diff --git a/.clang-format b/.clang-format new file mode 100644 index 000000000..2c827e4ef --- /dev/null +++ b/.clang-format @@ -0,0 +1,97 @@ +--- +Language: Cpp +# BasedOnStyle: Google +# More info: http://clang.llvm.org/docs/ClangFormatStyleOptions.html +AccessModifierOffset: -4 +AlignAfterOpenBracket: DontAlign +AlignConsecutiveAssignments: false +AlignConsecutiveDeclarations: false +AlignEscapedNewlinesLeft: true +AlignOperands: true +AlignTrailingComments: true +AllowAllParametersOfDeclarationOnNextLine: true +AllowShortBlocksOnASingleLine: false +AllowShortCaseLabelsOnASingleLine: false +AllowShortFunctionsOnASingleLine: All +AllowShortIfStatementsOnASingleLine: true +AllowShortLoopsOnASingleLine: true +AlwaysBreakAfterDefinitionReturnType: None +AlwaysBreakAfterReturnType: None +AlwaysBreakBeforeMultilineStrings: true +AlwaysBreakTemplateDeclarations: false +BinPackArguments: true +BinPackParameters: true +BraceWrapping: + AfterClass: false + AfterControlStatement: false + AfterEnum: false + AfterFunction: false + AfterNamespace: false + AfterObjCDeclaration: false + AfterStruct: false + AfterUnion: false + BeforeCatch: false + BeforeElse: false + IndentBraces: false +BreakBeforeBinaryOperators: None +BreakBeforeBraces: GNU +BreakBeforeTernaryOperators: true +BreakConstructorInitializersBeforeComma: false +BreakAfterJavaFieldAnnotations: false +BreakStringLiterals: true +ColumnLimit: 0 +CommentPragmas: '^ IWYU pragma:' +ConstructorInitializerAllOnOneLineOrOnePerLine: true +ConstructorInitializerIndentWidth: 4 +ContinuationIndentWidth: 4 +Cpp11BracedListStyle: true +DerivePointerAlignment: true +DisableFormat: false +ExperimentalAutoDetectBinPacking: false +ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ] +IncludeCategories: + - Regex: '^<.*\.h>' + Priority: 1 + - Regex: '^<.*' + Priority: 2 + - Regex: '.*' + Priority: 3 +IncludeIsMainRegex: '([-_](test|unittest))?$' +IndentCaseLabels: false +IndentWidth: 4 +IndentWrappedFunctionNames: false +JavaScriptQuotes: Leave +JavaScriptWrapImports: true +KeepEmptyLinesAtTheStartOfBlocks: false +MacroBlockBegin: '' +MacroBlockEnd: '' +MaxEmptyLinesToKeep: 2 +NamespaceIndentation: None +ObjCBlockIndentWidth: 2 +ObjCSpaceAfterProperty: false +ObjCSpaceBeforeProtocolList: false +PenaltyBreakBeforeFirstCallParameter: 1 +PenaltyBreakComment: 300 +PenaltyBreakFirstLessLess: 120 +PenaltyBreakString: 1000 +PenaltyExcessCharacter: 1000000 +PenaltyReturnTypeOnItsOwnLine: 200 +PointerAlignment: Left +ReflowComments: true +SortIncludes: false +SpaceAfterCStyleCast: false +SpaceAfterTemplateKeyword: true +SpaceBeforeAssignmentOperators: true +SpaceBeforeParens: ControlStatements +SpaceInEmptyParentheses: false +SpacesBeforeTrailingComments: 2 +SpacesInAngles: false +SpacesInContainerLiterals: true +SpacesInCStyleCastParentheses: false +SpacesInParentheses: false +SpacesInSquareBrackets: false +Standard: Auto +TabWidth: 8 +UseTab: Never +... + diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 12cc1328f..8af901f52 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -128,6 +128,8 @@ $ git pull --rebase upstream next ### How to submit a pull request +Before submitting you code, please be sure to [apply clang-format](http://gnss-sdr.org/coding-style/#use-tools-for-automated-code-formatting). + When the contribution is ready, you can [submit a pull request](https://github.com/gnss-sdr/gnss-sdr/compare/). Head to your GitHub repository, switch to your `my_feature` branch, and click the diff --git a/README.md b/README.md index 4e5c946a2..2a7b6d821 100644 --- a/README.md +++ b/README.md @@ -84,7 +84,7 @@ $ sudo yum install make automake gcc gcc-c++ kernel-devel cmake git boost-devel boost-date-time boost-system boost-filesystem boost-thread boost-chrono \ boost-serialization log4cpp-devel gnuradio-devel gr-osmosdr-devel \ blas-devel lapack-devel matio-devel armadillo-devel gflags-devel \ - glog-devel gnutls-devel openssl-devel python-mako python-six + glog-devel openssl-devel python-mako python-six ~~~~~~ Once you have installed these packages, you can jump directly to [download the source code and build GNSS-SDR](#download-and-build-linux). @@ -101,7 +101,7 @@ $ sudo yum install make automake gcc gcc-c++ kernel-devel libtool \ hdf5-devel cmake git boost-devel boost-date-time boost-system \ boost-filesystem boost-thread boost-chrono boost-serialization \ log4cpp-devel gnuradio-devel gr-osmosdr-devel blas-devel lapack-devel \ - armadillo-devel gnutls-devel openssl-devel python-mako python-six + armadillo-devel openssl-devel python-mako python-six ~~~~~~ Once you have installed these packages, you can jump directly to [download the source code and build GNSS-SDR](#download-and-build-linux). @@ -244,11 +244,11 @@ changing `/home/username/googletest-release-1.8.0/googletest` by the actual dire -#### Install the [GnuTLS library](http://www.gnutls.org/ "GnuTLS's Homepage"): +#### Install the [GnuTLS](http://www.gnutls.org/ "GnuTLS's Homepage") or [OpenSSL](https://www.openssl.org/ "OpenSSL's Homepage") libraries: ~~~~~~ $ sudo apt-get install libgnutls-openssl-dev # For Debian/Ubuntu/LinuxMint -$ sudo yum install libgnutls-openssl-devel # For Fedora/CentOS/RHEL +$ sudo yum install openssl-devel # For Fedora/CentOS/RHEL ~~~~~~ In case the GnuTLS library with openssl extensions package is not available in your GNU/Linux distribution, GNSS-SDR can also work well with OpenSSL. diff --git a/docs/PULL_REQUEST_TEMPLATE.md b/docs/PULL_REQUEST_TEMPLATE.md index b4e04e2c1..bb69db911 100644 --- a/docs/PULL_REQUEST_TEMPLATE.md +++ b/docs/PULL_REQUEST_TEMPLATE.md @@ -5,7 +5,8 @@ Before submitting your pull request, please make sure the following is done: 2. If you are a first-time contributor, after your pull request you will be asked to sign an Individual Contributor License Agreement ([CLA](https://en.wikipedia.org/wiki/Contributor_License_Agreement)) before your code gets accepted into `master`. This license is for your protection as a Contributor as well as for the protection of [CTTC](http://www.cttc.es/); it does not change your rights to use your own contributions for any other purpose. Except for the license granted therein to CTTC and recipients of software distributed by CTTC, you reserve all right, title, and interest in and to your contributions. The information you provide in that CLA will be maintained in accordance with [CTTC's privacy policy](http://www.cttc.es/privacy/). 3. You have read the [Contributing Guidelines](https://github.com/gnss-sdr/gnss-sdr/blob/master/CONTRIBUTING.md). 4. You have read the [coding style guide](http://gnss-sdr.org/coding-style/). - 5. You have forked the [gnss-sdr upstream repository](https://github.com/gnss-sdr/gnss-sdr) and have created your branch from `next` (or any other currently living branch in the upstream repository). - 6. Please include a description of your changes here. + 5. Specifically, you have read [about clang-format](http://gnss-sdr.org/coding-style/#use-tools-for-automated-code-formatting) and you have applied it. + 6. You have forked the [gnss-sdr upstream repository](https://github.com/gnss-sdr/gnss-sdr) and have created your branch from `next` (or any other currently living branch in the upstream repository). + 7. Please include a description of your changes here. **Please feel free to delete this line and the above text once you have read it and in case you want to go on with your pull request.** \ No newline at end of file diff --git a/src/algorithms/PVT/adapters/rtklib_pvt.cc b/src/algorithms/PVT/adapters/rtklib_pvt.cc index 1ba2bd509..f9bcc37d9 100644 --- a/src/algorithms/PVT/adapters/rtklib_pvt.cc +++ b/src/algorithms/PVT/adapters/rtklib_pvt.cc @@ -42,12 +42,11 @@ using google::LogMessage; RtklibPvt::RtklibPvt(ConfigurationInterface* configuration, - std::string role, - unsigned int in_streams, - unsigned int out_streams) : - role_(role), - in_streams_(in_streams), - out_streams_(out_streams) + std::string role, + unsigned int in_streams, + unsigned int out_streams) : role_(role), + in_streams_(in_streams), + out_streams_(out_streams) { // dump parameters std::string default_dump_filename = "./pvt.dat"; @@ -71,27 +70,27 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration, // RINEX version int rinex_version = configuration->property(role + ".rinex_version", 3); - if ( FLAGS_RINEX_version.compare("3.01") == 0 ) + if (FLAGS_RINEX_version.compare("3.01") == 0) { rinex_version = 3; } - else if ( FLAGS_RINEX_version.compare("3.02") == 0 ) + else if (FLAGS_RINEX_version.compare("3.02") == 0) { rinex_version = 3; } - else if ( FLAGS_RINEX_version.compare("3") == 0 ) + else if (FLAGS_RINEX_version.compare("3") == 0) { rinex_version = 3; } - else if ( FLAGS_RINEX_version.compare("2.11") == 0 ) + else if (FLAGS_RINEX_version.compare("2.11") == 0) { rinex_version = 2; } - else if ( FLAGS_RINEX_version.compare("2.10") == 0 ) + else if (FLAGS_RINEX_version.compare("2.10") == 0) { rinex_version = 2; } - else if ( FLAGS_RINEX_version.compare("2") == 0 ) + else if (FLAGS_RINEX_version.compare("2") == 0) { rinex_version = 2; } @@ -110,19 +109,19 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration, int rtcm_MT1077_rate_ms = boost::math::lcm(configuration->property(role + ".rtcm_MT1077_rate_ms", rtcm_MSM_rate_ms), output_rate_ms); int rtcm_MT1087_rate_ms = boost::math::lcm(configuration->property(role + ".rtcm_MT1087_rate_ms", rtcm_MSM_rate_ms), output_rate_ms); int rtcm_MT1097_rate_ms = boost::math::lcm(configuration->property(role + ".rtcm_MT1097_rate_ms", rtcm_MSM_rate_ms), output_rate_ms); - std::map rtcm_msg_rate_ms; + std::map rtcm_msg_rate_ms; rtcm_msg_rate_ms[1019] = rtcm_MT1019_rate_ms; rtcm_msg_rate_ms[1020] = rtcm_MT1020_rate_ms; rtcm_msg_rate_ms[1045] = rtcm_MT1045_rate_ms; - for (int k = 1071; k < 1078; k++) // All GPS MSM + for (int k = 1071; k < 1078; k++) // All GPS MSM { rtcm_msg_rate_ms[k] = rtcm_MT1077_rate_ms; } - for (int k = 1081; k < 1088; k++) // All GLONASS MSM + for (int k = 1081; k < 1088; k++) // All GLONASS MSM { rtcm_msg_rate_ms[k] = rtcm_MT1087_rate_ms; } - for (int k = 1091; k < 1098; k++) // All Galileo MSM + for (int k = 1091; k < 1098; k++) // All Galileo MSM { rtcm_msg_rate_ms[k] = rtcm_MT1097_rate_ms; } @@ -184,47 +183,47 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration, // *******************WARNING!!!!!!!*********** // GPS L5 only configurable for single frequency, single system at the moment!!!!!! - if( (gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0)) type_of_receiver = 1; - if( (gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0)) type_of_receiver = 2; - if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count != 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0)) type_of_receiver = 3; - if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0)) type_of_receiver = 4; - if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0)) type_of_receiver = 5; - if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count != 0) && (glo_1G_count == 0)) type_of_receiver = 6; + if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0)) type_of_receiver = 1; + if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0)) type_of_receiver = 2; + if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count != 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0)) type_of_receiver = 3; + if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0)) type_of_receiver = 4; + if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0)) type_of_receiver = 5; + if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count != 0) && (glo_1G_count == 0)) type_of_receiver = 6; - if( (gps_1C_count != 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0)) type_of_receiver = 7; + if ((gps_1C_count != 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0)) type_of_receiver = 7; //if( (gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0)) type_of_receiver = 8; - if( (gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0)) type_of_receiver = 9; - if( (gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0)) type_of_receiver = 10; - if( (gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count != 0) && (glo_1G_count == 0)) type_of_receiver = 11; - if( (gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0)) type_of_receiver = 12; + if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0)) type_of_receiver = 9; + if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0)) type_of_receiver = 10; + if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count != 0) && (glo_1G_count == 0)) type_of_receiver = 11; + if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0)) type_of_receiver = 12; //if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0)) type_of_receiver = 13; - if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0)) type_of_receiver = 14; - if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count != 0) && (glo_1G_count == 0)) type_of_receiver = 15; + if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0)) type_of_receiver = 14; + if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count != 0) && (glo_1G_count == 0)) type_of_receiver = 15; //if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0)) type_of_receiver = 16; - if( (gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0)) type_of_receiver = 17; - if( (gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count != 0) && (glo_1G_count == 0)) type_of_receiver = 18; + if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0)) type_of_receiver = 17; + if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count != 0) && (glo_1G_count == 0)) type_of_receiver = 18; //if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0)) type_of_receiver = 19; //if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0)) type_of_receiver = 20; - if( (gps_1C_count != 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0)) type_of_receiver = 21; + if ((gps_1C_count != 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0)) type_of_receiver = 21; //if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count = 0)) type_of_receiver = 22; - if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0)) type_of_receiver = 23; + if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0)) type_of_receiver = 23; //if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2R_count != 0)) type_of_receiver = 24; //if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0) && (glo_1G_count != 0)) type_of_receiver = 25; - if( (gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0)) type_of_receiver = 26; - if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0)) type_of_receiver = 27; - if( (gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0)) type_of_receiver = 28; + if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0)) type_of_receiver = 26; + if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0)) type_of_receiver = 27; + if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0)) type_of_receiver = 28; //RTKLIB PVT solver options // Settings 1 int positioning_mode = -1; std::string default_pos_mode("Single"); - std::string positioning_mode_str = configuration->property(role + ".positioning_mode", default_pos_mode); /* (PMODE_XXX) see src/algorithms/libs/rtklib/rtklib.h */ - if(positioning_mode_str.compare("Single") == 0) positioning_mode = PMODE_SINGLE; - if(positioning_mode_str.compare("Static") == 0) positioning_mode = PMODE_STATIC; - if(positioning_mode_str.compare("Kinematic") == 0) positioning_mode = PMODE_KINEMA; - if(positioning_mode_str.compare("PPP_Static") == 0) positioning_mode = PMODE_PPP_STATIC; - if(positioning_mode_str.compare("PPP_Kinematic") == 0) positioning_mode = PMODE_PPP_KINEMA; + std::string positioning_mode_str = configuration->property(role + ".positioning_mode", default_pos_mode); /* (PMODE_XXX) see src/algorithms/libs/rtklib/rtklib.h */ + if (positioning_mode_str.compare("Single") == 0) positioning_mode = PMODE_SINGLE; + if (positioning_mode_str.compare("Static") == 0) positioning_mode = PMODE_STATIC; + if (positioning_mode_str.compare("Kinematic") == 0) positioning_mode = PMODE_KINEMA; + if (positioning_mode_str.compare("PPP_Static") == 0) positioning_mode = PMODE_PPP_STATIC; + if (positioning_mode_str.compare("PPP_Kinematic") == 0) positioning_mode = PMODE_PPP_KINEMA; - if( positioning_mode == -1 ) + if (positioning_mode == -1) { //warn user and set the default std::cout << "WARNING: Bad specification of positioning mode." << std::endl; @@ -237,19 +236,19 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration, int num_bands = 0; if ((gps_1C_count > 0) || (gal_1B_count > 0) || (glo_1G_count > 0)) num_bands = 1; - if (((gps_1C_count > 0) || (gal_1B_count > 0) || (glo_1G_count > 0)) && (gps_2S_count > 0) ) num_bands = 2; - if (((gps_1C_count > 0) || (gal_1B_count > 0) || (glo_1G_count > 0)) && ((gal_E5a_count > 0) || (gal_E5b_count > 0) || (gps_L5_count > 0))) num_bands = 2; + if (((gps_1C_count > 0) || (gal_1B_count > 0) || (glo_1G_count > 0)) && (gps_2S_count > 0)) num_bands = 2; + if (((gps_1C_count > 0) || (gal_1B_count > 0) || (glo_1G_count > 0)) && ((gal_E5a_count > 0) || (gal_E5b_count > 0) || (gps_L5_count > 0))) num_bands = 2; if (((gps_1C_count > 0) || (gal_1B_count > 0) || (glo_1G_count > 0)) && (gps_2S_count > 0) && ((gal_E5a_count > 0) || (gal_E5b_count > 0) || (gps_L5_count > 0))) num_bands = 3; int number_of_frequencies = configuration->property(role + ".num_bands", num_bands); /* (1:L1, 2:L1+L2, 3:L1+L2+L5) */ - if( (number_of_frequencies < 1) || (number_of_frequencies > 3) ) + if ((number_of_frequencies < 1) || (number_of_frequencies > 3)) { //warn user and set the default number_of_frequencies = num_bands; } double elevation_mask = configuration->property(role + ".elevation_mask", 15.0); - if( (elevation_mask < 0.0) || (elevation_mask > 90.0) ) + if ((elevation_mask < 0.0) || (elevation_mask > 90.0)) { //warn user and set the default LOG(WARNING) << "Erroneous Elevation Mask. Setting to default value of 15.0 degrees"; @@ -257,7 +256,7 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration, } int dynamics_model = configuration->property(role + ".dynamics_model", 0); /* dynamics model (0:none, 1:velocity, 2:accel) */ - if( (dynamics_model < 0) || (dynamics_model > 2) ) + if ((dynamics_model < 0) || (dynamics_model > 2)) { //warn user and set the default LOG(WARNING) << "Erroneous Dynamics Model configuration. Setting to default value of (0:none)"; @@ -267,13 +266,13 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration, std::string default_iono_model("OFF"); std::string iono_model_str = configuration->property(role + ".iono_model", default_iono_model); /* (IONOOPT_XXX) see src/algorithms/libs/rtklib/rtklib.h */ int iono_model = -1; - if(iono_model_str.compare("OFF") == 0) iono_model = IONOOPT_OFF; - if(iono_model_str.compare("Broadcast") == 0) iono_model = IONOOPT_BRDC; - if(iono_model_str.compare("SBAS") == 0) iono_model = IONOOPT_SBAS; - if(iono_model_str.compare("Iono-Free-LC") == 0) iono_model = IONOOPT_IFLC; - if(iono_model_str.compare("Estimate_STEC") == 0) iono_model = IONOOPT_EST; - if(iono_model_str.compare("IONEX") == 0) iono_model = IONOOPT_TEC; - if( iono_model == -1 ) + if (iono_model_str.compare("OFF") == 0) iono_model = IONOOPT_OFF; + if (iono_model_str.compare("Broadcast") == 0) iono_model = IONOOPT_BRDC; + if (iono_model_str.compare("SBAS") == 0) iono_model = IONOOPT_SBAS; + if (iono_model_str.compare("Iono-Free-LC") == 0) iono_model = IONOOPT_IFLC; + if (iono_model_str.compare("Estimate_STEC") == 0) iono_model = IONOOPT_EST; + if (iono_model_str.compare("IONEX") == 0) iono_model = IONOOPT_TEC; + if (iono_model == -1) { //warn user and set the default std::cout << "WARNING: Bad specification of ionospheric model." << std::endl; @@ -286,12 +285,12 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration, std::string default_trop_model("OFF"); int trop_model = -1; std::string trop_model_str = configuration->property(role + ".trop_model", default_trop_model); /* (TROPOPT_XXX) see src/algorithms/libs/rtklib/rtklib.h */ - if(trop_model_str.compare("OFF") == 0) trop_model = TROPOPT_OFF; - if(trop_model_str.compare("Saastamoinen") == 0) trop_model = TROPOPT_SAAS; - if(trop_model_str.compare("SBAS") == 0) trop_model = TROPOPT_SBAS; - if(trop_model_str.compare("Estimate_ZTD") == 0) trop_model = TROPOPT_EST; - if(trop_model_str.compare("Estimate_ZTD_Grad") == 0) trop_model = TROPOPT_ESTG; - if( trop_model == -1 ) + if (trop_model_str.compare("OFF") == 0) trop_model = TROPOPT_OFF; + if (trop_model_str.compare("Saastamoinen") == 0) trop_model = TROPOPT_SAAS; + if (trop_model_str.compare("SBAS") == 0) trop_model = TROPOPT_SBAS; + if (trop_model_str.compare("Estimate_ZTD") == 0) trop_model = TROPOPT_EST; + if (trop_model_str.compare("Estimate_ZTD_Grad") == 0) trop_model = TROPOPT_ESTG; + if (trop_model == -1) { //warn user and set the default std::cout << "WARNING: Bad specification of tropospheric model." << std::endl; @@ -323,8 +322,8 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration, if ((gps_1C_count > 0) || (gps_2S_count > 0) || (gps_L5_count > 0)) nsys += SYS_GPS; if ((gal_1B_count > 0) || (gal_E5a_count > 0) || (gal_E5b_count > 0)) nsys += SYS_GAL; if ((glo_1G_count > 0)) nsys += SYS_GLO; - int navigation_system = configuration->property(role + ".navigation_system", nsys); /* (SYS_XXX) see src/algorithms/libs/rtklib/rtklib.h */ - if( (navigation_system < 1) || (navigation_system > 255) ) /* GPS: 1 SBAS: 2 GPS+SBAS: 3 Galileo: 8 Galileo+GPS: 9 GPS+SBAS+Galileo: 11 All: 255 */ + int navigation_system = configuration->property(role + ".navigation_system", nsys); /* (SYS_XXX) see src/algorithms/libs/rtklib/rtklib.h */ + if ((navigation_system < 1) || (navigation_system > 255)) /* GPS: 1 SBAS: 2 GPS+SBAS: 3 Galileo: 8 Galileo+GPS: 9 GPS+SBAS+Galileo: 11 All: 255 */ { //warn user and set the default LOG(WARNING) << "Erroneous Navigation System. Setting to default value of (0:none)"; @@ -335,12 +334,12 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration, std::string default_gps_ar("Continuous"); std::string integer_ambiguity_resolution_gps_str = configuration->property(role + ".AR_GPS", default_gps_ar); /* Integer Ambiguity Resolution mode for GPS (0:off,1:continuous,2:instantaneous,3:fix and hold,4:ppp-ar) */ int integer_ambiguity_resolution_gps = -1; - if(integer_ambiguity_resolution_gps_str.compare("OFF") == 0) integer_ambiguity_resolution_gps = ARMODE_OFF; - if(integer_ambiguity_resolution_gps_str.compare("Continuous") == 0) integer_ambiguity_resolution_gps = ARMODE_CONT; - if(integer_ambiguity_resolution_gps_str.compare("Instantaneous") == 0) integer_ambiguity_resolution_gps = ARMODE_INST; - if(integer_ambiguity_resolution_gps_str.compare("Fix-and-Hold") == 0) integer_ambiguity_resolution_gps = ARMODE_FIXHOLD; - if(integer_ambiguity_resolution_gps_str.compare("PPP-AR") == 0) integer_ambiguity_resolution_gps = ARMODE_PPPAR; - if( integer_ambiguity_resolution_gps == -1 ) + if (integer_ambiguity_resolution_gps_str.compare("OFF") == 0) integer_ambiguity_resolution_gps = ARMODE_OFF; + if (integer_ambiguity_resolution_gps_str.compare("Continuous") == 0) integer_ambiguity_resolution_gps = ARMODE_CONT; + if (integer_ambiguity_resolution_gps_str.compare("Instantaneous") == 0) integer_ambiguity_resolution_gps = ARMODE_INST; + if (integer_ambiguity_resolution_gps_str.compare("Fix-and-Hold") == 0) integer_ambiguity_resolution_gps = ARMODE_FIXHOLD; + if (integer_ambiguity_resolution_gps_str.compare("PPP-AR") == 0) integer_ambiguity_resolution_gps = ARMODE_PPPAR; + if (integer_ambiguity_resolution_gps == -1) { //warn user and set the default std::cout << "WARNING: Bad specification of GPS ambiguity resolution method." << std::endl; @@ -351,7 +350,7 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration, } int integer_ambiguity_resolution_glo = configuration->property(role + ".AR_GLO", 1); /* Integer Ambiguity Resolution mode for GLONASS (0:off,1:on,2:auto cal,3:ext cal) */ - if( (integer_ambiguity_resolution_glo < 0) || (integer_ambiguity_resolution_glo > 3) ) + if ((integer_ambiguity_resolution_glo < 0) || (integer_ambiguity_resolution_glo > 3)) { //warn user and set the default LOG(WARNING) << "Erroneous Integer Ambiguity Resolution for GLONASS . Setting to default value of (1:on)"; @@ -359,7 +358,7 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration, } int integer_ambiguity_resolution_bds = configuration->property(role + ".AR_DBS", 1); /* Integer Ambiguity Resolution mode for BEIDOU (0:off,1:on) */ - if( (integer_ambiguity_resolution_bds < 0) || (integer_ambiguity_resolution_bds > 1) ) + if ((integer_ambiguity_resolution_bds < 0) || (integer_ambiguity_resolution_bds > 1)) { //warn user and set the default LOG(WARNING) << "Erroneous Integer Ambiguity Resolution for BEIDOU . Setting to default value of (1:on)"; @@ -369,13 +368,13 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration, double min_ratio_to_fix_ambiguity = configuration->property(role + ".min_ratio_to_fix_ambiguity", 3.0); /* Set the integer ambiguity validation threshold for ratio‐test, which uses the ratio of squared residuals of the best integer vector to the second‐best vector. */ - int min_lock_to_fix_ambiguity = configuration->property(role + ".min_lock_to_fix_ambiguity", 0); /* Set the minimum lock count to fix integer ambiguity. + int min_lock_to_fix_ambiguity = configuration->property(role + ".min_lock_to_fix_ambiguity", 0); /* Set the minimum lock count to fix integer ambiguity. If the lock count is less than the value, the ambiguity is excluded from the fixed integer vector. */ - double min_elevation_to_fix_ambiguity = configuration->property(role + ".min_elevation_to_fix_ambiguity", 0.0); /* Set the minimum elevation (deg) to fix integer ambiguity. + double min_elevation_to_fix_ambiguity = configuration->property(role + ".min_elevation_to_fix_ambiguity", 0.0); /* Set the minimum elevation (deg) to fix integer ambiguity. If the elevation of the satellite is less than the value, the ambiguity is excluded from the fixed integer vector. */ - int outage_reset_ambiguity = configuration->property(role + ".outage_reset_ambiguity", 5); /* Set the outage count to reset ambiguity. If the data outage count is over the value, the estimated ambiguity is reset to the initial value. */ + int outage_reset_ambiguity = configuration->property(role + ".outage_reset_ambiguity", 5); /* Set the outage count to reset ambiguity. If the data outage count is over the value, the estimated ambiguity is reset to the initial value. */ double slip_threshold = configuration->property(role + ".slip_threshold", 0.05); /* set the cycle‐slip threshold (m) of geometry‐free LC carrier‐phase difference between epochs */ @@ -404,7 +403,7 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration, double sigma_acch = configuration->property(role + ".sigma_acch", 1e-1); /* Set the process noise standard deviation of the receiver acceleration as the horizontal component. (m/s2/sqrt(s)). If Receiver Dynamics is set to OFF, they are not used. */ - double sigma_accv = configuration->property(role + ".sigma_accv", 1e-2); /* Set the process noise standard deviation of the receiver acceleration as + double sigma_accv = configuration->property(role + ".sigma_accv", 1e-2); /* Set the process noise standard deviation of the receiver acceleration as the vertical component. (m/s2/sqrt(s)). If Receiver Dynamics is set to OFF, they are not used. */ double sigma_pos = configuration->property(role + ".sigma_pos", 0.0); @@ -415,70 +414,71 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration, double carrier_phase_error_factor_a = configuration->property(role + ".carrier_phase_error_factor_a", 0.003); double carrier_phase_error_factor_b = configuration->property(role + ".carrier_phase_error_factor_b", 0.003); - snrmask_t snrmask = { {}, {{},{}} }; + snrmask_t snrmask = {{}, {{}, {}}}; - prcopt_t rtklib_configuration_options = {positioning_mode, /* positioning mode (PMODE_XXX) see src/algorithms/libs/rtklib/rtklib.h */ - 0, /* solution type (0:forward,1:backward,2:combined) */ - number_of_frequencies, /* number of frequencies (1:L1, 2:L1+L2, 3:L1+L2+L5)*/ - navigation_system, /* navigation system */ - elevation_mask * D2R, /* elevation mask angle (degrees) */ - snrmask, /* snrmask_t snrmask SNR mask */ - 0, /* satellite ephemeris/clock (EPHOPT_XXX) */ - integer_ambiguity_resolution_gps, /* AR mode (0:off,1:continuous,2:instantaneous,3:fix and hold,4:ppp-ar) */ - integer_ambiguity_resolution_glo, /* GLONASS AR mode (0:off,1:on,2:auto cal,3:ext cal) */ - integer_ambiguity_resolution_bds, /* BeiDou AR mode (0:off,1:on) */ - outage_reset_ambiguity, /* obs outage count to reset bias */ - min_lock_to_fix_ambiguity, /* min lock count to fix ambiguity */ - 10, /* min fix count to hold ambiguity */ - 1, /* max iteration to resolve ambiguity */ - iono_model, /* ionosphere option (IONOOPT_XXX) */ - trop_model, /* troposphere option (TROPOPT_XXX) */ - dynamics_model, /* dynamics model (0:none, 1:velocity, 2:accel) */ - earth_tide, /* earth tide correction (0:off,1:solid,2:solid+otl+pole) */ - number_filter_iter, /* number of filter iteration */ - 0, /* code smoothing window size (0:none) */ - 0, /* interpolate reference obs (for post mission) */ - 0, /* sbssat_t sbssat SBAS correction options */ - 0, /* sbsion_t sbsion[MAXBAND+1] SBAS satellite selection (0:all) */ - 0, /* rover position for fixed mode */ - 0, /* base position for relative mode */ - /* 0:pos in prcopt, 1:average of single pos, */ - /* 2:read from file, 3:rinex header, 4:rtcm pos */ - {code_phase_error_ratio_l1,code_phase_error_ratio_l2,code_phase_error_ratio_l5}, /* eratio[NFREQ] code/phase error ratio */ - {100.0,carrier_phase_error_factor_a,carrier_phase_error_factor_b,0.0,1.0}, /* err[5]: measurement error factor [0]:reserved, [1-3]:error factor a/b/c of phase (m) , [4]:doppler frequency (hz) */ - {bias_0,iono_0,trop_0}, /* std[3]: initial-state std [0]bias,[1]iono [2]trop*/ - {sigma_bias,sigma_iono,sigma_trop,sigma_acch,sigma_accv,sigma_pos}, /* prn[6] process-noise std */ - 5e-12, /* sclkstab: satellite clock stability (sec/sec) */ - {min_ratio_to_fix_ambiguity,0.9999,0.25,0.1,0.05,0.0,0.0,0.0}, /* thresar[8]: AR validation threshold */ - min_elevation_to_fix_ambiguity, /* elevation mask of AR for rising satellite (deg) */ - 0.0, /* elevation mask to hold ambiguity (deg) */ - slip_threshold, /* slip threshold of geometry-free phase (m) */ - 30.0, /* max difference of time (sec) */ - threshold_reject_innovation, /* reject threshold of innovation (m) */ - threshold_reject_gdop, /* reject threshold of gdop */ - {}, /* double baseline[2] baseline length constraint {const,sigma} (m) */ - {}, /* double ru[3] rover position for fixed mode {x,y,z} (ecef) (m) */ - {}, /* double rb[3] base position for relative mode {x,y,z} (ecef) (m) */ - {"",""}, /* char anttype[2][MAXANT] antenna types {rover,base} */ - {{},{}}, /* double antdel[2][3] antenna delta {{rov_e,rov_n,rov_u},{ref_e,ref_n,ref_u}} */ - {}, /* pcv_t pcvr[2] receiver antenna parameters {rov,base} */ - {}, /* unsigned char exsats[MAXSAT] excluded satellites (1:excluded, 2:included) */ - 0, /* max averaging epoches */ - 0, /* initialize by restart */ - 1, /* output single by dgps/float/fix/ppp outage */ - {"",""}, /* char rnxopt[2][256] rinex options {rover,base} */ - {sat_PCV,rec_PCV,phwindup,reject_GPS_IIA,raim_fde}, /* posopt[6] positioning options [0]: satellite and receiver antenna PCV model; [1]: interpolate antenna parameters; [2]: apply phase wind-up correction for PPP modes; [3]: exclude measurements of GPS Block IIA satellites satellite [4]: RAIM FDE (fault detection and exclusion) [5]: handle day-boundary clock jump */ - 0, /* solution sync mode (0:off,1:on) */ - {{},{}}, /* odisp[2][6*11] ocean tide loading parameters {rov,base} */ - { {}, {{},{}}, {{},{}}, {}, {} }, /* exterr_t exterr extended receiver error model */ - 0, /* disable L2-AR */ - {} /* char pppopt[256] ppp option "-GAP_RESION=" default gap to reset iono parameters (ep) */ + prcopt_t rtklib_configuration_options = { + positioning_mode, /* positioning mode (PMODE_XXX) see src/algorithms/libs/rtklib/rtklib.h */ + 0, /* solution type (0:forward,1:backward,2:combined) */ + number_of_frequencies, /* number of frequencies (1:L1, 2:L1+L2, 3:L1+L2+L5)*/ + navigation_system, /* navigation system */ + elevation_mask * D2R, /* elevation mask angle (degrees) */ + snrmask, /* snrmask_t snrmask SNR mask */ + 0, /* satellite ephemeris/clock (EPHOPT_XXX) */ + integer_ambiguity_resolution_gps, /* AR mode (0:off,1:continuous,2:instantaneous,3:fix and hold,4:ppp-ar) */ + integer_ambiguity_resolution_glo, /* GLONASS AR mode (0:off,1:on,2:auto cal,3:ext cal) */ + integer_ambiguity_resolution_bds, /* BeiDou AR mode (0:off,1:on) */ + outage_reset_ambiguity, /* obs outage count to reset bias */ + min_lock_to_fix_ambiguity, /* min lock count to fix ambiguity */ + 10, /* min fix count to hold ambiguity */ + 1, /* max iteration to resolve ambiguity */ + iono_model, /* ionosphere option (IONOOPT_XXX) */ + trop_model, /* troposphere option (TROPOPT_XXX) */ + dynamics_model, /* dynamics model (0:none, 1:velocity, 2:accel) */ + earth_tide, /* earth tide correction (0:off,1:solid,2:solid+otl+pole) */ + number_filter_iter, /* number of filter iteration */ + 0, /* code smoothing window size (0:none) */ + 0, /* interpolate reference obs (for post mission) */ + 0, /* sbssat_t sbssat SBAS correction options */ + 0, /* sbsion_t sbsion[MAXBAND+1] SBAS satellite selection (0:all) */ + 0, /* rover position for fixed mode */ + 0, /* base position for relative mode */ + /* 0:pos in prcopt, 1:average of single pos, */ + /* 2:read from file, 3:rinex header, 4:rtcm pos */ + {code_phase_error_ratio_l1, code_phase_error_ratio_l2, code_phase_error_ratio_l5}, /* eratio[NFREQ] code/phase error ratio */ + {100.0, carrier_phase_error_factor_a, carrier_phase_error_factor_b, 0.0, 1.0}, /* err[5]: measurement error factor [0]:reserved, [1-3]:error factor a/b/c of phase (m) , [4]:doppler frequency (hz) */ + {bias_0, iono_0, trop_0}, /* std[3]: initial-state std [0]bias,[1]iono [2]trop*/ + {sigma_bias, sigma_iono, sigma_trop, sigma_acch, sigma_accv, sigma_pos}, /* prn[6] process-noise std */ + 5e-12, /* sclkstab: satellite clock stability (sec/sec) */ + {min_ratio_to_fix_ambiguity, 0.9999, 0.25, 0.1, 0.05, 0.0, 0.0, 0.0}, /* thresar[8]: AR validation threshold */ + min_elevation_to_fix_ambiguity, /* elevation mask of AR for rising satellite (deg) */ + 0.0, /* elevation mask to hold ambiguity (deg) */ + slip_threshold, /* slip threshold of geometry-free phase (m) */ + 30.0, /* max difference of time (sec) */ + threshold_reject_innovation, /* reject threshold of innovation (m) */ + threshold_reject_gdop, /* reject threshold of gdop */ + {}, /* double baseline[2] baseline length constraint {const,sigma} (m) */ + {}, /* double ru[3] rover position for fixed mode {x,y,z} (ecef) (m) */ + {}, /* double rb[3] base position for relative mode {x,y,z} (ecef) (m) */ + {"", ""}, /* char anttype[2][MAXANT] antenna types {rover,base} */ + {{}, {}}, /* double antdel[2][3] antenna delta {{rov_e,rov_n,rov_u},{ref_e,ref_n,ref_u}} */ + {}, /* pcv_t pcvr[2] receiver antenna parameters {rov,base} */ + {}, /* unsigned char exsats[MAXSAT] excluded satellites (1:excluded, 2:included) */ + 0, /* max averaging epoches */ + 0, /* initialize by restart */ + 1, /* output single by dgps/float/fix/ppp outage */ + {"", ""}, /* char rnxopt[2][256] rinex options {rover,base} */ + {sat_PCV, rec_PCV, phwindup, reject_GPS_IIA, raim_fde}, /* posopt[6] positioning options [0]: satellite and receiver antenna PCV model; [1]: interpolate antenna parameters; [2]: apply phase wind-up correction for PPP modes; [3]: exclude measurements of GPS Block IIA satellites satellite [4]: RAIM FDE (fault detection and exclusion) [5]: handle day-boundary clock jump */ + 0, /* solution sync mode (0:off,1:on) */ + {{}, {}}, /* odisp[2][6*11] ocean tide loading parameters {rov,base} */ + {{}, {{}, {}}, {{}, {}}, {}, {}}, /* exterr_t exterr extended receiver error model */ + 0, /* disable L2-AR */ + {} /* char pppopt[256] ppp option "-GAP_RESION=" default gap to reset iono parameters (ep) */ }; rtkinit(&rtk, &rtklib_configuration_options); // make PVT object - pvt_ = rtklib_make_pvt_cc(in_streams_, dump_, dump_filename_, output_rate_ms, display_rate_ms, flag_nmea_tty_port, nmea_dump_filename, nmea_dump_devname, rinex_version, flag_rtcm_server, flag_rtcm_tty_port, rtcm_tcp_port, rtcm_station_id, rtcm_msg_rate_ms, rtcm_dump_devname, type_of_receiver, rtk); + pvt_ = rtklib_make_pvt_cc(in_streams_, dump_, dump_filename_, output_rate_ms, display_rate_ms, flag_nmea_tty_port, nmea_dump_filename, nmea_dump_devname, rinex_version, flag_rtcm_server, flag_rtcm_tty_port, rtcm_tcp_port, rtcm_station_id, rtcm_msg_rate_ms, rtcm_dump_devname, type_of_receiver, rtk); DLOG(INFO) << "pvt(" << pvt_->unique_id() << ")"; } @@ -486,7 +486,7 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration, bool RtklibPvt::save_assistance_to_XML() { LOG(INFO) << "SUPL: Try to save GPS ephemeris to XML file " << eph_xml_filename_; - std::map eph_map = pvt_->get_GPS_L1_ephemeris_map(); + std::map eph_map = pvt_->get_GPS_L1_ephemeris_map(); if (eph_map.size() > 0) { @@ -498,12 +498,12 @@ bool RtklibPvt::save_assistance_to_XML() ofs.close(); LOG(INFO) << "Saved GPS L1 Ephemeris map data"; } - catch (const std::exception & e) + catch (const std::exception& e) { LOG(WARNING) << e.what(); return false; } - return true; // return variable (true == succeeded) + return true; // return variable (true == succeeded) } else { @@ -522,7 +522,9 @@ RtklibPvt::~RtklibPvt() void RtklibPvt::connect(gr::top_block_sptr top_block) { - if(top_block) { /* top_block is not null */}; + if (top_block) + { /* top_block is not null */ + }; // Nothing to connect internally DLOG(INFO) << "nothing to connect internally"; } @@ -530,7 +532,9 @@ void RtklibPvt::connect(gr::top_block_sptr top_block) void RtklibPvt::disconnect(gr::top_block_sptr top_block) { - if(top_block) { /* top_block is not null */}; + if (top_block) + { /* top_block is not null */ + }; // Nothing to disconnect } @@ -543,5 +547,5 @@ gr::basic_block_sptr RtklibPvt::get_left_block() gr::basic_block_sptr RtklibPvt::get_right_block() { - return pvt_; // this is a sink, nothing downstream + return pvt_; // this is a sink, nothing downstream } diff --git a/src/algorithms/PVT/adapters/rtklib_pvt.h b/src/algorithms/PVT/adapters/rtklib_pvt.h index f0b4238b4..1ae5808f5 100644 --- a/src/algorithms/PVT/adapters/rtklib_pvt.h +++ b/src/algorithms/PVT/adapters/rtklib_pvt.h @@ -29,7 +29,6 @@ */ - #ifndef GNSS_SDR_RTKLIB_PVT_H_ #define GNSS_SDR_RTKLIB_PVT_H_ @@ -47,9 +46,9 @@ class RtklibPvt : public PvtInterface { public: RtklibPvt(ConfigurationInterface* configuration, - std::string role, - unsigned int in_streams, - unsigned int out_streams); + std::string role, + unsigned int in_streams, + unsigned int out_streams); virtual ~RtklibPvt(); diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc index b800b0fc3..dc3afaf72 100644 --- a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc +++ b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc @@ -46,62 +46,62 @@ using google::LogMessage; rtklib_pvt_cc_sptr rtklib_make_pvt_cc(unsigned int nchannels, - bool dump, - std::string dump_filename, - int output_rate_ms, - int display_rate_ms, - bool flag_nmea_tty_port, - std::string nmea_dump_filename, - std::string nmea_dump_devname, - int rinex_version, - bool flag_rtcm_server, - bool flag_rtcm_tty_port, - unsigned short rtcm_tcp_port, - unsigned short rtcm_station_id, - std::map rtcm_msg_rate_ms, - std::string rtcm_dump_devname, - const unsigned int type_of_receiver, - rtk_t & rtk) + bool dump, + std::string dump_filename, + int output_rate_ms, + int display_rate_ms, + bool flag_nmea_tty_port, + std::string nmea_dump_filename, + std::string nmea_dump_devname, + int rinex_version, + bool flag_rtcm_server, + bool flag_rtcm_tty_port, + unsigned short rtcm_tcp_port, + unsigned short rtcm_station_id, + std::map rtcm_msg_rate_ms, + std::string rtcm_dump_devname, + const unsigned int type_of_receiver, + rtk_t& rtk) { return rtklib_pvt_cc_sptr(new rtklib_pvt_cc(nchannels, - dump, - dump_filename, - output_rate_ms, - display_rate_ms, - flag_nmea_tty_port, - nmea_dump_filename, - nmea_dump_devname, - rinex_version, - flag_rtcm_server, - flag_rtcm_tty_port, - rtcm_tcp_port, - rtcm_station_id, - rtcm_msg_rate_ms, - rtcm_dump_devname, - type_of_receiver, - rtk)); + dump, + dump_filename, + output_rate_ms, + display_rate_ms, + flag_nmea_tty_port, + nmea_dump_filename, + nmea_dump_devname, + rinex_version, + flag_rtcm_server, + flag_rtcm_tty_port, + rtcm_tcp_port, + rtcm_station_id, + rtcm_msg_rate_ms, + rtcm_dump_devname, + type_of_receiver, + rtk)); } void rtklib_pvt_cc::msg_handler_telemetry(pmt::pmt_t msg) { try - { + { //************* GPS telemetry ***************** - if( pmt::any_ref(msg).type() == typeid(std::shared_ptr) ) + if (pmt::any_ref(msg).type() == typeid(std::shared_ptr)) { // ### GPS EPHEMERIS ### std::shared_ptr gps_eph; gps_eph = boost::any_cast>(pmt::any_ref(msg)); DLOG(INFO) << "Ephemeris record has arrived from SAT ID " << gps_eph->i_satellite_PRN << " (Block " - << gps_eph->satelliteBlock[gps_eph->i_satellite_PRN] << ")" - << "inserted with Toe="<< gps_eph->d_Toe<<" and GPS Week=" + << gps_eph->satelliteBlock[gps_eph->i_satellite_PRN] << ")" + << "inserted with Toe=" << gps_eph->d_Toe << " and GPS Week=" << gps_eph->i_GPS_week; // update/insert new ephemeris record to the global ephemeris map d_ls_pvt->gps_ephemeris_map[gps_eph->i_satellite_PRN] = *gps_eph; } - else if(pmt::any_ref(msg).type() == typeid(std::shared_ptr) ) + else if (pmt::any_ref(msg).type() == typeid(std::shared_ptr)) { // ### GPS IONO ### std::shared_ptr gps_iono; @@ -109,7 +109,7 @@ void rtklib_pvt_cc::msg_handler_telemetry(pmt::pmt_t msg) d_ls_pvt->gps_iono = *gps_iono; DLOG(INFO) << "New IONO record has arrived "; } - else if(pmt::any_ref(msg).type() == typeid(std::shared_ptr) ) + else if (pmt::any_ref(msg).type() == typeid(std::shared_ptr)) { // ### GPS UTC MODEL ### std::shared_ptr gps_utc_model; @@ -117,7 +117,7 @@ void rtklib_pvt_cc::msg_handler_telemetry(pmt::pmt_t msg) d_ls_pvt->gps_utc_model = *gps_utc_model; DLOG(INFO) << "New UTC record has arrived "; } - else if(pmt::any_ref(msg).type() == typeid(std::shared_ptr) ) + else if (pmt::any_ref(msg).type() == typeid(std::shared_ptr)) { // ### GPS CNAV message ### std::shared_ptr gps_cnav_ephemeris; @@ -126,7 +126,7 @@ void rtklib_pvt_cc::msg_handler_telemetry(pmt::pmt_t msg) d_ls_pvt->gps_cnav_ephemeris_map[gps_cnav_ephemeris->i_satellite_PRN] = *gps_cnav_ephemeris; DLOG(INFO) << "New GPS CNAV ephemeris record has arrived "; } - else if(pmt::any_ref(msg).type() == typeid(std::shared_ptr) ) + else if (pmt::any_ref(msg).type() == typeid(std::shared_ptr)) { // ### GPS CNAV IONO ### std::shared_ptr gps_cnav_iono; @@ -134,7 +134,7 @@ void rtklib_pvt_cc::msg_handler_telemetry(pmt::pmt_t msg) d_ls_pvt->gps_cnav_iono = *gps_cnav_iono; DLOG(INFO) << "New CNAV IONO record has arrived "; } - else if(pmt::any_ref(msg).type() == typeid(std::shared_ptr) ) + else if (pmt::any_ref(msg).type() == typeid(std::shared_ptr)) { // ### GPS CNAV UTC MODEL ### std::shared_ptr gps_cnav_utc_model; @@ -144,7 +144,7 @@ void rtklib_pvt_cc::msg_handler_telemetry(pmt::pmt_t msg) } //**************** Galileo telemetry ******************** - else if(pmt::any_ref(msg).type() == typeid(std::shared_ptr) ) + else if (pmt::any_ref(msg).type() == typeid(std::shared_ptr)) { // ### Galileo EPHEMERIS ### std::shared_ptr galileo_eph; @@ -156,7 +156,7 @@ void rtklib_pvt_cc::msg_handler_telemetry(pmt::pmt_t msg) // update/insert new ephemeris record to the global ephemeris map d_ls_pvt->galileo_ephemeris_map[galileo_eph->i_satellite_PRN] = *galileo_eph; } - else if(pmt::any_ref(msg).type() == typeid(std::shared_ptr) ) + else if (pmt::any_ref(msg).type() == typeid(std::shared_ptr)) { // ### Galileo IONO ### std::shared_ptr galileo_iono; @@ -164,7 +164,7 @@ void rtklib_pvt_cc::msg_handler_telemetry(pmt::pmt_t msg) d_ls_pvt->galileo_iono = *galileo_iono; DLOG(INFO) << "New IONO record has arrived "; } - else if(pmt::any_ref(msg).type() == typeid(std::shared_ptr) ) + else if (pmt::any_ref(msg).type() == typeid(std::shared_ptr)) { // ### Galileo UTC MODEL ### std::shared_ptr galileo_utc_model; @@ -172,7 +172,7 @@ void rtklib_pvt_cc::msg_handler_telemetry(pmt::pmt_t msg) d_ls_pvt->galileo_utc_model = *galileo_utc_model; DLOG(INFO) << "New UTC record has arrived "; } - else if(pmt::any_ref(msg).type() == typeid(std::shared_ptr) ) + else if (pmt::any_ref(msg).type() == typeid(std::shared_ptr)) { // ### Galileo Almanac ### std::shared_ptr galileo_almanac; @@ -183,7 +183,7 @@ void rtklib_pvt_cc::msg_handler_telemetry(pmt::pmt_t msg) } //**************** GLONASS GNAV Telemetry ************************** - else if(pmt::any_ref(msg).type() == typeid(std::shared_ptr) ) + else if (pmt::any_ref(msg).type() == typeid(std::shared_ptr)) { // ### GLONASS GNAV EPHEMERIS ### std::shared_ptr glonass_gnav_eph; @@ -197,7 +197,7 @@ void rtklib_pvt_cc::msg_handler_telemetry(pmt::pmt_t msg) // update/insert new ephemeris record to the global ephemeris map d_ls_pvt->glonass_gnav_ephemeris_map[glonass_gnav_eph->i_satellite_PRN] = *glonass_gnav_eph; } - else if(pmt::any_ref(msg).type() == typeid(std::shared_ptr) ) + else if (pmt::any_ref(msg).type() == typeid(std::shared_ptr)) { // ### GLONASS GNAV UTC MODEL ### std::shared_ptr glonass_gnav_utc_model; @@ -205,43 +205,40 @@ void rtklib_pvt_cc::msg_handler_telemetry(pmt::pmt_t msg) d_ls_pvt->glonass_gnav_utc_model = *glonass_gnav_utc_model; DLOG(INFO) << "New GLONASS GNAV UTC record has arrived "; } - else if(pmt::any_ref(msg).type() == typeid(std::shared_ptr) ) + else if (pmt::any_ref(msg).type() == typeid(std::shared_ptr)) { // ### GLONASS GNAV Almanac ### std::shared_ptr glonass_gnav_almanac; glonass_gnav_almanac = boost::any_cast>(pmt::any_ref(msg)); d_ls_pvt->glonass_gnav_almanac = *glonass_gnav_almanac; DLOG(INFO) << "New GLONASS GNAV Almanac has arrived " - << ", GLONASS GNAV Slot Number =" << glonass_gnav_almanac->d_n_A; + << ", GLONASS GNAV Slot Number =" << glonass_gnav_almanac->d_n_A; } else { LOG(WARNING) << "msg_handler_telemetry unknown object type!"; } - - } - catch(boost::bad_any_cast& e) - { + } + catch (boost::bad_any_cast& e) + { LOG(WARNING) << "msg_handler_telemetry Bad any cast!"; - } + } } -std::map rtklib_pvt_cc::get_GPS_L1_ephemeris_map() +std::map rtklib_pvt_cc::get_GPS_L1_ephemeris_map() { return d_ls_pvt->gps_ephemeris_map; } rtklib_pvt_cc::rtklib_pvt_cc(unsigned int nchannels, bool dump, std::string dump_filename, - int output_rate_ms, int display_rate_ms, bool flag_nmea_tty_port, - std::string nmea_dump_filename, std::string nmea_dump_devname, int rinex_version, - bool flag_rtcm_server, bool flag_rtcm_tty_port, unsigned short rtcm_tcp_port, - unsigned short rtcm_station_id, std::map rtcm_msg_rate_ms, std::string - rtcm_dump_devname, const unsigned int type_of_receiver, rtk_t & rtk) : - gr::sync_block("rtklib_pvt_cc", - gr::io_signature::make(nchannels, nchannels, sizeof(Gnss_Synchro)), - gr::io_signature::make(0, 0, 0)) + int output_rate_ms, int display_rate_ms, bool flag_nmea_tty_port, + std::string nmea_dump_filename, std::string nmea_dump_devname, int rinex_version, + bool flag_rtcm_server, bool flag_rtcm_tty_port, unsigned short rtcm_tcp_port, + unsigned short rtcm_station_id, std::map rtcm_msg_rate_ms, std::string rtcm_dump_devname, const unsigned int type_of_receiver, rtk_t& rtk) : gr::sync_block("rtklib_pvt_cc", + gr::io_signature::make(nchannels, nchannels, sizeof(Gnss_Synchro)), + gr::io_signature::make(0, 0, 0)) { d_output_rate_ms = output_rate_ms; d_display_rate_ms = display_rate_ms; @@ -274,7 +271,7 @@ rtklib_pvt_cc::rtklib_pvt_cc(unsigned int nchannels, bool dump, std::string dump std::string rtcm_dump_filename; rtcm_dump_filename = d_dump_filename; d_rtcm_printer = std::make_shared(rtcm_dump_filename, flag_rtcm_server, flag_rtcm_tty_port, rtcm_tcp_port, rtcm_station_id, rtcm_dump_devname); - if(rtcm_msg_rate_ms.find(1019) != rtcm_msg_rate_ms.end()) + if (rtcm_msg_rate_ms.find(1019) != rtcm_msg_rate_ms.end()) { d_rtcm_MT1019_rate_ms = rtcm_msg_rate_ms[1019]; } @@ -282,7 +279,7 @@ rtklib_pvt_cc::rtklib_pvt_cc(unsigned int nchannels, bool dump, std::string dump { d_rtcm_MT1019_rate_ms = boost::math::lcm(5000, d_output_rate_ms); // default value if not set } - if(rtcm_msg_rate_ms.find(1020) != rtcm_msg_rate_ms.end()) + if (rtcm_msg_rate_ms.find(1020) != rtcm_msg_rate_ms.end()) { d_rtcm_MT1020_rate_ms = rtcm_msg_rate_ms[1020]; } @@ -290,7 +287,7 @@ rtklib_pvt_cc::rtklib_pvt_cc(unsigned int nchannels, bool dump, std::string dump { d_rtcm_MT1020_rate_ms = boost::math::lcm(5000, d_output_rate_ms); // default value if not set } - if(rtcm_msg_rate_ms.find(1045) != rtcm_msg_rate_ms.end()) + if (rtcm_msg_rate_ms.find(1045) != rtcm_msg_rate_ms.end()) { d_rtcm_MT1045_rate_ms = rtcm_msg_rate_ms[1045]; } @@ -298,7 +295,7 @@ rtklib_pvt_cc::rtklib_pvt_cc(unsigned int nchannels, bool dump, std::string dump { d_rtcm_MT1045_rate_ms = boost::math::lcm(5000, d_output_rate_ms); // default value if not set } - if(rtcm_msg_rate_ms.find(1077) != rtcm_msg_rate_ms.end()) // whatever between 1071 and 1077 + if (rtcm_msg_rate_ms.find(1077) != rtcm_msg_rate_ms.end()) // whatever between 1071 and 1077 { d_rtcm_MT1077_rate_ms = rtcm_msg_rate_ms[1077]; } @@ -306,7 +303,7 @@ rtklib_pvt_cc::rtklib_pvt_cc(unsigned int nchannels, bool dump, std::string dump { d_rtcm_MT1077_rate_ms = boost::math::lcm(1000, d_output_rate_ms); // default value if not set } - if(rtcm_msg_rate_ms.find(1087) != rtcm_msg_rate_ms.end()) // whatever between 1081 and 1087 + if (rtcm_msg_rate_ms.find(1087) != rtcm_msg_rate_ms.end()) // whatever between 1081 and 1087 { d_rtcm_MT1087_rate_ms = rtcm_msg_rate_ms[1087]; } @@ -314,7 +311,7 @@ rtklib_pvt_cc::rtklib_pvt_cc(unsigned int nchannels, bool dump, std::string dump { d_rtcm_MT1087_rate_ms = boost::math::lcm(1000, d_output_rate_ms); // default value if not set } - if(rtcm_msg_rate_ms.find(1097) != rtcm_msg_rate_ms.end()) // whatever between 1091 and 1097 + if (rtcm_msg_rate_ms.find(1097) != rtcm_msg_rate_ms.end()) // whatever between 1091 and 1097 { d_rtcm_MT1097_rate_ms = rtcm_msg_rate_ms[1097]; d_rtcm_MSM_rate_ms = rtcm_msg_rate_ms[1097]; @@ -322,7 +319,7 @@ rtklib_pvt_cc::rtklib_pvt_cc(unsigned int nchannels, bool dump, std::string dump else { d_rtcm_MT1097_rate_ms = boost::math::lcm(1000, d_output_rate_ms); // default value if not set - d_rtcm_MSM_rate_ms = boost::math::lcm(1000, d_output_rate_ms); // default value if not set + d_rtcm_MSM_rate_ms = boost::math::lcm(1000, d_output_rate_ms); // default value if not set } b_rtcm_writing_started = false; @@ -357,15 +354,15 @@ rtklib_pvt_cc::rtklib_pvt_cc(unsigned int nchannels, bool dump, std::string dump if (d_dump_file.is_open() == false) { try - { - d_dump_file.exceptions (std::ifstream::failbit | std::ifstream::badbit ); + { + d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); LOG(INFO) << "PVT dump enabled Log file: " << d_dump_filename.c_str(); - } + } catch (const std::ifstream::failure& e) - { + { LOG(WARNING) << "Exception opening PVT dump file " << e.what(); - } + } } } @@ -373,7 +370,7 @@ rtklib_pvt_cc::rtklib_pvt_cc(unsigned int nchannels, bool dump, std::string dump first_fix = true; sysv_msg_key = 1101; int msgflg = IPC_CREAT | 0666; - if ((sysv_msqid = msgget(sysv_msg_key, msgflg )) == -1) + if ((sysv_msqid = msgget(sysv_msg_key, msgflg)) == -1) { std::cout << "GNSS-SDR can not create message queues!" << std::endl; throw new std::exception(); @@ -392,17 +389,17 @@ rtklib_pvt_cc::~rtklib_pvt_cc() if (d_ls_pvt->gps_cnav_ephemeris_map.size() > 0) { try - { + { std::ofstream ofs(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); boost::archive::xml_oarchive xml(ofs); xml << boost::serialization::make_nvp("GNSS-SDR_ephemeris_map", d_ls_pvt->gps_cnav_ephemeris_map); ofs.close(); LOG(INFO) << "Saved GPS L2CM or L5 Ephemeris map data"; - } + } catch (std::exception& e) - { + { LOG(WARNING) << e.what(); - } + } } else { @@ -415,17 +412,17 @@ rtklib_pvt_cc::~rtklib_pvt_cc() if (d_ls_pvt->gps_ephemeris_map.size() > 0) { try - { + { std::ofstream ofs(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); boost::archive::xml_oarchive xml(ofs); xml << boost::serialization::make_nvp("GNSS-SDR_ephemeris_map", d_ls_pvt->gps_ephemeris_map); ofs.close(); LOG(INFO) << "Saved GPS L1 CA Ephemeris map data"; - } - catch (const std::exception & e) - { + } + catch (const std::exception& e) + { LOG(WARNING) << e.what(); - } + } } else { @@ -438,17 +435,17 @@ rtklib_pvt_cc::~rtklib_pvt_cc() if (d_ls_pvt->galileo_ephemeris_map.size() > 0) { try - { + { std::ofstream ofs(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); boost::archive::xml_oarchive xml(ofs); xml << boost::serialization::make_nvp("GNSS-SDR_ephemeris_map", d_ls_pvt->galileo_ephemeris_map); ofs.close(); LOG(INFO) << "Saved Galileo E1 Ephemeris map data"; - } - catch (const std::exception & e) - { + } + catch (const std::exception& e) + { LOG(WARNING) << e.what(); - } + } } else { @@ -461,17 +458,17 @@ rtklib_pvt_cc::~rtklib_pvt_cc() if (d_ls_pvt->glonass_gnav_ephemeris_map.size() > 0) { try - { + { std::ofstream ofs(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); boost::archive::xml_oarchive xml(ofs); xml << boost::serialization::make_nvp("GNSS-SDR_ephemeris_map", d_ls_pvt->glonass_gnav_ephemeris_map); ofs.close(); LOG(INFO) << "Saved GLONASS GNAV Ephemeris map data"; - } + } catch (std::exception& e) - { + { LOG(WARNING) << e.what(); - } + } } else { @@ -480,18 +477,18 @@ rtklib_pvt_cc::~rtklib_pvt_cc() if (d_dump_file.is_open() == true) { try - { + { d_dump_file.close(); - } - catch(const std::exception & ex) - { + } + catch (const std::exception& ex) + { LOG(WARNING) << "Exception in destructor closing the dump file " << ex.what(); - } + } } } -bool rtklib_pvt_cc::observables_pairCompare_min(const std::pair& a, const std::pair& b) +bool rtklib_pvt_cc::observables_pairCompare_min(const std::pair& a, const std::pair& b) { return (a.second.Pseudorange_m) < (b.second.Pseudorange_m); } @@ -513,10 +510,10 @@ bool rtklib_pvt_cc::send_sys_v_ttff_msg(ttff_msgbuf ttff) } -int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items __attribute__((unused))) +int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items __attribute__((unused))) { - for(int epoch = 0; epoch < noutput_items; epoch++) + for (int epoch = 0; epoch < noutput_items; epoch++) { bool flag_display_pvt = false; bool flag_compute_pvt_output = false; @@ -531,58 +528,51 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite unsigned int glo_channel = 0; gnss_observables_map.clear(); - const Gnss_Synchro **in = reinterpret_cast(&input_items[0]); // Get the input buffer pointer + const Gnss_Synchro** in = reinterpret_cast(&input_items[0]); // Get the input buffer pointer // ############ 1. READ PSEUDORANGES #### for (unsigned int i = 0; i < d_nchannels; i++) { if (in[i][epoch].Flag_valid_pseudorange == true) { - std::map::const_iterator tmp_eph_iter_gps = d_ls_pvt->gps_ephemeris_map.find(in[i][epoch].PRN); - std::map::const_iterator tmp_eph_iter_gal = d_ls_pvt->galileo_ephemeris_map.find(in[i][epoch].PRN); - std::map::const_iterator tmp_eph_iter_cnav = d_ls_pvt->gps_cnav_ephemeris_map.find(in[i][epoch].PRN); - std::map::const_iterator tmp_eph_iter_glo_gnav = d_ls_pvt->glonass_gnav_ephemeris_map.find(in[i][epoch].PRN); - if(((tmp_eph_iter_gps->second.i_satellite_PRN == in[i][epoch].PRN) && (std::string(in[i][epoch].Signal).compare("1C") == 0)) - || ((tmp_eph_iter_cnav->second.i_satellite_PRN == in[i][epoch].PRN) && (std::string(in[i][epoch].Signal).compare("2S") == 0)) - || ((tmp_eph_iter_gal->second.i_satellite_PRN == in[i][epoch].PRN) && (std::string(in[i][epoch].Signal).compare("1B") == 0)) - || ((tmp_eph_iter_gal->second.i_satellite_PRN == in[i][epoch].PRN) && (std::string(in[i][epoch].Signal).compare("5X") == 0)) - || ((tmp_eph_iter_glo_gnav->second.i_satellite_PRN == in[i][epoch].PRN) && (std::string(in[i][epoch].Signal).compare("1G") == 0)) - || ((tmp_eph_iter_glo_gnav->second.i_satellite_PRN == in[i][epoch].PRN) && (std::string(in[i][epoch].Signal).compare("2G") == 0)) - || ((tmp_eph_iter_cnav->second.i_satellite_PRN == in[i][epoch].PRN) && (std::string(in[i][epoch].Signal).compare("L5") == 0))) + std::map::const_iterator tmp_eph_iter_gps = d_ls_pvt->gps_ephemeris_map.find(in[i][epoch].PRN); + std::map::const_iterator tmp_eph_iter_gal = d_ls_pvt->galileo_ephemeris_map.find(in[i][epoch].PRN); + std::map::const_iterator tmp_eph_iter_cnav = d_ls_pvt->gps_cnav_ephemeris_map.find(in[i][epoch].PRN); + std::map::const_iterator tmp_eph_iter_glo_gnav = d_ls_pvt->glonass_gnav_ephemeris_map.find(in[i][epoch].PRN); + if (((tmp_eph_iter_gps->second.i_satellite_PRN == in[i][epoch].PRN) && (std::string(in[i][epoch].Signal).compare("1C") == 0)) || ((tmp_eph_iter_cnav->second.i_satellite_PRN == in[i][epoch].PRN) && (std::string(in[i][epoch].Signal).compare("2S") == 0)) || ((tmp_eph_iter_gal->second.i_satellite_PRN == in[i][epoch].PRN) && (std::string(in[i][epoch].Signal).compare("1B") == 0)) || ((tmp_eph_iter_gal->second.i_satellite_PRN == in[i][epoch].PRN) && (std::string(in[i][epoch].Signal).compare("5X") == 0)) || ((tmp_eph_iter_glo_gnav->second.i_satellite_PRN == in[i][epoch].PRN) && (std::string(in[i][epoch].Signal).compare("1G") == 0)) || ((tmp_eph_iter_glo_gnav->second.i_satellite_PRN == in[i][epoch].PRN) && (std::string(in[i][epoch].Signal).compare("2G") == 0)) || ((tmp_eph_iter_cnav->second.i_satellite_PRN == in[i][epoch].PRN) && (std::string(in[i][epoch].Signal).compare("L5") == 0))) { // store valid observables in a map. - gnss_observables_map.insert(std::pair(i, in[i][epoch])); + gnss_observables_map.insert(std::pair(i, in[i][epoch])); } - if(d_ls_pvt->gps_ephemeris_map.size() > 0) + if (d_ls_pvt->gps_ephemeris_map.size() > 0) { - if(tmp_eph_iter_gps != d_ls_pvt->gps_ephemeris_map.end()) + if (tmp_eph_iter_gps != d_ls_pvt->gps_ephemeris_map.end()) { - d_rtcm_printer->lock_time(d_ls_pvt->gps_ephemeris_map.find(in[i][epoch].PRN)->second, in[i][epoch].RX_time, in[i][epoch]); // keep track of locking time + d_rtcm_printer->lock_time(d_ls_pvt->gps_ephemeris_map.find(in[i][epoch].PRN)->second, in[i][epoch].RX_time, in[i][epoch]); // keep track of locking time } } - if(d_ls_pvt->galileo_ephemeris_map.size() > 0) + if (d_ls_pvt->galileo_ephemeris_map.size() > 0) { - if(tmp_eph_iter_gal != d_ls_pvt->galileo_ephemeris_map.end()) + if (tmp_eph_iter_gal != d_ls_pvt->galileo_ephemeris_map.end()) { - d_rtcm_printer->lock_time(d_ls_pvt->galileo_ephemeris_map.find(in[i][epoch].PRN)->second, in[i][epoch].RX_time, in[i][epoch]); // keep track of locking time + d_rtcm_printer->lock_time(d_ls_pvt->galileo_ephemeris_map.find(in[i][epoch].PRN)->second, in[i][epoch].RX_time, in[i][epoch]); // keep track of locking time } } - if(d_ls_pvt->gps_cnav_ephemeris_map.size() > 0) + if (d_ls_pvt->gps_cnav_ephemeris_map.size() > 0) { - if(tmp_eph_iter_cnav != d_ls_pvt->gps_cnav_ephemeris_map.end()) + if (tmp_eph_iter_cnav != d_ls_pvt->gps_cnav_ephemeris_map.end()) { - d_rtcm_printer->lock_time(d_ls_pvt->gps_cnav_ephemeris_map.find(in[i][epoch].PRN)->second, in[i][epoch].RX_time, in[i][epoch]); // keep track of locking time + d_rtcm_printer->lock_time(d_ls_pvt->gps_cnav_ephemeris_map.find(in[i][epoch].PRN)->second, in[i][epoch].RX_time, in[i][epoch]); // keep track of locking time } } - if(d_ls_pvt->glonass_gnav_ephemeris_map.size() > 0) + if (d_ls_pvt->glonass_gnav_ephemeris_map.size() > 0) { - if(tmp_eph_iter_glo_gnav != d_ls_pvt->glonass_gnav_ephemeris_map.end()) + if (tmp_eph_iter_glo_gnav != d_ls_pvt->glonass_gnav_ephemeris_map.end()) { - d_rtcm_printer->lock_time(d_ls_pvt->glonass_gnav_ephemeris_map.find(in[i][epoch].PRN)->second, in[i][epoch].RX_time, in[i][epoch]); // keep track of locking time + d_rtcm_printer->lock_time(d_ls_pvt->glonass_gnav_ephemeris_map.find(in[i][epoch].PRN)->second, in[i][epoch].RX_time, in[i][epoch]); // keep track of locking time } } - } } @@ -610,47 +600,47 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite flag_display_pvt = true; last_pvt_display_T_rx_s = current_RX_time; } - if ((std::fabs(current_RX_time - last_RTCM_1019_output_time) * 1000.0 >= static_cast(d_rtcm_MT1019_rate_ms)) && (d_rtcm_MT1019_rate_ms != 0) ) // allows deactivating messages by setting rate = 0 + if ((std::fabs(current_RX_time - last_RTCM_1019_output_time) * 1000.0 >= static_cast(d_rtcm_MT1019_rate_ms)) && (d_rtcm_MT1019_rate_ms != 0)) // allows deactivating messages by setting rate = 0 { flag_write_RTCM_1019_output = true; last_RTCM_1019_output_time = current_RX_time; } - if ((std::fabs(current_RX_time - last_RTCM_1020_output_time) * 1000.0 >= static_cast(d_rtcm_MT1020_rate_ms)) && (d_rtcm_MT1020_rate_ms != 0) ) // allows deactivating messages by setting rate = 0 + if ((std::fabs(current_RX_time - last_RTCM_1020_output_time) * 1000.0 >= static_cast(d_rtcm_MT1020_rate_ms)) && (d_rtcm_MT1020_rate_ms != 0)) // allows deactivating messages by setting rate = 0 { flag_write_RTCM_1020_output = true; last_RTCM_1020_output_time = current_RX_time; } - if ((std::fabs(current_RX_time - last_RTCM_1045_output_time) * 1000.0 >= static_cast(d_rtcm_MT1045_rate_ms)) && (d_rtcm_MT1045_rate_ms != 0) ) + if ((std::fabs(current_RX_time - last_RTCM_1045_output_time) * 1000.0 >= static_cast(d_rtcm_MT1045_rate_ms)) && (d_rtcm_MT1045_rate_ms != 0)) { flag_write_RTCM_1045_output = true; last_RTCM_1045_output_time = current_RX_time; } - if ((std::fabs(current_RX_time - last_RTCM_1077_output_time) * 1000.0 >= static_cast(d_rtcm_MT1077_rate_ms)) && (d_rtcm_MT1077_rate_ms != 0) ) + if ((std::fabs(current_RX_time - last_RTCM_1077_output_time) * 1000.0 >= static_cast(d_rtcm_MT1077_rate_ms)) && (d_rtcm_MT1077_rate_ms != 0)) { last_RTCM_1077_output_time = current_RX_time; } - if ((std::fabs(current_RX_time - last_RTCM_1087_output_time) * 1000.0 >= static_cast(d_rtcm_MT1087_rate_ms)) && (d_rtcm_MT1087_rate_ms != 0) ) + if ((std::fabs(current_RX_time - last_RTCM_1087_output_time) * 1000.0 >= static_cast(d_rtcm_MT1087_rate_ms)) && (d_rtcm_MT1087_rate_ms != 0)) { last_RTCM_1087_output_time = current_RX_time; } - if ((std::fabs(current_RX_time - last_RTCM_1097_output_time) * 1000.0 >= static_cast(d_rtcm_MT1097_rate_ms)) && (d_rtcm_MT1097_rate_ms != 0) ) + if ((std::fabs(current_RX_time - last_RTCM_1097_output_time) * 1000.0 >= static_cast(d_rtcm_MT1097_rate_ms)) && (d_rtcm_MT1097_rate_ms != 0)) { last_RTCM_1097_output_time = current_RX_time; } - if ((std::fabs(current_RX_time - last_RTCM_MSM_output_time) * 1000.0 >= static_cast(d_rtcm_MSM_rate_ms)) && (d_rtcm_MSM_rate_ms != 0) ) + if ((std::fabs(current_RX_time - last_RTCM_MSM_output_time) * 1000.0 >= static_cast(d_rtcm_MSM_rate_ms)) && (d_rtcm_MSM_rate_ms != 0)) { flag_write_RTCM_MSM_output = true; last_RTCM_MSM_output_time = current_RX_time; } - if ((std::fabs(current_RX_time - last_RINEX_obs_output_time) >= 1.0) ) // TODO: Make it configurable + if ((std::fabs(current_RX_time - last_RINEX_obs_output_time) >= 1.0)) // TODO: Make it configurable { flag_write_RINEX_obs_output = true; last_RINEX_obs_output_time = current_RX_time; } - if ((std::fabs(current_RX_time - last_RINEX_nav_output_time) >= 6.0) ) // TODO: Make it configurable + if ((std::fabs(current_RX_time - last_RINEX_nav_output_time) >= 6.0)) // TODO: Make it configurable { flag_write_RINEX_nav_output = true; last_RINEX_nav_output_time = current_RX_time; @@ -658,15 +648,15 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite // correct the observable to account for the receiver clock offset - for (std::map::iterator it = gnss_observables_map.begin(); it != gnss_observables_map.end(); ++it) + for (std::map::iterator it = gnss_observables_map.begin(); it != gnss_observables_map.end(); ++it) { it->second.Pseudorange_m = it->second.Pseudorange_m - d_ls_pvt->get_time_offset_s() * GPS_C_m_s; } - if(first_fix == true) + if (first_fix == true) { std::cout << "First position fix at " << boost::posix_time::to_simple_string(d_ls_pvt->get_position_UTC_time()) - << " UTC is Lat = " << d_ls_pvt->get_latitude() << " [deg], Long = " << d_ls_pvt->get_longitude() - << " [deg], Height= " << d_ls_pvt->get_height() << " [m]" << std::endl; + << " UTC is Lat = " << d_ls_pvt->get_latitude() << " [deg], Long = " << d_ls_pvt->get_longitude() + << " [deg], Height= " << d_ls_pvt->get_height() << " [m]" << std::endl; ttff_msgbuf ttff; ttff.mtype = 1; end = std::chrono::system_clock::now(); @@ -720,251 +710,249 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite std::map::const_iterator glonass_gnav_ephemeris_iter; std::map::const_iterator gnss_observables_iter; - if (!b_rinex_header_written) // & we have utc data in nav message! + if (!b_rinex_header_written) // & we have utc data in nav message! { galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_cnav_ephemeris_iter = d_ls_pvt->gps_cnav_ephemeris_map.cbegin(); glonass_gnav_ephemeris_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); - if(type_of_rx == 1) // GPS L1 C/A only + if (type_of_rx == 1) // GPS L1 C/A only { if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) { rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, d_rx_time); rp->rinex_nav_header(rp->navFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model); - b_rinex_header_written = true; // do not write header anymore - + b_rinex_header_written = true; // do not write header anymore } } - if(type_of_rx == 2) // GPS L2C only + if (type_of_rx == 2) // GPS L2C only { if (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend()) { rp->rinex_obs_header(rp->obsFile, gps_cnav_ephemeris_iter->second, d_rx_time); rp->rinex_nav_header(rp->navFile, d_ls_pvt->gps_cnav_iono, d_ls_pvt->gps_cnav_utc_model); - b_rinex_header_written = true; // do not write header anymore + b_rinex_header_written = true; // do not write header anymore } } - if(type_of_rx == 3) // GPS L5 only + if (type_of_rx == 3) // GPS L5 only { if (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend()) { rp->rinex_obs_header(rp->obsFile, gps_cnav_ephemeris_iter->second, d_rx_time); rp->rinex_nav_header(rp->navFile, d_ls_pvt->gps_cnav_iono, d_ls_pvt->gps_cnav_utc_model); - b_rinex_header_written = true; // do not write header anymore + b_rinex_header_written = true; // do not write header anymore } } - if(type_of_rx == 4) // Galileo E1B only + if (type_of_rx == 4) // Galileo E1B only { if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) { rp->rinex_obs_header(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time); rp->rinex_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->galileo_almanac); - b_rinex_header_written = true; // do not write header anymore + b_rinex_header_written = true; // do not write header anymore } } - if(type_of_rx == 5) // Galileo E5a only + if (type_of_rx == 5) // Galileo E5a only { std::string signal("5X"); if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) { rp->rinex_obs_header(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, signal); rp->rinex_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->galileo_almanac); - b_rinex_header_written = true; // do not write header anymore + b_rinex_header_written = true; // do not write header anymore } } - if(type_of_rx == 6) // Galileo E5b only + if (type_of_rx == 6) // Galileo E5b only { std::string signal("7X"); if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) { rp->rinex_obs_header(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, signal); rp->rinex_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->galileo_almanac); - b_rinex_header_written = true; // do not write header anymore + b_rinex_header_written = true; // do not write header anymore } } - if(type_of_rx == 7) // GPS L1 C/A + GPS L2C + if (type_of_rx == 7) // GPS L1 C/A + GPS L2C { if ((gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) && (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend())) { rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, gps_cnav_ephemeris_iter->second, d_rx_time); rp->rinex_nav_header(rp->navFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model); - b_rinex_header_written = true; // do not write header anymore + b_rinex_header_written = true; // do not write header anymore } } - if(type_of_rx == 9) // GPS L1 C/A + Galileo E1B + if (type_of_rx == 9) // GPS L1 C/A + Galileo E1B { - if ((galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) && (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) ) + if ((galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) && (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend())) { std::string gal_signal("1B"); rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gal_signal); - rp->rinex_nav_header(rp->navMixFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->galileo_almanac); - b_rinex_header_written = true; // do not write header anymore + rp->rinex_nav_header(rp->navMixFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->galileo_almanac); + b_rinex_header_written = true; // do not write header anymore } } - if(type_of_rx == 10) // GPS L1 C/A + Galileo E5a + if (type_of_rx == 10) // GPS L1 C/A + Galileo E5a { - if ((galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) && (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) ) + if ((galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) && (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend())) { std::string gal_signal("5X"); rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gal_signal); - rp->rinex_nav_header(rp->navMixFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->galileo_almanac); - b_rinex_header_written = true; // do not write header anymore + rp->rinex_nav_header(rp->navMixFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->galileo_almanac); + b_rinex_header_written = true; // do not write header anymore } } - if(type_of_rx == 11) // GPS L1 C/A + Galileo E5b + if (type_of_rx == 11) // GPS L1 C/A + Galileo E5b { - if ((galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) && (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) ) + if ((galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) && (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend())) { std::string gal_signal("7X"); rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gal_signal); - rp->rinex_nav_header(rp->navMixFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->galileo_almanac); - b_rinex_header_written = true; // do not write header anymore + rp->rinex_nav_header(rp->navMixFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->galileo_almanac); + b_rinex_header_written = true; // do not write header anymore } } - if(type_of_rx == 14) // Galileo E1B + Galileo E5a + if (type_of_rx == 14) // Galileo E1B + Galileo E5a { - if ((galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) ) + if ((galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend())) { std::string gal_signal("1B 5X"); rp->rinex_obs_header(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, gal_signal); - rp->rinex_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->galileo_almanac); - b_rinex_header_written = true; // do not write header anymore + rp->rinex_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->galileo_almanac); + b_rinex_header_written = true; // do not write header anymore } } - if(type_of_rx == 15) // Galileo E1B + Galileo E5b + if (type_of_rx == 15) // Galileo E1B + Galileo E5b { - if ((galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) ) + if ((galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend())) { std::string gal_signal("1B 7X"); rp->rinex_obs_header(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, gal_signal); - rp->rinex_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->galileo_almanac); - b_rinex_header_written = true; // do not write header anymore + rp->rinex_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->galileo_almanac); + b_rinex_header_written = true; // do not write header anymore } } - if(type_of_rx == 23) // GLONASS L1 C/A only + if (type_of_rx == 23) // GLONASS L1 C/A only { std::string signal("1G"); if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) { rp->rinex_obs_header(rp->obsFile, glonass_gnav_ephemeris_iter->second, d_rx_time, signal); rp->rinex_nav_header(rp->navGloFile, d_ls_pvt->glonass_gnav_utc_model, glonass_gnav_ephemeris_iter->second); - b_rinex_header_written = true; // do not write header anymore + b_rinex_header_written = true; // do not write header anymore } } - if(type_of_rx == 24) // GLONASS L2 C/A only + if (type_of_rx == 24) // GLONASS L2 C/A only { std::string signal("2G"); if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) { rp->rinex_obs_header(rp->obsFile, glonass_gnav_ephemeris_iter->second, d_rx_time, signal); rp->rinex_nav_header(rp->navGloFile, d_ls_pvt->glonass_gnav_utc_model, glonass_gnav_ephemeris_iter->second); - b_rinex_header_written = true; // do not write header anymore + b_rinex_header_written = true; // do not write header anymore } } - if(type_of_rx == 25) // GLONASS L1 C/A + GLONASS L2 C/A + if (type_of_rx == 25) // GLONASS L1 C/A + GLONASS L2 C/A { std::string signal("1G 2G"); if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) { rp->rinex_obs_header(rp->obsFile, glonass_gnav_ephemeris_iter->second, d_rx_time, signal); rp->rinex_nav_header(rp->navGloFile, d_ls_pvt->glonass_gnav_utc_model, glonass_gnav_ephemeris_iter->second); - b_rinex_header_written = true; // do not write header anymore + b_rinex_header_written = true; // do not write header anymore } } - if(type_of_rx == 26) // GPS L1 C/A + GLONASS L1 C/A + if (type_of_rx == 26) // GPS L1 C/A + GLONASS L1 C/A { - if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) && (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) ) + if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) && (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend())) { std::string glo_signal("1G"); rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, glo_signal); - if(d_rinex_version == 3) - rp->rinex_nav_header(rp->navMixFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac); - if(d_rinex_version == 2) + if (d_rinex_version == 3) + rp->rinex_nav_header(rp->navMixFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac); + if (d_rinex_version == 2) { rp->rinex_nav_header(rp->navFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model); rp->rinex_nav_header(rp->navGloFile, d_ls_pvt->glonass_gnav_utc_model, glonass_gnav_ephemeris_iter->second); } - b_rinex_header_written = true; // do not write header anymore + b_rinex_header_written = true; // do not write header anymore } } - if(type_of_rx == 27) // Galileo E1B + GLONASS L1 C/A + if (type_of_rx == 27) // Galileo E1B + GLONASS L1 C/A { - if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) && (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) ) + if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) && (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend())) { std::string glo_signal("1G"); std::string gal_signal("1B"); rp->rinex_obs_header(rp->obsFile, galileo_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, glo_signal, gal_signal); rp->rinex_nav_header(rp->navMixFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->galileo_almanac, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac); - b_rinex_header_written = true; // do not write header anymore + b_rinex_header_written = true; // do not write header anymore } } - if(type_of_rx == 28) // GPS L2C + GLONASS L1 C/A + if (type_of_rx == 28) // GPS L2C + GLONASS L1 C/A { - if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) && (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend()) ) + if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) && (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend())) { std::string glo_signal("1G"); rp->rinex_obs_header(rp->obsFile, gps_cnav_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, glo_signal); - rp->rinex_nav_header(rp->navMixFile, d_ls_pvt->gps_cnav_iono, d_ls_pvt->gps_cnav_utc_model, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac); - b_rinex_header_written = true; // do not write header anymore + rp->rinex_nav_header(rp->navMixFile, d_ls_pvt->gps_cnav_iono, d_ls_pvt->gps_cnav_utc_model, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac); + b_rinex_header_written = true; // do not write header anymore } } } - if(b_rinex_header_written) // The header is already written, we can now log the navigation message data + if (b_rinex_header_written) // The header is already written, we can now log the navigation message data { - if(flag_write_RINEX_nav_output) + if (flag_write_RINEX_nav_output) { - if(type_of_rx == 1) // GPS L1 C/A only + if (type_of_rx == 1) // GPS L1 C/A only { rp->log_rinex_nav(rp->navFile, d_ls_pvt->gps_ephemeris_map); } - if(type_of_rx == 2) // GPS L2C only + if (type_of_rx == 2) // GPS L2C only { rp->log_rinex_nav(rp->navFile, d_ls_pvt->gps_cnav_ephemeris_map); } - if(type_of_rx == 3) // GPS L5 only + if (type_of_rx == 3) // GPS L5 only { rp->log_rinex_nav(rp->navFile, d_ls_pvt->gps_cnav_ephemeris_map); } - if( (type_of_rx == 4) || (type_of_rx == 5) || (type_of_rx == 6) ) // Galileo + if ((type_of_rx == 4) || (type_of_rx == 5) || (type_of_rx == 6)) // Galileo { rp->log_rinex_nav(rp->navGalFile, d_ls_pvt->galileo_ephemeris_map); } - if(type_of_rx == 7) // GPS L1 C/A + GPS L2C + if (type_of_rx == 7) // GPS L1 C/A + GPS L2C { rp->log_rinex_nav(rp->navFile, d_ls_pvt->gps_cnav_ephemeris_map); } - if((type_of_rx == 9) || (type_of_rx == 10) || (type_of_rx == 11)) // GPS L1 C/A + Galileo + if ((type_of_rx == 9) || (type_of_rx == 10) || (type_of_rx == 11)) // GPS L1 C/A + Galileo { rp->log_rinex_nav(rp->navMixFile, d_ls_pvt->gps_ephemeris_map, d_ls_pvt->galileo_ephemeris_map); } - if((type_of_rx == 14) || (type_of_rx == 15)) // Galileo E1B + Galileo E5a + if ((type_of_rx == 14) || (type_of_rx == 15)) // Galileo E1B + Galileo E5a { rp->log_rinex_nav(rp->navGalFile, d_ls_pvt->galileo_ephemeris_map); } - if((type_of_rx == 23) || (type_of_rx == 24) || (type_of_rx == 25)) // GLONASS L1 C/A, GLONASS L2 C/A + if ((type_of_rx == 23) || (type_of_rx == 24) || (type_of_rx == 25)) // GLONASS L1 C/A, GLONASS L2 C/A { rp->log_rinex_nav(rp->navGloFile, d_ls_pvt->glonass_gnav_ephemeris_map); } - if(type_of_rx == 26) // GPS L1 C/A + GLONASS L1 C/A + if (type_of_rx == 26) // GPS L1 C/A + GLONASS L1 C/A { - if(d_rinex_version == 3) + if (d_rinex_version == 3) rp->log_rinex_nav(rp->navMixFile, d_ls_pvt->gps_ephemeris_map, d_ls_pvt->glonass_gnav_ephemeris_map); - if(d_rinex_version == 2) + if (d_rinex_version == 2) { rp->log_rinex_nav(rp->navFile, d_ls_pvt->gps_ephemeris_map); rp->log_rinex_nav(rp->navGloFile, d_ls_pvt->glonass_gnav_ephemeris_map); } - } - if(type_of_rx == 27) // Galileo E1B + GLONASS L1 C/A + if (type_of_rx == 27) // Galileo E1B + GLONASS L1 C/A { rp->log_rinex_nav(rp->navMixFile, d_ls_pvt->galileo_ephemeris_map, d_ls_pvt->glonass_gnav_ephemeris_map); } - if(type_of_rx == 28) // GPS L2C + GLONASS L1 C/A + if (type_of_rx == 28) // GPS L2C + GLONASS L1 C/A { rp->log_rinex_nav(rp->navMixFile, d_ls_pvt->gps_cnav_ephemeris_map, d_ls_pvt->glonass_gnav_ephemeris_map); } @@ -975,9 +963,9 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite glonass_gnav_ephemeris_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); // Log observables into the RINEX file - if(flag_write_RINEX_obs_output) + if (flag_write_RINEX_obs_output) { - if(type_of_rx == 1) // GPS L1 C/A only + if (type_of_rx == 1) // GPS L1 C/A only { if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end()) { @@ -990,7 +978,7 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite b_rinex_header_updated = true; } } - if(type_of_rx == 2) // GPS L2C only + if (type_of_rx == 2) // GPS L2C only { if (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.end()) { @@ -1003,7 +991,7 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite b_rinex_header_updated = true; } } - if(type_of_rx == 3) // GPS L5 + if (type_of_rx == 3) // GPS L5 { if (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.end()) { @@ -1016,7 +1004,7 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite b_rinex_header_updated = true; } } - if(type_of_rx == 4) // Galileo E1B only + if (type_of_rx == 4) // Galileo E1B only { if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end()) { @@ -1029,7 +1017,7 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite b_rinex_header_updated = true; } } - if(type_of_rx == 5) // Galileo E5a only + if (type_of_rx == 5) // Galileo E5a only { if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end()) { @@ -1042,7 +1030,7 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite b_rinex_header_updated = true; } } - if(type_of_rx == 6) // Galileo E5b only + if (type_of_rx == 6) // Galileo E5b only { if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end()) { @@ -1055,9 +1043,9 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite b_rinex_header_updated = true; } } - if(type_of_rx == 7) // GPS L1 C/A + GPS L2C + if (type_of_rx == 7) // GPS L1 C/A + GPS L2C { - if( (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end()) && (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.end()) ) + if ((gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end()) && (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.end())) { rp->log_rinex_obs(rp->obsFile, gps_ephemeris_iter->second, gps_cnav_ephemeris_iter->second, d_rx_time, gnss_observables_map); } @@ -1068,20 +1056,20 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite b_rinex_header_updated = true; } } - if(type_of_rx == 9) // GPS L1 C/A + Galileo E1B + if (type_of_rx == 9) // GPS L1 C/A + Galileo E1B { - if ((galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end()) && (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end()) ) + if ((galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end()) && (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end())) { rp->log_rinex_obs(rp->obsFile, gps_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gnss_observables_map); } if (!b_rinex_header_updated && (d_ls_pvt->gps_utc_model.d_A0 != 0)) { rp->update_obs_header(rp->obsFile, d_ls_pvt->gps_utc_model); - rp->update_nav_header(rp->navMixFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->galileo_almanac); + rp->update_nav_header(rp->navMixFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->galileo_almanac); b_rinex_header_updated = true; } } - if(type_of_rx == 14) // Galileo E1B + Galileo E5a + if (type_of_rx == 14) // Galileo E1B + Galileo E5a { if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end()) { @@ -1094,7 +1082,7 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite b_rinex_header_updated = true; } } - if(type_of_rx == 15) // Galileo E1B + Galileo E5b + if (type_of_rx == 15) // Galileo E1B + Galileo E5b { if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end()) { @@ -1107,7 +1095,7 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite b_rinex_header_updated = true; } } - if(type_of_rx == 23) // GLONASS L1 C/A only + if (type_of_rx == 23) // GLONASS L1 C/A only { if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.end()) { @@ -1120,7 +1108,7 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite b_rinex_header_updated = true; } } - if(type_of_rx == 24) // GLONASS L2 C/A only + if (type_of_rx == 24) // GLONASS L2 C/A only { if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.end()) { @@ -1133,7 +1121,7 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite b_rinex_header_updated = true; } } - if(type_of_rx == 25) // GLONASS L1 C/A + GLONASS L2 C/A + if (type_of_rx == 25) // GLONASS L1 C/A + GLONASS L2 C/A { if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.end()) { @@ -1146,64 +1134,63 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite b_rinex_header_updated = true; } } - if(type_of_rx == 26) // GPS L1 C/A + GLONASS L1 C/A + if (type_of_rx == 26) // GPS L1 C/A + GLONASS L1 C/A { - if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.end()) && (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end()) ) + if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.end()) && (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end())) { rp->log_rinex_obs(rp->obsFile, gps_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map); } if (!b_rinex_header_updated && (d_ls_pvt->gps_utc_model.d_A0 != 0)) { rp->update_obs_header(rp->obsFile, d_ls_pvt->gps_utc_model); - rp->update_nav_header(rp->navMixFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac); - b_rinex_header_updated = true; // do not write header anymore + rp->update_nav_header(rp->navMixFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac); + b_rinex_header_updated = true; // do not write header anymore } } - if(type_of_rx == 27) // Galileo E1B + GLONASS L1 C/A + if (type_of_rx == 27) // Galileo E1B + GLONASS L1 C/A { - if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.end()) && (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end()) ) + if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.end()) && (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end())) { rp->log_rinex_obs(rp->obsFile, galileo_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map); - } if (!b_rinex_header_updated && (d_ls_pvt->galileo_utc_model.A0_6 != 0)) { rp->update_obs_header(rp->obsFile, d_ls_pvt->galileo_utc_model); - rp->update_nav_header(rp->navMixFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->galileo_almanac, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac); - b_rinex_header_updated = true; // do not write header anymore + rp->update_nav_header(rp->navMixFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->galileo_almanac, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac); + b_rinex_header_updated = true; // do not write header anymore } } - if(type_of_rx == 28) // GPS L2C + GLONASS L1 C/A + if (type_of_rx == 28) // GPS L2C + GLONASS L1 C/A { - if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.end()) && (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.end()) ) + if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.end()) && (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.end())) { rp->log_rinex_obs(rp->obsFile, gps_cnav_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map); } if (!b_rinex_header_updated && (d_ls_pvt->gps_cnav_utc_model.d_A0 != 0)) { rp->update_obs_header(rp->obsFile, d_ls_pvt->gps_cnav_utc_model); - rp->update_nav_header(rp->navMixFile, d_ls_pvt->gps_cnav_iono, d_ls_pvt->gps_cnav_utc_model, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac); - b_rinex_header_updated = true; // do not write header anymore + rp->update_nav_header(rp->navMixFile, d_ls_pvt->gps_cnav_iono, d_ls_pvt->gps_cnav_utc_model, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac); + b_rinex_header_updated = true; // do not write header anymore } } } } // ####################### RTCM MESSAGES ################# - if(b_rtcm_writing_started) + if (b_rtcm_writing_started) { - if(type_of_rx == 1) // GPS L1 C/A + if (type_of_rx == 1) // GPS L1 C/A { - if(flag_write_RTCM_1019_output == true) + if (flag_write_RTCM_1019_output == true) { - for(std::map::const_iterator gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_ephemeris_iter++ ) + for (std::map::const_iterator gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_ephemeris_iter++) { d_rtcm_printer->Print_Rtcm_MT1019(gps_ephemeris_iter->second); } } - if(flag_write_RTCM_MSM_output == true) + if (flag_write_RTCM_MSM_output == true) { - std::map::const_iterator gps_ephemeris_iter; + std::map::const_iterator gps_ephemeris_iter; gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) @@ -1212,18 +1199,18 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite } } } - if((type_of_rx == 4) || (type_of_rx == 5) || (type_of_rx == 6) || (type_of_rx == 14) || (type_of_rx == 15)) // Galileo + if ((type_of_rx == 4) || (type_of_rx == 5) || (type_of_rx == 6) || (type_of_rx == 14) || (type_of_rx == 15)) // Galileo { - if(flag_write_RTCM_1045_output == true) + if (flag_write_RTCM_1045_output == true) { - for(std::map::const_iterator gal_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); gal_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend(); gal_ephemeris_iter++ ) + for (std::map::const_iterator gal_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); gal_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend(); gal_ephemeris_iter++) { d_rtcm_printer->Print_Rtcm_MT1045(gal_ephemeris_iter->second); } } - if(flag_write_RTCM_MSM_output == true) + if (flag_write_RTCM_MSM_output == true) { - std::map::const_iterator gal_ephemeris_iter; + std::map::const_iterator gal_ephemeris_iter; gal_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); if (gal_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) { @@ -1231,44 +1218,44 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite } } } - if(type_of_rx == 7) // GPS L1 C/A + GPS L2C + if (type_of_rx == 7) // GPS L1 C/A + GPS L2C { - if(flag_write_RTCM_1019_output == true) + if (flag_write_RTCM_1019_output == true) { - for(std::map::const_iterator gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_ephemeris_iter++ ) + for (std::map::const_iterator gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_ephemeris_iter++) { d_rtcm_printer->Print_Rtcm_MT1019(gps_ephemeris_iter->second); } } - if(flag_write_RTCM_MSM_output == true) + if (flag_write_RTCM_MSM_output == true) { - std::map::const_iterator gps_ephemeris_iter; + std::map::const_iterator gps_ephemeris_iter; gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); - std::map::const_iterator gps_cnav_ephemeris_iter; + std::map::const_iterator gps_cnav_ephemeris_iter; gps_cnav_ephemeris_iter = d_ls_pvt->gps_cnav_ephemeris_map.cbegin(); - if ((gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) && (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend()) ) + if ((gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) && (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend())) { d_rtcm_printer->Print_Rtcm_MSM(7, gps_ephemeris_iter->second, gps_cnav_ephemeris_iter->second, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } } } - if(type_of_rx == 9) // GPS L1 C/A + Galileo E1B + if (type_of_rx == 9) // GPS L1 C/A + Galileo E1B { - if(flag_write_RTCM_1019_output == true) + if (flag_write_RTCM_1019_output == true) { - for(gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.begin(); gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end(); gps_ephemeris_iter++ ) + for (gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.begin(); gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end(); gps_ephemeris_iter++) { d_rtcm_printer->Print_Rtcm_MT1019(gps_ephemeris_iter->second); } } - if(flag_write_RTCM_1045_output == true) + if (flag_write_RTCM_1045_output == true) { - for(galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.begin(); galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end(); galileo_ephemeris_iter++ ) + for (galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.begin(); galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end(); galileo_ephemeris_iter++) { d_rtcm_printer->Print_Rtcm_MT1045(galileo_ephemeris_iter->second); } } - if(flag_write_RTCM_MSM_output == true) + if (flag_write_RTCM_MSM_output == true) { //gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.end(); //galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.end(); @@ -1276,9 +1263,9 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) { std::string system(&gnss_observables_iter->second.System, 1); - if(gps_channel == 0) + if (gps_channel == 0) { - if(system.compare("G") == 0) + if (system.compare("G") == 0) { // This is a channel with valid GPS signal gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.find(gnss_observables_iter->second.PRN); @@ -1288,9 +1275,9 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite } } } - if(gal_channel == 0) + if (gal_channel == 0) { - if(system.compare("E") == 0) + if (system.compare("E") == 0) { galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) @@ -1301,15 +1288,14 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite } i++; } - if(flag_write_RTCM_MSM_output == true) + if (flag_write_RTCM_MSM_output == true) { - if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) { d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, galileo_ephemeris_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } } - if(flag_write_RTCM_MSM_output == true) + if (flag_write_RTCM_MSM_output == true) { if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) { @@ -1318,17 +1304,17 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite } } } - if((type_of_rx == 23) || (type_of_rx == 24) || (type_of_rx == 25)) // GLONASS + if ((type_of_rx == 23) || (type_of_rx == 24) || (type_of_rx == 25)) // GLONASS { - if(flag_write_RTCM_1020_output == true) + if (flag_write_RTCM_1020_output == true) { - for(std::map::const_iterator glonass_gnav_ephemeris_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend(); glonass_gnav_ephemeris_iter++ ) + for (std::map::const_iterator glonass_gnav_ephemeris_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend(); glonass_gnav_ephemeris_iter++) { d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_ephemeris_iter->second, d_ls_pvt->glonass_gnav_utc_model); } } - std::map::const_iterator glo_gnav_ephemeris_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); + std::map::const_iterator glo_gnav_ephemeris_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); if (glo_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) { @@ -1336,23 +1322,23 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite } b_rtcm_writing_started = true; } - if(type_of_rx == 26) // GPS L1 C/A + GLONASS L1 C/A + if (type_of_rx == 26) // GPS L1 C/A + GLONASS L1 C/A { - if(flag_write_RTCM_1019_output == true) + if (flag_write_RTCM_1019_output == true) { - for(gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_ephemeris_iter++ ) + for (gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_ephemeris_iter++) { d_rtcm_printer->Print_Rtcm_MT1019(gps_ephemeris_iter->second); } } - if(flag_write_RTCM_1020_output == true) + if (flag_write_RTCM_1020_output == true) { - for(std::map::const_iterator glonass_gnav_ephemeris_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend(); glonass_gnav_ephemeris_iter++ ) + for (std::map::const_iterator glonass_gnav_ephemeris_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend(); glonass_gnav_ephemeris_iter++) { d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_ephemeris_iter->second, d_ls_pvt->glonass_gnav_utc_model); } } - if(flag_write_RTCM_MSM_output == true) + if (flag_write_RTCM_MSM_output == true) { //gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.end(); //galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.end(); @@ -1360,9 +1346,9 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite for (gnss_observables_iter = gnss_observables_map.begin(); gnss_observables_iter != gnss_observables_map.end(); gnss_observables_iter++) { std::string system(&gnss_observables_iter->second.System, 1); - if(gps_channel == 0) + if (gps_channel == 0) { - if(system.compare("G") == 0) + if (system.compare("G") == 0) { // This is a channel with valid GPS signal gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.find(gnss_observables_iter->second.PRN); @@ -1372,9 +1358,9 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite } } } - if(glo_channel == 0) + if (glo_channel == 0) { - if(system.compare("R") == 0) + if (system.compare("R") == 0) { glonass_gnav_ephemeris_iter = d_ls_pvt->glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN); if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) @@ -1385,15 +1371,14 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite } i++; } - if(flag_write_RTCM_MSM_output == true) + if (flag_write_RTCM_MSM_output == true) { - if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) { d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } } - if(flag_write_RTCM_MSM_output == true) + if (flag_write_RTCM_MSM_output == true) { if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) { @@ -1402,23 +1387,23 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite } } } - if(type_of_rx == 27) // GLONASS L1 C/A + Galileo E1B + if (type_of_rx == 27) // GLONASS L1 C/A + Galileo E1B { - if(flag_write_RTCM_1020_output == true) + if (flag_write_RTCM_1020_output == true) { - for(std::map::const_iterator glonass_gnav_ephemeris_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend(); glonass_gnav_ephemeris_iter++ ) + for (std::map::const_iterator glonass_gnav_ephemeris_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend(); glonass_gnav_ephemeris_iter++) { d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_ephemeris_iter->second, d_ls_pvt->glonass_gnav_utc_model); } } - if(flag_write_RTCM_1045_output == true) + if (flag_write_RTCM_1045_output == true) { - for(galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend(); galileo_ephemeris_iter++ ) + for (galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend(); galileo_ephemeris_iter++) { d_rtcm_printer->Print_Rtcm_MT1045(galileo_ephemeris_iter->second); } } - if(flag_write_RTCM_MSM_output == true) + if (flag_write_RTCM_MSM_output == true) { //gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.end(); //galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.end(); @@ -1426,9 +1411,9 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) { std::string system(&gnss_observables_iter->second.System, 1); - if(gal_channel == 0) + if (gal_channel == 0) { - if(system.compare("E") == 0) + if (system.compare("E") == 0) { // This is a channel with valid GPS signal galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); @@ -1438,9 +1423,9 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite } } } - if(glo_channel == 0) + if (glo_channel == 0) { - if(system.compare("R") == 0) + if (system.compare("R") == 0) { glonass_gnav_ephemeris_iter = d_ls_pvt->glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN); if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.end()) @@ -1451,17 +1436,15 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite } i++; } - if(flag_write_RTCM_MSM_output == true) + if (flag_write_RTCM_MSM_output == true) { - if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end()) { d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, galileo_ephemeris_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } } - if(flag_write_RTCM_MSM_output == true) + if (flag_write_RTCM_MSM_output == true) { - if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.end()) { d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); @@ -1471,16 +1454,16 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite } } - if(!b_rtcm_writing_started) // the first time + if (!b_rtcm_writing_started) // the first time { - if(type_of_rx == 1) // GPS L1 C/A + if (type_of_rx == 1) // GPS L1 C/A { - for(std::map::const_iterator gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_ephemeris_iter++ ) + for (std::map::const_iterator gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_ephemeris_iter++) { d_rtcm_printer->Print_Rtcm_MT1019(gps_ephemeris_iter->second); } - std::map::const_iterator gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); + std::map::const_iterator gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) { @@ -1488,14 +1471,14 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite } b_rtcm_writing_started = true; } - if((type_of_rx == 4) || (type_of_rx == 5) || (type_of_rx == 6) || (type_of_rx == 14) || (type_of_rx == 15)) // Galileo + if ((type_of_rx == 4) || (type_of_rx == 5) || (type_of_rx == 6) || (type_of_rx == 14) || (type_of_rx == 15)) // Galileo { - for(std::map::const_iterator gal_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); gal_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend(); gal_ephemeris_iter++ ) + for (std::map::const_iterator gal_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); gal_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend(); gal_ephemeris_iter++) { d_rtcm_printer->Print_Rtcm_MT1045(gal_ephemeris_iter->second); } - std::map::const_iterator gal_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); + std::map::const_iterator gal_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); if (gal_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) { @@ -1503,15 +1486,15 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite } b_rtcm_writing_started = true; } - if(type_of_rx == 7) // GPS L1 C/A + GPS L2C + if (type_of_rx == 7) // GPS L1 C/A + GPS L2C { - for(std::map::const_iterator gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_ephemeris_iter++ ) + for (std::map::const_iterator gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_ephemeris_iter++) { d_rtcm_printer->Print_Rtcm_MT1019(gps_ephemeris_iter->second); } - std::map::const_iterator gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); - std::map::const_iterator gps_cnav_ephemeris_iter = d_ls_pvt->gps_cnav_ephemeris_map.cbegin(); + std::map::const_iterator gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); + std::map::const_iterator gps_cnav_ephemeris_iter = d_ls_pvt->gps_cnav_ephemeris_map.cbegin(); if ((gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) && (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend())) { @@ -1519,18 +1502,18 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite } b_rtcm_writing_started = true; } - if(type_of_rx == 9) // GPS L1 C/A + Galileo E1B + if (type_of_rx == 9) // GPS L1 C/A + Galileo E1B { - if(d_rtcm_MT1019_rate_ms != 0) // allows deactivating messages by setting rate = 0 + if (d_rtcm_MT1019_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for(std::map::const_iterator gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_ephemeris_iter++ ) + for (std::map::const_iterator gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_ephemeris_iter++) { d_rtcm_printer->Print_Rtcm_MT1019(gps_ephemeris_iter->second); } } - if(d_rtcm_MT1045_rate_ms != 0) + if (d_rtcm_MT1045_rate_ms != 0) { - for(galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.begin(); galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end(); galileo_ephemeris_iter++ ) + for (galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.begin(); galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end(); galileo_ephemeris_iter++) { d_rtcm_printer->Print_Rtcm_MT1045(galileo_ephemeris_iter->second); } @@ -1540,9 +1523,9 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) { std::string system(&gnss_observables_iter->second.System, 1); - if(gps_channel == 0) + if (gps_channel == 0) { - if(system.compare("G") == 0) + if (system.compare("G") == 0) { // This is a channel with valid GPS signal gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.find(gnss_observables_iter->second.PRN); @@ -1552,9 +1535,9 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite } } } - if(gal_channel == 0) + if (gal_channel == 0) { - if(system.compare("E") == 0) + if (system.compare("E") == 0) { galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end()) @@ -1571,20 +1554,20 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite d_rtcm_printer->Print_Rtcm_MSM(7, gps_ephemeris_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } - if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end() && (d_rtcm_MT1097_rate_ms != 0) ) + if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end() && (d_rtcm_MT1097_rate_ms != 0)) { d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, galileo_ephemeris_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } b_rtcm_writing_started = true; } - if((type_of_rx == 23) || (type_of_rx == 24) || (type_of_rx == 25)) // GLONASS + if ((type_of_rx == 23) || (type_of_rx == 24) || (type_of_rx == 25)) // GLONASS { - for(std::map::const_iterator glonass_gnav_ephemeris_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend(); glonass_gnav_ephemeris_iter++ ) + for (std::map::const_iterator glonass_gnav_ephemeris_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend(); glonass_gnav_ephemeris_iter++) { d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_ephemeris_iter->second, d_ls_pvt->glonass_gnav_utc_model); } - std::map::const_iterator glo_gnav_ephemeris_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); + std::map::const_iterator glo_gnav_ephemeris_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); if (glo_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) { @@ -1592,18 +1575,18 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite } b_rtcm_writing_started = true; } - if(type_of_rx == 26) // GPS L1 C/A + GLONASS L1 C/A + if (type_of_rx == 26) // GPS L1 C/A + GLONASS L1 C/A { - if(d_rtcm_MT1019_rate_ms != 0) // allows deactivating messages by setting rate = 0 + if (d_rtcm_MT1019_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for(gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_ephemeris_iter++ ) + for (gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_ephemeris_iter++) { d_rtcm_printer->Print_Rtcm_MT1019(gps_ephemeris_iter->second); } } - if(d_rtcm_MT1020_rate_ms != 0) // allows deactivating messages by setting rate = 0 + if (d_rtcm_MT1020_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for(std::map::const_iterator glonass_gnav_ephemeris_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend(); glonass_gnav_ephemeris_iter++ ) + for (std::map::const_iterator glonass_gnav_ephemeris_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend(); glonass_gnav_ephemeris_iter++) { d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_ephemeris_iter->second, d_ls_pvt->glonass_gnav_utc_model); } @@ -1615,9 +1598,9 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) { std::string system(&gnss_observables_iter->second.System, 1); - if(gps_channel == 0) + if (gps_channel == 0) { - if(system.compare("G") == 0) + if (system.compare("G") == 0) { // This is a channel with valid GPS signal gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.find(gnss_observables_iter->second.PRN); @@ -1627,9 +1610,9 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite } } } - if(glo_channel == 0) + if (glo_channel == 0) { - if(system.compare("R") == 0) + if (system.compare("R") == 0) { glonass_gnav_ephemeris_iter = d_ls_pvt->glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN); if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) @@ -1652,18 +1635,18 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite b_rtcm_writing_started = true; } - if(type_of_rx == 27) // GLONASS L1 C/A + Galileo E1B + if (type_of_rx == 27) // GLONASS L1 C/A + Galileo E1B { - if(d_rtcm_MT1020_rate_ms != 0) // allows deactivating messages by setting rate = 0 + if (d_rtcm_MT1020_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for(std::map::const_iterator glonass_gnav_ephemeris_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend(); glonass_gnav_ephemeris_iter++ ) + for (std::map::const_iterator glonass_gnav_ephemeris_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend(); glonass_gnav_ephemeris_iter++) { d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_ephemeris_iter->second, d_ls_pvt->glonass_gnav_utc_model); } } - if(d_rtcm_MT1045_rate_ms != 0) // allows deactivating messages by setting rate = 0 + if (d_rtcm_MT1045_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for(galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend(); galileo_ephemeris_iter++ ) + for (galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend(); galileo_ephemeris_iter++) { d_rtcm_printer->Print_Rtcm_MT1045(galileo_ephemeris_iter->second); } @@ -1673,9 +1656,9 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) { std::string system(&gnss_observables_iter->second.System, 1); - if(gal_channel == 0) + if (gal_channel == 0) { - if(system.compare("E") == 0) + if (system.compare("E") == 0) { // This is a channel with valid GPS signal galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); @@ -1685,9 +1668,9 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite } } } - if(glo_channel == 0) + if (glo_channel == 0) { - if(system.compare("R") == 0) + if (system.compare("R") == 0) { glonass_gnav_ephemeris_iter = d_ls_pvt->glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN); if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.end()) @@ -1712,14 +1695,14 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite } // DEBUG MESSAGE: Display position in console output - if( (d_ls_pvt->is_valid_position() == true) && (flag_display_pvt == true) ) + if ((d_ls_pvt->is_valid_position() == true) && (flag_display_pvt == true)) { std::cout << "Position at " << boost::posix_time::to_simple_string(d_ls_pvt->get_position_UTC_time()) << " UTC using " << d_ls_pvt->get_num_valid_observations() << " observations is Lat = " << d_ls_pvt->get_latitude() << " [deg], Long = " << d_ls_pvt->get_longitude() << " [deg], Height= " << d_ls_pvt->get_height() << " [m]" << std::endl; LOG(INFO) << "Position at " << boost::posix_time::to_simple_string(d_ls_pvt->get_position_UTC_time()) - << " UTC using "<< d_ls_pvt->get_num_valid_observations() << " observations is Lat = " << d_ls_pvt->get_latitude() << " [deg], Long = " << d_ls_pvt->get_longitude() + << " UTC using " << d_ls_pvt->get_num_valid_observations() << " observations is Lat = " << d_ls_pvt->get_latitude() << " [deg], Long = " << d_ls_pvt->get_longitude() << " [deg], Height= " << d_ls_pvt->get_height() << " [m]"; /* std::cout << "Dilution of Precision at " << boost::posix_time::to_simple_string(d_ls_pvt->get_position_UTC_time()) @@ -1729,10 +1712,10 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite } // MULTIPLEXED FILE RECORDING - Record results to file - if(d_dump == true) + if (d_dump == true) { try - { + { double tmp_double; for (unsigned int i = 0; i < d_nchannels; i++) { @@ -1742,11 +1725,11 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); d_dump_file.write(reinterpret_cast(&d_rx_time), sizeof(double)); } - } + } catch (const std::ifstream::failure& e) - { + { LOG(WARNING) << "Exception writing observables dump file " << e.what(); - } + } } } } diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.h b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.h index 635dfb7d7..f4e4323fd 100644 --- a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.h +++ b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.h @@ -53,22 +53,22 @@ class rtklib_pvt_cc; typedef boost::shared_ptr rtklib_pvt_cc_sptr; rtklib_pvt_cc_sptr rtklib_make_pvt_cc(unsigned int n_channels, - bool dump, - std::string dump_filename, - int output_rate_ms, - int display_rate_ms, - bool flag_nmea_tty_port, - std::string nmea_dump_filename, - std::string nmea_dump_devname, - int rinex_version, - bool flag_rtcm_server, - bool flag_rtcm_tty_port, - unsigned short rtcm_tcp_port, - unsigned short rtcm_station_id, - std::map rtcm_msg_rate_ms, - std::string rtcm_dump_devname, - const unsigned int type_of_receiver, - rtk_t & rtk); + bool dump, + std::string dump_filename, + int output_rate_ms, + int display_rate_ms, + bool flag_nmea_tty_port, + std::string nmea_dump_filename, + std::string nmea_dump_devname, + int rinex_version, + bool flag_rtcm_server, + bool flag_rtcm_tty_port, + unsigned short rtcm_tcp_port, + unsigned short rtcm_station_id, + std::map rtcm_msg_rate_ms, + std::string rtcm_dump_devname, + const unsigned int type_of_receiver, + rtk_t& rtk); /*! * \brief This class implements a block that computes the PVT solution with Galileo E1 signals @@ -77,22 +77,22 @@ class rtklib_pvt_cc : public gr::sync_block { private: friend rtklib_pvt_cc_sptr rtklib_make_pvt_cc(unsigned int nchannels, - bool dump, - std::string dump_filename, - int output_rate_ms, - int display_rate_ms, - bool flag_nmea_tty_port, - std::string nmea_dump_filename, - std::string nmea_dump_devname, - int rinex_version, - bool flag_rtcm_server, - bool flag_rtcm_tty_port, - unsigned short rtcm_tcp_port, - unsigned short rtcm_station_id, - std::map rtcm_msg_rate_ms, - std::string rtcm_dump_devname, - const unsigned int type_of_receiver, - rtk_t & rtk); + bool dump, + std::string dump_filename, + int output_rate_ms, + int display_rate_ms, + bool flag_nmea_tty_port, + std::string nmea_dump_filename, + std::string nmea_dump_devname, + int rinex_version, + bool flag_rtcm_server, + bool flag_rtcm_tty_port, + unsigned short rtcm_tcp_port, + unsigned short rtcm_station_id, + std::map rtcm_msg_rate_ms, + std::string rtcm_dump_devname, + const unsigned int type_of_receiver, + rtk_t& rtk); void msg_handler_telemetry(pmt::pmt_t msg); @@ -101,15 +101,15 @@ private: bool b_rinex_header_updated; double d_rinex_version; bool b_rtcm_writing_started; - int d_rtcm_MT1045_rate_ms; //!< Galileo Broadcast Ephemeris - int d_rtcm_MT1019_rate_ms; //!< GPS Broadcast Ephemeris (orbits) - int d_rtcm_MT1020_rate_ms; //!< GLONASS Broadcast Ephemeris (orbits) - int d_rtcm_MT1077_rate_ms; //!< The type 7 Multiple Signal Message format for the USA’s GPS system, popular - int d_rtcm_MT1087_rate_ms; //!< GLONASS MSM7. The type 7 Multiple Signal Message format for the Russian GLONASS system - int d_rtcm_MT1097_rate_ms; //!< Galileo MSM7. The type 7 Multiple Signal Message format for Europe’s Galileo system + int d_rtcm_MT1045_rate_ms; //!< Galileo Broadcast Ephemeris + int d_rtcm_MT1019_rate_ms; //!< GPS Broadcast Ephemeris (orbits) + int d_rtcm_MT1020_rate_ms; //!< GLONASS Broadcast Ephemeris (orbits) + int d_rtcm_MT1077_rate_ms; //!< The type 7 Multiple Signal Message format for the USA’s GPS system, popular + int d_rtcm_MT1087_rate_ms; //!< GLONASS MSM7. The type 7 Multiple Signal Message format for the Russian GLONASS system + int d_rtcm_MT1097_rate_ms; //!< Galileo MSM7. The type 7 Multiple Signal Message format for Europe’s Galileo system int d_rtcm_MSM_rate_ms; - int d_last_status_print_seg; //for status printer + int d_last_status_print_seg; //for status printer unsigned int d_nchannels; std::string d_dump_filename; @@ -136,16 +136,17 @@ private: double last_RINEX_nav_output_time; std::shared_ptr d_ls_pvt; - std::map gnss_observables_map; - bool observables_pairCompare_min(const std::pair& a, const std::pair& b); + std::map gnss_observables_map; + bool observables_pairCompare_min(const std::pair& a, const std::pair& b); unsigned int type_of_rx; bool first_fix; key_t sysv_msg_key; int sysv_msqid; - typedef struct { - long mtype;//required by sys v message + typedef struct + { + long mtype; //required by sys v message double ttff; } ttff_msgbuf; bool send_sys_v_ttff_msg(ttff_msgbuf ttff); @@ -153,33 +154,33 @@ private: public: rtklib_pvt_cc(unsigned int nchannels, - bool dump, std::string dump_filename, - int output_rate_ms, - int display_rate_ms, - bool flag_nmea_tty_port, - std::string nmea_dump_filename, - std::string nmea_dump_devname, - int rinex_version, - bool flag_rtcm_server, - bool flag_rtcm_tty_port, - unsigned short rtcm_tcp_port, - unsigned short rtcm_station_id, - std::map rtcm_msg_rate_ms, - std::string rtcm_dump_devname, - const unsigned int type_of_receiver, - rtk_t & rtk); + bool dump, std::string dump_filename, + int output_rate_ms, + int display_rate_ms, + bool flag_nmea_tty_port, + std::string nmea_dump_filename, + std::string nmea_dump_devname, + int rinex_version, + bool flag_rtcm_server, + bool flag_rtcm_tty_port, + unsigned short rtcm_tcp_port, + unsigned short rtcm_station_id, + std::map rtcm_msg_rate_ms, + std::string rtcm_dump_devname, + const unsigned int type_of_receiver, + rtk_t& rtk); /*! * \brief Get latest set of GPS L1 ephemeris from PVT block * * It is used to save the assistance data at the receiver shutdown */ - std::map get_GPS_L1_ephemeris_map(); + std::map get_GPS_L1_ephemeris_map(); - ~rtklib_pvt_cc(); //!< Default destructor + ~rtklib_pvt_cc(); //!< Default destructor - int work (int noutput_items, gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); //!< PVT Signal Processing + int work(int noutput_items, gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items); //!< PVT Signal Processing }; #endif diff --git a/src/algorithms/PVT/libs/geojson_printer.cc b/src/algorithms/PVT/libs/geojson_printer.cc index 5820778d4..9a5973858 100644 --- a/src/algorithms/PVT/libs/geojson_printer.cc +++ b/src/algorithms/PVT/libs/geojson_printer.cc @@ -43,7 +43,7 @@ GeoJSON_Printer::GeoJSON_Printer() } -GeoJSON_Printer::~GeoJSON_Printer () +GeoJSON_Printer::~GeoJSON_Printer() { GeoJSON_Printer::close_file(); } @@ -60,37 +60,37 @@ bool GeoJSON_Printer::set_headers(std::string filename, bool time_tag_name) const int year = timeinfo.tm_year - 100; strm0 << year; const int month = timeinfo.tm_mon + 1; - if(month < 10) + if (month < 10) { strm0 << "0"; } strm0 << month; const int day = timeinfo.tm_mday; - if(day < 10) + if (day < 10) { strm0 << "0"; } strm0 << day << "_"; const int hour = timeinfo.tm_hour; - if(hour < 10) + if (hour < 10) { strm0 << "0"; } strm0 << hour; const int min = timeinfo.tm_min; - if(min < 10) + if (min < 10) { strm0 << "0"; } strm0 << min; const int sec = timeinfo.tm_sec; - if(sec < 10) + if (sec < 10) { strm0 << "0"; } strm0 << sec; - filename_ = filename + "_" + strm0.str() + ".geojson"; + filename_ = filename + "_" + strm0.str() + ".geojson"; } else { @@ -184,7 +184,7 @@ bool GeoJSON_Printer::close_file() // if nothing is written, erase the file if (first_pos == true) { - if(remove(filename_.c_str()) != 0) LOG(INFO) << "Error deleting temporary file"; + if (remove(filename_.c_str()) != 0) LOG(INFO) << "Error deleting temporary file"; } return true; @@ -194,5 +194,3 @@ bool GeoJSON_Printer::close_file() return false; } } - - diff --git a/src/algorithms/PVT/libs/geojson_printer.h b/src/algorithms/PVT/libs/geojson_printer.h index 17e080975..8c2f08d41 100644 --- a/src/algorithms/PVT/libs/geojson_printer.h +++ b/src/algorithms/PVT/libs/geojson_printer.h @@ -50,6 +50,7 @@ private: std::ofstream geojson_file; bool first_pos; std::string filename_; + public: GeoJSON_Printer(); ~GeoJSON_Printer(); diff --git a/src/algorithms/PVT/libs/hybrid_ls_pvt.cc b/src/algorithms/PVT/libs/hybrid_ls_pvt.cc index 202f01709..3197c1882 100644 --- a/src/algorithms/PVT/libs/hybrid_ls_pvt.cc +++ b/src/algorithms/PVT/libs/hybrid_ls_pvt.cc @@ -49,21 +49,21 @@ hybrid_ls_pvt::hybrid_ls_pvt(int nchannels, std::string dump_filename, bool flag this->set_averaging_flag(false); // ############# ENABLE DATA FILE LOG ################# if (d_flag_dump_enabled == true) - { - if (d_dump_file.is_open() == false) { - try - { - d_dump_file.exceptions (std::ifstream::failbit | std::ifstream::badbit); - d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); - LOG(INFO) << "PVT lib dump enabled Log file: " << d_dump_filename.c_str(); - } - catch (const std::ifstream::failure &e) - { - LOG(WARNING) << "Exception opening PVT lib dump file " << e.what(); - } + if (d_dump_file.is_open() == false) + { + try + { + d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); + d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); + LOG(INFO) << "PVT lib dump enabled Log file: " << d_dump_filename.c_str(); + } + catch (const std::ifstream::failure& e) + { + LOG(WARNING) << "Exception opening PVT lib dump file " << e.what(); + } + } } - } } @@ -72,27 +72,27 @@ hybrid_ls_pvt::~hybrid_ls_pvt() if (d_dump_file.is_open() == true) { try - { + { d_dump_file.close(); - } - catch(const std::exception & ex) - { + } + catch (const std::exception& ex) + { LOG(WARNING) << "Exception in destructor closing the dump file " << ex.what(); - } + } } } -bool hybrid_ls_pvt::get_PVT(std::map gnss_observables_map, double hybrid_current_time, bool flag_averaging) +bool hybrid_ls_pvt::get_PVT(std::map gnss_observables_map, double hybrid_current_time, bool flag_averaging) { - std::map::iterator gnss_observables_iter; - std::map::iterator galileo_ephemeris_iter; - std::map::iterator gps_ephemeris_iter; - std::map::iterator gps_cnav_ephemeris_iter; + std::map::iterator gnss_observables_iter; + std::map::iterator galileo_ephemeris_iter; + std::map::iterator gps_ephemeris_iter; + std::map::iterator gps_cnav_ephemeris_iter; - arma::vec W; // channels weight vector - arma::vec obs; // pseudoranges observation vector - arma::mat satpos; // satellite positions matrix + arma::vec W; // channels weight vector + arma::vec obs; // pseudoranges observation vector + arma::mat satpos; // satellite positions matrix int Galileo_week_number = 0; int GPS_week = 0; @@ -109,188 +109,188 @@ bool hybrid_ls_pvt::get_PVT(std::map gnss_observables_map, dou // ******************************************************************************** // ****** PREPARE THE LEAST SQUARES DATA (SV POSITIONS MATRIX AND OBS VECTORS) **** // ******************************************************************************** - int valid_obs = 0; //valid observations counter + int valid_obs = 0; //valid observations counter - for(gnss_observables_iter = gnss_observables_map.begin(); - gnss_observables_iter != gnss_observables_map.end(); - gnss_observables_iter++) + for (gnss_observables_iter = gnss_observables_map.begin(); + gnss_observables_iter != gnss_observables_map.end(); + gnss_observables_iter++) { - switch(gnss_observables_iter->second.System) - { - case 'E': + switch (gnss_observables_iter->second.System) { - // 1 Gal - find the ephemeris for the current GALILEO SV observation. The SV PRN ID is the map key - galileo_ephemeris_iter = galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (galileo_ephemeris_iter != galileo_ephemeris_map.end()) - { - /*! + case 'E': + { + // 1 Gal - find the ephemeris for the current GALILEO SV observation. The SV PRN ID is the map key + galileo_ephemeris_iter = galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); + if (galileo_ephemeris_iter != galileo_ephemeris_map.end()) + { + /*! * \todo Place here the satellite CN0 (power level, or weight factor) */ - W.resize(valid_obs + 1, 1); - W(valid_obs) = 1; + W.resize(valid_obs + 1, 1); + W(valid_obs) = 1; - // COMMON RX TIME PVT ALGORITHM - double Rx_time = hybrid_current_time; - double Tx_time = Rx_time - gnss_observables_iter->second.Pseudorange_m / GALILEO_C_m_s; + // COMMON RX TIME PVT ALGORITHM + double Rx_time = hybrid_current_time; + double Tx_time = Rx_time - gnss_observables_iter->second.Pseudorange_m / GALILEO_C_m_s; - // 2- compute the clock drift using the clock model (broadcast) for this SV - SV_clock_bias_s = galileo_ephemeris_iter->second.sv_clock_drift(Tx_time); + // 2- compute the clock drift using the clock model (broadcast) for this SV + SV_clock_bias_s = galileo_ephemeris_iter->second.sv_clock_drift(Tx_time); - // 3- compute the current ECEF position for this SV using corrected TX time - TX_time_corrected_s = Tx_time - SV_clock_bias_s; - galileo_ephemeris_iter->second.satellitePosition(TX_time_corrected_s); + // 3- compute the current ECEF position for this SV using corrected TX time + TX_time_corrected_s = Tx_time - SV_clock_bias_s; + galileo_ephemeris_iter->second.satellitePosition(TX_time_corrected_s); - //store satellite positions in a matrix - satpos.resize(3, valid_obs + 1); - satpos(0, valid_obs) = galileo_ephemeris_iter->second.d_satpos_X; - satpos(1, valid_obs) = galileo_ephemeris_iter->second.d_satpos_Y; - satpos(2, valid_obs) = galileo_ephemeris_iter->second.d_satpos_Z; + //store satellite positions in a matrix + satpos.resize(3, valid_obs + 1); + satpos(0, valid_obs) = galileo_ephemeris_iter->second.d_satpos_X; + satpos(1, valid_obs) = galileo_ephemeris_iter->second.d_satpos_Y; + satpos(2, valid_obs) = galileo_ephemeris_iter->second.d_satpos_Z; - // 4- fill the observations vector with the corrected observables - obs.resize(valid_obs + 1, 1); - obs(valid_obs) = gnss_observables_iter->second.Pseudorange_m + SV_clock_bias_s * GALILEO_C_m_s - this->get_time_offset_s() * GALILEO_C_m_s; - this->set_visible_satellites_ID(valid_obs, galileo_ephemeris_iter->second.i_satellite_PRN); - this->set_visible_satellites_CN0_dB(valid_obs, gnss_observables_iter->second.CN0_dB_hz); + // 4- fill the observations vector with the corrected observables + obs.resize(valid_obs + 1, 1); + obs(valid_obs) = gnss_observables_iter->second.Pseudorange_m + SV_clock_bias_s * GALILEO_C_m_s - this->get_time_offset_s() * GALILEO_C_m_s; + this->set_visible_satellites_ID(valid_obs, galileo_ephemeris_iter->second.i_satellite_PRN); + this->set_visible_satellites_CN0_dB(valid_obs, gnss_observables_iter->second.CN0_dB_hz); - Galileo_week_number = galileo_ephemeris_iter->second.WN_5; //for GST - GST = galileo_ephemeris_iter->second.Galileo_System_Time(Galileo_week_number, hybrid_current_time); + Galileo_week_number = galileo_ephemeris_iter->second.WN_5; //for GST + GST = galileo_ephemeris_iter->second.Galileo_System_Time(Galileo_week_number, hybrid_current_time); - // SV ECEF DEBUG OUTPUT - DLOG(INFO) << "ECEF satellite SV ID=" << galileo_ephemeris_iter->second.i_satellite_PRN - << " X=" << galileo_ephemeris_iter->second.d_satpos_X - << " [m] Y=" << galileo_ephemeris_iter->second.d_satpos_Y - << " [m] Z=" << galileo_ephemeris_iter->second.d_satpos_Z - << " [m] PR_obs=" << obs(valid_obs) << " [m]"; + // SV ECEF DEBUG OUTPUT + DLOG(INFO) << "ECEF satellite SV ID=" << galileo_ephemeris_iter->second.i_satellite_PRN + << " X=" << galileo_ephemeris_iter->second.d_satpos_X + << " [m] Y=" << galileo_ephemeris_iter->second.d_satpos_Y + << " [m] Z=" << galileo_ephemeris_iter->second.d_satpos_Z + << " [m] PR_obs=" << obs(valid_obs) << " [m]"; - valid_obs++; - } - else // the ephemeris are not available for this SV - { - DLOG(INFO) << "No ephemeris data for SV " << gnss_observables_iter->second.PRN; - } - break; - } - case 'G': - { - // 1 GPS - find the ephemeris for the current GPS SV observation. The SV PRN ID is the map key - std::string sig_(gnss_observables_iter->second.Signal); - if(sig_.compare("1C") == 0) - { - gps_ephemeris_iter = gps_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (gps_ephemeris_iter != gps_ephemeris_map.end()) - { - /*! + valid_obs++; + } + else // the ephemeris are not available for this SV + { + DLOG(INFO) << "No ephemeris data for SV " << gnss_observables_iter->second.PRN; + } + break; + } + case 'G': + { + // 1 GPS - find the ephemeris for the current GPS SV observation. The SV PRN ID is the map key + std::string sig_(gnss_observables_iter->second.Signal); + if (sig_.compare("1C") == 0) + { + gps_ephemeris_iter = gps_ephemeris_map.find(gnss_observables_iter->second.PRN); + if (gps_ephemeris_iter != gps_ephemeris_map.end()) + { + /*! * \todo Place here the satellite CN0 (power level, or weight factor) */ - W.resize(valid_obs + 1, 1); - W(valid_obs) = 1; + W.resize(valid_obs + 1, 1); + W(valid_obs) = 1; - // COMMON RX TIME PVT ALGORITHM MODIFICATION (Like RINEX files) - // first estimate of transmit time - double Rx_time = hybrid_current_time; - double Tx_time = Rx_time - gnss_observables_iter->second.Pseudorange_m / GPS_C_m_s; + // COMMON RX TIME PVT ALGORITHM MODIFICATION (Like RINEX files) + // first estimate of transmit time + double Rx_time = hybrid_current_time; + double Tx_time = Rx_time - gnss_observables_iter->second.Pseudorange_m / GPS_C_m_s; - // 2- compute the clock drift using the clock model (broadcast) for this SV, not including relativistic effect - SV_clock_bias_s = gps_ephemeris_iter->second.sv_clock_drift(Tx_time); //- gps_ephemeris_iter->second.d_TGD; + // 2- compute the clock drift using the clock model (broadcast) for this SV, not including relativistic effect + SV_clock_bias_s = gps_ephemeris_iter->second.sv_clock_drift(Tx_time); //- gps_ephemeris_iter->second.d_TGD; - // 3- compute the current ECEF position for this SV using corrected TX time and obtain clock bias including relativistic effect - TX_time_corrected_s = Tx_time - SV_clock_bias_s; - double dtr = gps_ephemeris_iter->second.satellitePosition(TX_time_corrected_s); + // 3- compute the current ECEF position for this SV using corrected TX time and obtain clock bias including relativistic effect + TX_time_corrected_s = Tx_time - SV_clock_bias_s; + double dtr = gps_ephemeris_iter->second.satellitePosition(TX_time_corrected_s); - //store satellite positions in a matrix - satpos.resize(3, valid_obs + 1); - satpos(0, valid_obs) = gps_ephemeris_iter->second.d_satpos_X; - satpos(1, valid_obs) = gps_ephemeris_iter->second.d_satpos_Y; - satpos(2, valid_obs) = gps_ephemeris_iter->second.d_satpos_Z; + //store satellite positions in a matrix + satpos.resize(3, valid_obs + 1); + satpos(0, valid_obs) = gps_ephemeris_iter->second.d_satpos_X; + satpos(1, valid_obs) = gps_ephemeris_iter->second.d_satpos_Y; + satpos(2, valid_obs) = gps_ephemeris_iter->second.d_satpos_Z; - // 4- fill the observations vector with the corrected pseudoranges - // compute code bias: TGD for single frequency - // See IS-GPS-200E section 20.3.3.3.3.2 - double sqrt_Gamma=GPS_L1_FREQ_HZ/GPS_L2_FREQ_HZ; - double Gamma=sqrt_Gamma*sqrt_Gamma; - double P1_P2=(1.0-Gamma)*(gps_ephemeris_iter->second.d_TGD* GPS_C_m_s); - double Code_bias_m= P1_P2/(1.0-Gamma); - obs.resize(valid_obs + 1, 1); - obs(valid_obs) = gnss_observables_iter->second.Pseudorange_m + dtr * GPS_C_m_s-Code_bias_m-this->get_time_offset_s() * GPS_C_m_s; - this->set_visible_satellites_ID(valid_obs, gps_ephemeris_iter->second.i_satellite_PRN); - this->set_visible_satellites_CN0_dB(valid_obs, gnss_observables_iter->second.CN0_dB_hz); + // 4- fill the observations vector with the corrected pseudoranges + // compute code bias: TGD for single frequency + // See IS-GPS-200E section 20.3.3.3.3.2 + double sqrt_Gamma = GPS_L1_FREQ_HZ / GPS_L2_FREQ_HZ; + double Gamma = sqrt_Gamma * sqrt_Gamma; + double P1_P2 = (1.0 - Gamma) * (gps_ephemeris_iter->second.d_TGD * GPS_C_m_s); + double Code_bias_m = P1_P2 / (1.0 - Gamma); + obs.resize(valid_obs + 1, 1); + obs(valid_obs) = gnss_observables_iter->second.Pseudorange_m + dtr * GPS_C_m_s - Code_bias_m - this->get_time_offset_s() * GPS_C_m_s; + this->set_visible_satellites_ID(valid_obs, gps_ephemeris_iter->second.i_satellite_PRN); + this->set_visible_satellites_CN0_dB(valid_obs, gnss_observables_iter->second.CN0_dB_hz); - // SV ECEF DEBUG OUTPUT - LOG(INFO) << "(new)ECEF GPS L1 CA satellite SV ID=" << gps_ephemeris_iter->second.i_satellite_PRN - << " TX Time corrected="<second.i_GPS_week; - } - else // the ephemeris are not available for this SV - { - DLOG(INFO) << "No ephemeris data for SV " << gnss_observables_iter->first; - } - } - if(sig_.compare("2S") == 0) - { - gps_cnav_ephemeris_iter = gps_cnav_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (gps_cnav_ephemeris_iter != gps_cnav_ephemeris_map.end()) - { - /*! + valid_obs++; + // compute the UTC time for this SV (just to print the associated UTC timestamp) + GPS_week = gps_ephemeris_iter->second.i_GPS_week; + } + else // the ephemeris are not available for this SV + { + DLOG(INFO) << "No ephemeris data for SV " << gnss_observables_iter->first; + } + } + if (sig_.compare("2S") == 0) + { + gps_cnav_ephemeris_iter = gps_cnav_ephemeris_map.find(gnss_observables_iter->second.PRN); + if (gps_cnav_ephemeris_iter != gps_cnav_ephemeris_map.end()) + { + /*! * \todo Place here the satellite CN0 (power level, or weight factor) */ - W.resize(valid_obs + 1, 1); - W(valid_obs) = 1; + W.resize(valid_obs + 1, 1); + W(valid_obs) = 1; - // COMMON RX TIME PVT ALGORITHM MODIFICATION (Like RINEX files) - // first estimate of transmit time - double Rx_time = hybrid_current_time; - double Tx_time = Rx_time - gnss_observables_iter->second.Pseudorange_m / GPS_C_m_s; + // COMMON RX TIME PVT ALGORITHM MODIFICATION (Like RINEX files) + // first estimate of transmit time + double Rx_time = hybrid_current_time; + double Tx_time = Rx_time - gnss_observables_iter->second.Pseudorange_m / GPS_C_m_s; - // 2- compute the clock drift using the clock model (broadcast) for this SV - SV_clock_bias_s = gps_cnav_ephemeris_iter->second.sv_clock_drift(Tx_time); + // 2- compute the clock drift using the clock model (broadcast) for this SV + SV_clock_bias_s = gps_cnav_ephemeris_iter->second.sv_clock_drift(Tx_time); - // 3- compute the current ECEF position for this SV using corrected TX time - TX_time_corrected_s = Tx_time - SV_clock_bias_s; - //std::cout<<"TX time["<second.i_satellite_PRN<<"]="<second.satellitePosition(TX_time_corrected_s); + // 3- compute the current ECEF position for this SV using corrected TX time + TX_time_corrected_s = Tx_time - SV_clock_bias_s; + //std::cout<<"TX time["<second.i_satellite_PRN<<"]="<second.satellitePosition(TX_time_corrected_s); - //store satellite positions in a matrix - satpos.resize(3, valid_obs + 1); - satpos(0, valid_obs) = gps_cnav_ephemeris_iter->second.d_satpos_X; - satpos(1, valid_obs) = gps_cnav_ephemeris_iter->second.d_satpos_Y; - satpos(2, valid_obs) = gps_cnav_ephemeris_iter->second.d_satpos_Z; + //store satellite positions in a matrix + satpos.resize(3, valid_obs + 1); + satpos(0, valid_obs) = gps_cnav_ephemeris_iter->second.d_satpos_X; + satpos(1, valid_obs) = gps_cnav_ephemeris_iter->second.d_satpos_Y; + satpos(2, valid_obs) = gps_cnav_ephemeris_iter->second.d_satpos_Z; - // 4- fill the observations vector with the corrected observables - obs.resize(valid_obs + 1, 1); - obs(valid_obs) = gnss_observables_iter->second.Pseudorange_m + dtr*GPS_C_m_s + SV_clock_bias_s * GPS_C_m_s; - this->set_visible_satellites_ID(valid_obs, gps_cnav_ephemeris_iter->second.i_satellite_PRN); - this->set_visible_satellites_CN0_dB(valid_obs, gnss_observables_iter->second.CN0_dB_hz); + // 4- fill the observations vector with the corrected observables + obs.resize(valid_obs + 1, 1); + obs(valid_obs) = gnss_observables_iter->second.Pseudorange_m + dtr * GPS_C_m_s + SV_clock_bias_s * GPS_C_m_s; + this->set_visible_satellites_ID(valid_obs, gps_cnav_ephemeris_iter->second.i_satellite_PRN); + this->set_visible_satellites_CN0_dB(valid_obs, gnss_observables_iter->second.CN0_dB_hz); - GPS_week = gps_cnav_ephemeris_iter->second.i_GPS_week; - GPS_week=GPS_week%1024; //Necessary due to the increase of WN bits in CNAV message (10 in GPS NAV and 13 in CNAV) + GPS_week = gps_cnav_ephemeris_iter->second.i_GPS_week; + GPS_week = GPS_week % 1024; //Necessary due to the increase of WN bits in CNAV message (10 in GPS NAV and 13 in CNAV) - // SV ECEF DEBUG OUTPUT - LOG(INFO) << "(new)ECEF GPS L2M satellite SV ID=" << gps_cnav_ephemeris_iter->second.i_satellite_PRN - << " TX Time corrected="<second.PRN; - } - } + valid_obs++; + } + else // the ephemeris are not available for this SV + { + DLOG(INFO) << "No ephemeris data for SV " << gnss_observables_iter->second.PRN; + } + } + break; + } + default: + DLOG(INFO) << "Hybrid observables: Unknown GNSS"; break; } - default : - DLOG(INFO) << "Hybrid observables: Unknown GNSS"; - break; - } } // ******************************************************************************** @@ -300,35 +300,35 @@ bool hybrid_ls_pvt::get_PVT(std::map gnss_observables_map, dou LOG(INFO) << "HYBRID PVT: valid observations=" << valid_obs; - if(valid_obs >= 4) + if (valid_obs >= 4) { arma::vec rx_position_and_time; DLOG(INFO) << "satpos=" << satpos; DLOG(INFO) << "obs=" << obs; DLOG(INFO) << "W=" << W; try - { + { // check if this is the initial position computation if (this->get_time_offset_s() == 0) { // execute Bancroft's algorithm to estimate initial receiver position and time DLOG(INFO) << " Executing Bancroft algorithm..."; rx_position_and_time = bancroftPos(satpos.t(), obs); - this->set_rx_pos(rx_position_and_time.rows(0, 2)); // save ECEF position for the next iteration - this->set_time_offset_s(rx_position_and_time(3) / GPS_C_m_s); // save time for the next iteration [meters]->[seconds] + this->set_rx_pos(rx_position_and_time.rows(0, 2)); // save ECEF position for the next iteration + this->set_time_offset_s(rx_position_and_time(3) / GPS_C_m_s); // save time for the next iteration [meters]->[seconds] } // Execute WLS using previous position as the initialization point rx_position_and_time = leastSquarePos(satpos, obs, W); - this->set_rx_pos(rx_position_and_time.rows(0, 2)); // save ECEF position for the next iteration - this->set_time_offset_s(this->get_time_offset_s() + rx_position_and_time(3) / GPS_C_m_s); // accumulate the rx time error for the next iteration [meters]->[seconds] + this->set_rx_pos(rx_position_and_time.rows(0, 2)); // save ECEF position for the next iteration + this->set_time_offset_s(this->get_time_offset_s() + rx_position_and_time(3) / GPS_C_m_s); // accumulate the rx time error for the next iteration [meters]->[seconds] DLOG(INFO) << "Hybrid Position at TOW=" << hybrid_current_time << " in ECEF (X,Y,Z,t[meters]) = " << rx_position_and_time; DLOG(INFO) << "Accumulated rx clock error=" << this->get_time_offset_s() << " clock error for this iteration=" << rx_position_and_time(3) / GPS_C_m_s << " [s]"; // Compute GST and Gregorian time - if( GST != 0.0) + if (GST != 0.0) { utc = galileo_utc_model.GST_to_UTC_time(GST, Galileo_week_number); } @@ -347,17 +347,18 @@ bool hybrid_ls_pvt::get_PVT(std::map gnss_observables_map, dou DLOG(INFO) << "Hybrid Position at " << boost::posix_time::to_simple_string(p_time) << " is Lat = " << this->get_latitude() << " [deg], Long = " << this->get_longitude() - << " [deg], Height= " << this->get_height() << " [m]" << " RX time offset= " << this->get_time_offset_s() << " [s]"; + << " [deg], Height= " << this->get_height() << " [m]" + << " RX time offset= " << this->get_time_offset_s() << " [s]"; // ###### Compute DOPs ######## hybrid_ls_pvt::compute_DOP(); // ######## LOG FILE ######### - if(d_flag_dump_enabled == true) + if (d_flag_dump_enabled == true) { // MULTIPLEXED FILE RECORDING - Record results to file try - { + { double tmp_double; // PVT GPS time tmp_double = hybrid_current_time; @@ -383,22 +384,22 @@ bool hybrid_ls_pvt::get_PVT(std::map gnss_observables_map, dou // GEO user position Height [m] tmp_double = this->get_height(); d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); - } + } catch (const std::ifstream::failure& e) - { + { LOG(WARNING) << "Exception writing PVT LS dump file " << e.what(); - } + } } // MOVING AVERAGE PVT this->perform_pos_averaging(); - } - catch(const std::exception & e) - { - this->set_time_offset_s(0.0); //reset rx time estimation + } + catch (const std::exception& e) + { + this->set_time_offset_s(0.0); //reset rx time estimation LOG(WARNING) << "Problem with the solver, invalid solution!" << e.what(); this->set_valid_position(false); - } + } } else { diff --git a/src/algorithms/PVT/libs/hybrid_ls_pvt.h b/src/algorithms/PVT/libs/hybrid_ls_pvt.h index 37fb6e15d..a4cb780a0 100644 --- a/src/algorithms/PVT/libs/hybrid_ls_pvt.h +++ b/src/algorithms/PVT/libs/hybrid_ls_pvt.h @@ -52,18 +52,19 @@ private: bool d_flag_dump_enabled; std::string d_dump_filename; std::ofstream d_dump_file; - int d_nchannels; // Number of available channels for positioning + int d_nchannels; // Number of available channels for positioning double d_galileo_current_time; + public: - hybrid_ls_pvt(int nchannels,std::string dump_filename, bool flag_dump_to_file); + hybrid_ls_pvt(int nchannels, std::string dump_filename, bool flag_dump_to_file); ~hybrid_ls_pvt(); - bool get_PVT(std::map gnss_observables_map, double Rx_time, bool flag_averaging); + bool get_PVT(std::map gnss_observables_map, double Rx_time, bool flag_averaging); + + std::map galileo_ephemeris_map; //!< Map storing new Galileo_Ephemeris + std::map gps_ephemeris_map; //!< Map storing new GPS_Ephemeris + std::map gps_cnav_ephemeris_map; - std::map galileo_ephemeris_map; //!< Map storing new Galileo_Ephemeris - std::map gps_ephemeris_map; //!< Map storing new GPS_Ephemeris - std::map gps_cnav_ephemeris_map; - Galileo_Utc_Model galileo_utc_model; Galileo_Iono galileo_iono; Galileo_Almanac galileo_almanac; diff --git a/src/algorithms/PVT/libs/kml_printer.cc b/src/algorithms/PVT/libs/kml_printer.cc index 7e6e53ae5..b59ddc11c 100644 --- a/src/algorithms/PVT/libs/kml_printer.cc +++ b/src/algorithms/PVT/libs/kml_printer.cc @@ -36,7 +36,7 @@ using google::LogMessage; -bool Kml_Printer::set_headers(std::string filename, bool time_tag_name) +bool Kml_Printer::set_headers(std::string filename, bool time_tag_name) { boost::posix_time::ptime pt = boost::posix_time::second_clock::local_time(); tm timeinfo = boost::posix_time::to_tm(pt); @@ -47,37 +47,37 @@ bool Kml_Printer::set_headers(std::string filename, bool time_tag_name) const int year = timeinfo.tm_year - 100; strm0 << year; const int month = timeinfo.tm_mon + 1; - if(month < 10) + if (month < 10) { strm0 << "0"; } strm0 << month; const int day = timeinfo.tm_mday; - if(day < 10) + if (day < 10) { strm0 << "0"; } strm0 << day << "_"; const int hour = timeinfo.tm_hour; - if(hour < 10) + if (hour < 10) { strm0 << "0"; } strm0 << hour; const int min = timeinfo.tm_min; - if(min < 10) + if (min < 10) { strm0 << "0"; } strm0 << min; const int sec = timeinfo.tm_sec; - if(sec < 10) + if (sec < 10) { strm0 << "0"; } strm0 << sec; - kml_filename = filename + "_" + strm0.str() + ".kml"; + kml_filename = filename + "_" + strm0.str() + ".kml"; } else { @@ -92,29 +92,29 @@ bool Kml_Printer::set_headers(std::string filename, bool time_tag_name) kml_file.setf(kml_file.fixed, kml_file.floatfield); kml_file << std::setprecision(14); kml_file << "" << std::endl - << "" << std::endl - << " " << std::endl - << " GNSS Track" << std::endl - << " GNSS-SDR Receiver position log file created at " << pt - << " " << std::endl - << "" << std::endl - << "" << std::endl - << "GNSS-SDR PVT" << std::endl - << "GNSS-SDR position log" << std::endl - << "#yellowLineGreenPoly" << std::endl - << "" << std::endl - << "0" << std::endl - << "1" << std::endl - << "absolute" << std::endl - << "" << std::endl; + << "" << std::endl + << " " << std::endl + << " GNSS Track" << std::endl + << " GNSS-SDR Receiver position log file created at " << pt + << " " << std::endl + << "" << std::endl + << "" << std::endl + << "GNSS-SDR PVT" << std::endl + << "GNSS-SDR position log" << std::endl + << "#yellowLineGreenPoly" << std::endl + << "" << std::endl + << "0" << std::endl + << "1" << std::endl + << "absolute" << std::endl + << "" << std::endl; return true; } else @@ -124,7 +124,6 @@ bool Kml_Printer::set_headers(std::string filename, bool time_tag_name) } - bool Kml_Printer::print_position(const std::shared_ptr& position, bool print_average_values) { double latitude; @@ -164,7 +163,6 @@ bool Kml_Printer::close_file() { if (kml_file.is_open()) { - kml_file << "" << std::endl << "" << std::endl << "" << std::endl @@ -180,20 +178,17 @@ bool Kml_Printer::close_file() } - -Kml_Printer::Kml_Printer () +Kml_Printer::Kml_Printer() { positions_printed = false; } - -Kml_Printer::~Kml_Printer () +Kml_Printer::~Kml_Printer() { close_file(); - if(!positions_printed) + if (!positions_printed) { - if(remove(kml_filename.c_str()) != 0) LOG(INFO) << "Error deleting temporary KML file"; + if (remove(kml_filename.c_str()) != 0) LOG(INFO) << "Error deleting temporary KML file"; } } - diff --git a/src/algorithms/PVT/libs/kml_printer.h b/src/algorithms/PVT/libs/kml_printer.h index 9a0ca8a2f..01907e121 100644 --- a/src/algorithms/PVT/libs/kml_printer.h +++ b/src/algorithms/PVT/libs/kml_printer.h @@ -50,6 +50,7 @@ private: std::ofstream kml_file; bool positions_printed; std::string kml_filename; + public: Kml_Printer(); ~Kml_Printer(); diff --git a/src/algorithms/PVT/libs/ls_pvt.cc b/src/algorithms/PVT/libs/ls_pvt.cc index daef8f3f2..27be29287 100644 --- a/src/algorithms/PVT/libs/ls_pvt.cc +++ b/src/algorithms/PVT/libs/ls_pvt.cc @@ -41,7 +41,6 @@ using google::LogMessage; Ls_Pvt::Ls_Pvt() : Pvt_Solution() { - } arma::vec Ls_Pvt::bancroftPos(const arma::mat& satpos, const arma::vec& obs) @@ -70,7 +69,7 @@ arma::vec Ls_Pvt::bancroftPos(const arma::mat& satpos, const arma::vec& obs) // 6995655.459 -23537808.269 -9927906.485 24222112.972 ]; // Solution: 596902.683 -4847843.316 4088216.740 - arma::vec pos = arma::zeros(4,1); + arma::vec pos = arma::zeros(4, 1); arma::mat B_pass = arma::zeros(obs.size(), 4); B_pass.submat(0, 0, obs.size() - 1, 2) = satpos; B_pass.col(3) = obs; @@ -81,27 +80,27 @@ arma::vec Ls_Pvt::bancroftPos(const arma::mat& satpos, const arma::vec& obs) for (int iter = 0; iter < 2; iter++) { B = B_pass; - int m = arma::size(B,0); + int m = arma::size(B, 0); for (int i = 0; i < m; i++) { - int x = B(i,0); - int y = B(i,1); + int x = B(i, 0); + int y = B(i, 1); if (iter == 0) { traveltime = 0.072; } else { - int z = B(i,2); + int z = B(i, 2); double rho = (x - pos(0)) * (x - pos(0)) + (y - pos(1)) * (y - pos(1)) + (z - pos(2)) * (z - pos(2)); traveltime = sqrt(rho) / GPS_C_m_s; } double angle = traveltime * 7.292115147e-5; double cosa = cos(angle); double sina = sin(angle); - B(i,0) = cosa * x + sina * y; - B(i,1) = -sina * x + cosa * y; - }// % i-loop + B(i, 0) = cosa * x + sina * y; + B(i, 1) = -sina * x + cosa * y; + } // % i-loop if (m > 3) { @@ -111,8 +110,8 @@ arma::vec Ls_Pvt::bancroftPos(const arma::mat& satpos, const arma::vec& obs) { BBB = arma::inv(B); } - arma::vec e = arma::ones(m,1); - arma::vec alpha = arma::zeros(m,1); + arma::vec e = arma::ones(m, 1); + arma::vec alpha = arma::zeros(m, 1); for (int i = 0; i < m; i++) { alpha(i) = lorentz(B.row(i).t(), B.row(i).t()) / 2.0; @@ -124,24 +123,24 @@ arma::vec Ls_Pvt::bancroftPos(const arma::mat& satpos, const arma::vec& obs) double c = lorentz(BBBalpha, BBBalpha); double root = sqrt(b * b - a * c); arma::vec r = {(-b - root) / a, (-b + root) / a}; - arma::mat possible_pos = arma::zeros(4,2); + arma::mat possible_pos = arma::zeros(4, 2); for (int i = 0; i < 2; i++) { possible_pos.col(i) = r(i) * BBBe + BBBalpha; - possible_pos(3,i) = -possible_pos(3,i); + possible_pos(3, i) = -possible_pos(3, i); } - arma::vec abs_omc = arma::zeros(2,1); + arma::vec abs_omc = arma::zeros(2, 1); for (int j = 0; j < m; j++) { for (int i = 0; i < 2; i++) { - double c_dt = possible_pos(3,i); - double calc = arma::norm(satpos.row(i).t() - possible_pos.col(i).rows(0,2)) + c_dt; + double c_dt = possible_pos(3, i); + double calc = arma::norm(satpos.row(i).t() - possible_pos.col(i).rows(0, 2)) + c_dt; double omc = obs(j) - calc; abs_omc(i) = std::abs(omc); } - } // % j-loop + } // % j-loop // discrimination between roots if (abs_omc(0) > abs_omc(1)) @@ -152,7 +151,7 @@ arma::vec Ls_Pvt::bancroftPos(const arma::mat& satpos, const arma::vec& obs) { pos = possible_pos.col(0); } - } // % iter loop + } // % iter loop return pos; } @@ -167,11 +166,11 @@ double Ls_Pvt::lorentz(const arma::vec& x, const arma::vec& y) // M = diag([1 1 1 -1]); // p = x'*M*y; - return(x(0) * y(0) + x(1) * y(1) + x(2) * y(2) - x(3) * y(3)); + return (x(0) * y(0) + x(1) * y(1) + x(2) * y(2) - x(3) * y(3)); } -arma::vec Ls_Pvt::leastSquarePos(const arma::mat & satpos, const arma::vec & obs, const arma::vec & w_vec) +arma::vec Ls_Pvt::leastSquarePos(const arma::mat& satpos, const arma::vec& obs, const arma::vec& w_vec) { /* Computes the Least Squares Solution. * Inputs: @@ -185,14 +184,14 @@ arma::vec Ls_Pvt::leastSquarePos(const arma::mat & satpos, const arma::vec & obs */ //=== Initialization ======================================================= - int nmbOfIterations = 10; // TODO: include in config + int nmbOfIterations = 10; // TODO: include in config int nmbOfSatellites; - nmbOfSatellites = satpos.n_cols; // Armadillo + nmbOfSatellites = satpos.n_cols; // Armadillo arma::mat w = arma::zeros(nmbOfSatellites, nmbOfSatellites); - w.diag() = w_vec; //diagonal weight matrix + w.diag() = w_vec; //diagonal weight matrix arma::vec rx_pos = this->get_rx_pos(); - arma::vec pos = {rx_pos(0), rx_pos(1), rx_pos(2), 0}; // time error in METERS (time x speed) + arma::vec pos = {rx_pos(0), rx_pos(1), rx_pos(2), 0}; // time error in METERS (time x speed) arma::mat A; arma::mat omc; A = arma::zeros(nmbOfSatellites, 4); @@ -215,31 +214,33 @@ arma::vec Ls_Pvt::leastSquarePos(const arma::mat & satpos, const arma::vec & obs if (iter == 0) { //--- Initialize variables at the first iteration -------------- - Rot_X = X.col(i); //Armadillo + Rot_X = X.col(i); //Armadillo trop = 0.0; } else { //--- Update equations ----------------------------------------- rho2 = (X(0, i) - pos(0)) * - (X(0, i) - pos(0)) + (X(1, i) - pos(1)) * - (X(1, i) - pos(1)) + (X(2, i) - pos(2)) * - (X(2, i) - pos(2)); + (X(0, i) - pos(0)) + + (X(1, i) - pos(1)) * + (X(1, i) - pos(1)) + + (X(2, i) - pos(2)) * + (X(2, i) - pos(2)); traveltime = sqrt(rho2) / GPS_C_m_s; //--- Correct satellite position (do to earth rotation) -------- - Rot_X = Ls_Pvt::rotateSatellite(traveltime, X.col(i)); //armadillo + Rot_X = Ls_Pvt::rotateSatellite(traveltime, X.col(i)); //armadillo //--- Find DOA and range of satellites - double * azim = 0; - double * elev = 0; - double * dist = 0; - Ls_Pvt::topocent(azim, elev, dist, pos.subvec(0,2), Rot_X - pos.subvec(0, 2)); + double* azim = 0; + double* elev = 0; + double* dist = 0; + Ls_Pvt::topocent(azim, elev, dist, pos.subvec(0, 2), Rot_X - pos.subvec(0, 2)); this->set_visible_satellites_Az(i, *azim); this->set_visible_satellites_El(i, *elev); this->set_visible_satellites_Distance(i, *dist); - if(traveltime < 0.1 && nmbOfSatellites > 3) + if (traveltime < 0.1 && nmbOfSatellites > 3) { //--- Find receiver's height Ls_Pvt::togeod(&dphi, &dlambda, &h, 6378137.0, 298.257223563, pos(0), pos(1), pos(2)); @@ -253,29 +254,29 @@ arma::vec Ls_Pvt::leastSquarePos(const arma::mat & satpos, const arma::vec & obs { //--- Find delay due to troposphere (in meters) Ls_Pvt::tropo(&trop, sin(this->get_visible_satellites_El(i) * GPS_PI / 180.0), h / 1000.0, 1013.0, 293.0, 50.0, 0.0, 0.0, 0.0); - if(trop > 5.0 ) trop = 0.0; //check for erratic values + if (trop > 5.0) trop = 0.0; //check for erratic values } } } //--- Apply the corrections ---------------------------------------- - omc(i) = (obs(i) - norm(Rot_X - pos.subvec(0, 2), 2) - pos(3) - trop); // Armadillo + omc(i) = (obs(i) - norm(Rot_X - pos.subvec(0, 2), 2) - pos(3) - trop); // Armadillo //--- Construct the A matrix --------------------------------------- //Armadillo - A(i,0) = (-(Rot_X(0) - pos(0))) / obs(i); - A(i,1) = (-(Rot_X(1) - pos(1))) / obs(i); - A(i,2) = (-(Rot_X(2) - pos(2))) / obs(i); - A(i,3) = 1.0; + A(i, 0) = (-(Rot_X(0) - pos(0))) / obs(i); + A(i, 1) = (-(Rot_X(1) - pos(1))) / obs(i); + A(i, 2) = (-(Rot_X(2) - pos(2))) / obs(i); + A(i, 3) = 1.0; } //--- Find position update --------------------------------------------- - x = arma::solve(w*A, w*omc); // Armadillo + x = arma::solve(w * A, w * omc); // Armadillo //--- Apply position update -------------------------------------------- pos = pos + x; - if (arma::norm(x,2) < 1e-4) + if (arma::norm(x, 2) < 1e-4) { - break; // exit the loop because we assume that the LS algorithm has converged (err < 0.1 cm) + break; // exit the loop because we assume that the LS algorithm has converged (err < 0.1 cm) } } @@ -290,5 +291,3 @@ arma::vec Ls_Pvt::leastSquarePos(const arma::mat & satpos, const arma::vec & obs } return pos; } - - diff --git a/src/algorithms/PVT/libs/ls_pvt.h b/src/algorithms/PVT/libs/ls_pvt.h index 9332c198c..692d6e026 100644 --- a/src/algorithms/PVT/libs/ls_pvt.h +++ b/src/algorithms/PVT/libs/ls_pvt.h @@ -45,20 +45,20 @@ private: /*! * \brief Computes the Lorentz inner product between two vectors */ - double lorentz(const arma::vec & x,const arma::vec & y); + double lorentz(const arma::vec& x, const arma::vec& y); + public: Ls_Pvt(); /*! * \brief Computes the initial position solution based on the Bancroft algorithm */ - arma::vec bancroftPos(const arma::mat & satpos, const arma::vec & obs); + arma::vec bancroftPos(const arma::mat& satpos, const arma::vec& obs); /*! * \brief Computes the Weighted Least Squares position solution */ - arma::vec leastSquarePos(const arma::mat & satpos, const arma::vec & obs, const arma::vec & w_vec); - + arma::vec leastSquarePos(const arma::mat& satpos, const arma::vec& obs, const arma::vec& w_vec); }; #endif diff --git a/src/algorithms/PVT/libs/nmea_printer.cc b/src/algorithms/PVT/libs/nmea_printer.cc index f2fcda3e8..305a89a07 100644 --- a/src/algorithms/PVT/libs/nmea_printer.cc +++ b/src/algorithms/PVT/libs/nmea_printer.cc @@ -79,7 +79,7 @@ Nmea_Printer::~Nmea_Printer() } -int Nmea_Printer::init_serial (std::string serial_device) +int Nmea_Printer::init_serial(std::string serial_device) { /*! * Opens the serial device and sets the default baud rate for a NMEA transmission (9600,8,N,1) @@ -93,12 +93,12 @@ int Nmea_Printer::init_serial (std::string serial_device) long PARITY; fd = open(serial_device.c_str(), O_RDWR | O_NOCTTY | O_NDELAY); - if (fd == -1) return fd; //failed to open TTY port + if (fd == -1) return fd; //failed to open TTY port - if(fcntl(fd, F_SETFL, 0) == -1) LOG(INFO) << "Error enabling direct I/O"; // clear all flags on descriptor, enable direct I/O - tcgetattr(fd, &options); // read serial port options + if (fcntl(fd, F_SETFL, 0) == -1) LOG(INFO) << "Error enabling direct I/O"; // clear all flags on descriptor, enable direct I/O + tcgetattr(fd, &options); // read serial port options - BAUD = B9600; + BAUD = B9600; //BAUD = B38400; DATABITS = CS8; STOPBITS = 0; @@ -116,7 +116,7 @@ int Nmea_Printer::init_serial (std::string serial_device) } -void Nmea_Printer::close_serial () +void Nmea_Printer::close_serial() { if (nmea_dev_descriptor != -1) { @@ -149,7 +149,7 @@ bool Nmea_Printer::Print_Nmea_Line(const std::shared_ptr& pvt_data // write to log file try - { + { //GPRMC nmea_file_descriptor << GPRMC; //GPGGA (Global Positioning System Fixed Data) @@ -158,31 +158,32 @@ bool Nmea_Printer::Print_Nmea_Line(const std::shared_ptr& pvt_data nmea_file_descriptor << GPGSA; //GPGSV nmea_file_descriptor << GPGSV; - } - catch(const std::exception & ex) - { - DLOG(INFO) << "NMEA printer can not write on output file" << nmea_filename.c_str();; - } + } + catch (const std::exception& ex) + { + DLOG(INFO) << "NMEA printer can not write on output file" << nmea_filename.c_str(); + ; + } //write to serial device - if (nmea_dev_descriptor!=-1) + if (nmea_dev_descriptor != -1) { - if(write(nmea_dev_descriptor, GPRMC.c_str(), GPRMC.length()) == -1) + if (write(nmea_dev_descriptor, GPRMC.c_str(), GPRMC.length()) == -1) { DLOG(INFO) << "NMEA printer cannot write on serial device" << nmea_devname.c_str(); return false; } - if(write(nmea_dev_descriptor, GPGGA.c_str(), GPGGA.length()) == -1) + if (write(nmea_dev_descriptor, GPGGA.c_str(), GPGGA.length()) == -1) { DLOG(INFO) << "NMEA printer cannot write on serial device" << nmea_devname.c_str(); return false; } - if(write(nmea_dev_descriptor, GPGSA.c_str(), GPGSA.length()) == -1) + if (write(nmea_dev_descriptor, GPGSA.c_str(), GPGSA.length()) == -1) { DLOG(INFO) << "NMEA printer cannot write on serial device" << nmea_devname.c_str(); return false; } - if(write(nmea_dev_descriptor, GPGSV.c_str(), GPGSV.length()) == -1) + if (write(nmea_dev_descriptor, GPGSV.c_str(), GPGSV.length()) == -1) { DLOG(INFO) << "NMEA printer cannot write on serial device" << nmea_devname.c_str(); return false; @@ -211,7 +212,7 @@ std::string Nmea_Printer::latitude_to_hm(double lat) if (lat < 0.0) { north = false; - lat = -lat ; + lat = -lat; } else { @@ -220,7 +221,7 @@ std::string Nmea_Printer::latitude_to_hm(double lat) int deg = static_cast(lat); double mins = lat - static_cast(deg); - mins *= 60.0 ; + mins *= 60.0; std::ostringstream out_string; out_string.setf(std::ios::fixed, std::ios::floatfield); out_string.fill('0'); @@ -249,7 +250,7 @@ std::string Nmea_Printer::longitude_to_hm(double longitude) if (longitude < 0.0) { east = false; - longitude = -longitude ; + longitude = -longitude; } else { @@ -257,7 +258,7 @@ std::string Nmea_Printer::longitude_to_hm(double longitude) } int deg = static_cast(longitude); double mins = longitude - static_cast(deg); - mins *= 60.0 ; + mins *= 60.0; std::ostringstream out_string; out_string.setf(std::ios::fixed, std::ios::floatfield); out_string.width(3); @@ -294,30 +295,30 @@ std::string Nmea_Printer::get_UTC_NMEA_time(boost::posix_time::ptime d_position_ utc_hours = td.hours(); utc_mins = td.minutes(); utc_seconds = td.seconds(); - utc_milliseconds = td.total_milliseconds() - td.total_seconds()*1000; + utc_milliseconds = td.total_milliseconds() - td.total_seconds() * 1000; - if (utc_hours < 10) sentence_str << "0"; // two digits for hours + if (utc_hours < 10) sentence_str << "0"; // two digits for hours sentence_str << utc_hours; - if (utc_mins < 10) sentence_str << "0"; // two digits for minutes + if (utc_mins < 10) sentence_str << "0"; // two digits for minutes sentence_str << utc_mins; - if (utc_seconds < 10) sentence_str << "0"; // two digits for seconds + if (utc_seconds < 10) sentence_str << "0"; // two digits for seconds sentence_str << utc_seconds; if (utc_milliseconds < 10) { - sentence_str << ".00"; // three digits for ms + sentence_str << ".00"; // three digits for ms sentence_str << utc_milliseconds; } else if (utc_milliseconds < 100) { - sentence_str << ".0"; // three digits for ms + sentence_str << ".0"; // three digits for ms sentence_str << utc_milliseconds; } else { - sentence_str << "."; // three digits for ms + sentence_str << "."; // three digits for ms sentence_str << utc_milliseconds; } return sentence_str.str(); @@ -450,7 +451,7 @@ std::string Nmea_Printer::get_GPGSA() // 1 fix not available // 2 fix 2D // 3 fix 3D - if (valid_fix==true) + if (valid_fix == true) { sentence_str << ",3"; } @@ -460,7 +461,7 @@ std::string Nmea_Printer::get_GPGSA() }; // Used satellites - for (int i=0; i<12; i++) + for (int i = 0; i < 12; i++) { sentence_str << ","; if (i < n_sats_used) @@ -479,7 +480,7 @@ std::string Nmea_Printer::get_GPGSA() sentence_str.fill('0'); sentence_str << pdop; //HDOP - sentence_str<<","; + sentence_str << ","; sentence_str.setf(std::ios::fixed, std::ios::floatfield); sentence_str.width(2); sentence_str.precision(1); @@ -528,7 +529,7 @@ std::string Nmea_Printer::get_GPGSV() // generate the frames int current_satellite = 0; - for (int i=1; i<(n_frames+1); i++) + for (int i = 1; i < (n_frames + 1); i++) { frame_str.str(""); frame_str << sentence_header; @@ -547,7 +548,7 @@ std::string Nmea_Printer::get_GPGSV() frame_str << std::dec << n_sats_used; //satellites info - for (int j=0; j<4; j++) + for (int j = 0; j < 4; j++) { // write satellite info frame_str << ","; @@ -601,7 +602,7 @@ std::string Nmea_Printer::get_GPGGA() { //boost::posix_time::ptime d_position_UTC_time=boost::posix_time::microsec_clock::universal_time(); bool valid_fix = d_PVT_data->is_valid_position(); - int n_channels = d_PVT_data->get_num_valid_observations();//d_nchannels + int n_channels = d_PVT_data->get_num_valid_observations(); //d_nchannels double hdop = d_PVT_data->get_HDOP(); double MSL_altitude; @@ -708,4 +709,3 @@ std::string Nmea_Printer::get_GPGGA() return sentence_str.str(); //$GPGGA,104427.591,5920.7009,N,01803.2938,E,1,05,3.3,78.2,M,23.2,M,0.0,0000*4A } - diff --git a/src/algorithms/PVT/libs/nmea_printer.h b/src/algorithms/PVT/libs/nmea_printer.h index 0e378ca8b..c1b671d1a 100644 --- a/src/algorithms/PVT/libs/nmea_printer.h +++ b/src/algorithms/PVT/libs/nmea_printer.h @@ -66,17 +66,17 @@ public: ~Nmea_Printer(); private: - std::string nmea_filename; // String with the NMEA log filename - std::ofstream nmea_file_descriptor; // Output file stream for NMEA log file + std::string nmea_filename; // String with the NMEA log filename + std::ofstream nmea_file_descriptor; // Output file stream for NMEA log file std::string nmea_devname; - int nmea_dev_descriptor; // NMEA serial device descriptor (i.e. COM port) + int nmea_dev_descriptor; // NMEA serial device descriptor (i.e. COM port) std::shared_ptr d_PVT_data; - int init_serial(std::string serial_device); //serial port control + int init_serial(std::string serial_device); //serial port control void close_serial(); - std::string get_GPGGA(); // fix data - std::string get_GPGSV(); // satellite data - std::string get_GPGSA(); // overall satellite reception data - std::string get_GPRMC(); // minimum recommended data + std::string get_GPGGA(); // fix data + std::string get_GPGSV(); // satellite data + std::string get_GPGSA(); // overall satellite reception data + std::string get_GPRMC(); // minimum recommended data std::string get_UTC_NMEA_time(boost::posix_time::ptime d_position_UTC_time); std::string longitude_to_hm(double longitude); std::string latitude_to_hm(double lat); diff --git a/src/algorithms/PVT/libs/pvt_solution.cc b/src/algorithms/PVT/libs/pvt_solution.cc index 5872d5ba7..e38da70f7 100644 --- a/src/algorithms/PVT/libs/pvt_solution.cc +++ b/src/algorithms/PVT/libs/pvt_solution.cc @@ -55,11 +55,11 @@ Pvt_Solution::Pvt_Solution() b_valid_position = false; d_averaging_depth = 0; d_valid_observations = 0; - d_rx_pos = arma::zeros(3,1); + d_rx_pos = arma::zeros(3, 1); d_rx_dt_s = 0.0; } -arma::vec Pvt_Solution::rotateSatellite(double const traveltime, const arma::vec & X_sat) +arma::vec Pvt_Solution::rotateSatellite(double const traveltime, const arma::vec &X_sat) { /* * Returns rotated satellite ECEF coordinates due to Earth @@ -78,7 +78,7 @@ arma::vec Pvt_Solution::rotateSatellite(double const traveltime, const arma::vec omegatau = OMEGA_EARTH_DOT * traveltime; //--- Build a rotation matrix ---------------------------------------------- - arma::mat R3 = arma::zeros(3,3); + arma::mat R3 = arma::zeros(3, 3); R3(0, 0) = cos(omegatau); R3(0, 1) = sin(omegatau); R3(0, 2) = 0.0; @@ -112,7 +112,7 @@ int Pvt_Solution::cart2geo(double X, double Y, double Z, int elipsoid_selection) const double a[5] = {6378388.0, 6378160.0, 6378135.0, 6378137.0, 6378137.0}; const double f[5] = {1.0 / 297.0, 1.0 / 298.247, 1.0 / 298.26, 1.0 / 298.257222101, 1.0 / 298.257223563}; - double lambda = atan2(Y, X); + double lambda = atan2(Y, X); double ex2 = (2.0 - f[elipsoid_selection]) * f[elipsoid_selection] / ((1.0 - f[elipsoid_selection]) * (1.0 - f[elipsoid_selection])); double c = a[elipsoid_selection] * sqrt(1.0 + ex2); double phi = atan(Z / ((sqrt(X * X + Y * Y) * (1.0 - (2.0 - f[elipsoid_selection])) * f[elipsoid_selection]))); @@ -125,7 +125,7 @@ int Pvt_Solution::cart2geo(double X, double Y, double Z, int elipsoid_selection) { oldh = h; N = c / sqrt(1 + ex2 * (cos(phi) * cos(phi))); - phi = atan(Z / ((sqrt(X * X + Y * Y) * (1.0 - (2.0 - f[elipsoid_selection]) * f[elipsoid_selection] * N / (N + h) )))); + phi = atan(Z / ((sqrt(X * X + Y * Y) * (1.0 - (2.0 - f[elipsoid_selection]) * f[elipsoid_selection] * N / (N + h))))); h = sqrt(X * X + Y * Y) / cos(phi) - N; iterations = iterations + 1; if (iterations > 100) @@ -182,7 +182,7 @@ int Pvt_Solution::togeod(double *dphi, double *dlambda, double *h, double a, dou } // first guess - double P = sqrt(X * X + Y * Y); // P is distance from spin axis + double P = sqrt(X * X + Y * Y); // P is distance from spin axis //direct calculation of longitude if (P > 1.0E-20) @@ -200,12 +200,12 @@ int Pvt_Solution::togeod(double *dphi, double *dlambda, double *h, double a, dou *dlambda = *dlambda + 360.0; } - double r = sqrt(P * P + Z * Z); // r is distance from origin (0,0,0) + double r = sqrt(P * P + Z * Z); // r is distance from origin (0,0,0) double sinphi; if (r > 1.0E-20) { - sinphi = Z/r; + sinphi = Z / r; } else { @@ -221,7 +221,7 @@ int Pvt_Solution::togeod(double *dphi, double *dlambda, double *h, double a, dou return 1; } - *h = r - a * (1 - sinphi * sinphi/finv); + *h = r - a * (1 - sinphi * sinphi / finv); // iterate double cosphi; @@ -244,7 +244,7 @@ int Pvt_Solution::togeod(double *dphi, double *dlambda, double *h, double a, dou // update height and latitude *h = *h + (sinphi * dZ + cosphi * dP); - *dphi = *dphi + (cosphi * dZ - sinphi * dP)/(N_phi + (*h)); + *dphi = *dphi + (cosphi * dZ - sinphi * dP) / (N_phi + (*h)); // test for convergence if ((dP * dP + dZ * dZ) < tolsq) @@ -285,61 +285,66 @@ int Pvt_Solution::tropo(double *ddr_m, double sinel, double hsta_km, double p_mb Translated to C++ by Carles Fernandez from a Matlab implementation by Kai Borre */ - const double a_e = 6378.137; // semi-major axis of earth ellipsoid - const double b0 = 7.839257e-5; + const double a_e = 6378.137; // semi-major axis of earth ellipsoid + const double b0 = 7.839257e-5; const double tlapse = -6.5; - const double em = -978.77 / (2.8704e6 * tlapse * 1.0e-5); + const double em = -978.77 / (2.8704e6 * tlapse * 1.0e-5); - double tkhum = t_kel + tlapse * (hhum_km - htkel_km); - double atkel = 7.5 * (tkhum - 273.15) / (237.3 + tkhum - 273.15); - double e0 = 0.0611 * hum * pow(10, atkel); - double tksea = t_kel - tlapse * htkel_km; - double tkelh = tksea + tlapse * hhum_km; - double e0sea = e0 * pow((tksea / tkelh), (4 * em)); - double tkelp = tksea + tlapse * hp_km; - double psea = p_mb * pow((tksea / tkelp), em); + double tkhum = t_kel + tlapse * (hhum_km - htkel_km); + double atkel = 7.5 * (tkhum - 273.15) / (237.3 + tkhum - 273.15); + double e0 = 0.0611 * hum * pow(10, atkel); + double tksea = t_kel - tlapse * htkel_km; + double tkelh = tksea + tlapse * hhum_km; + double e0sea = e0 * pow((tksea / tkelh), (4 * em)); + double tkelp = tksea + tlapse * hp_km; + double psea = p_mb * pow((tksea / tkelp), em); - if(sinel < 0) { sinel = 0.0; } + if (sinel < 0) + { + sinel = 0.0; + } - double tropo_delay = 0.0; - bool done = false; - double refsea = 77.624e-6 / tksea; - double htop = 1.1385e-5 / refsea; - refsea = refsea * psea; - double ref = refsea * pow(((htop - hsta_km) / htop), 4); + double tropo_delay = 0.0; + bool done = false; + double refsea = 77.624e-6 / tksea; + double htop = 1.1385e-5 / refsea; + refsea = refsea * psea; + double ref = refsea * pow(((htop - hsta_km) / htop), 4); double a; double b; double rtop; - while(1) + while (1) { rtop = pow((a_e + htop), 2) - pow((a_e + hsta_km), 2) * (1 - pow(sinel, 2)); // check to see if geometry is crazy - if(rtop < 0) { rtop = 0; } + if (rtop < 0) + { + rtop = 0; + } rtop = sqrt(rtop) - (a_e + hsta_km) * sinel; - a = -sinel / (htop - hsta_km); - b = -b0 * (1 - pow(sinel,2)) / (htop - hsta_km); + a = -sinel / (htop - hsta_km); + b = -b0 * (1 - pow(sinel, 2)) / (htop - hsta_km); arma::vec rn = arma::vec(8); rn.zeros(); - for(int i = 0; i<8; i++) + for (int i = 0; i < 8; i++) { - rn(i) = pow(rtop, (i+1+1)); - + rn(i) = pow(rtop, (i + 1 + 1)); } - arma::rowvec alpha = {2 * a, 2 * pow(a, 2) + 4 * b /3, a * (pow(a, 2) + 3 * b), - pow(a, 4)/5 + 2.4 * pow(a, 2) * b + 1.2 * pow(b, 2), 2 * a * b * (pow(a, 2) + 3 * b)/3, - pow(b, 2) * (6 * pow(a, 2) + 4 * b) * 1.428571e-1, 0, 0}; + arma::rowvec alpha = {2 * a, 2 * pow(a, 2) + 4 * b / 3, a * (pow(a, 2) + 3 * b), + pow(a, 4) / 5 + 2.4 * pow(a, 2) * b + 1.2 * pow(b, 2), 2 * a * b * (pow(a, 2) + 3 * b) / 3, + pow(b, 2) * (6 * pow(a, 2) + 4 * b) * 1.428571e-1, 0, 0}; - if(pow(b, 2) > 1.0e-35) + if (pow(b, 2) > 1.0e-35) { - alpha(6) = a * pow(b, 3) /2; + alpha(6) = a * pow(b, 3) / 2; alpha(7) = pow(b, 4) / 9; } @@ -348,22 +353,22 @@ int Pvt_Solution::tropo(double *ddr_m, double sinel, double hsta_km, double p_mb dr = dr + aux_(0, 0); tropo_delay = tropo_delay + dr * ref * 1000; - if(done == true) + if (done == true) { *ddr_m = tropo_delay; break; } - done = true; - refsea = (371900.0e-6 / tksea - 12.92e-6) / tksea; - htop = 1.1385e-5 * (1255 / tksea + 0.05) / refsea; - ref = refsea * e0sea * pow(((htop - hsta_km) / htop), 4); + done = true; + refsea = (371900.0e-6 / tksea - 12.92e-6) / tksea; + htop = 1.1385e-5 * (1255 / tksea + 0.05) / refsea; + ref = refsea * e0sea * pow(((htop - hsta_km) / htop), 4); } return 0; } -int Pvt_Solution::topocent(double *Az, double *El, double *D, const arma::vec & x, const arma::vec & dx) +int Pvt_Solution::topocent(double *Az, double *El, double *D, const arma::vec &x, const arma::vec &dx) { /* Transformation of vector dx into topocentric coordinate system with origin at x @@ -383,8 +388,8 @@ int Pvt_Solution::topocent(double *Az, double *El, double *D, const arma::vec & double phi; double h; double dtr = GPS_PI / 180.0; - double a = 6378137.0; // semi-major axis of the reference ellipsoid WGS-84 - double finv = 298.257223563; // inverse of flattening of the reference ellipsoid WGS-84 + double a = 6378137.0; // semi-major axis of the reference ellipsoid WGS-84 + double finv = 298.257223563; // inverse of flattening of the reference ellipsoid WGS-84 // Transform x into geodetic coordinates Pvt_Solution::togeod(&phi, &lambda, &h, a, finv, x(0), x(1), x(2)); @@ -394,19 +399,19 @@ int Pvt_Solution::topocent(double *Az, double *El, double *D, const arma::vec & double cb = cos(phi * dtr); double sb = sin(phi * dtr); - arma::mat F = arma::zeros(3,3); + arma::mat F = arma::zeros(3, 3); - F(0,0) = -sl; - F(0,1) = -sb * cl; - F(0,2) = cb * cl; + F(0, 0) = -sl; + F(0, 1) = -sb * cl; + F(0, 2) = cb * cl; - F(1,0) = cl; - F(1,1) = -sb * sl; - F(1,2) = cb * sl; + F(1, 0) = cl; + F(1, 1) = -sb * sl; + F(1, 2) = cb * sl; - F(2,0) = 0; - F(2,1) = cb; - F(2,2) = sb; + F(2, 0) = 0; + F(2, 1) = cb; + F(2, 2) = sb; arma::vec local_vector; @@ -440,47 +445,46 @@ int Pvt_Solution::topocent(double *Az, double *El, double *D, const arma::vec & } - int Pvt_Solution::compute_DOP() { // ###### Compute DOPs ######## // 1- Rotation matrix from ECEF coordinates to ENU coordinates // ref: http://www.navipedia.net/index.php/Transformations_between_ECEF_and_ENU_coordinates - arma::mat F = arma::zeros(3,3); - F(0,0) = -sin(GPS_TWO_PI * (d_longitude_d/360.0)); - F(0,1) = -sin(GPS_TWO_PI * (d_latitude_d/360.0)) * cos(GPS_TWO_PI * (d_longitude_d/360.0)); - F(0,2) = cos(GPS_TWO_PI * (d_latitude_d/360.0)) * cos(GPS_TWO_PI * (d_longitude_d/360.0)); + arma::mat F = arma::zeros(3, 3); + F(0, 0) = -sin(GPS_TWO_PI * (d_longitude_d / 360.0)); + F(0, 1) = -sin(GPS_TWO_PI * (d_latitude_d / 360.0)) * cos(GPS_TWO_PI * (d_longitude_d / 360.0)); + F(0, 2) = cos(GPS_TWO_PI * (d_latitude_d / 360.0)) * cos(GPS_TWO_PI * (d_longitude_d / 360.0)); - F(1,0) = cos((GPS_TWO_PI * d_longitude_d)/360.0); - F(1,1) = -sin((GPS_TWO_PI * d_latitude_d)/360.0) * sin((GPS_TWO_PI * d_longitude_d)/360.0); - F(1,2) = cos((GPS_TWO_PI * d_latitude_d/360.0)) * sin((GPS_TWO_PI * d_longitude_d)/360.0); + F(1, 0) = cos((GPS_TWO_PI * d_longitude_d) / 360.0); + F(1, 1) = -sin((GPS_TWO_PI * d_latitude_d) / 360.0) * sin((GPS_TWO_PI * d_longitude_d) / 360.0); + F(1, 2) = cos((GPS_TWO_PI * d_latitude_d / 360.0)) * sin((GPS_TWO_PI * d_longitude_d) / 360.0); - F(2,0) = 0; - F(2,1) = cos((GPS_TWO_PI * d_latitude_d)/360.0); - F(2,2) = sin((GPS_TWO_PI * d_latitude_d/360.0)); + F(2, 0) = 0; + F(2, 1) = cos((GPS_TWO_PI * d_latitude_d) / 360.0); + F(2, 2) = sin((GPS_TWO_PI * d_latitude_d / 360.0)); // 2- Apply the rotation to the latest covariance matrix (available in ECEF from LS) arma::mat Q_ECEF = d_Q.submat(0, 0, 2, 2); arma::mat DOP_ENU = arma::zeros(3, 3); try - { + { DOP_ENU = arma::htrans(F) * Q_ECEF * F; - d_GDOP = sqrt(arma::trace(DOP_ENU)); // Geometric DOP - d_PDOP = sqrt(DOP_ENU(0, 0) + DOP_ENU(1, 1) + DOP_ENU(2, 2));// PDOP - d_HDOP = sqrt(DOP_ENU(0, 0) + DOP_ENU(1, 1)); // HDOP - d_VDOP = sqrt(DOP_ENU(2, 2)); // VDOP - d_TDOP = sqrt(d_Q(3, 3)); // TDOP - } - catch(const std::exception & ex) - { - d_GDOP = -1; // Geometric DOP - d_PDOP = -1; // PDOP - d_HDOP = -1; // HDOP - d_VDOP = -1; // VDOP - d_TDOP = -1; // TDOP - } + d_GDOP = sqrt(arma::trace(DOP_ENU)); // Geometric DOP + d_PDOP = sqrt(DOP_ENU(0, 0) + DOP_ENU(1, 1) + DOP_ENU(2, 2)); // PDOP + d_HDOP = sqrt(DOP_ENU(0, 0) + DOP_ENU(1, 1)); // HDOP + d_VDOP = sqrt(DOP_ENU(2, 2)); // VDOP + d_TDOP = sqrt(d_Q(3, 3)); // TDOP + } + catch (const std::exception &ex) + { + d_GDOP = -1; // Geometric DOP + d_PDOP = -1; // PDOP + d_HDOP = -1; // HDOP + d_VDOP = -1; // VDOP + d_TDOP = -1; // TDOP + } return 0; } @@ -521,7 +525,7 @@ void Pvt_Solution::perform_pos_averaging() { d_avg_latitude_d = d_avg_latitude_d + d_hist_latitude_d.at(i); d_avg_longitude_d = d_avg_longitude_d + d_hist_longitude_d.at(i); - d_avg_height_m = d_avg_height_m + d_hist_height_m.at(i); + d_avg_height_m = d_avg_height_m + d_hist_height_m.at(i); } d_avg_latitude_d = d_avg_latitude_d / static_cast(d_averaging_depth); d_avg_longitude_d = d_avg_longitude_d / static_cast(d_averaging_depth); @@ -614,7 +618,7 @@ void Pvt_Solution::set_valid_position(bool is_valid) } -void Pvt_Solution::set_rx_pos(const arma::vec & pos) +void Pvt_Solution::set_rx_pos(const arma::vec &pos) { d_rx_pos = pos; d_latitude_d = d_rx_pos(0); @@ -635,7 +639,7 @@ boost::posix_time::ptime Pvt_Solution::get_position_UTC_time() const } -void Pvt_Solution::set_position_UTC_time(const boost::posix_time::ptime & pt) +void Pvt_Solution::set_position_UTC_time(const boost::posix_time::ptime &pt) { d_position_UTC_time = pt; } @@ -655,14 +659,14 @@ void Pvt_Solution::set_num_valid_observations(int num) bool Pvt_Solution::set_visible_satellites_ID(size_t index, unsigned int prn) { - if(index >= PVT_MAX_CHANNELS) + if (index >= PVT_MAX_CHANNELS) { LOG(WARNING) << "Setting sat ID to channel " << index << " (the maximum is " << PVT_MAX_CHANNELS << ")"; return false; } else { - if(prn >= PVT_MAX_PRN) + if (prn >= PVT_MAX_PRN) { LOG(WARNING) << "Setting to channel " << index << " a PRN of " << prn << " (the maximum is " << PVT_MAX_PRN << ")"; return false; @@ -678,7 +682,7 @@ bool Pvt_Solution::set_visible_satellites_ID(size_t index, unsigned int prn) unsigned int Pvt_Solution::get_visible_satellites_ID(size_t index) const { - if(index >= PVT_MAX_CHANNELS) + if (index >= PVT_MAX_CHANNELS) { LOG(WARNING) << "Getting sat ID for channel " << index << " (the maximum is " << PVT_MAX_CHANNELS << ")"; return 0; @@ -692,21 +696,21 @@ unsigned int Pvt_Solution::get_visible_satellites_ID(size_t index) const bool Pvt_Solution::set_visible_satellites_El(size_t index, double el) { - if(index >= PVT_MAX_CHANNELS) + if (index >= PVT_MAX_CHANNELS) { LOG(WARNING) << "Setting sat elevation for channel " << index << " (the maximum is " << PVT_MAX_CHANNELS << ")"; return false; } else { - if(el > 90.0) + if (el > 90.0) { LOG(WARNING) << "Setting a sat elevation > 90 [degrees]. Saturating to 90"; d_visible_satellites_El[index] = 90.0; } else { - if(el < -90.0) + if (el < -90.0) { LOG(WARNING) << "Setting a sat elevation < -90 [degrees]. Saturating to -90"; d_visible_satellites_El[index] = -90.0; @@ -723,7 +727,7 @@ bool Pvt_Solution::set_visible_satellites_El(size_t index, double el) double Pvt_Solution::get_visible_satellites_El(size_t index) const { - if(index >= PVT_MAX_CHANNELS) + if (index >= PVT_MAX_CHANNELS) { LOG(WARNING) << "Getting sat elevation for channel " << index << " (the maximum is " << PVT_MAX_CHANNELS << ")"; return 0.0; @@ -737,7 +741,7 @@ double Pvt_Solution::get_visible_satellites_El(size_t index) const bool Pvt_Solution::set_visible_satellites_Az(size_t index, double az) { - if(index >= PVT_MAX_CHANNELS) + if (index >= PVT_MAX_CHANNELS) { LOG(WARNING) << "Getting sat azimuth for channel " << index << " (the maximum is " << PVT_MAX_CHANNELS << ")"; return false; @@ -752,7 +756,7 @@ bool Pvt_Solution::set_visible_satellites_Az(size_t index, double az) double Pvt_Solution::get_visible_satellites_Az(size_t index) const { - if(index >= PVT_MAX_CHANNELS) + if (index >= PVT_MAX_CHANNELS) { LOG(WARNING) << "Getting sat azimuth for channel " << index << " (the maximum is " << PVT_MAX_CHANNELS << ")"; return 0.0; @@ -766,7 +770,7 @@ double Pvt_Solution::get_visible_satellites_Az(size_t index) const bool Pvt_Solution::set_visible_satellites_Distance(size_t index, double dist) { - if(index >= PVT_MAX_CHANNELS) + if (index >= PVT_MAX_CHANNELS) { LOG(WARNING) << "Setting sat distance for channel " << index << " (the maximum is " << PVT_MAX_CHANNELS << ")"; return false; @@ -781,7 +785,7 @@ bool Pvt_Solution::set_visible_satellites_Distance(size_t index, double dist) double Pvt_Solution::get_visible_satellites_Distance(size_t index) const { - if(index >= PVT_MAX_CHANNELS) + if (index >= PVT_MAX_CHANNELS) { LOG(WARNING) << "Getting sat distance for channel " << index << " (the maximum is " << PVT_MAX_CHANNELS << ")"; return 0.0; @@ -795,7 +799,7 @@ double Pvt_Solution::get_visible_satellites_Distance(size_t index) const bool Pvt_Solution::set_visible_satellites_CN0_dB(size_t index, double cn0) { - if(index >= PVT_MAX_CHANNELS) + if (index >= PVT_MAX_CHANNELS) { LOG(WARNING) << "Setting sat Cn0 for channel " << index << " (the maximum is " << PVT_MAX_CHANNELS << ")"; return false; @@ -810,7 +814,7 @@ bool Pvt_Solution::set_visible_satellites_CN0_dB(size_t index, double cn0) double Pvt_Solution::get_visible_satellites_CN0_dB(size_t index) const { - if(index >= PVT_MAX_CHANNELS) + if (index >= PVT_MAX_CHANNELS) { LOG(WARNING) << "Getting received CN0 for channel " << index << " (the maximum is " << PVT_MAX_CHANNELS << ")"; return 0.0; @@ -822,7 +826,7 @@ double Pvt_Solution::get_visible_satellites_CN0_dB(size_t index) const } -void Pvt_Solution::set_Q(const arma::mat & Q) +void Pvt_Solution::set_Q(const arma::mat &Q) { d_Q = Q; } diff --git a/src/algorithms/PVT/libs/pvt_solution.h b/src/algorithms/PVT/libs/pvt_solution.h index cf209004e..e036b1547 100644 --- a/src/algorithms/PVT/libs/pvt_solution.h +++ b/src/algorithms/PVT/libs/pvt_solution.h @@ -47,15 +47,15 @@ const unsigned int PVT_MAX_PRN = 127; // 126 is SBAS class Pvt_Solution { private: - double d_rx_dt_s; // RX time offset [s] + double d_rx_dt_s; // RX time offset [s] - double d_latitude_d; // RX position Latitude WGS84 [deg] - double d_longitude_d; // RX position Longitude WGS84 [deg] - double d_height_m; // RX position height WGS84 [m] + double d_latitude_d; // RX position Latitude WGS84 [deg] + double d_longitude_d; // RX position Longitude WGS84 [deg] + double d_height_m; // RX position height WGS84 [m] - double d_avg_latitude_d; // Averaged latitude in degrees - double d_avg_longitude_d; // Averaged longitude in degrees - double d_avg_height_m; // Averaged height [m] + double d_avg_latitude_d; // Averaged latitude in degrees + double d_avg_longitude_d; // Averaged longitude in degrees + double d_avg_height_m; // Averaged height [m] bool b_valid_position; @@ -64,7 +64,7 @@ private: std::deque d_hist_height_m; bool d_flag_averaging; - int d_averaging_depth; // Length of averaging window + int d_averaging_depth; // Length of averaging window arma::vec d_rx_pos; boost::posix_time::ptime d_position_UTC_time; @@ -77,11 +77,11 @@ private: double d_VDOP; double d_TDOP; - int d_visible_satellites_IDs[PVT_MAX_CHANNELS] = {}; // Array with the IDs of the valid satellites - double d_visible_satellites_El[PVT_MAX_CHANNELS] = {}; // Array with the LOS Elevation of the valid satellites - double d_visible_satellites_Az[PVT_MAX_CHANNELS] = {}; // Array with the LOS Azimuth of the valid satellites - double d_visible_satellites_Distance[PVT_MAX_CHANNELS] = {}; // Array with the LOS Distance of the valid satellites - double d_visible_satellites_CN0_dB[PVT_MAX_CHANNELS] = {}; // Array with the IDs of the valid satellites + int d_visible_satellites_IDs[PVT_MAX_CHANNELS] = {}; // Array with the IDs of the valid satellites + double d_visible_satellites_El[PVT_MAX_CHANNELS] = {}; // Array with the LOS Elevation of the valid satellites + double d_visible_satellites_Az[PVT_MAX_CHANNELS] = {}; // Array with the LOS Azimuth of the valid satellites + double d_visible_satellites_Distance[PVT_MAX_CHANNELS] = {}; // Array with the LOS Distance of the valid satellites + double d_visible_satellites_CN0_dB[PVT_MAX_CHANNELS] = {}; // Array with the IDs of the valid satellites public: Pvt_Solution(); @@ -89,22 +89,22 @@ public: double get_time_offset_s() const; //!< Get RX time offset [s] void set_time_offset_s(double offset); //!< Set RX time offset [s] - double get_latitude() const; //!< Get RX position Latitude WGS84 [deg] - double get_longitude() const; //!< Get RX position Longitude WGS84 [deg] - double get_height() const; //!< Get RX position height WGS84 [m] + double get_latitude() const; //!< Get RX position Latitude WGS84 [deg] + double get_longitude() const; //!< Get RX position Longitude WGS84 [deg] + double get_height() const; //!< Get RX position height WGS84 [m] - double get_avg_latitude() const; //!< Get RX position averaged Latitude WGS84 [deg] - double get_avg_longitude() const; //!< Get RX position averaged Longitude WGS84 [deg] - double get_avg_height() const; //!< Get RX position averaged height WGS84 [m] + double get_avg_latitude() const; //!< Get RX position averaged Latitude WGS84 [deg] + double get_avg_longitude() const; //!< Get RX position averaged Longitude WGS84 [deg] + double get_avg_height() const; //!< Get RX position averaged height WGS84 [m] - void set_rx_pos(const arma::vec & pos); //!< Set position: Latitude [deg], longitude [deg], height [m] + void set_rx_pos(const arma::vec &pos); //!< Set position: Latitude [deg], longitude [deg], height [m] arma::vec get_rx_pos() const; bool is_valid_position() const; void set_valid_position(bool is_valid); boost::posix_time::ptime get_position_UTC_time() const; - void set_position_UTC_time(const boost::posix_time::ptime & pt); + void set_position_UTC_time(const boost::posix_time::ptime &pt); int get_num_valid_observations() const; //!< Get the number of valid pseudorange observations (valid satellites) void set_num_valid_observations(int num); //!< Set the number of valid pseudorange observations (valid satellites) @@ -112,27 +112,27 @@ public: bool set_visible_satellites_ID(size_t index, unsigned int prn); //!< Set the ID of the visible satellite index channel unsigned int get_visible_satellites_ID(size_t index) const; //!< Get the ID of the visible satellite index channel - bool set_visible_satellites_El(size_t index, double el); //!< Set the LOS Elevation, in degrees, of the visible satellite index channel - double get_visible_satellites_El(size_t index) const; //!< Get the LOS Elevation, in degrees, of the visible satellite index channel + bool set_visible_satellites_El(size_t index, double el); //!< Set the LOS Elevation, in degrees, of the visible satellite index channel + double get_visible_satellites_El(size_t index) const; //!< Get the LOS Elevation, in degrees, of the visible satellite index channel - bool set_visible_satellites_Az(size_t index, double az); //!< Set the LOS Azimuth, in degrees, of the visible satellite index channel - double get_visible_satellites_Az(size_t index) const; //!< Get the LOS Azimuth, in degrees, of the visible satellite index channel + bool set_visible_satellites_Az(size_t index, double az); //!< Set the LOS Azimuth, in degrees, of the visible satellite index channel + double get_visible_satellites_Az(size_t index) const; //!< Get the LOS Azimuth, in degrees, of the visible satellite index channel - bool set_visible_satellites_Distance(size_t index, double dist); //!< Set the LOS Distance of the visible satellite index channel - double get_visible_satellites_Distance(size_t index) const; //!< Get the LOS Distance of the visible satellite index channel + bool set_visible_satellites_Distance(size_t index, double dist); //!< Set the LOS Distance of the visible satellite index channel + double get_visible_satellites_Distance(size_t index) const; //!< Get the LOS Distance of the visible satellite index channel - bool set_visible_satellites_CN0_dB(size_t index, double cn0); //!< Set the CN0 in dB of the visible satellite index channel - double get_visible_satellites_CN0_dB(size_t index) const; //!< Get the CN0 in dB of the visible satellite index channel + bool set_visible_satellites_CN0_dB(size_t index, double cn0); //!< Set the CN0 in dB of the visible satellite index channel + double get_visible_satellites_CN0_dB(size_t index) const; //!< Get the CN0 in dB of the visible satellite index channel //averaging void perform_pos_averaging(); - void set_averaging_depth(int depth); //!< Set length of averaging window + void set_averaging_depth(int depth); //!< Set length of averaging window bool is_averaging() const; void set_averaging_flag(bool flag); // DOP estimations - void set_Q(const arma::mat & Q); - int compute_DOP(); //!< Compute Dilution Of Precision parameters + void set_Q(const arma::mat &Q); + int compute_DOP(); //!< Compute Dilution Of Precision parameters double get_GDOP() const; double get_PDOP() const; @@ -140,7 +140,7 @@ public: double get_VDOP() const; double get_TDOP() const; - arma::vec rotateSatellite(double traveltime, const arma::vec & X_sat); + arma::vec rotateSatellite(double traveltime, const arma::vec &X_sat); /*! * \brief Conversion of Cartesian coordinates (X,Y,Z) to geographical @@ -157,9 +157,9 @@ public: * 4 - World Geodetic System 1984. * */ - int cart2geo(double X, double Y, double Z, int elipsoid_selection); + int cart2geo(double X, double Y, double Z, int elipsoid_selection); - /*! + /*! * \brief Transformation of vector dx into topocentric coordinate system with origin at x * * \param[in] x Vector origin coordinates (in ECEF system [X; Y; Z;]) @@ -171,9 +171,9 @@ public: * * Based on a Matlab function by Kai Borre */ - int topocent(double *Az, double *El, double *D, const arma::vec & x, const arma::vec & dx); + int topocent(double *Az, double *El, double *D, const arma::vec &x, const arma::vec &dx); - /*! + /*! * \brief Subroutine to calculate geodetic coordinates latitude, longitude, * height given Cartesian coordinates X,Y,Z, and reference ellipsoid * values semi-major axis (a) and the inverse of flattening (finv). @@ -192,9 +192,9 @@ public: * * Based in a Matlab function by Kai Borre */ - int togeod(double *dphi, double *dlambda, double *h, double a, double finv, double X, double Y, double Z); + int togeod(double *dphi, double *dlambda, double *h, double a, double finv, double X, double Y, double Z); - /*! + /*! * \brief Tropospheric correction * * \param[in] sinel - sin of elevation angle of satellite @@ -217,7 +217,7 @@ public: * * Translated to C++ by Carles Fernandez from a Matlab implementation by Kai Borre */ - int tropo(double *ddr_m, double sinel, double hsta_km, double p_mb, double t_kel, double hum, double hp_km, double htkel_km, double hhum_km); + int tropo(double *ddr_m, double sinel, double hsta_km, double p_mb, double t_kel, double hum, double hp_km, double htkel_km, double hhum_km); }; #endif diff --git a/src/algorithms/PVT/libs/rinex_printer.cc b/src/algorithms/PVT/libs/rinex_printer.cc index 7d4990a77..430542037 100644 --- a/src/algorithms/PVT/libs/rinex_printer.cc +++ b/src/algorithms/PVT/libs/rinex_printer.cc @@ -34,10 +34,10 @@ #include #include #include -#include // for getlogin_r() -#include // for min and max -#include // for floor -#include // for getenv() +#include // for getlogin_r() +#include // for min and max +#include // for floor +#include // for getenv() #include #include #include @@ -72,52 +72,52 @@ Rinex_Printer::Rinex_Printer(int conf_version) satelliteSystem["Beidou"] = "C"; satelliteSystem["Mixed"] = "M"; - observationCode["GPS_L1_CA"] = "1C"; // "1C" GPS L1 C/A - observationCode["GPS_L1_P"] = "1P"; // "1P" GPS L1 P - observationCode["GPS_L1_Z_TRACKING"] = "1W"; // "1W" GPS L1 Z-tracking and similar (AS on) - observationCode["GPS_L1_Y"] = "1Y"; // "1Y" GPS L1 Y - observationCode["GPS_L1_M "] = "1M"; // "1M" GPS L1 M - observationCode["GPS_L1_CODELESS"] = "1N"; // "1N" GPS L1 codeless - observationCode["GPS_L2_CA"] = "2C"; // "2C" GPS L2 C/A - observationCode["L2_SEMI_CODELESS"] = "2D"; // "2D" GPS L2 L1(C/A)+(P2-P1) semi-codeless - observationCode["GPS_L2_L2CM"] = "2S"; // "2S" GPS L2 L2C (M) - observationCode["GPS_L2_L2CL"] = "2L"; // "2L" GPS L2 L2C (L) - observationCode["GPS_L2_L2CML"] = "2X"; // "2X" GPS L2 L2C (M+L) - observationCode["GPS_L2_P"] = "2P"; // "2P" GPS L2 P - observationCode["GPS_L2_Z_TRACKING"] = "2W"; // "2W" GPS L2 Z-tracking and similar (AS on) - observationCode["GPS_L2_Y"] = "2Y"; // "2Y" GPS L2 Y - observationCode["GPS_L2_M"] = "2M"; // "2M" GPS GPS L2 M - observationCode["GPS_L2_codeless"] = "2N"; // "2N" GPS L2 codeless - observationCode["GPS_L5_I"] = "5I"; // "5I" GPS L5 I - observationCode["GPS_L5_Q"] = "5Q"; // "5Q" GPS L5 Q - observationCode["GPS_L5_IQ"] = "5X"; // "5X" GPS L5 I+Q - observationCode["GLONASS_G1_CA"] = "1C"; // "1C" GLONASS G1 C/A - observationCode["GLONASS_G1_P"] = "1P"; // "1P" GLONASS G1 P - observationCode["GLONASS_G2_CA"] = "2C"; // "2C" GLONASS G2 C/A (Glonass M) - observationCode["GLONASS_G2_P"] = "2P"; // "2P" GLONASS G2 P - observationCode["GALILEO_E1_A"] = "1A"; // "1A" GALILEO E1 A (PRS) - observationCode["GALILEO_E1_B"] = "1B"; // "1B" GALILEO E1 B (I/NAV OS/CS/SoL) - observationCode["GALILEO_E1_C"] = "1C"; // "1C" GALILEO E1 C (no data) - observationCode["GALILEO_E1_BC"] = "1X"; // "1X" GALILEO E1 B+C - observationCode["GALILEO_E1_ABC"] = "1Z"; // "1Z" GALILEO E1 A+B+C - observationCode["GALILEO_E5a_I"] = "5I"; // "5I" GALILEO E5a I (F/NAV OS) - observationCode["GALILEO_E5a_Q"] = "5Q"; // "5Q" GALILEO E5a Q (no data) - observationCode["GALILEO_E5a_IQ"] = "5X"; // "5X" GALILEO E5a I+Q - observationCode["GALILEO_E5b_I"] = "7I"; // "7I" GALILEO E5b I - observationCode["GALILEO_E5b_Q"] = "7Q"; // "7Q" GALILEO E5b Q - observationCode["GALILEO_E5b_IQ"] = "7X"; // "7X" GALILEO E5b I+Q - observationCode["GALILEO_E5_I"] = "8I"; // "8I" GALILEO E5 I - observationCode["GALILEO_E5_Q"] = "8Q"; // "8Q" GALILEO E5 Q - observationCode["GALILEO_E5_IQ"] = "8X"; // "8X" GALILEO E5 I+Q - observationCode["GALILEO_E56_A"] = "6A"; // "6A" GALILEO E6 A - observationCode["GALILEO_E56_B"] = "6B"; // "6B" GALILEO E6 B - observationCode["GALILEO_E56_B"] = "6C"; // "6C" GALILEO E6 C - observationCode["GALILEO_E56_BC"] = "6X"; // "6X" GALILEO E6 B+C - observationCode["GALILEO_E56_ABC"] = "6Z"; // "6Z" GALILEO E6 A+B+C - observationCode["SBAS_L1_CA"] = "1C"; // "1C" SBAS L1 C/A - observationCode["SBAS_L5_I"] = "5I"; // "5I" SBAS L5 I - observationCode["SBAS_L5_Q"] = "5Q"; // "5Q" SBAS L5 Q - observationCode["SBAS_L5_IQ"] = "5X"; // "5X" SBAS L5 I+Q + observationCode["GPS_L1_CA"] = "1C"; // "1C" GPS L1 C/A + observationCode["GPS_L1_P"] = "1P"; // "1P" GPS L1 P + observationCode["GPS_L1_Z_TRACKING"] = "1W"; // "1W" GPS L1 Z-tracking and similar (AS on) + observationCode["GPS_L1_Y"] = "1Y"; // "1Y" GPS L1 Y + observationCode["GPS_L1_M "] = "1M"; // "1M" GPS L1 M + observationCode["GPS_L1_CODELESS"] = "1N"; // "1N" GPS L1 codeless + observationCode["GPS_L2_CA"] = "2C"; // "2C" GPS L2 C/A + observationCode["L2_SEMI_CODELESS"] = "2D"; // "2D" GPS L2 L1(C/A)+(P2-P1) semi-codeless + observationCode["GPS_L2_L2CM"] = "2S"; // "2S" GPS L2 L2C (M) + observationCode["GPS_L2_L2CL"] = "2L"; // "2L" GPS L2 L2C (L) + observationCode["GPS_L2_L2CML"] = "2X"; // "2X" GPS L2 L2C (M+L) + observationCode["GPS_L2_P"] = "2P"; // "2P" GPS L2 P + observationCode["GPS_L2_Z_TRACKING"] = "2W"; // "2W" GPS L2 Z-tracking and similar (AS on) + observationCode["GPS_L2_Y"] = "2Y"; // "2Y" GPS L2 Y + observationCode["GPS_L2_M"] = "2M"; // "2M" GPS GPS L2 M + observationCode["GPS_L2_codeless"] = "2N"; // "2N" GPS L2 codeless + observationCode["GPS_L5_I"] = "5I"; // "5I" GPS L5 I + observationCode["GPS_L5_Q"] = "5Q"; // "5Q" GPS L5 Q + observationCode["GPS_L5_IQ"] = "5X"; // "5X" GPS L5 I+Q + observationCode["GLONASS_G1_CA"] = "1C"; // "1C" GLONASS G1 C/A + observationCode["GLONASS_G1_P"] = "1P"; // "1P" GLONASS G1 P + observationCode["GLONASS_G2_CA"] = "2C"; // "2C" GLONASS G2 C/A (Glonass M) + observationCode["GLONASS_G2_P"] = "2P"; // "2P" GLONASS G2 P + observationCode["GALILEO_E1_A"] = "1A"; // "1A" GALILEO E1 A (PRS) + observationCode["GALILEO_E1_B"] = "1B"; // "1B" GALILEO E1 B (I/NAV OS/CS/SoL) + observationCode["GALILEO_E1_C"] = "1C"; // "1C" GALILEO E1 C (no data) + observationCode["GALILEO_E1_BC"] = "1X"; // "1X" GALILEO E1 B+C + observationCode["GALILEO_E1_ABC"] = "1Z"; // "1Z" GALILEO E1 A+B+C + observationCode["GALILEO_E5a_I"] = "5I"; // "5I" GALILEO E5a I (F/NAV OS) + observationCode["GALILEO_E5a_Q"] = "5Q"; // "5Q" GALILEO E5a Q (no data) + observationCode["GALILEO_E5a_IQ"] = "5X"; // "5X" GALILEO E5a I+Q + observationCode["GALILEO_E5b_I"] = "7I"; // "7I" GALILEO E5b I + observationCode["GALILEO_E5b_Q"] = "7Q"; // "7Q" GALILEO E5b Q + observationCode["GALILEO_E5b_IQ"] = "7X"; // "7X" GALILEO E5b I+Q + observationCode["GALILEO_E5_I"] = "8I"; // "8I" GALILEO E5 I + observationCode["GALILEO_E5_Q"] = "8Q"; // "8Q" GALILEO E5 Q + observationCode["GALILEO_E5_IQ"] = "8X"; // "8X" GALILEO E5 I+Q + observationCode["GALILEO_E56_A"] = "6A"; // "6A" GALILEO E6 A + observationCode["GALILEO_E56_B"] = "6B"; // "6B" GALILEO E6 B + observationCode["GALILEO_E56_B"] = "6C"; // "6C" GALILEO E6 C + observationCode["GALILEO_E56_BC"] = "6X"; // "6X" GALILEO E6 B+C + observationCode["GALILEO_E56_ABC"] = "6Z"; // "6Z" GALILEO E6 A+B+C + observationCode["SBAS_L1_CA"] = "1C"; // "1C" SBAS L1 C/A + observationCode["SBAS_L5_I"] = "5I"; // "5I" SBAS L5 I + observationCode["SBAS_L5_Q"] = "5Q"; // "5Q" SBAS L5 Q + observationCode["SBAS_L5_IQ"] = "5X"; // "5X" SBAS L5 I+Q observationCode["COMPASS_E2_I"] = "2I"; observationCode["COMPASS_E2_Q"] = "2Q"; observationCode["COMPASS_E2_IQ"] = "2X"; @@ -142,7 +142,7 @@ Rinex_Printer::Rinex_Printer(int conf_version) observationCode["GPS_L1_CA_v2"] = "1"; observationCode["GLONASS_G1_CA_v2"] = "1"; - if(conf_version == 2) + if (conf_version == 2) { version = 2; stringVersion = "2.11"; @@ -153,7 +153,7 @@ Rinex_Printer::Rinex_Printer(int conf_version) stringVersion = "3.02"; } - numberTypesObservations = 4; // Number of available types of observable in the system + numberTypesObservations = 4; // Number of available types of observable in the system fake_cnav_iode = 1; } @@ -177,27 +177,27 @@ Rinex_Printer::~Rinex_Printer() // If nothing written, erase the files. if (posn == 0) { - if(remove(navfilename.c_str()) != 0) LOG(INFO) << "Error deleting temporary file"; + if (remove(navfilename.c_str()) != 0) LOG(INFO) << "Error deleting temporary file"; } if (poso == 0) { - if(remove(obsfilename.c_str()) != 0) LOG(INFO) << "Error deleting temporary file"; + if (remove(obsfilename.c_str()) != 0) LOG(INFO) << "Error deleting temporary file"; } if (poss == 0) { - if(remove(sbsfilename.c_str()) != 0) LOG(INFO) << "Error deleting temporary file"; + if (remove(sbsfilename.c_str()) != 0) LOG(INFO) << "Error deleting temporary file"; } if (posng == 0) { - if(remove(navGalfilename.c_str()) != 0) LOG(INFO) << "Error deleting temporary file"; + if (remove(navGalfilename.c_str()) != 0) LOG(INFO) << "Error deleting temporary file"; } if (posmn == 0) { - if(remove(navMixfilename.c_str()) != 0) LOG(INFO) << "Error deleting temporary file"; + if (remove(navMixfilename.c_str()) != 0) LOG(INFO) << "Error deleting temporary file"; } if (posnr == 0) { - if(remove(navGlofilename.c_str()) != 0) LOG(INFO) << "Error deleting temporary file"; + if (remove(navGlofilename.c_str()) != 0) LOG(INFO) << "Error deleting temporary file"; } } @@ -207,23 +207,23 @@ void Rinex_Printer::lengthCheck(const std::string& line) if (line.length() != 80) { LOG(ERROR) << "Bad defined RINEX line: " - << line.length() << " characters (must be 80)" << std::endl - << line << std::endl - << "----|---1|0---|---2|0---|---3|0---|---4|0---|---5|0---|---6|0---|---7|0---|---8|" << std::endl; + << line.length() << " characters (must be 80)" << std::endl + << line << std::endl + << "----|---1|0---|---2|0---|---3|0---|---4|0---|---5|0---|---6|0---|---7|0---|---8|" << std::endl; } } std::string Rinex_Printer::createFilename(std::string type) { - const std::string stationName = "GSDR"; // 4-character station name designator + const std::string stationName = "GSDR"; // 4-character station name designator boost::gregorian::date today = boost::gregorian::day_clock::local_day(); const int dayOfTheYear = today.day_of_year(); std::stringstream strm0; - if (dayOfTheYear < 100) strm0 << "0"; // three digits for day of the year - if (dayOfTheYear < 10) strm0 << "0"; // three digits for day of the year + if (dayOfTheYear < 100) strm0 << "0"; // three digits for day of the year + if (dayOfTheYear < 10) strm0 << "0"; // three digits for day of the year strm0 << dayOfTheYear; - std::string dayOfTheYearTag=strm0.str(); + std::string dayOfTheYearTag = strm0.str(); std::map fileType; fileType.insert(std::pair("RINEX_FILE_TYPE_OBS", "O")); // O - Observation file. @@ -273,12 +273,12 @@ std::string Rinex_Printer::createFilename(std::string type) int local_minute = pt_tm.tm_min; std::stringstream strm2; - if (local_minute<10) strm2 << "0"; // at least two digits for minutes + if (local_minute < 10) strm2 << "0"; // at least two digits for minutes strm2 << local_minute; std::string minTag = strm2.str(); - int local_year = pt_tm.tm_year - 100; // 2012 is 112 + int local_year = pt_tm.tm_year - 100; // 2012 is 112 std::stringstream strm3; strm3 << local_year; std::string yearTag = strm3.str(); @@ -315,12 +315,12 @@ std::string Rinex_Printer::getLocalTime() std::stringstream strmHour; int utc_hour = pt_tm.tm_hour; - if (utc_hour < 10) strmHour << "0"; // two digits for hours + if (utc_hour < 10) strmHour << "0"; // two digits for hours strmHour << utc_hour; std::stringstream strmMin; int utc_minute = pt_tm.tm_min; - if (utc_minute < 10) strmMin << "0"; // two digits for minutes + if (utc_minute < 10) strmMin << "0"; // two digits for minutes strmMin << utc_minute; if (version == 2) @@ -362,7 +362,7 @@ std::string Rinex_Printer::getLocalTime() std::stringstream strm2; int utc_seconds = pt_tm.tm_sec; - if (utc_seconds < 10) strm2 << "0"; // two digits for seconds + if (utc_seconds < 10) strm2 << "0"; // two digits for seconds strm2 << utc_seconds; line += strm2.str(); line += std::string(1, ' '); @@ -453,9 +453,9 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Glonass_Gnav_Utc_M // Set reference time and its clock corrections boost::posix_time::ptime p_utc_ref_time = glonass_gnav_eph.glot_to_utc(glonass_gnav_eph.d_t_b, 0.0); std::string timestring = boost::posix_time::to_iso_string(p_utc_ref_time); - std::string year (timestring, 0, 4); - std::string month (timestring, 4, 2); - std::string day (timestring, 6, 2); + std::string year(timestring, 0, 4); + std::string month(timestring, 4, 2); + std::string day(timestring, 6, 2); line.clear(); line += Rinex_Printer::rightJustify(year, 6); @@ -479,7 +479,9 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Glonass_Gnav_Utc_M void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& gps_iono, const Gps_Utc_Model& gps_utc_model, const Glonass_Gnav_Utc_Model& glonass_gnav_utc_model, const Glonass_Gnav_Almanac& glonass_gnav_almanac) { - if(glonass_gnav_almanac.i_satellite_freq_channel){} //Avoid compiler warning + if (glonass_gnav_almanac.i_satellite_freq_channel) + { + } //Avoid compiler warning std::string line; stringVersion = "3.02"; version = 3; @@ -601,7 +603,9 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& gps_iono void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_CNAV_Iono& gps_iono, const Gps_CNAV_Utc_Model& gps_utc_model, const Glonass_Gnav_Utc_Model& glonass_gnav_utc_model, const Glonass_Gnav_Almanac& glonass_gnav_almanac) { - if(glonass_gnav_almanac.i_satellite_freq_channel){} //Avoid compiler warning + if (glonass_gnav_almanac.i_satellite_freq_channel) + { + } //Avoid compiler warning std::string line; stringVersion = "3.02"; version = 3; @@ -723,9 +727,13 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_CNAV_Iono& gps void Rinex_Printer::rinex_nav_header(std::fstream& out, const Galileo_Iono& galileo_iono, const Galileo_Utc_Model& galileo_utc_model, const Galileo_Almanac& galileo_almanac, const Glonass_Gnav_Utc_Model& glonass_gnav_utc_model, const Glonass_Gnav_Almanac& glonass_gnav_almanac) { - if(glonass_gnav_almanac.i_satellite_freq_channel){} //Avoid compiler warning + if (glonass_gnav_almanac.i_satellite_freq_channel) + { + } //Avoid compiler warning //Avoid compiler warning, there is not time system correction between Galileo and GLONASS - if(galileo_almanac.A_0G_10){} + if (galileo_almanac.A_0G_10) + { + } std::string line; // -------- Line 1 @@ -937,7 +945,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Galileo_Iono& iono } -void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_CNAV_Iono & iono, const Gps_CNAV_Utc_Model & utc_model) +void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_CNAV_Iono& iono, const Gps_CNAV_Utc_Model& utc_model) { std::string line; @@ -1068,7 +1076,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& iono, co line += std::string(25, ' '); } - if (version == 3 ) + if (version == 3) { line += std::string("N: GNSS NAV DATA"); line += std::string(4, ' '); @@ -1174,7 +1182,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& iono, co line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.d_A0, 18, 2), 19); line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.d_A1, 18, 2), 19); line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.d_t_OT), 9); - line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.i_WN_T + 1024), 9); // valid until 2019 + line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.i_WN_T + 1024), 9); // valid until 2019 line += std::string(1, ' '); line += Rinex_Printer::leftJustify("DELTA-UTC: A0,A1,T,W", 20); } @@ -1370,7 +1378,7 @@ void Rinex_Printer::rinex_sbs_header(std::fstream& out) line = std::string(5, ' '); line += std::string("2.10"); line += std::string(11, ' '); - line += Rinex_Printer::leftJustify("B SBAS DATA",20); + line += Rinex_Printer::leftJustify("B SBAS DATA", 20); line += std::string(20, ' '); line += std::string("RINEX VERSION / TYPE"); @@ -1398,23 +1406,23 @@ void Rinex_Printer::rinex_sbs_header(std::fstream& out) tm pt_tm = boost::local_time::to_tm(pt); std::stringstream strYear; int utc_year = pt.date().year(); - utc_year -= 2000; // two digits for year + utc_year -= 2000; // two digits for year strYear << utc_year; std::stringstream strMonth; int utc_month = pt.date().month().as_number(); - if (utc_month < 10) strMonth << "0"; // two digits for months + if (utc_month < 10) strMonth << "0"; // two digits for months strMonth << utc_month; std::stringstream strmDay; int utc_day = pt.date().day().as_number(); - if (utc_day < 10) strmDay << "0"; // two digits for days + if (utc_day < 10) strmDay << "0"; // two digits for days strmDay << utc_day; std::stringstream strmHour; int utc_hour = pt_tm.tm_hour; - if (utc_hour < 10) strmHour << "0"; // two digits for hours + if (utc_hour < 10) strmHour << "0"; // two digits for hours strmHour << utc_hour; std::stringstream strmMin; int utc_minute = pt_tm.tm_min; - if (utc_minute < 10) strmMin << "0"; // two digits for minutes + if (utc_minute < 10) strmMin << "0"; // two digits for minutes strmMin << utc_minute; std::string time_str; time_str += strmDay.str(); @@ -1471,7 +1479,9 @@ void Rinex_Printer::rinex_sbs_header(std::fstream& out) void Rinex_Printer::update_nav_header(std::fstream& out, const Glonass_Gnav_Utc_Model& glonass_gnav_utc_model, const Glonass_Gnav_Almanac& glonass_gnav_almanac) { - if(glonass_gnav_almanac.i_satellite_freq_channel){} //Avoid compiler warning + if (glonass_gnav_almanac.i_satellite_freq_channel) + { + } //Avoid compiler warning std::vector data; std::string line_aux; @@ -1482,11 +1492,11 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Glonass_Gnav_Utc_ bool no_more_finds = false; std::string line_str; - while(!out.eof()) + while (!out.eof()) { std::getline(out, line_str); - if(!no_more_finds) + if (!no_more_finds) { line_aux.clear(); @@ -1521,7 +1531,6 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Glonass_Gnav_Utc_ { data.push_back(line_str); } - } else { @@ -1555,11 +1564,11 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Galileo_Iono& gal bool no_more_finds = false; std::string line_str; - while(!out.eof()) + while (!out.eof()) { std::getline(out, line_str); - if(!no_more_finds) + if (!no_more_finds) { line_aux.clear(); @@ -1617,7 +1626,6 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Galileo_Iono& gal { data.push_back(line_str); } - } else { @@ -1628,7 +1636,7 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Galileo_Iono& gal out.close(); out.open(navGalfilename, std::ios::out | std::ios::trunc); out.seekp(0); - for (int i = 0; i < (int) data.size() - 1; i++) + for (int i = 0; i < (int)data.size() - 1; i++) { out << data[i] << std::endl; } @@ -1651,11 +1659,11 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Gps_Utc_Model& ut bool no_more_finds = false; std::string line_str; - while(!out.eof()) + while (!out.eof()) { std::getline(out, line_str); - if(!no_more_finds) + if (!no_more_finds) { line_aux.clear(); @@ -1689,7 +1697,7 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Gps_Utc_Model& ut line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.d_A0, 18, 2), 19); line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.d_A1, 18, 2), 19); line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.d_t_OT), 9); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.i_WN_T + 1024), 9); // valid until 2019 + line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.i_WN_T + 1024), 9); // valid until 2019 line_aux += std::string(1, ' '); line_aux += Rinex_Printer::leftJustify("DELTA-UTC: A0,A1,T,W", 20); data.push_back(line_aux); @@ -1790,7 +1798,7 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Gps_Utc_Model& ut } -void Rinex_Printer::update_nav_header(std::fstream & out, const Gps_CNAV_Utc_Model & utc_model, const Gps_CNAV_Iono & iono ) +void Rinex_Printer::update_nav_header(std::fstream& out, const Gps_CNAV_Utc_Model& utc_model, const Gps_CNAV_Iono& iono) { std::vector data; std::string line_aux; @@ -1802,11 +1810,11 @@ void Rinex_Printer::update_nav_header(std::fstream & out, const Gps_CNAV_Utc_Mod bool no_more_finds = false; std::string line_str; - while(!out.eof()) + while (!out.eof()) { std::getline(out, line_str); - if(!no_more_finds) + if (!no_more_finds) { line_aux.clear(); @@ -1897,11 +1905,11 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Gps_Iono& gps_ion bool no_more_finds = false; std::string line_str; - while(!out.eof()) + while (!out.eof()) { std::getline(out, line_str); - if(!no_more_finds) + if (!no_more_finds) { line_aux.clear(); @@ -2017,7 +2025,9 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Gps_Iono& gps_ion void Rinex_Printer::update_nav_header(std::fstream& out, const Gps_Iono& gps_iono, const Gps_Utc_Model& gps_utc_model, const Glonass_Gnav_Utc_Model& glonass_gnav_utc_model, const Glonass_Gnav_Almanac& glonass_gnav_almanac) { - if(glonass_gnav_almanac.i_satellite_freq_channel){} //Avoid compiler warning + if (glonass_gnav_almanac.i_satellite_freq_channel) + { + } //Avoid compiler warning std::vector data; std::string line_aux; @@ -2028,11 +2038,11 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Gps_Iono& gps_ion bool no_more_finds = false; std::string line_str; - while(!out.eof()) + while (!out.eof()) { std::getline(out, line_str); - if(!no_more_finds) + if (!no_more_finds) { line_aux.clear(); @@ -2100,7 +2110,6 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Gps_Iono& gps_ion { data.push_back(line_str); } - } else { @@ -2111,7 +2120,7 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Gps_Iono& gps_ion out.close(); out.open(navMixfilename, std::ios::out | std::ios::trunc); out.seekp(0); - for (int i = 0; i < (int) data.size() - 1; i++) + for (int i = 0; i < (int)data.size() - 1; i++) { out << data[i] << std::endl; } @@ -2124,7 +2133,9 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Gps_Iono& gps_ion void Rinex_Printer::update_nav_header(std::fstream& out, const Gps_CNAV_Iono& gps_iono, const Gps_CNAV_Utc_Model& gps_utc_model, const Glonass_Gnav_Utc_Model& glonass_gnav_utc_model, const Glonass_Gnav_Almanac& glonass_gnav_almanac) { - if(glonass_gnav_almanac.i_satellite_freq_channel){} //Avoid compiler warning + if (glonass_gnav_almanac.i_satellite_freq_channel) + { + } //Avoid compiler warning std::vector data; std::string line_aux; @@ -2135,11 +2146,11 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Gps_CNAV_Iono& gp bool no_more_finds = false; std::string line_str; - while(!out.eof()) + while (!out.eof()) { std::getline(out, line_str); - if(!no_more_finds) + if (!no_more_finds) { line_aux.clear(); @@ -2217,7 +2228,7 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Gps_CNAV_Iono& gp out.close(); out.open(navMixfilename, std::ios::out | std::ios::trunc); out.seekp(0); - for (int i = 0; i < (int) data.size() - 1; i++) + for (int i = 0; i < (int)data.size() - 1; i++) { out << data[i] << std::endl; } @@ -2230,9 +2241,13 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Gps_CNAV_Iono& gp void Rinex_Printer::update_nav_header(std::fstream& out, const Galileo_Iono& galileo_iono, const Galileo_Utc_Model& galileo_utc_model, const Galileo_Almanac& galileo_almanac, const Glonass_Gnav_Utc_Model& glonass_gnav_utc_model, const Glonass_Gnav_Almanac& glonass_gnav_almanac) { - if(glonass_gnav_almanac.i_satellite_freq_channel){} //Avoid compiler warning + if (glonass_gnav_almanac.i_satellite_freq_channel) + { + } //Avoid compiler warning //Avoid compiler warning, there is not time system correction between Galileo and GLONASS - if(galileo_almanac.A_0G_10){} + if (galileo_almanac.A_0G_10) + { + } std::vector data; std::string line_aux; @@ -2243,11 +2258,11 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Galileo_Iono& gal bool no_more_finds = false; std::string line_str; - while(!out.eof()) + while (!out.eof()) { std::getline(out, line_str); - if(!no_more_finds) + if (!no_more_finds) { line_aux.clear(); @@ -2305,7 +2320,6 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Galileo_Iono& gal { data.push_back(line_str); } - } else { @@ -2316,7 +2330,7 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Galileo_Iono& gal out.close(); out.open(navMixfilename, std::ios::out | std::ios::trunc); out.seekp(0); - for (int i = 0; i < (int) data.size() - 1; i++) + for (int i = 0; i < (int)data.size() - 1; i++) { out << data[i] << std::endl; } @@ -2327,31 +2341,31 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Galileo_Iono& gal } -void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::map& eph_map) +void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::map& eph_map) { std::string line; - std::map::const_iterator gps_ephemeris_iter; + std::map::const_iterator gps_ephemeris_iter; - for(gps_ephemeris_iter = eph_map.cbegin(); - gps_ephemeris_iter != eph_map.cend(); - gps_ephemeris_iter++) + for (gps_ephemeris_iter = eph_map.cbegin(); + gps_ephemeris_iter != eph_map.cend(); + gps_ephemeris_iter++) { // -------- SV / EPOCH / SV CLK boost::posix_time::ptime p_utc_time = Rinex_Printer::compute_GPS_time(gps_ephemeris_iter->second, gps_ephemeris_iter->second.d_Toc); std::string timestring = boost::posix_time::to_iso_string(p_utc_time); - std::string month (timestring, 4, 2); - std::string day (timestring, 6, 2); - std::string hour (timestring, 9, 2); - std::string minutes (timestring, 11, 2); - std::string seconds (timestring, 13, 2); + std::string month(timestring, 4, 2); + std::string day(timestring, 6, 2); + std::string hour(timestring, 9, 2); + std::string minutes(timestring, 11, 2); + std::string seconds(timestring, 13, 2); if (version == 2) { line += Rinex_Printer::rightJustify(boost::lexical_cast(gps_ephemeris_iter->second.i_satellite_PRN), 2); line += std::string(1, ' '); - std::string year (timestring, 2, 2); + std::string year(timestring, 2, 2); line += year; line += std::string(1, ' '); - if(boost::lexical_cast(month) < 10) + if (boost::lexical_cast(month) < 10) { line += std::string(1, ' '); line += std::string(month, 1, 1); @@ -2361,7 +2375,7 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::map(day) < 10) + if (boost::lexical_cast(day) < 10) { line += std::string(1, ' '); line += std::string(day, 1, 1); @@ -2371,7 +2385,7 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::map(hour) < 10) + if (boost::lexical_cast(hour) < 10) { line += std::string(1, ' '); line += std::string(hour, 1, 1); @@ -2381,7 +2395,7 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::map(minutes) < 10) + if (boost::lexical_cast(minutes) < 10) { line += std::string(1, ' '); line += std::string(minutes, 1, 1); @@ -2391,7 +2405,7 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::map(seconds) < 10) + if (boost::lexical_cast(seconds) < 10) { line += std::string(1, ' '); line += std::string(seconds, 1, 1); @@ -2404,7 +2418,7 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::map 16) { - std::string decimal (timestring, 16, 1); + std::string decimal(timestring, 16, 1); } line += decimal; line += std::string(1, ' '); @@ -2418,9 +2432,9 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::mapsecond.i_satellite_PRN < 10) line += std::string("0"); + if (gps_ephemeris_iter->second.i_satellite_PRN < 10) line += std::string("0"); line += boost::lexical_cast(gps_ephemeris_iter->second.i_satellite_PRN); - std::string year (timestring, 0, 4); + std::string year(timestring, 0, 4); line += std::string(1, ' '); line += year; line += std::string(1, ' '); @@ -2562,7 +2576,7 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::map(gps_ephemeris_iter->second.i_code_on_L2), 18, 2); line += std::string(1, ' '); - double GPS_week_continuous_number = static_cast(gps_ephemeris_iter->second.i_GPS_week + 1024); // valid until April 7, 2019 (check http://www.colorado.edu/geography/gcraft/notes/gps/gpseow.htm) + double GPS_week_continuous_number = static_cast(gps_ephemeris_iter->second.i_GPS_week + 1024); // valid until April 7, 2019 (check http://www.colorado.edu/geography/gcraft/notes/gps/gpseow.htm) line += Rinex_Printer::doub2for(GPS_week_continuous_number, 18, 2); line += std::string(1, ' '); line += Rinex_Printer::doub2for(static_cast(gps_ephemeris_iter->second.i_code_on_L2), 18, 2); @@ -2615,29 +2629,29 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::mapsecond.satelliteBlock.at(gps_ephemeris_iter->second.i_satellite_PRN).compare("IIA")) { // Block II/IIA (Table 20-XI IS-GPS-200E ) - if ( (gps_ephemeris_iter->second.d_IODC > 239) && (gps_ephemeris_iter->second.d_IODC < 248) ) curve_fit_interval = 8; - if ( ( (gps_ephemeris_iter->second.d_IODC > 247) && (gps_ephemeris_iter->second.d_IODC < 256) ) || (gps_ephemeris_iter->second.d_IODC == 496) ) curve_fit_interval = 14; - if ( (gps_ephemeris_iter->second.d_IODC > 496) && (gps_ephemeris_iter->second.d_IODC < 504) ) curve_fit_interval = 26; - if ( (gps_ephemeris_iter->second.d_IODC > 503) && (gps_ephemeris_iter->second.d_IODC < 511) ) curve_fit_interval = 50; - if ( ( (gps_ephemeris_iter->second.d_IODC > 751) && (gps_ephemeris_iter->second.d_IODC < 757) ) || (gps_ephemeris_iter->second.d_IODC == 511) ) curve_fit_interval = 74; - if ( gps_ephemeris_iter->second.d_IODC == 757 ) curve_fit_interval = 98; + if ((gps_ephemeris_iter->second.d_IODC > 239) && (gps_ephemeris_iter->second.d_IODC < 248)) curve_fit_interval = 8; + if (((gps_ephemeris_iter->second.d_IODC > 247) && (gps_ephemeris_iter->second.d_IODC < 256)) || (gps_ephemeris_iter->second.d_IODC == 496)) curve_fit_interval = 14; + if ((gps_ephemeris_iter->second.d_IODC > 496) && (gps_ephemeris_iter->second.d_IODC < 504)) curve_fit_interval = 26; + if ((gps_ephemeris_iter->second.d_IODC > 503) && (gps_ephemeris_iter->second.d_IODC < 511)) curve_fit_interval = 50; + if (((gps_ephemeris_iter->second.d_IODC > 751) && (gps_ephemeris_iter->second.d_IODC < 757)) || (gps_ephemeris_iter->second.d_IODC == 511)) curve_fit_interval = 74; + if (gps_ephemeris_iter->second.d_IODC == 757) curve_fit_interval = 98; } if ((gps_ephemeris_iter->second.satelliteBlock.at(gps_ephemeris_iter->second.i_satellite_PRN).compare("IIR") == 0) || - (gps_ephemeris_iter->second.satelliteBlock.at(gps_ephemeris_iter->second.i_satellite_PRN).compare("IIR-M") == 0) || - (gps_ephemeris_iter->second.satelliteBlock.at(gps_ephemeris_iter->second.i_satellite_PRN).compare("IIF") == 0) || - (gps_ephemeris_iter->second.satelliteBlock.at(gps_ephemeris_iter->second.i_satellite_PRN).compare("IIIA") == 0) ) + (gps_ephemeris_iter->second.satelliteBlock.at(gps_ephemeris_iter->second.i_satellite_PRN).compare("IIR-M") == 0) || + (gps_ephemeris_iter->second.satelliteBlock.at(gps_ephemeris_iter->second.i_satellite_PRN).compare("IIF") == 0) || + (gps_ephemeris_iter->second.satelliteBlock.at(gps_ephemeris_iter->second.i_satellite_PRN).compare("IIIA") == 0)) { // Block IIR/IIR-M/IIF/IIIA (Table 20-XII IS-GPS-200E ) - if ( (gps_ephemeris_iter->second.d_IODC > 239) && (gps_ephemeris_iter->second.d_IODC < 248)) curve_fit_interval = 8; - if ( ( (gps_ephemeris_iter->second.d_IODC > 247) && (gps_ephemeris_iter->second.d_IODC < 256)) || (gps_ephemeris_iter->second.d_IODC == 496) ) curve_fit_interval = 14; - if ( ( (gps_ephemeris_iter->second.d_IODC > 496) && (gps_ephemeris_iter->second.d_IODC < 504)) || ( (gps_ephemeris_iter->second.d_IODC > 1020) && (gps_ephemeris_iter->second.d_IODC < 1024) ) ) curve_fit_interval = 26; + if ((gps_ephemeris_iter->second.d_IODC > 239) && (gps_ephemeris_iter->second.d_IODC < 248)) curve_fit_interval = 8; + if (((gps_ephemeris_iter->second.d_IODC > 247) && (gps_ephemeris_iter->second.d_IODC < 256)) || (gps_ephemeris_iter->second.d_IODC == 496)) curve_fit_interval = 14; + if (((gps_ephemeris_iter->second.d_IODC > 496) && (gps_ephemeris_iter->second.d_IODC < 504)) || ((gps_ephemeris_iter->second.d_IODC > 1020) && (gps_ephemeris_iter->second.d_IODC < 1024))) curve_fit_interval = 26; } line += Rinex_Printer::doub2for(curve_fit_interval, 18, 2); line += std::string(1, ' '); - line += std::string(18, ' '); // spare + line += std::string(18, ' '); // spare line += std::string(1, ' '); - line += std::string(18, ' '); // spare + line += std::string(18, ' '); // spare if (version == 2) { line += std::string(1, ' '); @@ -2649,27 +2663,27 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::map& eph_map) +void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::map& eph_map) { std::string line; - std::map::const_iterator gps_ephemeris_iter; + std::map::const_iterator gps_ephemeris_iter; - for(gps_ephemeris_iter = eph_map.cbegin(); - gps_ephemeris_iter != eph_map.cend(); - gps_ephemeris_iter++) + for (gps_ephemeris_iter = eph_map.cbegin(); + gps_ephemeris_iter != eph_map.cend(); + gps_ephemeris_iter++) { // -------- SV / EPOCH / SV CLK boost::posix_time::ptime p_utc_time = Rinex_Printer::compute_GPS_time(gps_ephemeris_iter->second, gps_ephemeris_iter->second.d_Toc); std::string timestring = boost::posix_time::to_iso_string(p_utc_time); - std::string month (timestring, 4, 2); - std::string day (timestring, 6, 2); - std::string hour (timestring, 9, 2); - std::string minutes (timestring, 11, 2); - std::string seconds (timestring, 13, 2); + std::string month(timestring, 4, 2); + std::string day(timestring, 6, 2); + std::string hour(timestring, 9, 2); + std::string minutes(timestring, 11, 2); + std::string seconds(timestring, 13, 2); line += satelliteSystem["GPS"]; - if (gps_ephemeris_iter->second.i_satellite_PRN < 10) line += std::string("0"); + if (gps_ephemeris_iter->second.i_satellite_PRN < 10) line += std::string("0"); line += boost::lexical_cast(gps_ephemeris_iter->second.i_satellite_PRN); - std::string year (timestring, 0, 4); + std::string year(timestring, 0, 4); line += std::string(1, ' '); line += year; line += std::string(1, ' '); @@ -2697,11 +2711,11 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::mapsecond.d_Toe1 == gps_ephemeris_iter->second.d_Toe2) && (gps_ephemeris_iter->second.d_Toe1 == gps_ephemeris_iter->second.d_Toc)) ) // Toe1: Toe in message type 10, Toe2: Toe in message type 11 + if (!((gps_ephemeris_iter->second.d_Toe1 == gps_ephemeris_iter->second.d_Toe2) && (gps_ephemeris_iter->second.d_Toe1 == gps_ephemeris_iter->second.d_Toc))) // Toe1: Toe in message type 10, Toe2: Toe in message type 11 { // Toe1: Toe in message type 10, Toe2: Toe in message type 11, fake_cnav_iode = fake_cnav_iode + 1; - if(fake_cnav_iode == 240) fake_cnav_iode = 1; + if (fake_cnav_iode == 240) fake_cnav_iode = 1; } line += Rinex_Printer::doub2for(fake_cnav_iode, 18, 2); @@ -2723,7 +2737,7 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::mapsecond.d_Cus, 18, 2); line += std::string(1, ' '); - const double A_REF = 26559710.0; // See IS-GPS-200H, pp. 163 + const double A_REF = 26559710.0; // See IS-GPS-200H, pp. 163 double sqrt_A = sqrt(A_REF + gps_ephemeris_iter->second.d_DELTA_A); line += Rinex_Printer::doub2for(sqrt_A, 18, 2); Rinex_Printer::lengthCheck(line); @@ -2751,7 +2765,7 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::mapsecond.d_OMEGA, 18, 2); line += std::string(1, ' '); - const double OMEGA_DOT_REF = -2.6e-9; // semicircles / s, see IS-GPS-200H pp. 164 + const double OMEGA_DOT_REF = -2.6e-9; // semicircles / s, see IS-GPS-200H pp. 164 double OMEGA_DOT = OMEGA_DOT_REF + gps_ephemeris_iter->second.d_DELTA_OMEGA_DOT; line += Rinex_Printer::doub2for(OMEGA_DOT, 18, 2); Rinex_Printer::lengthCheck(line); @@ -2766,7 +2780,7 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::map(gps_ephemeris_iter->second.i_GPS_week + 1024); // valid until April 7, 2019 (check http://www.colorado.edu/geography/gcraft/notes/gps/gpseow.htm) + double GPS_week_continuous_number = static_cast(gps_ephemeris_iter->second.i_GPS_week + 1024); // valid until April 7, 2019 (check http://www.colorado.edu/geography/gcraft/notes/gps/gpseow.htm) line += Rinex_Printer::doub2for(GPS_week_continuous_number, 18, 2); line += std::string(1, ' '); line += Rinex_Printer::doub2for(my_zero, 18, 2); @@ -2792,12 +2806,12 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::mapsecond.d_TOW, 18, 2); line += std::string(1, ' '); - double curve_fit_interval = 3; /// ?? Not defined in CNAV + double curve_fit_interval = 3; /// ?? Not defined in CNAV line += Rinex_Printer::doub2for(curve_fit_interval, 18, 2); line += std::string(1, ' '); - line += std::string(18, ' '); // spare + line += std::string(18, ' '); // spare line += std::string(1, ' '); - line += std::string(18, ' '); // spare + line += std::string(18, ' '); // spare Rinex_Printer::lengthCheck(line); out << line << std::endl; line.clear(); @@ -2808,25 +2822,25 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::map& eph_map) { std::string line; - std::map::const_iterator galileo_ephemeris_iter; + std::map::const_iterator galileo_ephemeris_iter; line.clear(); - for(galileo_ephemeris_iter = eph_map.cbegin(); - galileo_ephemeris_iter != eph_map.cend(); - galileo_ephemeris_iter++) + for (galileo_ephemeris_iter = eph_map.cbegin(); + galileo_ephemeris_iter != eph_map.cend(); + galileo_ephemeris_iter++) { // -------- SV / EPOCH / SV CLK boost::posix_time::ptime p_utc_time = Rinex_Printer::compute_Galileo_time(galileo_ephemeris_iter->second, galileo_ephemeris_iter->second.t0e_1); std::string timestring = boost::posix_time::to_iso_string(p_utc_time); - std::string month (timestring, 4, 2); - std::string day (timestring, 6, 2); - std::string hour (timestring, 9, 2); - std::string minutes (timestring, 11, 2); - std::string seconds (timestring, 13, 2); + std::string month(timestring, 4, 2); + std::string day(timestring, 6, 2); + std::string hour(timestring, 9, 2); + std::string minutes(timestring, 11, 2); + std::string seconds(timestring, 13, 2); line += satelliteSystem["Galileo"]; - if (galileo_ephemeris_iter->second.i_satellite_PRN < 10) line += std::string("0"); + if (galileo_ephemeris_iter->second.i_satellite_PRN < 10) line += std::string("0"); line += boost::lexical_cast(galileo_ephemeris_iter->second.i_satellite_PRN); - std::string year (timestring, 0, 4); + std::string year(timestring, 0, 4); line += std::string(1, ' '); line += year; line += std::string(1, ' '); @@ -2912,7 +2926,7 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::map(data_source_INAV), 18, 2); line += std::string(1, ' '); double GST_week = static_cast(galileo_ephemeris_iter->second.WN_5); - double num_GST_rollovers = floor((GST_week + 1024.0) / 4096.0 ); + double num_GST_rollovers = floor((GST_week + 1024.0) / 4096.0); double Galileo_week_continuous_number = GST_week + 1024.0 + num_GST_rollovers * 4096.0; line += Rinex_Printer::doub2for(Galileo_week_continuous_number, 18, 2); line += std::string(1, ' '); @@ -2929,28 +2943,26 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::mapsecond.E1B_HS_5 == 0) E1B_HS = "00"; - if(galileo_ephemeris_iter->second.E1B_HS_5 == 1) E1B_HS = "01"; - if(galileo_ephemeris_iter->second.E1B_HS_5 == 2) E1B_HS = "10"; - if(galileo_ephemeris_iter->second.E1B_HS_5 == 3) E1B_HS = "11"; - if(galileo_ephemeris_iter->second.E5b_HS_5 == 0) E5B_HS = "00"; - if(galileo_ephemeris_iter->second.E5b_HS_5 == 1) E5B_HS = "01"; - if(galileo_ephemeris_iter->second.E5b_HS_5 == 2) E5B_HS = "10"; - if(galileo_ephemeris_iter->second.E5b_HS_5 == 3) E5B_HS = "11"; + if (galileo_ephemeris_iter->second.E1B_HS_5 == 0) E1B_HS = "00"; + if (galileo_ephemeris_iter->second.E1B_HS_5 == 1) E1B_HS = "01"; + if (galileo_ephemeris_iter->second.E1B_HS_5 == 2) E1B_HS = "10"; + if (galileo_ephemeris_iter->second.E1B_HS_5 == 3) E1B_HS = "11"; + if (galileo_ephemeris_iter->second.E5b_HS_5 == 0) E5B_HS = "00"; + if (galileo_ephemeris_iter->second.E5b_HS_5 == 1) E5B_HS = "01"; + if (galileo_ephemeris_iter->second.E5b_HS_5 == 2) E5B_HS = "10"; + if (galileo_ephemeris_iter->second.E5b_HS_5 == 3) E5B_HS = "11"; - if(E1B_HS == "11") LOG(WARNING) << "Signal Component currently in Test"; - if(E1B_HS == "10") LOG(WARNING) << "Signal will be out of service"; - if(E1B_HS == "01") LOG(WARNING) << "Signal out of service"; + if (E1B_HS == "11") LOG(WARNING) << "Signal Component currently in Test"; + if (E1B_HS == "10") LOG(WARNING) << "Signal will be out of service"; + if (E1B_HS == "01") LOG(WARNING) << "Signal out of service"; E1B_HS = "00"; // *************** CHANGE THIS WHEN GALILEO SIGNAL IS VALID std::string E1B_DVS = boost::lexical_cast(galileo_ephemeris_iter->second.E1B_DVS_5); - if(E1B_DVS == "1") LOG(WARNING) << "Navigation data without guarantee"; - E1B_DVS = "0"; // *************** CHANGE THIS WHEN GALILEO SIGNAL IS VALID + if (E1B_DVS == "1") LOG(WARNING) << "Navigation data without guarantee"; + E1B_DVS = "0"; // *************** CHANGE THIS WHEN GALILEO SIGNAL IS VALID - std::string SVhealth_str = E5B_HS + boost::lexical_cast(galileo_ephemeris_iter->second.E5b_DVS_5) - + "11" + "1" + E1B_DVS + E1B_HS - + boost::lexical_cast(galileo_ephemeris_iter->second.E1B_DVS_5); - SVhealth_str = "000000000"; // *************** CHANGE THIS WHEN GALILEO SIGNAL IS VALID + std::string SVhealth_str = E5B_HS + boost::lexical_cast(galileo_ephemeris_iter->second.E5b_DVS_5) + "11" + "1" + E1B_DVS + E1B_HS + boost::lexical_cast(galileo_ephemeris_iter->second.E1B_DVS_5); + SVhealth_str = "000000000"; // *************** CHANGE THIS WHEN GALILEO SIGNAL IS VALID int SVhealth = Rinex_Printer::toInt(SVhealth_str, 9); line += Rinex_Printer::doub2for(static_cast(SVhealth), 18, 2); line += std::string(1, ' '); @@ -2967,9 +2979,9 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::map& eph_map) +void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::map& eph_map) { std::string line; - std::map::const_iterator glonass_gnav_ephemeris_iter; + std::map::const_iterator glonass_gnav_ephemeris_iter; - for(glonass_gnav_ephemeris_iter = eph_map.begin(); - glonass_gnav_ephemeris_iter != eph_map.end(); - glonass_gnav_ephemeris_iter++) + for (glonass_gnav_ephemeris_iter = eph_map.begin(); + glonass_gnav_ephemeris_iter != eph_map.end(); + glonass_gnav_ephemeris_iter++) { // -------- SV / EPOCH / SV CLK boost::posix_time::ptime p_utc_time = glonass_gnav_ephemeris_iter->second.glot_to_utc(glonass_gnav_ephemeris_iter->second.d_t_b, 0.0); std::string timestring = boost::posix_time::to_iso_string(p_utc_time); - std::string month (timestring, 4, 2); - std::string day (timestring, 6, 2); - std::string hour (timestring, 9, 2); - std::string minutes (timestring, 11, 2); - std::string seconds (timestring, 13, 2); + std::string month(timestring, 4, 2); + std::string day(timestring, 6, 2); + std::string hour(timestring, 9, 2); + std::string minutes(timestring, 11, 2); + std::string seconds(timestring, 13, 2); if (version == 2) { line += Rinex_Printer::rightJustify(boost::lexical_cast(glonass_gnav_ephemeris_iter->second.i_satellite_PRN), 2); line += std::string(1, ' '); - std::string year (timestring, 2, 2); + std::string year(timestring, 2, 2); line += year; line += std::string(1, ' '); - if(boost::lexical_cast(month) < 10) + if (boost::lexical_cast(month) < 10) { line += std::string(1, ' '); line += std::string(month, 1, 1); @@ -3011,7 +3023,7 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::map(day) < 10) + if (boost::lexical_cast(day) < 10) { line += std::string(1, ' '); line += std::string(day, 1, 1); @@ -3021,7 +3033,7 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::map(hour) < 10) + if (boost::lexical_cast(hour) < 10) { line += std::string(1, ' '); line += std::string(hour, 1, 1); @@ -3031,7 +3043,7 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::map(minutes) < 10) + if (boost::lexical_cast(minutes) < 10) { line += std::string(1, ' '); line += std::string(minutes, 1, 1); @@ -3041,7 +3053,7 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::map(seconds) < 10) + if (boost::lexical_cast(seconds) < 10) { line += std::string(1, ' '); line += std::string(seconds, 1, 1); @@ -3054,7 +3066,7 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::map 16) { - std::string decimal (timestring, 16, 1); + std::string decimal(timestring, 16, 1); } line += decimal; line += std::string(1, ' '); @@ -3068,9 +3080,9 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::mapsecond.i_satellite_PRN < 10) line += std::string("0"); + if (glonass_gnav_ephemeris_iter->second.i_satellite_PRN < 10) line += std::string("0"); line += boost::lexical_cast(glonass_gnav_ephemeris_iter->second.i_satellite_PRN); - std::string year (timestring, 0, 4); + std::string year(timestring, 0, 4); line += std::string(1, ' '); line += year; line += std::string(1, ' '); @@ -3089,7 +3101,7 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::mapsecond.d_gamma_n, 18, 2); line += std::string(1, ' '); //TODO need to define this here. what is nd - line += Rinex_Printer::doub2for(glonass_gnav_ephemeris_iter->second.d_t_k + p_utc_time.date().day_of_week()*86400, 18, 2); + line += Rinex_Printer::doub2for(glonass_gnav_ephemeris_iter->second.d_t_k + p_utc_time.date().day_of_week() * 86400, 18, 2); } Rinex_Printer::lengthCheck(line); out << line << std::endl; @@ -3208,9 +3220,11 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::map::const_iterator glonass_gnav_ephemeris_iter; + std::map::const_iterator glonass_gnav_ephemeris_iter; // -------- Line 1 line = std::string(5, ' '); @@ -3270,7 +3284,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Glonass_Gnav_Ephem // -------- Line MARKER NAME line.clear(); - line += Rinex_Printer::leftJustify("DEFAULT MARKER NAME", 60); // put a flag or a property, + line += Rinex_Printer::leftJustify("DEFAULT MARKER NAME", 60); // put a flag or a property, line += Rinex_Printer::leftJustify("MARKER NAME", 20); Rinex_Printer::lengthCheck(line); out << line << std::endl; @@ -3279,7 +3293,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Glonass_Gnav_Ephem if (version == 2) { line.clear(); - line += Rinex_Printer::leftJustify("GROUND_CRAFT", 20); // put a flag or a property + line += Rinex_Printer::leftJustify("GROUND_CRAFT", 20); // put a flag or a property line += std::string(40, ' '); line += Rinex_Printer::leftJustify("MARKER NUMBER", 20); Rinex_Printer::lengthCheck(line); @@ -3288,7 +3302,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Glonass_Gnav_Ephem if (version == 3) { line.clear(); - line += Rinex_Printer::leftJustify("GROUND_CRAFT", 20); // put a flag or a property + line += Rinex_Printer::leftJustify("GROUND_CRAFT", 20); // put a flag or a property line += std::string(40, ' '); line += Rinex_Printer::leftJustify("MARKER TYPE", 20); Rinex_Printer::lengthCheck(line); @@ -3309,17 +3323,17 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Glonass_Gnav_Ephem username = "UNKNOWN USER"; } line += leftJustify(username, 20); - line += Rinex_Printer::leftJustify("CTTC", 40); // add flag and property + line += Rinex_Printer::leftJustify("CTTC", 40); // add flag and property line += Rinex_Printer::leftJustify("OBSERVER / AGENCY", 20); Rinex_Printer::lengthCheck(line); out << line << std::endl; // -------- Line REC / TYPE VERS line.clear(); - line += Rinex_Printer::leftJustify("GNSS-SDR", 20); // add flag and property - line += Rinex_Printer::leftJustify("Software Receiver", 20); // add flag and property + line += Rinex_Printer::leftJustify("GNSS-SDR", 20); // add flag and property + line += Rinex_Printer::leftJustify("Software Receiver", 20); // add flag and property //line += Rinex_Printer::leftJustify(google::VersionString(), 20); // add flag and property - if(gnss_sdr_version.length() > 20) gnss_sdr_version.resize(9, ' '); + if (gnss_sdr_version.length() > 20) gnss_sdr_version.resize(9, ' '); line += Rinex_Printer::leftJustify(gnss_sdr_version, 20); line += Rinex_Printer::leftJustify("REC # / TYPE / VERS", 20); lengthCheck(line); @@ -3328,7 +3342,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Glonass_Gnav_Ephem // -------- ANTENNA TYPE line.clear(); line += Rinex_Printer::leftJustify("Antenna number", 20); // add flag and property - line += Rinex_Printer::leftJustify("Antenna type", 20); // add flag and property + line += Rinex_Printer::leftJustify("Antenna type", 20); // add flag and property line += std::string(20, ' '); line += Rinex_Printer::leftJustify("ANT # / TYPE", 20); Rinex_Printer::lengthCheck(line); @@ -3380,7 +3394,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Glonass_Gnav_Ephem signal_ = "2G"; std::size_t found_2G = glonass_bands.find(signal_); - if(found_1G != std::string::npos) + if (found_1G != std::string::npos) { line += std::string(1, ' '); line += observationType["PSEUDORANGE"]; @@ -3396,7 +3410,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Glonass_Gnav_Ephem line += observationCode["GLONASS_G1_CA"]; } - if(found_2G != std::string::npos) + if (found_2G != std::string::npos) { line += std::string(1, ' '); line += observationType["PSEUDORANGE"]; @@ -3412,7 +3426,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Glonass_Gnav_Ephem line += observationCode["GLONASS_G2_CA"]; } - line += std::string(60-line.size(), ' '); + line += std::string(60 - line.size(), ' '); line += Rinex_Printer::leftJustify("SYS / # / OBS TYPES", 20); Rinex_Printer::lengthCheck(line); out << line << std::endl; @@ -3437,7 +3451,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Glonass_Gnav_Ephem // GLONASS L1 SIGNAL STRENGTH line += Rinex_Printer::rightJustify(observationType["SIGNAL_STRENGTH_v2"], 5); line += observationCode["GLONASS_G1_CA_v2"]; - line += std::string(60-line.size(), ' '); + line += std::string(60 - line.size(), ' '); line += Rinex_Printer::leftJustify("# / TYPES OF OBSERV", 20); Rinex_Printer::lengthCheck(line); out << line << std::endl; @@ -3456,15 +3470,15 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Glonass_Gnav_Ephem } // -------- TIME OF FIRST OBS - boost::posix_time::ptime p_utc_time = Rinex_Printer::compute_UTC_time(eph,d_TOW_first_observation); + boost::posix_time::ptime p_utc_time = Rinex_Printer::compute_UTC_time(eph, d_TOW_first_observation); std::string timestring = boost::posix_time::to_iso_string(p_utc_time); - std::string year (timestring, 0, 4); - std::string month (timestring, 4, 2); - std::string day (timestring, 6, 2); - std::string hour (timestring, 9, 2); - std::string minutes (timestring, 11, 2); + std::string year(timestring, 0, 4); + std::string month(timestring, 4, 2); + std::string day(timestring, 6, 2); + std::string hour(timestring, 9, 2); + std::string minutes(timestring, 11, 2); double intpart = 0; - double seconds = p_utc_time.time_of_day().seconds() + modf (d_TOW_first_observation , &intpart); + double seconds = p_utc_time.time_of_day().seconds() + modf(d_TOW_first_observation, &intpart); line.clear(); line += Rinex_Printer::rightJustify(year, 6); line += Rinex_Printer::rightJustify(month, 6); @@ -3484,14 +3498,14 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Glonass_Gnav_Ephem // -------- GLONASS SLOT / FRQ # // TODO Need to provide system with list of all satellites and update this accordingly line.clear(); - line += Rinex_Printer::rightJustify(boost::lexical_cast(0), 3); // Number of satellites in list + line += Rinex_Printer::rightJustify(boost::lexical_cast(0), 3); // Number of satellites in list line += std::string(1, ' '); line += satelliteSystem["GLONASS"]; - line += Rinex_Printer::rightJustify(boost::lexical_cast(0), 2); // Slot Number + line += Rinex_Printer::rightJustify(boost::lexical_cast(0), 2); // Slot Number line += std::string(1, ' '); - line += Rinex_Printer::rightJustify(boost::lexical_cast(0), 2); // Frequency Number + line += Rinex_Printer::rightJustify(boost::lexical_cast(0), 2); // Frequency Number line += std::string(1, ' '); - line += std::string(60-line.size(), ' '); + line += std::string(60 - line.size(), ' '); line += Rinex_Printer::leftJustify("GLONASS SLOT / FRQ #", 20); Rinex_Printer::lengthCheck(line); out << line << std::endl; @@ -3519,7 +3533,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Glonass_Gnav_Ephem line += observationCode["GLONASS_G2_P"]; line += std::string(1, ' '); line += Rinex_Printer::rightJustify(asString(0.0, 3), 8); - line += std::string(60-line.size(), ' '); + line += std::string(60 - line.size(), ' '); line += Rinex_Printer::leftJustify("GLONASS COD/PHS/BIS", 20); Rinex_Printer::lengthCheck(line); out << line << std::endl; @@ -3536,7 +3550,9 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Glonass_Gnav_Ephem void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& gps_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, const double d_TOW_first_observation, const std::string glonass_bands) { - if(glonass_gnav_eph.d_m){} // avoid warning, not needed + if (glonass_gnav_eph.d_m) + { + } // avoid warning, not needed std::string line; // -------- Line 1 @@ -3592,7 +3608,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& gps if (version == 2) { line.clear(); - line += Rinex_Printer::leftJustify("GROUND_CRAFT", 20); // put a flag or a property + line += Rinex_Printer::leftJustify("GROUND_CRAFT", 20); // put a flag or a property line += std::string(40, ' '); line += Rinex_Printer::leftJustify("MARKER NUMBER", 20); Rinex_Printer::lengthCheck(line); @@ -3601,7 +3617,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& gps if (version == 3) { line.clear(); - line += Rinex_Printer::leftJustify("GROUND_CRAFT", 20); // put a flag or a property + line += Rinex_Printer::leftJustify("GROUND_CRAFT", 20); // put a flag or a property line += std::string(40, ' '); line += Rinex_Printer::leftJustify("MARKER TYPE", 20); Rinex_Printer::lengthCheck(line); @@ -3610,7 +3626,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& gps // -------- Line MARKER TYPE line.clear(); - line += Rinex_Printer::leftJustify("NON_GEODETIC", 20); // put a flag or a property + line += Rinex_Printer::leftJustify("NON_GEODETIC", 20); // put a flag or a property line += std::string(40, ' '); line += Rinex_Printer::leftJustify("MARKER TYPE", 20); Rinex_Printer::lengthCheck(line); @@ -3630,17 +3646,17 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& gps username = "UNKNOWN USER"; } line += leftJustify(username, 20); - line += Rinex_Printer::leftJustify("CTTC", 40); // add flag and property + line += Rinex_Printer::leftJustify("CTTC", 40); // add flag and property line += Rinex_Printer::leftJustify("OBSERVER / AGENCY", 20); Rinex_Printer::lengthCheck(line); out << line << std::endl; // -------- Line REC / TYPE VERS line.clear(); - line += Rinex_Printer::leftJustify("GNSS-SDR", 20); // add flag and property - line += Rinex_Printer::leftJustify("Software Receiver", 20); // add flag and property + line += Rinex_Printer::leftJustify("GNSS-SDR", 20); // add flag and property + line += Rinex_Printer::leftJustify("Software Receiver", 20); // add flag and property //line += Rinex_Printer::leftJustify(google::VersionString(), 20); // add flag and property - if(gnss_sdr_version.length() > 20) gnss_sdr_version.resize(9, ' '); + if (gnss_sdr_version.length() > 20) gnss_sdr_version.resize(9, ' '); line += Rinex_Printer::leftJustify(gnss_sdr_version, 20); line += Rinex_Printer::leftJustify("REC # / TYPE / VERS", 20); lengthCheck(line); @@ -3649,7 +3665,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& gps // -------- ANTENNA TYPE line.clear(); line += Rinex_Printer::leftJustify("Antenna number", 20); // add flag and property - line += Rinex_Printer::leftJustify("Antenna type", 20); // add flag and property + line += Rinex_Printer::leftJustify("Antenna type", 20); // add flag and property line += std::string(20, ' '); line += Rinex_Printer::leftJustify("ANT # / TYPE", 20); Rinex_Printer::lengthCheck(line); @@ -3684,7 +3700,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& gps out << line << std::endl; // -------- SYS / OBS TYPES - if(version == 3) + if (version == 3) { // one line per available system line.clear(); @@ -3711,7 +3727,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& gps line += std::string(1, ' '); line += observationType["SIGNAL_STRENGTH"]; line += observationCode["GPS_L1_CA"]; - line += std::string(60-line.size(), ' '); + line += std::string(60 - line.size(), ' '); line += Rinex_Printer::leftJustify("SYS / # / OBS TYPES", 20); Rinex_Printer::lengthCheck(line); out << line << std::endl; @@ -3720,13 +3736,13 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& gps unsigned int number_of_observations_glo = 0; std::string signal_("1G"); std::size_t found_1G = glonass_bands.find(signal_); - if(found_1G != std::string::npos) + if (found_1G != std::string::npos) { number_of_observations_glo = number_of_observations_glo + 4; } signal_ = "2G"; std::size_t found_2G = glonass_bands.find(signal_); - if(found_2G != std::string::npos) + if (found_2G != std::string::npos) { number_of_observations_glo = number_of_observations_glo + 4; } @@ -3734,7 +3750,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& gps line += satelliteSystem["GLONASS"]; line += std::string(2, ' '); line += Rinex_Printer::rightJustify(std::to_string(number_of_observations_glo), 3); - if(found_1G != std::string::npos) + if (found_1G != std::string::npos) { line += std::string(1, ' '); line += observationType["PSEUDORANGE"]; @@ -3749,7 +3765,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& gps line += observationType["SIGNAL_STRENGTH"]; line += observationCode["GLONASS_G1_CA"]; } - if(found_2G != std::string::npos) + if (found_2G != std::string::npos) { line += std::string(1, ' '); line += observationType["PSEUDORANGE"]; @@ -3764,12 +3780,12 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& gps line += observationType["SIGNAL_STRENGTH"]; line += observationCode["GLONASS_G2_CA"]; } - line += std::string(60-line.size(), ' '); + line += std::string(60 - line.size(), ' '); line += Rinex_Printer::leftJustify("SYS / # / OBS TYPES", 20); Rinex_Printer::lengthCheck(line); out << line << std::endl; } - if(version == 2) + if (version == 2) { // -------- SYS / OBS TYPES line.clear(); @@ -3789,14 +3805,14 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& gps // GLONASS L1 SIGNAL STRENGTH line += Rinex_Printer::rightJustify(observationType["SIGNAL_STRENGTH_v2"], 5); line += observationCode["GLONASS_G1_CA_v2"]; - line += std::string(60-line.size(), ' '); + line += std::string(60 - line.size(), ' '); line += Rinex_Printer::leftJustify("# / TYPES OF OBSERV", 20); Rinex_Printer::lengthCheck(line); out << line << std::endl; } // -------- Signal Strength units (only version 3) - if(version == 3) + if (version == 3) { line.clear(); line += Rinex_Printer::leftJustify("DBHZ", 20); @@ -3809,12 +3825,12 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& gps // -------- TIME OF FIRST OBS line.clear(); boost::posix_time::ptime p_gps_time = Rinex_Printer::compute_GPS_time(gps_eph, d_TOW_first_observation); - std::string timestring=boost::posix_time::to_iso_string(p_gps_time); - std::string year (timestring, 0, 4); - std::string month (timestring, 4, 2); - std::string day (timestring, 6, 2); - std::string hour (timestring, 9, 2); - std::string minutes (timestring, 11, 2); + std::string timestring = boost::posix_time::to_iso_string(p_gps_time); + std::string year(timestring, 0, 4); + std::string month(timestring, 4, 2); + std::string day(timestring, 6, 2); + std::string hour(timestring, 9, 2); + std::string minutes(timestring, 11, 2); double gps_t = d_TOW_first_observation; double seconds = fmod(gps_t, 60); line += Rinex_Printer::rightJustify(year, 6); @@ -3835,14 +3851,14 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& gps // -------- GLONASS SLOT / FRQ # // TODO Need to provide system with list of all satellites and update this accordingly line.clear(); - line += Rinex_Printer::rightJustify(boost::lexical_cast(0), 3); // Number of satellites in list + line += Rinex_Printer::rightJustify(boost::lexical_cast(0), 3); // Number of satellites in list line += std::string(1, ' '); line += satelliteSystem["GLONASS"]; - line += Rinex_Printer::rightJustify(boost::lexical_cast(0), 2); // Slot Number + line += Rinex_Printer::rightJustify(boost::lexical_cast(0), 2); // Slot Number line += std::string(1, ' '); - line += Rinex_Printer::rightJustify(boost::lexical_cast(0), 2); // Frequency Number + line += Rinex_Printer::rightJustify(boost::lexical_cast(0), 2); // Frequency Number line += std::string(1, ' '); - line += std::string(60-line.size(), ' '); + line += std::string(60 - line.size(), ' '); line += Rinex_Printer::leftJustify("GLONASS SLOT / FRQ #", 20); Rinex_Printer::lengthCheck(line); out << line << std::endl; @@ -3870,7 +3886,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& gps line += observationCode["GLONASS_G2_P"]; line += std::string(1, ' '); line += Rinex_Printer::rightJustify(asString(0.0, 3), 8); - line += std::string(60-line.size(), ' '); + line += std::string(60 - line.size(), ' '); line += Rinex_Printer::leftJustify("GLONASS COD/PHS/BIS", 20); Rinex_Printer::lengthCheck(line); out << line << std::endl; @@ -3887,7 +3903,9 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& gps void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_CNAV_Ephemeris& gps_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, const double d_TOW_first_observation, const std::string glonass_bands) { - if(glonass_gnav_eph.d_m){} // avoid warning, not needed + if (glonass_gnav_eph.d_m) + { + } // avoid warning, not needed std::string line; // -------- Line 1 @@ -3943,7 +3961,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_CNAV_Ephemeris if (version == 2) { line.clear(); - line += Rinex_Printer::leftJustify("GROUND_CRAFT", 20); // put a flag or a property + line += Rinex_Printer::leftJustify("GROUND_CRAFT", 20); // put a flag or a property line += std::string(40, ' '); line += Rinex_Printer::leftJustify("MARKER NUMBER", 20); Rinex_Printer::lengthCheck(line); @@ -3952,7 +3970,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_CNAV_Ephemeris if (version == 3) { line.clear(); - line += Rinex_Printer::leftJustify("GROUND_CRAFT", 20); // put a flag or a property + line += Rinex_Printer::leftJustify("GROUND_CRAFT", 20); // put a flag or a property line += std::string(40, ' '); line += Rinex_Printer::leftJustify("MARKER TYPE", 20); Rinex_Printer::lengthCheck(line); @@ -3961,7 +3979,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_CNAV_Ephemeris // -------- Line MARKER TYPE line.clear(); - line += Rinex_Printer::leftJustify("NON_GEODETIC", 20); // put a flag or a property + line += Rinex_Printer::leftJustify("NON_GEODETIC", 20); // put a flag or a property line += std::string(40, ' '); line += Rinex_Printer::leftJustify("MARKER TYPE", 20); Rinex_Printer::lengthCheck(line); @@ -3981,17 +3999,17 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_CNAV_Ephemeris username = "UNKNOWN USER"; } line += leftJustify(username, 20); - line += Rinex_Printer::leftJustify("CTTC", 40); // add flag and property + line += Rinex_Printer::leftJustify("CTTC", 40); // add flag and property line += Rinex_Printer::leftJustify("OBSERVER / AGENCY", 20); Rinex_Printer::lengthCheck(line); out << line << std::endl; // -------- Line REC / TYPE VERS line.clear(); - line += Rinex_Printer::leftJustify("GNSS-SDR", 20); // add flag and property - line += Rinex_Printer::leftJustify("Software Receiver", 20); // add flag and property + line += Rinex_Printer::leftJustify("GNSS-SDR", 20); // add flag and property + line += Rinex_Printer::leftJustify("Software Receiver", 20); // add flag and property //line += Rinex_Printer::leftJustify(google::VersionString(), 20); // add flag and property - if(gnss_sdr_version.length() > 20) gnss_sdr_version.resize(9, ' '); + if (gnss_sdr_version.length() > 20) gnss_sdr_version.resize(9, ' '); line += Rinex_Printer::leftJustify(gnss_sdr_version, 20); line += Rinex_Printer::leftJustify("REC # / TYPE / VERS", 20); lengthCheck(line); @@ -4000,7 +4018,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_CNAV_Ephemeris // -------- ANTENNA TYPE line.clear(); line += Rinex_Printer::leftJustify("Antenna number", 20); // add flag and property - line += Rinex_Printer::leftJustify("Antenna type", 20); // add flag and property + line += Rinex_Printer::leftJustify("Antenna type", 20); // add flag and property line += std::string(20, ' '); line += Rinex_Printer::leftJustify("ANT # / TYPE", 20); Rinex_Printer::lengthCheck(line); @@ -4060,7 +4078,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_CNAV_Ephemeris line += std::string(1, ' '); line += observationType["SIGNAL_STRENGTH"]; line += observationCode["GPS_L2_L2CM"]; - line += std::string(60-line.size(), ' '); + line += std::string(60 - line.size(), ' '); line += Rinex_Printer::leftJustify("SYS / # / OBS TYPES", 20); Rinex_Printer::lengthCheck(line); out << line << std::endl; @@ -4069,13 +4087,13 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_CNAV_Ephemeris unsigned int number_of_observations_glo = 0; std::string signal_("1G"); std::size_t found_1G = glonass_bands.find(signal_); - if(found_1G != std::string::npos) + if (found_1G != std::string::npos) { number_of_observations_glo = number_of_observations_glo + 4; } signal_ = "2G"; std::size_t found_2G = glonass_bands.find(signal_); - if(found_2G != std::string::npos) + if (found_2G != std::string::npos) { number_of_observations_glo = number_of_observations_glo + 4; } @@ -4083,7 +4101,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_CNAV_Ephemeris line += satelliteSystem["GLONASS"]; line += std::string(2, ' '); line += Rinex_Printer::rightJustify(std::to_string(number_of_observations_glo), 3); - if(found_1G != std::string::npos) + if (found_1G != std::string::npos) { line += std::string(1, ' '); line += observationType["PSEUDORANGE"]; @@ -4098,7 +4116,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_CNAV_Ephemeris line += observationType["SIGNAL_STRENGTH"]; line += observationCode["GLONASS_G1_CA"]; } - if(found_2G != std::string::npos) + if (found_2G != std::string::npos) { line += std::string(1, ' '); line += observationType["PSEUDORANGE"]; @@ -4113,7 +4131,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_CNAV_Ephemeris line += observationType["SIGNAL_STRENGTH"]; line += observationCode["GLONASS_G2_CA"]; } - line += std::string(60-line.size(), ' '); + line += std::string(60 - line.size(), ' '); line += Rinex_Printer::leftJustify("SYS / # / OBS TYPES", 20); Rinex_Printer::lengthCheck(line); out << line << std::endl; @@ -4129,12 +4147,12 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_CNAV_Ephemeris // -------- TIME OF FIRST OBS line.clear(); boost::posix_time::ptime p_gps_time = Rinex_Printer::compute_GPS_time(gps_eph, d_TOW_first_observation); - std::string timestring=boost::posix_time::to_iso_string(p_gps_time); - std::string year (timestring, 0, 4); - std::string month (timestring, 4, 2); - std::string day (timestring, 6, 2); - std::string hour (timestring, 9, 2); - std::string minutes (timestring, 11, 2); + std::string timestring = boost::posix_time::to_iso_string(p_gps_time); + std::string year(timestring, 0, 4); + std::string month(timestring, 4, 2); + std::string day(timestring, 6, 2); + std::string hour(timestring, 9, 2); + std::string minutes(timestring, 11, 2); double gps_t = d_TOW_first_observation; double seconds = fmod(gps_t, 60); line += Rinex_Printer::rightJustify(year, 6); @@ -4152,14 +4170,14 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_CNAV_Ephemeris // -------- GLONASS SLOT / FRQ # // TODO Need to provide system with list of all satellites and update this accordingly line.clear(); - line += Rinex_Printer::rightJustify(boost::lexical_cast(0), 3); // Number of satellites in list + line += Rinex_Printer::rightJustify(boost::lexical_cast(0), 3); // Number of satellites in list line += std::string(1, ' '); line += satelliteSystem["GLONASS"]; - line += Rinex_Printer::rightJustify(boost::lexical_cast(0), 2); // Slot Number + line += Rinex_Printer::rightJustify(boost::lexical_cast(0), 2); // Slot Number line += std::string(1, ' '); - line += Rinex_Printer::rightJustify(boost::lexical_cast(0), 2); // Frequency Number + line += Rinex_Printer::rightJustify(boost::lexical_cast(0), 2); // Frequency Number line += std::string(1, ' '); - line += std::string(60-line.size(), ' '); + line += std::string(60 - line.size(), ' '); line += Rinex_Printer::leftJustify("GLONASS SLOT / FRQ #", 20); Rinex_Printer::lengthCheck(line); out << line << std::endl; @@ -4187,7 +4205,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_CNAV_Ephemeris line += observationCode["GLONASS_G2_P"]; line += std::string(1, ' '); line += Rinex_Printer::rightJustify(asString(0.0, 3), 8); - line += std::string(60-line.size(), ' '); + line += std::string(60 - line.size(), ' '); line += Rinex_Printer::leftJustify("GLONASS COD/PHS/BIS", 20); Rinex_Printer::lengthCheck(line); out << line << std::endl; @@ -4203,7 +4221,9 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_CNAV_Ephemeris void Rinex_Printer::rinex_obs_header(std::fstream& out, const Galileo_Ephemeris& galileo_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, const double d_TOW_first_observation, const std::string galileo_bands, const std::string glonass_bands) { - if(glonass_gnav_eph.d_m){} // avoid warning, not needed + if (glonass_gnav_eph.d_m) + { + } // avoid warning, not needed std::string line; version = 3; @@ -4258,14 +4278,14 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Galileo_Ephemeris& // -------- Line MARKER NAME line.clear(); - line += Rinex_Printer::leftJustify("DEFAULT MARKER NAME", 60); // put a flag or a property, + line += Rinex_Printer::leftJustify("DEFAULT MARKER NAME", 60); // put a flag or a property, line += Rinex_Printer::leftJustify("MARKER TYPE", 20); Rinex_Printer::lengthCheck(line); out << line << std::endl; // -------- Line MARKER TYPE line.clear(); - line += Rinex_Printer::leftJustify("NON_GEODETIC", 20); // put a flag or a property + line += Rinex_Printer::leftJustify("NON_GEODETIC", 20); // put a flag or a property line += std::string(40, ' '); line += Rinex_Printer::leftJustify("MARKER TYPE", 20); Rinex_Printer::lengthCheck(line); @@ -4285,17 +4305,17 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Galileo_Ephemeris& username = "UNKNOWN USER"; } line += leftJustify(username, 20); - line += Rinex_Printer::leftJustify("CTTC", 40); // add flag and property + line += Rinex_Printer::leftJustify("CTTC", 40); // add flag and property line += Rinex_Printer::leftJustify("OBSERVER / AGENCY", 20); Rinex_Printer::lengthCheck(line); out << line << std::endl; // -------- Line REC / TYPE VERS line.clear(); - line += Rinex_Printer::leftJustify("GNSS-SDR", 20); // add flag and property - line += Rinex_Printer::leftJustify("Software Receiver", 20); // add flag and property + line += Rinex_Printer::leftJustify("GNSS-SDR", 20); // add flag and property + line += Rinex_Printer::leftJustify("Software Receiver", 20); // add flag and property //line += Rinex_Printer::leftJustify(google::VersionString(), 20); // add flag and property - if(gnss_sdr_version.length() > 20) gnss_sdr_version.resize(9, ' '); + if (gnss_sdr_version.length() > 20) gnss_sdr_version.resize(9, ' '); line += Rinex_Printer::leftJustify(gnss_sdr_version, 20); line += Rinex_Printer::leftJustify("REC # / TYPE / VERS", 20); lengthCheck(line); @@ -4304,7 +4324,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Galileo_Ephemeris& // -------- ANTENNA TYPE line.clear(); line += Rinex_Printer::leftJustify("Antenna number", 20); // add flag and property - line += Rinex_Printer::leftJustify("Antenna type", 20); // add flag and property + line += Rinex_Printer::leftJustify("Antenna type", 20); // add flag and property line += std::string(20, ' '); line += Rinex_Printer::leftJustify("ANT # / TYPE", 20); Rinex_Printer::lengthCheck(line); @@ -4343,13 +4363,13 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Galileo_Ephemeris& unsigned int number_of_observations_gal = 0; std::string signal_("1B"); std::size_t found_1B = galileo_bands.find(signal_); - if(found_1B != std::string::npos) + if (found_1B != std::string::npos) { number_of_observations_gal = number_of_observations_gal + 4; } signal_ = "5X"; std::size_t found_5X = galileo_bands.find(signal_); - if(found_5X != std::string::npos) + if (found_5X != std::string::npos) { number_of_observations_gal = number_of_observations_gal + 4; } @@ -4357,7 +4377,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Galileo_Ephemeris& line.clear(); signal_ = "7X"; std::size_t found_7X = galileo_bands.find(signal_); - if(found_7X != std::string::npos) + if (found_7X != std::string::npos) { number_of_observations_gal = number_of_observations_gal + 4; } @@ -4367,7 +4387,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Galileo_Ephemeris& line += std::string(2, ' '); line += Rinex_Printer::rightJustify(std::to_string(number_of_observations_gal), 3); - if(found_1B != std::string::npos) + if (found_1B != std::string::npos) { line += std::string(1, ' '); line += observationType["PSEUDORANGE"]; @@ -4383,7 +4403,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Galileo_Ephemeris& line += observationCode["GALILEO_E1_B"]; } - if(found_5X != std::string::npos) + if (found_5X != std::string::npos) { line += std::string(1, ' '); line += observationType["PSEUDORANGE"]; @@ -4399,7 +4419,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Galileo_Ephemeris& line += observationCode["GALILEO_E5a_IQ"]; } - if(found_7X != std::string::npos) + if (found_7X != std::string::npos) { line += std::string(1, ' '); line += observationType["PSEUDORANGE"]; @@ -4415,7 +4435,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Galileo_Ephemeris& line += observationCode["GALILEO_E5b_IQ"]; } - line += std::string(60-line.size(), ' '); + line += std::string(60 - line.size(), ' '); line += Rinex_Printer::leftJustify("SYS / # / OBS TYPES", 20); Rinex_Printer::lengthCheck(line); out << line << std::endl; @@ -4424,13 +4444,13 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Galileo_Ephemeris& unsigned int number_of_observations_glo = 0; signal_ = "1G"; std::size_t found_1G = glonass_bands.find(signal_); - if(found_1G != std::string::npos) + if (found_1G != std::string::npos) { number_of_observations_glo = number_of_observations_glo + 4; } signal_ = "2G"; std::size_t found_2G = glonass_bands.find(signal_); - if(found_2G != std::string::npos) + if (found_2G != std::string::npos) { number_of_observations_glo = number_of_observations_glo + 4; } @@ -4439,7 +4459,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Galileo_Ephemeris& line += std::string(2, ' '); line += Rinex_Printer::rightJustify(std::to_string(number_of_observations_glo), 3); - if(found_1G != std::string::npos) + if (found_1G != std::string::npos) { line += std::string(1, ' '); line += observationType["PSEUDORANGE"]; @@ -4455,7 +4475,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Galileo_Ephemeris& line += observationCode["GLONASS_L1_CA"]; } - if(found_2G != std::string::npos) + if (found_2G != std::string::npos) { line += std::string(1, ' '); line += observationType["PSEUDORANGE"]; @@ -4471,7 +4491,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Galileo_Ephemeris& line += observationCode["GLONASS_L2_CA"]; } - line += std::string(60-line.size(), ' '); + line += std::string(60 - line.size(), ' '); line += Rinex_Printer::leftJustify("SYS / # / OBS TYPES", 20); Rinex_Printer::lengthCheck(line); out << line << std::endl; @@ -4487,12 +4507,12 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Galileo_Ephemeris& // -------- TIME OF FIRST OBS line.clear(); boost::posix_time::ptime p_galileo_time = Rinex_Printer::compute_Galileo_time(galileo_eph, d_TOW_first_observation); - std::string timestring=boost::posix_time::to_iso_string(p_galileo_time); - std::string year (timestring, 0, 4); - std::string month (timestring, 4, 2); - std::string day (timestring, 6, 2); - std::string hour (timestring, 9, 2); - std::string minutes (timestring, 11, 2); + std::string timestring = boost::posix_time::to_iso_string(p_galileo_time); + std::string year(timestring, 0, 4); + std::string month(timestring, 4, 2); + std::string day(timestring, 6, 2); + std::string hour(timestring, 9, 2); + std::string minutes(timestring, 11, 2); double galileo_t = d_TOW_first_observation; double seconds = fmod(galileo_t, 60); line += Rinex_Printer::rightJustify(year, 6); @@ -4578,7 +4598,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& eph // -------- Line MARKER NAME line.clear(); - line += Rinex_Printer::leftJustify("DEFAULT MARKER NAME", 60); // put a flag or a property, + line += Rinex_Printer::leftJustify("DEFAULT MARKER NAME", 60); // put a flag or a property, line += Rinex_Printer::leftJustify("MARKER NAME", 20); Rinex_Printer::lengthCheck(line); out << line << std::endl; @@ -4605,17 +4625,17 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& eph username = "UNKNOWN USER"; } line += leftJustify(username, 20); - line += Rinex_Printer::leftJustify("CTTC", 40); // add flag and property + line += Rinex_Printer::leftJustify("CTTC", 40); // add flag and property line += Rinex_Printer::leftJustify("OBSERVER / AGENCY", 20); Rinex_Printer::lengthCheck(line); out << line << std::endl; // -------- Line REC / TYPE VERS line.clear(); - line += Rinex_Printer::leftJustify("GNSS-SDR", 20); // add flag and property - line += Rinex_Printer::leftJustify("Software Receiver", 20); // add flag and property + line += Rinex_Printer::leftJustify("GNSS-SDR", 20); // add flag and property + line += Rinex_Printer::leftJustify("Software Receiver", 20); // add flag and property //line += Rinex_Printer::leftJustify(google::VersionString(), 20); // add flag and property - if(gnss_sdr_version.length() > 20) gnss_sdr_version.resize(9, ' '); + if (gnss_sdr_version.length() > 20) gnss_sdr_version.resize(9, ' '); line += Rinex_Printer::leftJustify(gnss_sdr_version, 20); line += Rinex_Printer::leftJustify("REC # / TYPE / VERS", 20); lengthCheck(line); @@ -4624,7 +4644,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& eph // -------- ANTENNA TYPE line.clear(); line += Rinex_Printer::leftJustify("Antenna number", 20); // add flag and property - line += Rinex_Printer::leftJustify("Antenna type", 20); // add flag and property + line += Rinex_Printer::leftJustify("Antenna type", 20); // add flag and property line += std::string(20, ' '); line += Rinex_Printer::leftJustify("ANT # / TYPE", 20); Rinex_Printer::lengthCheck(line); @@ -4663,8 +4683,8 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& eph // --------- WAVELENGHT FACTOR // put here real data! line.clear(); - line +=Rinex_Printer::rightJustify("1",6); - line +=Rinex_Printer::rightJustify("1",6); + line += Rinex_Printer::rightJustify("1", 6); + line += Rinex_Printer::rightJustify("1", 6); line += std::string(48, ' '); line += Rinex_Printer::leftJustify("WAVELENGTH FACT L1/2", 20); Rinex_Printer::lengthCheck(line); @@ -4700,7 +4720,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& eph line += observationType["SIGNAL_STRENGTH"]; line += observationCode["GPS_L1_CA"]; - line += std::string(60-line.size(), ' '); + line += std::string(60 - line.size(), ' '); line += Rinex_Printer::leftJustify("SYS / # / OBS TYPES", 20); Rinex_Printer::lengthCheck(line); out << line << std::endl; @@ -4726,7 +4746,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& eph // GPS L1 SIGNAL STRENGTH line += Rinex_Printer::rightJustify(observationType["SIGNAL_STRENGTH_v2"], 5); line += observationCode["GPS_L1_CA_v2"]; - line += std::string(60-line.size(), ' '); + line += std::string(60 - line.size(), ' '); line += Rinex_Printer::leftJustify("# / TYPES OF OBSERV", 20); Rinex_Printer::lengthCheck(line); out << line << std::endl; @@ -4745,13 +4765,13 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& eph // -------- TIME OF FIRST OBS line.clear(); - boost::posix_time::ptime p_gps_time = Rinex_Printer::compute_GPS_time(eph,d_TOW_first_observation); + boost::posix_time::ptime p_gps_time = Rinex_Printer::compute_GPS_time(eph, d_TOW_first_observation); std::string timestring = boost::posix_time::to_iso_string(p_gps_time); - std::string year (timestring, 0, 4); - std::string month (timestring, 4, 2); - std::string day (timestring, 6, 2); - std::string hour (timestring, 9, 2); - std::string minutes (timestring, 11, 2); + std::string year(timestring, 0, 4); + std::string month(timestring, 4, 2); + std::string day(timestring, 6, 2); + std::string hour(timestring, 9, 2); + std::string minutes(timestring, 11, 2); double gps_t = d_TOW_first_observation; double seconds = fmod(gps_t, 60); line += Rinex_Printer::rightJustify(year, 6); @@ -4777,7 +4797,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& eph } -void Rinex_Printer::rinex_obs_header(std::fstream & out, const Gps_CNAV_Ephemeris & eph, const double d_TOW_first_observation) +void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_CNAV_Ephemeris& eph, const double d_TOW_first_observation) { std::string line; @@ -4832,7 +4852,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream & out, const Gps_CNAV_Ephemeri // -------- Line MARKER NAME line.clear(); - line += Rinex_Printer::leftJustify("DEFAULT MARKER NAME", 60); // put a flag or a property, + line += Rinex_Printer::leftJustify("DEFAULT MARKER NAME", 60); // put a flag or a property, line += Rinex_Printer::leftJustify("MARKER NAME", 20); Rinex_Printer::lengthCheck(line); out << line << std::endl; @@ -4859,17 +4879,17 @@ void Rinex_Printer::rinex_obs_header(std::fstream & out, const Gps_CNAV_Ephemeri username = "UNKNOWN USER"; } line += leftJustify(username, 20); - line += Rinex_Printer::leftJustify("CTTC", 40); // add flag and property + line += Rinex_Printer::leftJustify("CTTC", 40); // add flag and property line += Rinex_Printer::leftJustify("OBSERVER / AGENCY", 20); Rinex_Printer::lengthCheck(line); out << line << std::endl; // -------- Line REC / TYPE VERS line.clear(); - line += Rinex_Printer::leftJustify("GNSS-SDR", 20); // add flag and property - line += Rinex_Printer::leftJustify("Software Receiver", 20); // add flag and property + line += Rinex_Printer::leftJustify("GNSS-SDR", 20); // add flag and property + line += Rinex_Printer::leftJustify("Software Receiver", 20); // add flag and property //line += Rinex_Printer::leftJustify(google::VersionString(), 20); // add flag and property - if(gnss_sdr_version.length() > 20) gnss_sdr_version.resize(9, ' '); + if (gnss_sdr_version.length() > 20) gnss_sdr_version.resize(9, ' '); line += Rinex_Printer::leftJustify(gnss_sdr_version, 20); line += Rinex_Printer::leftJustify("REC # / TYPE / VERS", 20); lengthCheck(line); @@ -4878,7 +4898,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream & out, const Gps_CNAV_Ephemeri // -------- ANTENNA TYPE line.clear(); line += Rinex_Printer::leftJustify("Antenna number", 20); // add flag and property - line += Rinex_Printer::leftJustify("Antenna type", 20); // add flag and property + line += Rinex_Printer::leftJustify("Antenna type", 20); // add flag and property line += std::string(20, ' '); line += Rinex_Printer::leftJustify("ANT # / TYPE", 20); Rinex_Printer::lengthCheck(line); @@ -4939,7 +4959,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream & out, const Gps_CNAV_Ephemeri line += observationType["SIGNAL_STRENGTH"]; line += observationCode["GPS_L2_L2CM"]; - line += std::string(60-line.size(), ' '); + line += std::string(60 - line.size(), ' '); line += Rinex_Printer::leftJustify("SYS / # / OBS TYPES", 20); Rinex_Printer::lengthCheck(line); out << line << std::endl; @@ -4954,13 +4974,13 @@ void Rinex_Printer::rinex_obs_header(std::fstream & out, const Gps_CNAV_Ephemeri // -------- TIME OF FIRST OBS line.clear(); - boost::posix_time::ptime p_gps_time = Rinex_Printer::compute_GPS_time(eph,d_TOW_first_observation); + boost::posix_time::ptime p_gps_time = Rinex_Printer::compute_GPS_time(eph, d_TOW_first_observation); std::string timestring = boost::posix_time::to_iso_string(p_gps_time); - std::string year (timestring, 0, 4); - std::string month (timestring, 4, 2); - std::string day (timestring, 6, 2); - std::string hour (timestring, 9, 2); - std::string minutes (timestring, 11, 2); + std::string year(timestring, 0, 4); + std::string month(timestring, 4, 2); + std::string day(timestring, 6, 2); + std::string hour(timestring, 9, 2); + std::string minutes(timestring, 11, 2); double gps_t = d_TOW_first_observation; double seconds = fmod(gps_t, 60); line += Rinex_Printer::rightJustify(year, 6); @@ -4986,9 +5006,11 @@ void Rinex_Printer::rinex_obs_header(std::fstream & out, const Gps_CNAV_Ephemeri } -void Rinex_Printer::rinex_obs_header(std::fstream & out, const Gps_Ephemeris & eph, const Gps_CNAV_Ephemeris & eph_cnav, const double d_TOW_first_observation) +void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& eph, const Gps_CNAV_Ephemeris& eph_cnav, const double d_TOW_first_observation) { - if(eph_cnav.d_i_0){} // avoid warning, not needed + if (eph_cnav.d_i_0) + { + } // avoid warning, not needed std::string line; // -------- Line 1 @@ -5042,7 +5064,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream & out, const Gps_Ephemeris & e // -------- Line MARKER NAME line.clear(); - line += Rinex_Printer::leftJustify("DEFAULT MARKER NAME", 60); // put a flag or a property, + line += Rinex_Printer::leftJustify("DEFAULT MARKER NAME", 60); // put a flag or a property, line += Rinex_Printer::leftJustify("MARKER NAME", 20); Rinex_Printer::lengthCheck(line); out << line << std::endl; @@ -5069,17 +5091,17 @@ void Rinex_Printer::rinex_obs_header(std::fstream & out, const Gps_Ephemeris & e username = "UNKNOWN USER"; } line += leftJustify(username, 20); - line += Rinex_Printer::leftJustify("CTTC", 40); // add flag and property + line += Rinex_Printer::leftJustify("CTTC", 40); // add flag and property line += Rinex_Printer::leftJustify("OBSERVER / AGENCY", 20); Rinex_Printer::lengthCheck(line); out << line << std::endl; // -------- Line REC / TYPE VERS line.clear(); - line += Rinex_Printer::leftJustify("GNSS-SDR", 20); // add flag and property - line += Rinex_Printer::leftJustify("Software Receiver", 20); // add flag and property + line += Rinex_Printer::leftJustify("GNSS-SDR", 20); // add flag and property + line += Rinex_Printer::leftJustify("Software Receiver", 20); // add flag and property //line += Rinex_Printer::leftJustify(google::VersionString(), 20); // add flag and property - if(gnss_sdr_version.length() > 20) gnss_sdr_version.resize(9, ' '); + if (gnss_sdr_version.length() > 20) gnss_sdr_version.resize(9, ' '); line += Rinex_Printer::leftJustify(gnss_sdr_version, 20); line += Rinex_Printer::leftJustify("REC # / TYPE / VERS", 20); lengthCheck(line); @@ -5088,7 +5110,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream & out, const Gps_Ephemeris & e // -------- ANTENNA TYPE line.clear(); line += Rinex_Printer::leftJustify("Antenna number", 20); // add flag and property - line += Rinex_Printer::leftJustify("Antenna type", 20); // add flag and property + line += Rinex_Printer::leftJustify("Antenna type", 20); // add flag and property line += std::string(20, ' '); line += Rinex_Printer::leftJustify("ANT # / TYPE", 20); Rinex_Printer::lengthCheck(line); @@ -5165,7 +5187,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream & out, const Gps_Ephemeris & e line += observationType["SIGNAL_STRENGTH"]; line += observationCode["GPS_L2_L2CM"]; - line += std::string(60-line.size(), ' '); + line += std::string(60 - line.size(), ' '); line += Rinex_Printer::leftJustify("SYS / # / OBS TYPES", 20); Rinex_Printer::lengthCheck(line); out << line << std::endl; @@ -5180,13 +5202,13 @@ void Rinex_Printer::rinex_obs_header(std::fstream & out, const Gps_Ephemeris & e // -------- TIME OF FIRST OBS line.clear(); - boost::posix_time::ptime p_gps_time = Rinex_Printer::compute_GPS_time(eph,d_TOW_first_observation); + boost::posix_time::ptime p_gps_time = Rinex_Printer::compute_GPS_time(eph, d_TOW_first_observation); std::string timestring = boost::posix_time::to_iso_string(p_gps_time); - std::string year (timestring, 0, 4); - std::string month (timestring, 4, 2); - std::string day (timestring, 6, 2); - std::string hour (timestring, 9, 2); - std::string minutes (timestring, 11, 2); + std::string year(timestring, 0, 4); + std::string month(timestring, 4, 2); + std::string day(timestring, 6, 2); + std::string hour(timestring, 9, 2); + std::string minutes(timestring, 11, 2); double gps_t = d_TOW_first_observation; double seconds = fmod(gps_t, 60); line += Rinex_Printer::rightJustify(year, 6); @@ -5268,7 +5290,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Galileo_Ephemeris& // -------- Line MARKER NAME line.clear(); - line += Rinex_Printer::leftJustify("DEFAULT MARKER NAME", 60); // put a flag or a property, + line += Rinex_Printer::leftJustify("DEFAULT MARKER NAME", 60); // put a flag or a property, line += Rinex_Printer::leftJustify("MARKER NAME", 20); Rinex_Printer::lengthCheck(line); out << line << std::endl; @@ -5295,17 +5317,17 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Galileo_Ephemeris& username = "UNKNOWN USER"; } line += leftJustify(username, 20); - line += Rinex_Printer::leftJustify("CTTC", 40); // add flag and property + line += Rinex_Printer::leftJustify("CTTC", 40); // add flag and property line += Rinex_Printer::leftJustify("OBSERVER / AGENCY", 20); Rinex_Printer::lengthCheck(line); out << line << std::endl; // -------- Line REC / TYPE VERS line.clear(); - line += Rinex_Printer::leftJustify("GNSS-SDR", 20); // add flag and property - line += Rinex_Printer::leftJustify("Software Receiver", 20); // add flag and property + line += Rinex_Printer::leftJustify("GNSS-SDR", 20); // add flag and property + line += Rinex_Printer::leftJustify("Software Receiver", 20); // add flag and property //line += Rinex_Printer::leftJustify(google::VersionString(), 20); // add flag and property - if(gnss_sdr_version.length() > 20) gnss_sdr_version.resize(9, ' '); + if (gnss_sdr_version.length() > 20) gnss_sdr_version.resize(9, ' '); line += Rinex_Printer::leftJustify(gnss_sdr_version, 20); line += Rinex_Printer::leftJustify("REC # / TYPE / VERS", 20); lengthCheck(line); @@ -5314,7 +5336,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Galileo_Ephemeris& // -------- ANTENNA TYPE line.clear(); line += Rinex_Printer::leftJustify("Antenna number", 20); // add flag and property - line += Rinex_Printer::leftJustify("Antenna type", 20); // add flag and property + line += Rinex_Printer::leftJustify("Antenna type", 20); // add flag and property line += std::string(20, ' '); line += Rinex_Printer::leftJustify("ANT # / TYPE", 20); Rinex_Printer::lengthCheck(line); @@ -5353,13 +5375,13 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Galileo_Ephemeris& unsigned int number_of_observations = 0; std::string signal_("1B"); std::size_t found_1B = bands.find(signal_); - if(found_1B != std::string::npos) + if (found_1B != std::string::npos) { number_of_observations = number_of_observations + 4; } signal_ = "5X"; std::size_t found_5X = bands.find(signal_); - if(found_5X != std::string::npos) + if (found_5X != std::string::npos) { number_of_observations = number_of_observations + 4; } @@ -5367,7 +5389,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Galileo_Ephemeris& line.clear(); signal_ = "7X"; std::size_t found_7X = bands.find(signal_); - if(found_7X != std::string::npos) + if (found_7X != std::string::npos) { number_of_observations = number_of_observations + 4; } @@ -5378,7 +5400,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Galileo_Ephemeris& line += std::string(2, ' '); line += Rinex_Printer::rightJustify(std::to_string(number_of_observations), 3); - if(found_1B != std::string::npos) + if (found_1B != std::string::npos) { line += std::string(1, ' '); line += observationType["PSEUDORANGE"]; @@ -5394,7 +5416,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Galileo_Ephemeris& line += observationCode["GALILEO_E1_B"]; } - if(found_5X != std::string::npos) + if (found_5X != std::string::npos) { line += std::string(1, ' '); line += observationType["PSEUDORANGE"]; @@ -5410,7 +5432,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Galileo_Ephemeris& line += observationCode["GALILEO_E5a_IQ"]; } - if(found_7X != std::string::npos) + if (found_7X != std::string::npos) { line += std::string(1, ' '); line += observationType["PSEUDORANGE"]; @@ -5426,7 +5448,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Galileo_Ephemeris& line += observationCode["GALILEO_E5b_IQ"]; } - line += std::string(60-line.size(), ' '); + line += std::string(60 - line.size(), ' '); line += Rinex_Printer::leftJustify("SYS / # / OBS TYPES", 20); Rinex_Printer::lengthCheck(line); out << line << std::endl; @@ -5442,12 +5464,12 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Galileo_Ephemeris& // -------- TIME OF FIRST OBS line.clear(); boost::posix_time::ptime p_galileo_time = Rinex_Printer::compute_Galileo_time(eph, d_TOW_first_observation); - std::string timestring=boost::posix_time::to_iso_string(p_galileo_time); - std::string year (timestring, 0, 4); - std::string month (timestring, 4, 2); - std::string day (timestring, 6, 2); - std::string hour (timestring, 9, 2); - std::string minutes (timestring, 11, 2); + std::string timestring = boost::posix_time::to_iso_string(p_galileo_time); + std::string year(timestring, 0, 4); + std::string month(timestring, 4, 2); + std::string day(timestring, 6, 2); + std::string hour(timestring, 9, 2); + std::string minutes(timestring, 11, 2); double galileo_t = d_TOW_first_observation; double seconds = fmod(galileo_t, 60); line += Rinex_Printer::rightJustify(year, 6); @@ -5475,7 +5497,9 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Galileo_Ephemeris& void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& gps_eph, const Galileo_Ephemeris& galileo_eph, const double d_TOW_first_observation, const std::string galileo_bands) { - if(galileo_eph.e_1){} // avoid warning, not needed + if (galileo_eph.e_1) + { + } // avoid warning, not needed std::string line; version = 3; @@ -5530,7 +5554,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& gps // -------- Line MARKER NAME line.clear(); - line += Rinex_Printer::leftJustify("DEFAULT MARKER NAME", 60); // put a flag or a property, + line += Rinex_Printer::leftJustify("DEFAULT MARKER NAME", 60); // put a flag or a property, line += Rinex_Printer::leftJustify("MARKER NAME", 20); Rinex_Printer::lengthCheck(line); out << line << std::endl; @@ -5557,17 +5581,17 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& gps username = "UNKNOWN USER"; } line += leftJustify(username, 20); - line += Rinex_Printer::leftJustify("CTTC", 40); // add flag and property + line += Rinex_Printer::leftJustify("CTTC", 40); // add flag and property line += Rinex_Printer::leftJustify("OBSERVER / AGENCY", 20); Rinex_Printer::lengthCheck(line); out << line << std::endl; // -------- Line REC / TYPE VERS line.clear(); - line += Rinex_Printer::leftJustify("GNSS-SDR", 20); // add flag and property - line += Rinex_Printer::leftJustify("Software Receiver", 20); // add flag and property + line += Rinex_Printer::leftJustify("GNSS-SDR", 20); // add flag and property + line += Rinex_Printer::leftJustify("Software Receiver", 20); // add flag and property //line += Rinex_Printer::leftJustify(google::VersionString(), 20); // add flag and property - if(gnss_sdr_version.length() > 20) gnss_sdr_version.resize(9, ' '); + if (gnss_sdr_version.length() > 20) gnss_sdr_version.resize(9, ' '); line += Rinex_Printer::leftJustify(gnss_sdr_version, 20); line += Rinex_Printer::leftJustify("REC # / TYPE / VERS", 20); lengthCheck(line); @@ -5576,7 +5600,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& gps // -------- ANTENNA TYPE line.clear(); line += Rinex_Printer::leftJustify("Antenna number", 20); // add flag and property - line += Rinex_Printer::leftJustify("Antenna type", 20); // add flag and property + line += Rinex_Printer::leftJustify("Antenna type", 20); // add flag and property line += std::string(20, ' '); line += Rinex_Printer::leftJustify("ANT # / TYPE", 20); Rinex_Printer::lengthCheck(line); @@ -5636,7 +5660,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& gps line += std::string(1, ' '); line += observationType["SIGNAL_STRENGTH"]; line += observationCode["GPS_L1_CA"]; - line += std::string(60-line.size(), ' '); + line += std::string(60 - line.size(), ' '); line += Rinex_Printer::leftJustify("SYS / # / OBS TYPES", 20); Rinex_Printer::lengthCheck(line); out << line << std::endl; @@ -5645,13 +5669,13 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& gps unsigned int number_of_observations_gal = 0; std::string signal_("1B"); std::size_t found_1B = galileo_bands.find(signal_); - if(found_1B != std::string::npos) + if (found_1B != std::string::npos) { number_of_observations_gal = number_of_observations_gal + 4; } signal_ = "5X"; std::size_t found_5X = galileo_bands.find(signal_); - if(found_5X != std::string::npos) + if (found_5X != std::string::npos) { number_of_observations_gal = number_of_observations_gal + 4; } @@ -5659,7 +5683,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& gps line.clear(); signal_ = "7X"; std::size_t found_7X = galileo_bands.find(signal_); - if(found_7X != std::string::npos) + if (found_7X != std::string::npos) { number_of_observations_gal = number_of_observations_gal + 4; } @@ -5668,7 +5692,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& gps line += std::string(2, ' '); line += Rinex_Printer::rightJustify(std::to_string(number_of_observations_gal), 3); - if(found_1B != std::string::npos) + if (found_1B != std::string::npos) { line += std::string(1, ' '); line += observationType["PSEUDORANGE"]; @@ -5684,7 +5708,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& gps line += observationCode["GALILEO_E1_B"]; } - if(found_5X != std::string::npos) + if (found_5X != std::string::npos) { line += std::string(1, ' '); line += observationType["PSEUDORANGE"]; @@ -5700,7 +5724,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& gps line += observationCode["GALILEO_E5a_IQ"]; } - if(found_7X != std::string::npos) + if (found_7X != std::string::npos) { line += std::string(1, ' '); line += observationType["PSEUDORANGE"]; @@ -5716,7 +5740,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& gps line += observationCode["GALILEO_E5b_IQ"]; } - line += std::string(60-line.size(), ' '); + line += std::string(60 - line.size(), ' '); line += Rinex_Printer::leftJustify("SYS / # / OBS TYPES", 20); Rinex_Printer::lengthCheck(line); out << line << std::endl; @@ -5732,12 +5756,12 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& gps // -------- TIME OF FIRST OBS line.clear(); boost::posix_time::ptime p_gps_time = Rinex_Printer::compute_GPS_time(gps_eph, d_TOW_first_observation); - std::string timestring=boost::posix_time::to_iso_string(p_gps_time); - std::string year (timestring, 0, 4); - std::string month (timestring, 4, 2); - std::string day (timestring, 6, 2); - std::string hour (timestring, 9, 2); - std::string minutes (timestring, 11, 2); + std::string timestring = boost::posix_time::to_iso_string(p_gps_time); + std::string year(timestring, 0, 4); + std::string month(timestring, 4, 2); + std::string day(timestring, 6, 2); + std::string hour(timestring, 9, 2); + std::string minutes(timestring, 11, 2); double gps_t = d_TOW_first_observation; double seconds = fmod(gps_t, 60); line += Rinex_Printer::rightJustify(year, 6); @@ -5763,7 +5787,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& gps void Rinex_Printer::update_obs_header(std::fstream& out __attribute__((unused)), const Glonass_Gnav_Utc_Model& utc_model) { - if(utc_model.d_N_4) + if (utc_model.d_N_4) { // do nothing } @@ -5781,17 +5805,17 @@ void Rinex_Printer::update_obs_header(std::fstream& out, const Gps_Utc_Model& ut bool no_more_finds = false; std::string line_str; - while(!out.eof()) + while (!out.eof()) { std::getline(out, line_str); - if(!no_more_finds) + if (!no_more_finds) { line_aux.clear(); if (version == 2) { - if (line_str.find("TIME OF FIRST OBS", 59) != std::string::npos) // TIME OF FIRST OBS last header annotation might change in the future + if (line_str.find("TIME OF FIRST OBS", 59) != std::string::npos) // TIME OF FIRST OBS last header annotation might change in the future { data.push_back(line_str); line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.d_DeltaT_LS), 6); @@ -5843,7 +5867,7 @@ void Rinex_Printer::update_obs_header(std::fstream& out, const Gps_Utc_Model& ut out.close(); out.open(obsfilename, std::ios::out | std::ios::trunc); out.seekp(0); - for (int i = 0; i < static_cast( data.size()) - 1; i++) + for (int i = 0; i < static_cast(data.size()) - 1; i++) { out << data[i] << std::endl; } @@ -5864,11 +5888,11 @@ void Rinex_Printer::update_obs_header(std::fstream& out, const Gps_CNAV_Utc_Mode bool no_more_finds = false; std::string line_str; - while(!out.eof()) + while (!out.eof()) { std::getline(out, line_str); - if(!no_more_finds) + if (!no_more_finds) { line_aux.clear(); if (line_str.find("TIME OF FIRST OBS", 59) != std::string::npos) @@ -5891,7 +5915,6 @@ void Rinex_Printer::update_obs_header(std::fstream& out, const Gps_CNAV_Utc_Mode { data.push_back(line_str); } - } else { @@ -5923,11 +5946,11 @@ void Rinex_Printer::update_obs_header(std::fstream& out, const Galileo_Utc_Model bool no_more_finds = false; std::string line_str; - while(!out.eof()) + while (!out.eof()) { std::getline(out, line_str); - if(!no_more_finds) + if (!no_more_finds) { line_aux.clear(); @@ -5951,7 +5974,6 @@ void Rinex_Printer::update_obs_header(std::fstream& out, const Galileo_Utc_Model { data.push_back(line_str); } - } else { @@ -5967,18 +5989,20 @@ void Rinex_Printer::update_obs_header(std::fstream& out, const Galileo_Utc_Model out << data[i] << std::endl; } out.close(); - out.open(obsfilename, std::ios::out | std::ios::in |std::ios::app); + out.open(obsfilename, std::ios::out | std::ios::in | std::ios::app); out.seekp(0, std::ios_base::end); } -void Rinex_Printer::log_rinex_obs(std::fstream& out, const Glonass_Gnav_Ephemeris& eph, const double obs_time, const std::map& observables, const std::string glonass_band) +void Rinex_Printer::log_rinex_obs(std::fstream& out, const Glonass_Gnav_Ephemeris& eph, const double obs_time, const std::map& observables, const std::string glonass_band) { // RINEX observations timestamps are GPS timestamps. std::string line; // Avoid compiler warning - if(glonass_band.size()){} + if (glonass_band.size()) + { + } boost::posix_time::ptime p_glonass_time = Rinex_Printer::compute_UTC_time(eph, obs_time); std::string timestring = boost::posix_time::to_iso_string(p_glonass_time); @@ -5986,19 +6010,19 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Glonass_Gnav_Ephemeri //double gps_t = eph.sv_clock_correction(obs_time); double glonass_t = obs_time; - std::string month (timestring, 4, 2); - std::string day (timestring, 6, 2); - std::string hour (timestring, 9, 2); - std::string minutes (timestring, 11, 2); + std::string month(timestring, 4, 2); + std::string day(timestring, 6, 2); + std::string hour(timestring, 9, 2); + std::string minutes(timestring, 11, 2); if (version == 2) { line.clear(); - std::string year (timestring, 2, 2); + std::string year(timestring, 2, 2); line += std::string(1, ' '); line += year; line += std::string(1, ' '); - if (month.compare(0, 1 , "0") == 0) + if (month.compare(0, 1, "0") == 0) { line += std::string(1, ' '); line += month.substr(1, 1); @@ -6008,7 +6032,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Glonass_Gnav_Ephemeri line += month; } line += std::string(1, ' '); - if (day.compare(0, 1 , "0") == 0) + if (day.compare(0, 1, "0") == 0) { line += std::string(1, ' '); line += day.substr(1, 1); @@ -6034,16 +6058,16 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Glonass_Gnav_Ephemeri //Number of satellites observed in current epoch int numSatellitesObserved = 0; std::map::const_iterator observables_iter; - for(observables_iter = observables.begin(); - observables_iter != observables.end(); - observables_iter++) + for (observables_iter = observables.begin(); + observables_iter != observables.end(); + observables_iter++) { numSatellitesObserved++; } line += Rinex_Printer::rightJustify(boost::lexical_cast(numSatellitesObserved), 3); - for(observables_iter = observables.begin(); - observables_iter != observables.end(); - observables_iter++) + for (observables_iter = observables.begin(); + observables_iter != observables.end(); + observables_iter++) { line += satelliteSystem["GLONASS"]; if (static_cast(observables_iter->second.PRN) < 10) line += std::string(1, '0'); @@ -6055,9 +6079,9 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Glonass_Gnav_Ephemeri Rinex_Printer::lengthCheck(line); out << line << std::endl; - for(observables_iter = observables.begin(); - observables_iter != observables.end(); - observables_iter++) + for (observables_iter = observables.begin(); + observables_iter != observables.end(); + observables_iter++) { std::string lineObs; lineObs.clear(); @@ -6067,7 +6091,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Glonass_Gnav_Ephemeri lineObs += Rinex_Printer::rightJustify(asString(observables_iter->second.Pseudorange_m, 3), 14); //Loss of lock indicator (LLI) - int lli = 0; // Include in the observation!! + int lli = 0; // Include in the observation!! if (lli == 0) { lineObs += std::string(1, ' '); @@ -6081,7 +6105,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Glonass_Gnav_Ephemeri int ssi = Rinex_Printer::signalStrength(observables_iter->second.CN0_dB_hz); lineObs += Rinex_Printer::rightJustify(Rinex_Printer::asString(ssi), 1); // GLONASS L1 CA PHASE - lineObs += Rinex_Printer::rightJustify(asString(observables_iter->second.Carrier_phase_rads/GLONASS_TWO_PI, 3), 14); + lineObs += Rinex_Printer::rightJustify(asString(observables_iter->second.Carrier_phase_rads / GLONASS_TWO_PI, 3), 14); if (lli == 0) { lineObs += std::string(1, ' '); @@ -6111,7 +6135,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Glonass_Gnav_Ephemeri if (version == 3) { - std::string year (timestring, 0, 4); + std::string year(timestring, 0, 4); line += std::string(1, '>'); line += std::string(1, ' '); line += year; @@ -6139,9 +6163,9 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Glonass_Gnav_Ephemeri //Number of satellites observed in current epoch int numSatellitesObserved = 0; std::map::const_iterator observables_iter; - for(observables_iter = observables.begin(); - observables_iter != observables.end(); - observables_iter++) + for (observables_iter = observables.begin(); + observables_iter != observables.end(); + observables_iter++) { numSatellitesObserved++; } @@ -6154,9 +6178,9 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Glonass_Gnav_Ephemeri Rinex_Printer::lengthCheck(line); out << line << std::endl; - for(observables_iter = observables.begin(); - observables_iter != observables.end(); - observables_iter++) + for (observables_iter = observables.begin(); + observables_iter != observables.end(); + observables_iter++) { std::string lineObs; lineObs.clear(); @@ -6167,7 +6191,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Glonass_Gnav_Ephemeri lineObs += Rinex_Printer::rightJustify(asString(observables_iter->second.Pseudorange_m, 3), 14); //Loss of lock indicator (LLI) - int lli = 0; // Include in the observation!! + int lli = 0; // Include in the observation!! if (lli == 0) { lineObs += std::string(1, ' '); @@ -6182,7 +6206,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Glonass_Gnav_Ephemeri lineObs += Rinex_Printer::rightJustify(Rinex_Printer::asString(ssi), 1); // GLONASS L1 CA PHASE - lineObs += Rinex_Printer::rightJustify(asString(observables_iter->second.Carrier_phase_rads/GLONASS_TWO_PI, 3), 14); + lineObs += Rinex_Printer::rightJustify(asString(observables_iter->second.Carrier_phase_rads / GLONASS_TWO_PI, 3), 14); if (lli == 0) { lineObs += std::string(1, ' '); @@ -6216,9 +6240,11 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Glonass_Gnav_Ephemeri } -void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, double gps_obs_time, const std::map& observables) +void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, double gps_obs_time, const std::map& observables) { - if(glonass_gnav_eph.d_m){} // avoid warning, not needed + if (glonass_gnav_eph.d_m) + { + } // avoid warning, not needed std::string line; // -------- EPOCH record @@ -6228,19 +6254,19 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep //double gps_t = eph.sv_clock_correction(obs_time); double gps_t = gps_obs_time; - std::string month (timestring, 4, 2); - std::string day (timestring, 6, 2); - std::string hour (timestring, 9, 2); - std::string minutes (timestring, 11, 2); + std::string month(timestring, 4, 2); + std::string day(timestring, 6, 2); + std::string hour(timestring, 9, 2); + std::string minutes(timestring, 11, 2); if (version == 2) { line.clear(); - std::string year (timestring, 2, 2); + std::string year(timestring, 2, 2); line += std::string(1, ' '); line += year; line += std::string(1, ' '); - if (month.compare(0, 1 , "0") == 0) + if (month.compare(0, 1, "0") == 0) { line += std::string(1, ' '); line += month.substr(1, 1); @@ -6250,7 +6276,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep line += month; } line += std::string(1, ' '); - if (day.compare(0, 1 , "0") == 0) + if (day.compare(0, 1, "0") == 0) { line += std::string(1, ' '); line += day.substr(1, 1); @@ -6276,7 +6302,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep } if (version == 3) { - std::string year (timestring, 0, 4); + std::string year(timestring, 0, 4); line += std::string(1, '>'); line += std::string(1, ' '); line += year; @@ -6294,7 +6320,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep // Add extra 0 if seconds are < 10 if (seconds < 10) { - line +=std::string(1, '0'); + line += std::string(1, '0'); } line += Rinex_Printer::asString(seconds, 7); line += std::string(2, ' '); @@ -6309,21 +6335,21 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep std::map observablesR2C; std::map::const_iterator observables_iter; - for(observables_iter = observables.begin(); - observables_iter != observables.end(); - observables_iter++) + for (observables_iter = observables.begin(); + observables_iter != observables.end(); + observables_iter++) { std::string system_(&observables_iter->second.System, 1); std::string sig_(observables_iter->second.Signal); - if((system_.compare("R") == 0) && (sig_.compare("1G") == 0)) + if ((system_.compare("R") == 0) && (sig_.compare("1G") == 0)) { observablesR1C.insert(std::pair(observables_iter->first, observables_iter->second)); } - if((system_.compare("R") == 0) && (sig_.compare("2G") == 0)) + if ((system_.compare("R") == 0) && (sig_.compare("2G") == 0)) { observablesR2C.insert(std::pair(observables_iter->first, observables_iter->second)); } - if((system_.compare("G") == 0) && (sig_.compare("1C") == 0)) + if ((system_.compare("G") == 0) && (sig_.compare("1C") == 0)) { observablesG1C.insert(std::pair(observables_iter->first, observables_iter->second)); } @@ -6332,27 +6358,27 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep std::multimap total_glo_map; std::set available_glo_prns; std::set::iterator it; - for(observables_iter = observablesR1C.begin(); - observables_iter != observablesR1C.end(); - observables_iter++) + for (observables_iter = observablesR1C.begin(); + observables_iter != observablesR1C.end(); + observables_iter++) { unsigned int prn_ = observables_iter->second.PRN; total_glo_map.insert(std::pair(prn_, observables_iter->second)); it = available_glo_prns.find(prn_); - if(it == available_glo_prns.end()) + if (it == available_glo_prns.end()) { available_glo_prns.insert(prn_); } } - for(observables_iter = observablesR2C.begin(); - observables_iter != observablesR2C.end(); - observables_iter++) + for (observables_iter = observablesR2C.begin(); + observables_iter != observablesR2C.end(); + observables_iter++) { unsigned int prn_ = observables_iter->second.PRN; total_glo_map.insert(std::pair(prn_, observables_iter->second)); it = available_glo_prns.find(prn_); - if(it == available_glo_prns.end()) + if (it == available_glo_prns.end()) { available_glo_prns.insert(prn_); } @@ -6362,30 +6388,30 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep int numGpsSatellitesObserved = observablesG1C.size(); int numSatellitesObserved = numGloSatellitesObserved + numGpsSatellitesObserved; line += Rinex_Printer::rightJustify(boost::lexical_cast(numSatellitesObserved), 3); - if(version == 2) + if (version == 2) { // Add list of GPS satellites - for(observables_iter = observablesG1C.begin(); - observables_iter != observablesG1C.end(); - observables_iter++) + for (observables_iter = observablesG1C.begin(); + observables_iter != observablesG1C.end(); + observables_iter++) { line += satelliteSystem["GPS"]; if (static_cast(observables_iter->second.PRN) < 10) line += std::string(1, '0'); line += boost::lexical_cast(static_cast(observables_iter->second.PRN)); } // Add list of GLONASS L1 satellites - for(observables_iter = observablesR1C.begin(); - observables_iter != observablesR1C.end(); - observables_iter++) + for (observables_iter = observablesR1C.begin(); + observables_iter != observablesR1C.end(); + observables_iter++) { line += satelliteSystem["GLONASS"]; if (static_cast(observables_iter->second.PRN) < 10) line += std::string(1, '0'); line += boost::lexical_cast(static_cast(observables_iter->second.PRN)); } // Add list of GLONASS L2 satellites - for(observables_iter = observablesR2C.begin(); - observables_iter != observablesR2C.end(); - observables_iter++) + for (observables_iter = observablesR2C.begin(); + observables_iter != observablesR2C.end(); + observables_iter++) { line += satelliteSystem["GLONASS"]; if (static_cast(observables_iter->second.PRN) < 10) line += std::string(1, '0'); @@ -6399,18 +6425,18 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep // -------- OBSERVATION record std::string s; std::string lineObs; - for(observables_iter = observablesG1C.begin(); - observables_iter != observablesG1C.end(); - observables_iter++) + for (observables_iter = observablesG1C.begin(); + observables_iter != observablesG1C.end(); + observables_iter++) { lineObs.clear(); s.assign(1, observables_iter->second.System); - if(version == 3) + if (version == 3) { // Specify system only if in version 3 - if(s.compare("G") == 0) lineObs += satelliteSystem["GPS"]; - if(s.compare("R") == 0) lineObs += satelliteSystem["GLONASS"]; // should not happen + if (s.compare("G") == 0) lineObs += satelliteSystem["GPS"]; + if (s.compare("R") == 0) lineObs += satelliteSystem["GLONASS"]; // should not happen if (static_cast(observables_iter->second.PRN) < 10) lineObs += std::string(1, '0'); lineObs += boost::lexical_cast(static_cast(observables_iter->second.PRN)); } @@ -6419,7 +6445,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep lineObs += Rinex_Printer::rightJustify(asString(observables_iter->second.Pseudorange_m, 3), 14); //Loss of lock indicator (LLI) - int lli = 0; // Include in the observation!! + int lli = 0; // Include in the observation!! if (lli == 0) { lineObs += std::string(1, ' '); @@ -6434,7 +6460,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep lineObs += Rinex_Printer::rightJustify(Rinex_Printer::asString(ssi), 1); // PHASE - lineObs += Rinex_Printer::rightJustify(asString(observables_iter->second.Carrier_phase_rads/GPS_TWO_PI, 3), 14); + lineObs += Rinex_Printer::rightJustify(asString(observables_iter->second.Carrier_phase_rads / GPS_TWO_PI, 3), 14); if (lli == 0) { lineObs += std::string(1, ' '); @@ -6464,13 +6490,13 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep out << lineObs << std::endl; } - std::pair ::iterator, std::multimap::iterator> ret; - for(it = available_glo_prns.begin(); - it != available_glo_prns.end(); - it++) + std::pair::iterator, std::multimap::iterator> ret; + for (it = available_glo_prns.begin(); + it != available_glo_prns.end(); + it++) { lineObs.clear(); - if(version == 3) + if (version == 3) { lineObs += satelliteSystem["GLONASS"]; if (static_cast(*it) < 10) lineObs += std::string(1, '0'); @@ -6484,7 +6510,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep lineObs += Rinex_Printer::rightJustify(asString(iter->second.Pseudorange_m, 3), 14); //Loss of lock indicator (LLI) - int lli = 0; // Include in the observation!! + int lli = 0; // Include in the observation!! if (lli == 0) { lineObs += std::string(1, ' '); @@ -6532,9 +6558,11 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep } -void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& gps_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, double gps_obs_time, const std::map& observables) +void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& gps_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, double gps_obs_time, const std::map& observables) { - if(glonass_gnav_eph.d_m){} // avoid warning, not needed + if (glonass_gnav_eph.d_m) + { + } // avoid warning, not needed std::string line; // -------- EPOCH record @@ -6544,12 +6572,12 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& g //double gps_t = eph.sv_clock_correction(obs_time); double gps_t = gps_obs_time; - std::string month (timestring, 4, 2); - std::string day (timestring, 6, 2); - std::string hour (timestring, 9, 2); - std::string minutes (timestring, 11, 2); + std::string month(timestring, 4, 2); + std::string day(timestring, 6, 2); + std::string hour(timestring, 9, 2); + std::string minutes(timestring, 11, 2); - std::string year (timestring, 0, 4); + std::string year(timestring, 0, 4); line += std::string(1, '>'); line += std::string(1, ' '); line += year; @@ -6567,7 +6595,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& g // Add extra 0 if seconds are < 10 if (seconds < 10) { - line +=std::string(1, '0'); + line += std::string(1, '0'); } line += Rinex_Printer::asString(seconds, 7); line += std::string(2, ' '); @@ -6581,21 +6609,21 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& g std::map observablesR2C; std::map::const_iterator observables_iter; - for(observables_iter = observables.begin(); - observables_iter != observables.end(); - observables_iter++) + for (observables_iter = observables.begin(); + observables_iter != observables.end(); + observables_iter++) { std::string system_(&observables_iter->second.System, 1); std::string sig_(observables_iter->second.Signal); - if((system_.compare("R") == 0) && (sig_.compare("1G") == 0)) + if ((system_.compare("R") == 0) && (sig_.compare("1G") == 0)) { observablesR1C.insert(std::pair(observables_iter->first, observables_iter->second)); } - if((system_.compare("R") == 0) && (sig_.compare("2G") == 0)) + if ((system_.compare("R") == 0) && (sig_.compare("2G") == 0)) { observablesR2C.insert(std::pair(observables_iter->first, observables_iter->second)); } - if((system_.compare("G") == 0) && (sig_.compare("2S") == 0)) + if ((system_.compare("G") == 0) && (sig_.compare("2S") == 0)) { observablesG2S.insert(std::pair(observables_iter->first, observables_iter->second)); } @@ -6604,27 +6632,27 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& g std::multimap total_glo_map; std::set available_glo_prns; std::set::iterator it; - for(observables_iter = observablesR1C.begin(); - observables_iter != observablesR1C.end(); - observables_iter++) + for (observables_iter = observablesR1C.begin(); + observables_iter != observablesR1C.end(); + observables_iter++) { unsigned int prn_ = observables_iter->second.PRN; total_glo_map.insert(std::pair(prn_, observables_iter->second)); it = available_glo_prns.find(prn_); - if(it == available_glo_prns.end()) + if (it == available_glo_prns.end()) { available_glo_prns.insert(prn_); } } - for(observables_iter = observablesR2C.begin(); - observables_iter != observablesR2C.end(); - observables_iter++) + for (observables_iter = observablesR2C.begin(); + observables_iter != observablesR2C.end(); + observables_iter++) { unsigned int prn_ = observables_iter->second.PRN; total_glo_map.insert(std::pair(prn_, observables_iter->second)); it = available_glo_prns.find(prn_); - if(it == available_glo_prns.end()) + if (it == available_glo_prns.end()) { available_glo_prns.insert(prn_); } @@ -6642,16 +6670,16 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& g // -------- OBSERVATION record std::string s; std::string lineObs; - for(observables_iter = observablesG2S.begin(); - observables_iter != observablesG2S.end(); - observables_iter++) + for (observables_iter = observablesG2S.begin(); + observables_iter != observablesG2S.end(); + observables_iter++) { lineObs.clear(); s.assign(1, observables_iter->second.System); // Specify system only if in version 3 - if(s.compare("G") == 0) lineObs += satelliteSystem["GPS"]; - if(s.compare("R") == 0) lineObs += satelliteSystem["GLONASS"]; // should not happen + if (s.compare("G") == 0) lineObs += satelliteSystem["GPS"]; + if (s.compare("R") == 0) lineObs += satelliteSystem["GLONASS"]; // should not happen if (static_cast(observables_iter->second.PRN) < 10) lineObs += std::string(1, '0'); lineObs += boost::lexical_cast(static_cast(observables_iter->second.PRN)); @@ -6659,7 +6687,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& g lineObs += Rinex_Printer::rightJustify(asString(observables_iter->second.Pseudorange_m, 3), 14); //Loss of lock indicator (LLI) - int lli = 0; // Include in the observation!! + int lli = 0; // Include in the observation!! if (lli == 0) { lineObs += std::string(1, ' '); @@ -6674,7 +6702,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& g lineObs += Rinex_Printer::rightJustify(Rinex_Printer::asString(ssi), 1); // PHASE - lineObs += Rinex_Printer::rightJustify(asString(observables_iter->second.Carrier_phase_rads/GPS_TWO_PI, 3), 14); + lineObs += Rinex_Printer::rightJustify(asString(observables_iter->second.Carrier_phase_rads / GPS_TWO_PI, 3), 14); if (lli == 0) { lineObs += std::string(1, ' '); @@ -6704,10 +6732,10 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& g out << lineObs << std::endl; } - std::pair ::iterator, std::multimap::iterator> ret; - for(it = available_glo_prns.begin(); - it != available_glo_prns.end(); - it++) + std::pair::iterator, std::multimap::iterator> ret; + for (it = available_glo_prns.begin(); + it != available_glo_prns.end(); + it++) { lineObs.clear(); lineObs += satelliteSystem["GLONASS"]; @@ -6722,7 +6750,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& g lineObs += Rinex_Printer::rightJustify(asString(iter->second.Pseudorange_m, 3), 14); //Loss of lock indicator (LLI) - int lli = 0; // Include in the observation!! + int lli = 0; // Include in the observation!! if (lli == 0) { lineObs += std::string(1, ' '); @@ -6770,9 +6798,11 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& g } -void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& galileo_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, double galileo_obs_time, const std::map& observables) +void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& galileo_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, double galileo_obs_time, const std::map& observables) { - if(glonass_gnav_eph.d_m){} // avoid warning, not needed + if (glonass_gnav_eph.d_m) + { + } // avoid warning, not needed std::string line; boost::posix_time::ptime p_galileo_time = Rinex_Printer::compute_Galileo_time(galileo_eph, galileo_obs_time); @@ -6781,12 +6811,12 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& ga //double gps_t = eph.sv_clock_correction(obs_time); double galileo_t = galileo_obs_time; - std::string month (timestring, 4, 2); - std::string day (timestring, 6, 2); - std::string hour (timestring, 9, 2); - std::string minutes (timestring, 11, 2); + std::string month(timestring, 4, 2); + std::string day(timestring, 6, 2); + std::string hour(timestring, 9, 2); + std::string minutes(timestring, 11, 2); - std::string year (timestring, 0, 4); + std::string year(timestring, 0, 4); line += std::string(1, '>'); line += std::string(1, ' '); line += year; @@ -6804,7 +6834,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& ga // Add extra 0 if seconds are < 10 if (seconds < 10) { - line +=std::string(1, '0'); + line += std::string(1, '0'); } line += Rinex_Printer::asString(seconds, 7); line += std::string(2, ' '); @@ -6819,21 +6849,21 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& ga std::map observablesR2C; std::map::const_iterator observables_iter; - for(observables_iter = observables.begin(); - observables_iter != observables.end(); - observables_iter++) + for (observables_iter = observables.begin(); + observables_iter != observables.end(); + observables_iter++) { std::string system_(&observables_iter->second.System, 1); std::string sig_(observables_iter->second.Signal); - if((system_.compare("R") == 0) && (sig_.compare("1G") == 0)) + if ((system_.compare("R") == 0) && (sig_.compare("1G") == 0)) { observablesR1C.insert(std::pair(observables_iter->first, observables_iter->second)); } - if((system_.compare("R") == 0) && (sig_.compare("2G") == 0)) + if ((system_.compare("R") == 0) && (sig_.compare("2G") == 0)) { observablesR2C.insert(std::pair(observables_iter->first, observables_iter->second)); } - if((system_.compare("E") == 0) && (sig_.compare("1B") == 0)) + if ((system_.compare("E") == 0) && (sig_.compare("1B") == 0)) { observablesE1B.insert(std::pair(observables_iter->first, observables_iter->second)); } @@ -6842,26 +6872,26 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& ga std::multimap total_glo_map; std::set available_glo_prns; std::set::iterator it; - for(observables_iter = observablesR1C.begin(); - observables_iter != observablesR1C.end(); - observables_iter++) + for (observables_iter = observablesR1C.begin(); + observables_iter != observablesR1C.end(); + observables_iter++) { unsigned int prn_ = observables_iter->second.PRN; total_glo_map.insert(std::pair(prn_, observables_iter->second)); it = available_glo_prns.find(prn_); - if(it == available_glo_prns.end()) + if (it == available_glo_prns.end()) { available_glo_prns.insert(prn_); } } - for(observables_iter = observablesR2C.begin(); - observables_iter != observablesR2C.end(); - observables_iter++) + for (observables_iter = observablesR2C.begin(); + observables_iter != observablesR2C.end(); + observables_iter++) { unsigned int prn_ = observables_iter->second.PRN; total_glo_map.insert(std::pair(prn_, observables_iter->second)); it = available_glo_prns.find(prn_); - if(it == available_glo_prns.end()) + if (it == available_glo_prns.end()) { available_glo_prns.insert(prn_); } @@ -6881,21 +6911,21 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& ga std::string s; std::string lineObs; - for(observables_iter = observablesE1B.begin(); - observables_iter != observablesE1B.end(); - observables_iter++) + for (observables_iter = observablesE1B.begin(); + observables_iter != observablesE1B.end(); + observables_iter++) { lineObs.clear(); s.assign(1, observables_iter->second.System); - if(s.compare("E") == 0) lineObs += satelliteSystem["Galileo"]; - if(s.compare("R") == 0) lineObs += satelliteSystem["GLONASS"]; // should not happen + if (s.compare("E") == 0) lineObs += satelliteSystem["Galileo"]; + if (s.compare("R") == 0) lineObs += satelliteSystem["GLONASS"]; // should not happen if (static_cast(observables_iter->second.PRN) < 10) lineObs += std::string(1, '0'); lineObs += boost::lexical_cast(static_cast(observables_iter->second.PRN)); lineObs += Rinex_Printer::rightJustify(asString(observables_iter->second.Pseudorange_m, 3), 14); //Loss of lock indicator (LLI) - int lli = 0; // Include in the observation!! + int lli = 0; // Include in the observation!! if (lli == 0) { lineObs += std::string(1, ' '); @@ -6910,7 +6940,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& ga lineObs += Rinex_Printer::rightJustify(Rinex_Printer::asString(ssi), 1); // PHASE - lineObs += Rinex_Printer::rightJustify(asString(observables_iter->second.Carrier_phase_rads/GPS_TWO_PI, 3), 14); + lineObs += Rinex_Printer::rightJustify(asString(observables_iter->second.Carrier_phase_rads / GPS_TWO_PI, 3), 14); if (lli == 0) { lineObs += std::string(1, ' '); @@ -6940,10 +6970,10 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& ga out << lineObs << std::endl; } - std::pair ::iterator, std::multimap::iterator> ret; - for(it = available_glo_prns.begin(); - it != available_glo_prns.end(); - it++) + std::pair::iterator, std::multimap::iterator> ret; + for (it = available_glo_prns.begin(); + it != available_glo_prns.end(); + it++) { lineObs.clear(); lineObs += satelliteSystem["Galileo"]; @@ -6955,7 +6985,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& ga lineObs += Rinex_Printer::rightJustify(asString(iter->second.Pseudorange_m, 3), 14); //Loss of lock indicator (LLI) - int lli = 0; // Include in the observation!! + int lli = 0; // Include in the observation!! if (lli == 0) { lineObs += std::string(1, ' '); @@ -7003,7 +7033,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& ga } -void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, const double obs_time, const std::map& observables) +void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, const double obs_time, const std::map& observables) { // RINEX observations timestamps are GPS timestamps. std::string line; @@ -7014,19 +7044,19 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, c //double gps_t = eph.sv_clock_correction(obs_time); double gps_t = obs_time; - std::string month (timestring, 4, 2); - std::string day (timestring, 6, 2); - std::string hour (timestring, 9, 2); - std::string minutes (timestring, 11, 2); + std::string month(timestring, 4, 2); + std::string day(timestring, 6, 2); + std::string hour(timestring, 9, 2); + std::string minutes(timestring, 11, 2); if (version == 2) { line.clear(); - std::string year (timestring, 2, 2); + std::string year(timestring, 2, 2); line += std::string(1, ' '); line += year; line += std::string(1, ' '); - if (month.compare(0, 1 , "0") == 0) + if (month.compare(0, 1, "0") == 0) { line += std::string(1, ' '); line += month.substr(1, 1); @@ -7036,7 +7066,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, c line += month; } line += std::string(1, ' '); - if (day.compare(0, 1 , "0") == 0) + if (day.compare(0, 1, "0") == 0) { line += std::string(1, ' '); line += day.substr(1, 1); @@ -7062,16 +7092,16 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, c //Number of satellites observed in current epoch int numSatellitesObserved = 0; std::map::const_iterator observables_iter; - for(observables_iter = observables.cbegin(); - observables_iter != observables.cend(); - observables_iter++) + for (observables_iter = observables.cbegin(); + observables_iter != observables.cend(); + observables_iter++) { numSatellitesObserved++; } line += Rinex_Printer::rightJustify(boost::lexical_cast(numSatellitesObserved), 3); - for(observables_iter = observables.cbegin(); - observables_iter != observables.cend(); - observables_iter++) + for (observables_iter = observables.cbegin(); + observables_iter != observables.cend(); + observables_iter++) { line += satelliteSystem["GPS"]; if (static_cast(observables_iter->second.PRN) < 10) line += std::string(1, '0'); @@ -7083,9 +7113,9 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, c Rinex_Printer::lengthCheck(line); out << line << std::endl; - for(observables_iter = observables.cbegin(); - observables_iter != observables.cend(); - observables_iter++) + for (observables_iter = observables.cbegin(); + observables_iter != observables.cend(); + observables_iter++) { std::string lineObs; lineObs.clear(); @@ -7095,7 +7125,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, c lineObs += Rinex_Printer::rightJustify(asString(observables_iter->second.Pseudorange_m, 3), 14); //Loss of lock indicator (LLI) - int lli = 0; // Include in the observation!! + int lli = 0; // Include in the observation!! if (lli == 0) { lineObs += std::string(1, ' '); @@ -7109,7 +7139,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, c int ssi = Rinex_Printer::signalStrength(observables_iter->second.CN0_dB_hz); lineObs += Rinex_Printer::rightJustify(Rinex_Printer::asString(ssi), 1); // GPS L1 CA PHASE - lineObs += Rinex_Printer::rightJustify(asString(observables_iter->second.Carrier_phase_rads/GPS_TWO_PI, 3), 14); + lineObs += Rinex_Printer::rightJustify(asString(observables_iter->second.Carrier_phase_rads / GPS_TWO_PI, 3), 14); if (lli == 0) { lineObs += std::string(1, ' '); @@ -7139,7 +7169,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, c if (version == 3) { - std::string year (timestring, 0, 4); + std::string year(timestring, 0, 4); line += std::string(1, '>'); line += std::string(1, ' '); line += year; @@ -7167,9 +7197,9 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, c //Number of satellites observed in current epoch int numSatellitesObserved = 0; std::map::const_iterator observables_iter; - for(observables_iter = observables.cbegin(); - observables_iter != observables.cend(); - observables_iter++) + for (observables_iter = observables.cbegin(); + observables_iter != observables.cend(); + observables_iter++) { numSatellitesObserved++; } @@ -7182,9 +7212,9 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, c Rinex_Printer::lengthCheck(line); out << line << std::endl; - for(observables_iter = observables.cbegin(); - observables_iter != observables.cend(); - observables_iter++) + for (observables_iter = observables.cbegin(); + observables_iter != observables.cend(); + observables_iter++) { std::string lineObs; lineObs.clear(); @@ -7195,7 +7225,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, c lineObs += Rinex_Printer::rightJustify(asString(observables_iter->second.Pseudorange_m, 3), 14); //Loss of lock indicator (LLI) - int lli = 0; // Include in the observation!! + int lli = 0; // Include in the observation!! if (lli == 0) { lineObs += std::string(1, ' '); @@ -7210,7 +7240,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, c lineObs += Rinex_Printer::rightJustify(Rinex_Printer::asString(ssi), 1); // GPS L1 CA PHASE - lineObs += Rinex_Printer::rightJustify(asString(observables_iter->second.Carrier_phase_rads/GPS_TWO_PI, 3), 14); + lineObs += Rinex_Printer::rightJustify(asString(observables_iter->second.Carrier_phase_rads / GPS_TWO_PI, 3), 14); if (lli == 0) { lineObs += std::string(1, ' '); @@ -7244,7 +7274,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, c } -void Rinex_Printer::log_rinex_obs(std::fstream & out, const Gps_CNAV_Ephemeris & eph, double obs_time, const std::map & observables) +void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& eph, double obs_time, const std::map& observables) { // RINEX observations timestamps are GPS timestamps. std::string line; @@ -7255,12 +7285,12 @@ void Rinex_Printer::log_rinex_obs(std::fstream & out, const Gps_CNAV_Ephemeris & //double gps_t = eph.sv_clock_correction(obs_time); double gps_t = obs_time; - std::string month (timestring, 4, 2); - std::string day (timestring, 6, 2); - std::string hour (timestring, 9, 2); - std::string minutes (timestring, 11, 2); + std::string month(timestring, 4, 2); + std::string day(timestring, 6, 2); + std::string hour(timestring, 9, 2); + std::string minutes(timestring, 11, 2); - std::string year (timestring, 0, 4); + std::string year(timestring, 0, 4); line += std::string(1, '>'); line += std::string(1, ' '); line += year; @@ -7288,9 +7318,9 @@ void Rinex_Printer::log_rinex_obs(std::fstream & out, const Gps_CNAV_Ephemeris & //Number of satellites observed in current epoch int numSatellitesObserved = 0; std::map::const_iterator observables_iter; - for(observables_iter = observables.cbegin(); - observables_iter != observables.cend(); - observables_iter++) + for (observables_iter = observables.cbegin(); + observables_iter != observables.cend(); + observables_iter++) { numSatellitesObserved++; } @@ -7303,9 +7333,9 @@ void Rinex_Printer::log_rinex_obs(std::fstream & out, const Gps_CNAV_Ephemeris & Rinex_Printer::lengthCheck(line); out << line << std::endl; - for(observables_iter = observables.cbegin(); - observables_iter != observables.cend(); - observables_iter++) + for (observables_iter = observables.cbegin(); + observables_iter != observables.cend(); + observables_iter++) { std::string lineObs; lineObs.clear(); @@ -7317,7 +7347,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream & out, const Gps_CNAV_Ephemeris & lineObs += Rinex_Printer::rightJustify(asString(observables_iter->second.Pseudorange_m, 3), 14); //Loss of lock indicator (LLI) - int lli = 0; // Include in the observation!! + int lli = 0; // Include in the observation!! if (lli == 0) { lineObs += std::string(1, ' '); @@ -7332,7 +7362,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream & out, const Gps_CNAV_Ephemeris & lineObs += Rinex_Printer::rightJustify(Rinex_Printer::asString(ssi), 1); // GPS L2 PHASE - lineObs += Rinex_Printer::rightJustify(asString(observables_iter->second.Carrier_phase_rads/GPS_TWO_PI, 3), 14); + lineObs += Rinex_Printer::rightJustify(asString(observables_iter->second.Carrier_phase_rads / GPS_TWO_PI, 3), 14); if (lli == 0) { lineObs += std::string(1, ' '); @@ -7365,9 +7395,11 @@ void Rinex_Printer::log_rinex_obs(std::fstream & out, const Gps_CNAV_Ephemeris & } -void Rinex_Printer::log_rinex_obs(std::fstream & out, const Gps_Ephemeris & eph, const Gps_CNAV_Ephemeris & eph_cnav, double obs_time, const std::map & observables) +void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, const Gps_CNAV_Ephemeris& eph_cnav, double obs_time, const std::map& observables) { - if(eph_cnav.d_i_0){} // avoid warning, not needed + if (eph_cnav.d_i_0) + { + } // avoid warning, not needed // RINEX observations timestamps are GPS timestamps. std::string line; @@ -7377,12 +7409,12 @@ void Rinex_Printer::log_rinex_obs(std::fstream & out, const Gps_Ephemeris & eph, //double gps_t = eph.sv_clock_correction(obs_time); double gps_t = obs_time; - std::string month (timestring, 4, 2); - std::string day (timestring, 6, 2); - std::string hour (timestring, 9, 2); - std::string minutes (timestring, 11, 2); + std::string month(timestring, 4, 2); + std::string day(timestring, 6, 2); + std::string hour(timestring, 9, 2); + std::string minutes(timestring, 11, 2); - std::string year (timestring, 0, 4); + std::string year(timestring, 0, 4); line += std::string(1, '>'); line += std::string(1, ' '); line += year; @@ -7416,22 +7448,22 @@ void Rinex_Printer::log_rinex_obs(std::fstream & out, const Gps_Ephemeris & eph, std::multimap total_mmap; std::multimap::iterator mmap_iter; - for(observables_iter = observables.cbegin(); - observables_iter != observables.cend(); - observables_iter++) + for (observables_iter = observables.cbegin(); + observables_iter != observables.cend(); + observables_iter++) { std::string system_(&observables_iter->second.System, 1); std::string sig_(observables_iter->second.Signal); - if((system_.compare("G") == 0) && (sig_.compare("1C") == 0)) + if ((system_.compare("G") == 0) && (sig_.compare("1C") == 0)) { observablesL1.insert(std::pair(observables_iter->first, observables_iter->second)); total_mmap.insert(std::pair(observables_iter->second.PRN, observables_iter->second)); } - if((system_.compare("G") == 0) && (sig_.compare("2S") == 0)) + if ((system_.compare("G") == 0) && (sig_.compare("2S") == 0)) { observablesL2.insert(std::pair(observables_iter->first, observables_iter->second)); mmap_iter = total_mmap.find(observables_iter->second.PRN); - if(mmap_iter == total_mmap.end()) + if (mmap_iter == total_mmap.end()) { Gnss_Synchro gs = Gnss_Synchro(); total_mmap.insert(std::pair(observables_iter->second.PRN, gs)); @@ -7443,11 +7475,11 @@ void Rinex_Printer::log_rinex_obs(std::fstream & out, const Gps_Ephemeris & eph, // Fill with zeros satellites with L1 obs but not L2 std::multimap mmap_aux; mmap_aux = total_mmap; - for(mmap_iter = mmap_aux.begin(); - mmap_iter != mmap_aux.end(); - mmap_iter++) + for (mmap_iter = mmap_aux.begin(); + mmap_iter != mmap_aux.end(); + mmap_iter++) { - if((total_mmap.count(mmap_iter->second.PRN)) == 1 && (mmap_iter->second.PRN != 0)) + if ((total_mmap.count(mmap_iter->second.PRN)) == 1 && (mmap_iter->second.PRN != 0)) { Gnss_Synchro gs = Gnss_Synchro(); std::string sys = "G"; @@ -7461,25 +7493,25 @@ void Rinex_Printer::log_rinex_obs(std::fstream & out, const Gps_Ephemeris & eph, std::set available_prns; std::set::iterator it; - for(observables_iter = observablesL1.cbegin(); - observables_iter != observablesL1.cend(); - observables_iter++) + for (observables_iter = observablesL1.cbegin(); + observables_iter != observablesL1.cend(); + observables_iter++) { unsigned int prn_ = observables_iter->second.PRN; it = available_prns.find(prn_); - if(it == available_prns.end()) + if (it == available_prns.end()) { available_prns.insert(prn_); } } - for(observables_iter = observablesL2.cbegin(); - observables_iter != observablesL2.cend(); - observables_iter++) + for (observables_iter = observablesL2.cbegin(); + observables_iter != observablesL2.cend(); + observables_iter++) { unsigned int prn_ = observables_iter->second.PRN; it = available_prns.find(prn_); - if(it == available_prns.end()) + if (it == available_prns.end()) { available_prns.insert(prn_); } @@ -7494,10 +7526,10 @@ void Rinex_Printer::log_rinex_obs(std::fstream & out, const Gps_Ephemeris & eph, out << line << std::endl; std::string lineObs; - std::pair ::iterator, std::multimap::iterator> ret; - for(it = available_prns.begin(); - it != available_prns.end(); - it++) + std::pair::iterator, std::multimap::iterator> ret; + for (it = available_prns.begin(); + it != available_prns.end(); + it++) { lineObs.clear(); lineObs += satelliteSystem["GPS"]; @@ -7509,7 +7541,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream & out, const Gps_Ephemeris & eph, lineObs += Rinex_Printer::rightJustify(asString(iter->second.Pseudorange_m, 3), 14); //Loss of lock indicator (LLI) - int lli = 0; // Include in the observation!! + int lli = 0; // Include in the observation!! if (lli == 0) { lineObs += std::string(1, ' '); @@ -7557,7 +7589,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream & out, const Gps_Ephemeris & eph, } -void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& eph, double obs_time, const std::map& observables, const std::string galileo_bands) +void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& eph, double obs_time, const std::map& observables, const std::string galileo_bands) { // RINEX observations timestamps are Galileo timestamps. // See http://gage14.upc.es/gLAB/HTML/Observation_Rinex_v3.01.html @@ -7569,12 +7601,12 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& ep //double gps_t = eph.sv_clock_correction(obs_time); double galileo_t = obs_time; - std::string month (timestring, 4, 2); - std::string day (timestring, 6, 2); - std::string hour (timestring, 9, 2); - std::string minutes (timestring, 11, 2); + std::string month(timestring, 4, 2); + std::string day(timestring, 6, 2); + std::string hour(timestring, 9, 2); + std::string minutes(timestring, 11, 2); - std::string year (timestring, 0, 4); + std::string year(timestring, 0, 4); line += std::string(1, '>'); line += std::string(1, ' '); line += year; @@ -7607,21 +7639,21 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& ep std::map observablesE5B; std::map::const_iterator observables_iter; - for(observables_iter = observables.cbegin(); - observables_iter != observables.cend(); - observables_iter++) + for (observables_iter = observables.cbegin(); + observables_iter != observables.cend(); + observables_iter++) { std::string system_(&observables_iter->second.System, 1); std::string sig_(observables_iter->second.Signal); - if((system_.compare("E") == 0) && (sig_.compare("1B") == 0)) + if ((system_.compare("E") == 0) && (sig_.compare("1B") == 0)) { observablesE1B.insert(std::pair(observables_iter->first, observables_iter->second)); } - if((system_.compare("E") == 0) && (sig_.compare("5X") == 0)) + if ((system_.compare("E") == 0) && (sig_.compare("5X") == 0)) { observablesE5A.insert(std::pair(observables_iter->first, observables_iter->second)); } - if((system_.compare("E") == 0) && (sig_.compare("7X") == 0)) + if ((system_.compare("E") == 0) && (sig_.compare("7X") == 0)) { observablesE5B.insert(std::pair(observables_iter->first, observables_iter->second)); } @@ -7633,33 +7665,33 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& ep std::multimap total_map; std::set available_prns; std::set::iterator it; - if(found_1B != std::string::npos) + if (found_1B != std::string::npos) { - for(observables_iter = observablesE1B.begin(); - observables_iter != observablesE1B.end(); - observables_iter++) + for (observables_iter = observablesE1B.begin(); + observables_iter != observablesE1B.end(); + observables_iter++) { unsigned int prn_ = observables_iter->second.PRN; total_map.insert(std::pair(prn_, observables_iter->second)); it = available_prns.find(prn_); - if(it == available_prns.end()) + if (it == available_prns.end()) { available_prns.insert(prn_); } } } - if(found_E5a != std::string::npos) + if (found_E5a != std::string::npos) { - for(observables_iter = observablesE5A.cbegin(); - observables_iter != observablesE5A.cend(); - observables_iter++) + for (observables_iter = observablesE5A.cbegin(); + observables_iter != observablesE5A.cend(); + observables_iter++) { unsigned int prn_ = observables_iter->second.PRN; it = available_prns.find(prn_); - if(it == available_prns.end()) + if (it == available_prns.end()) { available_prns.insert(prn_); - if(found_1B != std::string::npos) + if (found_1B != std::string::npos) { Gnss_Synchro gs = Gnss_Synchro(); std::string sys = "E"; @@ -7673,18 +7705,18 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& ep total_map.insert(std::pair(prn_, observables_iter->second)); } } - if(found_E5b != std::string::npos) + if (found_E5b != std::string::npos) { - for(observables_iter = observablesE5B.cbegin(); - observables_iter != observablesE5B.cend(); - observables_iter++) + for (observables_iter = observablesE5B.cbegin(); + observables_iter != observablesE5B.cend(); + observables_iter++) { unsigned int prn_ = observables_iter->second.PRN; it = available_prns.find(prn_); - if(it == available_prns.end()) + if (it == available_prns.end()) { available_prns.insert(prn_); - if(found_1B != std::string::npos) + if (found_1B != std::string::npos) { Gnss_Synchro gs = Gnss_Synchro(); std::string sys = "E"; @@ -7694,7 +7726,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& ep gs.PRN = prn_; total_map.insert(std::pair(prn_, gs)); } - if(found_E5a != std::string::npos) + if (found_E5a != std::string::npos) { Gnss_Synchro gs = Gnss_Synchro(); std::string sys = "E"; @@ -7708,9 +7740,9 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& ep else { // if 5X is listed but empty - if(found_E5a != std::string::npos) + if (found_E5a != std::string::npos) { - if( (total_map.count(prn_)) == 1) + if ((total_map.count(prn_)) == 1) { Gnss_Synchro gs = Gnss_Synchro(); std::string sys = "E"; @@ -7734,10 +7766,10 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& ep out << line << std::endl; std::string lineObs; - std::pair ::iterator, std::multimap::iterator> ret; - for(it = available_prns.begin(); - it != available_prns.end(); - it++) + std::pair::iterator, std::multimap::iterator> ret; + for (it = available_prns.begin(); + it != available_prns.end(); + it++) { lineObs.clear(); lineObs += satelliteSystem["Galileo"]; @@ -7749,7 +7781,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& ep lineObs += Rinex_Printer::rightJustify(asString(iter->second.Pseudorange_m, 3), 14); //Loss of lock indicator (LLI) - int lli = 0; // Include in the observation!! + int lli = 0; // Include in the observation!! if (lli == 0) { lineObs += std::string(1, ' '); @@ -7797,9 +7829,11 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& ep } -void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_eph, const Galileo_Ephemeris& galileo_eph, double gps_obs_time, const std::map& observables) +void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_eph, const Galileo_Ephemeris& galileo_eph, double gps_obs_time, const std::map& observables) { - if(galileo_eph.e_1){} // avoid warning, not needed + if (galileo_eph.e_1) + { + } // avoid warning, not needed std::string line; boost::posix_time::ptime p_gps_time = Rinex_Printer::compute_GPS_time(gps_eph, gps_obs_time); @@ -7808,12 +7842,12 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep //double gps_t = eph.sv_clock_correction(obs_time); double gps_t = gps_obs_time; - std::string month (timestring, 4, 2); - std::string day (timestring, 6, 2); - std::string hour (timestring, 9, 2); - std::string minutes (timestring, 11, 2); + std::string month(timestring, 4, 2); + std::string day(timestring, 6, 2); + std::string hour(timestring, 9, 2); + std::string minutes(timestring, 11, 2); - std::string year (timestring, 0, 4); + std::string year(timestring, 0, 4); line += std::string(1, '>'); line += std::string(1, ' '); line += year; @@ -7831,7 +7865,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep // Add extra 0 if seconds are < 10 if (seconds < 10) { - line +=std::string(1, '0'); + line += std::string(1, '0'); } line += Rinex_Printer::asString(seconds, 7); line += std::string(2, ' '); @@ -7847,25 +7881,25 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep std::map observablesE5B; std::map::const_iterator observables_iter; - for(observables_iter = observables.cbegin(); - observables_iter != observables.cend(); - observables_iter++) + for (observables_iter = observables.cbegin(); + observables_iter != observables.cend(); + observables_iter++) { std::string system_(&observables_iter->second.System, 1); std::string sig_(observables_iter->second.Signal); - if((system_.compare("E") == 0) && (sig_.compare("1B") == 0)) + if ((system_.compare("E") == 0) && (sig_.compare("1B") == 0)) { observablesE1B.insert(std::pair(observables_iter->first, observables_iter->second)); } - if((system_.compare("E") == 0) && (sig_.compare("5X") == 0)) + if ((system_.compare("E") == 0) && (sig_.compare("5X") == 0)) { observablesE5A.insert(std::pair(observables_iter->first, observables_iter->second)); } - if((system_.compare("E") == 0) && (sig_.compare("7X") == 0)) + if ((system_.compare("E") == 0) && (sig_.compare("7X") == 0)) { observablesE5B.insert(std::pair(observables_iter->first, observables_iter->second)); } - if((system_.compare("G") == 0) && (sig_.compare("1C") == 0)) + if ((system_.compare("G") == 0) && (sig_.compare("1C") == 0)) { observablesG1C.insert(std::pair(observables_iter->first, observables_iter->second)); } @@ -7874,40 +7908,40 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep std::multimap total_gal_map; std::set available_gal_prns; std::set::iterator it; - for(observables_iter = observablesE1B.cbegin(); - observables_iter != observablesE1B.cend(); - observables_iter++) + for (observables_iter = observablesE1B.cbegin(); + observables_iter != observablesE1B.cend(); + observables_iter++) { unsigned int prn_ = observables_iter->second.PRN; total_gal_map.insert(std::pair(prn_, observables_iter->second)); it = available_gal_prns.find(prn_); - if(it == available_gal_prns.end()) + if (it == available_gal_prns.end()) { available_gal_prns.insert(prn_); } } - for(observables_iter = observablesE5A.cbegin(); - observables_iter != observablesE5A.cend(); - observables_iter++) + for (observables_iter = observablesE5A.cbegin(); + observables_iter != observablesE5A.cend(); + observables_iter++) { unsigned int prn_ = observables_iter->second.PRN; total_gal_map.insert(std::pair(prn_, observables_iter->second)); it = available_gal_prns.find(prn_); - if(it == available_gal_prns.end()) + if (it == available_gal_prns.end()) { available_gal_prns.insert(prn_); } } - for(observables_iter = observablesE5B.cbegin(); - observables_iter != observablesE5B.cend(); - observables_iter++) + for (observables_iter = observablesE5B.cbegin(); + observables_iter != observablesE5B.cend(); + observables_iter++) { unsigned int prn_ = observables_iter->second.PRN; total_gal_map.insert(std::pair(prn_, observables_iter->second)); it = available_gal_prns.find(prn_); - if(it == available_gal_prns.end()) + if (it == available_gal_prns.end()) { available_gal_prns.insert(prn_); } @@ -7927,21 +7961,21 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep std::string s; std::string lineObs; - for(observables_iter = observablesG1C.cbegin(); - observables_iter != observablesG1C.cend(); - observables_iter++) + for (observables_iter = observablesG1C.cbegin(); + observables_iter != observablesG1C.cend(); + observables_iter++) { lineObs.clear(); s.assign(1, observables_iter->second.System); - if(s.compare("G") == 0) lineObs += satelliteSystem["GPS"]; - if(s.compare("E") == 0) lineObs += satelliteSystem["Galileo"]; // should not happen + if (s.compare("G") == 0) lineObs += satelliteSystem["GPS"]; + if (s.compare("E") == 0) lineObs += satelliteSystem["Galileo"]; // should not happen if (static_cast(observables_iter->second.PRN) < 10) lineObs += std::string(1, '0'); lineObs += boost::lexical_cast(static_cast(observables_iter->second.PRN)); lineObs += Rinex_Printer::rightJustify(asString(observables_iter->second.Pseudorange_m, 3), 14); //Loss of lock indicator (LLI) - int lli = 0; // Include in the observation!! + int lli = 0; // Include in the observation!! if (lli == 0) { lineObs += std::string(1, ' '); @@ -7956,7 +7990,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep lineObs += Rinex_Printer::rightJustify(Rinex_Printer::asString(ssi), 1); // PHASE - lineObs += Rinex_Printer::rightJustify(asString(observables_iter->second.Carrier_phase_rads/GPS_TWO_PI, 3), 14); + lineObs += Rinex_Printer::rightJustify(asString(observables_iter->second.Carrier_phase_rads / GPS_TWO_PI, 3), 14); if (lli == 0) { lineObs += std::string(1, ' '); @@ -7986,10 +8020,10 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep out << lineObs << std::endl; } - std::pair ::iterator, std::multimap::iterator> ret; - for(it = available_gal_prns.begin(); - it != available_gal_prns.end(); - it++) + std::pair::iterator, std::multimap::iterator> ret; + for (it = available_gal_prns.begin(); + it != available_gal_prns.end(); + it++) { lineObs.clear(); lineObs += satelliteSystem["Galileo"]; @@ -8001,7 +8035,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep lineObs += Rinex_Printer::rightJustify(asString(iter->second.Pseudorange_m, 3), 14); //Loss of lock indicator (LLI) - int lli = 0; // Include in the observation!! + int lli = 0; // Include in the observation!! if (lli == 0) { lineObs += std::string(1, ' '); @@ -8049,29 +8083,28 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep } - -void Rinex_Printer::to_date_time(int gps_week, int gps_tow, int &year, int &month, int &day, int &hour, int &minute, int &second) +void Rinex_Printer::to_date_time(int gps_week, int gps_tow, int& year, int& month, int& day, int& hour, int& minute, int& second) { // represents GPS time (week, TOW) in the date time format of the Gregorian calendar. // -> Leap years are considered, but leap seconds are not. int days_per_month[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; // seconds in a not leap year - const int secs_per_day = 24*60*60; - const int secs_per_week = 7*secs_per_day; - const int secs_per_normal_year = 365*secs_per_day; + const int secs_per_day = 24 * 60 * 60; + const int secs_per_week = 7 * secs_per_day; + const int secs_per_normal_year = 365 * secs_per_day; const int secs_per_leap_year = secs_per_normal_year + secs_per_day; // the GPS epoch is 06.01.1980 00:00, i.e. midnight 5. / 6. January 1980 // -> seconds since then - int secs_since_gps_epoch = gps_week*secs_per_week + gps_tow; + int secs_since_gps_epoch = gps_week * secs_per_week + gps_tow; // find year, consider leap years bool is_leap_year; - int remaining_secs = secs_since_gps_epoch + 5*secs_per_day; - for (int y = 1980; true ; y++) + int remaining_secs = secs_since_gps_epoch + 5 * secs_per_day; + for (int y = 1980; true; y++) { - is_leap_year = y%4 == 0 && (y%100 != 0 || y%400 == 0); + is_leap_year = y % 4 == 0 && (y % 100 != 0 || y % 400 == 0); int secs_in_year_y = is_leap_year ? secs_per_leap_year : secs_per_normal_year; if (secs_in_year_y <= remaining_secs) @@ -8088,10 +8121,10 @@ void Rinex_Printer::to_date_time(int gps_week, int gps_tow, int &year, int &mont } // find month - for (int m = 1; true ; m++) + for (int m = 1; true; m++) { - int secs_in_month_m = days_per_month[m-1]*secs_per_day; - if (is_leap_year && m == 2 ) // consider February of leap year + int secs_in_month_m = days_per_month[m - 1] * secs_per_day; + if (is_leap_year && m == 2) // consider February of leap year { secs_in_month_m += secs_per_day; } @@ -8109,14 +8142,14 @@ void Rinex_Printer::to_date_time(int gps_week, int gps_tow, int &year, int &mont //std::cout << "month: m=" << m << " secs_in_month_m="<< secs_in_month_m << " remaining_secs="<< remaining_secs << std::endl; } - day = remaining_secs/secs_per_day+1; - remaining_secs = remaining_secs%secs_per_day; + day = remaining_secs / secs_per_day + 1; + remaining_secs = remaining_secs % secs_per_day; - hour = remaining_secs/(60*60); - remaining_secs = remaining_secs%(60*60); + hour = remaining_secs / (60 * 60); + remaining_secs = remaining_secs % (60 * 60); - minute = remaining_secs/60; - second = remaining_secs%60; + minute = remaining_secs / 60; + second = remaining_secs % 60; } @@ -8206,7 +8239,7 @@ void Rinex_Printer::to_date_time(int gps_week, int gps_tow, int &year, int &mont int Rinex_Printer::signalStrength(const double snr) { int ss; - ss = int ( std::min( std::max( int (floor(snr/6)) , 1), 9) ); + ss = int(std::min(std::max(int(floor(snr / 6)), 1), 9)); return ss; } @@ -8235,7 +8268,7 @@ boost::posix_time::ptime Rinex_Printer::compute_GPS_time(const Gps_Ephemeris& ep } -boost::posix_time::ptime Rinex_Printer::compute_GPS_time(const Gps_CNAV_Ephemeris & eph, const double obs_time) +boost::posix_time::ptime Rinex_Printer::compute_GPS_time(const Gps_CNAV_Ephemeris& eph, const double obs_time) { // The RINEX v2.11 v3.00 format uses GPS time for the observations epoch, not UTC time, thus, no leap seconds needed here. // (see Section 3 in http://igscb.jpl.nasa.gov/igscb/data/format/rinex211.txt) @@ -8254,7 +8287,7 @@ boost::posix_time::ptime Rinex_Printer::compute_Galileo_time(const Galileo_Ephem // (see Pag. 17 in http://igscb.jpl.nasa.gov/igscb/data/format/rinex301.pdf) // --??? No time correction here, since it will be done in the RINEX processor double galileo_t = obs_time; - boost::posix_time::time_duration t = boost::posix_time::millisec((galileo_t + 604800 * static_cast(eph.WN_5)) * 1000); // + boost::posix_time::time_duration t = boost::posix_time::millisec((galileo_t + 604800 * static_cast(eph.WN_5)) * 1000); // boost::posix_time::ptime p_time(boost::gregorian::date(1999, 8, 22), t); return p_time; } @@ -8263,7 +8296,7 @@ boost::posix_time::ptime Rinex_Printer::compute_Galileo_time(const Galileo_Ephem boost::posix_time::ptime Rinex_Printer::compute_UTC_time(const Glonass_Gnav_Ephemeris& eph, const double obs_time) { double tod = 0.0; - double glot2utc = 3*3600; + double glot2utc = 3 * 3600; double obs_time_glot = 0.0; int i = 0; @@ -8271,12 +8304,12 @@ boost::posix_time::ptime Rinex_Printer::compute_UTC_time(const Glonass_Gnav_Ephe obs_time_glot = obs_time + glot2utc; // Get seconds of day in glonass time - tod = fmod (obs_time_glot, 86400); + tod = fmod(obs_time_glot, 86400); // Form date and time duration types boost::posix_time::time_duration t1(0, 0, tod); boost::gregorian::date d1(eph.d_yr, 1, 1); - boost::gregorian::days d2(eph.d_N_T-1); + boost::gregorian::days d2(eph.d_N_T - 1); boost::posix_time::ptime glo_time(d1 + d2, t1); // Convert to utc @@ -8284,7 +8317,7 @@ boost::posix_time::ptime Rinex_Printer::compute_UTC_time(const Glonass_Gnav_Ephe boost::posix_time::ptime utc_time = glo_time - t2; // Adjust for leap second correction - for (i = 0; GLONASS_LEAP_SECONDS[i][0]>0; i++) + for (i = 0; GLONASS_LEAP_SECONDS[i][0] > 0; i++) { boost::posix_time::time_duration t3(GLONASS_LEAP_SECONDS[i][3], GLONASS_LEAP_SECONDS[i][4], GLONASS_LEAP_SECONDS[i][5]); boost::gregorian::date d3(GLONASS_LEAP_SECONDS[i][0], GLONASS_LEAP_SECONDS[i][1], GLONASS_LEAP_SECONDS[i][2]); @@ -8292,7 +8325,7 @@ boost::posix_time::ptime Rinex_Printer::compute_UTC_time(const Glonass_Gnav_Ephe if (utc_time >= ls_time) { // We subtract the leap second when going from gpst to utc - utc_time = utc_time - boost::posix_time::time_duration(0,0,fabs(GLONASS_LEAP_SECONDS[i][6])); + utc_time = utc_time - boost::posix_time::time_duration(0, 0, fabs(GLONASS_LEAP_SECONDS[i][6])); break; } } @@ -8304,7 +8337,7 @@ boost::posix_time::ptime Rinex_Printer::compute_UTC_time(const Glonass_Gnav_Ephe double Rinex_Printer::get_leap_second(const Glonass_Gnav_Ephemeris& eph, const double gps_obs_time) { double tod = 0.0; - double glot2utc = 3*3600; + double glot2utc = 3 * 3600; double obs_time_glot = 0.0; int i = 0; double leap_second = 0; @@ -8313,12 +8346,12 @@ double Rinex_Printer::get_leap_second(const Glonass_Gnav_Ephemeris& eph, const d obs_time_glot = gps_obs_time + glot2utc; // Get seconds of day in glonass time - tod = fmod (obs_time_glot, 86400); + tod = fmod(obs_time_glot, 86400); // Form date and time duration types boost::posix_time::time_duration t1(0, 0, tod); boost::gregorian::date d1(eph.d_yr, 1, 1); - boost::gregorian::days d2(eph.d_N_T-1); + boost::gregorian::days d2(eph.d_N_T - 1); boost::posix_time::ptime glo_time(d1 + d2, t1); // Convert to utc @@ -8326,7 +8359,7 @@ double Rinex_Printer::get_leap_second(const Glonass_Gnav_Ephemeris& eph, const d boost::posix_time::ptime utc_time = glo_time - t2; // Adjust for leap second correction - for (i = 0; GLONASS_LEAP_SECONDS[i][0]>0; i++) + for (i = 0; GLONASS_LEAP_SECONDS[i][0] > 0; i++) { boost::posix_time::time_duration t3(GLONASS_LEAP_SECONDS[i][3], GLONASS_LEAP_SECONDS[i][4], GLONASS_LEAP_SECONDS[i][5]); boost::gregorian::date d3(GLONASS_LEAP_SECONDS[i][0], GLONASS_LEAP_SECONDS[i][1], GLONASS_LEAP_SECONDS[i][2]); diff --git a/src/algorithms/PVT/libs/rinex_printer.h b/src/algorithms/PVT/libs/rinex_printer.h index 69ffe24e5..d5b8f5835 100644 --- a/src/algorithms/PVT/libs/rinex_printer.h +++ b/src/algorithms/PVT/libs/rinex_printer.h @@ -85,122 +85,122 @@ public: */ ~Rinex_Printer(); - std::fstream obsFile ; // & eph_map); + void log_rinex_nav(std::fstream& out, const std::map& eph_map); /*! * \brief Writes data from the GPS L2 navigation message into the RINEX file */ - void log_rinex_nav(std::fstream & out, const std::map & eph_map); + void log_rinex_nav(std::fstream& out, const std::map& eph_map); /*! * \brief Writes data from the Galileo navigation message into the RINEX file */ - void log_rinex_nav(std::fstream & out, const std::map & eph_map); + void log_rinex_nav(std::fstream& out, const std::map& eph_map); /*! * \brief Writes data from the Mixed (GPS/Galileo) navigation message into the RINEX file */ - void log_rinex_nav(std::fstream & out, const std::map & gps_eph_map, const std::map & galileo_eph_map); + void log_rinex_nav(std::fstream& out, const std::map& gps_eph_map, const std::map& galileo_eph_map); /*! * \brief Writes data from the GLONASS GNAV navigation message into the RINEX file */ - void log_rinex_nav(std::fstream & out, const std::map & eph_map); + void log_rinex_nav(std::fstream& out, const std::map& eph_map); /*! * \brief Writes data from the Mixed (GPS/GLONASS GNAV) navigation message into the RINEX file */ - void log_rinex_nav(std::fstream & out, const std::map & gps_eph_map, const std::map & glonass_gnav_eph_map); + void log_rinex_nav(std::fstream& out, const std::map& gps_eph_map, const std::map& glonass_gnav_eph_map); /*! * \brief Writes data from the Mixed (GPS/GLONASS GNAV) navigation message into the RINEX file */ - void log_rinex_nav(std::fstream & out, const std::map & gps_cnav_eph_map, const std::map & glonass_gnav_eph_map); + void log_rinex_nav(std::fstream& out, const std::map& gps_cnav_eph_map, const std::map& glonass_gnav_eph_map); /*! * \brief Writes data from the Mixed (Galileo/ GLONASS GNAV) navigation message into the RINEX file */ - void log_rinex_nav(std::fstream & out, const std::map & galileo_eph_map, const std::map & glonass_gnav_eph_map); + void log_rinex_nav(std::fstream& out, const std::map& galileo_eph_map, const std::map& glonass_gnav_eph_map); /*! * \brief Writes GPS L1 observables into the RINEX file */ - void log_rinex_obs(std::fstream & out, const Gps_Ephemeris & eph, double obs_time, const std::map & observables); + void log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, double obs_time, const std::map& observables); /*! * \brief Writes GPS L2 observables into the RINEX file */ - void log_rinex_obs(std::fstream & out, const Gps_CNAV_Ephemeris & eph, double obs_time, const std::map & observables); + void log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& eph, double obs_time, const std::map& observables); /*! * \brief Writes dual frequency GPS L1 and L2 observables into the RINEX file */ - void log_rinex_obs(std::fstream & out, const Gps_Ephemeris & eph, const Gps_CNAV_Ephemeris & eph_cnav, double obs_time, const std::map & observables); + void log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, const Gps_CNAV_Ephemeris& eph_cnav, double obs_time, const std::map& observables); /*! * \brief Writes Galileo observables into the RINEX file. Example: galileo_bands("1B"), galileo_bands("1B 5X"), galileo_bands("5X"), ... Default: "1B". */ - void log_rinex_obs(std::fstream & out, const Galileo_Ephemeris & eph, double obs_time, const std::map & observables, const std::string galileo_bands = "1B"); + void log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& eph, double obs_time, const std::map& observables, const std::string galileo_bands = "1B"); /*! * \brief Writes Mixed GPS / Galileo observables into the RINEX file */ - void log_rinex_obs(std::fstream & out, const Gps_Ephemeris & gps_eph, const Galileo_Ephemeris & galileo_eph, const double gps_obs_time, const std::map & observables); + void log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_eph, const Galileo_Ephemeris& galileo_eph, const double gps_obs_time, const std::map& observables); /*! * \brief Writes GLONASS GNAV observables into the RINEX file. Example: glonass_bands("1C"), galileo_bands("1B 5X"), galileo_bands("5X"), ... Default: "1B". */ - void log_rinex_obs(std::fstream & out, const Glonass_Gnav_Ephemeris & eph, double obs_time, const std::map & observables, const std::string glonass_bands = "1C"); + void log_rinex_obs(std::fstream& out, const Glonass_Gnav_Ephemeris& eph, double obs_time, const std::map& observables, const std::string glonass_bands = "1C"); /*! * \brief Writes Mixed GPS L1 C/A - GLONASS observables into the RINEX file */ - void log_rinex_obs(std::fstream & out, const Gps_Ephemeris & gps_eph, const Glonass_Gnav_Ephemeris & glonass_gnav_eph, const double gps_obs_time, const std::map & observables); + void log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, const double gps_obs_time, const std::map& observables); /*! * \brief Writes Mixed GPS L2C - GLONASS observables into the RINEX file */ - void log_rinex_obs(std::fstream & out, const Gps_CNAV_Ephemeris & gps_cnav_eph, const Glonass_Gnav_Ephemeris & glonass_gnav_eph, const double gps_obs_time, const std::map & observables); + void log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& gps_cnav_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, const double gps_obs_time, const std::map& observables); /*! * \brief Writes Mixed Galileo/GLONASS observables into the RINEX file */ - void log_rinex_obs(std::fstream & out, const Galileo_Ephemeris & galileo_eph, const Glonass_Gnav_Ephemeris & glonass_gnav_eph, const double gps_obs_time, const std::map & observables); + void log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& galileo_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, const double gps_obs_time, const std::map& observables); /*! * \brief Represents GPS time in the date time format. Leap years are considered, but leap seconds are not. */ - void to_date_time(int gps_week, int gps_tow, int & year, int & month, int & day, int & hour, int & minute, int & second); + void to_date_time(int gps_week, int gps_tow, int& year, int& month, int& day, int& hour, int& minute, int& second); /*! * \brief Writes raw SBAS messages into the RINEX file */ //void log_rinex_sbs(std::fstream & out, const Sbas_Raw_Msg & sbs_message); - void update_nav_header(std::fstream & out, const Gps_Utc_Model & gps_utc, const Gps_Iono & gps_iono); + void update_nav_header(std::fstream& out, const Gps_Utc_Model& gps_utc, const Gps_Iono& gps_iono); - void update_nav_header(std::fstream & out, const Gps_CNAV_Utc_Model & utc_model, const Gps_CNAV_Iono & iono); + void update_nav_header(std::fstream& out, const Gps_CNAV_Utc_Model& utc_model, const Gps_CNAV_Iono& iono); - void update_nav_header(std::fstream & out, const Gps_Iono & gps_iono, const Gps_Utc_Model & gps_utc_model, const Galileo_Iono & galileo_iono, const Galileo_Utc_Model & galileo_utc_model, const Galileo_Almanac& galileo_almanac); + void update_nav_header(std::fstream& out, const Gps_Iono& gps_iono, const Gps_Utc_Model& gps_utc_model, const Galileo_Iono& galileo_iono, const Galileo_Utc_Model& galileo_utc_model, const Galileo_Almanac& galileo_almanac); - void update_nav_header(std::fstream & out, const Galileo_Iono & galileo_iono, const Galileo_Utc_Model & utc_model, const Galileo_Almanac & galileo_almanac); + void update_nav_header(std::fstream& out, const Galileo_Iono& galileo_iono, const Galileo_Utc_Model& utc_model, const Galileo_Almanac& galileo_almanac); - void update_nav_header(std::fstream & out, const Glonass_Gnav_Utc_Model & glonass_gnav_utc_model, const Glonass_Gnav_Almanac & glonass_gnav_almanac); + void update_nav_header(std::fstream& out, const Glonass_Gnav_Utc_Model& glonass_gnav_utc_model, const Glonass_Gnav_Almanac& glonass_gnav_almanac); - void update_nav_header(std::fstream & out, const Gps_Iono & gps_iono, const Gps_Utc_Model & gps_utc, const Glonass_Gnav_Utc_Model & glonass_gnav_utc_model, const Glonass_Gnav_Almanac & glonass_gnav_almanac); + void update_nav_header(std::fstream& out, const Gps_Iono& gps_iono, const Gps_Utc_Model& gps_utc, const Glonass_Gnav_Utc_Model& glonass_gnav_utc_model, const Glonass_Gnav_Almanac& glonass_gnav_almanac); - void update_nav_header(std::fstream & out, const Gps_CNAV_Iono & gps_cnav_iono, const Gps_CNAV_Utc_Model & gps_cnav_utc, const Glonass_Gnav_Utc_Model & glonass_gnav_utc_model, const Glonass_Gnav_Almanac & glonass_gnav_almanac); + void update_nav_header(std::fstream& out, const Gps_CNAV_Iono& gps_cnav_iono, const Gps_CNAV_Utc_Model& gps_cnav_utc, const Glonass_Gnav_Utc_Model& glonass_gnav_utc_model, const Glonass_Gnav_Almanac& glonass_gnav_almanac); - void update_nav_header(std::fstream & out, const Galileo_Iono & galileo_iono, const Galileo_Utc_Model & galileo_utc_model, const Galileo_Almanac& galileo_almanac, const Glonass_Gnav_Utc_Model & glonass_gnav_utc_model, const Glonass_Gnav_Almanac & glonass_gnav_almanac); + void update_nav_header(std::fstream& out, const Galileo_Iono& galileo_iono, const Galileo_Utc_Model& galileo_utc_model, const Galileo_Almanac& galileo_almanac, const Glonass_Gnav_Utc_Model& glonass_gnav_utc_model, const Glonass_Gnav_Almanac& glonass_gnav_almanac); - void update_obs_header(std::fstream & out, const Gps_Utc_Model & utc_model); + void update_obs_header(std::fstream& out, const Gps_Utc_Model& utc_model); - void update_obs_header(std::fstream & out, const Gps_CNAV_Utc_Model & utc_model); + void update_obs_header(std::fstream& out, const Gps_CNAV_Utc_Model& utc_model); - void update_obs_header(std::fstream & out, const Galileo_Utc_Model & galileo_utc_model); + void update_obs_header(std::fstream& out, const Galileo_Utc_Model& galileo_utc_model); - void update_obs_header(std::fstream & out, const Glonass_Gnav_Utc_Model & glonass_gnav_utc_model); + void update_obs_header(std::fstream& out, const Glonass_Gnav_Utc_Model& glonass_gnav_utc_model); - std::map satelliteSystem; // observationType; // observationCode; // satelliteSystem; // observationType; // observationCode; // 0.87654E-0004 or -0.1234E00005. */ - inline std::string & sci2for(std::string & aStr, - const std::string::size_type startPos = 0, - const std::string::size_type length = std::string::npos, - const std::string::size_type expLen = 3, - const bool checkSwitch = true); + inline std::string& sci2for(std::string& aStr, + const std::string::size_type startPos = 0, + const std::string::size_type length = std::string::npos, + const std::string::size_type expLen = 3, + const bool checkSwitch = true); /* @@ -499,10 +501,10 @@ private: * that check. * @return a string containing \a d in FORTRAN notation. */ - inline std::string doub2for(const double & d, - const std::string::size_type length, - const std::string::size_type expLen, - const bool checkSwitch = true); + inline std::string doub2for(const double& d, + const std::string::size_type length, + const std::string::size_type expLen, + const bool checkSwitch = true); /* @@ -510,7 +512,7 @@ private: * @param s string containing a number. * @return double representation of string. */ - inline double asDouble(const std::string & s) + inline double asDouble(const std::string& s) { return strtod(s.c_str(), 0); } @@ -523,7 +525,7 @@ private: * @param s string containing a number. * @return long integer representation of string. */ - inline long asInt(const std::string & s) + inline long asInt(const std::string& s) { return strtol(s.c_str(), 0, 10); } @@ -536,7 +538,7 @@ private: * @return string representation of \a x. */ inline std::string asString(const double x, - const std::string::size_type precision = 17); + const std::string::size_type precision = 17); /* @@ -546,7 +548,7 @@ private: * @return string representation of \a x. */ inline std::string asString(const long double x, - const std::string::size_type precision = 21); + const std::string::size_type precision = 21); /* @@ -555,26 +557,26 @@ private: * @param x object to turn into a string. * @return string representation of \a x. */ - template inline std::string asString(const X x); + template + inline std::string asString(const X x); inline std::string asFixWidthString(const int x, const int width, char fill_digit); }; - // Implementation of inline functions (modified versions from GPSTk http://www.gpstk.org) -inline std::string & Rinex_Printer::leftJustify(std::string & s, - const std::string::size_type length, - const char pad) +inline std::string& Rinex_Printer::leftJustify(std::string& s, + const std::string::size_type length, + const char pad) { - if(length < s.length()) + if (length < s.length()) { s = s.substr(0, length); } else { - s.append(length-s.length(), pad); + s.append(length - s.length(), pad); } return s; } @@ -582,13 +584,13 @@ inline std::string & Rinex_Printer::leftJustify(std::string & s, // if the string is bigger than length, truncate it from the left. // otherwise, add pad characters to its left. -inline std::string & Rinex_Printer::rightJustify(std::string & s, - const std::string::size_type length, - const char pad) +inline std::string& Rinex_Printer::rightJustify(std::string& s, + const std::string::size_type length, + const char pad) { - if(length < s.length()) + if (length < s.length()) { - s = s.substr(s.length()-length, std::string::npos); + s = s.substr(s.length() - length, std::string::npos); } else { @@ -598,11 +600,10 @@ inline std::string & Rinex_Printer::rightJustify(std::string & s, } - -inline std::string Rinex_Printer::doub2for(const double & d, - const std::string::size_type length, - const std::string::size_type expLen, - const bool checkSwitch) +inline std::string Rinex_Printer::doub2for(const double& d, + const std::string::size_type length, + const std::string::size_type expLen, + const bool checkSwitch) { short exponentLength = expLen; @@ -617,11 +618,11 @@ inline std::string Rinex_Printer::doub2for(const double & d, } -inline std::string Rinex_Printer::doub2sci(const double & d, - const std::string::size_type length, - const std::string::size_type expLen, - const bool showSign, - const bool checkSwitch) +inline std::string Rinex_Printer::doub2sci(const double& d, + const std::string::size_type length, + const std::string::size_type expLen, + const bool showSign, + const bool checkSwitch) { std::string toReturn; short exponentLength = expLen; @@ -648,11 +649,11 @@ inline std::string Rinex_Printer::doub2sci(const double & d, } -inline std::string & Rinex_Printer::sci2for(std::string & aStr, - const std::string::size_type startPos, - const std::string::size_type length, - const std::string::size_type expLen, - const bool checkSwitch) +inline std::string& Rinex_Printer::sci2for(std::string& aStr, + const std::string::size_type startPos, + const std::string::size_type length, + const std::string::size_type expLen, + const bool checkSwitch) { std::string::size_type idx = aStr.find('.', startPos); int expAdd = 0; @@ -660,7 +661,7 @@ inline std::string & Rinex_Printer::sci2for(std::string & aStr, long iexp; //If checkSwitch is false, always redo the exponential. Otherwise, //set it to false. - bool redoexp =! checkSwitch; + bool redoexp = !checkSwitch; // Check for decimal place within specified boundaries if ((idx <= 0) || (idx >= (startPos + length - expLen - 1))) @@ -712,11 +713,11 @@ inline std::string & Rinex_Printer::sci2for(std::string & aStr, if (iexp < 0) { aStr += "-"; - iexp -= iexp*2; + iexp -= iexp * 2; } else aStr += "+"; - aStr += Rinex_Printer::rightJustify(asString(iexp),expLen,'0'); + aStr += Rinex_Printer::rightJustify(asString(iexp), expLen, '0'); } // if the number is positive, append a space @@ -736,11 +737,10 @@ inline std::string & Rinex_Printer::sci2for(std::string & aStr, } // end sci2for - inline std::string asString(const long double x, const std::string::size_type precision) { std::ostringstream ss; - ss << std::fixed << std::setprecision(precision) << x ; + ss << std::fixed << std::setprecision(precision) << x; return ss.str(); } @@ -761,7 +761,7 @@ inline std::string Rinex_Printer::asFixWidthString(const int x, const int width, } -inline long asInt(const std::string & s) +inline long asInt(const std::string& s) { return strtol(s.c_str(), 0, 10); } @@ -771,16 +771,17 @@ inline int Rinex_Printer::toInt(std::string bitString, int sLength) { int tempInt; int num = 0; - for(int i = 0; i < sLength; i++) - { - tempInt = bitString[i]-'0'; - num |= (1 << (sLength - 1 - i)) * tempInt; - } + for (int i = 0; i < sLength; i++) + { + tempInt = bitString[i] - '0'; + num |= (1 << (sLength - 1 - i)) * tempInt; + } return num; } -template inline std::string Rinex_Printer::asString(const X x) +template +inline std::string Rinex_Printer::asString(const X x) { std::ostringstream ss; ss << x; diff --git a/src/algorithms/PVT/libs/rtcm_printer.cc b/src/algorithms/PVT/libs/rtcm_printer.cc index 4766ad480..5dd52ae38 100644 --- a/src/algorithms/PVT/libs/rtcm_printer.cc +++ b/src/algorithms/PVT/libs/rtcm_printer.cc @@ -53,37 +53,37 @@ Rtcm_Printer::Rtcm_Printer(std::string filename, bool flag_rtcm_server, bool fla const int year = timeinfo.tm_year - 100; strm0 << year; const int month = timeinfo.tm_mon + 1; - if(month < 10) + if (month < 10) { strm0 << "0"; } strm0 << month; const int day = timeinfo.tm_mday; - if(day < 10) + if (day < 10) { strm0 << "0"; } strm0 << day << "_"; const int hour = timeinfo.tm_hour; - if(hour < 10) + if (hour < 10) { strm0 << "0"; } strm0 << hour; const int min = timeinfo.tm_min; - if(min < 10) + if (min < 10) { strm0 << "0"; } strm0 << min; const int sec = timeinfo.tm_sec; - if(sec < 10) + if (sec < 10) { strm0 << "0"; } strm0 << sec; - rtcm_filename = filename + "_" + strm0.str() + ".rtcm"; + rtcm_filename = filename + "_" + strm0.str() + ".rtcm"; } else { @@ -115,7 +115,7 @@ Rtcm_Printer::Rtcm_Printer(std::string filename, bool flag_rtcm_server, bool fla rtcm = std::make_shared(port); - if(flag_rtcm_server) + if (flag_rtcm_server) { rtcm->run_server(); } @@ -124,20 +124,20 @@ Rtcm_Printer::Rtcm_Printer(std::string filename, bool flag_rtcm_server, bool fla Rtcm_Printer::~Rtcm_Printer() { - if(rtcm->is_server_running()) + if (rtcm->is_server_running()) { try - { + { rtcm->stop_server(); - } - catch(const boost::exception & e) - { + } + catch (const boost::exception& e) + { LOG(WARNING) << "Boost exception: " << boost::diagnostic_information(e); - } - catch(const std::exception & ex) - { + } + catch (const std::exception& ex) + { LOG(WARNING) << "STD exception: " << ex.what(); - } + } } if (rtcm_file_descriptor.is_open()) { @@ -146,14 +146,14 @@ Rtcm_Printer::~Rtcm_Printer() rtcm_file_descriptor.close(); if (pos == 0) { - if(remove(rtcm_filename.c_str()) != 0) LOG(INFO) << "Error deleting temporary RTCM file"; + if (remove(rtcm_filename.c_str()) != 0) LOG(INFO) << "Error deleting temporary RTCM file"; } } close_serial(); } -bool Rtcm_Printer::Print_Rtcm_MT1001(const Gps_Ephemeris& gps_eph, double obs_time, const std::map & observables) +bool Rtcm_Printer::Print_Rtcm_MT1001(const Gps_Ephemeris& gps_eph, double obs_time, const std::map& observables) { std::string m1001 = rtcm->print_MT1001(gps_eph, obs_time, observables, station_id); Rtcm_Printer::Print_Message(m1001); @@ -161,7 +161,7 @@ bool Rtcm_Printer::Print_Rtcm_MT1001(const Gps_Ephemeris& gps_eph, double obs_ti } -bool Rtcm_Printer::Print_Rtcm_MT1002(const Gps_Ephemeris& gps_eph, double obs_time, const std::map & observables) +bool Rtcm_Printer::Print_Rtcm_MT1002(const Gps_Ephemeris& gps_eph, double obs_time, const std::map& observables) { std::string m1002 = rtcm->print_MT1002(gps_eph, obs_time, observables, station_id); Rtcm_Printer::Print_Message(m1002); @@ -169,7 +169,7 @@ bool Rtcm_Printer::Print_Rtcm_MT1002(const Gps_Ephemeris& gps_eph, double obs_ti } -bool Rtcm_Printer::Print_Rtcm_MT1003(const Gps_Ephemeris& gps_eph, const Gps_CNAV_Ephemeris& cnav_eph, double obs_time, const std::map & observables) +bool Rtcm_Printer::Print_Rtcm_MT1003(const Gps_Ephemeris& gps_eph, const Gps_CNAV_Ephemeris& cnav_eph, double obs_time, const std::map& observables) { std::string m1003 = rtcm->print_MT1003(gps_eph, cnav_eph, obs_time, observables, station_id); Rtcm_Printer::Print_Message(m1003); @@ -177,7 +177,7 @@ bool Rtcm_Printer::Print_Rtcm_MT1003(const Gps_Ephemeris& gps_eph, const Gps_CNA } -bool Rtcm_Printer::Print_Rtcm_MT1004(const Gps_Ephemeris& gps_eph, const Gps_CNAV_Ephemeris& cnav_eph, double obs_time, const std::map & observables) +bool Rtcm_Printer::Print_Rtcm_MT1004(const Gps_Ephemeris& gps_eph, const Gps_CNAV_Ephemeris& cnav_eph, double obs_time, const std::map& observables) { std::string m1003 = rtcm->print_MT1004(gps_eph, cnav_eph, obs_time, observables, station_id); Rtcm_Printer::Print_Message(m1003); @@ -185,7 +185,7 @@ bool Rtcm_Printer::Print_Rtcm_MT1004(const Gps_Ephemeris& gps_eph, const Gps_CNA } -bool Rtcm_Printer::Print_Rtcm_MT1009(const Glonass_Gnav_Ephemeris& glonass_gnav_eph, double obs_time, const std::map & observables) +bool Rtcm_Printer::Print_Rtcm_MT1009(const Glonass_Gnav_Ephemeris& glonass_gnav_eph, double obs_time, const std::map& observables) { std::string m1009 = rtcm->print_MT1009(glonass_gnav_eph, obs_time, observables, station_id); Rtcm_Printer::Print_Message(m1009); @@ -193,7 +193,7 @@ bool Rtcm_Printer::Print_Rtcm_MT1009(const Glonass_Gnav_Ephemeris& glonass_gnav_ } -bool Rtcm_Printer::Print_Rtcm_MT1010(const Glonass_Gnav_Ephemeris& glonass_gnav_eph, double obs_time, const std::map & observables) +bool Rtcm_Printer::Print_Rtcm_MT1010(const Glonass_Gnav_Ephemeris& glonass_gnav_eph, double obs_time, const std::map& observables) { std::string m1010 = rtcm->print_MT1010(glonass_gnav_eph, obs_time, observables, station_id); Rtcm_Printer::Print_Message(m1010); @@ -201,7 +201,7 @@ bool Rtcm_Printer::Print_Rtcm_MT1010(const Glonass_Gnav_Ephemeris& glonass_gnav_ } -bool Rtcm_Printer::Print_Rtcm_MT1011(const Glonass_Gnav_Ephemeris& glonass_gnav_ephL1, const Glonass_Gnav_Ephemeris& glonass_gnav_ephL2, double obs_time, const std::map & observables) +bool Rtcm_Printer::Print_Rtcm_MT1011(const Glonass_Gnav_Ephemeris& glonass_gnav_ephL1, const Glonass_Gnav_Ephemeris& glonass_gnav_ephL2, double obs_time, const std::map& observables) { std::string m1011 = rtcm->print_MT1011(glonass_gnav_ephL1, glonass_gnav_ephL2, obs_time, observables, station_id); Rtcm_Printer::Print_Message(m1011); @@ -209,7 +209,7 @@ bool Rtcm_Printer::Print_Rtcm_MT1011(const Glonass_Gnav_Ephemeris& glonass_gnav_ } -bool Rtcm_Printer::Print_Rtcm_MT1012(const Glonass_Gnav_Ephemeris& glonass_gnav_ephL1, const Glonass_Gnav_Ephemeris& glonass_gnav_ephL2, double obs_time, const std::map & observables) +bool Rtcm_Printer::Print_Rtcm_MT1012(const Glonass_Gnav_Ephemeris& glonass_gnav_ephL1, const Glonass_Gnav_Ephemeris& glonass_gnav_ephL2, double obs_time, const std::map& observables) { std::string m1012 = rtcm->print_MT1012(glonass_gnav_ephL1, glonass_gnav_ephL2, obs_time, observables, station_id); Rtcm_Printer::Print_Message(m1012); @@ -217,7 +217,7 @@ bool Rtcm_Printer::Print_Rtcm_MT1012(const Glonass_Gnav_Ephemeris& glonass_gnav_ } -bool Rtcm_Printer::Print_Rtcm_MT1019(const Gps_Ephemeris & gps_eph) +bool Rtcm_Printer::Print_Rtcm_MT1019(const Gps_Ephemeris& gps_eph) { std::string m1019 = rtcm->print_MT1019(gps_eph); Rtcm_Printer::Print_Message(m1019); @@ -225,7 +225,7 @@ bool Rtcm_Printer::Print_Rtcm_MT1019(const Gps_Ephemeris & gps_eph) } -bool Rtcm_Printer::Print_Rtcm_MT1020(const Glonass_Gnav_Ephemeris & glonass_gnav_eph, const Glonass_Gnav_Utc_Model & glonass_gnav_utc_model) +bool Rtcm_Printer::Print_Rtcm_MT1020(const Glonass_Gnav_Ephemeris& glonass_gnav_eph, const Glonass_Gnav_Utc_Model& glonass_gnav_utc_model) { std::string m1020 = rtcm->print_MT1020(glonass_gnav_eph, glonass_gnav_utc_model); Rtcm_Printer::Print_Message(m1020); @@ -233,7 +233,7 @@ bool Rtcm_Printer::Print_Rtcm_MT1020(const Glonass_Gnav_Ephemeris & glonass_gnav } -bool Rtcm_Printer::Print_Rtcm_MT1045(const Galileo_Ephemeris & gal_eph) +bool Rtcm_Printer::Print_Rtcm_MT1045(const Galileo_Ephemeris& gal_eph) { std::string m1045 = rtcm->print_MT1045(gal_eph); Rtcm_Printer::Print_Message(m1045); @@ -241,44 +241,44 @@ bool Rtcm_Printer::Print_Rtcm_MT1045(const Galileo_Ephemeris & gal_eph) } -bool Rtcm_Printer::Print_Rtcm_MSM(unsigned int msm_number, const Gps_Ephemeris & gps_eph, - const Gps_CNAV_Ephemeris & gps_cnav_eph, - const Galileo_Ephemeris & gal_eph, - const Glonass_Gnav_Ephemeris & glo_gnav_eph, - double obs_time, - const std::map & observables, - unsigned int clock_steering_indicator, - unsigned int external_clock_indicator, - int smooth_int, - bool divergence_free, - bool more_messages) +bool Rtcm_Printer::Print_Rtcm_MSM(unsigned int msm_number, const Gps_Ephemeris& gps_eph, + const Gps_CNAV_Ephemeris& gps_cnav_eph, + const Galileo_Ephemeris& gal_eph, + const Glonass_Gnav_Ephemeris& glo_gnav_eph, + double obs_time, + const std::map& observables, + unsigned int clock_steering_indicator, + unsigned int external_clock_indicator, + int smooth_int, + bool divergence_free, + bool more_messages) { std::string msm; - if(msm_number == 1) + if (msm_number == 1) { msm = rtcm->print_MSM_1(gps_eph, gps_cnav_eph, gal_eph, glo_gnav_eph, obs_time, observables, station_id, clock_steering_indicator, external_clock_indicator, smooth_int, divergence_free, more_messages); } - else if(msm_number == 2) + else if (msm_number == 2) { msm = rtcm->print_MSM_2(gps_eph, gps_cnav_eph, gal_eph, glo_gnav_eph, obs_time, observables, station_id, clock_steering_indicator, external_clock_indicator, smooth_int, divergence_free, more_messages); } - else if(msm_number == 3) + else if (msm_number == 3) { msm = rtcm->print_MSM_3(gps_eph, gps_cnav_eph, gal_eph, glo_gnav_eph, obs_time, observables, station_id, clock_steering_indicator, external_clock_indicator, smooth_int, divergence_free, more_messages); } - else if(msm_number == 4) + else if (msm_number == 4) { msm = rtcm->print_MSM_4(gps_eph, gps_cnav_eph, gal_eph, glo_gnav_eph, obs_time, observables, station_id, clock_steering_indicator, external_clock_indicator, smooth_int, divergence_free, more_messages); } - else if(msm_number == 5) + else if (msm_number == 5) { msm = rtcm->print_MSM_5(gps_eph, gps_cnav_eph, gal_eph, glo_gnav_eph, obs_time, observables, station_id, clock_steering_indicator, external_clock_indicator, smooth_int, divergence_free, more_messages); } - else if(msm_number == 6) + else if (msm_number == 6) { msm = rtcm->print_MSM_6(gps_eph, gps_cnav_eph, gal_eph, glo_gnav_eph, obs_time, observables, station_id, clock_steering_indicator, external_clock_indicator, smooth_int, divergence_free, more_messages); } - else if(msm_number == 7) + else if (msm_number == 7) { msm = rtcm->print_MSM_7(gps_eph, gps_cnav_eph, gal_eph, glo_gnav_eph, obs_time, observables, station_id, clock_steering_indicator, external_clock_indicator, smooth_int, divergence_free, more_messages); } @@ -308,10 +308,10 @@ int Rtcm_Printer::init_serial(std::string serial_device) fd = open(serial_device.c_str(), O_RDWR | O_NOCTTY | O_NDELAY); if (fd == -1) return fd; // failed to open TTY port - if(fcntl(fd, F_SETFL, 0) == -1) LOG(INFO) << "Error enabling direct I/O"; // clear all flags on descriptor, enable direct I/O - tcgetattr(fd, &options); // read serial port options + if (fcntl(fd, F_SETFL, 0) == -1) LOG(INFO) << "Error enabling direct I/O"; // clear all flags on descriptor, enable direct I/O + tcgetattr(fd, &options); // read serial port options - BAUD = B9600; + BAUD = B9600; //BAUD = B38400; DATABITS = CS8; STOPBITS = 0; @@ -338,23 +338,23 @@ void Rtcm_Printer::close_serial() } -bool Rtcm_Printer::Print_Message(const std::string & message) +bool Rtcm_Printer::Print_Message(const std::string& message) { //write to file try - { + { rtcm_file_descriptor << message << std::endl; - } - catch(const std::exception & ex) - { + } + catch (const std::exception& ex) + { DLOG(INFO) << "RTCM printer cannot write on the output file " << rtcm_filename.c_str(); return false; - } + } //write to serial device if (rtcm_dev_descriptor != -1) { - if(write(rtcm_dev_descriptor, message.c_str(), message.length()) == -1) + if (write(rtcm_dev_descriptor, message.c_str(), message.length()) == -1) { DLOG(INFO) << "RTCM printer cannot write on serial device " << rtcm_devname.c_str(); std::cout << "RTCM printer cannot write on serial device " << rtcm_devname.c_str() << std::endl; @@ -372,25 +372,25 @@ std::string Rtcm_Printer::print_MT1005_test() } -unsigned int Rtcm_Printer::lock_time(const Gps_Ephemeris& eph, double obs_time, const Gnss_Synchro & gnss_synchro) +unsigned int Rtcm_Printer::lock_time(const Gps_Ephemeris& eph, double obs_time, const Gnss_Synchro& gnss_synchro) { return rtcm->lock_time(eph, obs_time, gnss_synchro); } -unsigned int Rtcm_Printer::lock_time(const Gps_CNAV_Ephemeris& eph, double obs_time, const Gnss_Synchro & gnss_synchro) +unsigned int Rtcm_Printer::lock_time(const Gps_CNAV_Ephemeris& eph, double obs_time, const Gnss_Synchro& gnss_synchro) { return rtcm->lock_time(eph, obs_time, gnss_synchro); } -unsigned int Rtcm_Printer::lock_time(const Galileo_Ephemeris& eph, double obs_time, const Gnss_Synchro & gnss_synchro) +unsigned int Rtcm_Printer::lock_time(const Galileo_Ephemeris& eph, double obs_time, const Gnss_Synchro& gnss_synchro) { return rtcm->lock_time(eph, obs_time, gnss_synchro); } -unsigned int Rtcm_Printer::lock_time(const Glonass_Gnav_Ephemeris& eph, double obs_time, const Gnss_Synchro & gnss_synchro) +unsigned int Rtcm_Printer::lock_time(const Glonass_Gnav_Ephemeris& eph, double obs_time, const Gnss_Synchro& gnss_synchro) { return rtcm->lock_time(eph, obs_time, gnss_synchro); } diff --git a/src/algorithms/PVT/libs/rtcm_printer.h b/src/algorithms/PVT/libs/rtcm_printer.h index 8568273bf..95809a73b 100644 --- a/src/algorithms/PVT/libs/rtcm_printer.h +++ b/src/algorithms/PVT/libs/rtcm_printer.h @@ -55,10 +55,10 @@ public: */ ~Rtcm_Printer(); - bool Print_Rtcm_MT1001(const Gps_Ephemeris& gps_eph, double obs_time, const std::map & observables); - bool Print_Rtcm_MT1002(const Gps_Ephemeris& gps_eph, double obs_time, const std::map & observables); - bool Print_Rtcm_MT1003(const Gps_Ephemeris& gps_eph, const Gps_CNAV_Ephemeris& cnav_eph, double obs_time, const std::map & observables); - bool Print_Rtcm_MT1004(const Gps_Ephemeris& gps_eph, const Gps_CNAV_Ephemeris& cnav_eph, double obs_time, const std::map & observables); + bool Print_Rtcm_MT1001(const Gps_Ephemeris& gps_eph, double obs_time, const std::map& observables); + bool Print_Rtcm_MT1002(const Gps_Ephemeris& gps_eph, double obs_time, const std::map& observables); + bool Print_Rtcm_MT1003(const Gps_Ephemeris& gps_eph, const Gps_CNAV_Ephemeris& cnav_eph, double obs_time, const std::map& observables); + bool Print_Rtcm_MT1004(const Gps_Ephemeris& gps_eph, const Gps_CNAV_Ephemeris& cnav_eph, double obs_time, const std::map& observables); /*! * \brief Prints L1-Only GLONASS RTK Observables * \details This GLONASS message type is not generally used or supported; type 1012 is to be preferred. @@ -68,7 +68,7 @@ public: * \param observables Set of observables as defined by the platform * \return true or false upon operation success */ - bool Print_Rtcm_MT1009(const Glonass_Gnav_Ephemeris& glonass_gnav_eph, double obs_time, const std::map & observables); + bool Print_Rtcm_MT1009(const Glonass_Gnav_Ephemeris& glonass_gnav_eph, double obs_time, const std::map& observables); /*! * \brief Prints Extended L1-Only GLONASS RTK Observables * \details This GLONASS message type is used when only L1 data is present and bandwidth is very tight, often 1012 is used in such cases. @@ -78,7 +78,7 @@ public: * \param observables Set of observables as defined by the platform * \return true or false upon operation success */ - bool Print_Rtcm_MT1010(const Glonass_Gnav_Ephemeris& glonass_gnav_eph, double obs_time, const std::map & observables); + bool Print_Rtcm_MT1010(const Glonass_Gnav_Ephemeris& glonass_gnav_eph, double obs_time, const std::map& observables); /*! * \brief Prints L1&L2 GLONASS RTK Observables * \details This GLONASS message type is not generally used or supported; type 1012 is to be preferred @@ -89,7 +89,7 @@ public: * \param observables Set of observables as defined by the platform * \return true or false upon operation success */ - bool Print_Rtcm_MT1011(const Glonass_Gnav_Ephemeris& glonass_gnav_ephL1, const Glonass_Gnav_Ephemeris& glonass_gnav_ephL2, double obs_time, const std::map & observables); + bool Print_Rtcm_MT1011(const Glonass_Gnav_Ephemeris& glonass_gnav_ephL1, const Glonass_Gnav_Ephemeris& glonass_gnav_ephL2, double obs_time, const std::map& observables); /*! * \brief Prints Extended L1&L2 GLONASS RTK Observables * \details This GLONASS message type is the most common observational message type, with L1/L2/SNR content. This is one of the most common messages found. @@ -100,10 +100,10 @@ public: * \param observables Set of observables as defined by the platform * \return true or false upon operation success */ - bool Print_Rtcm_MT1012(const Glonass_Gnav_Ephemeris& glonass_gnav_ephL1, const Glonass_Gnav_Ephemeris& glonass_gnav_ephL2, double obs_time, const std::map & observables); + bool Print_Rtcm_MT1012(const Glonass_Gnav_Ephemeris& glonass_gnav_ephL1, const Glonass_Gnav_Ephemeris& glonass_gnav_ephL2, double obs_time, const std::map& observables); - bool Print_Rtcm_MT1019(const Gps_Ephemeris & gps_eph); // & observables, - unsigned int clock_steering_indicator, - unsigned int external_clock_indicator, - int smooth_int, - bool divergence_free, - bool more_messages); + const Gps_Ephemeris& gps_eph, + const Gps_CNAV_Ephemeris& gps_cnav_eph, + const Galileo_Ephemeris& gal_eph, + const Glonass_Gnav_Ephemeris& glo_gnav_eph, + double obs_time, + const std::map& observables, + unsigned int clock_steering_indicator, + unsigned int external_clock_indicator, + int smooth_int, + bool divergence_free, + bool more_messages); - std::string print_MT1005_test(); // rtcm; - bool Print_Message(const std::string & message); + bool Print_Message(const std::string& message); }; #endif diff --git a/src/algorithms/PVT/libs/rtklib_solver.cc b/src/algorithms/PVT/libs/rtklib_solver.cc index 2067e42f8..158e92b59 100644 --- a/src/algorithms/PVT/libs/rtklib_solver.cc +++ b/src/algorithms/PVT/libs/rtklib_solver.cc @@ -61,7 +61,7 @@ using google::LogMessage; -rtklib_solver::rtklib_solver(int nchannels, std::string dump_filename, bool flag_dump_to_file, rtk_t & rtk) +rtklib_solver::rtklib_solver(int nchannels, std::string dump_filename, bool flag_dump_to_file, rtk_t& rtk) { // init empty ephemeris for all the available GNSS channels d_nchannels = nchannels; @@ -71,7 +71,7 @@ rtklib_solver::rtklib_solver(int nchannels, std::string dump_filename, bool flag this->set_averaging_flag(false); rtk_ = rtk; - pvt_sol = {{0,0}, {0,0,0,0,0,0}, {0,0,0,0,0,0}, {0,0,0,0,0,0}, '0', '0', '0', 0, 0, 0 }; + pvt_sol = {{0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, '0', '0', '0', 0, 0, 0}; // ############# ENABLE DATA FILE LOG ################# if (d_flag_dump_enabled == true) @@ -79,15 +79,15 @@ rtklib_solver::rtklib_solver(int nchannels, std::string dump_filename, bool flag if (d_dump_file.is_open() == false) { try - { + { d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); LOG(INFO) << "PVT lib dump enabled Log file: " << d_dump_filename.c_str(); - } - catch (const std::ifstream::failure &e) - { + } + catch (const std::ifstream::failure& e) + { LOG(WARNING) << "Exception opening PVT lib dump file " << e.what(); - } + } } } } @@ -98,24 +98,24 @@ rtklib_solver::~rtklib_solver() if (d_dump_file.is_open() == true) { try - { + { d_dump_file.close(); - } - catch(const std::exception & ex) - { + } + catch (const std::exception& ex) + { LOG(WARNING) << "Exception in destructor closing the dump file " << ex.what(); - } + } } } -bool rtklib_solver::get_PVT(const std::map & gnss_observables_map, double Rx_time, bool flag_averaging) +bool rtklib_solver::get_PVT(const std::map& gnss_observables_map, double Rx_time, bool flag_averaging) { - std::map::const_iterator gnss_observables_iter; - std::map::const_iterator galileo_ephemeris_iter; - std::map::const_iterator gps_ephemeris_iter; - std::map::const_iterator gps_cnav_ephemeris_iter; - std::map::const_iterator glonass_gnav_ephemeris_iter; + std::map::const_iterator gnss_observables_iter; + std::map::const_iterator galileo_ephemeris_iter; + std::map::const_iterator gps_ephemeris_iter; + std::map::const_iterator gps_cnav_ephemeris_iter; + std::map::const_iterator glonass_gnav_ephemeris_iter; const Glonass_Gnav_Utc_Model gnav_utc = this->glonass_gnav_utc_model; this->set_averaging_flag(flag_averaging); @@ -123,283 +123,280 @@ bool rtklib_solver::get_PVT(const std::map & gnss_observables_ // ******************************************************************************** // ****** PREPARE THE DATA (SV EPHEMERIS AND OBSERVATIONS) ************************ // ******************************************************************************** - int valid_obs = 0; //valid observations counter - int glo_valid_obs = 0; //GLONASS L1/L2 valid observations counter + int valid_obs = 0; //valid observations counter + int glo_valid_obs = 0; //GLONASS L1/L2 valid observations counter obsd_t obs_data[MAXOBS]; eph_t eph_data[MAXOBS]; geph_t geph_data[MAXOBS]; - for(gnss_observables_iter = gnss_observables_map.cbegin(); - gnss_observables_iter != gnss_observables_map.cend(); - gnss_observables_iter++) + for (gnss_observables_iter = gnss_observables_map.cbegin(); + gnss_observables_iter != gnss_observables_map.cend(); + gnss_observables_iter++) { - switch(gnss_observables_iter->second.System) - { - case 'E': + switch (gnss_observables_iter->second.System) { - std::string sig_(gnss_observables_iter->second.Signal); - // Galileo E1 - if(sig_.compare("1B") == 0) - { - // 1 Gal - find the ephemeris for the current GALILEO SV observation. The SV PRN ID is the map key - galileo_ephemeris_iter = galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (galileo_ephemeris_iter != galileo_ephemeris_map.cend()) - { - //convert ephemeris from GNSS-SDR class to RTKLIB structure - eph_data[valid_obs] = eph_to_rtklib(galileo_ephemeris_iter->second); - //convert observation from GNSS-SDR class to RTKLIB structure - obsd_t newobs = {{0,0}, '0', '0', {}, {}, {}, {}, {}, {}}; - obs_data[valid_obs+glo_valid_obs] = insert_obs_to_rtklib(newobs, + case 'E': + { + std::string sig_(gnss_observables_iter->second.Signal); + // Galileo E1 + if (sig_.compare("1B") == 0) + { + // 1 Gal - find the ephemeris for the current GALILEO SV observation. The SV PRN ID is the map key + galileo_ephemeris_iter = galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); + if (galileo_ephemeris_iter != galileo_ephemeris_map.cend()) + { + //convert ephemeris from GNSS-SDR class to RTKLIB structure + eph_data[valid_obs] = eph_to_rtklib(galileo_ephemeris_iter->second); + //convert observation from GNSS-SDR class to RTKLIB structure + obsd_t newobs = {{0, 0}, '0', '0', {}, {}, {}, {}, {}, {}}; + obs_data[valid_obs + glo_valid_obs] = insert_obs_to_rtklib(newobs, gnss_observables_iter->second, galileo_ephemeris_iter->second.WN_5, 0); - valid_obs++; - } - else // the ephemeris are not available for this SV - { - DLOG(INFO) << "No ephemeris data for SV " << gnss_observables_iter->second.PRN; - } - } + valid_obs++; + } + else // the ephemeris are not available for this SV + { + DLOG(INFO) << "No ephemeris data for SV " << gnss_observables_iter->second.PRN; + } + } // Galileo E5 - if(sig_.compare("5X") == 0) + if (sig_.compare("5X") == 0) { - // 1 Gal - find the ephemeris for the current GALILEO SV observation. The SV PRN ID is the map key - galileo_ephemeris_iter = galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (galileo_ephemeris_iter != galileo_ephemeris_map.cend()) - { - bool found_E1_obs = false; - for (int i = 0; i < valid_obs; i++) - { - if (eph_data[i].sat == (static_cast(gnss_observables_iter->second.PRN + NSATGPS + NSATGLO))) - { - obs_data[i + glo_valid_obs] = insert_obs_to_rtklib(obs_data[i + glo_valid_obs], + // 1 Gal - find the ephemeris for the current GALILEO SV observation. The SV PRN ID is the map key + galileo_ephemeris_iter = galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); + if (galileo_ephemeris_iter != galileo_ephemeris_map.cend()) + { + bool found_E1_obs = false; + for (int i = 0; i < valid_obs; i++) + { + if (eph_data[i].sat == (static_cast(gnss_observables_iter->second.PRN + NSATGPS + NSATGLO))) + { + obs_data[i + glo_valid_obs] = insert_obs_to_rtklib(obs_data[i + glo_valid_obs], gnss_observables_iter->second, galileo_ephemeris_iter->second.WN_5, - 2);//Band 3 (L5/E5) - found_E1_obs = true; - break; - } - } - if (!found_E1_obs) - { - //insert Galileo E5 obs as new obs and also insert its ephemeris - //convert ephemeris from GNSS-SDR class to RTKLIB structure - eph_data[valid_obs] = eph_to_rtklib(galileo_ephemeris_iter->second); - //convert observation from GNSS-SDR class to RTKLIB structure - unsigned char default_code_ = static_cast(CODE_NONE); - obsd_t newobs = {{0,0}, '0', '0', {}, {}, - {default_code_, default_code_, default_code_}, - {}, {0.0, 0.0, 0.0}, {}}; - obs_data[valid_obs+glo_valid_obs] = insert_obs_to_rtklib(newobs, + 2); //Band 3 (L5/E5) + found_E1_obs = true; + break; + } + } + if (!found_E1_obs) + { + //insert Galileo E5 obs as new obs and also insert its ephemeris + //convert ephemeris from GNSS-SDR class to RTKLIB structure + eph_data[valid_obs] = eph_to_rtklib(galileo_ephemeris_iter->second); + //convert observation from GNSS-SDR class to RTKLIB structure + unsigned char default_code_ = static_cast(CODE_NONE); + obsd_t newobs = {{0, 0}, '0', '0', {}, {}, + {default_code_, default_code_, default_code_}, + {}, {0.0, 0.0, 0.0}, {}}; + obs_data[valid_obs + glo_valid_obs] = insert_obs_to_rtklib(newobs, gnss_observables_iter->second, galileo_ephemeris_iter->second.WN_5, - 2); //Band 3 (L5/E5) - valid_obs++; - } - } - else // the ephemeris are not available for this SV - { - DLOG(INFO) << "No ephemeris data for SV " << gnss_observables_iter->second.PRN; - } - } - break; - } - case 'G': - { - // GPS L1 - // 1 GPS - find the ephemeris for the current GPS SV observation. The SV PRN ID is the map key - std::string sig_(gnss_observables_iter->second.Signal); - if(sig_.compare("1C") == 0) - { - gps_ephemeris_iter = gps_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (gps_ephemeris_iter != gps_ephemeris_map.cend()) - { - //convert ephemeris from GNSS-SDR class to RTKLIB structure - eph_data[valid_obs] = eph_to_rtklib(gps_ephemeris_iter->second); - //convert observation from GNSS-SDR class to RTKLIB structure - obsd_t newobs = {{0,0}, '0', '0', {}, {}, {}, {}, {}, {}}; - obs_data[valid_obs+glo_valid_obs] = insert_obs_to_rtklib(newobs, + 2); //Band 3 (L5/E5) + valid_obs++; + } + } + else // the ephemeris are not available for this SV + { + DLOG(INFO) << "No ephemeris data for SV " << gnss_observables_iter->second.PRN; + } + } + break; + } + case 'G': + { + // GPS L1 + // 1 GPS - find the ephemeris for the current GPS SV observation. The SV PRN ID is the map key + std::string sig_(gnss_observables_iter->second.Signal); + if (sig_.compare("1C") == 0) + { + gps_ephemeris_iter = gps_ephemeris_map.find(gnss_observables_iter->second.PRN); + if (gps_ephemeris_iter != gps_ephemeris_map.cend()) + { + //convert ephemeris from GNSS-SDR class to RTKLIB structure + eph_data[valid_obs] = eph_to_rtklib(gps_ephemeris_iter->second); + //convert observation from GNSS-SDR class to RTKLIB structure + obsd_t newobs = {{0, 0}, '0', '0', {}, {}, {}, {}, {}, {}}; + obs_data[valid_obs + glo_valid_obs] = insert_obs_to_rtklib(newobs, gnss_observables_iter->second, gps_ephemeris_iter->second.i_GPS_week, 0); - valid_obs++; - } - else // the ephemeris are not available for this SV - { - DLOG(INFO) << "No ephemeris data for SV " << gnss_observables_iter->first; - } - } - //GPS L2 - if(sig_.compare("2S") == 0) - { - gps_cnav_ephemeris_iter = gps_cnav_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (gps_cnav_ephemeris_iter != gps_cnav_ephemeris_map.cend()) - { - // 1. Find the same satellite in GPS L1 band - gps_ephemeris_iter = gps_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (gps_ephemeris_iter != gps_ephemeris_map.cend()) - { - // 2. If found, replace the existing GPS L1 ephemeris with the GPS L2 ephemeris - // (more precise!), and attach the L2 observation to the L1 observation in RTKLIB structure - for (int i = 0; i < valid_obs; i++) - { - if (eph_data[i].sat == static_cast(gnss_observables_iter->second.PRN)) - { - eph_data[i] = eph_to_rtklib(gps_cnav_ephemeris_iter->second); - obs_data[i+glo_valid_obs] = insert_obs_to_rtklib(obs_data[i+glo_valid_obs], + valid_obs++; + } + else // the ephemeris are not available for this SV + { + DLOG(INFO) << "No ephemeris data for SV " << gnss_observables_iter->first; + } + } + //GPS L2 + if (sig_.compare("2S") == 0) + { + gps_cnav_ephemeris_iter = gps_cnav_ephemeris_map.find(gnss_observables_iter->second.PRN); + if (gps_cnav_ephemeris_iter != gps_cnav_ephemeris_map.cend()) + { + // 1. Find the same satellite in GPS L1 band + gps_ephemeris_iter = gps_ephemeris_map.find(gnss_observables_iter->second.PRN); + if (gps_ephemeris_iter != gps_ephemeris_map.cend()) + { + // 2. If found, replace the existing GPS L1 ephemeris with the GPS L2 ephemeris + // (more precise!), and attach the L2 observation to the L1 observation in RTKLIB structure + for (int i = 0; i < valid_obs; i++) + { + if (eph_data[i].sat == static_cast(gnss_observables_iter->second.PRN)) + { + eph_data[i] = eph_to_rtklib(gps_cnav_ephemeris_iter->second); + obs_data[i + glo_valid_obs] = insert_obs_to_rtklib(obs_data[i + glo_valid_obs], gnss_observables_iter->second, gps_cnav_ephemeris_iter->second.i_GPS_week, - 1);//Band 2 (L2) - break; - } - } - } - else - { - // 3. If not found, insert the GPS L2 ephemeris and the observation - //convert ephemeris from GNSS-SDR class to RTKLIB structure - eph_data[valid_obs] = eph_to_rtklib(gps_cnav_ephemeris_iter->second); - //convert observation from GNSS-SDR class to RTKLIB structure - unsigned char default_code_ = static_cast(CODE_NONE); - obsd_t newobs = {{0,0}, '0', '0', {}, {}, + 1); //Band 2 (L2) + break; + } + } + } + else + { + // 3. If not found, insert the GPS L2 ephemeris and the observation + //convert ephemeris from GNSS-SDR class to RTKLIB structure + eph_data[valid_obs] = eph_to_rtklib(gps_cnav_ephemeris_iter->second); + //convert observation from GNSS-SDR class to RTKLIB structure + unsigned char default_code_ = static_cast(CODE_NONE); + obsd_t newobs = {{0, 0}, '0', '0', {}, {}, {default_code_, default_code_, default_code_}, {}, {0.0, 0.0, 0.0}, {}}; - obs_data[valid_obs + glo_valid_obs] = insert_obs_to_rtklib(newobs, + obs_data[valid_obs + glo_valid_obs] = insert_obs_to_rtklib(newobs, gnss_observables_iter->second, gps_cnav_ephemeris_iter->second.i_GPS_week, - 1);//Band 2 (L2) - valid_obs++; - } - } - else // the ephemeris are not available for this SV - { - DLOG(INFO) << "No ephemeris data for SV " << gnss_observables_iter->second.PRN; - } - } - //GPS L5 - if(sig_.compare("L5") == 0) - { - gps_cnav_ephemeris_iter = gps_cnav_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (gps_cnav_ephemeris_iter != gps_cnav_ephemeris_map.cend()) - { - // 1. Find the same satellite in GPS L1 band - gps_ephemeris_iter = gps_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (gps_ephemeris_iter != gps_ephemeris_map.cend()) - { - // 2. If found, replace the existing GPS L1 ephemeris with the GPS L5 ephemeris - // (more precise!), and attach the L5 observation to the L1 observation in RTKLIB structure - for (int i = 0; i < valid_obs; i++) - { - if (eph_data[i].sat == static_cast(gnss_observables_iter->second.PRN)) - { - eph_data[i] = eph_to_rtklib(gps_cnav_ephemeris_iter->second); - obs_data[i+glo_valid_obs] = insert_obs_to_rtklib(obs_data[i], + 1); //Band 2 (L2) + valid_obs++; + } + } + else // the ephemeris are not available for this SV + { + DLOG(INFO) << "No ephemeris data for SV " << gnss_observables_iter->second.PRN; + } + } + //GPS L5 + if (sig_.compare("L5") == 0) + { + gps_cnav_ephemeris_iter = gps_cnav_ephemeris_map.find(gnss_observables_iter->second.PRN); + if (gps_cnav_ephemeris_iter != gps_cnav_ephemeris_map.cend()) + { + // 1. Find the same satellite in GPS L1 band + gps_ephemeris_iter = gps_ephemeris_map.find(gnss_observables_iter->second.PRN); + if (gps_ephemeris_iter != gps_ephemeris_map.cend()) + { + // 2. If found, replace the existing GPS L1 ephemeris with the GPS L5 ephemeris + // (more precise!), and attach the L5 observation to the L1 observation in RTKLIB structure + for (int i = 0; i < valid_obs; i++) + { + if (eph_data[i].sat == static_cast(gnss_observables_iter->second.PRN)) + { + eph_data[i] = eph_to_rtklib(gps_cnav_ephemeris_iter->second); + obs_data[i + glo_valid_obs] = insert_obs_to_rtklib(obs_data[i], gnss_observables_iter->second, gps_cnav_ephemeris_iter->second.i_GPS_week, - 2);//Band 3 (L5) - break; - } - } - } - else - { - // 3. If not found, insert the GPS L5 ephemeris and the observation - //convert ephemeris from GNSS-SDR class to RTKLIB structure - eph_data[valid_obs] = eph_to_rtklib(gps_cnav_ephemeris_iter->second); - //convert observation from GNSS-SDR class to RTKLIB structure - unsigned char default_code_ = static_cast(CODE_NONE); - obsd_t newobs = {{0,0}, '0', '0', {}, {}, + 2); //Band 3 (L5) + break; + } + } + } + else + { + // 3. If not found, insert the GPS L5 ephemeris and the observation + //convert ephemeris from GNSS-SDR class to RTKLIB structure + eph_data[valid_obs] = eph_to_rtklib(gps_cnav_ephemeris_iter->second); + //convert observation from GNSS-SDR class to RTKLIB structure + unsigned char default_code_ = static_cast(CODE_NONE); + obsd_t newobs = {{0, 0}, '0', '0', {}, {}, {default_code_, default_code_, default_code_}, {}, {0.0, 0.0, 0.0}, {}}; - obs_data[valid_obs+glo_valid_obs] = insert_obs_to_rtklib(newobs, + obs_data[valid_obs + glo_valid_obs] = insert_obs_to_rtklib(newobs, gnss_observables_iter->second, gps_cnav_ephemeris_iter->second.i_GPS_week, - 2);//Band 3 (L5) - valid_obs++; - } - } - else // the ephemeris are not available for this SV - { - DLOG(INFO) << "No ephemeris data for SV " << gnss_observables_iter->second.PRN; - } - } - break; - } - case 'R': //TODO This should be using rtk lib nomenclature - { - std::string sig_(gnss_observables_iter->second.Signal); - // GLONASS GNAV L1 - if(sig_.compare("1G") == 0) - { - // 1 Glo - find the ephemeris for the current GLONASS SV observation. The SV Slot Number (PRN ID) is the map key - glonass_gnav_ephemeris_iter = glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (glonass_gnav_ephemeris_iter != glonass_gnav_ephemeris_map.cend()) - { - //convert ephemeris from GNSS-SDR class to RTKLIB structure - geph_data[glo_valid_obs] = eph_to_rtklib(glonass_gnav_ephemeris_iter->second, gnav_utc); - //convert observation from GNSS-SDR class to RTKLIB structure - obsd_t newobs = {{0,0}, '0', '0', {}, {}, {}, {}, {}, {}}; - obs_data[valid_obs+glo_valid_obs] = insert_obs_to_rtklib(newobs, + 2); //Band 3 (L5) + valid_obs++; + } + } + else // the ephemeris are not available for this SV + { + DLOG(INFO) << "No ephemeris data for SV " << gnss_observables_iter->second.PRN; + } + } + break; + } + case 'R': //TODO This should be using rtk lib nomenclature + { + std::string sig_(gnss_observables_iter->second.Signal); + // GLONASS GNAV L1 + if (sig_.compare("1G") == 0) + { + // 1 Glo - find the ephemeris for the current GLONASS SV observation. The SV Slot Number (PRN ID) is the map key + glonass_gnav_ephemeris_iter = glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN); + if (glonass_gnav_ephemeris_iter != glonass_gnav_ephemeris_map.cend()) + { + //convert ephemeris from GNSS-SDR class to RTKLIB structure + geph_data[glo_valid_obs] = eph_to_rtklib(glonass_gnav_ephemeris_iter->second, gnav_utc); + //convert observation from GNSS-SDR class to RTKLIB structure + obsd_t newobs = {{0, 0}, '0', '0', {}, {}, {}, {}, {}, {}}; + obs_data[valid_obs + glo_valid_obs] = insert_obs_to_rtklib(newobs, gnss_observables_iter->second, glonass_gnav_ephemeris_iter->second.d_WN, - 0);//Band 0 (L1) - glo_valid_obs++; - } - else // the ephemeris are not available for this SV - { - DLOG(INFO) << "No ephemeris data for SV " << gnss_observables_iter->second.PRN; - } - - } - // GLONASS GNAV L2 - if(sig_.compare("2G") == 0) - { - // 1 GLONASS - find the ephemeris for the current GLONASS SV observation. The SV PRN ID is the map key - glonass_gnav_ephemeris_iter = glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (glonass_gnav_ephemeris_iter != glonass_gnav_ephemeris_map.cend()) - { - bool found_L1_obs = false; - for (int i = 0; i < glo_valid_obs; i++) - { - if (geph_data[i].sat == (static_cast(gnss_observables_iter->second.PRN+NSATGPS))) - { - obs_data[i+valid_obs] = insert_obs_to_rtklib(obs_data[i+valid_obs], + 0); //Band 0 (L1) + glo_valid_obs++; + } + else // the ephemeris are not available for this SV + { + DLOG(INFO) << "No ephemeris data for SV " << gnss_observables_iter->second.PRN; + } + } + // GLONASS GNAV L2 + if (sig_.compare("2G") == 0) + { + // 1 GLONASS - find the ephemeris for the current GLONASS SV observation. The SV PRN ID is the map key + glonass_gnav_ephemeris_iter = glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN); + if (glonass_gnav_ephemeris_iter != glonass_gnav_ephemeris_map.cend()) + { + bool found_L1_obs = false; + for (int i = 0; i < glo_valid_obs; i++) + { + if (geph_data[i].sat == (static_cast(gnss_observables_iter->second.PRN + NSATGPS))) + { + obs_data[i + valid_obs] = insert_obs_to_rtklib(obs_data[i + valid_obs], gnss_observables_iter->second, glonass_gnav_ephemeris_iter->second.d_WN, - 1);//Band 1 (L2) - found_L1_obs = true; - break; - } - } - if (!found_L1_obs) - { - //insert GLONASS GNAV L2 obs as new obs and also insert its ephemeris - //convert ephemeris from GNSS-SDR class to RTKLIB structure - geph_data[glo_valid_obs] = eph_to_rtklib(glonass_gnav_ephemeris_iter->second, gnav_utc); - //convert observation from GNSS-SDR class to RTKLIB structure - obsd_t newobs = {{0,0}, '0', '0', {}, {}, {}, {}, {}, {}}; - obs_data[valid_obs+glo_valid_obs] = insert_obs_to_rtklib(newobs, + 1); //Band 1 (L2) + found_L1_obs = true; + break; + } + } + if (!found_L1_obs) + { + //insert GLONASS GNAV L2 obs as new obs and also insert its ephemeris + //convert ephemeris from GNSS-SDR class to RTKLIB structure + geph_data[glo_valid_obs] = eph_to_rtklib(glonass_gnav_ephemeris_iter->second, gnav_utc); + //convert observation from GNSS-SDR class to RTKLIB structure + obsd_t newobs = {{0, 0}, '0', '0', {}, {}, {}, {}, {}, {}}; + obs_data[valid_obs + glo_valid_obs] = insert_obs_to_rtklib(newobs, gnss_observables_iter->second, glonass_gnav_ephemeris_iter->second.d_WN, - 1); //Band 1 (L2) - glo_valid_obs++; - } - } - else // the ephemeris are not available for this SV - { - DLOG(INFO) << "No ephemeris data for SV " << gnss_observables_iter->second.PRN; - } - - - } + 1); //Band 1 (L2) + glo_valid_obs++; + } + } + else // the ephemeris are not available for this SV + { + DLOG(INFO) << "No ephemeris data for SV " << gnss_observables_iter->second.PRN; + } + } + break; + } + default: + DLOG(INFO) << "Hybrid observables: Unknown GNSS"; break; } - default : - DLOG(INFO) << "Hybrid observables: Unknown GNSS"; - break; - } } // ********************************************************************** @@ -425,16 +422,16 @@ bool rtklib_solver::get_PVT(const std::map & gnss_observables_ result = rtkpos(&rtk_, obs_data, valid_obs + glo_valid_obs, &nav_data); - if(result == 0) + if (result == 0) { LOG(INFO) << "RTKLIB rtkpos error"; DLOG(INFO) << "RTKLIB rtkpos error message: " << rtk_.errbuf; - this->set_time_offset_s(0.0); //reset rx time estimation + this->set_time_offset_s(0.0); //reset rx time estimation this->set_num_valid_observations(0); } else { - this->set_num_valid_observations(rtk_.sol.ns); //record the number of valid satellites used by the PVT solver + this->set_num_valid_observations(rtk_.sol.ns); //record the number of valid satellites used by the PVT solver pvt_sol = rtk_.sol; this->set_valid_position(true); arma::vec rx_position_and_time(4); @@ -442,9 +439,9 @@ bool rtklib_solver::get_PVT(const std::map & gnss_observables_ rx_position_and_time(1) = pvt_sol.rr[1]; rx_position_and_time(2) = pvt_sol.rr[2]; rx_position_and_time(3) = pvt_sol.dtr[0]; - this->set_rx_pos(rx_position_and_time.rows(0, 2)); // save ECEF position for the next iteration + this->set_rx_pos(rx_position_and_time.rows(0, 2)); // save ECEF position for the next iteration double offset_s = this->get_time_offset_s(); - this->set_time_offset_s(offset_s + (rx_position_and_time(3) / GPS_C_m_s)); // accumulate the rx time error for the next iteration [meters]->[seconds] + this->set_time_offset_s(offset_s + (rx_position_and_time(3) / GPS_C_m_s)); // accumulate the rx time error for the next iteration [meters]->[seconds] DLOG(INFO) << "RTKLIB Position at TOW=" << Rx_time << " in ECEF (X,Y,Z,t[meters]) = " << rx_position_and_time; boost::posix_time::ptime p_time; @@ -456,14 +453,15 @@ bool rtklib_solver::get_PVT(const std::map & gnss_observables_ DLOG(INFO) << "RTKLIB Position at " << boost::posix_time::to_simple_string(p_time) << " is Lat = " << this->get_latitude() << " [deg], Long = " << this->get_longitude() - << " [deg], Height= " << this->get_height() << " [m]" << " RX time offset= " << this->get_time_offset_s() << " [s]"; + << " [deg], Height= " << this->get_height() << " [m]" + << " RX time offset= " << this->get_time_offset_s() << " [s]"; // ######## LOG FILE ######### - if(d_flag_dump_enabled == true) + if (d_flag_dump_enabled == true) { // MULTIPLEXED FILE RECORDING - Record results to file try - { + { double tmp_double; // PVT GPS time tmp_double = Rx_time; @@ -489,13 +487,13 @@ bool rtklib_solver::get_PVT(const std::map & gnss_observables_ // GEO user position Height [m] tmp_double = this->get_height(); d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); - } + } catch (const std::ifstream::failure& e) - { + { LOG(WARNING) << "Exception writing PVT LS dump file " << e.what(); - } + } } - } - } - return this->is_valid_position(); - } + } + } + return this->is_valid_position(); +} diff --git a/src/algorithms/PVT/libs/rtklib_solver.h b/src/algorithms/PVT/libs/rtklib_solver.h index af53b4811..3af8d2a76 100644 --- a/src/algorithms/PVT/libs/rtklib_solver.h +++ b/src/algorithms/PVT/libs/rtklib_solver.h @@ -80,15 +80,15 @@ private: bool d_flag_dump_enabled; int d_nchannels; // Number of available channels for positioning public: - rtklib_solver(int nchannels, std::string dump_filename, bool flag_dump_to_file, rtk_t & rtk); + rtklib_solver(int nchannels, std::string dump_filename, bool flag_dump_to_file, rtk_t& rtk); ~rtklib_solver(); - bool get_PVT(const std::map & gnss_observables_map, double Rx_time, bool flag_averaging); + bool get_PVT(const std::map& gnss_observables_map, double Rx_time, bool flag_averaging); - std::map galileo_ephemeris_map; //!< Map storing new Galileo_Ephemeris - std::map gps_ephemeris_map; //!< Map storing new GPS_Ephemeris - std::map gps_cnav_ephemeris_map; //!< Map storing new GPS_CNAV_Ephemeris - std::map glonass_gnav_ephemeris_map; //!< Map storing new GLONASS GNAV Ephmeris + std::map galileo_ephemeris_map; //!< Map storing new Galileo_Ephemeris + std::map gps_ephemeris_map; //!< Map storing new GPS_Ephemeris + std::map gps_cnav_ephemeris_map; //!< Map storing new GPS_CNAV_Ephemeris + std::map glonass_gnav_ephemeris_map; //!< Map storing new GLONASS GNAV Ephmeris Galileo_Utc_Model galileo_utc_model; Galileo_Iono galileo_iono; @@ -100,8 +100,8 @@ public: Gps_CNAV_Iono gps_cnav_iono; Gps_CNAV_Utc_Model gps_cnav_utc_model; - Glonass_Gnav_Utc_Model glonass_gnav_utc_model; //!< Map storing GLONASS GNAV UTC Model - Glonass_Gnav_Almanac glonass_gnav_almanac; //!< Map storing GLONASS GNAV Almanac Model + Glonass_Gnav_Utc_Model glonass_gnav_utc_model; //!< Map storing GLONASS GNAV UTC Model + Glonass_Gnav_Almanac glonass_gnav_almanac; //!< Map storing GLONASS GNAV Almanac Model int count_valid_position; }; diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_8ms_ambiguous_acquisition.cc b/src/algorithms/acquisition/adapters/galileo_e1_pcps_8ms_ambiguous_acquisition.cc index 178ccade0..dcbc716ab 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_8ms_ambiguous_acquisition.cc +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_8ms_ambiguous_acquisition.cc @@ -41,9 +41,8 @@ using google::LogMessage; GalileoE1Pcps8msAmbiguousAcquisition::GalileoE1Pcps8msAmbiguousAcquisition( - ConfigurationInterface* configuration, std::string role, - unsigned int in_streams, unsigned int out_streams) : - role_(role), in_streams_(in_streams), out_streams_(out_streams) + ConfigurationInterface* configuration, std::string role, + unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) { configuration_ = configuration; std::string default_item_type = "gr_complex"; @@ -52,14 +51,14 @@ GalileoE1Pcps8msAmbiguousAcquisition::GalileoE1Pcps8msAmbiguousAcquisition( DLOG(INFO) << "role " << role; item_type_ = configuration_->property(role + ".item_type", - default_item_type); + default_item_type); long fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 4000000); fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); if_ = configuration_->property(role + ".if", 0); dump_ = configuration_->property(role + ".dump", false); doppler_max_ = configuration_->property(role + ".doppler_max", 5000); - if (FLAGS_doppler_max != 0 ) doppler_max_ = FLAGS_doppler_max; + if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max; sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 4); if (sampled_ms_ % 4 != 0) @@ -73,13 +72,11 @@ GalileoE1Pcps8msAmbiguousAcquisition::GalileoE1Pcps8msAmbiguousAcquisition( max_dwells_ = configuration_->property(role + ".max_dwells", 1); dump_filename_ = configuration_->property(role + ".dump_filename", - default_dump_filename); + default_dump_filename); //--- Find number of samples per spreading code (4 ms) ----------------- code_length_ = round( - fs_in_ - / (Galileo_E1_CODE_CHIP_RATE_HZ - / Galileo_E1_B_CODE_LENGTH_CHIPS)); + fs_in_ / (Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS)); vector_length_ = code_length_ * static_cast(sampled_ms_ / 4); @@ -91,20 +88,20 @@ GalileoE1Pcps8msAmbiguousAcquisition::GalileoE1Pcps8msAmbiguousAcquisition( { item_size_ = sizeof(gr_complex); acquisition_cc_ = galileo_pcps_8ms_make_acquisition_cc(sampled_ms_, max_dwells_, - doppler_max_, if_, fs_in_, samples_per_ms, code_length_, - dump_, dump_filename_); + doppler_max_, if_, fs_in_, samples_per_ms, code_length_, + dump_, dump_filename_); stream_to_vector_ = gr::blocks::stream_to_vector::make(item_size_, vector_length_); DLOG(INFO) << "stream_to_vector(" - << stream_to_vector_->unique_id() << ")"; + << stream_to_vector_->unique_id() << ")"; DLOG(INFO) << "acquisition(" << acquisition_cc_->unique_id() - << ")"; + << ")"; } else { item_size_ = sizeof(gr_complex); LOG(WARNING) << item_type_ << " unknown acquisition item type"; } - + channel_ = 0; threshold_ = 0.0; doppler_step_ = 0; @@ -130,11 +127,11 @@ void GalileoE1Pcps8msAmbiguousAcquisition::set_channel(unsigned int channel) void GalileoE1Pcps8msAmbiguousAcquisition::set_threshold(float threshold) { - float pfa = configuration_->property(role_+ boost::lexical_cast(channel_) + ".pfa", 0.0); + float pfa = configuration_->property(role_ + boost::lexical_cast(channel_) + ".pfa", 0.0); - if(pfa == 0.0) pfa = configuration_->property(role_ + ".pfa", 0.0); + if (pfa == 0.0) pfa = configuration_->property(role_ + ".pfa", 0.0); - if(pfa == 0.0) + if (pfa == 0.0) { threshold_ = threshold; } @@ -174,7 +171,7 @@ void GalileoE1Pcps8msAmbiguousAcquisition::set_doppler_step(unsigned int doppler void GalileoE1Pcps8msAmbiguousAcquisition::set_gnss_synchro( - Gnss_Synchro* gnss_synchro) + Gnss_Synchro* gnss_synchro) { gnss_synchro_ = gnss_synchro; if (item_type_.compare("gr_complex") == 0) @@ -209,18 +206,17 @@ void GalileoE1Pcps8msAmbiguousAcquisition::set_local_code() if (item_type_.compare("gr_complex") == 0) { bool cboc = configuration_->property( - "Acquisition" + boost::lexical_cast(channel_) - + ".cboc", false); + "Acquisition" + boost::lexical_cast(channel_) + ".cboc", false); - std::complex * code = new std::complex[code_length_]; + std::complex* code = new std::complex[code_length_]; galileo_e1_code_gen_complex_sampled(code, gnss_synchro_->Signal, - cboc, gnss_synchro_->PRN, fs_in_, 0, false); + cboc, gnss_synchro_->PRN, fs_in_, 0, false); - for (unsigned int i = 0; i < sampled_ms_/4; i++) + for (unsigned int i = 0; i < sampled_ms_ / 4; i++) { - memcpy(&(code_[i*code_length_]), code, - sizeof(gr_complex)*code_length_); + memcpy(&(code_[i * code_length_]), code, + sizeof(gr_complex) * code_length_); } acquisition_cc_->set_local_code(code_); @@ -248,12 +244,12 @@ float GalileoE1Pcps8msAmbiguousAcquisition::calculate_threshold(float pfa) DLOG(INFO) << "Channel " << channel_ << " Pfa = " << pfa; - unsigned int ncells = vector_length_*frequency_bins; + unsigned int ncells = vector_length_ * frequency_bins; double exponent = 1 / static_cast(ncells); - double val = pow(1.0 - pfa,exponent); + double val = pow(1.0 - pfa, exponent); double lambda = double(vector_length_); - boost::math::exponential_distribution mydist (lambda); - float threshold = static_cast(quantile(mydist,val)); + boost::math::exponential_distribution mydist(lambda); + float threshold = static_cast(quantile(mydist, val)); return threshold; } @@ -287,4 +283,3 @@ gr::basic_block_sptr GalileoE1Pcps8msAmbiguousAcquisition::get_right_block() { return acquisition_cc_; } - diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_8ms_ambiguous_acquisition.h b/src/algorithms/acquisition/adapters/galileo_e1_pcps_8ms_ambiguous_acquisition.h index 90e9d3488..e49f3b2a7 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_8ms_ambiguous_acquisition.h +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_8ms_ambiguous_acquisition.h @@ -45,12 +45,12 @@ class ConfigurationInterface; * \brief Adapts a PCPS 8ms acquisition block to an * AcquisitionInterface for Galileo E1 Signals */ -class GalileoE1Pcps8msAmbiguousAcquisition: public AcquisitionInterface +class GalileoE1Pcps8msAmbiguousAcquisition : public AcquisitionInterface { public: GalileoE1Pcps8msAmbiguousAcquisition(ConfigurationInterface* configuration, - std::string role, unsigned int in_streams, - unsigned int out_streams); + std::string role, unsigned int in_streams, + unsigned int out_streams); virtual ~GalileoE1Pcps8msAmbiguousAcquisition(); @@ -142,8 +142,8 @@ private: long if_; bool dump_; std::string dump_filename_; - std::complex * code_; - Gnss_Synchro * gnss_synchro_; + std::complex* code_; + Gnss_Synchro* gnss_synchro_; std::string role_; unsigned int in_streams_; unsigned int out_streams_; diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition.cc b/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition.cc index c3ada5ef3..a16e10573 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition.cc +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition.cc @@ -42,9 +42,8 @@ using google::LogMessage; GalileoE1PcpsAmbiguousAcquisition::GalileoE1PcpsAmbiguousAcquisition( - ConfigurationInterface* configuration, std::string role, - unsigned int in_streams, unsigned int out_streams) : - role_(role), in_streams_(in_streams), out_streams_(out_streams) + ConfigurationInterface* configuration, std::string role, + unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) { configuration_ = configuration; std::string default_item_type = "gr_complex"; @@ -60,7 +59,7 @@ GalileoE1PcpsAmbiguousAcquisition::GalileoE1PcpsAmbiguousAcquisition( dump_ = configuration_->property(role + ".dump", false); blocking_ = configuration_->property(role + ".blocking", true); doppler_max_ = configuration_->property(role + ".doppler_max", 5000); - if (FLAGS_doppler_max != 0 ) doppler_max_ = FLAGS_doppler_max; + if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max; sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 4); if (sampled_ms_ % 4 != 0) @@ -72,8 +71,8 @@ GalileoE1PcpsAmbiguousAcquisition::GalileoE1PcpsAmbiguousAcquisition( } bit_transition_flag_ = configuration_->property(role + ".bit_transition_flag", false); - use_CFAR_algorithm_flag_ = configuration_->property(role + ".use_CFAR_algorithm", true); //will be false in future versions - acquire_pilot_ = configuration_->property(role + ".acquire_pilot", false); //will be true in future versions + use_CFAR_algorithm_flag_ = configuration_->property(role + ".use_CFAR_algorithm", true); //will be false in future versions + acquire_pilot_ = configuration_->property(role + ".acquire_pilot", false); //will be true in future versions max_dwells_ = configuration_->property(role + ".max_dwells", 1); @@ -84,27 +83,30 @@ GalileoE1PcpsAmbiguousAcquisition::GalileoE1PcpsAmbiguousAcquisition( int samples_per_ms = round(code_length_ / 4.0); vector_length_ = sampled_ms_ * samples_per_ms; - if( bit_transition_flag_ ) + if (bit_transition_flag_) { vector_length_ *= 2; } code_ = new gr_complex[vector_length_]; - if (item_type_.compare("cshort") == 0 ) + if (item_type_.compare("cshort") == 0) { item_size_ = sizeof(lv_16sc_t); } - else { item_size_ = sizeof(gr_complex); } + else + { + item_size_ = sizeof(gr_complex); + } acquisition_ = pcps_make_acquisition(sampled_ms_, max_dwells_, - doppler_max_, if_, fs_in_, samples_per_ms, code_length_, - bit_transition_flag_, use_CFAR_algorithm_flag_, dump_, blocking_, - dump_filename_, item_size_); + doppler_max_, if_, fs_in_, samples_per_ms, code_length_, + bit_transition_flag_, use_CFAR_algorithm_flag_, dump_, blocking_, + dump_filename_, item_size_); DLOG(INFO) << "acquisition(" << acquisition_->unique_id() << ")"; stream_to_vector_ = gr::blocks::stream_to_vector::make(item_size_, vector_length_); DLOG(INFO) << "stream_to_vector(" << stream_to_vector_->unique_id() << ")"; - + if (item_type_.compare("cbyte") == 0) { cbyte_to_float_x2_ = make_complex_byte_to_float_x2(); @@ -133,11 +135,11 @@ void GalileoE1PcpsAmbiguousAcquisition::set_channel(unsigned int channel) void GalileoE1PcpsAmbiguousAcquisition::set_threshold(float threshold) { - float pfa = configuration_->property(role_+ boost::lexical_cast(channel_) + ".pfa", 0.0); + float pfa = configuration_->property(role_ + boost::lexical_cast(channel_) + ".pfa", 0.0); - if(pfa == 0.0) pfa = configuration_->property(role_ + ".pfa", 0.0); + if (pfa == 0.0) pfa = configuration_->property(role_ + ".pfa", 0.0); - if(pfa == 0.0) + if (pfa == 0.0) { threshold_ = threshold; } @@ -192,28 +194,27 @@ void GalileoE1PcpsAmbiguousAcquisition::init() void GalileoE1PcpsAmbiguousAcquisition::set_local_code() { bool cboc = configuration_->property( - "Acquisition" + boost::lexical_cast(channel_) - + ".cboc", false); + "Acquisition" + boost::lexical_cast(channel_) + ".cboc", false); - std::complex * code = new std::complex[code_length_]; + std::complex* code = new std::complex[code_length_]; if (acquire_pilot_ == true) { //set local signal generator to Galileo E1 pilot component (1C) char pilot_signal[3] = "1C"; galileo_e1_code_gen_complex_sampled(code, pilot_signal, - cboc, gnss_synchro_->PRN, fs_in_, 0, false); + cboc, gnss_synchro_->PRN, fs_in_, 0, false); } else { galileo_e1_code_gen_complex_sampled(code, gnss_synchro_->Signal, - cboc, gnss_synchro_->PRN, fs_in_, 0, false); + cboc, gnss_synchro_->PRN, fs_in_, 0, false); } for (unsigned int i = 0; i < sampled_ms_ / 4; i++) { - memcpy(&(code_[i*code_length_]), code, sizeof(gr_complex)*code_length_); + memcpy(&(code_[i * code_length_]), code, sizeof(gr_complex) * code_length_); } acquisition_->set_local_code(code_); @@ -241,14 +242,14 @@ float GalileoE1PcpsAmbiguousAcquisition::calculate_threshold(float pfa) frequency_bins++; } - DLOG(INFO) <<"Channel "<property(role + ".if", 0); dump_ = configuration_->property(role + ".dump", false); doppler_max_ = configuration_->property(role + ".doppler_max", 5000); - if (FLAGS_doppler_max != 0 ) doppler_max_ = FLAGS_doppler_max; + if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max; sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 4); if (sampled_ms_ % 4 != 0) { sampled_ms_ = static_cast(sampled_ms_ / 4) * 4; LOG(WARNING) << "coherent_integration_time should be multiple of " - << "Galileo code length (4 ms). coherent_integration_time = " - << sampled_ms_ << " ms will be used."; + << "Galileo code length (4 ms). coherent_integration_time = " + << sampled_ms_ << " ms will be used."; } max_dwells_ = configuration_->property(role + ".max_dwells", 1); dump_filename_ = configuration_->property(role + ".dump_filename", - default_dump_filename); + default_dump_filename); //--- Find number of samples per spreading code (4 ms) ----------------- code_length_ = round( - fs_in_ - / (Galileo_E1_CODE_CHIP_RATE_HZ - / Galileo_E1_B_CODE_LENGTH_CHIPS)); + fs_in_ / (Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS)); vector_length_ = code_length_ * static_cast(sampled_ms_ / 4); int samples_per_ms = code_length_ / 4; - code_data_ = new gr_complex[vector_length_]; + code_data_ = new gr_complex[vector_length_]; code_pilot_ = new gr_complex[vector_length_]; if (item_type_.compare("gr_complex") == 0) { item_size_ = sizeof(gr_complex); acquisition_cc_ = pcps_cccwsr_make_acquisition_cc(sampled_ms_, max_dwells_, - doppler_max_, if_, fs_in_, samples_per_ms, code_length_, - dump_, dump_filename_); + doppler_max_, if_, fs_in_, samples_per_ms, code_length_, + dump_, dump_filename_); stream_to_vector_ = gr::blocks::stream_to_vector::make(item_size_, vector_length_); DLOG(INFO) << "stream_to_vector(" - << stream_to_vector_->unique_id() << ")"; + << stream_to_vector_->unique_id() << ")"; DLOG(INFO) << "acquisition(" << acquisition_cc_->unique_id() - << ")"; + << ")"; } else { @@ -147,7 +144,7 @@ void GalileoE1PcpsCccwsrAmbiguousAcquisition::set_threshold(float threshold) threshold_ = threshold; - DLOG(INFO) <<"Channel "<property( - "Acquisition" + boost::lexical_cast(channel_) - + ".cboc", false); + "Acquisition" + boost::lexical_cast(channel_) + ".cboc", false); char signal[3]; strcpy(signal, "1B"); galileo_e1_code_gen_complex_sampled(code_data_, signal, - cboc, gnss_synchro_->PRN, fs_in_, 0, false); + cboc, gnss_synchro_->PRN, fs_in_, 0, false); strcpy(signal, "1C"); galileo_e1_code_gen_complex_sampled(code_pilot_, signal, - cboc, gnss_synchro_->PRN, fs_in_, 0, false); + cboc, gnss_synchro_->PRN, fs_in_, 0, false); acquisition_cc_->set_local_code(code_data_, code_pilot_); } @@ -246,10 +242,11 @@ void GalileoE1PcpsCccwsrAmbiguousAcquisition::set_state(int state) } - float GalileoE1PcpsCccwsrAmbiguousAcquisition::calculate_threshold(float pfa) { - if(pfa){ /* Not implemented*/}; + if (pfa) + { /* Not implemented*/ + }; return 0.0; } @@ -260,7 +257,6 @@ void GalileoE1PcpsCccwsrAmbiguousAcquisition::connect(gr::top_block_sptr top_blo { top_block->connect(stream_to_vector_, 0, acquisition_cc_, 0); } - } @@ -283,4 +279,3 @@ gr::basic_block_sptr GalileoE1PcpsCccwsrAmbiguousAcquisition::get_right_block() { return acquisition_cc_; } - diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_cccwsr_ambiguous_acquisition.h b/src/algorithms/acquisition/adapters/galileo_e1_pcps_cccwsr_ambiguous_acquisition.h index 1ae47ea54..ec0b6bd5d 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_cccwsr_ambiguous_acquisition.h +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_cccwsr_ambiguous_acquisition.h @@ -45,12 +45,12 @@ class ConfigurationInterface; * \brief Adapts a PCPS CCCWSR acquisition block to an AcquisitionInterface * for Galileo E1 Signals */ -class GalileoE1PcpsCccwsrAmbiguousAcquisition: public AcquisitionInterface +class GalileoE1PcpsCccwsrAmbiguousAcquisition : public AcquisitionInterface { public: GalileoE1PcpsCccwsrAmbiguousAcquisition(ConfigurationInterface* configuration, - std::string role, unsigned int in_streams, - unsigned int out_streams); + std::string role, unsigned int in_streams, + unsigned int out_streams); virtual ~GalileoE1PcpsCccwsrAmbiguousAcquisition(); @@ -145,9 +145,9 @@ private: long if_; bool dump_; std::string dump_filename_; - std::complex * code_data_; - std::complex * code_pilot_; - Gnss_Synchro * gnss_synchro_; + std::complex* code_data_; + std::complex* code_pilot_; + Gnss_Synchro* gnss_synchro_; std::string role_; unsigned int in_streams_; unsigned int out_streams_; diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_quicksync_ambiguous_acquisition.cc b/src/algorithms/acquisition/adapters/galileo_e1_pcps_quicksync_ambiguous_acquisition.cc index f42c41719..7eede9fa8 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_quicksync_ambiguous_acquisition.cc +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_quicksync_ambiguous_acquisition.cc @@ -41,9 +41,8 @@ using google::LogMessage; GalileoE1PcpsQuickSyncAmbiguousAcquisition::GalileoE1PcpsQuickSyncAmbiguousAcquisition( - ConfigurationInterface* configuration, std::string role, - unsigned int in_streams, unsigned int out_streams) : - role_(role), in_streams_(in_streams), out_streams_(out_streams) + ConfigurationInterface* configuration, std::string role, + unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) { configuration_ = configuration; std::string default_item_type = "gr_complex"; @@ -52,21 +51,19 @@ GalileoE1PcpsQuickSyncAmbiguousAcquisition::GalileoE1PcpsQuickSyncAmbiguousAcqui DLOG(INFO) << "role " << role; item_type_ = configuration_->property(role + ".item_type", - default_item_type); + default_item_type); long fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 4000000); fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); if_ = configuration_->property(role + ".if", 0); dump_ = configuration_->property(role + ".dump", false); doppler_max_ = configuration_->property(role + ".doppler_max", 5000); - if (FLAGS_doppler_max != 0 ) doppler_max_ = FLAGS_doppler_max; + if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max; sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 8); /*--- Find number of samples per spreading code (4 ms) -----------------*/ code_length_ = round( - fs_in_ - / (Galileo_E1_CODE_CHIP_RATE_HZ - / Galileo_E1_B_CODE_LENGTH_CHIPS)); + fs_in_ / (Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS)); int samples_per_ms = round(code_length_ / 4.0); @@ -79,24 +76,23 @@ GalileoE1PcpsQuickSyncAmbiguousAcquisition::GalileoE1PcpsQuickSyncAmbiguousAcqui //folding_factor_ = static_cast(ceil(sqrt(log2(code_length_)))); folding_factor_ = configuration_->property(role + ".folding_factor", 2); - if (sampled_ms_ % (folding_factor_*4) != 0) + if (sampled_ms_ % (folding_factor_ * 4) != 0) { LOG(WARNING) << "QuickSync Algorithm requires a coherent_integration_time" - << " multiple of "<<(folding_factor_*4)<<"ms, Value entered " - <(folding_factor_ * 4); } else { - sampled_ms_ = static_cast(sampled_ms_/(folding_factor_*4)) * (folding_factor_*4); + sampled_ms_ = static_cast(sampled_ms_ / (folding_factor_ * 4)) * (folding_factor_ * 4); } LOG(WARNING) << "coherent_integration_time should be multiple of " - << "Galileo code length (4 ms). coherent_integration_time = " - << sampled_ms_ << " ms will be used."; - + << "Galileo code length (4 ms). coherent_integration_time = " + << sampled_ms_ << " ms will be used."; } // vector_length_ = (sampled_ms_/folding_factor_) * code_length_; vector_length_ = sampled_ms_ * samples_per_ms; @@ -112,27 +108,27 @@ GalileoE1PcpsQuickSyncAmbiguousAcquisition::GalileoE1PcpsQuickSyncAmbiguousAcqui } dump_filename_ = configuration_->property(role + ".dump_filename", - default_dump_filename); + default_dump_filename); code_ = new gr_complex[code_length_]; LOG(INFO) << "Vector Length: " << vector_length_ - << ", Samples per ms: " << samples_per_ms - << ", Folding factor: " << folding_factor_ - << ", Sampled ms: " << sampled_ms_ - << ", Code Length: " << code_length_; + << ", Samples per ms: " << samples_per_ms + << ", Folding factor: " << folding_factor_ + << ", Sampled ms: " << sampled_ms_ + << ", Code Length: " << code_length_; if (item_type_.compare("gr_complex") == 0) { item_size_ = sizeof(gr_complex); acquisition_cc_ = pcps_quicksync_make_acquisition_cc(folding_factor_, - sampled_ms_, max_dwells_, doppler_max_, if_, fs_in_, - samples_per_ms, code_length_, bit_transition_flag_, - dump_, dump_filename_); + sampled_ms_, max_dwells_, doppler_max_, if_, fs_in_, + samples_per_ms, code_length_, bit_transition_flag_, + dump_, dump_filename_); stream_to_vector_ = gr::blocks::stream_to_vector::make(item_size_, - vector_length_); + vector_length_); DLOG(INFO) << "stream_to_vector_quicksync(" - << stream_to_vector_->unique_id() << ")"; + << stream_to_vector_->unique_id() << ")"; DLOG(INFO) << "acquisition_quicksync(" << acquisition_cc_->unique_id() - << ")"; + << ")"; } else { @@ -153,8 +149,7 @@ GalileoE1PcpsQuickSyncAmbiguousAcquisition::~GalileoE1PcpsQuickSyncAmbiguousAcqu } -void -GalileoE1PcpsQuickSyncAmbiguousAcquisition::set_channel(unsigned int channel) +void GalileoE1PcpsQuickSyncAmbiguousAcquisition::set_channel(unsigned int channel) { channel_ = channel; if (item_type_.compare("gr_complex") == 0) @@ -164,15 +159,13 @@ GalileoE1PcpsQuickSyncAmbiguousAcquisition::set_channel(unsigned int channel) } -void -GalileoE1PcpsQuickSyncAmbiguousAcquisition::set_threshold(float threshold) +void GalileoE1PcpsQuickSyncAmbiguousAcquisition::set_threshold(float threshold) { + float pfa = configuration_->property(role_ + boost::lexical_cast(channel_) + ".pfa", 0.0); - float pfa = configuration_->property(role_+ boost::lexical_cast(channel_) + ".pfa", 0.0); + if (pfa == 0.0) pfa = configuration_->property(role_ + ".pfa", 0.0); - if(pfa==0.0) pfa = configuration_->property(role_+".pfa", 0.0); - - if(pfa==0.0) + if (pfa == 0.0) { threshold_ = threshold; } @@ -181,7 +174,7 @@ GalileoE1PcpsQuickSyncAmbiguousAcquisition::set_threshold(float threshold) threshold_ = calculate_threshold(pfa); } - DLOG(INFO) <<"Channel "<init(); //set_local_code(); } -void -GalileoE1PcpsQuickSyncAmbiguousAcquisition::set_local_code() +void GalileoE1PcpsQuickSyncAmbiguousAcquisition::set_local_code() { if (item_type_.compare("gr_complex") == 0) { bool cboc = configuration_->property( - "Acquisition" + boost::lexical_cast(channel_) - + ".cboc", false); + "Acquisition" + boost::lexical_cast(channel_) + ".cboc", false); - std::complex * code = new std::complex[code_length_]; + std::complex* code = new std::complex[code_length_]; galileo_e1_code_gen_complex_sampled(code, gnss_synchro_->Signal, - cboc, gnss_synchro_->PRN, fs_in_, 0, false); + cboc, gnss_synchro_->PRN, fs_in_, 0, false); - - for (unsigned int i = 0; i < (sampled_ms_/(folding_factor_*4)); i++) - { - memcpy(&(code_[i*code_length_]), code, - sizeof(gr_complex)*code_length_); - } - - // memcpy(code_, code,sizeof(gr_complex)*code_length_); + + for (unsigned int i = 0; i < (sampled_ms_ / (folding_factor_ * 4)); i++) + { + memcpy(&(code_[i * code_length_]), code, + sizeof(gr_complex) * code_length_); + } + + // memcpy(code_, code,sizeof(gr_complex)*code_length_); acquisition_cc_->set_local_code(code_); delete[] code; @@ -276,8 +263,7 @@ GalileoE1PcpsQuickSyncAmbiguousAcquisition::set_local_code() } -void -GalileoE1PcpsQuickSyncAmbiguousAcquisition::reset() +void GalileoE1PcpsQuickSyncAmbiguousAcquisition::reset() { if (item_type_.compare("gr_complex") == 0) { @@ -288,13 +274,12 @@ GalileoE1PcpsQuickSyncAmbiguousAcquisition::reset() void GalileoE1PcpsQuickSyncAmbiguousAcquisition::set_state(int state) { if (item_type_.compare("gr_complex") == 0) - { - acquisition_cc_->set_state(state); - } + { + acquisition_cc_->set_state(state); + } } - float GalileoE1PcpsQuickSyncAmbiguousAcquisition::calculate_threshold(float pfa) { unsigned int frequency_bins = 0; @@ -309,15 +294,14 @@ float GalileoE1PcpsQuickSyncAmbiguousAcquisition::calculate_threshold(float pfa) double exponent = 1.0 / static_cast(ncells); double val = pow(1.0 - pfa, exponent); double lambda = static_cast(code_length_) / static_cast(folding_factor_); - boost::math::exponential_distribution mydist (lambda); - float threshold = static_cast(quantile(mydist,val)); + boost::math::exponential_distribution mydist(lambda); + float threshold = static_cast(quantile(mydist, val)); return threshold; } -void -GalileoE1PcpsQuickSyncAmbiguousAcquisition::connect(gr::top_block_sptr top_block) +void GalileoE1PcpsQuickSyncAmbiguousAcquisition::connect(gr::top_block_sptr top_block) { if (item_type_.compare("gr_complex") == 0) { @@ -326,8 +310,7 @@ GalileoE1PcpsQuickSyncAmbiguousAcquisition::connect(gr::top_block_sptr top_block } -void -GalileoE1PcpsQuickSyncAmbiguousAcquisition::disconnect(gr::top_block_sptr top_block) +void GalileoE1PcpsQuickSyncAmbiguousAcquisition::disconnect(gr::top_block_sptr top_block) { if (item_type_.compare("gr_complex") == 0) { @@ -346,4 +329,3 @@ gr::basic_block_sptr GalileoE1PcpsQuickSyncAmbiguousAcquisition::get_right_block { return acquisition_cc_; } - diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_quicksync_ambiguous_acquisition.h b/src/algorithms/acquisition/adapters/galileo_e1_pcps_quicksync_ambiguous_acquisition.h index 0e64dbf96..98116a851 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_quicksync_ambiguous_acquisition.h +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_quicksync_ambiguous_acquisition.h @@ -45,12 +45,12 @@ class ConfigurationInterface; * \brief This class adapts a PCPS acquisition block to an * AcquisitionInterface for Galileo E1 Signals */ -class GalileoE1PcpsQuickSyncAmbiguousAcquisition: public AcquisitionInterface +class GalileoE1PcpsQuickSyncAmbiguousAcquisition : public AcquisitionInterface { public: GalileoE1PcpsQuickSyncAmbiguousAcquisition(ConfigurationInterface* configuration, - std::string role, unsigned int in_streams, - unsigned int out_streams); + std::string role, unsigned int in_streams, + unsigned int out_streams); virtual ~GalileoE1PcpsQuickSyncAmbiguousAcquisition(); @@ -149,8 +149,8 @@ private: long if_; bool dump_; std::string dump_filename_; - std::complex * code_; - Gnss_Synchro * gnss_synchro_; + std::complex* code_; + Gnss_Synchro* gnss_synchro_; std::string role_; unsigned int in_streams_; unsigned int out_streams_; diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_tong_ambiguous_acquisition.cc b/src/algorithms/acquisition/adapters/galileo_e1_pcps_tong_ambiguous_acquisition.cc index 18d5dc1ff..677a04fc9 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_tong_ambiguous_acquisition.cc +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_tong_ambiguous_acquisition.cc @@ -41,9 +41,8 @@ using google::LogMessage; GalileoE1PcpsTongAmbiguousAcquisition::GalileoE1PcpsTongAmbiguousAcquisition( - ConfigurationInterface* configuration, std::string role, - unsigned int in_streams, unsigned int out_streams) : - role_(role), in_streams_(in_streams), out_streams_(out_streams) + ConfigurationInterface* configuration, std::string role, + unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) { configuration_ = configuration; std::string default_item_type = "gr_complex"; @@ -52,22 +51,22 @@ GalileoE1PcpsTongAmbiguousAcquisition::GalileoE1PcpsTongAmbiguousAcquisition( DLOG(INFO) << "role " << role; item_type_ = configuration_->property(role + ".item_type", - default_item_type); + default_item_type); long fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 4000000); fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); if_ = configuration_->property(role + ".if", 0); dump_ = configuration_->property(role + ".dump", false); doppler_max_ = configuration_->property(role + ".doppler_max", 5000); - if (FLAGS_doppler_max != 0 ) doppler_max_ = FLAGS_doppler_max; + if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max; sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 4); if (sampled_ms_ % 4 != 0) { sampled_ms_ = static_cast(sampled_ms_ / 4) * 4; LOG(WARNING) << "coherent_integration_time should be multiple of " - << "Galileo code length (4 ms). coherent_integration_time = " - << sampled_ms_ << " ms will be used."; + << "Galileo code length (4 ms). coherent_integration_time = " + << sampled_ms_ << " ms will be used."; } tong_init_val_ = configuration->property(role + ".tong_init_val", 1); @@ -75,14 +74,12 @@ GalileoE1PcpsTongAmbiguousAcquisition::GalileoE1PcpsTongAmbiguousAcquisition( tong_max_dwells_ = configuration->property(role + ".tong_max_dwells", tong_max_val_ + 1); dump_filename_ = configuration_->property(role + ".dump_filename", - default_dump_filename); + default_dump_filename); //--- Find number of samples per spreading code (4 ms) ----------------- code_length_ = round( - fs_in_ - / (Galileo_E1_CODE_CHIP_RATE_HZ - / Galileo_E1_B_CODE_LENGTH_CHIPS)); + fs_in_ / (Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS)); vector_length_ = code_length_ * static_cast(sampled_ms_ / 4); @@ -94,14 +91,14 @@ GalileoE1PcpsTongAmbiguousAcquisition::GalileoE1PcpsTongAmbiguousAcquisition( { item_size_ = sizeof(gr_complex); acquisition_cc_ = pcps_tong_make_acquisition_cc(sampled_ms_, doppler_max_, - if_, fs_in_, samples_per_ms, code_length_, tong_init_val_, - tong_max_val_, tong_max_dwells_, dump_, dump_filename_); + if_, fs_in_, samples_per_ms, code_length_, tong_init_val_, + tong_max_val_, tong_max_dwells_, dump_, dump_filename_); stream_to_vector_ = gr::blocks::stream_to_vector::make(item_size_, vector_length_); DLOG(INFO) << "stream_to_vector(" - << stream_to_vector_->unique_id() << ")"; + << stream_to_vector_->unique_id() << ")"; DLOG(INFO) << "acquisition(" << acquisition_cc_->unique_id() - << ")"; + << ")"; } else { @@ -134,12 +131,11 @@ void GalileoE1PcpsTongAmbiguousAcquisition::set_channel(unsigned int channel) void GalileoE1PcpsTongAmbiguousAcquisition::set_threshold(float threshold) { + float pfa = configuration_->property(role_ + boost::lexical_cast(channel_) + ".pfa", 0.0); - float pfa = configuration_->property(role_+ boost::lexical_cast(channel_) + ".pfa", 0.0); + if (pfa == 0.0) pfa = configuration_->property(role_ + ".pfa", 0.0); - if(pfa == 0.0) pfa = configuration_->property(role_+".pfa", 0.0); - - if(pfa == 0.0) + if (pfa == 0.0) { threshold_ = threshold; } @@ -148,7 +144,7 @@ void GalileoE1PcpsTongAmbiguousAcquisition::set_threshold(float threshold) threshold_ = calculate_threshold(pfa); } - DLOG(INFO) <<"Channel "<set_doppler_step(doppler_step_); } - } void GalileoE1PcpsTongAmbiguousAcquisition::set_gnss_synchro( - Gnss_Synchro* gnss_synchro) + Gnss_Synchro* gnss_synchro) { gnss_synchro_ = gnss_synchro; if (item_type_.compare("gr_complex") == 0) @@ -215,18 +210,17 @@ void GalileoE1PcpsTongAmbiguousAcquisition::set_local_code() if (item_type_.compare("gr_complex") == 0) { bool cboc = configuration_->property( - "Acquisition" + boost::lexical_cast(channel_) - + ".cboc", false); + "Acquisition" + boost::lexical_cast(channel_) + ".cboc", false); - std::complex * code = new std::complex[code_length_]; + std::complex* code = new std::complex[code_length_]; galileo_e1_code_gen_complex_sampled(code, gnss_synchro_->Signal, - cboc, gnss_synchro_->PRN, fs_in_, 0, false); + cboc, gnss_synchro_->PRN, fs_in_, 0, false); - for (unsigned int i = 0; i < sampled_ms_/4; i++) + for (unsigned int i = 0; i < sampled_ms_ / 4; i++) { - memcpy(&(code_[i*code_length_]), code, - sizeof(gr_complex)*code_length_); + memcpy(&(code_[i * code_length_]), code, + sizeof(gr_complex) * code_length_); } acquisition_cc_->set_local_code(code_); @@ -262,10 +256,10 @@ float GalileoE1PcpsTongAmbiguousAcquisition::calculate_threshold(float pfa) unsigned int ncells = vector_length_ * frequency_bins; double exponent = 1 / static_cast(ncells); - double val = pow(1.0-pfa,exponent); + double val = pow(1.0 - pfa, exponent); double lambda = double(vector_length_); - boost::math::exponential_distribution mydist (lambda); - float threshold = static_cast(quantile(mydist,val)); + boost::math::exponential_distribution mydist(lambda); + float threshold = static_cast(quantile(mydist, val)); return threshold; } @@ -299,4 +293,3 @@ gr::basic_block_sptr GalileoE1PcpsTongAmbiguousAcquisition::get_right_block() { return acquisition_cc_; } - diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_tong_ambiguous_acquisition.h b/src/algorithms/acquisition/adapters/galileo_e1_pcps_tong_ambiguous_acquisition.h index 78f033572..c4ebebd17 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_tong_ambiguous_acquisition.h +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_tong_ambiguous_acquisition.h @@ -45,12 +45,12 @@ class ConfigurationInterface; * \brief Adapts a PCPS Tong acquisition block to an AcquisitionInterface * for Galileo E1 Signals */ -class GalileoE1PcpsTongAmbiguousAcquisition: public AcquisitionInterface +class GalileoE1PcpsTongAmbiguousAcquisition : public AcquisitionInterface { public: GalileoE1PcpsTongAmbiguousAcquisition(ConfigurationInterface* configuration, - std::string role, unsigned int in_streams, - unsigned int out_streams); + std::string role, unsigned int in_streams, + unsigned int out_streams); virtual ~GalileoE1PcpsTongAmbiguousAcquisition(); @@ -149,8 +149,8 @@ private: long if_; bool dump_; std::string dump_filename_; - std::complex * code_; - Gnss_Synchro * gnss_synchro_; + std::complex* code_; + Gnss_Synchro* gnss_synchro_; std::string role_; unsigned int in_streams_; unsigned int out_streams_; diff --git a/src/algorithms/acquisition/adapters/galileo_e5a_noncoherent_iq_acquisition_caf.cc b/src/algorithms/acquisition/adapters/galileo_e5a_noncoherent_iq_acquisition_caf.cc index 1046a1d22..5b11f8e76 100644 --- a/src/algorithms/acquisition/adapters/galileo_e5a_noncoherent_iq_acquisition_caf.cc +++ b/src/algorithms/acquisition/adapters/galileo_e5a_noncoherent_iq_acquisition_caf.cc @@ -47,9 +47,8 @@ using google::LogMessage; GalileoE5aNoncoherentIQAcquisitionCaf::GalileoE5aNoncoherentIQAcquisitionCaf( - ConfigurationInterface* configuration, std::string role, - unsigned int in_streams, unsigned int out_streams) : - role_(role), in_streams_(in_streams), out_streams_(out_streams) + ConfigurationInterface* configuration, std::string role, + unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) { configuration_ = configuration; std::string default_item_type = "gr_complex"; @@ -64,9 +63,9 @@ GalileoE5aNoncoherentIQAcquisitionCaf::GalileoE5aNoncoherentIQAcquisitionCaf( if_ = configuration_->property(role + ".if", 0); dump_ = configuration_->property(role + ".dump", false); doppler_max_ = configuration_->property(role + ".doppler_max", 5000); - if (FLAGS_doppler_max != 0 ) doppler_max_ = FLAGS_doppler_max; - CAF_window_hz_ = configuration_->property(role + ".CAF_window_hz",0); - Zero_padding = configuration_->property(role + ".Zero_padding",0); + if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max; + CAF_window_hz_ = configuration_->property(role + ".CAF_window_hz", 0); + Zero_padding = configuration_->property(role + ".Zero_padding", 0); sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 1); if (sampled_ms_ > 3) { @@ -90,8 +89,8 @@ GalileoE5aNoncoherentIQAcquisitionCaf::GalileoE5aNoncoherentIQAcquisitionCaf( vector_length_ = code_length_ * sampled_ms_; - codeI_= new gr_complex[vector_length_]; - codeQ_= new gr_complex[vector_length_]; + codeI_ = new gr_complex[vector_length_]; + codeQ_ = new gr_complex[vector_length_]; both_signal_components = false; std::string sig_ = configuration_->property("Channel.signal", std::string("5X")); @@ -103,13 +102,13 @@ GalileoE5aNoncoherentIQAcquisitionCaf::GalileoE5aNoncoherentIQAcquisitionCaf( { item_size_ = sizeof(gr_complex); acquisition_cc_ = galileo_e5a_noncoherentIQ_make_acquisition_caf_cc(sampled_ms_, max_dwells_, - doppler_max_, if_, fs_in_, code_length_, code_length_, bit_transition_flag_, - dump_, dump_filename_, both_signal_components, CAF_window_hz_,Zero_padding); + doppler_max_, if_, fs_in_, code_length_, code_length_, bit_transition_flag_, + dump_, dump_filename_, both_signal_components, CAF_window_hz_, Zero_padding); } else { item_size_ = sizeof(gr_complex); - LOG(WARNING) << item_type_ << " unknown acquisition item type"; + LOG(WARNING) << item_type_ << " unknown acquisition item type"; } channel_ = 0; @@ -138,12 +137,11 @@ void GalileoE5aNoncoherentIQAcquisitionCaf::set_channel(unsigned int channel) void GalileoE5aNoncoherentIQAcquisitionCaf::set_threshold(float threshold) { + float pfa = configuration_->property(role_ + boost::lexical_cast(channel_) + ".pfa", 0.0); - float pfa = configuration_->property(role_+ boost::lexical_cast(channel_) + ".pfa", 0.0); + if (pfa == 0.0) pfa = configuration_->property(role_ + ".pfa", 0.0); - if(pfa == 0.0) pfa = configuration_->property(role_ + ".pfa", 0.0); - - if(pfa == 0.0) + if (pfa == 0.0) { threshold_ = threshold; } @@ -183,7 +181,7 @@ void GalileoE5aNoncoherentIQAcquisitionCaf::set_doppler_step(unsigned int dopple void GalileoE5aNoncoherentIQAcquisitionCaf::set_gnss_synchro( - Gnss_Synchro* gnss_synchro) + Gnss_Synchro* gnss_synchro) { gnss_synchro_ = gnss_synchro; if (item_type_.compare("gr_complex") == 0) @@ -223,31 +221,31 @@ void GalileoE5aNoncoherentIQAcquisitionCaf::set_local_code() if (gnss_synchro_->Signal[0] == '5' && gnss_synchro_->Signal[1] == 'X') { char a[3]; - strcpy(a,"5I"); + strcpy(a, "5I"); galileo_e5_a_code_gen_complex_sampled(codeI, a, - gnss_synchro_->PRN, fs_in_, 0); + gnss_synchro_->PRN, fs_in_, 0); - strcpy(a,"5Q"); + strcpy(a, "5Q"); galileo_e5_a_code_gen_complex_sampled(codeQ, a, - gnss_synchro_->PRN, fs_in_, 0); + gnss_synchro_->PRN, fs_in_, 0); } else { galileo_e5_a_code_gen_complex_sampled(codeI, gnss_synchro_->Signal, - gnss_synchro_->PRN, fs_in_, 0); + gnss_synchro_->PRN, fs_in_, 0); } // WARNING: 3ms are coherently integrated. Secondary sequence (1,1,1) // is generated, and modulated in the 'block'. - if (Zero_padding == 0) // if no zero_padding + if (Zero_padding == 0) // if no zero_padding { for (unsigned int i = 0; i < sampled_ms_; i++) { - memcpy(&(codeI_[i*code_length_]), codeI, - sizeof(gr_complex)*code_length_); + memcpy(&(codeI_[i * code_length_]), codeI, + sizeof(gr_complex) * code_length_); if (gnss_synchro_->Signal[0] == '5' && gnss_synchro_->Signal[1] == 'X') { - memcpy(&(codeQ_[i*code_length_]), codeQ, - sizeof(gr_complex)*code_length_); + memcpy(&(codeQ_[i * code_length_]), codeQ, + sizeof(gr_complex) * code_length_); } } } @@ -255,20 +253,18 @@ void GalileoE5aNoncoherentIQAcquisitionCaf::set_local_code() { // 1ms code + 1ms zero padding memcpy(&(codeI_[0]), codeI, - sizeof(gr_complex)*code_length_); + sizeof(gr_complex) * code_length_); if (gnss_synchro_->Signal[0] == '5' && gnss_synchro_->Signal[1] == 'X') { memcpy(&(codeQ_[0]), codeQ, - sizeof(gr_complex)*code_length_); + sizeof(gr_complex) * code_length_); } } - acquisition_cc_->set_local_code(codeI_,codeQ_); + acquisition_cc_->set_local_code(codeI_, codeQ_); delete[] codeI; delete[] codeQ; - } - } @@ -294,8 +290,8 @@ float GalileoE5aNoncoherentIQAcquisitionCaf::calculate_threshold(float pfa) double exponent = 1 / static_cast(ncells); double val = pow(1.0 - pfa, exponent); double lambda = double(vector_length_); - boost::math::exponential_distribution mydist (lambda); - float threshold = static_cast(quantile(mydist,val)); + boost::math::exponential_distribution mydist(lambda); + float threshold = static_cast(quantile(mydist, val)); return threshold; } @@ -309,14 +305,18 @@ void GalileoE5aNoncoherentIQAcquisitionCaf::set_state(int state) void GalileoE5aNoncoherentIQAcquisitionCaf::connect(gr::top_block_sptr top_block) { - if(top_block) { /* top_block is not null */}; + if (top_block) + { /* top_block is not null */ + }; // Nothing to connect internally } void GalileoE5aNoncoherentIQAcquisitionCaf::disconnect(gr::top_block_sptr top_block) { - if(top_block) { /* top_block is not null */}; + if (top_block) + { /* top_block is not null */ + }; // Nothing to disconnect internally } diff --git a/src/algorithms/acquisition/adapters/galileo_e5a_noncoherent_iq_acquisition_caf.h b/src/algorithms/acquisition/adapters/galileo_e5a_noncoherent_iq_acquisition_caf.h index cfe7653d7..333fa3d0f 100644 --- a/src/algorithms/acquisition/adapters/galileo_e5a_noncoherent_iq_acquisition_caf.h +++ b/src/algorithms/acquisition/adapters/galileo_e5a_noncoherent_iq_acquisition_caf.h @@ -45,12 +45,12 @@ class ConfigurationInterface; -class GalileoE5aNoncoherentIQAcquisitionCaf: public AcquisitionInterface +class GalileoE5aNoncoherentIQAcquisitionCaf : public AcquisitionInterface { public: GalileoE5aNoncoherentIQAcquisitionCaf(ConfigurationInterface* configuration, - std::string role, unsigned int in_streams, - unsigned int out_streams); + std::string role, unsigned int in_streams, + unsigned int out_streams); virtual ~GalileoE5aNoncoherentIQAcquisitionCaf(); @@ -151,10 +151,10 @@ private: std::string dump_filename_; int Zero_padding; int CAF_window_hz_; - std::complex * codeI_; - std::complex * codeQ_; + std::complex* codeI_; + std::complex* codeQ_; bool both_signal_components; - Gnss_Synchro * gnss_synchro_; + Gnss_Synchro* gnss_synchro_; std::string role_; unsigned int in_streams_; unsigned int out_streams_; diff --git a/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition.cc b/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition.cc index 1bcb950a8..fcc614792 100644 --- a/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition.cc @@ -42,8 +42,7 @@ using google::LogMessage; GalileoE5aPcpsAcquisition::GalileoE5aPcpsAcquisition(ConfigurationInterface* configuration, - std::string role, unsigned int in_streams, unsigned int out_streams) : - role_(role), in_streams_(in_streams), out_streams_(out_streams) + std::string role, unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) { configuration_ = configuration; std::string default_item_type = "gr_complex"; @@ -57,10 +56,13 @@ GalileoE5aPcpsAcquisition::GalileoE5aPcpsAcquisition(ConfigurationInterface* con fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); acq_pilot_ = configuration_->property(role + ".acquire_pilot", false); acq_iq_ = configuration_->property(role + ".acquire_iq", false); - if(acq_iq_) { acq_pilot_ = false; } + if (acq_iq_) + { + acq_pilot_ = false; + } dump_ = configuration_->property(role + ".dump", false); doppler_max_ = configuration_->property(role + ".doppler_max", 5000); - if (FLAGS_doppler_max != 0 ) doppler_max_ = FLAGS_doppler_max; + if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max; sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 1); max_dwells_ = configuration_->property(role + ".max_dwells", 1); dump_filename_ = configuration_->property(role + ".dump_filename", default_dump_filename); @@ -74,23 +76,23 @@ GalileoE5aPcpsAcquisition::GalileoE5aPcpsAcquisition(ConfigurationInterface* con code_ = new gr_complex[vector_length_]; - if(item_type_.compare("gr_complex") == 0) + if (item_type_.compare("gr_complex") == 0) { item_size_ = sizeof(gr_complex); } - else if(item_type_.compare("cshort") == 0) + else if (item_type_.compare("cshort") == 0) { item_size_ = sizeof(lv_16sc_t); } else { item_size_ = sizeof(gr_complex); - LOG(WARNING) << item_type_ << " unknown acquisition item type"; + LOG(WARNING) << item_type_ << " unknown acquisition item type"; } acquisition_ = pcps_make_acquisition(sampled_ms_, max_dwells_, doppler_max_, 0, fs_in_, - code_length_, code_length_, bit_transition_flag_, use_CFAR_, dump_, blocking_, - dump_filename_, item_size_); + code_length_, code_length_, bit_transition_flag_, use_CFAR_, dump_, blocking_, + dump_filename_, item_size_); stream_to_vector_ = gr::blocks::stream_to_vector::make(item_size_, vector_length_); channel_ = 0; @@ -115,14 +117,22 @@ void GalileoE5aPcpsAcquisition::set_channel(unsigned int channel) void GalileoE5aPcpsAcquisition::set_threshold(float threshold) { + float pfa = configuration_->property(role_ + boost::lexical_cast(channel_) + ".pfa", 0.0); - float pfa = configuration_->property(role_+ boost::lexical_cast(channel_) + ".pfa", 0.0); + if (pfa == 0.0) + { + pfa = configuration_->property(role_ + ".pfa", 0.0); + } - if(pfa == 0.0) { pfa = configuration_->property(role_ + ".pfa", 0.0); } + if (pfa == 0.0) + { + threshold_ = threshold; + } - if(pfa == 0.0) { threshold_ = threshold; } - - else { threshold_ = calculate_threshold(pfa); } + else + { + threshold_ = calculate_threshold(pfa); + } DLOG(INFO) << "Channel " << channel_ << " Threshold = " << threshold_; @@ -168,16 +178,25 @@ void GalileoE5aPcpsAcquisition::set_local_code() gr_complex* code = new gr_complex[code_length_]; char signal_[3]; - if(acq_iq_) { strcpy(signal_, "5X"); } - else if(acq_pilot_) { strcpy(signal_, "5Q"); } - else { strcpy(signal_, "5I"); } + if (acq_iq_) + { + strcpy(signal_, "5X"); + } + else if (acq_pilot_) + { + strcpy(signal_, "5Q"); + } + else + { + strcpy(signal_, "5I"); + } galileo_e5_a_code_gen_complex_sampled(code, signal_, gnss_synchro_->PRN, fs_in_, 0); - for(unsigned int i = 0; i < sampled_ms_; i++) - { - memcpy(code_ + (i * code_length_), code, sizeof(gr_complex) * code_length_); - } + for (unsigned int i = 0; i < sampled_ms_; i++) + { + memcpy(code_ + (i * code_length_), code, sizeof(gr_complex) * code_length_); + } acquisition_->set_local_code(code_); delete[] code; @@ -202,8 +221,8 @@ float GalileoE5aPcpsAcquisition::calculate_threshold(float pfa) double exponent = 1 / static_cast(ncells); double val = pow(1.0 - pfa, exponent); double lambda = double(vector_length_); - boost::math::exponential_distribution mydist (lambda); - float threshold = static_cast(quantile(mydist,val)); + boost::math::exponential_distribution mydist(lambda); + float threshold = static_cast(quantile(mydist, val)); return threshold; } diff --git a/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition.h b/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition.h index db6023160..8423ebf7c 100644 --- a/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition.h +++ b/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition.h @@ -40,12 +40,12 @@ class ConfigurationInterface; -class GalileoE5aPcpsAcquisition: public AcquisitionInterface +class GalileoE5aPcpsAcquisition : public AcquisitionInterface { public: GalileoE5aPcpsAcquisition(ConfigurationInterface* configuration, - std::string role, unsigned int in_streams, - unsigned int out_streams); + std::string role, unsigned int in_streams, + unsigned int out_streams); virtual ~GalileoE5aPcpsAcquisition(); @@ -124,7 +124,6 @@ public: void set_state(int state); private: - float calculate_threshold(float pfa); ConfigurationInterface* configuration_; @@ -167,6 +166,5 @@ private: gr_complex* code_; Gnss_Synchro* gnss_synchro_; - }; #endif /* GALILEO_E5A_PCPS_ACQUISITION_H_ */ diff --git a/src/algorithms/acquisition/adapters/glonass_l1_ca_pcps_acquisition.cc b/src/algorithms/acquisition/adapters/glonass_l1_ca_pcps_acquisition.cc index 06dac08ee..4c96e0f81 100644 --- a/src/algorithms/acquisition/adapters/glonass_l1_ca_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/glonass_l1_ca_pcps_acquisition.cc @@ -43,9 +43,8 @@ using google::LogMessage; GlonassL1CaPcpsAcquisition::GlonassL1CaPcpsAcquisition( - ConfigurationInterface* configuration, std::string role, - unsigned int in_streams, unsigned int out_streams) : - role_(role), in_streams_(in_streams), out_streams_(out_streams) + ConfigurationInterface* configuration, std::string role, + unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) { configuration_ = configuration; std::string default_item_type = "gr_complex"; @@ -61,11 +60,11 @@ GlonassL1CaPcpsAcquisition::GlonassL1CaPcpsAcquisition( dump_ = configuration_->property(role + ".dump", false); blocking_ = configuration_->property(role + ".blocking", true); doppler_max_ = configuration_->property(role + ".doppler_max", 5000); - if (FLAGS_doppler_max != 0 ) doppler_max_ = FLAGS_doppler_max; + if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max; sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 1); bit_transition_flag_ = configuration_->property(role + ".bit_transition_flag", false); - use_CFAR_algorithm_flag_=configuration_->property(role + ".use_CFAR_algorithm", true); //will be false in future versions + use_CFAR_algorithm_flag_ = configuration_->property(role + ".use_CFAR_algorithm", true); //will be false in future versions max_dwells_ = configuration_->property(role + ".max_dwells", 1); @@ -76,14 +75,14 @@ GlonassL1CaPcpsAcquisition::GlonassL1CaPcpsAcquisition( vector_length_ = code_length_ * sampled_ms_; - if( bit_transition_flag_ ) + if (bit_transition_flag_) { vector_length_ *= 2; } code_ = new gr_complex[vector_length_]; - if (item_type_.compare("cshort") == 0 ) + if (item_type_.compare("cshort") == 0) { item_size_ = sizeof(lv_16sc_t); } @@ -92,8 +91,8 @@ GlonassL1CaPcpsAcquisition::GlonassL1CaPcpsAcquisition( item_size_ = sizeof(gr_complex); } acquisition_ = pcps_make_acquisition(sampled_ms_, max_dwells_, - doppler_max_, if_, fs_in_, code_length_, code_length_, - bit_transition_flag_, use_CFAR_algorithm_flag_, dump_, blocking_, dump_filename_, item_size_); + doppler_max_, if_, fs_in_, code_length_, code_length_, + bit_transition_flag_, use_CFAR_algorithm_flag_, dump_, blocking_, dump_filename_, item_size_); DLOG(INFO) << "acquisition(" << acquisition_->unique_id() << ")"; stream_to_vector_ = gr::blocks::stream_to_vector::make(item_size_, vector_length_); @@ -129,7 +128,7 @@ void GlonassL1CaPcpsAcquisition::set_threshold(float threshold) { float pfa = configuration_->property(role_ + ".pfa", 0.0); - if(pfa == 0.0) + if (pfa == 0.0) { threshold_ = threshold; } @@ -186,12 +185,12 @@ void GlonassL1CaPcpsAcquisition::set_local_code() { std::complex* code = new std::complex[code_length_]; - glonass_l1_ca_code_gen_complex_sampled(code,/* gnss_synchro_->PRN,*/ fs_in_, 0); + glonass_l1_ca_code_gen_complex_sampled(code, /* gnss_synchro_->PRN,*/ fs_in_, 0); for (unsigned int i = 0; i < sampled_ms_; i++) { - memcpy(&(code_[i*code_length_]), code, - sizeof(gr_complex)*code_length_); + memcpy(&(code_[i * code_length_]), code, + sizeof(gr_complex) * code_length_); } acquisition_->set_local_code(code_); @@ -222,15 +221,15 @@ float GlonassL1CaPcpsAcquisition::calculate_threshold(float pfa) } */ - frequency_bins = (2*doppler_max_ + doppler_step_)/doppler_step_; + frequency_bins = (2 * doppler_max_ + doppler_step_) / doppler_step_; DLOG(INFO) << "Channel " << channel_ << " Pfa = " << pfa; unsigned int ncells = vector_length_ * frequency_bins; double exponent = 1 / static_cast(ncells); double val = pow(1.0 - pfa, exponent); double lambda = static_cast(vector_length_); - boost::math::exponential_distribution mydist (lambda); - float threshold = static_cast(quantile(mydist,val)); + boost::math::exponential_distribution mydist(lambda); + float threshold = static_cast(quantile(mydist, val)); return threshold; } diff --git a/src/algorithms/acquisition/adapters/glonass_l1_ca_pcps_acquisition.h b/src/algorithms/acquisition/adapters/glonass_l1_ca_pcps_acquisition.h index 9251eb71d..64fb5cfd3 100644 --- a/src/algorithms/acquisition/adapters/glonass_l1_ca_pcps_acquisition.h +++ b/src/algorithms/acquisition/adapters/glonass_l1_ca_pcps_acquisition.h @@ -48,12 +48,12 @@ class ConfigurationInterface; * \brief This class adapts a PCPS acquisition block to an AcquisitionInterface * for GPS L1 C/A signals */ -class GlonassL1CaPcpsAcquisition: public AcquisitionInterface +class GlonassL1CaPcpsAcquisition : public AcquisitionInterface { public: GlonassL1CaPcpsAcquisition(ConfigurationInterface* configuration, - std::string role, unsigned int in_streams, - unsigned int out_streams); + std::string role, unsigned int in_streams, + unsigned int out_streams); virtual ~GlonassL1CaPcpsAcquisition(); @@ -155,8 +155,8 @@ private: bool dump_; bool blocking_; std::string dump_filename_; - std::complex * code_; - Gnss_Synchro * gnss_synchro_; + std::complex* code_; + Gnss_Synchro* gnss_synchro_; std::string role_; unsigned int in_streams_; unsigned int out_streams_; diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.cc b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.cc index 5010c224c..aa4ec18c6 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.cc @@ -42,13 +42,11 @@ #include - using google::LogMessage; GpsL1CaPcpsAcquisition::GpsL1CaPcpsAcquisition( - ConfigurationInterface* configuration, std::string role, - unsigned int in_streams, unsigned int out_streams) : - role_(role), in_streams_(in_streams), out_streams_(out_streams) + ConfigurationInterface* configuration, std::string role, + unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) { configuration_ = configuration; std::string default_item_type = "gr_complex"; @@ -63,11 +61,11 @@ GpsL1CaPcpsAcquisition::GpsL1CaPcpsAcquisition( dump_ = configuration_->property(role + ".dump", false); blocking_ = configuration_->property(role + ".blocking", true); doppler_max_ = configuration_->property(role + ".doppler_max", 5000); - if (FLAGS_doppler_max != 0 ) doppler_max_ = FLAGS_doppler_max; + if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max; sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 1); bit_transition_flag_ = configuration_->property(role + ".bit_transition_flag", false); - use_CFAR_algorithm_flag_=configuration_->property(role + ".use_CFAR_algorithm", true); //will be false in future versions + use_CFAR_algorithm_flag_ = configuration_->property(role + ".use_CFAR_algorithm", true); //will be false in future versions max_dwells_ = configuration_->property(role + ".max_dwells", 1); @@ -78,14 +76,14 @@ GpsL1CaPcpsAcquisition::GpsL1CaPcpsAcquisition( vector_length_ = code_length_ * sampled_ms_; - if( bit_transition_flag_ ) + if (bit_transition_flag_) { vector_length_ *= 2; } code_ = new gr_complex[vector_length_]; - if (item_type_.compare("cshort") == 0 ) + if (item_type_.compare("cshort") == 0) { item_size_ = sizeof(lv_16sc_t); } @@ -94,8 +92,8 @@ GpsL1CaPcpsAcquisition::GpsL1CaPcpsAcquisition( item_size_ = sizeof(gr_complex); } acquisition_ = pcps_make_acquisition(sampled_ms_, max_dwells_, - doppler_max_, if_, fs_in_, code_length_, code_length_, - bit_transition_flag_, use_CFAR_algorithm_flag_, dump_, blocking_, dump_filename_, item_size_); + doppler_max_, if_, fs_in_, code_length_, code_length_, + bit_transition_flag_, use_CFAR_algorithm_flag_, dump_, blocking_, dump_filename_, item_size_); DLOG(INFO) << "acquisition(" << acquisition_->unique_id() << ")"; stream_to_vector_ = gr::blocks::stream_to_vector::make(item_size_, vector_length_); @@ -131,7 +129,7 @@ void GpsL1CaPcpsAcquisition::set_threshold(float threshold) { float pfa = configuration_->property(role_ + ".pfa", 0.0); - if(pfa == 0.0) + if (pfa == 0.0) { threshold_ = threshold; } @@ -191,8 +189,8 @@ void GpsL1CaPcpsAcquisition::set_local_code() for (unsigned int i = 0; i < sampled_ms_; i++) { - memcpy(&(code_[i*code_length_]), code, - sizeof(gr_complex)*code_length_); + memcpy(&(code_[i * code_length_]), code, + sizeof(gr_complex) * code_length_); } acquisition_->set_local_code(code_); @@ -212,7 +210,6 @@ void GpsL1CaPcpsAcquisition::set_state(int state) } - float GpsL1CaPcpsAcquisition::calculate_threshold(float pfa) { //Calculate the threshold @@ -226,8 +223,8 @@ float GpsL1CaPcpsAcquisition::calculate_threshold(float pfa) double exponent = 1 / static_cast(ncells); double val = pow(1.0 - pfa, exponent); double lambda = double(vector_length_); - boost::math::exponential_distribution mydist (lambda); - float threshold = static_cast(quantile(mydist,val)); + boost::math::exponential_distribution mydist(lambda); + float threshold = static_cast(quantile(mydist, val)); return threshold; } @@ -309,4 +306,3 @@ gr::basic_block_sptr GpsL1CaPcpsAcquisition::get_right_block() { return acquisition_; } - diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.h b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.h index 104911ff1..590b228e6 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.h +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.h @@ -52,12 +52,12 @@ class ConfigurationInterface; * \brief This class adapts a PCPS acquisition block to an AcquisitionInterface * for GPS L1 C/A signals */ -class GpsL1CaPcpsAcquisition: public AcquisitionInterface +class GpsL1CaPcpsAcquisition : public AcquisitionInterface { public: GpsL1CaPcpsAcquisition(ConfigurationInterface* configuration, - std::string role, unsigned int in_streams, - unsigned int out_streams); + std::string role, unsigned int in_streams, + unsigned int out_streams); virtual ~GpsL1CaPcpsAcquisition(); @@ -159,8 +159,8 @@ private: bool dump_; bool blocking_; std::string dump_filename_; - std::complex * code_; - Gnss_Synchro * gnss_synchro_; + std::complex* code_; + Gnss_Synchro* gnss_synchro_; std::string role_; unsigned int in_streams_; unsigned int out_streams_; diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fine_doppler.cc b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fine_doppler.cc index 89c837d13..99e04f021 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fine_doppler.cc +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fine_doppler.cc @@ -42,9 +42,8 @@ using google::LogMessage; GpsL1CaPcpsAcquisitionFineDoppler::GpsL1CaPcpsAcquisitionFineDoppler( - ConfigurationInterface* configuration, std::string role, - unsigned int in_streams, unsigned int out_streams) : - role_(role), in_streams_(in_streams), out_streams_(out_streams) + ConfigurationInterface* configuration, std::string role, + unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) { std::string default_item_type = "gr_complex"; std::string default_dump_filename = "./data/acquisition.dat"; @@ -58,23 +57,22 @@ GpsL1CaPcpsAcquisitionFineDoppler::GpsL1CaPcpsAcquisitionFineDoppler( dump_ = configuration->property(role + ".dump", false); dump_filename_ = configuration->property(role + ".dump_filename", default_dump_filename); doppler_max_ = configuration->property(role + ".doppler_max", 5000); - if (FLAGS_doppler_max != 0 ) doppler_max_ = FLAGS_doppler_max; - doppler_min_ = configuration->property(role + ".doppler_min", - doppler_max_); + if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max; + doppler_min_ = configuration->property(role + ".doppler_min", -doppler_max_); sampled_ms_ = configuration->property(role + ".coherent_integration_time_ms", 1); - max_dwells_= configuration->property(role + ".max_dwells", 1); - + max_dwells_ = configuration->property(role + ".max_dwells", 1); + //--- Find number of samples per spreading code ------------------------- - vector_length_ = round(fs_in_ - / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS)); + vector_length_ = round(fs_in_ / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS)); code_ = new gr_complex[vector_length_]; if (item_type_.compare("gr_complex") == 0) { item_size_ = sizeof(gr_complex); - acquisition_cc_ = pcps_make_acquisition_fine_doppler_cc(max_dwells_,sampled_ms_, - doppler_max_, doppler_min_, if_, fs_in_, vector_length_, - dump_, dump_filename_); + acquisition_cc_ = pcps_make_acquisition_fine_doppler_cc(max_dwells_, sampled_ms_, + doppler_max_, doppler_min_, if_, fs_in_, vector_length_, + dump_, dump_filename_); } else { @@ -132,7 +130,7 @@ void GpsL1CaPcpsAcquisitionFineDoppler::set_gnss_synchro(Gnss_Synchro* gnss_sync signed int GpsL1CaPcpsAcquisitionFineDoppler::mag() { - return acquisition_cc_->mag(); + return acquisition_cc_->mag(); } @@ -158,14 +156,18 @@ void GpsL1CaPcpsAcquisitionFineDoppler::reset() void GpsL1CaPcpsAcquisitionFineDoppler::connect(boost::shared_ptr top_block) { - if(top_block) { /* top_block is not null */}; + if (top_block) + { /* top_block is not null */ + }; //nothing to disconnect, now the tracking uses gr_sync_decimator } void GpsL1CaPcpsAcquisitionFineDoppler::disconnect(boost::shared_ptr top_block) { - if(top_block) { /* top_block is not null */}; + if (top_block) + { /* top_block is not null */ + }; //nothing to disconnect, now the tracking uses gr_sync_decimator } @@ -180,4 +182,3 @@ boost::shared_ptr GpsL1CaPcpsAcquisitionFineDoppler::get_right_ { return acquisition_cc_; } - diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fine_doppler.h b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fine_doppler.h index 4d1474a10..43734e918 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fine_doppler.h +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fine_doppler.h @@ -40,19 +40,18 @@ #include "pcps_acquisition_fine_doppler_cc.h" - class ConfigurationInterface; /*! * \brief This class Adapts a PCPS acquisition block with fine Doppler estimation to an AcquisitionInterface for * GPS L1 C/A signals */ -class GpsL1CaPcpsAcquisitionFineDoppler: public AcquisitionInterface +class GpsL1CaPcpsAcquisitionFineDoppler : public AcquisitionInterface { public: GpsL1CaPcpsAcquisitionFineDoppler(ConfigurationInterface* configuration, - std::string role, unsigned int in_streams, - unsigned int out_streams); + std::string role, unsigned int in_streams, + unsigned int out_streams); virtual ~GpsL1CaPcpsAcquisitionFineDoppler(); @@ -139,8 +138,8 @@ private: long if_; bool dump_; std::string dump_filename_; - std::complex * code_; - Gnss_Synchro * gnss_synchro_; + std::complex* code_; + Gnss_Synchro* gnss_synchro_; std::string role_; unsigned int in_streams_; unsigned int out_streams_; diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.h b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.h index 3a6115e6e..2c8f9eed4 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.h +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.h @@ -53,8 +53,8 @@ class GpsL1CaPcpsAcquisitionFpga : public AcquisitionInterface { public: GpsL1CaPcpsAcquisitionFpga(ConfigurationInterface* configuration, - std::string role, unsigned int in_streams, - unsigned int out_streams); + std::string role, unsigned int in_streams, + unsigned int out_streams); virtual ~GpsL1CaPcpsAcquisitionFpga(); @@ -144,7 +144,7 @@ private: unsigned int doppler_max_; unsigned int doppler_step_; unsigned int max_dwells_; - Gnss_Synchro * gnss_synchro_; + Gnss_Synchro* gnss_synchro_; std::string role_; unsigned int in_streams_; unsigned int out_streams_; diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_assisted_acquisition.cc b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_assisted_acquisition.cc index 6c054ef73..61eb6ed08 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_assisted_acquisition.cc +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_assisted_acquisition.cc @@ -43,9 +43,8 @@ using google::LogMessage; GpsL1CaPcpsAssistedAcquisition::GpsL1CaPcpsAssistedAcquisition( - ConfigurationInterface* configuration, std::string role, - unsigned int in_streams, unsigned int out_streams) : - role_(role), in_streams_(in_streams), out_streams_(out_streams) + ConfigurationInterface* configuration, std::string role, + unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) { std::string default_item_type = "gr_complex"; std::string default_dump_filename = "./data/acquisition.dat"; @@ -58,15 +57,14 @@ GpsL1CaPcpsAssistedAcquisition::GpsL1CaPcpsAssistedAcquisition( if_ = configuration->property(role + ".if", 0); dump_ = configuration->property(role + ".dump", false); doppler_max_ = configuration->property(role + ".doppler_max", 5000); - if (FLAGS_doppler_max != 0 ) doppler_max_ = FLAGS_doppler_max; + if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max; doppler_min_ = configuration->property(role + ".doppler_min", -doppler_max_); sampled_ms_ = configuration->property(role + ".coherent_integration_time_ms", 1); - max_dwells_= configuration->property(role + ".max_dwells", 1); + max_dwells_ = configuration->property(role + ".max_dwells", 1); dump_filename_ = configuration->property(role + ".dump_filename", default_dump_filename); //--- Find number of samples per spreading code ------------------------- - vector_length_ = round(fs_in_ - / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS)); + vector_length_ = round(fs_in_ / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS)); code_ = new gr_complex[vector_length_]; @@ -74,8 +72,8 @@ GpsL1CaPcpsAssistedAcquisition::GpsL1CaPcpsAssistedAcquisition( { item_size_ = sizeof(gr_complex); acquisition_cc_ = pcps_make_assisted_acquisition_cc(max_dwells_, sampled_ms_, - doppler_max_, doppler_min_, if_, fs_in_, vector_length_, - dump_, dump_filename_); + doppler_max_, doppler_min_, if_, fs_in_, vector_length_, + dump_, dump_filename_); } else { @@ -133,7 +131,7 @@ void GpsL1CaPcpsAssistedAcquisition::set_gnss_synchro(Gnss_Synchro* gnss_synchro signed int GpsL1CaPcpsAssistedAcquisition::mag() { - return acquisition_cc_->mag(); + return acquisition_cc_->mag(); } @@ -157,14 +155,18 @@ void GpsL1CaPcpsAssistedAcquisition::reset() void GpsL1CaPcpsAssistedAcquisition::connect(gr::top_block_sptr top_block) { - if(top_block) { /* top_block is not null */}; + if (top_block) + { /* top_block is not null */ + }; //nothing to disconnect, now the tracking uses gr_sync_decimator } void GpsL1CaPcpsAssistedAcquisition::disconnect(gr::top_block_sptr top_block) { - if(top_block) { /* top_block is not null */}; + if (top_block) + { /* top_block is not null */ + }; //nothing to disconnect, now the tracking uses gr_sync_decimator } @@ -179,4 +181,3 @@ gr::basic_block_sptr GpsL1CaPcpsAssistedAcquisition::get_right_block() { return acquisition_cc_; } - diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_assisted_acquisition.h b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_assisted_acquisition.h index ee7ac9b66..1997d03c4 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_assisted_acquisition.h +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_assisted_acquisition.h @@ -40,19 +40,18 @@ #include "pcps_assisted_acquisition_cc.h" - class ConfigurationInterface; /*! * \brief This class adapts a PCPS acquisition block to an AcquisitionInterface * for GPS L1 C/A signals */ -class GpsL1CaPcpsAssistedAcquisition: public AcquisitionInterface +class GpsL1CaPcpsAssistedAcquisition : public AcquisitionInterface { public: GpsL1CaPcpsAssistedAcquisition(ConfigurationInterface* configuration, - std::string role, unsigned int in_streams, - unsigned int out_streams); + std::string role, unsigned int in_streams, + unsigned int out_streams); virtual ~GpsL1CaPcpsAssistedAcquisition(); @@ -140,8 +139,8 @@ private: long if_; bool dump_; std::string dump_filename_; - std::complex * code_; - Gnss_Synchro * gnss_synchro_; + std::complex* code_; + Gnss_Synchro* gnss_synchro_; std::string role_; unsigned int in_streams_; unsigned int out_streams_; diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_opencl_acquisition.cc b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_opencl_acquisition.cc index 00e388f07..88d9e4a65 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_opencl_acquisition.cc +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_opencl_acquisition.cc @@ -41,9 +41,8 @@ using google::LogMessage; GpsL1CaPcpsOpenClAcquisition::GpsL1CaPcpsOpenClAcquisition( - ConfigurationInterface* configuration, std::string role, - unsigned int in_streams, unsigned int out_streams) : - role_(role), in_streams_(in_streams), out_streams_(out_streams) + ConfigurationInterface* configuration, std::string role, + unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) { configuration_ = configuration; std::string default_item_type = "gr_complex"; @@ -52,14 +51,14 @@ GpsL1CaPcpsOpenClAcquisition::GpsL1CaPcpsOpenClAcquisition( DLOG(INFO) << "role " << role; item_type_ = configuration_->property(role + ".item_type", - default_item_type); + default_item_type); long fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000); fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); if_ = configuration_->property(role + ".if", 0); dump_ = configuration_->property(role + ".dump", false); doppler_max_ = configuration->property(role + ".doppler_max", 5000); - if (FLAGS_doppler_max != 0 ) doppler_max_ = FLAGS_doppler_max; + if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max; sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 1); bit_transition_flag_ = configuration_->property("Acquisition.bit_transition_flag", false); @@ -74,11 +73,10 @@ GpsL1CaPcpsOpenClAcquisition::GpsL1CaPcpsOpenClAcquisition( } dump_filename_ = configuration_->property(role + ".dump_filename", - default_dump_filename); + default_dump_filename); //--- Find number of samples per spreading code ------------------------- - code_length_ = round(fs_in_ - / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS)); + code_length_ = round(fs_in_ / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS)); vector_length_ = code_length_ * sampled_ms_; @@ -88,8 +86,8 @@ GpsL1CaPcpsOpenClAcquisition::GpsL1CaPcpsOpenClAcquisition( { item_size_ = sizeof(gr_complex); acquisition_cc_ = pcps_make_opencl_acquisition_cc(sampled_ms_, max_dwells_, - doppler_max_, if_, fs_in_, code_length_, code_length_, - bit_transition_flag_, dump_, dump_filename_); + doppler_max_, if_, fs_in_, code_length_, code_length_, + bit_transition_flag_, dump_, dump_filename_); stream_to_vector_ = gr::blocks::stream_to_vector::make(item_size_, vector_length_); @@ -129,11 +127,11 @@ void GpsL1CaPcpsOpenClAcquisition::set_threshold(float threshold) { float pfa = configuration_->property(role_ + boost::lexical_cast(channel_) + ".pfa", 0.0); - if(pfa == 0.0) + if (pfa == 0.0) { pfa = configuration_->property(role_ + ".pfa", 0.0); } - if(pfa == 0.0) + if (pfa == 0.0) { threshold_ = threshold; } @@ -168,7 +166,6 @@ void GpsL1CaPcpsOpenClAcquisition::set_doppler_step(unsigned int doppler_step) { acquisition_cc_->set_doppler_step(doppler_step_); } - } @@ -212,8 +209,8 @@ void GpsL1CaPcpsOpenClAcquisition::set_local_code() for (unsigned int i = 0; i < sampled_ms_; i++) { - memcpy(&(code_[i*code_length_]), code, - sizeof(gr_complex)*code_length_); + memcpy(&(code_[i * code_length_]), code, + sizeof(gr_complex) * code_length_); } acquisition_cc_->set_local_code(code_); @@ -248,8 +245,8 @@ float GpsL1CaPcpsOpenClAcquisition::calculate_threshold(float pfa) double exponent = 1 / static_cast(ncells); double val = pow(1.0 - pfa, exponent); double lambda = double(vector_length_); - boost::math::exponential_distribution mydist (lambda); - float threshold = static_cast(quantile(mydist,val)); + boost::math::exponential_distribution mydist(lambda); + float threshold = static_cast(quantile(mydist, val)); return threshold; } @@ -283,4 +280,3 @@ gr::basic_block_sptr GpsL1CaPcpsOpenClAcquisition::get_right_block() { return acquisition_cc_; } - diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_opencl_acquisition.h b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_opencl_acquisition.h index 606926155..7c4380287 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_opencl_acquisition.h +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_opencl_acquisition.h @@ -39,19 +39,18 @@ #include "pcps_opencl_acquisition_cc.h" - class ConfigurationInterface; /*! * \brief This class adapts an OpenCL PCPS acquisition block to an * AcquisitionInterface for GPS L1 C/A signals */ -class GpsL1CaPcpsOpenClAcquisition: public AcquisitionInterface +class GpsL1CaPcpsOpenClAcquisition : public AcquisitionInterface { public: GpsL1CaPcpsOpenClAcquisition(ConfigurationInterface* configuration, - std::string role, unsigned int in_streams, - unsigned int out_streams); + std::string role, unsigned int in_streams, + unsigned int out_streams); virtual ~GpsL1CaPcpsOpenClAcquisition(); @@ -144,8 +143,8 @@ private: long if_; bool dump_; std::string dump_filename_; - std::complex * code_; - Gnss_Synchro * gnss_synchro_; + std::complex* code_; + Gnss_Synchro* gnss_synchro_; std::string role_; unsigned int in_streams_; unsigned int out_streams_; diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_quicksync_acquisition.cc b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_quicksync_acquisition.cc index e794a4e37..f591a64cb 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_quicksync_acquisition.cc +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_quicksync_acquisition.cc @@ -42,9 +42,8 @@ using google::LogMessage; GpsL1CaPcpsQuickSyncAcquisition::GpsL1CaPcpsQuickSyncAcquisition( - ConfigurationInterface* configuration, std::string role, - unsigned int in_streams, unsigned int out_streams) : - role_(role), in_streams_(in_streams), out_streams_(out_streams) + ConfigurationInterface* configuration, std::string role, + unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) { configuration_ = configuration; std::string default_item_type = "gr_complex"; @@ -58,23 +57,22 @@ GpsL1CaPcpsQuickSyncAcquisition::GpsL1CaPcpsQuickSyncAcquisition( if_ = configuration_->property(role + ".if", 0); dump_ = configuration_->property(role + ".dump", false); doppler_max_ = configuration->property(role + ".doppler_max", 5000); - if (FLAGS_doppler_max != 0 ) doppler_max_ = FLAGS_doppler_max; + if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max; sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 4); //--- Find number of samples per spreading code ------------------------- - code_length_ = round(fs_in_ - / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS)); + code_length_ = round(fs_in_ / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS)); /*Calculate the folding factor value based on the calculations*/ unsigned int temp = static_cast(ceil(sqrt(log2(code_length_)))); folding_factor_ = configuration_->property(role + ".folding_factor", temp); - if ( sampled_ms_ % folding_factor_ != 0) + if (sampled_ms_ % folding_factor_ != 0) { LOG(WARNING) << "QuickSync Algorithm requires a coherent_integration_time" << " multiple of " << folding_factor_ << "ms, Value entered " << sampled_ms_ << " ms"; - if(sampled_ms_ < folding_factor_) + if (sampled_ms_ < folding_factor_) { sampled_ms_ = static_cast(folding_factor_); } @@ -105,22 +103,22 @@ GpsL1CaPcpsQuickSyncAcquisition::GpsL1CaPcpsQuickSyncAcquisition( code_ = new gr_complex[code_length_](); /*Object relevant information for debugging*/ LOG(INFO) << "Implementation: " << this->implementation() - << ", Vector Length: " << vector_length_ - << ", Samples per ms: " << samples_per_ms - << ", Folding factor: " << folding_factor_ - << ", Sampled ms: " << sampled_ms_ - << ", Code Length: " << code_length_; + << ", Vector Length: " << vector_length_ + << ", Samples per ms: " << samples_per_ms + << ", Folding factor: " << folding_factor_ + << ", Sampled ms: " << sampled_ms_ + << ", Code Length: " << code_length_; if (item_type_.compare("gr_complex") == 0) { item_size_ = sizeof(gr_complex); acquisition_cc_ = pcps_quicksync_make_acquisition_cc(folding_factor_, - sampled_ms_, max_dwells_,doppler_max_, if_, fs_in_, - samples_per_ms, code_length_,bit_transition_flag_, - dump_, dump_filename_); + sampled_ms_, max_dwells_, doppler_max_, if_, fs_in_, + samples_per_ms, code_length_, bit_transition_flag_, + dump_, dump_filename_); stream_to_vector_ = gr::blocks::stream_to_vector::make(item_size_, - code_length_*folding_factor_); + code_length_ * folding_factor_); DLOG(INFO) << "stream_to_vector_quicksync(" << stream_to_vector_->unique_id() << ")"; DLOG(INFO) << "acquisition(" << acquisition_cc_->unique_id() << ")"; @@ -157,13 +155,14 @@ void GpsL1CaPcpsQuickSyncAcquisition::set_channel(unsigned int channel) void GpsL1CaPcpsQuickSyncAcquisition::set_threshold(float threshold) { float pfa = configuration_->property(role_ + - boost::lexical_cast(channel_) + ".pfa", 0.0); + boost::lexical_cast(channel_) + ".pfa", + 0.0); - if(pfa == 0.0) + if (pfa == 0.0) { pfa = configuration_->property(role_ + ".pfa", 0.0); } - if(pfa == 0.0) + if (pfa == 0.0) { threshold_ = threshold; } @@ -172,7 +171,7 @@ void GpsL1CaPcpsQuickSyncAcquisition::set_threshold(float threshold) threshold_ = calculate_threshold(pfa); } - DLOG(INFO) << "Channel "<< channel_ << " Threshold = " << threshold_; + DLOG(INFO) << "Channel " << channel_ << " Threshold = " << threshold_; if (item_type_.compare("gr_complex") == 0) { @@ -240,10 +239,10 @@ void GpsL1CaPcpsQuickSyncAcquisition::set_local_code() gps_l1_ca_code_gen_complex_sampled(code, gnss_synchro_->PRN, fs_in_, 0); - for (unsigned int i = 0; i < (sampled_ms_/folding_factor_); i++) + for (unsigned int i = 0; i < (sampled_ms_ / folding_factor_); i++) { - memcpy(&(code_[i*code_length_]), code, - sizeof(gr_complex)*code_length_); + memcpy(&(code_[i * code_length_]), code, + sizeof(gr_complex) * code_length_); } //memcpy(code_, code,sizeof(gr_complex)*code_length_); @@ -280,13 +279,13 @@ float GpsL1CaPcpsQuickSyncAcquisition::calculate_threshold(float pfa) { frequency_bins++; } - DLOG(INFO) << "Channel " << channel_<< " Pfa = " << pfa; + DLOG(INFO) << "Channel " << channel_ << " Pfa = " << pfa; unsigned int ncells = (code_length_ / folding_factor_) * frequency_bins; double exponent = 1.0 / static_cast(ncells); double val = pow(1.0 - pfa, exponent); double lambda = static_cast(code_length_) / static_cast(folding_factor_); - boost::math::exponential_distribution mydist (lambda); - float threshold = static_cast(quantile(mydist,val)); + boost::math::exponential_distribution mydist(lambda); + float threshold = static_cast(quantile(mydist, val)); return threshold; } @@ -320,5 +319,3 @@ gr::basic_block_sptr GpsL1CaPcpsQuickSyncAcquisition::get_right_block() { return acquisition_cc_; } - - diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_quicksync_acquisition.h b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_quicksync_acquisition.h index a43597ee8..6ef2977da 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_quicksync_acquisition.h +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_quicksync_acquisition.h @@ -41,19 +41,18 @@ #include "configuration_interface.h" - class ConfigurationInterface; /*! * \brief This class adapts a PCPS acquisition block to an AcquisitionInterface * for GPS L1 C/A signals */ -class GpsL1CaPcpsQuickSyncAcquisition: public AcquisitionInterface +class GpsL1CaPcpsQuickSyncAcquisition : public AcquisitionInterface { public: GpsL1CaPcpsQuickSyncAcquisition(ConfigurationInterface* configuration, - std::string role, unsigned int in_streams, - unsigned int out_streams); + std::string role, unsigned int in_streams, + unsigned int out_streams); virtual ~GpsL1CaPcpsQuickSyncAcquisition(); @@ -131,6 +130,7 @@ public: * \brief If state = 1, it forces the block to start acquiring from the first sample */ void set_state(int state); + private: ConfigurationInterface* configuration_; pcps_quicksync_acquisition_cc_sptr acquisition_cc_; @@ -151,14 +151,13 @@ private: long if_; bool dump_; std::string dump_filename_; - std::complex * code_; - Gnss_Synchro * gnss_synchro_; + std::complex* code_; + Gnss_Synchro* gnss_synchro_; std::string role_; unsigned int in_streams_; unsigned int out_streams_; float calculate_threshold(float pfa); - }; #endif /* GNSS_SDR_GPS_L1_CA_PCPS_QUICKSYNC_ACQUISITION_H_ */ diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_tong_acquisition.cc b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_tong_acquisition.cc index d8d1349a3..d5a43e3f4 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_tong_acquisition.cc +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_tong_acquisition.cc @@ -41,9 +41,8 @@ using google::LogMessage; GpsL1CaPcpsTongAcquisition::GpsL1CaPcpsTongAcquisition( - ConfigurationInterface* configuration, std::string role, - unsigned int in_streams, unsigned int out_streams) : - role_(role), in_streams_(in_streams), out_streams_(out_streams) + ConfigurationInterface* configuration, std::string role, + unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) { configuration_ = configuration; std::string default_item_type = "gr_complex"; @@ -58,7 +57,7 @@ GpsL1CaPcpsTongAcquisition::GpsL1CaPcpsTongAcquisition( if_ = configuration_->property(role + ".if", 0); dump_ = configuration_->property(role + ".dump", false); doppler_max_ = configuration->property(role + ".doppler_max", 5000); - if (FLAGS_doppler_max != 0 ) doppler_max_ = FLAGS_doppler_max; + if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max; sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 1); tong_init_val_ = configuration->property(role + ".tong_init_val", 1); @@ -68,8 +67,7 @@ GpsL1CaPcpsTongAcquisition::GpsL1CaPcpsTongAcquisition( dump_filename_ = configuration_->property(role + ".dump_filename", default_dump_filename); //--- Find number of samples per spreading code ------------------------- - code_length_ = round(fs_in_ - / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS)); + code_length_ = round(fs_in_ / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS)); vector_length_ = code_length_ * sampled_ms_; @@ -79,8 +77,8 @@ GpsL1CaPcpsTongAcquisition::GpsL1CaPcpsTongAcquisition( { item_size_ = sizeof(gr_complex); acquisition_cc_ = pcps_tong_make_acquisition_cc(sampled_ms_, doppler_max_, if_, fs_in_, - code_length_, code_length_, tong_init_val_, tong_max_val_, tong_max_dwells_, - dump_, dump_filename_); + code_length_, code_length_, tong_init_val_, tong_max_val_, tong_max_dwells_, + dump_, dump_filename_); stream_to_vector_ = gr::blocks::stream_to_vector::make(item_size_, vector_length_); @@ -110,9 +108,9 @@ void GpsL1CaPcpsTongAcquisition::set_channel(unsigned int channel) { channel_ = channel; if (item_type_.compare("gr_complex") == 0) - { - acquisition_cc_->set_channel(channel_); - } + { + acquisition_cc_->set_channel(channel_); + } } @@ -120,11 +118,11 @@ void GpsL1CaPcpsTongAcquisition::set_threshold(float threshold) { float pfa = configuration_->property(role_ + boost::lexical_cast(channel_) + ".pfa", 0.0); - if(pfa == 0.0) + if (pfa == 0.0) { - pfa = configuration_->property(role_+".pfa", 0.0); + pfa = configuration_->property(role_ + ".pfa", 0.0); } - if(pfa == 0.0) + if (pfa == 0.0) { threshold_ = threshold; } @@ -159,7 +157,6 @@ void GpsL1CaPcpsTongAcquisition::set_doppler_step(unsigned int doppler_step) { acquisition_cc_->set_doppler_step(doppler_step_); } - } @@ -195,21 +192,21 @@ void GpsL1CaPcpsTongAcquisition::init() void GpsL1CaPcpsTongAcquisition::set_local_code() { if (item_type_.compare("gr_complex") == 0) - { - std::complex* code = new std::complex[code_length_]; + { + std::complex* code = new std::complex[code_length_]; - gps_l1_ca_code_gen_complex_sampled(code, gnss_synchro_->PRN, fs_in_, 0); + gps_l1_ca_code_gen_complex_sampled(code, gnss_synchro_->PRN, fs_in_, 0); - for (unsigned int i = 0; i < sampled_ms_; i++) - { - memcpy(&(code_[i*code_length_]), code, - sizeof(gr_complex)*code_length_); - } + for (unsigned int i = 0; i < sampled_ms_; i++) + { + memcpy(&(code_[i * code_length_]), code, + sizeof(gr_complex) * code_length_); + } - acquisition_cc_->set_local_code(code_); + acquisition_cc_->set_local_code(code_); - delete[] code; - } + delete[] code; + } } @@ -225,9 +222,9 @@ void GpsL1CaPcpsTongAcquisition::reset() void GpsL1CaPcpsTongAcquisition::set_state(int state) { if (item_type_.compare("gr_complex") == 0) - { - acquisition_cc_->set_state(state); - } + { + acquisition_cc_->set_state(state); + } } @@ -240,13 +237,13 @@ float GpsL1CaPcpsTongAcquisition::calculate_threshold(float pfa) frequency_bins++; } - DLOG(INFO) << "Channel "<< channel_ <<" Pfa = "<< pfa; + DLOG(INFO) << "Channel " << channel_ << " Pfa = " << pfa; unsigned int ncells = vector_length_ * frequency_bins; double exponent = 1 / static_cast(ncells); - double val = pow(1.0 - pfa,exponent); + double val = pow(1.0 - pfa, exponent); double lambda = double(vector_length_); - boost::math::exponential_distribution mydist (lambda); + boost::math::exponential_distribution mydist(lambda); float threshold = static_cast(quantile(mydist, val)); return threshold; @@ -259,7 +256,6 @@ void GpsL1CaPcpsTongAcquisition::connect(gr::top_block_sptr top_block) { top_block->connect(stream_to_vector_, 0, acquisition_cc_, 0); } - } @@ -282,4 +278,3 @@ gr::basic_block_sptr GpsL1CaPcpsTongAcquisition::get_right_block() { return acquisition_cc_; } - diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_tong_acquisition.h b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_tong_acquisition.h index 957688bad..24fe9ba30 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_tong_acquisition.h +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_tong_acquisition.h @@ -45,12 +45,12 @@ class ConfigurationInterface; * \brief This class adapts a PCPS Tong acquisition block to an * AcquisitionInterface for GPS L1 C/A signals */ -class GpsL1CaPcpsTongAcquisition: public AcquisitionInterface +class GpsL1CaPcpsTongAcquisition : public AcquisitionInterface { public: GpsL1CaPcpsTongAcquisition(ConfigurationInterface* configuration, - std::string role, unsigned int in_streams, - unsigned int out_streams); + std::string role, unsigned int in_streams, + unsigned int out_streams); virtual ~GpsL1CaPcpsTongAcquisition(); @@ -149,8 +149,8 @@ private: long if_; bool dump_; std::string dump_filename_; - std::complex * code_; - Gnss_Synchro * gnss_synchro_; + std::complex* code_; + Gnss_Synchro* gnss_synchro_; std::string role_; unsigned int in_streams_; unsigned int out_streams_; diff --git a/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.cc b/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.cc index a8c2bab9e..19dd1ef1a 100644 --- a/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.cc @@ -43,9 +43,8 @@ using google::LogMessage; GpsL2MPcpsAcquisition::GpsL2MPcpsAcquisition( - ConfigurationInterface* configuration, std::string role, - unsigned int in_streams, unsigned int out_streams) : - role_(role), in_streams_(in_streams), out_streams_(out_streams) + ConfigurationInterface* configuration, std::string role, + unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) { configuration_ = configuration; std::string default_item_type = "gr_complex"; @@ -62,29 +61,28 @@ GpsL2MPcpsAcquisition::GpsL2MPcpsAcquisition( dump_ = configuration_->property(role + ".dump", false); blocking_ = configuration_->property(role + ".blocking", true); doppler_max_ = configuration->property(role + ".doppler_max", 5000); - if (FLAGS_doppler_max != 0 ) doppler_max_ = FLAGS_doppler_max; + if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max; bit_transition_flag_ = configuration_->property(role + ".bit_transition_flag", false); - use_CFAR_algorithm_flag_=configuration_->property(role + ".use_CFAR_algorithm", true); //will be false in future versions + use_CFAR_algorithm_flag_ = configuration_->property(role + ".use_CFAR_algorithm", true); //will be false in future versions max_dwells_ = configuration_->property(role + ".max_dwells", 1); dump_filename_ = configuration_->property(role + ".dump_filename", default_dump_filename); //--- Find number of samples per spreading code ------------------------- - code_length_ = round(static_cast(fs_in_) - / (GPS_L2_M_CODE_RATE_HZ / static_cast(GPS_L2_M_CODE_LENGTH_CHIPS))); + code_length_ = round(static_cast(fs_in_) / (GPS_L2_M_CODE_RATE_HZ / static_cast(GPS_L2_M_CODE_LENGTH_CHIPS))); vector_length_ = code_length_; - if( bit_transition_flag_ ) + if (bit_transition_flag_) { vector_length_ *= 2; } code_ = new gr_complex[vector_length_]; - if (item_type_.compare("cshort") == 0 ) + if (item_type_.compare("cshort") == 0) { item_size_ = sizeof(lv_16sc_t); } @@ -93,14 +91,14 @@ GpsL2MPcpsAcquisition::GpsL2MPcpsAcquisition( item_size_ = sizeof(gr_complex); } acquisition_ = pcps_make_acquisition(1, max_dwells_, - doppler_max_, if_, fs_in_, code_length_, code_length_, - bit_transition_flag_, use_CFAR_algorithm_flag_, dump_, blocking_, - dump_filename_, item_size_); - DLOG(INFO) << "acquisition(" << acquisition_->unique_id() << ")"; + doppler_max_, if_, fs_in_, code_length_, code_length_, + bit_transition_flag_, use_CFAR_algorithm_flag_, dump_, blocking_, + dump_filename_, item_size_); + DLOG(INFO) << "acquisition(" << acquisition_->unique_id() << ")"; stream_to_vector_ = gr::blocks::stream_to_vector::make(item_size_, vector_length_); DLOG(INFO) << "stream_to_vector(" << stream_to_vector_->unique_id() << ")"; - + if (item_type_.compare("cbyte") == 0) { cbyte_to_float_x2_ = make_complex_byte_to_float_x2(); @@ -131,11 +129,11 @@ void GpsL2MPcpsAcquisition::set_threshold(float threshold) { float pfa = configuration_->property(role_ + boost::lexical_cast(channel_) + ".pfa", 0.0); - if(pfa == 0.0) + if (pfa == 0.0) { pfa = configuration_->property(role_ + ".pfa", 0.0); } - if(pfa == 0.0) + if (pfa == 0.0) { threshold_ = threshold; } @@ -144,7 +142,7 @@ void GpsL2MPcpsAcquisition::set_threshold(float threshold) threshold_ = calculate_threshold(pfa); } - DLOG(INFO) << "Channel " << channel_ <<" Threshold = " << threshold_; + DLOG(INFO) << "Channel " << channel_ << " Threshold = " << threshold_; acquisition_->set_threshold(threshold_); } @@ -191,9 +189,8 @@ void GpsL2MPcpsAcquisition::init() void GpsL2MPcpsAcquisition::set_local_code() { - gps_l2c_m_code_gen_complex_sampled(code_, gnss_synchro_->PRN, fs_in_); - + acquisition_->set_local_code(code_); } @@ -209,7 +206,6 @@ void GpsL2MPcpsAcquisition::set_state(int state) } - float GpsL2MPcpsAcquisition::calculate_threshold(float pfa) { //Calculate the threshold @@ -218,13 +214,13 @@ float GpsL2MPcpsAcquisition::calculate_threshold(float pfa) { frequency_bins++; } - DLOG(INFO) << "Channel " << channel_<< " Pfa = " << pfa; + DLOG(INFO) << "Channel " << channel_ << " Pfa = " << pfa; unsigned int ncells = vector_length_ * frequency_bins; double exponent = 1.0 / static_cast(ncells); double val = pow(1.0 - pfa, exponent); double lambda = double(vector_length_); - boost::math::exponential_distribution mydist (lambda); - float threshold = static_cast(quantile(mydist,val)); + boost::math::exponential_distribution mydist(lambda); + float threshold = static_cast(quantile(mydist, val)); return threshold; } @@ -306,4 +302,3 @@ gr::basic_block_sptr GpsL2MPcpsAcquisition::get_right_block() { return acquisition_; } - diff --git a/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.h b/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.h index 5fa3e1a0b..22babe4d4 100644 --- a/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.h +++ b/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.h @@ -44,19 +44,18 @@ #include - class ConfigurationInterface; /*! * \brief This class adapts a PCPS acquisition block to an AcquisitionInterface * for GPS L2 M signals */ -class GpsL2MPcpsAcquisition: public AcquisitionInterface +class GpsL2MPcpsAcquisition : public AcquisitionInterface { public: GpsL2MPcpsAcquisition(ConfigurationInterface* configuration, - std::string role, unsigned int in_streams, - unsigned int out_streams); + std::string role, unsigned int in_streams, + unsigned int out_streams); virtual ~GpsL2MPcpsAcquisition(); @@ -157,8 +156,8 @@ private: bool dump_; bool blocking_; std::string dump_filename_; - std::complex * code_; - Gnss_Synchro * gnss_synchro_; + std::complex* code_; + Gnss_Synchro* gnss_synchro_; std::string role_; unsigned int in_streams_; unsigned int out_streams_; diff --git a/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.cc b/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.cc index 4d72ad74b..f61d078e5 100644 --- a/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.cc @@ -43,9 +43,8 @@ using google::LogMessage; GpsL5iPcpsAcquisition::GpsL5iPcpsAcquisition( - ConfigurationInterface* configuration, std::string role, - unsigned int in_streams, unsigned int out_streams) : - role_(role), in_streams_(in_streams), out_streams_(out_streams) + ConfigurationInterface* configuration, std::string role, + unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) { configuration_ = configuration; std::string default_item_type = "gr_complex"; @@ -61,29 +60,28 @@ GpsL5iPcpsAcquisition::GpsL5iPcpsAcquisition( dump_ = configuration_->property(role + ".dump", false); blocking_ = configuration_->property(role + ".blocking", true); doppler_max_ = configuration->property(role + ".doppler_max", 5000); - if (FLAGS_doppler_max != 0 ) doppler_max_ = FLAGS_doppler_max; + if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max; bit_transition_flag_ = configuration_->property(role + ".bit_transition_flag", false); - use_CFAR_algorithm_flag_=configuration_->property(role + ".use_CFAR_algorithm", true); //will be false in future versions + use_CFAR_algorithm_flag_ = configuration_->property(role + ".use_CFAR_algorithm", true); //will be false in future versions max_dwells_ = configuration_->property(role + ".max_dwells", 1); dump_filename_ = configuration_->property(role + ".dump_filename", default_dump_filename); //--- Find number of samples per spreading code ------------------------- - code_length_ = round(static_cast(fs_in_) - / (GPS_L5i_CODE_RATE_HZ / static_cast(GPS_L5i_CODE_LENGTH_CHIPS))); + code_length_ = round(static_cast(fs_in_) / (GPS_L5i_CODE_RATE_HZ / static_cast(GPS_L5i_CODE_LENGTH_CHIPS))); vector_length_ = code_length_; - if( bit_transition_flag_ ) + if (bit_transition_flag_) { vector_length_ *= 2; } code_ = new gr_complex[vector_length_]; - if (item_type_.compare("cshort") == 0 ) + if (item_type_.compare("cshort") == 0) { item_size_ = sizeof(lv_16sc_t); } @@ -92,14 +90,14 @@ GpsL5iPcpsAcquisition::GpsL5iPcpsAcquisition( item_size_ = sizeof(gr_complex); } acquisition_ = pcps_make_acquisition(1, max_dwells_, - doppler_max_, if_, fs_in_, code_length_, code_length_, - bit_transition_flag_, use_CFAR_algorithm_flag_, dump_, blocking_, - dump_filename_, item_size_); + doppler_max_, if_, fs_in_, code_length_, code_length_, + bit_transition_flag_, use_CFAR_algorithm_flag_, dump_, blocking_, + dump_filename_, item_size_); DLOG(INFO) << "acquisition(" << acquisition_->unique_id() << ")"; stream_to_vector_ = gr::blocks::stream_to_vector::make(item_size_, vector_length_); DLOG(INFO) << "stream_to_vector(" << stream_to_vector_->unique_id() << ")"; - + if (item_type_.compare("cbyte") == 0) { cbyte_to_float_x2_ = make_complex_byte_to_float_x2(); @@ -130,11 +128,11 @@ void GpsL5iPcpsAcquisition::set_threshold(float threshold) { float pfa = configuration_->property(role_ + boost::lexical_cast(channel_) + ".pfa", 0.0); - if(pfa == 0.0) + if (pfa == 0.0) { pfa = configuration_->property(role_ + ".pfa", 0.0); } - if(pfa == 0.0) + if (pfa == 0.0) { threshold_ = threshold; } @@ -143,7 +141,7 @@ void GpsL5iPcpsAcquisition::set_threshold(float threshold) threshold_ = calculate_threshold(pfa); } - DLOG(INFO) << "Channel " << channel_ <<" Threshold = " << threshold_; + DLOG(INFO) << "Channel " << channel_ << " Threshold = " << threshold_; acquisition_->set_threshold(threshold_); } @@ -188,9 +186,8 @@ void GpsL5iPcpsAcquisition::init() void GpsL5iPcpsAcquisition::set_local_code() { - gps_l5i_code_gen_complex_sampled(code_, gnss_synchro_->PRN, fs_in_); - + acquisition_->set_local_code(code_); } @@ -206,7 +203,6 @@ void GpsL5iPcpsAcquisition::set_state(int state) } - float GpsL5iPcpsAcquisition::calculate_threshold(float pfa) { //Calculate the threshold @@ -215,13 +211,13 @@ float GpsL5iPcpsAcquisition::calculate_threshold(float pfa) { frequency_bins++; } - DLOG(INFO) << "Channel " << channel_<< " Pfa = " << pfa; + DLOG(INFO) << "Channel " << channel_ << " Pfa = " << pfa; unsigned int ncells = vector_length_ * frequency_bins; double exponent = 1.0 / static_cast(ncells); double val = pow(1.0 - pfa, exponent); double lambda = double(vector_length_); - boost::math::exponential_distribution mydist (lambda); - float threshold = static_cast(quantile(mydist,val)); + boost::math::exponential_distribution mydist(lambda); + float threshold = static_cast(quantile(mydist, val)); return threshold; } @@ -303,4 +299,3 @@ gr::basic_block_sptr GpsL5iPcpsAcquisition::get_right_block() { return acquisition_; } - diff --git a/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.h b/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.h index 977b70c60..ee9fb5d70 100644 --- a/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.h +++ b/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.h @@ -50,12 +50,12 @@ class ConfigurationInterface; * \brief This class adapts a PCPS acquisition block to an AcquisitionInterface * for GPS L5i signals */ -class GpsL5iPcpsAcquisition: public AcquisitionInterface +class GpsL5iPcpsAcquisition : public AcquisitionInterface { public: GpsL5iPcpsAcquisition(ConfigurationInterface* configuration, - std::string role, unsigned int in_streams, - unsigned int out_streams); + std::string role, unsigned int in_streams, + unsigned int out_streams); virtual ~GpsL5iPcpsAcquisition(); @@ -156,8 +156,8 @@ private: bool dump_; bool blocking_; std::string dump_filename_; - std::complex * code_; - Gnss_Synchro * gnss_synchro_; + std::complex* code_; + Gnss_Synchro* gnss_synchro_; std::string role_; unsigned int in_streams_; unsigned int out_streams_; diff --git a/src/algorithms/acquisition/gnuradio_blocks/galileo_e5a_noncoherent_iq_acquisition_caf_cc.cc b/src/algorithms/acquisition/gnuradio_blocks/galileo_e5a_noncoherent_iq_acquisition_caf_cc.cc index 858a4117d..7144a219b 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/galileo_e5a_noncoherent_iq_acquisition_caf_cc.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/galileo_e5a_noncoherent_iq_acquisition_caf_cc.cc @@ -46,40 +46,38 @@ using google::LogMessage; galileo_e5a_noncoherentIQ_acquisition_caf_cc_sptr galileo_e5a_noncoherentIQ_make_acquisition_caf_cc( - unsigned int sampled_ms, - unsigned int max_dwells, - unsigned int doppler_max, long freq, long fs_in, - int samples_per_ms, int samples_per_code, - bool bit_transition_flag, - bool dump, - std::string dump_filename, - bool both_signal_components_, - int CAF_window_hz_, - int Zero_padding_) + unsigned int sampled_ms, + unsigned int max_dwells, + unsigned int doppler_max, long freq, long fs_in, + int samples_per_ms, int samples_per_code, + bool bit_transition_flag, + bool dump, + std::string dump_filename, + bool both_signal_components_, + int CAF_window_hz_, + int Zero_padding_) { - return galileo_e5a_noncoherentIQ_acquisition_caf_cc_sptr( - new galileo_e5a_noncoherentIQ_acquisition_caf_cc(sampled_ms, max_dwells, doppler_max, freq, fs_in, samples_per_ms, - samples_per_code, bit_transition_flag, dump, dump_filename, both_signal_components_, CAF_window_hz_, Zero_padding_)); + new galileo_e5a_noncoherentIQ_acquisition_caf_cc(sampled_ms, max_dwells, doppler_max, freq, fs_in, samples_per_ms, + samples_per_code, bit_transition_flag, dump, dump_filename, both_signal_components_, CAF_window_hz_, Zero_padding_)); } galileo_e5a_noncoherentIQ_acquisition_caf_cc::galileo_e5a_noncoherentIQ_acquisition_caf_cc( - unsigned int sampled_ms, - unsigned int max_dwells, - unsigned int doppler_max, long freq, long fs_in, - int samples_per_ms, int samples_per_code, - bool bit_transition_flag, - bool dump, - std::string dump_filename, - bool both_signal_components_, - int CAF_window_hz_, - int Zero_padding_) : - gr::block("galileo_e5a_noncoherentIQ_acquisition_caf_cc", - gr::io_signature::make(1, 1, sizeof(gr_complex)), - gr::io_signature::make(0, 0, sizeof(gr_complex))) + unsigned int sampled_ms, + unsigned int max_dwells, + unsigned int doppler_max, long freq, long fs_in, + int samples_per_ms, int samples_per_code, + bool bit_transition_flag, + bool dump, + std::string dump_filename, + bool both_signal_components_, + int CAF_window_hz_, + int Zero_padding_) : gr::block("galileo_e5a_noncoherentIQ_acquisition_caf_cc", + gr::io_signature::make(1, 1, sizeof(gr_complex)), + gr::io_signature::make(0, 0, sizeof(gr_complex))) { this->message_port_register_out(pmt::mp("events")); - d_sample_counter = 0; // SAMPLE COUNTER + d_sample_counter = 0; // SAMPLE COUNTER d_active = false; d_state = 0; d_freq = freq; @@ -106,14 +104,14 @@ galileo_e5a_noncoherentIQ_acquisition_caf_cc::galileo_e5a_noncoherentIQ_acquisit d_both_signal_components = both_signal_components_; d_CAF_window_hz = CAF_window_hz_; - d_inbuffer = static_cast(volk_gnsssdr_malloc(d_fft_size * sizeof(gr_complex), volk_gnsssdr_get_alignment())); - d_fft_code_I_A = static_cast(volk_gnsssdr_malloc(d_fft_size * sizeof(gr_complex), volk_gnsssdr_get_alignment())); - d_magnitudeIA = static_cast(volk_gnsssdr_malloc(d_fft_size * sizeof(float), volk_gnsssdr_get_alignment())); + d_inbuffer = static_cast(volk_gnsssdr_malloc(d_fft_size * sizeof(gr_complex), volk_gnsssdr_get_alignment())); + d_fft_code_I_A = static_cast(volk_gnsssdr_malloc(d_fft_size * sizeof(gr_complex), volk_gnsssdr_get_alignment())); + d_magnitudeIA = static_cast(volk_gnsssdr_malloc(d_fft_size * sizeof(float), volk_gnsssdr_get_alignment())); if (d_both_signal_components == true) { - d_fft_code_Q_A = static_cast(volk_gnsssdr_malloc(d_fft_size * sizeof(gr_complex), volk_gnsssdr_get_alignment())); - d_magnitudeQA = static_cast(volk_gnsssdr_malloc(d_fft_size * sizeof(float), volk_gnsssdr_get_alignment())); + d_fft_code_Q_A = static_cast(volk_gnsssdr_malloc(d_fft_size * sizeof(gr_complex), volk_gnsssdr_get_alignment())); + d_magnitudeQA = static_cast(volk_gnsssdr_malloc(d_fft_size * sizeof(float), volk_gnsssdr_get_alignment())); } else { @@ -123,12 +121,12 @@ galileo_e5a_noncoherentIQ_acquisition_caf_cc::galileo_e5a_noncoherentIQ_acquisit // IF COHERENT INTEGRATION TIME > 1 if (d_sampled_ms > 1) { - d_fft_code_I_B = static_cast(volk_gnsssdr_malloc(d_fft_size * sizeof(gr_complex), volk_gnsssdr_get_alignment())); - d_magnitudeIB = static_cast(volk_gnsssdr_malloc(d_fft_size * sizeof(float), volk_gnsssdr_get_alignment())); + d_fft_code_I_B = static_cast(volk_gnsssdr_malloc(d_fft_size * sizeof(gr_complex), volk_gnsssdr_get_alignment())); + d_magnitudeIB = static_cast(volk_gnsssdr_malloc(d_fft_size * sizeof(float), volk_gnsssdr_get_alignment())); if (d_both_signal_components == true) { - d_fft_code_Q_B = static_cast(volk_gnsssdr_malloc(d_fft_size * sizeof(gr_complex), volk_gnsssdr_get_alignment())); - d_magnitudeQB = static_cast(volk_gnsssdr_malloc(d_fft_size * sizeof(float), volk_gnsssdr_get_alignment())); + d_fft_code_Q_B = static_cast(volk_gnsssdr_malloc(d_fft_size * sizeof(gr_complex), volk_gnsssdr_get_alignment())); + d_magnitudeQB = static_cast(volk_gnsssdr_malloc(d_fft_size * sizeof(float), volk_gnsssdr_get_alignment())); } else { @@ -219,27 +217,27 @@ galileo_e5a_noncoherentIQ_acquisition_caf_cc::~galileo_e5a_noncoherentIQ_acquisi } -void galileo_e5a_noncoherentIQ_acquisition_caf_cc::set_local_code(std::complex * codeI, std::complex * codeQ ) +void galileo_e5a_noncoherentIQ_acquisition_caf_cc::set_local_code(std::complex *codeI, std::complex *codeQ) { // DATA SIGNAL // Three replicas of data primary code. CODE A: (1,1,1) - memcpy(d_fft_if->get_inbuf(), codeI, sizeof(gr_complex)*d_fft_size); + memcpy(d_fft_if->get_inbuf(), codeI, sizeof(gr_complex) * d_fft_size); - d_fft_if->execute(); // We need the FFT of local code + d_fft_if->execute(); // We need the FFT of local code //Conjugate the local code - volk_32fc_conjugate_32fc(d_fft_code_I_A,d_fft_if->get_outbuf(),d_fft_size); + volk_32fc_conjugate_32fc(d_fft_code_I_A, d_fft_if->get_outbuf(), d_fft_size); // SAME FOR PILOT SIGNAL if (d_both_signal_components == true) { // Three replicas of pilot primary code. CODE A: (1,1,1) - memcpy(d_fft_if->get_inbuf(), codeQ, sizeof(gr_complex)*d_fft_size); + memcpy(d_fft_if->get_inbuf(), codeQ, sizeof(gr_complex) * d_fft_size); - d_fft_if->execute(); // We need the FFT of local code + d_fft_if->execute(); // We need the FFT of local code //Conjugate the local code - volk_32fc_conjugate_32fc(d_fft_code_Q_A,d_fft_if->get_outbuf(),d_fft_size); + volk_32fc_conjugate_32fc(d_fft_code_Q_A, d_fft_if->get_outbuf(), d_fft_size); } // IF INTEGRATION TIME > 1 code, we need to evaluate the other possible combination // Note: max integration time allowed = 3ms (dealt in adapter) @@ -247,24 +245,24 @@ void galileo_e5a_noncoherentIQ_acquisition_caf_cc::set_local_code(std::complexget_inbuf())[0], - &codeI[0], gr_complex(-1,0), - d_samples_per_code); + &codeI[0], gr_complex(-1, 0), + d_samples_per_code); - d_fft_if->execute(); // We need the FFT of local code + d_fft_if->execute(); // We need the FFT of local code //Conjugate the local code - volk_32fc_conjugate_32fc(d_fft_code_I_B,d_fft_if->get_outbuf(),d_fft_size); + volk_32fc_conjugate_32fc(d_fft_code_I_B, d_fft_if->get_outbuf(), d_fft_size); if (d_both_signal_components == true) { // PILOT CODE B: First replica is inverted (0,1,1) volk_32fc_s32fc_multiply_32fc(&(d_fft_if->get_inbuf())[0], - &codeQ[0], gr_complex(-1,0), - d_samples_per_code); - d_fft_if->execute(); // We need the FFT of local code + &codeQ[0], gr_complex(-1, 0), + d_samples_per_code); + d_fft_if->execute(); // We need the FFT of local code //Conjugate the local code - volk_32fc_conjugate_32fc(d_fft_code_Q_B,d_fft_if->get_outbuf(),d_fft_size); + volk_32fc_conjugate_32fc(d_fft_code_Q_B, d_fft_if->get_outbuf(), d_fft_size); } } } @@ -286,22 +284,22 @@ void galileo_e5a_noncoherentIQ_acquisition_caf_cc::init() // Count the number of bins d_num_doppler_bins = 0; for (int doppler = static_cast(-d_doppler_max); - doppler <= static_cast(d_doppler_max); - doppler += d_doppler_step) + doppler <= static_cast(d_doppler_max); + doppler += d_doppler_step) { d_num_doppler_bins++; } // Create the carrier Doppler wipeoff signals - d_grid_doppler_wipeoffs = new gr_complex*[d_num_doppler_bins]; + d_grid_doppler_wipeoffs = new gr_complex *[d_num_doppler_bins]; for (unsigned int doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++) { - d_grid_doppler_wipeoffs[doppler_index] = static_cast(volk_gnsssdr_malloc(d_fft_size * sizeof(gr_complex), volk_gnsssdr_get_alignment())); + d_grid_doppler_wipeoffs[doppler_index] = static_cast(volk_gnsssdr_malloc(d_fft_size * sizeof(gr_complex), volk_gnsssdr_get_alignment())); int doppler = -static_cast(d_doppler_max) + d_doppler_step * doppler_index; float phase_step_rad = GALILEO_TWO_PI * (d_freq + doppler) / static_cast(d_fs_in); float _phase[1]; _phase[0] = 0; - volk_gnsssdr_s32f_sincos_32fc(d_grid_doppler_wipeoffs[doppler_index], - phase_step_rad, _phase, d_fft_size); + volk_gnsssdr_s32f_sincos_32fc(d_grid_doppler_wipeoffs[doppler_index], -phase_step_rad, _phase, d_fft_size); } /* CAF Filtering to resolve doppler ambiguity. Phase and quadrature must be processed @@ -309,17 +307,16 @@ void galileo_e5a_noncoherentIQ_acquisition_caf_cc::init() // if (d_CAF_filter) if (d_CAF_window_hz > 0) { - d_CAF_vector = static_cast(volk_gnsssdr_malloc(d_num_doppler_bins * sizeof(float), volk_gnsssdr_get_alignment())); - d_CAF_vector_I = static_cast(volk_gnsssdr_malloc(d_num_doppler_bins * sizeof(float), volk_gnsssdr_get_alignment())); + d_CAF_vector = static_cast(volk_gnsssdr_malloc(d_num_doppler_bins * sizeof(float), volk_gnsssdr_get_alignment())); + d_CAF_vector_I = static_cast(volk_gnsssdr_malloc(d_num_doppler_bins * sizeof(float), volk_gnsssdr_get_alignment())); if (d_both_signal_components == true) { - d_CAF_vector_Q = static_cast(volk_gnsssdr_malloc(d_num_doppler_bins * sizeof(float), volk_gnsssdr_get_alignment())); + d_CAF_vector_Q = static_cast(volk_gnsssdr_malloc(d_num_doppler_bins * sizeof(float), volk_gnsssdr_get_alignment())); } } } - void galileo_e5a_noncoherentIQ_acquisition_caf_cc::set_state(int state) { d_state = state; @@ -334,7 +331,8 @@ void galileo_e5a_noncoherentIQ_acquisition_caf_cc::set_state(int state) d_test_statistics = 0.0; } else if (d_state == 0) - {} + { + } else { LOG(ERROR) << "State can only be set to 0 or 1"; @@ -342,11 +340,9 @@ void galileo_e5a_noncoherentIQ_acquisition_caf_cc::set_state(int state) } - - int galileo_e5a_noncoherentIQ_acquisition_caf_cc::general_work(int noutput_items __attribute__((unused)), - gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items __attribute__((unused))) + gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items __attribute__((unused))) { /* * By J.Arribas, L.Esteve, M.Molina and M.Sales @@ -360,7 +356,7 @@ int galileo_e5a_noncoherentIQ_acquisition_caf_cc::general_work(int noutput_items * 7. Declare positive or negative acquisition using a message port */ - int acquisition_message = -1; //0=STOP_CHANNEL 1=ACQ_SUCCEES 2=ACQ_FAIL + int acquisition_message = -1; //0=STOP_CHANNEL 1=ACQ_SUCCEES 2=ACQ_FAIL /* States: 0 Stop Channel * 1 Load the buffer until it reaches fft_size * 2 Acquisition algorithm @@ -368,448 +364,471 @@ int galileo_e5a_noncoherentIQ_acquisition_caf_cc::general_work(int noutput_items * 4 Negative acquisition */ switch (d_state) - { - case 0: { - if (d_active) - { - //restart acquisition variables - d_gnss_synchro->Acq_delay_samples = 0.0; - d_gnss_synchro->Acq_doppler_hz = 0.0; - d_gnss_synchro->Acq_samplestamp_samples = 0; - d_well_count = 0; - d_mag = 0.0; - d_input_power = 0.0; - d_test_statistics = 0.0; - d_state = 1; - } - d_sample_counter += ninput_items[0]; // sample counter - consume_each(ninput_items[0]); + case 0: + { + if (d_active) + { + //restart acquisition variables + d_gnss_synchro->Acq_delay_samples = 0.0; + d_gnss_synchro->Acq_doppler_hz = 0.0; + d_gnss_synchro->Acq_samplestamp_samples = 0; + d_well_count = 0; + d_mag = 0.0; + d_input_power = 0.0; + d_test_statistics = 0.0; + d_state = 1; + } + d_sample_counter += ninput_items[0]; // sample counter + consume_each(ninput_items[0]); - break; - } - case 1: - { - const gr_complex *in = reinterpret_cast(input_items[0]); //Get the input samples pointer - unsigned int buff_increment; - if ((ninput_items[0] + d_buffer_count) <= d_fft_size) - { - buff_increment = ninput_items[0]; - } - else - { - buff_increment = d_fft_size - d_buffer_count; - } - memcpy(&d_inbuffer[d_buffer_count], in, sizeof(gr_complex) * buff_increment); - // If buffer will be full in next iteration - if (d_buffer_count >= (d_fft_size - d_gr_stream_buffer)) - { - d_state = 2; - } - d_buffer_count += buff_increment; - d_sample_counter += buff_increment; // sample counter - consume_each(buff_increment); - break; - } - case 2: - { - // Fill last part of the buffer and reset counter - const gr_complex *in = reinterpret_cast(input_items[0]); //Get the input samples pointer - if (d_buffer_count < d_fft_size) - { - memcpy(&d_inbuffer[d_buffer_count], in, sizeof(gr_complex)*(d_fft_size-d_buffer_count)); - } - d_sample_counter += (d_fft_size - d_buffer_count); // sample counter + break; + } + case 1: + { + const gr_complex *in = reinterpret_cast(input_items[0]); //Get the input samples pointer + unsigned int buff_increment; + if ((ninput_items[0] + d_buffer_count) <= d_fft_size) + { + buff_increment = ninput_items[0]; + } + else + { + buff_increment = d_fft_size - d_buffer_count; + } + memcpy(&d_inbuffer[d_buffer_count], in, sizeof(gr_complex) * buff_increment); + // If buffer will be full in next iteration + if (d_buffer_count >= (d_fft_size - d_gr_stream_buffer)) + { + d_state = 2; + } + d_buffer_count += buff_increment; + d_sample_counter += buff_increment; // sample counter + consume_each(buff_increment); + break; + } + case 2: + { + // Fill last part of the buffer and reset counter + const gr_complex *in = reinterpret_cast(input_items[0]); //Get the input samples pointer + if (d_buffer_count < d_fft_size) + { + memcpy(&d_inbuffer[d_buffer_count], in, sizeof(gr_complex) * (d_fft_size - d_buffer_count)); + } + d_sample_counter += (d_fft_size - d_buffer_count); // sample counter - // initialize acquisition algorithm - int doppler; - uint32_t indext = 0; - uint32_t indext_IA = 0; - uint32_t indext_IB = 0; - uint32_t indext_QA = 0; - uint32_t indext_QB = 0; - float magt = 0.0; - float magt_IA = 0.0; - float magt_IB = 0.0; - float magt_QA = 0.0; - float magt_QB = 0.0; - float fft_normalization_factor = static_cast(d_fft_size) * static_cast(d_fft_size); - d_input_power = 0.0; - d_mag = 0.0; - d_well_count++; + // initialize acquisition algorithm + int doppler; + uint32_t indext = 0; + uint32_t indext_IA = 0; + uint32_t indext_IB = 0; + uint32_t indext_QA = 0; + uint32_t indext_QB = 0; + float magt = 0.0; + float magt_IA = 0.0; + float magt_IB = 0.0; + float magt_QA = 0.0; + float magt_QB = 0.0; + float fft_normalization_factor = static_cast(d_fft_size) * static_cast(d_fft_size); + d_input_power = 0.0; + d_mag = 0.0; + d_well_count++; - DLOG(INFO) << "Channel: " << d_channel - << " , doing acquisition of satellite: " << d_gnss_synchro->System << " "<< d_gnss_synchro->PRN - << " ,sample stamp: " << d_sample_counter << ", threshold: " - << d_threshold << ", doppler_max: " << d_doppler_max - << ", doppler_step: " << d_doppler_step; + DLOG(INFO) << "Channel: " << d_channel + << " , doing acquisition of satellite: " << d_gnss_synchro->System << " " << d_gnss_synchro->PRN + << " ,sample stamp: " << d_sample_counter << ", threshold: " + << d_threshold << ", doppler_max: " << d_doppler_max + << ", doppler_step: " << d_doppler_step; - // 1- Compute the input signal power estimation - volk_32fc_magnitude_squared_32f(d_magnitudeIA, d_inbuffer, d_fft_size); - volk_32f_accumulator_s32f(&d_input_power, d_magnitudeIA, d_fft_size); - d_input_power /= static_cast(d_fft_size); + // 1- Compute the input signal power estimation + volk_32fc_magnitude_squared_32f(d_magnitudeIA, d_inbuffer, d_fft_size); + volk_32f_accumulator_s32f(&d_input_power, d_magnitudeIA, d_fft_size); + d_input_power /= static_cast(d_fft_size); - // 2- Doppler frequency search loop - for (unsigned int doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++) - { - // doppler search steps + // 2- Doppler frequency search loop + for (unsigned int doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++) + { + // doppler search steps - doppler = -static_cast(d_doppler_max) + d_doppler_step * doppler_index; + doppler = -static_cast(d_doppler_max) + d_doppler_step * doppler_index; - volk_32fc_x2_multiply_32fc(d_fft_if->get_inbuf(), d_inbuffer, + volk_32fc_x2_multiply_32fc(d_fft_if->get_inbuf(), d_inbuffer, d_grid_doppler_wipeoffs[doppler_index], d_fft_size); - // 3- Perform the FFT-based convolution (parallel time search) - // Compute the FFT of the carrier wiped--off incoming signal - d_fft_if->execute(); + // 3- Perform the FFT-based convolution (parallel time search) + // Compute the FFT of the carrier wiped--off incoming signal + d_fft_if->execute(); - // CODE IA - // Multiply carrier wiped--off, Fourier transformed incoming signal - // with the local FFT'd code reference using SIMD operations with VOLK library - volk_32fc_x2_multiply_32fc(d_ifft->get_inbuf(), + // CODE IA + // Multiply carrier wiped--off, Fourier transformed incoming signal + // with the local FFT'd code reference using SIMD operations with VOLK library + volk_32fc_x2_multiply_32fc(d_ifft->get_inbuf(), d_fft_if->get_outbuf(), d_fft_code_I_A, d_fft_size); - // compute the inverse FFT - d_ifft->execute(); + // compute the inverse FFT + d_ifft->execute(); - // Search maximum - volk_32fc_magnitude_squared_32f(d_magnitudeIA, d_ifft->get_outbuf(), d_fft_size); - volk_gnsssdr_32f_index_max_32u(&indext_IA, d_magnitudeIA, d_fft_size); - // Normalize the maximum value to correct the scale factor introduced by FFTW - magt_IA = d_magnitudeIA[indext_IA] / (fft_normalization_factor * fft_normalization_factor); + // Search maximum + volk_32fc_magnitude_squared_32f(d_magnitudeIA, d_ifft->get_outbuf(), d_fft_size); + volk_gnsssdr_32f_index_max_32u(&indext_IA, d_magnitudeIA, d_fft_size); + // Normalize the maximum value to correct the scale factor introduced by FFTW + magt_IA = d_magnitudeIA[indext_IA] / (fft_normalization_factor * fft_normalization_factor); - if (d_both_signal_components == true) - { - // REPEAT FOR ALL CODES. CODE_QA - volk_32fc_x2_multiply_32fc(d_ifft->get_inbuf(), + if (d_both_signal_components == true) + { + // REPEAT FOR ALL CODES. CODE_QA + volk_32fc_x2_multiply_32fc(d_ifft->get_inbuf(), d_fft_if->get_outbuf(), d_fft_code_Q_A, d_fft_size); - d_ifft->execute(); - volk_32fc_magnitude_squared_32f(d_magnitudeQA, d_ifft->get_outbuf(), d_fft_size); - volk_gnsssdr_32f_index_max_32u(&indext_QA, d_magnitudeQA, d_fft_size); - magt_QA = d_magnitudeQA[indext_QA] / (fft_normalization_factor * fft_normalization_factor); - } - if (d_sampled_ms > 1) // If Integration time > 1 code - { - // REPEAT FOR ALL CODES. CODE_IB - volk_32fc_x2_multiply_32fc(d_ifft->get_inbuf(), + d_ifft->execute(); + volk_32fc_magnitude_squared_32f(d_magnitudeQA, d_ifft->get_outbuf(), d_fft_size); + volk_gnsssdr_32f_index_max_32u(&indext_QA, d_magnitudeQA, d_fft_size); + magt_QA = d_magnitudeQA[indext_QA] / (fft_normalization_factor * fft_normalization_factor); + } + if (d_sampled_ms > 1) // If Integration time > 1 code + { + // REPEAT FOR ALL CODES. CODE_IB + volk_32fc_x2_multiply_32fc(d_ifft->get_inbuf(), d_fft_if->get_outbuf(), d_fft_code_I_B, d_fft_size); - d_ifft->execute(); - volk_32fc_magnitude_squared_32f(d_magnitudeIB, d_ifft->get_outbuf(), d_fft_size); - volk_gnsssdr_32f_index_max_32u(&indext_IB, d_magnitudeIB, d_fft_size); - magt_IB = d_magnitudeIB[indext_IB] / (fft_normalization_factor * fft_normalization_factor); + d_ifft->execute(); + volk_32fc_magnitude_squared_32f(d_magnitudeIB, d_ifft->get_outbuf(), d_fft_size); + volk_gnsssdr_32f_index_max_32u(&indext_IB, d_magnitudeIB, d_fft_size); + magt_IB = d_magnitudeIB[indext_IB] / (fft_normalization_factor * fft_normalization_factor); - if (d_both_signal_components == true) - { - // REPEAT FOR ALL CODES. CODE_QB - volk_32fc_x2_multiply_32fc(d_ifft->get_inbuf(), + if (d_both_signal_components == true) + { + // REPEAT FOR ALL CODES. CODE_QB + volk_32fc_x2_multiply_32fc(d_ifft->get_inbuf(), d_fft_if->get_outbuf(), d_fft_code_Q_B, d_fft_size); - d_ifft->execute(); - volk_32fc_magnitude_squared_32f(d_magnitudeQB, d_ifft->get_outbuf(), d_fft_size); - volk_gnsssdr_32f_index_max_32u(&indext_QB, d_magnitudeQB, d_fft_size); - magt_QB = d_magnitudeIB[indext_QB] / (fft_normalization_factor * fft_normalization_factor); - } - } + d_ifft->execute(); + volk_32fc_magnitude_squared_32f(d_magnitudeQB, d_ifft->get_outbuf(), d_fft_size); + volk_gnsssdr_32f_index_max_32u(&indext_QB, d_magnitudeQB, d_fft_size); + magt_QB = d_magnitudeIB[indext_QB] / (fft_normalization_factor * fft_normalization_factor); + } + } - // Integrate noncoherently the two best combinations (I² + Q²) - // and store the result in the I channel. - // If CAF filter to resolve doppler ambiguity is needed, - // peak is stored before non-coherent integration. - if (d_sampled_ms > 1) // T_integration > 1 code - { - if (magt_IA >= magt_IB) - { - // if (d_CAF_filter) {d_CAF_vector_I[doppler_index] = magt_IA;} - if (d_CAF_window_hz > 0) {d_CAF_vector_I[doppler_index] = d_magnitudeIA[indext_IA];} - if (d_both_signal_components) - { - // Integrate non-coherently I+Q - if (magt_QA >= magt_QB) - { - // if (d_CAF_filter) {d_CAF_vector_Q[doppler_index] = magt_QA;} - if (d_CAF_window_hz > 0) {d_CAF_vector_Q[doppler_index] = d_magnitudeQA[indext_QA];} - for (unsigned int i=0; i 0) {d_CAF_vector_Q[doppler_index] = d_magnitudeQB[indext_QB];} - for (unsigned int i=0; i 0) {d_CAF_vector_I[doppler_index] = d_magnitudeIB[indext_IB];} - if (d_both_signal_components) - { - // Integrate non-coherently I+Q - if (magt_QA >= magt_QB) - { - //if (d_CAF_filter) {d_CAF_vector_Q[doppler_index] = magt_QA;} - if (d_CAF_window_hz > 0) {d_CAF_vector_Q[doppler_index] = d_magnitudeQA[indext_QA];} - for (unsigned int i=0; i 0) {d_CAF_vector_Q[doppler_index] = d_magnitudeQB[indext_QB];} - for (unsigned int i=0; i 0) {d_CAF_vector_I[doppler_index] = d_magnitudeIA[indext_IA];} - if (d_both_signal_components) - { - // if (d_CAF_filter) {d_CAF_vector_Q[doppler_index] = magt_QA;} - if (d_CAF_window_hz > 0) {d_CAF_vector_Q[doppler_index] = d_magnitudeQA[indext_QA];} - // NON-Coherent integration of only 1 code - for (unsigned int i=0; i 1) // T_integration > 1 code + { + if (magt_IA >= magt_IB) + { + // if (d_CAF_filter) {d_CAF_vector_I[doppler_index] = magt_IA;} + if (d_CAF_window_hz > 0) + { + d_CAF_vector_I[doppler_index] = d_magnitudeIA[indext_IA]; + } + if (d_both_signal_components) + { + // Integrate non-coherently I+Q + if (magt_QA >= magt_QB) + { + // if (d_CAF_filter) {d_CAF_vector_Q[doppler_index] = magt_QA;} + if (d_CAF_window_hz > 0) + { + d_CAF_vector_Q[doppler_index] = d_magnitudeQA[indext_QA]; + } + for (unsigned int i = 0; i < d_fft_size; i++) + { + d_magnitudeIA[i] += d_magnitudeQA[i]; + } + } + else + { + // if (d_CAF_filter) {d_CAF_vector_Q[doppler_index] = magt_QB;} + if (d_CAF_window_hz > 0) + { + d_CAF_vector_Q[doppler_index] = d_magnitudeQB[indext_QB]; + } + for (unsigned int i = 0; i < d_fft_size; i++) + { + d_magnitudeIA[i] += d_magnitudeQB[i]; + } + } + } + volk_gnsssdr_32f_index_max_32u(&indext, d_magnitudeIA, d_fft_size); + magt = d_magnitudeIA[indext] / (fft_normalization_factor * fft_normalization_factor); + } + else + { + // if (d_CAF_filter) {d_CAF_vector_I[doppler_index] = magt_IB;} + if (d_CAF_window_hz > 0) + { + d_CAF_vector_I[doppler_index] = d_magnitudeIB[indext_IB]; + } + if (d_both_signal_components) + { + // Integrate non-coherently I+Q + if (magt_QA >= magt_QB) + { + //if (d_CAF_filter) {d_CAF_vector_Q[doppler_index] = magt_QA;} + if (d_CAF_window_hz > 0) + { + d_CAF_vector_Q[doppler_index] = d_magnitudeQA[indext_QA]; + } + for (unsigned int i = 0; i < d_fft_size; i++) + { + d_magnitudeIB[i] += d_magnitudeQA[i]; + } + } + else + { + // if (d_CAF_filter) {d_CAF_vector_Q[doppler_index] = magt_QB;} + if (d_CAF_window_hz > 0) + { + d_CAF_vector_Q[doppler_index] = d_magnitudeQB[indext_QB]; + } + for (unsigned int i = 0; i < d_fft_size; i++) + { + d_magnitudeIB[i] += d_magnitudeQB[i]; + } + } + } + volk_gnsssdr_32f_index_max_32u(&indext, d_magnitudeIB, d_fft_size); + magt = d_magnitudeIB[indext] / (fft_normalization_factor * fft_normalization_factor); + } + } + else + { + // if (d_CAF_filter) {d_CAF_vector_I[doppler_index] = magt_IA;} + if (d_CAF_window_hz > 0) + { + d_CAF_vector_I[doppler_index] = d_magnitudeIA[indext_IA]; + } + if (d_both_signal_components) + { + // if (d_CAF_filter) {d_CAF_vector_Q[doppler_index] = magt_QA;} + if (d_CAF_window_hz > 0) + { + d_CAF_vector_Q[doppler_index] = d_magnitudeQA[indext_QA]; + } + // NON-Coherent integration of only 1 code + for (unsigned int i = 0; i < d_fft_size; i++) + { + d_magnitudeIA[i] += d_magnitudeQA[i]; + } + } + volk_gnsssdr_32f_index_max_32u(&indext, d_magnitudeIA, d_fft_size); + magt = d_magnitudeIA[indext] / (fft_normalization_factor * fft_normalization_factor); + } - // 4- record the maximum peak and the associated synchronization parameters - if (d_mag < magt) - { - d_mag = magt; - // In case that d_bit_transition_flag = true, we compare the potentially - // new maximum test statistics (d_mag/d_input_power) with the value in - // d_test_statistics. When the second dwell is being processed, the value - // of d_mag/d_input_power could be lower than d_test_statistics (i.e, - // the maximum test statistics in the previous dwell is greater than - // current d_mag/d_input_power). Note that d_test_statistics is not - // restarted between consecutive dwells in multidwell operation. - if (d_test_statistics < (d_mag / d_input_power) || !d_bit_transition_flag) - { - d_gnss_synchro->Acq_delay_samples = static_cast(indext % d_samples_per_code); - d_gnss_synchro->Acq_doppler_hz = static_cast(doppler); - d_gnss_synchro->Acq_samplestamp_samples = d_sample_counter; + // 4- record the maximum peak and the associated synchronization parameters + if (d_mag < magt) + { + d_mag = magt; + // In case that d_bit_transition_flag = true, we compare the potentially + // new maximum test statistics (d_mag/d_input_power) with the value in + // d_test_statistics. When the second dwell is being processed, the value + // of d_mag/d_input_power could be lower than d_test_statistics (i.e, + // the maximum test statistics in the previous dwell is greater than + // current d_mag/d_input_power). Note that d_test_statistics is not + // restarted between consecutive dwells in multidwell operation. + if (d_test_statistics < (d_mag / d_input_power) || !d_bit_transition_flag) + { + d_gnss_synchro->Acq_delay_samples = static_cast(indext % d_samples_per_code); + d_gnss_synchro->Acq_doppler_hz = static_cast(doppler); + d_gnss_synchro->Acq_samplestamp_samples = d_sample_counter; - // 5- Compute the test statistics and compare to the threshold - d_test_statistics = d_mag / d_input_power; - } - } + // 5- Compute the test statistics and compare to the threshold + d_test_statistics = d_mag / d_input_power; + } + } - // Record results to file if required - if (d_dump) - { - std::stringstream filename; - std::streamsize n = sizeof(float) * (d_fft_size); // noncomplex file write - filename.str(""); - filename << "../data/test_statistics_E5a_sat_" - << d_gnss_synchro->PRN << "_doppler_" << doppler << ".dat"; - d_dump_file.open(filename.str().c_str(), std::ios::out | std::ios::binary); - if (d_sampled_ms > 1) // If integration time > 1 code - { - if (magt_IA >= magt_IB) - { - d_dump_file.write(reinterpret_cast(d_magnitudeIA), n); - } - else - { - d_dump_file.write(reinterpret_cast(d_magnitudeIB), n); - } - } - else - { - d_dump_file.write(reinterpret_cast(d_magnitudeIA), n); - } - d_dump_file.close(); - } - } - // std::cout << "d_mag " << d_mag << ".d_sample_counter " << d_sample_counter << ". acq delay " << d_gnss_synchro->Acq_delay_samples<< " indext "<< indext << std::endl; - // 6 OPTIONAL: CAF filter to avoid Doppler ambiguity in bit transition. - if (d_CAF_window_hz > 0) - { - int CAF_bins_half; - float* accum = static_cast(volk_gnsssdr_malloc(sizeof(float), volk_gnsssdr_get_alignment())); - CAF_bins_half = d_CAF_window_hz / (2 * d_doppler_step); - float weighting_factor; - weighting_factor = 0.5 / static_cast(CAF_bins_half); - // weighting_factor = 0; - // std::cout << "weighting_factor " << weighting_factor << std::endl; - // Initialize first iterations - for (int doppler_index = 0; doppler_index < CAF_bins_half; doppler_index++) - { - d_CAF_vector[doppler_index] = 0; - // volk_32f_accumulator_s32f_a(&d_CAF_vector[doppler_index], d_CAF_vector_I, CAF_bins_half+doppler_index+1); - for (int i = 0; i < CAF_bins_half + doppler_index + 1; i++) - { - d_CAF_vector[doppler_index] += d_CAF_vector_I[i] * (1 - weighting_factor * static_cast((doppler_index - i))); - } - // d_CAF_vector[doppler_index] /= CAF_bins_half+doppler_index+1; - d_CAF_vector[doppler_index] /= 1 + CAF_bins_half + doppler_index - weighting_factor * CAF_bins_half * (CAF_bins_half + 1) / 2 - weighting_factor * doppler_index * (doppler_index + 1) / 2; // triangles = [n*(n+1)/2] - if (d_both_signal_components) - { - accum[0] = 0; - // volk_32f_accumulator_s32f_a(&accum[0], d_CAF_vector_Q, CAF_bins_half+doppler_index+1); - for (int i = 0; i < CAF_bins_half + doppler_index + 1; i++) - { - accum[0] += d_CAF_vector_Q[i] * (1 - weighting_factor * static_cast(abs(doppler_index - i))); - } - // accum[0] /= CAF_bins_half+doppler_index+1; - accum[0] /= 1 + CAF_bins_half + doppler_index - weighting_factor * CAF_bins_half * (CAF_bins_half + 1) / 2 - weighting_factor * doppler_index * (doppler_index + 1) / 2; // triangles = [n*(n+1)/2] - d_CAF_vector[doppler_index] += accum[0]; - } - } - // Body loop - for (unsigned int doppler_index = CAF_bins_half; doppler_index < d_num_doppler_bins - CAF_bins_half; doppler_index++) - { - d_CAF_vector[doppler_index] = 0; - // volk_32f_accumulator_s32f_a(&d_CAF_vector[doppler_index], &d_CAF_vector_I[doppler_index-CAF_bins_half], 2*CAF_bins_half+1); - for (int i = doppler_index - CAF_bins_half; i < static_cast(doppler_index + CAF_bins_half + 1); i++) - { - d_CAF_vector[doppler_index] += d_CAF_vector_I[i] * (1 - weighting_factor * static_cast((doppler_index - i))); - } - // d_CAF_vector[doppler_index] /= 2*CAF_bins_half+1; - d_CAF_vector[doppler_index] /= 1 + 2 * CAF_bins_half - 2 * weighting_factor * CAF_bins_half * (CAF_bins_half + 1) / 2; - if (d_both_signal_components) - { - accum[0] = 0; - // volk_32f_accumulator_s32f_a(&accum[0], &d_CAF_vector_Q[doppler_index-CAF_bins_half], 2*CAF_bins_half); - for (int i = doppler_index-CAF_bins_half; i < static_cast(doppler_index + CAF_bins_half + 1); i++) - { - accum[0] += d_CAF_vector_Q[i] * (1 - weighting_factor * static_cast((doppler_index - i))); - } - // accum[0] /= 2*CAF_bins_half+1; - accum[0] /= 1 + 2 * CAF_bins_half - 2 * weighting_factor * CAF_bins_half * (CAF_bins_half + 1) / 2; - d_CAF_vector[doppler_index] += accum[0]; - } - } - // Final iterations - for (int doppler_index = d_num_doppler_bins - CAF_bins_half; doppler_index < static_cast(d_num_doppler_bins); doppler_index++) - { - d_CAF_vector[doppler_index] = 0; - // volk_32f_accumulator_s32f_a(&d_CAF_vector[doppler_index], &d_CAF_vector_I[doppler_index-CAF_bins_half], CAF_bins_half + (d_num_doppler_bins-doppler_index)); - for (int i = doppler_index - CAF_bins_half; i < static_cast(d_num_doppler_bins); i++) - { - d_CAF_vector[doppler_index] += d_CAF_vector_I[i] * (1 - weighting_factor * (abs(doppler_index - i))); - } - // d_CAF_vector[doppler_index] /= CAF_bins_half+(d_num_doppler_bins-doppler_index); - d_CAF_vector[doppler_index] /= 1 + CAF_bins_half + (d_num_doppler_bins - doppler_index - 1) - weighting_factor * CAF_bins_half * (CAF_bins_half + 1) / 2 - weighting_factor * (d_num_doppler_bins - doppler_index - 1) * (d_num_doppler_bins - doppler_index) / 2; - if (d_both_signal_components) - { - accum[0] = 0; - // volk_32f_accumulator_s32f_a(&accum[0], &d_CAF_vector_Q[doppler_index-CAF_bins_half], CAF_bins_half + (d_num_doppler_bins-doppler_index)); - for (int i = doppler_index-CAF_bins_half; i < static_cast(d_num_doppler_bins); i++) - { - accum[0] += d_CAF_vector_Q[i] * (1 - weighting_factor * (abs(doppler_index - i))); - } - // accum[0] /= CAF_bins_half+(d_num_doppler_bins-doppler_index); - accum[0] /= 1 + CAF_bins_half + (d_num_doppler_bins - doppler_index - 1) - weighting_factor * CAF_bins_half * (CAF_bins_half + 1) / 2 - weighting_factor * (d_num_doppler_bins - doppler_index - 1) * (d_num_doppler_bins - doppler_index) / 2; - d_CAF_vector[doppler_index] += accum[0]; - } - } + // Record results to file if required + if (d_dump) + { + std::stringstream filename; + std::streamsize n = sizeof(float) * (d_fft_size); // noncomplex file write + filename.str(""); + filename << "../data/test_statistics_E5a_sat_" + << d_gnss_synchro->PRN << "_doppler_" << doppler << ".dat"; + d_dump_file.open(filename.str().c_str(), std::ios::out | std::ios::binary); + if (d_sampled_ms > 1) // If integration time > 1 code + { + if (magt_IA >= magt_IB) + { + d_dump_file.write(reinterpret_cast(d_magnitudeIA), n); + } + else + { + d_dump_file.write(reinterpret_cast(d_magnitudeIB), n); + } + } + else + { + d_dump_file.write(reinterpret_cast(d_magnitudeIA), n); + } + d_dump_file.close(); + } + } + // std::cout << "d_mag " << d_mag << ".d_sample_counter " << d_sample_counter << ". acq delay " << d_gnss_synchro->Acq_delay_samples<< " indext "<< indext << std::endl; + // 6 OPTIONAL: CAF filter to avoid Doppler ambiguity in bit transition. + if (d_CAF_window_hz > 0) + { + int CAF_bins_half; + float *accum = static_cast(volk_gnsssdr_malloc(sizeof(float), volk_gnsssdr_get_alignment())); + CAF_bins_half = d_CAF_window_hz / (2 * d_doppler_step); + float weighting_factor; + weighting_factor = 0.5 / static_cast(CAF_bins_half); + // weighting_factor = 0; + // std::cout << "weighting_factor " << weighting_factor << std::endl; + // Initialize first iterations + for (int doppler_index = 0; doppler_index < CAF_bins_half; doppler_index++) + { + d_CAF_vector[doppler_index] = 0; + // volk_32f_accumulator_s32f_a(&d_CAF_vector[doppler_index], d_CAF_vector_I, CAF_bins_half+doppler_index+1); + for (int i = 0; i < CAF_bins_half + doppler_index + 1; i++) + { + d_CAF_vector[doppler_index] += d_CAF_vector_I[i] * (1 - weighting_factor * static_cast((doppler_index - i))); + } + // d_CAF_vector[doppler_index] /= CAF_bins_half+doppler_index+1; + d_CAF_vector[doppler_index] /= 1 + CAF_bins_half + doppler_index - weighting_factor * CAF_bins_half * (CAF_bins_half + 1) / 2 - weighting_factor * doppler_index * (doppler_index + 1) / 2; // triangles = [n*(n+1)/2] + if (d_both_signal_components) + { + accum[0] = 0; + // volk_32f_accumulator_s32f_a(&accum[0], d_CAF_vector_Q, CAF_bins_half+doppler_index+1); + for (int i = 0; i < CAF_bins_half + doppler_index + 1; i++) + { + accum[0] += d_CAF_vector_Q[i] * (1 - weighting_factor * static_cast(abs(doppler_index - i))); + } + // accum[0] /= CAF_bins_half+doppler_index+1; + accum[0] /= 1 + CAF_bins_half + doppler_index - weighting_factor * CAF_bins_half * (CAF_bins_half + 1) / 2 - weighting_factor * doppler_index * (doppler_index + 1) / 2; // triangles = [n*(n+1)/2] + d_CAF_vector[doppler_index] += accum[0]; + } + } + // Body loop + for (unsigned int doppler_index = CAF_bins_half; doppler_index < d_num_doppler_bins - CAF_bins_half; doppler_index++) + { + d_CAF_vector[doppler_index] = 0; + // volk_32f_accumulator_s32f_a(&d_CAF_vector[doppler_index], &d_CAF_vector_I[doppler_index-CAF_bins_half], 2*CAF_bins_half+1); + for (int i = doppler_index - CAF_bins_half; i < static_cast(doppler_index + CAF_bins_half + 1); i++) + { + d_CAF_vector[doppler_index] += d_CAF_vector_I[i] * (1 - weighting_factor * static_cast((doppler_index - i))); + } + // d_CAF_vector[doppler_index] /= 2*CAF_bins_half+1; + d_CAF_vector[doppler_index] /= 1 + 2 * CAF_bins_half - 2 * weighting_factor * CAF_bins_half * (CAF_bins_half + 1) / 2; + if (d_both_signal_components) + { + accum[0] = 0; + // volk_32f_accumulator_s32f_a(&accum[0], &d_CAF_vector_Q[doppler_index-CAF_bins_half], 2*CAF_bins_half); + for (int i = doppler_index - CAF_bins_half; i < static_cast(doppler_index + CAF_bins_half + 1); i++) + { + accum[0] += d_CAF_vector_Q[i] * (1 - weighting_factor * static_cast((doppler_index - i))); + } + // accum[0] /= 2*CAF_bins_half+1; + accum[0] /= 1 + 2 * CAF_bins_half - 2 * weighting_factor * CAF_bins_half * (CAF_bins_half + 1) / 2; + d_CAF_vector[doppler_index] += accum[0]; + } + } + // Final iterations + for (int doppler_index = d_num_doppler_bins - CAF_bins_half; doppler_index < static_cast(d_num_doppler_bins); doppler_index++) + { + d_CAF_vector[doppler_index] = 0; + // volk_32f_accumulator_s32f_a(&d_CAF_vector[doppler_index], &d_CAF_vector_I[doppler_index-CAF_bins_half], CAF_bins_half + (d_num_doppler_bins-doppler_index)); + for (int i = doppler_index - CAF_bins_half; i < static_cast(d_num_doppler_bins); i++) + { + d_CAF_vector[doppler_index] += d_CAF_vector_I[i] * (1 - weighting_factor * (abs(doppler_index - i))); + } + // d_CAF_vector[doppler_index] /= CAF_bins_half+(d_num_doppler_bins-doppler_index); + d_CAF_vector[doppler_index] /= 1 + CAF_bins_half + (d_num_doppler_bins - doppler_index - 1) - weighting_factor * CAF_bins_half * (CAF_bins_half + 1) / 2 - weighting_factor * (d_num_doppler_bins - doppler_index - 1) * (d_num_doppler_bins - doppler_index) / 2; + if (d_both_signal_components) + { + accum[0] = 0; + // volk_32f_accumulator_s32f_a(&accum[0], &d_CAF_vector_Q[doppler_index-CAF_bins_half], CAF_bins_half + (d_num_doppler_bins-doppler_index)); + for (int i = doppler_index - CAF_bins_half; i < static_cast(d_num_doppler_bins); i++) + { + accum[0] += d_CAF_vector_Q[i] * (1 - weighting_factor * (abs(doppler_index - i))); + } + // accum[0] /= CAF_bins_half+(d_num_doppler_bins-doppler_index); + accum[0] /= 1 + CAF_bins_half + (d_num_doppler_bins - doppler_index - 1) - weighting_factor * CAF_bins_half * (CAF_bins_half + 1) / 2 - weighting_factor * (d_num_doppler_bins - doppler_index - 1) * (d_num_doppler_bins - doppler_index) / 2; + d_CAF_vector[doppler_index] += accum[0]; + } + } - // Recompute the maximum doppler peak - volk_gnsssdr_32f_index_max_32u(&indext, d_CAF_vector, d_num_doppler_bins); - doppler = -static_cast(d_doppler_max) + d_doppler_step * indext; - d_gnss_synchro->Acq_doppler_hz = static_cast(doppler); - // Dump if required, appended at the end of the file - if (d_dump) - { - std::stringstream filename; - std::streamsize n = sizeof(float) * (d_num_doppler_bins); // noncomplex file write - filename.str(""); - filename << "../data/test_statistics_E5a_sat_" << d_gnss_synchro->PRN << "_CAF.dat"; - d_dump_file.open(filename.str().c_str(), std::ios::out | std::ios::binary); - d_dump_file.write(reinterpret_cast(d_CAF_vector), n); - d_dump_file.close(); - } - volk_gnsssdr_free(accum); - } + // Recompute the maximum doppler peak + volk_gnsssdr_32f_index_max_32u(&indext, d_CAF_vector, d_num_doppler_bins); + doppler = -static_cast(d_doppler_max) + d_doppler_step * indext; + d_gnss_synchro->Acq_doppler_hz = static_cast(doppler); + // Dump if required, appended at the end of the file + if (d_dump) + { + std::stringstream filename; + std::streamsize n = sizeof(float) * (d_num_doppler_bins); // noncomplex file write + filename.str(""); + filename << "../data/test_statistics_E5a_sat_" << d_gnss_synchro->PRN << "_CAF.dat"; + d_dump_file.open(filename.str().c_str(), std::ios::out | std::ios::binary); + d_dump_file.write(reinterpret_cast(d_CAF_vector), n); + d_dump_file.close(); + } + volk_gnsssdr_free(accum); + } - if (d_well_count == d_max_dwells) - { - if (d_test_statistics > d_threshold) - { - d_state = 3; // Positive acquisition - } - else - { - d_state = 4; // Negative acquisition - } - } - else - { - d_state = 1; - } + if (d_well_count == d_max_dwells) + { + if (d_test_statistics > d_threshold) + { + d_state = 3; // Positive acquisition + } + else + { + d_state = 4; // Negative acquisition + } + } + else + { + d_state = 1; + } - consume_each(d_fft_size - d_buffer_count); - d_buffer_count = 0; - break; + consume_each(d_fft_size - d_buffer_count); + d_buffer_count = 0; + break; + } + case 3: + { + // 7.1- Declare positive acquisition using a message port + DLOG(INFO) << "positive acquisition"; + DLOG(INFO) << "satellite " << d_gnss_synchro->System << " " << d_gnss_synchro->PRN; + DLOG(INFO) << "sample_stamp " << d_sample_counter; + DLOG(INFO) << "test statistics value " << d_test_statistics; + DLOG(INFO) << "test statistics threshold " << d_threshold; + DLOG(INFO) << "code phase " << d_gnss_synchro->Acq_delay_samples; + DLOG(INFO) << "doppler " << d_gnss_synchro->Acq_doppler_hz; + DLOG(INFO) << "magnitude " << d_mag; + DLOG(INFO) << "input signal power " << d_input_power; + + d_active = false; + d_state = 0; + + acquisition_message = 1; + this->message_port_pub(pmt::mp("events"), pmt::from_long(acquisition_message)); + d_sample_counter += ninput_items[0]; // sample counter + consume_each(ninput_items[0]); + break; + } + case 4: + { + // 7.2- Declare negative acquisition using a message port + DLOG(INFO) << "negative acquisition"; + DLOG(INFO) << "satellite " << d_gnss_synchro->System << " " << d_gnss_synchro->PRN; + DLOG(INFO) << "sample_stamp " << d_sample_counter; + DLOG(INFO) << "test statistics value " << d_test_statistics; + DLOG(INFO) << "test statistics threshold " << d_threshold; + DLOG(INFO) << "code phase " << d_gnss_synchro->Acq_delay_samples; + DLOG(INFO) << "doppler " << d_gnss_synchro->Acq_doppler_hz; + DLOG(INFO) << "magnitude " << d_mag; + DLOG(INFO) << "input signal power " << d_input_power; + + d_active = false; + d_state = 0; + + d_sample_counter += ninput_items[0]; // sample counter + consume_each(ninput_items[0]); + acquisition_message = 2; + this->message_port_pub(pmt::mp("events"), pmt::from_long(acquisition_message)); + break; + } } - case 3: - { - // 7.1- Declare positive acquisition using a message port - DLOG(INFO) << "positive acquisition"; - DLOG(INFO) << "satellite " << d_gnss_synchro->System << " " << d_gnss_synchro->PRN; - DLOG(INFO) << "sample_stamp " << d_sample_counter; - DLOG(INFO) << "test statistics value " << d_test_statistics; - DLOG(INFO) << "test statistics threshold " << d_threshold; - DLOG(INFO) << "code phase " << d_gnss_synchro->Acq_delay_samples; - DLOG(INFO) << "doppler " << d_gnss_synchro->Acq_doppler_hz; - DLOG(INFO) << "magnitude " << d_mag; - DLOG(INFO) << "input signal power " << d_input_power; - - d_active = false; - d_state = 0; - - acquisition_message = 1; - this->message_port_pub(pmt::mp("events"), pmt::from_long(acquisition_message)); - d_sample_counter += ninput_items[0]; // sample counter - consume_each(ninput_items[0]); - break; - } - case 4: - { - // 7.2- Declare negative acquisition using a message port - DLOG(INFO) << "negative acquisition"; - DLOG(INFO) << "satellite " << d_gnss_synchro->System << " " << d_gnss_synchro->PRN; - DLOG(INFO) << "sample_stamp " << d_sample_counter; - DLOG(INFO) << "test statistics value " << d_test_statistics; - DLOG(INFO) << "test statistics threshold " << d_threshold; - DLOG(INFO) << "code phase " << d_gnss_synchro->Acq_delay_samples; - DLOG(INFO) << "doppler " << d_gnss_synchro->Acq_doppler_hz; - DLOG(INFO) << "magnitude " << d_mag; - DLOG(INFO) << "input signal power " << d_input_power; - - d_active = false; - d_state = 0; - - d_sample_counter += ninput_items[0]; // sample counter - consume_each(ninput_items[0]); - acquisition_message = 2; - this->message_port_pub(pmt::mp("events"), pmt::from_long(acquisition_message)); - break; - } - } return 0; } - diff --git a/src/algorithms/acquisition/gnuradio_blocks/galileo_e5a_noncoherent_iq_acquisition_caf_cc.h b/src/algorithms/acquisition/gnuradio_blocks/galileo_e5a_noncoherent_iq_acquisition_caf_cc.h index ab44e54c7..4d4cf61c0 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/galileo_e5a_noncoherent_iq_acquisition_caf_cc.h +++ b/src/algorithms/acquisition/gnuradio_blocks/galileo_e5a_noncoherent_iq_acquisition_caf_cc.h @@ -51,15 +51,15 @@ typedef boost::shared_ptr galileo_ galileo_e5a_noncoherentIQ_acquisition_caf_cc_sptr galileo_e5a_noncoherentIQ_make_acquisition_caf_cc(unsigned int sampled_ms, - unsigned int max_dwells, - unsigned int doppler_max, long freq, long fs_in, - int samples_per_ms, int samples_per_code, - bool bit_transition_flag, - bool dump, - std::string dump_filename, - bool both_signal_components_, - int CAF_window_hz_, - int Zero_padding_); + unsigned int max_dwells, + unsigned int doppler_max, long freq, long fs_in, + int samples_per_ms, int samples_per_code, + bool bit_transition_flag, + bool dump, + std::string dump_filename, + bool both_signal_components_, + int CAF_window_hz_, + int Zero_padding_); /*! * \brief This class implements a Parallel Code Phase Search Acquisition. @@ -67,37 +67,37 @@ galileo_e5a_noncoherentIQ_make_acquisition_caf_cc(unsigned int sampled_ms, * Check \ref Navitec2012 "An Open Source Galileo E1 Software Receiver", * Algorithm 1, for a pseudocode description of this implementation. */ -class galileo_e5a_noncoherentIQ_acquisition_caf_cc: public gr::block +class galileo_e5a_noncoherentIQ_acquisition_caf_cc : public gr::block { private: friend galileo_e5a_noncoherentIQ_acquisition_caf_cc_sptr galileo_e5a_noncoherentIQ_make_acquisition_caf_cc( - unsigned int sampled_ms, - unsigned int max_dwells, - unsigned int doppler_max, long freq, long fs_in, - int samples_per_ms, int samples_per_code, - bool bit_transition_flag, - bool dump, - std::string dump_filename, - bool both_signal_components_, - int CAF_window_hz_, - int Zero_padding_); + unsigned int sampled_ms, + unsigned int max_dwells, + unsigned int doppler_max, long freq, long fs_in, + int samples_per_ms, int samples_per_code, + bool bit_transition_flag, + bool dump, + std::string dump_filename, + bool both_signal_components_, + int CAF_window_hz_, + int Zero_padding_); galileo_e5a_noncoherentIQ_acquisition_caf_cc( - unsigned int sampled_ms, - unsigned int max_dwells, - unsigned int doppler_max, long freq, long fs_in, - int samples_per_ms, int samples_per_code, - bool bit_transition_flag, - bool dump, - std::string dump_filename, - bool both_signal_components_, - int CAF_window_hz_, - int Zero_padding_); + unsigned int sampled_ms, + unsigned int max_dwells, + unsigned int doppler_max, long freq, long fs_in, + int samples_per_ms, int samples_per_code, + bool bit_transition_flag, + bool dump, + std::string dump_filename, + bool both_signal_components_, + int CAF_window_hz_, + int Zero_padding_); void calculate_magnitudes(gr_complex* fft_begin, int doppler_shift, - int doppler_offset); - float estimate_input_power(gr_complex *in ); + int doppler_offset); + float estimate_input_power(gr_complex* in); long d_fs_in; long d_freq; @@ -122,7 +122,7 @@ private: gr_complex* d_inbuffer; gr::fft::fft_complex* d_fft_if; gr::fft::fft_complex* d_ifft; - Gnss_Synchro *d_gnss_synchro; + Gnss_Synchro* d_gnss_synchro; unsigned int d_code_phase; float d_doppler_freq; float d_mag; @@ -138,14 +138,14 @@ private: int d_state; bool d_dump; bool d_both_signal_components; -// bool d_CAF_filter; + // bool d_CAF_filter; int d_CAF_window_hz; float* d_CAF_vector; float* d_CAF_vector_I; float* d_CAF_vector_Q; -// double* d_CAF_vector; -// double* d_CAF_vector_I; -// double* d_CAF_vector_Q; + // double* d_CAF_vector; + // double* d_CAF_vector_I; + // double* d_CAF_vector_Q; unsigned int d_channel; std::string d_dump_filename; unsigned int d_buffer_count; @@ -155,97 +155,96 @@ public: /*! * \brief Default destructor. */ - ~galileo_e5a_noncoherentIQ_acquisition_caf_cc(); + ~galileo_e5a_noncoherentIQ_acquisition_caf_cc(); - /*! + /*! * \brief Set acquisition/tracking common Gnss_Synchro object pointer * to exchange synchronization data between acquisition and tracking blocks. * \param p_gnss_synchro Satellite information shared by the processing blocks. */ - inline void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) - { - d_gnss_synchro = p_gnss_synchro; - } + inline void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) + { + d_gnss_synchro = p_gnss_synchro; + } - /*! + /*! * \brief Returns the maximum peak of grid search. */ - inline unsigned int mag() const - { - return d_mag; - } + inline unsigned int mag() const + { + return d_mag; + } - /*! + /*! * \brief Initializes acquisition algorithm. */ - void init(); + void init(); - /*! + /*! * \brief Sets local code for PCPS acquisition algorithm. * \param code - Pointer to the PRN code. */ - void set_local_code(std::complex * code, std::complex * codeQ); + void set_local_code(std::complex* code, std::complex* codeQ); - /*! + /*! * \brief Starts acquisition algorithm, turning from standby mode to * active mode * \param active - bool that activates/deactivates the block. */ - inline void set_active(bool active) - { - d_active = active; - } + inline void set_active(bool active) + { + d_active = active; + } - /*! + /*! * \brief If set to 1, ensures that acquisition starts at the * first available sample. * \param state - int=1 forces start of acquisition */ - void set_state(int state); + void set_state(int state); - /*! + /*! * \brief Set acquisition channel unique ID * \param channel - receiver channel. */ - inline void set_channel(unsigned int channel) - { - d_channel = channel; - } + inline void set_channel(unsigned int channel) + { + d_channel = channel; + } - /*! + /*! * \brief Set statistics threshold of PCPS algorithm. * \param threshold - Threshold for signal detection (check \ref Navitec2012, * Algorithm 1, for a definition of this threshold). */ - inline void set_threshold(float threshold) - { - d_threshold = threshold; - } + inline void set_threshold(float threshold) + { + d_threshold = threshold; + } - /*! + /*! * \brief Set maximum Doppler grid search * \param doppler_max - Maximum Doppler shift considered in the grid search [Hz]. */ - inline void set_doppler_max(unsigned int doppler_max) - { - d_doppler_max = doppler_max; - } + inline void set_doppler_max(unsigned int doppler_max) + { + d_doppler_max = doppler_max; + } - /*! + /*! * \brief Set Doppler steps for the grid search * \param doppler_step - Frequency bin of the search grid [Hz]. */ - inline void set_doppler_step(unsigned int doppler_step) - { - d_doppler_step = doppler_step; - } + inline void set_doppler_step(unsigned int doppler_step) + { + d_doppler_step = doppler_step; + } - /*! + /*! * \brief Parallel Code Phase Search Acquisition signal processing. */ - int general_work(int noutput_items, gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - + int general_work(int noutput_items, gr_vector_int& ninput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items); }; #endif /* GALILEO_E5A_NONCOHERENT_IQ_ACQUISITION_CAF_CC_H_ */ diff --git a/src/algorithms/acquisition/gnuradio_blocks/galileo_pcps_8ms_acquisition_cc.cc b/src/algorithms/acquisition/gnuradio_blocks/galileo_pcps_8ms_acquisition_cc.cc index 1ccaa8fb4..c1c6c21dc 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/galileo_pcps_8ms_acquisition_cc.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/galileo_pcps_8ms_acquisition_cc.cc @@ -40,28 +40,27 @@ using google::LogMessage; galileo_pcps_8ms_acquisition_cc_sptr galileo_pcps_8ms_make_acquisition_cc( - unsigned int sampled_ms, unsigned int max_dwells, - unsigned int doppler_max, long freq, long fs_in, - int samples_per_ms, int samples_per_code, - bool dump, std::string dump_filename) + unsigned int sampled_ms, unsigned int max_dwells, + unsigned int doppler_max, long freq, long fs_in, + int samples_per_ms, int samples_per_code, + bool dump, std::string dump_filename) { - return galileo_pcps_8ms_acquisition_cc_sptr( - new galileo_pcps_8ms_acquisition_cc(sampled_ms, max_dwells, doppler_max, freq, fs_in, samples_per_ms, - samples_per_code, dump, dump_filename)); + new galileo_pcps_8ms_acquisition_cc(sampled_ms, max_dwells, doppler_max, freq, fs_in, samples_per_ms, + samples_per_code, dump, dump_filename)); } galileo_pcps_8ms_acquisition_cc::galileo_pcps_8ms_acquisition_cc( - unsigned int sampled_ms, unsigned int max_dwells, - unsigned int doppler_max, long freq, long fs_in, - int samples_per_ms, int samples_per_code, - bool dump, std::string dump_filename) : - gr::block("galileo_pcps_8ms_acquisition_cc", - gr::io_signature::make(1, 1, sizeof(gr_complex) * sampled_ms * samples_per_ms), - gr::io_signature::make(0, 0, sizeof(gr_complex) * sampled_ms * samples_per_ms)) + unsigned int sampled_ms, unsigned int max_dwells, + unsigned int doppler_max, long freq, long fs_in, + int samples_per_ms, int samples_per_code, + bool dump, + std::string dump_filename) : gr::block("galileo_pcps_8ms_acquisition_cc", + gr::io_signature::make(1, 1, sizeof(gr_complex) * sampled_ms * samples_per_ms), + gr::io_signature::make(0, 0, sizeof(gr_complex) * sampled_ms * samples_per_ms)) { this->message_port_register_out(pmt::mp("events")); - d_sample_counter = 0; // SAMPLE COUNTER + d_sample_counter = 0; // SAMPLE COUNTER d_active = false; d_state = 0; d_freq = freq; @@ -77,9 +76,9 @@ galileo_pcps_8ms_acquisition_cc::galileo_pcps_8ms_acquisition_cc( d_input_power = 0.0; d_num_doppler_bins = 0; - d_fft_code_A = static_cast(volk_gnsssdr_malloc(d_fft_size * sizeof(gr_complex), volk_gnsssdr_get_alignment())); - d_fft_code_B = static_cast(volk_gnsssdr_malloc(d_fft_size * sizeof(gr_complex), volk_gnsssdr_get_alignment())); - d_magnitude = static_cast(volk_gnsssdr_malloc(d_fft_size * sizeof(float), volk_gnsssdr_get_alignment())); + d_fft_code_A = static_cast(volk_gnsssdr_malloc(d_fft_size * sizeof(gr_complex), volk_gnsssdr_get_alignment())); + d_fft_code_B = static_cast(volk_gnsssdr_malloc(d_fft_size * sizeof(gr_complex), volk_gnsssdr_get_alignment())); + d_magnitude = static_cast(volk_gnsssdr_malloc(d_fft_size * sizeof(float), volk_gnsssdr_get_alignment())); // Direct FFT d_fft_if = new gr::fft::fft_complex(d_fft_size, true); @@ -126,22 +125,22 @@ galileo_pcps_8ms_acquisition_cc::~galileo_pcps_8ms_acquisition_cc() } } -void galileo_pcps_8ms_acquisition_cc::set_local_code(std::complex * code) +void galileo_pcps_8ms_acquisition_cc::set_local_code(std::complex *code) { // code A: two replicas of a primary code - memcpy(d_fft_if->get_inbuf(), code, sizeof(gr_complex)*d_fft_size); + memcpy(d_fft_if->get_inbuf(), code, sizeof(gr_complex) * d_fft_size); - d_fft_if->execute(); // We need the FFT of local code + d_fft_if->execute(); // We need the FFT of local code //Conjugate the local code volk_32fc_conjugate_32fc(d_fft_code_A, d_fft_if->get_outbuf(), d_fft_size); // code B: two replicas of a primary code; the second replica is inverted. volk_32fc_s32fc_multiply_32fc(&(d_fft_if->get_inbuf())[d_samples_per_code], - &code[d_samples_per_code], gr_complex(-1,0), - d_samples_per_code); + &code[d_samples_per_code], gr_complex(-1, 0), + d_samples_per_code); - d_fft_if->execute(); // We need the FFT of local code + d_fft_if->execute(); // We need the FFT of local code //Conjugate the local code volk_32fc_conjugate_32fc(d_fft_code_B, d_fft_if->get_outbuf(), d_fft_size); @@ -163,22 +162,22 @@ void galileo_pcps_8ms_acquisition_cc::init() // Count the number of bins d_num_doppler_bins = 0; for (int doppler = static_cast(-d_doppler_max); - doppler <= static_cast(d_doppler_max); - doppler += d_doppler_step) + doppler <= static_cast(d_doppler_max); + doppler += d_doppler_step) { d_num_doppler_bins++; } // Create the carrier Doppler wipeoff signals - d_grid_doppler_wipeoffs = new gr_complex*[d_num_doppler_bins]; + d_grid_doppler_wipeoffs = new gr_complex *[d_num_doppler_bins]; for (unsigned int doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++) { - d_grid_doppler_wipeoffs[doppler_index] = static_cast(volk_gnsssdr_malloc(d_fft_size * sizeof(gr_complex), volk_gnsssdr_get_alignment())); + d_grid_doppler_wipeoffs[doppler_index] = static_cast(volk_gnsssdr_malloc(d_fft_size * sizeof(gr_complex), volk_gnsssdr_get_alignment())); int doppler = -static_cast(d_doppler_max) + d_doppler_step * doppler_index; float phase_step_rad = static_cast(GALILEO_TWO_PI) * (d_freq + doppler) / static_cast(d_fs_in); float _phase[1]; _phase[0] = 0; - volk_gnsssdr_s32f_sincos_32fc(d_grid_doppler_wipeoffs[doppler_index], - phase_step_rad, _phase, d_fft_size); + volk_gnsssdr_s32f_sincos_32fc(d_grid_doppler_wipeoffs[doppler_index], -phase_step_rad, _phase, d_fft_size); } } @@ -197,7 +196,8 @@ void galileo_pcps_8ms_acquisition_cc::set_state(int state) d_test_statistics = 0.0; } else if (d_state == 0) - {} + { + } else { LOG(ERROR) << "State can only be set to 0 or 1"; @@ -205,216 +205,215 @@ void galileo_pcps_8ms_acquisition_cc::set_state(int state) } - int galileo_pcps_8ms_acquisition_cc::general_work(int noutput_items, - gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items __attribute__((unused))) + gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items __attribute__((unused))) { - int acquisition_message = -1; //0=STOP_CHANNEL 1=ACQ_SUCCEES 2=ACQ_FAIL + int acquisition_message = -1; //0=STOP_CHANNEL 1=ACQ_SUCCEES 2=ACQ_FAIL switch (d_state) - { - case 0: { - if (d_active) - { - //restart acquisition variables - d_gnss_synchro->Acq_delay_samples = 0.0; - d_gnss_synchro->Acq_doppler_hz = 0.0; - d_gnss_synchro->Acq_samplestamp_samples = 0; - d_well_count = 0; - d_mag = 0.0; - d_input_power = 0.0; - d_test_statistics = 0.0; + case 0: + { + if (d_active) + { + //restart acquisition variables + d_gnss_synchro->Acq_delay_samples = 0.0; + d_gnss_synchro->Acq_doppler_hz = 0.0; + d_gnss_synchro->Acq_samplestamp_samples = 0; + d_well_count = 0; + d_mag = 0.0; + d_input_power = 0.0; + d_test_statistics = 0.0; - d_state = 1; - } + d_state = 1; + } - d_sample_counter += d_fft_size * ninput_items[0]; // sample counter - consume_each(ninput_items[0]); + d_sample_counter += d_fft_size * ninput_items[0]; // sample counter + consume_each(ninput_items[0]); - break; + break; + } + + case 1: + { + // initialize acquisition algorithm + int doppler; + uint32_t indext = 0; + uint32_t indext_A = 0; + uint32_t indext_B = 0; + float magt = 0.0; + float magt_A = 0.0; + float magt_B = 0.0; + const gr_complex *in = reinterpret_cast(input_items[0]); //Get the input samples pointer + float fft_normalization_factor = static_cast(d_fft_size) * static_cast(d_fft_size); + d_input_power = 0.0; + d_mag = 0.0; + + d_sample_counter += d_fft_size; // sample counter + + d_well_count++; + + DLOG(INFO) << "Channel: " << d_channel + << " , doing acquisition of satellite: " << d_gnss_synchro->System << " " << d_gnss_synchro->PRN + << " ,sample stamp: " << d_sample_counter << ", threshold: " + << d_threshold << ", doppler_max: " << d_doppler_max + << ", doppler_step: " << d_doppler_step; + + // 1- Compute the input signal power estimation + volk_32fc_magnitude_squared_32f(d_magnitude, in, d_fft_size); + volk_32f_accumulator_s32f(&d_input_power, d_magnitude, d_fft_size); + d_input_power /= static_cast(d_fft_size); + + // 2- Doppler frequency search loop + for (unsigned int doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++) + { + // doppler search steps + doppler = -static_cast(d_doppler_max) + d_doppler_step * doppler_index; + + volk_32fc_x2_multiply_32fc(d_fft_if->get_inbuf(), in, + d_grid_doppler_wipeoffs[doppler_index], d_fft_size); + + // 3- Perform the FFT-based convolution (parallel time search) + // Compute the FFT of the carrier wiped--off incoming signal + d_fft_if->execute(); + + // Multiply carrier wiped--off, Fourier transformed incoming signal + // with the local FFT'd code A reference using SIMD operations with + // VOLK library + volk_32fc_x2_multiply_32fc(d_ifft->get_inbuf(), + d_fft_if->get_outbuf(), d_fft_code_A, d_fft_size); + + // compute the inverse FFT + d_ifft->execute(); + + // Search maximum + volk_32fc_magnitude_squared_32f(d_magnitude, d_ifft->get_outbuf(), d_fft_size); + volk_gnsssdr_32f_index_max_32u(&indext_A, d_magnitude, d_fft_size); + + // Normalize the maximum value to correct the scale factor introduced by FFTW + magt_A = d_magnitude[indext_A] / (fft_normalization_factor * fft_normalization_factor); + + // Multiply carrier wiped--off, Fourier transformed incoming signal + // with the local FFT'd code B reference using SIMD operations with + // VOLK library + volk_32fc_x2_multiply_32fc(d_ifft->get_inbuf(), + d_fft_if->get_outbuf(), d_fft_code_B, d_fft_size); + + // compute the inverse FFT + d_ifft->execute(); + + // Search maximum + volk_32fc_magnitude_squared_32f(d_magnitude, d_ifft->get_outbuf(), d_fft_size); + volk_gnsssdr_32f_index_max_32u(&indext_B, d_magnitude, d_fft_size); + + // Normalize the maximum value to correct the scale factor introduced by FFTW + magt_B = d_magnitude[indext_B] / (fft_normalization_factor * fft_normalization_factor); + + // Take the greater magnitude + if (magt_A >= magt_B) + { + magt = magt_A; + indext = indext_A; + } + else + { + magt = magt_B; + indext = indext_B; + } + + // 4- record the maximum peak and the associated synchronization parameters + if (d_mag < magt) + { + d_mag = magt; + d_gnss_synchro->Acq_delay_samples = static_cast(indext % d_samples_per_code); + d_gnss_synchro->Acq_doppler_hz = static_cast(doppler); + d_gnss_synchro->Acq_samplestamp_samples = d_sample_counter; + } + + // Record results to file if required + if (d_dump) + { + std::stringstream filename; + std::streamsize n = 2 * sizeof(float) * (d_fft_size); // complex file write + filename.str(""); + filename << "../data/test_statistics_" << d_gnss_synchro->System + << "_" << d_gnss_synchro->Signal << "_sat_" + << d_gnss_synchro->PRN << "_doppler_" << doppler << ".dat"; + d_dump_file.open(filename.str().c_str(), std::ios::out | std::ios::binary); + d_dump_file.write(reinterpret_cast(d_ifft->get_outbuf()), n); //write directly |abs(x)|^2 in this Doppler bin? + d_dump_file.close(); + } + } + + // 5- Compute the test statistics and compare to the threshold + //d_test_statistics = 2 * d_fft_size * d_mag / d_input_power; + d_test_statistics = d_mag / d_input_power; + + if (d_test_statistics > d_threshold) + { + d_state = 2; // Positive acquisition + } + else if (d_well_count == d_max_dwells) + { + d_state = 3; // Negative acquisition + } + + consume_each(1); + + break; + } + + case 2: + { + // 6.1- Declare positive acquisition using a message port + DLOG(INFO) << "positive acquisition"; + DLOG(INFO) << "satellite " << d_gnss_synchro->System << " " << d_gnss_synchro->PRN; + DLOG(INFO) << "sample_stamp " << d_sample_counter; + DLOG(INFO) << "test statistics value " << d_test_statistics; + DLOG(INFO) << "test statistics threshold " << d_threshold; + DLOG(INFO) << "code phase " << d_gnss_synchro->Acq_delay_samples; + DLOG(INFO) << "doppler " << d_gnss_synchro->Acq_doppler_hz; + DLOG(INFO) << "magnitude " << d_mag; + DLOG(INFO) << "input signal power " << d_input_power; + + d_active = false; + d_state = 0; + + d_sample_counter += d_fft_size * ninput_items[0]; // sample counter + consume_each(ninput_items[0]); + + acquisition_message = 1; + this->message_port_pub(pmt::mp("events"), pmt::from_long(acquisition_message)); + + break; + } + + case 3: + { + // 6.2- Declare negative acquisition using a message port + DLOG(INFO) << "negative acquisition"; + DLOG(INFO) << "satellite " << d_gnss_synchro->System << " " << d_gnss_synchro->PRN; + DLOG(INFO) << "sample_stamp " << d_sample_counter; + DLOG(INFO) << "test statistics value " << d_test_statistics; + DLOG(INFO) << "test statistics threshold " << d_threshold; + DLOG(INFO) << "code phase " << d_gnss_synchro->Acq_delay_samples; + DLOG(INFO) << "doppler " << d_gnss_synchro->Acq_doppler_hz; + DLOG(INFO) << "magnitude " << d_mag; + DLOG(INFO) << "input signal power " << d_input_power; + + d_active = false; + d_state = 0; + + d_sample_counter += d_fft_size * ninput_items[0]; // sample counter + consume_each(ninput_items[0]); + + acquisition_message = 2; + this->message_port_pub(pmt::mp("events"), pmt::from_long(acquisition_message)); + + break; + } } - case 1: - { - // initialize acquisition algorithm - int doppler; - uint32_t indext = 0; - uint32_t indext_A = 0; - uint32_t indext_B = 0; - float magt = 0.0; - float magt_A = 0.0; - float magt_B = 0.0; - const gr_complex *in = reinterpret_cast(input_items[0]); //Get the input samples pointer - float fft_normalization_factor = static_cast(d_fft_size) * static_cast(d_fft_size); - d_input_power = 0.0; - d_mag = 0.0; - - d_sample_counter += d_fft_size; // sample counter - - d_well_count++; - - DLOG(INFO) << "Channel: " << d_channel - << " , doing acquisition of satellite: " << d_gnss_synchro->System << " "<< d_gnss_synchro->PRN - << " ,sample stamp: " << d_sample_counter << ", threshold: " - << d_threshold << ", doppler_max: " << d_doppler_max - << ", doppler_step: " << d_doppler_step; - - // 1- Compute the input signal power estimation - volk_32fc_magnitude_squared_32f(d_magnitude, in, d_fft_size); - volk_32f_accumulator_s32f(&d_input_power, d_magnitude, d_fft_size); - d_input_power /= static_cast(d_fft_size); - - // 2- Doppler frequency search loop - for (unsigned int doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++) - { - // doppler search steps - doppler = -static_cast(d_doppler_max) + d_doppler_step * doppler_index; - - volk_32fc_x2_multiply_32fc(d_fft_if->get_inbuf(), in, - d_grid_doppler_wipeoffs[doppler_index], d_fft_size); - - // 3- Perform the FFT-based convolution (parallel time search) - // Compute the FFT of the carrier wiped--off incoming signal - d_fft_if->execute(); - - // Multiply carrier wiped--off, Fourier transformed incoming signal - // with the local FFT'd code A reference using SIMD operations with - // VOLK library - volk_32fc_x2_multiply_32fc(d_ifft->get_inbuf(), - d_fft_if->get_outbuf(), d_fft_code_A, d_fft_size); - - // compute the inverse FFT - d_ifft->execute(); - - // Search maximum - volk_32fc_magnitude_squared_32f(d_magnitude, d_ifft->get_outbuf(), d_fft_size); - volk_gnsssdr_32f_index_max_32u(&indext_A, d_magnitude, d_fft_size); - - // Normalize the maximum value to correct the scale factor introduced by FFTW - magt_A = d_magnitude[indext_A] / (fft_normalization_factor * fft_normalization_factor); - - // Multiply carrier wiped--off, Fourier transformed incoming signal - // with the local FFT'd code B reference using SIMD operations with - // VOLK library - volk_32fc_x2_multiply_32fc(d_ifft->get_inbuf(), - d_fft_if->get_outbuf(), d_fft_code_B, d_fft_size); - - // compute the inverse FFT - d_ifft->execute(); - - // Search maximum - volk_32fc_magnitude_squared_32f(d_magnitude, d_ifft->get_outbuf(), d_fft_size); - volk_gnsssdr_32f_index_max_32u(&indext_B, d_magnitude, d_fft_size); - - // Normalize the maximum value to correct the scale factor introduced by FFTW - magt_B = d_magnitude[indext_B] / (fft_normalization_factor * fft_normalization_factor); - - // Take the greater magnitude - if (magt_A >= magt_B) - { - magt = magt_A; - indext = indext_A; - } - else - { - magt = magt_B; - indext = indext_B; - } - - // 4- record the maximum peak and the associated synchronization parameters - if (d_mag < magt) - { - d_mag = magt; - d_gnss_synchro->Acq_delay_samples = static_cast(indext % d_samples_per_code); - d_gnss_synchro->Acq_doppler_hz = static_cast(doppler); - d_gnss_synchro->Acq_samplestamp_samples = d_sample_counter; - } - - // Record results to file if required - if (d_dump) - { - std::stringstream filename; - std::streamsize n = 2 * sizeof(float) * (d_fft_size); // complex file write - filename.str(""); - filename << "../data/test_statistics_" << d_gnss_synchro->System - <<"_" << d_gnss_synchro->Signal << "_sat_" - << d_gnss_synchro->PRN << "_doppler_" << doppler << ".dat"; - d_dump_file.open(filename.str().c_str(), std::ios::out | std::ios::binary); - d_dump_file.write(reinterpret_cast(d_ifft->get_outbuf()), n); //write directly |abs(x)|^2 in this Doppler bin? - d_dump_file.close(); - } - } - - // 5- Compute the test statistics and compare to the threshold - //d_test_statistics = 2 * d_fft_size * d_mag / d_input_power; - d_test_statistics = d_mag / d_input_power; - - if (d_test_statistics > d_threshold) - { - d_state = 2; // Positive acquisition - } - else if (d_well_count == d_max_dwells) - { - d_state = 3; // Negative acquisition - } - - consume_each(1); - - break; - } - - case 2: - { - // 6.1- Declare positive acquisition using a message port - DLOG(INFO) << "positive acquisition"; - DLOG(INFO) << "satellite " << d_gnss_synchro->System << " " << d_gnss_synchro->PRN; - DLOG(INFO) << "sample_stamp " << d_sample_counter; - DLOG(INFO) << "test statistics value " << d_test_statistics; - DLOG(INFO) << "test statistics threshold " << d_threshold; - DLOG(INFO) << "code phase " << d_gnss_synchro->Acq_delay_samples; - DLOG(INFO) << "doppler " << d_gnss_synchro->Acq_doppler_hz; - DLOG(INFO) << "magnitude " << d_mag; - DLOG(INFO) << "input signal power " << d_input_power; - - d_active = false; - d_state = 0; - - d_sample_counter += d_fft_size * ninput_items[0]; // sample counter - consume_each(ninput_items[0]); - - acquisition_message = 1; - this->message_port_pub(pmt::mp("events"), pmt::from_long(acquisition_message)); - - break; - } - - case 3: - { - // 6.2- Declare negative acquisition using a message port - DLOG(INFO) << "negative acquisition"; - DLOG(INFO) << "satellite " << d_gnss_synchro->System << " " << d_gnss_synchro->PRN; - DLOG(INFO) << "sample_stamp " << d_sample_counter; - DLOG(INFO) << "test statistics value " << d_test_statistics; - DLOG(INFO) << "test statistics threshold " << d_threshold; - DLOG(INFO) << "code phase " << d_gnss_synchro->Acq_delay_samples; - DLOG(INFO) << "doppler " << d_gnss_synchro->Acq_doppler_hz; - DLOG(INFO) << "magnitude " << d_mag; - DLOG(INFO) << "input signal power " << d_input_power; - - d_active = false; - d_state = 0; - - d_sample_counter += d_fft_size * ninput_items[0]; // sample counter - consume_each(ninput_items[0]); - - acquisition_message = 2; - this->message_port_pub(pmt::mp("events"), pmt::from_long(acquisition_message)); - - break; - } - } - return noutput_items; } diff --git a/src/algorithms/acquisition/gnuradio_blocks/galileo_pcps_8ms_acquisition_cc.h b/src/algorithms/acquisition/gnuradio_blocks/galileo_pcps_8ms_acquisition_cc.h index 267a5f6cf..7c020246b 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/galileo_pcps_8ms_acquisition_cc.h +++ b/src/algorithms/acquisition/gnuradio_blocks/galileo_pcps_8ms_acquisition_cc.h @@ -45,31 +45,31 @@ typedef boost::shared_ptr galileo_pcps_8ms_acqu galileo_pcps_8ms_acquisition_cc_sptr galileo_pcps_8ms_make_acquisition_cc(unsigned int sampled_ms, unsigned int max_dwells, - unsigned int doppler_max, long freq, long fs_in, - int samples_per_ms, int samples_per_code, - bool dump, std::string dump_filename); + unsigned int doppler_max, long freq, long fs_in, + int samples_per_ms, int samples_per_code, + bool dump, std::string dump_filename); /*! * \brief This class implements a Parallel Code Phase Search Acquisition for * Galileo E1 signals with coherent integration time = 8 ms (two codes) */ -class galileo_pcps_8ms_acquisition_cc: public gr::block +class galileo_pcps_8ms_acquisition_cc : public gr::block { private: friend galileo_pcps_8ms_acquisition_cc_sptr galileo_pcps_8ms_make_acquisition_cc(unsigned int sampled_ms, unsigned int max_dwells, - unsigned int doppler_max, long freq, long fs_in, - int samples_per_ms, int samples_per_code, - bool dump, std::string dump_filename); + unsigned int doppler_max, long freq, long fs_in, + int samples_per_ms, int samples_per_code, + bool dump, std::string dump_filename); galileo_pcps_8ms_acquisition_cc(unsigned int sampled_ms, unsigned int max_dwells, - unsigned int doppler_max, long freq, long fs_in, - int samples_per_ms, int samples_per_code, - bool dump, std::string dump_filename); + unsigned int doppler_max, long freq, long fs_in, + int samples_per_ms, int samples_per_code, + bool dump, std::string dump_filename); void calculate_magnitudes(gr_complex* fft_begin, int doppler_shift, - int doppler_offset); + int doppler_offset); long d_fs_in; long d_freq; @@ -91,7 +91,7 @@ private: gr_complex* d_fft_code_B; gr::fft::fft_complex* d_fft_if; gr::fft::fft_complex* d_ifft; - Gnss_Synchro *d_gnss_synchro; + Gnss_Synchro* d_gnss_synchro; unsigned int d_code_phase; float d_doppler_freq; float d_mag; @@ -138,7 +138,7 @@ public: * \brief Sets local code for PCPS acquisition algorithm. * \param code - Pointer to the PRN code. */ - void set_local_code(std::complex * code); + void set_local_code(std::complex* code); /*! * \brief Starts acquisition algorithm, turning from standby mode to @@ -197,9 +197,9 @@ public: /*! * \brief Parallel Code Phase Search Acquisition signal processing. */ - int general_work(int noutput_items, gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); + int general_work(int noutput_items, gr_vector_int& ninput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items); }; #endif /* GNSS_SDR_PCPS_8MS_ACQUISITION_CC_H_*/ diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.cc index 3c261cd07..11c0754cd 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.cc @@ -34,8 +34,8 @@ */ #include "pcps_acquisition.h" -#include "GPS_L1_CA.h" // for GPS_TWO_PI -#include "GLONASS_L1_CA.h" // for GLONASS_TWO_PI +#include "GPS_L1_CA.h" // for GPS_TWO_PI +#include "GLONASS_L1_CA.h" // for GLONASS_TWO_PI #include #include #include @@ -46,33 +46,33 @@ using google::LogMessage; pcps_acquisition_sptr pcps_make_acquisition( - unsigned int sampled_ms, unsigned int max_dwells, - unsigned int doppler_max, long freq, long fs_in, - int samples_per_ms, int samples_per_code, - bool bit_transition_flag, bool use_CFAR_algorithm_flag, - bool dump, bool blocking, - std::string dump_filename, size_t it_size) + unsigned int sampled_ms, unsigned int max_dwells, + unsigned int doppler_max, long freq, long fs_in, + int samples_per_ms, int samples_per_code, + bool bit_transition_flag, bool use_CFAR_algorithm_flag, + bool dump, bool blocking, + std::string dump_filename, size_t it_size) { return pcps_acquisition_sptr( - new pcps_acquisition(sampled_ms, max_dwells, doppler_max, freq, fs_in, samples_per_ms, - samples_per_code, bit_transition_flag, use_CFAR_algorithm_flag, dump, blocking, dump_filename, it_size)); + new pcps_acquisition(sampled_ms, max_dwells, doppler_max, freq, fs_in, samples_per_ms, + samples_per_code, bit_transition_flag, use_CFAR_algorithm_flag, dump, blocking, dump_filename, it_size)); } pcps_acquisition::pcps_acquisition( - unsigned int sampled_ms, unsigned int max_dwells, - unsigned int doppler_max, long freq, long fs_in, - int samples_per_ms, int samples_per_code, - bool bit_transition_flag, bool use_CFAR_algorithm_flag, - bool dump, bool blocking, - std::string dump_filename, size_t it_size) : - gr::block("pcps_acquisition", - gr::io_signature::make(1, 1, it_size * sampled_ms * samples_per_ms * ( bit_transition_flag ? 2 : 1 )), - gr::io_signature::make(0, 0, it_size * sampled_ms * samples_per_ms * ( bit_transition_flag ? 2 : 1 )) ) + unsigned int sampled_ms, unsigned int max_dwells, + unsigned int doppler_max, long freq, long fs_in, + int samples_per_ms, int samples_per_code, + bool bit_transition_flag, bool use_CFAR_algorithm_flag, + bool dump, bool blocking, + std::string dump_filename, + size_t it_size) : gr::block("pcps_acquisition", + gr::io_signature::make(1, 1, it_size * sampled_ms * samples_per_ms * (bit_transition_flag ? 2 : 1)), + gr::io_signature::make(0, 0, it_size * sampled_ms * samples_per_ms * (bit_transition_flag ? 2 : 1))) { this->message_port_register_out(pmt::mp("events")); - d_sample_counter = 0; // SAMPLE COUNTER + d_sample_counter = 0; // SAMPLE COUNTER d_active = false; d_state = 0; d_freq = freq; @@ -95,8 +95,14 @@ pcps_acquisition::pcps_acquisition( d_code_phase = 0; d_test_statistics = 0.0; d_channel = 0; - if(it_size == sizeof(gr_complex)) { d_cshort = false; } - else { d_cshort = true; } + if (it_size == sizeof(gr_complex)) + { + d_cshort = false; + } + else + { + d_cshort = true; + } // COD: // Experimenting with the overlap/save technique for handling bit trannsitions @@ -108,10 +114,10 @@ pcps_acquisition::pcps_acquisition( // // We can avoid this by doing linear correlation, effectively doubling the // size of the input buffer and padding the code with zeros. - if( d_bit_transition_flag ) + if (d_bit_transition_flag) { d_fft_size *= 2; - d_max_dwells = 1; //Activation of d_bit_transition_flag invalidates the value of d_max_dwells + d_max_dwells = 1; //Activation of d_bit_transition_flag invalidates the value of d_max_dwells } d_fft_codes = static_cast(volk_gnsssdr_malloc(d_fft_size * sizeof(gr_complex), volk_gnsssdr_get_alignment())); @@ -131,7 +137,7 @@ pcps_acquisition::pcps_acquisition( d_blocking = blocking; d_worker_active = false; d_data_buffer = static_cast(volk_gnsssdr_malloc(d_fft_size * sizeof(gr_complex), volk_gnsssdr_get_alignment())); - if(d_cshort) + if (d_cshort) { d_data_buffer_sc = static_cast(volk_gnsssdr_malloc(d_fft_size * sizeof(lv_16sc_t), volk_gnsssdr_get_alignment())); } @@ -158,16 +164,19 @@ pcps_acquisition::~pcps_acquisition() delete d_ifft; delete d_fft_if; volk_gnsssdr_free(d_data_buffer); - if(d_cshort) { volk_gnsssdr_free(d_data_buffer_sc); } + if (d_cshort) + { + volk_gnsssdr_free(d_data_buffer_sc); + } } -void pcps_acquisition::set_local_code(std::complex * code) +void pcps_acquisition::set_local_code(std::complex* code) { // reset the intermediate frequency d_freq = d_old_freq; // This will check if it's fdma, if yes will update the intermediate frequency and the doppler grid - if( is_fdma() ) + if (is_fdma()) { update_grid_doppler_wipeoffs(); } @@ -175,11 +184,11 @@ void pcps_acquisition::set_local_code(std::complex * code) // Here we want to create a buffer that looks like this: // [ 0 0 0 ... 0 c_0 c_1 ... c_L] // where c_i is the local code and there are L zeros and L chips - gr::thread::scoped_lock lock(d_setlock); // require mutex with work function called by the scheduler - if( d_bit_transition_flag ) + gr::thread::scoped_lock lock(d_setlock); // require mutex with work function called by the scheduler + if (d_bit_transition_flag) { int offset = d_fft_size / 2; - std::fill_n( d_fft_if->get_inbuf(), offset, gr_complex( 0.0, 0.0 ) ); + std::fill_n(d_fft_if->get_inbuf(), offset, gr_complex(0.0, 0.0)); memcpy(d_fft_if->get_inbuf() + offset, code, sizeof(gr_complex) * offset); } else @@ -187,7 +196,7 @@ void pcps_acquisition::set_local_code(std::complex * code) memcpy(d_fft_if->get_inbuf(), code, sizeof(gr_complex) * d_fft_size); } - d_fft_if->execute(); // We need the FFT of local code + d_fft_if->execute(); // We need the FFT of local code volk_32fc_conjugate_32fc(d_fft_codes, d_fft_if->get_outbuf(), d_fft_size); } @@ -195,7 +204,7 @@ void pcps_acquisition::set_local_code(std::complex * code) bool pcps_acquisition::is_fdma() { // Dealing with FDMA system - if( strcmp(d_gnss_synchro->Signal,"1G") == 0 ) + if (strcmp(d_gnss_synchro->Signal, "1G") == 0) { d_freq += DFRQ1_GLO * GLONASS_PRN.at(d_gnss_synchro->PRN); LOG(INFO) << "Trying to acquire SV PRN " << d_gnss_synchro->PRN << " with freq " << d_freq << " in Glonass Channel " << GLONASS_PRN.at(d_gnss_synchro->PRN) << std::endl; @@ -213,7 +222,7 @@ void pcps_acquisition::update_local_carrier(gr_complex* carrier_vector, int corr float phase_step_rad = GPS_TWO_PI * freq / static_cast(d_fs_in); float _phase[1]; _phase[0] = 0; - volk_gnsssdr_s32f_sincos_32fc(carrier_vector, - phase_step_rad, _phase, correlator_length_samples); + volk_gnsssdr_s32f_sincos_32fc(carrier_vector, -phase_step_rad, _phase, correlator_length_samples); } @@ -230,7 +239,7 @@ void pcps_acquisition::init() d_mag = 0.0; d_input_power = 0.0; - d_num_doppler_bins = static_cast(std::ceil( static_cast(static_cast(d_doppler_max) - static_cast(-d_doppler_max)) / static_cast(d_doppler_step))); + d_num_doppler_bins = static_cast(std::ceil(static_cast(static_cast(d_doppler_max) - static_cast(-d_doppler_max)) / static_cast(d_doppler_step))); // Create the carrier Doppler wipeoff signals d_grid_doppler_wipeoffs = new gr_complex*[d_num_doppler_bins]; @@ -243,7 +252,7 @@ void pcps_acquisition::init() } d_worker_active = false; - if(d_dump) + if (d_dump) { unsigned int effective_fft_size = (d_bit_transition_flag ? (d_fft_size / 2) : d_fft_size); grid_ = arma::fmat(effective_fft_size, d_num_doppler_bins, arma::fill::zeros); @@ -264,7 +273,7 @@ void pcps_acquisition::update_grid_doppler_wipeoffs() void pcps_acquisition::set_state(int state) { - gr::thread::scoped_lock lock(d_setlock); // require mutex with work function called by the scheduler + gr::thread::scoped_lock lock(d_setlock); // require mutex with work function called by the scheduler d_state = state; if (d_state == 1) { @@ -278,7 +287,8 @@ void pcps_acquisition::set_state(int state) d_active = true; } else if (d_state == 0) - {} + { + } else { LOG(ERROR) << "State can only be set to 0 or 1"; @@ -323,8 +333,8 @@ void pcps_acquisition::send_negative_acquisition() int pcps_acquisition::general_work(int noutput_items __attribute__((unused)), - gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items __attribute__((unused))) + gr_vector_int& ninput_items, gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items __attribute__((unused))) { /* * By J.Arribas, L.Esteve and M.Molina @@ -338,56 +348,62 @@ int pcps_acquisition::general_work(int noutput_items __attribute__((unused)), */ gr::thread::scoped_lock lk(d_setlock); - if(!d_active || d_worker_active) + if (!d_active || d_worker_active) { d_sample_counter += d_fft_size * ninput_items[0]; consume_each(ninput_items[0]); return 0; } - switch(d_state) - { - case 0: + switch (d_state) { - //restart acquisition variables - d_gnss_synchro->Acq_delay_samples = 0.0; - d_gnss_synchro->Acq_doppler_hz = 0.0; - d_gnss_synchro->Acq_samplestamp_samples = 0; - d_well_count = 0; - d_mag = 0.0; - d_input_power = 0.0; - d_test_statistics = 0.0; - d_state = 1; - d_sample_counter += d_fft_size * ninput_items[0]; // sample counter - consume_each(ninput_items[0]); - break; - } + case 0: + { + //restart acquisition variables + d_gnss_synchro->Acq_delay_samples = 0.0; + d_gnss_synchro->Acq_doppler_hz = 0.0; + d_gnss_synchro->Acq_samplestamp_samples = 0; + d_well_count = 0; + d_mag = 0.0; + d_input_power = 0.0; + d_test_statistics = 0.0; + d_state = 1; + d_sample_counter += d_fft_size * ninput_items[0]; // sample counter + consume_each(ninput_items[0]); + break; + } - case 1: - { - // Copy the data to the core and let it know that new data is available - if(d_cshort) { memcpy(d_data_buffer_sc, input_items[0], d_fft_size * sizeof(lv_16sc_t)); } - else { memcpy(d_data_buffer, input_items[0], d_fft_size * sizeof(gr_complex)); } - if(d_blocking) - { - lk.unlock(); - acquisition_core(d_sample_counter); - } - else - { - gr::thread::thread d_worker(&pcps_acquisition::acquisition_core, this, d_sample_counter); - d_worker_active = true; - } - d_sample_counter += d_fft_size; - consume_each(1); - break; + case 1: + { + // Copy the data to the core and let it know that new data is available + if (d_cshort) + { + memcpy(d_data_buffer_sc, input_items[0], d_fft_size * sizeof(lv_16sc_t)); + } + else + { + memcpy(d_data_buffer, input_items[0], d_fft_size * sizeof(gr_complex)); + } + if (d_blocking) + { + lk.unlock(); + acquisition_core(d_sample_counter); + } + else + { + gr::thread::thread d_worker(&pcps_acquisition::acquisition_core, this, d_sample_counter); + d_worker_active = true; + } + d_sample_counter += d_fft_size; + consume_each(1); + break; + } } - } return 0; } -void pcps_acquisition::acquisition_core( unsigned long int samp_count ) +void pcps_acquisition::acquisition_core(unsigned long int samp_count) { gr::thread::scoped_lock lk(d_setlock); @@ -395,9 +411,12 @@ void pcps_acquisition::acquisition_core( unsigned long int samp_count ) int doppler; uint32_t indext = 0; float magt = 0.0; - const gr_complex* in = d_data_buffer; //Get the input samples pointer - int effective_fft_size = ( d_bit_transition_flag ? d_fft_size/2 : d_fft_size ); - if(d_cshort) { volk_gnsssdr_16ic_convert_32fc(d_data_buffer, d_data_buffer_sc, d_fft_size); } + const gr_complex* in = d_data_buffer; //Get the input samples pointer + int effective_fft_size = (d_bit_transition_flag ? d_fft_size / 2 : d_fft_size); + if (d_cshort) + { + volk_gnsssdr_16ic_convert_32fc(d_data_buffer, d_data_buffer_sc, d_fft_size); + } float fft_normalization_factor = static_cast(d_fft_size) * static_cast(d_fft_size); d_input_power = 0.0; @@ -409,7 +428,7 @@ void pcps_acquisition::acquisition_core( unsigned long int samp_count ) << " ,sample stamp: " << samp_count << ", threshold: " << d_threshold << ", doppler_max: " << d_doppler_max << ", doppler_step: " << d_doppler_step - << ", use_CFAR_algorithm_flag: " << ( d_use_CFAR_algorithm_flag ? "true" : "false" ); + << ", use_CFAR_algorithm_flag: " << (d_use_CFAR_algorithm_flag ? "true" : "false"); lk.unlock(); if (d_use_CFAR_algorithm_flag) @@ -439,7 +458,7 @@ void pcps_acquisition::acquisition_core( unsigned long int samp_count ) d_ifft->execute(); // Search maximum - size_t offset = ( d_bit_transition_flag ? effective_fft_size : 0 ); + size_t offset = (d_bit_transition_flag ? effective_fft_size : 0); volk_32fc_magnitude_squared_32f(d_magnitude, d_ifft->get_outbuf() + offset, effective_fft_size); volk_gnsssdr_32f_index_max_32u(&indext, d_magnitude, effective_fft_size); magt = d_magnitude[indext]; @@ -484,7 +503,7 @@ void pcps_acquisition::acquisition_core( unsigned long int samp_count ) if (d_dump) { memcpy(grid_.colptr(doppler_index), d_magnitude, sizeof(float) * effective_fft_size); - if(doppler_index == (d_num_doppler_bins - 1)) + if (doppler_index == (d_num_doppler_bins - 1)) { std::string filename = d_dump_filename; filename.append("_"); @@ -496,7 +515,7 @@ void pcps_acquisition::acquisition_core( unsigned long int samp_count ) filename.append(std::to_string(d_gnss_synchro->PRN)); filename.append(".mat"); mat_t* matfp = Mat_CreateVer(filename.c_str(), NULL, MAT_FT_MAT73); - if(matfp == NULL) + if (matfp == NULL) { std::cout << "Unable to create or open Acquisition dump file" << std::endl; d_dump = false; @@ -505,17 +524,17 @@ void pcps_acquisition::acquisition_core( unsigned long int samp_count ) { size_t dims[2] = {static_cast(effective_fft_size), static_cast(d_num_doppler_bins)}; matvar_t* matvar = Mat_VarCreate("grid", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, grid_.memptr(), 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); dims[0] = static_cast(1); dims[1] = static_cast(1); matvar = Mat_VarCreate("doppler_max", MAT_C_SINGLE, MAT_T_UINT32, 1, dims, &d_doppler_max, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("doppler_step", MAT_C_SINGLE, MAT_T_UINT32, 1, dims, &d_doppler_step, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); Mat_Close(matfp); @@ -528,7 +547,7 @@ void pcps_acquisition::acquisition_core( unsigned long int samp_count ) { if (d_test_statistics > d_threshold) { - d_state = 0; // Positive acquisition + d_state = 0; // Positive acquisition d_active = false; send_positive_acquisition(); } @@ -541,17 +560,17 @@ void pcps_acquisition::acquisition_core( unsigned long int samp_count ) } else { - if (d_well_count == d_max_dwells) // d_max_dwells = 2 + if (d_well_count == d_max_dwells) // d_max_dwells = 2 { if (d_test_statistics > d_threshold) { - d_state = 0; // Positive acquisition + d_state = 0; // Positive acquisition d_active = false; send_positive_acquisition(); } else { - d_state = 0; // Negative acquisition + d_state = 0; // Negative acquisition d_active = false; send_negative_acquisition(); } diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.h b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.h index c8ba1ef1b..d99ad3f6e 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.h +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.h @@ -66,11 +66,11 @@ typedef boost::shared_ptr pcps_acquisition_sptr; pcps_acquisition_sptr pcps_make_acquisition(unsigned int sampled_ms, unsigned int max_dwells, - unsigned int doppler_max, long freq, long fs_in, - int samples_per_ms, int samples_per_code, - bool bit_transition_flag, bool use_CFAR_algorithm_flag, - bool dump, bool blocking, - std::string dump_filename, size_t it_size); + unsigned int doppler_max, long freq, long fs_in, + int samples_per_ms, int samples_per_code, + bool bit_transition_flag, bool use_CFAR_algorithm_flag, + bool dump, bool blocking, + std::string dump_filename, size_t it_size); /*! * \brief This class implements a Parallel Code Phase Search Acquisition. @@ -78,29 +78,29 @@ pcps_make_acquisition(unsigned int sampled_ms, unsigned int max_dwells, * Check \ref Navitec2012 "An Open Source Galileo E1 Software Receiver", * Algorithm 1, for a pseudocode description of this implementation. */ -class pcps_acquisition: public gr::block +class pcps_acquisition : public gr::block { private: friend pcps_acquisition_sptr pcps_make_acquisition(unsigned int sampled_ms, unsigned int max_dwells, - unsigned int doppler_max, long freq, long fs_in, - int samples_per_ms, int samples_per_code, - bool bit_transition_flag, bool use_CFAR_algorithm_flag, - bool dump, bool blocking, - std::string dump_filename, size_t it_size); + unsigned int doppler_max, long freq, long fs_in, + int samples_per_ms, int samples_per_code, + bool bit_transition_flag, bool use_CFAR_algorithm_flag, + bool dump, bool blocking, + std::string dump_filename, size_t it_size); pcps_acquisition(unsigned int sampled_ms, unsigned int max_dwells, - unsigned int doppler_max, long freq, long fs_in, - int samples_per_ms, int samples_per_code, - bool bit_transition_flag, bool use_CFAR_algorithm_flag, - bool dump, bool blocking, - std::string dump_filename, size_t it_size); + unsigned int doppler_max, long freq, long fs_in, + int samples_per_ms, int samples_per_code, + bool bit_transition_flag, bool use_CFAR_algorithm_flag, + bool dump, bool blocking, + std::string dump_filename, size_t it_size); void update_local_carrier(gr_complex* carrier_vector, int correlator_length_samples, float freq); void update_grid_doppler_wipeoffs(); bool is_fdma(); - void acquisition_core( unsigned long int samp_count ); + void acquisition_core(unsigned long int samp_count); void send_negative_acquisition(); @@ -147,14 +147,14 @@ private: public: ~pcps_acquisition(); - /*! + /*! * \brief Set acquisition/tracking common Gnss_Synchro object pointer * to exchange synchronization data between acquisition and tracking blocks. * \param p_gnss_synchro Satellite information shared by the processing blocks. */ inline void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) { - gr::thread::scoped_lock lock(d_setlock); // require mutex with work function called by the scheduler + gr::thread::scoped_lock lock(d_setlock); // require mutex with work function called by the scheduler d_gnss_synchro = p_gnss_synchro; } @@ -166,83 +166,82 @@ public: return d_mag; } - /*! + /*! * \brief Initializes acquisition algorithm. */ void init(); - /*! + /*! * \brief Sets local code for PCPS acquisition algorithm. * \param code - Pointer to the PRN code. */ - void set_local_code(std::complex * code); + void set_local_code(std::complex* code); - /*! + /*! * \brief Starts acquisition algorithm, turning from standby mode to * active mode * \param active - bool that activates/deactivates the block. */ inline void set_active(bool active) { - gr::thread::scoped_lock lock(d_setlock); // require mutex with work function called by the scheduler + gr::thread::scoped_lock lock(d_setlock); // require mutex with work function called by the scheduler d_active = active; } - /*! + /*! * \brief If set to 1, ensures that acquisition starts at the * first available sample. * \param state - int=1 forces start of acquisition */ void set_state(int state); - /*! + /*! * \brief Set acquisition channel unique ID * \param channel - receiver channel. */ inline void set_channel(unsigned int channel) { - gr::thread::scoped_lock lock(d_setlock); // require mutex with work function called by the scheduler + gr::thread::scoped_lock lock(d_setlock); // require mutex with work function called by the scheduler d_channel = channel; } - /*! + /*! * \brief Set statistics threshold of PCPS algorithm. * \param threshold - Threshold for signal detection (check \ref Navitec2012, * Algorithm 1, for a definition of this threshold). */ inline void set_threshold(float threshold) { - gr::thread::scoped_lock lock(d_setlock); // require mutex with work function called by the scheduler + gr::thread::scoped_lock lock(d_setlock); // require mutex with work function called by the scheduler d_threshold = threshold; } - /*! + /*! * \brief Set maximum Doppler grid search * \param doppler_max - Maximum Doppler shift considered in the grid search [Hz]. */ inline void set_doppler_max(unsigned int doppler_max) { - gr::thread::scoped_lock lock(d_setlock); // require mutex with work function called by the scheduler + gr::thread::scoped_lock lock(d_setlock); // require mutex with work function called by the scheduler d_doppler_max = doppler_max; } - /*! + /*! * \brief Set Doppler steps for the grid search * \param doppler_step - Frequency bin of the search grid [Hz]. */ inline void set_doppler_step(unsigned int doppler_step) { - gr::thread::scoped_lock lock(d_setlock); // require mutex with work function called by the scheduler + gr::thread::scoped_lock lock(d_setlock); // require mutex with work function called by the scheduler d_doppler_step = doppler_step; } - /*! + /*! * \brief Parallel Code Phase Search Acquisition signal processing. */ - int general_work(int noutput_items, gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - + int general_work(int noutput_items, gr_vector_int& ninput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items); }; #endif /* GNSS_SDR_PCPS_ACQUISITION_H_*/ diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fine_doppler_cc.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fine_doppler_cc.cc index 12520a89e..860d96e49 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fine_doppler_cc.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fine_doppler_cc.cc @@ -38,34 +38,32 @@ #include #include #include -#include // std::rotate, std::fill_n +#include // std::rotate, std::fill_n #include using google::LogMessage; pcps_acquisition_fine_doppler_cc_sptr pcps_make_acquisition_fine_doppler_cc( - int max_dwells, unsigned int sampled_ms, int doppler_max, int doppler_min, long freq, - long fs_in, int samples_per_ms, bool dump, - std::string dump_filename) + int max_dwells, unsigned int sampled_ms, int doppler_max, int doppler_min, long freq, + long fs_in, int samples_per_ms, bool dump, + std::string dump_filename) { - return pcps_acquisition_fine_doppler_cc_sptr( - new pcps_acquisition_fine_doppler_cc(max_dwells, sampled_ms, doppler_max, doppler_min, freq, - fs_in, samples_per_ms, dump, dump_filename)); + new pcps_acquisition_fine_doppler_cc(max_dwells, sampled_ms, doppler_max, doppler_min, freq, + fs_in, samples_per_ms, dump, dump_filename)); } pcps_acquisition_fine_doppler_cc::pcps_acquisition_fine_doppler_cc( - int max_dwells, unsigned int sampled_ms, int doppler_max, int doppler_min, long freq, - long fs_in, int samples_per_ms, bool dump, - std::string dump_filename) : - gr::block("pcps_acquisition_fine_doppler_cc", - gr::io_signature::make(1, 1, sizeof(gr_complex)), - gr::io_signature::make(0, 0, sizeof(gr_complex))) + int max_dwells, unsigned int sampled_ms, int doppler_max, int doppler_min, long freq, + long fs_in, int samples_per_ms, bool dump, + std::string dump_filename) : gr::block("pcps_acquisition_fine_doppler_cc", + gr::io_signature::make(1, 1, sizeof(gr_complex)), + gr::io_signature::make(0, 0, sizeof(gr_complex))) { this->message_port_register_out(pmt::mp("events")); - d_sample_counter = 0; // SAMPLE COUNTER + d_sample_counter = 0; // SAMPLE COUNTER d_active = false; d_freq = freq; d_fs_in = fs_in; @@ -79,9 +77,9 @@ pcps_acquisition_fine_doppler_cc::pcps_acquisition_fine_doppler_cc( d_gnuradio_forecast_samples = d_fft_size; d_input_power = 0.0; d_state = 0; - d_carrier = static_cast(volk_gnsssdr_malloc(d_fft_size * sizeof(gr_complex), volk_gnsssdr_get_alignment())); - d_fft_codes = static_cast(volk_gnsssdr_malloc(d_fft_size * sizeof(gr_complex), volk_gnsssdr_get_alignment())); - d_magnitude = static_cast(volk_gnsssdr_malloc(d_fft_size * sizeof(float), volk_gnsssdr_get_alignment())); + d_carrier = static_cast(volk_gnsssdr_malloc(d_fft_size * sizeof(gr_complex), volk_gnsssdr_get_alignment())); + d_fft_codes = static_cast(volk_gnsssdr_malloc(d_fft_size * sizeof(gr_complex), volk_gnsssdr_get_alignment())); + d_magnitude = static_cast(volk_gnsssdr_malloc(d_fft_size * sizeof(float), volk_gnsssdr_get_alignment())); // Direct FFT d_fft_if = new gr::fft::fft_complex(d_fft_size, true); @@ -115,10 +113,10 @@ void pcps_acquisition_fine_doppler_cc::set_doppler_step(unsigned int doppler_ste d_num_doppler_points = floor(std::abs(d_config_doppler_max - d_config_doppler_min) / d_doppler_step); - d_grid_data = new float*[d_num_doppler_points]; + d_grid_data = new float *[d_num_doppler_points]; for (int i = 0; i < d_num_doppler_points; i++) { - d_grid_data[i] = static_cast(volk_gnsssdr_malloc(d_fft_size * sizeof(float), volk_gnsssdr_get_alignment())); + d_grid_data[i] = static_cast(volk_gnsssdr_malloc(d_fft_size * sizeof(float), volk_gnsssdr_get_alignment())); } update_carrier_wipeoff(); } @@ -151,10 +149,10 @@ pcps_acquisition_fine_doppler_cc::~pcps_acquisition_fine_doppler_cc() } -void pcps_acquisition_fine_doppler_cc::set_local_code(std::complex * code) +void pcps_acquisition_fine_doppler_cc::set_local_code(std::complex *code) { memcpy(d_fft_if->get_inbuf(), code, sizeof(gr_complex) * d_fft_size); - d_fft_if->execute(); // We need the FFT of local code + d_fft_if->execute(); // We need the FFT of local code //Conjugate the local code volk_32fc_conjugate_32fc(d_fft_codes, d_fft_if->get_outbuf(), d_fft_size); } @@ -175,12 +173,12 @@ void pcps_acquisition_fine_doppler_cc::init() } -void pcps_acquisition_fine_doppler_cc::forecast (int noutput_items, - gr_vector_int &ninput_items_required) +void pcps_acquisition_fine_doppler_cc::forecast(int noutput_items, + gr_vector_int &ninput_items_required) { if (noutput_items != 0) { - ninput_items_required[0] = d_gnuradio_forecast_samples ; //set the required available samples in each call + ninput_items_required[0] = d_gnuradio_forecast_samples; //set the required available samples in each call } } @@ -203,17 +201,17 @@ void pcps_acquisition_fine_doppler_cc::update_carrier_wipeoff() // create the carrier Doppler wipeoff signals int doppler_hz; float phase_step_rad; - d_grid_doppler_wipeoffs = new gr_complex*[d_num_doppler_points]; + d_grid_doppler_wipeoffs = new gr_complex *[d_num_doppler_points]; for (int doppler_index = 0; doppler_index < d_num_doppler_points; doppler_index++) { - doppler_hz = d_config_doppler_min + d_doppler_step*doppler_index; + doppler_hz = d_config_doppler_min + d_doppler_step * doppler_index; // doppler search steps // compute the carrier doppler wipe-off signal and store it - phase_step_rad = static_cast(GPS_TWO_PI) * ( d_freq + doppler_hz ) / static_cast(d_fs_in); + phase_step_rad = static_cast(GPS_TWO_PI) * (d_freq + doppler_hz) / static_cast(d_fs_in); d_grid_doppler_wipeoffs[doppler_index] = new gr_complex[d_fft_size]; float _phase[1]; _phase[0] = 0; - volk_gnsssdr_s32f_sincos_32fc(d_grid_doppler_wipeoffs[doppler_index], - phase_step_rad, _phase, d_fft_size); + volk_gnsssdr_s32f_sincos_32fc(d_grid_doppler_wipeoffs[doppler_index], -phase_step_rad, _phase, d_fft_size); } } @@ -226,7 +224,7 @@ double pcps_acquisition_fine_doppler_cc::search_maximum() uint32_t tmp_intex_t = 0; uint32_t index_time = 0; - for (int i=0;i magt) @@ -243,7 +241,7 @@ double pcps_acquisition_fine_doppler_cc::search_maximum() magt = magt / (fft_normalization_factor * fft_normalization_factor); // 5- Compute the test statistics and compare to the threshold - d_test_statistics = magt/(d_input_power*std::sqrt(d_well_count)); + d_test_statistics = magt / (d_input_power * std::sqrt(d_well_count)); // 4- record the maximum peak and the associated synchronization parameters d_gnss_synchro->Acq_delay_samples = static_cast(index_time); @@ -254,14 +252,13 @@ double pcps_acquisition_fine_doppler_cc::search_maximum() if (d_dump) { std::stringstream filename; - std::streamsize n = 2 * sizeof(float) * (d_fft_size); // complex file write + std::streamsize n = 2 * sizeof(float) * (d_fft_size); // complex file write filename.str(""); filename << "../data/test_statistics_" << d_gnss_synchro->System - <<"_" << d_gnss_synchro->Signal << "_sat_" - << d_gnss_synchro->PRN << "_doppler_" << d_gnss_synchro->Acq_doppler_hz << ".dat"; - d_dump_file.open(filename.str().c_str(), std::ios::out - | std::ios::binary); - d_dump_file.write(reinterpret_cast(d_grid_data[index_doppler]), n); //write directly |abs(x)|^2 in this Doppler bin? + << "_" << d_gnss_synchro->Signal << "_sat_" + << d_gnss_synchro->PRN << "_doppler_" << d_gnss_synchro->Acq_doppler_hz << ".dat"; + d_dump_file.open(filename.str().c_str(), std::ios::out | std::ios::binary); + d_dump_file.write(reinterpret_cast(d_grid_data[index_doppler]), n); //write directly |abs(x)|^2 in this Doppler bin? d_dump_file.close(); } @@ -271,7 +268,7 @@ double pcps_acquisition_fine_doppler_cc::search_maximum() float pcps_acquisition_fine_doppler_cc::estimate_input_power(gr_vector_const_void_star &input_items) { - const gr_complex *in = reinterpret_cast(input_items[0]); //Get the input samples pointer + const gr_complex *in = reinterpret_cast(input_items[0]); //Get the input samples pointer // Compute the input signal power estimation float power = 0; volk_32fc_magnitude_squared_32f(d_magnitude, in, d_fft_size); @@ -284,16 +281,16 @@ float pcps_acquisition_fine_doppler_cc::estimate_input_power(gr_vector_const_voi int pcps_acquisition_fine_doppler_cc::compute_and_accumulate_grid(gr_vector_const_void_star &input_items) { // initialize acquisition algorithm - const gr_complex *in = reinterpret_cast(input_items[0]); //Get the input samples pointer + const gr_complex *in = reinterpret_cast(input_items[0]); //Get the input samples pointer DLOG(INFO) << "Channel: " << d_channel - << " , doing acquisition of satellite: " << d_gnss_synchro->System << " "<< d_gnss_synchro->PRN - << " ,sample stamp: " << d_sample_counter << ", threshold: " - << d_threshold << ", doppler_max: " << d_config_doppler_max - << ", doppler_step: " << d_doppler_step; + << " , doing acquisition of satellite: " << d_gnss_synchro->System << " " << d_gnss_synchro->PRN + << " ,sample stamp: " << d_sample_counter << ", threshold: " + << d_threshold << ", doppler_max: " << d_config_doppler_max + << ", doppler_step: " << d_doppler_step; // 2- Doppler frequency search loop - float* p_tmp_vector = static_cast(volk_gnsssdr_malloc(d_fft_size * sizeof(float), volk_gnsssdr_get_alignment())); + float *p_tmp_vector = static_cast(volk_gnsssdr_malloc(d_fft_size * sizeof(float), volk_gnsssdr_get_alignment())); for (int doppler_index = 0; doppler_index < d_num_doppler_points; doppler_index++) { @@ -314,7 +311,7 @@ int pcps_acquisition_fine_doppler_cc::compute_and_accumulate_grid(gr_vector_cons // save the grid matrix delay file volk_32fc_magnitude_squared_32f(p_tmp_vector, d_ifft->get_outbuf(), d_fft_size); - const float* old_vector = d_grid_data[doppler_index]; + const float *old_vector = d_grid_data[doppler_index]; volk_32f_x2_add_32f(d_grid_data[doppler_index], old_vector, p_tmp_vector, d_fft_size); } @@ -334,7 +331,7 @@ int pcps_acquisition_fine_doppler_cc::estimate_Doppler(gr_vector_const_void_star std::fill_n(fft_operator->get_inbuf(), fft_size_extended, gr_complex(0.0, 0.0)); //1. generate local code aligned with the acquisition code phase estimation - gr_complex *code_replica = static_cast(volk_gnsssdr_malloc(d_fft_size * sizeof(gr_complex), volk_gnsssdr_get_alignment())); + gr_complex *code_replica = static_cast(volk_gnsssdr_malloc(d_fft_size * sizeof(gr_complex), volk_gnsssdr_get_alignment())); gps_l1_ca_code_gen_complex_sampled(code_replica, d_gnss_synchro->PRN, d_fs_in, 0); @@ -347,7 +344,7 @@ int pcps_acquisition_fine_doppler_cc::estimate_Doppler(gr_vector_const_void_star } //2. Perform code wipe-off - const gr_complex *in = reinterpret_cast(input_items[0]); //Get the input samples pointer + const gr_complex *in = reinterpret_cast(input_items[0]); //Get the input samples pointer volk_32fc_x2_multiply_32fc(fft_operator->get_inbuf(), in, code_replica, d_fft_size); @@ -355,7 +352,7 @@ int pcps_acquisition_fine_doppler_cc::estimate_Doppler(gr_vector_const_void_star fft_operator->execute(); // 4. Compute the magnitude and find the maximum - float* p_tmp_vector = static_cast(volk_gnsssdr_malloc(fft_size_extended * sizeof(float), volk_gnsssdr_get_alignment())); + float *p_tmp_vector = static_cast(volk_gnsssdr_malloc(fft_size_extended * sizeof(float), volk_gnsssdr_get_alignment())); volk_32fc_magnitude_squared_32f(p_tmp_vector, fft_operator->get_outbuf(), fft_size_extended); @@ -389,7 +386,7 @@ int pcps_acquisition_fine_doppler_cc::estimate_Doppler(gr_vector_const_void_star else { DLOG(INFO) << "Abs(Grid Doppler - FFT Doppler)=" << std::abs(fftFreqBins[tmp_index_freq] - d_gnss_synchro->Acq_doppler_hz); - DLOG(INFO) << "Error estimating fine frequency Doppler"; + DLOG(INFO) << "Error estimating fine frequency Doppler"; //debug log // // std::cout<<"FFT maximum present at "<= d_max_dwells) - { - d_state = 2; - } - break; - case 2: // Compute test statistics and decide - //DLOG(INFO) <<"S2"< d_threshold) - { - d_state = 3; //perform fine doppler estimation - } - else - { - d_state = 5; //negative acquisition - } - break; - case 3: // Fine doppler estimation - //DLOG(INFO) <<"S3"<System << " " << d_gnss_synchro->PRN; - DLOG(INFO) << "sample_stamp " << d_sample_counter; - DLOG(INFO) << "test statistics value " << d_test_statistics; - DLOG(INFO) << "test statistics threshold " << d_threshold; - DLOG(INFO) << "code phase " << d_gnss_synchro->Acq_delay_samples; - DLOG(INFO) << "doppler " << d_gnss_synchro->Acq_doppler_hz; - DLOG(INFO) << "input signal power " << d_input_power; + { + case 0: // S0. StandBy + //DLOG(INFO) <<"S0"<= d_max_dwells) + { + d_state = 2; + } + break; + case 2: // Compute test statistics and decide + //DLOG(INFO) <<"S2"< d_threshold) + { + d_state = 3; //perform fine doppler estimation + } + else + { + d_state = 5; //negative acquisition + } + break; + case 3: // Fine doppler estimation + //DLOG(INFO) <<"S3"<System << " " << d_gnss_synchro->PRN; + DLOG(INFO) << "sample_stamp " << d_sample_counter; + DLOG(INFO) << "test statistics value " << d_test_statistics; + DLOG(INFO) << "test statistics threshold " << d_threshold; + DLOG(INFO) << "code phase " << d_gnss_synchro->Acq_delay_samples; + DLOG(INFO) << "doppler " << d_gnss_synchro->Acq_doppler_hz; + DLOG(INFO) << "input signal power " << d_input_power; - d_active = false; - // Send message to channel port //0=STOP_CHANNEL 1=ACQ_SUCCEES 2=ACQ_FAIL - this->message_port_pub(pmt::mp("events"), pmt::from_long(1)); - d_state = 0; - break; - case 5: // Negative_Acq - //DLOG(INFO) <<"S5"<System << " " << d_gnss_synchro->PRN; - DLOG(INFO) << "sample_stamp " << d_sample_counter; - DLOG(INFO) << "test statistics value " << d_test_statistics; - DLOG(INFO) << "test statistics threshold " << d_threshold; - DLOG(INFO) << "code phase " << d_gnss_synchro->Acq_delay_samples; - DLOG(INFO) << "doppler " << d_gnss_synchro->Acq_doppler_hz; - DLOG(INFO) << "input signal power " << d_input_power; + d_active = false; + // Send message to channel port //0=STOP_CHANNEL 1=ACQ_SUCCEES 2=ACQ_FAIL + this->message_port_pub(pmt::mp("events"), pmt::from_long(1)); + d_state = 0; + break; + case 5: // Negative_Acq + //DLOG(INFO) <<"S5"<System << " " << d_gnss_synchro->PRN; + DLOG(INFO) << "sample_stamp " << d_sample_counter; + DLOG(INFO) << "test statistics value " << d_test_statistics; + DLOG(INFO) << "test statistics threshold " << d_threshold; + DLOG(INFO) << "code phase " << d_gnss_synchro->Acq_delay_samples; + DLOG(INFO) << "doppler " << d_gnss_synchro->Acq_doppler_hz; + DLOG(INFO) << "input signal power " << d_input_power; - d_active = false; - // Send message to channel port //0=STOP_CHANNEL 1=ACQ_SUCCEES 2=ACQ_FAIL - this->message_port_pub(pmt::mp("events"), pmt::from_long(2)); - d_state = 0; - break; - default: - d_state = 0; - break; - } + d_active = false; + // Send message to channel port //0=STOP_CHANNEL 1=ACQ_SUCCEES 2=ACQ_FAIL + this->message_port_pub(pmt::mp("events"), pmt::from_long(2)); + d_state = 0; + break; + default: + d_state = 0; + break; + } //DLOG(INFO)<<"d_sample_counter="< -pcps_acquisition_fine_doppler_cc_sptr; + pcps_acquisition_fine_doppler_cc_sptr; pcps_acquisition_fine_doppler_cc_sptr pcps_make_acquisition_fine_doppler_cc(int max_dwells, unsigned int sampled_ms, - int doppler_max, int doppler_min, long freq, long fs_in, int samples_per_ms, - bool dump, std::string dump_filename); + int doppler_max, int doppler_min, long freq, long fs_in, int samples_per_ms, + bool dump, std::string dump_filename); /*! * \brief This class implements a Parallel Code Phase Search Acquisition. @@ -72,26 +72,26 @@ pcps_make_acquisition_fine_doppler_cc(int max_dwells, unsigned int sampled_ms, * Algorithm 1, for a pseudocode description of this implementation. */ -class pcps_acquisition_fine_doppler_cc: public gr::block +class pcps_acquisition_fine_doppler_cc : public gr::block { private: friend pcps_acquisition_fine_doppler_cc_sptr pcps_make_acquisition_fine_doppler_cc(int max_dwells, unsigned int sampled_ms, - int doppler_max, int doppler_min, long freq, long fs_in, - int samples_per_ms, bool dump, - std::string dump_filename); + int doppler_max, int doppler_min, long freq, long fs_in, + int samples_per_ms, bool dump, + std::string dump_filename); pcps_acquisition_fine_doppler_cc(int max_dwells, unsigned int sampled_ms, - int doppler_max, int doppler_min, long freq, long fs_in, - int samples_per_ms, bool dump, - std::string dump_filename); + int doppler_max, int doppler_min, long freq, long fs_in, + int samples_per_ms, bool dump, + std::string dump_filename); void calculate_magnitudes(gr_complex* fft_begin, int doppler_shift, - int doppler_offset); + int doppler_offset); - int compute_and_accumulate_grid(gr_vector_const_void_star &input_items); - int estimate_Doppler(gr_vector_const_void_star &input_items); - float estimate_input_power(gr_vector_const_void_star &input_items); + int compute_and_accumulate_grid(gr_vector_const_void_star& input_items); + int estimate_Doppler(gr_vector_const_void_star& input_items); + float estimate_input_power(gr_vector_const_void_star& input_items); double search_maximum(); void reset_grid(); void update_carrier_wipeoff(); @@ -122,7 +122,7 @@ private: gr::fft::fft_complex* d_fft_if; gr::fft::fft_complex* d_ifft; - Gnss_Synchro *d_gnss_synchro; + Gnss_Synchro* d_gnss_synchro; unsigned int d_code_phase; float d_doppler_freq; float d_input_power; @@ -169,7 +169,7 @@ public: * \brief Sets local code for PCPS acquisition algorithm. * \param code - Pointer to the PRN code. */ - void set_local_code(std::complex * code); + void set_local_code(std::complex* code); /*! * \brief Starts acquisition algorithm, turning from standby mode to @@ -218,11 +218,11 @@ public: /*! * \brief Parallel Code Phase Search Acquisition signal processing. */ - int general_work(int noutput_items, gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); + int general_work(int noutput_items, gr_vector_int& ninput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items); - void forecast (int noutput_items, gr_vector_int &ninput_items_required); + void forecast(int noutput_items, gr_vector_int& ninput_items_required); }; #endif /* pcps_acquisition_fine_doppler_cc*/ diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_assisted_acquisition_cc.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_assisted_acquisition_cc.cc index f730a3d30..17866975b 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_assisted_acquisition_cc.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_assisted_acquisition_cc.cc @@ -46,27 +46,25 @@ extern concurrent_map global_gps_acq_assist_map; using google::LogMessage; pcps_assisted_acquisition_cc_sptr pcps_make_assisted_acquisition_cc( - int max_dwells, unsigned int sampled_ms, int doppler_max, int doppler_min, long freq, - long fs_in, int samples_per_ms, bool dump, - std::string dump_filename) + int max_dwells, unsigned int sampled_ms, int doppler_max, int doppler_min, long freq, + long fs_in, int samples_per_ms, bool dump, + std::string dump_filename) { return pcps_assisted_acquisition_cc_sptr( - new pcps_assisted_acquisition_cc(max_dwells, sampled_ms, doppler_max, doppler_min, freq, - fs_in, samples_per_ms, dump, dump_filename)); + new pcps_assisted_acquisition_cc(max_dwells, sampled_ms, doppler_max, doppler_min, freq, + fs_in, samples_per_ms, dump, dump_filename)); } - pcps_assisted_acquisition_cc::pcps_assisted_acquisition_cc( - int max_dwells, unsigned int sampled_ms, int doppler_max, int doppler_min, long freq, - long fs_in, int samples_per_ms, bool dump, - std::string dump_filename) : - gr::block("pcps_assisted_acquisition_cc", - gr::io_signature::make(1, 1, sizeof(gr_complex)), - gr::io_signature::make(0, 0, sizeof(gr_complex))) + int max_dwells, unsigned int sampled_ms, int doppler_max, int doppler_min, long freq, + long fs_in, int samples_per_ms, bool dump, + std::string dump_filename) : gr::block("pcps_assisted_acquisition_cc", + gr::io_signature::make(1, 1, sizeof(gr_complex)), + gr::io_signature::make(0, 0, sizeof(gr_complex))) { this->message_port_register_out(pmt::mp("events")); - d_sample_counter = 0; // SAMPLE COUNTER + d_sample_counter = 0; // SAMPLE COUNTER d_active = false; d_freq = freq; d_fs_in = fs_in; @@ -77,12 +75,12 @@ pcps_assisted_acquisition_cc::pcps_assisted_acquisition_cc( d_fft_size = d_sampled_ms * d_samples_per_ms; // HS Acquisition d_max_dwells = max_dwells; - d_gnuradio_forecast_samples = d_fft_size*4; + d_gnuradio_forecast_samples = d_fft_size * 4; d_input_power = 0.0; d_state = 0; d_disable_assist = false; - d_fft_codes = static_cast(volk_gnsssdr_malloc(d_fft_size * sizeof(gr_complex), volk_gnsssdr_get_alignment())); - d_carrier = static_cast(volk_gnsssdr_malloc(d_fft_size * sizeof(gr_complex), volk_gnsssdr_get_alignment())); + d_fft_codes = static_cast(volk_gnsssdr_malloc(d_fft_size * sizeof(gr_complex), volk_gnsssdr_get_alignment())); + d_carrier = static_cast(volk_gnsssdr_malloc(d_fft_size * sizeof(gr_complex), volk_gnsssdr_get_alignment())); // Direct FFT d_fft_if = new gr::fft::fft_complex(d_fft_size, true); @@ -111,14 +109,12 @@ pcps_assisted_acquisition_cc::pcps_assisted_acquisition_cc( } - void pcps_assisted_acquisition_cc::set_doppler_step(unsigned int doppler_step) { d_doppler_step = doppler_step; } - void pcps_assisted_acquisition_cc::free_grid_memory() { for (int i = 0; i < d_num_doppler_points; i++) @@ -130,7 +126,6 @@ void pcps_assisted_acquisition_cc::free_grid_memory() } - pcps_assisted_acquisition_cc::~pcps_assisted_acquisition_cc() { volk_gnsssdr_free(d_carrier); @@ -144,14 +139,12 @@ pcps_assisted_acquisition_cc::~pcps_assisted_acquisition_cc() } - -void pcps_assisted_acquisition_cc::set_local_code(std::complex * code) +void pcps_assisted_acquisition_cc::set_local_code(std::complex *code) { - memcpy(d_fft_if->get_inbuf(), code, sizeof(gr_complex)*d_fft_size); + memcpy(d_fft_if->get_inbuf(), code, sizeof(gr_complex) * d_fft_size); } - void pcps_assisted_acquisition_cc::init() { d_gnss_synchro->Flag_valid_acquisition = false; @@ -165,35 +158,33 @@ void pcps_assisted_acquisition_cc::init() d_input_power = 0.0; d_state = 0; - d_fft_if->execute(); // We need the FFT of local code + d_fft_if->execute(); // We need the FFT of local code //Conjugate the local code volk_32fc_conjugate_32fc(d_fft_codes, d_fft_if->get_outbuf(), d_fft_size); } - -void pcps_assisted_acquisition_cc::forecast (int noutput_items, - gr_vector_int &ninput_items_required) +void pcps_assisted_acquisition_cc::forecast(int noutput_items, + gr_vector_int &ninput_items_required) { if (noutput_items != 0) { - ninput_items_required[0] = d_gnuradio_forecast_samples ; //set the required available samples in each call + ninput_items_required[0] = d_gnuradio_forecast_samples; //set the required available samples in each call } } - void pcps_assisted_acquisition_cc::get_assistance() { Gps_Acq_Assist gps_acq_assisistance; - if (global_gps_acq_assist_map.read(this->d_gnss_synchro->PRN, gps_acq_assisistance)==true) + if (global_gps_acq_assist_map.read(this->d_gnss_synchro->PRN, gps_acq_assisistance) == true) { //TODO: use the LO tolerance here if (gps_acq_assisistance.dopplerUncertainty >= 1000) { - d_doppler_max = gps_acq_assisistance.d_Doppler0 + gps_acq_assisistance.dopplerUncertainty*2; - d_doppler_min = gps_acq_assisistance.d_Doppler0 - gps_acq_assisistance.dopplerUncertainty*2; + d_doppler_max = gps_acq_assisistance.d_Doppler0 + gps_acq_assisistance.dopplerUncertainty * 2; + d_doppler_min = gps_acq_assisistance.d_Doppler0 - gps_acq_assisistance.dopplerUncertainty * 2; } else { @@ -201,18 +192,17 @@ void pcps_assisted_acquisition_cc::get_assistance() d_doppler_min = gps_acq_assisistance.d_Doppler0 - 1000; } this->d_disable_assist = false; - std::cout << "Acq assist ENABLED for GPS SV "<< this->d_gnss_synchro->PRN <<" (Doppler max,Doppler min)=(" + std::cout << "Acq assist ENABLED for GPS SV " << this->d_gnss_synchro->PRN << " (Doppler max,Doppler min)=(" << d_doppler_max << "," << d_doppler_min << ")" << std::endl; } else { this->d_disable_assist = true; - std::cout << "Acq assist DISABLED for GPS SV "<< this->d_gnss_synchro->PRN << std::endl; + std::cout << "Acq assist DISABLED for GPS SV " << this->d_gnss_synchro->PRN << std::endl; } } - void pcps_assisted_acquisition_cc::reset_grid() { d_well_count = 0; @@ -226,7 +216,6 @@ void pcps_assisted_acquisition_cc::reset_grid() } - void pcps_assisted_acquisition_cc::redefine_grid() { if (this->d_disable_assist == true) @@ -237,7 +226,7 @@ void pcps_assisted_acquisition_cc::redefine_grid() // Create the search grid array d_num_doppler_points = floor(std::abs(d_doppler_max - d_doppler_min) / d_doppler_step); - d_grid_data = new float*[d_num_doppler_points]; + d_grid_data = new float *[d_num_doppler_points]; for (int i = 0; i < d_num_doppler_points; i++) { d_grid_data[i] = new float[d_fft_size]; @@ -246,22 +235,21 @@ void pcps_assisted_acquisition_cc::redefine_grid() // create the carrier Doppler wipeoff signals int doppler_hz; float phase_step_rad; - d_grid_doppler_wipeoffs = new gr_complex*[d_num_doppler_points]; + d_grid_doppler_wipeoffs = new gr_complex *[d_num_doppler_points]; for (int doppler_index = 0; doppler_index < d_num_doppler_points; doppler_index++) { - doppler_hz = d_doppler_min + d_doppler_step*doppler_index; + doppler_hz = d_doppler_min + d_doppler_step * doppler_index; // doppler search steps // compute the carrier doppler wipe-off signal and store it phase_step_rad = static_cast(GPS_TWO_PI) * doppler_hz / static_cast(d_fs_in); d_grid_doppler_wipeoffs[doppler_index] = new gr_complex[d_fft_size]; float _phase[1]; _phase[0] = 0; - volk_gnsssdr_s32f_sincos_32fc(d_grid_doppler_wipeoffs[doppler_index], - phase_step_rad, _phase, d_fft_size); + volk_gnsssdr_s32f_sincos_32fc(d_grid_doppler_wipeoffs[doppler_index], -phase_step_rad, _phase, d_fft_size); } } - double pcps_assisted_acquisition_cc::search_maximum() { float magt = 0.0; @@ -270,9 +258,9 @@ double pcps_assisted_acquisition_cc::search_maximum() uint32_t tmp_intex_t = 0; uint32_t index_time = 0; - for (int i=0;i magt) { magt = d_grid_data[i][index_time]; @@ -297,13 +285,13 @@ double pcps_assisted_acquisition_cc::search_maximum() if (d_dump) { std::stringstream filename; - std::streamsize n = 2 * sizeof(float) * (d_fft_size); // complex file write + std::streamsize n = 2 * sizeof(float) * (d_fft_size); // complex file write filename.str(""); filename << "../data/test_statistics_" << d_gnss_synchro->System << "_" << d_gnss_synchro->Signal << "_sat_" - << d_gnss_synchro->PRN << "_doppler_" << d_gnss_synchro->Acq_doppler_hz << ".dat"; + << d_gnss_synchro->PRN << "_doppler_" << d_gnss_synchro->Acq_doppler_hz << ".dat"; d_dump_file.open(filename.str().c_str(), std::ios::out | std::ios::binary); - d_dump_file.write(reinterpret_cast(d_grid_data[index_doppler]), n); //write directly |abs(x)|^2 in this Doppler bin? + d_dump_file.write(reinterpret_cast(d_grid_data[index_doppler]), n); //write directly |abs(x)|^2 in this Doppler bin? d_dump_file.close(); } @@ -311,28 +299,26 @@ double pcps_assisted_acquisition_cc::search_maximum() } - float pcps_assisted_acquisition_cc::estimate_input_power(gr_vector_const_void_star &input_items) { - const gr_complex *in = reinterpret_cast(input_items[0]); //Get the input samples pointer + const gr_complex *in = reinterpret_cast(input_items[0]); //Get the input samples pointer // 1- Compute the input signal power estimation - float* p_tmp_vector = static_cast(volk_gnsssdr_malloc(d_fft_size * sizeof(float), volk_gnsssdr_get_alignment())); + float *p_tmp_vector = static_cast(volk_gnsssdr_malloc(d_fft_size * sizeof(float), volk_gnsssdr_get_alignment())); volk_32fc_magnitude_squared_32f(p_tmp_vector, in, d_fft_size); - const float* p_const_tmp_vector = p_tmp_vector; + const float *p_const_tmp_vector = p_tmp_vector; float power; volk_32f_accumulator_s32f(&power, p_const_tmp_vector, d_fft_size); volk_gnsssdr_free(p_tmp_vector); - return ( power / static_cast(d_fft_size)); + return (power / static_cast(d_fft_size)); } - int pcps_assisted_acquisition_cc::compute_and_accumulate_grid(gr_vector_const_void_star &input_items) { // initialize acquisition algorithm - const gr_complex *in = reinterpret_cast(input_items[0]); //Get the input samples pointer + const gr_complex *in = reinterpret_cast(input_items[0]); //Get the input samples pointer DLOG(INFO) << "Channel: " << d_channel << " , doing acquisition of satellite: " << d_gnss_synchro->System << " " @@ -342,7 +328,7 @@ int pcps_assisted_acquisition_cc::compute_and_accumulate_grid(gr_vector_const_vo << ", doppler_step: " << d_doppler_step; // 2- Doppler frequency search loop - float* p_tmp_vector = static_cast(volk_gnsssdr_malloc(d_fft_size * sizeof(float), volk_gnsssdr_get_alignment())); + float *p_tmp_vector = static_cast(volk_gnsssdr_malloc(d_fft_size * sizeof(float), volk_gnsssdr_get_alignment())); for (int doppler_index = 0; doppler_index < d_num_doppler_points; doppler_index++) { @@ -362,7 +348,7 @@ int pcps_assisted_acquisition_cc::compute_and_accumulate_grid(gr_vector_const_vo // save the grid matrix delay file volk_32fc_magnitude_squared_32f(p_tmp_vector, d_ifft->get_outbuf(), d_fft_size); - const float* old_vector = d_grid_data[doppler_index]; + const float *old_vector = d_grid_data[doppler_index]; volk_32f_x2_add_32f(d_grid_data[doppler_index], old_vector, p_tmp_vector, d_fft_size); } volk_gnsssdr_free(p_tmp_vector); @@ -370,10 +356,9 @@ int pcps_assisted_acquisition_cc::compute_and_accumulate_grid(gr_vector_const_vo } - int pcps_assisted_acquisition_cc::general_work(int noutput_items, - gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items __attribute__((unused))) + gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items __attribute__((unused))) { /*! * TODO: High sensitivity acquisition algorithm: @@ -393,102 +378,102 @@ int pcps_assisted_acquisition_cc::general_work(int noutput_items, */ switch (d_state) - { - case 0: // S0. StandBy - if (d_active == true) d_state = 1; - d_sample_counter += ninput_items[0]; // sample counter - consume_each(ninput_items[0]); - break; - case 1: // S1. GetAssist - get_assistance(); - redefine_grid(); - reset_grid(); - d_sample_counter += ninput_items[0]; // sample counter - consume_each(ninput_items[0]); - d_state = 2; - break; - case 2: // S2. ComputeGrid - int consumed_samples; - consumed_samples = compute_and_accumulate_grid(input_items); - d_well_count++; - if (d_well_count >= d_max_dwells) - { - d_state=3; - } - d_sample_counter += consumed_samples; - consume_each(consumed_samples); - break; - case 3: // Compute test statistics and decide - d_input_power = estimate_input_power(input_items); - d_test_statistics = search_maximum(); - if (d_test_statistics > d_threshold) - { - d_state = 5; - } - else - { - if (d_disable_assist == false) - { - d_disable_assist = true; - std::cout << "Acq assist DISABLED for GPS SV "<< this->d_gnss_synchro->PRN << std::endl; - d_state = 4; - } - else - { - d_state = 6; - } - } - d_sample_counter += ninput_items[0]; // sample counter - consume_each(ninput_items[0]); - break; - case 4: // RedefineGrid - free_grid_memory(); - redefine_grid(); - reset_grid(); - d_sample_counter += ninput_items[0]; // sample counter - consume_each(ninput_items[0]); - d_state = 2; - break; - case 5: // Positive_Acq - DLOG(INFO) << "positive acquisition"; - DLOG(INFO) << "satellite " << d_gnss_synchro->System << " " << d_gnss_synchro->PRN; - DLOG(INFO) << "sample_stamp " << d_sample_counter; - DLOG(INFO) << "test statistics value " << d_test_statistics; - DLOG(INFO) << "test statistics threshold " << d_threshold; - DLOG(INFO) << "code phase " << d_gnss_synchro->Acq_delay_samples; - DLOG(INFO) << "doppler " << d_gnss_synchro->Acq_doppler_hz; - DLOG(INFO) << "input signal power " << d_input_power; - d_active = false; - // Send message to channel port //0=STOP_CHANNEL 1=ACQ_SUCCESS 2=ACQ_FAIL - this->message_port_pub(pmt::mp("events"), pmt::from_long(1)); - free_grid_memory(); - // consume samples to not block the GNU Radio flowgraph - d_sample_counter += ninput_items[0]; // sample counter - consume_each(ninput_items[0]); - d_state = 0; - break; - case 6: // Negative_Acq - DLOG(INFO) << "negative acquisition"; - DLOG(INFO) << "satellite " << d_gnss_synchro->System << " " << d_gnss_synchro->PRN; - DLOG(INFO) << "sample_stamp " << d_sample_counter; - DLOG(INFO) << "test statistics value " << d_test_statistics; - DLOG(INFO) << "test statistics threshold " << d_threshold; - DLOG(INFO) << "code phase " << d_gnss_synchro->Acq_delay_samples; - DLOG(INFO) << "doppler " << d_gnss_synchro->Acq_doppler_hz; - DLOG(INFO) << "input signal power " << d_input_power; - d_active = false; - // Send message to channel port //0=STOP_CHANNEL 1=ACQ_SUCCESS 2=ACQ_FAIL - this->message_port_pub(pmt::mp("events"), pmt::from_long(2)); - free_grid_memory(); - // consume samples to not block the GNU Radio flowgraph - d_sample_counter += ninput_items[0]; // sample counter - consume_each(ninput_items[0]); - d_state = 0; - break; - default: - d_state = 0; - break; - } + { + case 0: // S0. StandBy + if (d_active == true) d_state = 1; + d_sample_counter += ninput_items[0]; // sample counter + consume_each(ninput_items[0]); + break; + case 1: // S1. GetAssist + get_assistance(); + redefine_grid(); + reset_grid(); + d_sample_counter += ninput_items[0]; // sample counter + consume_each(ninput_items[0]); + d_state = 2; + break; + case 2: // S2. ComputeGrid + int consumed_samples; + consumed_samples = compute_and_accumulate_grid(input_items); + d_well_count++; + if (d_well_count >= d_max_dwells) + { + d_state = 3; + } + d_sample_counter += consumed_samples; + consume_each(consumed_samples); + break; + case 3: // Compute test statistics and decide + d_input_power = estimate_input_power(input_items); + d_test_statistics = search_maximum(); + if (d_test_statistics > d_threshold) + { + d_state = 5; + } + else + { + if (d_disable_assist == false) + { + d_disable_assist = true; + std::cout << "Acq assist DISABLED for GPS SV " << this->d_gnss_synchro->PRN << std::endl; + d_state = 4; + } + else + { + d_state = 6; + } + } + d_sample_counter += ninput_items[0]; // sample counter + consume_each(ninput_items[0]); + break; + case 4: // RedefineGrid + free_grid_memory(); + redefine_grid(); + reset_grid(); + d_sample_counter += ninput_items[0]; // sample counter + consume_each(ninput_items[0]); + d_state = 2; + break; + case 5: // Positive_Acq + DLOG(INFO) << "positive acquisition"; + DLOG(INFO) << "satellite " << d_gnss_synchro->System << " " << d_gnss_synchro->PRN; + DLOG(INFO) << "sample_stamp " << d_sample_counter; + DLOG(INFO) << "test statistics value " << d_test_statistics; + DLOG(INFO) << "test statistics threshold " << d_threshold; + DLOG(INFO) << "code phase " << d_gnss_synchro->Acq_delay_samples; + DLOG(INFO) << "doppler " << d_gnss_synchro->Acq_doppler_hz; + DLOG(INFO) << "input signal power " << d_input_power; + d_active = false; + // Send message to channel port //0=STOP_CHANNEL 1=ACQ_SUCCESS 2=ACQ_FAIL + this->message_port_pub(pmt::mp("events"), pmt::from_long(1)); + free_grid_memory(); + // consume samples to not block the GNU Radio flowgraph + d_sample_counter += ninput_items[0]; // sample counter + consume_each(ninput_items[0]); + d_state = 0; + break; + case 6: // Negative_Acq + DLOG(INFO) << "negative acquisition"; + DLOG(INFO) << "satellite " << d_gnss_synchro->System << " " << d_gnss_synchro->PRN; + DLOG(INFO) << "sample_stamp " << d_sample_counter; + DLOG(INFO) << "test statistics value " << d_test_statistics; + DLOG(INFO) << "test statistics threshold " << d_threshold; + DLOG(INFO) << "code phase " << d_gnss_synchro->Acq_delay_samples; + DLOG(INFO) << "doppler " << d_gnss_synchro->Acq_doppler_hz; + DLOG(INFO) << "input signal power " << d_input_power; + d_active = false; + // Send message to channel port //0=STOP_CHANNEL 1=ACQ_SUCCESS 2=ACQ_FAIL + this->message_port_pub(pmt::mp("events"), pmt::from_long(2)); + free_grid_memory(); + // consume samples to not block the GNU Radio flowgraph + d_sample_counter += ninput_items[0]; // sample counter + consume_each(ninput_items[0]); + d_state = 0; + break; + default: + d_state = 0; + break; + } return noutput_items; } diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_assisted_acquisition_cc.h b/src/algorithms/acquisition/gnuradio_blocks/pcps_assisted_acquisition_cc.h index 58409b753..c4a03a3a7 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_assisted_acquisition_cc.h +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_assisted_acquisition_cc.h @@ -58,12 +58,12 @@ class pcps_assisted_acquisition_cc; typedef boost::shared_ptr -pcps_assisted_acquisition_cc_sptr; + pcps_assisted_acquisition_cc_sptr; pcps_assisted_acquisition_cc_sptr pcps_make_assisted_acquisition_cc(int max_dwells, unsigned int sampled_ms, - int doppler_max, int doppler_min, long freq, long fs_in, int samples_per_ms, - bool dump, std::string dump_filename); + int doppler_max, int doppler_min, long freq, long fs_in, int samples_per_ms, + bool dump, std::string dump_filename); /*! * \brief This class implements a Parallel Code Phase Search Acquisition. @@ -71,25 +71,25 @@ pcps_make_assisted_acquisition_cc(int max_dwells, unsigned int sampled_ms, * Check \ref Navitec2012 "An Open Source Galileo E1 Software Receiver", * Algorithm 1, for a pseudocode description of this implementation. */ -class pcps_assisted_acquisition_cc: public gr::block +class pcps_assisted_acquisition_cc : public gr::block { private: friend pcps_assisted_acquisition_cc_sptr pcps_make_assisted_acquisition_cc(int max_dwells, unsigned int sampled_ms, - int doppler_max, int doppler_min, long freq, long fs_in, - int samples_per_ms, bool dump, - std::string dump_filename); + int doppler_max, int doppler_min, long freq, long fs_in, + int samples_per_ms, bool dump, + std::string dump_filename); pcps_assisted_acquisition_cc(int max_dwells, unsigned int sampled_ms, - int doppler_max, int doppler_min, long freq, long fs_in, - int samples_per_ms, bool dump, - std::string dump_filename); + int doppler_max, int doppler_min, long freq, long fs_in, + int samples_per_ms, bool dump, + std::string dump_filename); void calculate_magnitudes(gr_complex* fft_begin, int doppler_shift, - int doppler_offset); + int doppler_offset); - int compute_and_accumulate_grid(gr_vector_const_void_star &input_items); - float estimate_input_power(gr_vector_const_void_star &input_items); + int compute_and_accumulate_grid(gr_vector_const_void_star& input_items); + float estimate_input_power(gr_vector_const_void_star& input_items); double search_maximum(); void get_assistance(); void reset_grid(); @@ -122,7 +122,7 @@ private: gr::fft::fft_complex* d_fft_if; gr::fft::fft_complex* d_ifft; - Gnss_Synchro *d_gnss_synchro; + Gnss_Synchro* d_gnss_synchro; unsigned int d_code_phase; float d_doppler_freq; float d_input_power; @@ -170,7 +170,7 @@ public: * \brief Sets local code for PCPS acquisition algorithm. * \param code - Pointer to the PRN code. */ - void set_local_code(std::complex * code); + void set_local_code(std::complex* code); /*! * \brief Starts acquisition algorithm, turning from standby mode to @@ -219,11 +219,11 @@ public: /*! * \brief Parallel Code Phase Search Acquisition signal processing. */ - int general_work(int noutput_items, gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); + int general_work(int noutput_items, gr_vector_int& ninput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items); - void forecast (int noutput_items, gr_vector_int &ninput_items_required); + void forecast(int noutput_items, gr_vector_int& ninput_items_required); }; #endif /* GNSS_SDR_PCPS_assisted_acquisition_cc_H_*/ diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_cccwsr_acquisition_cc.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_cccwsr_acquisition_cc.cc index 08327a647..9fb67a398 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_cccwsr_acquisition_cc.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_cccwsr_acquisition_cc.cc @@ -41,33 +41,33 @@ #include #include #include "control_message_factory.h" -#include "GPS_L1_CA.h" //GPS_TWO_PI +#include "GPS_L1_CA.h" //GPS_TWO_PI using google::LogMessage; pcps_cccwsr_acquisition_cc_sptr pcps_cccwsr_make_acquisition_cc( - unsigned int sampled_ms, unsigned int max_dwells, - unsigned int doppler_max, long freq, long fs_in, - int samples_per_ms, int samples_per_code, - bool dump, std::string dump_filename) + unsigned int sampled_ms, unsigned int max_dwells, + unsigned int doppler_max, long freq, long fs_in, + int samples_per_ms, int samples_per_code, + bool dump, std::string dump_filename) { return pcps_cccwsr_acquisition_cc_sptr( - new pcps_cccwsr_acquisition_cc(sampled_ms, max_dwells, doppler_max, freq, fs_in, - samples_per_ms, samples_per_code, dump, dump_filename)); + new pcps_cccwsr_acquisition_cc(sampled_ms, max_dwells, doppler_max, freq, fs_in, + samples_per_ms, samples_per_code, dump, dump_filename)); } pcps_cccwsr_acquisition_cc::pcps_cccwsr_acquisition_cc( - unsigned int sampled_ms, unsigned int max_dwells, - unsigned int doppler_max, long freq, long fs_in, - int samples_per_ms, int samples_per_code, - bool dump, std::string dump_filename) : - gr::block("pcps_cccwsr_acquisition_cc", - gr::io_signature::make(1, 1, sizeof(gr_complex) * sampled_ms * samples_per_ms), - gr::io_signature::make(0, 0, sizeof(gr_complex) * sampled_ms * samples_per_ms)) + unsigned int sampled_ms, unsigned int max_dwells, + unsigned int doppler_max, long freq, long fs_in, + int samples_per_ms, int samples_per_code, + bool dump, + std::string dump_filename) : gr::block("pcps_cccwsr_acquisition_cc", + gr::io_signature::make(1, 1, sizeof(gr_complex) * sampled_ms * samples_per_ms), + gr::io_signature::make(0, 0, sizeof(gr_complex) * sampled_ms * samples_per_ms)) { this->message_port_register_out(pmt::mp("events")); - d_sample_counter = 0; // SAMPLE COUNTER + d_sample_counter = 0; // SAMPLE COUNTER d_active = false; d_state = 0; d_freq = freq; @@ -83,13 +83,13 @@ pcps_cccwsr_acquisition_cc::pcps_cccwsr_acquisition_cc( d_input_power = 0.0; d_num_doppler_bins = 0; - d_fft_code_data = static_cast(volk_gnsssdr_malloc(d_fft_size * sizeof(gr_complex), volk_gnsssdr_get_alignment())); - d_fft_code_pilot = static_cast(volk_gnsssdr_malloc(d_fft_size * sizeof(gr_complex), volk_gnsssdr_get_alignment())); - d_data_correlation = static_cast(volk_gnsssdr_malloc(d_fft_size * sizeof(gr_complex), volk_gnsssdr_get_alignment())); - d_pilot_correlation = static_cast(volk_gnsssdr_malloc(d_fft_size * sizeof(gr_complex), volk_gnsssdr_get_alignment())); - d_correlation_plus = static_cast(volk_gnsssdr_malloc(d_fft_size * sizeof(gr_complex), volk_gnsssdr_get_alignment())); - d_correlation_minus = static_cast(volk_gnsssdr_malloc(d_fft_size * sizeof(gr_complex), volk_gnsssdr_get_alignment())); - d_magnitude = static_cast(volk_gnsssdr_malloc(d_fft_size * sizeof(float), volk_gnsssdr_get_alignment())); + d_fft_code_data = static_cast(volk_gnsssdr_malloc(d_fft_size * sizeof(gr_complex), volk_gnsssdr_get_alignment())); + d_fft_code_pilot = static_cast(volk_gnsssdr_malloc(d_fft_size * sizeof(gr_complex), volk_gnsssdr_get_alignment())); + d_data_correlation = static_cast(volk_gnsssdr_malloc(d_fft_size * sizeof(gr_complex), volk_gnsssdr_get_alignment())); + d_pilot_correlation = static_cast(volk_gnsssdr_malloc(d_fft_size * sizeof(gr_complex), volk_gnsssdr_get_alignment())); + d_correlation_plus = static_cast(volk_gnsssdr_malloc(d_fft_size * sizeof(gr_complex), volk_gnsssdr_get_alignment())); + d_correlation_minus = static_cast(volk_gnsssdr_malloc(d_fft_size * sizeof(gr_complex), volk_gnsssdr_get_alignment())); + d_magnitude = static_cast(volk_gnsssdr_malloc(d_fft_size * sizeof(float), volk_gnsssdr_get_alignment())); // Direct FFT d_fft_if = new gr::fft::fft_complex(d_fft_size, true); @@ -140,21 +140,21 @@ pcps_cccwsr_acquisition_cc::~pcps_cccwsr_acquisition_cc() } } -void pcps_cccwsr_acquisition_cc::set_local_code(std::complex* code_data, - std::complex* code_pilot) +void pcps_cccwsr_acquisition_cc::set_local_code(std::complex *code_data, + std::complex *code_pilot) { // Data code (E1B) memcpy(d_fft_if->get_inbuf(), code_data, sizeof(gr_complex) * d_fft_size); - d_fft_if->execute(); // We need the FFT of local code + d_fft_if->execute(); // We need the FFT of local code //Conjugate the local code - volk_32fc_conjugate_32fc(d_fft_code_data,d_fft_if->get_outbuf(),d_fft_size); + volk_32fc_conjugate_32fc(d_fft_code_data, d_fft_if->get_outbuf(), d_fft_size); // Pilot code (E1C) memcpy(d_fft_if->get_inbuf(), code_pilot, sizeof(gr_complex) * d_fft_size); - d_fft_if->execute(); // We need the FFT of local code + d_fft_if->execute(); // We need the FFT of local code //Conjugate the local code, volk_32fc_conjugate_32fc(d_fft_code_pilot, d_fft_if->get_outbuf(), d_fft_size); @@ -178,21 +178,21 @@ void pcps_cccwsr_acquisition_cc::init() for (int doppler = static_cast(-d_doppler_max); doppler <= static_cast(d_doppler_max); doppler += d_doppler_step) - { - d_num_doppler_bins++; - } + { + d_num_doppler_bins++; + } // Create the carrier Doppler wipeoff signals - d_grid_doppler_wipeoffs = new gr_complex*[d_num_doppler_bins]; + d_grid_doppler_wipeoffs = new gr_complex *[d_num_doppler_bins]; for (unsigned int doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++) { - d_grid_doppler_wipeoffs[doppler_index] = static_cast(volk_gnsssdr_malloc(d_fft_size * sizeof(gr_complex), volk_gnsssdr_get_alignment())); + d_grid_doppler_wipeoffs[doppler_index] = static_cast(volk_gnsssdr_malloc(d_fft_size * sizeof(gr_complex), volk_gnsssdr_get_alignment())); int doppler = -static_cast(d_doppler_max) + d_doppler_step * doppler_index; float phase_step_rad = GPS_TWO_PI * (d_freq + doppler) / static_cast(d_fs_in); float _phase[1]; _phase[0] = 0; - volk_gnsssdr_s32f_sincos_32fc(d_grid_doppler_wipeoffs[doppler_index], - phase_step_rad, _phase, d_fft_size); + volk_gnsssdr_s32f_sincos_32fc(d_grid_doppler_wipeoffs[doppler_index], -phase_step_rad, _phase, d_fft_size); } } @@ -211,7 +211,8 @@ void pcps_cccwsr_acquisition_cc::set_state(int state) d_test_statistics = 0.0; } else if (d_state == 0) - {} + { + } else { LOG(ERROR) << "State can only be set to 0 or 1"; @@ -220,227 +221,226 @@ void pcps_cccwsr_acquisition_cc::set_state(int state) int pcps_cccwsr_acquisition_cc::general_work(int noutput_items, - gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items __attribute__((unused))) + gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items __attribute__((unused))) { - - int acquisition_message = -1; //0=STOP_CHANNEL 1=ACQ_SUCCEES 2=ACQ_FAIL + int acquisition_message = -1; //0=STOP_CHANNEL 1=ACQ_SUCCEES 2=ACQ_FAIL switch (d_state) - { - case 0: { - if (d_active) - { - //restart acquisition variables - d_gnss_synchro->Acq_delay_samples = 0.0; - d_gnss_synchro->Acq_doppler_hz = 0.0; - d_gnss_synchro->Acq_samplestamp_samples = 0; - d_well_count = 0; - d_mag = 0.0; - d_input_power = 0.0; - d_test_statistics = 0.0; - - d_state = 1; - } - - d_sample_counter += d_fft_size * ninput_items[0]; // sample counter - consume_each(ninput_items[0]); - - break; - } - case 1: - { - // initialize acquisition algorithm - int doppler; - - uint32_t indext = 0; - uint32_t indext_plus = 0; - uint32_t indext_minus = 0; - float magt = 0.0; - float magt_plus = 0.0; - float magt_minus = 0.0; - const gr_complex *in = reinterpret_cast(input_items[0]); //Get the input samples pointer - float fft_normalization_factor = static_cast(d_fft_size) * static_cast(d_fft_size); - - d_sample_counter += d_fft_size; // sample counter - - d_well_count++; - - DLOG(INFO) << "Channel: " << d_channel - << " , doing acquisition of satellite: " << d_gnss_synchro->System << " "<< d_gnss_synchro->PRN - << " ,sample stamp: " << d_sample_counter << ", threshold: " - << d_threshold << ", doppler_max: " << d_doppler_max - << ", doppler_step: " << d_doppler_step; - - // 1- Compute the input signal power estimation - volk_32fc_magnitude_squared_32f(d_magnitude, in, d_fft_size); - volk_32f_accumulator_s32f(&d_input_power, d_magnitude, d_fft_size); - d_input_power /= static_cast(d_fft_size); - - // 2- Doppler frequency search loop - for (unsigned int doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++) - { - // doppler search steps - - doppler = -static_cast(d_doppler_max) + d_doppler_step * doppler_index; - - volk_32fc_x2_multiply_32fc(d_fft_if->get_inbuf(), in, - d_grid_doppler_wipeoffs[doppler_index], d_fft_size); - - // 3- Perform the FFT-based convolution (parallel time search) - // Compute the FFT of the carrier wiped--off incoming signal - d_fft_if->execute(); - - // Multiply carrier wiped--off, Fourier transformed incoming signal - // with the local FFT'd data code reference (E1B) using SIMD operations - // with VOLK library - volk_32fc_x2_multiply_32fc(d_ifft->get_inbuf(), - d_fft_if->get_outbuf(), d_fft_code_data, d_fft_size); - - // compute the inverse FFT - d_ifft->execute(); - - // Copy the result of the correlation between wiped--off signal and data code in - // d_data_correlation. - memcpy(d_data_correlation, d_ifft->get_outbuf(), sizeof(gr_complex)*d_fft_size); - - // Multiply carrier wiped--off, Fourier transformed incoming signal - // with the local FFT'd pilot code reference (E1C) using SIMD operations - // with VOLK library - volk_32fc_x2_multiply_32fc(d_ifft->get_inbuf(), - d_fft_if->get_outbuf(), d_fft_code_pilot, d_fft_size); - - // Compute the inverse FFT - d_ifft->execute(); - - // Copy the result of the correlation between wiped--off signal and pilot code in - // d_data_correlation. - memcpy(d_pilot_correlation, d_ifft->get_outbuf(), sizeof(gr_complex)*d_fft_size); - - for (unsigned int i = 0; i < d_fft_size; i++) - { - d_correlation_plus[i] = std::complex( - d_data_correlation[i].real() - d_pilot_correlation[i].imag(), - d_data_correlation[i].imag() + d_pilot_correlation[i].real()); - - d_correlation_minus[i] = std::complex( - d_data_correlation[i].real() + d_pilot_correlation[i].imag(), - d_data_correlation[i].imag() - d_pilot_correlation[i].real()); - } - - volk_32fc_magnitude_squared_32f(d_magnitude, d_correlation_plus, d_fft_size); - volk_gnsssdr_32f_index_max_32u(&indext_plus, d_magnitude, d_fft_size); - magt_plus = d_magnitude[indext_plus] / (fft_normalization_factor * fft_normalization_factor); - - volk_32fc_magnitude_squared_32f(d_magnitude, d_correlation_minus, d_fft_size); - volk_gnsssdr_32f_index_max_32u(&indext_minus, d_magnitude, d_fft_size); - magt_minus = d_magnitude[indext_minus] / (fft_normalization_factor * fft_normalization_factor); - - if (magt_plus >= magt_minus) + case 0: + { + if (d_active) { - magt = magt_plus; - indext = indext_plus; - } - else - { - magt = magt_minus; - indext = indext_minus; + //restart acquisition variables + d_gnss_synchro->Acq_delay_samples = 0.0; + d_gnss_synchro->Acq_doppler_hz = 0.0; + d_gnss_synchro->Acq_samplestamp_samples = 0; + d_well_count = 0; + d_mag = 0.0; + d_input_power = 0.0; + d_test_statistics = 0.0; + + d_state = 1; } - // 4- record the maximum peak and the associated synchronization parameters - if (d_mag < magt) - { - d_mag = magt; - d_gnss_synchro->Acq_delay_samples = static_cast(indext % d_samples_per_code); - d_gnss_synchro->Acq_doppler_hz = static_cast(doppler); - d_gnss_synchro->Acq_samplestamp_samples = d_sample_counter; - } + d_sample_counter += d_fft_size * ninput_items[0]; // sample counter + consume_each(ninput_items[0]); - // Record results to file if required - if (d_dump) - { - std::stringstream filename; - std::streamsize n = 2 * sizeof(float) * (d_fft_size); // complex file write - filename.str(""); - filename << "../data/test_statistics_" << d_gnss_synchro->System - <<"_" << d_gnss_synchro->Signal << "_sat_" - << d_gnss_synchro->PRN << "_doppler_" << doppler << ".dat"; - d_dump_file.open(filename.str().c_str(), std::ios::out | std::ios::binary); - d_dump_file.write(reinterpret_cast(d_ifft->get_outbuf()), n); //write directly |abs(x)|^2 in this Doppler bin? - d_dump_file.close(); - } - } + break; + } + case 1: + { + // initialize acquisition algorithm + int doppler; - // 5- Compute the test statistics and compare to the threshold - //d_test_statistics = 2 * d_fft_size * d_mag / d_input_power; - d_test_statistics = d_mag / d_input_power; + uint32_t indext = 0; + uint32_t indext_plus = 0; + uint32_t indext_minus = 0; + float magt = 0.0; + float magt_plus = 0.0; + float magt_minus = 0.0; + const gr_complex *in = reinterpret_cast(input_items[0]); //Get the input samples pointer + float fft_normalization_factor = static_cast(d_fft_size) * static_cast(d_fft_size); - // 6- Declare positive or negative acquisition using a message port - if (d_test_statistics > d_threshold) - { - d_state = 2; // Positive acquisition - } - else if (d_well_count == d_max_dwells) - { - d_state = 3; // Negative acquisition - } + d_sample_counter += d_fft_size; // sample counter - consume_each(1); + d_well_count++; - break; + DLOG(INFO) << "Channel: " << d_channel + << " , doing acquisition of satellite: " << d_gnss_synchro->System << " " << d_gnss_synchro->PRN + << " ,sample stamp: " << d_sample_counter << ", threshold: " + << d_threshold << ", doppler_max: " << d_doppler_max + << ", doppler_step: " << d_doppler_step; + + // 1- Compute the input signal power estimation + volk_32fc_magnitude_squared_32f(d_magnitude, in, d_fft_size); + volk_32f_accumulator_s32f(&d_input_power, d_magnitude, d_fft_size); + d_input_power /= static_cast(d_fft_size); + + // 2- Doppler frequency search loop + for (unsigned int doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++) + { + // doppler search steps + + doppler = -static_cast(d_doppler_max) + d_doppler_step * doppler_index; + + volk_32fc_x2_multiply_32fc(d_fft_if->get_inbuf(), in, + d_grid_doppler_wipeoffs[doppler_index], d_fft_size); + + // 3- Perform the FFT-based convolution (parallel time search) + // Compute the FFT of the carrier wiped--off incoming signal + d_fft_if->execute(); + + // Multiply carrier wiped--off, Fourier transformed incoming signal + // with the local FFT'd data code reference (E1B) using SIMD operations + // with VOLK library + volk_32fc_x2_multiply_32fc(d_ifft->get_inbuf(), + d_fft_if->get_outbuf(), d_fft_code_data, d_fft_size); + + // compute the inverse FFT + d_ifft->execute(); + + // Copy the result of the correlation between wiped--off signal and data code in + // d_data_correlation. + memcpy(d_data_correlation, d_ifft->get_outbuf(), sizeof(gr_complex) * d_fft_size); + + // Multiply carrier wiped--off, Fourier transformed incoming signal + // with the local FFT'd pilot code reference (E1C) using SIMD operations + // with VOLK library + volk_32fc_x2_multiply_32fc(d_ifft->get_inbuf(), + d_fft_if->get_outbuf(), d_fft_code_pilot, d_fft_size); + + // Compute the inverse FFT + d_ifft->execute(); + + // Copy the result of the correlation between wiped--off signal and pilot code in + // d_data_correlation. + memcpy(d_pilot_correlation, d_ifft->get_outbuf(), sizeof(gr_complex) * d_fft_size); + + for (unsigned int i = 0; i < d_fft_size; i++) + { + d_correlation_plus[i] = std::complex( + d_data_correlation[i].real() - d_pilot_correlation[i].imag(), + d_data_correlation[i].imag() + d_pilot_correlation[i].real()); + + d_correlation_minus[i] = std::complex( + d_data_correlation[i].real() + d_pilot_correlation[i].imag(), + d_data_correlation[i].imag() - d_pilot_correlation[i].real()); + } + + volk_32fc_magnitude_squared_32f(d_magnitude, d_correlation_plus, d_fft_size); + volk_gnsssdr_32f_index_max_32u(&indext_plus, d_magnitude, d_fft_size); + magt_plus = d_magnitude[indext_plus] / (fft_normalization_factor * fft_normalization_factor); + + volk_32fc_magnitude_squared_32f(d_magnitude, d_correlation_minus, d_fft_size); + volk_gnsssdr_32f_index_max_32u(&indext_minus, d_magnitude, d_fft_size); + magt_minus = d_magnitude[indext_minus] / (fft_normalization_factor * fft_normalization_factor); + + if (magt_plus >= magt_minus) + { + magt = magt_plus; + indext = indext_plus; + } + else + { + magt = magt_minus; + indext = indext_minus; + } + + // 4- record the maximum peak and the associated synchronization parameters + if (d_mag < magt) + { + d_mag = magt; + d_gnss_synchro->Acq_delay_samples = static_cast(indext % d_samples_per_code); + d_gnss_synchro->Acq_doppler_hz = static_cast(doppler); + d_gnss_synchro->Acq_samplestamp_samples = d_sample_counter; + } + + // Record results to file if required + if (d_dump) + { + std::stringstream filename; + std::streamsize n = 2 * sizeof(float) * (d_fft_size); // complex file write + filename.str(""); + filename << "../data/test_statistics_" << d_gnss_synchro->System + << "_" << d_gnss_synchro->Signal << "_sat_" + << d_gnss_synchro->PRN << "_doppler_" << doppler << ".dat"; + d_dump_file.open(filename.str().c_str(), std::ios::out | std::ios::binary); + d_dump_file.write(reinterpret_cast(d_ifft->get_outbuf()), n); //write directly |abs(x)|^2 in this Doppler bin? + d_dump_file.close(); + } + } + + // 5- Compute the test statistics and compare to the threshold + //d_test_statistics = 2 * d_fft_size * d_mag / d_input_power; + d_test_statistics = d_mag / d_input_power; + + // 6- Declare positive or negative acquisition using a message port + if (d_test_statistics > d_threshold) + { + d_state = 2; // Positive acquisition + } + else if (d_well_count == d_max_dwells) + { + d_state = 3; // Negative acquisition + } + + consume_each(1); + + break; + } + + case 2: + { + // 6.1- Declare positive acquisition using a message port + DLOG(INFO) << "positive acquisition"; + DLOG(INFO) << "satellite " << d_gnss_synchro->System << " " << d_gnss_synchro->PRN; + DLOG(INFO) << "sample_stamp " << d_sample_counter; + DLOG(INFO) << "test statistics value " << d_test_statistics; + DLOG(INFO) << "test statistics threshold " << d_threshold; + DLOG(INFO) << "code phase " << d_gnss_synchro->Acq_delay_samples; + DLOG(INFO) << "doppler " << d_gnss_synchro->Acq_doppler_hz; + DLOG(INFO) << "magnitude " << d_mag; + DLOG(INFO) << "input signal power " << d_input_power; + + d_active = false; + d_state = 0; + + d_sample_counter += d_fft_size * ninput_items[0]; // sample counter + consume_each(ninput_items[0]); + + acquisition_message = 1; + this->message_port_pub(pmt::mp("events"), pmt::from_long(acquisition_message)); + + break; + } + + case 3: + { + // 6.2- Declare negative acquisition using a message port + DLOG(INFO) << "negative acquisition"; + DLOG(INFO) << "satellite " << d_gnss_synchro->System << " " << d_gnss_synchro->PRN; + DLOG(INFO) << "sample_stamp " << d_sample_counter; + DLOG(INFO) << "test statistics value " << d_test_statistics; + DLOG(INFO) << "test statistics threshold " << d_threshold; + DLOG(INFO) << "code phase " << d_gnss_synchro->Acq_delay_samples; + DLOG(INFO) << "doppler " << d_gnss_synchro->Acq_doppler_hz; + DLOG(INFO) << "magnitude " << d_mag; + DLOG(INFO) << "input signal power " << d_input_power; + + d_active = false; + d_state = 0; + + d_sample_counter += d_fft_size * ninput_items[0]; // sample counter + consume_each(ninput_items[0]); + + acquisition_message = 2; + this->message_port_pub(pmt::mp("events"), pmt::from_long(acquisition_message)); + + break; + } } - case 2: - { - // 6.1- Declare positive acquisition using a message port - DLOG(INFO) << "positive acquisition"; - DLOG(INFO) << "satellite " << d_gnss_synchro->System << " " << d_gnss_synchro->PRN; - DLOG(INFO) << "sample_stamp " << d_sample_counter; - DLOG(INFO) << "test statistics value " << d_test_statistics; - DLOG(INFO) << "test statistics threshold " << d_threshold; - DLOG(INFO) << "code phase " << d_gnss_synchro->Acq_delay_samples; - DLOG(INFO) << "doppler " << d_gnss_synchro->Acq_doppler_hz; - DLOG(INFO) << "magnitude " << d_mag; - DLOG(INFO) << "input signal power " << d_input_power; - - d_active = false; - d_state = 0; - - d_sample_counter += d_fft_size * ninput_items[0]; // sample counter - consume_each(ninput_items[0]); - - acquisition_message = 1; - this->message_port_pub(pmt::mp("events"), pmt::from_long(acquisition_message)); - - break; - } - - case 3: - { - // 6.2- Declare negative acquisition using a message port - DLOG(INFO) << "negative acquisition"; - DLOG(INFO) << "satellite " << d_gnss_synchro->System << " " << d_gnss_synchro->PRN; - DLOG(INFO) << "sample_stamp " << d_sample_counter; - DLOG(INFO) << "test statistics value " << d_test_statistics; - DLOG(INFO) << "test statistics threshold " << d_threshold; - DLOG(INFO) << "code phase " << d_gnss_synchro->Acq_delay_samples; - DLOG(INFO) << "doppler " << d_gnss_synchro->Acq_doppler_hz; - DLOG(INFO) << "magnitude " << d_mag; - DLOG(INFO) << "input signal power " << d_input_power; - - d_active = false; - d_state = 0; - - d_sample_counter += d_fft_size * ninput_items[0]; // sample counter - consume_each(ninput_items[0]); - - acquisition_message = 2; - this->message_port_pub(pmt::mp("events"), pmt::from_long(acquisition_message)); - - break; - } - } - return noutput_items; } diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_cccwsr_acquisition_cc.h b/src/algorithms/acquisition/gnuradio_blocks/pcps_cccwsr_acquisition_cc.h index dad25665b..22ad06d72 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_cccwsr_acquisition_cc.h +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_cccwsr_acquisition_cc.h @@ -51,30 +51,30 @@ typedef boost::shared_ptr pcps_cccwsr_acquisition_cc pcps_cccwsr_acquisition_cc_sptr pcps_cccwsr_make_acquisition_cc(unsigned int sampled_ms, unsigned int max_dwells, - unsigned int doppler_max, long freq, long fs_in, - int samples_per_ms, int samples_per_code, - bool dump, std::string dump_filename); + unsigned int doppler_max, long freq, long fs_in, + int samples_per_ms, int samples_per_code, + bool dump, std::string dump_filename); /*! * \brief This class implements a Parallel Code Phase Search Acquisition with * Coherent Channel Combining With Sign Recovery scheme. */ -class pcps_cccwsr_acquisition_cc: public gr::block +class pcps_cccwsr_acquisition_cc : public gr::block { private: friend pcps_cccwsr_acquisition_cc_sptr pcps_cccwsr_make_acquisition_cc(unsigned int sampled_ms, unsigned int max_dwells, - unsigned int doppler_max, long freq, long fs_in, - int samples_per_ms, int samples_per_code, - bool dump, std::string dump_filename); + unsigned int doppler_max, long freq, long fs_in, + int samples_per_ms, int samples_per_code, + bool dump, std::string dump_filename); pcps_cccwsr_acquisition_cc(unsigned int sampled_ms, unsigned int max_dwells, - unsigned int doppler_max, long freq, long fs_in, - int samples_per_ms, int samples_per_code, - bool dump, std::string dump_filename); + unsigned int doppler_max, long freq, long fs_in, + int samples_per_ms, int samples_per_code, + bool dump, std::string dump_filename); void calculate_magnitudes(gr_complex* fft_begin, int doppler_shift, - int doppler_offset); + int doppler_offset); long d_fs_in; long d_freq; @@ -96,7 +96,7 @@ private: gr_complex* d_fft_code_pilot; gr::fft::fft_complex* d_fft_if; gr::fft::fft_complex* d_ifft; - Gnss_Synchro *d_gnss_synchro; + Gnss_Synchro* d_gnss_synchro; unsigned int d_code_phase; float d_doppler_freq; float d_mag; @@ -118,98 +118,98 @@ public: /*! * \brief Default destructor. */ - ~pcps_cccwsr_acquisition_cc(); + ~pcps_cccwsr_acquisition_cc(); /*! * \brief Set acquisition/tracking common Gnss_Synchro object pointer * to exchange synchronization data between acquisition and tracking blocks. * \param p_gnss_synchro Satellite information shared by the processing blocks. */ - inline void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) - { - d_gnss_synchro = p_gnss_synchro; - } + inline void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) + { + d_gnss_synchro = p_gnss_synchro; + } - /*! + /*! * \brief Returns the maximum peak of grid search. */ - inline unsigned int mag() const - { - return d_mag; - } + inline unsigned int mag() const + { + return d_mag; + } - /*! + /*! * \brief Initializes acquisition algorithm. */ - void init(); + void init(); - /*! + /*! * \brief Sets local code for CCCWSR acquisition algorithm. * \param data_code - Pointer to the data PRN code. * \param pilot_code - Pointer to the pilot PRN code. */ - void set_local_code(std::complex * code_data, std::complex * code_pilot); + void set_local_code(std::complex* code_data, std::complex* code_pilot); - /*! + /*! * \brief Starts acquisition algorithm, turning from standby mode to * active mode * \param active - bool that activates/deactivates the block. */ - inline void set_active(bool active) - { - d_active = active; - } + inline void set_active(bool active) + { + d_active = active; + } - /*! + /*! * \brief If set to 1, ensures that acquisition starts at the * first available sample. * \param state - int=1 forces start of acquisition */ - void set_state(int state); + void set_state(int state); - /*! + /*! * \brief Set acquisition channel unique ID * \param channel - receiver channel. */ - inline void set_channel(unsigned int channel) - { - d_channel = channel; - } + inline void set_channel(unsigned int channel) + { + d_channel = channel; + } - /*! + /*! * \brief Set statistics threshold of CCCWSR algorithm. * \param threshold - Threshold for signal detection (check \ref Navitec2012, * Algorithm 1, for a definition of this threshold). */ - inline void set_threshold(float threshold) - { - d_threshold = threshold; - } + inline void set_threshold(float threshold) + { + d_threshold = threshold; + } - /*! + /*! * \brief Set maximum Doppler grid search * \param doppler_max - Maximum Doppler shift considered in the grid search [Hz]. */ - inline void set_doppler_max(unsigned int doppler_max) - { - d_doppler_max = doppler_max; - } + inline void set_doppler_max(unsigned int doppler_max) + { + d_doppler_max = doppler_max; + } - /*! + /*! * \brief Set Doppler steps for the grid search * \param doppler_step - Frequency bin of the search grid [Hz]. */ - inline void set_doppler_step(unsigned int doppler_step) - { - d_doppler_step = doppler_step; - } + inline void set_doppler_step(unsigned int doppler_step) + { + d_doppler_step = doppler_step; + } - /*! + /*! * \brief Coherent Channel Combining With Sign Recovery Acquisition signal processing. */ - int general_work(int noutput_items, gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); + int general_work(int noutput_items, gr_vector_int& ninput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items); }; #endif /* GNSS_SDR_PCPS_CCCWSR_ACQUISITION_CC_H_*/ diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_opencl_acquisition_cc.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_opencl_acquisition_cc.cc index 28823347e..17d3628d5 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_opencl_acquisition_cc.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_opencl_acquisition_cc.cc @@ -58,40 +58,38 @@ #include #include #include "control_message_factory.h" -#include "fft_base_kernels.h" -#include "fft_internal.h" -#include "GPS_L1_CA.h" //GPS_TWO_PI +#include "opencl/fft_base_kernels.h" +#include "opencl/fft_internal.h" +#include "GPS_L1_CA.h" //GPS_TWO_PI using google::LogMessage; pcps_opencl_acquisition_cc_sptr pcps_make_opencl_acquisition_cc( - unsigned int sampled_ms, unsigned int max_dwells, - unsigned int doppler_max, long freq, long fs_in, - int samples_per_ms, int samples_per_code, - bool bit_transition_flag, - bool dump, - std::string dump_filename) + unsigned int sampled_ms, unsigned int max_dwells, + unsigned int doppler_max, long freq, long fs_in, + int samples_per_ms, int samples_per_code, + bool bit_transition_flag, + bool dump, + std::string dump_filename) { - return pcps_opencl_acquisition_cc_sptr( - new pcps_opencl_acquisition_cc(sampled_ms, max_dwells, doppler_max, freq, fs_in, samples_per_ms, - samples_per_code, bit_transition_flag, dump, dump_filename)); + new pcps_opencl_acquisition_cc(sampled_ms, max_dwells, doppler_max, freq, fs_in, samples_per_ms, + samples_per_code, bit_transition_flag, dump, dump_filename)); } pcps_opencl_acquisition_cc::pcps_opencl_acquisition_cc( - unsigned int sampled_ms, unsigned int max_dwells, - unsigned int doppler_max, long freq, long fs_in, - int samples_per_ms, int samples_per_code, - bool bit_transition_flag, - bool dump, - std::string dump_filename) : - gr::block("pcps_opencl_acquisition_cc", - gr::io_signature::make(1, 1, sizeof(gr_complex) * sampled_ms * samples_per_ms), - gr::io_signature::make(0, 0, sizeof(gr_complex) * sampled_ms * samples_per_ms)) + unsigned int sampled_ms, unsigned int max_dwells, + unsigned int doppler_max, long freq, long fs_in, + int samples_per_ms, int samples_per_code, + bool bit_transition_flag, + bool dump, + std::string dump_filename) : gr::block("pcps_opencl_acquisition_cc", + gr::io_signature::make(1, 1, sizeof(gr_complex) * sampled_ms * samples_per_ms), + gr::io_signature::make(0, 0, sizeof(gr_complex) * sampled_ms * samples_per_ms)) { this->message_port_register_out(pmt::mp("events")); - d_sample_counter = 0; // SAMPLE COUNTER + d_sample_counter = 0; // SAMPLE COUNTER d_active = false; d_state = 0; d_core_working = false; @@ -112,39 +110,37 @@ pcps_opencl_acquisition_cc::pcps_opencl_acquisition_cc( d_in_dwell_count = 0; d_cl_fft_batch_size = 1; - d_in_buffer = new gr_complex*[d_max_dwells]; + d_in_buffer = new gr_complex *[d_max_dwells]; for (unsigned int i = 0; i < d_max_dwells; i++) { - d_in_buffer[i] = static_cast(volk_gnsssdr_malloc(d_fft_size * sizeof(gr_complex), volk_gnsssdr_get_alignment())); + d_in_buffer[i] = static_cast(volk_gnsssdr_malloc(d_fft_size * sizeof(gr_complex), volk_gnsssdr_get_alignment())); } - d_magnitude = static_cast(volk_gnsssdr_malloc(d_fft_size * sizeof(float), volk_gnsssdr_get_alignment())); - d_fft_codes = static_cast(volk_gnsssdr_malloc(d_fft_size_pow2 * sizeof(gr_complex), volk_gnsssdr_get_alignment())); - d_zero_vector = static_cast(volk_gnsssdr_malloc((d_fft_size_pow2 - d_fft_size) * sizeof(gr_complex), volk_gnsssdr_get_alignment())); + d_magnitude = static_cast(volk_gnsssdr_malloc(d_fft_size * sizeof(float), volk_gnsssdr_get_alignment())); + d_fft_codes = static_cast(volk_gnsssdr_malloc(d_fft_size_pow2 * sizeof(gr_complex), volk_gnsssdr_get_alignment())); + d_zero_vector = static_cast(volk_gnsssdr_malloc((d_fft_size_pow2 - d_fft_size) * sizeof(gr_complex), volk_gnsssdr_get_alignment())); - for (unsigned int i = 0; i < (d_fft_size_pow2-d_fft_size); i++) + for (unsigned int i = 0; i < (d_fft_size_pow2 - d_fft_size); i++) { - d_zero_vector[i] = gr_complex(0.0,0.0); + d_zero_vector[i] = gr_complex(0.0, 0.0); } d_opencl = init_opencl_environment("math_kernel.cl"); if (d_opencl != 0) - { - // Direct FFT - d_fft_if = new gr::fft::fft_complex(d_fft_size, true); + { + // Direct FFT + d_fft_if = new gr::fft::fft_complex(d_fft_size, true); - // Inverse FFT - d_ifft = new gr::fft::fft_complex(d_fft_size, false); - } + // Inverse FFT + d_ifft = new gr::fft::fft_complex(d_fft_size, false); + } // For dumping samples into a file d_dump = dump; d_dump_filename = dump_filename; - } - pcps_opencl_acquisition_cc::~pcps_opencl_acquisition_cc() { if (d_num_doppler_bins > 0) @@ -174,7 +170,7 @@ pcps_opencl_acquisition_cc::~pcps_opencl_acquisition_cc() delete d_cl_buffer_2; delete d_cl_buffer_magnitude; delete d_cl_buffer_fft_codes; - if(d_num_doppler_bins > 0) + if (d_num_doppler_bins > 0) { delete[] d_cl_buffer_grid_doppler_wipeoffs; } @@ -194,20 +190,19 @@ pcps_opencl_acquisition_cc::~pcps_opencl_acquisition_cc() } - int pcps_opencl_acquisition_cc::init_opencl_environment(std::string kernel_filename) { //get all platforms (drivers) std::vector all_platforms; cl::Platform::get(&all_platforms); - if(all_platforms.size()==0) - { - std::cout << "No OpenCL platforms found. Check OpenCL installation!" << std::endl; - return 1; - } + if (all_platforms.size() == 0) + { + std::cout << "No OpenCL platforms found. Check OpenCL installation!" << std::endl; + return 1; + } - d_cl_platform = all_platforms[0]; //get default platform + d_cl_platform = all_platforms[0]; //get default platform std::cout << "Using platform: " << d_cl_platform.getInfo() << std::endl; @@ -215,11 +210,11 @@ int pcps_opencl_acquisition_cc::init_opencl_environment(std::string kernel_filen std::vector gpu_devices; d_cl_platform.getDevices(CL_DEVICE_TYPE_GPU, &gpu_devices); - if(gpu_devices.size()==0) - { - std::cout << "No GPU devices found. Check OpenCL installation!" << std::endl; - return 2; - } + if (gpu_devices.size() == 0) + { + std::cout << "No GPU devices found. Check OpenCL installation!" << std::endl; + return 2; + } d_cl_device = gpu_devices[0]; @@ -240,53 +235,52 @@ int pcps_opencl_acquisition_cc::init_opencl_environment(std::string kernel_filen cl::Program::Sources sources; - sources.push_back({kernel_code.c_str(),kernel_code.length()}); + sources.push_back({kernel_code.c_str(), kernel_code.length()}); - cl::Program program(context,sources); - if(program.build(device)!=CL_SUCCESS) - { - std::cout << " Error building: " - << program.getBuildInfo(device[0]) - << std::endl; - return 3; - } + cl::Program program(context, sources); + if (program.build(device) != CL_SUCCESS) + { + std::cout << " Error building: " + << program.getBuildInfo(device[0]) + << std::endl; + return 3; + } d_cl_program = program; // create buffers on the device - d_cl_buffer_in = new cl::Buffer(d_cl_context, CL_MEM_READ_WRITE, sizeof(gr_complex)*d_fft_size); - d_cl_buffer_fft_codes = new cl::Buffer(d_cl_context, CL_MEM_READ_WRITE, sizeof(gr_complex)*d_fft_size_pow2); - d_cl_buffer_1 = new cl::Buffer(d_cl_context, CL_MEM_READ_WRITE, sizeof(gr_complex)*d_fft_size_pow2); - d_cl_buffer_2 = new cl::Buffer(d_cl_context, CL_MEM_READ_WRITE, sizeof(gr_complex)*d_fft_size_pow2); - d_cl_buffer_magnitude = new cl::Buffer(d_cl_context, CL_MEM_READ_WRITE, sizeof(float)*d_fft_size); + d_cl_buffer_in = new cl::Buffer(d_cl_context, CL_MEM_READ_WRITE, sizeof(gr_complex) * d_fft_size); + d_cl_buffer_fft_codes = new cl::Buffer(d_cl_context, CL_MEM_READ_WRITE, sizeof(gr_complex) * d_fft_size_pow2); + d_cl_buffer_1 = new cl::Buffer(d_cl_context, CL_MEM_READ_WRITE, sizeof(gr_complex) * d_fft_size_pow2); + d_cl_buffer_2 = new cl::Buffer(d_cl_context, CL_MEM_READ_WRITE, sizeof(gr_complex) * d_fft_size_pow2); + d_cl_buffer_magnitude = new cl::Buffer(d_cl_context, CL_MEM_READ_WRITE, sizeof(float) * d_fft_size); //create queue to which we will push commands for the device. - d_cl_queue = new cl::CommandQueue(d_cl_context,d_cl_device); + d_cl_queue = new cl::CommandQueue(d_cl_context, d_cl_device); //create FFT plan cl_int err; clFFT_Dim3 dim = {d_fft_size_pow2, 1, 1}; d_cl_fft_plan = clFFT_CreatePlan(d_cl_context(), dim, clFFT_1D, - clFFT_InterleavedComplexFormat, &err); + clFFT_InterleavedComplexFormat, &err); if (err != 0) - { - delete d_cl_queue; - delete d_cl_buffer_in; - delete d_cl_buffer_1; - delete d_cl_buffer_2; - delete d_cl_buffer_magnitude; - delete d_cl_buffer_fft_codes; + { + delete d_cl_queue; + delete d_cl_buffer_in; + delete d_cl_buffer_1; + delete d_cl_buffer_2; + delete d_cl_buffer_magnitude; + delete d_cl_buffer_fft_codes; - std::cout << "Error creating OpenCL FFT plan." << std::endl; - return 4; - } + std::cout << "Error creating OpenCL FFT plan." << std::endl; + return 4; + } return 0; } - void pcps_opencl_acquisition_cc::init() { d_gnss_synchro->Flag_valid_acquisition = false; @@ -305,76 +299,75 @@ void pcps_opencl_acquisition_cc::init() for (int doppler = static_cast(-d_doppler_max); doppler <= static_cast(d_doppler_max); doppler += d_doppler_step) - { - d_num_doppler_bins++; - } + { + d_num_doppler_bins++; + } // Create the carrier Doppler wipeoff signals - d_grid_doppler_wipeoffs = new gr_complex*[d_num_doppler_bins]; + d_grid_doppler_wipeoffs = new gr_complex *[d_num_doppler_bins]; if (d_opencl == 0) { - d_cl_buffer_grid_doppler_wipeoffs = new cl::Buffer*[d_num_doppler_bins]; + d_cl_buffer_grid_doppler_wipeoffs = new cl::Buffer *[d_num_doppler_bins]; } for (unsigned int doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++) { - d_grid_doppler_wipeoffs[doppler_index] = static_cast(volk_gnsssdr_malloc(d_fft_size * sizeof(gr_complex), volk_gnsssdr_get_alignment())); + d_grid_doppler_wipeoffs[doppler_index] = static_cast(volk_gnsssdr_malloc(d_fft_size * sizeof(gr_complex), volk_gnsssdr_get_alignment())); int doppler = -static_cast(d_doppler_max) + d_doppler_step * doppler_index; float phase_step_rad = static_cast(GPS_TWO_PI) * (d_freq + doppler) / static_cast(d_fs_in); float _phase[1]; _phase[0] = 0; - volk_gnsssdr_s32f_sincos_32fc(d_grid_doppler_wipeoffs[doppler_index], - phase_step_rad, _phase, d_fft_size); + volk_gnsssdr_s32f_sincos_32fc(d_grid_doppler_wipeoffs[doppler_index], -phase_step_rad, _phase, d_fft_size); if (d_opencl == 0) { d_cl_buffer_grid_doppler_wipeoffs[doppler_index] = - new cl::Buffer(d_cl_context, CL_MEM_READ_WRITE, sizeof(gr_complex)*d_fft_size); + new cl::Buffer(d_cl_context, CL_MEM_READ_WRITE, sizeof(gr_complex) * d_fft_size); d_cl_queue->enqueueWriteBuffer(*(d_cl_buffer_grid_doppler_wipeoffs[doppler_index]), - CL_TRUE, 0, sizeof(gr_complex)*d_fft_size, - d_grid_doppler_wipeoffs[doppler_index]); + CL_TRUE, 0, sizeof(gr_complex) * d_fft_size, + d_grid_doppler_wipeoffs[doppler_index]); } } // zero padding in buffer_1 (FFT input) if (d_opencl == 0) - { - d_cl_queue->enqueueWriteBuffer(*d_cl_buffer_1, CL_TRUE, sizeof(gr_complex)*d_fft_size, - sizeof(gr_complex)*(d_fft_size_pow2 - d_fft_size), d_zero_vector); - } + { + d_cl_queue->enqueueWriteBuffer(*d_cl_buffer_1, CL_TRUE, sizeof(gr_complex) * d_fft_size, + sizeof(gr_complex) * (d_fft_size_pow2 - d_fft_size), d_zero_vector); + } } -void pcps_opencl_acquisition_cc::set_local_code(std::complex * code) +void pcps_opencl_acquisition_cc::set_local_code(std::complex *code) { - if(d_opencl == 0) + if (d_opencl == 0) { d_cl_queue->enqueueWriteBuffer(*d_cl_buffer_2, CL_TRUE, 0, - sizeof(gr_complex)*d_fft_size, code); + sizeof(gr_complex) * d_fft_size, code); - d_cl_queue->enqueueWriteBuffer(*d_cl_buffer_2, CL_TRUE, sizeof(gr_complex)*d_fft_size, - sizeof(gr_complex)*(d_fft_size_pow2 - 2*d_fft_size), - d_zero_vector); + d_cl_queue->enqueueWriteBuffer(*d_cl_buffer_2, CL_TRUE, sizeof(gr_complex) * d_fft_size, + sizeof(gr_complex) * (d_fft_size_pow2 - 2 * d_fft_size), + d_zero_vector); - d_cl_queue->enqueueWriteBuffer(*d_cl_buffer_2, CL_TRUE, sizeof(gr_complex) - *(d_fft_size_pow2 - d_fft_size), - sizeof(gr_complex)*d_fft_size, code); + d_cl_queue->enqueueWriteBuffer(*d_cl_buffer_2, CL_TRUE, sizeof(gr_complex) * (d_fft_size_pow2 - d_fft_size), + sizeof(gr_complex) * d_fft_size, code); clFFT_ExecuteInterleaved((*d_cl_queue)(), d_cl_fft_plan, d_cl_fft_batch_size, - clFFT_Forward, (*d_cl_buffer_2)(), (*d_cl_buffer_2)(), - 0, NULL, NULL); + clFFT_Forward, (*d_cl_buffer_2)(), (*d_cl_buffer_2)(), + 0, NULL, NULL); //Conjucate the local code cl::Kernel kernel = cl::Kernel(d_cl_program, "conj_vector"); - kernel.setArg(0, *d_cl_buffer_2); //input - kernel.setArg(1, *d_cl_buffer_fft_codes); //output + kernel.setArg(0, *d_cl_buffer_2); //input + kernel.setArg(1, *d_cl_buffer_fft_codes); //output d_cl_queue->enqueueNDRangeKernel(kernel, cl::NullRange, cl::NDRange(d_fft_size_pow2), cl::NullRange); } else { - memcpy(d_fft_if->get_inbuf(), code, sizeof(gr_complex)*d_fft_size); + memcpy(d_fft_if->get_inbuf(), code, sizeof(gr_complex) * d_fft_size); - d_fft_if->execute(); // We need the FFT of local code + d_fft_if->execute(); // We need the FFT of local code //Conjugate the local code volk_32fc_conjugate_32fc(d_fft_codes, d_fft_if->get_outbuf(), d_fft_size); @@ -388,7 +381,7 @@ void pcps_opencl_acquisition_cc::acquisition_core_volk() uint32_t indext = 0; float magt = 0.0; float fft_normalization_factor = static_cast(d_fft_size) * static_cast(d_fft_size); - gr_complex* in = d_in_buffer[d_well_count]; + gr_complex *in = d_in_buffer[d_well_count]; unsigned long int samplestamp = d_sample_counter_buffer[d_well_count]; d_input_power = 0.0; @@ -397,10 +390,10 @@ void pcps_opencl_acquisition_cc::acquisition_core_volk() d_well_count++; DLOG(INFO) << "Channel: " << d_channel - << " , doing acquisition of satellite: " << d_gnss_synchro->System << " "<< d_gnss_synchro->PRN - << " ,sample stamp: " << d_sample_counter << ", threshold: " - << d_threshold << ", doppler_max: " << d_doppler_max - << ", doppler_step: " << d_doppler_step; + << " , doing acquisition of satellite: " << d_gnss_synchro->System << " " << d_gnss_synchro->PRN + << " ,sample stamp: " << d_sample_counter << ", threshold: " + << d_threshold << ", doppler_max: " << d_doppler_max + << ", doppler_step: " << d_doppler_step; // 1- Compute the input signal power estimation volk_32fc_magnitude_squared_32f(d_magnitude, in, d_fft_size); @@ -412,9 +405,9 @@ void pcps_opencl_acquisition_cc::acquisition_core_volk() { // doppler search steps doppler = -static_cast(d_doppler_max) + d_doppler_step * doppler_index; - + volk_32fc_x2_multiply_32fc(d_fft_if->get_inbuf(), in, - d_grid_doppler_wipeoffs[doppler_index], d_fft_size); + d_grid_doppler_wipeoffs[doppler_index], d_fft_size); // 3- Perform the FFT-based convolution (parallel time search) // Compute the FFT of the carrier wiped--off incoming signal @@ -423,7 +416,7 @@ void pcps_opencl_acquisition_cc::acquisition_core_volk() // Multiply carrier wiped--off, Fourier transformed incoming signal // with the local FFT'd code reference using SIMD operations with VOLK library volk_32fc_x2_multiply_32fc(d_ifft->get_inbuf(), - d_fft_if->get_outbuf(), d_fft_codes, d_fft_size); + d_fft_if->get_outbuf(), d_fft_codes, d_fft_size); // compute the inverse FFT d_ifft->execute(); @@ -448,28 +441,28 @@ void pcps_opencl_acquisition_cc::acquisition_core_volk() // current d_mag/d_input_power). Note that d_test_statistics is not // restarted between consecutive dwells in multidwell operation. if (d_test_statistics < (d_mag / d_input_power) || !d_bit_transition_flag) - { - d_gnss_synchro->Acq_delay_samples = static_cast(indext % d_samples_per_code); - d_gnss_synchro->Acq_doppler_hz = static_cast(doppler); - d_gnss_synchro->Acq_samplestamp_samples = samplestamp; + { + d_gnss_synchro->Acq_delay_samples = static_cast(indext % d_samples_per_code); + d_gnss_synchro->Acq_doppler_hz = static_cast(doppler); + d_gnss_synchro->Acq_samplestamp_samples = samplestamp; - // 5- Compute the test statistics and compare to the threshold - //d_test_statistics = 2 * d_fft_size * d_mag / d_input_power; - d_test_statistics = d_mag / d_input_power; - } + // 5- Compute the test statistics and compare to the threshold + //d_test_statistics = 2 * d_fft_size * d_mag / d_input_power; + d_test_statistics = d_mag / d_input_power; + } } // Record results to file if required if (d_dump) { std::stringstream filename; - std::streamsize n = 2 * sizeof(float) * (d_fft_size); // complex file write + std::streamsize n = 2 * sizeof(float) * (d_fft_size); // complex file write filename.str(""); filename << "../data/test_statistics_" << d_gnss_synchro->System - <<"_" << d_gnss_synchro->Signal << "_sat_" - << d_gnss_synchro->PRN << "_doppler_" << doppler << ".dat"; + << "_" << d_gnss_synchro->Signal << "_sat_" + << d_gnss_synchro->PRN << "_doppler_" << doppler << ".dat"; d_dump_file.open(filename.str().c_str(), std::ios::out | std::ios::binary); - d_dump_file.write(reinterpret_cast(d_ifft->get_outbuf()), n); //write directly |abs(x)|^2 in this Doppler bin? + d_dump_file.write(reinterpret_cast(d_ifft->get_outbuf()), n); //write directly |abs(x)|^2 in this Doppler bin? d_dump_file.close(); } } @@ -478,24 +471,24 @@ void pcps_opencl_acquisition_cc::acquisition_core_volk() { if (d_test_statistics > d_threshold) { - d_state = 2; // Positive acquisition + d_state = 2; // Positive acquisition } else if (d_well_count == d_max_dwells) { - d_state = 3; // Negative acquisition + d_state = 3; // Negative acquisition } } else { - if (d_well_count == d_max_dwells) // d_max_dwells = 2 + if (d_well_count == d_max_dwells) // d_max_dwells = 2 { if (d_test_statistics > d_threshold) { - d_state = 2; // Positive acquisition + d_state = 2; // Positive acquisition } else { - d_state = 3; // Negative acquisition + d_state = 3; // Negative acquisition } } } @@ -509,30 +502,30 @@ void pcps_opencl_acquisition_cc::acquisition_core_opencl() int doppler; uint32_t indext = 0; float magt = 0.0; - float fft_normalization_factor = (static_cast(d_fft_size_pow2) * static_cast(d_fft_size)); //This works, but I am not sure why. - gr_complex* in = d_in_buffer[d_well_count]; + float fft_normalization_factor = (static_cast(d_fft_size_pow2) * static_cast(d_fft_size)); //This works, but I am not sure why. + gr_complex *in = d_in_buffer[d_well_count]; unsigned long int samplestamp = d_sample_counter_buffer[d_well_count]; d_input_power = 0.0; d_mag = 0.0; // write input vector in buffer of OpenCL device - d_cl_queue->enqueueWriteBuffer(*d_cl_buffer_in, CL_TRUE, 0, sizeof(gr_complex)*d_fft_size, in); + d_cl_queue->enqueueWriteBuffer(*d_cl_buffer_in, CL_TRUE, 0, sizeof(gr_complex) * d_fft_size, in); d_well_count++; -// struct timeval tv; -// long long int begin = 0; -// long long int end = 0; + // struct timeval tv; + // long long int begin = 0; + // long long int end = 0; -// gettimeofday(&tv, NULL); -// begin = tv.tv_sec *1e6 + tv.tv_usec; + // gettimeofday(&tv, NULL); + // begin = tv.tv_sec *1e6 + tv.tv_usec; DLOG(INFO) << "Channel: " << d_channel - << " , doing acquisition of satellite: " << d_gnss_synchro->System << " " << d_gnss_synchro->PRN - << " ,sample stamp: " << d_sample_counter << ", threshold: " - << d_threshold << ", doppler_max: " << d_doppler_max - << ", doppler_step: " << d_doppler_step; + << " , doing acquisition of satellite: " << d_gnss_synchro->System << " " << d_gnss_synchro->PRN + << " ,sample stamp: " << d_sample_counter << ", threshold: " + << d_threshold << ", doppler_max: " << d_doppler_max + << ", doppler_step: " << d_doppler_step; // 1- Compute the input signal power estimation volk_32fc_magnitude_squared_32f(d_magnitude, in, d_fft_size); @@ -546,49 +539,49 @@ void pcps_opencl_acquisition_cc::acquisition_core_opencl() { // doppler search steps - doppler = -static_cast(d_doppler_max) + d_doppler_step*doppler_index; + doppler = -static_cast(d_doppler_max) + d_doppler_step * doppler_index; //Multiply input signal with doppler wipe-off kernel = cl::Kernel(d_cl_program, "mult_vectors"); - kernel.setArg(0, *d_cl_buffer_in); //input 1 - kernel.setArg(1, *d_cl_buffer_grid_doppler_wipeoffs[doppler_index]); //input 2 - kernel.setArg(2, *d_cl_buffer_1); //output - d_cl_queue->enqueueNDRangeKernel(kernel,cl::NullRange, cl::NDRange(d_fft_size), - cl::NullRange); + kernel.setArg(0, *d_cl_buffer_in); //input 1 + kernel.setArg(1, *d_cl_buffer_grid_doppler_wipeoffs[doppler_index]); //input 2 + kernel.setArg(2, *d_cl_buffer_1); //output + d_cl_queue->enqueueNDRangeKernel(kernel, cl::NullRange, cl::NDRange(d_fft_size), + cl::NullRange); // In the previous operation, we store the result in the first d_fft_size positions // of d_cl_buffer_1. The rest d_fft_size_pow2-d_fft_size already have zeros // (zero-padding is made in init() for optimization purposes). clFFT_ExecuteInterleaved((*d_cl_queue)(), d_cl_fft_plan, d_cl_fft_batch_size, - clFFT_Forward,(*d_cl_buffer_1)(), (*d_cl_buffer_2)(), - 0, NULL, NULL); + clFFT_Forward, (*d_cl_buffer_1)(), (*d_cl_buffer_2)(), + 0, NULL, NULL); // Multiply carrier wiped--off, Fourier transformed incoming signal // with the local FFT'd code reference kernel = cl::Kernel(d_cl_program, "mult_vectors"); - kernel.setArg(0, *d_cl_buffer_2); //input 1 - kernel.setArg(1, *d_cl_buffer_fft_codes); //input 2 - kernel.setArg(2, *d_cl_buffer_2); //output + kernel.setArg(0, *d_cl_buffer_2); //input 1 + kernel.setArg(1, *d_cl_buffer_fft_codes); //input 2 + kernel.setArg(2, *d_cl_buffer_2); //output d_cl_queue->enqueueNDRangeKernel(kernel, cl::NullRange, cl::NDRange(d_fft_size_pow2), - cl::NullRange); + cl::NullRange); // compute the inverse FFT clFFT_ExecuteInterleaved((*d_cl_queue)(), d_cl_fft_plan, d_cl_fft_batch_size, - clFFT_Inverse, (*d_cl_buffer_2)(), (*d_cl_buffer_2)(), - 0, NULL, NULL); + clFFT_Inverse, (*d_cl_buffer_2)(), (*d_cl_buffer_2)(), + 0, NULL, NULL); // Compute magnitude kernel = cl::Kernel(d_cl_program, "magnitude_squared"); - kernel.setArg(0, *d_cl_buffer_2); //input 1 - kernel.setArg(1, *d_cl_buffer_magnitude); //output + kernel.setArg(0, *d_cl_buffer_2); //input 1 + kernel.setArg(1, *d_cl_buffer_magnitude); //output d_cl_queue->enqueueNDRangeKernel(kernel, cl::NullRange, cl::NDRange(d_fft_size), - cl::NullRange); + cl::NullRange); // This is the only function that blocks this thread until all previously enqueued // OpenCL commands are completed. d_cl_queue->enqueueReadBuffer(*d_cl_buffer_magnitude, CL_TRUE, 0, - sizeof(float)*d_fft_size,d_magnitude); + sizeof(float) * d_fft_size, d_magnitude); // Search maximum // @TODO: find an efficient way to search the maximum with OpenCL in the GPU. @@ -610,58 +603,58 @@ void pcps_opencl_acquisition_cc::acquisition_core_opencl() // current d_mag/d_input_power). Note that d_test_statistics is not // restarted between consecutive dwells in multidwell operation. if (d_test_statistics < (d_mag / d_input_power) || !d_bit_transition_flag) - { - d_gnss_synchro->Acq_delay_samples = static_cast(indext % d_samples_per_code); - d_gnss_synchro->Acq_doppler_hz = static_cast(doppler); - d_gnss_synchro->Acq_samplestamp_samples = samplestamp; + { + d_gnss_synchro->Acq_delay_samples = static_cast(indext % d_samples_per_code); + d_gnss_synchro->Acq_doppler_hz = static_cast(doppler); + d_gnss_synchro->Acq_samplestamp_samples = samplestamp; - // 5- Compute the test statistics and compare to the threshold - //d_test_statistics = 2 * d_fft_size * d_mag / d_input_power; - d_test_statistics = d_mag / d_input_power; - } + // 5- Compute the test statistics and compare to the threshold + //d_test_statistics = 2 * d_fft_size * d_mag / d_input_power; + d_test_statistics = d_mag / d_input_power; + } } // Record results to file if required if (d_dump) { std::stringstream filename; - std::streamsize n = 2 * sizeof(float) * (d_fft_size); // complex file write + std::streamsize n = 2 * sizeof(float) * (d_fft_size); // complex file write filename.str(""); filename << "../data/test_statistics_" << d_gnss_synchro->System << "_" << d_gnss_synchro->Signal << "_sat_" - << d_gnss_synchro->PRN << "_doppler_" << doppler << ".dat"; + << d_gnss_synchro->PRN << "_doppler_" << doppler << ".dat"; d_dump_file.open(filename.str().c_str(), std::ios::out | std::ios::binary); - d_dump_file.write(reinterpret_cast(d_ifft->get_outbuf()), n); //write directly |abs(x)|^2 in this Doppler bin? + d_dump_file.write(reinterpret_cast(d_ifft->get_outbuf()), n); //write directly |abs(x)|^2 in this Doppler bin? d_dump_file.close(); } } -// gettimeofday(&tv, NULL); -// end = tv.tv_sec *1e6 + tv.tv_usec; -// std::cout << "Acq time = " << (end-begin) << " us" << std::endl; + // gettimeofday(&tv, NULL); + // end = tv.tv_sec *1e6 + tv.tv_usec; + // std::cout << "Acq time = " << (end-begin) << " us" << std::endl; if (!d_bit_transition_flag) { if (d_test_statistics > d_threshold) { - d_state = 2; // Positive acquisition + d_state = 2; // Positive acquisition } else if (d_well_count == d_max_dwells) { - d_state = 3; // Negative acquisition + d_state = 3; // Negative acquisition } } else { - if (d_well_count == d_max_dwells) // d_max_dwells = 2 + if (d_well_count == d_max_dwells) // d_max_dwells = 2 { if (d_test_statistics > d_threshold) { - d_state = 2; // Positive acquisition + d_state = 2; // Positive acquisition } else { - d_state = 3; // Negative acquisition + d_state = 3; // Negative acquisition } } } @@ -686,7 +679,8 @@ void pcps_opencl_acquisition_cc::set_state(int state) d_sample_counter_buffer.clear(); } else if (d_state == 0) - {} + { + } else { LOG(ERROR) << "State can only be set to 0 or 1"; @@ -694,137 +688,137 @@ void pcps_opencl_acquisition_cc::set_state(int state) } int pcps_opencl_acquisition_cc::general_work(int noutput_items, - gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items __attribute__((unused))) + gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items __attribute__((unused))) { - int acquisition_message = -1; //0=STOP_CHANNEL 1=ACQ_SUCCEES 2=ACQ_FAIL + int acquisition_message = -1; //0=STOP_CHANNEL 1=ACQ_SUCCEES 2=ACQ_FAIL switch (d_state) - { - case 0: { - if (d_active) - { - //restart acquisition variables - d_gnss_synchro->Acq_delay_samples = 0.0; - d_gnss_synchro->Acq_doppler_hz = 0.0; - d_gnss_synchro->Acq_samplestamp_samples = 0; - d_well_count = 0; - d_mag = 0.0; - d_input_power = 0.0; - d_test_statistics = 0.0; - d_in_dwell_count = 0; - d_sample_counter_buffer.clear(); + case 0: + { + if (d_active) + { + //restart acquisition variables + d_gnss_synchro->Acq_delay_samples = 0.0; + d_gnss_synchro->Acq_doppler_hz = 0.0; + d_gnss_synchro->Acq_samplestamp_samples = 0; + d_well_count = 0; + d_mag = 0.0; + d_input_power = 0.0; + d_test_statistics = 0.0; + d_in_dwell_count = 0; + d_sample_counter_buffer.clear(); - d_state = 1; - } + d_state = 1; + } - d_sample_counter += d_fft_size * ninput_items[0]; // sample counter + d_sample_counter += d_fft_size * ninput_items[0]; // sample counter - break; + break; + } + + case 1: + { + if (d_in_dwell_count < d_max_dwells) + { + // Fill internal buffer with d_max_dwells signal blocks. This step ensures that + // consecutive signal blocks will be processed in multi-dwell operation. This is + // essential when d_bit_transition_flag = true. + unsigned int num_dwells = std::min(static_cast(d_max_dwells - d_in_dwell_count), ninput_items[0]); + for (unsigned int i = 0; i < num_dwells; i++) + { + memcpy(d_in_buffer[d_in_dwell_count++], static_cast(input_items[i]), + sizeof(gr_complex) * d_fft_size); + d_sample_counter += d_fft_size; + d_sample_counter_buffer.push_back(d_sample_counter); + } + + if (ninput_items[0] > static_cast(num_dwells)) + { + d_sample_counter += d_fft_size * (ninput_items[0] - num_dwells); + } + } + else + { + // We already have d_max_dwells consecutive blocks in the internal buffer, + // just skip input blocks. + d_sample_counter += d_fft_size * ninput_items[0]; + } + + // We create a new thread to process next block if the following + // conditions are fulfilled: + // 1. There are new blocks in d_in_buffer that have not been processed yet + // (d_well_count < d_in_dwell_count). + // 2. No other acquisition_core thead is working (!d_core_working). + // 3. d_state==1. We need to check again d_state because it can be modified at any + // moment by the external thread (may have changed since checked in the switch()). + // If the external thread has already declared positive (d_state=2) or negative + // (d_state=3) acquisition, we don't have to process next block!! + if ((d_well_count < d_in_dwell_count) && !d_core_working && d_state == 1) + { + d_core_working = true; + if (d_opencl == 0) + { // Use OpenCL implementation + boost::thread(&pcps_opencl_acquisition_cc::acquisition_core_opencl, this); + } + else + { // Use Volk implementation + boost::thread(&pcps_opencl_acquisition_cc::acquisition_core_volk, this); + } + } + + break; + } + + case 2: + { + // Declare positive acquisition using a message port + DLOG(INFO) << "positive acquisition"; + DLOG(INFO) << "satellite " << d_gnss_synchro->System << " " << d_gnss_synchro->PRN; + DLOG(INFO) << "sample_stamp " << d_sample_counter; + DLOG(INFO) << "test statistics value " << d_test_statistics; + DLOG(INFO) << "test statistics threshold " << d_threshold; + DLOG(INFO) << "code phase " << d_gnss_synchro->Acq_delay_samples; + DLOG(INFO) << "doppler " << d_gnss_synchro->Acq_doppler_hz; + DLOG(INFO) << "magnitude " << d_mag; + DLOG(INFO) << "input signal power " << d_input_power; + + d_active = false; + d_state = 0; + + d_sample_counter += d_fft_size * ninput_items[0]; // sample counter + + acquisition_message = 1; + this->message_port_pub(pmt::mp("events"), pmt::from_long(acquisition_message)); + + break; + } + + case 3: + { + // Declare negative acquisition using a message port + DLOG(INFO) << "negative acquisition"; + DLOG(INFO) << "satellite " << d_gnss_synchro->System << " " << d_gnss_synchro->PRN; + DLOG(INFO) << "sample_stamp " << d_sample_counter; + DLOG(INFO) << "test statistics value " << d_test_statistics; + DLOG(INFO) << "test statistics threshold " << d_threshold; + DLOG(INFO) << "code phase " << d_gnss_synchro->Acq_delay_samples; + DLOG(INFO) << "doppler " << d_gnss_synchro->Acq_doppler_hz; + DLOG(INFO) << "magnitude " << d_mag; + DLOG(INFO) << "input signal power " << d_input_power; + + d_active = false; + d_state = 0; + + d_sample_counter += d_fft_size * ninput_items[0]; // sample counter + + acquisition_message = 2; + this->message_port_pub(pmt::mp("events"), pmt::from_long(acquisition_message)); + + break; + } } - case 1: - { - if (d_in_dwell_count < d_max_dwells) - { - // Fill internal buffer with d_max_dwells signal blocks. This step ensures that - // consecutive signal blocks will be processed in multi-dwell operation. This is - // essential when d_bit_transition_flag = true. - unsigned int num_dwells = std::min(static_cast(d_max_dwells - d_in_dwell_count), ninput_items[0]); - for (unsigned int i = 0; i < num_dwells; i++) - { - memcpy(d_in_buffer[d_in_dwell_count++], static_cast(input_items[i]), - sizeof(gr_complex)*d_fft_size); - d_sample_counter += d_fft_size; - d_sample_counter_buffer.push_back(d_sample_counter); - } - - if (ninput_items[0] > static_cast(num_dwells)) - { - d_sample_counter += d_fft_size * (ninput_items[0] - num_dwells); - } - } - else - { - // We already have d_max_dwells consecutive blocks in the internal buffer, - // just skip input blocks. - d_sample_counter += d_fft_size * ninput_items[0]; - } - - // We create a new thread to process next block if the following - // conditions are fulfilled: - // 1. There are new blocks in d_in_buffer that have not been processed yet - // (d_well_count < d_in_dwell_count). - // 2. No other acquisition_core thead is working (!d_core_working). - // 3. d_state==1. We need to check again d_state because it can be modified at any - // moment by the external thread (may have changed since checked in the switch()). - // If the external thread has already declared positive (d_state=2) or negative - // (d_state=3) acquisition, we don't have to process next block!! - if ((d_well_count < d_in_dwell_count) && !d_core_working && d_state == 1) - { - d_core_working = true; - if (d_opencl == 0) - { // Use OpenCL implementation - boost::thread(&pcps_opencl_acquisition_cc::acquisition_core_opencl, this); - } - else - { // Use Volk implementation - boost::thread(&pcps_opencl_acquisition_cc::acquisition_core_volk, this); - } - } - - break; - } - - case 2: - { - // Declare positive acquisition using a message port - DLOG(INFO) << "positive acquisition"; - DLOG(INFO) << "satellite " << d_gnss_synchro->System << " " << d_gnss_synchro->PRN; - DLOG(INFO) << "sample_stamp " << d_sample_counter; - DLOG(INFO) << "test statistics value " << d_test_statistics; - DLOG(INFO) << "test statistics threshold " << d_threshold; - DLOG(INFO) << "code phase " << d_gnss_synchro->Acq_delay_samples; - DLOG(INFO) << "doppler " << d_gnss_synchro->Acq_doppler_hz; - DLOG(INFO) << "magnitude " << d_mag; - DLOG(INFO) << "input signal power " << d_input_power; - - d_active = false; - d_state = 0; - - d_sample_counter += d_fft_size * ninput_items[0]; // sample counter - - acquisition_message = 1; - this->message_port_pub(pmt::mp("events"), pmt::from_long(acquisition_message)); - - break; - } - - case 3: - { - // Declare negative acquisition using a message port - DLOG(INFO) << "negative acquisition"; - DLOG(INFO) << "satellite " << d_gnss_synchro->System << " " << d_gnss_synchro->PRN; - DLOG(INFO) << "sample_stamp " << d_sample_counter; - DLOG(INFO) << "test statistics value " << d_test_statistics; - DLOG(INFO) << "test statistics threshold " << d_threshold; - DLOG(INFO) << "code phase " << d_gnss_synchro->Acq_delay_samples; - DLOG(INFO) << "doppler " << d_gnss_synchro->Acq_doppler_hz; - DLOG(INFO) << "magnitude " << d_mag; - DLOG(INFO) << "input signal power " << d_input_power; - - d_active = false; - d_state = 0; - - d_sample_counter += d_fft_size * ninput_items[0]; // sample counter - - acquisition_message = 2; - this->message_port_pub(pmt::mp("events"), pmt::from_long(acquisition_message)); - - break; - } - } - consume_each(ninput_items[0]); return noutput_items; diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_opencl_acquisition_cc.h b/src/algorithms/acquisition/gnuradio_blocks/pcps_opencl_acquisition_cc.h index 8d5a1fef0..aebc73ef8 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_opencl_acquisition_cc.h +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_opencl_acquisition_cc.h @@ -57,13 +57,13 @@ #include #include #include -#include "fft_internal.h" +#include "opencl/fft_internal.h" #include "gnss_synchro.h" #ifdef __APPLE__ - #include "cl.hpp" +#include "opencl/cl.hpp" #else - #include +#include #endif class pcps_opencl_acquisition_cc; @@ -72,11 +72,11 @@ typedef boost::shared_ptr pcps_opencl_acquisition_cc pcps_opencl_acquisition_cc_sptr pcps_make_opencl_acquisition_cc(unsigned int sampled_ms, unsigned int max_dwells, - unsigned int doppler_max, long freq, long fs_in, - int samples_per_ms, int samples_per_code, - bool bit_transition_flag, - bool dump, - std::string dump_filename); + unsigned int doppler_max, long freq, long fs_in, + int samples_per_ms, int samples_per_code, + bool bit_transition_flag, + bool dump, + std::string dump_filename); /*! * \brief This class implements a Parallel Code Phase Search Acquisition. @@ -84,26 +84,26 @@ pcps_make_opencl_acquisition_cc(unsigned int sampled_ms, unsigned int max_dwells * Check \ref Navitec2012 "An Open Source Galileo E1 Software Receiver", * Algorithm 1, for a pseudocode description of this implementation. */ -class pcps_opencl_acquisition_cc: public gr::block +class pcps_opencl_acquisition_cc : public gr::block { private: friend pcps_opencl_acquisition_cc_sptr pcps_make_opencl_acquisition_cc(unsigned int sampled_ms, unsigned int max_dwells, - unsigned int doppler_max, long freq, long fs_in, - int samples_per_ms, int samples_per_code, - bool bit_transition_flag, - bool dump, - std::string dump_filename); + unsigned int doppler_max, long freq, long fs_in, + int samples_per_ms, int samples_per_code, + bool bit_transition_flag, + bool dump, + std::string dump_filename); pcps_opencl_acquisition_cc(unsigned int sampled_ms, unsigned int max_dwells, - unsigned int doppler_max, long freq, long fs_in, - int samples_per_ms, int samples_per_code, - bool bit_transition_flag, - bool dump, - std::string dump_filename); + unsigned int doppler_max, long freq, long fs_in, + int samples_per_ms, int samples_per_code, + bool bit_transition_flag, + bool dump, + std::string dump_filename); void calculate_magnitudes(gr_complex* fft_begin, int doppler_shift, - int doppler_offset); + int doppler_offset); int init_opencl_environment(std::string kernel_filename); @@ -128,7 +128,7 @@ private: gr_complex* d_fft_codes; gr::fft::fft_complex* d_fft_if; gr::fft::fft_complex* d_ifft; - Gnss_Synchro *d_gnss_synchro; + Gnss_Synchro* d_gnss_synchro; unsigned int d_code_phase; float d_doppler_freq; float d_mag; @@ -168,101 +168,101 @@ public: /*! * \brief Default destructor. */ - ~pcps_opencl_acquisition_cc(); + ~pcps_opencl_acquisition_cc(); - /*! + /*! * \brief Set acquisition/tracking common Gnss_Synchro object pointer * to exchange synchronization data between acquisition and tracking blocks. * \param p_gnss_synchro Satellite information shared by the processing blocks. */ - inline void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) - { - d_gnss_synchro = p_gnss_synchro; - } + inline void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) + { + d_gnss_synchro = p_gnss_synchro; + } - /*! + /*! * \brief Returns the maximum peak of grid search. */ - inline unsigned int mag() const - { - return d_mag; - } + inline unsigned int mag() const + { + return d_mag; + } - /*! + /*! * \brief Initializes acquisition algorithm. */ - void init(); + void init(); - /*! + /*! * \brief Sets local code for PCPS acquisition algorithm. * \param code - Pointer to the PRN code. */ - void set_local_code(std::complex * code); + void set_local_code(std::complex* code); - /*! + /*! * \brief Starts acquisition algorithm, turning from standby mode to * active mode * \param active - bool that activates/deactivates the block. */ - inline void set_active(bool active) - { - d_active = active; - } + inline void set_active(bool active) + { + d_active = active; + } - /*! + /*! * \brief If set to 1, ensures that acquisition starts at the * first available sample. * \param state - int=1 forces start of acquisition */ - void set_state(int state); + void set_state(int state); - /*! + /*! * \brief Set acquisition channel unique ID * \param channel - receiver channel. */ - inline void set_channel(unsigned int channel) - { - d_channel = channel; - } + inline void set_channel(unsigned int channel) + { + d_channel = channel; + } - /*! + /*! * \brief Set statistics threshold of PCPS algorithm. * \param threshold - Threshold for signal detection (check \ref Navitec2012, * Algorithm 1, for a definition of this threshold). */ - inline void set_threshold(float threshold) - { - d_threshold = threshold; - } + inline void set_threshold(float threshold) + { + d_threshold = threshold; + } - /*! + /*! * \brief Set maximum Doppler grid search * \param doppler_max - Maximum Doppler shift considered in the grid search [Hz]. */ - inline void set_doppler_max(unsigned int doppler_max) - { - d_doppler_max = doppler_max; - } + inline void set_doppler_max(unsigned int doppler_max) + { + d_doppler_max = doppler_max; + } - /*! + /*! * \brief Set Doppler steps for the grid search * \param doppler_step - Frequency bin of the search grid [Hz]. */ - inline void set_doppler_step(unsigned int doppler_step) - { - d_doppler_step = doppler_step; - } + inline void set_doppler_step(unsigned int doppler_step) + { + d_doppler_step = doppler_step; + } - /*! + /*! * \brief Parallel Code Phase Search Acquisition signal processing. */ - int general_work(int noutput_items, gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); + int general_work(int noutput_items, gr_vector_int& ninput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items); - void acquisition_core_volk(); + void acquisition_core_volk(); - void acquisition_core_opencl(); + void acquisition_core_opencl(); }; #endif diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_quicksync_acquisition_cc.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_quicksync_acquisition_cc.cc index 3a6a8c319..80e823156 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_quicksync_acquisition_cc.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_quicksync_acquisition_cc.cc @@ -42,38 +42,38 @@ using google::LogMessage; pcps_quicksync_acquisition_cc_sptr pcps_quicksync_make_acquisition_cc( - unsigned int folding_factor, - unsigned int sampled_ms, unsigned int max_dwells, - unsigned int doppler_max, long freq, long fs_in, - int samples_per_ms, int samples_per_code, - bool bit_transition_flag, - bool dump, - std::string dump_filename) + unsigned int folding_factor, + unsigned int sampled_ms, unsigned int max_dwells, + unsigned int doppler_max, long freq, long fs_in, + int samples_per_ms, int samples_per_code, + bool bit_transition_flag, + bool dump, + std::string dump_filename) { return pcps_quicksync_acquisition_cc_sptr( - new pcps_quicksync_acquisition_cc( - folding_factor, - sampled_ms, max_dwells, doppler_max, - freq, fs_in, samples_per_ms, - samples_per_code, - bit_transition_flag, - dump, dump_filename)); + new pcps_quicksync_acquisition_cc( + folding_factor, + sampled_ms, max_dwells, doppler_max, + freq, fs_in, samples_per_ms, + samples_per_code, + bit_transition_flag, + dump, dump_filename)); } pcps_quicksync_acquisition_cc::pcps_quicksync_acquisition_cc( - unsigned int folding_factor, - unsigned int sampled_ms, unsigned int max_dwells, - unsigned int doppler_max, long freq, long fs_in, - int samples_per_ms, int samples_per_code, - bool bit_transition_flag, - bool dump, std::string dump_filename): - gr::block("pcps_quicksync_acquisition_cc", - gr::io_signature::make(1, 1, (sizeof(gr_complex)*sampled_ms * samples_per_ms )), - gr::io_signature::make(0, 0, (sizeof(gr_complex)*sampled_ms * samples_per_ms ))) + unsigned int folding_factor, + unsigned int sampled_ms, unsigned int max_dwells, + unsigned int doppler_max, long freq, long fs_in, + int samples_per_ms, int samples_per_code, + bool bit_transition_flag, + bool dump, + std::string dump_filename) : gr::block("pcps_quicksync_acquisition_cc", + gr::io_signature::make(1, 1, (sizeof(gr_complex) * sampled_ms * samples_per_ms)), + gr::io_signature::make(0, 0, (sizeof(gr_complex) * sampled_ms * samples_per_ms))) { this->message_port_register_out(pmt::mp("events")); - d_sample_counter = 0; // SAMPLE COUNTER + d_sample_counter = 0; // SAMPLE COUNTER d_active = false; d_state = 0; d_freq = freq; @@ -178,16 +178,15 @@ void pcps_quicksync_acquisition_cc::set_local_code(std::complex* code) in the frequency domain after applying the fftw operation*/ for (unsigned int i = 0; i < d_folding_factor; i++) { - std::transform ((code + i * d_fft_size), (code + ((i + 1) * d_fft_size)) , - d_fft_if->get_inbuf(), d_fft_if->get_inbuf(), - std::plus()); + std::transform((code + i * d_fft_size), (code + ((i + 1) * d_fft_size)), + d_fft_if->get_inbuf(), d_fft_if->get_inbuf(), + std::plus()); } - d_fft_if->execute(); // We need the FFT of local code + d_fft_if->execute(); // We need the FFT of local code //Conjugate the local code volk_32fc_conjugate_32fc(d_fft_codes, d_fft_if->get_outbuf(), d_fft_size); - } @@ -204,14 +203,14 @@ void pcps_quicksync_acquisition_cc::init() d_gnss_synchro->Acq_samplestamp_samples = 0; d_mag = 0.0; d_input_power = 0.0; - - if(d_doppler_step == 0) d_doppler_step = 250; + + if (d_doppler_step == 0) d_doppler_step = 250; // Count the number of bins d_num_doppler_bins = 0; for (int doppler = static_cast(-d_doppler_max); - doppler <= static_cast(d_doppler_max); - doppler += d_doppler_step) + doppler <= static_cast(d_doppler_max); + doppler += d_doppler_step) { d_num_doppler_bins++; } @@ -225,37 +224,38 @@ void pcps_quicksync_acquisition_cc::init() float phase_step_rad = GPS_TWO_PI * (d_freq + doppler) / static_cast(d_fs_in); float _phase[1]; _phase[0] = 0; - volk_gnsssdr_s32f_sincos_32fc(d_grid_doppler_wipeoffs[doppler_index], - phase_step_rad, _phase, d_samples_per_code * d_folding_factor); + volk_gnsssdr_s32f_sincos_32fc(d_grid_doppler_wipeoffs[doppler_index], -phase_step_rad, _phase, d_samples_per_code * d_folding_factor); } // DLOG(INFO) << "end init"; } void pcps_quicksync_acquisition_cc::set_state(int state) - { - d_state = state; - if (d_state == 1) - { - d_gnss_synchro->Acq_delay_samples = 0.0; - d_gnss_synchro->Acq_doppler_hz = 0.0; - d_gnss_synchro->Acq_samplestamp_samples = 0; - d_well_count = 0; - d_mag = 0.0; - d_input_power = 0.0; - d_test_statistics = 0.0; - d_active = 1; - } - else if (d_state == 0) - {} - else - { - LOG(ERROR) << "State can only be set to 0 or 1"; - } - } +{ + d_state = state; + if (d_state == 1) + { + d_gnss_synchro->Acq_delay_samples = 0.0; + d_gnss_synchro->Acq_doppler_hz = 0.0; + d_gnss_synchro->Acq_samplestamp_samples = 0; + d_well_count = 0; + d_mag = 0.0; + d_input_power = 0.0; + d_test_statistics = 0.0; + d_active = 1; + } + else if (d_state == 0) + { + } + else + { + LOG(ERROR) << "State can only be set to 0 or 1"; + } +} int pcps_quicksync_acquisition_cc::general_work(int noutput_items, - gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items __attribute__((unused))) + gr_vector_int& ninput_items, gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items __attribute__((unused))) { /* * By J.Arribas, L.Esteve and M.Molina @@ -268,314 +268,312 @@ int pcps_quicksync_acquisition_cc::general_work(int noutput_items, * 6. Declare positive or negative acquisition using a message queue */ //DLOG(INFO) << "START GENERAL WORK"; - int acquisition_message = -1; //0=STOP_CHANNEL 1=ACQ_SUCCEES 2=ACQ_FAIL + int acquisition_message = -1; //0=STOP_CHANNEL 1=ACQ_SUCCEES 2=ACQ_FAIL //std::cout<<"general_work in quicksync gnuradio block"<Acq_delay_samples = 0.0; - d_gnss_synchro->Acq_doppler_hz = 0.0; - d_gnss_synchro->Acq_samplestamp_samples = 0; - d_well_count = 0; - d_mag = 0.0; - d_input_power = 0.0; - d_test_statistics = 0.0; + case 0: + { + //DLOG(INFO) << "START CASE 0"; + if (d_active) + { + //restart acquisition variables + d_gnss_synchro->Acq_delay_samples = 0.0; + d_gnss_synchro->Acq_doppler_hz = 0.0; + d_gnss_synchro->Acq_samplestamp_samples = 0; + d_well_count = 0; + d_mag = 0.0; + d_input_power = 0.0; + d_test_statistics = 0.0; - d_state = 1; - } + d_state = 1; + } - d_sample_counter += d_sampled_ms * d_samples_per_ms * ninput_items[0]; // sample counter - consume_each(ninput_items[0]); - //DLOG(INFO) << "END CASE 0"; - break; - } + d_sample_counter += d_sampled_ms * d_samples_per_ms * ninput_items[0]; // sample counter + consume_each(ninput_items[0]); + //DLOG(INFO) << "END CASE 0"; + break; + } - case 1: - { - /* initialize acquisition implementing the QuickSync algorithm*/ - //DLOG(INFO) << "START CASE 1"; - int doppler; - uint32_t indext = 0; - float magt = 0.0; - const gr_complex *in = reinterpret_cast(input_items[0]); //Get the input samples pointer + case 1: + { + /* initialize acquisition implementing the QuickSync algorithm*/ + //DLOG(INFO) << "START CASE 1"; + int doppler; + uint32_t indext = 0; + float magt = 0.0; + const gr_complex* in = reinterpret_cast(input_items[0]); //Get the input samples pointer - gr_complex* in_temp = static_cast(volk_gnsssdr_malloc(d_samples_per_code * d_folding_factor * sizeof(gr_complex), volk_gnsssdr_get_alignment())); - gr_complex* in_temp_folded = static_cast(volk_gnsssdr_malloc(d_fft_size * sizeof(gr_complex), volk_gnsssdr_get_alignment())); + gr_complex* in_temp = static_cast(volk_gnsssdr_malloc(d_samples_per_code * d_folding_factor * sizeof(gr_complex), volk_gnsssdr_get_alignment())); + gr_complex* in_temp_folded = static_cast(volk_gnsssdr_malloc(d_fft_size * sizeof(gr_complex), volk_gnsssdr_get_alignment())); - /*Create a signal to store a signal of size 1ms, to perform correlation + /*Create a signal to store a signal of size 1ms, to perform correlation in time. No folding on this data is required*/ - gr_complex* in_1code = static_cast(volk_gnsssdr_malloc(d_samples_per_code * sizeof(gr_complex), volk_gnsssdr_get_alignment())); + gr_complex* in_1code = static_cast(volk_gnsssdr_malloc(d_samples_per_code * sizeof(gr_complex), volk_gnsssdr_get_alignment())); - /*Stores the values of the correlation output between the local code + /*Stores the values of the correlation output between the local code and the signal with doppler shift corrected */ - gr_complex* corr_output = static_cast(volk_gnsssdr_malloc(d_samples_per_code * sizeof(gr_complex), volk_gnsssdr_get_alignment())); + gr_complex* corr_output = static_cast(volk_gnsssdr_malloc(d_samples_per_code * sizeof(gr_complex), volk_gnsssdr_get_alignment())); - /*Stores a copy of the folded version of the signal.This is used for + /*Stores a copy of the folded version of the signal.This is used for the FFT operations in future steps of excecution*/ - // gr_complex in_folded[d_fft_size]; - float fft_normalization_factor = static_cast(d_fft_size) * static_cast(d_fft_size); + // gr_complex in_folded[d_fft_size]; + float fft_normalization_factor = static_cast(d_fft_size) * static_cast(d_fft_size); - d_input_power = 0.0; - d_mag = 0.0; - d_test_statistics = 0.0; - d_noise_floor_power = 0.0; + d_input_power = 0.0; + d_mag = 0.0; + d_test_statistics = 0.0; + d_noise_floor_power = 0.0; - d_sample_counter += d_sampled_ms * d_samples_per_ms; // sample counter + d_sample_counter += d_sampled_ms * d_samples_per_ms; // sample counter - d_well_count++; + d_well_count++; - DLOG(INFO) << "Channel: " << d_channel - << " , doing acquisition of satellite: " - << d_gnss_synchro->System << " "<< d_gnss_synchro->PRN - << " ,algorithm: pcps_quicksync_acquisition" - << " ,folding factor: " << d_folding_factor - << " ,sample stamp: " << d_sample_counter << ", threshold: " - << d_threshold << ", doppler_max: " << d_doppler_max - << ", doppler_step: " << d_doppler_step << ", Signal Size: " - << d_samples_per_code * d_folding_factor; + DLOG(INFO) << "Channel: " << d_channel + << " , doing acquisition of satellite: " + << d_gnss_synchro->System << " " << d_gnss_synchro->PRN + << " ,algorithm: pcps_quicksync_acquisition" + << " ,folding factor: " << d_folding_factor + << " ,sample stamp: " << d_sample_counter << ", threshold: " + << d_threshold << ", doppler_max: " << d_doppler_max + << ", doppler_step: " << d_doppler_step << ", Signal Size: " + << d_samples_per_code * d_folding_factor; - /* 1- Compute the input signal power estimation. This operation is + /* 1- Compute the input signal power estimation. This operation is being performed in a signal of size nxp */ - volk_32fc_magnitude_squared_32f(d_magnitude, in, d_samples_per_code * d_folding_factor); - volk_32f_accumulator_s32f(&d_input_power, d_magnitude, d_samples_per_code * d_folding_factor); - d_input_power /= static_cast(d_samples_per_code * d_folding_factor); + volk_32fc_magnitude_squared_32f(d_magnitude, in, d_samples_per_code * d_folding_factor); + volk_32f_accumulator_s32f(&d_input_power, d_magnitude, d_samples_per_code * d_folding_factor); + d_input_power /= static_cast(d_samples_per_code * d_folding_factor); - for (unsigned int doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++) - { - /*Ensure that the signal is going to start with all samples + for (unsigned int doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++) + { + /*Ensure that the signal is going to start with all samples at zero. This is done to avoid over acumulation when performing the folding process to be stored in d_fft_if->get_inbuf()*/ - d_signal_folded = new gr_complex[d_fft_size](); - memcpy( d_fft_if->get_inbuf(), d_signal_folded, sizeof(gr_complex) * (d_fft_size)); + d_signal_folded = new gr_complex[d_fft_size](); + memcpy(d_fft_if->get_inbuf(), d_signal_folded, sizeof(gr_complex) * (d_fft_size)); - /*Doppler search steps and then multiplication of the incoming + /*Doppler search steps and then multiplication of the incoming signal with the doppler wipeoffs to eliminate frequency offset */ - doppler = -static_cast(d_doppler_max) + d_doppler_step * doppler_index; + doppler = -static_cast(d_doppler_max) + d_doppler_step * doppler_index; - /*Perform multiplication of the incoming signal with the + /*Perform multiplication of the incoming signal with the complex exponential vector. This removes the frequency doppler shift offset*/ - volk_32fc_x2_multiply_32fc(in_temp, in, + volk_32fc_x2_multiply_32fc(in_temp, in, d_grid_doppler_wipeoffs[doppler_index], d_samples_per_code * d_folding_factor); - /*Perform folding of the carrier wiped-off incoming signal. Since + /*Perform folding of the carrier wiped-off incoming signal. Since superlinear method is being used the folding factor in the incoming raw data signal is of d_folding_factor^2*/ - for ( int i = 0; i < static_cast(d_folding_factor * d_folding_factor); i++) - { - std::transform ((in_temp + i * d_fft_size), - (in_temp + ((i + 1) * d_fft_size)) , + for (int i = 0; i < static_cast(d_folding_factor * d_folding_factor); i++) + { + std::transform((in_temp + i * d_fft_size), + (in_temp + ((i + 1) * d_fft_size)), d_fft_if->get_inbuf(), d_fft_if->get_inbuf(), std::plus()); - } + } - /* 3- Perform the FFT-based convolution (parallel time search) + /* 3- Perform the FFT-based convolution (parallel time search) Compute the FFT of the carrier wiped--off incoming signal*/ - d_fft_if->execute(); + d_fft_if->execute(); - /*Multiply carrier wiped--off, Fourier transformed incoming + /*Multiply carrier wiped--off, Fourier transformed incoming signal with the local FFT'd code reference using SIMD operations with VOLK library*/ - volk_32fc_x2_multiply_32fc(d_ifft->get_inbuf(), + volk_32fc_x2_multiply_32fc(d_ifft->get_inbuf(), d_fft_if->get_outbuf(), d_fft_codes, d_fft_size); - /* compute the inverse FFT of the aliased signal*/ - d_ifft->execute(); + /* compute the inverse FFT of the aliased signal*/ + d_ifft->execute(); - /* Compute the magnitude and get the maximum value with its + /* Compute the magnitude and get the maximum value with its index position*/ - volk_32fc_magnitude_squared_32f(d_magnitude_folded, + volk_32fc_magnitude_squared_32f(d_magnitude_folded, d_ifft->get_outbuf(), d_fft_size); - /* Normalize the maximum value to correct the scale factor + /* Normalize the maximum value to correct the scale factor introduced by FFTW*/ - //volk_32f_s32f_multiply_32f_a(d_magnitude_folded,d_magnitude_folded, - // (1 / (fft_normalization_factor * fft_normalization_factor)), d_fft_size); - volk_gnsssdr_32f_index_max_32u(&indext, d_magnitude_folded, d_fft_size); + //volk_32f_s32f_multiply_32f_a(d_magnitude_folded,d_magnitude_folded, + // (1 / (fft_normalization_factor * fft_normalization_factor)), d_fft_size); + volk_gnsssdr_32f_index_max_32u(&indext, d_magnitude_folded, d_fft_size); - magt = d_magnitude_folded[indext] / (fft_normalization_factor * fft_normalization_factor); + magt = d_magnitude_folded[indext] / (fft_normalization_factor * fft_normalization_factor); - delete[] d_signal_folded; + delete[] d_signal_folded; - // 4- record the maximum peak and the associated synchronization parameters - if (d_mag < magt) - { - d_mag = magt; + // 4- record the maximum peak and the associated synchronization parameters + if (d_mag < magt) + { + d_mag = magt; - /* In case that d_bit_transition_flag = true, we compare the potentially + /* In case that d_bit_transition_flag = true, we compare the potentially new maximum test statistics (d_mag/d_input_power) with the value in d_test_statistics. When the second dwell is being processed, the value of d_mag/d_input_power could be lower than d_test_statistics (i.e, the maximum test statistics in the previous dwell is greater than current d_mag/d_input_power). Note that d_test_statistics is not restarted between consecutive dwells in multidwell operation.*/ - if (d_test_statistics < (d_mag / d_input_power) || !d_bit_transition_flag) - { - unsigned int detected_delay_samples_folded = 0; - detected_delay_samples_folded = (indext % d_samples_per_code); - gr_complex complex_acumulator[100]; - //gr_complex complex_acumulator[d_folding_factor]; + if (d_test_statistics < (d_mag / d_input_power) || !d_bit_transition_flag) + { + unsigned int detected_delay_samples_folded = 0; + detected_delay_samples_folded = (indext % d_samples_per_code); + gr_complex complex_acumulator[100]; + //gr_complex complex_acumulator[d_folding_factor]; - for (int i = 0; i < static_cast(d_folding_factor); i++) - { - d_possible_delay[i] = detected_delay_samples_folded + (i) * d_fft_size; - } + for (int i = 0; i < static_cast(d_folding_factor); i++) + { + d_possible_delay[i] = detected_delay_samples_folded + (i)*d_fft_size; + } - for ( int i = 0; i < static_cast(d_folding_factor); i++) - { - - /*Copy a signal of 1 code length into suggested buffer. + for (int i = 0; i < static_cast(d_folding_factor); i++) + { + /*Copy a signal of 1 code length into suggested buffer. The copied signal must have doppler effect corrected*/ - memcpy(in_1code,&in_temp[d_possible_delay[i]], + memcpy(in_1code, &in_temp[d_possible_delay[i]], sizeof(gr_complex) * (d_samples_per_code)); - /*Perform multiplication of the unmodified local + /*Perform multiplication of the unmodified local generated code with the incoming signal with doppler effect corrected and accumulates its value. This is indeed correlation in time for an specific value of a shift*/ - volk_32fc_x2_multiply_32fc(corr_output, in_1code, d_code, d_samples_per_code); + volk_32fc_x2_multiply_32fc(corr_output, in_1code, d_code, d_samples_per_code); - for(int j = 0; j < d_samples_per_code; j++) - { - complex_acumulator[i] += (corr_output[j]); - } + for (int j = 0; j < d_samples_per_code; j++) + { + complex_acumulator[i] += (corr_output[j]); + } + } + /*Obtain maximun value of correlation given the possible delay selected */ + volk_32fc_magnitude_squared_32f(d_corr_output_f, complex_acumulator, d_folding_factor); + volk_gnsssdr_32f_index_max_32u(&indext, d_corr_output_f, d_folding_factor); - } - /*Obtain maximun value of correlation given the possible delay selected */ - volk_32fc_magnitude_squared_32f(d_corr_output_f, complex_acumulator, d_folding_factor); - volk_gnsssdr_32f_index_max_32u(&indext, d_corr_output_f, d_folding_factor); + /*Now save the real code phase in the gnss_syncro block for use in other stages*/ + d_gnss_synchro->Acq_delay_samples = static_cast(d_possible_delay[indext]); + d_gnss_synchro->Acq_doppler_hz = static_cast(doppler); + d_gnss_synchro->Acq_samplestamp_samples = d_sample_counter; - /*Now save the real code phase in the gnss_syncro block for use in other stages*/ - d_gnss_synchro->Acq_delay_samples = static_cast(d_possible_delay[indext]); - d_gnss_synchro->Acq_doppler_hz = static_cast(doppler); - d_gnss_synchro->Acq_samplestamp_samples = d_sample_counter; + /* 5- Compute the test statistics and compare to the threshold d_test_statistics = 2 * d_fft_size * d_mag / d_input_power;*/ + d_test_statistics = d_mag / d_input_power; + //delete complex_acumulator; + } + } - /* 5- Compute the test statistics and compare to the threshold d_test_statistics = 2 * d_fft_size * d_mag / d_input_power;*/ - d_test_statistics = d_mag / d_input_power; - //delete complex_acumulator; - } - } - - // Record results to file if required - if (d_dump) - { - /*Since QuickSYnc performs a folded correlation in frequency by means + // Record results to file if required + if (d_dump) + { + /*Since QuickSYnc performs a folded correlation in frequency by means of the FFT, it is esential to also keep the values obtained from the possible delay to show how it is maximize*/ - std::stringstream filename; - std::streamsize n = sizeof(float) * (d_fft_size); // complex file write - filename.str(""); - filename << "../data/test_statistics_" << d_gnss_synchro->System - << "_" << d_gnss_synchro->Signal << "_sat_" - << d_gnss_synchro->PRN << "_doppler_" << doppler << ".dat"; - d_dump_file.open(filename.str().c_str(), std::ios::out | std::ios::binary); - d_dump_file.write(reinterpret_cast(d_magnitude_folded), n); //write directly |abs(x)|^2 in this Doppler bin? - d_dump_file.close(); - } - } + std::stringstream filename; + std::streamsize n = sizeof(float) * (d_fft_size); // complex file write + filename.str(""); + filename << "../data/test_statistics_" << d_gnss_synchro->System + << "_" << d_gnss_synchro->Signal << "_sat_" + << d_gnss_synchro->PRN << "_doppler_" << doppler << ".dat"; + d_dump_file.open(filename.str().c_str(), std::ios::out | std::ios::binary); + d_dump_file.write(reinterpret_cast(d_magnitude_folded), n); //write directly |abs(x)|^2 in this Doppler bin? + d_dump_file.close(); + } + } - if (!d_bit_transition_flag) - { - if (d_test_statistics > d_threshold) - { - d_state = 2; // Positive acquisition - } - else if (d_well_count == d_max_dwells) - { - d_state = 3; // Negative acquisition - } - } - else - { - if (d_well_count == d_max_dwells) // d_max_dwells = 2 - { - if (d_test_statistics > d_threshold) - { - d_state = 2; // Positive acquisition - } - else - { - d_state = 3; // Negative acquisition - } - } - } + if (!d_bit_transition_flag) + { + if (d_test_statistics > d_threshold) + { + d_state = 2; // Positive acquisition + } + else if (d_well_count == d_max_dwells) + { + d_state = 3; // Negative acquisition + } + } + else + { + if (d_well_count == d_max_dwells) // d_max_dwells = 2 + { + if (d_test_statistics > d_threshold) + { + d_state = 2; // Positive acquisition + } + else + { + d_state = 3; // Negative acquisition + } + } + } - volk_gnsssdr_free(in_temp); - volk_gnsssdr_free(in_temp_folded); - volk_gnsssdr_free(in_1code); - volk_gnsssdr_free(corr_output); - consume_each(1); + volk_gnsssdr_free(in_temp); + volk_gnsssdr_free(in_temp_folded); + volk_gnsssdr_free(in_1code); + volk_gnsssdr_free(corr_output); + consume_each(1); - break; + break; + } + + case 2: + { + //DLOG(INFO) << "START CASE 2"; + // 6.1- Declare positive acquisition using a message port + DLOG(INFO) << "positive acquisition"; + DLOG(INFO) << "satellite " << d_gnss_synchro->System << " " << d_gnss_synchro->PRN; + DLOG(INFO) << "sample_stamp " << d_sample_counter; + DLOG(INFO) << "test statistics value " << d_test_statistics; + DLOG(INFO) << "test statistics threshold " << d_threshold; + DLOG(INFO) << "folding factor " << d_folding_factor; + DLOG(INFO) << "possible delay correlation output"; + for (int i = 0; i < static_cast(d_folding_factor); i++) DLOG(INFO) << d_possible_delay[i] << "\t\t\t" << d_corr_output_f[i]; + DLOG(INFO) << "code phase " << d_gnss_synchro->Acq_delay_samples; + DLOG(INFO) << "doppler " << d_gnss_synchro->Acq_doppler_hz; + DLOG(INFO) << "magnitude folded " << d_mag; + DLOG(INFO) << "input signal power " << d_input_power; + + d_active = false; + d_state = 0; + + d_sample_counter += d_sampled_ms * d_samples_per_ms * ninput_items[0]; // sample counter + consume_each(ninput_items[0]); + + acquisition_message = 1; + this->message_port_pub(pmt::mp("events"), pmt::from_long(acquisition_message)); + //DLOG(INFO) << "END CASE 2"; + break; + } + + case 3: + { + //DLOG(INFO) << "START CASE 3"; + // 6.2- Declare negative acquisition using a message port + DLOG(INFO) << "negative acquisition"; + DLOG(INFO) << "satellite " << d_gnss_synchro->System << " " << d_gnss_synchro->PRN; + DLOG(INFO) << "sample_stamp " << d_sample_counter; + DLOG(INFO) << "test statistics value " << d_test_statistics; + DLOG(INFO) << "test statistics threshold " << d_threshold; + DLOG(INFO) << "folding factor " << d_folding_factor; + DLOG(INFO) << "possible delay corr output"; + for (int i = 0; i < static_cast(d_folding_factor); i++) DLOG(INFO) << d_possible_delay[i] << "\t\t\t" << d_corr_output_f[i]; + DLOG(INFO) << "code phase " << d_gnss_synchro->Acq_delay_samples; + DLOG(INFO) << "doppler " << d_gnss_synchro->Acq_doppler_hz; + DLOG(INFO) << "magnitude folded " << d_mag; + DLOG(INFO) << "input signal power " << d_input_power; + + d_active = false; + d_state = 0; + + d_sample_counter += d_sampled_ms * d_samples_per_ms * ninput_items[0]; // sample counter + consume_each(ninput_items[0]); + + acquisition_message = 2; + this->message_port_pub(pmt::mp("events"), pmt::from_long(acquisition_message)); + //DLOG(INFO) << "END CASE 3"; + break; + } } - - case 2: - { - //DLOG(INFO) << "START CASE 2"; - // 6.1- Declare positive acquisition using a message port - DLOG(INFO) << "positive acquisition"; - DLOG(INFO) << "satellite " << d_gnss_synchro->System << " " << d_gnss_synchro->PRN; - DLOG(INFO) << "sample_stamp " << d_sample_counter; - DLOG(INFO) << "test statistics value " << d_test_statistics; - DLOG(INFO) << "test statistics threshold " << d_threshold; - DLOG(INFO) << "folding factor " << d_folding_factor; - DLOG(INFO) << "possible delay correlation output"; - for (int i = 0; i < static_cast(d_folding_factor); i++) DLOG(INFO) << d_possible_delay[i] << "\t\t\t" << d_corr_output_f[i]; - DLOG(INFO) << "code phase " << d_gnss_synchro->Acq_delay_samples; - DLOG(INFO) << "doppler " << d_gnss_synchro->Acq_doppler_hz; - DLOG(INFO) << "magnitude folded " << d_mag; - DLOG(INFO) << "input signal power " << d_input_power; - - d_active = false; - d_state = 0; - - d_sample_counter += d_sampled_ms * d_samples_per_ms * ninput_items[0]; // sample counter - consume_each(ninput_items[0]); - - acquisition_message = 1; - this->message_port_pub(pmt::mp("events"), pmt::from_long(acquisition_message)); - //DLOG(INFO) << "END CASE 2"; - break; - } - - case 3: - { - //DLOG(INFO) << "START CASE 3"; - // 6.2- Declare negative acquisition using a message port - DLOG(INFO) << "negative acquisition"; - DLOG(INFO) << "satellite " << d_gnss_synchro->System << " " << d_gnss_synchro->PRN; - DLOG(INFO) << "sample_stamp " << d_sample_counter; - DLOG(INFO) << "test statistics value " << d_test_statistics; - DLOG(INFO) << "test statistics threshold " << d_threshold; - DLOG(INFO) << "folding factor "<(d_folding_factor); i++) DLOG(INFO) << d_possible_delay[i] << "\t\t\t" << d_corr_output_f[i]; - DLOG(INFO) << "code phase " << d_gnss_synchro->Acq_delay_samples; - DLOG(INFO) << "doppler " << d_gnss_synchro->Acq_doppler_hz; - DLOG(INFO) << "magnitude folded " << d_mag; - DLOG(INFO) << "input signal power " << d_input_power; - - d_active = false; - d_state = 0; - - d_sample_counter += d_sampled_ms * d_samples_per_ms * ninput_items[0]; // sample counter - consume_each(ninput_items[0]); - - acquisition_message = 2; - this->message_port_pub(pmt::mp("events"), pmt::from_long(acquisition_message)); - //DLOG(INFO) << "END CASE 3"; - break; - } - } return noutput_items; } diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_quicksync_acquisition_cc.h b/src/algorithms/acquisition/gnuradio_blocks/pcps_quicksync_acquisition_cc.h index 5840e3442..01fc094c8 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_quicksync_acquisition_cc.h +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_quicksync_acquisition_cc.h @@ -64,16 +64,16 @@ class pcps_quicksync_acquisition_cc; typedef boost::shared_ptr -pcps_quicksync_acquisition_cc_sptr; + pcps_quicksync_acquisition_cc_sptr; pcps_quicksync_acquisition_cc_sptr pcps_quicksync_make_acquisition_cc(unsigned int folding_factor, - unsigned int sampled_ms, unsigned int max_dwells, - unsigned int doppler_max, long freq, long fs_in, - int samples_per_ms, int samples_per_code, - bool bit_transition_flag, - bool dump, - std::string dump_filename); + unsigned int sampled_ms, unsigned int max_dwells, + unsigned int doppler_max, long freq, long fs_in, + int samples_per_ms, int samples_per_code, + bool bit_transition_flag, + bool dump, + std::string dump_filename); /*! * \brief This class implements a Parallel Code Phase Search Acquisition with @@ -82,31 +82,31 @@ pcps_quicksync_make_acquisition_cc(unsigned int folding_factor, * Check \ref Navitec2012 "Faster GPS via the Sparse Fourier Transform", * for details of its implementation and functionality. */ -class pcps_quicksync_acquisition_cc: public gr::block +class pcps_quicksync_acquisition_cc : public gr::block { private: friend pcps_quicksync_acquisition_cc_sptr pcps_quicksync_make_acquisition_cc(unsigned int folding_factor, - unsigned int sampled_ms, unsigned int max_dwells, - unsigned int doppler_max, long freq, long fs_in, - int samples_per_ms, int samples_per_code, - bool bit_transition_flag, - bool dump, - std::string dump_filename); + unsigned int sampled_ms, unsigned int max_dwells, + unsigned int doppler_max, long freq, long fs_in, + int samples_per_ms, int samples_per_code, + bool bit_transition_flag, + bool dump, + std::string dump_filename); pcps_quicksync_acquisition_cc(unsigned int folding_factor, - unsigned int sampled_ms, unsigned int max_dwells, - unsigned int doppler_max, long freq, long fs_in, - int samples_per_ms, int samples_per_code, - bool bit_transition_flag, - bool dump, - std::string dump_filename); + unsigned int sampled_ms, unsigned int max_dwells, + unsigned int doppler_max, long freq, long fs_in, + int samples_per_ms, int samples_per_code, + bool bit_transition_flag, + bool dump, + std::string dump_filename); void calculate_magnitudes(gr_complex* fft_begin, int doppler_shift, - int doppler_offset); + int doppler_offset); gr_complex* d_code; - unsigned int d_folding_factor; // also referred in the paper as 'p' + unsigned int d_folding_factor; // also referred in the paper as 'p' float* d_corr_acumulator; unsigned int* d_possible_delay; float* d_corr_output_f; @@ -135,7 +135,7 @@ private: gr::fft::fft_complex* d_fft_if; gr::fft::fft_complex* d_fft_if2; gr::fft::fft_complex* d_ifft; - Gnss_Synchro *d_gnss_synchro; + Gnss_Synchro* d_gnss_synchro; unsigned int d_code_phase; float d_doppler_freq; float d_mag; @@ -183,7 +183,7 @@ public: * \brief Sets local code for PCPS acquisition algorithm. * \param code - Pointer to the PRN code. */ - void set_local_code(std::complex * code); + void set_local_code(std::complex* code); /*! * \brief Starts acquisition algorithm, turning from standby mode to @@ -242,9 +242,9 @@ public: /*! * \brief Parallel Code Phase Search Acquisition signal processing. */ - int general_work(int noutput_items, gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); + int general_work(int noutput_items, gr_vector_int& ninput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items); }; #endif /* GNSS_SDR_PCPS_ACQUISITION_CC_H_*/ diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_tong_acquisition_cc.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_tong_acquisition_cc.cc index 28e28abf6..26d3b67f2 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_tong_acquisition_cc.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_tong_acquisition_cc.cc @@ -50,7 +50,7 @@ #include "pcps_tong_acquisition_cc.h" #include "control_message_factory.h" -#include "GPS_L1_CA.h" // for GPS_TWO_PI +#include "GPS_L1_CA.h" // for GPS_TWO_PI #include #include #include @@ -60,29 +60,29 @@ using google::LogMessage; pcps_tong_acquisition_cc_sptr pcps_tong_make_acquisition_cc( - unsigned int sampled_ms, unsigned int doppler_max, - long freq, long fs_in, int samples_per_ms, - int samples_per_code, unsigned int tong_init_val, - unsigned int tong_max_val, unsigned int tong_max_dwells, - bool dump, std::string dump_filename) + unsigned int sampled_ms, unsigned int doppler_max, + long freq, long fs_in, int samples_per_ms, + int samples_per_code, unsigned int tong_init_val, + unsigned int tong_max_val, unsigned int tong_max_dwells, + bool dump, std::string dump_filename) { return pcps_tong_acquisition_cc_sptr( - new pcps_tong_acquisition_cc(sampled_ms, doppler_max, freq, fs_in, samples_per_ms, samples_per_code, - tong_init_val, tong_max_val, tong_max_dwells, dump, dump_filename)); + new pcps_tong_acquisition_cc(sampled_ms, doppler_max, freq, fs_in, samples_per_ms, samples_per_code, + tong_init_val, tong_max_val, tong_max_dwells, dump, dump_filename)); } pcps_tong_acquisition_cc::pcps_tong_acquisition_cc( - unsigned int sampled_ms, unsigned int doppler_max, - long freq, long fs_in, int samples_per_ms, - int samples_per_code, unsigned int tong_init_val, - unsigned int tong_max_val, unsigned int tong_max_dwells, - bool dump, std::string dump_filename) : - gr::block("pcps_tong_acquisition_cc", - gr::io_signature::make(1, 1, sizeof(gr_complex) * sampled_ms * samples_per_ms), - gr::io_signature::make(0, 0, sizeof(gr_complex) * sampled_ms * samples_per_ms)) + unsigned int sampled_ms, unsigned int doppler_max, + long freq, long fs_in, int samples_per_ms, + int samples_per_code, unsigned int tong_init_val, + unsigned int tong_max_val, unsigned int tong_max_dwells, + bool dump, + std::string dump_filename) : gr::block("pcps_tong_acquisition_cc", + gr::io_signature::make(1, 1, sizeof(gr_complex) * sampled_ms * samples_per_ms), + gr::io_signature::make(0, 0, sizeof(gr_complex) * sampled_ms * samples_per_ms)) { this->message_port_register_out(pmt::mp("events")); - d_sample_counter = 0; // SAMPLE COUNTER + d_sample_counter = 0; // SAMPLE COUNTER d_active = false; d_state = 0; d_freq = freq; @@ -101,8 +101,8 @@ pcps_tong_acquisition_cc::pcps_tong_acquisition_cc( d_input_power = 0.0; d_num_doppler_bins = 0; - d_fft_codes = static_cast(volk_gnsssdr_malloc(d_fft_size * sizeof(gr_complex), volk_gnsssdr_get_alignment())); - d_magnitude = static_cast(volk_gnsssdr_malloc(d_fft_size * sizeof(float), volk_gnsssdr_get_alignment())); + d_fft_codes = static_cast(volk_gnsssdr_malloc(d_fft_size * sizeof(gr_complex), volk_gnsssdr_get_alignment())); + d_magnitude = static_cast(volk_gnsssdr_malloc(d_fft_size * sizeof(float), volk_gnsssdr_get_alignment())); // Direct FFT d_fft_if = new gr::fft::fft_complex(d_fft_size, true); @@ -151,11 +151,11 @@ pcps_tong_acquisition_cc::~pcps_tong_acquisition_cc() } } -void pcps_tong_acquisition_cc::set_local_code(std::complex * code) +void pcps_tong_acquisition_cc::set_local_code(std::complex *code) { - memcpy(d_fft_if->get_inbuf(), code, sizeof(gr_complex)*d_fft_size); + memcpy(d_fft_if->get_inbuf(), code, sizeof(gr_complex) * d_fft_size); - d_fft_if->execute(); // We need the FFT of local code + d_fft_if->execute(); // We need the FFT of local code //Conjugate the local code volk_32fc_conjugate_32fc(d_fft_codes, d_fft_if->get_outbuf(), d_fft_size); @@ -179,24 +179,24 @@ void pcps_tong_acquisition_cc::init() for (int doppler = static_cast(-d_doppler_max); doppler <= static_cast(d_doppler_max); doppler += d_doppler_step) - { - d_num_doppler_bins++; - } + { + d_num_doppler_bins++; + } // Create the carrier Doppler wipeoff signals and allocate data grid. - d_grid_doppler_wipeoffs = new gr_complex*[d_num_doppler_bins]; - d_grid_data = new float*[d_num_doppler_bins]; + d_grid_doppler_wipeoffs = new gr_complex *[d_num_doppler_bins]; + d_grid_data = new float *[d_num_doppler_bins]; for (unsigned int doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++) { - d_grid_doppler_wipeoffs[doppler_index] = static_cast(volk_gnsssdr_malloc(d_fft_size * sizeof(gr_complex), volk_gnsssdr_get_alignment())); + d_grid_doppler_wipeoffs[doppler_index] = static_cast(volk_gnsssdr_malloc(d_fft_size * sizeof(gr_complex), volk_gnsssdr_get_alignment())); int doppler = -static_cast(d_doppler_max) + d_doppler_step * doppler_index; float phase_step_rad = GPS_TWO_PI * (d_freq + doppler) / static_cast(d_fs_in); float _phase[1]; _phase[0] = 0; - volk_gnsssdr_s32f_sincos_32fc(d_grid_doppler_wipeoffs[doppler_index], - phase_step_rad, _phase, d_fft_size); + volk_gnsssdr_s32f_sincos_32fc(d_grid_doppler_wipeoffs[doppler_index], -phase_step_rad, _phase, d_fft_size); - d_grid_data[doppler_index] = static_cast(volk_gnsssdr_malloc(d_fft_size * sizeof(float), volk_gnsssdr_get_alignment())); + d_grid_data[doppler_index] = static_cast(volk_gnsssdr_malloc(d_fft_size * sizeof(float), volk_gnsssdr_get_alignment())); for (unsigned int i = 0; i < d_fft_size; i++) { @@ -228,7 +228,8 @@ void pcps_tong_acquisition_cc::set_state(int state) } } else if (d_state == 0) - {} + { + } else { LOG(ERROR) << "State can only be set to 0 or 1"; @@ -236,211 +237,211 @@ void pcps_tong_acquisition_cc::set_state(int state) } int pcps_tong_acquisition_cc::general_work(int noutput_items, - gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items __attribute__((unused))) + gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items __attribute__((unused))) { - int acquisition_message = -1; //0=STOP_CHANNEL 1=ACQ_SUCCEES 2=ACQ_FAIL + int acquisition_message = -1; //0=STOP_CHANNEL 1=ACQ_SUCCEES 2=ACQ_FAIL switch (d_state) - { - case 0: { - if (d_active) - { - //restart acquisition variables - d_gnss_synchro->Acq_delay_samples = 0.0; - d_gnss_synchro->Acq_doppler_hz = 0.0; - d_gnss_synchro->Acq_samplestamp_samples = 0; - d_dwell_count = 0; - d_tong_count = d_tong_init_val; - d_mag = 0.0; - d_input_power = 0.0; - d_test_statistics = 0.0; + case 0: + { + if (d_active) + { + //restart acquisition variables + d_gnss_synchro->Acq_delay_samples = 0.0; + d_gnss_synchro->Acq_doppler_hz = 0.0; + d_gnss_synchro->Acq_samplestamp_samples = 0; + d_dwell_count = 0; + d_tong_count = d_tong_init_val; + d_mag = 0.0; + d_input_power = 0.0; + d_test_statistics = 0.0; - for (unsigned int doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++) - { - for (unsigned int i = 0; i < d_fft_size; i++) - { - d_grid_data[doppler_index][i] = 0; - } - } + for (unsigned int doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++) + { + for (unsigned int i = 0; i < d_fft_size; i++) + { + d_grid_data[doppler_index][i] = 0; + } + } - d_state = 1; - } + d_state = 1; + } - d_sample_counter += d_fft_size * ninput_items[0]; // sample counter - consume_each(ninput_items[0]); + d_sample_counter += d_fft_size * ninput_items[0]; // sample counter + consume_each(ninput_items[0]); - break; + break; + } + + case 1: + { + // initialize acquisition algorithm + int doppler; + uint32_t indext = 0; + float magt = 0.0; + const gr_complex *in = reinterpret_cast(input_items[0]); //Get the input samples pointer + float fft_normalization_factor = static_cast(d_fft_size) * static_cast(d_fft_size); + d_input_power = 0.0; + d_mag = 0.0; + + d_sample_counter += d_fft_size; // sample counter + + d_dwell_count++; + + DLOG(INFO) << "Channel: " << d_channel + << " , doing acquisition of satellite: " << d_gnss_synchro->System << " " << d_gnss_synchro->PRN + << " ,sample stamp: " << d_sample_counter << ", threshold: " + << d_threshold << ", doppler_max: " << d_doppler_max + << ", doppler_step: " << d_doppler_step; + + // 1- Compute the input signal power estimation + volk_32fc_magnitude_squared_32f(d_magnitude, in, d_fft_size); + volk_32f_accumulator_s32f(&d_input_power, d_magnitude, d_fft_size); + d_input_power /= static_cast(d_fft_size); + + // 2- Doppler frequency search loop + for (unsigned int doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++) + { + // doppler search steps + + doppler = -static_cast(d_doppler_max) + d_doppler_step * doppler_index; + + volk_32fc_x2_multiply_32fc(d_fft_if->get_inbuf(), in, + d_grid_doppler_wipeoffs[doppler_index], d_fft_size); + + // 3- Perform the FFT-based convolution (parallel time search) + // Compute the FFT of the carrier wiped--off incoming signal + d_fft_if->execute(); + + // Multiply carrier wiped--off, Fourier transformed incoming signal + // with the local FFT'd code reference using SIMD operations with VOLK library + volk_32fc_x2_multiply_32fc(d_ifft->get_inbuf(), + d_fft_if->get_outbuf(), d_fft_codes, d_fft_size); + + // compute the inverse FFT + d_ifft->execute(); + + // Compute magnitude + volk_32fc_magnitude_squared_32f(d_magnitude, d_ifft->get_outbuf(), d_fft_size); + + // Compute vector of test statistics corresponding to current doppler index. + volk_32f_s32f_multiply_32f(d_magnitude, d_magnitude, + 1 / (fft_normalization_factor * fft_normalization_factor * d_input_power), + d_fft_size); + + // Accumulate test statistics in d_grid_data. + volk_32f_x2_add_32f(d_grid_data[doppler_index], d_magnitude, d_grid_data[doppler_index], d_fft_size); + + // Search maximum + volk_gnsssdr_32f_index_max_32u(&indext, d_grid_data[doppler_index], d_fft_size); + + magt = d_grid_data[doppler_index][indext]; + + // 4- record the maximum peak and the associated synchronization parameters + if (d_mag < magt) + { + d_mag = magt; + d_gnss_synchro->Acq_delay_samples = static_cast(indext % d_samples_per_code); + d_gnss_synchro->Acq_doppler_hz = static_cast(doppler); + d_gnss_synchro->Acq_samplestamp_samples = d_sample_counter; + } + + // Record results to file if required + if (d_dump) + { + std::stringstream filename; + std::streamsize n = 2 * sizeof(float) * (d_fft_size); // complex file write + filename.str(""); + filename << "../data/test_statistics_" << d_gnss_synchro->System + << "_" << d_gnss_synchro->Signal << "_sat_" + << d_gnss_synchro->PRN << "_doppler_" << doppler << ".dat"; + d_dump_file.open(filename.str().c_str(), std::ios::out | std::ios::binary); + d_dump_file.write(reinterpret_cast(d_ifft->get_outbuf()), n); //write directly |abs(x)|^2 in this Doppler bin? + d_dump_file.close(); + } + } + + // 5- Compute the test statistics and compare to the threshold + d_test_statistics = d_mag; + + if (d_test_statistics > d_threshold * d_dwell_count) + { + d_tong_count++; + if (d_tong_count == d_tong_max_val) + { + d_state = 2; // Positive acquisition + } + } + else + { + d_tong_count--; + if (d_tong_count == 0) + { + d_state = 3; // Negative acquisition + } + } + + if (d_dwell_count >= d_tong_max_dwells) + { + d_state = 3; // Negative acquisition + } + consume_each(1); + + break; + } + + case 2: + { + // 6.1- Declare positive acquisition using a message port + DLOG(INFO) << "positive acquisition"; + DLOG(INFO) << "satellite " << d_gnss_synchro->System << " " << d_gnss_synchro->PRN; + DLOG(INFO) << "sample_stamp " << d_sample_counter; + DLOG(INFO) << "test statistics value " << d_test_statistics; + DLOG(INFO) << "test statistics threshold " << d_threshold; + DLOG(INFO) << "code phase " << d_gnss_synchro->Acq_delay_samples; + DLOG(INFO) << "doppler " << d_gnss_synchro->Acq_doppler_hz; + DLOG(INFO) << "magnitude " << d_mag; + DLOG(INFO) << "input signal power " << d_input_power; + + d_active = false; + d_state = 0; + + d_sample_counter += d_fft_size * ninput_items[0]; // sample counter + consume_each(ninput_items[0]); + + acquisition_message = 1; + this->message_port_pub(pmt::mp("events"), pmt::from_long(acquisition_message)); + + break; + } + + case 3: + { + // 6.2- Declare negative acquisition using a message port + DLOG(INFO) << "negative acquisition"; + DLOG(INFO) << "satellite " << d_gnss_synchro->System << " " << d_gnss_synchro->PRN; + DLOG(INFO) << "sample_stamp " << d_sample_counter; + DLOG(INFO) << "test statistics value " << d_test_statistics; + DLOG(INFO) << "test statistics threshold " << d_threshold; + DLOG(INFO) << "code phase " << d_gnss_synchro->Acq_delay_samples; + DLOG(INFO) << "doppler " << d_gnss_synchro->Acq_doppler_hz; + DLOG(INFO) << "magnitude " << d_mag; + DLOG(INFO) << "input signal power " << d_input_power; + + d_active = false; + d_state = 0; + + d_sample_counter += d_fft_size * ninput_items[0]; // sample counter + consume_each(ninput_items[0]); + + acquisition_message = 2; + this->message_port_pub(pmt::mp("events"), pmt::from_long(acquisition_message)); + + break; + } } - case 1: - { - // initialize acquisition algorithm - int doppler; - uint32_t indext = 0; - float magt = 0.0; - const gr_complex *in = reinterpret_cast(input_items[0]); //Get the input samples pointer - float fft_normalization_factor = static_cast(d_fft_size) * static_cast(d_fft_size); - d_input_power = 0.0; - d_mag = 0.0; - - d_sample_counter += d_fft_size; // sample counter - - d_dwell_count++; - - DLOG(INFO) << "Channel: " << d_channel - << " , doing acquisition of satellite: " << d_gnss_synchro->System << " "<< d_gnss_synchro->PRN - << " ,sample stamp: " << d_sample_counter << ", threshold: " - << d_threshold << ", doppler_max: " << d_doppler_max - << ", doppler_step: " << d_doppler_step; - - // 1- Compute the input signal power estimation - volk_32fc_magnitude_squared_32f(d_magnitude, in, d_fft_size); - volk_32f_accumulator_s32f(&d_input_power, d_magnitude, d_fft_size); - d_input_power /= static_cast(d_fft_size); - - // 2- Doppler frequency search loop - for (unsigned int doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++) - { - // doppler search steps - - doppler = -static_cast(d_doppler_max) + d_doppler_step * doppler_index; - - volk_32fc_x2_multiply_32fc(d_fft_if->get_inbuf(), in, - d_grid_doppler_wipeoffs[doppler_index], d_fft_size); - - // 3- Perform the FFT-based convolution (parallel time search) - // Compute the FFT of the carrier wiped--off incoming signal - d_fft_if->execute(); - - // Multiply carrier wiped--off, Fourier transformed incoming signal - // with the local FFT'd code reference using SIMD operations with VOLK library - volk_32fc_x2_multiply_32fc(d_ifft->get_inbuf(), - d_fft_if->get_outbuf(), d_fft_codes, d_fft_size); - - // compute the inverse FFT - d_ifft->execute(); - - // Compute magnitude - volk_32fc_magnitude_squared_32f(d_magnitude, d_ifft->get_outbuf(), d_fft_size); - - // Compute vector of test statistics corresponding to current doppler index. - volk_32f_s32f_multiply_32f(d_magnitude, d_magnitude, - 1/(fft_normalization_factor*fft_normalization_factor*d_input_power), - d_fft_size); - - // Accumulate test statistics in d_grid_data. - volk_32f_x2_add_32f(d_grid_data[doppler_index], d_magnitude, d_grid_data[doppler_index], d_fft_size); - - // Search maximum - volk_gnsssdr_32f_index_max_32u(&indext, d_grid_data[doppler_index], d_fft_size); - - magt = d_grid_data[doppler_index][indext]; - - // 4- record the maximum peak and the associated synchronization parameters - if (d_mag < magt) - { - d_mag = magt; - d_gnss_synchro->Acq_delay_samples = static_cast(indext % d_samples_per_code); - d_gnss_synchro->Acq_doppler_hz = static_cast(doppler); - d_gnss_synchro->Acq_samplestamp_samples = d_sample_counter; - } - - // Record results to file if required - if (d_dump) - { - std::stringstream filename; - std::streamsize n = 2 * sizeof(float) * (d_fft_size); // complex file write - filename.str(""); - filename << "../data/test_statistics_" << d_gnss_synchro->System - <<"_" << d_gnss_synchro->Signal << "_sat_" - << d_gnss_synchro->PRN << "_doppler_" << doppler << ".dat"; - d_dump_file.open(filename.str().c_str(), std::ios::out | std::ios::binary); - d_dump_file.write(reinterpret_cast(d_ifft->get_outbuf()), n); //write directly |abs(x)|^2 in this Doppler bin? - d_dump_file.close(); - } - } - - // 5- Compute the test statistics and compare to the threshold - d_test_statistics = d_mag; - - if (d_test_statistics > d_threshold * d_dwell_count) - { - d_tong_count++; - if (d_tong_count == d_tong_max_val) - { - d_state = 2; // Positive acquisition - } - } - else - { - d_tong_count--; - if (d_tong_count == 0) - { - d_state = 3; // Negative acquisition - } - } - - if(d_dwell_count >= d_tong_max_dwells) - { - d_state = 3; // Negative acquisition - } - consume_each(1); - - break; - } - - case 2: - { - // 6.1- Declare positive acquisition using a message port - DLOG(INFO) << "positive acquisition"; - DLOG(INFO) << "satellite " << d_gnss_synchro->System << " " << d_gnss_synchro->PRN; - DLOG(INFO) << "sample_stamp " << d_sample_counter; - DLOG(INFO) << "test statistics value " << d_test_statistics; - DLOG(INFO) << "test statistics threshold " << d_threshold; - DLOG(INFO) << "code phase " << d_gnss_synchro->Acq_delay_samples; - DLOG(INFO) << "doppler " << d_gnss_synchro->Acq_doppler_hz; - DLOG(INFO) << "magnitude " << d_mag; - DLOG(INFO) << "input signal power " << d_input_power; - - d_active = false; - d_state = 0; - - d_sample_counter += d_fft_size * ninput_items[0]; // sample counter - consume_each(ninput_items[0]); - - acquisition_message = 1; - this->message_port_pub(pmt::mp("events"), pmt::from_long(acquisition_message)); - - break; - } - - case 3: - { - // 6.2- Declare negative acquisition using a message port - DLOG(INFO) << "negative acquisition"; - DLOG(INFO) << "satellite " << d_gnss_synchro->System << " " << d_gnss_synchro->PRN; - DLOG(INFO) << "sample_stamp " << d_sample_counter; - DLOG(INFO) << "test statistics value " << d_test_statistics; - DLOG(INFO) << "test statistics threshold " << d_threshold; - DLOG(INFO) << "code phase " << d_gnss_synchro->Acq_delay_samples; - DLOG(INFO) << "doppler " << d_gnss_synchro->Acq_doppler_hz; - DLOG(INFO) << "magnitude " << d_mag; - DLOG(INFO) << "input signal power " << d_input_power; - - d_active = false; - d_state = 0; - - d_sample_counter += d_fft_size * ninput_items[0]; // sample counter - consume_each(ninput_items[0]); - - acquisition_message = 2; - this->message_port_pub(pmt::mp("events"), pmt::from_long(acquisition_message)); - - break; - } - } - return noutput_items; } diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_tong_acquisition_cc.h b/src/algorithms/acquisition/gnuradio_blocks/pcps_tong_acquisition_cc.h index 4afb487fe..6f49aa91f 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_tong_acquisition_cc.h +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_tong_acquisition_cc.h @@ -65,33 +65,33 @@ typedef boost::shared_ptr pcps_tong_acquisition_cc_spt pcps_tong_acquisition_cc_sptr pcps_tong_make_acquisition_cc(unsigned int sampled_ms, unsigned int doppler_max, - long freq, long fs_in, int samples_per_ms, - int samples_per_code, unsigned int tong_init_val, - unsigned int tong_max_val, unsigned int tong_max_dwells, - bool dump, std::string dump_filename); + long freq, long fs_in, int samples_per_ms, + int samples_per_code, unsigned int tong_init_val, + unsigned int tong_max_val, unsigned int tong_max_dwells, + bool dump, std::string dump_filename); /*! * \brief This class implements a Parallel Code Phase Search Acquisition with * Tong algorithm. */ -class pcps_tong_acquisition_cc: public gr::block +class pcps_tong_acquisition_cc : public gr::block { private: friend pcps_tong_acquisition_cc_sptr pcps_tong_make_acquisition_cc(unsigned int sampled_ms, unsigned int doppler_max, - long freq, long fs_in, int samples_per_ms, - int samples_per_code, unsigned int tong_init_val, - unsigned int tong_max_val, unsigned int tong_max_dwells, - bool dump, std::string dump_filename); + long freq, long fs_in, int samples_per_ms, + int samples_per_code, unsigned int tong_init_val, + unsigned int tong_max_val, unsigned int tong_max_dwells, + bool dump, std::string dump_filename); pcps_tong_acquisition_cc(unsigned int sampled_ms, unsigned int doppler_max, - long freq, long fs_in, int samples_per_ms, - int samples_per_code, unsigned int tong_init_val, - unsigned int tong_max_val, unsigned int tong_max_dwells, - bool dump, std::string dump_filename); + long freq, long fs_in, int samples_per_ms, + int samples_per_code, unsigned int tong_init_val, + unsigned int tong_max_val, unsigned int tong_max_dwells, + bool dump, std::string dump_filename); void calculate_magnitudes(gr_complex* fft_begin, int doppler_shift, - int doppler_offset); + int doppler_offset); long d_fs_in; long d_freq; @@ -116,7 +116,7 @@ private: float** d_grid_data; gr::fft::fft_complex* d_fft_if; gr::fft::fft_complex* d_ifft; - Gnss_Synchro *d_gnss_synchro; + Gnss_Synchro* d_gnss_synchro; unsigned int d_code_phase; float d_doppler_freq; float d_mag; @@ -134,97 +134,97 @@ public: /*! * \brief Default destructor. */ - ~pcps_tong_acquisition_cc(); + ~pcps_tong_acquisition_cc(); - /*! + /*! * \brief Set acquisition/tracking common Gnss_Synchro object pointer * to exchange synchronization data between acquisition and tracking blocks. * \param p_gnss_synchro Satellite information shared by the processing blocks. */ - inline void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) - { - d_gnss_synchro = p_gnss_synchro; - } + inline void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) + { + d_gnss_synchro = p_gnss_synchro; + } - /*! + /*! * \brief Returns the maximum peak of grid search. */ - inline unsigned int mag() const - { - return d_mag; - } + inline unsigned int mag() const + { + return d_mag; + } - /*! + /*! * \brief Initializes acquisition algorithm. */ - void init(); + void init(); - /*! + /*! * \brief Sets local code for TONG acquisition algorithm. * \param code - Pointer to the PRN code. */ - void set_local_code(std::complex * code); + void set_local_code(std::complex* code); - /*! + /*! * \brief Starts acquisition algorithm, turning from standby mode to * active mode * \param active - bool that activates/deactivates the block. */ - inline void set_active(bool active) - { - d_active = active; - } + inline void set_active(bool active) + { + d_active = active; + } - /*! + /*! * \brief If set to 1, ensures that acquisition starts at the * first available sample. * \param state - int=1 forces start of acquisition */ - void set_state(int state); + void set_state(int state); - /*! + /*! * \brief Set acquisition channel unique ID * \param channel - receiver channel. */ - inline void set_channel(unsigned int channel) - { - d_channel = channel; - } + inline void set_channel(unsigned int channel) + { + d_channel = channel; + } - /*! + /*! * \brief Set statistics threshold of TONG algorithm. * \param threshold - Threshold for signal detection (check \ref Navitec2012, * Algorithm 1, for a definition of this threshold). */ - inline void set_threshold(float threshold) - { - d_threshold = threshold; - } + inline void set_threshold(float threshold) + { + d_threshold = threshold; + } - /*! + /*! * \brief Set maximum Doppler grid search * \param doppler_max - Maximum Doppler shift considered in the grid search [Hz]. */ - inline void set_doppler_max(unsigned int doppler_max) - { - d_doppler_max = doppler_max; - } + inline void set_doppler_max(unsigned int doppler_max) + { + d_doppler_max = doppler_max; + } - /*! + /*! * \brief Set Doppler steps for the grid search * \param doppler_step - Frequency bin of the search grid [Hz]. */ - inline void set_doppler_step(unsigned int doppler_step) - { - d_doppler_step = doppler_step; - } + inline void set_doppler_step(unsigned int doppler_step) + { + d_doppler_step = doppler_step; + } - /*! + /*! * \brief Parallel Code Phase Search Acquisition signal processing. */ - int general_work(int noutput_items, gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); + int general_work(int noutput_items, gr_vector_int& ninput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items); }; #endif /* GNSS_SDR_PCPS_TONG_ACQUISITION_CC_H_ */ diff --git a/src/algorithms/channel/adapters/channel.cc b/src/algorithms/channel/adapters/channel.cc index 5cfb237f6..5a6284888 100644 --- a/src/algorithms/channel/adapters/channel.cc +++ b/src/algorithms/channel/adapters/channel.cc @@ -39,10 +39,10 @@ using google::LogMessage; // Constructor -Channel::Channel(ConfigurationInterface *configuration, unsigned int channel, - std::shared_ptr pass_through, std::shared_ptr acq, - std::shared_ptr trk, std::shared_ptr nav, - std::string role, std::string implementation, gr::msg_queue::sptr queue) +Channel::Channel(ConfigurationInterface* configuration, unsigned int channel, + std::shared_ptr pass_through, std::shared_ptr acq, + std::shared_ptr trk, std::shared_ptr nav, + std::string role, std::string implementation, gr::msg_queue::sptr queue) { pass_through_ = pass_through; acq_ = acq; @@ -64,10 +64,10 @@ Channel::Channel(ConfigurationInterface *configuration, unsigned int channel, trk_->set_gnss_synchro(&gnss_synchro_); // Provide a warning to the user about the change of parameter name - if(channel_ == 0) + if (channel_ == 0) { long int deprecation_warning = configuration->property("GNSS-SDR.internal_fs_hz", 0); - if(deprecation_warning != 0) + if (deprecation_warning != 0) { std::cout << "WARNING: The global parameter name GNSS-SDR.internal_fs_hz has been DEPRECATED." << std::endl; std::cout << "WARNING: Please replace it by GNSS-SDR.internal_fs_sps in your configuration file." << std::endl; @@ -77,14 +77,14 @@ Channel::Channel(ConfigurationInterface *configuration, unsigned int channel, // IMPORTANT: Do not change the order between set_doppler_step and set_threshold unsigned int doppler_step = configuration->property("Acquisition_" + implementation_ + boost::lexical_cast(channel_) + ".doppler_step", 0); - if(doppler_step == 0) doppler_step = configuration->property("Acquisition_" + implementation_ + ".doppler_step", 500); - if(FLAGS_doppler_step != 0) doppler_step = static_cast(FLAGS_doppler_step); - DLOG(INFO) << "Channel "<< channel_ << " Doppler_step = " << doppler_step; + if (doppler_step == 0) doppler_step = configuration->property("Acquisition_" + implementation_ + ".doppler_step", 500); + if (FLAGS_doppler_step != 0) doppler_step = static_cast(FLAGS_doppler_step); + DLOG(INFO) << "Channel " << channel_ << " Doppler_step = " << doppler_step; acq_->set_doppler_step(doppler_step); float threshold = configuration->property("Acquisition_" + implementation_ + boost::lexical_cast(channel_) + ".threshold", 0.0); - if(threshold == 0.0) threshold = configuration->property("Acquisition_" + implementation_ + ".threshold", 0.0); + if (threshold == 0.0) threshold = configuration->property("Acquisition_" + implementation_ + ".threshold", 0.0); acq_->set_threshold(threshold); @@ -107,7 +107,7 @@ Channel::Channel(ConfigurationInterface *configuration, unsigned int channel, // Destructor -Channel::~Channel(){} +Channel::~Channel() {} void Channel::connect(gr::top_block_sptr top_block) @@ -190,9 +190,9 @@ void Channel::set_signal(const Gnss_Signal& gnss_signal) std::lock_guard lk(mx); gnss_signal_ = gnss_signal; std::string str_aux = gnss_signal_.get_signal_str(); - const char * str = str_aux.c_str(); // get a C style null terminated string - std::memcpy(static_cast(gnss_synchro_.Signal), str, 3); // copy string into synchro char array: 2 char + null - gnss_synchro_.Signal[2] = 0; // make sure that string length is only two characters + const char* str = str_aux.c_str(); // get a C style null terminated string + std::memcpy(static_cast(gnss_synchro_.Signal), str, 3); // copy string into synchro char array: 2 char + null + gnss_synchro_.Signal[2] = 0; // make sure that string length is only two characters gnss_synchro_.PRN = gnss_signal_.get_satellite().get_PRN(); gnss_synchro_.System = gnss_signal_.get_satellite().get_system_short().c_str()[0]; acq_->set_local_code(); @@ -205,11 +205,10 @@ void Channel::start_acquisition() std::lock_guard lk(mx); bool result = false; result = channel_fsm_->Event_start_acquisition(); - if(!result) + if (!result) { LOG(WARNING) << "Invalid channel event"; return; } DLOG(INFO) << "Channel start_acquisition()"; } - diff --git a/src/algorithms/channel/adapters/channel.h b/src/algorithms/channel/adapters/channel.h index d9ec7b9fe..aeec00925 100644 --- a/src/algorithms/channel/adapters/channel.h +++ b/src/algorithms/channel/adapters/channel.h @@ -56,15 +56,14 @@ class TelemetryDecoderInterface; * their interaction through a Finite State Machine * */ -class Channel: public ChannelInterface +class Channel : public ChannelInterface { - public: //! Constructor - Channel(ConfigurationInterface *configuration, unsigned int channel, - std::shared_ptr pass_through, std::shared_ptr acq, - std::shared_ptr trk, std::shared_ptr nav, - std::string role, std::string implementation, gr::msg_queue::sptr queue); + Channel(ConfigurationInterface* configuration, unsigned int channel, + std::shared_ptr pass_through, std::shared_ptr acq, + std::shared_ptr trk, std::shared_ptr nav, + std::string role, std::string implementation, gr::msg_queue::sptr queue); //! Virtual destructor virtual ~Channel(); @@ -82,12 +81,12 @@ public: inline Gnss_Signal get_signal() const override { return gnss_signal_; } - void start_acquisition() override; //!< Start the State Machine + void start_acquisition() override; //!< Start the State Machine void set_signal(const Gnss_Signal& gnss_signal_) override; //!< Sets the channel GNSS signal - inline std::shared_ptr acquisition(){ return acq_; } - inline std::shared_ptr tracking(){ return trk_; } - inline std::shared_ptr telemetry(){ return nav_; } + inline std::shared_ptr acquisition() { return acq_; } + inline std::shared_ptr tracking() { return trk_; } + inline std::shared_ptr telemetry() { return nav_; } void msg_handler_events(pmt::pmt_t msg); diff --git a/src/algorithms/channel/libs/channel_fsm.cc b/src/algorithms/channel/libs/channel_fsm.cc index 4a96029b5..310a784ef 100644 --- a/src/algorithms/channel/libs/channel_fsm.cc +++ b/src/algorithms/channel/libs/channel_fsm.cc @@ -34,7 +34,6 @@ #include - ChannelFsm::ChannelFsm() { acq_ = nullptr; @@ -44,9 +43,7 @@ ChannelFsm::ChannelFsm() } - -ChannelFsm::ChannelFsm(std::shared_ptr acquisition) : - acq_(acquisition) +ChannelFsm::ChannelFsm(std::shared_ptr acquisition) : acq_(acquisition) { trk_ = nullptr; channel_ = 0; @@ -57,7 +54,7 @@ ChannelFsm::ChannelFsm(std::shared_ptr acquisition) : bool ChannelFsm::Event_start_acquisition() { std::lock_guard lk(mx); - if((d_state == 1) || (d_state == 2)) + if ((d_state == 1) || (d_state == 2)) { return false; } @@ -74,7 +71,7 @@ bool ChannelFsm::Event_start_acquisition() bool ChannelFsm::Event_valid_acquisition() { std::lock_guard lk(mx); - if(d_state != 1) + if (d_state != 1) { return false; } @@ -91,7 +88,7 @@ bool ChannelFsm::Event_valid_acquisition() bool ChannelFsm::Event_failed_acquisition_repeat() { std::lock_guard lk(mx); - if(d_state != 1) + if (d_state != 1) { return false; } @@ -108,7 +105,7 @@ bool ChannelFsm::Event_failed_acquisition_repeat() bool ChannelFsm::Event_failed_acquisition_no_repeat() { std::lock_guard lk(mx); - if(d_state != 1) + if (d_state != 1) { return false; } @@ -125,7 +122,7 @@ bool ChannelFsm::Event_failed_acquisition_no_repeat() bool ChannelFsm::Event_failed_tracking_standby() { std::lock_guard lk(mx); - if(d_state != 2) + if (d_state != 2) { return false; } diff --git a/src/algorithms/channel/libs/channel_fsm.h b/src/algorithms/channel/libs/channel_fsm.h index 37e57a326..bb75ad762 100644 --- a/src/algorithms/channel/libs/channel_fsm.h +++ b/src/algorithms/channel/libs/channel_fsm.h @@ -62,7 +62,6 @@ public: bool Event_failed_tracking_standby(); private: - void start_acquisition(); void start_tracking(); void request_satellite(); diff --git a/src/algorithms/channel/libs/channel_msg_receiver_cc.cc b/src/algorithms/channel/libs/channel_msg_receiver_cc.cc index 7a80cfceb..9b1056bd6 100644 --- a/src/algorithms/channel/libs/channel_msg_receiver_cc.cc +++ b/src/algorithms/channel/libs/channel_msg_receiver_cc.cc @@ -37,7 +37,7 @@ using google::LogMessage; -channel_msg_receiver_cc_sptr channel_msg_receiver_make_cc(std::shared_ptr channel_fsm, bool repeat) +channel_msg_receiver_cc_sptr channel_msg_receiver_make_cc(std::shared_ptr channel_fsm, bool repeat) { return channel_msg_receiver_cc_sptr(new channel_msg_receiver_cc(channel_fsm, repeat)); } @@ -46,44 +46,43 @@ void channel_msg_receiver_cc::msg_handler_events(pmt::pmt_t msg) { bool result = false; try - { + { long int message = pmt::to_long(msg); switch (message) - { - case 1: //positive acquisition - result = d_channel_fsm->Event_valid_acquisition(); - break; - case 2: //negative acquisition - if (d_repeat == true) - { - result = d_channel_fsm->Event_failed_acquisition_repeat(); - } - else - { - result = d_channel_fsm->Event_failed_acquisition_no_repeat(); - } - break; - case 3: // tracking loss of lock event - result = d_channel_fsm->Event_failed_tracking_standby(); - break; - default: - LOG(WARNING) << "Default case, invalid message."; - break; - } - } - catch(boost::bad_any_cast& e) - { + { + case 1: //positive acquisition + result = d_channel_fsm->Event_valid_acquisition(); + break; + case 2: //negative acquisition + if (d_repeat == true) + { + result = d_channel_fsm->Event_failed_acquisition_repeat(); + } + else + { + result = d_channel_fsm->Event_failed_acquisition_no_repeat(); + } + break; + case 3: // tracking loss of lock event + result = d_channel_fsm->Event_failed_tracking_standby(); + break; + default: + LOG(WARNING) << "Default case, invalid message."; + break; + } + } + catch (boost::bad_any_cast& e) + { LOG(WARNING) << "msg_handler_telemetry Bad any cast!"; - } - if(!result) + } + if (!result) { LOG(WARNING) << "msg_handler_telemetry invalid event"; } } -channel_msg_receiver_cc::channel_msg_receiver_cc(std::shared_ptr channel_fsm, bool repeat) : - gr::block("channel_msg_receiver_cc", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0)) +channel_msg_receiver_cc::channel_msg_receiver_cc(std::shared_ptr channel_fsm, bool repeat) : gr::block("channel_msg_receiver_cc", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0)) { this->message_port_register_in(pmt::mp("events")); this->set_msg_handler(pmt::mp("events"), boost::bind(&channel_msg_receiver_cc::msg_handler_events, this, _1)); @@ -93,5 +92,4 @@ channel_msg_receiver_cc::channel_msg_receiver_cc(std::shared_ptr cha } -channel_msg_receiver_cc::~channel_msg_receiver_cc() -{} +channel_msg_receiver_cc::~channel_msg_receiver_cc() {} diff --git a/src/algorithms/channel/libs/channel_msg_receiver_cc.h b/src/algorithms/channel/libs/channel_msg_receiver_cc.h index 63997f25f..63da6efb9 100644 --- a/src/algorithms/channel/libs/channel_msg_receiver_cc.h +++ b/src/algorithms/channel/libs/channel_msg_receiver_cc.h @@ -47,14 +47,13 @@ class channel_msg_receiver_cc : public gr::block { private: std::shared_ptr d_channel_fsm; - bool d_repeat; // todo: change FSM to include repeat value + bool d_repeat; // todo: change FSM to include repeat value friend channel_msg_receiver_cc_sptr channel_msg_receiver_make_cc(std::shared_ptr channel_fsm, bool repeat); void msg_handler_events(pmt::pmt_t msg); channel_msg_receiver_cc(std::shared_ptr channel_fsm, bool repeat); public: - ~channel_msg_receiver_cc (); //!< Default destructor - + ~channel_msg_receiver_cc(); //!< Default destructor }; #endif diff --git a/src/algorithms/conditioner/adapters/array_signal_conditioner.cc b/src/algorithms/conditioner/adapters/array_signal_conditioner.cc index 7e378516d..91cf3abba 100644 --- a/src/algorithms/conditioner/adapters/array_signal_conditioner.cc +++ b/src/algorithms/conditioner/adapters/array_signal_conditioner.cc @@ -37,19 +37,22 @@ using google::LogMessage; // Constructor ArraySignalConditioner::ArraySignalConditioner(ConfigurationInterface *configuration, - std::shared_ptr data_type_adapt, std::shared_ptr in_filt, - std::shared_ptr res, std::string role, std::string implementation) : - data_type_adapt_(data_type_adapt), - in_filt_(in_filt), res_(res), role_(role), implementation_(implementation) + std::shared_ptr data_type_adapt, std::shared_ptr in_filt, + std::shared_ptr res, std::string role, std::string implementation) : data_type_adapt_(data_type_adapt), + in_filt_(in_filt), + res_(res), + role_(role), + implementation_(implementation) { connected_ = false; - if(configuration){ }; + if (configuration) + { + }; } // Destructor -ArraySignalConditioner::~ArraySignalConditioner() -{} +ArraySignalConditioner::~ArraySignalConditioner() {} void ArraySignalConditioner::connect(gr::top_block_sptr top_block) @@ -68,7 +71,7 @@ void ArraySignalConditioner::connect(gr::top_block_sptr top_block) //DLOG(INFO) << "data_type_adapter -> input_filter"; top_block->connect(in_filt_->get_right_block(), 0, - res_->get_left_block(), 0); + res_->get_left_block(), 0); DLOG(INFO) << "Array input_filter -> resampler"; @@ -76,7 +79,6 @@ void ArraySignalConditioner::connect(gr::top_block_sptr top_block) } - void ArraySignalConditioner::disconnect(gr::top_block_sptr top_block) { if (!connected_) @@ -88,7 +90,7 @@ void ArraySignalConditioner::disconnect(gr::top_block_sptr top_block) //top_block->disconnect(data_type_adapt_->get_right_block(), 0, // in_filt_->get_left_block(), 0); top_block->disconnect(in_filt_->get_right_block(), 0, - res_->get_left_block(), 0); + res_->get_left_block(), 0); //data_type_adapt_->disconnect(top_block); in_filt_->disconnect(top_block); @@ -105,9 +107,7 @@ gr::basic_block_sptr ArraySignalConditioner::get_left_block() } - gr::basic_block_sptr ArraySignalConditioner::get_right_block() { return res_->get_right_block(); } - diff --git a/src/algorithms/conditioner/adapters/array_signal_conditioner.h b/src/algorithms/conditioner/adapters/array_signal_conditioner.h index b639f1a14..ebe8f813d 100644 --- a/src/algorithms/conditioner/adapters/array_signal_conditioner.h +++ b/src/algorithms/conditioner/adapters/array_signal_conditioner.h @@ -47,13 +47,13 @@ class TelemetryDecoderInterface; * \brief This class wraps blocks to change data_type_adapter, input_filter and resampler * to be applied to the input flow of sampled signal. */ -class ArraySignalConditioner: public GNSSBlockInterface +class ArraySignalConditioner : public GNSSBlockInterface { public: //! Constructor ArraySignalConditioner(ConfigurationInterface *configuration, - std::shared_ptr data_type_adapt, std::shared_ptr in_filt, - std::shared_ptr res, std::string role, std::string implementation); + std::shared_ptr data_type_adapt, std::shared_ptr in_filt, + std::shared_ptr res, std::string role, std::string implementation); //! Virtual destructor virtual ~ArraySignalConditioner(); @@ -68,9 +68,9 @@ public: inline std::string implementation() override { return "Array_Signal_Conditioner"; } inline size_t item_size() override { return 0; } - inline std::shared_ptr data_type_adapter(){ return data_type_adapt_; } - inline std::shared_ptr input_filter(){ return in_filt_; } - inline std::shared_ptr resampler(){ return res_; } + inline std::shared_ptr data_type_adapter() { return data_type_adapt_; } + inline std::shared_ptr input_filter() { return in_filt_; } + inline std::shared_ptr resampler() { return res_; } private: std::shared_ptr data_type_adapt_; diff --git a/src/algorithms/conditioner/adapters/signal_conditioner.cc b/src/algorithms/conditioner/adapters/signal_conditioner.cc index 962b0dac7..b29a56c99 100644 --- a/src/algorithms/conditioner/adapters/signal_conditioner.cc +++ b/src/algorithms/conditioner/adapters/signal_conditioner.cc @@ -37,19 +37,22 @@ using google::LogMessage; // Constructor SignalConditioner::SignalConditioner(ConfigurationInterface *configuration, - std::shared_ptr data_type_adapt, std::shared_ptr in_filt, - std::shared_ptr res, std::string role, std::string implementation) : - data_type_adapt_(data_type_adapt), - in_filt_(in_filt), res_(res), role_(role), implementation_(implementation) + std::shared_ptr data_type_adapt, std::shared_ptr in_filt, + std::shared_ptr res, std::string role, std::string implementation) : data_type_adapt_(data_type_adapt), + in_filt_(in_filt), + res_(res), + role_(role), + implementation_(implementation) { connected_ = false; - if(configuration){ }; + if (configuration) + { + }; } // Destructor -SignalConditioner::~SignalConditioner() -{} +SignalConditioner::~SignalConditioner() {} void SignalConditioner::connect(gr::top_block_sptr top_block) @@ -81,9 +84,9 @@ void SignalConditioner::disconnect(gr::top_block_sptr top_block) } top_block->disconnect(data_type_adapt_->get_right_block(), 0, - in_filt_->get_left_block(), 0); + in_filt_->get_left_block(), 0); top_block->disconnect(in_filt_->get_right_block(), 0, - res_->get_left_block(), 0); + res_->get_left_block(), 0); data_type_adapt_->disconnect(top_block); in_filt_->disconnect(top_block); @@ -102,4 +105,3 @@ gr::basic_block_sptr SignalConditioner::get_right_block() { return res_->get_right_block(); } - diff --git a/src/algorithms/conditioner/adapters/signal_conditioner.h b/src/algorithms/conditioner/adapters/signal_conditioner.h index 940bba0da..60300b3ec 100644 --- a/src/algorithms/conditioner/adapters/signal_conditioner.h +++ b/src/algorithms/conditioner/adapters/signal_conditioner.h @@ -44,13 +44,13 @@ class TelemetryDecoderInterface; * \brief This class wraps blocks to change data_type_adapter, input_filter and resampler * to be applied to the input flow of sampled signal. */ -class SignalConditioner: public GNSSBlockInterface +class SignalConditioner : public GNSSBlockInterface { public: //! Constructor SignalConditioner(ConfigurationInterface *configuration, - std::shared_ptr data_type_adapt, std::shared_ptr in_filt, - std::shared_ptr res, std::string role, std::string implementation); + std::shared_ptr data_type_adapt, std::shared_ptr in_filt, + std::shared_ptr res, std::string role, std::string implementation); //! Virtual destructor virtual ~SignalConditioner(); @@ -66,9 +66,9 @@ public: inline size_t item_size() override { return 0; } - inline std::shared_ptr data_type_adapter(){ return data_type_adapt_; } - inline std::shared_ptr input_filter(){ return in_filt_; } - inline std::shared_ptr resampler(){ return res_; } + inline std::shared_ptr data_type_adapter() { return data_type_adapt_; } + inline std::shared_ptr input_filter() { return in_filt_; } + inline std::shared_ptr resampler() { return res_; } private: std::shared_ptr data_type_adapt_; diff --git a/src/algorithms/data_type_adapter/adapters/byte_to_short.cc b/src/algorithms/data_type_adapter/adapters/byte_to_short.cc index edce62562..11373a58d 100644 --- a/src/algorithms/data_type_adapter/adapters/byte_to_short.cc +++ b/src/algorithms/data_type_adapter/adapters/byte_to_short.cc @@ -36,9 +36,7 @@ using google::LogMessage; ByteToShort::ByteToShort(ConfigurationInterface* configuration, std::string role, - unsigned int in_streams, unsigned int out_streams) : - config_(configuration), role_(role), in_streams_(in_streams), - out_streams_(out_streams) + unsigned int in_streams, unsigned int out_streams) : config_(configuration), role_(role), in_streams_(in_streams), out_streams_(out_streams) { std::string default_input_item_type = "byte"; std::string default_output_item_type = "short"; @@ -66,7 +64,8 @@ ByteToShort::ByteToShort(ConfigurationInterface* configuration, std::string role ByteToShort::~ByteToShort() -{} +{ +} void ByteToShort::connect(gr::top_block_sptr top_block) @@ -91,16 +90,13 @@ void ByteToShort::disconnect(gr::top_block_sptr top_block) } - gr::basic_block_sptr ByteToShort::get_left_block() { return gr_char_to_short_; } - gr::basic_block_sptr ByteToShort::get_right_block() { return gr_char_to_short_; } - diff --git a/src/algorithms/data_type_adapter/adapters/byte_to_short.h b/src/algorithms/data_type_adapter/adapters/byte_to_short.h index 25420efc3..023c5710e 100644 --- a/src/algorithms/data_type_adapter/adapters/byte_to_short.h +++ b/src/algorithms/data_type_adapter/adapters/byte_to_short.h @@ -42,12 +42,12 @@ class ConfigurationInterface; * \brief Adapts an 8-bits sample stream (IF) to a short int stream (IF) * */ -class ByteToShort: public GNSSBlockInterface +class ByteToShort : public GNSSBlockInterface { public: ByteToShort(ConfigurationInterface* configuration, - std::string role, unsigned int in_streams, - unsigned int out_streams); + std::string role, unsigned int in_streams, + unsigned int out_streams); virtual ~ByteToShort(); diff --git a/src/algorithms/data_type_adapter/adapters/ibyte_to_cbyte.cc b/src/algorithms/data_type_adapter/adapters/ibyte_to_cbyte.cc index 542632542..0bbced35e 100644 --- a/src/algorithms/data_type_adapter/adapters/ibyte_to_cbyte.cc +++ b/src/algorithms/data_type_adapter/adapters/ibyte_to_cbyte.cc @@ -37,9 +37,7 @@ using google::LogMessage; IbyteToCbyte::IbyteToCbyte(ConfigurationInterface* configuration, std::string role, - unsigned int in_streams, unsigned int out_streams) : - config_(configuration), role_(role), in_streams_(in_streams), - out_streams_(out_streams) + unsigned int in_streams, unsigned int out_streams) : config_(configuration), role_(role), in_streams_(in_streams), out_streams_(out_streams) { std::string default_input_item_type = "byte"; std::string default_output_item_type = "lv_8sc_t"; @@ -64,7 +62,7 @@ IbyteToCbyte::IbyteToCbyte(ConfigurationInterface* configuration, std::string ro DLOG(INFO) << "Dumping output into file " << dump_filename_; file_sink_ = gr::blocks::file_sink::make(item_size, dump_filename_.c_str()); } - if(inverted_spectrum) + if (inverted_spectrum) { conjugate_ic_ = make_conjugate_ic(); } @@ -72,14 +70,15 @@ IbyteToCbyte::IbyteToCbyte(ConfigurationInterface* configuration, std::string ro IbyteToCbyte::~IbyteToCbyte() -{} +{ +} void IbyteToCbyte::connect(gr::top_block_sptr top_block) { if (dump_) { - if(inverted_spectrum) + if (inverted_spectrum) { top_block->connect(ibyte_to_cbyte_, 0, conjugate_ic_, 0); top_block->connect(conjugate_ic_, 0, file_sink_, 0); @@ -91,7 +90,7 @@ void IbyteToCbyte::connect(gr::top_block_sptr top_block) } else { - if(inverted_spectrum) + if (inverted_spectrum) { top_block->connect(ibyte_to_cbyte_, 0, conjugate_ic_, 0); } @@ -107,7 +106,7 @@ void IbyteToCbyte::disconnect(gr::top_block_sptr top_block) { if (dump_) { - if(inverted_spectrum) + if (inverted_spectrum) { top_block->disconnect(ibyte_to_cbyte_, 0, conjugate_ic_, 0); top_block->disconnect(conjugate_ic_, 0, file_sink_, 0); @@ -119,7 +118,7 @@ void IbyteToCbyte::disconnect(gr::top_block_sptr top_block) } else { - if(inverted_spectrum) + if (inverted_spectrum) { top_block->disconnect(ibyte_to_cbyte_, 0, conjugate_ic_, 0); } @@ -135,7 +134,7 @@ gr::basic_block_sptr IbyteToCbyte::get_left_block() gr::basic_block_sptr IbyteToCbyte::get_right_block() { - if(inverted_spectrum) + if (inverted_spectrum) { return conjugate_ic_; } diff --git a/src/algorithms/data_type_adapter/adapters/ibyte_to_cbyte.h b/src/algorithms/data_type_adapter/adapters/ibyte_to_cbyte.h index c3d3866c3..8b4f2ae06 100644 --- a/src/algorithms/data_type_adapter/adapters/ibyte_to_cbyte.h +++ b/src/algorithms/data_type_adapter/adapters/ibyte_to_cbyte.h @@ -48,8 +48,8 @@ class IbyteToCbyte : public GNSSBlockInterface { public: IbyteToCbyte(ConfigurationInterface* configuration, - std::string role, unsigned int in_streams, - unsigned int out_streams); + std::string role, unsigned int in_streams, + unsigned int out_streams); virtual ~IbyteToCbyte(); diff --git a/src/algorithms/data_type_adapter/adapters/ibyte_to_complex.cc b/src/algorithms/data_type_adapter/adapters/ibyte_to_complex.cc index 61023d212..ed926ee9f 100644 --- a/src/algorithms/data_type_adapter/adapters/ibyte_to_complex.cc +++ b/src/algorithms/data_type_adapter/adapters/ibyte_to_complex.cc @@ -35,9 +35,7 @@ using google::LogMessage; IbyteToComplex::IbyteToComplex(ConfigurationInterface* configuration, std::string role, - unsigned int in_streams, unsigned int out_streams) : - config_(configuration), role_(role), in_streams_(in_streams), - out_streams_(out_streams) + unsigned int in_streams, unsigned int out_streams) : config_(configuration), role_(role), in_streams_(in_streams), out_streams_(out_streams) { std::string default_input_item_type = "byte"; std::string default_output_item_type = "gr_complex"; @@ -70,14 +68,15 @@ IbyteToComplex::IbyteToComplex(ConfigurationInterface* configuration, std::strin IbyteToComplex::~IbyteToComplex() -{} +{ +} void IbyteToComplex::connect(gr::top_block_sptr top_block) { if (dump_) { - if(inverted_spectrum) + if (inverted_spectrum) { top_block->connect(gr_interleaved_char_to_complex_, 0, conjugate_cc_, 0); top_block->connect(conjugate_cc_, 0, file_sink_, 0); @@ -89,7 +88,7 @@ void IbyteToComplex::connect(gr::top_block_sptr top_block) } else { - if(inverted_spectrum) + if (inverted_spectrum) { top_block->connect(gr_interleaved_char_to_complex_, 0, conjugate_cc_, 0); } @@ -105,7 +104,7 @@ void IbyteToComplex::disconnect(gr::top_block_sptr top_block) { if (dump_) { - if(inverted_spectrum) + if (inverted_spectrum) { top_block->disconnect(gr_interleaved_char_to_complex_, 0, conjugate_cc_, 0); top_block->disconnect(conjugate_cc_, 0, file_sink_, 0); @@ -117,7 +116,7 @@ void IbyteToComplex::disconnect(gr::top_block_sptr top_block) } else { - if(inverted_spectrum) + if (inverted_spectrum) { top_block->disconnect(gr_interleaved_char_to_complex_, 0, conjugate_cc_, 0); } @@ -133,7 +132,7 @@ gr::basic_block_sptr IbyteToComplex::get_left_block() gr::basic_block_sptr IbyteToComplex::get_right_block() { - if(inverted_spectrum) + if (inverted_spectrum) { return conjugate_cc_; } diff --git a/src/algorithms/data_type_adapter/adapters/ibyte_to_complex.h b/src/algorithms/data_type_adapter/adapters/ibyte_to_complex.h index 47edf5b3d..3c71bf660 100644 --- a/src/algorithms/data_type_adapter/adapters/ibyte_to_complex.h +++ b/src/algorithms/data_type_adapter/adapters/ibyte_to_complex.h @@ -44,12 +44,12 @@ class ConfigurationInterface; * \brief Adapts an I/Q interleaved byte integer sample stream to a gr_complex (float) stream * */ -class IbyteToComplex: public GNSSBlockInterface +class IbyteToComplex : public GNSSBlockInterface { public: IbyteToComplex(ConfigurationInterface* configuration, - std::string role, unsigned int in_streams, - unsigned int out_streams); + std::string role, unsigned int in_streams, + unsigned int out_streams); virtual ~IbyteToComplex(); diff --git a/src/algorithms/data_type_adapter/adapters/ibyte_to_cshort.cc b/src/algorithms/data_type_adapter/adapters/ibyte_to_cshort.cc index 35755564f..7db7fef14 100644 --- a/src/algorithms/data_type_adapter/adapters/ibyte_to_cshort.cc +++ b/src/algorithms/data_type_adapter/adapters/ibyte_to_cshort.cc @@ -38,9 +38,7 @@ using google::LogMessage; IbyteToCshort::IbyteToCshort(ConfigurationInterface* configuration, std::string role, - unsigned int in_streams, unsigned int out_streams) : - config_(configuration), role_(role), in_streams_(in_streams), - out_streams_(out_streams) + unsigned int in_streams, unsigned int out_streams) : config_(configuration), role_(role), in_streams_(in_streams), out_streams_(out_streams) { std::string default_input_item_type = "byte"; std::string default_output_item_type = "cshort"; @@ -58,14 +56,14 @@ IbyteToCshort::IbyteToCshort(ConfigurationInterface* configuration, std::string interleaved_byte_to_complex_short_ = make_interleaved_byte_to_complex_short(); - DLOG(INFO) << "data_type_adapter_(" << interleaved_byte_to_complex_short_->unique_id()<<")"; + DLOG(INFO) << "data_type_adapter_(" << interleaved_byte_to_complex_short_->unique_id() << ")"; if (dump_) { DLOG(INFO) << "Dumping output into file " << dump_filename_; file_sink_ = gr::blocks::file_sink::make(item_size, dump_filename_.c_str()); } - if(inverted_spectrum) + if (inverted_spectrum) { conjugate_sc_ = make_conjugate_sc(); } @@ -73,14 +71,15 @@ IbyteToCshort::IbyteToCshort(ConfigurationInterface* configuration, std::string IbyteToCshort::~IbyteToCshort() -{} +{ +} void IbyteToCshort::connect(gr::top_block_sptr top_block) { if (dump_) { - if(inverted_spectrum) + if (inverted_spectrum) { top_block->connect(interleaved_byte_to_complex_short_, 0, conjugate_sc_, 0); top_block->connect(conjugate_sc_, 0, file_sink_, 0); @@ -92,7 +91,7 @@ void IbyteToCshort::connect(gr::top_block_sptr top_block) } else { - if(inverted_spectrum) + if (inverted_spectrum) { top_block->connect(interleaved_byte_to_complex_short_, 0, conjugate_sc_, 0); } @@ -104,7 +103,7 @@ void IbyteToCshort::disconnect(gr::top_block_sptr top_block) { if (dump_) { - if(inverted_spectrum) + if (inverted_spectrum) { top_block->disconnect(interleaved_byte_to_complex_short_, 0, conjugate_sc_, 0); top_block->disconnect(conjugate_sc_, 0, file_sink_, 0); @@ -116,7 +115,7 @@ void IbyteToCshort::disconnect(gr::top_block_sptr top_block) } else { - if(inverted_spectrum) + if (inverted_spectrum) { top_block->disconnect(interleaved_byte_to_complex_short_, 0, conjugate_sc_, 0); } @@ -132,7 +131,7 @@ gr::basic_block_sptr IbyteToCshort::get_left_block() gr::basic_block_sptr IbyteToCshort::get_right_block() { - if(inverted_spectrum) + if (inverted_spectrum) { return conjugate_sc_; } diff --git a/src/algorithms/data_type_adapter/adapters/ibyte_to_cshort.h b/src/algorithms/data_type_adapter/adapters/ibyte_to_cshort.h index 33c861945..a7d6394d1 100644 --- a/src/algorithms/data_type_adapter/adapters/ibyte_to_cshort.h +++ b/src/algorithms/data_type_adapter/adapters/ibyte_to_cshort.h @@ -44,12 +44,12 @@ class ConfigurationInterface; * \brief Adapts a short integer (16 bits) interleaved sample stream into a std::complex stream * */ -class IbyteToCshort: public GNSSBlockInterface +class IbyteToCshort : public GNSSBlockInterface { public: IbyteToCshort(ConfigurationInterface* configuration, - std::string role, unsigned int in_streams, - unsigned int out_streams); + std::string role, unsigned int in_streams, + unsigned int out_streams); virtual ~IbyteToCshort(); diff --git a/src/algorithms/data_type_adapter/adapters/ishort_to_complex.cc b/src/algorithms/data_type_adapter/adapters/ishort_to_complex.cc index 55cc24974..8e79a25c7 100644 --- a/src/algorithms/data_type_adapter/adapters/ishort_to_complex.cc +++ b/src/algorithms/data_type_adapter/adapters/ishort_to_complex.cc @@ -35,9 +35,7 @@ using google::LogMessage; IshortToComplex::IshortToComplex(ConfigurationInterface* configuration, std::string role, - unsigned int in_streams, unsigned int out_streams) : - config_(configuration), role_(role), in_streams_(in_streams), - out_streams_(out_streams) + unsigned int in_streams, unsigned int out_streams) : config_(configuration), role_(role), in_streams_(in_streams), out_streams_(out_streams) { std::string default_input_item_type = "short"; std::string default_output_item_type = "gr_complex"; @@ -70,14 +68,15 @@ IshortToComplex::IshortToComplex(ConfigurationInterface* configuration, std::str IshortToComplex::~IshortToComplex() -{} +{ +} void IshortToComplex::connect(gr::top_block_sptr top_block) { if (dump_) { - if(inverted_spectrum) + if (inverted_spectrum) { top_block->connect(gr_interleaved_short_to_complex_, 0, conjugate_cc_, 0); top_block->connect(conjugate_cc_, 0, file_sink_, 0); @@ -89,7 +88,7 @@ void IshortToComplex::connect(gr::top_block_sptr top_block) } else { - if(inverted_spectrum) + if (inverted_spectrum) { top_block->connect(gr_interleaved_short_to_complex_, 0, conjugate_cc_, 0); } @@ -105,7 +104,7 @@ void IshortToComplex::disconnect(gr::top_block_sptr top_block) { if (dump_) { - if(inverted_spectrum) + if (inverted_spectrum) { top_block->disconnect(gr_interleaved_short_to_complex_, 0, conjugate_cc_, 0); top_block->disconnect(conjugate_cc_, 0, file_sink_, 0); @@ -117,7 +116,7 @@ void IshortToComplex::disconnect(gr::top_block_sptr top_block) } else { - if(inverted_spectrum) + if (inverted_spectrum) { top_block->disconnect(gr_interleaved_short_to_complex_, 0, conjugate_cc_, 0); } @@ -133,7 +132,7 @@ gr::basic_block_sptr IshortToComplex::get_left_block() gr::basic_block_sptr IshortToComplex::get_right_block() { - if(inverted_spectrum) + if (inverted_spectrum) { return conjugate_cc_; } diff --git a/src/algorithms/data_type_adapter/adapters/ishort_to_complex.h b/src/algorithms/data_type_adapter/adapters/ishort_to_complex.h index 3319163fb..53d9a0d8a 100644 --- a/src/algorithms/data_type_adapter/adapters/ishort_to_complex.h +++ b/src/algorithms/data_type_adapter/adapters/ishort_to_complex.h @@ -43,12 +43,12 @@ class ConfigurationInterface; * \brief Adapts an I/Q interleaved short integer sample stream to a gr_complex (float) stream * */ -class IshortToComplex: public GNSSBlockInterface +class IshortToComplex : public GNSSBlockInterface { public: IshortToComplex(ConfigurationInterface* configuration, - std::string role, unsigned int in_streams, - unsigned int out_streams); + std::string role, unsigned int in_streams, + unsigned int out_streams); virtual ~IshortToComplex(); diff --git a/src/algorithms/data_type_adapter/adapters/ishort_to_cshort.cc b/src/algorithms/data_type_adapter/adapters/ishort_to_cshort.cc index 740c4baf5..f0e294f66 100644 --- a/src/algorithms/data_type_adapter/adapters/ishort_to_cshort.cc +++ b/src/algorithms/data_type_adapter/adapters/ishort_to_cshort.cc @@ -37,9 +37,7 @@ using google::LogMessage; IshortToCshort::IshortToCshort(ConfigurationInterface* configuration, std::string role, - unsigned int in_streams, unsigned int out_streams) : - config_(configuration), role_(role), in_streams_(in_streams), - out_streams_(out_streams) + unsigned int in_streams, unsigned int out_streams) : config_(configuration), role_(role), in_streams_(in_streams), out_streams_(out_streams) { std::string default_input_item_type = "short"; std::string default_output_item_type = "cshort"; @@ -64,7 +62,7 @@ IshortToCshort::IshortToCshort(ConfigurationInterface* configuration, std::strin DLOG(INFO) << "Dumping output into file " << dump_filename_; file_sink_ = gr::blocks::file_sink::make(item_size, dump_filename_.c_str()); } - if(inverted_spectrum) + if (inverted_spectrum) { conjugate_sc_ = make_conjugate_sc(); } @@ -72,14 +70,15 @@ IshortToCshort::IshortToCshort(ConfigurationInterface* configuration, std::strin IshortToCshort::~IshortToCshort() -{} +{ +} void IshortToCshort::connect(gr::top_block_sptr top_block) { if (dump_) { - if(inverted_spectrum) + if (inverted_spectrum) { top_block->connect(interleaved_short_to_complex_short_, 0, conjugate_sc_, 0); top_block->connect(conjugate_sc_, 0, file_sink_, 0); @@ -91,7 +90,7 @@ void IshortToCshort::connect(gr::top_block_sptr top_block) } else { - if(inverted_spectrum) + if (inverted_spectrum) { top_block->connect(interleaved_short_to_complex_short_, 0, conjugate_sc_, 0); } @@ -107,7 +106,7 @@ void IshortToCshort::disconnect(gr::top_block_sptr top_block) { if (dump_) { - if(inverted_spectrum) + if (inverted_spectrum) { top_block->disconnect(interleaved_short_to_complex_short_, 0, conjugate_sc_, 0); top_block->disconnect(conjugate_sc_, 0, file_sink_, 0); @@ -119,7 +118,7 @@ void IshortToCshort::disconnect(gr::top_block_sptr top_block) } else { - if(inverted_spectrum) + if (inverted_spectrum) { top_block->disconnect(interleaved_short_to_complex_short_, 0, conjugate_sc_, 0); } @@ -135,7 +134,7 @@ gr::basic_block_sptr IshortToCshort::get_left_block() gr::basic_block_sptr IshortToCshort::get_right_block() { - if(inverted_spectrum) + if (inverted_spectrum) { return conjugate_sc_; } diff --git a/src/algorithms/data_type_adapter/adapters/ishort_to_cshort.h b/src/algorithms/data_type_adapter/adapters/ishort_to_cshort.h index a996f7fd9..df8f68a06 100644 --- a/src/algorithms/data_type_adapter/adapters/ishort_to_cshort.h +++ b/src/algorithms/data_type_adapter/adapters/ishort_to_cshort.h @@ -44,12 +44,12 @@ class ConfigurationInterface; * \brief Adapts a short integer (16 bits) interleaved sample stream into a std::complex stream * */ -class IshortToCshort: public GNSSBlockInterface +class IshortToCshort : public GNSSBlockInterface { public: IshortToCshort(ConfigurationInterface* configuration, - std::string role, unsigned int in_streams, - unsigned int out_streams); + std::string role, unsigned int in_streams, + unsigned int out_streams); virtual ~IshortToCshort(); diff --git a/src/algorithms/data_type_adapter/gnuradio_blocks/interleaved_byte_to_complex_byte.cc b/src/algorithms/data_type_adapter/gnuradio_blocks/interleaved_byte_to_complex_byte.cc index 9cc6e21f4..69a7987dd 100644 --- a/src/algorithms/data_type_adapter/gnuradio_blocks/interleaved_byte_to_complex_byte.cc +++ b/src/algorithms/data_type_adapter/gnuradio_blocks/interleaved_byte_to_complex_byte.cc @@ -40,11 +40,10 @@ interleaved_byte_to_complex_byte_sptr make_interleaved_byte_to_complex_byte() } - interleaved_byte_to_complex_byte::interleaved_byte_to_complex_byte() : sync_decimator("interleaved_byte_to_complex_byte", - gr::io_signature::make (1, 1, sizeof(int8_t)), - gr::io_signature::make (1, 1, sizeof(lv_8sc_t)), // lv_8sc_t is a Volk's typedef for std::complex - 2) + gr::io_signature::make(1, 1, sizeof(int8_t)), + gr::io_signature::make(1, 1, sizeof(lv_8sc_t)), // lv_8sc_t is a Volk's typedef for std::complex + 2) { const int alignment_multiple = volk_get_alignment() / sizeof(lv_8sc_t); set_alignment(std::max(1, alignment_multiple)); @@ -52,15 +51,15 @@ interleaved_byte_to_complex_byte::interleaved_byte_to_complex_byte() : sync_deci int interleaved_byte_to_complex_byte::work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items) { const int8_t *in = reinterpret_cast(input_items[0]); lv_8sc_t *out = reinterpret_cast(output_items[0]); // This could be put into a Volk kernel int8_t real_part; int8_t imag_part; - for(int number = 0; number < noutput_items; number++) + for (int number = 0; number < noutput_items; number++) { // lv_cmake(r, i) defined at volk/volk_complex.h real_part = *in++; diff --git a/src/algorithms/data_type_adapter/gnuradio_blocks/interleaved_byte_to_complex_byte.h b/src/algorithms/data_type_adapter/gnuradio_blocks/interleaved_byte_to_complex_byte.h index d650c2f8b..4e37602ed 100644 --- a/src/algorithms/data_type_adapter/gnuradio_blocks/interleaved_byte_to_complex_byte.h +++ b/src/algorithms/data_type_adapter/gnuradio_blocks/interleaved_byte_to_complex_byte.h @@ -45,16 +45,17 @@ interleaved_byte_to_complex_byte_sptr make_interleaved_byte_to_complex_byte(); * \brief This class adapts an 8-bits interleaved sample stream * into a 16-bits complex stream (std::complex) */ -class interleaved_byte_to_complex_byte : public gr::sync_decimator +class interleaved_byte_to_complex_byte : public gr::sync_decimator { private: friend interleaved_byte_to_complex_byte_sptr make_interleaved_byte_to_complex_byte(); + public: interleaved_byte_to_complex_byte(); int work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items); }; #endif diff --git a/src/algorithms/data_type_adapter/gnuradio_blocks/interleaved_byte_to_complex_short.cc b/src/algorithms/data_type_adapter/gnuradio_blocks/interleaved_byte_to_complex_short.cc index c4927d825..7c154f820 100644 --- a/src/algorithms/data_type_adapter/gnuradio_blocks/interleaved_byte_to_complex_short.cc +++ b/src/algorithms/data_type_adapter/gnuradio_blocks/interleaved_byte_to_complex_short.cc @@ -40,11 +40,10 @@ interleaved_byte_to_complex_short_sptr make_interleaved_byte_to_complex_short() } - interleaved_byte_to_complex_short::interleaved_byte_to_complex_short() : sync_decimator("interleaved_byte_to_complex_short", - gr::io_signature::make (1, 1, sizeof(int8_t)), - gr::io_signature::make (1, 1, sizeof(lv_16sc_t)), // lv_16sc_t is a Volk's typedef for std::complex - 2) + gr::io_signature::make(1, 1, sizeof(int8_t)), + gr::io_signature::make(1, 1, sizeof(lv_16sc_t)), // lv_16sc_t is a Volk's typedef for std::complex + 2) { const int alignment_multiple = volk_get_alignment() / sizeof(lv_16sc_t); set_alignment(std::max(1, alignment_multiple)); @@ -52,15 +51,15 @@ interleaved_byte_to_complex_short::interleaved_byte_to_complex_short() : sync_de int interleaved_byte_to_complex_short::work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items) { const int8_t *in = reinterpret_cast(input_items[0]); lv_16sc_t *out = reinterpret_cast(output_items[0]); // This could be put into a Volk kernel int8_t real_part; int8_t imag_part; - for(int number = 0; number < noutput_items; number++) + for (int number = 0; number < noutput_items; number++) { // lv_cmake(r, i) defined at volk/volk_complex.h real_part = *in++; diff --git a/src/algorithms/data_type_adapter/gnuradio_blocks/interleaved_byte_to_complex_short.h b/src/algorithms/data_type_adapter/gnuradio_blocks/interleaved_byte_to_complex_short.h index 386e1fd85..88f1cc424 100644 --- a/src/algorithms/data_type_adapter/gnuradio_blocks/interleaved_byte_to_complex_short.h +++ b/src/algorithms/data_type_adapter/gnuradio_blocks/interleaved_byte_to_complex_short.h @@ -48,12 +48,13 @@ class interleaved_byte_to_complex_short : public gr::sync_decimator { private: friend interleaved_byte_to_complex_short_sptr make_interleaved_byte_to_complex_short(); + public: interleaved_byte_to_complex_short(); int work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items); }; #endif diff --git a/src/algorithms/data_type_adapter/gnuradio_blocks/interleaved_short_to_complex_short.cc b/src/algorithms/data_type_adapter/gnuradio_blocks/interleaved_short_to_complex_short.cc index 7d13e3c0c..ddad5165f 100644 --- a/src/algorithms/data_type_adapter/gnuradio_blocks/interleaved_short_to_complex_short.cc +++ b/src/algorithms/data_type_adapter/gnuradio_blocks/interleaved_short_to_complex_short.cc @@ -40,11 +40,10 @@ interleaved_short_to_complex_short_sptr make_interleaved_short_to_complex_short( } - interleaved_short_to_complex_short::interleaved_short_to_complex_short() : sync_decimator("interleaved_short_to_complex_short", - gr::io_signature::make (1, 1, sizeof(int16_t)), - gr::io_signature::make (1, 1, sizeof(lv_16sc_t)), // lv_16sc_t is a Volk's typedef for std::complex - 2) + gr::io_signature::make(1, 1, sizeof(int16_t)), + gr::io_signature::make(1, 1, sizeof(lv_16sc_t)), // lv_16sc_t is a Volk's typedef for std::complex + 2) { const int alignment_multiple = volk_get_alignment() / sizeof(lv_16sc_t); set_alignment(std::max(1, alignment_multiple)); @@ -52,15 +51,15 @@ interleaved_short_to_complex_short::interleaved_short_to_complex_short() : sync_ int interleaved_short_to_complex_short::work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items) { const int16_t *in = reinterpret_cast(input_items[0]); - lv_16sc_t *out = reinterpret_cast(output_items[0]); + lv_16sc_t *out = reinterpret_cast(output_items[0]); // This could be put into a Volk kernel int16_t real_part; int16_t imag_part; - for(int number = 0; number < noutput_items; number++) + for (int number = 0; number < noutput_items; number++) { // lv_cmake(r, i) defined at volk/volk_complex.h real_part = *in++; diff --git a/src/algorithms/data_type_adapter/gnuradio_blocks/interleaved_short_to_complex_short.h b/src/algorithms/data_type_adapter/gnuradio_blocks/interleaved_short_to_complex_short.h index d85735ae5..64d1297bf 100644 --- a/src/algorithms/data_type_adapter/gnuradio_blocks/interleaved_short_to_complex_short.h +++ b/src/algorithms/data_type_adapter/gnuradio_blocks/interleaved_short_to_complex_short.h @@ -48,12 +48,13 @@ class interleaved_short_to_complex_short : public gr::sync_decimator { private: friend interleaved_short_to_complex_short_sptr make_interleaved_short_to_complex_short(); + public: interleaved_short_to_complex_short(); int work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items); }; #endif diff --git a/src/algorithms/input_filter/adapters/beamformer_filter.cc b/src/algorithms/input_filter/adapters/beamformer_filter.cc index b621310f3..683673111 100644 --- a/src/algorithms/input_filter/adapters/beamformer_filter.cc +++ b/src/algorithms/input_filter/adapters/beamformer_filter.cc @@ -38,9 +38,8 @@ using google::LogMessage; BeamformerFilter::BeamformerFilter( - ConfigurationInterface* configuration, std::string role, - unsigned int in_stream, unsigned int out_stream) : - role_(role), in_stream_(in_stream), out_stream_(out_stream) + ConfigurationInterface* configuration, std::string role, + unsigned int in_stream, unsigned int out_stream) : role_(role), in_stream_(in_stream), out_stream_(out_stream) { std::string default_item_type = "gr_complex"; std::string default_dump_file = "./data/input_filter.dat"; @@ -55,12 +54,11 @@ BeamformerFilter::BeamformerFilter( beamformer_ = make_beamformer(); DLOG(INFO) << "Item size " << item_size_; DLOG(INFO) << "resampler(" << beamformer_->unique_id() << ")"; - } else { LOG(WARNING) << item_type_ - << " unrecognized item type for beamformer"; + << " unrecognized item type for beamformer"; item_size_ = sizeof(gr_complex); } if (dump_) @@ -76,7 +74,6 @@ BeamformerFilter::BeamformerFilter( BeamformerFilter::~BeamformerFilter() {} - void BeamformerFilter::connect(gr::top_block_sptr top_block) { if (dump_) diff --git a/src/algorithms/input_filter/adapters/beamformer_filter.h b/src/algorithms/input_filter/adapters/beamformer_filter.h index 1af6a13e5..6f02ba4ef 100644 --- a/src/algorithms/input_filter/adapters/beamformer_filter.h +++ b/src/algorithms/input_filter/adapters/beamformer_filter.h @@ -42,12 +42,12 @@ class ConfigurationInterface; * \brief Interface of an adapter of a direct resampler conditioner block * to a SignalConditionerInterface */ -class BeamformerFilter: public GNSSBlockInterface +class BeamformerFilter : public GNSSBlockInterface { public: BeamformerFilter(ConfigurationInterface* configuration, - std::string role, unsigned int in_stream, - unsigned int out_stream); + std::string role, unsigned int in_stream, + unsigned int out_stream); virtual ~BeamformerFilter(); diff --git a/src/algorithms/input_filter/adapters/fir_filter.cc b/src/algorithms/input_filter/adapters/fir_filter.cc index 3b1b613c1..4358bcccd 100644 --- a/src/algorithms/input_filter/adapters/fir_filter.cc +++ b/src/algorithms/input_filter/adapters/fir_filter.cc @@ -40,14 +40,11 @@ using google::LogMessage; FirFilter::FirFilter(ConfigurationInterface* configuration, std::string role, - unsigned int in_streams, unsigned int out_streams) : - config_(configuration), role_(role), in_streams_(in_streams), - out_streams_(out_streams) + unsigned int in_streams, unsigned int out_streams) : config_(configuration), role_(role), in_streams_(in_streams), out_streams_(out_streams) { size_t item_size; (*this).init(); - if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("gr_complex") == 0) - && (output_item_type_.compare("gr_complex") == 0)) + if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("gr_complex") == 0) && (output_item_type_.compare("gr_complex") == 0)) { item_size = sizeof(gr_complex); fir_filter_ccf_ = gr::filter::fir_filter_ccf::make(1, taps_); @@ -58,8 +55,7 @@ FirFilter::FirFilter(ConfigurationInterface* configuration, std::string role, file_sink_ = gr::blocks::file_sink::make(item_size, dump_filename_.c_str()); } } - else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("cshort") == 0) - && (output_item_type_.compare("cshort") == 0)) + else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("cshort") == 0) && (output_item_type_.compare("cshort") == 0)) { item_size = sizeof(lv_16sc_t); cshort_to_float_x2_ = make_cshort_to_float_x2(); @@ -76,8 +72,7 @@ FirFilter::FirFilter(ConfigurationInterface* configuration, std::string role, file_sink_ = gr::blocks::file_sink::make(item_size, dump_filename_.c_str()); } } - else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("cshort") == 0) - && (output_item_type_.compare("gr_complex") == 0)) + else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("cshort") == 0) && (output_item_type_.compare("gr_complex") == 0)) { item_size = sizeof(gr_complex); cshort_to_float_x2_ = make_cshort_to_float_x2(); @@ -93,8 +88,7 @@ FirFilter::FirFilter(ConfigurationInterface* configuration, std::string role, } } - else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("cbyte") == 0) - && (output_item_type_.compare("gr_complex") == 0)) + else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("cbyte") == 0) && (output_item_type_.compare("gr_complex") == 0)) { item_size = sizeof(gr_complex); cbyte_to_float_x2_ = make_complex_byte_to_float_x2(); @@ -112,8 +106,7 @@ FirFilter::FirFilter(ConfigurationInterface* configuration, std::string role, file_sink_ = gr::blocks::file_sink::make(item_size, dump_filename_.c_str()); } } - else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("cbyte") == 0) - && (output_item_type_.compare("cbyte") == 0)) + else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("cbyte") == 0) && (output_item_type_.compare("cbyte") == 0)) { item_size = sizeof(lv_8sc_t); cbyte_to_float_x2_ = make_complex_byte_to_float_x2(); @@ -141,16 +134,14 @@ FirFilter::FirFilter(ConfigurationInterface* configuration, std::string role, } - FirFilter::~FirFilter() -{} - +{ +} void FirFilter::connect(gr::top_block_sptr top_block) { - if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("gr_complex") == 0) - && (output_item_type_.compare("gr_complex") == 0)) + if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("gr_complex") == 0) && (output_item_type_.compare("gr_complex") == 0)) { if (dump_) { @@ -161,8 +152,7 @@ void FirFilter::connect(gr::top_block_sptr top_block) DLOG(INFO) << "Nothing to connect internally"; } } - else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("cshort") == 0) - && (output_item_type_.compare("cshort") == 0)) + else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("cshort") == 0) && (output_item_type_.compare("cshort") == 0)) { top_block->connect(cshort_to_float_x2_, 0, fir_filter_fff_1_, 0); top_block->connect(cshort_to_float_x2_, 1, fir_filter_fff_2_, 0); @@ -175,8 +165,7 @@ void FirFilter::connect(gr::top_block_sptr top_block) top_block->connect(short_x2_to_cshort_, 0, file_sink_, 0); } } - else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("cbyte") == 0) - && (output_item_type_.compare("gr_complex") == 0)) + else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("cbyte") == 0) && (output_item_type_.compare("gr_complex") == 0)) { top_block->connect(cbyte_to_float_x2_, 0, fir_filter_fff_1_, 0); top_block->connect(cbyte_to_float_x2_, 1, fir_filter_fff_2_, 0); @@ -187,8 +176,7 @@ void FirFilter::connect(gr::top_block_sptr top_block) top_block->connect(float_to_complex_, 0, file_sink_, 0); } } - else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("cbyte") == 0) - && (output_item_type_.compare("cbyte") == 0)) + else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("cbyte") == 0) && (output_item_type_.compare("cbyte") == 0)) { top_block->connect(cbyte_to_float_x2_, 0, fir_filter_fff_1_, 0); top_block->connect(cbyte_to_float_x2_, 1, fir_filter_fff_2_, 0); @@ -201,8 +189,7 @@ void FirFilter::connect(gr::top_block_sptr top_block) top_block->connect(char_x2_cbyte_, 0, file_sink_, 0); } } - else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("cshort") == 0) - && (output_item_type_.compare("gr_complex") == 0)) + else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("cshort") == 0) && (output_item_type_.compare("gr_complex") == 0)) { top_block->connect(cshort_to_float_x2_, 0, fir_filter_fff_1_, 0); top_block->connect(cshort_to_float_x2_, 1, fir_filter_fff_2_, 0); @@ -220,19 +207,16 @@ void FirFilter::connect(gr::top_block_sptr top_block) } - void FirFilter::disconnect(gr::top_block_sptr top_block) { - if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("gr_complex") == 0) - && (output_item_type_.compare("gr_complex") == 0)) + if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("gr_complex") == 0) && (output_item_type_.compare("gr_complex") == 0)) { if (dump_) { top_block->disconnect(fir_filter_ccf_, 0, file_sink_, 0); } } - else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("cbyte") == 0) - && (output_item_type_.compare("gr_complex") == 0)) + else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("cbyte") == 0) && (output_item_type_.compare("gr_complex") == 0)) { top_block->disconnect(fir_filter_fff_2_, 0, float_to_complex_, 1); top_block->disconnect(fir_filter_fff_1_, 0, float_to_complex_, 0); @@ -243,8 +227,7 @@ void FirFilter::disconnect(gr::top_block_sptr top_block) top_block->disconnect(float_to_complex_, 0, file_sink_, 0); } } - else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("cshort") == 0) - && (output_item_type_.compare("cshort") == 0)) + else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("cshort") == 0) && (output_item_type_.compare("cshort") == 0)) { top_block->disconnect(cshort_to_float_x2_, 0, fir_filter_fff_1_, 0); top_block->disconnect(cshort_to_float_x2_, 1, fir_filter_fff_2_, 0); @@ -257,8 +240,7 @@ void FirFilter::disconnect(gr::top_block_sptr top_block) top_block->disconnect(short_x2_to_cshort_, 0, file_sink_, 0); } } - else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("cbyte") == 0) - && (output_item_type_.compare("cbyte") == 0)) + else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("cbyte") == 0) && (output_item_type_.compare("cbyte") == 0)) { top_block->disconnect(float_to_char_2_, 0, char_x2_cbyte_, 1); top_block->disconnect(float_to_char_1_, 0, char_x2_cbyte_, 0); @@ -271,8 +253,7 @@ void FirFilter::disconnect(gr::top_block_sptr top_block) top_block->disconnect(char_x2_cbyte_, 0, file_sink_, 0); } } - else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("cshort") == 0) - && (output_item_type_.compare("gr_complex") == 0)) + else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("cshort") == 0) && (output_item_type_.compare("gr_complex") == 0)) { top_block->disconnect(cshort_to_float_x2_, 0, fir_filter_fff_1_, 0); top_block->disconnect(cshort_to_float_x2_, 1, fir_filter_fff_2_, 0); @@ -290,31 +271,25 @@ void FirFilter::disconnect(gr::top_block_sptr top_block) } - gr::basic_block_sptr FirFilter::get_left_block() { - if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("gr_complex") == 0) - && (output_item_type_.compare("gr_complex") == 0)) + if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("gr_complex") == 0) && (output_item_type_.compare("gr_complex") == 0)) { return fir_filter_ccf_; } - else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("cshort") == 0) - && (output_item_type_.compare("cshort") == 0)) + else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("cshort") == 0) && (output_item_type_.compare("cshort") == 0)) { return cshort_to_float_x2_; } - else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("cbyte") == 0) - && (output_item_type_.compare("gr_complex") == 0)) + else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("cbyte") == 0) && (output_item_type_.compare("gr_complex") == 0)) { return cbyte_to_float_x2_; } - else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("cbyte") == 0) - && (output_item_type_.compare("cbyte") == 0)) + else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("cbyte") == 0) && (output_item_type_.compare("cbyte") == 0)) { return cbyte_to_float_x2_; } - else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("cshort") == 0) - && (output_item_type_.compare("gr_complex") == 0)) + else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("cshort") == 0) && (output_item_type_.compare("gr_complex") == 0)) { return cshort_to_float_x2_; } @@ -326,31 +301,25 @@ gr::basic_block_sptr FirFilter::get_left_block() } - gr::basic_block_sptr FirFilter::get_right_block() { - if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("gr_complex") == 0) - && (output_item_type_.compare("gr_complex") == 0)) + if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("gr_complex") == 0) && (output_item_type_.compare("gr_complex") == 0)) { return fir_filter_ccf_; } - else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("cshort") == 0) - && (output_item_type_.compare("cshort") == 0)) + else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("cshort") == 0) && (output_item_type_.compare("cshort") == 0)) { return short_x2_to_cshort_; } - else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("cbyte") == 0) - && (output_item_type_.compare("gr_complex") == 0)) + else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("cbyte") == 0) && (output_item_type_.compare("gr_complex") == 0)) { return float_to_complex_; } - else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("cbyte") == 0) - && (output_item_type_.compare("cbyte") == 0)) + else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("cbyte") == 0) && (output_item_type_.compare("cbyte") == 0)) { return char_x2_cbyte_; } - else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("cshort") == 0) - && (output_item_type_.compare("gr_complex") == 0)) + else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("cshort") == 0) && (output_item_type_.compare("gr_complex") == 0)) { return float_to_complex_; } @@ -362,7 +331,6 @@ gr::basic_block_sptr FirFilter::get_right_block() } - void FirFilter::init() { std::string default_input_item_type = "gr_complex"; @@ -371,9 +339,9 @@ void FirFilter::init() std::string default_dump_filename = "../data/input_filter.dat"; int default_number_of_taps = 6; unsigned int default_number_of_bands = 2; - std::vector default_bands = { 0.0, 0.4, 0.6, 1.0 }; - std::vector default_ampl = { 1.0, 1.0, 0.0, 0.0 }; - std::vector default_error_w = { 1.0, 1.0 }; + std::vector default_bands = {0.0, 0.4, 0.6, 1.0}; + std::vector default_ampl = {1.0, 1.0, 0.0, 0.0}; + std::vector default_error_w = {1.0, 1.0}; std::string default_filter_type = "bandpass"; int default_grid_density = 16; diff --git a/src/algorithms/input_filter/adapters/fir_filter.h b/src/algorithms/input_filter/adapters/fir_filter.h index 0ea7faf39..d5318b9d2 100644 --- a/src/algorithms/input_filter/adapters/fir_filter.h +++ b/src/algorithms/input_filter/adapters/fir_filter.h @@ -59,14 +59,14 @@ class ConfigurationInterface; * given a set of band edges, the desired response on those bands, and the weight given * to the error in those bands. */ -class FirFilter: public GNSSBlockInterface +class FirFilter : public GNSSBlockInterface { public: //! Constructor FirFilter(ConfigurationInterface* configuration, - std::string role, - unsigned int in_streams, - unsigned int out_streams); + std::string role, + unsigned int in_streams, + unsigned int out_streams); //! Destructor virtual ~FirFilter(); @@ -100,7 +100,7 @@ private: std::string input_item_type_; std::string output_item_type_; std::string taps_item_type_; - std::vector taps_; + std::vector taps_; std::string role_; unsigned int in_streams_; unsigned int out_streams_; diff --git a/src/algorithms/input_filter/adapters/freq_xlating_fir_filter.cc b/src/algorithms/input_filter/adapters/freq_xlating_fir_filter.cc index dfab552c5..e8ef0a964 100644 --- a/src/algorithms/input_filter/adapters/freq_xlating_fir_filter.cc +++ b/src/algorithms/input_filter/adapters/freq_xlating_fir_filter.cc @@ -41,9 +41,7 @@ using google::LogMessage; FreqXlatingFirFilter::FreqXlatingFirFilter(ConfigurationInterface* configuration, std::string role, - unsigned int in_streams, unsigned int out_streams) : - config_(configuration), role_(role), in_streams_(in_streams), - out_streams_(out_streams) + unsigned int in_streams, unsigned int out_streams) : config_(configuration), role_(role), in_streams_(in_streams), out_streams_(out_streams) { size_t item_size; (*this).init(); @@ -51,35 +49,31 @@ FreqXlatingFirFilter::FreqXlatingFirFilter(ConfigurationInterface* configuration int default_decimation_factor = 1; decimation_factor = config_->property(role_ + ".decimation_factor", default_decimation_factor); - if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("gr_complex") == 0) - && (output_item_type_.compare("gr_complex") == 0)) + if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("gr_complex") == 0) && (output_item_type_.compare("gr_complex") == 0)) { - item_size = sizeof(gr_complex); //output - input_size_ = sizeof(gr_complex); //input + item_size = sizeof(gr_complex); //output + input_size_ = sizeof(gr_complex); //input freq_xlating_fir_filter_ccf_ = gr::filter::freq_xlating_fir_filter_ccf::make(decimation_factor, taps_, intermediate_freq_, sampling_freq_); DLOG(INFO) << "input_filter(" << freq_xlating_fir_filter_ccf_->unique_id() << ")"; } - else if((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("float") == 0) - && (output_item_type_.compare("gr_complex") == 0)) + else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("float") == 0) && (output_item_type_.compare("gr_complex") == 0)) { item_size = sizeof(gr_complex); - input_size_ = sizeof(float); //input + input_size_ = sizeof(float); //input freq_xlating_fir_filter_fcf_ = gr::filter::freq_xlating_fir_filter_fcf::make(decimation_factor, taps_, intermediate_freq_, sampling_freq_); DLOG(INFO) << "input_filter(" << freq_xlating_fir_filter_fcf_->unique_id() << ")"; } - else if((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("short") == 0) - && (output_item_type_.compare("gr_complex") == 0)) + else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("short") == 0) && (output_item_type_.compare("gr_complex") == 0)) { item_size = sizeof(gr_complex); - input_size_ = sizeof(int16_t); //input + input_size_ = sizeof(int16_t); //input freq_xlating_fir_filter_scf_ = gr::filter::freq_xlating_fir_filter_scf::make(decimation_factor, taps_, intermediate_freq_, sampling_freq_); DLOG(INFO) << "input_filter(" << freq_xlating_fir_filter_scf_->unique_id() << ")"; } - else if((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("short") == 0) - && (output_item_type_.compare("cshort") == 0)) + else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("short") == 0) && (output_item_type_.compare("cshort") == 0)) { item_size = sizeof(lv_16sc_t); - input_size_ = sizeof(int16_t); //input + input_size_ = sizeof(int16_t); //input freq_xlating_fir_filter_scf_ = gr::filter::freq_xlating_fir_filter_scf::make(decimation_factor, taps_, intermediate_freq_, sampling_freq_); DLOG(INFO) << "input_filter(" << freq_xlating_fir_filter_scf_->unique_id() << ")"; complex_to_float_ = gr::blocks::complex_to_float::make(); @@ -87,20 +81,18 @@ FreqXlatingFirFilter::FreqXlatingFirFilter(ConfigurationInterface* configuration float_to_short_2_ = gr::blocks::float_to_short::make(); short_x2_to_cshort_ = make_short_x2_to_cshort(); } - else if((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("byte") == 0) - && (output_item_type_.compare("gr_complex") == 0)) + else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("byte") == 0) && (output_item_type_.compare("gr_complex") == 0)) { item_size = sizeof(gr_complex); - input_size_ = sizeof(int8_t); //input + input_size_ = sizeof(int8_t); //input gr_char_to_short_ = gr::blocks::char_to_short::make(); freq_xlating_fir_filter_scf_ = gr::filter::freq_xlating_fir_filter_scf::make(decimation_factor, taps_, intermediate_freq_, sampling_freq_); DLOG(INFO) << "input_filter(" << freq_xlating_fir_filter_scf_->unique_id() << ")"; } - else if((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("byte") == 0) - && (output_item_type_.compare("cbyte") == 0)) + else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("byte") == 0) && (output_item_type_.compare("cbyte") == 0)) { item_size = sizeof(lv_8sc_t); - input_size_ = sizeof(int8_t); //input + input_size_ = sizeof(int8_t); //input gr_char_to_short_ = gr::blocks::char_to_short::make(); freq_xlating_fir_filter_scf_ = gr::filter::freq_xlating_fir_filter_scf::make(decimation_factor, taps_, intermediate_freq_, sampling_freq_); DLOG(INFO) << "input_filter(" << freq_xlating_fir_filter_scf_->unique_id() << ")"; @@ -109,8 +101,8 @@ FreqXlatingFirFilter::FreqXlatingFirFilter(ConfigurationInterface* configuration else { LOG(ERROR) << " Unknown input filter input/output item type conversion"; - item_size = sizeof(gr_complex); //avoids uninitialization - input_size_ = sizeof(gr_complex); //avoids uninitialization + item_size = sizeof(gr_complex); //avoids uninitialization + input_size_ = sizeof(gr_complex); //avoids uninitialization } if (dump_) @@ -122,40 +114,35 @@ FreqXlatingFirFilter::FreqXlatingFirFilter(ConfigurationInterface* configuration } - FreqXlatingFirFilter::~FreqXlatingFirFilter() -{} - +{ +} void FreqXlatingFirFilter::connect(gr::top_block_sptr top_block) { - if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("gr_complex") == 0) - && (output_item_type_.compare("gr_complex") == 0)) + if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("gr_complex") == 0) && (output_item_type_.compare("gr_complex") == 0)) { if (dump_) { top_block->connect(freq_xlating_fir_filter_ccf_, 0, file_sink_, 0); } } - else if((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("float") == 0) - && (output_item_type_.compare("gr_complex") == 0)) + else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("float") == 0) && (output_item_type_.compare("gr_complex") == 0)) { if (dump_) { top_block->connect(freq_xlating_fir_filter_fcf_, 0, file_sink_, 0); } } - else if((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("short") == 0) - && (output_item_type_.compare("gr_complex") == 0)) + else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("short") == 0) && (output_item_type_.compare("gr_complex") == 0)) { if (dump_) { top_block->connect(freq_xlating_fir_filter_scf_, 0, file_sink_, 0); } } - else if((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("short") == 0) - && (output_item_type_.compare("cshort") == 0)) + else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("short") == 0) && (output_item_type_.compare("cshort") == 0)) { top_block->connect(freq_xlating_fir_filter_scf_, 0, complex_to_float_, 0); top_block->connect(complex_to_float_, 0, float_to_short_1_, 0); @@ -167,8 +154,7 @@ void FreqXlatingFirFilter::connect(gr::top_block_sptr top_block) top_block->connect(short_x2_to_cshort_, 0, file_sink_, 0); } } - else if((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("byte") == 0) - && (output_item_type_.compare("gr_complex") == 0)) + else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("byte") == 0) && (output_item_type_.compare("gr_complex") == 0)) { top_block->connect(gr_char_to_short_, 0, freq_xlating_fir_filter_scf_, 0); if (dump_) @@ -176,8 +162,7 @@ void FreqXlatingFirFilter::connect(gr::top_block_sptr top_block) top_block->connect(freq_xlating_fir_filter_scf_, 0, file_sink_, 0); } } - else if((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("byte") == 0) - && (output_item_type_.compare("cbyte") == 0)) + else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("byte") == 0) && (output_item_type_.compare("cbyte") == 0)) { top_block->connect(gr_char_to_short_, 0, freq_xlating_fir_filter_scf_, 0); top_block->connect(freq_xlating_fir_filter_scf_, 0, complex_to_complex_byte_, 0); @@ -193,35 +178,30 @@ void FreqXlatingFirFilter::connect(gr::top_block_sptr top_block) } - void FreqXlatingFirFilter::disconnect(gr::top_block_sptr top_block) { - if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("gr_complex") == 0) - && (output_item_type_.compare("gr_complex") == 0)) + if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("gr_complex") == 0) && (output_item_type_.compare("gr_complex") == 0)) { if (dump_) { top_block->disconnect(freq_xlating_fir_filter_ccf_, 0, file_sink_, 0); } } - else if((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("float") == 0) - && (output_item_type_.compare("gr_complex") == 0)) + else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("float") == 0) && (output_item_type_.compare("gr_complex") == 0)) { if (dump_) { top_block->disconnect(freq_xlating_fir_filter_fcf_, 0, file_sink_, 0); } } - else if((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("short") == 0) - && (output_item_type_.compare("gr_complex") == 0)) + else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("short") == 0) && (output_item_type_.compare("gr_complex") == 0)) { if (dump_) { top_block->disconnect(freq_xlating_fir_filter_scf_, 0, file_sink_, 0); } } - else if((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("short") == 0) - && (output_item_type_.compare("cshort") == 0)) + else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("short") == 0) && (output_item_type_.compare("cshort") == 0)) { top_block->disconnect(freq_xlating_fir_filter_scf_, 0, complex_to_float_, 0); top_block->disconnect(complex_to_float_, 0, float_to_short_1_, 0); @@ -233,8 +213,7 @@ void FreqXlatingFirFilter::disconnect(gr::top_block_sptr top_block) top_block->disconnect(short_x2_to_cshort_, 0, file_sink_, 0); } } - else if((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("byte") == 0) - && (output_item_type_.compare("gr_complex") == 0)) + else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("byte") == 0) && (output_item_type_.compare("gr_complex") == 0)) { top_block->disconnect(gr_char_to_short_, 0, freq_xlating_fir_filter_scf_, 0); if (dump_) @@ -242,8 +221,7 @@ void FreqXlatingFirFilter::disconnect(gr::top_block_sptr top_block) top_block->disconnect(freq_xlating_fir_filter_scf_, 0, file_sink_, 0); } } - else if((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("byte") == 0) - && (output_item_type_.compare("cbyte") == 0)) + else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("byte") == 0) && (output_item_type_.compare("cbyte") == 0)) { top_block->disconnect(gr_char_to_short_, 0, freq_xlating_fir_filter_scf_, 0); top_block->disconnect(freq_xlating_fir_filter_scf_, 0, complex_to_complex_byte_, 0); @@ -261,33 +239,27 @@ void FreqXlatingFirFilter::disconnect(gr::top_block_sptr top_block) gr::basic_block_sptr FreqXlatingFirFilter::get_left_block() { - if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("gr_complex") == 0) - && (output_item_type_.compare("gr_complex") == 0)) + if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("gr_complex") == 0) && (output_item_type_.compare("gr_complex") == 0)) { return freq_xlating_fir_filter_ccf_; } - else if((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("float") == 0) - && (output_item_type_.compare("gr_complex") == 0)) + else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("float") == 0) && (output_item_type_.compare("gr_complex") == 0)) { return freq_xlating_fir_filter_fcf_; } - else if((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("short") == 0) - && (output_item_type_.compare("gr_complex") == 0)) + else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("short") == 0) && (output_item_type_.compare("gr_complex") == 0)) { return freq_xlating_fir_filter_scf_; } - else if((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("short") == 0) - && (output_item_type_.compare("cshort") == 0)) + else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("short") == 0) && (output_item_type_.compare("cshort") == 0)) { return freq_xlating_fir_filter_scf_; } - else if((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("byte") == 0) - && (output_item_type_.compare("gr_complex") == 0)) + else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("byte") == 0) && (output_item_type_.compare("gr_complex") == 0)) { return gr_char_to_short_; } - else if((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("byte") == 0) - && (output_item_type_.compare("cbyte") == 0)) + else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("byte") == 0) && (output_item_type_.compare("cbyte") == 0)) { return gr_char_to_short_; } @@ -301,33 +273,27 @@ gr::basic_block_sptr FreqXlatingFirFilter::get_left_block() gr::basic_block_sptr FreqXlatingFirFilter::get_right_block() { - if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("gr_complex") == 0) - && (output_item_type_.compare("gr_complex") == 0)) + if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("gr_complex") == 0) && (output_item_type_.compare("gr_complex") == 0)) { return freq_xlating_fir_filter_ccf_; } - else if((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("float") == 0) - && (output_item_type_.compare("gr_complex") == 0)) + else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("float") == 0) && (output_item_type_.compare("gr_complex") == 0)) { return freq_xlating_fir_filter_fcf_; } - else if((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("short") == 0) - && (output_item_type_.compare("gr_complex") == 0)) + else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("short") == 0) && (output_item_type_.compare("gr_complex") == 0)) { return freq_xlating_fir_filter_scf_; } - else if((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("short") == 0) - && (output_item_type_.compare("cshort") == 0)) + else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("short") == 0) && (output_item_type_.compare("cshort") == 0)) { return short_x2_to_cshort_; } - else if((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("byte") == 0) - && (output_item_type_.compare("gr_complex") == 0)) + else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("byte") == 0) && (output_item_type_.compare("gr_complex") == 0)) { return freq_xlating_fir_filter_scf_; } - else if((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("byte") == 0) - && (output_item_type_.compare("cbyte") == 0)) + else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("byte") == 0) && (output_item_type_.compare("cbyte") == 0)) { return complex_to_complex_byte_; } @@ -349,9 +315,9 @@ void FreqXlatingFirFilter::init() double default_sampling_freq = 4000000.0; int default_number_of_taps = 6; unsigned int default_number_of_bands = 2; - std::vector default_bands = { 0.0, 0.4, 0.6, 1.0 }; - std::vector default_ampl = { 1.0, 1.0, 0.0, 0.0 }; - std::vector default_error_w = { 1.0, 1.0 }; + std::vector default_bands = {0.0, 0.4, 0.6, 1.0}; + std::vector default_ampl = {1.0, 1.0, 0.0, 0.0}; + std::vector default_error_w = {1.0, 1.0}; std::string default_filter_type = "bandpass"; int default_grid_density = 16; @@ -368,10 +334,10 @@ void FreqXlatingFirFilter::init() unsigned int number_of_bands = config_->property(role_ + ".number_of_bands", default_number_of_bands); std::string filter_type = config_->property(role_ + ".filter_type", default_filter_type); - if(filter_type.compare("lowpass") != 0) + if (filter_type.compare("lowpass") != 0) { - std::vector taps_d; - std::vector bands; + std::vector taps_d; + std::vector bands; std::vector ampl; std::vector error_w; std::string option; @@ -410,10 +376,10 @@ void FreqXlatingFirFilter::init() } else { - double default_bw = 2000000.0; - double bw_ = config_->property(role_ + ".bw", default_bw); - double default_tw = bw_ / 10.0; - double tw_ = config_->property(role_ + ".tw", default_tw); - taps_ = gr::filter::firdes::low_pass(1.0, sampling_freq_, bw_, tw_); - } + double default_bw = 2000000.0; + double bw_ = config_->property(role_ + ".bw", default_bw); + double default_tw = bw_ / 10.0; + double tw_ = config_->property(role_ + ".tw", default_tw); + taps_ = gr::filter::firdes::low_pass(1.0, sampling_freq_, bw_, tw_); + } } diff --git a/src/algorithms/input_filter/adapters/freq_xlating_fir_filter.h b/src/algorithms/input_filter/adapters/freq_xlating_fir_filter.h index c304c3226..02d49971f 100644 --- a/src/algorithms/input_filter/adapters/freq_xlating_fir_filter.h +++ b/src/algorithms/input_filter/adapters/freq_xlating_fir_filter.h @@ -60,12 +60,12 @@ class ConfigurationInterface; * given a set of band edges, the desired response on those bands, and the weight given * to the error in those bands. */ -class FreqXlatingFirFilter: public GNSSBlockInterface +class FreqXlatingFirFilter : public GNSSBlockInterface { public: FreqXlatingFirFilter(ConfigurationInterface* configuration, - std::string role, unsigned int in_streams, - unsigned int out_streams); + std::string role, unsigned int in_streams, + unsigned int out_streams); virtual ~FreqXlatingFirFilter(); @@ -101,7 +101,7 @@ private: size_t input_size_; std::string output_item_type_; std::string taps_item_type_; - std::vector taps_; + std::vector taps_; double intermediate_freq_; double sampling_freq_; std::string role_; @@ -117,4 +117,4 @@ private: void init(); }; -#endif // GNSS_SDR_FREQ_XLATING_FIR_FILTER_H_ +#endif // GNSS_SDR_FREQ_XLATING_FIR_FILTER_H_ diff --git a/src/algorithms/input_filter/adapters/notch_filter.cc b/src/algorithms/input_filter/adapters/notch_filter.cc index ae209f3f2..9034c5fcf 100644 --- a/src/algorithms/input_filter/adapters/notch_filter.cc +++ b/src/algorithms/input_filter/adapters/notch_filter.cc @@ -39,9 +39,7 @@ using google::LogMessage; NotchFilter::NotchFilter(ConfigurationInterface* configuration, std::string role, - unsigned int in_streams, unsigned int out_streams) : - role_(role), in_streams_(in_streams), - out_streams_(out_streams) + unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) { size_t item_size_; float pfa; @@ -71,7 +69,6 @@ NotchFilter::NotchFilter(ConfigurationInterface* configuration, std::string role notch_filter_ = make_notch_filter(pfa, p_c_factor, length_, n_segments_est, n_segments_reset); DLOG(INFO) << "Item size " << item_size_; DLOG(INFO) << "input filter(" << notch_filter_->unique_id() << ")"; - } else { @@ -88,7 +85,8 @@ NotchFilter::NotchFilter(ConfigurationInterface* configuration, std::string role NotchFilter::~NotchFilter() -{} +{ +} void NotchFilter::connect(gr::top_block_sptr top_block) @@ -101,7 +99,7 @@ void NotchFilter::connect(gr::top_block_sptr top_block) else { DLOG(INFO) << "nothing to connect internally"; - } + } } @@ -114,7 +112,7 @@ void NotchFilter::disconnect(gr::top_block_sptr top_block) } -gr::basic_block_sptr NotchFilter::get_left_block() +gr::basic_block_sptr NotchFilter::get_left_block() { return notch_filter_; } diff --git a/src/algorithms/input_filter/adapters/notch_filter.h b/src/algorithms/input_filter/adapters/notch_filter.h index 9e2a11f26..cb44a8059 100644 --- a/src/algorithms/input_filter/adapters/notch_filter.h +++ b/src/algorithms/input_filter/adapters/notch_filter.h @@ -41,12 +41,12 @@ class ConfigurationInterface; -class NotchFilter: public GNSSBlockInterface +class NotchFilter : public GNSSBlockInterface { public: NotchFilter(ConfigurationInterface* configuration, - std::string role, unsigned int in_streams, - unsigned int out_streams); + std::string role, unsigned int in_streams, + unsigned int out_streams); virtual ~NotchFilter(); std::string role() @@ -67,9 +67,8 @@ public: void disconnect(gr::top_block_sptr top_block); gr::basic_block_sptr get_left_block(); gr::basic_block_sptr get_right_block(); - + private: - bool dump_; std::string dump_filename_; std::string role_; @@ -80,4 +79,4 @@ private: notch_sptr notch_filter_; }; -#endif //GNSS_SDR_NOTCH_FILTER_H_ +#endif //GNSS_SDR_NOTCH_FILTER_H_ diff --git a/src/algorithms/input_filter/adapters/notch_filter_lite.cc b/src/algorithms/input_filter/adapters/notch_filter_lite.cc index 86c11e114..22e536c22 100644 --- a/src/algorithms/input_filter/adapters/notch_filter_lite.cc +++ b/src/algorithms/input_filter/adapters/notch_filter_lite.cc @@ -39,9 +39,7 @@ using google::LogMessage; NotchFilterLite::NotchFilterLite(ConfigurationInterface* configuration, std::string role, - unsigned int in_streams, unsigned int out_streams) : - role_(role), in_streams_(in_streams), - out_streams_(out_streams) + unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) { size_t item_size_; float p_c_factor; @@ -56,7 +54,7 @@ NotchFilterLite::NotchFilterLite(ConfigurationInterface* configuration, std::str int default_n_segments_reset = 5000000; float default_samp_freq = 4000000; float samp_freq = configuration->property("SignalSource.sampling_frequency", default_samp_freq); - float default_coeff_rate = samp_freq * 0.1; + float default_coeff_rate = samp_freq * 0.1; float coeff_rate; std::string default_item_type = "gr_complex"; std::string default_dump_file = "./data/input_filter.dat"; @@ -94,7 +92,8 @@ NotchFilterLite::NotchFilterLite(ConfigurationInterface* configuration, std::str NotchFilterLite::~NotchFilterLite() -{} +{ +} void NotchFilterLite::connect(gr::top_block_sptr top_block) @@ -107,7 +106,7 @@ void NotchFilterLite::connect(gr::top_block_sptr top_block) else { DLOG(INFO) << "nothing to connect internally"; - } + } } @@ -120,7 +119,7 @@ void NotchFilterLite::disconnect(gr::top_block_sptr top_block) } -gr::basic_block_sptr NotchFilterLite::get_left_block() +gr::basic_block_sptr NotchFilterLite::get_left_block() { return notch_filter_lite_; } diff --git a/src/algorithms/input_filter/adapters/notch_filter_lite.h b/src/algorithms/input_filter/adapters/notch_filter_lite.h index 0333d76c1..ea091dc58 100644 --- a/src/algorithms/input_filter/adapters/notch_filter_lite.h +++ b/src/algorithms/input_filter/adapters/notch_filter_lite.h @@ -41,12 +41,12 @@ class ConfigurationInterface; -class NotchFilterLite: public GNSSBlockInterface +class NotchFilterLite : public GNSSBlockInterface { public: NotchFilterLite(ConfigurationInterface* configuration, - std::string role, unsigned int in_streams, - unsigned int out_streams); + std::string role, unsigned int in_streams, + unsigned int out_streams); virtual ~NotchFilterLite(); std::string role() @@ -67,9 +67,8 @@ public: void disconnect(gr::top_block_sptr top_block); gr::basic_block_sptr get_left_block(); gr::basic_block_sptr get_right_block(); - + private: - bool dump_; std::string dump_filename_; std::string role_; @@ -80,4 +79,4 @@ private: notch_lite_sptr notch_filter_lite_; }; -#endif //GNSS_SDR_NOTCH_FILTER_LITE_H_ +#endif //GNSS_SDR_NOTCH_FILTER_LITE_H_ diff --git a/src/algorithms/input_filter/adapters/pulse_blanking_filter.cc b/src/algorithms/input_filter/adapters/pulse_blanking_filter.cc index 5f92ecf94..d2d5615c1 100644 --- a/src/algorithms/input_filter/adapters/pulse_blanking_filter.cc +++ b/src/algorithms/input_filter/adapters/pulse_blanking_filter.cc @@ -39,16 +39,14 @@ using google::LogMessage; PulseBlankingFilter::PulseBlankingFilter(ConfigurationInterface* configuration, std::string role, - unsigned int in_streams, unsigned int out_streams) : - config_(configuration), role_(role), in_streams_(in_streams), - out_streams_(out_streams) + unsigned int in_streams, unsigned int out_streams) : config_(configuration), role_(role), in_streams_(in_streams), out_streams_(out_streams) { size_t item_size; xlat_ = false; std::string default_input_item_type = "gr_complex"; std::string default_output_item_type = "gr_complex"; std::string default_dump_filename = "../data/input_filter.dat"; - + DLOG(INFO) << "role " << role_; input_item_type_ = config_->property(role_ + ".input_item_type", default_input_item_type); @@ -65,15 +63,15 @@ PulseBlankingFilter::PulseBlankingFilter(ConfigurationInterface* configuration, int n_segments_reset = config_->property(role_ + ".segments_reset", default_n_segments_reset); if (input_item_type_.compare("gr_complex") == 0) { - item_size = sizeof(gr_complex); //output - input_size_ = sizeof(gr_complex); //input + item_size = sizeof(gr_complex); //output + input_size_ = sizeof(gr_complex); //input pulse_blanking_cc_ = make_pulse_blanking_cc(pfa, length_, n_segments_est, n_segments_reset); } else { LOG(ERROR) << " Unknown input filter input/output item type conversion"; - item_size = sizeof(gr_complex); //avoids uninitialization - input_size_ = sizeof(gr_complex); //avoids uninitialization + item_size = sizeof(gr_complex); //avoids uninitialization + input_size_ = sizeof(gr_complex); //avoids uninitialization } double default_if = 0.0; double if_aux = config_->property(role_ + ".if", default_if); @@ -87,7 +85,7 @@ PulseBlankingFilter::PulseBlankingFilter(ConfigurationInterface* configuration, double bw_ = config_->property(role_ + ".bw", default_bw); double default_tw = bw_ / 10.0; double tw_ = config_->property(role_ + ".tw", default_tw); - const std::vector taps = gr::filter::firdes::low_pass(1.0, sampling_freq_, bw_ , tw_); + const std::vector taps = gr::filter::firdes::low_pass(1.0, sampling_freq_, bw_, tw_); freq_xlating_ = gr::filter::freq_xlating_fir_filter_ccf::make(1, taps, if_, sampling_freq_); } if (dump_) @@ -99,10 +97,9 @@ PulseBlankingFilter::PulseBlankingFilter(ConfigurationInterface* configuration, } - PulseBlankingFilter::~PulseBlankingFilter() -{} - +{ +} void PulseBlankingFilter::connect(gr::top_block_sptr top_block) @@ -126,7 +123,6 @@ void PulseBlankingFilter::connect(gr::top_block_sptr top_block) } - void PulseBlankingFilter::disconnect(gr::top_block_sptr top_block) { if (input_item_type_.compare("gr_complex") == 0) diff --git a/src/algorithms/input_filter/adapters/pulse_blanking_filter.h b/src/algorithms/input_filter/adapters/pulse_blanking_filter.h index fb8f82515..c1e521222 100644 --- a/src/algorithms/input_filter/adapters/pulse_blanking_filter.h +++ b/src/algorithms/input_filter/adapters/pulse_blanking_filter.h @@ -40,12 +40,12 @@ class ConfigurationInterface; -class PulseBlankingFilter: public GNSSBlockInterface +class PulseBlankingFilter : public GNSSBlockInterface { public: PulseBlankingFilter(ConfigurationInterface* configuration, - std::string role, unsigned int in_streams, - unsigned int out_streams); + std::string role, unsigned int in_streams, + unsigned int out_streams); virtual ~PulseBlankingFilter(); @@ -86,4 +86,4 @@ private: gr::filter::freq_xlating_fir_filter_ccf::sptr freq_xlating_; }; -#endif // GNSS_SDR_PULSE_BLANKING_FILTER_H_ +#endif // GNSS_SDR_PULSE_BLANKING_FILTER_H_ diff --git a/src/algorithms/input_filter/gnuradio_blocks/beamformer.cc b/src/algorithms/input_filter/gnuradio_blocks/beamformer.cc index 7fa3fc68a..4d0a0c2e5 100644 --- a/src/algorithms/input_filter/gnuradio_blocks/beamformer.cc +++ b/src/algorithms/input_filter/gnuradio_blocks/beamformer.cc @@ -43,17 +43,19 @@ beamformer_sptr make_beamformer() beamformer::beamformer() -: gr::sync_block("beamformer", - gr::io_signature::make(GNSS_SDR_BEAMFORMER_CHANNELS, GNSS_SDR_BEAMFORMER_CHANNELS,sizeof(gr_complex)), - gr::io_signature::make(1, 1,sizeof(gr_complex))) + : gr::sync_block("beamformer", + gr::io_signature::make(GNSS_SDR_BEAMFORMER_CHANNELS, GNSS_SDR_BEAMFORMER_CHANNELS, sizeof(gr_complex)), + gr::io_signature::make(1, 1, sizeof(gr_complex))) { //initialize weight vector - if (posix_memalign((void**)&weight_vector, 16, GNSS_SDR_BEAMFORMER_CHANNELS * sizeof(gr_complex)) == 0){}; - - for (int i = 0; i< GNSS_SDR_BEAMFORMER_CHANNELS; i++) + if (posix_memalign((void **)&weight_vector, 16, GNSS_SDR_BEAMFORMER_CHANNELS * sizeof(gr_complex)) == 0) { - weight_vector[i] = gr_complex(1,0); + }; + + for (int i = 0; i < GNSS_SDR_BEAMFORMER_CHANNELS; i++) + { + weight_vector[i] = gr_complex(1, 0); } } @@ -64,8 +66,8 @@ beamformer::~beamformer() } -int beamformer::work(int noutput_items,gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) +int beamformer::work(int noutput_items, gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items) { gr_complex *out = reinterpret_cast(output_items[0]); // channel output buffers @@ -81,9 +83,9 @@ int beamformer::work(int noutput_items,gr_vector_const_void_star &input_items, // NON-VOLK beamforming operation //TODO: Implement VOLK SIMD-accelerated beamformer! gr_complex sum; - for(int n = 0; n < noutput_items; n++) + for (int n = 0; n < noutput_items; n++) { - sum = gr_complex(0,0); + sum = gr_complex(0, 0); for (int i = 0; i < GNSS_SDR_BEAMFORMER_CHANNELS; i++) { sum = sum + (reinterpret_cast(input_items[i]))[n] * weight_vector[i]; diff --git a/src/algorithms/input_filter/gnuradio_blocks/beamformer.h b/src/algorithms/input_filter/gnuradio_blocks/beamformer.h index 271b9da6f..392d0b94e 100644 --- a/src/algorithms/input_filter/gnuradio_blocks/beamformer.h +++ b/src/algorithms/input_filter/gnuradio_blocks/beamformer.h @@ -41,19 +41,19 @@ beamformer_sptr make_beamformer(); /*! * \brief This class implements a real-time software-defined spatial filter using the CTTC GNSS experimental antenna array input and a set of dynamically reloadable weights */ -class beamformer: public gr::sync_block +class beamformer : public gr::sync_block { private: friend beamformer_sptr make_beamformer_sptr(); - gr_complex* weight_vector; + gr_complex *weight_vector; public: beamformer(); ~beamformer(); - int work (int noutput_items, gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); + int work(int noutput_items, gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items); }; #endif diff --git a/src/algorithms/input_filter/gnuradio_blocks/notch_cc.cc b/src/algorithms/input_filter/gnuradio_blocks/notch_cc.cc index 26dd1f1af..8ada10c1f 100644 --- a/src/algorithms/input_filter/gnuradio_blocks/notch_cc.cc +++ b/src/algorithms/input_filter/gnuradio_blocks/notch_cc.cc @@ -38,36 +38,36 @@ using google::LogMessage; -notch_sptr make_notch_filter(float pfa, float p_c_factor, - int length_, int n_segments_est, int n_segments_reset) +notch_sptr make_notch_filter(float pfa, float p_c_factor, + int length_, int n_segments_est, int n_segments_reset) { return notch_sptr(new Notch(pfa, p_c_factor, length_, n_segments_est, n_segments_reset)); } Notch::Notch(float pfa, float p_c_factor, int length_, int n_segments_est, int n_segments_reset) : gr::block("Notch", - gr::io_signature::make (1, 1, sizeof(gr_complex)), - gr::io_signature::make (1, 1, sizeof(gr_complex))) + gr::io_signature::make(1, 1, sizeof(gr_complex)), + gr::io_signature::make(1, 1, sizeof(gr_complex))) { const int alignment_multiple = volk_get_alignment() / sizeof(gr_complex); set_alignment(std::max(1, alignment_multiple)); set_history(2); this->pfa = pfa; noise_pow_est = 0.0; - this->p_c_factor = gr_complex(p_c_factor , 0); - this->length_ = length_; //Set the number of samples per segment - filter_state_ = false; //Initial state of the filter - n_deg_fred = 2 * length_; //Number of dregrees of freedom - n_segments = 0; - this->n_segments_est = n_segments_est; // Set the number of segments for noise power estimation - this->n_segments_reset = n_segments_reset; // Set the period (in segments) when the noise power is estimated - z_0 = gr_complex(0 , 0); + this->p_c_factor = gr_complex(p_c_factor, 0); + this->length_ = length_; //Set the number of samples per segment + filter_state_ = false; //Initial state of the filter + n_deg_fred = 2 * length_; //Number of dregrees of freedom + n_segments = 0; + this->n_segments_est = n_segments_est; // Set the number of segments for noise power estimation + this->n_segments_reset = n_segments_reset; // Set the period (in segments) when the noise power is estimated + z_0 = gr_complex(0, 0); boost::math::chi_squared_distribution my_dist_(n_deg_fred); thres_ = boost::math::quantile(boost::math::complement(my_dist_, pfa)); c_samples = static_cast(volk_malloc(length_ * sizeof(gr_complex), volk_get_alignment())); angle_ = static_cast(volk_malloc(length_ * sizeof(float), volk_get_alignment())); power_spect = static_cast(volk_malloc(length_ * sizeof(float), volk_get_alignment())); - last_out = gr_complex(0,0); + last_out = gr_complex(0, 0); d_fft = std::unique_ptr(new gr::fft::fft_complex(length_, true)); } @@ -81,49 +81,49 @@ Notch::~Notch() void Notch::forecast(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items_required) { - for(unsigned int aux = 0; aux < ninput_items_required.size(); aux++) + for (unsigned int aux = 0; aux < ninput_items_required.size(); aux++) { ninput_items_required[aux] = length_; } } int Notch::general_work(int noutput_items, gr_vector_int &ninput_items __attribute__((unused)), - gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) + gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { int index_out = 0; float sig2dB = 0.0; float sig2lin = 0.0; lv_32fc_t dot_prod_; - const gr_complex* in = reinterpret_cast(input_items[0]); - gr_complex* out = reinterpret_cast(output_items[0]); + const gr_complex *in = reinterpret_cast(input_items[0]); + gr_complex *out = reinterpret_cast(output_items[0]); in++; - while((index_out + length_) < noutput_items) + while ((index_out + length_) < noutput_items) { - if((n_segments < n_segments_est) && (filter_state_ == false)) + if ((n_segments < n_segments_est) && (filter_state_ == false)) { memcpy(d_fft->get_inbuf(), in, sizeof(gr_complex) * length_); d_fft->execute(); volk_32fc_s32f_power_spectrum_32f(power_spect, d_fft->get_outbuf(), 1.0, length_); volk_32f_s32f_calc_spectral_noise_floor_32f(&sig2dB, power_spect, 15.0, length_); - sig2lin = std::pow(10.0, (sig2dB / 10.0)) / (static_cast(n_deg_fred) ); + sig2lin = std::pow(10.0, (sig2dB / 10.0)) / (static_cast(n_deg_fred)); noise_pow_est = (static_cast(n_segments) * noise_pow_est + sig2lin) / (static_cast(n_segments + 1)); memcpy(out, in, sizeof(gr_complex) * length_); } else { volk_32fc_x2_conjugate_dot_prod_32fc(&dot_prod_, in, in, length_); - if( (lv_creal(dot_prod_) / noise_pow_est) > thres_) + if ((lv_creal(dot_prod_) / noise_pow_est) > thres_) { - if(filter_state_ == false) + if (filter_state_ == false) { filter_state_ = true; - last_out = gr_complex(0,0); + last_out = gr_complex(0, 0); } volk_32fc_x2_multiply_conjugate_32fc(c_samples, in, (in - 1), length_); volk_32fc_s32f_atan2_32f(angle_, c_samples, static_cast(1.0), length_); - for(int aux = 0; aux < length_; aux++) + for (int aux = 0; aux < length_; aux++) { - z_0 = std::exp(gr_complex(0,1) * (*(angle_ + aux))); + z_0 = std::exp(gr_complex(0, 1) * (*(angle_ + aux))); *(out + aux) = *(in + aux) - z_0 * (*(in + aux - 1)) + p_c_factor * z_0 * last_out; last_out = *(out + aux); } diff --git a/src/algorithms/input_filter/gnuradio_blocks/notch_cc.h b/src/algorithms/input_filter/gnuradio_blocks/notch_cc.h index 127acc9d1..b8e0a5880 100644 --- a/src/algorithms/input_filter/gnuradio_blocks/notch_cc.h +++ b/src/algorithms/input_filter/gnuradio_blocks/notch_cc.h @@ -40,8 +40,8 @@ class Notch; typedef boost::shared_ptr notch_sptr; -notch_sptr make_notch_filter(float pfa, float p_c_factor, - int length_, int n_segments_est, int n_segments_reset); +notch_sptr make_notch_filter(float pfa, float p_c_factor, + int length_, int n_segments_est, int n_segments_reset); /*! * \brief This class implements a real-time software-defined multi state notch filter @@ -50,7 +50,6 @@ notch_sptr make_notch_filter(float pfa, float p_c_factor, class Notch : public gr::block { private: - float pfa; float noise_pow_est; float thres_; @@ -63,22 +62,21 @@ private: gr_complex last_out; gr_complex z_0; gr_complex p_c_factor; - gr_complex* c_samples; - float* angle_; - float* power_spect; + gr_complex *c_samples; + float *angle_; + float *power_spect; std::unique_ptr d_fft; - + public: - Notch(float pfa, float p_c_factor, int length_, int n_segments_est, int n_segments_reset); - + ~Notch(); - + void forecast(int noutput_items, gr_vector_int &ninput_items_required); - - int general_work (int noutput_items, gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); + + int general_work(int noutput_items, gr_vector_int &ninput_items, + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items); }; -#endif //GNSS_SDR_NOTCH_H_ +#endif //GNSS_SDR_NOTCH_H_ diff --git a/src/algorithms/input_filter/gnuradio_blocks/notch_lite_cc.cc b/src/algorithms/input_filter/gnuradio_blocks/notch_lite_cc.cc index 091a67a7d..e55cc0e29 100644 --- a/src/algorithms/input_filter/gnuradio_blocks/notch_lite_cc.cc +++ b/src/algorithms/input_filter/gnuradio_blocks/notch_lite_cc.cc @@ -44,13 +44,13 @@ notch_lite_sptr make_notch_filter_lite(float p_c_factor, float pfa, int length_, } NotchLite::NotchLite(float p_c_factor, float pfa, int length_, int n_segments_est, int n_segments_reset, int n_segments_coeff) : gr::block("NotchLite", - gr::io_signature::make (1, 1, sizeof(gr_complex)), - gr::io_signature::make (1, 1, sizeof(gr_complex))) + gr::io_signature::make(1, 1, sizeof(gr_complex)), + gr::io_signature::make(1, 1, sizeof(gr_complex))) { const int alignment_multiple = volk_get_alignment() / sizeof(gr_complex); set_alignment(std::max(1, alignment_multiple)); set_history(2); - this->p_c_factor = gr_complex(p_c_factor , 0); + this->p_c_factor = gr_complex(p_c_factor, 0); this->n_segments_est = n_segments_est; this->n_segments_reset = n_segments_reset; this->n_segments_coeff_reset = n_segments_coeff; @@ -62,7 +62,7 @@ NotchLite::NotchLite(float p_c_factor, float pfa, int length_, int n_segments_es n_deg_fred = 2 * length_; noise_pow_est = 0.0; filter_state_ = false; - z_0 = gr_complex(0 , 0); + z_0 = gr_complex(0, 0); last_out = gr_complex(0, 0); boost::math::chi_squared_distribution my_dist_(n_deg_fred); thres_ = boost::math::quantile(boost::math::complement(my_dist_, pfa)); @@ -81,25 +81,25 @@ NotchLite::~NotchLite() void NotchLite::forecast(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items_required) { - for(unsigned int aux = 0; aux < ninput_items_required.size(); aux++) + for (unsigned int aux = 0; aux < ninput_items_required.size(); aux++) { ninput_items_required[aux] = length_; } } int NotchLite::general_work(int noutput_items, gr_vector_int &ninput_items __attribute__((unused)), - gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) + gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { int index_out = 0; float sig2dB = 0.0; float sig2lin = 0.0; lv_32fc_t dot_prod_; - const gr_complex* in = reinterpret_cast(input_items[0]); - gr_complex* out = reinterpret_cast(output_items[0]); + const gr_complex *in = reinterpret_cast(input_items[0]); + gr_complex *out = reinterpret_cast(output_items[0]); in++; - while((index_out + length_) < noutput_items) + while ((index_out + length_) < noutput_items) { - if((n_segments < n_segments_est) && (filter_state_ == false)) + if ((n_segments < n_segments_est) && (filter_state_ == false)) { memcpy(d_fft->get_inbuf(), in, sizeof(gr_complex) * length_); d_fft->execute(); @@ -112,24 +112,24 @@ int NotchLite::general_work(int noutput_items, gr_vector_int &ninput_items __att else { volk_32fc_x2_conjugate_dot_prod_32fc(&dot_prod_, in, in, length_); - if( (lv_creal(dot_prod_) / noise_pow_est) > thres_) + if ((lv_creal(dot_prod_) / noise_pow_est) > thres_) { - if(filter_state_ == false) + if (filter_state_ == false) { filter_state_ = true; - last_out = gr_complex(0,0); + last_out = gr_complex(0, 0); n_segments_coeff = 0; } - if(n_segments_coeff == 0) + if (n_segments_coeff == 0) { volk_32fc_x2_multiply_conjugate_32fc(&c_samples1, (in + 1), in, 1); volk_32fc_s32f_atan2_32f(&angle1, &c_samples1, static_cast(1.0), 1); volk_32fc_x2_multiply_conjugate_32fc(&c_samples2, (in + length_ - 1), (in + length_ - 2), 1); volk_32fc_s32f_atan2_32f(&angle2, &c_samples2, static_cast(1.0), 1); float angle_ = (angle1 + angle2) / 2.0; - z_0 = std::exp(gr_complex(0,1) * angle_); + z_0 = std::exp(gr_complex(0, 1) * angle_); } - for(int aux = 0; aux < length_; aux++) + for (int aux = 0; aux < length_; aux++) { *(out + aux) = *(in + aux) - z_0 * (*(in + aux - 1)) + p_c_factor * z_0 * last_out; last_out = *(out + aux); diff --git a/src/algorithms/input_filter/gnuradio_blocks/notch_lite_cc.h b/src/algorithms/input_filter/gnuradio_blocks/notch_lite_cc.h index cfe9df491..288dbbf7a 100644 --- a/src/algorithms/input_filter/gnuradio_blocks/notch_lite_cc.h +++ b/src/algorithms/input_filter/gnuradio_blocks/notch_lite_cc.h @@ -49,7 +49,6 @@ notch_lite_sptr make_notch_filter_lite(float p_c_factor, float pfa, int length_, class NotchLite : public gr::block { private: - int length_; int n_segments; int n_segments_est; @@ -68,20 +67,19 @@ private: gr_complex c_samples2; float angle1; float angle2; - float* power_spect; + float *power_spect; std::unique_ptr d_fft; - + public: - NotchLite(float p_c_factor, float pfa, int length_, int n_segments_est, int n_segments_reset, int n_segments_coeff); - + ~NotchLite(); - + void forecast(int noutput_items, gr_vector_int &ninput_items_required); - - int general_work (int noutput_items, gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); + + int general_work(int noutput_items, gr_vector_int &ninput_items, + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items); }; -#endif //GNSS_SDR_NOTCH_LITE_H_ +#endif //GNSS_SDR_NOTCH_LITE_H_ diff --git a/src/algorithms/input_filter/gnuradio_blocks/pulse_blanking_cc.cc b/src/algorithms/input_filter/gnuradio_blocks/pulse_blanking_cc.cc index badcd00d9..1a6a0828e 100644 --- a/src/algorithms/input_filter/gnuradio_blocks/pulse_blanking_cc.cc +++ b/src/algorithms/input_filter/gnuradio_blocks/pulse_blanking_cc.cc @@ -37,16 +37,16 @@ using google::LogMessage; -pulse_blanking_cc_sptr make_pulse_blanking_cc(float pfa, int length_, - int n_segments_est, int n_segments_reset) +pulse_blanking_cc_sptr make_pulse_blanking_cc(float pfa, int length_, + int n_segments_est, int n_segments_reset) { return pulse_blanking_cc_sptr(new pulse_blanking_cc(pfa, length_, n_segments_est, n_segments_reset)); } pulse_blanking_cc::pulse_blanking_cc(float pfa, int length_, int n_segments_est, int n_segments_reset) : gr::block("pulse_blanking_cc", - gr::io_signature::make (1, 1, sizeof(gr_complex)), - gr::io_signature::make (1, 1, sizeof(gr_complex))) + gr::io_signature::make(1, 1, sizeof(gr_complex)), + gr::io_signature::make(1, 1, sizeof(gr_complex))) { const int alignment_multiple = volk_get_alignment() / sizeof(gr_complex); set_alignment(std::max(1, alignment_multiple)); @@ -70,37 +70,37 @@ pulse_blanking_cc::pulse_blanking_cc(float pfa, int length_, int n_segments_est, pulse_blanking_cc::~pulse_blanking_cc() { - volk_free(zeros_); + volk_free(zeros_); } void pulse_blanking_cc::forecast(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items_required) { - for(unsigned int aux=0; aux < ninput_items_required.size(); aux++) + for (unsigned int aux = 0; aux < ninput_items_required.size(); aux++) { ninput_items_required[aux] = length_; } } -int pulse_blanking_cc::general_work (int noutput_items, gr_vector_int &ninput_items __attribute__((unused)), - gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) +int pulse_blanking_cc::general_work(int noutput_items, gr_vector_int &ninput_items __attribute__((unused)), + gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { - const gr_complex* in = reinterpret_cast(input_items[0]); - gr_complex* out = reinterpret_cast(output_items[0]); - float* magnitude = static_cast(volk_malloc(noutput_items * sizeof(float), volk_get_alignment())); + const gr_complex *in = reinterpret_cast(input_items[0]); + gr_complex *out = reinterpret_cast(output_items[0]); + float *magnitude = static_cast(volk_malloc(noutput_items * sizeof(float), volk_get_alignment())); volk_32fc_magnitude_squared_32f(magnitude, in, noutput_items); int sample_index = 0; float segment_energy; - while((sample_index + length_) < noutput_items) + while ((sample_index + length_) < noutput_items) { volk_32f_accumulator_s32f(&segment_energy, (magnitude + sample_index), length_); - if((n_segments < n_segments_est) && (last_filtered == false)) + if ((n_segments < n_segments_est) && (last_filtered == false)) { - noise_power_estimation = ( static_cast(n_segments) * noise_power_estimation + segment_energy / static_cast(n_deg_fred) ) / static_cast(n_segments + 1); + noise_power_estimation = (static_cast(n_segments) * noise_power_estimation + segment_energy / static_cast(n_deg_fred)) / static_cast(n_segments + 1); memcpy(out, in, sizeof(gr_complex) * length_); } else { - if((segment_energy / noise_power_estimation) > thres_) + if ((segment_energy / noise_power_estimation) > thres_) { memcpy(out, zeros_, sizeof(gr_complex) * length_); last_filtered = true; @@ -122,5 +122,5 @@ int pulse_blanking_cc::general_work (int noutput_items, gr_vector_int &ninput_it } volk_free(magnitude); consume_each(sample_index); - return sample_index; + return sample_index; } diff --git a/src/algorithms/input_filter/gnuradio_blocks/pulse_blanking_cc.h b/src/algorithms/input_filter/gnuradio_blocks/pulse_blanking_cc.h index b149bc72e..32f6eaf27 100644 --- a/src/algorithms/input_filter/gnuradio_blocks/pulse_blanking_cc.h +++ b/src/algorithms/input_filter/gnuradio_blocks/pulse_blanking_cc.h @@ -44,7 +44,6 @@ pulse_blanking_cc_sptr make_pulse_blanking_cc(float pfa, int length_, int n_segm class pulse_blanking_cc : public gr::block { private: - int length_; int n_segments; int n_segments_est; @@ -54,19 +53,17 @@ private: float noise_power_estimation; float thres_; float pfa; - gr_complex* zeros_; - + gr_complex *zeros_; + public: - pulse_blanking_cc(float pfa, int length_, int n_segments_est, int n_segments_reset); - + ~pulse_blanking_cc(); - int general_work (int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), - gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); - + int general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), + gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); + void forecast(int noutput_items, gr_vector_int &ninput_items_required); - }; #endif diff --git a/src/algorithms/libs/CMakeLists.txt b/src/algorithms/libs/CMakeLists.txt index ef0471f16..65e2c96b2 100644 --- a/src/algorithms/libs/CMakeLists.txt +++ b/src/algorithms/libs/CMakeLists.txt @@ -41,9 +41,9 @@ set(GNSS_SPLIBS_SOURCES if(OPENCL_FOUND) set(GNSS_SPLIBS_SOURCES ${GNSS_SPLIBS_SOURCES} - fft_execute.cc # Needs OpenCL - fft_setup.cc # Needs OpenCL - fft_kernelstring.cc # Needs OpenCL + opencl/fft_execute.cc # Needs OpenCL + opencl/fft_setup.cc # Needs OpenCL + opencl/fft_kernelstring.cc # Needs OpenCL ) endif(OPENCL_FOUND) diff --git a/src/algorithms/libs/byte_x2_to_complex_byte.cc b/src/algorithms/libs/byte_x2_to_complex_byte.cc index 2b289cac5..d93b6ebef 100644 --- a/src/algorithms/libs/byte_x2_to_complex_byte.cc +++ b/src/algorithms/libs/byte_x2_to_complex_byte.cc @@ -40,10 +40,9 @@ byte_x2_to_complex_byte_sptr make_byte_x2_to_complex_byte() } - byte_x2_to_complex_byte::byte_x2_to_complex_byte() : sync_block("byte_x2_to_complex_byte", - gr::io_signature::make (2, 2, sizeof(int8_t)), // int8_t, defined in stdint.h and included in volk.h (signed char) - gr::io_signature::make (1, 1, sizeof(lv_8sc_t))) // lv_8sc_t is a Volk's typedef for std::complex + gr::io_signature::make(2, 2, sizeof(int8_t)), // int8_t, defined in stdint.h and included in volk.h (signed char) + gr::io_signature::make(1, 1, sizeof(lv_8sc_t))) // lv_8sc_t is a Volk's typedef for std::complex { const int alignment_multiple = volk_get_alignment() / sizeof(lv_8sc_t); set_alignment(std::max(1, alignment_multiple)); @@ -51,8 +50,8 @@ byte_x2_to_complex_byte::byte_x2_to_complex_byte() : sync_block("byte_x2_to_comp int byte_x2_to_complex_byte::work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items) { const int8_t *in0 = reinterpret_cast(input_items[0]); const int8_t *in1 = reinterpret_cast(input_items[1]); @@ -60,7 +59,7 @@ int byte_x2_to_complex_byte::work(int noutput_items, // This could be put into a volk kernel int8_t real_part; int8_t imag_part; - for(int number = 0; number < noutput_items; number++) + for (int number = 0; number < noutput_items; number++) { // lv_cmake(r, i) defined at volk/volk_complex.h real_part = *in0++; diff --git a/src/algorithms/libs/byte_x2_to_complex_byte.h b/src/algorithms/libs/byte_x2_to_complex_byte.h index a46f4c544..50d43c07c 100644 --- a/src/algorithms/libs/byte_x2_to_complex_byte.h +++ b/src/algorithms/libs/byte_x2_to_complex_byte.h @@ -49,12 +49,13 @@ class byte_x2_to_complex_byte : public gr::sync_block { private: friend byte_x2_to_complex_byte_sptr make_byte_x2_to_complex_byte(); + public: byte_x2_to_complex_byte(); int work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items); }; #endif diff --git a/src/algorithms/libs/complex_byte_to_float_x2.cc b/src/algorithms/libs/complex_byte_to_float_x2.cc index 014b330f3..0ca929627 100644 --- a/src/algorithms/libs/complex_byte_to_float_x2.cc +++ b/src/algorithms/libs/complex_byte_to_float_x2.cc @@ -40,10 +40,9 @@ complex_byte_to_float_x2_sptr make_complex_byte_to_float_x2() } - complex_byte_to_float_x2::complex_byte_to_float_x2() : sync_block("complex_byte_to_float_x2", - gr::io_signature::make (1, 1, sizeof(lv_8sc_t)), // lv_8sc_t is a Volk's typedef for std::complex - gr::io_signature::make (2, 2, sizeof(float))) + gr::io_signature::make(1, 1, sizeof(lv_8sc_t)), // lv_8sc_t is a Volk's typedef for std::complex + gr::io_signature::make(2, 2, sizeof(float))) { const int alignment_multiple = volk_get_alignment() / sizeof(float); set_alignment(std::max(1, alignment_multiple)); @@ -51,8 +50,8 @@ complex_byte_to_float_x2::complex_byte_to_float_x2() : sync_block("complex_byte_ int complex_byte_to_float_x2::work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items) { const lv_8sc_t *in = reinterpret_cast(input_items[0]); float *out0 = reinterpret_cast(output_items[0]); diff --git a/src/algorithms/libs/complex_byte_to_float_x2.h b/src/algorithms/libs/complex_byte_to_float_x2.h index 6883f7d39..bc8003d7d 100644 --- a/src/algorithms/libs/complex_byte_to_float_x2.h +++ b/src/algorithms/libs/complex_byte_to_float_x2.h @@ -49,12 +49,13 @@ class complex_byte_to_float_x2 : public gr::sync_block { private: friend complex_byte_to_float_x2_sptr make_complex_byte_to_float_x2(); + public: complex_byte_to_float_x2(); int work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items); }; #endif diff --git a/src/algorithms/libs/complex_float_to_complex_byte.cc b/src/algorithms/libs/complex_float_to_complex_byte.cc index fc26ead1a..e7256f792 100644 --- a/src/algorithms/libs/complex_float_to_complex_byte.cc +++ b/src/algorithms/libs/complex_float_to_complex_byte.cc @@ -40,10 +40,9 @@ complex_float_to_complex_byte_sptr make_complex_float_to_complex_byte() } - complex_float_to_complex_byte::complex_float_to_complex_byte() : sync_block("complex_float_to_complex_byte", - gr::io_signature::make (1, 1, sizeof(gr_complex)), - gr::io_signature::make (1, 1, sizeof(lv_8sc_t))) // lv_8sc_t is a Volk's typedef for std::complex + gr::io_signature::make(1, 1, sizeof(gr_complex)), + gr::io_signature::make(1, 1, sizeof(lv_8sc_t))) // lv_8sc_t is a Volk's typedef for std::complex { const int alignment_multiple = volk_gnsssdr_get_alignment() / sizeof(lv_8sc_t); set_alignment(std::max(1, alignment_multiple)); @@ -51,11 +50,11 @@ complex_float_to_complex_byte::complex_float_to_complex_byte() : sync_block("com int complex_float_to_complex_byte::work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items) { const gr_complex *in = reinterpret_cast(input_items[0]); - lv_8sc_t *out = reinterpret_cast(output_items[0]); + lv_8sc_t *out = reinterpret_cast(output_items[0]); volk_gnsssdr_32fc_convert_8ic(out, in, noutput_items); return noutput_items; } diff --git a/src/algorithms/libs/complex_float_to_complex_byte.h b/src/algorithms/libs/complex_float_to_complex_byte.h index 50f50564b..d8205b9e9 100644 --- a/src/algorithms/libs/complex_float_to_complex_byte.h +++ b/src/algorithms/libs/complex_float_to_complex_byte.h @@ -47,12 +47,13 @@ class complex_float_to_complex_byte : public gr::sync_block { private: friend complex_float_to_complex_byte_sptr make_complex_float_to_complex_byte(); + public: complex_float_to_complex_byte(); int work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items); }; #endif diff --git a/src/algorithms/libs/conjugate_cc.cc b/src/algorithms/libs/conjugate_cc.cc index c216d3ece..a439d1822 100644 --- a/src/algorithms/libs/conjugate_cc.cc +++ b/src/algorithms/libs/conjugate_cc.cc @@ -40,8 +40,8 @@ conjugate_cc_sptr make_conjugate_cc() conjugate_cc::conjugate_cc() : gr::sync_block("conjugate_cc", - gr::io_signature::make (1, 1, sizeof(gr_complex)), - gr::io_signature::make (1, 1, sizeof(gr_complex))) + gr::io_signature::make(1, 1, sizeof(gr_complex)), + gr::io_signature::make(1, 1, sizeof(gr_complex))) { const int alignment_multiple = volk_get_alignment() / sizeof(gr_complex); set_alignment(std::max(1, alignment_multiple)); @@ -49,8 +49,8 @@ conjugate_cc::conjugate_cc() : gr::sync_block("conjugate_cc", int conjugate_cc::work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items) { const gr_complex *in = reinterpret_cast(input_items[0]); gr_complex *out = reinterpret_cast(output_items[0]); diff --git a/src/algorithms/libs/conjugate_cc.h b/src/algorithms/libs/conjugate_cc.h index 55466a0d1..7f13c46de 100644 --- a/src/algorithms/libs/conjugate_cc.h +++ b/src/algorithms/libs/conjugate_cc.h @@ -48,12 +48,13 @@ class conjugate_cc : public gr::sync_block { private: friend conjugate_cc_sptr make_conjugate_cc(); + public: conjugate_cc(); int work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items); }; #endif diff --git a/src/algorithms/libs/conjugate_ic.cc b/src/algorithms/libs/conjugate_ic.cc index 29fa1744e..42ab9d8a9 100644 --- a/src/algorithms/libs/conjugate_ic.cc +++ b/src/algorithms/libs/conjugate_ic.cc @@ -40,8 +40,8 @@ conjugate_ic_sptr make_conjugate_ic() conjugate_ic::conjugate_ic() : gr::sync_block("conjugate_ic", - gr::io_signature::make (1, 1, sizeof(lv_8sc_t)), - gr::io_signature::make (1, 1, sizeof(lv_8sc_t))) + gr::io_signature::make(1, 1, sizeof(lv_8sc_t)), + gr::io_signature::make(1, 1, sizeof(lv_8sc_t))) { const int alignment_multiple = volk_gnsssdr_get_alignment() / sizeof(lv_8sc_t); set_alignment(std::max(1, alignment_multiple)); @@ -49,8 +49,8 @@ conjugate_ic::conjugate_ic() : gr::sync_block("conjugate_ic", int conjugate_ic::work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items) { const lv_8sc_t *in = reinterpret_cast(input_items[0]); lv_8sc_t *out = reinterpret_cast(output_items[0]); diff --git a/src/algorithms/libs/conjugate_ic.h b/src/algorithms/libs/conjugate_ic.h index efec8e2f8..472d68cd7 100644 --- a/src/algorithms/libs/conjugate_ic.h +++ b/src/algorithms/libs/conjugate_ic.h @@ -48,12 +48,13 @@ class conjugate_ic : public gr::sync_block { private: friend conjugate_ic_sptr make_conjugate_ic(); + public: conjugate_ic(); int work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items); }; #endif diff --git a/src/algorithms/libs/conjugate_sc.cc b/src/algorithms/libs/conjugate_sc.cc index 2ea5aeef7..2e5c1cb4e 100644 --- a/src/algorithms/libs/conjugate_sc.cc +++ b/src/algorithms/libs/conjugate_sc.cc @@ -40,8 +40,8 @@ conjugate_sc_sptr make_conjugate_sc() conjugate_sc::conjugate_sc() : gr::sync_block("conjugate_sc", - gr::io_signature::make (1, 1, sizeof(lv_16sc_t)), - gr::io_signature::make (1, 1, sizeof(lv_16sc_t))) + gr::io_signature::make(1, 1, sizeof(lv_16sc_t)), + gr::io_signature::make(1, 1, sizeof(lv_16sc_t))) { const int alignment_multiple = volk_gnsssdr_get_alignment() / sizeof(lv_16sc_t); set_alignment(std::max(1, alignment_multiple)); @@ -49,8 +49,8 @@ conjugate_sc::conjugate_sc() : gr::sync_block("conjugate_sc", int conjugate_sc::work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items) { const lv_16sc_t *in = reinterpret_cast(input_items[0]); lv_16sc_t *out = reinterpret_cast(output_items[0]); diff --git a/src/algorithms/libs/conjugate_sc.h b/src/algorithms/libs/conjugate_sc.h index 3b424f4cc..3b85c9385 100644 --- a/src/algorithms/libs/conjugate_sc.h +++ b/src/algorithms/libs/conjugate_sc.h @@ -48,12 +48,13 @@ class conjugate_sc : public gr::sync_block { private: friend conjugate_sc_sptr make_conjugate_sc(); + public: conjugate_sc(); int work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items); }; #endif diff --git a/src/algorithms/libs/cshort_to_float_x2.cc b/src/algorithms/libs/cshort_to_float_x2.cc index 50b2f3d4b..c328af8bc 100644 --- a/src/algorithms/libs/cshort_to_float_x2.cc +++ b/src/algorithms/libs/cshort_to_float_x2.cc @@ -40,10 +40,9 @@ cshort_to_float_x2_sptr make_cshort_to_float_x2() } - cshort_to_float_x2::cshort_to_float_x2() : sync_block("cshort_to_float_x2", - gr::io_signature::make (1, 1, sizeof(lv_16sc_t)), // lv_8sc_t is a Volk's typedef for std::complex - gr::io_signature::make (2, 2, sizeof(float))) + gr::io_signature::make(1, 1, sizeof(lv_16sc_t)), // lv_8sc_t is a Volk's typedef for std::complex + gr::io_signature::make(2, 2, sizeof(float))) { const int alignment_multiple = volk_get_alignment() / sizeof(lv_16sc_t); set_alignment(std::max(1, alignment_multiple)); @@ -51,8 +50,8 @@ cshort_to_float_x2::cshort_to_float_x2() : sync_block("cshort_to_float_x2", int cshort_to_float_x2::work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items) { const lv_16sc_t *in = reinterpret_cast(input_items[0]); float *out0 = reinterpret_cast(output_items[0]); diff --git a/src/algorithms/libs/cshort_to_float_x2.h b/src/algorithms/libs/cshort_to_float_x2.h index c15662ed8..6a59dcc8f 100644 --- a/src/algorithms/libs/cshort_to_float_x2.h +++ b/src/algorithms/libs/cshort_to_float_x2.h @@ -49,12 +49,13 @@ class cshort_to_float_x2 : public gr::sync_block { private: friend cshort_to_float_x2_sptr make_cshort_to_float_x2(); + public: cshort_to_float_x2(); int work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items); }; #endif diff --git a/src/algorithms/libs/fft_base_kernels.h b/src/algorithms/libs/fft_base_kernels.h deleted file mode 100644 index 101795697..000000000 --- a/src/algorithms/libs/fft_base_kernels.h +++ /dev/null @@ -1,277 +0,0 @@ - -// -// File: fft_base_kernels.h -// -// Version: <1.0> -// -// Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Inc. ("Apple") -// in consideration of your agreement to the following terms, and your use, -// installation, modification or redistribution of this Apple software -// constitutes acceptance of these terms. If you do not agree with these -// terms, please do not use, install, modify or redistribute this Apple -// software. -// -// In consideration of your agreement to abide by the following terms, and -// subject to these terms, Apple grants you a personal, non - exclusive -// license, under Apple's copyrights in this original Apple software ( the -// "Apple Software" ), to use, reproduce, modify and redistribute the Apple -// Software, with or without modifications, in source and / or binary forms; -// provided that if you redistribute the Apple Software in its entirety and -// without modifications, you must retain this notice and the following text -// and disclaimers in all such redistributions of the Apple Software. Neither -// the name, trademarks, service marks or logos of Apple Inc. may be used to -// endorse or promote products derived from the Apple Software without specific -// prior written permission from Apple. Except as expressly stated in this -// notice, no other rights or licenses, express or implied, are granted by -// Apple herein, including but not limited to any patent rights that may be -// infringed by your derivative works or by other works in which the Apple -// Software may be incorporated. -// -// The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO -// WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED -// WARRANTIES OF NON - INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A -// PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION -// ALONE OR IN COMBINATION WITH YOUR PRODUCTS. -// -// IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR -// CONSEQUENTIAL DAMAGES ( INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -// INTERRUPTION ) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION -// AND / OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER -// UNDER THEORY OF CONTRACT, TORT ( INCLUDING NEGLIGENCE ), STRICT LIABILITY OR -// OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Copyright ( C ) 2008 Apple Inc. All Rights Reserved. -// -//////////////////////////////////////////////////////////////////////////////////////////////////// - - -#ifndef __CL_FFT_BASE_KERNELS_ -#define __CL_FFT_BASE_KERNELS_ - -#include - -using namespace std; - -static string baseKernels = string( - "#ifndef M_PI\n" - "#define M_PI 0x1.921fb54442d18p+1\n" - "#endif\n" - "#define complexMul(a,b) ((float2)(mad(-(a).y, (b).y, (a).x * (b).x), mad((a).y, (b).x, (a).x * (b).y)))\n" - "#define conj(a) ((float2)((a).x, -(a).y))\n" - "#define conjTransp(a) ((float2)(-(a).y, (a).x))\n" - "\n" - "#define fftKernel2(a,dir) \\\n" - "{ \\\n" - " float2 c = (a)[0]; \\\n" - " (a)[0] = c + (a)[1]; \\\n" - " (a)[1] = c - (a)[1]; \\\n" - "}\n" - "\n" - "#define fftKernel2S(d1,d2,dir) \\\n" - "{ \\\n" - " float2 c = (d1); \\\n" - " (d1) = c + (d2); \\\n" - " (d2) = c - (d2); \\\n" - "}\n" - "\n" - "#define fftKernel4(a,dir) \\\n" - "{ \\\n" - " fftKernel2S((a)[0], (a)[2], dir); \\\n" - " fftKernel2S((a)[1], (a)[3], dir); \\\n" - " fftKernel2S((a)[0], (a)[1], dir); \\\n" - " (a)[3] = (float2)(dir)*(conjTransp((a)[3])); \\\n" - " fftKernel2S((a)[2], (a)[3], dir); \\\n" - " float2 c = (a)[1]; \\\n" - " (a)[1] = (a)[2]; \\\n" - " (a)[2] = c; \\\n" - "}\n" - "\n" - "#define fftKernel4s(a0,a1,a2,a3,dir) \\\n" - "{ \\\n" - " fftKernel2S((a0), (a2), dir); \\\n" - " fftKernel2S((a1), (a3), dir); \\\n" - " fftKernel2S((a0), (a1), dir); \\\n" - " (a3) = (float2)(dir)*(conjTransp((a3))); \\\n" - " fftKernel2S((a2), (a3), dir); \\\n" - " float2 c = (a1); \\\n" - " (a1) = (a2); \\\n" - " (a2) = c; \\\n" - "}\n" - "\n" - "#define bitreverse8(a) \\\n" - "{ \\\n" - " float2 c; \\\n" - " c = (a)[1]; \\\n" - " (a)[1] = (a)[4]; \\\n" - " (a)[4] = c; \\\n" - " c = (a)[3]; \\\n" - " (a)[3] = (a)[6]; \\\n" - " (a)[6] = c; \\\n" - "}\n" - "\n" - "#define fftKernel8(a,dir) \\\n" - "{ \\\n" - " const float2 w1 = (float2)(0x1.6a09e6p-1f, dir*0x1.6a09e6p-1f); \\\n" - " const float2 w3 = (float2)(-0x1.6a09e6p-1f, dir*0x1.6a09e6p-1f); \\\n" - " float2 c; \\\n" - " fftKernel2S((a)[0], (a)[4], dir); \\\n" - " fftKernel2S((a)[1], (a)[5], dir); \\\n" - " fftKernel2S((a)[2], (a)[6], dir); \\\n" - " fftKernel2S((a)[3], (a)[7], dir); \\\n" - " (a)[5] = complexMul(w1, (a)[5]); \\\n" - " (a)[6] = (float2)(dir)*(conjTransp((a)[6])); \\\n" - " (a)[7] = complexMul(w3, (a)[7]); \\\n" - " fftKernel2S((a)[0], (a)[2], dir); \\\n" - " fftKernel2S((a)[1], (a)[3], dir); \\\n" - " fftKernel2S((a)[4], (a)[6], dir); \\\n" - " fftKernel2S((a)[5], (a)[7], dir); \\\n" - " (a)[3] = (float2)(dir)*(conjTransp((a)[3])); \\\n" - " (a)[7] = (float2)(dir)*(conjTransp((a)[7])); \\\n" - " fftKernel2S((a)[0], (a)[1], dir); \\\n" - " fftKernel2S((a)[2], (a)[3], dir); \\\n" - " fftKernel2S((a)[4], (a)[5], dir); \\\n" - " fftKernel2S((a)[6], (a)[7], dir); \\\n" - " bitreverse8((a)); \\\n" - "}\n" - "\n" - "#define bitreverse4x4(a) \\\n" - "{ \\\n" - " float2 c; \\\n" - " c = (a)[1]; (a)[1] = (a)[4]; (a)[4] = c; \\\n" - " c = (a)[2]; (a)[2] = (a)[8]; (a)[8] = c; \\\n" - " c = (a)[3]; (a)[3] = (a)[12]; (a)[12] = c; \\\n" - " c = (a)[6]; (a)[6] = (a)[9]; (a)[9] = c; \\\n" - " c = (a)[7]; (a)[7] = (a)[13]; (a)[13] = c; \\\n" - " c = (a)[11]; (a)[11] = (a)[14]; (a)[14] = c; \\\n" - "}\n" - "\n" - "#define fftKernel16(a,dir) \\\n" - "{ \\\n" - " const float w0 = 0x1.d906bcp-1f; \\\n" - " const float w1 = 0x1.87de2ap-2f; \\\n" - " const float w2 = 0x1.6a09e6p-1f; \\\n" - " fftKernel4s((a)[0], (a)[4], (a)[8], (a)[12], dir); \\\n" - " fftKernel4s((a)[1], (a)[5], (a)[9], (a)[13], dir); \\\n" - " fftKernel4s((a)[2], (a)[6], (a)[10], (a)[14], dir); \\\n" - " fftKernel4s((a)[3], (a)[7], (a)[11], (a)[15], dir); \\\n" - " (a)[5] = complexMul((a)[5], (float2)(w0, dir*w1)); \\\n" - " (a)[6] = complexMul((a)[6], (float2)(w2, dir*w2)); \\\n" - " (a)[7] = complexMul((a)[7], (float2)(w1, dir*w0)); \\\n" - " (a)[9] = complexMul((a)[9], (float2)(w2, dir*w2)); \\\n" - " (a)[10] = (float2)(dir)*(conjTransp((a)[10])); \\\n" - " (a)[11] = complexMul((a)[11], (float2)(-w2, dir*w2)); \\\n" - " (a)[13] = complexMul((a)[13], (float2)(w1, dir*w0)); \\\n" - " (a)[14] = complexMul((a)[14], (float2)(-w2, dir*w2)); \\\n" - " (a)[15] = complexMul((a)[15], (float2)(-w0, dir*-w1)); \\\n" - " fftKernel4((a), dir); \\\n" - " fftKernel4((a) + 4, dir); \\\n" - " fftKernel4((a) + 8, dir); \\\n" - " fftKernel4((a) + 12, dir); \\\n" - " bitreverse4x4((a)); \\\n" - "}\n" - "\n" - "#define bitreverse32(a) \\\n" - "{ \\\n" - " float2 c1, c2; \\\n" - " c1 = (a)[2]; (a)[2] = (a)[1]; c2 = (a)[4]; (a)[4] = c1; c1 = (a)[8]; (a)[8] = c2; c2 = (a)[16]; (a)[16] = c1; (a)[1] = c2; \\\n" - " c1 = (a)[6]; (a)[6] = (a)[3]; c2 = (a)[12]; (a)[12] = c1; c1 = (a)[24]; (a)[24] = c2; c2 = (a)[17]; (a)[17] = c1; (a)[3] = c2; \\\n" - " c1 = (a)[10]; (a)[10] = (a)[5]; c2 = (a)[20]; (a)[20] = c1; c1 = (a)[9]; (a)[9] = c2; c2 = (a)[18]; (a)[18] = c1; (a)[5] = c2; \\\n" - " c1 = (a)[14]; (a)[14] = (a)[7]; c2 = (a)[28]; (a)[28] = c1; c1 = (a)[25]; (a)[25] = c2; c2 = (a)[19]; (a)[19] = c1; (a)[7] = c2; \\\n" - " c1 = (a)[22]; (a)[22] = (a)[11]; c2 = (a)[13]; (a)[13] = c1; c1 = (a)[26]; (a)[26] = c2; c2 = (a)[21]; (a)[21] = c1; (a)[11] = c2; \\\n" - " c1 = (a)[30]; (a)[30] = (a)[15]; c2 = (a)[29]; (a)[29] = c1; c1 = (a)[27]; (a)[27] = c2; c2 = (a)[23]; (a)[23] = c1; (a)[15] = c2; \\\n" - "}\n" - "\n" - "#define fftKernel32(a,dir) \\\n" - "{ \\\n" - " fftKernel2S((a)[0], (a)[16], dir); \\\n" - " fftKernel2S((a)[1], (a)[17], dir); \\\n" - " fftKernel2S((a)[2], (a)[18], dir); \\\n" - " fftKernel2S((a)[3], (a)[19], dir); \\\n" - " fftKernel2S((a)[4], (a)[20], dir); \\\n" - " fftKernel2S((a)[5], (a)[21], dir); \\\n" - " fftKernel2S((a)[6], (a)[22], dir); \\\n" - " fftKernel2S((a)[7], (a)[23], dir); \\\n" - " fftKernel2S((a)[8], (a)[24], dir); \\\n" - " fftKernel2S((a)[9], (a)[25], dir); \\\n" - " fftKernel2S((a)[10], (a)[26], dir); \\\n" - " fftKernel2S((a)[11], (a)[27], dir); \\\n" - " fftKernel2S((a)[12], (a)[28], dir); \\\n" - " fftKernel2S((a)[13], (a)[29], dir); \\\n" - " fftKernel2S((a)[14], (a)[30], dir); \\\n" - " fftKernel2S((a)[15], (a)[31], dir); \\\n" - " (a)[17] = complexMul((a)[17], (float2)(0x1.f6297cp-1f, dir*0x1.8f8b84p-3f)); \\\n" - " (a)[18] = complexMul((a)[18], (float2)(0x1.d906bcp-1f, dir*0x1.87de2ap-2f)); \\\n" - " (a)[19] = complexMul((a)[19], (float2)(0x1.a9b662p-1f, dir*0x1.1c73b4p-1f)); \\\n" - " (a)[20] = complexMul((a)[20], (float2)(0x1.6a09e6p-1f, dir*0x1.6a09e6p-1f)); \\\n" - " (a)[21] = complexMul((a)[21], (float2)(0x1.1c73b4p-1f, dir*0x1.a9b662p-1f)); \\\n" - " (a)[22] = complexMul((a)[22], (float2)(0x1.87de2ap-2f, dir*0x1.d906bcp-1f)); \\\n" - " (a)[23] = complexMul((a)[23], (float2)(0x1.8f8b84p-3f, dir*0x1.f6297cp-1f)); \\\n" - " (a)[24] = complexMul((a)[24], (float2)(0x0p+0f, dir*0x1p+0f)); \\\n" - " (a)[25] = complexMul((a)[25], (float2)(-0x1.8f8b84p-3f, dir*0x1.f6297cp-1f)); \\\n" - " (a)[26] = complexMul((a)[26], (float2)(-0x1.87de2ap-2f, dir*0x1.d906bcp-1f)); \\\n" - " (a)[27] = complexMul((a)[27], (float2)(-0x1.1c73b4p-1f, dir*0x1.a9b662p-1f)); \\\n" - " (a)[28] = complexMul((a)[28], (float2)(-0x1.6a09e6p-1f, dir*0x1.6a09e6p-1f)); \\\n" - " (a)[29] = complexMul((a)[29], (float2)(-0x1.a9b662p-1f, dir*0x1.1c73b4p-1f)); \\\n" - " (a)[30] = complexMul((a)[30], (float2)(-0x1.d906bcp-1f, dir*0x1.87de2ap-2f)); \\\n" - " (a)[31] = complexMul((a)[31], (float2)(-0x1.f6297cp-1f, dir*0x1.8f8b84p-3f)); \\\n" - " fftKernel16((a), dir); \\\n" - " fftKernel16((a) + 16, dir); \\\n" - " bitreverse32((a)); \\\n" - "}\n\n" - ); - -static string twistKernelInterleaved = string( - "__kernel void \\\n" - "clFFT_1DTwistInterleaved(__global float2 *in, unsigned int startRow, unsigned int numCols, unsigned int N, unsigned int numRowsToProcess, int dir) \\\n" - "{ \\\n" - " float2 a, w; \\\n" - " float ang; \\\n" - " unsigned int j; \\\n" - " unsigned int i = get_global_id(0); \\\n" - " unsigned int startIndex = i; \\\n" - " \\\n" - " if(i < numCols) \\\n" - " { \\\n" - " for(j = 0; j < numRowsToProcess; j++) \\\n" - " { \\\n" - " a = in[startIndex]; \\\n" - " ang = 2.0f * M_PI * dir * i * (startRow + j) / N; \\\n" - " w = (float2)(native_cos(ang), native_sin(ang)); \\\n" - " a = complexMul(a, w); \\\n" - " in[startIndex] = a; \\\n" - " startIndex += numCols; \\\n" - " } \\\n" - " } \\\n" - "} \\\n" - ); - -static string twistKernelPlannar = string( - "__kernel void \\\n" - "clFFT_1DTwistSplit(__global float *in_real, __global float *in_imag , unsigned int startRow, unsigned int numCols, unsigned int N, unsigned int numRowsToProcess, int dir) \\\n" - "{ \\\n" - " float2 a, w; \\\n" - " float ang; \\\n" - " unsigned int j; \\\n" - " unsigned int i = get_global_id(0); \\\n" - " unsigned int startIndex = i; \\\n" - " \\\n" - " if(i < numCols) \\\n" - " { \\\n" - " for(j = 0; j < numRowsToProcess; j++) \\\n" - " { \\\n" - " a = (float2)(in_real[startIndex], in_imag[startIndex]); \\\n" - " ang = 2.0f * M_PI * dir * i * (startRow + j) / N; \\\n" - " w = (float2)(native_cos(ang), native_sin(ang)); \\\n" - " a = complexMul(a, w); \\\n" - " in_real[startIndex] = a.x; \\\n" - " in_imag[startIndex] = a.y; \\\n" - " startIndex += numCols; \\\n" - " } \\\n" - " } \\\n" - "} \\\n" - ); - - - -#endif diff --git a/src/algorithms/libs/fft_execute.cc b/src/algorithms/libs/fft_execute.cc deleted file mode 100644 index 6416e163e..000000000 --- a/src/algorithms/libs/fft_execute.cc +++ /dev/null @@ -1,405 +0,0 @@ - -// -// File: fft_execute.cpp -// -// Version: <1.0> -// -// Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Inc. ("Apple") -// in consideration of your agreement to the following terms, and your use, -// installation, modification or redistribution of this Apple software -// constitutes acceptance of these terms. If you do not agree with these -// terms, please do not use, install, modify or redistribute this Apple -// software.¬ -// -// In consideration of your agreement to abide by the following terms, and -// subject to these terms, Apple grants you a personal, non - exclusive -// license, under Apple's copyrights in this original Apple software ( the -// "Apple Software" ), to use, reproduce, modify and redistribute the Apple -// Software, with or without modifications, in source and / or binary forms; -// provided that if you redistribute the Apple Software in its entirety and -// without modifications, you must retain this notice and the following text -// and disclaimers in all such redistributions of the Apple Software. Neither -// the name, trademarks, service marks or logos of Apple Inc. may be used to -// endorse or promote products derived from the Apple Software without specific -// prior written permission from Apple. Except as expressly stated in this -// notice, no other rights or licenses, express or implied, are granted by -// Apple herein, including but not limited to any patent rights that may be -// infringed by your derivative works or by other works in which the Apple -// Software may be incorporated. -// -// The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO -// WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED -// WARRANTIES OF NON - INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A -// PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION -// ALONE OR IN COMBINATION WITH YOUR PRODUCTS. -// -// IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR -// CONSEQUENTIAL DAMAGES ( INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -// INTERRUPTION ) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION -// AND / OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER -// UNDER THEORY OF CONTRACT, TORT ( INCLUDING NEGLIGENCE ), STRICT LIABILITY OR -// OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Copyright ( C ) 2008 Apple Inc. All Rights Reserved. -// -//////////////////////////////////////////////////////////////////////////////////////////////////// - - -#include "fft_internal.h" -#include "clFFT.h" -#include -#include -#include - -#define max(a,b) (((a)>(b)) ? (a) : (b)) -#define min(a,b) (((a)<(b)) ? (a) : (b)) - -static cl_int -allocateTemporaryBufferInterleaved(cl_fft_plan *plan, cl_uint batchSize) -{ - cl_int err = CL_SUCCESS; - if(plan->temp_buffer_needed && plan->last_batch_size != batchSize) - { - plan->last_batch_size = batchSize; - size_t tmpLength = plan->n.x * plan->n.y * plan->n.z * batchSize * 2 * sizeof(cl_float); - - if(plan->tempmemobj) - clReleaseMemObject(plan->tempmemobj); - - plan->tempmemobj = clCreateBuffer(plan->context, CL_MEM_READ_WRITE, tmpLength, NULL, &err); - } - return err; -} - -static cl_int -allocateTemporaryBufferPlannar(cl_fft_plan *plan, cl_uint batchSize) -{ - cl_int err = CL_SUCCESS; - cl_int terr; - if(plan->temp_buffer_needed && plan->last_batch_size != batchSize) - { - plan->last_batch_size = batchSize; - size_t tmpLength = plan->n.x * plan->n.y * plan->n.z * batchSize * sizeof(cl_float); - - if(plan->tempmemobj_real) - clReleaseMemObject(plan->tempmemobj_real); - - if(plan->tempmemobj_imag) - clReleaseMemObject(plan->tempmemobj_imag); - - plan->tempmemobj_real = clCreateBuffer(plan->context, CL_MEM_READ_WRITE, tmpLength, NULL, &err); - plan->tempmemobj_imag = clCreateBuffer(plan->context, CL_MEM_READ_WRITE, tmpLength, NULL, &terr); - err |= terr; - } - return err; -} - -void -getKernelWorkDimensions(cl_fft_plan *plan, cl_fft_kernel_info *kernelInfo, cl_int *batchSize, size_t *gWorkItems, size_t *lWorkItems) -{ - *lWorkItems = kernelInfo->num_workitems_per_workgroup; - int numWorkGroups = kernelInfo->num_workgroups; - int numXFormsPerWG = kernelInfo->num_xforms_per_workgroup; - - switch(kernelInfo->dir) - { - case cl_fft_kernel_x: - *batchSize *= (plan->n.y * plan->n.z); - numWorkGroups = (*batchSize % numXFormsPerWG) ? (*batchSize/numXFormsPerWG + 1) : (*batchSize/numXFormsPerWG); - numWorkGroups *= kernelInfo->num_workgroups; - break; - case cl_fft_kernel_y: - *batchSize *= plan->n.z; - numWorkGroups *= *batchSize; - break; - case cl_fft_kernel_z: - numWorkGroups *= *batchSize; - break; - } - - *gWorkItems = numWorkGroups * *lWorkItems; -} - -cl_int -clFFT_ExecuteInterleaved( cl_command_queue queue, clFFT_Plan Plan, cl_int batchSize, clFFT_Direction dir, - cl_mem data_in, cl_mem data_out, - cl_int num_events, cl_event *event_list, cl_event *event ) -{ - int s; - cl_fft_plan *plan = (cl_fft_plan *) Plan; - if(plan->format != clFFT_InterleavedComplexFormat) - return CL_INVALID_VALUE; - - cl_int err; - size_t gWorkItems, lWorkItems; - int inPlaceDone; - - cl_int isInPlace = data_in == data_out ? 1 : 0; - - if((err = allocateTemporaryBufferInterleaved(plan, batchSize)) != CL_SUCCESS) - return err; - - cl_mem memObj[3]; - memObj[0] = data_in; - memObj[1] = data_out; - memObj[2] = plan->tempmemobj; - cl_fft_kernel_info *kernelInfo = plan->kernel_info; - int numKernels = plan->num_kernels; - - int numKernelsOdd = numKernels & 1; - int currRead = 0; - int currWrite = 1; - - // at least one external dram shuffle (transpose) required - if(plan->temp_buffer_needed) - { - // in-place transform - if(isInPlace) - { - inPlaceDone = 0; - currRead = 1; - currWrite = 2; - } - else - { - currWrite = (numKernels & 1) ? 1 : 2; - } - - while(kernelInfo) - { - if( isInPlace && numKernelsOdd && !inPlaceDone && kernelInfo->in_place_possible) - { - currWrite = currRead; - inPlaceDone = 1; - } - - s = batchSize; - getKernelWorkDimensions(plan, kernelInfo, &s, &gWorkItems, &lWorkItems); - err |= clSetKernelArg(kernelInfo->kernel, 0, sizeof(cl_mem), &memObj[currRead]); - err |= clSetKernelArg(kernelInfo->kernel, 1, sizeof(cl_mem), &memObj[currWrite]); - err |= clSetKernelArg(kernelInfo->kernel, 2, sizeof(cl_int), &dir); - err |= clSetKernelArg(kernelInfo->kernel, 3, sizeof(cl_int), &s); - - err |= clEnqueueNDRangeKernel(queue, kernelInfo->kernel, 1, NULL, &gWorkItems, &lWorkItems, 0, NULL, NULL); - if(err) - return err; - - currRead = (currWrite == 1) ? 1 : 2; - currWrite = (currWrite == 1) ? 2 : 1; - - kernelInfo = kernelInfo->next; - } - } - // no dram shuffle (transpose required) transform - // all kernels can execute in-place. - else { - - while(kernelInfo) - { - s = batchSize; - getKernelWorkDimensions(plan, kernelInfo, &s, &gWorkItems, &lWorkItems); - err |= clSetKernelArg(kernelInfo->kernel, 0, sizeof(cl_mem), &memObj[currRead]); - err |= clSetKernelArg(kernelInfo->kernel, 1, sizeof(cl_mem), &memObj[currWrite]); - err |= clSetKernelArg(kernelInfo->kernel, 2, sizeof(cl_int), &dir); - err |= clSetKernelArg(kernelInfo->kernel, 3, sizeof(cl_int), &s); - - err |= clEnqueueNDRangeKernel(queue, kernelInfo->kernel, 1, NULL, &gWorkItems, &lWorkItems, 0, NULL, NULL); - if(err) - return err; - - currRead = 1; - currWrite = 1; - - kernelInfo = kernelInfo->next; - } - } - - return err; -} - -cl_int -clFFT_ExecutePlannar( cl_command_queue queue, clFFT_Plan Plan, cl_int batchSize, clFFT_Direction dir, - cl_mem data_in_real, cl_mem data_in_imag, cl_mem data_out_real, cl_mem data_out_imag, - cl_int num_events, cl_event *event_list, cl_event *event) -{ - int s; - cl_fft_plan *plan = (cl_fft_plan *) Plan; - - if(plan->format != clFFT_SplitComplexFormat) - return CL_INVALID_VALUE; - - cl_int err; - size_t gWorkItems, lWorkItems; - int inPlaceDone; - - cl_int isInPlace = ((data_in_real == data_out_real) && (data_in_imag == data_out_imag)) ? 1 : 0; - - if((err = allocateTemporaryBufferPlannar(plan, batchSize)) != CL_SUCCESS) - return err; - - cl_mem memObj_real[3]; - cl_mem memObj_imag[3]; - memObj_real[0] = data_in_real; - memObj_real[1] = data_out_real; - memObj_real[2] = plan->tempmemobj_real; - memObj_imag[0] = data_in_imag; - memObj_imag[1] = data_out_imag; - memObj_imag[2] = plan->tempmemobj_imag; - - cl_fft_kernel_info *kernelInfo = plan->kernel_info; - int numKernels = plan->num_kernels; - - int numKernelsOdd = numKernels & 1; - int currRead = 0; - int currWrite = 1; - - // at least one external dram shuffle (transpose) required - if(plan->temp_buffer_needed) - { - // in-place transform - if(isInPlace) - { - inPlaceDone = 0; - currRead = 1; - currWrite = 2; - } - else - { - currWrite = (numKernels & 1) ? 1 : 2; - } - - while(kernelInfo) - { - if( isInPlace && numKernelsOdd && !inPlaceDone && kernelInfo->in_place_possible) - { - currWrite = currRead; - inPlaceDone = 1; - } - - s = batchSize; - getKernelWorkDimensions(plan, kernelInfo, &s, &gWorkItems, &lWorkItems); - err |= clSetKernelArg(kernelInfo->kernel, 0, sizeof(cl_mem), &memObj_real[currRead]); - err |= clSetKernelArg(kernelInfo->kernel, 1, sizeof(cl_mem), &memObj_imag[currRead]); - err |= clSetKernelArg(kernelInfo->kernel, 2, sizeof(cl_mem), &memObj_real[currWrite]); - err |= clSetKernelArg(kernelInfo->kernel, 3, sizeof(cl_mem), &memObj_imag[currWrite]); - err |= clSetKernelArg(kernelInfo->kernel, 4, sizeof(cl_int), &dir); - err |= clSetKernelArg(kernelInfo->kernel, 5, sizeof(cl_int), &s); - - err |= clEnqueueNDRangeKernel(queue, kernelInfo->kernel, 1, NULL, &gWorkItems, &lWorkItems, 0, NULL, NULL); - if(err) - return err; - - currRead = (currWrite == 1) ? 1 : 2; - currWrite = (currWrite == 1) ? 2 : 1; - - kernelInfo = kernelInfo->next; - } - } - // no dram shuffle (transpose required) transform - else { - - while(kernelInfo) - { - s = batchSize; - getKernelWorkDimensions(plan, kernelInfo, &s, &gWorkItems, &lWorkItems); - err |= clSetKernelArg(kernelInfo->kernel, 0, sizeof(cl_mem), &memObj_real[currRead]); - err |= clSetKernelArg(kernelInfo->kernel, 1, sizeof(cl_mem), &memObj_imag[currRead]); - err |= clSetKernelArg(kernelInfo->kernel, 2, sizeof(cl_mem), &memObj_real[currWrite]); - err |= clSetKernelArg(kernelInfo->kernel, 3, sizeof(cl_mem), &memObj_imag[currWrite]); - err |= clSetKernelArg(kernelInfo->kernel, 4, sizeof(cl_int), &dir); - err |= clSetKernelArg(kernelInfo->kernel, 5, sizeof(cl_int), &s); - - err |= clEnqueueNDRangeKernel(queue, kernelInfo->kernel, 1, NULL, &gWorkItems, &lWorkItems, 0, NULL, NULL); - if(err) - return err; - - currRead = 1; - currWrite = 1; - - kernelInfo = kernelInfo->next; - } - } - - return err; -} - -cl_int -clFFT_1DTwistInterleaved(clFFT_Plan Plan, cl_command_queue queue, cl_mem array, - unsigned numRows, unsigned numCols, unsigned startRow, unsigned rowsToProcess, clFFT_Direction dir) -{ - cl_fft_plan *plan = (cl_fft_plan *) Plan; - - unsigned int N = numRows*numCols; - unsigned int nCols = numCols; - unsigned int sRow = startRow; - unsigned int rToProcess = rowsToProcess; - int d = dir; - int err = 0; - - cl_device_id device_id; - err = clGetCommandQueueInfo(queue, CL_QUEUE_DEVICE, sizeof(cl_device_id), &device_id, NULL); - if(err) - return err; - - size_t gSize; - err = clGetKernelWorkGroupInfo(plan->twist_kernel, device_id, CL_KERNEL_WORK_GROUP_SIZE, sizeof(size_t), &gSize, NULL); - if(err) - return err; - - gSize = min(128, gSize); - size_t numGlobalThreads[1] = { max(numCols / gSize, 1)*gSize }; - size_t numLocalThreads[1] = { gSize }; - - err |= clSetKernelArg(plan->twist_kernel, 0, sizeof(cl_mem), &array); - err |= clSetKernelArg(plan->twist_kernel, 1, sizeof(unsigned int), &sRow); - err |= clSetKernelArg(plan->twist_kernel, 2, sizeof(unsigned int), &nCols); - err |= clSetKernelArg(plan->twist_kernel, 3, sizeof(unsigned int), &N); - err |= clSetKernelArg(plan->twist_kernel, 4, sizeof(unsigned int), &rToProcess); - err |= clSetKernelArg(plan->twist_kernel, 5, sizeof(int), &d); - - err |= clEnqueueNDRangeKernel(queue, plan->twist_kernel, 1, NULL, numGlobalThreads, numLocalThreads, 0, NULL, NULL); - - return err; -} - -cl_int -clFFT_1DTwistPlannar(clFFT_Plan Plan, cl_command_queue queue, cl_mem array_real, cl_mem array_imag, - unsigned numRows, unsigned numCols, unsigned startRow, unsigned rowsToProcess, clFFT_Direction dir) -{ - cl_fft_plan *plan = (cl_fft_plan *) Plan; - - unsigned int N = numRows*numCols; - unsigned int nCols = numCols; - unsigned int sRow = startRow; - unsigned int rToProcess = rowsToProcess; - int d = dir; - int err = 0; - - cl_device_id device_id; - err = clGetCommandQueueInfo(queue, CL_QUEUE_DEVICE, sizeof(cl_device_id), &device_id, NULL); - if(err) - return err; - - size_t gSize; - err = clGetKernelWorkGroupInfo(plan->twist_kernel, device_id, CL_KERNEL_WORK_GROUP_SIZE, sizeof(size_t), &gSize, NULL); - if(err) - return err; - - gSize = min(128, gSize); - size_t numGlobalThreads[1] = { max(numCols / gSize, 1)*gSize }; - size_t numLocalThreads[1] = { gSize }; - - err |= clSetKernelArg(plan->twist_kernel, 0, sizeof(cl_mem), &array_real); - err |= clSetKernelArg(plan->twist_kernel, 1, sizeof(cl_mem), &array_imag); - err |= clSetKernelArg(plan->twist_kernel, 2, sizeof(unsigned int), &sRow); - err |= clSetKernelArg(plan->twist_kernel, 3, sizeof(unsigned int), &nCols); - err |= clSetKernelArg(plan->twist_kernel, 4, sizeof(unsigned int), &N); - err |= clSetKernelArg(plan->twist_kernel, 5, sizeof(unsigned int), &rToProcess); - err |= clSetKernelArg(plan->twist_kernel, 6, sizeof(int), &d); - - err |= clEnqueueNDRangeKernel(queue, plan->twist_kernel, 1, NULL, numGlobalThreads, numLocalThreads, 0, NULL, NULL); - - return err; -} - diff --git a/src/algorithms/libs/fft_internal.h b/src/algorithms/libs/fft_internal.h deleted file mode 100644 index 5b797a3a0..000000000 --- a/src/algorithms/libs/fft_internal.h +++ /dev/null @@ -1,163 +0,0 @@ - -// -// File: fft_internal.h -// -// Version: <1.0> -// -// Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Inc. ("Apple") -// in consideration of your agreement to the following terms, and your use, -// installation, modification or redistribution of this Apple software -// constitutes acceptance of these terms. If you do not agree with these -// terms, please do not use, install, modify or redistribute this Apple -// software. -// -// In consideration of your agreement to abide by the following terms, and -// subject to these terms, Apple grants you a personal, non - exclusive -// license, under Apple's copyrights in this original Apple software ( the -// "Apple Software" ), to use, reproduce, modify and redistribute the Apple -// Software, with or without modifications, in source and / or binary forms; -// provided that if you redistribute the Apple Software in its entirety and -// without modifications, you must retain this notice and the following text -// and disclaimers in all such redistributions of the Apple Software. Neither -// the name, trademarks, service marks or logos of Apple Inc. may be used to -// endorse or promote products derived from the Apple Software without specific -// prior written permission from Apple. Except as expressly stated in this -// notice, no other rights or licenses, express or implied, are granted by -// Apple herein, including but not limited to any patent rights that may be -// infringed by your derivative works or by other works in which the Apple -// Software may be incorporated. -// -// The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO -// WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED -// WARRANTIES OF NON - INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A -// PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION -// ALONE OR IN COMBINATION WITH YOUR PRODUCTS. -// -// IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR -// CONSEQUENTIAL DAMAGES ( INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -// INTERRUPTION ) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION -// AND / OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER -// UNDER THEORY OF CONTRACT, TORT ( INCLUDING NEGLIGENCE ), STRICT LIABILITY OR -// OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Copyright ( C ) 2008 Apple Inc. All Rights Reserved. -// -//////////////////////////////////////////////////////////////////////////////////////////////////// - - -#ifndef __CLFFT_INTERNAL_H -#define __CLFFT_INTERNAL_H - -#include "clFFT.h" -#include -#include -#include - -using namespace std; - -typedef enum kernel_dir_t -{ - cl_fft_kernel_x, - cl_fft_kernel_y, - cl_fft_kernel_z -}cl_fft_kernel_dir; - -typedef struct kernel_info_t -{ - cl_kernel kernel; - char *kernel_name; - unsigned lmem_size; - unsigned num_workgroups; - unsigned num_xforms_per_workgroup; - unsigned num_workitems_per_workgroup; - cl_fft_kernel_dir dir; - int in_place_possible; - kernel_info_t *next; -}cl_fft_kernel_info; - -typedef struct -{ - // context in which fft resources are created and kernels are executed - cl_context context; - - // size of signal - clFFT_Dim3 n; - - // dimension of transform ... must be either 1D, 2D or 3D - clFFT_Dimension dim; - - // data format ... must be either interleaved or plannar - clFFT_DataFormat format; - - // string containing kernel source. Generated at runtime based on - // n, dim, format and other parameters - string *kernel_string; - - // CL program containing source and kernel this particular - // n, dim, data format - cl_program program; - - // linked list of kernels which needs to be executed for this fft - cl_fft_kernel_info *kernel_info; - - // number of kernels - int num_kernels; - - // twist kernel for virtualizing fft of very large sizes that do not - // fit in GPU global memory - cl_kernel twist_kernel; - - // flag indicating if temporary intermediate buffer is needed or not. - // this depends on fft kernels being executed and if transform is - // in-place or out-of-place. e.g. Local memory fft (say 1D 1024 ... - // one that does not require global transpose do not need temporary buffer) - // 2D 1024x1024 out-of-place fft however do require intermediate buffer. - // If temp buffer is needed, its allocation is lazy i.e. its not allocated - // until its needed - cl_int temp_buffer_needed; - - // Batch size is runtime parameter and size of temporary buffer (if needed) - // depends on batch size. Allocation of temporary buffer is lazy i.e. its - // only created when needed. Once its created at first call of clFFT_Executexxx - // it is not allocated next time if next time clFFT_Executexxx is called with - // batch size different than the first call. last_batch_size caches the last - // batch size with which this plan is used so that we dont keep allocating/deallocating - // temp buffer if same batch size is used again and again. - unsigned last_batch_size; - - // temporary buffer for interleaved plan - cl_mem tempmemobj; - - // temporary buffer for planner plan. Only one of tempmemobj or - // (tempmemobj_real, tempmemobj_imag) pair is valid (allocated) depending - // data format of plan (plannar or interleaved) - cl_mem tempmemobj_real, tempmemobj_imag; - - // Maximum size of signal for which local memory transposed based - // fft is sufficient i.e. no global mem transpose (communication) - // is needed - unsigned max_localmem_fft_size; - - // Maximum work items per work group allowed. This, along with max_radix below controls - // maximum local memory being used by fft kernels of this plan. Set to 256 by default - unsigned max_work_item_per_workgroup; - - // Maximum base radix for local memory fft ... this controls the maximum register - // space used by work items. Currently defaults to 16 - unsigned max_radix; - - // Device depended parameter that tells how many work-items need to be read consecutive - // values to make sure global memory access by work-items of a work-group result in - // coalesced memory access to utilize full bandwidth e.g. on NVidia tesla, this is 16 - unsigned min_mem_coalesce_width; - - // Number of local memory banks. This is used to geneate kernel with local memory - // transposes with appropriate padding to avoid bank conflicts to local memory - // e.g. on NVidia it is 16. - unsigned num_local_mem_banks; -}cl_fft_plan; - -void FFT1D(cl_fft_plan *plan, cl_fft_kernel_dir dir); - -#endif diff --git a/src/algorithms/libs/fft_kernelstring.cc b/src/algorithms/libs/fft_kernelstring.cc deleted file mode 100644 index 7847ce959..000000000 --- a/src/algorithms/libs/fft_kernelstring.cc +++ /dev/null @@ -1,1257 +0,0 @@ - -// -// File: fft_kernelstring.cpp -// -// Version: <1.0> -// -// Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Inc. ("Apple") -// in consideration of your agreement to the following terms, and your use, -// installation, modification or redistribution of this Apple software -// constitutes acceptance of these terms. If you do not agree with these -// terms, please do not use, install, modify or redistribute this Apple -// software. -// -// In consideration of your agreement to abide by the following terms, and -// subject to these terms, Apple grants you a personal, non - exclusive -// license, under Apple's copyrights in this original Apple software ( the -// "Apple Software" ), to use, reproduce, modify and redistribute the Apple -// Software, with or without modifications, in source and / or binary forms; -// provided that if you redistribute the Apple Software in its entirety and -// without modifications, you must retain this notice and the following text -// and disclaimers in all such redistributions of the Apple Software. Neither -// the name, trademarks, service marks or logos of Apple Inc. may be used to -// endorse or promote products derived from the Apple Software without specific -// prior written permission from Apple. Except as expressly stated in this -// notice, no other rights or licenses, express or implied, are granted by -// Apple herein, including but not limited to any patent rights that may be -// infringed by your derivative works or by other works in which the Apple -// Software may be incorporated. -// -// The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO -// WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED -// WARRANTIES OF NON - INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A -// PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION -// ALONE OR IN COMBINATION WITH YOUR PRODUCTS. -// -// IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR -// CONSEQUENTIAL DAMAGES ( INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -// INTERRUPTION ) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION -// AND / OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER -// UNDER THEORY OF CONTRACT, TORT ( INCLUDING NEGLIGENCE ), STRICT LIABILITY OR -// OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Copyright ( C ) 2008 Apple Inc. All Rights Reserved. -// -//////////////////////////////////////////////////////////////////////////////////////////////////// - - -#include -#include -#include -#include -#include -#include -#include -#include -#include "fft_internal.h" -#include "clFFT.h" - -using namespace std; - -#define max(A,B) ((A) > (B) ? (A) : (B)) -#define min(A,B) ((A) < (B) ? (A) : (B)) - -static string -num2str(int num) -{ - char temp[200]; - sprintf(temp, "%d", num); - return string(temp); -} - -// For any n, this function decomposes n into factors for loacal memory tranpose -// based fft. Factors (radices) are sorted such that the first one (radixArray[0]) -// is the largest. This base radix determines the number of registers used by each -// work item and product of remaining radices determine the size of work group needed. -// To make things concrete with and example, suppose n = 1024. It is decomposed into -// 1024 = 16 x 16 x 4. Hence kernel uses float2 a[16], for local in-register fft and -// needs 16 x 4 = 64 work items per work group. So kernel first performance 64 length -// 16 ffts (64 work items working in parallel) following by transpose using local -// memory followed by again 64 length 16 ffts followed by transpose using local memory -// followed by 256 length 4 ffts. For the last step since with size of work group is -// 64 and each work item can array for 16 values, 64 work items can compute 256 length -// 4 ffts by each work item computing 4 length 4 ffts. -// Similarly for n = 2048 = 8 x 8 x 8 x 4, each work group has 8 x 8 x 4 = 256 work -// iterms which each computes 256 (in-parallel) length 8 ffts in-register, followed -// by transpose using local memory, followed by 256 length 8 in-register ffts, followed -// by transpose using local memory, followed by 256 length 8 in-register ffts, followed -// by transpose using local memory, followed by 512 length 4 in-register ffts. Again, -// for the last step, each work item computes two length 4 in-register ffts and thus -// 256 work items are needed to compute all 512 ffts. -// For n = 32 = 8 x 4, 4 work items first compute 4 in-register -// lenth 8 ffts, followed by transpose using local memory followed by 8 in-register -// length 4 ffts, where each work item computes two length 4 ffts thus 4 work items -// can compute 8 length 4 ffts. However if work group size of say 64 is choosen, -// each work group can compute 64/ 4 = 16 size 32 ffts (batched transform). -// Users can play with these parameters to figure what gives best performance on -// their particular device i.e. some device have less register space thus using -// smaller base radix can avoid spilling ... some has small local memory thus -// using smaller work group size may be required etc - -static void -getRadixArray(unsigned int n, unsigned int *radixArray, unsigned int *numRadices, unsigned int maxRadix) -{ - if(maxRadix > 1) - { - maxRadix = min(n, maxRadix); - unsigned int cnt = 0; - while(n > maxRadix) - { - radixArray[cnt++] = maxRadix; - n /= maxRadix; - } - radixArray[cnt++] = n; - *numRadices = cnt; - return; - } - - switch(n) - { - case 2: - *numRadices = 1; - radixArray[0] = 2; - break; - - case 4: - *numRadices = 1; - radixArray[0] = 4; - break; - - case 8: - *numRadices = 1; - radixArray[0] = 8; - break; - - case 16: - *numRadices = 2; - radixArray[0] = 8; radixArray[1] = 2; - break; - - case 32: - *numRadices = 2; - radixArray[0] = 8; radixArray[1] = 4; - break; - - case 64: - *numRadices = 2; - radixArray[0] = 8; radixArray[1] = 8; - break; - - case 128: - *numRadices = 3; - radixArray[0] = 8; radixArray[1] = 4; radixArray[2] = 4; - break; - - case 256: - *numRadices = 4; - radixArray[0] = 4; radixArray[1] = 4; radixArray[2] = 4; radixArray[3] = 4; - break; - - case 512: - *numRadices = 3; - radixArray[0] = 8; radixArray[1] = 8; radixArray[2] = 8; - break; - - case 1024: - *numRadices = 3; - radixArray[0] = 16; radixArray[1] = 16; radixArray[2] = 4; - break; - case 2048: - *numRadices = 4; - radixArray[0] = 8; radixArray[1] = 8; radixArray[2] = 8; radixArray[3] = 4; - break; - default: - *numRadices = 0; - return; - } -} - -static void -insertHeader(string &kernelString, string &kernelName, clFFT_DataFormat dataFormat) -{ - if(dataFormat == clFFT_SplitComplexFormat) - kernelString += string("__kernel void ") + kernelName + string("(__global float *in_real, __global float *in_imag, __global float *out_real, __global float *out_imag, int dir, int S)\n"); - else - kernelString += string("__kernel void ") + kernelName + string("(__global float2 *in, __global float2 *out, int dir, int S)\n"); -} - -static void -insertVariables(string &kStream, int maxRadix) -{ - kStream += string(" int i, j, r, indexIn, indexOut, index, tid, bNum, xNum, k, l;\n"); - kStream += string(" int s, ii, jj, offset;\n"); - kStream += string(" float2 w;\n"); - kStream += string(" float ang, angf, ang1;\n"); - kStream += string(" __local float *lMemStore, *lMemLoad;\n"); - kStream += string(" float2 a[") + num2str(maxRadix) + string("];\n"); - kStream += string(" int lId = get_local_id( 0 );\n"); - kStream += string(" int groupId = get_group_id( 0 );\n"); -} - -static void -formattedLoad(string &kernelString, int aIndex, int gIndex, clFFT_DataFormat dataFormat) -{ - if(dataFormat == clFFT_InterleavedComplexFormat) - kernelString += string(" a[") + num2str(aIndex) + string("] = in[") + num2str(gIndex) + string("];\n"); - else - { - kernelString += string(" a[") + num2str(aIndex) + string("].x = in_real[") + num2str(gIndex) + string("];\n"); - kernelString += string(" a[") + num2str(aIndex) + string("].y = in_imag[") + num2str(gIndex) + string("];\n"); - } -} - -static void -formattedStore(string &kernelString, int aIndex, int gIndex, clFFT_DataFormat dataFormat) -{ - if(dataFormat == clFFT_InterleavedComplexFormat) - kernelString += string(" out[") + num2str(gIndex) + string("] = a[") + num2str(aIndex) + string("];\n"); - else - { - kernelString += string(" out_real[") + num2str(gIndex) + string("] = a[") + num2str(aIndex) + string("].x;\n"); - kernelString += string(" out_imag[") + num2str(gIndex) + string("] = a[") + num2str(aIndex) + string("].y;\n"); - } -} - -static int -insertGlobalLoadsAndTranspose(string &kernelString, int N, int numWorkItemsPerXForm, int numXFormsPerWG, int R0, int mem_coalesce_width, clFFT_DataFormat dataFormat) -{ - int log2NumWorkItemsPerXForm = (int) log2(numWorkItemsPerXForm); - int groupSize = numWorkItemsPerXForm * numXFormsPerWG; - int i, j; - int lMemSize = 0; - - if(numXFormsPerWG > 1) - kernelString += string(" s = S & ") + num2str(numXFormsPerWG - 1) + string(";\n"); - - if(numWorkItemsPerXForm >= mem_coalesce_width) - { - if(numXFormsPerWG > 1) - { - kernelString += string(" ii = lId & ") + num2str(numWorkItemsPerXForm-1) + string(";\n"); - kernelString += string(" jj = lId >> ") + num2str(log2NumWorkItemsPerXForm) + string(";\n"); - kernelString += string(" if( !s || (groupId < get_num_groups(0)-1) || (jj < s) ) {\n"); - kernelString += string(" offset = mad24( mad24(groupId, ") + num2str(numXFormsPerWG) + string(", jj), ") + num2str(N) + string(", ii );\n"); - if(dataFormat == clFFT_InterleavedComplexFormat) - { - kernelString += string(" in += offset;\n"); - kernelString += string(" out += offset;\n"); - } - else - { - kernelString += string(" in_real += offset;\n"); - kernelString += string(" in_imag += offset;\n"); - kernelString += string(" out_real += offset;\n"); - kernelString += string(" out_imag += offset;\n"); - } - for(i = 0; i < R0; i++) - formattedLoad(kernelString, i, i*numWorkItemsPerXForm, dataFormat); - kernelString += string(" }\n"); - } - else - { - kernelString += string(" ii = lId;\n"); - kernelString += string(" jj = 0;\n"); - kernelString += string(" offset = mad24(groupId, ") + num2str(N) + string(", ii);\n"); - if(dataFormat == clFFT_InterleavedComplexFormat) - { - kernelString += string(" in += offset;\n"); - kernelString += string(" out += offset;\n"); - } - else - { - kernelString += string(" in_real += offset;\n"); - kernelString += string(" in_imag += offset;\n"); - kernelString += string(" out_real += offset;\n"); - kernelString += string(" out_imag += offset;\n"); - } - for(i = 0; i < R0; i++) - formattedLoad(kernelString, i, i*numWorkItemsPerXForm, dataFormat); - } - } - else if( N >= mem_coalesce_width ) - { - int numInnerIter = N / mem_coalesce_width; - int numOuterIter = numXFormsPerWG / ( groupSize / mem_coalesce_width ); - - kernelString += string(" ii = lId & ") + num2str(mem_coalesce_width - 1) + string(";\n"); - kernelString += string(" jj = lId >> ") + num2str((int)log2(mem_coalesce_width)) + string(";\n"); - kernelString += string(" lMemStore = sMem + mad24( jj, ") + num2str(N + numWorkItemsPerXForm) + string(", ii );\n"); - kernelString += string(" offset = mad24( groupId, ") + num2str(numXFormsPerWG) + string(", jj);\n"); - kernelString += string(" offset = mad24( offset, ") + num2str(N) + string(", ii );\n"); - if(dataFormat == clFFT_InterleavedComplexFormat) - { - kernelString += string(" in += offset;\n"); - kernelString += string(" out += offset;\n"); - } - else - { - kernelString += string(" in_real += offset;\n"); - kernelString += string(" in_imag += offset;\n"); - kernelString += string(" out_real += offset;\n"); - kernelString += string(" out_imag += offset;\n"); - } - - kernelString += string("if((groupId == get_num_groups(0)-1) && s) {\n"); - for(i = 0; i < numOuterIter; i++ ) - { - kernelString += string(" if( jj < s ) {\n"); - for(j = 0; j < numInnerIter; j++ ) - formattedLoad(kernelString, i * numInnerIter + j, j * mem_coalesce_width + i * ( groupSize / mem_coalesce_width ) * N, dataFormat); - kernelString += string(" }\n"); - if(i != numOuterIter - 1) - kernelString += string(" jj += ") + num2str(groupSize / mem_coalesce_width) + string(";\n"); - } - kernelString += string("}\n "); - kernelString += string("else {\n"); - for(i = 0; i < numOuterIter; i++ ) - { - for(j = 0; j < numInnerIter; j++ ) - formattedLoad(kernelString, i * numInnerIter + j, j * mem_coalesce_width + i * ( groupSize / mem_coalesce_width ) * N, dataFormat); - } - kernelString += string("}\n"); - - kernelString += string(" ii = lId & ") + num2str(numWorkItemsPerXForm - 1) + string(";\n"); - kernelString += string(" jj = lId >> ") + num2str(log2NumWorkItemsPerXForm) + string(";\n"); - kernelString += string(" lMemLoad = sMem + mad24( jj, ") + num2str(N + numWorkItemsPerXForm) + string(", ii);\n"); - - for( i = 0; i < numOuterIter; i++ ) - { - for( j = 0; j < numInnerIter; j++ ) - { - kernelString += string(" lMemStore[") + num2str(j * mem_coalesce_width + i * ( groupSize / mem_coalesce_width ) * (N + numWorkItemsPerXForm )) + string("] = a[") + - num2str(i * numInnerIter + j) + string("].x;\n"); - } - } - kernelString += string(" barrier( CLK_LOCAL_MEM_FENCE );\n"); - - for( i = 0; i < R0; i++ ) - kernelString += string(" a[") + num2str(i) + string("].x = lMemLoad[") + num2str(i * numWorkItemsPerXForm) + string("];\n"); - kernelString += string(" barrier( CLK_LOCAL_MEM_FENCE );\n"); - - for( i = 0; i < numOuterIter; i++ ) - { - for( j = 0; j < numInnerIter; j++ ) - { - kernelString += string(" lMemStore[") + num2str(j * mem_coalesce_width + i * ( groupSize / mem_coalesce_width ) * (N + numWorkItemsPerXForm )) + string("] = a[") + - num2str(i * numInnerIter + j) + string("].y;\n"); - } - } - kernelString += string(" barrier( CLK_LOCAL_MEM_FENCE );\n"); - - for( i = 0; i < R0; i++ ) - kernelString += string(" a[") + num2str(i) + string("].y = lMemLoad[") + num2str(i * numWorkItemsPerXForm) + string("];\n"); - kernelString += string(" barrier( CLK_LOCAL_MEM_FENCE );\n"); - - lMemSize = (N + numWorkItemsPerXForm) * numXFormsPerWG; - } - else - { - kernelString += string(" offset = mad24( groupId, ") + num2str(N * numXFormsPerWG) + string(", lId );\n"); - if(dataFormat == clFFT_InterleavedComplexFormat) - { - kernelString += string(" in += offset;\n"); - kernelString += string(" out += offset;\n"); - } - else - { - kernelString += string(" in_real += offset;\n"); - kernelString += string(" in_imag += offset;\n"); - kernelString += string(" out_real += offset;\n"); - kernelString += string(" out_imag += offset;\n"); - } - - kernelString += string(" ii = lId & ") + num2str(N-1) + string(";\n"); - kernelString += string(" jj = lId >> ") + num2str((int)log2(N)) + string(";\n"); - kernelString += string(" lMemStore = sMem + mad24( jj, ") + num2str(N + numWorkItemsPerXForm) + string(", ii );\n"); - - kernelString += string("if((groupId == get_num_groups(0)-1) && s) {\n"); - for( i = 0; i < R0; i++ ) - { - kernelString += string(" if(jj < s )\n"); - formattedLoad(kernelString, i, i*groupSize, dataFormat); - if(i != R0 - 1) - kernelString += string(" jj += ") + num2str(groupSize / N) + string(";\n"); - } - kernelString += string("}\n"); - kernelString += string("else {\n"); - for( i = 0; i < R0; i++ ) - { - formattedLoad(kernelString, i, i*groupSize, dataFormat); - } - kernelString += string("}\n"); - - if(numWorkItemsPerXForm > 1) - { - kernelString += string(" ii = lId & ") + num2str(numWorkItemsPerXForm - 1) + string(";\n"); - kernelString += string(" jj = lId >> ") + num2str(log2NumWorkItemsPerXForm) + string(";\n"); - kernelString += string(" lMemLoad = sMem + mad24( jj, ") + num2str(N + numWorkItemsPerXForm) + string(", ii );\n"); - } - else - { - kernelString += string(" ii = 0;\n"); - kernelString += string(" jj = lId;\n"); - kernelString += string(" lMemLoad = sMem + mul24( jj, ") + num2str(N + numWorkItemsPerXForm) + string(");\n"); - } - - - for( i = 0; i < R0; i++ ) - kernelString += string(" lMemStore[") + num2str(i * ( groupSize / N ) * ( N + numWorkItemsPerXForm )) + string("] = a[") + num2str(i) + string("].x;\n"); - kernelString += string(" barrier( CLK_LOCAL_MEM_FENCE );\n"); - - for( i = 0; i < R0; i++ ) - kernelString += string(" a[") + num2str(i) + string("].x = lMemLoad[") + num2str(i * numWorkItemsPerXForm) + string("];\n"); - kernelString += string(" barrier( CLK_LOCAL_MEM_FENCE );\n"); - - for( i = 0; i < R0; i++ ) - kernelString += string(" lMemStore[") + num2str(i * ( groupSize / N ) * ( N + numWorkItemsPerXForm )) + string("] = a[") + num2str(i) + string("].y;\n"); - kernelString += string(" barrier( CLK_LOCAL_MEM_FENCE );\n"); - - for( i = 0; i < R0; i++ ) - kernelString += string(" a[") + num2str(i) + string("].y = lMemLoad[") + num2str(i * numWorkItemsPerXForm) + string("];\n"); - kernelString += string(" barrier( CLK_LOCAL_MEM_FENCE );\n"); - - lMemSize = (N + numWorkItemsPerXForm) * numXFormsPerWG; - } - - return lMemSize; -} - -static int -insertGlobalStoresAndTranspose(string &kernelString, int N, int maxRadix, int Nr, int numWorkItemsPerXForm, int numXFormsPerWG, int mem_coalesce_width, clFFT_DataFormat dataFormat) -{ - int groupSize = numWorkItemsPerXForm * numXFormsPerWG; - int i, j, k, ind; - int lMemSize = 0; - int numIter = maxRadix / Nr; - string indent = string(""); - - if( numWorkItemsPerXForm >= mem_coalesce_width ) - { - if(numXFormsPerWG > 1) - { - kernelString += string(" if( !s || (groupId < get_num_groups(0)-1) || (jj < s) ) {\n"); - indent = string(" "); - } - for(i = 0; i < maxRadix; i++) - { - j = i % numIter; - k = i / numIter; - ind = j * Nr + k; - formattedStore(kernelString, ind, i*numWorkItemsPerXForm, dataFormat); - } - if(numXFormsPerWG > 1) - kernelString += string(" }\n"); - } - else if( N >= mem_coalesce_width ) - { - int numInnerIter = N / mem_coalesce_width; - int numOuterIter = numXFormsPerWG / ( groupSize / mem_coalesce_width ); - - kernelString += string(" lMemLoad = sMem + mad24( jj, ") + num2str(N + numWorkItemsPerXForm) + string(", ii );\n"); - kernelString += string(" ii = lId & ") + num2str(mem_coalesce_width - 1) + string(";\n"); - kernelString += string(" jj = lId >> ") + num2str((int)log2(mem_coalesce_width)) + string(";\n"); - kernelString += string(" lMemStore = sMem + mad24( jj,") + num2str(N + numWorkItemsPerXForm) + string(", ii );\n"); - - for( i = 0; i < maxRadix; i++ ) - { - j = i % numIter; - k = i / numIter; - ind = j * Nr + k; - kernelString += string(" lMemLoad[") + num2str(i*numWorkItemsPerXForm) + string("] = a[") + num2str(ind) + string("].x;\n"); - } - kernelString += string(" barrier( CLK_LOCAL_MEM_FENCE );\n"); - - for( i = 0; i < numOuterIter; i++ ) - for( j = 0; j < numInnerIter; j++ ) - kernelString += string(" a[") + num2str(i*numInnerIter + j) + string("].x = lMemStore[") + num2str(j*mem_coalesce_width + i*( groupSize / mem_coalesce_width )*(N + numWorkItemsPerXForm)) + string("];\n"); - kernelString += string(" barrier( CLK_LOCAL_MEM_FENCE );\n"); - - for( i = 0; i < maxRadix; i++ ) - { - j = i % numIter; - k = i / numIter; - ind = j * Nr + k; - kernelString += string(" lMemLoad[") + num2str(i*numWorkItemsPerXForm) + string("] = a[") + num2str(ind) + string("].y;\n"); - } - kernelString += string(" barrier( CLK_LOCAL_MEM_FENCE );\n"); - - for( i = 0; i < numOuterIter; i++ ) - for( j = 0; j < numInnerIter; j++ ) - kernelString += string(" a[") + num2str(i*numInnerIter + j) + string("].y = lMemStore[") + num2str(j*mem_coalesce_width + i*( groupSize / mem_coalesce_width )*(N + numWorkItemsPerXForm)) + string("];\n"); - kernelString += string(" barrier( CLK_LOCAL_MEM_FENCE );\n"); - - kernelString += string("if((groupId == get_num_groups(0)-1) && s) {\n"); - for(i = 0; i < numOuterIter; i++ ) - { - kernelString += string(" if( jj < s ) {\n"); - for(j = 0; j < numInnerIter; j++ ) - formattedStore(kernelString, i*numInnerIter + j, j*mem_coalesce_width + i*(groupSize/mem_coalesce_width)*N, dataFormat); - kernelString += string(" }\n"); - if(i != numOuterIter - 1) - kernelString += string(" jj += ") + num2str(groupSize / mem_coalesce_width) + string(";\n"); - } - kernelString += string("}\n"); - kernelString += string("else {\n"); - for(i = 0; i < numOuterIter; i++ ) - { - for(j = 0; j < numInnerIter; j++ ) - formattedStore(kernelString, i*numInnerIter + j, j*mem_coalesce_width + i*(groupSize/mem_coalesce_width)*N, dataFormat); - } - kernelString += string("}\n"); - - lMemSize = (N + numWorkItemsPerXForm) * numXFormsPerWG; - } - else - { - kernelString += string(" lMemLoad = sMem + mad24( jj,") + num2str(N + numWorkItemsPerXForm) + string(", ii );\n"); - - kernelString += string(" ii = lId & ") + num2str(N - 1) + string(";\n"); - kernelString += string(" jj = lId >> ") + num2str((int) log2(N)) + string(";\n"); - kernelString += string(" lMemStore = sMem + mad24( jj,") + num2str(N + numWorkItemsPerXForm) + string(", ii );\n"); - - for( i = 0; i < maxRadix; i++ ) - { - j = i % numIter; - k = i / numIter; - ind = j * Nr + k; - kernelString += string(" lMemLoad[") + num2str(i*numWorkItemsPerXForm) + string("] = a[") + num2str(ind) + string("].x;\n"); - } - kernelString += string(" barrier( CLK_LOCAL_MEM_FENCE );\n"); - - for( i = 0; i < maxRadix; i++ ) - kernelString += string(" a[") + num2str(i) + string("].x = lMemStore[") + num2str(i*( groupSize / N )*( N + numWorkItemsPerXForm )) + string("];\n"); - kernelString += string(" barrier( CLK_LOCAL_MEM_FENCE );\n"); - - for( i = 0; i < maxRadix; i++ ) - { - j = i % numIter; - k = i / numIter; - ind = j * Nr + k; - kernelString += string(" lMemLoad[") + num2str(i*numWorkItemsPerXForm) + string("] = a[") + num2str(ind) + string("].y;\n"); - } - kernelString += string(" barrier( CLK_LOCAL_MEM_FENCE );\n"); - - for( i = 0; i < maxRadix; i++ ) - kernelString += string(" a[") + num2str(i) + string("].y = lMemStore[") + num2str(i*( groupSize / N )*( N + numWorkItemsPerXForm )) + string("];\n"); - kernelString += string(" barrier( CLK_LOCAL_MEM_FENCE );\n"); - - kernelString += string("if((groupId == get_num_groups(0)-1) && s) {\n"); - for( i = 0; i < maxRadix; i++ ) - { - kernelString += string(" if(jj < s ) {\n"); - formattedStore(kernelString, i, i*groupSize, dataFormat); - kernelString += string(" }\n"); - if( i != maxRadix - 1) - kernelString += string(" jj +=") + num2str(groupSize / N) + string(";\n"); - } - kernelString += string("}\n"); - kernelString += string("else {\n"); - for( i = 0; i < maxRadix; i++ ) - { - formattedStore(kernelString, i, i*groupSize, dataFormat); - } - kernelString += string("}\n"); - - lMemSize = (N + numWorkItemsPerXForm) * numXFormsPerWG; - } - - return lMemSize; -} - -static void -insertfftKernel(string &kernelString, int Nr, int numIter) -{ - int i; - for(i = 0; i < numIter; i++) - { - kernelString += string(" fftKernel") + num2str(Nr) + string("(a+") + num2str(i*Nr) + string(", dir);\n"); - } -} - -static void -insertTwiddleKernel(string &kernelString, int Nr, int numIter, int Nprev, int len, int numWorkItemsPerXForm) -{ - int z, k; - int logNPrev = (int)log2(Nprev); - - for(z = 0; z < numIter; z++) - { - if(z == 0) - { - if(Nprev > 1) - kernelString += string(" angf = (float) (ii >> ") + num2str(logNPrev) + string(");\n"); - else - kernelString += string(" angf = (float) ii;\n"); - } - else - { - if(Nprev > 1) - kernelString += string(" angf = (float) ((") + num2str(z*numWorkItemsPerXForm) + string(" + ii) >>") + num2str(logNPrev) + string(");\n"); - else - kernelString += string(" angf = (float) (") + num2str(z*numWorkItemsPerXForm) + string(" + ii);\n"); - } - - for(k = 1; k < Nr; k++) { - int ind = z*Nr + k; - //float fac = (float) (2.0 * M_PI * (double) k / (double) len); - kernelString += string(" ang = dir * ( 2.0f * M_PI * ") + num2str(k) + string(".0f / ") + num2str(len) + string(".0f )") + string(" * angf;\n"); - kernelString += string(" w = (float2)(native_cos(ang), native_sin(ang));\n"); - kernelString += string(" a[") + num2str(ind) + string("] = complexMul(a[") + num2str(ind) + string("], w);\n"); - } - } -} - -static int -getPadding(int numWorkItemsPerXForm, int Nprev, int numWorkItemsReq, int numXFormsPerWG, int Nr, int numBanks, int *offset, int *midPad) -{ - if((numWorkItemsPerXForm <= Nprev) || (Nprev >= numBanks)) - *offset = 0; - else { - int numRowsReq = ((numWorkItemsPerXForm < numBanks) ? numWorkItemsPerXForm : numBanks) / Nprev; - int numColsReq = 1; - if(numRowsReq > Nr) - numColsReq = numRowsReq / Nr; - numColsReq = Nprev * numColsReq; - *offset = numColsReq; - } - - if(numWorkItemsPerXForm >= numBanks || numXFormsPerWG == 1) - *midPad = 0; - else { - int bankNum = ( (numWorkItemsReq + *offset) * Nr ) & (numBanks - 1); - if( bankNum >= numWorkItemsPerXForm ) - *midPad = 0; - else - *midPad = numWorkItemsPerXForm - bankNum; - } - - int lMemSize = ( numWorkItemsReq + *offset) * Nr * numXFormsPerWG + *midPad * (numXFormsPerWG - 1); - return lMemSize; -} - - -static void -insertLocalStores(string &kernelString, int numIter, int Nr, int numWorkItemsPerXForm, int numWorkItemsReq, int offset, string &comp) -{ - int z, k; - - for(z = 0; z < numIter; z++) { - for(k = 0; k < Nr; k++) { - int index = k*(numWorkItemsReq + offset) + z*numWorkItemsPerXForm; - kernelString += string(" lMemStore[") + num2str(index) + string("] = a[") + num2str(z*Nr + k) + string("].") + comp + string(";\n"); - } - } - kernelString += string(" barrier(CLK_LOCAL_MEM_FENCE);\n"); -} - -static void -insertLocalLoads(string &kernelString, int n, int Nr, int Nrn, int Nprev, int Ncurr, int numWorkItemsPerXForm, int numWorkItemsReq, int offset, string &comp) -{ - int numWorkItemsReqN = n / Nrn; - int interBlockHNum = max( Nprev / numWorkItemsPerXForm, 1 ); - int interBlockHStride = numWorkItemsPerXForm; - int vertWidth = max(numWorkItemsPerXForm / Nprev, 1); - vertWidth = min( vertWidth, Nr); - int vertNum = Nr / vertWidth; - int vertStride = ( n / Nr + offset ) * vertWidth; - int iter = max( numWorkItemsReqN / numWorkItemsPerXForm, 1); - int intraBlockHStride = (numWorkItemsPerXForm / (Nprev*Nr)) > 1 ? (numWorkItemsPerXForm / (Nprev*Nr)) : 1; - intraBlockHStride *= Nprev; - - int stride = numWorkItemsReq / Nrn; - int i; - for(i = 0; i < iter; i++) { - int ii = i / (interBlockHNum * vertNum); - int zz = i % (interBlockHNum * vertNum); - int jj = zz % interBlockHNum; - int kk = zz / interBlockHNum; - int z; - for(z = 0; z < Nrn; z++) { - int st = kk * vertStride + jj * interBlockHStride + ii * intraBlockHStride + z * stride; - kernelString += string(" a[") + num2str(i*Nrn + z) + string("].") + comp + string(" = lMemLoad[") + num2str(st) + string("];\n"); - } - } - kernelString += string(" barrier(CLK_LOCAL_MEM_FENCE);\n"); -} - -static void -insertLocalLoadIndexArithmatic(string &kernelString, int Nprev, int Nr, int numWorkItemsReq, int numWorkItemsPerXForm, int numXFormsPerWG, int offset, int midPad) -{ - int Ncurr = Nprev * Nr; - int logNcurr = (int)log2(Ncurr); - int logNprev = (int)log2(Nprev); - int incr = (numWorkItemsReq + offset) * Nr + midPad; - - if(Ncurr < numWorkItemsPerXForm) - { - if(Nprev == 1) - kernelString += string(" j = ii & ") + num2str(Ncurr - 1) + string(";\n"); - else - kernelString += string(" j = (ii & ") + num2str(Ncurr - 1) + string(") >> ") + num2str(logNprev) + string(";\n"); - - if(Nprev == 1) - kernelString += string(" i = ii >> ") + num2str(logNcurr) + string(";\n"); - else - kernelString += string(" i = mad24(ii >> ") + num2str(logNcurr) + string(", ") + num2str(Nprev) + string(", ii & ") + num2str(Nprev - 1) + string(");\n"); - } - else - { - if(Nprev == 1) - kernelString += string(" j = ii;\n"); - else - kernelString += string(" j = ii >> ") + num2str(logNprev) + string(";\n"); - if(Nprev == 1) - kernelString += string(" i = 0;\n"); - else - kernelString += string(" i = ii & ") + num2str(Nprev - 1) + string(";\n"); - } - - if(numXFormsPerWG > 1) - kernelString += string(" i = mad24(jj, ") + num2str(incr) + string(", i);\n"); - - kernelString += string(" lMemLoad = sMem + mad24(j, ") + num2str(numWorkItemsReq + offset) + string(", i);\n"); -} - -static void -insertLocalStoreIndexArithmatic(string &kernelString, int numWorkItemsReq, int numXFormsPerWG, int Nr, int offset, int midPad) -{ - if(numXFormsPerWG == 1) { - kernelString += string(" lMemStore = sMem + ii;\n"); - } - else { - kernelString += string(" lMemStore = sMem + mad24(jj, ") + num2str((numWorkItemsReq + offset)*Nr + midPad) + string(", ii);\n"); - } -} - - -static void -createLocalMemfftKernelString(cl_fft_plan *plan) -{ - unsigned int radixArray[10]; - unsigned int numRadix; - - unsigned int n = plan->n.x; - - assert(n <= plan->max_work_item_per_workgroup * plan->max_radix && "signal lenght too big for local mem fft\n"); - - getRadixArray(n, radixArray, &numRadix, 0); - assert(numRadix > 0 && "no radix array supplied\n"); - - if(n/radixArray[0] > plan->max_work_item_per_workgroup) - getRadixArray(n, radixArray, &numRadix, plan->max_radix); - - assert(radixArray[0] <= plan->max_radix && "max radix choosen is greater than allowed\n"); - assert(n/radixArray[0] <= plan->max_work_item_per_workgroup && "required work items per xform greater than maximum work items allowed per work group for local mem fft\n"); - - unsigned int tmpLen = 1; - unsigned int i; - for(i = 0; i < numRadix; i++) - { - assert( radixArray[i] && !( (radixArray[i] - 1) & radixArray[i] ) ); - tmpLen *= radixArray[i]; - } - assert(tmpLen == n && "product of radices choosen doesnt match the length of signal\n"); - - int offset, midPad; - string localString(""), kernelName(""); - - clFFT_DataFormat dataFormat = plan->format; - string *kernelString = plan->kernel_string; - - - cl_fft_kernel_info **kInfo = &plan->kernel_info; - int kCount = 0; - - while(*kInfo) - { - kInfo = &(*kInfo)->next; - kCount++; - } - - kernelName = string("fft") + num2str(kCount); - - *kInfo = (cl_fft_kernel_info *) malloc(sizeof(cl_fft_kernel_info)); - (*kInfo)->kernel = 0; - (*kInfo)->lmem_size = 0; - (*kInfo)->num_workgroups = 0; - (*kInfo)->num_workitems_per_workgroup = 0; - (*kInfo)->dir = cl_fft_kernel_x; - (*kInfo)->in_place_possible = 1; - (*kInfo)->next = NULL; - (*kInfo)->kernel_name = (char *) malloc(sizeof(char)*(kernelName.size()+1)); - strcpy((*kInfo)->kernel_name, kernelName.c_str()); - - unsigned int numWorkItemsPerXForm = n / radixArray[0]; - unsigned int numWorkItemsPerWG = numWorkItemsPerXForm <= 64 ? 64 : numWorkItemsPerXForm; - assert(numWorkItemsPerWG <= plan->max_work_item_per_workgroup); - int numXFormsPerWG = numWorkItemsPerWG / numWorkItemsPerXForm; - (*kInfo)->num_workgroups = 1; - (*kInfo)->num_xforms_per_workgroup = numXFormsPerWG; - (*kInfo)->num_workitems_per_workgroup = numWorkItemsPerWG; - - unsigned int *N = radixArray; - unsigned int maxRadix = N[0]; - unsigned int lMemSize = 0; - - insertVariables(localString, maxRadix); - - lMemSize = insertGlobalLoadsAndTranspose(localString, n, numWorkItemsPerXForm, numXFormsPerWG, maxRadix, plan->min_mem_coalesce_width, dataFormat); - (*kInfo)->lmem_size = (lMemSize > (*kInfo)->lmem_size) ? lMemSize : (*kInfo)->lmem_size; - - string xcomp = string("x"); - string ycomp = string("y"); - - unsigned int Nprev = 1; - unsigned int len = n; - unsigned int r; - for(r = 0; r < numRadix; r++) - { - int numIter = N[0] / N[r]; - int numWorkItemsReq = n / N[r]; - int Ncurr = Nprev * N[r]; - insertfftKernel(localString, N[r], numIter); - - if(r < (numRadix - 1)) { - insertTwiddleKernel(localString, N[r], numIter, Nprev, len, numWorkItemsPerXForm); - lMemSize = getPadding(numWorkItemsPerXForm, Nprev, numWorkItemsReq, numXFormsPerWG, N[r], plan->num_local_mem_banks, &offset, &midPad); - (*kInfo)->lmem_size = (lMemSize > (*kInfo)->lmem_size) ? lMemSize : (*kInfo)->lmem_size; - insertLocalStoreIndexArithmatic(localString, numWorkItemsReq, numXFormsPerWG, N[r], offset, midPad); - insertLocalLoadIndexArithmatic(localString, Nprev, N[r], numWorkItemsReq, numWorkItemsPerXForm, numXFormsPerWG, offset, midPad); - insertLocalStores(localString, numIter, N[r], numWorkItemsPerXForm, numWorkItemsReq, offset, xcomp); - insertLocalLoads(localString, n, N[r], N[r+1], Nprev, Ncurr, numWorkItemsPerXForm, numWorkItemsReq, offset, xcomp); - insertLocalStores(localString, numIter, N[r], numWorkItemsPerXForm, numWorkItemsReq, offset, ycomp); - insertLocalLoads(localString, n, N[r], N[r+1], Nprev, Ncurr, numWorkItemsPerXForm, numWorkItemsReq, offset, ycomp); - Nprev = Ncurr; - len = len / N[r]; - } - } - - lMemSize = insertGlobalStoresAndTranspose(localString, n, maxRadix, N[numRadix - 1], numWorkItemsPerXForm, numXFormsPerWG, plan->min_mem_coalesce_width, dataFormat); - (*kInfo)->lmem_size = (lMemSize > (*kInfo)->lmem_size) ? lMemSize : (*kInfo)->lmem_size; - - insertHeader(*kernelString, kernelName, dataFormat); - *kernelString += string("{\n"); - if((*kInfo)->lmem_size) - *kernelString += string(" __local float sMem[") + num2str((*kInfo)->lmem_size) + string("];\n"); - *kernelString += localString; - *kernelString += string("}\n"); -} - -// For n larger than what can be computed using local memory fft, global transposes -// multiple kernel launces is needed. For these sizes, n can be decomposed using -// much larger base radices i.e. say n = 262144 = 128 x 64 x 32. Thus three kernel -// launches will be needed, first computing 64 x 32, length 128 ffts, second computing -// 128 x 32 length 64 ffts, and finally a kernel computing 128 x 64 length 32 ffts. -// Each of these base radices can futher be divided into factors so that each of these -// base ffts can be computed within one kernel launch using in-register ffts and local -// memory transposes i.e for the first kernel above which computes 64 x 32 ffts on length -// 128, 128 can be decomposed into 128 = 16 x 8 i.e. 8 work items can compute 8 length -// 16 ffts followed by transpose using local memory followed by each of these eight -// work items computing 2 length 8 ffts thus computing 16 length 8 ffts in total. This -// means only 8 work items are needed for computing one length 128 fft. If we choose -// work group size of say 64, we can compute 64/8 = 8 length 128 ffts within one -// work group. Since we need to compute 64 x 32 length 128 ffts in first kernel, this -// means we need to launch 64 x 32 / 8 = 256 work groups with 64 work items in each -// work group where each work group is computing 8 length 128 ffts where each length -// 128 fft is computed by 8 work items. Same logic can be applied to other two kernels -// in this example. Users can play with difference base radices and difference -// decompositions of base radices to generates different kernels and see which gives -// best performance. Following function is just fixed to use 128 as base radix - -void -getGlobalRadixInfo(int n, int *radix, int *R1, int *R2, int *numRadices) -{ - int baseRadix = min(n, 128); - - int numR = 0; - int N = n; - while(N > baseRadix) - { - N /= baseRadix; - numR++; - } - - for(int i = 0; i < numR; i++) - radix[i] = baseRadix; - - radix[numR] = N; - numR++; - *numRadices = numR; - - for(int i = 0; i < numR; i++) - { - int B = radix[i]; - if(B <= 8) - { - R1[i] = B; - R2[i] = 1; - continue; - } - - int r1 = 2; - int r2 = B / r1; - while(r2 > r1) - { - r1 *=2; - r2 = B / r1; - } - R1[i] = r1; - R2[i] = r2; - } -} - -static void -createGlobalFFTKernelString(cl_fft_plan *plan, int n, int BS, cl_fft_kernel_dir dir, int vertBS) -{ - int i, j, k, t; - int radixArr[10] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; - int R1Arr[10] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; - int R2Arr[10] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; - int radix, R1, R2; - int numRadices; - - int maxThreadsPerBlock = plan->max_work_item_per_workgroup; - int maxArrayLen = plan->max_radix; - int batchSize = plan->min_mem_coalesce_width; - clFFT_DataFormat dataFormat = plan->format; - int vertical = (dir == cl_fft_kernel_x) ? 0 : 1; - - getGlobalRadixInfo(n, radixArr, R1Arr, R2Arr, &numRadices); - - int numPasses = numRadices; - - string localString(""), kernelName(""); - string *kernelString = plan->kernel_string; - cl_fft_kernel_info **kInfo = &plan->kernel_info; - int kCount = 0; - - while(*kInfo) - { - kInfo = &(*kInfo)->next; - kCount++; - } - - int N = n; - int m = (int)log2(n); - int Rinit = vertical ? BS : 1; - batchSize = vertical ? min(BS, batchSize) : batchSize; - int passNum; - - for(passNum = 0; passNum < numPasses; passNum++) - { - - localString.clear(); - kernelName.clear(); - - radix = radixArr[passNum]; - R1 = R1Arr[passNum]; - R2 = R2Arr[passNum]; - - int strideI = Rinit; - for(i = 0; i < numPasses; i++) - if(i != passNum) - strideI *= radixArr[i]; - - int strideO = Rinit; - for(i = 0; i < passNum; i++) - strideO *= radixArr[i]; - - int threadsPerXForm = R2; - batchSize = R2 == 1 ? plan->max_work_item_per_workgroup : batchSize; - batchSize = min(batchSize, strideI); - int threadsPerBlock = batchSize * threadsPerXForm; - threadsPerBlock = min(threadsPerBlock, maxThreadsPerBlock); - batchSize = threadsPerBlock / threadsPerXForm; - assert(R2 <= R1); - assert(R1*R2 == radix); - assert(R1 <= maxArrayLen); - assert(threadsPerBlock <= maxThreadsPerBlock); - - int numIter = R1 / R2; - int gInInc = threadsPerBlock / batchSize; - - - int lgStrideO = (int)log2(strideO); - int numBlocksPerXForm = strideI / batchSize; - int numBlocks = numBlocksPerXForm; - if(!vertical) - numBlocks *= BS; - else - numBlocks *= vertBS; - - kernelName = string("fft") + num2str(kCount); - *kInfo = (cl_fft_kernel_info *) malloc(sizeof(cl_fft_kernel_info)); - (*kInfo)->kernel = 0; - if(R2 == 1) - (*kInfo)->lmem_size = 0; - else - { - if(strideO == 1) - (*kInfo)->lmem_size = (radix + 1)*batchSize; - else - (*kInfo)->lmem_size = threadsPerBlock*R1; - } - (*kInfo)->num_workgroups = numBlocks; - (*kInfo)->num_xforms_per_workgroup = 1; - (*kInfo)->num_workitems_per_workgroup = threadsPerBlock; - (*kInfo)->dir = dir; - if( (passNum == (numPasses - 1)) && (numPasses & 1) ) - (*kInfo)->in_place_possible = 1; - else - (*kInfo)->in_place_possible = 0; - (*kInfo)->next = NULL; - (*kInfo)->kernel_name = (char *) malloc(sizeof(char)*(kernelName.size()+1)); - strcpy((*kInfo)->kernel_name, kernelName.c_str()); - - insertVariables(localString, R1); - - if(vertical) - { - localString += string("xNum = groupId >> ") + num2str((int)log2(numBlocksPerXForm)) + string(";\n"); - localString += string("groupId = groupId & ") + num2str(numBlocksPerXForm - 1) + string(";\n"); - localString += string("indexIn = mad24(groupId, ") + num2str(batchSize) + string(", xNum << ") + num2str((int)log2(n*BS)) + string(");\n"); - localString += string("tid = mul24(groupId, ") + num2str(batchSize) + string(");\n"); - localString += string("i = tid >> ") + num2str(lgStrideO) + string(";\n"); - localString += string("j = tid & ") + num2str(strideO - 1) + string(";\n"); - int stride = radix*Rinit; - for(i = 0; i < passNum; i++) - stride *= radixArr[i]; - localString += string("indexOut = mad24(i, ") + num2str(stride) + string(", j + ") + string("(xNum << ") + num2str((int) log2(n*BS)) + string("));\n"); - localString += string("bNum = groupId;\n"); - } - else - { - int lgNumBlocksPerXForm = (int)log2(numBlocksPerXForm); - localString += string("bNum = groupId & ") + num2str(numBlocksPerXForm - 1) + string(";\n"); - localString += string("xNum = groupId >> ") + num2str(lgNumBlocksPerXForm) + string(";\n"); - localString += string("indexIn = mul24(bNum, ") + num2str(batchSize) + string(");\n"); - localString += string("tid = indexIn;\n"); - localString += string("i = tid >> ") + num2str(lgStrideO) + string(";\n"); - localString += string("j = tid & ") + num2str(strideO - 1) + string(";\n"); - int stride = radix*Rinit; - for(i = 0; i < passNum; i++) - stride *= radixArr[i]; - localString += string("indexOut = mad24(i, ") + num2str(stride) + string(", j);\n"); - localString += string("indexIn += (xNum << ") + num2str(m) + string(");\n"); - localString += string("indexOut += (xNum << ") + num2str(m) + string(");\n"); - } - - // Load Data - int lgBatchSize = (int)log2(batchSize); - localString += string("tid = lId;\n"); - localString += string("i = tid & ") + num2str(batchSize - 1) + string(";\n"); - localString += string("j = tid >> ") + num2str(lgBatchSize) + string(";\n"); - localString += string("indexIn += mad24(j, ") + num2str(strideI) + string(", i);\n"); - - if(dataFormat == clFFT_SplitComplexFormat) - { - localString += string("in_real += indexIn;\n"); - localString += string("in_imag += indexIn;\n"); - for(j = 0; j < R1; j++) - localString += string("a[") + num2str(j) + string("].x = in_real[") + num2str(j*gInInc*strideI) + string("];\n"); - for(j = 0; j < R1; j++) - localString += string("a[") + num2str(j) + string("].y = in_imag[") + num2str(j*gInInc*strideI) + string("];\n"); - } - else - { - localString += string("in += indexIn;\n"); - for(j = 0; j < R1; j++) - localString += string("a[") + num2str(j) + string("] = in[") + num2str(j*gInInc*strideI) + string("];\n"); - } - - localString += string("fftKernel") + num2str(R1) + string("(a, dir);\n"); - - if(R2 > 1) - { - // twiddle - for(k = 1; k < R1; k++) - { - localString += string("ang = dir*(2.0f*M_PI*") + num2str(k) + string("/") + num2str(radix) + string(")*j;\n"); - localString += string("w = (float2)(native_cos(ang), native_sin(ang));\n"); - localString += string("a[") + num2str(k) + string("] = complexMul(a[") + num2str(k) + string("], w);\n"); - } - - // shuffle - numIter = R1 / R2; - localString += string("indexIn = mad24(j, ") + num2str(threadsPerBlock*numIter) + string(", i);\n"); - localString += string("lMemStore = sMem + tid;\n"); - localString += string("lMemLoad = sMem + indexIn;\n"); - for(k = 0; k < R1; k++) - localString += string("lMemStore[") + num2str(k*threadsPerBlock) + string("] = a[") + num2str(k) + string("].x;\n"); - localString += string("barrier(CLK_LOCAL_MEM_FENCE);\n"); - for(k = 0; k < numIter; k++) - for(t = 0; t < R2; t++) - localString += string("a[") + num2str(k*R2+t) + string("].x = lMemLoad[") + num2str(t*batchSize + k*threadsPerBlock) + string("];\n"); - localString += string("barrier(CLK_LOCAL_MEM_FENCE);\n"); - for(k = 0; k < R1; k++) - localString += string("lMemStore[") + num2str(k*threadsPerBlock) + string("] = a[") + num2str(k) + string("].y;\n"); - localString += string("barrier(CLK_LOCAL_MEM_FENCE);\n"); - for(k = 0; k < numIter; k++) - for(t = 0; t < R2; t++) - localString += string("a[") + num2str(k*R2+t) + string("].y = lMemLoad[") + num2str(t*batchSize + k*threadsPerBlock) + string("];\n"); - localString += string("barrier(CLK_LOCAL_MEM_FENCE);\n"); - - for(j = 0; j < numIter; j++) - localString += string("fftKernel") + num2str(R2) + string("(a + ") + num2str(j*R2) + string(", dir);\n"); - } - - // twiddle - if(passNum < (numPasses - 1)) - { - localString += string("l = ((bNum << ") + num2str(lgBatchSize) + string(") + i) >> ") + num2str(lgStrideO) + string(";\n"); - localString += string("k = j << ") + num2str((int)log2(R1/R2)) + string(";\n"); - localString += string("ang1 = dir*(2.0f*M_PI/") + num2str(N) + string(")*l;\n"); - for(t = 0; t < R1; t++) - { - localString += string("ang = ang1*(k + ") + num2str((t%R2)*R1 + (t/R2)) + string(");\n"); - localString += string("w = (float2)(native_cos(ang), native_sin(ang));\n"); - localString += string("a[") + num2str(t) + string("] = complexMul(a[") + num2str(t) + string("], w);\n"); - } - } - - // Store Data - if(strideO == 1) - { - - localString += string("lMemStore = sMem + mad24(i, ") + num2str(radix + 1) + string(", j << ") + num2str((int)log2(R1/R2)) + string(");\n"); - localString += string("lMemLoad = sMem + mad24(tid >> ") + num2str((int)log2(radix)) + string(", ") + num2str(radix+1) + string(", tid & ") + num2str(radix-1) + string(");\n"); - - for(i = 0; i < R1/R2; i++) - for(j = 0; j < R2; j++) - localString += string("lMemStore[ ") + num2str(i + j*R1) + string("] = a[") + num2str(i*R2+j) + string("].x;\n"); - localString += string("barrier(CLK_LOCAL_MEM_FENCE);\n"); - if(threadsPerBlock >= radix) - { - for(i = 0; i < R1; i++) - localString += string("a[") + num2str(i) + string("].x = lMemLoad[") + num2str(i*(radix+1)*(threadsPerBlock/radix)) + string("];\n"); - } - else - { - int innerIter = radix/threadsPerBlock; - int outerIter = R1/innerIter; - for(i = 0; i < outerIter; i++) - for(j = 0; j < innerIter; j++) - localString += string("a[") + num2str(i*innerIter+j) + string("].x = lMemLoad[") + num2str(j*threadsPerBlock + i*(radix+1)) + string("];\n"); - } - localString += string("barrier(CLK_LOCAL_MEM_FENCE);\n"); - - for(i = 0; i < R1/R2; i++) - for(j = 0; j < R2; j++) - localString += string("lMemStore[ ") + num2str(i + j*R1) + string("] = a[") + num2str(i*R2+j) + string("].y;\n"); - localString += string("barrier(CLK_LOCAL_MEM_FENCE);\n"); - if(threadsPerBlock >= radix) - { - for(i = 0; i < R1; i++) - localString += string("a[") + num2str(i) + string("].y = lMemLoad[") + num2str(i*(radix+1)*(threadsPerBlock/radix)) + string("];\n"); - } - else - { - int innerIter = radix/threadsPerBlock; - int outerIter = R1/innerIter; - for(i = 0; i < outerIter; i++) - for(j = 0; j < innerIter; j++) - localString += string("a[") + num2str(i*innerIter+j) + string("].y = lMemLoad[") + num2str(j*threadsPerBlock + i*(radix+1)) + string("];\n"); - } - localString += string("barrier(CLK_LOCAL_MEM_FENCE);\n"); - - localString += string("indexOut += tid;\n"); - if(dataFormat == clFFT_SplitComplexFormat) { - localString += string("out_real += indexOut;\n"); - localString += string("out_imag += indexOut;\n"); - for(k = 0; k < R1; k++) - localString += string("out_real[") + num2str(k*threadsPerBlock) + string("] = a[") + num2str(k) + string("].x;\n"); - for(k = 0; k < R1; k++) - localString += string("out_imag[") + num2str(k*threadsPerBlock) + string("] = a[") + num2str(k) + string("].y;\n"); - } - else { - localString += string("out += indexOut;\n"); - for(k = 0; k < R1; k++) - localString += string("out[") + num2str(k*threadsPerBlock) + string("] = a[") + num2str(k) + string("];\n"); - } - - } - else - { - localString += string("indexOut += mad24(j, ") + num2str(numIter*strideO) + string(", i);\n"); - if(dataFormat == clFFT_SplitComplexFormat) { - localString += string("out_real += indexOut;\n"); - localString += string("out_imag += indexOut;\n"); - for(k = 0; k < R1; k++) - localString += string("out_real[") + num2str(((k%R2)*R1 + (k/R2))*strideO) + string("] = a[") + num2str(k) + string("].x;\n"); - for(k = 0; k < R1; k++) - localString += string("out_imag[") + num2str(((k%R2)*R1 + (k/R2))*strideO) + string("] = a[") + num2str(k) + string("].y;\n"); - } - else { - localString += string("out += indexOut;\n"); - for(k = 0; k < R1; k++) - localString += string("out[") + num2str(((k%R2)*R1 + (k/R2))*strideO) + string("] = a[") + num2str(k) + string("];\n"); - } - } - - insertHeader(*kernelString, kernelName, dataFormat); - *kernelString += string("{\n"); - if((*kInfo)->lmem_size) - *kernelString += string(" __local float sMem[") + num2str((*kInfo)->lmem_size) + string("];\n"); - *kernelString += localString; - *kernelString += string("}\n"); - - N /= radix; - kInfo = &(*kInfo)->next; - kCount++; - } -} - -void FFT1D(cl_fft_plan *plan, cl_fft_kernel_dir dir) -{ - unsigned int radixArray[10]; - unsigned int numRadix; - - switch(dir) - { - case cl_fft_kernel_x: - if(plan->n.x > plan->max_localmem_fft_size) - { - createGlobalFFTKernelString(plan, plan->n.x, 1, cl_fft_kernel_x, 1); - } - else if(plan->n.x > 1) - { - getRadixArray(plan->n.x, radixArray, &numRadix, 0); - if(plan->n.x / radixArray[0] <= plan->max_work_item_per_workgroup) - { - createLocalMemfftKernelString(plan); - } - else - { - getRadixArray(plan->n.x, radixArray, &numRadix, plan->max_radix); - if(plan->n.x / radixArray[0] <= plan->max_work_item_per_workgroup) - createLocalMemfftKernelString(plan); - else - createGlobalFFTKernelString(plan, plan->n.x, 1, cl_fft_kernel_x, 1); - } - } - break; - - case cl_fft_kernel_y: - if(plan->n.y > 1) - createGlobalFFTKernelString(plan, plan->n.y, plan->n.x, cl_fft_kernel_y, 1); - break; - - case cl_fft_kernel_z: - if(plan->n.z > 1) - createGlobalFFTKernelString(plan, plan->n.z, plan->n.x*plan->n.y, cl_fft_kernel_z, 1); - default: - return; - } -} - diff --git a/src/algorithms/libs/fft_setup.cc b/src/algorithms/libs/fft_setup.cc deleted file mode 100644 index 6d2025d66..000000000 --- a/src/algorithms/libs/fft_setup.cc +++ /dev/null @@ -1,402 +0,0 @@ - -// -// File: fft_setup.cpp -// -// Version: <1.0> -// -// Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Inc. ("Apple") -// in consideration of your agreement to the following terms, and your use, -// installation, modification or redistribution of this Apple software -// constitutes acceptance of these terms. If you do not agree with these -// terms, please do not use, install, modify or redistribute this Apple -// software. -// -// In consideration of your agreement to abide by the following terms, and -// subject to these terms, Apple grants you a personal, non - exclusive -// license, under Apple's copyrights in this original Apple software ( the -// "Apple Software" ), to use, reproduce, modify and redistribute the Apple -// Software, with or without modifications, in source and / or binary forms; -// provided that if you redistribute the Apple Software in its entirety and -// without modifications, you must retain this notice and the following text -// and disclaimers in all such redistributions of the Apple Software. Neither -// the name, trademarks, service marks or logos of Apple Inc. may be used to -// endorse or promote products derived from the Apple Software without specific -// prior written permission from Apple. Except as expressly stated in this -// notice, no other rights or licenses, express or implied, are granted by -// Apple herein, including but not limited to any patent rights that may be -// infringed by your derivative works or by other works in which the Apple -// Software may be incorporated. -// -// The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO -// WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED -// WARRANTIES OF NON - INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A -// PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION -// ALONE OR IN COMBINATION WITH YOUR PRODUCTS. -// -// IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR -// CONSEQUENTIAL DAMAGES ( INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -// INTERRUPTION ) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION -// AND / OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER -// UNDER THEORY OF CONTRACT, TORT ( INCLUDING NEGLIGENCE ), STRICT LIABILITY OR -// OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Copyright ( C ) 2008 Apple Inc. All Rights Reserved. -// -//////////////////////////////////////////////////////////////////////////////////////////////////// - - -#include "fft_internal.h" -#include "fft_base_kernels.h" -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace std; - -extern void getKernelWorkDimensions(cl_fft_plan *plan, cl_fft_kernel_info *kernelInfo, cl_int *batchSize, size_t *gWorkItems, size_t *lWorkItems); - -static void -getBlockConfigAndKernelString(cl_fft_plan *plan) -{ - plan->temp_buffer_needed = 0; - *plan->kernel_string += baseKernels; - - if(plan->format == clFFT_SplitComplexFormat) - *plan->kernel_string += twistKernelPlannar; - else - *plan->kernel_string += twistKernelInterleaved; - - switch(plan->dim) - { - case clFFT_1D: - FFT1D(plan, cl_fft_kernel_x); - break; - - case clFFT_2D: - FFT1D(plan, cl_fft_kernel_x); - FFT1D(plan, cl_fft_kernel_y); - break; - - case clFFT_3D: - FFT1D(plan, cl_fft_kernel_x); - FFT1D(plan, cl_fft_kernel_y); - FFT1D(plan, cl_fft_kernel_z); - break; - - default: - return; - } - - plan->temp_buffer_needed = 0; - cl_fft_kernel_info *kInfo = plan->kernel_info; - while(kInfo) - { - plan->temp_buffer_needed |= !kInfo->in_place_possible; - kInfo = kInfo->next; - } -} - - -static void -deleteKernelInfo(cl_fft_kernel_info *kInfo) -{ - if(kInfo) - { - if(kInfo->kernel_name) - free(kInfo->kernel_name); - if(kInfo->kernel) - clReleaseKernel(kInfo->kernel); - free(kInfo); - } -} - -static void -destroy_plan(cl_fft_plan *Plan) -{ - cl_fft_kernel_info *kernel_info = Plan->kernel_info; - - while(kernel_info) - { - cl_fft_kernel_info *tmp = kernel_info->next; - deleteKernelInfo(kernel_info); - kernel_info = tmp; - } - - Plan->kernel_info = NULL; - - if(Plan->kernel_string) - { - delete Plan->kernel_string; - Plan->kernel_string = NULL; - } - if(Plan->twist_kernel) - { - clReleaseKernel(Plan->twist_kernel); - Plan->twist_kernel = NULL; - } - if(Plan->program) - { - clReleaseProgram(Plan->program); - Plan->program = NULL; - } - if(Plan->tempmemobj) - { - clReleaseMemObject(Plan->tempmemobj); - Plan->tempmemobj = NULL; - } - if(Plan->tempmemobj_real) - { - clReleaseMemObject(Plan->tempmemobj_real); - Plan->tempmemobj_real = NULL; - } - if(Plan->tempmemobj_imag) - { - clReleaseMemObject(Plan->tempmemobj_imag); - Plan->tempmemobj_imag = NULL; - } -} - -static int -createKernelList(cl_fft_plan *plan) -{ - cl_program program = plan->program; - cl_fft_kernel_info *kernel_info = plan->kernel_info; - - cl_int err; - while(kernel_info) - { - kernel_info->kernel = clCreateKernel(program, kernel_info->kernel_name, &err); - if(!kernel_info->kernel || err != CL_SUCCESS) - return err; - kernel_info = kernel_info->next; - } - - if(plan->format == clFFT_SplitComplexFormat) - plan->twist_kernel = clCreateKernel(program, "clFFT_1DTwistSplit", &err); - else - plan->twist_kernel = clCreateKernel(program, "clFFT_1DTwistInterleaved", &err); - - if(!plan->twist_kernel || err) - return err; - - return CL_SUCCESS; -} - -int getMaxKernelWorkGroupSize(cl_fft_plan *plan, unsigned int *max_wg_size, unsigned int num_devices, cl_device_id *devices) -{ - int reg_needed = 0; - *max_wg_size = std::numeric_limits::max(); - int err; - unsigned wg_size; - - unsigned int i; - for(i = 0; i < num_devices; i++) - { - cl_fft_kernel_info *kInfo = plan->kernel_info; - while(kInfo) - { - err = clGetKernelWorkGroupInfo(kInfo->kernel, devices[i], CL_KERNEL_WORK_GROUP_SIZE, sizeof(size_t), &wg_size, NULL); - if(err != CL_SUCCESS) - return -1; - - if(wg_size < kInfo->num_workitems_per_workgroup) - reg_needed |= 1; - - if(*max_wg_size > wg_size) - *max_wg_size = wg_size; - - kInfo = kInfo->next; - } - } - - return reg_needed; -} - -#define ERR_MACRO(err) { \ - if( err != CL_SUCCESS) \ - { \ - if(error_code) \ - *error_code = err; \ - clFFT_DestroyPlan((clFFT_Plan) plan); \ - return (clFFT_Plan) NULL; \ - } \ - } - -clFFT_Plan -clFFT_CreatePlan(cl_context context, clFFT_Dim3 n, clFFT_Dimension dim, clFFT_DataFormat dataFormat, cl_int *error_code ) -{ - int i; - cl_int err; - int isPow2 = 1; - cl_fft_plan *plan = NULL; - ostringstream kString; - int num_devices; - int gpu_found = 0; - cl_device_id devices[16]; - size_t ret_size; - cl_device_type device_type; - - if(!context) - ERR_MACRO(CL_INVALID_VALUE); - - isPow2 |= n.x && !( (n.x - 1) & n.x ); - isPow2 |= n.y && !( (n.y - 1) & n.y ); - isPow2 |= n.z && !( (n.z - 1) & n.z ); - - if(!isPow2) - ERR_MACRO(CL_INVALID_VALUE); - - if( (dim == clFFT_1D && (n.y != 1 || n.z != 1)) || (dim == clFFT_2D && n.z != 1) ) - ERR_MACRO(CL_INVALID_VALUE); - - plan = (cl_fft_plan *) malloc(sizeof(cl_fft_plan)); - if(!plan) - ERR_MACRO(CL_OUT_OF_RESOURCES); - - plan->context = context; - clRetainContext(context); - plan->n = n; - plan->dim = dim; - plan->format = dataFormat; - plan->kernel_info = 0; - plan->num_kernels = 0; - plan->twist_kernel = 0; - plan->program = 0; - plan->temp_buffer_needed = 0; - plan->last_batch_size = 0; - plan->tempmemobj = 0; - plan->tempmemobj_real = 0; - plan->tempmemobj_imag = 0; - plan->max_localmem_fft_size = 2048; - plan->max_work_item_per_workgroup = 256; - plan->max_radix = 16; - plan->min_mem_coalesce_width = 16; - plan->num_local_mem_banks = 16; - -patch_kernel_source: - - plan->kernel_string = new string(""); - if(!plan->kernel_string) - ERR_MACRO(CL_OUT_OF_RESOURCES); - - getBlockConfigAndKernelString(plan); - - const char *source_str = plan->kernel_string->c_str(); - plan->program = clCreateProgramWithSource(context, 1, (const char**) &source_str, NULL, &err); - ERR_MACRO(err); - - err = clGetContextInfo(context, CL_CONTEXT_DEVICES, sizeof(devices), devices, &ret_size); - ERR_MACRO(err); - - num_devices = (int)(ret_size / sizeof(cl_device_id)); - - for(i = 0; i < num_devices; i++) - { - err = clGetDeviceInfo(devices[i], CL_DEVICE_TYPE, sizeof(device_type), &device_type, NULL); - ERR_MACRO(err); - - if(device_type == CL_DEVICE_TYPE_GPU) - { - gpu_found = 1; - err = clBuildProgram(plan->program, 1, &devices[i], "-cl-mad-enable", NULL, NULL); - if (err != CL_SUCCESS) - { - char *build_log; - char devicename[200]; - size_t log_size; - - err = clGetProgramBuildInfo(plan->program, devices[i], CL_PROGRAM_BUILD_LOG, 0, NULL, &log_size); - ERR_MACRO(err); - - build_log = (char *) malloc(log_size + 1); - - err = clGetProgramBuildInfo(plan->program, devices[i], CL_PROGRAM_BUILD_LOG, log_size, build_log, NULL); - ERR_MACRO(err); - - err = clGetDeviceInfo(devices[i], CL_DEVICE_NAME, sizeof(devicename), devicename, NULL); - ERR_MACRO(err); - - fprintf(stdout, "FFT program build log on device %s\n", devicename); - fprintf(stdout, "%s\n", build_log); - free(build_log); - - ERR_MACRO(err); - } - } - } - - if(!gpu_found) - ERR_MACRO(CL_INVALID_CONTEXT); - - err = createKernelList(plan); - ERR_MACRO(err); - - // we created program and kernels based on "some max work group size (default 256)" ... this work group size - // may be larger than what kernel may execute with ... if thats the case we need to regenerate the kernel source - // setting this as limit i.e max group size and rebuild. - unsigned int max_kernel_wg_size; - int patching_req = getMaxKernelWorkGroupSize(plan, &max_kernel_wg_size, num_devices, devices); - if(patching_req == -1) - { - ERR_MACRO(err); - } - - if(patching_req) - { - destroy_plan(plan); - plan->max_work_item_per_workgroup = max_kernel_wg_size; - goto patch_kernel_source; - } - - cl_fft_kernel_info *kInfo = plan->kernel_info; - while(kInfo) - { - plan->num_kernels++; - kInfo = kInfo->next; - } - - if(error_code) - *error_code = CL_SUCCESS; - - return (clFFT_Plan) plan; -} - -void -clFFT_DestroyPlan(clFFT_Plan plan) -{ - cl_fft_plan *Plan = (cl_fft_plan *) plan; - if(Plan) - { - destroy_plan(Plan); - clReleaseContext(Plan->context); - free(Plan); - } -} - -void clFFT_DumpPlan( clFFT_Plan Plan, FILE *file) -{ - size_t gDim, lDim; - FILE *out; - if(!file) - out = stdout; - else - out = file; - - cl_fft_plan *plan = (cl_fft_plan *) Plan; - cl_fft_kernel_info *kInfo = plan->kernel_info; - - while(kInfo) - { - cl_int s = 1; - getKernelWorkDimensions(plan, kInfo, &s, &gDim, &lDim); - fprintf(out, "Run kernel %s with global dim = {%zd*BatchSize}, local dim={%zd}\n", kInfo->kernel_name, gDim, lDim); - kInfo = kInfo->next; - } - fprintf(out, "%s\n", plan->kernel_string->c_str()); -} diff --git a/src/algorithms/libs/galileo_e1_signal_processing.cc b/src/algorithms/libs/galileo_e1_signal_processing.cc index 49ce4d0f6..ebeefcccf 100644 --- a/src/algorithms/libs/galileo_e1_signal_processing.cc +++ b/src/algorithms/libs/galileo_e1_signal_processing.cc @@ -74,7 +74,7 @@ void galileo_e1_code_gen_int(int* _dest, char _Signal[3], signed int _prn) void galileo_e1_sinboc_11_gen_int(int* _dest, int* _prn, unsigned int _length_out) { const unsigned int _length_in = Galileo_E1_B_CODE_LENGTH_CHIPS; - unsigned int _period = static_cast( _length_out / _length_in ); + unsigned int _period = static_cast(_length_out / _length_in); for (unsigned int i = 0; i < _length_in; i++) { for (unsigned int j = 0; j < (_period / 2); j++) @@ -83,7 +83,7 @@ void galileo_e1_sinboc_11_gen_int(int* _dest, int* _prn, unsigned int _length_ou } for (unsigned int j = (_period / 2); j < _period; j++) { - _dest[i * _period + j] = - _prn[i]; + _dest[i * _period + j] = -_prn[i]; } } } @@ -102,7 +102,7 @@ void galileo_e1_sinboc_61_gen_int(int* _dest, int* _prn, unsigned int _length_ou } for (unsigned int j = 1; j < _period; j += 2) { - _dest[i * _period + j] = - _prn[i]; + _dest[i * _period + j] = -_prn[i]; } } } @@ -115,26 +115,26 @@ void galileo_e1_gen_float(float* _dest, int* _prn, char _Signal[3]) const float alpha = sqrt(10.0 / 11.0); const float beta = sqrt(1.0 / 11.0); - int sinboc_11[12 * 4092]; // _codeLength not accepted by Clang + int sinboc_11[12 * 4092]; // _codeLength not accepted by Clang int sinboc_61[12 * 4092]; - galileo_e1_sinboc_11_gen_int(sinboc_11, _prn, _codeLength); //generate sinboc(1,1) 12 samples per chip - galileo_e1_sinboc_61_gen_int(sinboc_61, _prn, _codeLength); //generate sinboc(6,1) 12 samples per chip + galileo_e1_sinboc_11_gen_int(sinboc_11, _prn, _codeLength); //generate sinboc(1,1) 12 samples per chip + galileo_e1_sinboc_61_gen_int(sinboc_61, _prn, _codeLength); //generate sinboc(6,1) 12 samples per chip if (_galileo_signal.rfind("1B") != std::string::npos && _galileo_signal.length() >= 2) { for (unsigned int i = 0; i < _codeLength; i++) { - _dest[i] = alpha * static_cast(sinboc_11[i]) + - beta * static_cast(sinboc_61[i]); + _dest[i] = alpha * static_cast(sinboc_11[i]) + + beta * static_cast(sinboc_61[i]); } } else if (_galileo_signal.rfind("1C") != std::string::npos && _galileo_signal.length() >= 2) { for (unsigned int i = 0; i < _codeLength; i++) { - _dest[i] = alpha * static_cast(sinboc_11[i]) - - beta * static_cast(sinboc_61[i]); + _dest[i] = alpha * static_cast(sinboc_11[i]) - + beta * static_cast(sinboc_61[i]); } } else @@ -143,23 +143,21 @@ void galileo_e1_gen_float(float* _dest, int* _prn, char _Signal[3]) void galileo_e1_code_gen_float_sampled(float* _dest, char _Signal[3], - bool _cboc, unsigned int _prn, signed int _fs, unsigned int _chip_shift, - bool _secondary_flag) + bool _cboc, unsigned int _prn, signed int _fs, unsigned int _chip_shift, + bool _secondary_flag) { // This function is based on the GNU software GPS for MATLAB in Kay Borre's book std::string _galileo_signal = _Signal; unsigned int _samplesPerCode; - const int _codeFreqBasis = Galileo_E1_CODE_CHIP_RATE_HZ; //Hz + const int _codeFreqBasis = Galileo_E1_CODE_CHIP_RATE_HZ; //Hz unsigned int _codeLength = Galileo_E1_B_CODE_LENGTH_CHIPS; int primary_code_E1_chips[static_cast(Galileo_E1_B_CODE_LENGTH_CHIPS)]; - _samplesPerCode = static_cast( static_cast(_fs) / (static_cast(_codeFreqBasis ) / static_cast(_codeLength))); + _samplesPerCode = static_cast(static_cast(_fs) / (static_cast(_codeFreqBasis) / static_cast(_codeLength))); const int _samplesPerChip = (_cboc == true) ? 12 : 2; - const unsigned int delay = ((static_cast(Galileo_E1_B_CODE_LENGTH_CHIPS) - _chip_shift) - % static_cast(Galileo_E1_B_CODE_LENGTH_CHIPS)) - * _samplesPerCode / Galileo_E1_B_CODE_LENGTH_CHIPS; + const unsigned int delay = ((static_cast(Galileo_E1_B_CODE_LENGTH_CHIPS) - _chip_shift) % static_cast(Galileo_E1_B_CODE_LENGTH_CHIPS)) * _samplesPerCode / Galileo_E1_B_CODE_LENGTH_CHIPS; - galileo_e1_code_gen_int(primary_code_E1_chips, _Signal, _prn); //generate Galileo E1 code, 1 sample per chip + galileo_e1_code_gen_int(primary_code_E1_chips, _Signal, _prn); //generate Galileo E1 code, 1 sample per chip float* _signal_E1; @@ -168,16 +166,16 @@ void galileo_e1_code_gen_float_sampled(float* _dest, char _Signal[3], if (_cboc == true) { - galileo_e1_gen_float(_signal_E1, primary_code_E1_chips, _Signal); //generate cboc 12 samples per chip + galileo_e1_gen_float(_signal_E1, primary_code_E1_chips, _Signal); //generate cboc 12 samples per chip } else { int _signal_E1_int[_codeLength]; - galileo_e1_sinboc_11_gen_int(_signal_E1_int, primary_code_E1_chips, _codeLength); //generate sinboc(1,1) 2 samples per chip + galileo_e1_sinboc_11_gen_int(_signal_E1_int, primary_code_E1_chips, _codeLength); //generate sinboc(1,1) 2 samples per chip - for( unsigned int ii = 0; ii < _codeLength; ++ii ) + for (unsigned int ii = 0; ii < _codeLength; ++ii) { - _signal_E1[ii] = static_cast< float >( _signal_E1_int[ii] ); + _signal_E1[ii] = static_cast(_signal_E1_int[ii]); } } @@ -185,7 +183,7 @@ void galileo_e1_code_gen_float_sampled(float* _dest, char _Signal[3], { float* _resampled_signal = new float[_samplesPerCode]; resampler(_signal_E1, _resampled_signal, _samplesPerChip * _codeFreqBasis, _fs, - _codeLength, _samplesPerCode); //resamples code to fs + _codeLength, _samplesPerCode); //resamples code to fs delete[] _signal_E1; _signal_E1 = _resampled_signal; @@ -199,8 +197,7 @@ void galileo_e1_code_gen_float_sampled(float* _dest, char _Signal[3], { for (unsigned k = 0; k < _samplesPerCode; k++) { - _signal_E1C_secondary[i*_samplesPerCode + k] = _signal_E1[k] - * (Galileo_E1_C_SECONDARY_CODE.at(i) == '0' ? 1.0f : -1.0f); + _signal_E1C_secondary[i * _samplesPerCode + k] = _signal_E1[k] * (Galileo_E1_C_SECONDARY_CODE.at(i) == '0' ? 1.0f : -1.0f); } } @@ -220,13 +217,13 @@ void galileo_e1_code_gen_float_sampled(float* _dest, char _Signal[3], void galileo_e1_code_gen_complex_sampled(std::complex* _dest, char _Signal[3], - bool _cboc, unsigned int _prn, signed int _fs, unsigned int _chip_shift, - bool _secondary_flag) + bool _cboc, unsigned int _prn, signed int _fs, unsigned int _chip_shift, + bool _secondary_flag) { std::string _galileo_signal = _Signal; - const int _codeFreqBasis = Galileo_E1_CODE_CHIP_RATE_HZ; //Hz - unsigned int _samplesPerCode = static_cast( static_cast(_fs) / - (static_cast(_codeFreqBasis ) / static_cast(Galileo_E1_B_CODE_LENGTH_CHIPS))); + const int _codeFreqBasis = Galileo_E1_CODE_CHIP_RATE_HZ; //Hz + unsigned int _samplesPerCode = static_cast(static_cast(_fs) / + (static_cast(_codeFreqBasis) / static_cast(Galileo_E1_B_CODE_LENGTH_CHIPS))); if (_galileo_signal.rfind("1C") != std::string::npos && _galileo_signal.length() >= 2 && _secondary_flag) { @@ -235,24 +232,24 @@ void galileo_e1_code_gen_complex_sampled(std::complex* _dest, char _Signa float real_code[_samplesPerCode]; - galileo_e1_code_gen_float_sampled( real_code, _Signal, _cboc, _prn, _fs, _chip_shift, _secondary_flag ); + galileo_e1_code_gen_float_sampled(real_code, _Signal, _cboc, _prn, _fs, _chip_shift, _secondary_flag); - for( unsigned int ii = 0; ii < _samplesPerCode; ++ii ) + for (unsigned int ii = 0; ii < _samplesPerCode; ++ii) { - _dest[ii] = std::complex< float >( real_code[ii], 0.0f ); + _dest[ii] = std::complex(real_code[ii], 0.0f); } } void galileo_e1_code_gen_float_sampled(float* _dest, char _Signal[3], - bool _cboc, unsigned int _prn, signed int _fs, unsigned int _chip_shift) + bool _cboc, unsigned int _prn, signed int _fs, unsigned int _chip_shift) { galileo_e1_code_gen_float_sampled(_dest, _Signal, _cboc, _prn, _fs, _chip_shift, false); } void galileo_e1_code_gen_complex_sampled(std::complex* _dest, char _Signal[3], - bool _cboc, unsigned int _prn, signed int _fs, unsigned int _chip_shift) + bool _cboc, unsigned int _prn, signed int _fs, unsigned int _chip_shift) { galileo_e1_code_gen_complex_sampled(_dest, _Signal, _cboc, _prn, _fs, _chip_shift, false); } diff --git a/src/algorithms/libs/galileo_e1_signal_processing.h b/src/algorithms/libs/galileo_e1_signal_processing.h index f7c670129..96f0fd175 100644 --- a/src/algorithms/libs/galileo_e1_signal_processing.h +++ b/src/algorithms/libs/galileo_e1_signal_processing.h @@ -41,8 +41,8 @@ * */ void galileo_e1_code_gen_float_sampled(float* _dest, char _Signal[3], - bool _cboc, unsigned int _prn, signed int _fs, unsigned int _chip_shift, - bool _secondary_flag); + bool _cboc, unsigned int _prn, signed int _fs, unsigned int _chip_shift, + bool _secondary_flag); /*! * \brief This function generates Galileo E1 code (can select E1B or E1C, cboc or sinboc @@ -50,7 +50,7 @@ void galileo_e1_code_gen_float_sampled(float* _dest, char _Signal[3], * */ void galileo_e1_code_gen_float_sampled(float* _dest, char _Signal[3], - bool _cboc, unsigned int _prn, signed int _fs, unsigned int _chip_shift); + bool _cboc, unsigned int _prn, signed int _fs, unsigned int _chip_shift); /*! * \brief This function generates Galileo E1 code (can select E1B or E1C, cboc or sinboc @@ -58,13 +58,13 @@ void galileo_e1_code_gen_float_sampled(float* _dest, char _Signal[3], * */ void galileo_e1_code_gen_complex_sampled(std::complex* _dest, char _Signal[3], - bool _cboc, unsigned int _prn, signed int _fs, unsigned int _chip_shift, - bool _secondary_flag); + bool _cboc, unsigned int _prn, signed int _fs, unsigned int _chip_shift, + bool _secondary_flag); /*! * \brief galileo_e1_code_gen_complex_sampled without _secondary_flag for backward compatibility. */ void galileo_e1_code_gen_complex_sampled(std::complex* _dest, char _Signal[3], - bool _cboc, unsigned int _prn, signed int _fs, unsigned int _chip_shift); + bool _cboc, unsigned int _prn, signed int _fs, unsigned int _chip_shift); #endif /* GNSS_SDR_GALILEO_E1_SIGNAL_PROCESSING_H_ */ diff --git a/src/algorithms/libs/galileo_e5_signal_processing.cc b/src/algorithms/libs/galileo_e5_signal_processing.cc index 4f1f116bb..d506de1fc 100644 --- a/src/algorithms/libs/galileo_e5_signal_processing.cc +++ b/src/algorithms/libs/galileo_e5_signal_processing.cc @@ -37,7 +37,6 @@ #include - void galileo_e5_a_code_gen_complex_primary(std::complex* _dest, signed int _prn, char _Signal[3]) { unsigned int prn = _prn - 1; @@ -86,10 +85,10 @@ void galileo_e5_a_code_gen_complex_primary(std::complex* _dest, signed in { hex_to_binary_converter(a, Galileo_E5a_I_PRIMARY_CODE[prn].at(i)); hex_to_binary_converter(b, Galileo_E5a_Q_PRIMARY_CODE[prn].at(i)); - _dest[index] = std::complex(float(a[0]),float(b[0])); - _dest[index + 1] = std::complex(float(a[1]),float(b[1])); - _dest[index + 2] = std::complex(float(a[2]),float(b[2])); - _dest[index + 3] = std::complex(float(a[3]),float(b[3])); + _dest[index] = std::complex(float(a[0]), float(b[0])); + _dest[index + 1] = std::complex(float(a[1]), float(b[1])); + _dest[index + 2] = std::complex(float(a[2]), float(b[2])); + _dest[index + 3] = std::complex(float(a[3]), float(b[3])); index = index + 4; } // last 2 bits are filled up zeros @@ -101,7 +100,7 @@ void galileo_e5_a_code_gen_complex_primary(std::complex* _dest, signed in } void galileo_e5_a_code_gen_complex_sampled(std::complex* _dest, char _Signal[3], - unsigned int _prn, signed int _fs, unsigned int _chip_shift) + unsigned int _prn, signed int _fs, unsigned int _chip_shift) { unsigned int _samplesPerCode; unsigned int delay; @@ -110,17 +109,19 @@ void galileo_e5_a_code_gen_complex_sampled(std::complex* _dest, char _Sig std::complex* _code = new std::complex[_codeLength](); - galileo_e5_a_code_gen_complex_primary(_code , _prn , _Signal); + galileo_e5_a_code_gen_complex_primary(_code, _prn, _Signal); - _samplesPerCode = static_cast(static_cast(_fs) / ( static_cast(_codeFreqBasis) / static_cast(_codeLength))); + _samplesPerCode = static_cast(static_cast(_fs) / (static_cast(_codeFreqBasis) / static_cast(_codeLength))); delay = ((_codeLength - _chip_shift) % _codeLength) * _samplesPerCode / _codeLength; if (_fs != _codeFreqBasis) { std::complex* _resampled_signal; - if (posix_memalign((void**)&_resampled_signal, 16, _samplesPerCode * sizeof(gr_complex)) == 0){}; - resampler(_code, _resampled_signal, _codeFreqBasis, _fs, _codeLength, _samplesPerCode); //resamples code to fs + if (posix_memalign((void**)&_resampled_signal, 16, _samplesPerCode * sizeof(gr_complex)) == 0) + { + }; + resampler(_code, _resampled_signal, _codeFreqBasis, _fs, _codeLength, _samplesPerCode); //resamples code to fs delete[] _code; _code = _resampled_signal; } diff --git a/src/algorithms/libs/galileo_e5_signal_processing.h b/src/algorithms/libs/galileo_e5_signal_processing.h index 41dde566f..549621dba 100644 --- a/src/algorithms/libs/galileo_e5_signal_processing.h +++ b/src/algorithms/libs/galileo_e5_signal_processing.h @@ -44,14 +44,14 @@ void galileo_e5_a_code_gen_complex_primary(std::complex* _dest, signed int _prn, char _Signal[3]); -void galileo_e5_a_code_gen_tiered(std::complex* _dest,std::complex* _primary ,unsigned int _prn, char _Signal[3]); +void galileo_e5_a_code_gen_tiered(std::complex* _dest, std::complex* _primary, unsigned int _prn, char _Signal[3]); /*! * \brief Generates Galileo E5a complex code, shifted to the desired chip and sampled at a frequency fs * bool _pilot generates E5aQ code if true and E5aI (data signal) if false. */ void galileo_e5_a_code_gen_complex_sampled(std::complex* _dest, - char _Signal[3], unsigned int _prn, signed int _fs, unsigned int _chip_shift); + char _Signal[3], unsigned int _prn, signed int _fs, unsigned int _chip_shift); #endif /* GNSS_SDR_GALILEO_E5_SIGNAL_PROCESSING_H_ */ diff --git a/src/algorithms/libs/glonass_l1_signal_processing.cc b/src/algorithms/libs/glonass_l1_signal_processing.cc index 3ee50707a..caeba3672 100644 --- a/src/algorithms/libs/glonass_l1_signal_processing.cc +++ b/src/algorithms/libs/glonass_l1_signal_processing.cc @@ -32,9 +32,9 @@ #include "glonass_l1_signal_processing.h" -auto auxCeil = [](float x){ return static_cast(static_cast((x)+1)); }; +auto auxCeil = [](float x) { return static_cast(static_cast((x) + 1)); }; -void glonass_l1_ca_code_gen_complex(std::complex* _dest,/* signed int _prn,*/ unsigned int _chip_shift) +void glonass_l1_ca_code_gen_complex(std::complex* _dest, /* signed int _prn,*/ unsigned int _chip_shift) { const unsigned int _code_length = 511; bool G1[_code_length]; @@ -44,19 +44,19 @@ void glonass_l1_ca_code_gen_complex(std::complex* _dest,/* signed int _pr unsigned int delay; unsigned int lcv, lcv2; - for(lcv = 0; lcv < 9; lcv++) + for (lcv = 0; lcv < 9; lcv++) { G1_register[lcv] = 1; } /* Generate G1 Register */ - for(lcv = 0; lcv < _code_length; lcv++) + for (lcv = 0; lcv < _code_length; lcv++) { G1[lcv] = G1_register[2]; - feedback1 = G1_register[4]^G1_register[0]; + feedback1 = G1_register[4] ^ G1_register[0]; - for(lcv2 = 0; lcv2 < 8; lcv2++) + for (lcv2 = 0; lcv2 < 8; lcv2++) { G1_register[lcv2] = G1_register[lcv2 + 1]; } @@ -65,10 +65,10 @@ void glonass_l1_ca_code_gen_complex(std::complex* _dest,/* signed int _pr } /* Generate PRN from G1 Register */ - for(lcv = 0; lcv < _code_length; lcv++) + for (lcv = 0; lcv < _code_length; lcv++) { aux = G1[lcv]; - if(aux == true) + if (aux == true) { _dest[lcv] = std::complex(1, 0); } @@ -84,10 +84,10 @@ void glonass_l1_ca_code_gen_complex(std::complex* _dest,/* signed int _pr delay %= _code_length; /* Generate PRN from G1 and G2 Registers */ - for(lcv = 0; lcv < _code_length; lcv++) + for (lcv = 0; lcv < _code_length; lcv++) { aux = G1[(lcv + _chip_shift) % _code_length]; - if(aux == true) + if (aux == true) { _dest[lcv] = std::complex(1, 0); } @@ -104,7 +104,7 @@ void glonass_l1_ca_code_gen_complex(std::complex* _dest,/* signed int _pr /* * Generates complex GLONASS L1 C/A code for the desired SV ID and sampled to specific sampling frequency */ -void glonass_l1_ca_code_gen_complex_sampled(std::complex* _dest,/* unsigned int _prn,*/ signed int _fs, unsigned int _chip_shift) +void glonass_l1_ca_code_gen_complex_sampled(std::complex* _dest, /* unsigned int _prn,*/ signed int _fs, unsigned int _chip_shift) { // This function is based on the GNU software GPS for MATLAB in the Kay Borre book std::complex _code[511]; @@ -112,16 +112,16 @@ void glonass_l1_ca_code_gen_complex_sampled(std::complex* _dest,/* unsign float _ts; float _tc; float aux; - const signed int _codeFreqBasis = 511000; //Hz + const signed int _codeFreqBasis = 511000; //Hz const signed int _codeLength = 511; //--- Find number of samples per spreading code ---------------------------- _samplesPerCode = static_cast(static_cast(_fs) / static_cast(_codeFreqBasis / _codeLength)); //--- Find time constants -------------------------------------------------- - _ts = 1.0 / static_cast(_fs); // Sampling period in sec - _tc = 1.0 / static_cast(_codeFreqBasis); // C/A chip period in sec - glonass_l1_ca_code_gen_complex(_code, _chip_shift); //generate C/A code 1 sample per chip + _ts = 1.0 / static_cast(_fs); // Sampling period in sec + _tc = 1.0 / static_cast(_codeFreqBasis); // C/A chip period in sec + glonass_l1_ca_code_gen_complex(_code, _chip_shift); //generate C/A code 1 sample per chip for (signed int i = 0; i < _samplesPerCode; i++) { @@ -133,8 +133,8 @@ void glonass_l1_ca_code_gen_complex_sampled(std::complex* _dest,/* unsign // millisecond). // _codeValueIndex = ceil((_ts * ((float)i + 1)) / _tc) - 1; - aux = (_ts * (i + 1)) / _tc; - _codeValueIndex = auxCeil( aux ) - 1; + aux = (_ts * (i + 1)) / _tc; + _codeValueIndex = auxCeil(aux) - 1; //--- Make the digitized version of the C/A code ----------------------- // The "upsampled" code is made by selecting values form the CA code @@ -143,11 +143,10 @@ void glonass_l1_ca_code_gen_complex_sampled(std::complex* _dest,/* unsign { //--- Correct the last index (due to number rounding issues) ----------- _dest[i] = _code[_codeLength - 1]; - } else { - _dest[i] = _code[_codeValueIndex]; //repeat the chip -> upsample + _dest[i] = _code[_codeValueIndex]; //repeat the chip -> upsample } } } diff --git a/src/algorithms/libs/glonass_l1_signal_processing.h b/src/algorithms/libs/glonass_l1_signal_processing.h index 891febcb9..cf93a19a8 100644 --- a/src/algorithms/libs/glonass_l1_signal_processing.h +++ b/src/algorithms/libs/glonass_l1_signal_processing.h @@ -39,9 +39,9 @@ void glonass_l1_ca_code_gen_complex(std::complex* _dest, /*signed int _prn,*/ unsigned int _chip_shift); //! Generates N complex GLONASS L1 C/A codes for the desired SV ID and code shift -void glonass_l1_ca_code_gen_complex_sampled(std::complex* _dest,/* unsigned int _prn,*/ signed int _fs, unsigned int _chip_shift, unsigned int _ncodes); +void glonass_l1_ca_code_gen_complex_sampled(std::complex* _dest, /* unsigned int _prn,*/ signed int _fs, unsigned int _chip_shift, unsigned int _ncodes); //! Generates complex GLONASS L1 C/A code for the desired SV ID and code shift -void glonass_l1_ca_code_gen_complex_sampled(std::complex* _dest,/* unsigned int _prn,*/ signed int _fs, unsigned int _chip_shift); +void glonass_l1_ca_code_gen_complex_sampled(std::complex* _dest, /* unsigned int _prn,*/ signed int _fs, unsigned int _chip_shift); #endif /* GNSS_SDR_GLONASS_SDR_SIGNAL_PROCESSING_H_ */ diff --git a/src/algorithms/libs/gnss_sdr_flags.cc b/src/algorithms/libs/gnss_sdr_flags.cc index 0e8e1cf59..db6e37757 100644 --- a/src/algorithms/libs/gnss_sdr_flags.cc +++ b/src/algorithms/libs/gnss_sdr_flags.cc @@ -30,7 +30,7 @@ #include "gnss_sdr_flags.h" -#include // for exists +#include // for exists #include #include #include @@ -38,13 +38,13 @@ DEFINE_string(c, "-", "Path to the configuration file (if set, overrides --config_file)."); DEFINE_string(config_file, std::string(GNSSSDR_INSTALL_DIR "/share/gnss-sdr/conf/default.conf"), - "Path to the configuration file."); + "Path to the configuration file."); DEFINE_string(s, "-", - "If defined, path to the file containing the signal samples (overrides the configuration file and --signal_source)."); + "If defined, path to the file containing the signal samples (overrides the configuration file and --signal_source)."); DEFINE_string(signal_source, "-", - "If defined, path to the file containing the signal samples (overrides the configuration file)."); + "If defined, path to the file containing the signal samples (overrides the configuration file)."); DEFINE_int32(doppler_max, 0, "If defined, sets the maximum Doppler value in the search grid, in Hz (overrides the configuration file)."); @@ -67,36 +67,36 @@ DEFINE_double(pll_bw_hz, 0.0, "If defined, bandwidth of the PLL low pass filter, #if GFLAGS_GREATER_2_0 -static bool ValidateC(const char* flagname, const std::string & value) +static bool ValidateC(const char* flagname, const std::string& value) { - if (boost::filesystem::exists( value ) or value.compare("-") == 0) // value is ok + if (boost::filesystem::exists(value) or value.compare("-") == 0) // value is ok return true; std::cout << "Invalid value for flag -" << flagname << ". The file '" << value << "' does not exist." << std::endl; std::cout << "GNSS-SDR program ended." << std::endl; return false; } -static bool ValidateConfigFile(const char* flagname, const std::string & value) +static bool ValidateConfigFile(const char* flagname, const std::string& value) { - if (boost::filesystem::exists( value ) or value.compare(std::string(GNSSSDR_INSTALL_DIR "/share/gnss-sdr/conf/default.conf")) == 0) // value is ok + if (boost::filesystem::exists(value) or value.compare(std::string(GNSSSDR_INSTALL_DIR "/share/gnss-sdr/conf/default.conf")) == 0) // value is ok return true; std::cout << "Invalid value for flag -" << flagname << ". The file '" << value << "' does not exist." << std::endl; std::cout << "GNSS-SDR program ended." << std::endl; return false; } -static bool ValidateS(const char* flagname, const std::string & value) +static bool ValidateS(const char* flagname, const std::string& value) { - if (boost::filesystem::exists( value ) or value.compare("-") == 0) // value is ok + if (boost::filesystem::exists(value) or value.compare("-") == 0) // value is ok return true; std::cout << "Invalid value for flag -" << flagname << ". The file '" << value << "' does not exist." << std::endl; std::cout << "GNSS-SDR program ended." << std::endl; return false; } -static bool ValidateSignalSource(const char* flagname, const std::string & value) +static bool ValidateSignalSource(const char* flagname, const std::string& value) { - if (boost::filesystem::exists( value ) or value.compare("-") == 0) // value is ok + if (boost::filesystem::exists(value) or value.compare("-") == 0) // value is ok return true; std::cout << "Invalid value for flag -" << flagname << ". The file '" << value << "' does not exist." << std::endl; std::cout << "GNSS-SDR program ended." << std::endl; @@ -106,7 +106,7 @@ static bool ValidateSignalSource(const char* flagname, const std::string & value static bool ValidateDopplerMax(const char* flagname, int32_t value) { const int32_t max_value = 1000000; - if (value >= 0 && value < max_value) // value is ok + if (value >= 0 && value < max_value) // value is ok return true; std::cout << "Invalid value for flag -" << flagname << ": " << value << ". Allowed range is 0 < " << flagname << " < " << max_value << " Hz." << std::endl; std::cout << "GNSS-SDR program ended." << std::endl; @@ -116,7 +116,7 @@ static bool ValidateDopplerMax(const char* flagname, int32_t value) static bool ValidateDopplerStep(const char* flagname, int32_t value) { const int32_t max_value = 10000; - if (value >= 0 && value < max_value) // value is ok + if (value >= 0 && value < max_value) // value is ok return true; std::cout << "Invalid value for flag -" << flagname << ": " << value << ". Allowed range is 0 < " << flagname << " < " << max_value << " Hz." << std::endl; std::cout << "GNSS-SDR program ended." << std::endl; @@ -126,7 +126,7 @@ static bool ValidateDopplerStep(const char* flagname, int32_t value) static bool ValidateCn0Samples(const char* flagname, int32_t value) { const int32_t max_value = 10000; - if (value > 0 && value < max_value) // value is ok + if (value > 0 && value < max_value) // value is ok return true; std::cout << "Invalid value for flag -" << flagname << ": " << value << ". Allowed range is 0 < " << flagname << " < " << max_value << " samples." << std::endl; std::cout << "GNSS-SDR program ended." << std::endl; @@ -136,7 +136,7 @@ static bool ValidateCn0Samples(const char* flagname, int32_t value) static bool ValidateCn0Min(const char* flagname, int32_t value) { const int32_t max_value = 100; - if (value > 0 && value < max_value) // value is ok + if (value > 0 && value < max_value) // value is ok return true; std::cout << "Invalid value for flag -" << flagname << ": " << value << ". Allowed range is 0 < " << flagname << " < " << max_value << " dB-Hz." << std::endl; std::cout << "GNSS-SDR program ended." << std::endl; @@ -146,7 +146,7 @@ static bool ValidateCn0Min(const char* flagname, int32_t value) static bool ValidateMaxLockFail(const char* flagname, int32_t value) { const int32_t max_value = 10000; - if (value > 0 && value < max_value) // value is ok + if (value > 0 && value < max_value) // value is ok return true; std::cout << "Invalid value for flag -" << flagname << ": " << value << ". Allowed range is 0 < " << flagname << " < " << max_value << " fails." << std::endl; std::cout << "GNSS-SDR program ended." << std::endl; @@ -156,7 +156,7 @@ static bool ValidateMaxLockFail(const char* flagname, int32_t value) static bool ValidateCarrierLockTh(const char* flagname, double value) { const double max_value = 1.508; - if (value > 0.0 && value < max_value) // value is ok + if (value > 0.0 && value < max_value) // value is ok return true; std::cout << "Invalid value for flag -" << flagname << ": " << value << ". Allowed range is 0 < " << flagname << " < " << max_value << " rad." << std::endl; std::cout << "GNSS-SDR program ended." << std::endl; @@ -166,7 +166,7 @@ static bool ValidateCarrierLockTh(const char* flagname, double value) static bool ValidateDllBw(const char* flagname, double value) { const double max_value = 10000.0; - if (value >= 0.0 && value < max_value) // value is ok + if (value >= 0.0 && value < max_value) // value is ok return true; std::cout << "Invalid value for flag -" << flagname << ": " << value << ". Allowed range is 0 < " << flagname << " < " << max_value << " Hz." << std::endl; std::cout << "GNSS-SDR program ended." << std::endl; @@ -176,7 +176,7 @@ static bool ValidateDllBw(const char* flagname, double value) static bool ValidatePllBw(const char* flagname, double value) { const double max_value = 10000.0; - if (value >= 0.0 && value < max_value) // value is ok + if (value >= 0.0 && value < max_value) // value is ok return true; std::cout << "Invalid value for flag -" << flagname << ": " << value << ". Allowed range is 0 < " << flagname << " < " << max_value << " Hz." << std::endl; std::cout << "GNSS-SDR program ended." << std::endl; @@ -198,4 +198,3 @@ DEFINE_validator(pll_bw_hz, &ValidatePllBw); #endif - diff --git a/src/algorithms/libs/gnss_sdr_flags.h b/src/algorithms/libs/gnss_sdr_flags.h index 7ccbdabe5..c0c67383d 100644 --- a/src/algorithms/libs/gnss_sdr_flags.h +++ b/src/algorithms/libs/gnss_sdr_flags.h @@ -34,29 +34,29 @@ #include -DECLARE_string(c); // -gnss_sdr_sample_counter::gnss_sdr_sample_counter () : gr::sync_block("sample_counter", - gr::io_signature::make(1, 1, sizeof(Gnss_Synchro)), - gr::io_signature::make(0,0,0)) +gnss_sdr_sample_counter::gnss_sdr_sample_counter() : gr::sync_block("sample_counter", + gr::io_signature::make(1, 1, sizeof(Gnss_Synchro)), + gr::io_signature::make(0, 0, 0)) { this->message_port_register_out(pmt::mp("sample_counter")); last_T_rx_s = 0; - report_interval_s = 1;//default reporting 1 second - flag_enable_send_msg = false; //enable it for reporting time with asynchronous message + report_interval_s = 1; //default reporting 1 second + flag_enable_send_msg = false; //enable it for reporting time with asynchronous message } -gnss_sdr_sample_counter_sptr gnss_sdr_make_sample_counter () +gnss_sdr_sample_counter_sptr gnss_sdr_make_sample_counter() { gnss_sdr_sample_counter_sptr sample_counter_(new gnss_sdr_sample_counter()); return sample_counter_; } -int gnss_sdr_sample_counter::work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items __attribute__((unused))) +int gnss_sdr_sample_counter::work(int noutput_items, + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items __attribute__((unused))) { - const Gnss_Synchro *in = reinterpret_cast(input_items[0]); // input + const Gnss_Synchro *in = reinterpret_cast(input_items[0]); // input double current_T_rx_s = in[noutput_items - 1].Tracking_sample_counter / static_cast(in[noutput_items - 1].fs); if ((current_T_rx_s - last_T_rx_s) > report_interval_s) { std::cout << "Current receiver time: " << floor(current_T_rx_s) << " [s]" << std::endl; - if(flag_enable_send_msg == true) + if (flag_enable_send_msg == true) { this->message_port_pub(pmt::mp("receiver_time"), pmt::from_double(current_T_rx_s)); } diff --git a/src/algorithms/libs/gnss_sdr_sample_counter.h b/src/algorithms/libs/gnss_sdr_sample_counter.h index ec1560ee8..afb56ce49 100644 --- a/src/algorithms/libs/gnss_sdr_sample_counter.h +++ b/src/algorithms/libs/gnss_sdr_sample_counter.h @@ -39,20 +39,20 @@ class gnss_sdr_sample_counter; typedef boost::shared_ptr gnss_sdr_sample_counter_sptr; -gnss_sdr_sample_counter_sptr gnss_sdr_make_sample_counter (); +gnss_sdr_sample_counter_sptr gnss_sdr_make_sample_counter(); class gnss_sdr_sample_counter : public gr::sync_block { friend gnss_sdr_sample_counter_sptr gnss_sdr_make_sample_counter(); - gnss_sdr_sample_counter (); + gnss_sdr_sample_counter(); double last_T_rx_s; double report_interval_s; bool flag_enable_send_msg; public: int work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items); }; #endif /*GNSS_SDR_sample_counter_H_*/ diff --git a/src/algorithms/libs/gnss_sdr_valve.cc b/src/algorithms/libs/gnss_sdr_valve.cc index d56edbbc8..5a6a15979 100644 --- a/src/algorithms/libs/gnss_sdr_valve.cc +++ b/src/algorithms/libs/gnss_sdr_valve.cc @@ -34,41 +34,43 @@ #include "control_message_factory.h" #include #include -#include // for min -#include // for memcpy +#include // for min +#include // for memcpy -gnss_sdr_valve::gnss_sdr_valve (size_t sizeof_stream_item, - unsigned long long nitems, - gr::msg_queue::sptr queue) : gr::sync_block("valve", - gr::io_signature::make(1, 1, sizeof_stream_item), - gr::io_signature::make(1, 1, sizeof_stream_item) ), - d_nitems(nitems), d_ncopied_items(0), d_queue(queue) -{} +gnss_sdr_valve::gnss_sdr_valve(size_t sizeof_stream_item, + unsigned long long nitems, + gr::msg_queue::sptr queue) : gr::sync_block("valve", + gr::io_signature::make(1, 1, sizeof_stream_item), + gr::io_signature::make(1, 1, sizeof_stream_item)), + d_nitems(nitems), + d_ncopied_items(0), + d_queue(queue) +{ +} -boost::shared_ptr gnss_sdr_make_valve (size_t sizeof_stream_item, unsigned long long nitems, gr::msg_queue::sptr queue) +boost::shared_ptr gnss_sdr_make_valve(size_t sizeof_stream_item, unsigned long long nitems, gr::msg_queue::sptr queue) { boost::shared_ptr valve_(new gnss_sdr_valve(sizeof_stream_item, nitems, queue)); return valve_; } - -int gnss_sdr_valve::work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) +int gnss_sdr_valve::work(int noutput_items, + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items) { if (d_ncopied_items >= d_nitems) { - ControlMessageFactory* cmf = new ControlMessageFactory(); - d_queue->handle(cmf->GetQueueMessage(200,0)); - LOG(INFO) << "Stopping receiver, "<< d_ncopied_items << " samples processed"; + ControlMessageFactory *cmf = new ControlMessageFactory(); + d_queue->handle(cmf->GetQueueMessage(200, 0)); + LOG(INFO) << "Stopping receiver, " << d_ncopied_items << " samples processed"; delete cmf; - return -1; // Done! + return -1; // Done! } unsigned long long n = std::min(d_nitems - d_ncopied_items, static_cast(noutput_items)); if (n == 0) return 0; - memcpy (output_items[0], input_items[0], n * input_signature()->sizeof_stream_item(0)); + memcpy(output_items[0], input_items[0], n * input_signature()->sizeof_stream_item(0)); //for(long long i = 0; i++; i -boost::shared_ptr gnss_sdr_make_valve (size_t sizeof_stream_item, - unsigned long long nitems, - gr::msg_queue::sptr queue); +boost::shared_ptr gnss_sdr_make_valve(size_t sizeof_stream_item, + unsigned long long nitems, + gr::msg_queue::sptr queue); /*! * \brief Implementation of a GNU Radio block that sends a STOP message to the * control queue right after a specific number of samples have passed through it. @@ -48,19 +48,19 @@ boost::shared_ptr gnss_sdr_make_valve (size_t sizeof_stream_item, class gnss_sdr_valve : public gr::sync_block { friend boost::shared_ptr gnss_sdr_make_valve(size_t sizeof_stream_item, - unsigned long long nitems, - gr::msg_queue::sptr queue); - gnss_sdr_valve (size_t sizeof_stream_item, - unsigned long long nitems, - gr::msg_queue::sptr queue); + unsigned long long nitems, + gr::msg_queue::sptr queue); + gnss_sdr_valve(size_t sizeof_stream_item, + unsigned long long nitems, + gr::msg_queue::sptr queue); unsigned long long d_nitems; unsigned long long d_ncopied_items; gr::msg_queue::sptr d_queue; public: int work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items); }; #endif /*GNSS_SDR_GNSS_SDR_VALVE_H_*/ diff --git a/src/algorithms/libs/gnss_signal_processing.cc b/src/algorithms/libs/gnss_signal_processing.cc index ba624ea9b..41f44a7a8 100644 --- a/src/algorithms/libs/gnss_signal_processing.cc +++ b/src/algorithms/libs/gnss_signal_processing.cc @@ -36,13 +36,13 @@ #include -auto auxCeil2 = [](float x){ return static_cast(static_cast((x)+1)); }; +auto auxCeil2 = [](float x) { return static_cast(static_cast((x) + 1)); }; void complex_exp_gen(std::complex* _dest, double _f, double _fs, unsigned int _samps) { gr::fxpt_nco d_nco; d_nco.set_freq((GPS_TWO_PI * _f) / _fs); - d_nco.sincos(_dest, _samps, 1); + d_nco.sincos(_dest, _samps, 1); } @@ -50,120 +50,120 @@ void complex_exp_gen_conj(std::complex* _dest, double _f, double _fs, uns { gr::fxpt_nco d_nco; d_nco.set_freq(-(GPS_TWO_PI * _f) / _fs); - d_nco.sincos(_dest, _samps, 1); + d_nco.sincos(_dest, _samps, 1); } -void hex_to_binary_converter(int * _dest, char _from) +void hex_to_binary_converter(int* _dest, char _from) { - switch(_from) - { - case '0': - *(_dest) = 1; - *(_dest+1) = 1; - *(_dest+2) = 1; - *(_dest+3) = 1; - break; - case '1': - *(_dest) = 1; - *(_dest+1) = 1; - *(_dest+2) = 1; - *(_dest+3) = -1; - break; - case '2': - *(_dest) = 1; - *(_dest+1) = 1; - *(_dest+2) = -1; - *(_dest+3) = 1; - break; - case '3': - *(_dest) = 1; - *(_dest+1) = 1; - *(_dest+2) = -1; - *(_dest+3) = -1; - break; - case '4': - *(_dest) = 1; - *(_dest+1) = -1; - *(_dest+2) = 1; - *(_dest+3) = 1; - break; - case '5': - *(_dest) = 1; - *(_dest+1) = -1; - *(_dest+2) = 1; - *(_dest+3) = -1; - break; - case '6': - *(_dest) = 1; - *(_dest+1) = -1; - *(_dest+2) = -1; - *(_dest+3) = 1; - break; - case '7': - *(_dest) = 1; - *(_dest+1) = -1; - *(_dest+2) = -1; - *(_dest+3) = -1; - break; - case '8': - *(_dest) = -1; - *(_dest+1) = 1; - *(_dest+2) = 1; - *(_dest+3) = 1; - break; - case '9': - *(_dest) = -1; - *(_dest+1) = 1; - *(_dest+2) = 1; - *(_dest+3) = -1; - break; - case 'A': - *(_dest) = -1; - *(_dest+1) = 1; - *(_dest+2) = -1; - *(_dest+3) = 1; - break; - case 'B': - *(_dest) = -1; - *(_dest+1) = 1; - *(_dest+2) = -1; - *(_dest+3) = -1; - break; - case 'C': - *(_dest) = -1; - *(_dest+1) = -1; - *(_dest+2) = 1; - *(_dest+3) = 1; - break; - case 'D': - *(_dest) = -1; - *(_dest+1) = -1; - *(_dest+2) = 1; - *(_dest+3) = -1; - break; - case 'E': - *(_dest) = -1; - *(_dest+1) = -1; - *(_dest+2) = -1; - *(_dest+3) = 1; - break; - case 'F': - *(_dest) = -1; - *(_dest+1) = -1; - *(_dest+2) = -1; - *(_dest+3) = -1; - break; - } + switch (_from) + { + case '0': + *(_dest) = 1; + *(_dest + 1) = 1; + *(_dest + 2) = 1; + *(_dest + 3) = 1; + break; + case '1': + *(_dest) = 1; + *(_dest + 1) = 1; + *(_dest + 2) = 1; + *(_dest + 3) = -1; + break; + case '2': + *(_dest) = 1; + *(_dest + 1) = 1; + *(_dest + 2) = -1; + *(_dest + 3) = 1; + break; + case '3': + *(_dest) = 1; + *(_dest + 1) = 1; + *(_dest + 2) = -1; + *(_dest + 3) = -1; + break; + case '4': + *(_dest) = 1; + *(_dest + 1) = -1; + *(_dest + 2) = 1; + *(_dest + 3) = 1; + break; + case '5': + *(_dest) = 1; + *(_dest + 1) = -1; + *(_dest + 2) = 1; + *(_dest + 3) = -1; + break; + case '6': + *(_dest) = 1; + *(_dest + 1) = -1; + *(_dest + 2) = -1; + *(_dest + 3) = 1; + break; + case '7': + *(_dest) = 1; + *(_dest + 1) = -1; + *(_dest + 2) = -1; + *(_dest + 3) = -1; + break; + case '8': + *(_dest) = -1; + *(_dest + 1) = 1; + *(_dest + 2) = 1; + *(_dest + 3) = 1; + break; + case '9': + *(_dest) = -1; + *(_dest + 1) = 1; + *(_dest + 2) = 1; + *(_dest + 3) = -1; + break; + case 'A': + *(_dest) = -1; + *(_dest + 1) = 1; + *(_dest + 2) = -1; + *(_dest + 3) = 1; + break; + case 'B': + *(_dest) = -1; + *(_dest + 1) = 1; + *(_dest + 2) = -1; + *(_dest + 3) = -1; + break; + case 'C': + *(_dest) = -1; + *(_dest + 1) = -1; + *(_dest + 2) = 1; + *(_dest + 3) = 1; + break; + case 'D': + *(_dest) = -1; + *(_dest + 1) = -1; + *(_dest + 2) = 1; + *(_dest + 3) = -1; + break; + case 'E': + *(_dest) = -1; + *(_dest + 1) = -1; + *(_dest + 2) = -1; + *(_dest + 3) = 1; + break; + case 'F': + *(_dest) = -1; + *(_dest + 1) = -1; + *(_dest + 2) = -1; + *(_dest + 3) = -1; + break; + } } void resampler(float* _from, float* _dest, float _fs_in, - float _fs_out, unsigned int _length_in, unsigned int _length_out) + float _fs_out, unsigned int _length_in, unsigned int _length_out) { unsigned int _codeValueIndex; float aux; //--- Find time constants -------------------------------------------------- - const float _t_in = 1 / _fs_in; // Incoming sampling period in sec - const float _t_out = 1 / _fs_out; // Out sampling period in sec + const float _t_in = 1 / _fs_in; // Incoming sampling period in sec + const float _t_out = 1 / _fs_out; // Out sampling period in sec for (unsigned int i = 0; i < _length_out - 1; i++) { //=== Digitizing ======================================================= @@ -180,13 +180,13 @@ void resampler(float* _from, float* _dest, float _fs_in, } void resampler(std::complex* _from, std::complex* _dest, float _fs_in, - float _fs_out, unsigned int _length_in, unsigned int _length_out) + float _fs_out, unsigned int _length_in, unsigned int _length_out) { unsigned int _codeValueIndex; float aux; //--- Find time constants -------------------------------------------------- - const float _t_in = 1 / _fs_in; // Incoming sampling period in sec - const float _t_out = 1 / _fs_out; // Out sampling period in sec + const float _t_in = 1 / _fs_in; // Incoming sampling period in sec + const float _t_out = 1 / _fs_out; // Out sampling period in sec for (unsigned int i = 0; i < _length_out - 1; i++) { //=== Digitizing ======================================================= diff --git a/src/algorithms/libs/gnss_signal_processing.h b/src/algorithms/libs/gnss_signal_processing.h index b75cb71c5..b9f7f266a 100644 --- a/src/algorithms/libs/gnss_signal_processing.h +++ b/src/algorithms/libs/gnss_signal_processing.h @@ -43,14 +43,14 @@ * */ void complex_exp_gen(std::complex* _dest, double _f, double _fs, - unsigned int _samps); + unsigned int _samps); /*! * \brief This function generates a conjugate complex exponential in _dest. * */ void complex_exp_gen_conj(std::complex* _dest, double _f, double _fs, - unsigned int _samps); + unsigned int _samps); /*! @@ -58,21 +58,21 @@ void complex_exp_gen_conj(std::complex* _dest, double _f, double _fs, * to binary (the output are 4 ints with +1 or -1 values). * */ -void hex_to_binary_converter(int * _dest, char _from); +void hex_to_binary_converter(int* _dest, char _from); /*! * \brief This function resamples a sequence of float values. * */ void resampler(float* _from, float* _dest, - float _fs_in, float _fs_out, unsigned int _length_in, - unsigned int _length_out); + float _fs_in, float _fs_out, unsigned int _length_in, + unsigned int _length_out); /*! * \brief This function resamples a sequence of complex values. * */ void resampler(std::complex* _from, std::complex* _dest, - float _fs_in, float _fs_out, unsigned int _length_in, - unsigned int _length_out); + float _fs_in, float _fs_out, unsigned int _length_in, + unsigned int _length_out); #endif /* GNSS_SDR_GNSS_SIGNAL_PROCESSING_H_ */ diff --git a/src/algorithms/libs/gps_l2c_signal.cc b/src/algorithms/libs/gps_l2c_signal.cc index 590c5751c..68fb7c024 100644 --- a/src/algorithms/libs/gps_l2c_signal.cc +++ b/src/algorithms/libs/gps_l2c_signal.cc @@ -38,17 +38,17 @@ int32_t gps_l2c_m_shift(int32_t x) { - return static_cast((x >> 1)^((x & 1) * 0445112474)); + return static_cast((x >> 1) ^ ((x & 1) * 0445112474)); } -void gps_l2c_m_code(int32_t * _dest, unsigned int _prn) +void gps_l2c_m_code(int32_t* _dest, unsigned int _prn) { int32_t x; - x = GPS_L2C_M_INIT_REG[ _prn - 1]; + x = GPS_L2C_M_INIT_REG[_prn - 1]; for (int n = 0; n < GPS_L2_M_CODE_LENGTH_CHIPS; n++) { - _dest[n] = static_cast(x&1); + _dest[n] = static_cast(x & 1); x = gps_l2c_m_shift(x); } } @@ -92,7 +92,7 @@ void gps_l2c_m_code_gen_complex_sampled(std::complex* _dest, unsigned int _samplesPerCode = static_cast(static_cast(_fs) / (static_cast(GPS_L2_M_CODE_RATE_HZ) / static_cast(_codeLength))); //--- Find time constants -------------------------------------------------- - _ts = 1.0 / static_cast(_fs); // Sampling period in sec + _ts = 1.0 / static_cast(_fs); // Sampling period in sec _tc = 1.0 / static_cast(GPS_L2_M_CODE_RATE_HZ); // C/A chip period in sec //float aux; @@ -114,12 +114,8 @@ void gps_l2c_m_code_gen_complex_sampled(std::complex* _dest, unsigned int } else { - _dest[i] = std::complex(1.0 - 2.0 * _code[_codeValueIndex], 0); //repeat the chip -> upsample + _dest[i] = std::complex(1.0 - 2.0 * _code[_codeValueIndex], 0); //repeat the chip -> upsample } } delete[] _code; } - - - - diff --git a/src/algorithms/libs/gps_l5_signal.cc b/src/algorithms/libs/gps_l5_signal.cc index 46b5d9430..7a443d20f 100644 --- a/src/algorithms/libs/gps_l5_signal.cc +++ b/src/algorithms/libs/gps_l5_signal.cc @@ -40,9 +40,9 @@ std::deque l5i_xa_shift(std::deque xa) { - if (xa == std::deque{1,1,1,1,1,1,1,1,1,1,1,0,1}) + if (xa == std::deque{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1}) { - return std::deque{1,1,1,1,1,1,1,1,1,1,1,1,1}; + return std::deque{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; } else { @@ -55,9 +55,9 @@ std::deque l5i_xa_shift(std::deque xa) std::deque l5q_xa_shift(std::deque xa) { - if (xa == std::deque{1,1,1,1,1,1,1,1,1,1,1,0,1}) + if (xa == std::deque{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1}) { - return std::deque{1,1,1,1,1,1,1,1,1,1,1,1,1}; + return std::deque{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; } else { @@ -78,7 +78,7 @@ std::deque l5i_xb_shift(std::deque xb) std::deque l5q_xb_shift(std::deque xb) { - std::deque out(xb.begin(), xb.end()-1); + std::deque out(xb.begin(), xb.end() - 1); out.push_front(xb[12] xor xb[11] xor xb[7] xor xb[6] xor xb[5] xor xb[3] xor xb[2] xor xb[0]); return out; } @@ -86,7 +86,7 @@ std::deque l5q_xb_shift(std::deque xb) std::deque make_l5i_xa() { - std::deque xa = {1,1,1,1,1,1,1,1,1,1,1,1,1}; + std::deque xa = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; std::deque y(GPS_L5i_CODE_LENGTH_CHIPS, 0); for (int i = 0; i < GPS_L5i_CODE_LENGTH_CHIPS; i++) @@ -100,8 +100,8 @@ std::deque make_l5i_xa() std::deque make_l5i_xb() { - std::deque xb = {1,1,1,1,1,1,1,1,1,1,1,1,1}; - std::deque y(GPS_L5i_CODE_LENGTH_CHIPS,0); + std::deque xb = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; + std::deque y(GPS_L5i_CODE_LENGTH_CHIPS, 0); for (int i = 0; i < GPS_L5i_CODE_LENGTH_CHIPS; i++) { @@ -114,7 +114,7 @@ std::deque make_l5i_xb() std::deque make_l5q_xa() { - std::deque xa = {1,1,1,1,1,1,1,1,1,1,1,1,1}; + std::deque xa = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; std::deque y(GPS_L5q_CODE_LENGTH_CHIPS, 0); for (int i = 0; i < GPS_L5q_CODE_LENGTH_CHIPS; i++) @@ -128,7 +128,7 @@ std::deque make_l5q_xa() std::deque make_l5q_xb() { - std::deque xb = {1,1,1,1,1,1,1,1,1,1,1,1,1}; + std::deque xb = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; std::deque y(GPS_L5q_CODE_LENGTH_CHIPS, 0); for (int i = 0; i < GPS_L5q_CODE_LENGTH_CHIPS; i++) @@ -140,7 +140,7 @@ std::deque make_l5q_xb() } -void make_l5i(int32_t * _dest, int prn) +void make_l5i(int32_t* _dest, int prn) { int xb_offset = GPS_L5i_INIT_REG[prn]; @@ -160,7 +160,7 @@ void make_l5i(int32_t * _dest, int prn) } -void make_l5q(int32_t * _dest, int prn) +void make_l5q(int32_t* _dest, int prn) { int xb_offset = GPS_L5q_INIT_REG[prn]; @@ -186,7 +186,7 @@ void gps_l5i_code_gen_complex(std::complex* _dest, unsigned int _prn) if (_prn > 0 and _prn < 51) { - make_l5i(_code, _prn - 1); + make_l5i(_code, _prn - 1); } for (signed int i = 0; i < GPS_L5i_CODE_LENGTH_CHIPS; i++) @@ -206,7 +206,7 @@ void gps_l5i_code_gen_complex_sampled(std::complex* _dest, unsigned int _ int32_t* _code = new int32_t[GPS_L5i_CODE_LENGTH_CHIPS]; if (_prn > 0 and _prn < 51) { - make_l5i(_code, _prn - 1); + make_l5i(_code, _prn - 1); } signed int _samplesPerCode, _codeValueIndex; @@ -218,7 +218,7 @@ void gps_l5i_code_gen_complex_sampled(std::complex* _dest, unsigned int _ _samplesPerCode = static_cast(static_cast(_fs) / (static_cast(GPS_L5i_CODE_RATE_HZ) / static_cast(_codeLength))); //--- Find time constants -------------------------------------------------- - _ts = 1.0 / static_cast(_fs); // Sampling period in sec + _ts = 1.0 / static_cast(_fs); // Sampling period in sec _tc = 1.0 / static_cast(GPS_L5i_CODE_RATE_HZ); // C/A chip period in sec //float aux; @@ -240,7 +240,7 @@ void gps_l5i_code_gen_complex_sampled(std::complex* _dest, unsigned int _ } else { - _dest[i] = std::complex(1.0 - 2.0 * _code[_codeValueIndex], 0); //repeat the chip -> upsample + _dest[i] = std::complex(1.0 - 2.0 * _code[_codeValueIndex], 0); //repeat the chip -> upsample } } delete[] _code; @@ -253,7 +253,7 @@ void gps_l5q_code_gen_complex(std::complex* _dest, unsigned int _prn) if (_prn > 0 and _prn < 51) { - make_l5q(_code, _prn - 1); + make_l5q(_code, _prn - 1); } for (signed int i = 0; i < GPS_L5q_CODE_LENGTH_CHIPS; i++) @@ -273,7 +273,7 @@ void gps_l5q_code_gen_complex_sampled(std::complex* _dest, unsigned int _ int32_t* _code = new int32_t[GPS_L5q_CODE_LENGTH_CHIPS]; if (_prn > 0 and _prn < 51) { - make_l5q(_code, _prn - 1); + make_l5q(_code, _prn - 1); } signed int _samplesPerCode, _codeValueIndex; @@ -285,7 +285,7 @@ void gps_l5q_code_gen_complex_sampled(std::complex* _dest, unsigned int _ _samplesPerCode = static_cast(static_cast(_fs) / (static_cast(GPS_L5q_CODE_RATE_HZ) / static_cast(_codeLength))); //--- Find time constants -------------------------------------------------- - _ts = 1.0 / static_cast(_fs); // Sampling period in sec + _ts = 1.0 / static_cast(_fs); // Sampling period in sec _tc = 1.0 / static_cast(GPS_L5q_CODE_RATE_HZ); // C/A chip period in sec //float aux; @@ -307,10 +307,8 @@ void gps_l5q_code_gen_complex_sampled(std::complex* _dest, unsigned int _ } else { - _dest[i] = std::complex(1.0 - 2.0 * _code[_codeValueIndex], 0); //repeat the chip -> upsample + _dest[i] = std::complex(1.0 - 2.0 * _code[_codeValueIndex], 0); //repeat the chip -> upsample } } delete[] _code; } - - diff --git a/src/algorithms/libs/gps_sdr_signal_processing.cc b/src/algorithms/libs/gps_sdr_signal_processing.cc index 1ddb8976a..fe280c293 100644 --- a/src/algorithms/libs/gps_sdr_signal_processing.cc +++ b/src/algorithms/libs/gps_sdr_signal_processing.cc @@ -32,7 +32,7 @@ #include "gps_sdr_signal_processing.h" -auto auxCeil = [](float x){ return static_cast(static_cast((x)+1)); }; +auto auxCeil = [](float x) { return static_cast(static_cast((x) + 1)); }; void gps_l1_ca_code_gen_int(int* _dest, signed int _prn, unsigned int _chip_shift) { @@ -47,15 +47,15 @@ void gps_l1_ca_code_gen_int(int* _dest, signed int _prn, unsigned int _chip_shif signed int prn_idx; /* G2 Delays as defined in GPS-ISD-200D */ - const signed int delays[51] = {5 /*PRN1*/, 6, 7, 8, 17, 18, 139, 140, 141, 251, 252, 254 ,255, 256, 257, 258, 469, 470, 471, 472, - 473, 474, 509, 512, 513, 514, 515, 516, 859, 860, 861, 862 /*PRN32*/, - 145 /*PRN120*/, 175, 52, 21, 237, 235, 886, 657, 634, 762, - 355, 1012, 176, 603, 130, 359, 595, 68, 386 /*PRN138*/}; + const signed int delays[51] = {5 /*PRN1*/, 6, 7, 8, 17, 18, 139, 140, 141, 251, 252, 254, 255, 256, 257, 258, 469, 470, 471, 472, + 473, 474, 509, 512, 513, 514, 515, 516, 859, 860, 861, 862 /*PRN32*/, + 145 /*PRN120*/, 175, 52, 21, 237, 235, 886, 657, 634, 762, + 355, 1012, 176, 603, 130, 359, 595, 68, 386 /*PRN138*/}; // compute delay array index for given PRN number - if(120 <= _prn && _prn <= 138) + if (120 <= _prn && _prn <= 138) { - prn_idx = _prn - 88; // SBAS PRNs are at array indices 31 to 50 (offset: -120+33-1 =-88) + prn_idx = _prn - 88; // SBAS PRNs are at array indices 31 to 50 (offset: -120+33-1 =-88) } else { @@ -63,25 +63,25 @@ void gps_l1_ca_code_gen_int(int* _dest, signed int _prn, unsigned int _chip_shif } /* A simple error check */ - if((prn_idx < 0) || (prn_idx > 51)) + if ((prn_idx < 0) || (prn_idx > 51)) return; - for(lcv = 0; lcv < 10; lcv++) + for (lcv = 0; lcv < 10; lcv++) { G1_register[lcv] = 1; G2_register[lcv] = 1; } /* Generate G1 & G2 Register */ - for(lcv = 0; lcv < _code_length; lcv++) + for (lcv = 0; lcv < _code_length; lcv++) { G1[lcv] = G1_register[0]; G2[lcv] = G2_register[0]; - feedback1 = G1_register[7]^G1_register[0]; + feedback1 = G1_register[7] ^ G1_register[0]; feedback2 = (G2_register[8] + G2_register[7] + G2_register[4] + G2_register[2] + G2_register[1] + G2_register[0]) & 0x1; - for(lcv2 = 0; lcv2 < 9; lcv2++) + for (lcv2 = 0; lcv2 < 9; lcv2++) { G1_register[lcv2] = G1_register[lcv2 + 1]; G2_register[lcv2] = G2_register[lcv2 + 1]; @@ -97,10 +97,10 @@ void gps_l1_ca_code_gen_int(int* _dest, signed int _prn, unsigned int _chip_shif delay %= _code_length; /* Generate PRN from G1 and G2 Registers */ - for(lcv = 0; lcv < _code_length; lcv++) + for (lcv = 0; lcv < _code_length; lcv++) { - aux = G1[(lcv + _chip_shift) % _code_length]^G2[delay]; - if(aux == true) + aux = G1[(lcv + _chip_shift) % _code_length] ^ G2[delay]; + if (aux == true) { _dest[lcv] = 1; } @@ -117,13 +117,13 @@ void gps_l1_ca_code_gen_int(int* _dest, signed int _prn, unsigned int _chip_shif void gps_l1_ca_code_gen_float(float* _dest, signed int _prn, unsigned int _chip_shift) { unsigned int _code_length = 1023; - int ca_code_int[ _code_length ]; + int ca_code_int[_code_length]; - gps_l1_ca_code_gen_int( ca_code_int, _prn, _chip_shift ); + gps_l1_ca_code_gen_int(ca_code_int, _prn, _chip_shift); - for( unsigned int ii = 0; ii < _code_length; ++ii ) + for (unsigned int ii = 0; ii < _code_length; ++ii) { - _dest[ii] = static_cast( ca_code_int[ii] ); + _dest[ii] = static_cast(ca_code_int[ii]); } } @@ -131,13 +131,13 @@ void gps_l1_ca_code_gen_float(float* _dest, signed int _prn, unsigned int _chip_ void gps_l1_ca_code_gen_complex(std::complex* _dest, signed int _prn, unsigned int _chip_shift) { unsigned int _code_length = 1023; - int ca_code_int[ _code_length ]; + int ca_code_int[_code_length]; - gps_l1_ca_code_gen_int( ca_code_int, _prn, _chip_shift ); + gps_l1_ca_code_gen_int(ca_code_int, _prn, _chip_shift); - for( unsigned int ii = 0; ii < _code_length; ++ii ) + for (unsigned int ii = 0; ii < _code_length; ++ii) { - _dest[ii] = std::complex( static_cast(ca_code_int[ii]), 0.0f ); + _dest[ii] = std::complex(static_cast(ca_code_int[ii]), 0.0f); } } @@ -153,16 +153,16 @@ void gps_l1_ca_code_gen_complex_sampled(std::complex* _dest, unsigned int float _ts; float _tc; float aux; - const signed int _codeFreqBasis = 1023000; //Hz + const signed int _codeFreqBasis = 1023000; //Hz const signed int _codeLength = 1023; //--- Find number of samples per spreading code ---------------------------- _samplesPerCode = static_cast(static_cast(_fs) / static_cast(_codeFreqBasis / _codeLength)); //--- Find time constants -------------------------------------------------- - _ts = 1.0 / static_cast(_fs); // Sampling period in sec - _tc = 1.0 / static_cast(_codeFreqBasis); // C/A chip period in sec - gps_l1_ca_code_gen_complex(_code, _prn, _chip_shift); //generate C/A code 1 sample per chip + _ts = 1.0 / static_cast(_fs); // Sampling period in sec + _tc = 1.0 / static_cast(_codeFreqBasis); // C/A chip period in sec + gps_l1_ca_code_gen_complex(_code, _prn, _chip_shift); //generate C/A code 1 sample per chip for (signed int i = 0; i < _samplesPerCode; i++) { @@ -174,8 +174,8 @@ void gps_l1_ca_code_gen_complex_sampled(std::complex* _dest, unsigned int // millisecond). // _codeValueIndex = ceil((_ts * ((float)i + 1)) / _tc) - 1; - aux = (_ts * (i + 1)) / _tc; - _codeValueIndex = auxCeil( aux ) - 1; + aux = (_ts * (i + 1)) / _tc; + _codeValueIndex = auxCeil(aux) - 1; //--- Make the digitized version of the C/A code ----------------------- // The "upsampled" code is made by selecting values form the CA code @@ -184,12 +184,10 @@ void gps_l1_ca_code_gen_complex_sampled(std::complex* _dest, unsigned int { //--- Correct the last index (due to number rounding issues) ----------- _dest[i] = _code[_codeLength - 1]; - } else { - _dest[i] = _code[_codeValueIndex]; //repeat the chip -> upsample + _dest[i] = _code[_codeValueIndex]; //repeat the chip -> upsample } } } - diff --git a/src/algorithms/libs/gps_sdr_signal_processing.h b/src/algorithms/libs/gps_sdr_signal_processing.h index bd41ca8a3..caeab2a0b 100644 --- a/src/algorithms/libs/gps_sdr_signal_processing.h +++ b/src/algorithms/libs/gps_sdr_signal_processing.h @@ -35,10 +35,10 @@ #include -//!Generates int GPS L1 C/A code for the desired SV ID and code shift +//!Generates int GPS L1 C/A code for the desired SV ID and code shift void gps_l1_ca_code_gen_int(int* _dest, signed int _prn, unsigned int _chip_shift); -//!Generates float GPS L1 C/A code for the desired SV ID and code shift +//!Generates float GPS L1 C/A code for the desired SV ID and code shift void gps_l1_ca_code_gen_float(float* _dest, signed int _prn, unsigned int _chip_shift); //!Generates complex GPS L1 C/A code for the desired SV ID and code shift, and sampled to specific sampling frequency diff --git a/src/algorithms/libs/cl.hpp b/src/algorithms/libs/opencl/cl.hpp similarity index 100% rename from src/algorithms/libs/cl.hpp rename to src/algorithms/libs/opencl/cl.hpp diff --git a/src/algorithms/libs/clFFT.h b/src/algorithms/libs/opencl/clFFT.h similarity index 62% rename from src/algorithms/libs/clFFT.h rename to src/algorithms/libs/opencl/clFFT.h index d1e3a8fc4..9f9c8c1d3 100644 --- a/src/algorithms/libs/clFFT.h +++ b/src/algorithms/libs/opencl/clFFT.h @@ -50,85 +50,86 @@ #define __CLFFT_H #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif #include #ifdef __APPLE__ - #include +#include #else - #include +#include #endif -// XForm type -typedef enum -{ - clFFT_Forward = -1, - clFFT_Inverse = 1 - -}clFFT_Direction; + // XForm type + typedef enum + { + clFFT_Forward = -1, + clFFT_Inverse = 1 -// XForm dimension -typedef enum -{ - clFFT_1D = 0, - clFFT_2D = 1, - clFFT_3D = 3 - -}clFFT_Dimension; + } clFFT_Direction; -// XForm Data type -typedef enum -{ - clFFT_SplitComplexFormat = 0, - clFFT_InterleavedComplexFormat = 1 -}clFFT_DataFormat; + // XForm dimension + typedef enum + { + clFFT_1D = 0, + clFFT_2D = 1, + clFFT_3D = 3 -typedef struct -{ - unsigned int x; - unsigned int y; - unsigned int z; -}clFFT_Dim3; - -typedef struct -{ - float *real; - float *imag; -} clFFT_SplitComplex; + } clFFT_Dimension; -typedef struct -{ - float real; - float imag; -}clFFT_Complex; + // XForm Data type + typedef enum + { + clFFT_SplitComplexFormat = 0, + clFFT_InterleavedComplexFormat = 1 + } clFFT_DataFormat; -typedef void* clFFT_Plan; + typedef struct + { + unsigned int x; + unsigned int y; + unsigned int z; + } clFFT_Dim3; -clFFT_Plan clFFT_CreatePlan( cl_context context, clFFT_Dim3 n, clFFT_Dimension dim, clFFT_DataFormat dataFormat, cl_int *error_code ); + typedef struct + { + float *real; + float *imag; + } clFFT_SplitComplex; -void clFFT_DestroyPlan( clFFT_Plan plan ); + typedef struct + { + float real; + float imag; + } clFFT_Complex; -cl_int clFFT_ExecuteInterleaved( cl_command_queue queue, clFFT_Plan plan, cl_int batchSize, clFFT_Direction dir, - cl_mem data_in, cl_mem data_out, - cl_int num_events, cl_event *event_list, cl_event *event ); + typedef void *clFFT_Plan; -cl_int clFFT_ExecutePlannar( cl_command_queue queue, clFFT_Plan plan, cl_int batchSize, clFFT_Direction dir, - cl_mem data_in_real, cl_mem data_in_imag, cl_mem data_out_real, cl_mem data_out_imag, - cl_int num_events, cl_event *event_list, cl_event *event ); + clFFT_Plan clFFT_CreatePlan(cl_context context, clFFT_Dim3 n, clFFT_Dimension dim, clFFT_DataFormat dataFormat, cl_int *error_code); -cl_int clFFT_1DTwistInterleaved(clFFT_Plan Plan, cl_command_queue queue, cl_mem array, - size_t numRows, size_t numCols, size_t startRow, size_t rowsToProcess, clFFT_Direction dir); - + void clFFT_DestroyPlan(clFFT_Plan plan); -cl_int clFFT_1DTwistPlannar(clFFT_Plan Plan, cl_command_queue queue, cl_mem array_real, cl_mem array_imag, - size_t numRows, size_t numCols, size_t startRow, size_t rowsToProcess, clFFT_Direction dir); - -void clFFT_DumpPlan( clFFT_Plan plan, FILE *file); + cl_int clFFT_ExecuteInterleaved(cl_command_queue queue, clFFT_Plan plan, cl_int batchSize, clFFT_Direction dir, + cl_mem data_in, cl_mem data_out, + cl_int num_events, cl_event *event_list, cl_event *event); + + cl_int clFFT_ExecutePlannar(cl_command_queue queue, clFFT_Plan plan, cl_int batchSize, clFFT_Direction dir, + cl_mem data_in_real, cl_mem data_in_imag, cl_mem data_out_real, cl_mem data_out_imag, + cl_int num_events, cl_event *event_list, cl_event *event); + + cl_int clFFT_1DTwistInterleaved(clFFT_Plan Plan, cl_command_queue queue, cl_mem array, + size_t numRows, size_t numCols, size_t startRow, size_t rowsToProcess, clFFT_Direction dir); + + + cl_int clFFT_1DTwistPlannar(clFFT_Plan Plan, cl_command_queue queue, cl_mem array_real, cl_mem array_imag, + size_t numRows, size_t numCols, size_t startRow, size_t rowsToProcess, clFFT_Direction dir); + + void clFFT_DumpPlan(clFFT_Plan plan, FILE *file); #ifdef __cplusplus } #endif -#endif +#endif diff --git a/src/algorithms/libs/opencl/fft_base_kernels.h b/src/algorithms/libs/opencl/fft_base_kernels.h new file mode 100644 index 000000000..42c7d5816 --- /dev/null +++ b/src/algorithms/libs/opencl/fft_base_kernels.h @@ -0,0 +1,273 @@ + +// +// File: fft_base_kernels.h +// +// Version: <1.0> +// +// Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Inc. ("Apple") +// in consideration of your agreement to the following terms, and your use, +// installation, modification or redistribution of this Apple software +// constitutes acceptance of these terms. If you do not agree with these +// terms, please do not use, install, modify or redistribute this Apple +// software. +// +// In consideration of your agreement to abide by the following terms, and +// subject to these terms, Apple grants you a personal, non - exclusive +// license, under Apple's copyrights in this original Apple software ( the +// "Apple Software" ), to use, reproduce, modify and redistribute the Apple +// Software, with or without modifications, in source and / or binary forms; +// provided that if you redistribute the Apple Software in its entirety and +// without modifications, you must retain this notice and the following text +// and disclaimers in all such redistributions of the Apple Software. Neither +// the name, trademarks, service marks or logos of Apple Inc. may be used to +// endorse or promote products derived from the Apple Software without specific +// prior written permission from Apple. Except as expressly stated in this +// notice, no other rights or licenses, express or implied, are granted by +// Apple herein, including but not limited to any patent rights that may be +// infringed by your derivative works or by other works in which the Apple +// Software may be incorporated. +// +// The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO +// WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED +// WARRANTIES OF NON - INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A +// PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION +// ALONE OR IN COMBINATION WITH YOUR PRODUCTS. +// +// IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR +// CONSEQUENTIAL DAMAGES ( INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION ) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION +// AND / OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER +// UNDER THEORY OF CONTRACT, TORT ( INCLUDING NEGLIGENCE ), STRICT LIABILITY OR +// OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Copyright ( C ) 2008 Apple Inc. All Rights Reserved. +// +//////////////////////////////////////////////////////////////////////////////////////////////////// + + +#ifndef __CL_FFT_BASE_KERNELS_ +#define __CL_FFT_BASE_KERNELS_ + +#include + +using namespace std; + +static string baseKernels = string( + "#ifndef M_PI\n" + "#define M_PI 0x1.921fb54442d18p+1\n" + "#endif\n" + "#define complexMul(a,b) ((float2)(mad(-(a).y, (b).y, (a).x * (b).x), mad((a).y, (b).x, (a).x * (b).y)))\n" + "#define conj(a) ((float2)((a).x, -(a).y))\n" + "#define conjTransp(a) ((float2)(-(a).y, (a).x))\n" + "\n" + "#define fftKernel2(a,dir) \\\n" + "{ \\\n" + " float2 c = (a)[0]; \\\n" + " (a)[0] = c + (a)[1]; \\\n" + " (a)[1] = c - (a)[1]; \\\n" + "}\n" + "\n" + "#define fftKernel2S(d1,d2,dir) \\\n" + "{ \\\n" + " float2 c = (d1); \\\n" + " (d1) = c + (d2); \\\n" + " (d2) = c - (d2); \\\n" + "}\n" + "\n" + "#define fftKernel4(a,dir) \\\n" + "{ \\\n" + " fftKernel2S((a)[0], (a)[2], dir); \\\n" + " fftKernel2S((a)[1], (a)[3], dir); \\\n" + " fftKernel2S((a)[0], (a)[1], dir); \\\n" + " (a)[3] = (float2)(dir)*(conjTransp((a)[3])); \\\n" + " fftKernel2S((a)[2], (a)[3], dir); \\\n" + " float2 c = (a)[1]; \\\n" + " (a)[1] = (a)[2]; \\\n" + " (a)[2] = c; \\\n" + "}\n" + "\n" + "#define fftKernel4s(a0,a1,a2,a3,dir) \\\n" + "{ \\\n" + " fftKernel2S((a0), (a2), dir); \\\n" + " fftKernel2S((a1), (a3), dir); \\\n" + " fftKernel2S((a0), (a1), dir); \\\n" + " (a3) = (float2)(dir)*(conjTransp((a3))); \\\n" + " fftKernel2S((a2), (a3), dir); \\\n" + " float2 c = (a1); \\\n" + " (a1) = (a2); \\\n" + " (a2) = c; \\\n" + "}\n" + "\n" + "#define bitreverse8(a) \\\n" + "{ \\\n" + " float2 c; \\\n" + " c = (a)[1]; \\\n" + " (a)[1] = (a)[4]; \\\n" + " (a)[4] = c; \\\n" + " c = (a)[3]; \\\n" + " (a)[3] = (a)[6]; \\\n" + " (a)[6] = c; \\\n" + "}\n" + "\n" + "#define fftKernel8(a,dir) \\\n" + "{ \\\n" + " const float2 w1 = (float2)(0x1.6a09e6p-1f, dir*0x1.6a09e6p-1f); \\\n" + " const float2 w3 = (float2)(-0x1.6a09e6p-1f, dir*0x1.6a09e6p-1f); \\\n" + " float2 c; \\\n" + " fftKernel2S((a)[0], (a)[4], dir); \\\n" + " fftKernel2S((a)[1], (a)[5], dir); \\\n" + " fftKernel2S((a)[2], (a)[6], dir); \\\n" + " fftKernel2S((a)[3], (a)[7], dir); \\\n" + " (a)[5] = complexMul(w1, (a)[5]); \\\n" + " (a)[6] = (float2)(dir)*(conjTransp((a)[6])); \\\n" + " (a)[7] = complexMul(w3, (a)[7]); \\\n" + " fftKernel2S((a)[0], (a)[2], dir); \\\n" + " fftKernel2S((a)[1], (a)[3], dir); \\\n" + " fftKernel2S((a)[4], (a)[6], dir); \\\n" + " fftKernel2S((a)[5], (a)[7], dir); \\\n" + " (a)[3] = (float2)(dir)*(conjTransp((a)[3])); \\\n" + " (a)[7] = (float2)(dir)*(conjTransp((a)[7])); \\\n" + " fftKernel2S((a)[0], (a)[1], dir); \\\n" + " fftKernel2S((a)[2], (a)[3], dir); \\\n" + " fftKernel2S((a)[4], (a)[5], dir); \\\n" + " fftKernel2S((a)[6], (a)[7], dir); \\\n" + " bitreverse8((a)); \\\n" + "}\n" + "\n" + "#define bitreverse4x4(a) \\\n" + "{ \\\n" + " float2 c; \\\n" + " c = (a)[1]; (a)[1] = (a)[4]; (a)[4] = c; \\\n" + " c = (a)[2]; (a)[2] = (a)[8]; (a)[8] = c; \\\n" + " c = (a)[3]; (a)[3] = (a)[12]; (a)[12] = c; \\\n" + " c = (a)[6]; (a)[6] = (a)[9]; (a)[9] = c; \\\n" + " c = (a)[7]; (a)[7] = (a)[13]; (a)[13] = c; \\\n" + " c = (a)[11]; (a)[11] = (a)[14]; (a)[14] = c; \\\n" + "}\n" + "\n" + "#define fftKernel16(a,dir) \\\n" + "{ \\\n" + " const float w0 = 0x1.d906bcp-1f; \\\n" + " const float w1 = 0x1.87de2ap-2f; \\\n" + " const float w2 = 0x1.6a09e6p-1f; \\\n" + " fftKernel4s((a)[0], (a)[4], (a)[8], (a)[12], dir); \\\n" + " fftKernel4s((a)[1], (a)[5], (a)[9], (a)[13], dir); \\\n" + " fftKernel4s((a)[2], (a)[6], (a)[10], (a)[14], dir); \\\n" + " fftKernel4s((a)[3], (a)[7], (a)[11], (a)[15], dir); \\\n" + " (a)[5] = complexMul((a)[5], (float2)(w0, dir*w1)); \\\n" + " (a)[6] = complexMul((a)[6], (float2)(w2, dir*w2)); \\\n" + " (a)[7] = complexMul((a)[7], (float2)(w1, dir*w0)); \\\n" + " (a)[9] = complexMul((a)[9], (float2)(w2, dir*w2)); \\\n" + " (a)[10] = (float2)(dir)*(conjTransp((a)[10])); \\\n" + " (a)[11] = complexMul((a)[11], (float2)(-w2, dir*w2)); \\\n" + " (a)[13] = complexMul((a)[13], (float2)(w1, dir*w0)); \\\n" + " (a)[14] = complexMul((a)[14], (float2)(-w2, dir*w2)); \\\n" + " (a)[15] = complexMul((a)[15], (float2)(-w0, dir*-w1)); \\\n" + " fftKernel4((a), dir); \\\n" + " fftKernel4((a) + 4, dir); \\\n" + " fftKernel4((a) + 8, dir); \\\n" + " fftKernel4((a) + 12, dir); \\\n" + " bitreverse4x4((a)); \\\n" + "}\n" + "\n" + "#define bitreverse32(a) \\\n" + "{ \\\n" + " float2 c1, c2; \\\n" + " c1 = (a)[2]; (a)[2] = (a)[1]; c2 = (a)[4]; (a)[4] = c1; c1 = (a)[8]; (a)[8] = c2; c2 = (a)[16]; (a)[16] = c1; (a)[1] = c2; \\\n" + " c1 = (a)[6]; (a)[6] = (a)[3]; c2 = (a)[12]; (a)[12] = c1; c1 = (a)[24]; (a)[24] = c2; c2 = (a)[17]; (a)[17] = c1; (a)[3] = c2; \\\n" + " c1 = (a)[10]; (a)[10] = (a)[5]; c2 = (a)[20]; (a)[20] = c1; c1 = (a)[9]; (a)[9] = c2; c2 = (a)[18]; (a)[18] = c1; (a)[5] = c2; \\\n" + " c1 = (a)[14]; (a)[14] = (a)[7]; c2 = (a)[28]; (a)[28] = c1; c1 = (a)[25]; (a)[25] = c2; c2 = (a)[19]; (a)[19] = c1; (a)[7] = c2; \\\n" + " c1 = (a)[22]; (a)[22] = (a)[11]; c2 = (a)[13]; (a)[13] = c1; c1 = (a)[26]; (a)[26] = c2; c2 = (a)[21]; (a)[21] = c1; (a)[11] = c2; \\\n" + " c1 = (a)[30]; (a)[30] = (a)[15]; c2 = (a)[29]; (a)[29] = c1; c1 = (a)[27]; (a)[27] = c2; c2 = (a)[23]; (a)[23] = c1; (a)[15] = c2; \\\n" + "}\n" + "\n" + "#define fftKernel32(a,dir) \\\n" + "{ \\\n" + " fftKernel2S((a)[0], (a)[16], dir); \\\n" + " fftKernel2S((a)[1], (a)[17], dir); \\\n" + " fftKernel2S((a)[2], (a)[18], dir); \\\n" + " fftKernel2S((a)[3], (a)[19], dir); \\\n" + " fftKernel2S((a)[4], (a)[20], dir); \\\n" + " fftKernel2S((a)[5], (a)[21], dir); \\\n" + " fftKernel2S((a)[6], (a)[22], dir); \\\n" + " fftKernel2S((a)[7], (a)[23], dir); \\\n" + " fftKernel2S((a)[8], (a)[24], dir); \\\n" + " fftKernel2S((a)[9], (a)[25], dir); \\\n" + " fftKernel2S((a)[10], (a)[26], dir); \\\n" + " fftKernel2S((a)[11], (a)[27], dir); \\\n" + " fftKernel2S((a)[12], (a)[28], dir); \\\n" + " fftKernel2S((a)[13], (a)[29], dir); \\\n" + " fftKernel2S((a)[14], (a)[30], dir); \\\n" + " fftKernel2S((a)[15], (a)[31], dir); \\\n" + " (a)[17] = complexMul((a)[17], (float2)(0x1.f6297cp-1f, dir*0x1.8f8b84p-3f)); \\\n" + " (a)[18] = complexMul((a)[18], (float2)(0x1.d906bcp-1f, dir*0x1.87de2ap-2f)); \\\n" + " (a)[19] = complexMul((a)[19], (float2)(0x1.a9b662p-1f, dir*0x1.1c73b4p-1f)); \\\n" + " (a)[20] = complexMul((a)[20], (float2)(0x1.6a09e6p-1f, dir*0x1.6a09e6p-1f)); \\\n" + " (a)[21] = complexMul((a)[21], (float2)(0x1.1c73b4p-1f, dir*0x1.a9b662p-1f)); \\\n" + " (a)[22] = complexMul((a)[22], (float2)(0x1.87de2ap-2f, dir*0x1.d906bcp-1f)); \\\n" + " (a)[23] = complexMul((a)[23], (float2)(0x1.8f8b84p-3f, dir*0x1.f6297cp-1f)); \\\n" + " (a)[24] = complexMul((a)[24], (float2)(0x0p+0f, dir*0x1p+0f)); \\\n" + " (a)[25] = complexMul((a)[25], (float2)(-0x1.8f8b84p-3f, dir*0x1.f6297cp-1f)); \\\n" + " (a)[26] = complexMul((a)[26], (float2)(-0x1.87de2ap-2f, dir*0x1.d906bcp-1f)); \\\n" + " (a)[27] = complexMul((a)[27], (float2)(-0x1.1c73b4p-1f, dir*0x1.a9b662p-1f)); \\\n" + " (a)[28] = complexMul((a)[28], (float2)(-0x1.6a09e6p-1f, dir*0x1.6a09e6p-1f)); \\\n" + " (a)[29] = complexMul((a)[29], (float2)(-0x1.a9b662p-1f, dir*0x1.1c73b4p-1f)); \\\n" + " (a)[30] = complexMul((a)[30], (float2)(-0x1.d906bcp-1f, dir*0x1.87de2ap-2f)); \\\n" + " (a)[31] = complexMul((a)[31], (float2)(-0x1.f6297cp-1f, dir*0x1.8f8b84p-3f)); \\\n" + " fftKernel16((a), dir); \\\n" + " fftKernel16((a) + 16, dir); \\\n" + " bitreverse32((a)); \\\n" + "}\n\n"); + +static string twistKernelInterleaved = string( + "__kernel void \\\n" + "clFFT_1DTwistInterleaved(__global float2 *in, unsigned int startRow, unsigned int numCols, unsigned int N, unsigned int numRowsToProcess, int dir) \\\n" + "{ \\\n" + " float2 a, w; \\\n" + " float ang; \\\n" + " unsigned int j; \\\n" + " unsigned int i = get_global_id(0); \\\n" + " unsigned int startIndex = i; \\\n" + " \\\n" + " if(i < numCols) \\\n" + " { \\\n" + " for(j = 0; j < numRowsToProcess; j++) \\\n" + " { \\\n" + " a = in[startIndex]; \\\n" + " ang = 2.0f * M_PI * dir * i * (startRow + j) / N; \\\n" + " w = (float2)(native_cos(ang), native_sin(ang)); \\\n" + " a = complexMul(a, w); \\\n" + " in[startIndex] = a; \\\n" + " startIndex += numCols; \\\n" + " } \\\n" + " } \\\n" + "} \\\n"); + +static string twistKernelPlannar = string( + "__kernel void \\\n" + "clFFT_1DTwistSplit(__global float *in_real, __global float *in_imag , unsigned int startRow, unsigned int numCols, unsigned int N, unsigned int numRowsToProcess, int dir) \\\n" + "{ \\\n" + " float2 a, w; \\\n" + " float ang; \\\n" + " unsigned int j; \\\n" + " unsigned int i = get_global_id(0); \\\n" + " unsigned int startIndex = i; \\\n" + " \\\n" + " if(i < numCols) \\\n" + " { \\\n" + " for(j = 0; j < numRowsToProcess; j++) \\\n" + " { \\\n" + " a = (float2)(in_real[startIndex], in_imag[startIndex]); \\\n" + " ang = 2.0f * M_PI * dir * i * (startRow + j) / N; \\\n" + " w = (float2)(native_cos(ang), native_sin(ang)); \\\n" + " a = complexMul(a, w); \\\n" + " in_real[startIndex] = a.x; \\\n" + " in_imag[startIndex] = a.y; \\\n" + " startIndex += numCols; \\\n" + " } \\\n" + " } \\\n" + "} \\\n"); + + +#endif diff --git a/src/algorithms/libs/opencl/fft_execute.cc b/src/algorithms/libs/opencl/fft_execute.cc new file mode 100644 index 000000000..baf3873be --- /dev/null +++ b/src/algorithms/libs/opencl/fft_execute.cc @@ -0,0 +1,403 @@ + +// +// File: fft_execute.cpp +// +// Version: <1.0> +// +// Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Inc. ("Apple") +// in consideration of your agreement to the following terms, and your use, +// installation, modification or redistribution of this Apple software +// constitutes acceptance of these terms. If you do not agree with these +// terms, please do not use, install, modify or redistribute this Apple +// software.¬ +// +// In consideration of your agreement to abide by the following terms, and +// subject to these terms, Apple grants you a personal, non - exclusive +// license, under Apple's copyrights in this original Apple software ( the +// "Apple Software" ), to use, reproduce, modify and redistribute the Apple +// Software, with or without modifications, in source and / or binary forms; +// provided that if you redistribute the Apple Software in its entirety and +// without modifications, you must retain this notice and the following text +// and disclaimers in all such redistributions of the Apple Software. Neither +// the name, trademarks, service marks or logos of Apple Inc. may be used to +// endorse or promote products derived from the Apple Software without specific +// prior written permission from Apple. Except as expressly stated in this +// notice, no other rights or licenses, express or implied, are granted by +// Apple herein, including but not limited to any patent rights that may be +// infringed by your derivative works or by other works in which the Apple +// Software may be incorporated. +// +// The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO +// WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED +// WARRANTIES OF NON - INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A +// PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION +// ALONE OR IN COMBINATION WITH YOUR PRODUCTS. +// +// IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR +// CONSEQUENTIAL DAMAGES ( INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION ) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION +// AND / OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER +// UNDER THEORY OF CONTRACT, TORT ( INCLUDING NEGLIGENCE ), STRICT LIABILITY OR +// OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Copyright ( C ) 2008 Apple Inc. All Rights Reserved. +// +//////////////////////////////////////////////////////////////////////////////////////////////////// + + +#include "fft_internal.h" +#include "clFFT.h" +#include +#include +#include + +#define max(a, b) (((a) > (b)) ? (a) : (b)) +#define min(a, b) (((a) < (b)) ? (a) : (b)) + +static cl_int +allocateTemporaryBufferInterleaved(cl_fft_plan *plan, cl_uint batchSize) +{ + cl_int err = CL_SUCCESS; + if (plan->temp_buffer_needed && plan->last_batch_size != batchSize) + { + plan->last_batch_size = batchSize; + size_t tmpLength = plan->n.x * plan->n.y * plan->n.z * batchSize * 2 * sizeof(cl_float); + + if (plan->tempmemobj) + clReleaseMemObject(plan->tempmemobj); + + plan->tempmemobj = clCreateBuffer(plan->context, CL_MEM_READ_WRITE, tmpLength, NULL, &err); + } + return err; +} + +static cl_int +allocateTemporaryBufferPlannar(cl_fft_plan *plan, cl_uint batchSize) +{ + cl_int err = CL_SUCCESS; + cl_int terr; + if (plan->temp_buffer_needed && plan->last_batch_size != batchSize) + { + plan->last_batch_size = batchSize; + size_t tmpLength = plan->n.x * plan->n.y * plan->n.z * batchSize * sizeof(cl_float); + + if (plan->tempmemobj_real) + clReleaseMemObject(plan->tempmemobj_real); + + if (plan->tempmemobj_imag) + clReleaseMemObject(plan->tempmemobj_imag); + + plan->tempmemobj_real = clCreateBuffer(plan->context, CL_MEM_READ_WRITE, tmpLength, NULL, &err); + plan->tempmemobj_imag = clCreateBuffer(plan->context, CL_MEM_READ_WRITE, tmpLength, NULL, &terr); + err |= terr; + } + return err; +} + +void getKernelWorkDimensions(cl_fft_plan *plan, cl_fft_kernel_info *kernelInfo, cl_int *batchSize, size_t *gWorkItems, size_t *lWorkItems) +{ + *lWorkItems = kernelInfo->num_workitems_per_workgroup; + int numWorkGroups = kernelInfo->num_workgroups; + int numXFormsPerWG = kernelInfo->num_xforms_per_workgroup; + + switch (kernelInfo->dir) + { + case cl_fft_kernel_x: + *batchSize *= (plan->n.y * plan->n.z); + numWorkGroups = (*batchSize % numXFormsPerWG) ? (*batchSize / numXFormsPerWG + 1) : (*batchSize / numXFormsPerWG); + numWorkGroups *= kernelInfo->num_workgroups; + break; + case cl_fft_kernel_y: + *batchSize *= plan->n.z; + numWorkGroups *= *batchSize; + break; + case cl_fft_kernel_z: + numWorkGroups *= *batchSize; + break; + } + + *gWorkItems = numWorkGroups * *lWorkItems; +} + +cl_int +clFFT_ExecuteInterleaved(cl_command_queue queue, clFFT_Plan Plan, cl_int batchSize, clFFT_Direction dir, + cl_mem data_in, cl_mem data_out, + cl_int num_events, cl_event *event_list, cl_event *event) +{ + int s; + cl_fft_plan *plan = (cl_fft_plan *)Plan; + if (plan->format != clFFT_InterleavedComplexFormat) + return CL_INVALID_VALUE; + + cl_int err; + size_t gWorkItems, lWorkItems; + int inPlaceDone; + + cl_int isInPlace = data_in == data_out ? 1 : 0; + + if ((err = allocateTemporaryBufferInterleaved(plan, batchSize)) != CL_SUCCESS) + return err; + + cl_mem memObj[3]; + memObj[0] = data_in; + memObj[1] = data_out; + memObj[2] = plan->tempmemobj; + cl_fft_kernel_info *kernelInfo = plan->kernel_info; + int numKernels = plan->num_kernels; + + int numKernelsOdd = numKernels & 1; + int currRead = 0; + int currWrite = 1; + + // at least one external dram shuffle (transpose) required + if (plan->temp_buffer_needed) + { + // in-place transform + if (isInPlace) + { + inPlaceDone = 0; + currRead = 1; + currWrite = 2; + } + else + { + currWrite = (numKernels & 1) ? 1 : 2; + } + + while (kernelInfo) + { + if (isInPlace && numKernelsOdd && !inPlaceDone && kernelInfo->in_place_possible) + { + currWrite = currRead; + inPlaceDone = 1; + } + + s = batchSize; + getKernelWorkDimensions(plan, kernelInfo, &s, &gWorkItems, &lWorkItems); + err |= clSetKernelArg(kernelInfo->kernel, 0, sizeof(cl_mem), &memObj[currRead]); + err |= clSetKernelArg(kernelInfo->kernel, 1, sizeof(cl_mem), &memObj[currWrite]); + err |= clSetKernelArg(kernelInfo->kernel, 2, sizeof(cl_int), &dir); + err |= clSetKernelArg(kernelInfo->kernel, 3, sizeof(cl_int), &s); + + err |= clEnqueueNDRangeKernel(queue, kernelInfo->kernel, 1, NULL, &gWorkItems, &lWorkItems, 0, NULL, NULL); + if (err) + return err; + + currRead = (currWrite == 1) ? 1 : 2; + currWrite = (currWrite == 1) ? 2 : 1; + + kernelInfo = kernelInfo->next; + } + } + // no dram shuffle (transpose required) transform + // all kernels can execute in-place. + else + { + while (kernelInfo) + { + s = batchSize; + getKernelWorkDimensions(plan, kernelInfo, &s, &gWorkItems, &lWorkItems); + err |= clSetKernelArg(kernelInfo->kernel, 0, sizeof(cl_mem), &memObj[currRead]); + err |= clSetKernelArg(kernelInfo->kernel, 1, sizeof(cl_mem), &memObj[currWrite]); + err |= clSetKernelArg(kernelInfo->kernel, 2, sizeof(cl_int), &dir); + err |= clSetKernelArg(kernelInfo->kernel, 3, sizeof(cl_int), &s); + + err |= clEnqueueNDRangeKernel(queue, kernelInfo->kernel, 1, NULL, &gWorkItems, &lWorkItems, 0, NULL, NULL); + if (err) + return err; + + currRead = 1; + currWrite = 1; + + kernelInfo = kernelInfo->next; + } + } + + return err; +} + +cl_int +clFFT_ExecutePlannar(cl_command_queue queue, clFFT_Plan Plan, cl_int batchSize, clFFT_Direction dir, + cl_mem data_in_real, cl_mem data_in_imag, cl_mem data_out_real, cl_mem data_out_imag, + cl_int num_events, cl_event *event_list, cl_event *event) +{ + int s; + cl_fft_plan *plan = (cl_fft_plan *)Plan; + + if (plan->format != clFFT_SplitComplexFormat) + return CL_INVALID_VALUE; + + cl_int err; + size_t gWorkItems, lWorkItems; + int inPlaceDone; + + cl_int isInPlace = ((data_in_real == data_out_real) && (data_in_imag == data_out_imag)) ? 1 : 0; + + if ((err = allocateTemporaryBufferPlannar(plan, batchSize)) != CL_SUCCESS) + return err; + + cl_mem memObj_real[3]; + cl_mem memObj_imag[3]; + memObj_real[0] = data_in_real; + memObj_real[1] = data_out_real; + memObj_real[2] = plan->tempmemobj_real; + memObj_imag[0] = data_in_imag; + memObj_imag[1] = data_out_imag; + memObj_imag[2] = plan->tempmemobj_imag; + + cl_fft_kernel_info *kernelInfo = plan->kernel_info; + int numKernels = plan->num_kernels; + + int numKernelsOdd = numKernels & 1; + int currRead = 0; + int currWrite = 1; + + // at least one external dram shuffle (transpose) required + if (plan->temp_buffer_needed) + { + // in-place transform + if (isInPlace) + { + inPlaceDone = 0; + currRead = 1; + currWrite = 2; + } + else + { + currWrite = (numKernels & 1) ? 1 : 2; + } + + while (kernelInfo) + { + if (isInPlace && numKernelsOdd && !inPlaceDone && kernelInfo->in_place_possible) + { + currWrite = currRead; + inPlaceDone = 1; + } + + s = batchSize; + getKernelWorkDimensions(plan, kernelInfo, &s, &gWorkItems, &lWorkItems); + err |= clSetKernelArg(kernelInfo->kernel, 0, sizeof(cl_mem), &memObj_real[currRead]); + err |= clSetKernelArg(kernelInfo->kernel, 1, sizeof(cl_mem), &memObj_imag[currRead]); + err |= clSetKernelArg(kernelInfo->kernel, 2, sizeof(cl_mem), &memObj_real[currWrite]); + err |= clSetKernelArg(kernelInfo->kernel, 3, sizeof(cl_mem), &memObj_imag[currWrite]); + err |= clSetKernelArg(kernelInfo->kernel, 4, sizeof(cl_int), &dir); + err |= clSetKernelArg(kernelInfo->kernel, 5, sizeof(cl_int), &s); + + err |= clEnqueueNDRangeKernel(queue, kernelInfo->kernel, 1, NULL, &gWorkItems, &lWorkItems, 0, NULL, NULL); + if (err) + return err; + + currRead = (currWrite == 1) ? 1 : 2; + currWrite = (currWrite == 1) ? 2 : 1; + + kernelInfo = kernelInfo->next; + } + } + // no dram shuffle (transpose required) transform + else + { + while (kernelInfo) + { + s = batchSize; + getKernelWorkDimensions(plan, kernelInfo, &s, &gWorkItems, &lWorkItems); + err |= clSetKernelArg(kernelInfo->kernel, 0, sizeof(cl_mem), &memObj_real[currRead]); + err |= clSetKernelArg(kernelInfo->kernel, 1, sizeof(cl_mem), &memObj_imag[currRead]); + err |= clSetKernelArg(kernelInfo->kernel, 2, sizeof(cl_mem), &memObj_real[currWrite]); + err |= clSetKernelArg(kernelInfo->kernel, 3, sizeof(cl_mem), &memObj_imag[currWrite]); + err |= clSetKernelArg(kernelInfo->kernel, 4, sizeof(cl_int), &dir); + err |= clSetKernelArg(kernelInfo->kernel, 5, sizeof(cl_int), &s); + + err |= clEnqueueNDRangeKernel(queue, kernelInfo->kernel, 1, NULL, &gWorkItems, &lWorkItems, 0, NULL, NULL); + if (err) + return err; + + currRead = 1; + currWrite = 1; + + kernelInfo = kernelInfo->next; + } + } + + return err; +} + +cl_int +clFFT_1DTwistInterleaved(clFFT_Plan Plan, cl_command_queue queue, cl_mem array, + unsigned numRows, unsigned numCols, unsigned startRow, unsigned rowsToProcess, clFFT_Direction dir) +{ + cl_fft_plan *plan = (cl_fft_plan *)Plan; + + unsigned int N = numRows * numCols; + unsigned int nCols = numCols; + unsigned int sRow = startRow; + unsigned int rToProcess = rowsToProcess; + int d = dir; + int err = 0; + + cl_device_id device_id; + err = clGetCommandQueueInfo(queue, CL_QUEUE_DEVICE, sizeof(cl_device_id), &device_id, NULL); + if (err) + return err; + + size_t gSize; + err = clGetKernelWorkGroupInfo(plan->twist_kernel, device_id, CL_KERNEL_WORK_GROUP_SIZE, sizeof(size_t), &gSize, NULL); + if (err) + return err; + + gSize = min(128, gSize); + size_t numGlobalThreads[1] = {max(numCols / gSize, 1) * gSize}; + size_t numLocalThreads[1] = {gSize}; + + err |= clSetKernelArg(plan->twist_kernel, 0, sizeof(cl_mem), &array); + err |= clSetKernelArg(plan->twist_kernel, 1, sizeof(unsigned int), &sRow); + err |= clSetKernelArg(plan->twist_kernel, 2, sizeof(unsigned int), &nCols); + err |= clSetKernelArg(plan->twist_kernel, 3, sizeof(unsigned int), &N); + err |= clSetKernelArg(plan->twist_kernel, 4, sizeof(unsigned int), &rToProcess); + err |= clSetKernelArg(plan->twist_kernel, 5, sizeof(int), &d); + + err |= clEnqueueNDRangeKernel(queue, plan->twist_kernel, 1, NULL, numGlobalThreads, numLocalThreads, 0, NULL, NULL); + + return err; +} + +cl_int +clFFT_1DTwistPlannar(clFFT_Plan Plan, cl_command_queue queue, cl_mem array_real, cl_mem array_imag, + unsigned numRows, unsigned numCols, unsigned startRow, unsigned rowsToProcess, clFFT_Direction dir) +{ + cl_fft_plan *plan = (cl_fft_plan *)Plan; + + unsigned int N = numRows * numCols; + unsigned int nCols = numCols; + unsigned int sRow = startRow; + unsigned int rToProcess = rowsToProcess; + int d = dir; + int err = 0; + + cl_device_id device_id; + err = clGetCommandQueueInfo(queue, CL_QUEUE_DEVICE, sizeof(cl_device_id), &device_id, NULL); + if (err) + return err; + + size_t gSize; + err = clGetKernelWorkGroupInfo(plan->twist_kernel, device_id, CL_KERNEL_WORK_GROUP_SIZE, sizeof(size_t), &gSize, NULL); + if (err) + return err; + + gSize = min(128, gSize); + size_t numGlobalThreads[1] = {max(numCols / gSize, 1) * gSize}; + size_t numLocalThreads[1] = {gSize}; + + err |= clSetKernelArg(plan->twist_kernel, 0, sizeof(cl_mem), &array_real); + err |= clSetKernelArg(plan->twist_kernel, 1, sizeof(cl_mem), &array_imag); + err |= clSetKernelArg(plan->twist_kernel, 2, sizeof(unsigned int), &sRow); + err |= clSetKernelArg(plan->twist_kernel, 3, sizeof(unsigned int), &nCols); + err |= clSetKernelArg(plan->twist_kernel, 4, sizeof(unsigned int), &N); + err |= clSetKernelArg(plan->twist_kernel, 5, sizeof(unsigned int), &rToProcess); + err |= clSetKernelArg(plan->twist_kernel, 6, sizeof(int), &d); + + err |= clEnqueueNDRangeKernel(queue, plan->twist_kernel, 1, NULL, numGlobalThreads, numLocalThreads, 0, NULL, NULL); + + return err; +} diff --git a/src/algorithms/libs/opencl/fft_internal.h b/src/algorithms/libs/opencl/fft_internal.h new file mode 100644 index 000000000..5e462f455 --- /dev/null +++ b/src/algorithms/libs/opencl/fft_internal.h @@ -0,0 +1,163 @@ + +// +// File: fft_internal.h +// +// Version: <1.0> +// +// Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Inc. ("Apple") +// in consideration of your agreement to the following terms, and your use, +// installation, modification or redistribution of this Apple software +// constitutes acceptance of these terms. If you do not agree with these +// terms, please do not use, install, modify or redistribute this Apple +// software. +// +// In consideration of your agreement to abide by the following terms, and +// subject to these terms, Apple grants you a personal, non - exclusive +// license, under Apple's copyrights in this original Apple software ( the +// "Apple Software" ), to use, reproduce, modify and redistribute the Apple +// Software, with or without modifications, in source and / or binary forms; +// provided that if you redistribute the Apple Software in its entirety and +// without modifications, you must retain this notice and the following text +// and disclaimers in all such redistributions of the Apple Software. Neither +// the name, trademarks, service marks or logos of Apple Inc. may be used to +// endorse or promote products derived from the Apple Software without specific +// prior written permission from Apple. Except as expressly stated in this +// notice, no other rights or licenses, express or implied, are granted by +// Apple herein, including but not limited to any patent rights that may be +// infringed by your derivative works or by other works in which the Apple +// Software may be incorporated. +// +// The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO +// WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED +// WARRANTIES OF NON - INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A +// PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION +// ALONE OR IN COMBINATION WITH YOUR PRODUCTS. +// +// IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR +// CONSEQUENTIAL DAMAGES ( INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION ) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION +// AND / OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER +// UNDER THEORY OF CONTRACT, TORT ( INCLUDING NEGLIGENCE ), STRICT LIABILITY OR +// OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Copyright ( C ) 2008 Apple Inc. All Rights Reserved. +// +//////////////////////////////////////////////////////////////////////////////////////////////////// + + +#ifndef __CLFFT_INTERNAL_H +#define __CLFFT_INTERNAL_H + +#include "clFFT.h" +#include +#include +#include + +using namespace std; + +typedef enum kernel_dir_t +{ + cl_fft_kernel_x, + cl_fft_kernel_y, + cl_fft_kernel_z +} cl_fft_kernel_dir; + +typedef struct kernel_info_t +{ + cl_kernel kernel; + char *kernel_name; + unsigned lmem_size; + unsigned num_workgroups; + unsigned num_xforms_per_workgroup; + unsigned num_workitems_per_workgroup; + cl_fft_kernel_dir dir; + int in_place_possible; + kernel_info_t *next; +} cl_fft_kernel_info; + +typedef struct +{ + // context in which fft resources are created and kernels are executed + cl_context context; + + // size of signal + clFFT_Dim3 n; + + // dimension of transform ... must be either 1D, 2D or 3D + clFFT_Dimension dim; + + // data format ... must be either interleaved or plannar + clFFT_DataFormat format; + + // string containing kernel source. Generated at runtime based on + // n, dim, format and other parameters + string *kernel_string; + + // CL program containing source and kernel this particular + // n, dim, data format + cl_program program; + + // linked list of kernels which needs to be executed for this fft + cl_fft_kernel_info *kernel_info; + + // number of kernels + int num_kernels; + + // twist kernel for virtualizing fft of very large sizes that do not + // fit in GPU global memory + cl_kernel twist_kernel; + + // flag indicating if temporary intermediate buffer is needed or not. + // this depends on fft kernels being executed and if transform is + // in-place or out-of-place. e.g. Local memory fft (say 1D 1024 ... + // one that does not require global transpose do not need temporary buffer) + // 2D 1024x1024 out-of-place fft however do require intermediate buffer. + // If temp buffer is needed, its allocation is lazy i.e. its not allocated + // until its needed + cl_int temp_buffer_needed; + + // Batch size is runtime parameter and size of temporary buffer (if needed) + // depends on batch size. Allocation of temporary buffer is lazy i.e. its + // only created when needed. Once its created at first call of clFFT_Executexxx + // it is not allocated next time if next time clFFT_Executexxx is called with + // batch size different than the first call. last_batch_size caches the last + // batch size with which this plan is used so that we dont keep allocating/deallocating + // temp buffer if same batch size is used again and again. + unsigned last_batch_size; + + // temporary buffer for interleaved plan + cl_mem tempmemobj; + + // temporary buffer for planner plan. Only one of tempmemobj or + // (tempmemobj_real, tempmemobj_imag) pair is valid (allocated) depending + // data format of plan (plannar or interleaved) + cl_mem tempmemobj_real, tempmemobj_imag; + + // Maximum size of signal for which local memory transposed based + // fft is sufficient i.e. no global mem transpose (communication) + // is needed + unsigned max_localmem_fft_size; + + // Maximum work items per work group allowed. This, along with max_radix below controls + // maximum local memory being used by fft kernels of this plan. Set to 256 by default + unsigned max_work_item_per_workgroup; + + // Maximum base radix for local memory fft ... this controls the maximum register + // space used by work items. Currently defaults to 16 + unsigned max_radix; + + // Device depended parameter that tells how many work-items need to be read consecutive + // values to make sure global memory access by work-items of a work-group result in + // coalesced memory access to utilize full bandwidth e.g. on NVidia tesla, this is 16 + unsigned min_mem_coalesce_width; + + // Number of local memory banks. This is used to geneate kernel with local memory + // transposes with appropriate padding to avoid bank conflicts to local memory + // e.g. on NVidia it is 16. + unsigned num_local_mem_banks; +} cl_fft_plan; + +void FFT1D(cl_fft_plan *plan, cl_fft_kernel_dir dir); + +#endif diff --git a/src/algorithms/libs/opencl/fft_kernelstring.cc b/src/algorithms/libs/opencl/fft_kernelstring.cc new file mode 100644 index 000000000..733b60f42 --- /dev/null +++ b/src/algorithms/libs/opencl/fft_kernelstring.cc @@ -0,0 +1,1281 @@ + +// +// File: fft_kernelstring.cpp +// +// Version: <1.0> +// +// Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Inc. ("Apple") +// in consideration of your agreement to the following terms, and your use, +// installation, modification or redistribution of this Apple software +// constitutes acceptance of these terms. If you do not agree with these +// terms, please do not use, install, modify or redistribute this Apple +// software. +// +// In consideration of your agreement to abide by the following terms, and +// subject to these terms, Apple grants you a personal, non - exclusive +// license, under Apple's copyrights in this original Apple software ( the +// "Apple Software" ), to use, reproduce, modify and redistribute the Apple +// Software, with or without modifications, in source and / or binary forms; +// provided that if you redistribute the Apple Software in its entirety and +// without modifications, you must retain this notice and the following text +// and disclaimers in all such redistributions of the Apple Software. Neither +// the name, trademarks, service marks or logos of Apple Inc. may be used to +// endorse or promote products derived from the Apple Software without specific +// prior written permission from Apple. Except as expressly stated in this +// notice, no other rights or licenses, express or implied, are granted by +// Apple herein, including but not limited to any patent rights that may be +// infringed by your derivative works or by other works in which the Apple +// Software may be incorporated. +// +// The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO +// WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED +// WARRANTIES OF NON - INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A +// PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION +// ALONE OR IN COMBINATION WITH YOUR PRODUCTS. +// +// IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR +// CONSEQUENTIAL DAMAGES ( INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION ) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION +// AND / OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER +// UNDER THEORY OF CONTRACT, TORT ( INCLUDING NEGLIGENCE ), STRICT LIABILITY OR +// OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Copyright ( C ) 2008 Apple Inc. All Rights Reserved. +// +//////////////////////////////////////////////////////////////////////////////////////////////////// + + +#include +#include +#include +#include +#include +#include +#include +#include +#include "fft_internal.h" +#include "clFFT.h" + +using namespace std; + +#define max(A, B) ((A) > (B) ? (A) : (B)) +#define min(A, B) ((A) < (B) ? (A) : (B)) + +static string +num2str(int num) +{ + char temp[200]; + sprintf(temp, "%d", num); + return string(temp); +} + +// For any n, this function decomposes n into factors for loacal memory tranpose +// based fft. Factors (radices) are sorted such that the first one (radixArray[0]) +// is the largest. This base radix determines the number of registers used by each +// work item and product of remaining radices determine the size of work group needed. +// To make things concrete with and example, suppose n = 1024. It is decomposed into +// 1024 = 16 x 16 x 4. Hence kernel uses float2 a[16], for local in-register fft and +// needs 16 x 4 = 64 work items per work group. So kernel first performance 64 length +// 16 ffts (64 work items working in parallel) following by transpose using local +// memory followed by again 64 length 16 ffts followed by transpose using local memory +// followed by 256 length 4 ffts. For the last step since with size of work group is +// 64 and each work item can array for 16 values, 64 work items can compute 256 length +// 4 ffts by each work item computing 4 length 4 ffts. +// Similarly for n = 2048 = 8 x 8 x 8 x 4, each work group has 8 x 8 x 4 = 256 work +// iterms which each computes 256 (in-parallel) length 8 ffts in-register, followed +// by transpose using local memory, followed by 256 length 8 in-register ffts, followed +// by transpose using local memory, followed by 256 length 8 in-register ffts, followed +// by transpose using local memory, followed by 512 length 4 in-register ffts. Again, +// for the last step, each work item computes two length 4 in-register ffts and thus +// 256 work items are needed to compute all 512 ffts. +// For n = 32 = 8 x 4, 4 work items first compute 4 in-register +// lenth 8 ffts, followed by transpose using local memory followed by 8 in-register +// length 4 ffts, where each work item computes two length 4 ffts thus 4 work items +// can compute 8 length 4 ffts. However if work group size of say 64 is choosen, +// each work group can compute 64/ 4 = 16 size 32 ffts (batched transform). +// Users can play with these parameters to figure what gives best performance on +// their particular device i.e. some device have less register space thus using +// smaller base radix can avoid spilling ... some has small local memory thus +// using smaller work group size may be required etc + +static void +getRadixArray(unsigned int n, unsigned int *radixArray, unsigned int *numRadices, unsigned int maxRadix) +{ + if (maxRadix > 1) + { + maxRadix = min(n, maxRadix); + unsigned int cnt = 0; + while (n > maxRadix) + { + radixArray[cnt++] = maxRadix; + n /= maxRadix; + } + radixArray[cnt++] = n; + *numRadices = cnt; + return; + } + + switch (n) + { + case 2: + *numRadices = 1; + radixArray[0] = 2; + break; + + case 4: + *numRadices = 1; + radixArray[0] = 4; + break; + + case 8: + *numRadices = 1; + radixArray[0] = 8; + break; + + case 16: + *numRadices = 2; + radixArray[0] = 8; + radixArray[1] = 2; + break; + + case 32: + *numRadices = 2; + radixArray[0] = 8; + radixArray[1] = 4; + break; + + case 64: + *numRadices = 2; + radixArray[0] = 8; + radixArray[1] = 8; + break; + + case 128: + *numRadices = 3; + radixArray[0] = 8; + radixArray[1] = 4; + radixArray[2] = 4; + break; + + case 256: + *numRadices = 4; + radixArray[0] = 4; + radixArray[1] = 4; + radixArray[2] = 4; + radixArray[3] = 4; + break; + + case 512: + *numRadices = 3; + radixArray[0] = 8; + radixArray[1] = 8; + radixArray[2] = 8; + break; + + case 1024: + *numRadices = 3; + radixArray[0] = 16; + radixArray[1] = 16; + radixArray[2] = 4; + break; + case 2048: + *numRadices = 4; + radixArray[0] = 8; + radixArray[1] = 8; + radixArray[2] = 8; + radixArray[3] = 4; + break; + default: + *numRadices = 0; + return; + } +} + +static void +insertHeader(string &kernelString, string &kernelName, clFFT_DataFormat dataFormat) +{ + if (dataFormat == clFFT_SplitComplexFormat) + kernelString += string("__kernel void ") + kernelName + string("(__global float *in_real, __global float *in_imag, __global float *out_real, __global float *out_imag, int dir, int S)\n"); + else + kernelString += string("__kernel void ") + kernelName + string("(__global float2 *in, __global float2 *out, int dir, int S)\n"); +} + +static void +insertVariables(string &kStream, int maxRadix) +{ + kStream += string(" int i, j, r, indexIn, indexOut, index, tid, bNum, xNum, k, l;\n"); + kStream += string(" int s, ii, jj, offset;\n"); + kStream += string(" float2 w;\n"); + kStream += string(" float ang, angf, ang1;\n"); + kStream += string(" __local float *lMemStore, *lMemLoad;\n"); + kStream += string(" float2 a[") + num2str(maxRadix) + string("];\n"); + kStream += string(" int lId = get_local_id( 0 );\n"); + kStream += string(" int groupId = get_group_id( 0 );\n"); +} + +static void +formattedLoad(string &kernelString, int aIndex, int gIndex, clFFT_DataFormat dataFormat) +{ + if (dataFormat == clFFT_InterleavedComplexFormat) + kernelString += string(" a[") + num2str(aIndex) + string("] = in[") + num2str(gIndex) + string("];\n"); + else + { + kernelString += string(" a[") + num2str(aIndex) + string("].x = in_real[") + num2str(gIndex) + string("];\n"); + kernelString += string(" a[") + num2str(aIndex) + string("].y = in_imag[") + num2str(gIndex) + string("];\n"); + } +} + +static void +formattedStore(string &kernelString, int aIndex, int gIndex, clFFT_DataFormat dataFormat) +{ + if (dataFormat == clFFT_InterleavedComplexFormat) + kernelString += string(" out[") + num2str(gIndex) + string("] = a[") + num2str(aIndex) + string("];\n"); + else + { + kernelString += string(" out_real[") + num2str(gIndex) + string("] = a[") + num2str(aIndex) + string("].x;\n"); + kernelString += string(" out_imag[") + num2str(gIndex) + string("] = a[") + num2str(aIndex) + string("].y;\n"); + } +} + +static int +insertGlobalLoadsAndTranspose(string &kernelString, int N, int numWorkItemsPerXForm, int numXFormsPerWG, int R0, int mem_coalesce_width, clFFT_DataFormat dataFormat) +{ + int log2NumWorkItemsPerXForm = (int)log2(numWorkItemsPerXForm); + int groupSize = numWorkItemsPerXForm * numXFormsPerWG; + int i, j; + int lMemSize = 0; + + if (numXFormsPerWG > 1) + kernelString += string(" s = S & ") + num2str(numXFormsPerWG - 1) + string(";\n"); + + if (numWorkItemsPerXForm >= mem_coalesce_width) + { + if (numXFormsPerWG > 1) + { + kernelString += string(" ii = lId & ") + num2str(numWorkItemsPerXForm - 1) + string(";\n"); + kernelString += string(" jj = lId >> ") + num2str(log2NumWorkItemsPerXForm) + string(";\n"); + kernelString += string(" if( !s || (groupId < get_num_groups(0)-1) || (jj < s) ) {\n"); + kernelString += string(" offset = mad24( mad24(groupId, ") + num2str(numXFormsPerWG) + string(", jj), ") + num2str(N) + string(", ii );\n"); + if (dataFormat == clFFT_InterleavedComplexFormat) + { + kernelString += string(" in += offset;\n"); + kernelString += string(" out += offset;\n"); + } + else + { + kernelString += string(" in_real += offset;\n"); + kernelString += string(" in_imag += offset;\n"); + kernelString += string(" out_real += offset;\n"); + kernelString += string(" out_imag += offset;\n"); + } + for (i = 0; i < R0; i++) + formattedLoad(kernelString, i, i * numWorkItemsPerXForm, dataFormat); + kernelString += string(" }\n"); + } + else + { + kernelString += string(" ii = lId;\n"); + kernelString += string(" jj = 0;\n"); + kernelString += string(" offset = mad24(groupId, ") + num2str(N) + string(", ii);\n"); + if (dataFormat == clFFT_InterleavedComplexFormat) + { + kernelString += string(" in += offset;\n"); + kernelString += string(" out += offset;\n"); + } + else + { + kernelString += string(" in_real += offset;\n"); + kernelString += string(" in_imag += offset;\n"); + kernelString += string(" out_real += offset;\n"); + kernelString += string(" out_imag += offset;\n"); + } + for (i = 0; i < R0; i++) + formattedLoad(kernelString, i, i * numWorkItemsPerXForm, dataFormat); + } + } + else if (N >= mem_coalesce_width) + { + int numInnerIter = N / mem_coalesce_width; + int numOuterIter = numXFormsPerWG / (groupSize / mem_coalesce_width); + + kernelString += string(" ii = lId & ") + num2str(mem_coalesce_width - 1) + string(";\n"); + kernelString += string(" jj = lId >> ") + num2str((int)log2(mem_coalesce_width)) + string(";\n"); + kernelString += string(" lMemStore = sMem + mad24( jj, ") + num2str(N + numWorkItemsPerXForm) + string(", ii );\n"); + kernelString += string(" offset = mad24( groupId, ") + num2str(numXFormsPerWG) + string(", jj);\n"); + kernelString += string(" offset = mad24( offset, ") + num2str(N) + string(", ii );\n"); + if (dataFormat == clFFT_InterleavedComplexFormat) + { + kernelString += string(" in += offset;\n"); + kernelString += string(" out += offset;\n"); + } + else + { + kernelString += string(" in_real += offset;\n"); + kernelString += string(" in_imag += offset;\n"); + kernelString += string(" out_real += offset;\n"); + kernelString += string(" out_imag += offset;\n"); + } + + kernelString += string("if((groupId == get_num_groups(0)-1) && s) {\n"); + for (i = 0; i < numOuterIter; i++) + { + kernelString += string(" if( jj < s ) {\n"); + for (j = 0; j < numInnerIter; j++) + formattedLoad(kernelString, i * numInnerIter + j, j * mem_coalesce_width + i * (groupSize / mem_coalesce_width) * N, dataFormat); + kernelString += string(" }\n"); + if (i != numOuterIter - 1) + kernelString += string(" jj += ") + num2str(groupSize / mem_coalesce_width) + string(";\n"); + } + kernelString += string("}\n "); + kernelString += string("else {\n"); + for (i = 0; i < numOuterIter; i++) + { + for (j = 0; j < numInnerIter; j++) + formattedLoad(kernelString, i * numInnerIter + j, j * mem_coalesce_width + i * (groupSize / mem_coalesce_width) * N, dataFormat); + } + kernelString += string("}\n"); + + kernelString += string(" ii = lId & ") + num2str(numWorkItemsPerXForm - 1) + string(";\n"); + kernelString += string(" jj = lId >> ") + num2str(log2NumWorkItemsPerXForm) + string(";\n"); + kernelString += string(" lMemLoad = sMem + mad24( jj, ") + num2str(N + numWorkItemsPerXForm) + string(", ii);\n"); + + for (i = 0; i < numOuterIter; i++) + { + for (j = 0; j < numInnerIter; j++) + { + kernelString += string(" lMemStore[") + num2str(j * mem_coalesce_width + i * (groupSize / mem_coalesce_width) * (N + numWorkItemsPerXForm)) + string("] = a[") + + num2str(i * numInnerIter + j) + string("].x;\n"); + } + } + kernelString += string(" barrier( CLK_LOCAL_MEM_FENCE );\n"); + + for (i = 0; i < R0; i++) + kernelString += string(" a[") + num2str(i) + string("].x = lMemLoad[") + num2str(i * numWorkItemsPerXForm) + string("];\n"); + kernelString += string(" barrier( CLK_LOCAL_MEM_FENCE );\n"); + + for (i = 0; i < numOuterIter; i++) + { + for (j = 0; j < numInnerIter; j++) + { + kernelString += string(" lMemStore[") + num2str(j * mem_coalesce_width + i * (groupSize / mem_coalesce_width) * (N + numWorkItemsPerXForm)) + string("] = a[") + + num2str(i * numInnerIter + j) + string("].y;\n"); + } + } + kernelString += string(" barrier( CLK_LOCAL_MEM_FENCE );\n"); + + for (i = 0; i < R0; i++) + kernelString += string(" a[") + num2str(i) + string("].y = lMemLoad[") + num2str(i * numWorkItemsPerXForm) + string("];\n"); + kernelString += string(" barrier( CLK_LOCAL_MEM_FENCE );\n"); + + lMemSize = (N + numWorkItemsPerXForm) * numXFormsPerWG; + } + else + { + kernelString += string(" offset = mad24( groupId, ") + num2str(N * numXFormsPerWG) + string(", lId );\n"); + if (dataFormat == clFFT_InterleavedComplexFormat) + { + kernelString += string(" in += offset;\n"); + kernelString += string(" out += offset;\n"); + } + else + { + kernelString += string(" in_real += offset;\n"); + kernelString += string(" in_imag += offset;\n"); + kernelString += string(" out_real += offset;\n"); + kernelString += string(" out_imag += offset;\n"); + } + + kernelString += string(" ii = lId & ") + num2str(N - 1) + string(";\n"); + kernelString += string(" jj = lId >> ") + num2str((int)log2(N)) + string(";\n"); + kernelString += string(" lMemStore = sMem + mad24( jj, ") + num2str(N + numWorkItemsPerXForm) + string(", ii );\n"); + + kernelString += string("if((groupId == get_num_groups(0)-1) && s) {\n"); + for (i = 0; i < R0; i++) + { + kernelString += string(" if(jj < s )\n"); + formattedLoad(kernelString, i, i * groupSize, dataFormat); + if (i != R0 - 1) + kernelString += string(" jj += ") + num2str(groupSize / N) + string(";\n"); + } + kernelString += string("}\n"); + kernelString += string("else {\n"); + for (i = 0; i < R0; i++) + { + formattedLoad(kernelString, i, i * groupSize, dataFormat); + } + kernelString += string("}\n"); + + if (numWorkItemsPerXForm > 1) + { + kernelString += string(" ii = lId & ") + num2str(numWorkItemsPerXForm - 1) + string(";\n"); + kernelString += string(" jj = lId >> ") + num2str(log2NumWorkItemsPerXForm) + string(";\n"); + kernelString += string(" lMemLoad = sMem + mad24( jj, ") + num2str(N + numWorkItemsPerXForm) + string(", ii );\n"); + } + else + { + kernelString += string(" ii = 0;\n"); + kernelString += string(" jj = lId;\n"); + kernelString += string(" lMemLoad = sMem + mul24( jj, ") + num2str(N + numWorkItemsPerXForm) + string(");\n"); + } + + + for (i = 0; i < R0; i++) + kernelString += string(" lMemStore[") + num2str(i * (groupSize / N) * (N + numWorkItemsPerXForm)) + string("] = a[") + num2str(i) + string("].x;\n"); + kernelString += string(" barrier( CLK_LOCAL_MEM_FENCE );\n"); + + for (i = 0; i < R0; i++) + kernelString += string(" a[") + num2str(i) + string("].x = lMemLoad[") + num2str(i * numWorkItemsPerXForm) + string("];\n"); + kernelString += string(" barrier( CLK_LOCAL_MEM_FENCE );\n"); + + for (i = 0; i < R0; i++) + kernelString += string(" lMemStore[") + num2str(i * (groupSize / N) * (N + numWorkItemsPerXForm)) + string("] = a[") + num2str(i) + string("].y;\n"); + kernelString += string(" barrier( CLK_LOCAL_MEM_FENCE );\n"); + + for (i = 0; i < R0; i++) + kernelString += string(" a[") + num2str(i) + string("].y = lMemLoad[") + num2str(i * numWorkItemsPerXForm) + string("];\n"); + kernelString += string(" barrier( CLK_LOCAL_MEM_FENCE );\n"); + + lMemSize = (N + numWorkItemsPerXForm) * numXFormsPerWG; + } + + return lMemSize; +} + +static int +insertGlobalStoresAndTranspose(string &kernelString, int N, int maxRadix, int Nr, int numWorkItemsPerXForm, int numXFormsPerWG, int mem_coalesce_width, clFFT_DataFormat dataFormat) +{ + int groupSize = numWorkItemsPerXForm * numXFormsPerWG; + int i, j, k, ind; + int lMemSize = 0; + int numIter = maxRadix / Nr; + string indent = string(""); + + if (numWorkItemsPerXForm >= mem_coalesce_width) + { + if (numXFormsPerWG > 1) + { + kernelString += string(" if( !s || (groupId < get_num_groups(0)-1) || (jj < s) ) {\n"); + indent = string(" "); + } + for (i = 0; i < maxRadix; i++) + { + j = i % numIter; + k = i / numIter; + ind = j * Nr + k; + formattedStore(kernelString, ind, i * numWorkItemsPerXForm, dataFormat); + } + if (numXFormsPerWG > 1) + kernelString += string(" }\n"); + } + else if (N >= mem_coalesce_width) + { + int numInnerIter = N / mem_coalesce_width; + int numOuterIter = numXFormsPerWG / (groupSize / mem_coalesce_width); + + kernelString += string(" lMemLoad = sMem + mad24( jj, ") + num2str(N + numWorkItemsPerXForm) + string(", ii );\n"); + kernelString += string(" ii = lId & ") + num2str(mem_coalesce_width - 1) + string(";\n"); + kernelString += string(" jj = lId >> ") + num2str((int)log2(mem_coalesce_width)) + string(";\n"); + kernelString += string(" lMemStore = sMem + mad24( jj,") + num2str(N + numWorkItemsPerXForm) + string(", ii );\n"); + + for (i = 0; i < maxRadix; i++) + { + j = i % numIter; + k = i / numIter; + ind = j * Nr + k; + kernelString += string(" lMemLoad[") + num2str(i * numWorkItemsPerXForm) + string("] = a[") + num2str(ind) + string("].x;\n"); + } + kernelString += string(" barrier( CLK_LOCAL_MEM_FENCE );\n"); + + for (i = 0; i < numOuterIter; i++) + for (j = 0; j < numInnerIter; j++) + kernelString += string(" a[") + num2str(i * numInnerIter + j) + string("].x = lMemStore[") + num2str(j * mem_coalesce_width + i * (groupSize / mem_coalesce_width) * (N + numWorkItemsPerXForm)) + string("];\n"); + kernelString += string(" barrier( CLK_LOCAL_MEM_FENCE );\n"); + + for (i = 0; i < maxRadix; i++) + { + j = i % numIter; + k = i / numIter; + ind = j * Nr + k; + kernelString += string(" lMemLoad[") + num2str(i * numWorkItemsPerXForm) + string("] = a[") + num2str(ind) + string("].y;\n"); + } + kernelString += string(" barrier( CLK_LOCAL_MEM_FENCE );\n"); + + for (i = 0; i < numOuterIter; i++) + for (j = 0; j < numInnerIter; j++) + kernelString += string(" a[") + num2str(i * numInnerIter + j) + string("].y = lMemStore[") + num2str(j * mem_coalesce_width + i * (groupSize / mem_coalesce_width) * (N + numWorkItemsPerXForm)) + string("];\n"); + kernelString += string(" barrier( CLK_LOCAL_MEM_FENCE );\n"); + + kernelString += string("if((groupId == get_num_groups(0)-1) && s) {\n"); + for (i = 0; i < numOuterIter; i++) + { + kernelString += string(" if( jj < s ) {\n"); + for (j = 0; j < numInnerIter; j++) + formattedStore(kernelString, i * numInnerIter + j, j * mem_coalesce_width + i * (groupSize / mem_coalesce_width) * N, dataFormat); + kernelString += string(" }\n"); + if (i != numOuterIter - 1) + kernelString += string(" jj += ") + num2str(groupSize / mem_coalesce_width) + string(";\n"); + } + kernelString += string("}\n"); + kernelString += string("else {\n"); + for (i = 0; i < numOuterIter; i++) + { + for (j = 0; j < numInnerIter; j++) + formattedStore(kernelString, i * numInnerIter + j, j * mem_coalesce_width + i * (groupSize / mem_coalesce_width) * N, dataFormat); + } + kernelString += string("}\n"); + + lMemSize = (N + numWorkItemsPerXForm) * numXFormsPerWG; + } + else + { + kernelString += string(" lMemLoad = sMem + mad24( jj,") + num2str(N + numWorkItemsPerXForm) + string(", ii );\n"); + + kernelString += string(" ii = lId & ") + num2str(N - 1) + string(";\n"); + kernelString += string(" jj = lId >> ") + num2str((int)log2(N)) + string(";\n"); + kernelString += string(" lMemStore = sMem + mad24( jj,") + num2str(N + numWorkItemsPerXForm) + string(", ii );\n"); + + for (i = 0; i < maxRadix; i++) + { + j = i % numIter; + k = i / numIter; + ind = j * Nr + k; + kernelString += string(" lMemLoad[") + num2str(i * numWorkItemsPerXForm) + string("] = a[") + num2str(ind) + string("].x;\n"); + } + kernelString += string(" barrier( CLK_LOCAL_MEM_FENCE );\n"); + + for (i = 0; i < maxRadix; i++) + kernelString += string(" a[") + num2str(i) + string("].x = lMemStore[") + num2str(i * (groupSize / N) * (N + numWorkItemsPerXForm)) + string("];\n"); + kernelString += string(" barrier( CLK_LOCAL_MEM_FENCE );\n"); + + for (i = 0; i < maxRadix; i++) + { + j = i % numIter; + k = i / numIter; + ind = j * Nr + k; + kernelString += string(" lMemLoad[") + num2str(i * numWorkItemsPerXForm) + string("] = a[") + num2str(ind) + string("].y;\n"); + } + kernelString += string(" barrier( CLK_LOCAL_MEM_FENCE );\n"); + + for (i = 0; i < maxRadix; i++) + kernelString += string(" a[") + num2str(i) + string("].y = lMemStore[") + num2str(i * (groupSize / N) * (N + numWorkItemsPerXForm)) + string("];\n"); + kernelString += string(" barrier( CLK_LOCAL_MEM_FENCE );\n"); + + kernelString += string("if((groupId == get_num_groups(0)-1) && s) {\n"); + for (i = 0; i < maxRadix; i++) + { + kernelString += string(" if(jj < s ) {\n"); + formattedStore(kernelString, i, i * groupSize, dataFormat); + kernelString += string(" }\n"); + if (i != maxRadix - 1) + kernelString += string(" jj +=") + num2str(groupSize / N) + string(";\n"); + } + kernelString += string("}\n"); + kernelString += string("else {\n"); + for (i = 0; i < maxRadix; i++) + { + formattedStore(kernelString, i, i * groupSize, dataFormat); + } + kernelString += string("}\n"); + + lMemSize = (N + numWorkItemsPerXForm) * numXFormsPerWG; + } + + return lMemSize; +} + +static void +insertfftKernel(string &kernelString, int Nr, int numIter) +{ + int i; + for (i = 0; i < numIter; i++) + { + kernelString += string(" fftKernel") + num2str(Nr) + string("(a+") + num2str(i * Nr) + string(", dir);\n"); + } +} + +static void +insertTwiddleKernel(string &kernelString, int Nr, int numIter, int Nprev, int len, int numWorkItemsPerXForm) +{ + int z, k; + int logNPrev = (int)log2(Nprev); + + for (z = 0; z < numIter; z++) + { + if (z == 0) + { + if (Nprev > 1) + kernelString += string(" angf = (float) (ii >> ") + num2str(logNPrev) + string(");\n"); + else + kernelString += string(" angf = (float) ii;\n"); + } + else + { + if (Nprev > 1) + kernelString += string(" angf = (float) ((") + num2str(z * numWorkItemsPerXForm) + string(" + ii) >>") + num2str(logNPrev) + string(");\n"); + else + kernelString += string(" angf = (float) (") + num2str(z * numWorkItemsPerXForm) + string(" + ii);\n"); + } + + for (k = 1; k < Nr; k++) + { + int ind = z * Nr + k; + //float fac = (float) (2.0 * M_PI * (double) k / (double) len); + kernelString += string(" ang = dir * ( 2.0f * M_PI * ") + num2str(k) + string(".0f / ") + num2str(len) + string(".0f )") + string(" * angf;\n"); + kernelString += string(" w = (float2)(native_cos(ang), native_sin(ang));\n"); + kernelString += string(" a[") + num2str(ind) + string("] = complexMul(a[") + num2str(ind) + string("], w);\n"); + } + } +} + +static int +getPadding(int numWorkItemsPerXForm, int Nprev, int numWorkItemsReq, int numXFormsPerWG, int Nr, int numBanks, int *offset, int *midPad) +{ + if ((numWorkItemsPerXForm <= Nprev) || (Nprev >= numBanks)) + *offset = 0; + else + { + int numRowsReq = ((numWorkItemsPerXForm < numBanks) ? numWorkItemsPerXForm : numBanks) / Nprev; + int numColsReq = 1; + if (numRowsReq > Nr) + numColsReq = numRowsReq / Nr; + numColsReq = Nprev * numColsReq; + *offset = numColsReq; + } + + if (numWorkItemsPerXForm >= numBanks || numXFormsPerWG == 1) + *midPad = 0; + else + { + int bankNum = ((numWorkItemsReq + *offset) * Nr) & (numBanks - 1); + if (bankNum >= numWorkItemsPerXForm) + *midPad = 0; + else + *midPad = numWorkItemsPerXForm - bankNum; + } + + int lMemSize = (numWorkItemsReq + *offset) * Nr * numXFormsPerWG + *midPad * (numXFormsPerWG - 1); + return lMemSize; +} + + +static void +insertLocalStores(string &kernelString, int numIter, int Nr, int numWorkItemsPerXForm, int numWorkItemsReq, int offset, string &comp) +{ + int z, k; + + for (z = 0; z < numIter; z++) + { + for (k = 0; k < Nr; k++) + { + int index = k * (numWorkItemsReq + offset) + z * numWorkItemsPerXForm; + kernelString += string(" lMemStore[") + num2str(index) + string("] = a[") + num2str(z * Nr + k) + string("].") + comp + string(";\n"); + } + } + kernelString += string(" barrier(CLK_LOCAL_MEM_FENCE);\n"); +} + +static void +insertLocalLoads(string &kernelString, int n, int Nr, int Nrn, int Nprev, int Ncurr, int numWorkItemsPerXForm, int numWorkItemsReq, int offset, string &comp) +{ + int numWorkItemsReqN = n / Nrn; + int interBlockHNum = max(Nprev / numWorkItemsPerXForm, 1); + int interBlockHStride = numWorkItemsPerXForm; + int vertWidth = max(numWorkItemsPerXForm / Nprev, 1); + vertWidth = min(vertWidth, Nr); + int vertNum = Nr / vertWidth; + int vertStride = (n / Nr + offset) * vertWidth; + int iter = max(numWorkItemsReqN / numWorkItemsPerXForm, 1); + int intraBlockHStride = (numWorkItemsPerXForm / (Nprev * Nr)) > 1 ? (numWorkItemsPerXForm / (Nprev * Nr)) : 1; + intraBlockHStride *= Nprev; + + int stride = numWorkItemsReq / Nrn; + int i; + for (i = 0; i < iter; i++) + { + int ii = i / (interBlockHNum * vertNum); + int zz = i % (interBlockHNum * vertNum); + int jj = zz % interBlockHNum; + int kk = zz / interBlockHNum; + int z; + for (z = 0; z < Nrn; z++) + { + int st = kk * vertStride + jj * interBlockHStride + ii * intraBlockHStride + z * stride; + kernelString += string(" a[") + num2str(i * Nrn + z) + string("].") + comp + string(" = lMemLoad[") + num2str(st) + string("];\n"); + } + } + kernelString += string(" barrier(CLK_LOCAL_MEM_FENCE);\n"); +} + +static void +insertLocalLoadIndexArithmatic(string &kernelString, int Nprev, int Nr, int numWorkItemsReq, int numWorkItemsPerXForm, int numXFormsPerWG, int offset, int midPad) +{ + int Ncurr = Nprev * Nr; + int logNcurr = (int)log2(Ncurr); + int logNprev = (int)log2(Nprev); + int incr = (numWorkItemsReq + offset) * Nr + midPad; + + if (Ncurr < numWorkItemsPerXForm) + { + if (Nprev == 1) + kernelString += string(" j = ii & ") + num2str(Ncurr - 1) + string(";\n"); + else + kernelString += string(" j = (ii & ") + num2str(Ncurr - 1) + string(") >> ") + num2str(logNprev) + string(";\n"); + + if (Nprev == 1) + kernelString += string(" i = ii >> ") + num2str(logNcurr) + string(";\n"); + else + kernelString += string(" i = mad24(ii >> ") + num2str(logNcurr) + string(", ") + num2str(Nprev) + string(", ii & ") + num2str(Nprev - 1) + string(");\n"); + } + else + { + if (Nprev == 1) + kernelString += string(" j = ii;\n"); + else + kernelString += string(" j = ii >> ") + num2str(logNprev) + string(";\n"); + if (Nprev == 1) + kernelString += string(" i = 0;\n"); + else + kernelString += string(" i = ii & ") + num2str(Nprev - 1) + string(";\n"); + } + + if (numXFormsPerWG > 1) + kernelString += string(" i = mad24(jj, ") + num2str(incr) + string(", i);\n"); + + kernelString += string(" lMemLoad = sMem + mad24(j, ") + num2str(numWorkItemsReq + offset) + string(", i);\n"); +} + +static void +insertLocalStoreIndexArithmatic(string &kernelString, int numWorkItemsReq, int numXFormsPerWG, int Nr, int offset, int midPad) +{ + if (numXFormsPerWG == 1) + { + kernelString += string(" lMemStore = sMem + ii;\n"); + } + else + { + kernelString += string(" lMemStore = sMem + mad24(jj, ") + num2str((numWorkItemsReq + offset) * Nr + midPad) + string(", ii);\n"); + } +} + + +static void +createLocalMemfftKernelString(cl_fft_plan *plan) +{ + unsigned int radixArray[10]; + unsigned int numRadix; + + unsigned int n = plan->n.x; + + assert(n <= plan->max_work_item_per_workgroup * plan->max_radix && "signal lenght too big for local mem fft\n"); + + getRadixArray(n, radixArray, &numRadix, 0); + assert(numRadix > 0 && "no radix array supplied\n"); + + if (n / radixArray[0] > plan->max_work_item_per_workgroup) + getRadixArray(n, radixArray, &numRadix, plan->max_radix); + + assert(radixArray[0] <= plan->max_radix && "max radix choosen is greater than allowed\n"); + assert(n / radixArray[0] <= plan->max_work_item_per_workgroup && "required work items per xform greater than maximum work items allowed per work group for local mem fft\n"); + + unsigned int tmpLen = 1; + unsigned int i; + for (i = 0; i < numRadix; i++) + { + assert(radixArray[i] && !((radixArray[i] - 1) & radixArray[i])); + tmpLen *= radixArray[i]; + } + assert(tmpLen == n && "product of radices choosen doesnt match the length of signal\n"); + + int offset, midPad; + string localString(""), kernelName(""); + + clFFT_DataFormat dataFormat = plan->format; + string *kernelString = plan->kernel_string; + + + cl_fft_kernel_info **kInfo = &plan->kernel_info; + int kCount = 0; + + while (*kInfo) + { + kInfo = &(*kInfo)->next; + kCount++; + } + + kernelName = string("fft") + num2str(kCount); + + *kInfo = (cl_fft_kernel_info *)malloc(sizeof(cl_fft_kernel_info)); + (*kInfo)->kernel = 0; + (*kInfo)->lmem_size = 0; + (*kInfo)->num_workgroups = 0; + (*kInfo)->num_workitems_per_workgroup = 0; + (*kInfo)->dir = cl_fft_kernel_x; + (*kInfo)->in_place_possible = 1; + (*kInfo)->next = NULL; + (*kInfo)->kernel_name = (char *)malloc(sizeof(char) * (kernelName.size() + 1)); + strcpy((*kInfo)->kernel_name, kernelName.c_str()); + + unsigned int numWorkItemsPerXForm = n / radixArray[0]; + unsigned int numWorkItemsPerWG = numWorkItemsPerXForm <= 64 ? 64 : numWorkItemsPerXForm; + assert(numWorkItemsPerWG <= plan->max_work_item_per_workgroup); + int numXFormsPerWG = numWorkItemsPerWG / numWorkItemsPerXForm; + (*kInfo)->num_workgroups = 1; + (*kInfo)->num_xforms_per_workgroup = numXFormsPerWG; + (*kInfo)->num_workitems_per_workgroup = numWorkItemsPerWG; + + unsigned int *N = radixArray; + unsigned int maxRadix = N[0]; + unsigned int lMemSize = 0; + + insertVariables(localString, maxRadix); + + lMemSize = insertGlobalLoadsAndTranspose(localString, n, numWorkItemsPerXForm, numXFormsPerWG, maxRadix, plan->min_mem_coalesce_width, dataFormat); + (*kInfo)->lmem_size = (lMemSize > (*kInfo)->lmem_size) ? lMemSize : (*kInfo)->lmem_size; + + string xcomp = string("x"); + string ycomp = string("y"); + + unsigned int Nprev = 1; + unsigned int len = n; + unsigned int r; + for (r = 0; r < numRadix; r++) + { + int numIter = N[0] / N[r]; + int numWorkItemsReq = n / N[r]; + int Ncurr = Nprev * N[r]; + insertfftKernel(localString, N[r], numIter); + + if (r < (numRadix - 1)) + { + insertTwiddleKernel(localString, N[r], numIter, Nprev, len, numWorkItemsPerXForm); + lMemSize = getPadding(numWorkItemsPerXForm, Nprev, numWorkItemsReq, numXFormsPerWG, N[r], plan->num_local_mem_banks, &offset, &midPad); + (*kInfo)->lmem_size = (lMemSize > (*kInfo)->lmem_size) ? lMemSize : (*kInfo)->lmem_size; + insertLocalStoreIndexArithmatic(localString, numWorkItemsReq, numXFormsPerWG, N[r], offset, midPad); + insertLocalLoadIndexArithmatic(localString, Nprev, N[r], numWorkItemsReq, numWorkItemsPerXForm, numXFormsPerWG, offset, midPad); + insertLocalStores(localString, numIter, N[r], numWorkItemsPerXForm, numWorkItemsReq, offset, xcomp); + insertLocalLoads(localString, n, N[r], N[r + 1], Nprev, Ncurr, numWorkItemsPerXForm, numWorkItemsReq, offset, xcomp); + insertLocalStores(localString, numIter, N[r], numWorkItemsPerXForm, numWorkItemsReq, offset, ycomp); + insertLocalLoads(localString, n, N[r], N[r + 1], Nprev, Ncurr, numWorkItemsPerXForm, numWorkItemsReq, offset, ycomp); + Nprev = Ncurr; + len = len / N[r]; + } + } + + lMemSize = insertGlobalStoresAndTranspose(localString, n, maxRadix, N[numRadix - 1], numWorkItemsPerXForm, numXFormsPerWG, plan->min_mem_coalesce_width, dataFormat); + (*kInfo)->lmem_size = (lMemSize > (*kInfo)->lmem_size) ? lMemSize : (*kInfo)->lmem_size; + + insertHeader(*kernelString, kernelName, dataFormat); + *kernelString += string("{\n"); + if ((*kInfo)->lmem_size) + *kernelString += string(" __local float sMem[") + num2str((*kInfo)->lmem_size) + string("];\n"); + *kernelString += localString; + *kernelString += string("}\n"); +} + +// For n larger than what can be computed using local memory fft, global transposes +// multiple kernel launces is needed. For these sizes, n can be decomposed using +// much larger base radices i.e. say n = 262144 = 128 x 64 x 32. Thus three kernel +// launches will be needed, first computing 64 x 32, length 128 ffts, second computing +// 128 x 32 length 64 ffts, and finally a kernel computing 128 x 64 length 32 ffts. +// Each of these base radices can futher be divided into factors so that each of these +// base ffts can be computed within one kernel launch using in-register ffts and local +// memory transposes i.e for the first kernel above which computes 64 x 32 ffts on length +// 128, 128 can be decomposed into 128 = 16 x 8 i.e. 8 work items can compute 8 length +// 16 ffts followed by transpose using local memory followed by each of these eight +// work items computing 2 length 8 ffts thus computing 16 length 8 ffts in total. This +// means only 8 work items are needed for computing one length 128 fft. If we choose +// work group size of say 64, we can compute 64/8 = 8 length 128 ffts within one +// work group. Since we need to compute 64 x 32 length 128 ffts in first kernel, this +// means we need to launch 64 x 32 / 8 = 256 work groups with 64 work items in each +// work group where each work group is computing 8 length 128 ffts where each length +// 128 fft is computed by 8 work items. Same logic can be applied to other two kernels +// in this example. Users can play with difference base radices and difference +// decompositions of base radices to generates different kernels and see which gives +// best performance. Following function is just fixed to use 128 as base radix + +void getGlobalRadixInfo(int n, int *radix, int *R1, int *R2, int *numRadices) +{ + int baseRadix = min(n, 128); + + int numR = 0; + int N = n; + while (N > baseRadix) + { + N /= baseRadix; + numR++; + } + + for (int i = 0; i < numR; i++) + radix[i] = baseRadix; + + radix[numR] = N; + numR++; + *numRadices = numR; + + for (int i = 0; i < numR; i++) + { + int B = radix[i]; + if (B <= 8) + { + R1[i] = B; + R2[i] = 1; + continue; + } + + int r1 = 2; + int r2 = B / r1; + while (r2 > r1) + { + r1 *= 2; + r2 = B / r1; + } + R1[i] = r1; + R2[i] = r2; + } +} + +static void +createGlobalFFTKernelString(cl_fft_plan *plan, int n, int BS, cl_fft_kernel_dir dir, int vertBS) +{ + int i, j, k, t; + int radixArr[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; + int R1Arr[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; + int R2Arr[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; + int radix, R1, R2; + int numRadices; + + int maxThreadsPerBlock = plan->max_work_item_per_workgroup; + int maxArrayLen = plan->max_radix; + int batchSize = plan->min_mem_coalesce_width; + clFFT_DataFormat dataFormat = plan->format; + int vertical = (dir == cl_fft_kernel_x) ? 0 : 1; + + getGlobalRadixInfo(n, radixArr, R1Arr, R2Arr, &numRadices); + + int numPasses = numRadices; + + string localString(""), kernelName(""); + string *kernelString = plan->kernel_string; + cl_fft_kernel_info **kInfo = &plan->kernel_info; + int kCount = 0; + + while (*kInfo) + { + kInfo = &(*kInfo)->next; + kCount++; + } + + int N = n; + int m = (int)log2(n); + int Rinit = vertical ? BS : 1; + batchSize = vertical ? min(BS, batchSize) : batchSize; + int passNum; + + for (passNum = 0; passNum < numPasses; passNum++) + { + localString.clear(); + kernelName.clear(); + + radix = radixArr[passNum]; + R1 = R1Arr[passNum]; + R2 = R2Arr[passNum]; + + int strideI = Rinit; + for (i = 0; i < numPasses; i++) + if (i != passNum) + strideI *= radixArr[i]; + + int strideO = Rinit; + for (i = 0; i < passNum; i++) + strideO *= radixArr[i]; + + int threadsPerXForm = R2; + batchSize = R2 == 1 ? plan->max_work_item_per_workgroup : batchSize; + batchSize = min(batchSize, strideI); + int threadsPerBlock = batchSize * threadsPerXForm; + threadsPerBlock = min(threadsPerBlock, maxThreadsPerBlock); + batchSize = threadsPerBlock / threadsPerXForm; + assert(R2 <= R1); + assert(R1 * R2 == radix); + assert(R1 <= maxArrayLen); + assert(threadsPerBlock <= maxThreadsPerBlock); + + int numIter = R1 / R2; + int gInInc = threadsPerBlock / batchSize; + + + int lgStrideO = (int)log2(strideO); + int numBlocksPerXForm = strideI / batchSize; + int numBlocks = numBlocksPerXForm; + if (!vertical) + numBlocks *= BS; + else + numBlocks *= vertBS; + + kernelName = string("fft") + num2str(kCount); + *kInfo = (cl_fft_kernel_info *)malloc(sizeof(cl_fft_kernel_info)); + (*kInfo)->kernel = 0; + if (R2 == 1) + (*kInfo)->lmem_size = 0; + else + { + if (strideO == 1) + (*kInfo)->lmem_size = (radix + 1) * batchSize; + else + (*kInfo)->lmem_size = threadsPerBlock * R1; + } + (*kInfo)->num_workgroups = numBlocks; + (*kInfo)->num_xforms_per_workgroup = 1; + (*kInfo)->num_workitems_per_workgroup = threadsPerBlock; + (*kInfo)->dir = dir; + if ((passNum == (numPasses - 1)) && (numPasses & 1)) + (*kInfo)->in_place_possible = 1; + else + (*kInfo)->in_place_possible = 0; + (*kInfo)->next = NULL; + (*kInfo)->kernel_name = (char *)malloc(sizeof(char) * (kernelName.size() + 1)); + strcpy((*kInfo)->kernel_name, kernelName.c_str()); + + insertVariables(localString, R1); + + if (vertical) + { + localString += string("xNum = groupId >> ") + num2str((int)log2(numBlocksPerXForm)) + string(";\n"); + localString += string("groupId = groupId & ") + num2str(numBlocksPerXForm - 1) + string(";\n"); + localString += string("indexIn = mad24(groupId, ") + num2str(batchSize) + string(", xNum << ") + num2str((int)log2(n * BS)) + string(");\n"); + localString += string("tid = mul24(groupId, ") + num2str(batchSize) + string(");\n"); + localString += string("i = tid >> ") + num2str(lgStrideO) + string(";\n"); + localString += string("j = tid & ") + num2str(strideO - 1) + string(";\n"); + int stride = radix * Rinit; + for (i = 0; i < passNum; i++) + stride *= radixArr[i]; + localString += string("indexOut = mad24(i, ") + num2str(stride) + string(", j + ") + string("(xNum << ") + num2str((int)log2(n * BS)) + string("));\n"); + localString += string("bNum = groupId;\n"); + } + else + { + int lgNumBlocksPerXForm = (int)log2(numBlocksPerXForm); + localString += string("bNum = groupId & ") + num2str(numBlocksPerXForm - 1) + string(";\n"); + localString += string("xNum = groupId >> ") + num2str(lgNumBlocksPerXForm) + string(";\n"); + localString += string("indexIn = mul24(bNum, ") + num2str(batchSize) + string(");\n"); + localString += string("tid = indexIn;\n"); + localString += string("i = tid >> ") + num2str(lgStrideO) + string(";\n"); + localString += string("j = tid & ") + num2str(strideO - 1) + string(";\n"); + int stride = radix * Rinit; + for (i = 0; i < passNum; i++) + stride *= radixArr[i]; + localString += string("indexOut = mad24(i, ") + num2str(stride) + string(", j);\n"); + localString += string("indexIn += (xNum << ") + num2str(m) + string(");\n"); + localString += string("indexOut += (xNum << ") + num2str(m) + string(");\n"); + } + + // Load Data + int lgBatchSize = (int)log2(batchSize); + localString += string("tid = lId;\n"); + localString += string("i = tid & ") + num2str(batchSize - 1) + string(";\n"); + localString += string("j = tid >> ") + num2str(lgBatchSize) + string(";\n"); + localString += string("indexIn += mad24(j, ") + num2str(strideI) + string(", i);\n"); + + if (dataFormat == clFFT_SplitComplexFormat) + { + localString += string("in_real += indexIn;\n"); + localString += string("in_imag += indexIn;\n"); + for (j = 0; j < R1; j++) + localString += string("a[") + num2str(j) + string("].x = in_real[") + num2str(j * gInInc * strideI) + string("];\n"); + for (j = 0; j < R1; j++) + localString += string("a[") + num2str(j) + string("].y = in_imag[") + num2str(j * gInInc * strideI) + string("];\n"); + } + else + { + localString += string("in += indexIn;\n"); + for (j = 0; j < R1; j++) + localString += string("a[") + num2str(j) + string("] = in[") + num2str(j * gInInc * strideI) + string("];\n"); + } + + localString += string("fftKernel") + num2str(R1) + string("(a, dir);\n"); + + if (R2 > 1) + { + // twiddle + for (k = 1; k < R1; k++) + { + localString += string("ang = dir*(2.0f*M_PI*") + num2str(k) + string("/") + num2str(radix) + string(")*j;\n"); + localString += string("w = (float2)(native_cos(ang), native_sin(ang));\n"); + localString += string("a[") + num2str(k) + string("] = complexMul(a[") + num2str(k) + string("], w);\n"); + } + + // shuffle + numIter = R1 / R2; + localString += string("indexIn = mad24(j, ") + num2str(threadsPerBlock * numIter) + string(", i);\n"); + localString += string("lMemStore = sMem + tid;\n"); + localString += string("lMemLoad = sMem + indexIn;\n"); + for (k = 0; k < R1; k++) + localString += string("lMemStore[") + num2str(k * threadsPerBlock) + string("] = a[") + num2str(k) + string("].x;\n"); + localString += string("barrier(CLK_LOCAL_MEM_FENCE);\n"); + for (k = 0; k < numIter; k++) + for (t = 0; t < R2; t++) + localString += string("a[") + num2str(k * R2 + t) + string("].x = lMemLoad[") + num2str(t * batchSize + k * threadsPerBlock) + string("];\n"); + localString += string("barrier(CLK_LOCAL_MEM_FENCE);\n"); + for (k = 0; k < R1; k++) + localString += string("lMemStore[") + num2str(k * threadsPerBlock) + string("] = a[") + num2str(k) + string("].y;\n"); + localString += string("barrier(CLK_LOCAL_MEM_FENCE);\n"); + for (k = 0; k < numIter; k++) + for (t = 0; t < R2; t++) + localString += string("a[") + num2str(k * R2 + t) + string("].y = lMemLoad[") + num2str(t * batchSize + k * threadsPerBlock) + string("];\n"); + localString += string("barrier(CLK_LOCAL_MEM_FENCE);\n"); + + for (j = 0; j < numIter; j++) + localString += string("fftKernel") + num2str(R2) + string("(a + ") + num2str(j * R2) + string(", dir);\n"); + } + + // twiddle + if (passNum < (numPasses - 1)) + { + localString += string("l = ((bNum << ") + num2str(lgBatchSize) + string(") + i) >> ") + num2str(lgStrideO) + string(";\n"); + localString += string("k = j << ") + num2str((int)log2(R1 / R2)) + string(";\n"); + localString += string("ang1 = dir*(2.0f*M_PI/") + num2str(N) + string(")*l;\n"); + for (t = 0; t < R1; t++) + { + localString += string("ang = ang1*(k + ") + num2str((t % R2) * R1 + (t / R2)) + string(");\n"); + localString += string("w = (float2)(native_cos(ang), native_sin(ang));\n"); + localString += string("a[") + num2str(t) + string("] = complexMul(a[") + num2str(t) + string("], w);\n"); + } + } + + // Store Data + if (strideO == 1) + { + localString += string("lMemStore = sMem + mad24(i, ") + num2str(radix + 1) + string(", j << ") + num2str((int)log2(R1 / R2)) + string(");\n"); + localString += string("lMemLoad = sMem + mad24(tid >> ") + num2str((int)log2(radix)) + string(", ") + num2str(radix + 1) + string(", tid & ") + num2str(radix - 1) + string(");\n"); + + for (i = 0; i < R1 / R2; i++) + for (j = 0; j < R2; j++) + localString += string("lMemStore[ ") + num2str(i + j * R1) + string("] = a[") + num2str(i * R2 + j) + string("].x;\n"); + localString += string("barrier(CLK_LOCAL_MEM_FENCE);\n"); + if (threadsPerBlock >= radix) + { + for (i = 0; i < R1; i++) + localString += string("a[") + num2str(i) + string("].x = lMemLoad[") + num2str(i * (radix + 1) * (threadsPerBlock / radix)) + string("];\n"); + } + else + { + int innerIter = radix / threadsPerBlock; + int outerIter = R1 / innerIter; + for (i = 0; i < outerIter; i++) + for (j = 0; j < innerIter; j++) + localString += string("a[") + num2str(i * innerIter + j) + string("].x = lMemLoad[") + num2str(j * threadsPerBlock + i * (radix + 1)) + string("];\n"); + } + localString += string("barrier(CLK_LOCAL_MEM_FENCE);\n"); + + for (i = 0; i < R1 / R2; i++) + for (j = 0; j < R2; j++) + localString += string("lMemStore[ ") + num2str(i + j * R1) + string("] = a[") + num2str(i * R2 + j) + string("].y;\n"); + localString += string("barrier(CLK_LOCAL_MEM_FENCE);\n"); + if (threadsPerBlock >= radix) + { + for (i = 0; i < R1; i++) + localString += string("a[") + num2str(i) + string("].y = lMemLoad[") + num2str(i * (radix + 1) * (threadsPerBlock / radix)) + string("];\n"); + } + else + { + int innerIter = radix / threadsPerBlock; + int outerIter = R1 / innerIter; + for (i = 0; i < outerIter; i++) + for (j = 0; j < innerIter; j++) + localString += string("a[") + num2str(i * innerIter + j) + string("].y = lMemLoad[") + num2str(j * threadsPerBlock + i * (radix + 1)) + string("];\n"); + } + localString += string("barrier(CLK_LOCAL_MEM_FENCE);\n"); + + localString += string("indexOut += tid;\n"); + if (dataFormat == clFFT_SplitComplexFormat) + { + localString += string("out_real += indexOut;\n"); + localString += string("out_imag += indexOut;\n"); + for (k = 0; k < R1; k++) + localString += string("out_real[") + num2str(k * threadsPerBlock) + string("] = a[") + num2str(k) + string("].x;\n"); + for (k = 0; k < R1; k++) + localString += string("out_imag[") + num2str(k * threadsPerBlock) + string("] = a[") + num2str(k) + string("].y;\n"); + } + else + { + localString += string("out += indexOut;\n"); + for (k = 0; k < R1; k++) + localString += string("out[") + num2str(k * threadsPerBlock) + string("] = a[") + num2str(k) + string("];\n"); + } + } + else + { + localString += string("indexOut += mad24(j, ") + num2str(numIter * strideO) + string(", i);\n"); + if (dataFormat == clFFT_SplitComplexFormat) + { + localString += string("out_real += indexOut;\n"); + localString += string("out_imag += indexOut;\n"); + for (k = 0; k < R1; k++) + localString += string("out_real[") + num2str(((k % R2) * R1 + (k / R2)) * strideO) + string("] = a[") + num2str(k) + string("].x;\n"); + for (k = 0; k < R1; k++) + localString += string("out_imag[") + num2str(((k % R2) * R1 + (k / R2)) * strideO) + string("] = a[") + num2str(k) + string("].y;\n"); + } + else + { + localString += string("out += indexOut;\n"); + for (k = 0; k < R1; k++) + localString += string("out[") + num2str(((k % R2) * R1 + (k / R2)) * strideO) + string("] = a[") + num2str(k) + string("];\n"); + } + } + + insertHeader(*kernelString, kernelName, dataFormat); + *kernelString += string("{\n"); + if ((*kInfo)->lmem_size) + *kernelString += string(" __local float sMem[") + num2str((*kInfo)->lmem_size) + string("];\n"); + *kernelString += localString; + *kernelString += string("}\n"); + + N /= radix; + kInfo = &(*kInfo)->next; + kCount++; + } +} + +void FFT1D(cl_fft_plan *plan, cl_fft_kernel_dir dir) +{ + unsigned int radixArray[10]; + unsigned int numRadix; + + switch (dir) + { + case cl_fft_kernel_x: + if (plan->n.x > plan->max_localmem_fft_size) + { + createGlobalFFTKernelString(plan, plan->n.x, 1, cl_fft_kernel_x, 1); + } + else if (plan->n.x > 1) + { + getRadixArray(plan->n.x, radixArray, &numRadix, 0); + if (plan->n.x / radixArray[0] <= plan->max_work_item_per_workgroup) + { + createLocalMemfftKernelString(plan); + } + else + { + getRadixArray(plan->n.x, radixArray, &numRadix, plan->max_radix); + if (plan->n.x / radixArray[0] <= plan->max_work_item_per_workgroup) + createLocalMemfftKernelString(plan); + else + createGlobalFFTKernelString(plan, plan->n.x, 1, cl_fft_kernel_x, 1); + } + } + break; + + case cl_fft_kernel_y: + if (plan->n.y > 1) + createGlobalFFTKernelString(plan, plan->n.y, plan->n.x, cl_fft_kernel_y, 1); + break; + + case cl_fft_kernel_z: + if (plan->n.z > 1) + createGlobalFFTKernelString(plan, plan->n.z, plan->n.x * plan->n.y, cl_fft_kernel_z, 1); + default: + return; + } +} diff --git a/src/algorithms/libs/opencl/fft_setup.cc b/src/algorithms/libs/opencl/fft_setup.cc new file mode 100644 index 000000000..1349d65f7 --- /dev/null +++ b/src/algorithms/libs/opencl/fft_setup.cc @@ -0,0 +1,402 @@ + +// +// File: fft_setup.cpp +// +// Version: <1.0> +// +// Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Inc. ("Apple") +// in consideration of your agreement to the following terms, and your use, +// installation, modification or redistribution of this Apple software +// constitutes acceptance of these terms. If you do not agree with these +// terms, please do not use, install, modify or redistribute this Apple +// software. +// +// In consideration of your agreement to abide by the following terms, and +// subject to these terms, Apple grants you a personal, non - exclusive +// license, under Apple's copyrights in this original Apple software ( the +// "Apple Software" ), to use, reproduce, modify and redistribute the Apple +// Software, with or without modifications, in source and / or binary forms; +// provided that if you redistribute the Apple Software in its entirety and +// without modifications, you must retain this notice and the following text +// and disclaimers in all such redistributions of the Apple Software. Neither +// the name, trademarks, service marks or logos of Apple Inc. may be used to +// endorse or promote products derived from the Apple Software without specific +// prior written permission from Apple. Except as expressly stated in this +// notice, no other rights or licenses, express or implied, are granted by +// Apple herein, including but not limited to any patent rights that may be +// infringed by your derivative works or by other works in which the Apple +// Software may be incorporated. +// +// The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO +// WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED +// WARRANTIES OF NON - INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A +// PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION +// ALONE OR IN COMBINATION WITH YOUR PRODUCTS. +// +// IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR +// CONSEQUENTIAL DAMAGES ( INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION ) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION +// AND / OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER +// UNDER THEORY OF CONTRACT, TORT ( INCLUDING NEGLIGENCE ), STRICT LIABILITY OR +// OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Copyright ( C ) 2008 Apple Inc. All Rights Reserved. +// +//////////////////////////////////////////////////////////////////////////////////////////////////// + + +#include "fft_internal.h" +#include "fft_base_kernels.h" +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace std; + +extern void getKernelWorkDimensions(cl_fft_plan *plan, cl_fft_kernel_info *kernelInfo, cl_int *batchSize, size_t *gWorkItems, size_t *lWorkItems); + +static void +getBlockConfigAndKernelString(cl_fft_plan *plan) +{ + plan->temp_buffer_needed = 0; + *plan->kernel_string += baseKernels; + + if (plan->format == clFFT_SplitComplexFormat) + *plan->kernel_string += twistKernelPlannar; + else + *plan->kernel_string += twistKernelInterleaved; + + switch (plan->dim) + { + case clFFT_1D: + FFT1D(plan, cl_fft_kernel_x); + break; + + case clFFT_2D: + FFT1D(plan, cl_fft_kernel_x); + FFT1D(plan, cl_fft_kernel_y); + break; + + case clFFT_3D: + FFT1D(plan, cl_fft_kernel_x); + FFT1D(plan, cl_fft_kernel_y); + FFT1D(plan, cl_fft_kernel_z); + break; + + default: + return; + } + + plan->temp_buffer_needed = 0; + cl_fft_kernel_info *kInfo = plan->kernel_info; + while (kInfo) + { + plan->temp_buffer_needed |= !kInfo->in_place_possible; + kInfo = kInfo->next; + } +} + + +static void +deleteKernelInfo(cl_fft_kernel_info *kInfo) +{ + if (kInfo) + { + if (kInfo->kernel_name) + free(kInfo->kernel_name); + if (kInfo->kernel) + clReleaseKernel(kInfo->kernel); + free(kInfo); + } +} + +static void +destroy_plan(cl_fft_plan *Plan) +{ + cl_fft_kernel_info *kernel_info = Plan->kernel_info; + + while (kernel_info) + { + cl_fft_kernel_info *tmp = kernel_info->next; + deleteKernelInfo(kernel_info); + kernel_info = tmp; + } + + Plan->kernel_info = NULL; + + if (Plan->kernel_string) + { + delete Plan->kernel_string; + Plan->kernel_string = NULL; + } + if (Plan->twist_kernel) + { + clReleaseKernel(Plan->twist_kernel); + Plan->twist_kernel = NULL; + } + if (Plan->program) + { + clReleaseProgram(Plan->program); + Plan->program = NULL; + } + if (Plan->tempmemobj) + { + clReleaseMemObject(Plan->tempmemobj); + Plan->tempmemobj = NULL; + } + if (Plan->tempmemobj_real) + { + clReleaseMemObject(Plan->tempmemobj_real); + Plan->tempmemobj_real = NULL; + } + if (Plan->tempmemobj_imag) + { + clReleaseMemObject(Plan->tempmemobj_imag); + Plan->tempmemobj_imag = NULL; + } +} + +static int +createKernelList(cl_fft_plan *plan) +{ + cl_program program = plan->program; + cl_fft_kernel_info *kernel_info = plan->kernel_info; + + cl_int err; + while (kernel_info) + { + kernel_info->kernel = clCreateKernel(program, kernel_info->kernel_name, &err); + if (!kernel_info->kernel || err != CL_SUCCESS) + return err; + kernel_info = kernel_info->next; + } + + if (plan->format == clFFT_SplitComplexFormat) + plan->twist_kernel = clCreateKernel(program, "clFFT_1DTwistSplit", &err); + else + plan->twist_kernel = clCreateKernel(program, "clFFT_1DTwistInterleaved", &err); + + if (!plan->twist_kernel || err) + return err; + + return CL_SUCCESS; +} + +int getMaxKernelWorkGroupSize(cl_fft_plan *plan, unsigned int *max_wg_size, unsigned int num_devices, cl_device_id *devices) +{ + int reg_needed = 0; + *max_wg_size = std::numeric_limits::max(); + int err; + unsigned wg_size; + + unsigned int i; + for (i = 0; i < num_devices; i++) + { + cl_fft_kernel_info *kInfo = plan->kernel_info; + while (kInfo) + { + err = clGetKernelWorkGroupInfo(kInfo->kernel, devices[i], CL_KERNEL_WORK_GROUP_SIZE, sizeof(size_t), &wg_size, NULL); + if (err != CL_SUCCESS) + return -1; + + if (wg_size < kInfo->num_workitems_per_workgroup) + reg_needed |= 1; + + if (*max_wg_size > wg_size) + *max_wg_size = wg_size; + + kInfo = kInfo->next; + } + } + + return reg_needed; +} + +#define ERR_MACRO(err) \ + { \ + if (err != CL_SUCCESS) \ + { \ + if (error_code) \ + *error_code = err; \ + clFFT_DestroyPlan((clFFT_Plan)plan); \ + return (clFFT_Plan)NULL; \ + } \ + } + +clFFT_Plan +clFFT_CreatePlan(cl_context context, clFFT_Dim3 n, clFFT_Dimension dim, clFFT_DataFormat dataFormat, cl_int *error_code) +{ + int i; + cl_int err; + int isPow2 = 1; + cl_fft_plan *plan = NULL; + ostringstream kString; + int num_devices; + int gpu_found = 0; + cl_device_id devices[16]; + size_t ret_size; + cl_device_type device_type; + + if (!context) + ERR_MACRO(CL_INVALID_VALUE); + + isPow2 |= n.x && !((n.x - 1) & n.x); + isPow2 |= n.y && !((n.y - 1) & n.y); + isPow2 |= n.z && !((n.z - 1) & n.z); + + if (!isPow2) + ERR_MACRO(CL_INVALID_VALUE); + + if ((dim == clFFT_1D && (n.y != 1 || n.z != 1)) || (dim == clFFT_2D && n.z != 1)) + ERR_MACRO(CL_INVALID_VALUE); + + plan = (cl_fft_plan *)malloc(sizeof(cl_fft_plan)); + if (!plan) + ERR_MACRO(CL_OUT_OF_RESOURCES); + + plan->context = context; + clRetainContext(context); + plan->n = n; + plan->dim = dim; + plan->format = dataFormat; + plan->kernel_info = 0; + plan->num_kernels = 0; + plan->twist_kernel = 0; + plan->program = 0; + plan->temp_buffer_needed = 0; + plan->last_batch_size = 0; + plan->tempmemobj = 0; + plan->tempmemobj_real = 0; + plan->tempmemobj_imag = 0; + plan->max_localmem_fft_size = 2048; + plan->max_work_item_per_workgroup = 256; + plan->max_radix = 16; + plan->min_mem_coalesce_width = 16; + plan->num_local_mem_banks = 16; + +patch_kernel_source: + + plan->kernel_string = new string(""); + if (!plan->kernel_string) + ERR_MACRO(CL_OUT_OF_RESOURCES); + + getBlockConfigAndKernelString(plan); + + const char *source_str = plan->kernel_string->c_str(); + plan->program = clCreateProgramWithSource(context, 1, (const char **)&source_str, NULL, &err); + ERR_MACRO(err); + + err = clGetContextInfo(context, CL_CONTEXT_DEVICES, sizeof(devices), devices, &ret_size); + ERR_MACRO(err); + + num_devices = (int)(ret_size / sizeof(cl_device_id)); + + for (i = 0; i < num_devices; i++) + { + err = clGetDeviceInfo(devices[i], CL_DEVICE_TYPE, sizeof(device_type), &device_type, NULL); + ERR_MACRO(err); + + if (device_type == CL_DEVICE_TYPE_GPU) + { + gpu_found = 1; + err = clBuildProgram(plan->program, 1, &devices[i], "-cl-mad-enable", NULL, NULL); + if (err != CL_SUCCESS) + { + char *build_log; + char devicename[200]; + size_t log_size; + + err = clGetProgramBuildInfo(plan->program, devices[i], CL_PROGRAM_BUILD_LOG, 0, NULL, &log_size); + ERR_MACRO(err); + + build_log = (char *)malloc(log_size + 1); + + err = clGetProgramBuildInfo(plan->program, devices[i], CL_PROGRAM_BUILD_LOG, log_size, build_log, NULL); + ERR_MACRO(err); + + err = clGetDeviceInfo(devices[i], CL_DEVICE_NAME, sizeof(devicename), devicename, NULL); + ERR_MACRO(err); + + fprintf(stdout, "FFT program build log on device %s\n", devicename); + fprintf(stdout, "%s\n", build_log); + free(build_log); + + ERR_MACRO(err); + } + } + } + + if (!gpu_found) + ERR_MACRO(CL_INVALID_CONTEXT); + + err = createKernelList(plan); + ERR_MACRO(err); + + // we created program and kernels based on "some max work group size (default 256)" ... this work group size + // may be larger than what kernel may execute with ... if thats the case we need to regenerate the kernel source + // setting this as limit i.e max group size and rebuild. + unsigned int max_kernel_wg_size; + int patching_req = getMaxKernelWorkGroupSize(plan, &max_kernel_wg_size, num_devices, devices); + if (patching_req == -1) + { + ERR_MACRO(err); + } + + if (patching_req) + { + destroy_plan(plan); + plan->max_work_item_per_workgroup = max_kernel_wg_size; + goto patch_kernel_source; + } + + cl_fft_kernel_info *kInfo = plan->kernel_info; + while (kInfo) + { + plan->num_kernels++; + kInfo = kInfo->next; + } + + if (error_code) + *error_code = CL_SUCCESS; + + return (clFFT_Plan)plan; +} + +void clFFT_DestroyPlan(clFFT_Plan plan) +{ + cl_fft_plan *Plan = (cl_fft_plan *)plan; + if (Plan) + { + destroy_plan(Plan); + clReleaseContext(Plan->context); + free(Plan); + } +} + +void clFFT_DumpPlan(clFFT_Plan Plan, FILE *file) +{ + size_t gDim, lDim; + FILE *out; + if (!file) + out = stdout; + else + out = file; + + cl_fft_plan *plan = (cl_fft_plan *)Plan; + cl_fft_kernel_info *kInfo = plan->kernel_info; + + while (kInfo) + { + cl_int s = 1; + getKernelWorkDimensions(plan, kInfo, &s, &gDim, &lDim); + fprintf(out, "Run kernel %s with global dim = {%zd*BatchSize}, local dim={%zd}\n", kInfo->kernel_name, gDim, lDim); + kInfo = kInfo->next; + } + fprintf(out, "%s\n", plan->kernel_string->c_str()); +} diff --git a/src/algorithms/libs/pass_through.cc b/src/algorithms/libs/pass_through.cc index 584d06886..d05224266 100644 --- a/src/algorithms/libs/pass_through.cc +++ b/src/algorithms/libs/pass_through.cc @@ -39,16 +39,15 @@ using google::LogMessage; Pass_Through::Pass_Through(ConfigurationInterface* configuration, std::string role, - unsigned int in_streams, - unsigned int out_streams) : - role_(role), - in_streams_(in_streams), - out_streams_(out_streams) + unsigned int in_streams, + unsigned int out_streams) : role_(role), + in_streams_(in_streams), + out_streams_(out_streams) { std::string default_item_type = "gr_complex"; std::string input_type = configuration->property(role + ".input_item_type", default_item_type); std::string output_type = configuration->property(role + ".output_item_type", default_item_type); - if(input_type.compare(output_type) != 0) + if (input_type.compare(output_type) != 0) { LOG(WARNING) << "input_item_type and output_item_type are different in a Pass_Through implementation! Taking " << input_type @@ -58,46 +57,46 @@ Pass_Through::Pass_Through(ConfigurationInterface* configuration, std::string ro item_type_ = configuration->property(role + ".item_type", input_type); inverted_spectrum = configuration->property(role + ".inverted_spectrum", false); - if(item_type_.compare("float") == 0) + if (item_type_.compare("float") == 0) { item_size_ = sizeof(float); } - else if(item_type_.compare("gr_complex") == 0) + else if (item_type_.compare("gr_complex") == 0) { item_size_ = sizeof(gr_complex); - if(inverted_spectrum) + if (inverted_spectrum) { conjugate_cc_ = make_conjugate_cc(); } } - else if(item_type_.compare("short") == 0) + else if (item_type_.compare("short") == 0) { item_size_ = sizeof(int16_t); } - else if(item_type_.compare("ishort") == 0) + else if (item_type_.compare("ishort") == 0) { item_size_ = sizeof(int16_t); } - else if(item_type_.compare("cshort") == 0) + else if (item_type_.compare("cshort") == 0) { item_size_ = sizeof(lv_16sc_t); - if(inverted_spectrum) + if (inverted_spectrum) { conjugate_sc_ = make_conjugate_sc(); } } - else if(item_type_.compare("byte") == 0) + else if (item_type_.compare("byte") == 0) { item_size_ = sizeof(int8_t); } - else if(item_type_.compare("ibyte") == 0) + else if (item_type_.compare("ibyte") == 0) { item_size_ = sizeof(int8_t); } - else if(item_type_.compare("cbyte") == 0) + else if (item_type_.compare("cbyte") == 0) { item_size_ = sizeof(lv_8sc_t); - if(inverted_spectrum) + if (inverted_spectrum) { conjugate_ic_ = make_conjugate_ic(); } @@ -113,41 +112,42 @@ Pass_Through::Pass_Through(ConfigurationInterface* configuration, std::string ro } - Pass_Through::~Pass_Through() -{} - +{ +} void Pass_Through::connect(gr::top_block_sptr top_block) { - if(top_block) { /* top_block is not null */}; + if (top_block) + { /* top_block is not null */ + }; DLOG(INFO) << "nothing to connect internally"; } - void Pass_Through::disconnect(gr::top_block_sptr top_block) { - if(top_block) { /* top_block is not null */}; + if (top_block) + { /* top_block is not null */ + }; // Nothing to disconnect } - gr::basic_block_sptr Pass_Through::get_left_block() { - if(inverted_spectrum) + if (inverted_spectrum) { - if(item_type_.compare("gr_complex") == 0) + if (item_type_.compare("gr_complex") == 0) { return conjugate_cc_; } - else if(item_type_.compare("cshort") == 0) + else if (item_type_.compare("cshort") == 0) { return conjugate_sc_; } - else if(item_type_.compare("cbyte") == 0) + else if (item_type_.compare("cbyte") == 0) { return conjugate_ic_; } @@ -162,20 +162,19 @@ gr::basic_block_sptr Pass_Through::get_left_block() } - gr::basic_block_sptr Pass_Through::get_right_block() { - if(inverted_spectrum) + if (inverted_spectrum) { - if(item_type_.compare("gr_complex") == 0) + if (item_type_.compare("gr_complex") == 0) { return conjugate_cc_; } - else if(item_type_.compare("cshort") == 0) + else if (item_type_.compare("cshort") == 0) { return conjugate_sc_; } - else if(item_type_.compare("cbyte") == 0) + else if (item_type_.compare("cbyte") == 0) { return conjugate_ic_; } diff --git a/src/algorithms/libs/pass_through.h b/src/algorithms/libs/pass_through.h index 105ec9f78..1a9538ae4 100644 --- a/src/algorithms/libs/pass_through.h +++ b/src/algorithms/libs/pass_through.h @@ -51,9 +51,9 @@ class Pass_Through : public GNSSBlockInterface { public: Pass_Through(ConfigurationInterface* configuration, - std::string role, - unsigned int in_stream, - unsigned int out_stream); + std::string role, + unsigned int in_stream, + unsigned int out_stream); virtual ~Pass_Through(); @@ -77,7 +77,7 @@ public: { return item_size_; } - + void connect(gr::top_block_sptr top_block) override; void disconnect(gr::top_block_sptr top_block) override; gr::basic_block_sptr get_left_block() override; diff --git a/src/algorithms/libs/rtklib/rtklib.h b/src/algorithms/libs/rtklib/rtklib.h index 8d172b171..93a5be2a9 100644 --- a/src/algorithms/libs/rtklib/rtklib.h +++ b/src/algorithms/libs/rtklib/rtklib.h @@ -67,126 +67,125 @@ /* macros --------------------------------------------------------------------*/ -#define dev_t int -#define socket_t int -#define closesocket close -#define lock_t pthread_mutex_t -#define thread_t pthread_t -#define initlock(f) pthread_mutex_init(f,NULL) -#define rtk_lock(f) pthread_mutex_lock(f) -#define rtk_unlock(f) pthread_mutex_unlock(f) +#define dev_t int +#define socket_t int +#define closesocket close +#define lock_t pthread_mutex_t +#define thread_t pthread_t +#define initlock(f) pthread_mutex_init(f, NULL) +#define rtk_lock(f) pthread_mutex_lock(f) +#define rtk_unlock(f) pthread_mutex_unlock(f) -#define VER_RTKLIB "2.4.2" -#define NTRIP_AGENT "RTKLIB/" VER_RTKLIB -#define NTRIP_CLI_PORT 2101 /* default ntrip-client connection port */ -#define NTRIP_SVR_PORT 80 /* default ntrip-server connection port */ -#define NTRIP_MAXRSP 32768 /* max size of ntrip response */ -#define NTRIP_MAXSTR 256 /* max length of mountpoint string */ -#define NTRIP_RSP_OK_CLI "ICY 200 OK\r\n" /* ntrip response: client */ -#define NTRIP_RSP_OK_SVR "OK\r\n" /* ntrip response: server */ -#define NTRIP_RSP_SRCTBL "SOURCETABLE 200 OK\r\n" /* ntrip response: source table */ -#define NTRIP_RSP_TBLEND "ENDSOURCETABLE" -#define NTRIP_RSP_HTTP "HTTP/" /* ntrip response: http */ -#define NTRIP_RSP_ERROR "ERROR" /* ntrip response: error */ +#define VER_RTKLIB "2.4.2" +#define NTRIP_AGENT "RTKLIB/" VER_RTKLIB +#define NTRIP_CLI_PORT 2101 /* default ntrip-client connection port */ +#define NTRIP_SVR_PORT 80 /* default ntrip-server connection port */ +#define NTRIP_MAXRSP 32768 /* max size of ntrip response */ +#define NTRIP_MAXSTR 256 /* max length of mountpoint string */ +#define NTRIP_RSP_OK_CLI "ICY 200 OK\r\n" /* ntrip response: client */ +#define NTRIP_RSP_OK_SVR "OK\r\n" /* ntrip response: server */ +#define NTRIP_RSP_SRCTBL "SOURCETABLE 200 OK\r\n" /* ntrip response: source table */ +#define NTRIP_RSP_TBLEND "ENDSOURCETABLE" +#define NTRIP_RSP_HTTP "HTTP/" /* ntrip response: http */ +#define NTRIP_RSP_ERROR "ERROR" /* ntrip response: error */ -#define FTP_CMD "wget" /* ftp/http command */ +#define FTP_CMD "wget" /* ftp/http command */ -const int TINTACT = 200; //!< period for stream active (ms) -const int SERIBUFFSIZE = 4096; //!< serial buffer size (bytes) -const int TIMETAGH_LEN = 64; //!< time tag file header length -const int MAXCLI = 32; //!< max client connection for tcp svr -const int MAXSTATMSG = 32; //!< max length of status message +const int TINTACT = 200; //!< period for stream active (ms) +const int SERIBUFFSIZE = 4096; //!< serial buffer size (bytes) +const int TIMETAGH_LEN = 64; //!< time tag file header length +const int MAXCLI = 32; //!< max client connection for tcp svr +const int MAXSTATMSG = 32; //!< max length of status message -const int FTP_TIMEOUT = 30; //!< ftp/http timeout (s) -const int MAXRAWLEN = 4096; //!< max length of receiver raw message -const int MAXSOLBUF = 256; //!< max number of solution buffer -const int MAXSBSMSG = 32; //!< max number of SBAS msg in RTK server -const int MAXOBSBUF = 128; //!< max number of observation data buffer +const int FTP_TIMEOUT = 30; //!< ftp/http timeout (s) +const int MAXRAWLEN = 4096; //!< max length of receiver raw message +const int MAXSOLBUF = 256; //!< max number of solution buffer +const int MAXSBSMSG = 32; //!< max number of SBAS msg in RTK server +const int MAXOBSBUF = 128; //!< max number of observation data buffer const int FILEPATHSEP = '/'; -const double RE_WGS84 = 6378137.0; //!< earth semimajor axis (WGS84) (m) -const double FE_WGS84 = (1.0 / 298.257223563); //!< earth flattening (WGS84) +const double RE_WGS84 = 6378137.0; //!< earth semimajor axis (WGS84) (m) +const double FE_WGS84 = (1.0 / 298.257223563); //!< earth flattening (WGS84) -const double HION = 350000.0; //!< ionosphere height (m) -const double PRN_HWBIAS = 1e-6; //!< process noise of h/w bias (m/MHz/sqrt(s)) +const double HION = 350000.0; //!< ionosphere height (m) +const double PRN_HWBIAS = 1e-6; //!< process noise of h/w bias (m/MHz/sqrt(s)) -const double INT_SWAP_STAT = 86400.0; //!< swap interval of solution status file (s) -const double INT_SWAP_TRAC = 86400.0; //!< swap interval of trace file (s) +const double INT_SWAP_STAT = 86400.0; //!< swap interval of solution status file (s) +const double INT_SWAP_TRAC = 86400.0; //!< swap interval of trace file (s) -const unsigned int POLYCRC32 = 0xEDB88320u; //!< CRC32 polynomial -const unsigned int POLYCRC24Q = 0x1864CFBu; //!< CRC24Q polynomial +const unsigned int POLYCRC32 = 0xEDB88320u; //!< CRC32 polynomial +const unsigned int POLYCRC24Q = 0x1864CFBu; //!< CRC24Q polynomial -const int PMODE_SINGLE = 0; //!< positioning mode: single -const int PMODE_DGPS = 1; //!< positioning mode: DGPS/DGNSS -const int PMODE_KINEMA = 2; //!< positioning mode: kinematic -const int PMODE_STATIC = 3; //!< positioning mode: static -const int PMODE_MOVEB = 4; //!< positioning mode: moving-base -const int PMODE_FIXED = 5; //!< positioning mode: fixed -const int PMODE_PPP_KINEMA = 6; //!< positioning mode: PPP-kinemaric -const int PMODE_PPP_STATIC = 7; //!< positioning mode: PPP-static -const int PMODE_PPP_FIXED = 8; //!< positioning mode: PPP-fixed +const int PMODE_SINGLE = 0; //!< positioning mode: single +const int PMODE_DGPS = 1; //!< positioning mode: DGPS/DGNSS +const int PMODE_KINEMA = 2; //!< positioning mode: kinematic +const int PMODE_STATIC = 3; //!< positioning mode: static +const int PMODE_MOVEB = 4; //!< positioning mode: moving-base +const int PMODE_FIXED = 5; //!< positioning mode: fixed +const int PMODE_PPP_KINEMA = 6; //!< positioning mode: PPP-kinemaric +const int PMODE_PPP_STATIC = 7; //!< positioning mode: PPP-static +const int PMODE_PPP_FIXED = 8; //!< positioning mode: PPP-fixed -const int SOLF_LLH = 0; //!< solution format: lat/lon/height -const int SOLF_XYZ = 1; //!< solution format: x/y/z-ecef -const int SOLF_ENU = 2; //!< solution format: e/n/u-baseline -const int SOLF_NMEA = 3; //!< solution format: NMEA-183 -const int SOLF_STAT = 4; //!< solution format: solution status -const int SOLF_GSIF = 5; //!< solution format: GSI F1/F2 +const int SOLF_LLH = 0; //!< solution format: lat/lon/height +const int SOLF_XYZ = 1; //!< solution format: x/y/z-ecef +const int SOLF_ENU = 2; //!< solution format: e/n/u-baseline +const int SOLF_NMEA = 3; //!< solution format: NMEA-183 +const int SOLF_STAT = 4; //!< solution format: solution status +const int SOLF_GSIF = 5; //!< solution format: GSI F1/F2 -const int SOLQ_NONE = 0; //!< solution status: no solution -const int SOLQ_FIX = 1; //!< solution status: fix -const int SOLQ_FLOAT = 2; //!< solution status: float -const int SOLQ_SBAS = 3; //!< solution status: SBAS -const int SOLQ_DGPS = 4; //!< solution status: DGPS/DGNSS -const int SOLQ_SINGLE = 5; //!< solution status: single -const int SOLQ_PPP = 6; //!< solution status: PPP -const int SOLQ_DR = 7; //!< solution status: dead reckoning -const int MAXSOLQ = 7; //!< max number of solution status +const int SOLQ_NONE = 0; //!< solution status: no solution +const int SOLQ_FIX = 1; //!< solution status: fix +const int SOLQ_FLOAT = 2; //!< solution status: float +const int SOLQ_SBAS = 3; //!< solution status: SBAS +const int SOLQ_DGPS = 4; //!< solution status: DGPS/DGNSS +const int SOLQ_SINGLE = 5; //!< solution status: single +const int SOLQ_PPP = 6; //!< solution status: PPP +const int SOLQ_DR = 7; //!< solution status: dead reckoning +const int MAXSOLQ = 7; //!< max number of solution status -const int TIMES_GPST = 0; //!< time system: gps time -const int TIMES_UTC = 1; //!< time system: utc -const int TIMES_JST = 2; //!< time system: jst +const int TIMES_GPST = 0; //!< time system: gps time +const int TIMES_UTC = 1; //!< time system: utc +const int TIMES_JST = 2; //!< time system: jst -const double ERR_SAAS = 0.3; //!< saastamoinen model error std (m) -const double ERR_BRDCI = 0.5; //!< broadcast iono model error factor -const double ERR_CBIAS = 0.3; //!< code bias error std (m) -const double REL_HUMI = 0.7; //!< relative humidity for saastamoinen model -const double GAP_RESION = 120; //!< default gap to reset ionos parameters (ep) +const double ERR_SAAS = 0.3; //!< saastamoinen model error std (m) +const double ERR_BRDCI = 0.5; //!< broadcast iono model error factor +const double ERR_CBIAS = 0.3; //!< code bias error std (m) +const double REL_HUMI = 0.7; //!< relative humidity for saastamoinen model +const double GAP_RESION = 120; //!< default gap to reset ionos parameters (ep) -const int MAXFREQ = 7; //!< max NFREQ +const int MAXFREQ = 7; //!< max NFREQ -const int MAXLEAPS = 64; //!< max number of leap seconds table -const double DTTOL = 0.005; //!< tolerance of time difference (s) +const int MAXLEAPS = 64; //!< max number of leap seconds table +const double DTTOL = 0.005; //!< tolerance of time difference (s) -const int NFREQ = 3; //!< number of carrier frequencies -const int NFREQGLO = 2; //!< number of carrier frequencies of GLONASS -const int NEXOBS = 0; //!< number of extended obs codes -const int MAXANT = 64; //!< max length of station name/antenna type +const int NFREQ = 3; //!< number of carrier frequencies +const int NFREQGLO = 2; //!< number of carrier frequencies of GLONASS +const int NEXOBS = 0; //!< number of extended obs codes +const int MAXANT = 64; //!< max length of station name/antenna type -const int MINPRNGPS = 1; //!< min satellite PRN number of GPS -const int MAXPRNGPS = 32; //!< max satellite PRN number of GPS -const int NSATGPS = (MAXPRNGPS - MINPRNGPS + 1); //!< number of GPS satellites +const int MINPRNGPS = 1; //!< min satellite PRN number of GPS +const int MAXPRNGPS = 32; //!< max satellite PRN number of GPS +const int NSATGPS = (MAXPRNGPS - MINPRNGPS + 1); //!< number of GPS satellites const int NSYSGPS = 1; -const int SYS_NONE = 0x00; //!< navigation system: none -const int SYS_GPS = 0x01; //!< navigation system: GPS -const int SYS_SBS = 0x02; //!< navigation system: SBAS -const int SYS_GLO = 0x04; //!< navigation system: GLONASS -const int SYS_GAL = 0x08; //!< navigation system: Galileo -const int SYS_QZS = 0x10; //!< navigation system: QZSS -const int SYS_BDS = 0x20; //!< navigation system: BeiDou -const int SYS_IRN = 0x40; //!< navigation system: IRNS -const int SYS_LEO = 0x80; //!< navigation system: LEO -const int SYS_ALL = 0xFF; //!< navigation system: all - +const int SYS_NONE = 0x00; //!< navigation system: none +const int SYS_GPS = 0x01; //!< navigation system: GPS +const int SYS_SBS = 0x02; //!< navigation system: SBAS +const int SYS_GLO = 0x04; //!< navigation system: GLONASS +const int SYS_GAL = 0x08; //!< navigation system: Galileo +const int SYS_QZS = 0x10; //!< navigation system: QZSS +const int SYS_BDS = 0x20; //!< navigation system: BeiDou +const int SYS_IRN = 0x40; //!< navigation system: IRNS +const int SYS_LEO = 0x80; //!< navigation system: LEO +const int SYS_ALL = 0xFF; //!< navigation system: all #define ENAGLO #ifdef ENAGLO -const int MINPRNGLO = 1; //!< min satellite slot number of GLONASS -const int MAXPRNGLO = 27; //!< max satellite slot number of GLONASS -const int NSATGLO = (MAXPRNGLO - MINPRNGLO + 1); //!< number of GLONASS satellites +const int MINPRNGLO = 1; //!< min satellite slot number of GLONASS +const int MAXPRNGLO = 27; //!< max satellite slot number of GLONASS +const int NSATGLO = (MAXPRNGLO - MINPRNGLO + 1); //!< number of GLONASS satellites const int NSYSGLO = 1; #else const int MINPRNGLO = 0; @@ -201,17 +200,17 @@ const int MAXPRNGLO = 27; //!< max satellite slot number of G const int NSATGLO = (MAXPRNGLO - MINPRNGLO + 1); //!< number of GLONASS satellites const int NSYSGLO = 1; */ -const int MINPRNGAL = 1; //!< min satellite PRN number of Galileo -const int MAXPRNGAL = 30; //!< max satellite PRN number of Galileo -const int NSATGAL = (MAXPRNGAL - MINPRNGAL + 1); //!< number of Galileo satellites +const int MINPRNGAL = 1; //!< min satellite PRN number of Galileo +const int MAXPRNGAL = 30; //!< max satellite PRN number of Galileo +const int NSATGAL = (MAXPRNGAL - MINPRNGAL + 1); //!< number of Galileo satellites const int NSYSGAL = 1; #ifdef ENAQZS -const int MINPRNQZS = 193; //!< min satellite PRN number of QZSS -const int MAXPRNQZS = 199; //!< max satellite PRN number of QZSS -const int MINPRNQZS_S = 183; //!< min satellite PRN number of QZSS SAIF -const int MAXPRNQZS_S = 189; //!< max satellite PRN number of QZSS SAIF -const int NSATQZS = (MAXPRNQZS - MINPRNQZS + 1); //!< number of QZSS satellites +const int MINPRNQZS = 193; //!< min satellite PRN number of QZSS +const int MAXPRNQZS = 199; //!< max satellite PRN number of QZSS +const int MINPRNQZS_S = 183; //!< min satellite PRN number of QZSS SAIF +const int MAXPRNQZS_S = 189; //!< max satellite PRN number of QZSS SAIF +const int NSATQZS = (MAXPRNQZS - MINPRNQZS + 1); //!< number of QZSS satellites const int NSYSQZS = 1; #else const int MINPRNQZS = 0; @@ -223,9 +222,9 @@ const int NSYSQZS = 0; #endif #ifdef ENABDS -const int MINPRNBDS = 1; //!< min satellite sat number of BeiDou -const int MAXPRNBDS = 35; //!< max satellite sat number of BeiDou -const int NSATBDS = (MAXPRNBDS - MINPRNCM + 1); //!< number of BeiDou satellites +const int MINPRNBDS = 1; //!< min satellite sat number of BeiDou +const int MAXPRNBDS = 35; //!< max satellite sat number of BeiDou +const int NSATBDS = (MAXPRNBDS - MINPRNCM + 1); //!< number of BeiDou satellites const int NSYSBDS = 1; #else const int MINPRNBDS = 0; @@ -235,9 +234,9 @@ const int NSYSBDS = 0; #endif #ifdef ENAIRN -const int MINPRNIRN = 1; //!< min satellite sat number of IRNSS -const int MAXPRNIRN = 7; //!< max satellite sat number of IRNSS -const int NSATIRN = (MAXPRNIRN - MINPRNIRN + 1); //!< number of IRNSS satellites +const int MINPRNIRN = 1; //!< min satellite sat number of IRNSS +const int MAXPRNIRN = 7; //!< max satellite sat number of IRNSS +const int NSATIRN = (MAXPRNIRN - MINPRNIRN + 1); //!< number of IRNSS satellites const int NSYSIRN = 1; #else const int MINPRNIRN = 0; @@ -247,9 +246,9 @@ const int NSYSIRN = 0; #endif #ifdef ENALEO -const int MINPRNLEO = 1; //!< min satellite sat number of LEO -const int NSATLEO = 10; //!< max satellite sat number of LEO -const int NSATLEO = (MAXPRNLEO - MINPRNLEO + 1); //!< number of LEO satellites +const int MINPRNLEO = 1; //!< min satellite sat number of LEO +const int NSATLEO = 10; //!< max satellite sat number of LEO +const int NSATLEO = (MAXPRNLEO - MINPRNLEO + 1); //!< number of LEO satellites const int NSYSLEO = 1; #else const int MINPRNLEO = 0; @@ -258,368 +257,393 @@ const int NSATLEO = 0; const int NSYSLEO = 0; #endif -const int NSYS = (NSYSGPS + NSYSGLO + NSYSGAL + NSYSQZS + NSYSBDS + NSYSIRN + NSYSLEO); //!< number of systems +const int NSYS = (NSYSGPS + NSYSGLO + NSYSGAL + NSYSQZS + NSYSBDS + NSYSIRN + NSYSLEO); //!< number of systems -const int MINPRNSBS = 120; //!< min satellite PRN number of SBAS -const int MAXPRNSBS = 142; //!< max satellite PRN number of SBAS -const int NSATSBS = (MAXPRNSBS - MINPRNSBS + 1); //!< number of SBAS satellites +const int MINPRNSBS = 120; //!< min satellite PRN number of SBAS +const int MAXPRNSBS = 142; //!< max satellite PRN number of SBAS +const int NSATSBS = (MAXPRNSBS - MINPRNSBS + 1); //!< number of SBAS satellites const int MAXSAT = (NSATGPS + NSATGLO + NSATGAL + NSATQZS + NSATBDS + NSATIRN + NSATSBS + NSATLEO); const int MAXSTA = 255; #ifndef MAXOBS -const int MAXOBS = 64; //!< max number of obs in an epoch +const int MAXOBS = 64; //!< max number of obs in an epoch #endif -const int MAXRCV = 64; //!< max receiver number (1 to MAXRCV) -const int MAXOBSTYPE = 64; //!< max number of obs type in RINEX -const double MAXDTOE = 7200.0; //!< max time difference to GPS Toe (s) -const double MAXDTOE_QZS = 7200.0; //!< max time difference to QZSS Toe (s) -const double MAXDTOE_GAL = 10800.0; //!< max time difference to Galileo Toe (s) -const double MAXDTOE_BDS = 21600.0; //!< max time difference to BeiDou Toe (s) -const double MAXDTOE_GLO = 1800.0; //!< max time difference to GLONASS Toe (s) -const double MAXDTOE_SBS = 360.0; //!< max time difference to SBAS Toe (s) -const double MAXDTOE_S = 86400.0; //!< max time difference to ephem toe (s) for other -const double MAXGDOP = 300.0; //!< max GDOP +const int MAXRCV = 64; //!< max receiver number (1 to MAXRCV) +const int MAXOBSTYPE = 64; //!< max number of obs type in RINEX +const double MAXDTOE = 7200.0; //!< max time difference to GPS Toe (s) +const double MAXDTOE_QZS = 7200.0; //!< max time difference to QZSS Toe (s) +const double MAXDTOE_GAL = 10800.0; //!< max time difference to Galileo Toe (s) +const double MAXDTOE_BDS = 21600.0; //!< max time difference to BeiDou Toe (s) +const double MAXDTOE_GLO = 1800.0; //!< max time difference to GLONASS Toe (s) +const double MAXDTOE_SBS = 360.0; //!< max time difference to SBAS Toe (s) +const double MAXDTOE_S = 86400.0; //!< max time difference to ephem toe (s) for other +const double MAXGDOP = 300.0; //!< max GDOP -const int MAXSBSURA = 8; //!< max URA of SBAS satellite -const int MAXBAND = 10; //!< max SBAS band of IGP -const int MAXNIGP = 201; //!< max number of IGP in SBAS band -const int MAXNGEO = 4; //!< max number of GEO satellites +const int MAXSBSURA = 8; //!< max URA of SBAS satellite +const int MAXBAND = 10; //!< max SBAS band of IGP +const int MAXNIGP = 201; //!< max number of IGP in SBAS band +const int MAXNGEO = 4; //!< max number of GEO satellites -const int MAXSOLMSG = 8191; //!< max length of solution message -const int MAXERRMSG = 4096; //!< max length of error/warning message +const int MAXSOLMSG = 8191; //!< max length of solution message +const int MAXERRMSG = 4096; //!< max length of error/warning message -const int IONOOPT_OFF = 0; //!< ionosphere option: correction off -const int IONOOPT_BRDC = 1; //!< ionosphere option: broadcast model -const int IONOOPT_SBAS = 2; //!< ionosphere option: SBAS model -const int IONOOPT_IFLC = 3; //!< ionosphere option: L1/L2 or L1/L5 iono-free LC -const int IONOOPT_EST = 4; //!< ionosphere option: estimation -const int IONOOPT_TEC = 5; //!< ionosphere option: IONEX TEC model -const int IONOOPT_QZS = 6; //!< ionosphere option: QZSS broadcast model -const int IONOOPT_LEX = 7; //!< ionosphere option: QZSS LEX ionospehre -const int IONOOPT_STEC = 8; //!< ionosphere option: SLANT TEC model +const int IONOOPT_OFF = 0; //!< ionosphere option: correction off +const int IONOOPT_BRDC = 1; //!< ionosphere option: broadcast model +const int IONOOPT_SBAS = 2; //!< ionosphere option: SBAS model +const int IONOOPT_IFLC = 3; //!< ionosphere option: L1/L2 or L1/L5 iono-free LC +const int IONOOPT_EST = 4; //!< ionosphere option: estimation +const int IONOOPT_TEC = 5; //!< ionosphere option: IONEX TEC model +const int IONOOPT_QZS = 6; //!< ionosphere option: QZSS broadcast model +const int IONOOPT_LEX = 7; //!< ionosphere option: QZSS LEX ionospehre +const int IONOOPT_STEC = 8; //!< ionosphere option: SLANT TEC model -const int TROPOPT_OFF = 0; //!< troposphere option: correction off -const int TROPOPT_SAAS = 1; //!< troposphere option: Saastamoinen model -const int TROPOPT_SBAS = 2; //!< troposphere option: SBAS model -const int TROPOPT_EST = 3; //!< troposphere option: ZTD estimation -const int TROPOPT_ESTG = 4; //!< troposphere option: ZTD+grad estimation -const int TROPOPT_COR = 5; //!< troposphere option: ZTD correction -const int TROPOPT_CORG = 6; //!< troposphere option: ZTD+grad correction +const int TROPOPT_OFF = 0; //!< troposphere option: correction off +const int TROPOPT_SAAS = 1; //!< troposphere option: Saastamoinen model +const int TROPOPT_SBAS = 2; //!< troposphere option: SBAS model +const int TROPOPT_EST = 3; //!< troposphere option: ZTD estimation +const int TROPOPT_ESTG = 4; //!< troposphere option: ZTD+grad estimation +const int TROPOPT_COR = 5; //!< troposphere option: ZTD correction +const int TROPOPT_CORG = 6; //!< troposphere option: ZTD+grad correction -const int EPHOPT_BRDC = 0; //!< ephemeris option: broadcast ephemeris -const int EPHOPT_PREC = 1; //!< ephemeris option: precise ephemeris -const int EPHOPT_SBAS = 2; //!< ephemeris option: broadcast + SBAS -const int EPHOPT_SSRAPC = 3; //!< ephemeris option: broadcast + SSR_APC -const int EPHOPT_SSRCOM = 4; //!< ephemeris option: broadcast + SSR_COM -const int EPHOPT_LEX = 5; //!< ephemeris option: QZSS LEX ephemeris +const int EPHOPT_BRDC = 0; //!< ephemeris option: broadcast ephemeris +const int EPHOPT_PREC = 1; //!< ephemeris option: precise ephemeris +const int EPHOPT_SBAS = 2; //!< ephemeris option: broadcast + SBAS +const int EPHOPT_SSRAPC = 3; //!< ephemeris option: broadcast + SSR_APC +const int EPHOPT_SSRCOM = 4; //!< ephemeris option: broadcast + SSR_COM +const int EPHOPT_LEX = 5; //!< ephemeris option: QZSS LEX ephemeris -const double EFACT_GPS = 1.0; //!< error factor: GPS -const double EFACT_GLO = 1.5; //!< error factor: GLONASS -const double EFACT_GAL = 1.0; //!< error factor: Galileo -const double EFACT_QZS = 1.0; //!< error factor: QZSS -const double EFACT_BDS = 1.0; //!< error factor: BeiDou -const double EFACT_IRN = 1.5; //!< error factor: IRNSS -const double EFACT_SBS = 3.0; //!< error factor: SBAS +const double EFACT_GPS = 1.0; //!< error factor: GPS +const double EFACT_GLO = 1.5; //!< error factor: GLONASS +const double EFACT_GAL = 1.0; //!< error factor: Galileo +const double EFACT_QZS = 1.0; //!< error factor: QZSS +const double EFACT_BDS = 1.0; //!< error factor: BeiDou +const double EFACT_IRN = 1.5; //!< error factor: IRNSS +const double EFACT_SBS = 3.0; //!< error factor: SBAS -const int MAXEXFILE = 1024; //!< max number of expanded files -const double MAXSBSAGEF = 30.0; //!< max age of SBAS fast correction (s) -const double MAXSBSAGEL = 1800.0; //!< max age of SBAS long term corr (s) +const int MAXEXFILE = 1024; //!< max number of expanded files +const double MAXSBSAGEF = 30.0; //!< max age of SBAS fast correction (s) +const double MAXSBSAGEL = 1800.0; //!< max age of SBAS long term corr (s) -const int ARMODE_OFF = 0; //!< AR mode: off -const int ARMODE_CONT = 1; //!< AR mode: continuous -const int ARMODE_INST = 2; //!< AR mode: instantaneous -const int ARMODE_FIXHOLD = 3; //!< AR mode: fix and hold -const int ARMODE_PPPAR = 4; //!< AR mode: PPP-AR -const int ARMODE_PPPAR_ILS = 5; //!< AR mode: AR mode: PPP-AR ILS +const int ARMODE_OFF = 0; //!< AR mode: off +const int ARMODE_CONT = 1; //!< AR mode: continuous +const int ARMODE_INST = 2; //!< AR mode: instantaneous +const int ARMODE_FIXHOLD = 3; //!< AR mode: fix and hold +const int ARMODE_PPPAR = 4; //!< AR mode: PPP-AR +const int ARMODE_PPPAR_ILS = 5; //!< AR mode: AR mode: PPP-AR ILS const int ARMODE_WLNL = 6; const int ARMODE_TCAR = 7; -const int POSOPT_RINEX = 3; //!< pos option: rinex header pos -const int MAXSTRPATH = 1024; //!< max length of stream path -const int MAXSTRMSG = 1024; //!< max length of stream message +const int POSOPT_RINEX = 3; //!< pos option: rinex header pos +const int MAXSTRPATH = 1024; //!< max length of stream path +const int MAXSTRMSG = 1024; //!< max length of stream message -typedef void fatalfunc_t(const char *); //!< fatal callback function type +typedef void fatalfunc_t(const char *); //!< fatal callback function type -#define STR_MODE_R 0x1 /* stream mode: read */ -#define STR_MODE_W 0x2 /* stream mode: write */ -#define STR_MODE_RW 0x3 /* stream mode: read/write */ +#define STR_MODE_R 0x1 /* stream mode: read */ +#define STR_MODE_W 0x2 /* stream mode: write */ +#define STR_MODE_RW 0x3 /* stream mode: read/write */ -#define STR_NONE 0 /* stream type: none */ -#define STR_SERIAL 1 /* stream type: serial */ -#define STR_FILE 2 /* stream type: file */ -#define STR_TCPSVR 3 /* stream type: TCP server */ -#define STR_TCPCLI 4 /* stream type: TCP client */ -#define STR_UDP 5 /* stream type: UDP stream */ -#define STR_NTRIPSVR 6 /* stream type: NTRIP server */ -#define STR_NTRIPCLI 7 /* stream type: NTRIP client */ -#define STR_FTP 8 /* stream type: ftp */ -#define STR_HTTP 9 /* stream type: http */ +#define STR_NONE 0 /* stream type: none */ +#define STR_SERIAL 1 /* stream type: serial */ +#define STR_FILE 2 /* stream type: file */ +#define STR_TCPSVR 3 /* stream type: TCP server */ +#define STR_TCPCLI 4 /* stream type: TCP client */ +#define STR_UDP 5 /* stream type: UDP stream */ +#define STR_NTRIPSVR 6 /* stream type: NTRIP server */ +#define STR_NTRIPCLI 7 /* stream type: NTRIP client */ +#define STR_FTP 8 /* stream type: ftp */ +#define STR_HTTP 9 /* stream type: http */ -#define NP_PPP(opt) ((opt)->dynamics?9:3) /* number of pos solution */ -#define IC_PPP(s,opt) (NP_PPP(opt)+(s)) /* state index of clocks (s=0:gps,1:glo) */ -#define IT_PPP(opt) (IC_PPP(0,opt)+NSYS) /* state index of tropos */ -#define NR_PPP(opt) (IT_PPP(opt)+((opt)->tropopttropopt==TROPOPT_EST?1:3))) /* number of solutions */ -#define IB_PPP(s,opt) (NR_PPP(opt)+(s)-1) /* state index of phase bias */ -#define NX_PPP(opt) (IB_PPP(MAXSAT,opt)+1) /* number of estimated states */ +#define NP_PPP(opt) ((opt)->dynamics ? 9 : 3) /* number of pos solution */ +#define IC_PPP(s, opt) (NP_PPP(opt) + (s)) /* state index of clocks (s=0:gps,1:glo) */ +#define IT_PPP(opt) (IC_PPP(0, opt) + NSYS) /* state index of tropos */ +#define NR_PPP(opt) (IT_PPP(opt) + ((opt)->tropopt < TROPOPT_EST ? 0 : ((opt)->tropopt == TROPOPT_EST ? 1 : 3))) /* number of solutions */ +#define IB_PPP(s, opt) (NR_PPP(opt) + (s)-1) /* state index of phase bias */ +#define NX_PPP(opt) (IB_PPP(MAXSAT, opt) + 1) /* number of estimated states */ -#define NF_RTK(opt) ((opt)->ionoopt==IONOOPT_IFLC?1:(opt)->nf) -#define NP_RTK(opt) ((opt)->dynamics==0?3:9) -#define NI_RTK(opt) ((opt)->ionoopt!=IONOOPT_EST?0:MAXSAT) -#define NT_RTK(opt) ((opt)->tropopttropoptglomodear!=2?0:NFREQGLO) -#define NB_RTK(opt) ((opt)->mode<=PMODE_DGPS?0:MAXSAT*NF_RTK(opt)) -#define NR_RTK(opt) (NP_RTK(opt)+NI_RTK(opt)+NT_RTK(opt)+NL_RTK(opt)) -#define NX_RTK(opt) (NR_RTK(opt)+NB_RTK(opt)) +#define NF_RTK(opt) ((opt)->ionoopt == IONOOPT_IFLC ? 1 : (opt)->nf) +#define NP_RTK(opt) ((opt)->dynamics == 0 ? 3 : 9) +#define NI_RTK(opt) ((opt)->ionoopt != IONOOPT_EST ? 0 : MAXSAT) +#define NT_RTK(opt) ((opt)->tropopt < TROPOPT_EST ? 0 : ((opt)->tropopt < TROPOPT_ESTG ? 2 : 6)) +#define NL_RTK(opt) ((opt)->glomodear != 2 ? 0 : NFREQGLO) +#define NB_RTK(opt) ((opt)->mode <= PMODE_DGPS ? 0 : MAXSAT * NF_RTK(opt)) +#define NR_RTK(opt) (NP_RTK(opt) + NI_RTK(opt) + NT_RTK(opt) + NL_RTK(opt)) +#define NX_RTK(opt) (NR_RTK(opt) + NB_RTK(opt)) -typedef struct { /* time struct */ - time_t time; /* time (s) expressed by standard time_t */ - double sec; /* fraction of second under 1 s */ +typedef struct +{ /* time struct */ + time_t time; /* time (s) expressed by standard time_t */ + double sec; /* fraction of second under 1 s */ } gtime_t; -typedef struct { /* observation data record */ - gtime_t time; /* receiver sampling time (GPST) */ - unsigned char sat,rcv; /* satellite/receiver number */ - unsigned char SNR [NFREQ+NEXOBS]; /* signal strength (0.25 dBHz) */ - unsigned char LLI [NFREQ+NEXOBS]; /* loss of lock indicator */ - unsigned char code[NFREQ+NEXOBS]; /* code indicator (CODE_???) */ - double L[NFREQ+NEXOBS]; /* observation data carrier-phase (cycle) */ - double P[NFREQ+NEXOBS]; /* observation data pseudorange (m) */ - float D[NFREQ+NEXOBS]; /* observation data doppler frequency (Hz) */ +typedef struct +{ /* observation data record */ + gtime_t time; /* receiver sampling time (GPST) */ + unsigned char sat, rcv; /* satellite/receiver number */ + unsigned char SNR[NFREQ + NEXOBS]; /* signal strength (0.25 dBHz) */ + unsigned char LLI[NFREQ + NEXOBS]; /* loss of lock indicator */ + unsigned char code[NFREQ + NEXOBS]; /* code indicator (CODE_???) */ + double L[NFREQ + NEXOBS]; /* observation data carrier-phase (cycle) */ + double P[NFREQ + NEXOBS]; /* observation data pseudorange (m) */ + float D[NFREQ + NEXOBS]; /* observation data doppler frequency (Hz) */ } obsd_t; -typedef struct { /* observation data */ - int n,nmax; /* number of obervation data/allocated */ - obsd_t *data; /* observation data records */ +typedef struct +{ /* observation data */ + int n, nmax; /* number of obervation data/allocated */ + obsd_t *data; /* observation data records */ } obs_t; -typedef struct { /* earth rotation parameter data type */ - double mjd; /* mjd (days) */ - double xp,yp; /* pole offset (rad) */ - double xpr,ypr; /* pole offset rate (rad/day) */ - double ut1_utc; /* ut1-utc (s) */ - double lod; /* length of day (s/day) */ +typedef struct +{ /* earth rotation parameter data type */ + double mjd; /* mjd (days) */ + double xp, yp; /* pole offset (rad) */ + double xpr, ypr; /* pole offset rate (rad/day) */ + double ut1_utc; /* ut1-utc (s) */ + double lod; /* length of day (s/day) */ } erpd_t; -typedef struct { /* earth rotation parameter type */ - int n,nmax; /* number and max number of data */ - erpd_t *data; /* earth rotation parameter data */ +typedef struct +{ /* earth rotation parameter type */ + int n, nmax; /* number and max number of data */ + erpd_t *data; /* earth rotation parameter data */ } erp_t; -typedef struct { /* antenna parameter type */ - int sat; /* satellite number (0:receiver) */ - char type[MAXANT]; /* antenna type */ - char code[MAXANT]; /* serial number or satellite code */ - gtime_t ts,te; /* valid time start and end */ - double off[NFREQ][ 3]; /* phase center offset e/n/u or x/y/z (m) */ +typedef struct +{ /* antenna parameter type */ + int sat; /* satellite number (0:receiver) */ + char type[MAXANT]; /* antenna type */ + char code[MAXANT]; /* serial number or satellite code */ + gtime_t ts, te; /* valid time start and end */ + double off[NFREQ][3]; /* phase center offset e/n/u or x/y/z (m) */ double var[NFREQ][19]; /* phase center variation (m) */ - /* el=90,85,...,0 or nadir=0,1,2,3,... (deg) */ + /* el=90,85,...,0 or nadir=0,1,2,3,... (deg) */ } pcv_t; -typedef struct { /* antenna parameters type */ - int n,nmax; /* number of data/allocated */ - pcv_t *pcv; /* antenna parameters data */ +typedef struct +{ /* antenna parameters type */ + int n, nmax; /* number of data/allocated */ + pcv_t *pcv; /* antenna parameters data */ } pcvs_t; -typedef struct { /* almanac type */ - int sat; /* satellite number */ - int svh; /* sv health (0:ok) */ - int svconf; /* as and sv config */ - int week; /* GPS/QZS: gps week, GAL: galileo week */ - gtime_t toa; /* Toa */ - /* SV orbit parameters */ - double A,e,i0,OMG0,omg,M0,OMGd; - double toas; /* Toa (s) in week */ - double f0,f1; /* SV clock parameters (af0,af1) */ +typedef struct +{ /* almanac type */ + int sat; /* satellite number */ + int svh; /* sv health (0:ok) */ + int svconf; /* as and sv config */ + int week; /* GPS/QZS: gps week, GAL: galileo week */ + gtime_t toa; /* Toa */ + /* SV orbit parameters */ + double A, e, i0, OMG0, omg, M0, OMGd; + double toas; /* Toa (s) in week */ + double f0, f1; /* SV clock parameters (af0,af1) */ } alm_t; -typedef struct { /* GPS/QZS/GAL broadcast ephemeris type */ - int sat; /* satellite number */ - int iode,iodc; /* IODE,IODC */ - int sva; /* SV accuracy (URA index) */ - int svh; /* SV health (0:ok) */ - int week; /* GPS/QZS: gps week, GAL: galileo week */ - int code; /* GPS/QZS: code on L2, GAL/BDS: data sources */ - int flag; /* GPS/QZS: L2 P data flag, BDS: nav type */ - gtime_t toe,toc,ttr; /* Toe,Toc,T_trans */ - /* SV orbit parameters */ - double A,e,i0,OMG0,omg,M0,deln,OMGd,idot; - double crc,crs,cuc,cus,cic,cis; - double toes; /* Toe (s) in week */ - double fit; /* fit interval (h) */ - double f0,f1,f2; /* SV clock parameters (af0,af1,af2) */ - double tgd[4]; /* group delay parameters */ - /* GPS/QZS:tgd[0]=TGD */ - /* GAL :tgd[0]=BGD E5a/E1,tgd[1]=BGD E5b/E1 */ - /* BDS :tgd[0]=BGD1,tgd[1]=BGD2 */ - double Adot,ndot; /* Adot,ndot for CNAV */ +typedef struct +{ /* GPS/QZS/GAL broadcast ephemeris type */ + int sat; /* satellite number */ + int iode, iodc; /* IODE,IODC */ + int sva; /* SV accuracy (URA index) */ + int svh; /* SV health (0:ok) */ + int week; /* GPS/QZS: gps week, GAL: galileo week */ + int code; /* GPS/QZS: code on L2, GAL/BDS: data sources */ + int flag; /* GPS/QZS: L2 P data flag, BDS: nav type */ + gtime_t toe, toc, ttr; /* Toe,Toc,T_trans */ + /* SV orbit parameters */ + double A, e, i0, OMG0, omg, M0, deln, OMGd, idot; + double crc, crs, cuc, cus, cic, cis; + double toes; /* Toe (s) in week */ + double fit; /* fit interval (h) */ + double f0, f1, f2; /* SV clock parameters (af0,af1,af2) */ + double tgd[4]; /* group delay parameters */ + /* GPS/QZS:tgd[0]=TGD */ + /* GAL :tgd[0]=BGD E5a/E1,tgd[1]=BGD E5b/E1 */ + /* BDS :tgd[0]=BGD1,tgd[1]=BGD2 */ + double Adot, ndot; /* Adot,ndot for CNAV */ } eph_t; -typedef struct { /* GLONASS broadcast ephemeris type */ - int sat; /* satellite number */ - int iode; /* IODE (0-6 bit of tb field) */ - int frq; /* satellite frequency number */ - int svh,sva,age; /* satellite health, accuracy, age of operation */ - gtime_t toe; /* epoch of epherides (gpst) */ - gtime_t tof; /* message frame time (gpst) */ - double pos[3]; /* satellite position (ecef) (m) */ - double vel[3]; /* satellite velocity (ecef) (m/s) */ - double acc[3]; /* satellite acceleration (ecef) (m/s^2) */ - double taun,gamn; /* SV clock bias (s)/relative freq bias */ - double dtaun; /* delay between L1 and L2 (s) */ +typedef struct +{ /* GLONASS broadcast ephemeris type */ + int sat; /* satellite number */ + int iode; /* IODE (0-6 bit of tb field) */ + int frq; /* satellite frequency number */ + int svh, sva, age; /* satellite health, accuracy, age of operation */ + gtime_t toe; /* epoch of epherides (gpst) */ + gtime_t tof; /* message frame time (gpst) */ + double pos[3]; /* satellite position (ecef) (m) */ + double vel[3]; /* satellite velocity (ecef) (m/s) */ + double acc[3]; /* satellite acceleration (ecef) (m/s^2) */ + double taun, gamn; /* SV clock bias (s)/relative freq bias */ + double dtaun; /* delay between L1 and L2 (s) */ } geph_t; -typedef struct { /* precise ephemeris type */ - gtime_t time; /* time (GPST) */ - int index; /* ephemeris index for multiple files */ +typedef struct +{ /* precise ephemeris type */ + gtime_t time; /* time (GPST) */ + int index; /* ephemeris index for multiple files */ double pos[MAXSAT][4]; /* satellite position/clock (ecef) (m|s) */ - float std[MAXSAT][4]; /* satellite position/clock std (m|s) */ + float std[MAXSAT][4]; /* satellite position/clock std (m|s) */ double vel[MAXSAT][4]; /* satellite velocity/clk-rate (m/s|s/s) */ - float vst[MAXSAT][4]; /* satellite velocity/clk-rate std (m/s|s/s) */ - float cov[MAXSAT][3]; /* satellite position covariance (m^2) */ - float vco[MAXSAT][3]; /* satellite velocity covariance (m^2) */ + float vst[MAXSAT][4]; /* satellite velocity/clk-rate std (m/s|s/s) */ + float cov[MAXSAT][3]; /* satellite position covariance (m^2) */ + float vco[MAXSAT][3]; /* satellite velocity covariance (m^2) */ } peph_t; -typedef struct { /* precise clock type */ - gtime_t time; /* time (GPST) */ - int index; /* clock index for multiple files */ +typedef struct +{ /* precise clock type */ + gtime_t time; /* time (GPST) */ + int index; /* clock index for multiple files */ double clk[MAXSAT][1]; /* satellite clock (s) */ - float std[MAXSAT][1]; /* satellite clock std (s) */ + float std[MAXSAT][1]; /* satellite clock std (s) */ } pclk_t; -typedef struct { /* SBAS ephemeris type */ - int sat; /* satellite number */ - gtime_t t0; /* reference epoch time (GPST) */ - gtime_t tof; /* time of message frame (GPST) */ - int sva; /* SV accuracy (URA index) */ - int svh; /* SV health (0:ok) */ - double pos[3]; /* satellite position (m) (ecef) */ - double vel[3]; /* satellite velocity (m/s) (ecef) */ - double acc[3]; /* satellite acceleration (m/s^2) (ecef) */ - double af0,af1; /* satellite clock-offset/drift (s,s/s) */ +typedef struct +{ /* SBAS ephemeris type */ + int sat; /* satellite number */ + gtime_t t0; /* reference epoch time (GPST) */ + gtime_t tof; /* time of message frame (GPST) */ + int sva; /* SV accuracy (URA index) */ + int svh; /* SV health (0:ok) */ + double pos[3]; /* satellite position (m) (ecef) */ + double vel[3]; /* satellite velocity (m/s) (ecef) */ + double acc[3]; /* satellite acceleration (m/s^2) (ecef) */ + double af0, af1; /* satellite clock-offset/drift (s,s/s) */ } seph_t; -typedef struct { /* norad two line element data type */ - char name [32]; /* common name */ - char alias[32]; /* alias name */ - char satno[16]; /* satellite catalog number */ - char satclass; /* classification */ - char desig[16]; /* international designator */ - gtime_t epoch; /* element set epoch (UTC) */ - double ndot; /* 1st derivative of mean motion */ - double nddot; /* 2st derivative of mean motion */ - double bstar; /* B* drag term */ - int etype; /* element set type */ - int eleno; /* element number */ - double inc; /* orbit inclination (deg) */ - double OMG; /* right ascension of ascending node (deg) */ - double ecc; /* eccentricity */ - double omg; /* argument of perigee (deg) */ - double M; /* mean anomaly (deg) */ - double n; /* mean motion (rev/day) */ - int rev; /* revolution number at epoch */ +typedef struct +{ /* norad two line element data type */ + char name[32]; /* common name */ + char alias[32]; /* alias name */ + char satno[16]; /* satellite catalog number */ + char satclass; /* classification */ + char desig[16]; /* international designator */ + gtime_t epoch; /* element set epoch (UTC) */ + double ndot; /* 1st derivative of mean motion */ + double nddot; /* 2st derivative of mean motion */ + double bstar; /* B* drag term */ + int etype; /* element set type */ + int eleno; /* element number */ + double inc; /* orbit inclination (deg) */ + double OMG; /* right ascension of ascending node (deg) */ + double ecc; /* eccentricity */ + double omg; /* argument of perigee (deg) */ + double M; /* mean anomaly (deg) */ + double n; /* mean motion (rev/day) */ + int rev; /* revolution number at epoch */ } tled_t; -typedef struct { /* norad two line element type */ - int n,nmax; /* number/max number of two line element data */ - tled_t *data; /* norad two line element data */ +typedef struct +{ /* norad two line element type */ + int n, nmax; /* number/max number of two line element data */ + tled_t *data; /* norad two line element data */ } tle_t; -typedef struct { /* TEC grid type */ - gtime_t time; /* epoch time (GPST) */ - int ndata[3]; /* TEC grid data size {nlat,nlon,nhgt} */ - double rb; /* earth radius (km) */ - double lats[3]; /* latitude start/interval (deg) */ - double lons[3]; /* longitude start/interval (deg) */ - double hgts[3]; /* heights start/interval (km) */ - double *data; /* TEC grid data (tecu) */ - float *rms; /* RMS values (tecu) */ +typedef struct +{ /* TEC grid type */ + gtime_t time; /* epoch time (GPST) */ + int ndata[3]; /* TEC grid data size {nlat,nlon,nhgt} */ + double rb; /* earth radius (km) */ + double lats[3]; /* latitude start/interval (deg) */ + double lons[3]; /* longitude start/interval (deg) */ + double hgts[3]; /* heights start/interval (km) */ + double *data; /* TEC grid data (tecu) */ + float *rms; /* RMS values (tecu) */ } tec_t; -typedef struct { /* satellite fcb data type */ - gtime_t ts,te; /* start/end time (GPST) */ +typedef struct +{ /* satellite fcb data type */ + gtime_t ts, te; /* start/end time (GPST) */ double bias[MAXSAT][3]; /* fcb value (cyc) */ - double std [MAXSAT][3]; /* fcb std-dev (cyc) */ + double std[MAXSAT][3]; /* fcb std-dev (cyc) */ } fcbd_t; -typedef struct { /* SBAS message type */ - int week,tow; /* receiption time */ - int prn; /* SBAS satellite PRN number */ +typedef struct +{ /* SBAS message type */ + int week, tow; /* receiption time */ + int prn; /* SBAS satellite PRN number */ unsigned char msg[29]; /* SBAS message (226bit) padded by 0 */ } sbsmsg_t; -typedef struct { /* SBAS messages type */ - int n,nmax; /* number of SBAS messages/allocated */ - sbsmsg_t *msgs; /* SBAS messages */ +typedef struct +{ /* SBAS messages type */ + int n, nmax; /* number of SBAS messages/allocated */ + sbsmsg_t *msgs; /* SBAS messages */ } sbs_t; -typedef struct { /* SBAS fast correction type */ - gtime_t t0; /* time of applicability (TOF) */ - double prc; /* pseudorange correction (PRC) (m) */ - double rrc; /* range-rate correction (RRC) (m/s) */ - double dt; /* range-rate correction delta-time (s) */ - int iodf; /* IODF (issue of date fast corr) */ - short udre; /* UDRE+1 */ - short ai; /* degradation factor indicator */ +typedef struct +{ /* SBAS fast correction type */ + gtime_t t0; /* time of applicability (TOF) */ + double prc; /* pseudorange correction (PRC) (m) */ + double rrc; /* range-rate correction (RRC) (m/s) */ + double dt; /* range-rate correction delta-time (s) */ + int iodf; /* IODF (issue of date fast corr) */ + short udre; /* UDRE+1 */ + short ai; /* degradation factor indicator */ } sbsfcorr_t; -typedef struct { /* SBAS long term satellite error correction type */ - gtime_t t0; /* correction time */ - int iode; /* IODE (issue of date ephemeris) */ - double dpos[3]; /* delta position (m) (ecef) */ - double dvel[3]; /* delta velocity (m/s) (ecef) */ - double daf0,daf1; /* delta clock-offset/drift (s,s/s) */ +typedef struct +{ /* SBAS long term satellite error correction type */ + gtime_t t0; /* correction time */ + int iode; /* IODE (issue of date ephemeris) */ + double dpos[3]; /* delta position (m) (ecef) */ + double dvel[3]; /* delta velocity (m/s) (ecef) */ + double daf0, daf1; /* delta clock-offset/drift (s,s/s) */ } sbslcorr_t; -typedef struct { /* SBAS satellite correction type */ - int sat; /* satellite number */ - sbsfcorr_t fcorr; /* fast correction */ - sbslcorr_t lcorr; /* long term correction */ +typedef struct +{ /* SBAS satellite correction type */ + int sat; /* satellite number */ + sbsfcorr_t fcorr; /* fast correction */ + sbslcorr_t lcorr; /* long term correction */ } sbssatp_t; -typedef struct { /* SBAS satellite corrections type */ - int iodp; /* IODP (issue of date mask) */ - int nsat; /* number of satellites */ - int tlat; /* system latency (s) */ +typedef struct +{ /* SBAS satellite corrections type */ + int iodp; /* IODP (issue of date mask) */ + int nsat; /* number of satellites */ + int tlat; /* system latency (s) */ sbssatp_t sat[MAXSAT]; /* satellite correction */ } sbssat_t; -typedef struct { /* SBAS ionospheric correction type */ - gtime_t t0; /* correction time */ - short lat,lon; /* latitude/longitude (deg) */ - short give; /* GIVI+1 */ - float delay; /* vertical delay estimate (m) */ +typedef struct +{ /* SBAS ionospheric correction type */ + gtime_t t0; /* correction time */ + short lat, lon; /* latitude/longitude (deg) */ + short give; /* GIVI+1 */ + float delay; /* vertical delay estimate (m) */ } sbsigp_t; -typedef struct { /* IGP band type */ +typedef struct +{ /* IGP band type */ short x; /* longitude/latitude (deg) */ const short *y; /* latitudes/longitudes (deg) */ unsigned char bits; /* IGP mask start bit */ @@ -627,84 +651,92 @@ typedef struct { /* IGP band type */ } sbsigpband_t; -typedef struct { /* SBAS ionospheric corrections type */ - int iodi; /* IODI (issue of date ionos corr) */ - int nigp; /* number of igps */ +typedef struct +{ /* SBAS ionospheric corrections type */ + int iodi; /* IODI (issue of date ionos corr) */ + int nigp; /* number of igps */ sbsigp_t igp[MAXNIGP]; /* ionospheric correction */ } sbsion_t; -typedef struct { /* DGPS/GNSS correction type */ - gtime_t t0; /* correction time */ - double prc; /* pseudorange correction (PRC) (m) */ - double rrc; /* range rate correction (RRC) (m/s) */ - int iod; /* issue of data (IOD) */ - double udre; /* UDRE */ +typedef struct +{ /* DGPS/GNSS correction type */ + gtime_t t0; /* correction time */ + double prc; /* pseudorange correction (PRC) (m) */ + double rrc; /* range rate correction (RRC) (m/s) */ + int iod; /* issue of data (IOD) */ + double udre; /* UDRE */ } dgps_t; -typedef struct { /* SSR correction type */ - gtime_t t0[6]; /* epoch time (GPST) {eph,clk,hrclk,ura,bias,pbias} */ - double udi[6]; /* SSR update interval (s) */ - int iod[6]; /* iod ssr {eph,clk,hrclk,ura,bias,pbias} */ - int iode; /* issue of data */ - int iodcrc; /* issue of data crc for beidou/sbas */ - int ura; /* URA indicator */ - int refd; /* sat ref datum (0:ITRF,1:regional) */ - double deph [3]; /* delta orbit {radial,along,cross} (m) */ - double ddeph[3]; /* dot delta orbit {radial,along,cross} (m/s) */ - double dclk [3]; /* delta clock {c0,c1,c2} (m,m/s,m/s^2) */ - double hrclk; /* high-rate clock corection (m) */ - float cbias[MAXCODE]; /* code biases (m) */ - double pbias[MAXCODE]; /* phase biases (m) */ - float stdpb[MAXCODE]; /* std-dev of phase biases (m) */ - double yaw_ang,yaw_rate; /* yaw angle and yaw rate (deg,deg/s) */ - unsigned char update; /* update flag (0:no update,1:update) */ +typedef struct +{ /* SSR correction type */ + gtime_t t0[6]; /* epoch time (GPST) {eph,clk,hrclk,ura,bias,pbias} */ + double udi[6]; /* SSR update interval (s) */ + int iod[6]; /* iod ssr {eph,clk,hrclk,ura,bias,pbias} */ + int iode; /* issue of data */ + int iodcrc; /* issue of data crc for beidou/sbas */ + int ura; /* URA indicator */ + int refd; /* sat ref datum (0:ITRF,1:regional) */ + double deph[3]; /* delta orbit {radial,along,cross} (m) */ + double ddeph[3]; /* dot delta orbit {radial,along,cross} (m/s) */ + double dclk[3]; /* delta clock {c0,c1,c2} (m,m/s,m/s^2) */ + double hrclk; /* high-rate clock corection (m) */ + float cbias[MAXCODE]; /* code biases (m) */ + double pbias[MAXCODE]; /* phase biases (m) */ + float stdpb[MAXCODE]; /* std-dev of phase biases (m) */ + double yaw_ang, yaw_rate; /* yaw angle and yaw rate (deg,deg/s) */ + unsigned char update; /* update flag (0:no update,1:update) */ } ssr_t; -typedef struct { /* QZSS LEX message type */ - int prn; /* satellite PRN number */ - int type; /* message type */ - int alert; /* alert flag */ - unsigned char stat; /* signal tracking status */ - unsigned char snr; /* signal C/N0 (0.25 dBHz) */ - unsigned int ttt; /* tracking time (ms) */ +typedef struct +{ /* QZSS LEX message type */ + int prn; /* satellite PRN number */ + int type; /* message type */ + int alert; /* alert flag */ + unsigned char stat; /* signal tracking status */ + unsigned char snr; /* signal C/N0 (0.25 dBHz) */ + unsigned int ttt; /* tracking time (ms) */ unsigned char msg[212]; /* LEX message data part 1695 bits */ } lexmsg_t; -typedef struct { /* QZSS LEX messages type */ - int n,nmax; /* number of LEX messages and allocated */ - lexmsg_t *msgs; /* LEX messages */ +typedef struct +{ /* QZSS LEX messages type */ + int n, nmax; /* number of LEX messages and allocated */ + lexmsg_t *msgs; /* LEX messages */ } lex_t; -typedef struct { /* QZSS LEX ephemeris type */ - gtime_t toe; /* epoch time (GPST) */ - gtime_t tof; /* message frame time (GPST) */ - int sat; /* satellite number */ +typedef struct +{ /* QZSS LEX ephemeris type */ + gtime_t toe; /* epoch time (GPST) */ + gtime_t tof; /* message frame time (GPST) */ + int sat; /* satellite number */ unsigned char health; /* signal health (L1,L2,L1C,L5,LEX) */ - unsigned char ura; /* URA index */ - double pos[3]; /* satellite position (m) */ - double vel[3]; /* satellite velocity (m/s) */ - double acc[3]; /* satellite acceleration (m/s2) */ - double jerk[3]; /* satellite jerk (m/s3) */ - double af0,af1; /* satellite clock bias and drift (s,s/s) */ - double tgd; /* TGD */ - double isc[8]; /* ISC */ + unsigned char ura; /* URA index */ + double pos[3]; /* satellite position (m) */ + double vel[3]; /* satellite velocity (m/s) */ + double acc[3]; /* satellite acceleration (m/s2) */ + double jerk[3]; /* satellite jerk (m/s3) */ + double af0, af1; /* satellite clock bias and drift (s,s/s) */ + double tgd; /* TGD */ + double isc[8]; /* ISC */ } lexeph_t; -typedef struct { /* QZSS LEX ionosphere correction type */ - gtime_t t0; /* epoch time (GPST) */ - double tspan; /* valid time span (s) */ - double pos0[2]; /* reference position {lat,lon} (rad) */ - double coef[3][2]; /* coefficients lat x lon (3 x 2) */ +typedef struct +{ /* QZSS LEX ionosphere correction type */ + gtime_t t0; /* epoch time (GPST) */ + double tspan; /* valid time span (s) */ + double pos0[2]; /* reference position {lat,lon} (rad) */ + double coef[3][2]; /* coefficients lat x lon (3 x 2) */ } lexion_t; -typedef struct { /* stec data type */ +typedef struct +{ /* stec data type */ gtime_t time; /* time (GPST) */ unsigned char sat; /* satellite number */ double ion; /* slant ionos delay (m) */ @@ -714,94 +746,99 @@ typedef struct { /* stec data type */ } stec_t; -typedef struct { /* trop data type */ - gtime_t time; /* time (GPST) */ - double trp[3]; /* zenith tropos delay/gradient (m) */ - float std[3]; /* std-dev (m) */ +typedef struct +{ /* trop data type */ + gtime_t time; /* time (GPST) */ + double trp[3]; /* zenith tropos delay/gradient (m) */ + float std[3]; /* std-dev (m) */ } trop_t; -typedef struct { /* ppp corrections type */ - int nsta; /* number of stations */ - char stas[MAXSTA][8]; /* station names */ - double rr[MAXSTA][3]; /* station ecef positions (m) */ - int ns[MAXSTA],nsmax[MAXSTA]; /* number of stec data */ - int nt[MAXSTA],ntmax[MAXSTA]; /* number of trop data */ - stec_t *stec[MAXSTA]; /* stec data */ - trop_t *trop[MAXSTA]; /* trop data */ +typedef struct +{ /* ppp corrections type */ + int nsta; /* number of stations */ + char stas[MAXSTA][8]; /* station names */ + double rr[MAXSTA][3]; /* station ecef positions (m) */ + int ns[MAXSTA], nsmax[MAXSTA]; /* number of stec data */ + int nt[MAXSTA], ntmax[MAXSTA]; /* number of trop data */ + stec_t *stec[MAXSTA]; /* stec data */ + trop_t *trop[MAXSTA]; /* trop data */ } pppcorr_t; -typedef struct { /* navigation data type */ - int n,nmax; /* number of broadcast ephemeris */ - int ng,ngmax; /* number of glonass ephemeris */ - int ns,nsmax; /* number of sbas ephemeris */ - int ne,nemax; /* number of precise ephemeris */ - int nc,ncmax; /* number of precise clock */ - int na,namax; /* number of almanac data */ - int nt,ntmax; /* number of tec grid data */ - int nf,nfmax; /* number of satellite fcb data */ - eph_t *eph; /* GPS/QZS/GAL ephemeris */ - geph_t *geph; /* GLONASS ephemeris */ - seph_t *seph; /* SBAS ephemeris */ - peph_t *peph; /* precise ephemeris */ - pclk_t *pclk; /* precise clock */ - alm_t *alm; /* almanac data */ - tec_t *tec; /* tec grid data */ - fcbd_t *fcb; /* satellite fcb data */ - erp_t erp; /* earth rotation parameters */ - double utc_gps[4]; /* GPS delta-UTC parameters {A0,A1,T,W} */ - double utc_glo[4]; /* GLONASS UTC GPS time parameters */ - double utc_gal[4]; /* Galileo UTC GPS time parameters */ - double utc_qzs[4]; /* QZS UTC GPS time parameters */ - double utc_cmp[4]; /* BeiDou UTC parameters */ - double utc_irn[4]; /* IRNSS UTC parameters */ - double utc_sbs[4]; /* SBAS UTC parameters */ - double ion_gps[8]; /* GPS iono model parameters {a0,a1,a2,a3,b0,b1,b2,b3} */ - double ion_gal[4]; /* Galileo iono model parameters {ai0,ai1,ai2,0} */ - double ion_qzs[8]; /* QZSS iono model parameters {a0,a1,a2,a3,b0,b1,b2,b3} */ - double ion_cmp[8]; /* BeiDou iono model parameters {a0,a1,a2,a3,b0,b1,b2,b3} */ - double ion_irn[8]; /* IRNSS iono model parameters {a0,a1,a2,a3,b0,b1,b2,b3} */ - int leaps; /* leap seconds (s) */ - double lam[MAXSAT][NFREQ]; /* carrier wave lengths (m) */ - double cbias[MAXSAT][3]; /* satellite dcb (0:p1-p2,1:p1-c1,2:p2-c2) (m) */ - double rbias[MAXRCV][2][3]; /* receiver dcb (0:p1-p2,1:p1-c1,2:p2-c2) (m) */ - double wlbias[MAXSAT]; /* wide-lane bias (cycle) */ - double glo_cpbias[4]; /* glonass code-phase bias {1C,1P,2C,2P} (m) */ - char glo_fcn[MAXPRNGLO+1]; /* glonass frequency channel number + 8 */ - pcv_t pcvs[MAXSAT]; /* satellite antenna pcv */ - sbssat_t sbssat; /* SBAS satellite corrections */ - sbsion_t sbsion[MAXBAND+1]; /* SBAS ionosphere corrections */ - dgps_t dgps[MAXSAT]; /* DGPS corrections */ - ssr_t ssr[MAXSAT]; /* SSR corrections */ - lexeph_t lexeph[MAXSAT]; /* LEX ephemeris */ - lexion_t lexion; /* LEX ionosphere correction */ - pppcorr_t pppcorr; /* ppp corrections */ +typedef struct +{ /* navigation data type */ + int n, nmax; /* number of broadcast ephemeris */ + int ng, ngmax; /* number of glonass ephemeris */ + int ns, nsmax; /* number of sbas ephemeris */ + int ne, nemax; /* number of precise ephemeris */ + int nc, ncmax; /* number of precise clock */ + int na, namax; /* number of almanac data */ + int nt, ntmax; /* number of tec grid data */ + int nf, nfmax; /* number of satellite fcb data */ + eph_t *eph; /* GPS/QZS/GAL ephemeris */ + geph_t *geph; /* GLONASS ephemeris */ + seph_t *seph; /* SBAS ephemeris */ + peph_t *peph; /* precise ephemeris */ + pclk_t *pclk; /* precise clock */ + alm_t *alm; /* almanac data */ + tec_t *tec; /* tec grid data */ + fcbd_t *fcb; /* satellite fcb data */ + erp_t erp; /* earth rotation parameters */ + double utc_gps[4]; /* GPS delta-UTC parameters {A0,A1,T,W} */ + double utc_glo[4]; /* GLONASS UTC GPS time parameters */ + double utc_gal[4]; /* Galileo UTC GPS time parameters */ + double utc_qzs[4]; /* QZS UTC GPS time parameters */ + double utc_cmp[4]; /* BeiDou UTC parameters */ + double utc_irn[4]; /* IRNSS UTC parameters */ + double utc_sbs[4]; /* SBAS UTC parameters */ + double ion_gps[8]; /* GPS iono model parameters {a0,a1,a2,a3,b0,b1,b2,b3} */ + double ion_gal[4]; /* Galileo iono model parameters {ai0,ai1,ai2,0} */ + double ion_qzs[8]; /* QZSS iono model parameters {a0,a1,a2,a3,b0,b1,b2,b3} */ + double ion_cmp[8]; /* BeiDou iono model parameters {a0,a1,a2,a3,b0,b1,b2,b3} */ + double ion_irn[8]; /* IRNSS iono model parameters {a0,a1,a2,a3,b0,b1,b2,b3} */ + int leaps; /* leap seconds (s) */ + double lam[MAXSAT][NFREQ]; /* carrier wave lengths (m) */ + double cbias[MAXSAT][3]; /* satellite dcb (0:p1-p2,1:p1-c1,2:p2-c2) (m) */ + double rbias[MAXRCV][2][3]; /* receiver dcb (0:p1-p2,1:p1-c1,2:p2-c2) (m) */ + double wlbias[MAXSAT]; /* wide-lane bias (cycle) */ + double glo_cpbias[4]; /* glonass code-phase bias {1C,1P,2C,2P} (m) */ + char glo_fcn[MAXPRNGLO + 1]; /* glonass frequency channel number + 8 */ + pcv_t pcvs[MAXSAT]; /* satellite antenna pcv */ + sbssat_t sbssat; /* SBAS satellite corrections */ + sbsion_t sbsion[MAXBAND + 1]; /* SBAS ionosphere corrections */ + dgps_t dgps[MAXSAT]; /* DGPS corrections */ + ssr_t ssr[MAXSAT]; /* SSR corrections */ + lexeph_t lexeph[MAXSAT]; /* LEX ephemeris */ + lexion_t lexion; /* LEX ionosphere correction */ + pppcorr_t pppcorr; /* ppp corrections */ } nav_t; -typedef struct { /* station parameter type */ - char name [MAXANT]; /* marker name */ - char marker [MAXANT]; /* marker number */ - char antdes [MAXANT]; /* antenna descriptor */ - char antsno [MAXANT]; /* antenna serial number */ +typedef struct +{ /* station parameter type */ + char name[MAXANT]; /* marker name */ + char marker[MAXANT]; /* marker number */ + char antdes[MAXANT]; /* antenna descriptor */ + char antsno[MAXANT]; /* antenna serial number */ char rectype[MAXANT]; /* receiver type descriptor */ - char recver [MAXANT]; /* receiver firmware version */ - char recsno [MAXANT]; /* receiver serial number */ - int antsetup; /* antenna setup id */ - int itrf; /* ITRF realization year */ - int deltype; /* antenna delta type (0:enu,1:xyz) */ - double pos[3]; /* station position (ecef) (m) */ - double del[3]; /* antenna position delta (e/n/u or x/y/z) (m) */ - double hgt; /* antenna height (m) */ + char recver[MAXANT]; /* receiver firmware version */ + char recsno[MAXANT]; /* receiver serial number */ + int antsetup; /* antenna setup id */ + int itrf; /* ITRF realization year */ + int deltype; /* antenna delta type (0:enu,1:xyz) */ + double pos[3]; /* station position (ecef) (m) */ + double del[3]; /* antenna position delta (e/n/u or x/y/z) (m) */ + double hgt; /* antenna height (m) */ } sta_t; -typedef struct { /* solution type */ +typedef struct +{ /* solution type */ gtime_t time; /* time (GPST) */ double rr[6]; /* position/velocity (m|m/s) */ /* {x,y,z,vx,vy,vz} or {e,n,u,ve,vn,vu} */ - float qr[6]; /* position variance/covariance (m^2) */ + float qr[6]; /* position variance/covariance (m^2) */ /* {c_xx,c_yy,c_zz,c_xy,c_yz,c_zx} or */ /* {c_ee,c_nn,c_uu,c_en,c_nu,c_ue} */ double dtr[6]; /* receiver clock bias to time systems (s) */ @@ -814,27 +851,29 @@ typedef struct { /* solution type */ } sol_t; -typedef struct { /* solution buffer type */ - int n,nmax; /* number of solution/max number of buffer */ - int cyclic; /* cyclic buffer flag */ - int start,end; /* start/end index */ - gtime_t time; /* current solution time */ - sol_t *data; /* solution data */ - double rb[3]; /* reference position {x,y,z} (ecef) (m) */ - unsigned char buff[MAXSOLMSG+1]; /* message buffer */ - int nb; /* number of byte in message buffer */ +typedef struct +{ /* solution buffer type */ + int n, nmax; /* number of solution/max number of buffer */ + int cyclic; /* cyclic buffer flag */ + int start, end; /* start/end index */ + gtime_t time; /* current solution time */ + sol_t *data; /* solution data */ + double rb[3]; /* reference position {x,y,z} (ecef) (m) */ + unsigned char buff[MAXSOLMSG + 1]; /* message buffer */ + int nb; /* number of byte in message buffer */ } solbuf_t; -typedef struct { /* solution status type */ - gtime_t time; /* time (GPST) */ - unsigned char sat; /* satellite number */ - unsigned char frq; /* frequency (1:L1,2:L2,...) */ - float az,el; /* azimuth/elevation angle (rad) */ - float resp; /* pseudorange residual (m) */ - float resc; /* carrier-phase residual (m) */ - unsigned char flag; /* flags: (vsat<<5)+(slip<<3)+fix */ - unsigned char snr; /* signal strength (0.25 dBHz) */ +typedef struct +{ /* solution status type */ + gtime_t time; /* time (GPST) */ + unsigned char sat; /* satellite number */ + unsigned char frq; /* frequency (1:L1,2:L2,...) */ + float az, el; /* azimuth/elevation angle (rad) */ + float resp; /* pseudorange residual (m) */ + float resc; /* carrier-phase residual (m) */ + unsigned char flag; /* flags: (vsat<<5)+(slip<<3)+fix */ + unsigned char snr; /* signal strength (0.25 dBHz) */ unsigned short lock; /* lock counter */ unsigned short outc; /* outage counter */ unsigned short slipc; /* slip counter */ @@ -842,139 +881,147 @@ typedef struct { /* solution status type */ } solstat_t; -typedef struct { /* solution status buffer type */ - int n,nmax; /* number of solution/max number of buffer */ - solstat_t *data; /* solution status data */ +typedef struct +{ /* solution status buffer type */ + int n, nmax; /* number of solution/max number of buffer */ + solstat_t *data; /* solution status data */ } solstatbuf_t; -typedef struct { /* RTCM control struct type */ - int staid; /* station id */ - int stah; /* station health */ - int seqno; /* sequence number for rtcm 2 or iods msm */ - int outtype; /* output message type */ - gtime_t time; /* message time */ - gtime_t time_s; /* message start time */ - obs_t obs; /* observation data (uncorrected) */ - nav_t nav; /* satellite ephemerides */ - sta_t sta; /* station parameters */ - dgps_t *dgps; /* output of dgps corrections */ - ssr_t ssr[MAXSAT]; /* output of ssr corrections */ - char msg[128]; /* special message */ - char msgtype[256]; /* last message type */ - char msmtype[6][128]; /* msm signal types */ - int obsflag; /* obs data complete flag (1:ok,0:not complete) */ - int ephsat; /* update satellite of ephemeris */ - double cp[MAXSAT][NFREQ+NEXOBS]; /* carrier-phase measurement */ - unsigned short lock[MAXSAT][NFREQ+NEXOBS]; /* lock time */ - unsigned short loss[MAXSAT][NFREQ+NEXOBS]; /* loss of lock count */ - gtime_t lltime[MAXSAT][NFREQ+NEXOBS]; /* last lock time */ - int nbyte; /* number of bytes in message buffer */ - int nbit; /* number of bits in word buffer */ - int len; /* message length (bytes) */ - unsigned char buff[1200]; /* message buffer */ - unsigned int word; /* word buffer for rtcm 2 */ - unsigned int nmsg2[100]; /* message count of RTCM 2 (1-99:1-99,0:other) */ - unsigned int nmsg3[400]; /* message count of RTCM 3 (1-299:1001-1299,300-399:2000-2099,0:ohter) */ - char opt[256]; /* RTCM dependent options */ +typedef struct +{ /* RTCM control struct type */ + int staid; /* station id */ + int stah; /* station health */ + int seqno; /* sequence number for rtcm 2 or iods msm */ + int outtype; /* output message type */ + gtime_t time; /* message time */ + gtime_t time_s; /* message start time */ + obs_t obs; /* observation data (uncorrected) */ + nav_t nav; /* satellite ephemerides */ + sta_t sta; /* station parameters */ + dgps_t *dgps; /* output of dgps corrections */ + ssr_t ssr[MAXSAT]; /* output of ssr corrections */ + char msg[128]; /* special message */ + char msgtype[256]; /* last message type */ + char msmtype[6][128]; /* msm signal types */ + int obsflag; /* obs data complete flag (1:ok,0:not complete) */ + int ephsat; /* update satellite of ephemeris */ + double cp[MAXSAT][NFREQ + NEXOBS]; /* carrier-phase measurement */ + unsigned short lock[MAXSAT][NFREQ + NEXOBS]; /* lock time */ + unsigned short loss[MAXSAT][NFREQ + NEXOBS]; /* loss of lock count */ + gtime_t lltime[MAXSAT][NFREQ + NEXOBS]; /* last lock time */ + int nbyte; /* number of bytes in message buffer */ + int nbit; /* number of bits in word buffer */ + int len; /* message length (bytes) */ + unsigned char buff[1200]; /* message buffer */ + unsigned int word; /* word buffer for rtcm 2 */ + unsigned int nmsg2[100]; /* message count of RTCM 2 (1-99:1-99,0:other) */ + unsigned int nmsg3[400]; /* message count of RTCM 3 (1-299:1001-1299,300-399:2000-2099,0:ohter) */ + char opt[256]; /* RTCM dependent options */ } rtcm_t; -typedef struct { /* download url type */ - char type[32]; /* data type */ - char path[1024]; /* url path */ - char dir [1024]; /* local directory */ - double tint; /* time interval (s) */ +typedef struct +{ /* download url type */ + char type[32]; /* data type */ + char path[1024]; /* url path */ + char dir[1024]; /* local directory */ + double tint; /* time interval (s) */ } url_t; -typedef struct { /* option type */ - const char *name; /* option name */ - int format; /* option format (0:int,1:double,2:string,3:enum) */ - void *var; /* pointer to option variable */ +typedef struct +{ /* option type */ + const char *name; /* option name */ + int format; /* option format (0:int,1:double,2:string,3:enum) */ + void *var; /* pointer to option variable */ const char *comment; /* option comment/enum labels/unit */ } opt_t; -typedef struct { /* extended receiver error model */ - int ena[4]; /* model enabled */ - double cerr[4][NFREQ*2]; /* code errors (m) */ - double perr[4][NFREQ*2]; /* carrier-phase errors (m) */ - double gpsglob[NFREQ]; /* gps-glonass h/w bias (m) */ - double gloicb [NFREQ]; /* glonass interchannel bias (m/fn) */ +typedef struct +{ /* extended receiver error model */ + int ena[4]; /* model enabled */ + double cerr[4][NFREQ * 2]; /* code errors (m) */ + double perr[4][NFREQ * 2]; /* carrier-phase errors (m) */ + double gpsglob[NFREQ]; /* gps-glonass h/w bias (m) */ + double gloicb[NFREQ]; /* glonass interchannel bias (m/fn) */ } exterr_t; -typedef struct { /* SNR mask type */ - int ena[2]; /* enable flag {rover,base} */ +typedef struct +{ /* SNR mask type */ + int ena[2]; /* enable flag {rover,base} */ double mask[NFREQ][9]; /* mask (dBHz) at 5,10,...85 deg */ } snrmask_t; -typedef struct { /* processing options type */ - int mode; /* positioning mode (PMODE_???) */ - int soltype; /* solution type (0:forward,1:backward,2:combined) */ - int nf; /* number of frequencies (1:L1,2:L1+L2,3:L1+L2+L5) */ - int navsys; /* navigation system */ - double elmin; /* elevation mask angle (rad) */ - snrmask_t snrmask; /* SNR mask */ - int sateph; /* satellite ephemeris/clock (EPHOPT_???) */ - int modear; /* AR mode (0:off,1:continuous,2:instantaneous,3:fix and hold,4:ppp-ar) */ - int glomodear; /* GLONASS AR mode (0:off,1:on,2:auto cal,3:ext cal) */ - int bdsmodear; /* BeiDou AR mode (0:off,1:on) */ - int maxout; /* obs outage count to reset bias */ - int minlock; /* min lock count to fix ambiguity */ - int minfix; /* min fix count to hold ambiguity */ - int armaxiter; /* max iteration to resolve ambiguity */ - int ionoopt; /* ionosphere option (IONOOPT_???) */ - int tropopt; /* troposphere option (TROPOPT_???) */ - int dynamics; /* dynamics model (0:none,1:velociy,2:accel) */ - int tidecorr; /* earth tide correction (0:off,1:solid,2:solid+otl+pole) */ - int niter; /* number of filter iteration */ - int codesmooth; /* code smoothing window size (0:none) */ - int intpref; /* interpolate reference obs (for post mission) */ - int sbascorr; /* SBAS correction options */ - int sbassatsel; /* SBAS satellite selection (0:all) */ - int rovpos; /* rover position for fixed mode */ - int refpos; /* base position for relative mode */ - /* (0:pos in prcopt, 1:average of single pos, */ - /* 2:read from file, 3:rinex header, 4:rtcm pos) */ - double eratio[NFREQ]; /* code/phase error ratio */ - double err[5]; /* measurement error factor */ - /* [0]:reserved */ - /* [1-3]:error factor a/b/c of phase (m) */ - /* [4]:doppler frequency (hz) */ - double std[3]; /* initial-state std [0]bias,[1]iono [2]trop */ - double prn[6]; /* process-noise std [0]bias,[1]iono [2]trop [3]acch [4]accv [5] pos */ - double sclkstab; /* satellite clock stability (sec/sec) */ - double thresar[8]; /* AR validation threshold */ - double elmaskar; /* elevation mask of AR for rising satellite (deg) */ - double elmaskhold; /* elevation mask to hold ambiguity (deg) */ - double thresslip; /* slip threshold of geometry-free phase (m) */ - double maxtdiff; /* max difference of time (sec) */ - double maxinno; /* reject threshold of innovation (m) */ - double maxgdop; /* reject threshold of gdop */ - double baseline[2]; /* baseline length constraint {const,sigma} (m) */ - double ru[3]; /* rover position for fixed mode {x,y,z} (ecef) (m) */ - double rb[3]; /* base position for relative mode {x,y,z} (ecef) (m) */ - char anttype[2][MAXANT]; /* antenna types {rover,base} */ - double antdel[2][3]; /* antenna delta {{rov_e,rov_n,rov_u},{ref_e,ref_n,ref_u}} */ - pcv_t pcvr[2]; /* receiver antenna parameters {rov,base} */ +typedef struct +{ /* processing options type */ + int mode; /* positioning mode (PMODE_???) */ + int soltype; /* solution type (0:forward,1:backward,2:combined) */ + int nf; /* number of frequencies (1:L1,2:L1+L2,3:L1+L2+L5) */ + int navsys; /* navigation system */ + double elmin; /* elevation mask angle (rad) */ + snrmask_t snrmask; /* SNR mask */ + int sateph; /* satellite ephemeris/clock (EPHOPT_???) */ + int modear; /* AR mode (0:off,1:continuous,2:instantaneous,3:fix and hold,4:ppp-ar) */ + int glomodear; /* GLONASS AR mode (0:off,1:on,2:auto cal,3:ext cal) */ + int bdsmodear; /* BeiDou AR mode (0:off,1:on) */ + int maxout; /* obs outage count to reset bias */ + int minlock; /* min lock count to fix ambiguity */ + int minfix; /* min fix count to hold ambiguity */ + int armaxiter; /* max iteration to resolve ambiguity */ + int ionoopt; /* ionosphere option (IONOOPT_???) */ + int tropopt; /* troposphere option (TROPOPT_???) */ + int dynamics; /* dynamics model (0:none,1:velociy,2:accel) */ + int tidecorr; /* earth tide correction (0:off,1:solid,2:solid+otl+pole) */ + int niter; /* number of filter iteration */ + int codesmooth; /* code smoothing window size (0:none) */ + int intpref; /* interpolate reference obs (for post mission) */ + int sbascorr; /* SBAS correction options */ + int sbassatsel; /* SBAS satellite selection (0:all) */ + int rovpos; /* rover position for fixed mode */ + int refpos; /* base position for relative mode */ + /* (0:pos in prcopt, 1:average of single pos, */ + /* 2:read from file, 3:rinex header, 4:rtcm pos) */ + double eratio[NFREQ]; /* code/phase error ratio */ + double err[5]; /* measurement error factor */ + /* [0]:reserved */ + /* [1-3]:error factor a/b/c of phase (m) */ + /* [4]:doppler frequency (hz) */ + double std[3]; /* initial-state std [0]bias,[1]iono [2]trop */ + double prn[6]; /* process-noise std [0]bias,[1]iono [2]trop [3]acch [4]accv [5] pos */ + double sclkstab; /* satellite clock stability (sec/sec) */ + double thresar[8]; /* AR validation threshold */ + double elmaskar; /* elevation mask of AR for rising satellite (deg) */ + double elmaskhold; /* elevation mask to hold ambiguity (deg) */ + double thresslip; /* slip threshold of geometry-free phase (m) */ + double maxtdiff; /* max difference of time (sec) */ + double maxinno; /* reject threshold of innovation (m) */ + double maxgdop; /* reject threshold of gdop */ + double baseline[2]; /* baseline length constraint {const,sigma} (m) */ + double ru[3]; /* rover position for fixed mode {x,y,z} (ecef) (m) */ + double rb[3]; /* base position for relative mode {x,y,z} (ecef) (m) */ + char anttype[2][MAXANT]; /* antenna types {rover,base} */ + double antdel[2][3]; /* antenna delta {{rov_e,rov_n,rov_u},{ref_e,ref_n,ref_u}} */ + pcv_t pcvr[2]; /* receiver antenna parameters {rov,base} */ unsigned char exsats[MAXSAT]; /* excluded satellites (1:excluded,2:included) */ - int maxaveep; /* max averaging epoches */ - int initrst; /* initialize by restart */ - int outsingle; /* output single by dgps/float/fix/ppp outage */ - char rnxopt[2][256]; /* rinex options {rover,base} */ - int posopt[6]; /* positioning options */ - int syncsol; /* solution sync mode (0:off,1:on) */ - double odisp[2][6*11]; /* ocean tide loading parameters {rov,base} */ - exterr_t exterr; /* extended receiver error model */ - int freqopt; /* disable L2-AR */ - char pppopt[256]; /* ppp option */ + int maxaveep; /* max averaging epoches */ + int initrst; /* initialize by restart */ + int outsingle; /* output single by dgps/float/fix/ppp outage */ + char rnxopt[2][256]; /* rinex options {rover,base} */ + int posopt[6]; /* positioning options */ + int syncsol; /* solution sync mode (0:off,1:on) */ + double odisp[2][6 * 11]; /* ocean tide loading parameters {rov,base} */ + exterr_t exterr; /* extended receiver error model */ + int freqopt; /* disable L2-AR */ + char pppopt[256]; /* ppp option */ } prcopt_t; -typedef struct { /* solution options type */ +typedef struct +{ /* solution options type */ int posf; /* solution format (SOLF_???) */ int times; /* time system (TIMES_???) */ int timef; /* time format (0:sssss.s,1:yyyy/mm/dd hh:mm:ss.s) */ @@ -996,280 +1043,293 @@ typedef struct { /* solution options type */ } solopt_t; -typedef struct { /* satellite status type */ - unsigned char sys; /* navigation system */ - unsigned char vs; /* valid satellite flag single */ - double azel[2]; /* azimuth/elevation angles {az,el} (rad) */ - double resp[NFREQ]; /* residuals of pseudorange (m) */ - double resc[NFREQ]; /* residuals of carrier-phase (m) */ +typedef struct +{ /* satellite status type */ + unsigned char sys; /* navigation system */ + unsigned char vs; /* valid satellite flag single */ + double azel[2]; /* azimuth/elevation angles {az,el} (rad) */ + double resp[NFREQ]; /* residuals of pseudorange (m) */ + double resc[NFREQ]; /* residuals of carrier-phase (m) */ unsigned char vsat[NFREQ]; /* valid satellite flag */ - unsigned char snr [NFREQ]; /* signal strength (0.25 dBHz) */ - unsigned char fix [NFREQ]; /* ambiguity fix flag (1:fix,2:float,3:hold) */ + unsigned char snr[NFREQ]; /* signal strength (0.25 dBHz) */ + unsigned char fix[NFREQ]; /* ambiguity fix flag (1:fix,2:float,3:hold) */ unsigned char slip[NFREQ]; /* cycle-slip flag */ unsigned char half[NFREQ]; /* half-cycle valid flag */ - int lock [NFREQ]; /* lock counter of phase */ - unsigned int outc [NFREQ]; /* obs outage counter of phase */ + int lock[NFREQ]; /* lock counter of phase */ + unsigned int outc[NFREQ]; /* obs outage counter of phase */ unsigned int slipc[NFREQ]; /* cycle-slip counter */ - unsigned int rejc [NFREQ]; /* reject counter */ - double gf; /* geometry-free phase L1-L2 (m) */ - double gf2; /* geometry-free phase L1-L5 (m) */ - double mw; /* MW-LC (m) */ - double phw; /* phase windup (cycle) */ - gtime_t pt[2][NFREQ]; /* previous carrier-phase time */ - double ph[2][NFREQ]; /* previous carrier-phase observable (cycle) */ + unsigned int rejc[NFREQ]; /* reject counter */ + double gf; /* geometry-free phase L1-L2 (m) */ + double gf2; /* geometry-free phase L1-L5 (m) */ + double mw; /* MW-LC (m) */ + double phw; /* phase windup (cycle) */ + gtime_t pt[2][NFREQ]; /* previous carrier-phase time */ + double ph[2][NFREQ]; /* previous carrier-phase observable (cycle) */ } ssat_t; -typedef struct { /* ambiguity control type */ +typedef struct +{ /* ambiguity control type */ gtime_t epoch[4]; /* last epoch */ int n[4]; /* number of epochs */ - double LC [4]; /* linear combination average */ + double LC[4]; /* linear combination average */ double LCv[4]; /* linear combination variance */ int fixcnt; /* fix count */ char flags[MAXSAT]; /* fix flags */ } ambc_t; -typedef struct { /* RTK control/result type */ - sol_t sol; /* RTK solution */ - double rb[6]; /* base position/velocity (ecef) (m|m/s) */ - int nx,na; /* number of float states/fixed states */ - double tt; /* time difference between current and previous (s) */ - double *x, *P; /* float states and their covariance */ - double *xa,*Pa; /* fixed states and their covariance */ - int nfix; /* number of continuous fixes of ambiguity */ - ambc_t ambc[MAXSAT]; /* ambiguity control */ - ssat_t ssat[MAXSAT]; /* satellite status */ - int neb; /* bytes in error message buffer */ +typedef struct +{ /* RTK control/result type */ + sol_t sol; /* RTK solution */ + double rb[6]; /* base position/velocity (ecef) (m|m/s) */ + int nx, na; /* number of float states/fixed states */ + double tt; /* time difference between current and previous (s) */ + double *x, *P; /* float states and their covariance */ + double *xa, *Pa; /* fixed states and their covariance */ + int nfix; /* number of continuous fixes of ambiguity */ + ambc_t ambc[MAXSAT]; /* ambiguity control */ + ssat_t ssat[MAXSAT]; /* satellite status */ + int neb; /* bytes in error message buffer */ char errbuf[MAXERRMSG]; /* error message buffer */ - prcopt_t opt; /* processing options */ + prcopt_t opt; /* processing options */ } rtk_t; -typedef struct half_cyc_tag { /* half-cycle correction list type */ - unsigned char sat; /* satellite number */ - unsigned char freq; /* frequency number (0:L1,1:L2,2:L5) */ - unsigned char valid; /* half-cycle valid flag */ - char corr; /* half-cycle corrected (x 0.5 cyc) */ - gtime_t ts,te; /* time start, time end */ +typedef struct half_cyc_tag +{ /* half-cycle correction list type */ + unsigned char sat; /* satellite number */ + unsigned char freq; /* frequency number (0:L1,1:L2,2:L5) */ + unsigned char valid; /* half-cycle valid flag */ + char corr; /* half-cycle corrected (x 0.5 cyc) */ + gtime_t ts, te; /* time start, time end */ struct half_cyc_tag *next; /* pointer to next correction */ } half_cyc_t; -typedef struct { /* stream type */ - int type; /* type (STR_???) */ - int mode; /* mode (STR_MODE_?) */ - int state; /* state (-1:error,0:close,1:open) */ - unsigned int inb,inr; /* input bytes/rate */ - unsigned int outb,outr; /* output bytes/rate */ - unsigned int tick,tact; /* tick/active tick */ - unsigned int inbt,outbt; /* input/output bytes at tick */ - lock_t lock; /* lock flag */ - void *port; /* type dependent port control struct */ - char path[MAXSTRPATH]; /* stream path */ - char msg [MAXSTRMSG]; /* stream message */ +typedef struct +{ /* stream type */ + int type; /* type (STR_???) */ + int mode; /* mode (STR_MODE_?) */ + int state; /* state (-1:error,0:close,1:open) */ + unsigned int inb, inr; /* input bytes/rate */ + unsigned int outb, outr; /* output bytes/rate */ + unsigned int tick, tact; /* tick/active tick */ + unsigned int inbt, outbt; /* input/output bytes at tick */ + lock_t lock; /* lock flag */ + void *port; /* type dependent port control struct */ + char path[MAXSTRPATH]; /* stream path */ + char msg[MAXSTRMSG]; /* stream message */ } stream_t; -typedef struct { /* serial control type */ - dev_t dev; /* serial device */ - int error; /* error state */ +typedef struct +{ /* serial control type */ + dev_t dev; /* serial device */ + int error; /* error state */ } serial_t; -typedef struct { /* file control type */ - FILE *fp; /* file pointer */ - FILE *fp_tag; /* file pointer of tag file */ - FILE *fp_tmp; /* temporary file pointer for swap */ - FILE *fp_tag_tmp; /* temporary file pointer of tag file for swap */ - char path[MAXSTRPATH]; /* file path */ +typedef struct +{ /* file control type */ + FILE *fp; /* file pointer */ + FILE *fp_tag; /* file pointer of tag file */ + FILE *fp_tmp; /* temporary file pointer for swap */ + FILE *fp_tag_tmp; /* temporary file pointer of tag file for swap */ + char path[MAXSTRPATH]; /* file path */ char openpath[MAXSTRPATH]; /* open file path */ - int mode; /* file mode */ - int timetag; /* time tag flag (0:off,1:on) */ - int repmode; /* replay mode (0:master,1:slave) */ - int offset; /* time offset (ms) for slave */ - gtime_t time; /* start time */ - gtime_t wtime; /* write time */ - unsigned int tick; /* start tick */ - unsigned int tick_f; /* start tick in file */ - unsigned int fpos; /* current file position */ - double start; /* start offset (s) */ - double speed; /* replay speed (time factor) */ - double swapintv; /* swap interval (hr) (0: no swap) */ - lock_t lock; /* lock flag */ + int mode; /* file mode */ + int timetag; /* time tag flag (0:off,1:on) */ + int repmode; /* replay mode (0:master,1:slave) */ + int offset; /* time offset (ms) for slave */ + gtime_t time; /* start time */ + gtime_t wtime; /* write time */ + unsigned int tick; /* start tick */ + unsigned int tick_f; /* start tick in file */ + unsigned int fpos; /* current file position */ + double start; /* start offset (s) */ + double speed; /* replay speed (time factor) */ + double swapintv; /* swap interval (hr) (0: no swap) */ + lock_t lock; /* lock flag */ } file_t; -typedef struct { /* tcp control type */ - int state; /* state (0:close,1:wait,2:connect) */ - char saddr[256]; /* address string */ - int port; /* port */ +typedef struct +{ /* tcp control type */ + int state; /* state (0:close,1:wait,2:connect) */ + char saddr[256]; /* address string */ + int port; /* port */ struct sockaddr_in addr; /* address resolved */ - socket_t sock; /* socket descriptor */ - int tcon; /* reconnect time (ms) (-1:never,0:now) */ - unsigned int tact; /* data active tick */ - unsigned int tdis; /* disconnect tick */ + socket_t sock; /* socket descriptor */ + int tcon; /* reconnect time (ms) (-1:never,0:now) */ + unsigned int tact; /* data active tick */ + unsigned int tdis; /* disconnect tick */ } tcp_t; -typedef struct { /* tcp server type */ - tcp_t svr; /* tcp server control */ - tcp_t cli[MAXCLI]; /* tcp client controls */ +typedef struct +{ /* tcp server type */ + tcp_t svr; /* tcp server control */ + tcp_t cli[MAXCLI]; /* tcp client controls */ } tcpsvr_t; -typedef struct { /* tcp cilent type */ - tcp_t svr; /* tcp server control */ - int toinact; /* inactive timeout (ms) (0:no timeout) */ - int tirecon; /* reconnect interval (ms) (0:no reconnect) */ +typedef struct +{ /* tcp cilent type */ + tcp_t svr; /* tcp server control */ + int toinact; /* inactive timeout (ms) (0:no timeout) */ + int tirecon; /* reconnect interval (ms) (0:no reconnect) */ } tcpcli_t; -typedef struct { /* ntrip control type */ - int state; /* state (0:close,1:wait,2:connect) */ - int type; /* type (0:server,1:client) */ - int nb; /* response buffer size */ - char url[256]; /* url for proxy */ - char mntpnt[256]; /* mountpoint */ - char user[256]; /* user */ - char passwd[256]; /* password */ - char str[NTRIP_MAXSTR]; /* mountpoint string for server */ +typedef struct +{ /* ntrip control type */ + int state; /* state (0:close,1:wait,2:connect) */ + int type; /* type (0:server,1:client) */ + int nb; /* response buffer size */ + char url[256]; /* url for proxy */ + char mntpnt[256]; /* mountpoint */ + char user[256]; /* user */ + char passwd[256]; /* password */ + char str[NTRIP_MAXSTR]; /* mountpoint string for server */ unsigned char buff[NTRIP_MAXRSP]; /* response buffer */ - tcpcli_t *tcp; /* tcp client */ + tcpcli_t *tcp; /* tcp client */ } ntrip_t; -typedef struct { /* ftp download control type */ - int state; /* state (0:close,1:download,2:complete,3:error) */ - int proto; /* protocol (0:ftp,1:http) */ - int error; /* error code (0:no error,1-10:wget error, */ +typedef struct +{ /* ftp download control type */ + int state; /* state (0:close,1:download,2:complete,3:error) */ + int proto; /* protocol (0:ftp,1:http) */ + int error; /* error code (0:no error,1-10:wget error, */ /* 11:no temp dir,12:uncompact error) */ - char addr[1024]; /* download address */ - char file[1024]; /* download file path */ - char user[256]; /* user for ftp */ - char passwd[256]; /* password for ftp */ - char local[1024]; /* local file path */ - int topts[4]; /* time options {poff,tint,toff,tretry} (s) */ - gtime_t tnext; /* next retry time (gpst) */ - thread_t thread; /* download thread */ + char addr[1024]; /* download address */ + char file[1024]; /* download file path */ + char user[256]; /* user for ftp */ + char passwd[256]; /* password for ftp */ + char local[1024]; /* local file path */ + int topts[4]; /* time options {poff,tint,toff,tretry} (s) */ + gtime_t tnext; /* next retry time (gpst) */ + thread_t thread; /* download thread */ } ftp_t; -typedef struct { /* receiver raw data control type */ - gtime_t time; /* message time */ - gtime_t tobs; /* observation data time */ - obs_t obs; /* observation data */ - obs_t obuf; /* observation data buffer */ - nav_t nav; /* satellite ephemerides */ - sta_t sta; /* station parameters */ - int ephsat; /* sat number of update ephemeris (0:no satellite) */ - sbsmsg_t sbsmsg; /* SBAS message */ - char msgtype[256]; /* last message type */ - unsigned char subfrm[MAXSAT][380]; /* subframe buffer */ - lexmsg_t lexmsg; /* LEX message */ - double lockt[MAXSAT][NFREQ+NEXOBS]; /* lock time (s) */ - double icpp[MAXSAT],off[MAXSAT],icpc; /* carrier params for ss2 */ - double prCA[MAXSAT],dpCA[MAXSAT]; /* L1/CA pseudrange/doppler for javad */ - unsigned char halfc[MAXSAT][NFREQ+NEXOBS]; /* half-cycle add flag */ - char freqn[MAXOBS]; /* frequency number for javad */ - int nbyte; /* number of bytes in message buffer */ - int len; /* message length (bytes) */ - int iod; /* issue of data */ - int tod; /* time of day (ms) */ - int tbase; /* time base (0:gpst,1:utc(usno),2:glonass,3:utc(su) */ - int flag; /* general purpose flag */ - int outtype; /* output message type */ - unsigned char buff[MAXRAWLEN]; /* message buffer */ - char opt[256]; /* receiver dependent options */ - double receive_time;/* RT17: Reiceve time of week for week rollover detection */ - unsigned int plen; /* RT17: Total size of packet to be read */ - unsigned int pbyte; /* RT17: How many packet bytes have been read so far */ - unsigned int page; /* RT17: Last page number */ - unsigned int reply; /* RT17: Current reply number */ - int week; /* RT17: week number */ - unsigned char pbuff[255+4+2]; /* RT17: Packet buffer */ +typedef struct +{ /* receiver raw data control type */ + gtime_t time; /* message time */ + gtime_t tobs; /* observation data time */ + obs_t obs; /* observation data */ + obs_t obuf; /* observation data buffer */ + nav_t nav; /* satellite ephemerides */ + sta_t sta; /* station parameters */ + int ephsat; /* sat number of update ephemeris (0:no satellite) */ + sbsmsg_t sbsmsg; /* SBAS message */ + char msgtype[256]; /* last message type */ + unsigned char subfrm[MAXSAT][380]; /* subframe buffer */ + lexmsg_t lexmsg; /* LEX message */ + double lockt[MAXSAT][NFREQ + NEXOBS]; /* lock time (s) */ + double icpp[MAXSAT], off[MAXSAT], icpc; /* carrier params for ss2 */ + double prCA[MAXSAT], dpCA[MAXSAT]; /* L1/CA pseudrange/doppler for javad */ + unsigned char halfc[MAXSAT][NFREQ + NEXOBS]; /* half-cycle add flag */ + char freqn[MAXOBS]; /* frequency number for javad */ + int nbyte; /* number of bytes in message buffer */ + int len; /* message length (bytes) */ + int iod; /* issue of data */ + int tod; /* time of day (ms) */ + int tbase; /* time base (0:gpst,1:utc(usno),2:glonass,3:utc(su) */ + int flag; /* general purpose flag */ + int outtype; /* output message type */ + unsigned char buff[MAXRAWLEN]; /* message buffer */ + char opt[256]; /* receiver dependent options */ + double receive_time; /* RT17: Reiceve time of week for week rollover detection */ + unsigned int plen; /* RT17: Total size of packet to be read */ + unsigned int pbyte; /* RT17: How many packet bytes have been read so far */ + unsigned int page; /* RT17: Last page number */ + unsigned int reply; /* RT17: Current reply number */ + int week; /* RT17: week number */ + unsigned char pbuff[255 + 4 + 2]; /* RT17: Packet buffer */ } raw_t; -typedef struct { /* RTK server type */ - int state; /* server state (0:stop,1:running) */ - int cycle; /* processing cycle (ms) */ - int nmeacycle; /* NMEA request cycle (ms) (0:no req) */ - int nmeareq; /* NMEA request (0:no,1:nmeapos,2:single sol) */ - double nmeapos[3]; /* NMEA request position (ecef) (m) */ - int buffsize; /* input buffer size (bytes) */ - int format[3]; /* input format {rov,base,corr} */ - solopt_t solopt[2]; /* output solution options {sol1,sol2} */ - int navsel; /* ephemeris select (0:all,1:rover,2:base,3:corr) */ - int nsbs; /* number of sbas message */ - int nsol; /* number of solution buffer */ - rtk_t rtk; /* RTK control/result struct */ - int nb [3]; /* bytes in input buffers {rov,base} */ - int nsb[2]; /* bytes in soulution buffers */ - int npb[3]; /* bytes in input peek buffers */ - unsigned char *buff[3]; /* input buffers {rov,base,corr} */ - unsigned char *sbuf[2]; /* output buffers {sol1,sol2} */ - unsigned char *pbuf[3]; /* peek buffers {rov,base,corr} */ - sol_t solbuf[MAXSOLBUF]; /* solution buffer */ - unsigned int nmsg[3][10]; /* input message counts */ - raw_t raw [3]; /* receiver raw control {rov,base,corr} */ - rtcm_t rtcm[3]; /* RTCM control {rov,base,corr} */ - gtime_t ftime[3]; /* download time {rov,base,corr} */ - char files[3][MAXSTRPATH]; /* download paths {rov,base,corr} */ - obs_t obs[3][MAXOBSBUF]; /* observation data {rov,base,corr} */ - nav_t nav; /* navigation data */ +typedef struct +{ /* RTK server type */ + int state; /* server state (0:stop,1:running) */ + int cycle; /* processing cycle (ms) */ + int nmeacycle; /* NMEA request cycle (ms) (0:no req) */ + int nmeareq; /* NMEA request (0:no,1:nmeapos,2:single sol) */ + double nmeapos[3]; /* NMEA request position (ecef) (m) */ + int buffsize; /* input buffer size (bytes) */ + int format[3]; /* input format {rov,base,corr} */ + solopt_t solopt[2]; /* output solution options {sol1,sol2} */ + int navsel; /* ephemeris select (0:all,1:rover,2:base,3:corr) */ + int nsbs; /* number of sbas message */ + int nsol; /* number of solution buffer */ + rtk_t rtk; /* RTK control/result struct */ + int nb[3]; /* bytes in input buffers {rov,base} */ + int nsb[2]; /* bytes in soulution buffers */ + int npb[3]; /* bytes in input peek buffers */ + unsigned char *buff[3]; /* input buffers {rov,base,corr} */ + unsigned char *sbuf[2]; /* output buffers {sol1,sol2} */ + unsigned char *pbuf[3]; /* peek buffers {rov,base,corr} */ + sol_t solbuf[MAXSOLBUF]; /* solution buffer */ + unsigned int nmsg[3][10]; /* input message counts */ + raw_t raw[3]; /* receiver raw control {rov,base,corr} */ + rtcm_t rtcm[3]; /* RTCM control {rov,base,corr} */ + gtime_t ftime[3]; /* download time {rov,base,corr} */ + char files[3][MAXSTRPATH]; /* download paths {rov,base,corr} */ + obs_t obs[3][MAXOBSBUF]; /* observation data {rov,base,corr} */ + nav_t nav; /* navigation data */ sbsmsg_t sbsmsg[MAXSBSMSG]; /* SBAS message buffer */ - stream_t stream[8]; /* streams {rov,base,corr,sol1,sol2,logr,logb,logc} */ - stream_t *moni; /* monitor stream */ - unsigned int tick; /* start tick */ - thread_t thread; /* server thread */ - int cputime; /* CPU time (ms) for a processing cycle */ - int prcout; /* missing observation data count */ - lock_t lock; /* lock flag */ + stream_t stream[8]; /* streams {rov,base,corr,sol1,sol2,logr,logb,logc} */ + stream_t *moni; /* monitor stream */ + unsigned int tick; /* start tick */ + thread_t thread; /* server thread */ + int cputime; /* CPU time (ms) for a processing cycle */ + int prcout; /* missing observation data count */ + lock_t lock; /* lock flag */ } rtksvr_t; -typedef struct { /* multi-signal-message header type */ - unsigned char iod; /* issue of data station */ - unsigned char time_s; /* cumulative session transmitting time */ - unsigned char clk_str; /* clock steering indicator */ - unsigned char clk_ext; /* external clock indicator */ - unsigned char smooth; /* divergence free smoothing indicator */ - unsigned char tint_s; /* soothing interval */ - unsigned char nsat,nsig; /* number of satellites/signals */ - unsigned char sats[64]; /* satellites */ - unsigned char sigs[32]; /* signals */ - unsigned char cellmask[64]; /* cell mask */ +typedef struct +{ /* multi-signal-message header type */ + unsigned char iod; /* issue of data station */ + unsigned char time_s; /* cumulative session transmitting time */ + unsigned char clk_str; /* clock steering indicator */ + unsigned char clk_ext; /* external clock indicator */ + unsigned char smooth; /* divergence free smoothing indicator */ + unsigned char tint_s; /* soothing interval */ + unsigned char nsat, nsig; /* number of satellites/signals */ + unsigned char sats[64]; /* satellites */ + unsigned char sigs[32]; /* signals */ + unsigned char cellmask[64]; /* cell mask */ } msm_h_t; -const double chisqr[100] = { /* chi-sqr(n) (alpha=0.001) */ +const double chisqr[100] = {/* chi-sqr(n) (alpha=0.001) */ 10.8, 13.8, 16.3, 18.5, 20.5, 22.5, 24.3, 26.1, 27.9, 29.6, 31.3, 32.9, 34.5, 36.1, 37.7, 39.3, 40.8, 42.3, 43.8, 45.3, 46.8, 48.3, 49.7, 51.2, 52.6, 54.1, 55.5, 56.9, 58.3, 59.7, 61.1, 62.5, 63.9, 65.2, 66.6, 68.0, 69.3, 70.7, 72.1, 73.4, 74.7, 76.0, 77.3, 78.6, 80.0, 81.3, 82.6, 84.0, 85.4, 86.7, - 88.0, 89.3, 90.6, 91.9, 93.3, 94.7, 96.0, 97.4, 98.7, 100 , - 101 , 102 , 103 , 104 , 105 , 107 , 108 , 109 , 110 , 112 , - 113 , 114 , 115 , 116 , 118 , 119 , 120 , 122 , 123 , 125 , - 126 , 127 , 128 , 129 , 131 , 132 , 133 , 134 , 135 , 137 , - 138 , 139 , 140 , 142 , 143 , 144 , 145 , 147 , 148 , 149 -}; + 88.0, 89.3, 90.6, 91.9, 93.3, 94.7, 96.0, 97.4, 98.7, 100, + 101, 102, 103, 104, 105, 107, 108, 109, 110, 112, + 113, 114, 115, 116, 118, 119, 120, 122, 123, 125, + 126, 127, 128, 129, 131, 132, 133, 134, 135, 137, + 138, 139, 140, 142, 143, 144, 145, 147, 148, 149}; -const double lam_carr[MAXFREQ] = { /* carrier wave length (m) */ +const double lam_carr[MAXFREQ] = {/* carrier wave length (m) */ SPEED_OF_LIGHT / FREQ1, SPEED_OF_LIGHT / FREQ2, SPEED_OF_LIGHT / FREQ5, SPEED_OF_LIGHT / FREQ6, SPEED_OF_LIGHT / FREQ7, - SPEED_OF_LIGHT / FREQ8, SPEED_OF_LIGHT / FREQ9 -}; + SPEED_OF_LIGHT / FREQ8, SPEED_OF_LIGHT / FREQ9}; -const int STRFMT_RTCM2 = 0; /* stream format: RTCM 2 */ -const int STRFMT_RTCM3 = 1; /* stream format: RTCM 3 */ -const int STRFMT_SP3 = 16; /* stream format: SP3 */ -const int STRFMT_RNXCLK = 17; /* stream format: RINEX CLK */ -const int STRFMT_SBAS = 18; /* stream format: SBAS messages */ -const int STRFMT_NMEA = 19; /* stream format: NMEA 0183 */ +const int STRFMT_RTCM2 = 0; /* stream format: RTCM 2 */ +const int STRFMT_RTCM3 = 1; /* stream format: RTCM 3 */ +const int STRFMT_SP3 = 16; /* stream format: SP3 */ +const int STRFMT_RNXCLK = 17; /* stream format: RINEX CLK */ +const int STRFMT_SBAS = 18; /* stream format: SBAS messages */ +const int STRFMT_NMEA = 19; /* stream format: NMEA 0183 */ //const solopt_t solopt_default; /* default solution output options */ -const int MAXSTRRTK = 8; /* max number of stream in RTK server */ +const int MAXSTRRTK = 8; /* max number of stream in RTK server */ #endif diff --git a/src/algorithms/libs/rtklib/rtklib_conversions.cc b/src/algorithms/libs/rtklib/rtklib_conversions.cc index 7f1d933a6..730fe2814 100644 --- a/src/algorithms/libs/rtklib/rtklib_conversions.cc +++ b/src/algorithms/libs/rtklib/rtklib_conversions.cc @@ -31,74 +31,73 @@ #include "rtklib_conversions.h" #include "rtklib_rtkcmn.h" -obsd_t insert_obs_to_rtklib(obsd_t & rtklib_obs, const Gnss_Synchro & gnss_synchro, int week, int band) +obsd_t insert_obs_to_rtklib(obsd_t& rtklib_obs, const Gnss_Synchro& gnss_synchro, int week, int band) { rtklib_obs.D[band] = gnss_synchro.Carrier_Doppler_hz; rtklib_obs.P[band] = gnss_synchro.Pseudorange_m; rtklib_obs.L[band] = gnss_synchro.Carrier_phase_rads / PI_2; - switch(band) - { + switch (band) + { case 0: rtklib_obs.code[band] = static_cast(CODE_L1C); break; case 1: - rtklib_obs.code[band] = static_cast(CODE_L2S); - break; + rtklib_obs.code[band] = static_cast(CODE_L2S); + break; case 2: - rtklib_obs.code[band] = static_cast(CODE_L5X); - break; - } + rtklib_obs.code[band] = static_cast(CODE_L5X); + break; + } double CN0_dB_Hz_est = gnss_synchro.CN0_dB_hz; if (CN0_dB_Hz_est > 63.75) CN0_dB_Hz_est = 63.75; if (CN0_dB_Hz_est < 0.0) CN0_dB_Hz_est = 0.0; - unsigned char CN0_dB_Hz = static_cast(std::round(CN0_dB_Hz_est / 0.25 )); + unsigned char CN0_dB_Hz = static_cast(std::round(CN0_dB_Hz_est / 0.25)); rtklib_obs.SNR[band] = CN0_dB_Hz; //Galileo is the third satellite system for RTKLIB, so, add the required offset to discriminate Galileo ephemeris - switch(gnss_synchro.System) - { + switch (gnss_synchro.System) + { case 'G': rtklib_obs.sat = gnss_synchro.PRN; break; case 'E': - rtklib_obs.sat = gnss_synchro.PRN+NSATGPS+NSATGLO; + rtklib_obs.sat = gnss_synchro.PRN + NSATGPS + NSATGLO; break; case 'R': - rtklib_obs.sat = gnss_synchro.PRN+NSATGPS; + rtklib_obs.sat = gnss_synchro.PRN + NSATGPS; break; default: rtklib_obs.sat = gnss_synchro.PRN; - } + } rtklib_obs.time = gpst2time(adjgpsweek(week), gnss_synchro.RX_time); rtklib_obs.rcv = 1; return rtklib_obs; } -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; - 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}; + double week, sec; + 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}; - rtklib_sat.sat = glonass_gnav_eph.i_satellite_slot_number + NSATGPS; /* satellite number */ - rtklib_sat.iode = static_cast(glonass_gnav_eph.d_t_b); /* IODE (0-6 bit of tb field) */ - rtklib_sat.frq = glonass_gnav_eph.i_satellite_freq_channel; /* satellite frequency number */ - rtklib_sat.svh = glonass_gnav_eph.d_l3rd_n; /* satellite health*/ - rtklib_sat.sva = static_cast(glonass_gnav_eph.d_F_T); /* satellite accuracy*/ - rtklib_sat.age = static_cast(glonass_gnav_eph.d_E_n); /* satellite age*/ - rtklib_sat.pos[0] = glonass_gnav_eph.d_Xn*1000; /* satellite position (ecef) (m) */ - rtklib_sat.pos[1] = glonass_gnav_eph.d_Yn*1000; /* satellite position (ecef) (m) */ - rtklib_sat.pos[2] = glonass_gnav_eph.d_Zn*1000; /* satellite position (ecef) (m) */ - rtklib_sat.vel[0] = glonass_gnav_eph.d_VXn*1000; /* satellite velocity (ecef) (m/s) */ - rtklib_sat.vel[1] = glonass_gnav_eph.d_VYn*1000; /* satellite velocity (ecef) (m/s) */ - rtklib_sat.vel[2] = glonass_gnav_eph.d_VZn*1000; /* satellite velocity (ecef) (m/s) */ - rtklib_sat.acc[0] = glonass_gnav_eph.d_AXn*1000; /* satellite acceleration (ecef) (m/s^2) */ - rtklib_sat.acc[1] = glonass_gnav_eph.d_AYn*1000; /* satellite acceleration (ecef) (m/s^2) */ - rtklib_sat.acc[2] = glonass_gnav_eph.d_AZn*1000; /* satellite acceleration (ecef) (m/s^2) */ - rtklib_sat.taun = glonass_gnav_eph.d_tau_n; /* SV clock bias (s) */ - rtklib_sat.gamn = glonass_gnav_eph.d_gamma_n; /* SV relative freq bias */ - rtklib_sat.age = static_cast(glonass_gnav_eph.d_Delta_tau_n); /* delay between L1 and L2 (s) */ + rtklib_sat.sat = glonass_gnav_eph.i_satellite_slot_number + NSATGPS; /* satellite number */ + rtklib_sat.iode = static_cast(glonass_gnav_eph.d_t_b); /* IODE (0-6 bit of tb field) */ + rtklib_sat.frq = glonass_gnav_eph.i_satellite_freq_channel; /* satellite frequency number */ + rtklib_sat.svh = glonass_gnav_eph.d_l3rd_n; /* satellite health*/ + rtklib_sat.sva = static_cast(glonass_gnav_eph.d_F_T); /* satellite accuracy*/ + rtklib_sat.age = static_cast(glonass_gnav_eph.d_E_n); /* satellite age*/ + rtklib_sat.pos[0] = glonass_gnav_eph.d_Xn * 1000; /* satellite position (ecef) (m) */ + rtklib_sat.pos[1] = glonass_gnav_eph.d_Yn * 1000; /* satellite position (ecef) (m) */ + rtklib_sat.pos[2] = glonass_gnav_eph.d_Zn * 1000; /* satellite position (ecef) (m) */ + rtklib_sat.vel[0] = glonass_gnav_eph.d_VXn * 1000; /* satellite velocity (ecef) (m/s) */ + rtklib_sat.vel[1] = glonass_gnav_eph.d_VYn * 1000; /* satellite velocity (ecef) (m/s) */ + rtklib_sat.vel[2] = glonass_gnav_eph.d_VZn * 1000; /* satellite velocity (ecef) (m/s) */ + rtklib_sat.acc[0] = glonass_gnav_eph.d_AXn * 1000; /* satellite acceleration (ecef) (m/s^2) */ + rtklib_sat.acc[1] = glonass_gnav_eph.d_AYn * 1000; /* satellite acceleration (ecef) (m/s^2) */ + rtklib_sat.acc[2] = glonass_gnav_eph.d_AZn * 1000; /* satellite acceleration (ecef) (m/s^2) */ + rtklib_sat.taun = glonass_gnav_eph.d_tau_n; /* SV clock bias (s) */ + rtklib_sat.gamn = glonass_gnav_eph.d_gamma_n; /* SV relative freq bias */ + rtklib_sat.age = static_cast(glonass_gnav_eph.d_Delta_tau_n); /* delay between L1 and L2 (s) */ // Time expressed in GPS Time but using RTKLib format glonass_gnav_eph.glot_to_gpst(glonass_gnav_eph.d_t_b, gnav_clock_model.d_tau_c, gnav_clock_model.d_tau_gps, &week, &sec); @@ -114,12 +113,12 @@ geph_t eph_to_rtklib(const Glonass_Gnav_Ephemeris & glonass_gnav_eph, const Glon } -eph_t eph_to_rtklib(const Galileo_Ephemeris & gal_eph) +eph_t eph_to_rtklib(const Galileo_Ephemeris& gal_eph) { eph_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, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, {}, 0.0, 0.0 }; + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, {}, 0.0, 0.0}; //Galileo is the third satellite system for RTKLIB, so, add the required offset to discriminate Galileo ephemeris - rtklib_sat.sat = gal_eph.i_satellite_PRN+NSATGPS+NSATGLO; + rtklib_sat.sat = gal_eph.i_satellite_PRN + NSATGPS + NSATGLO; rtklib_sat.A = gal_eph.A_1 * gal_eph.A_1; rtklib_sat.M0 = gal_eph.M0_1; rtklib_sat.deln = gal_eph.delta_n_3; @@ -129,8 +128,8 @@ eph_t eph_to_rtklib(const Galileo_Ephemeris & gal_eph) rtklib_sat.i0 = gal_eph.i_0_2; rtklib_sat.idot = gal_eph.iDot_2; rtklib_sat.e = gal_eph.e_1; - rtklib_sat.Adot = 0; //only in CNAV; - rtklib_sat.ndot = 0; //only in CNAV; + rtklib_sat.Adot = 0; //only in CNAV; + rtklib_sat.ndot = 0; //only in CNAV; rtklib_sat.week = adjgpsweek(gal_eph.WN_5); /* week of tow */ rtklib_sat.cic = gal_eph.C_ic_4; @@ -154,8 +153,16 @@ eph_t eph_to_rtklib(const Galileo_Ephemeris & gal_eph) double tow, toc; tow = time2gpst(rtklib_sat.ttr, &rtklib_sat.week); toc = time2gpst(rtklib_sat.toc, NULL); - if (rtklib_sat.toes < tow - 302400.0) {rtklib_sat.week++; tow -= 604800.0;} - else if (rtklib_sat.toes > tow + 302400.0) {rtklib_sat.week--; tow += 604800.0;} + if (rtklib_sat.toes < tow - 302400.0) + { + rtklib_sat.week++; + tow -= 604800.0; + } + else if (rtklib_sat.toes > tow + 302400.0) + { + rtklib_sat.week--; + tow += 604800.0; + } rtklib_sat.toe = gpst2time(rtklib_sat.week, rtklib_sat.toes); rtklib_sat.toc = gpst2time(rtklib_sat.week, toc); rtklib_sat.ttr = gpst2time(rtklib_sat.week, tow); @@ -164,10 +171,10 @@ eph_t eph_to_rtklib(const Galileo_Ephemeris & gal_eph) } -eph_t eph_to_rtklib(const Gps_Ephemeris & gps_eph) +eph_t eph_to_rtklib(const Gps_Ephemeris& gps_eph) { eph_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, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, {}, 0.0, 0.0 }; + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, {}, 0.0, 0.0}; rtklib_sat.sat = gps_eph.i_satellite_PRN; rtklib_sat.A = gps_eph.d_sqrt_A * gps_eph.d_sqrt_A; rtklib_sat.M0 = gps_eph.d_M_0; @@ -178,8 +185,8 @@ eph_t eph_to_rtklib(const Gps_Ephemeris & gps_eph) rtklib_sat.i0 = gps_eph.d_i_0; rtklib_sat.idot = gps_eph.d_IDOT; rtklib_sat.e = gps_eph.d_e_eccentricity; - rtklib_sat.Adot = 0; //only in CNAV; - rtklib_sat.ndot = 0; //only in CNAV; + rtklib_sat.Adot = 0; //only in CNAV; + rtklib_sat.ndot = 0; //only in CNAV; rtklib_sat.week = adjgpsweek(gps_eph.i_GPS_week); /* week of tow */ rtklib_sat.cic = gps_eph.d_Cic; @@ -203,8 +210,16 @@ eph_t eph_to_rtklib(const Gps_Ephemeris & gps_eph) double tow, toc; tow = time2gpst(rtklib_sat.ttr, &rtklib_sat.week); toc = time2gpst(rtklib_sat.toc, NULL); - if (rtklib_sat.toes < tow - 302400.0) {rtklib_sat.week++; tow -= 604800.0;} - else if (rtklib_sat.toes > tow + 302400.0) {rtklib_sat.week--; tow += 604800.0;} + if (rtklib_sat.toes < tow - 302400.0) + { + rtklib_sat.week++; + tow -= 604800.0; + } + else if (rtklib_sat.toes > tow + 302400.0) + { + rtklib_sat.week--; + tow += 604800.0; + } rtklib_sat.toe = gpst2time(rtklib_sat.week, rtklib_sat.toes); rtklib_sat.toc = gpst2time(rtklib_sat.week, toc); rtklib_sat.ttr = gpst2time(rtklib_sat.week, tow); @@ -213,26 +228,26 @@ eph_t eph_to_rtklib(const Gps_Ephemeris & gps_eph) } -eph_t eph_to_rtklib(const Gps_CNAV_Ephemeris & gps_cnav_eph) +eph_t eph_to_rtklib(const Gps_CNAV_Ephemeris& gps_cnav_eph) { eph_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, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, {}, 0.0, 0.0 }; + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, {}, 0.0, 0.0}; rtklib_sat.sat = gps_cnav_eph.i_satellite_PRN; - const double A_REF = 26559710.0; // See IS-GPS-200H, pp. 170 + const double A_REF = 26559710.0; // See IS-GPS-200H, pp. 170 rtklib_sat.A = A_REF + gps_cnav_eph.d_DELTA_A; rtklib_sat.M0 = gps_cnav_eph.d_M_0; rtklib_sat.deln = gps_cnav_eph.d_Delta_n; rtklib_sat.OMG0 = gps_cnav_eph.d_OMEGA0; // Compute the angle between the ascending node and the Greenwich meridian - const double OMEGA_DOT_REF = -2.6e-9; // semicircles / s, see IS-GPS-200H pp. 164 + const double OMEGA_DOT_REF = -2.6e-9; // semicircles / s, see IS-GPS-200H pp. 164 double d_OMEGA_DOT = OMEGA_DOT_REF * PI + gps_cnav_eph.d_DELTA_OMEGA_DOT; rtklib_sat.OMGd = d_OMEGA_DOT; rtklib_sat.omg = gps_cnav_eph.d_OMEGA; rtklib_sat.i0 = gps_cnav_eph.d_i_0; rtklib_sat.idot = gps_cnav_eph.d_IDOT; rtklib_sat.e = gps_cnav_eph.d_e_eccentricity; - rtklib_sat.Adot = gps_cnav_eph.d_A_DOT; //only in CNAV; - rtklib_sat.ndot = gps_cnav_eph.d_DELTA_DOT_N; //only in CNAV; + rtklib_sat.Adot = gps_cnav_eph.d_A_DOT; //only in CNAV; + rtklib_sat.ndot = gps_cnav_eph.d_DELTA_DOT_N; //only in CNAV; rtklib_sat.week = adjgpsweek(gps_cnav_eph.i_GPS_week); /* week of tow */ rtklib_sat.cic = gps_cnav_eph.d_Cic; @@ -249,15 +264,23 @@ eph_t eph_to_rtklib(const Gps_CNAV_Ephemeris & gps_cnav_eph) rtklib_sat.tgd[2] = 0; rtklib_sat.tgd[3] = 0; rtklib_sat.toes = gps_cnav_eph.d_Toe1; - rtklib_sat.toc = gpst2time(rtklib_sat.week,gps_cnav_eph.d_Toc); - rtklib_sat.ttr = gpst2time(rtklib_sat.week,gps_cnav_eph.d_TOW); + rtklib_sat.toc = gpst2time(rtklib_sat.week, gps_cnav_eph.d_Toc); + rtklib_sat.ttr = gpst2time(rtklib_sat.week, gps_cnav_eph.d_TOW); /* adjustment for week handover */ double tow, toc; tow = time2gpst(rtklib_sat.ttr, &rtklib_sat.week); toc = time2gpst(rtklib_sat.toc, NULL); - if (rtklib_sat.toes < tow - 302400.0) {rtklib_sat.week++; tow -= 604800.0;} - else if (rtklib_sat.toes > tow + 302400.0) {rtklib_sat.week--; tow += 604800.0;} + if (rtklib_sat.toes < tow - 302400.0) + { + rtklib_sat.week++; + tow -= 604800.0; + } + else if (rtklib_sat.toes > tow + 302400.0) + { + rtklib_sat.week--; + tow += 604800.0; + } rtklib_sat.toe = gpst2time(rtklib_sat.week, rtklib_sat.toes); rtklib_sat.toc = gpst2time(rtklib_sat.week, toc); rtklib_sat.ttr = gpst2time(rtklib_sat.week, tow); diff --git a/src/algorithms/libs/rtklib/rtklib_conversions.h b/src/algorithms/libs/rtklib/rtklib_conversions.h index e5a73e88d..22a8501a5 100644 --- a/src/algorithms/libs/rtklib/rtklib_conversions.h +++ b/src/algorithms/libs/rtklib/rtklib_conversions.h @@ -39,16 +39,16 @@ #include "glonass_gnav_ephemeris.h" #include "glonass_gnav_utc_model.h" -eph_t eph_to_rtklib(const Galileo_Ephemeris & gal_eph); -eph_t eph_to_rtklib(const Gps_Ephemeris & gps_eph); -eph_t eph_to_rtklib(const Gps_CNAV_Ephemeris & gps_cnav_eph); +eph_t eph_to_rtklib(const Galileo_Ephemeris& gal_eph); +eph_t eph_to_rtklib(const Gps_Ephemeris& gps_eph); +eph_t eph_to_rtklib(const Gps_CNAV_Ephemeris& gps_cnav_eph); /*! * \brief Transforms a Glonass_Gnav_Ephemeris to its RTKLIB counterpart * \param glonass_gnav_eph GLONASS GNAV Ephemeris structure * \return Ephemeris structure for RTKLIB parsing */ -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); -obsd_t insert_obs_to_rtklib(obsd_t & rtklib_obs, const Gnss_Synchro & gnss_synchro, int week, int band); +obsd_t insert_obs_to_rtklib(obsd_t& rtklib_obs, const Gnss_Synchro& gnss_synchro, int week, int band); #endif /* GNSS_SDR_RTKLIB_CONVERSIONS_H_ */ diff --git a/src/algorithms/libs/rtklib/rtklib_ephemeris.cc b/src/algorithms/libs/rtklib/rtklib_ephemeris.cc index 7fb213366..a64b952ef 100644 --- a/src/algorithms/libs/rtklib/rtklib_ephemeris.cc +++ b/src/algorithms/libs/rtklib/rtklib_ephemeris.cc @@ -57,41 +57,40 @@ /* constants ------------------------------------------------------*/ -const double RE_GLO = 6378136.0; /* radius of earth (m) ref [2] */ -const double MU_GPS = 3.9860050e14; /* gravitational constant ref [1] */ -const double MU_GLO = 3.9860044e14; /* gravitational constant ref [2] */ -const double MU_GAL = 3.986004418e14; /* earth gravitational constant ref [7] */ -const double MU_BDS = 3.986004418e14; /* earth gravitational constant ref [9] */ -const double J2_GLO = 1.0826257e-3; /* 2nd zonal harmonic of geopot ref [2] */ +const double RE_GLO = 6378136.0; /* radius of earth (m) ref [2] */ +const double MU_GPS = 3.9860050e14; /* gravitational constant ref [1] */ +const double MU_GLO = 3.9860044e14; /* gravitational constant ref [2] */ +const double MU_GAL = 3.986004418e14; /* earth gravitational constant ref [7] */ +const double MU_BDS = 3.986004418e14; /* earth gravitational constant ref [9] */ +const double J2_GLO = 1.0826257e-3; /* 2nd zonal harmonic of geopot ref [2] */ -const double OMGE_GLO = 7.292115e-5; /* earth angular velocity (rad/s) ref [2] */ -const double OMGE_GAL = 7.2921151467e-5; /* earth angular velocity (rad/s) ref [7] */ -const double OMGE_BDS = 7.292115e-5; /* earth angular velocity (rad/s) ref [9] */ +const double OMGE_GLO = 7.292115e-5; /* earth angular velocity (rad/s) ref [2] */ +const double OMGE_GAL = 7.2921151467e-5; /* earth angular velocity (rad/s) ref [7] */ +const double OMGE_BDS = 7.292115e-5; /* earth angular velocity (rad/s) ref [9] */ const double SIN_5 = -0.0871557427476582; /* sin(-5.0 deg) */ -const double COS_5 = 0.9961946980917456; /* cos(-5.0 deg) */ +const double COS_5 = 0.9961946980917456; /* cos(-5.0 deg) */ -const double ERREPH_GLO = 5.0; /* error of glonass ephemeris (m) */ -const double TSTEP = 60.0; /* integration step glonass ephemeris (s) */ -const double RTOL_KEPLER = 1e-13; /* relative tolerance for Kepler equation */ +const double ERREPH_GLO = 5.0; /* error of glonass ephemeris (m) */ +const double TSTEP = 60.0; /* integration step glonass ephemeris (s) */ +const double RTOL_KEPLER = 1e-13; /* relative tolerance for Kepler equation */ -const double DEFURASSR = 0.15; /* default accurary of ssr corr (m) */ -const double MAXECORSSR = 10.0; /* max orbit correction of ssr (m) */ -const double MAXCCORSSR = 1e-6 * SPEED_OF_LIGHT; /* max clock correction of ssr (m) */ -const double MAXAGESSR = 90.0; /* max age of ssr orbit and clock (s) */ -const double MAXAGESSR_HRCLK = 10.0; /* max age of ssr high-rate clock (s) */ -const double STD_BRDCCLK = 30.0; /* error of broadcast clock (m) */ +const double DEFURASSR = 0.15; /* default accurary of ssr corr (m) */ +const double MAXECORSSR = 10.0; /* max orbit correction of ssr (m) */ +const double MAXCCORSSR = 1e-6 * SPEED_OF_LIGHT; /* max clock correction of ssr (m) */ +const double MAXAGESSR = 90.0; /* max age of ssr orbit and clock (s) */ +const double MAXAGESSR_HRCLK = 10.0; /* max age of ssr high-rate clock (s) */ +const double STD_BRDCCLK = 30.0; /* error of broadcast clock (m) */ -const int MAX_ITER_KEPLER = 30; /* max number of iteration of Kelpler */ +const int MAX_ITER_KEPLER = 30; /* max number of iteration of Kelpler */ /* variance by ura ephemeris (ref [1] 20.3.3.3.1.1) --------------------------*/ double var_uraeph(int ura) { const double ura_value[] = { - 2.4, 3.4, 4.85, 6.85, 9.65, 13.65, 24.0, 48.0, 96.0, 192.0, 384.0, 768.0, 1536.0, - 3072.0, 6144.0 - }; + 2.4, 3.4, 4.85, 6.85, 9.65, 13.65, 24.0, 48.0, 96.0, 192.0, 384.0, 768.0, 1536.0, + 3072.0, 6144.0}; return ura < 0 || 14 < ura ? std::pow(6144.0, 2.0) : std::pow(ura_value[ura], 2.0); } @@ -140,13 +139,13 @@ void alm2pos(gtime_t time, const alm_t *alm, double *rs, double *dts) } if (n >= MAX_ITER_KEPLER) { - trace(2, "alm2pos: kepler iteration overflow sat=%2d\n", alm->sat); + trace(2, "alm2pos: kepler iteration overflow sat=%2d\n", alm->sat); return; } sinE = sin(E); cosE = cos(E); u = atan2(sqrt(1.0 - alm->e * alm->e) * sinE, cosE - alm->e) + alm->omg; - r = alm->A * (1.0 - alm->e*cosE); + r = alm->A * (1.0 - alm->e * cosE); i = alm->i0; O = alm->OMG0 + (alm->OMGd - DEFAULT_OMEGA_EARTH_DOT) * tk - DEFAULT_OMEGA_EARTH_DOT * alm->toas; x = r * cos(u); @@ -182,7 +181,7 @@ double eph2clk(gtime_t time, const eph_t *eph) { t -= eph->f0 + eph->f1 * t + eph->f2 * t * t; } - return eph->f0 + eph->f1 * t + eph->f2 * t *t; + return eph->f0 + eph->f1 * t + eph->f2 * t * t; } @@ -200,7 +199,7 @@ double eph2clk(gtime_t time, const eph_t *eph) * (tgd or bgd) *-----------------------------------------------------------------------------*/ 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 xg, yg, zg, sino, coso; @@ -213,14 +212,23 @@ void eph2pos(gtime_t time, const eph_t *eph, double *rs, double *dts, rs[0] = rs[1] = rs[2] = *dts = *var = 0.0; return; } - tk = timediff(time , eph->toe); + tk = timediff(time, eph->toe); switch ((sys = satsys(eph->sat, &prn))) - { - case SYS_GAL: mu = MU_GAL; omge = OMGE_GAL; break; - case SYS_BDS: mu = MU_BDS; omge = OMGE_BDS; break; - default: mu = MU_GPS; omge = DEFAULT_OMEGA_EARTH_DOT; break; - } + { + case SYS_GAL: + mu = MU_GAL; + omge = OMGE_GAL; + break; + case SYS_BDS: + mu = MU_BDS; + omge = OMGE_BDS; + break; + default: + mu = MU_GPS; + omge = DEFAULT_OMEGA_EARTH_DOT; + break; + } M = eph->M0 + (sqrt(mu / (eph->A * eph->A * eph->A)) + eph->deln) * tk; for (n = 0, E = M, Ek = 0.0; fabs(E - Ek) > RTOL_KEPLER && n < MAX_ITER_KEPLER; n++) @@ -238,10 +246,11 @@ void eph2pos(gtime_t time, const eph_t *eph, double *rs, double *dts, trace(4, "kepler: sat=%2d e=%8.5f n=%2d del=%10.3e\n", eph->sat, eph->e, n, E - Ek); - u = atan2(sqrt(1.0 - eph->e*eph->e) * sinE, cosE-eph->e) + eph->omg; + u = atan2(sqrt(1.0 - eph->e * eph->e) * sinE, cosE - eph->e) + eph->omg; r = eph->A * (1.0 - eph->e * cosE); i = eph->i0 + eph->idot * tk; - sin2u = sin(2.0 * u); cos2u = cos(2.0 * u); + sin2u = sin(2.0 * u); + cos2u = cos(2.0 * u); u += eph->cus * sin2u + eph->cuc * cos2u; r += eph->crs * sin2u + eph->crc * cos2u; i += eph->cis * sin2u + eph->cic * cos2u; @@ -260,7 +269,7 @@ void eph2pos(gtime_t time, const eph_t *eph, double *rs, double *dts, zg = y * sin(i); sino = sin(omge * tk); coso = cos(omge * tk); - rs[0] = xg * coso + yg * sino * COS_5 + zg * sino * SIN_5; + rs[0] = xg * coso + yg * sino * COS_5 + zg * sino * SIN_5; rs[1] = -xg * sino + yg * coso * COS_5 + zg * coso * SIN_5; rs[2] = -yg * SIN_5 + zg * COS_5; } @@ -270,14 +279,14 @@ void eph2pos(gtime_t time, const eph_t *eph, double *rs, double *dts, sinO = sin(O); cosO = cos(O); rs[0] = x * cosO - y * cosi * sinO; - rs[1] = x * sinO + y *cosi * cosO; + rs[1] = x * sinO + y * cosi * cosO; rs[2] = y * sin(i); } tk = timediff(time, eph->toc); *dts = eph->f0 + eph->f1 * tk + eph->f2 * tk * tk; /* relativity correction */ - *dts -= 2.0 * sqrt(mu * eph->A) * eph-> e* sinE / std::pow(SPEED_OF_LIGHT, 2.0); + *dts -= 2.0 * sqrt(mu * eph->A) * eph->e * sinE / std::pow(SPEED_OF_LIGHT, 2.0); /* position and clock error variance */ *var = var_uraeph(eph->sva); @@ -296,10 +305,11 @@ void deq(const double *x, double *xdot, const double *acc) } /* ref [2] A.3.1.2 with bug fix for xdot[4],xdot[5] */ a = 1.5 * J2_GLO * MU_GLO * std::pow(RE_GLO, 2.0) / r2 / r3; /* 3/2*J2*mu*Ae^2/r^5 */ - b = 5.0 * x[2] * x[2] / r2; /* 5*z^2/r^2 */ - c = -MU_GLO / r3 - a * (1.0 - b); /* -mu/r^3-a(1-b) */ + b = 5.0 * x[2] * x[2] / r2; /* 5*z^2/r^2 */ + c = -MU_GLO / r3 - a * (1.0 - b); /* -mu/r^3-a(1-b) */ xdot[0] = x[3]; - xdot[1] = x[4]; xdot[2] = x[5]; + xdot[1] = x[4]; + xdot[2] = x[5]; xdot[3] = (c + omg2) * x[0] + 2.0 * OMGE_GLO * x[4] + acc[0]; xdot[4] = (c + omg2) * x[1] - 2.0 * OMGE_GLO * x[3] + acc[1]; xdot[5] = (c - 2.0 * a) * x[2] + acc[2]; @@ -312,9 +322,12 @@ void glorbit(double t, double *x, const double *acc) double k1[6], k2[6], k3[6], k4[6], w[6]; int i; - deq(x, k1, acc); for (i = 0; i< 6; i++) w[i] = x[i] + k1[i] * t / 2.0; - deq(w, k2, acc); for (i = 0; i < 6; i++) w[i] = x[i] + k2[i] * t / 2.0; - deq(w, k3, acc); for (i = 0; i < 6; i++) w[i] = x[i] + k3[i] * t; + deq(x, k1, acc); + for (i = 0; i < 6; i++) w[i] = x[i] + k1[i] * t / 2.0; + deq(w, k2, acc); + for (i = 0; i < 6; i++) w[i] = x[i] + k2[i] * t / 2.0; + deq(w, k3, acc); + for (i = 0; i < 6; i++) w[i] = x[i] + k3[i] * t; deq(w, k4, acc); for (i = 0; i < 6; i++) x[i] += (k1[i] + 2.0 * k2[i] + 2.0 * k3[i] + k4[i]) * t / 6.0; } @@ -355,7 +368,7 @@ double geph2clk(gtime_t time, const geph_t *geph) * notes : see ref [2] *-----------------------------------------------------------------------------*/ void geph2pos(gtime_t time, const geph_t *geph, double *rs, double *dts, - double *var) + double *var) { double t, tt, x[6]; int i; @@ -368,10 +381,10 @@ void geph2pos(gtime_t time, const geph_t *geph, double *rs, double *dts, for (i = 0; i < 3; i++) { - x[i ] = geph->pos[i]; - x[i+3] = geph->vel[i]; + x[i] = geph->pos[i]; + x[i + 3] = geph->vel[i]; } - for (tt = t < 0.0 ? - TSTEP : TSTEP; fabs(t) > 1e-9; t -= tt) + for (tt = t < 0.0 ? -TSTEP : TSTEP; fabs(t) > 1e-9; t -= tt) { if (fabs(t) < TSTEP) tt = t; glorbit(tt, x, geph->acc); @@ -400,7 +413,7 @@ double seph2clk(gtime_t time, const seph_t *seph) for (i = 0; i < 2; i++) { - t-=seph->af0 + seph->af1 * t; + t -= seph->af0 + seph->af1 * t; } return seph->af0 + seph->af1 * t; } @@ -417,7 +430,7 @@ double seph2clk(gtime_t time, const seph_t *seph) * notes : see ref [3] *-----------------------------------------------------------------------------*/ void seph2pos(gtime_t time, const seph_t *seph, double *rs, double *dts, - double *var) + double *var) { double t; int i; @@ -445,12 +458,20 @@ eph_t *seleph(gtime_t time, int sat, int iode, const nav_t *nav) trace(4, "seleph : time=%s sat=%2d iode=%d\n", time_str(time, 3), sat, iode); switch (satsys(sat, NULL)) - { - case SYS_QZS: tmax = MAXDTOE_QZS + 1.0; break; - case SYS_GAL: tmax = MAXDTOE_GAL + 1.0; break; - case SYS_BDS: tmax = MAXDTOE_BDS + 1.0; break; - default: tmax = MAXDTOE + 1.0; break; - } + { + case SYS_QZS: + tmax = MAXDTOE_QZS + 1.0; + break; + case SYS_GAL: + tmax = MAXDTOE_GAL + 1.0; + break; + case SYS_BDS: + tmax = MAXDTOE_BDS + 1.0; + break; + default: + tmax = MAXDTOE + 1.0; + break; + } tmin = tmax + 1.0; for (i = 0; i < nav->n; i++) @@ -459,12 +480,16 @@ eph_t *seleph(gtime_t time, int sat, int iode, const nav_t *nav) if (iode >= 0 && nav->eph[i].iode != iode) continue; if ((t = fabs(timediff(nav->eph[i].toe, time))) > tmax) continue; if (iode >= 0) return nav->eph + i; - if (t <= tmin) {j = i; tmin = t;} /* toe closest to time */ + if (t <= tmin) + { + j = i; + tmin = t; + } /* toe closest to time */ } - if (iode >= 0 || j<0) + if (iode >= 0 || j < 0) { trace(3, "no broadcast ephemeris: %s sat=%2d iode=%3d\n", time_str(time, 0), - sat, iode); + sat, iode); return NULL; } return nav->eph + j; @@ -485,12 +510,16 @@ geph_t *selgeph(gtime_t time, int sat, int iode, const nav_t *nav) if (iode >= 0 && nav->geph[i].iode != iode) continue; if ((t = fabs(timediff(nav->geph[i].toe, time))) > tmax) continue; if (iode >= 0) return nav->geph + i; - if (t <= tmin) {j = i; tmin = t;} /* toe closest to time */ + if (t <= tmin) + { + j = i; + tmin = t; + } /* toe closest to time */ } if (iode >= 0 || j < 0) { trace(3, "no glonass ephemeris : %s sat=%2d iode=%2d\n", time_str(time, 0), - sat, iode); + sat, iode); return NULL; } return nav->geph + j; @@ -509,7 +538,11 @@ seph_t *selseph(gtime_t time, int sat, const nav_t *nav) { if (nav->seph[i].sat != sat) continue; if ((t = fabs(timediff(nav->seph[i].t0, time))) > tmax) continue; - if (t <= tmin) {j = i; tmin = t;} /* toe closest to time */ + if (t <= tmin) + { + j = i; + tmin = t; + } /* toe closest to time */ } if (j < 0) { @@ -522,9 +555,9 @@ seph_t *selseph(gtime_t time, int sat, const nav_t *nav) /* satellite clock with broadcast ephemeris ----------------------------------*/ int ephclk(gtime_t time, gtime_t teph, int sat, const nav_t *nav, - double *dts) + double *dts) { - eph_t *eph; + eph_t *eph; geph_t *geph; seph_t *seph; int sys; @@ -548,7 +581,8 @@ int ephclk(gtime_t time, gtime_t teph, int sat, const nav_t *nav, if (!(seph = selseph(teph, sat, nav))) return 0; *dts = seph2clk(time, seph); } - else return 0; + else + return 0; return 1; } @@ -556,9 +590,9 @@ int ephclk(gtime_t time, gtime_t teph, int sat, const nav_t *nav, /* satellite position and clock by broadcast ephemeris -----------------------*/ int ephpos(gtime_t time, gtime_t teph, int sat, const nav_t *nav, - int iode, double *rs, double *dts, double *var, int *svh) + int iode, double *rs, double *dts, double *var, int *svh) { - eph_t *eph; + eph_t *eph; geph_t *geph; seph_t *seph; double rst[3], dtst[1], tt = 1e-3; @@ -596,7 +630,8 @@ int ephpos(gtime_t time, gtime_t teph, int sat, const nav_t *nav, seph2pos(time, seph, rst, dtst, var); *svh = seph->svh; } - else return 0; + else + return 0; /* satellite velocity and clock drift by differential approx */ for (i = 0; i < 3; i++) rs[i + 3] = (rst[i] - rs[i]) / tt; @@ -608,7 +643,7 @@ int ephpos(gtime_t time, gtime_t teph, int sat, const nav_t *nav, /* satellite position and clock with sbas correction -------------------------*/ int satpos_sbas(gtime_t time, gtime_t teph, int sat, const nav_t *nav, - double *rs, double *dts, double *var, int *svh) + double *rs, double *dts, double *var, int *svh) { const sbssatp_t *sbs; int i; @@ -640,7 +675,7 @@ int satpos_sbas(gtime_t time, gtime_t teph, int sat, const nav_t *nav, /* satellite position and clock with ssr correction --------------------------*/ int satpos_ssr(gtime_t time, gtime_t teph, int sat, const nav_t *nav, - int opt, double *rs, double *dts, double *var, int *svh) + int opt, double *rs, double *dts, double *var, int *svh) { const ssr_t *ssr; eph_t *eph; @@ -665,7 +700,7 @@ int satpos_ssr(gtime_t time, gtime_t teph, int sat, const nav_t *nav, if (ssr->iod[0] != ssr->iod[1]) { trace(2, "inconsist ssr correction: %s sat=%2d iod=%d %d\n", - time_str(time, 0), sat, ssr->iod[0], ssr->iod[1]); + time_str(time, 0), sat, ssr->iod[0], ssr->iod[1]); *svh = -1; return 0; } @@ -677,7 +712,7 @@ int satpos_ssr(gtime_t time, gtime_t teph, int sat, const nav_t *nav, if (fabs(t1) > MAXAGESSR || fabs(t2) > MAXAGESSR) { trace(2, "age of ssr error: %s sat=%2d t=%.0f %.0f\n", time_str(time, 0), - sat, t1, t2); + sat, t1, t2); *svh = -1; return 0; } @@ -695,7 +730,7 @@ int satpos_ssr(gtime_t time, gtime_t teph, int sat, const nav_t *nav, if (norm_rtk(deph, 3) > MAXECORSSR || fabs(dclk) > MAXCCORSSR) { trace(3, "invalid ssr correction: %s deph=%.1f dclk=%.1f\n", - time_str(time, 0), norm_rtk(deph, 3), dclk); + time_str(time, 0), norm_rtk(deph, 3), dclk); *svh = -1; return 0; } @@ -709,9 +744,9 @@ int satpos_ssr(gtime_t time, gtime_t teph, int sat, const nav_t *nav, if (!(eph = seleph(teph, sat, ssr->iode, nav))) return 0; /* satellite clock by clock parameters */ - tk=timediff(time, eph->toc); - dts[0] = eph->f0 + eph->f1*tk + eph->f2 * tk * tk; - dts[1] = eph->f1 + 2.0*eph->f2 * tk; + tk = timediff(time, eph->toc); + dts[0] = eph->f0 + eph->f1 * tk + eph->f2 * tk * tk; + dts[1] = eph->f1 + 2.0 * eph->f2 * tk; /* relativity correction */ dts[0] -= 2.0 * dot(rs, rs + 3, 3) / SPEED_OF_LIGHT / SPEED_OF_LIGHT; @@ -742,7 +777,7 @@ int satpos_ssr(gtime_t time, gtime_t teph, int sat, const nav_t *nav, *var = var_urassr(ssr->ura); trace(5, "satpos_ssr: %s sat=%2d deph=%6.3f %6.3f %6.3f er=%6.3f %6.3f %6.3f dclk=%6.3f var=%6.3f\n", - time_str(time, 2), sat, deph[0], deph[1], deph[2], er[0], er[1], er[2], dclk, *var); + time_str(time, 2), sat, deph[0], deph[1], deph[2], er[0], er[1], er[2], dclk, *var); return 1; } @@ -765,25 +800,32 @@ int satpos_ssr(gtime_t time, gtime_t teph, int sat, const nav_t *nav, * satellite clock does not include code bias correction (tgd or bgd) *-----------------------------------------------------------------------------*/ int satpos(gtime_t time, gtime_t teph, int sat, int ephopt, - const nav_t *nav, double *rs, double *dts, double *var, - int *svh) + const nav_t *nav, double *rs, double *dts, double *var, + int *svh) { trace(4, "satpos : time=%s sat=%2d ephopt=%d\n", time_str(time, 3), sat, ephopt); *svh = 0; switch (ephopt) - { - case EPHOPT_BRDC : return ephpos (time, teph, sat, nav, -1, rs, dts, var, svh); - case EPHOPT_SBAS : return satpos_sbas(time, teph, sat, nav, rs, dts, var, svh); - case EPHOPT_SSRAPC: return satpos_ssr (time, teph, sat, nav, 0, rs, dts, var, svh); - case EPHOPT_SSRCOM: return satpos_ssr (time, teph, sat, nav, 1, rs, dts, var, svh); - case EPHOPT_PREC : - if (!peph2pos(time, sat, nav, 1, rs, dts, var)) break; else return 1; - //TODO: enable lex - //case EPHOPT_LEX : - // if (!lexeph2pos(time, sat, nav, rs, dts, var)) break; else return 1; - } + { + case EPHOPT_BRDC: + return ephpos(time, teph, sat, nav, -1, rs, dts, var, svh); + case EPHOPT_SBAS: + return satpos_sbas(time, teph, sat, nav, rs, dts, var, svh); + case EPHOPT_SSRAPC: + return satpos_ssr(time, teph, sat, nav, 0, rs, dts, var, svh); + case EPHOPT_SSRCOM: + return satpos_ssr(time, teph, sat, nav, 1, rs, dts, var, svh); + case EPHOPT_PREC: + if (!peph2pos(time, sat, nav, 1, rs, dts, var)) + break; + else + return 1; + //TODO: enable lex + //case EPHOPT_LEX : + // if (!lexeph2pos(time, sat, nav, rs, dts, var)) break; else return 1; + } *svh = -1; return 0; } @@ -814,7 +856,7 @@ int satpos(gtime_t time, gtime_t teph, int sat, int ephopt, * signal transmission time *-----------------------------------------------------------------------------*/ 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] = {}; double dt, pr; @@ -824,13 +866,14 @@ void satposs(gtime_t teph, const obsd_t *obs, int n, const nav_t *nav, for (i = 0; i < n && i < MAXOBS; i++) { - for (j = 0; j < 6; j++) rs [j + i * 6] = 0.0; + for (j = 0; j < 6; j++) rs[j + i * 6] = 0.0; for (j = 0; j < 2; j++) dts[j + i * 2] = 0.0; var[i] = 0.0; svh[i] = 0; /* search any pseudorange */ - for (j = 0, pr = 0.0; j < NFREQ; j++) if ((pr = obs[i].P[j]) != 0.0) break; + for (j = 0, pr = 0.0; j < NFREQ; j++) + if ((pr = obs[i].P[j]) != 0.0) break; if (j >= NFREQ) { @@ -866,7 +909,7 @@ void satposs(gtime_t teph, const obsd_t *obs, int n, const nav_t *nav, for (i = 0; i < n && i < MAXOBS; i++) { trace(4, "%s sat=%2d rs=%13.3f %13.3f %13.3f dts=%12.3f var=%7.3f svh=%02X\n", - time_str(time[i], 6), obs[i].sat, rs[i * 6], rs[1 + i * 6], rs[2 + i * 6], - dts[i * 2] * 1e9, var[i], svh[i]); + time_str(time[i], 6), obs[i].sat, rs[i * 6], rs[1 + i * 6], rs[2 + i * 6], + dts[i * 2] * 1e9, var[i], svh[i]); } } diff --git a/src/algorithms/libs/rtklib/rtklib_ephemeris.h b/src/algorithms/libs/rtklib/rtklib_ephemeris.h index 1ccc32f4a..b6eaf6b78 100644 --- a/src/algorithms/libs/rtklib/rtklib_ephemeris.h +++ b/src/algorithms/libs/rtklib/rtklib_ephemeris.h @@ -62,36 +62,34 @@ double var_urassr(int ura); void alm2pos(gtime_t time, const alm_t *alm, double *rs, double *dts); double eph2clk(gtime_t time, const eph_t *eph); void eph2pos(gtime_t time, const eph_t *eph, double *rs, double *dts, - double *var); + double *var); void deq(const double *x, double *xdot, const double *acc); void glorbit(double t, double *x, const double *acc); double geph2clk(gtime_t time, const geph_t *geph); void geph2pos(gtime_t time, const geph_t *geph, double *rs, double *dts, - double *var); + double *var); double seph2clk(gtime_t time, const seph_t *seph); void seph2pos(gtime_t time, const seph_t *seph, double *rs, double *dts, - double *var); + double *var); eph_t *seleph(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); seph_t *selseph(gtime_t time, int sat, const nav_t *nav); int ephclk(gtime_t time, gtime_t teph, int sat, const nav_t *nav, - double *dts); + double *dts); //satellite position and clock by broadcast ephemeris int ephpos(gtime_t time, gtime_t teph, int sat, const nav_t *nav, - int iode, double *rs, double *dts, double *var, int *svh); + int iode, double *rs, double *dts, double *var, int *svh); int satpos_sbas(gtime_t time, gtime_t teph, int sat, const nav_t *nav, - double *rs, double *dts, double *var, int *svh); + double *rs, double *dts, double *var, int *svh); int satpos_ssr(gtime_t time, gtime_t teph, int sat, const nav_t *nav, - int opt, double *rs, double *dts, double *var, int *svh); + int opt, double *rs, double *dts, double *var, int *svh); int satpos(gtime_t time, gtime_t teph, int sat, int ephopt, - const nav_t *nav, double *rs, double *dts, double *var, - int *svh); + const nav_t *nav, double *rs, double *dts, double *var, + int *svh); 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); #endif /* GNSS_SDR_RTKLIB_EPHEMERIS_H_ */ diff --git a/src/algorithms/libs/rtklib/rtklib_ionex.cc b/src/algorithms/libs/rtklib/rtklib_ionex.cc index c70a43fa6..7790943fa 100644 --- a/src/algorithms/libs/rtklib/rtklib_ionex.cc +++ b/src/algorithms/libs/rtklib/rtklib_ionex.cc @@ -64,8 +64,8 @@ int getindex(double value, const double *range) { if (range[2] == 0.0) return 0; - if (range[1] > 0.0 && (value < range[0] || range[1] 0.0 && (value < range[0] || range[1] < value)) return -1; + if (range[1] < 0.0 && (value < range[1] || range[0] < value)) return -1; return (int)floor((value - range[0]) / range[2] + 0.5); } @@ -87,7 +87,7 @@ int dataindex(int i, int j, int k, const int *ndata) /* add tec data to navigation data -------------------------------------------*/ 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; gtime_t time0 = {0, 0}; @@ -102,16 +102,18 @@ tec_t *addtec(const double *lats, const double *lons, const double *hgts, if (nav->nt >= nav->ntmax) { - nav->ntmax+=256; - if (!(nav_tec = (tec_t *)realloc(nav->tec, sizeof(tec_t)*nav->ntmax))) + nav->ntmax += 256; + if (!(nav_tec = (tec_t *)realloc(nav->tec, sizeof(tec_t) * nav->ntmax))) { trace(1, "readionex malloc error ntmax=%d\n", nav->ntmax); - free(nav->tec); nav->tec = NULL; nav->nt = nav->ntmax = 0; + free(nav->tec); + nav->tec = NULL; + nav->nt = nav->ntmax = 0; return NULL; } nav->tec = nav_tec; } - p = nav->tec+nav->nt; + p = nav->tec + nav->nt; p->time = time0; p->rb = rb; for (i = 0; i < 3; i++) @@ -124,14 +126,14 @@ tec_t *addtec(const double *lats, const double *lons, const double *hgts, n = ndata[0] * ndata[1] * ndata[2]; if (!(p->data = (double *)malloc(sizeof(double) * n)) || - !(p->rms = (float *)malloc(sizeof(float ) * n))) + !(p->rms = (float *)malloc(sizeof(float) * n))) { return NULL; } for (i = 0; i < n; i++) { p->data[i] = 0.0; - p->rms [i] = 0.0f; + p->rms[i] = 0.0f; } nav->nt++; return p; @@ -155,24 +157,26 @@ void readionexdcb(FILE *fp, double *dcb, double *rms) if (strstr(label, "PRN / BIAS / RMS") == label) { - strncpy(id, buff+3, 3); id[3] = '\0'; + strncpy(id, buff + 3, 3); + id[3] = '\0'; if (!(sat = satid2no(id))) { trace(2, "ionex invalid satellite: %s\n", id); continue; } - dcb[sat-1] = str2num(buff, 6, 10); - rms[sat-1] = str2num(buff, 16, 10); + dcb[sat - 1] = str2num(buff, 6, 10); + rms[sat - 1] = str2num(buff, 16, 10); } - else if (strstr(label, "END OF AUX DATA") == label) break; + else if (strstr(label, "END OF AUX DATA") == label) + break; } } /* read ionex header ---------------------------------------------------------*/ 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; char buff[1024], *label; @@ -181,7 +185,6 @@ double readionexh(FILE *fp, double *lats, double *lons, double *hgts, while (fgets(buff, sizeof(buff), fp)) { - if (strlen(buff) < 60) continue; label = buff + 60; @@ -195,20 +198,20 @@ double readionexh(FILE *fp, double *lats, double *lons, double *hgts, } else if (strstr(label, "HGT1 / HGT2 / DHGT") == label) { - hgts[0] = str2num(buff, 2, 6); - hgts[1] = str2num(buff, 8, 6); + hgts[0] = str2num(buff, 2, 6); + hgts[1] = str2num(buff, 8, 6); hgts[2] = str2num(buff, 14, 6); } else if (strstr(label, "LAT1 / LAT2 / DLAT") == label) { - lats[0] = str2num(buff, 2, 6); - lats[1] = str2num(buff, 8, 6); + lats[0] = str2num(buff, 2, 6); + lats[1] = str2num(buff, 8, 6); lats[2] = str2num(buff, 14, 6); } - else if (strstr(label,"LON1 / LON2 / DLON") == label) + else if (strstr(label, "LON1 / LON2 / DLON") == label) { - lons[0] = str2num(buff, 2, 6); - lons[1] = str2num(buff, 8, 6); + lons[0] = str2num(buff, 2, 6); + lons[1] = str2num(buff, 8, 6); lons[2] = str2num(buff, 14, 6); } else if (strstr(label, "EXPONENT") == label) @@ -216,7 +219,7 @@ double readionexh(FILE *fp, double *lats, double *lons, double *hgts, *nexp = str2num(buff, 0, 6); } else if (strstr(label, "START OF AUX DATA") == label && - strstr(buff, "DIFFERENTIAL CODE BIASES")) + strstr(buff, "DIFFERENTIAL CODE BIASES")) { readionexdcb(fp, dcb, rms); } @@ -231,7 +234,7 @@ double readionexh(FILE *fp, double *lats, double *lons, double *hgts, /* read ionex body -----------------------------------------------------------*/ int readionexb(FILE *fp, const double *lats, const double *lons, - const double *hgts, double rb, double nexp, nav_t *nav) + const double *hgts, double rb, double nexp, nav_t *nav) { tec_t *p = NULL; gtime_t time = {0, 0}; @@ -273,22 +276,23 @@ int readionexb(FILE *fp, const double *lats, const double *lons, } if (type == 2) { - for (i = nav->nt-1; i >= 0; i--) + for (i = nav->nt - 1; i >= 0; i--) { if (fabs(timediff(time, nav->tec[i].time)) >= 1.0) continue; p = nav->tec + i; break; } } - else if (p) p->time = time; + else if (p) + p->time = time; } else if (strstr(label, "LAT/LON1/LON2/DLON/H") == label && p) { - lat = str2num(buff, 2, 6); - lon[0] = str2num(buff, 8, 6); + lat = str2num(buff, 2, 6); + lon[0] = str2num(buff, 8, 6); lon[1] = str2num(buff, 14, 6); lon[2] = str2num(buff, 20, 6); - hgt = str2num(buff, 26, 6); + hgt = str2num(buff, 26, 6); i = getindex(lat, p->lats); k = getindex(hgt, p->hgts); @@ -303,8 +307,10 @@ int readionexb(FILE *fp, const double *lats, const double *lons, if ((x = str2num(buff, m % 16 * 5, 5)) == 9999.0) continue; - if (type == 1) p->data[index] = x * std::pow(10.0, nexp); - else p->rms[index] = (float)(x * std::pow(10.0, nexp)); + if (type == 1) + p->data[index] = x * std::pow(10.0, nexp); + else + p->rms[index] = (float)(x * std::pow(10.0, nexp)); } } } @@ -337,7 +343,7 @@ void combtec(nav_t *nav) if (i > 0 && timediff(nav->tec[i].time, nav->tec[n - 1].time) == 0.0) { free(nav->tec[n - 1].data); - free(nav->tec[n - 1].rms ); + free(nav->tec[n - 1].rms); nav->tec[n - 1] = nav->tec[i]; continue; } @@ -380,7 +386,7 @@ void readtec(const char *file, nav_t *nav, int opt) { if (!(efiles[i] = (char *)malloc(1024))) { - for (i--; i >= 0; i--) free(efiles[i]); + for (i--; i >= 0; i--) free(efiles[i]); return; } } @@ -423,7 +429,7 @@ void readtec(const char *file, nav_t *nav, int opt) /* interpolate tec grid data -------------------------------------------------*/ 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}; int i, j, n, index; @@ -435,8 +441,10 @@ int interptec(const tec_t *tec, int k, const double *posp, double *value, dlat = posp[0] * R2D - tec->lats[0]; dlon = posp[1] * R2D - tec->lons[0]; - if (tec->lons[2] > 0.0) dlon -= floor( dlon / 360) * 360.0; /* 0 <= dlon<360 */ - else dlon += floor(-dlon / 360) * 360.0; /* -360lons[2] > 0.0) + dlon -= floor(dlon / 360) * 360.0; /* 0 <= dlon<360 */ + else + dlon += floor(-dlon / 360) * 360.0; /* -360lats[2]; b = dlon / tec->lons[2]; @@ -455,19 +463,41 @@ int interptec(const tec_t *tec, int k, const double *posp, double *value, if (d[0] > 0.0 && d[1] > 0.0 && d[2] > 0.0 && d[3] > 0.0) { /* bilinear interpolation (inside of grid) */ - *value = (1.0 - a) * (1.0 - b) * d[0] + a*(1.0 -b) * d[1] + (1.0 - a) * b * d[2] + a * b * d[3]; - *rms = (1.0 - a) * (1.0 - b) * r[0] + a*(1.0 - b) * r[1] + (1.0 - a) * b * r[2] + a * b * r[3]; + *value = (1.0 - a) * (1.0 - b) * d[0] + a * (1.0 - b) * d[1] + (1.0 - a) * b * d[2] + a * b * d[3]; + *rms = (1.0 - a) * (1.0 - b) * r[0] + a * (1.0 - b) * r[1] + (1.0 - a) * b * r[2] + a * b * r[3]; } /* nearest-neighbour extrapolation (outside of grid) */ - else if (a <= 0.5 && b <= 0.5 && d[0] > 0.0) {*value = d[0]; *rms = r[0];} - else if (a > 0.5 && b <= 0.5 && d[1] > 0.0) {*value = d[1]; *rms = r[1];} - else if (a <= 0.5 && b > 0.5 && d[2] > 0.0) {*value = d[2]; *rms = r[2];} - else if (a > 0.5 && b > 0.5 && d[3] > 0.0) {*value = d[3]; *rms = r[3];} + else if (a <= 0.5 && b <= 0.5 && d[0] > 0.0) + { + *value = d[0]; + *rms = r[0]; + } + else if (a > 0.5 && b <= 0.5 && d[1] > 0.0) + { + *value = d[1]; + *rms = r[1]; + } + else if (a <= 0.5 && b > 0.5 && d[2] > 0.0) + { + *value = d[2]; + *rms = r[2]; + } + else if (a > 0.5 && b > 0.5 && d[3] > 0.0) + { + *value = d[3]; + *rms = r[3]; + } else { i = 0; - for (n = 0; n < 4; n++) if (d[n] > 0.0) {i++; *value += d[n]; *rms += r[n];} - if(i == 0) return 0; + for (n = 0; n < 4; n++) + if (d[n] > 0.0) + { + i++; + *value += d[n]; + *rms += r[n]; + } + if (i == 0) return 0; *value /= i; *rms /= i; } @@ -477,31 +507,31 @@ int interptec(const tec_t *tec, int k, const double *posp, double *value, /* ionosphere delay by tec grid data -----------------------------------------*/ 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) */ double fs, posp[3] = {0}, vtec, rms, hion, rp; int i; trace(3, "iondelay: 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); *delay = *var = 0.0; - for (i = 0;i < tec->ndata[2]; i++) + for (i = 0; i < tec->ndata[2]; i++) { /* for a layer */ hion = tec->hgts[0] + tec->hgts[2] * i; /* ionospheric pierce point position */ fs = ionppp(pos, azel, tec->rb, hion, posp); - if (opt&2) + if (opt & 2) { /* modified single layer mapping function (M-SLM) ref [2] */ rp = tec->rb / (tec->rb + hion) * sin(0.9782 * (PI / 2.0 - azel[1])); fs = 1.0 / sqrt(1.0 - rp * rp); } - if (opt&1) + if (opt & 1) { /* earth rotation correction (sun-fixed coordinate) */ posp[1] += 2.0 * PI * timediff(time, tec->time) / 86400.0; @@ -534,13 +564,13 @@ int iondelay(gtime_t time, const tec_t *tec, const double *pos, * return ok with delay=0 and var=VAR_NOTEC if eltec[i].time, nav->tec[i-1].time)) == 0.0) + if ((tt = timediff(nav->tec[i].time, nav->tec[i - 1].time)) == 0.0) { trace(2, "tec grid time interval error\n"); return 0; } /* ionospheric delay by tec grid data */ - stat[0] = iondelay(time, nav->tec+i-1, pos, azel, opt, dels , vars ); - stat[1] = iondelay(time, nav->tec+i , pos, azel, opt, dels+1, vars+1); + stat[0] = iondelay(time, nav->tec + i - 1, pos, azel, opt, dels, vars); + stat[1] = iondelay(time, nav->tec + i, pos, azel, opt, dels + 1, vars + 1); if (!stat[0] && !stat[1]) { trace(2, "%s: tec grid out of area pos=%6.2f %7.2f azel=%6.1f %5.1f\n", - time_str(time, 0), pos[0] * R2D, pos[1] * R2D, azel[0] * R2D, azel[1] * R2D); + time_str(time, 0), pos[0] * R2D, pos[1] * R2D, azel[0] * R2D, azel[1] * R2D); return 0; } if (stat[0] && stat[1]) { /* linear interpolation by time */ - a = timediff(time, nav->tec[i-1].time) / tt; + a = timediff(time, nav->tec[i - 1].time) / tt; *delay = dels[0] * (1.0 - a) + dels[1] * a; - *var = vars[0] * (1.0 - a) + vars[1] * a; + *var = vars[0] * (1.0 - a) + vars[1] * a; } else if (stat[0]) { /* nearest-neighbour extrapolation by time */ *delay = dels[0]; - *var = vars[0]; + *var = vars[0]; } else { *delay = dels[1]; - *var = vars[1]; + *var = vars[1]; } trace(3, "iontec : delay=%5.2f std=%5.2f\n", *delay, sqrt(*var)); return 1; diff --git a/src/algorithms/libs/rtklib/rtklib_ionex.h b/src/algorithms/libs/rtklib/rtklib_ionex.h index 7ed73e3ee..6ffeb2c7a 100644 --- a/src/algorithms/libs/rtklib/rtklib_ionex.h +++ b/src/algorithms/libs/rtklib/rtklib_ionex.h @@ -62,29 +62,29 @@ #include "rtklib.h" -const double VAR_NOTEC = 30.0 * 30.0; /* variance of no tec */ -const double MIN_EL = 0.0; /* min elevation angle (rad) */ -const double MIN_HGT = -1000.0; /* min user height (m) */ +const double VAR_NOTEC = 30.0 * 30.0; /* variance of no tec */ +const double MIN_EL = 0.0; /* min elevation angle (rad) */ +const double MIN_HGT = -1000.0; /* min user height (m) */ int getindex(double value, const double *range); int nitem(const double *range); int dataindex(int i, int j, int k, const int *ndata); tec_t *addtec(const double *lats, const double *lons, const double *hgts, - double rb, nav_t *nav); + double rb, nav_t *nav); void readionexdcb(FILE *fp, double *dcb, double *rms); 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); int readionexb(FILE *fp, const double *lats, const double *lons, - const double *hgts, double rb, double nexp, nav_t *nav); + const double *hgts, double rb, double nexp, nav_t *nav); void combtec(nav_t *nav); void readtec(const char *file, nav_t *nav, int opt); int interptec(const tec_t *tec, int k, const double *posp, double *value, - double *rms); + double *rms); 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); 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); #endif /* GNSS_SDR_RTKLIB_IONEX_H_ */ diff --git a/src/algorithms/libs/rtklib/rtklib_lambda.cc b/src/algorithms/libs/rtklib/rtklib_lambda.cc index 32082ac97..3130b0e21 100644 --- a/src/algorithms/libs/rtklib/rtklib_lambda.cc +++ b/src/algorithms/libs/rtklib/rtklib_lambda.cc @@ -56,20 +56,25 @@ /* LD factorization (Q=L'*diag(D)*L) -----------------------------------------*/ int LD(int n, const double *Q, double *L, double *D) { - int i,j,k,info = 0; - double a,*A = mat(n,n); + int i, j, k, info = 0; + double a, *A = mat(n, n); - memcpy(A,Q,sizeof(double)*n*n); - for (i = n-1; i >= 0; i--) + memcpy(A, Q, sizeof(double) * n * n); + for (i = n - 1; i >= 0; i--) { - if ((D[i] = A[i+i*n])<=0.0) {info = -1; break;} + if ((D[i] = A[i + i * n]) <= 0.0) + { + info = -1; + break; + } a = sqrt(D[i]); - for (j = 0; j<=i; j++) L[i+j*n] = A[i+j*n]/a; - for (j = 0; j<=i-1; j++) for (k = 0;k<=j;k++) A[j+k*n] -= L[i+k*n]*L[i+j*n]; - for (j = 0; j<=i; j++) L[i+j*n] /= L[i+i*n]; + for (j = 0; j <= i; j++) L[i + j * n] = A[i + j * n] / a; + for (j = 0; j <= i - 1; j++) + for (k = 0; k <= j; k++) A[j + k * n] -= L[i + k * n] * L[i + j * n]; + for (j = 0; j <= i; j++) L[i + j * n] /= L[i + i * n]; } free(A); - if (info) fprintf(stderr,"%s : LD factorization error\n",__FILE__); + if (info) fprintf(stderr, "%s : LD factorization error\n", __FILE__); return info; } @@ -77,12 +82,12 @@ int LD(int n, const double *Q, double *L, double *D) /* integer gauss transformation ----------------------------------------------*/ void gauss(int n, double *L, double *Z, int i, int j) { - int k,mu; + int k, mu; - if ((mu = (int)ROUND_LAMBDA(L[i+j*n]))!=0) + if ((mu = (int)ROUND_LAMBDA(L[i + j * n])) != 0) { - for (k = i; k= 0) { - if (j<=k) for (i = j+1; is[imax]) imax = nn; - for (i = 0; i s[imax]) imax = nn; + for (i = 0; i < n; i++) zn[i + nn * n] = z[i]; s[nn++] = newdist; } else { - if (newdist= LOOPMAX) { - fprintf(stderr,"%s : search loop count overflow\n",__FILE__); + fprintf(stderr, "%s : search loop count overflow\n", __FILE__); return -1; } return 0; @@ -220,39 +243,40 @@ int search(int n, int m, const double *L, const double *D, * notes : matrix stored by column-major order (fortran convension) *-----------------------------------------------------------------------------*/ int lambda(int n, int m, const double *a, const double *Q, double *F, - double *s) + double *s) { int info; - double *L,*D,*Z,*z,*E; + double *L, *D, *Z, *z, *E; - if (n<=0||m<=0) return -1; - L = zeros(n,n); - D = mat(n,1); + if (n <= 0 || m <= 0) return -1; + L = zeros(n, n); + D = mat(n, 1); Z = eye(n); - z = mat(n,1); - E = mat(n,m); + z = mat(n, 1); + E = mat(n, m); /* LD factorization */ - if (!(info = LD(n,Q,L,D))) + if (!(info = LD(n, Q, L, D))) { - /* lambda reduction */ - reduction(n,L,D,Z); - matmul("TN",n,1,n,1.0,Z,a,0.0,z); /* z=Z'*a */ + reduction(n, L, D, Z); + matmul("TN", n, 1, n, 1.0, Z, a, 0.0, z); /* z=Z'*a */ /* mlambda search */ - if (!(info = search(n,m,L,D,z,E,s))) + if (!(info = search(n, m, L, D, z, E, s))) { - - info = solve("T",Z,E,n,m,F); /* F=Z'\E */ + info = solve("T", Z, E, n, m, F); /* F=Z'\E */ } } - free(L); free(D); free(Z); free(z); free(E); + free(L); + free(D); + free(Z); + free(z); + free(E); return info; } - /* lambda reduction ------------------------------------------------------------ * reduction by lambda (ref [1]) for integer least square * args : int n I number of float parameters @@ -262,27 +286,28 @@ int lambda(int n, int m, const double *a, const double *Q, double *F, *-----------------------------------------------------------------------------*/ int lambda_reduction(int n, const double *Q, double *Z) { - double *L,*D; - int i,j,info; + double *L, *D; + int i, j, info; - if (n<=0) return -1; + if (n <= 0) return -1; - L = zeros(n,n); - D = mat(n,1); + L = zeros(n, n); + D = mat(n, 1); - for (i = 0; ilam[obs->sat - 1]; double PC, P1, P2, P1_P2, P1_C1, P2_C2, gamma_; @@ -97,15 +97,24 @@ double prange(const obsd_t *obs, const nav_t *nav, const double *azel, /* L1-L2 for GPS/GLO/QZS, L1-L5 for GAL/SBS */ - if (sys & (SYS_GAL | SYS_SBS)) {j = 2;} + if (sys & (SYS_GAL | SYS_SBS)) + { + j = 2; + } if (sys == SYS_GPS) { - if(obs->code[1] != CODE_NONE) {j = 1;} - else if(obs->code[2] != CODE_NONE) {j = 2;} + if (obs->code[1] != CODE_NONE) + { + j = 1; + } + else if (obs->code[2] != CODE_NONE) + { + j = 2; + } } - if (NFREQ<2 || lam[i] == 0.0 || lam[j] == 0.0) + if (NFREQ < 2 || lam[i] == 0.0 || lam[j] == 0.0) { trace(4, "prange: NFREQ<2||lam[i]==0.0||lam[j]==0.0\n"); printf("i: %d j:%d, lam[i]: %f lam[j] %f\n", i, j, lam[i], lam[j]); @@ -118,7 +127,7 @@ double prange(const obsd_t *obs, const nav_t *nav, const double *azel, if (testsnr(0, i, azel[1], obs->SNR[i] * 0.25, &opt->snrmask)) { trace(4, "snr mask: %s sat=%2d el=%.1f snr=%.1f\n", - time_str(obs->time, 0), obs->sat, azel[1] * R2D, obs->SNR[i] * 0.25); + time_str(obs->time, 0), obs->sat, azel[1] * R2D, obs->SNR[i] * 0.25); return 0.0; } if (opt->ionoopt == IONOOPT_IFLC) @@ -133,48 +142,63 @@ double prange(const obsd_t *obs, const nav_t *nav, const double *azel, gamma_ = std::pow(lam[j], 2.0) / std::pow(lam[i], 2.0); /* f1^2/f2^2 */ P1 = obs->P[i]; P2 = obs->P[j]; - P1_P2 = nav->cbias[obs->sat-1][0]; - P1_C1 = nav->cbias[obs->sat-1][1]; - P2_C2 = nav->cbias[obs->sat-1][2]; + P1_P2 = nav->cbias[obs->sat - 1][0]; + P1_C1 = nav->cbias[obs->sat - 1][1]; + P2_C2 = nav->cbias[obs->sat - 1][2]; /* if no P1-P2 DCB, use TGD instead */ - if (P1_P2 == 0.0 && (sys & (SYS_GPS | SYS_GAL | SYS_QZS))) //CHECK! + if (P1_P2 == 0.0 && (sys & (SYS_GPS | SYS_GAL | SYS_QZS))) //CHECK! { P1_P2 = (1.0 - gamma_) * gettgd(obs->sat, nav); } if (opt->ionoopt == IONOOPT_IFLC) { /* dual-frequency */ - if (P1 == 0.0 || P2 == 0.0) { return 0.0; } - if (obs->code[i] == CODE_L1C) { P1 += P1_C1; } /* C1->P1 */ - if (obs->code[j] == CODE_L2C) { P2 += P2_C2; } /* C2->P2 */ + if (P1 == 0.0 || P2 == 0.0) + { + return 0.0; + } + if (obs->code[i] == CODE_L1C) + { + P1 += P1_C1; + } /* C1->P1 */ + if (obs->code[j] == CODE_L2C) + { + P2 += P2_C2; + } /* C2->P2 */ /* iono-free combination */ PC = (gamma_ * P1 - P2) / (gamma_ - 1.0); } else { /* single-frequency */ - if((obs->code[i] == CODE_NONE) && (obs->code[j] == CODE_NONE)) { return 0.0; } + if ((obs->code[i] == CODE_NONE) && (obs->code[j] == CODE_NONE)) + { + return 0.0; + } - else if((obs->code[i] != CODE_NONE) && (obs->code[j] == CODE_NONE)) - { + else if ((obs->code[i] != CODE_NONE) && (obs->code[j] == CODE_NONE)) + { P1 += P1_C1; /* C1->P1 */ PC = P1 - P1_P2 / (1.0 - gamma_); - } - else if((obs->code[i] == CODE_NONE) && (obs->code[j] != CODE_NONE)) - { - P2 += P2_C2; /* C2->P2 */ - PC = P2 - gamma_ * P1_P2 / (1.0 - gamma_); - } - /* dual-frequency */ - else - { - P1 += P1_C1; - P2 += P2_C2; - PC = (gamma_ * P1 - P2) / (gamma_ - 1.0); - } - } - if (opt->sateph == EPHOPT_SBAS) { PC -= P1_C1; } /* sbas clock based C1 */ + } + else if ((obs->code[i] == CODE_NONE) && (obs->code[j] != CODE_NONE)) + { + P2 += P2_C2; /* C2->P2 */ + PC = P2 - gamma_ * P1_P2 / (1.0 - gamma_); + } + /* dual-frequency */ + else + { + P1 += P1_C1; + P2 += P2_C2; + PC = (gamma_ * P1 - P2) / (gamma_ - 1.0); + } + } + if (opt->sateph == EPHOPT_SBAS) + { + PC -= P1_C1; + } /* sbas clock based C1 */ *var = std::pow(ERR_CBIAS, 2.0); @@ -195,11 +219,11 @@ double prange(const obsd_t *obs, const nav_t *nav, const double *azel, * return : status(1:ok,0:error) *-----------------------------------------------------------------------------*/ int ionocorr(gtime_t time, const nav_t *nav, int sat, const double *pos, - const double *azel, int ionoopt, double *ion, double *var) + const double *azel, int ionoopt, double *ion, double *var) { trace(4, "ionocorr: time=%s opt=%d sat=%2d pos=%.3f %.3f azel=%.3f %.3f\n", - time_str(time, 3), ionoopt, sat, pos[0]*R2D, pos[1]*R2D, azel[0]*R2D, - azel[1]*R2D); + time_str(time, 3), ionoopt, sat, pos[0] * R2D, pos[1] * R2D, azel[0] * R2D, + azel[1] * R2D); /* broadcast model */ if (ionoopt == IONOOPT_BRDC) @@ -219,7 +243,7 @@ int ionocorr(gtime_t time, const nav_t *nav, int sat, const double *pos, return iontec(time, nav, pos, azel, 1, ion, var); } /* qzss broadcast model */ - if (ionoopt == IONOOPT_QZS && norm_rtk(nav->ion_qzs, 8)>0.0) + if (ionoopt == IONOOPT_QZS && norm_rtk(nav->ion_qzs, 8) > 0.0) { *ion = ionmodel(time, nav->ion_qzs, pos, azel); *var = std::pow(*ion * ERR_BRDCI, 2.0); @@ -247,11 +271,11 @@ int ionocorr(gtime_t time, const nav_t *nav, int sat, const double *pos, * return : status(1:ok,0:error) *-----------------------------------------------------------------------------*/ int tropcorr(gtime_t time, const nav_t *nav __attribute__((unused)), const double *pos, - const double *azel, int tropopt, double *trp, double *var) + const double *azel, int tropopt, double *trp, double *var) { trace(4, "tropcorr: time=%s opt=%d pos=%.3f %.3f azel=%.3f %.3f\n", - time_str(time, 3), tropopt, pos[0]*R2D, pos[1]*R2D, azel[0]*R2D, - azel[1]*R2D); + time_str(time, 3), tropopt, pos[0] * R2D, pos[1] * R2D, azel[0] * R2D, + azel[1] * R2D); /* saastamoinen model */ if (tropopt == TROPOPT_SAAS || tropopt == TROPOPT_EST || tropopt == TROPOPT_ESTG) @@ -275,10 +299,10 @@ int tropcorr(gtime_t time, const nav_t *nav __attribute__((unused)), const doubl /* pseudorange residuals -----------------------------------------------------*/ int rescode(int iter, const obsd_t *obs, int n, const double *rs, - const double *dts, const double *vare, const int *svh, - const nav_t *nav, const double *x, const prcopt_t *opt, - double *v, double *H, double *var, double *azel, int *vsat, - double *resp, int *ns) + const double *dts, const double *vare, const int *svh, + const nav_t *nav, const double *x, const prcopt_t *opt, + double *v, double *H, double *var, double *azel, int *vsat, + double *resp, int *ns) { double r, dion, dtrp, vmeas, vion, vtrp, rr[3], pos[3], dtr, e[3], P, lam_L1; int i, j, nv = 0, sys, mask[4] = {0}; @@ -293,15 +317,15 @@ int rescode(int iter, const obsd_t *obs, int n, const double *rs, for (i = *ns = 0; i < n && i < MAXOBS; i++) { vsat[i] = 0; - azel[i*2] = azel[1+i*2] = resp[i] = 0.0; + azel[i * 2] = azel[1 + i * 2] = resp[i] = 0.0; if (!(sys = satsys(obs[i].sat, NULL))) continue; /* reject duplicated observation data */ - if (i < n - 1 && i < MAXOBS - 1 && obs[i].sat == obs[i+1].sat) + if (i < n - 1 && i < MAXOBS - 1 && obs[i].sat == obs[i + 1].sat) { trace(2, "duplicated observation data %s sat=%2d\n", - time_str(obs[i].time, 3), obs[i].sat); + time_str(obs[i].time, 3), obs[i].sat); i++; continue; } @@ -312,13 +336,13 @@ int rescode(int iter, const obsd_t *obs, int n, const double *rs, continue; } double elaux = satazel(pos, e, azel + i * 2); - if(elaux < opt->elmin) + if (elaux < opt->elmin) { trace(4, "satazel error. el = %lf , elmin = %lf\n", elaux, opt->elmin); continue; } /* psudorange with code bias correction */ - if ((P = prange(obs+i, nav, azel+i*2, iter, opt, &vmeas)) == 0.0) + if ((P = prange(obs + i, nav, azel + i * 2, iter, opt, &vmeas)) == 0.0) { trace(4, "prange error\n"); continue; @@ -332,8 +356,8 @@ int rescode(int iter, const obsd_t *obs, int n, const double *rs, } /* ionospheric corrections */ - if (!ionocorr(obs[i].time, nav, obs[i].sat, pos, azel+i*2, - iter>0 ? opt->ionoopt : IONOOPT_BRDC, &dion, &vion)) + if (!ionocorr(obs[i].time, nav, obs[i].sat, pos, azel + i * 2, + iter > 0 ? opt->ionoopt : IONOOPT_BRDC, &dion, &vion)) { trace(4, "ionocorr error\n"); continue; @@ -345,33 +369,49 @@ int rescode(int iter, const obsd_t *obs, int n, const double *rs, dion *= std::pow(lam_L1 / lam_carr[0], 2.0); } /* tropospheric corrections */ - if (!tropcorr(obs[i].time, nav, pos, azel + i*2, + if (!tropcorr(obs[i].time, nav, pos, azel + i * 2, iter > 0 ? opt->tropopt : TROPOPT_SAAS, &dtrp, &vtrp)) { trace(4, "tropocorr error\n"); continue; } /* pseudorange residual */ - v[nv] = P - (r + dtr - SPEED_OF_LIGHT * dts[i*2] + dion + dtrp); + v[nv] = P - (r + dtr - SPEED_OF_LIGHT * dts[i * 2] + dion + dtrp); /* design matrix */ - for (j = 0; j < NX; j++) H[j + nv * NX] = j < 3 ? - e[j] : (j == 3 ? 1.0 : 0.0); + for (j = 0; j < NX; j++) H[j + nv * NX] = j < 3 ? -e[j] : (j == 3 ? 1.0 : 0.0); /* time system and receiver bias offset correction */ - if (sys == SYS_GLO) {v[nv] -= x[4]; H[4+nv*NX] = 1.0; mask[1] = 1;} - else if (sys == SYS_GAL) {v[nv] -= x[5]; H[5+nv*NX] = 1.0; mask[2] = 1;} - else if (sys == SYS_BDS) {v[nv] -= x[6]; H[6+nv*NX] = 1.0; mask[3] = 1;} - else mask[0] = 1; + if (sys == SYS_GLO) + { + v[nv] -= x[4]; + H[4 + nv * NX] = 1.0; + mask[1] = 1; + } + else if (sys == SYS_GAL) + { + v[nv] -= x[5]; + H[5 + nv * NX] = 1.0; + mask[2] = 1; + } + else if (sys == SYS_BDS) + { + v[nv] -= x[6]; + H[6 + nv * NX] = 1.0; + mask[3] = 1; + } + else + mask[0] = 1; vsat[i] = 1; resp[i] = v[nv]; (*ns)++; /* error variance */ - var[nv++] = varerr(opt, azel[1+i*2], sys) + vare[i] + vmeas + vion + vtrp; + var[nv++] = varerr(opt, azel[1 + i * 2], sys) + vare[i] + vmeas + vion + vtrp; trace(4, "sat=%2d azel=%5.1f %4.1f res=%7.3f sig=%5.3f\n", obs[i].sat, - azel[i*2] * R2D, azel[1+i*2] * R2D, resp[i], sqrt(var[nv-1])); + azel[i * 2] * R2D, azel[1 + i * 2] * R2D, resp[i], sqrt(var[nv - 1])); } /* constraint to avoid rank-deficient */ for (i = 0; i < 4; i++) @@ -387,10 +427,10 @@ int rescode(int iter, const obsd_t *obs, int n, const double *rs, /* validate solution ---------------------------------------------------------*/ int valsol(const double *azel, const int *vsat, int n, - const prcopt_t *opt, const double *v, int nv, int nx, - char *msg) + const prcopt_t *opt, const double *v, int nv, int nx, + char *msg) { - double azels[MAXOBS*2] = {0}; + double azels[MAXOBS * 2] = {0}; double dop[4], vv; int i, ns; @@ -398,17 +438,17 @@ int valsol(const double *azel, const int *vsat, int n, /* chi-square validation of residuals */ vv = dot(v, v, nv); - if (nv > nx && vv > chisqr[nv-nx-1]) + if (nv > nx && vv > chisqr[nv - nx - 1]) { - sprintf(msg, "chi-square error nv=%d vv=%.1f cs=%.1f", nv, vv, chisqr[nv-nx-1]); + sprintf(msg, "chi-square error nv=%d vv=%.1f cs=%.1f", nv, vv, chisqr[nv - nx - 1]); return 0; } /* large gdop check */ for (i = ns = 0; i < n; i++) { if (!vsat[i]) continue; - azels[ ns*2] = azel[ i*2]; - azels[1+ns*2] = azel[1+i*2]; + azels[ns * 2] = azel[i * 2]; + azels[1 + ns * 2] = azel[1 + i * 2]; ns++; } dops(ns, azels, opt->elmin, dop); @@ -423,11 +463,11 @@ int valsol(const double *azel, const int *vsat, int n, /* estimate receiver position ------------------------------------------------*/ int estpos(const obsd_t *obs, int n, const double *rs, const double *dts, - const double *vare, const int *svh, const nav_t *nav, - const prcopt_t *opt, sol_t *sol, double *azel, int *vsat, - double *resp, char *msg) + const double *vare, const int *svh, const nav_t *nav, + const prcopt_t *opt, sol_t *sol, double *azel, int *vsat, + double *resp, char *msg) { - double x[NX] = {0}, dx[NX], Q[NX*NX], *v, *H, *var, sig; + double x[NX] = {0}, dx[NX], Q[NX * NX], *v, *H, *var, sig; int i, j, k, info, stat, nv, ns; trace(3, "estpos : n=%d\n", n); @@ -449,7 +489,7 @@ int estpos(const obsd_t *obs, int n, const double *rs, const double *dts, break; } /* weight by variance */ - for (j = 0;j < nv; j++) + for (j = 0; j < nv; j++) { sig = sqrt(var[j]); v[j] /= sig; @@ -473,9 +513,9 @@ int estpos(const obsd_t *obs, int n, const double *rs, const double *dts, sol->dtr[3] = x[6] / SPEED_OF_LIGHT; /* bds-gps time offset (s) */ for (j = 0; j < 6; j++) sol->rr[j] = j < 3 ? x[j] : 0.0; for (j = 0; j < 3; j++) sol->qr[j] = (float)Q[j + j * NX]; - sol->qr[3] = (float)Q[1]; /* cov xy */ + sol->qr[3] = (float)Q[1]; /* cov xy */ sol->qr[4] = (float)Q[2 + NX]; /* cov yz */ - sol->qr[5] = (float)Q[2]; /* cov zx */ + sol->qr[5] = (float)Q[2]; /* cov zx */ sol->ns = (unsigned char)ns; sol->age = sol->ratio = 0.0; @@ -502,13 +542,13 @@ int estpos(const obsd_t *obs, int n, const double *rs, const double *dts, /* raim fde (failure detection and exclution) -------------------------------*/ -int raim_fde(const obsd_t *obs, int n, const double *rs, - const double *dts, const double *vare, const int *svh, - const nav_t *nav, const prcopt_t *opt, sol_t *sol, - double *azel, int *vsat, double *resp, char *msg) +int raim_fde(const obsd_t *obs, int n, const double *rs, + const double *dts, const double *vare, const int *svh, + const nav_t *nav, const prcopt_t *opt, sol_t *sol, + double *azel, int *vsat, double *resp, char *msg) { 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]; double *rs_e, *dts_e, *vare_e, *azel_e, *resp_e, rms_e, rms = 100.0; int i, j, k, nvsat, stat = 0, *svh_e, *vsat_e, sat = 0; @@ -537,7 +577,7 @@ int raim_fde(const obsd_t *obs, int n, const double *rs, svh_e[k++] = svh[j]; } /* estimate receiver position without a satellite */ - if (!estpos(obs_e, n-1, rs_e, dts_e, vare_e, svh_e, nav, opt, &sol_e, azel_e, + if (!estpos(obs_e, n - 1, rs_e, dts_e, vare_e, svh_e, nav, opt, &sol_e, azel_e, vsat_e, resp_e, msg_e)) { trace(3, "raim_fde: exsat=%2d (%s)\n", obs[i].sat, msg); @@ -552,7 +592,7 @@ int raim_fde(const obsd_t *obs, int n, const double *rs, if (nvsat < 5) { trace(3, "raim_fde: exsat=%2d lack of satellites nvsat=%2d\n", - obs[i].sat, nvsat); + obs[i].sat, nvsat); continue; } rms_e = sqrt(rms_e / nvsat); @@ -578,7 +618,8 @@ int raim_fde(const obsd_t *obs, int n, const double *rs, } if (stat) { - time2str(obs[0].time, tstr, 2); satno2id(sat, name); + time2str(obs[0].time, tstr, 2); + satno2id(sat, name); trace(2, "%s: %s excluded by raim\n", tstr + 11, name); } free(obs_e); @@ -596,8 +637,8 @@ int raim_fde(const obsd_t *obs, int n, const double *rs, /* doppler residuals ---------------------------------------------------------*/ 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 double *azel, const int *vsat, double *v, double *H) + const nav_t *nav, const double *rr, const double *x, + const double *azel, const int *vsat, double *v, double *H) { double lam, rate, pos[3], E[9], a[3], e[3], vs[3], cosel; int i, j, nv = 0; @@ -609,31 +650,30 @@ int resdop(const obsd_t *obs, int n, const double *rs, const double *dts, for (i = 0; i < n && i < MAXOBS; i++) { - lam = nav->lam[obs[i].sat-1][0]; + lam = nav->lam[obs[i].sat - 1][0]; if (obs[i].D[0] == 0.0 || lam == 0.0 || !vsat[i] || norm_rtk(rs + 3 + i * 6, 3) <= 0.0) { continue; } /* line-of-sight vector in ecef */ - cosel = cos(azel[1+i*2]); - a[0] = sin(azel[i*2]) * cosel; - a[1] = cos(azel[i*2]) * cosel; - a[2] = sin(azel[1+i*2]); + cosel = cos(azel[1 + i * 2]); + a[0] = sin(azel[i * 2]) * cosel; + a[1] = cos(azel[i * 2]) * cosel; + a[2] = sin(azel[1 + i * 2]); matmul("TN", 3, 1, 3, 1.0, E, a, 0.0, e); /* satellite velocity relative to receiver in ecef */ - for (j = 0; j < 3; j++) vs[j] = rs[j+3+i*6] - x[j]; + for (j = 0; j < 3; j++) vs[j] = rs[j + 3 + i * 6] - x[j]; /* range rate with earth rotation correction */ - rate = dot(vs, e, 3) + DEFAULT_OMEGA_EARTH_DOT / SPEED_OF_LIGHT * (rs[4 + i * 6] * rr[0] + rs[1 + i * 6] * x[0]- - rs[3 + i * 6] * rr[1] - rs[i * 6] * x[1]); + rate = dot(vs, e, 3) + DEFAULT_OMEGA_EARTH_DOT / SPEED_OF_LIGHT * (rs[4 + i * 6] * rr[0] + rs[1 + i * 6] * x[0] - rs[3 + i * 6] * rr[1] - rs[i * 6] * x[1]); /* doppler residual */ - v[nv] =- lam * obs[i].D[0] - (rate + x[3] - SPEED_OF_LIGHT * dts[1 + i *2]); + v[nv] = -lam * obs[i].D[0] - (rate + x[3] - SPEED_OF_LIGHT * dts[1 + i * 2]); /* design matrix */ - for (j = 0; j < 4; j++) H[j + nv * 4] = j < 3 ? - e[j] : 1.0; + for (j = 0; j < 4; j++) H[j + nv * 4] = j < 3 ? -e[j] : 1.0; nv++; } @@ -643,8 +683,8 @@ int resdop(const obsd_t *obs, int n, const double *rs, const double *dts, /* estimate receiver velocity ------------------------------------------------*/ 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 double *azel, const int *vsat) + const nav_t *nav, const prcopt_t *opt __attribute__((unused)), sol_t *sol, + const double *azel, const int *vsat) { double x[4] = {0}, dx[4], Q[16], *v, *H; int i, j, nv; @@ -668,7 +708,7 @@ void estvel(const obsd_t *obs, int n, const double *rs, const double *dts, if (norm_rtk(dx, 4) < 1e-6) { - for (i = 0; i < 3; i++) sol->rr[i+3] = x[i]; + for (i = 0; i < 3; i++) sol->rr[i + 3] = x[i]; break; } } @@ -694,8 +734,8 @@ void estvel(const obsd_t *obs, int n, const double *rs, const double *dts, * and receiver bias) *-----------------------------------------------------------------------------*/ int pntpos(const obsd_t *obs, int n, const nav_t *nav, - const prcopt_t *opt, sol_t *sol, double *azel, ssat_t *ssat, - char *msg) + const prcopt_t *opt, sol_t *sol, double *azel, ssat_t *ssat, + char *msg) { prcopt_t opt_ = *opt; double *rs, *dts, *var, *azel_, *resp; @@ -703,7 +743,11 @@ int pntpos(const obsd_t *obs, int n, const nav_t *nav, sol->stat = SOLQ_NONE; - if (n <= 0) {strcpy(msg, "no observation data"); return 0;} + if (n <= 0) + { + strcpy(msg, "no observation data"); + return 0; + } trace(3, "pntpos : tobs=%s n=%d\n", time_str(obs[0].time, 3), n); @@ -753,12 +797,12 @@ int pntpos(const obsd_t *obs, int n, const nav_t *nav, } for (i = 0; i < n; i++) { - ssat[obs[i].sat-1].azel[0] = azel_[ i*2]; - ssat[obs[i].sat-1].azel[1] = azel_[1+i*2]; - ssat[obs[i].sat-1].snr[0] = obs[i].SNR[0]; + ssat[obs[i].sat - 1].azel[0] = azel_[i * 2]; + ssat[obs[i].sat - 1].azel[1] = azel_[1 + i * 2]; + ssat[obs[i].sat - 1].snr[0] = obs[i].SNR[0]; if (!vsat[i]) continue; - ssat[obs[i].sat-1].vs = 1; - ssat[obs[i].sat-1].resp[0] = resp[i]; + ssat[obs[i].sat - 1].vs = 1; + ssat[obs[i].sat - 1].resp[0] = resp[i]; } } free(rs); diff --git a/src/algorithms/libs/rtklib/rtklib_pntpos.h b/src/algorithms/libs/rtklib/rtklib_pntpos.h index 5dd969943..596d6b443 100644 --- a/src/algorithms/libs/rtklib/rtklib_pntpos.h +++ b/src/algorithms/libs/rtklib/rtklib_pntpos.h @@ -57,10 +57,10 @@ #include "rtklib_rtkcmn.h" /* constants -----------------------------------------------------------------*/ -const int NX = 4 + 3; //!< # of estimated parameters -const int MAXITR = 10; //!< max number of iteration for point pos -const double ERR_ION = 5.0; //!< ionospheric delay std (m) -const double ERR_TROP = 3.0; //!< tropspheric delay std (m) +const int NX = 4 + 3; //!< # of estimated parameters +const int MAXITR = 10; //!< max number of iteration for point pos +const double ERR_ION = 5.0; //!< ionospheric delay std (m) +const double ERR_TROP = 3.0; //!< tropspheric delay std (m) /* pseudorange measurement error variance ------------------------------------*/ @@ -71,7 +71,7 @@ double gettgd(int sat, const nav_t *nav); /* psendorange with code bias correction -------------------------------------*/ double prange(const obsd_t *obs, const nav_t *nav, const double *azel, - int iter, const prcopt_t *opt, double *var); + int iter, const prcopt_t *opt, double *var); /* ionospheric correction ------------------------------------------------------ * compute ionospheric correction @@ -86,7 +86,7 @@ double prange(const obsd_t *obs, const nav_t *nav, const double *azel, * return : status(1:ok,0:error) *-----------------------------------------------------------------------------*/ int ionocorr(gtime_t time, const nav_t *nav, int sat, const double *pos, - const double *azel, int ionoopt, double *ion, double *var); + const double *azel, int ionoopt, double *ion, double *var); /* tropospheric correction ----------------------------------------------------- * compute tropospheric correction * args : gtime_t time I time @@ -99,41 +99,41 @@ int ionocorr(gtime_t time, const nav_t *nav, int sat, const double *pos, * return : status(1:ok,0:error) *-----------------------------------------------------------------------------*/ int tropcorr(gtime_t time, const nav_t *nav, const double *pos, - const double *azel, int tropopt, double *trp, double *var); + const double *azel, int tropopt, double *trp, double *var); /* pseudorange residuals -----------------------------------------------------*/ int rescode(int iter, const obsd_t *obs, int n, const double *rs, - const double *dts, const double *vare, const int *svh, - const nav_t *nav, const double *x, const prcopt_t *opt, - double *v, double *H, double *var, double *azel, int *vsat, - double *resp, int *ns); + const double *dts, const double *vare, const int *svh, + const nav_t *nav, const double *x, const prcopt_t *opt, + double *v, double *H, double *var, double *azel, int *vsat, + double *resp, int *ns); /* validate solution ---------------------------------------------------------*/ int valsol(const double *azel, const int *vsat, int n, - const prcopt_t *opt, const double *v, int nv, int nx, - char *msg); + const prcopt_t *opt, const double *v, int nv, int nx, + char *msg); /* estimate receiver position ------------------------------------------------*/ int estpos(const obsd_t *obs, int n, const double *rs, const double *dts, - const double *vare, const int *svh, const nav_t *nav, - const prcopt_t *opt, sol_t *sol, double *azel, int *vsat, - double *resp, char *msg); + const double *vare, const int *svh, const nav_t *nav, + const prcopt_t *opt, sol_t *sol, double *azel, int *vsat, + double *resp, char *msg); /* raim fde (failure detection and exclution) -------------------------------*/ int raim_fde(const obsd_t *obs, int n, const double *rs, - const double *dts, const double *vare, const int *svh, - const nav_t *nav, const prcopt_t *opt, sol_t *sol, - double *azel, int *vsat, double *resp, char *msg); + const double *dts, const double *vare, const int *svh, + const nav_t *nav, const prcopt_t *opt, sol_t *sol, + double *azel, int *vsat, double *resp, char *msg); /* doppler residuals ---------------------------------------------------------*/ 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 double *azel, const int *vsat, double *v, double *H); + const nav_t *nav, const double *rr, const double *x, + const double *azel, const int *vsat, double *v, double *H); /* estimate receiver velocity ------------------------------------------------*/ void estvel(const obsd_t *obs, int n, const double *rs, const double *dts, - const nav_t *nav, const prcopt_t *opt, sol_t *sol, - const double *azel, const int *vsat); + const nav_t *nav, const prcopt_t *opt, sol_t *sol, + const double *azel, const int *vsat); /*! * \brief single-point positioning @@ -153,7 +153,7 @@ void estvel(const obsd_t *obs, int n, const double *rs, const double *dts, * and receiver bias) */ int pntpos(const obsd_t *obs, int n, const nav_t *nav, - const prcopt_t *opt, sol_t *sol, double *azel, ssat_t *ssat, - char *msg); + const prcopt_t *opt, sol_t *sol, double *azel, ssat_t *ssat, + char *msg); #endif /* GNSS_SDR_RTKLIB_PNTPOS_H_ */ diff --git a/src/algorithms/libs/rtklib/rtklib_ppp.cc b/src/algorithms/libs/rtklib/rtklib_ppp.cc index 96ccb7237..285424873 100644 --- a/src/algorithms/libs/rtklib/rtklib_ppp.cc +++ b/src/algorithms/libs/rtklib/rtklib_ppp.cc @@ -63,7 +63,7 @@ double lam_LC(int i, int j, int k) { const double f1 = FREQ1, f2 = FREQ2, f5 = FREQ5; - return SPEED_OF_LIGHT/(i*f1+j*f2+k*f5); + return SPEED_OF_LIGHT / (i * f1 + j * f2 + k * f5); } @@ -77,10 +77,10 @@ double L_LC(int i, int j, int k, const double *L) { return 0.0; } - L1 = SPEED_OF_LIGHT/f1*L[0]; - L2 = SPEED_OF_LIGHT/f2*L[1]; - L5 = SPEED_OF_LIGHT/f5*L[2]; - return (i*f1*L1+j*f2*L2+k*f5*L5)/(i*f1+j*f2+k*f5); + L1 = SPEED_OF_LIGHT / f1 * L[0]; + L2 = SPEED_OF_LIGHT / f2 * L[1]; + L5 = SPEED_OF_LIGHT / f5 * L[2]; + return (i * f1 * L1 + j * f2 * L2 + k * f5 * L5) / (i * f1 + j * f2 + k * f5); } @@ -97,7 +97,7 @@ double P_LC(int i, int j, int k, const double *P) P1 = P[0]; P2 = P[1]; P5 = P[2]; - return (i*f1*P1+j*f2*P2+k*f5*P5)/(i*f1+j*f2+k*f5); + return (i * f1 * P1 + j * f2 * P2 + k * f5 * P5) / (i * f1 + j * f2 + k * f5); } @@ -106,7 +106,7 @@ double var_LC(int i, int j, int k, double sig) { const double f1 = FREQ1, f2 = FREQ2, 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); } @@ -117,15 +117,15 @@ double p_gamma(double a, double x, double log_gamma_a) int i; if (x == 0.0) return 0.0; - if (x >= a+1.0) return 1.0-q_gamma(a, x, log_gamma_a); + if (x >= a + 1.0) return 1.0 - q_gamma(a, x, log_gamma_a); - y = w = exp(a*log(x)-x-log_gamma_a)/a; + y = w = exp(a * log(x) - x - log_gamma_a) / a; - for (i = 1;i<100;i++) + for (i = 1; i < 100; i++) { - w *= x/(a+i); + w *= x / (a + i); y += w; - if (fabs(w)<1E-15) break; + if (fabs(w) < 1E-15) break; } return y; } @@ -133,19 +133,20 @@ double p_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, w, la = 1.0, lb = x + 1.0 - a, lc; int i; - if (x= 0.0?q_gamma(0.5, x*x, LOG_PI/2.0):1.0+p_gamma(0.5, x*x, LOG_PI/2.0); + return x >= 0.0 ? q_gamma(0.5, x * x, LOG_PI / 2.0) : 1.0 + p_gamma(0.5, x * x, LOG_PI / 2.0); } @@ -163,10 +164,10 @@ double conffunc(int N, double B, double sig) double x, p = 1.0; int i; - x = fabs(B-N); - for (i = 1;i<8;i++) + x = fabs(B - N); + for (i = 1; i < 8; i++) { - p -= f_erfc((i-x)/(SQRT2*sig))-f_erfc((i+x)/(SQRT2*sig)); + p -= f_erfc((i - x) / (SQRT2 * sig)) - f_erfc((i + x) / (SQRT2 * sig)); } return p; } @@ -174,63 +175,62 @@ double conffunc(int N, double B, double sig) /* average LC ----------------------------------------------------------------*/ void average_LC(rtk_t *rtk, const obsd_t *obs, int n, const nav_t *nav __attribute__((unused)), - const double *azel) + const double *azel) { ambc_t *amb; double LC1, LC2, LC3, var1, var2, var3, sig; int i, j, sat; - for (i = 0;iopt.elmin) continue; + if (azel[1 + 2 * i] < rtk->opt.elmin) continue; if (satsys(sat, NULL) != SYS_GPS) continue; /* triple-freq carrier and code LC (m) */ - LC1 = L_LC(1, -1, 0, obs[i].L)-P_LC(1, 1, 0, obs[i].P); - LC2 = L_LC(0, 1, -1, obs[i].L)-P_LC(0, 1, 1, obs[i].P); - LC3 = L_LC(1, -6, 5, obs[i].L)-P_LC(1, 1, 0, obs[i].P); + LC1 = L_LC(1, -1, 0, obs[i].L) - P_LC(1, 1, 0, obs[i].P); + LC2 = L_LC(0, 1, -1, obs[i].L) - P_LC(0, 1, 1, obs[i].P); + LC3 = L_LC(1, -6, 5, obs[i].L) - P_LC(1, 1, 0, obs[i].P); - sig = std::sqrt(std::pow(rtk->opt.err[1], 2.0)+std::pow(rtk->opt.err[2]/sin(azel[1+2*i]), 2.0)); + sig = std::sqrt(std::pow(rtk->opt.err[1], 2.0) + std::pow(rtk->opt.err[2] / sin(azel[1 + 2 * i]), 2.0)); /* measurement noise variance (m) */ - var1 = var_LC(1, 1, 0, sig*rtk->opt.eratio[0]); - var2 = var_LC(0, 1, 1, sig*rtk->opt.eratio[0]); - var3 = var_LC(1, 1, 0, sig*rtk->opt.eratio[0]); + var1 = var_LC(1, 1, 0, sig * rtk->opt.eratio[0]); + var2 = var_LC(0, 1, 1, sig * rtk->opt.eratio[0]); + var3 = var_LC(1, 1, 0, sig * rtk->opt.eratio[0]); - amb = rtk->ambc+sat-1; + amb = rtk->ambc + sat - 1; - if (rtk->ssat[sat-1].slip[0] || rtk->ssat[sat-1].slip[1] || - rtk->ssat[sat-1].slip[2] || amb->n[0] == 0.0 || - fabs(timediff(amb->epoch[0], obs[0].time))>MIN_ARC_GAP) + if (rtk->ssat[sat - 1].slip[0] || rtk->ssat[sat - 1].slip[1] || + rtk->ssat[sat - 1].slip[2] || amb->n[0] == 0.0 || + fabs(timediff(amb->epoch[0], obs[0].time)) > MIN_ARC_GAP) { - amb->n[0] = amb->n[1] = amb->n[2] = 0.0; amb->LC[0] = amb->LC[1] = amb->LC[2] = 0.0; amb->LCv[0] = amb->LCv[1] = amb->LCv[2] = 0.0; amb->fixcnt = 0; - for (j = 0;jflags[j] = 0; + for (j = 0; j < MAXSAT; j++) amb->flags[j] = 0; } /* averaging */ if (LC1) { amb->n[0] += 1.0; - amb->LC [0] += (LC1 -amb->LC [0])/amb->n[0]; - amb->LCv[0] += (var1-amb->LCv[0])/amb->n[0]; + amb->LC[0] += (LC1 - amb->LC[0]) / amb->n[0]; + amb->LCv[0] += (var1 - amb->LCv[0]) / amb->n[0]; } if (LC2) { amb->n[1] += 1.0; - amb->LC [1] += (LC2 -amb->LC [1])/amb->n[1]; - amb->LCv[1] += (var2-amb->LCv[1])/amb->n[1]; + amb->LC[1] += (LC2 - amb->LC[1]) / amb->n[1]; + amb->LCv[1] += (var2 - amb->LCv[1]) / amb->n[1]; } if (LC3) { amb->n[2] += 1.0; - amb->LC [2] += (LC3 -amb->LC [2])/amb->n[2]; - amb->LCv[2] += (var3-amb->LCv[2])/amb->n[2]; + amb->LC[2] += (LC3 - amb->LC[2]) / amb->n[2]; + amb->LCv[2] += (var3 - amb->LCv[2]) / amb->n[2]; } amb->epoch[0] = obs[0].time; } @@ -243,24 +243,24 @@ int fix_amb_WL(rtk_t *rtk, const nav_t *nav, int sat1, int sat2, int *NW) ambc_t *amb1, *amb2; double BW, vW, lam_WL = lam_LC(1, -1, 0); - amb1 = rtk->ambc+sat1-1; - amb2 = rtk->ambc+sat2-1; + amb1 = rtk->ambc + sat1 - 1; + amb2 = rtk->ambc + sat2 - 1; if (!amb1->n[0] || !amb2->n[0]) return 0; - /* wide-lane ambiguity */ + /* wide-lane ambiguity */ #ifndef REV_WL_FCB - BW = (amb1->LC[0]-amb2->LC[0])/lam_WL+nav->wlbias[sat1-1]-nav->wlbias[sat2-1]; + BW = (amb1->LC[0] - amb2->LC[0]) / lam_WL + nav->wlbias[sat1 - 1] - nav->wlbias[sat2 - 1]; #else - BW = (amb1->LC[0]-amb2->LC[0])/lam_WL-nav->wlbias[sat1-1]+nav->wlbias[sat2-1]; + BW = (amb1->LC[0] - amb2->LC[0]) / lam_WL - nav->wlbias[sat1 - 1] + nav->wlbias[sat2 - 1]; #endif *NW = ROUND_PPP(BW); /* variance of wide-lane ambiguity */ - vW = (amb1->LCv[0]/amb1->n[0]+amb2->LCv[0]/amb2->n[0])/std::pow(lam_WL, 2.0); + vW = (amb1->LCv[0] / amb1->n[0] + amb2->LCv[0] / amb2->n[0]) / std::pow(lam_WL, 2.0); /* validation of integer wide-lane ambigyity */ - return fabs(*NW-BW) <= rtk->opt.thresar[2] && - conffunc(*NW, BW, sqrt(vW)) >= rtk->opt.thresar[1]; + return fabs(*NW - BW) <= rtk->opt.thresar[2] && + conffunc(*NW, BW, sqrt(vW)) >= rtk->opt.thresar[1]; } @@ -269,26 +269,30 @@ int is_depend(int sat1, int sat2, int *flgs, int *max_flg) { int i; - if (flgs[sat1-1] == 0 && flgs[sat2-1] == 0){ - flgs[sat1-1]=flgs[sat2-1]=++(*max_flg); - } - else if (flgs[sat1-1] == 0 && flgs[sat2-1] != 0) + if (flgs[sat1 - 1] == 0 && flgs[sat2 - 1] == 0) { - flgs[sat1-1] = flgs[sat2-1]; + flgs[sat1 - 1] = flgs[sat2 - 1] = ++(*max_flg); } - else if (flgs[sat1-1] != 0 && flgs[sat2-1] == 0) + else if (flgs[sat1 - 1] == 0 && flgs[sat2 - 1] != 0) { - flgs[sat2-1] = flgs[sat1-1]; + flgs[sat1 - 1] = flgs[sat2 - 1]; } - else if (flgs[sat1-1]>flgs[sat2-1]) + else if (flgs[sat1 - 1] != 0 && flgs[sat2 - 1] == 0) { - for (i = 0;i flgs[sat2 - 1]) { - for (i = 0;i= var[j-1]) continue; - SWAP_I(sat1[j], sat1[j-1]); - SWAP_I(sat2[j], sat2[j-1]); - SWAP_D(N[j], N[j-1]); - SWAP_D(var[j], var[j-1]); - } + for (i = 0; i < n; i++) + for (j = 1; j < n - i; j++) + { + if (var[j] >= var[j - 1]) continue; + SWAP_I(sat1[j], sat1[j - 1]); + SWAP_I(sat2[j], sat2[j - 1]); + SWAP_D(N[j], N[j - 1]); + SWAP_D(var[j], var[j - 1]); + } /* select linearly independent satellite pair */ - for (i = j = 0;inx, n); R = zeros(n, n); + v = zeros(n, 1); + H = zeros(rtk->nx, n); + R = zeros(n, n); /* constraints to fixed ambiguities */ - for (i = 0;iopt); k = IB_PPP(sat2[i], &rtk->opt); - v[i] = NC[i]-(rtk->x[j]-rtk->x[k]); - H[j+i*rtk->nx] = 1.0; - H[k+i*rtk->nx] = -1.0; - R[i+i*n] = std::pow(CONST_AMB, 2.0); + v[i] = NC[i] - (rtk->x[j] - rtk->x[k]); + H[j + i * rtk->nx] = 1.0; + H[k + i * rtk->nx] = -1.0; + R[i + i * n] = std::pow(CONST_AMB, 2.0); } /* update states with constraints */ if ((info = filter(rtk->x, rtk->P, H, v, R, rtk->nx, n))) { trace(1, "filter error (info=%d)\n", info); - free(v); free(H); free(R); + free(v); + free(H); + free(R); return 0; } /* set solution */ - for (i = 0;ina;i++) + for (i = 0; i < rtk->na; i++) { rtk->xa[i] = rtk->x[i]; - for (j = 0;jna;j++) + for (j = 0; j < rtk->na; j++) { - rtk->Pa[i+j*rtk->na] = rtk->Pa[j+i*rtk->na] = rtk->P[i+j*rtk->nx]; + rtk->Pa[i + j * rtk->na] = rtk->Pa[j + i * rtk->na] = rtk->P[i + j * rtk->nx]; } } /* set flags */ - for (i = 0;iambc[sat1[i]-1].flags[sat2[i]-1] = 1; - rtk->ambc[sat2[i]-1].flags[sat1[i]-1] = 1; + rtk->ambc[sat1[i] - 1].flags[sat2[i] - 1] = 1; + rtk->ambc[sat2[i] - 1].flags[sat1[i] - 1] = 1; } - free(v); free(H); free(R); + free(v); + free(H); + free(R); return 1; } @@ -374,39 +385,41 @@ 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; int i, j, k, m = 0, N1, stat; - lam1 = lam_carr[0]; lam2 = lam_carr[1]; + lam1 = lam_carr[0]; + lam2 = lam_carr[1]; - C1 = std::pow(lam2, 2.0)/(std::pow(lam2, 2.0)-std::pow(lam1, 2.0)); - C2 = -std::pow(lam1, 2.0)/(std::pow(lam2, 2.0)-std::pow(lam1, 2.0)); + C1 = std::pow(lam2, 2.0) / (std::pow(lam2, 2.0) - std::pow(lam1, 2.0)); + C2 = -std::pow(lam1, 2.0) / (std::pow(lam2, 2.0) - std::pow(lam1, 2.0)); - NC = zeros(n, 1); var = zeros(n, 1); + NC = zeros(n, 1); + var = zeros(n, 1); - for (i = 0;iopt); k = IB_PPP(sat2[i], &rtk->opt); /* narrow-lane ambiguity */ - B1 = (rtk->x[j]-rtk->x[k]+C2*lam2*NW[i])/lam_NL; + B1 = (rtk->x[j] - rtk->x[k] + C2 * lam2 * NW[i]) / lam_NL; N1 = ROUND_PPP(B1); /* variance of narrow-lane ambiguity */ - var[m] = rtk->P[j+j*rtk->nx]+rtk->P[k+k*rtk->nx]-2.0*rtk->P[j+k*rtk->nx]; - v1 = var[m]/std::pow(lam_NL, 2.0); + var[m] = rtk->P[j + j * rtk->nx] + rtk->P[k + k * rtk->nx] - 2.0 * rtk->P[j + k * rtk->nx]; + v1 = var[m] / std::pow(lam_NL, 2.0); /* validation of narrow-lane ambiguity */ - if (fabs(N1-B1)>rtk->opt.thresar[2] || - conffunc(N1, B1, sqrt(v1))opt.thresar[1]) + if (fabs(N1 - B1) > rtk->opt.thresar[2] || + conffunc(N1, B1, sqrt(v1)) < rtk->opt.thresar[1]) { continue; } /* iono-free ambiguity (m) */ - BC = C1*lam1*N1+C2*lam2*(N1-NW[i]); + BC = C1 * lam1 * N1 + C2 * lam2 * (N1 - NW[i]); /* check residuals */ - v = rtk->ssat[sat1[i]-1].resc[0]-rtk->ssat[sat2[i]-1].resc[0]; - vc = v+(BC-(rtk->x[j]-rtk->x[k])); - if (fabs(vc)>THRES_RES) continue; + v = rtk->ssat[sat1[i] - 1].resc[0] - rtk->ssat[sat2[i] - 1].resc[0]; + vc = v + (BC - (rtk->x[j] - rtk->x[k])); + if (fabs(vc) > THRES_RES) continue; sat1[m] = sat1[i]; sat2[m] = sat2[i]; @@ -418,7 +431,8 @@ int fix_amb_ROUND(rtk_t *rtk, int *sat1, int *sat2, const int *NW, int n) /* fixed solution */ stat = fix_sol(rtk, sat1, sat2, NC, m); - free(NC); free(var); + free(NC); + free(var); return stat && m >= 3; } @@ -430,15 +444,20 @@ 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; int i, j, k, m = 0, info, stat, flgs[MAXSAT] = {0}, max_flg = 0; - lam1 = lam_carr[0]; lam2 = lam_carr[1]; + lam1 = lam_carr[0]; + lam2 = lam_carr[1]; - C1 = std::pow(lam2, 2.0)/(std::pow(lam2, 2.0)-std::pow(lam1, 2.0)); - C2 = -std::pow(lam1, 2.0)/(std::pow(lam2, 2.0)-std::pow(lam1, 2.0)); + C1 = std::pow(lam2, 2.0) / (std::pow(lam2, 2.0) - std::pow(lam1, 2.0)); + C2 = -std::pow(lam1, 2.0) / (std::pow(lam2, 2.0) - std::pow(lam1, 2.0)); - B1 = zeros(n, 1); N1 = zeros(n, 2); D = zeros(rtk->nx, n); E = mat(n, rtk->nx); - Q = mat(n, n); NC = mat(n, 1); + B1 = zeros(n, 1); + N1 = zeros(n, 2); + D = zeros(rtk->nx, n); + E = mat(n, rtk->nx); + Q = mat(n, n); + NC = mat(n, 1); - for (i = 0;iopt); /* float narrow-lane ambiguity (cycle) */ - B1[m] = (rtk->x[j]-rtk->x[k]+C2*lam2*NW[i])/lam_NL; + B1[m] = (rtk->x[j] - rtk->x[k] + C2 * lam2 * NW[i]) / lam_NL; N1[m] = ROUND_PPP(B1[m]); /* validation of narrow-lane ambiguity */ - if (fabs(N1[m]-B1[m])>rtk->opt.thresar[2]) continue; + if (fabs(N1[m] - B1[m]) > rtk->opt.thresar[2]) continue; /* narrow-lane ambiguity transformation matrix */ - D[j+m*rtk->nx] = 1.0/lam_NL; - D[k+m*rtk->nx] = -1.0/lam_NL; + D[j + m * rtk->nx] = 1.0 / lam_NL; + D[k + m * rtk->nx] = -1.0 / lam_NL; sat1[m] = sat1[i]; sat2[m] = sat2[i]; NW[m++] = NW[i]; } - if (m<3) + if (m < 3) { - free(B1); free(N1); free(D); free(E); free(Q); free(NC); + free(B1); + free(N1); + free(D); + free(E); + free(Q); + free(NC); return 0; } @@ -475,36 +499,56 @@ int fix_amb_ILS(rtk_t *rtk, int *sat1, int *sat2, int *NW, int n) if ((info = lambda(m, 2, B1, Q, N1, s))) { trace(2, "lambda error: info=%d\n", info); - free(B1); free(N1); free(D); free(E); free(Q); free(NC); + free(B1); + free(N1); + free(D); + free(E); + free(Q); + free(NC); return 0; } if (s[0] <= 0.0) { - free(B1); free(N1); free(D); free(E); free(Q); free(NC); + free(B1); + free(N1); + free(D); + free(E); + free(Q); + free(NC); return 0; } - rtk->sol.ratio = (float)(MIN_PPP(s[1]/s[0], 999.9)); + rtk->sol.ratio = (float)(MIN_PPP(s[1] / s[0], 999.9)); /* varidation by ratio-test */ - if (rtk->opt.thresar[0]>0.0 && rtk->sol.ratioopt.thresar[0]) + if (rtk->opt.thresar[0] > 0.0 && rtk->sol.ratio < rtk->opt.thresar[0]) { trace(2, "varidation error: n=%2d ratio=%8.3f\n", m, rtk->sol.ratio); - free(B1); free(N1); free(D); free(E); free(Q); free(NC); + free(B1); + free(N1); + free(D); + free(E); + free(Q); + free(NC); return 0; } trace(2, "varidation ok: %s n=%2d ratio=%8.3f\n", time_str(rtk->sol.time, 0), m, - rtk->sol.ratio); + rtk->sol.ratio); /* narrow-lane to iono-free ambiguity */ - for (i = 0;iopt.ionoopt != IONOOPT_IFLC || rtk->opt.nf<2) return 0; + if (n <= 0 || rtk->opt.ionoopt != IONOOPT_IFLC || rtk->opt.nf < 2) return 0; trace(3, "pppamb: time=%s n=%d\n", time_str(obs[0].time, 0), n); - elmask = rtk->opt.elmaskar>0.0?rtk->opt.elmaskar:rtk->opt.elmin; + elmask = rtk->opt.elmaskar > 0.0 ? rtk->opt.elmaskar : rtk->opt.elmin; - sat1 = imat(n*n, 1); sat2 = imat(n*n, 1); NW = imat(n*n, 1); + sat1 = imat(n * n, 1); + sat2 = imat(n * n, 1); + NW = imat(n * n, 1); /* average LC */ average_LC(rtk, obs, n, nav, azel); /* fix wide-lane ambiguity */ - for (i = 0;issat[obs[i].sat-1].vsat[0] || - !rtk->ssat[obs[j].sat-1].vsat[0] || - azel[1+i*2]ssat[obs[i].sat - 1].vsat[0] || + !rtk->ssat[obs[j].sat - 1].vsat[0] || + azel[1 + i * 2] < elmask || azel[1 + j * 2] < elmask) continue; #if 0 /* test already fixed */ if (rtk->ambc[obs[i].sat-1].flags[obs[j].sat-1] && rtk->ambc[obs[j].sat-1].flags[obs[i].sat-1]) continue; #endif - sat1[m] = obs[i].sat; - sat2[m] = obs[j].sat; - if (fix_amb_WL(rtk, nav, sat1[m], sat2[m], NW+m)) m++; - } + sat1[m] = obs[i].sat; + sat2[m] = obs[j].sat; + if (fix_amb_WL(rtk, nav, sat1[m], sat2[m], NW + m)) m++; + } /* fix narrow-lane ambiguity */ if (rtk->opt.modear == ARMODE_PPPAR) { @@ -552,7 +599,9 @@ int pppamb(rtk_t *rtk, const obsd_t *obs, int n, const nav_t *nav, { stat = fix_amb_ILS(rtk, sat1, sat2, NW, m); } - free(sat1); free(sat2); free(NW); + free(sat1); + free(sat2); + free(NW); return stat; } @@ -573,52 +622,52 @@ void pppoutsolstat(rtk_t *rtk, int level, FILE *fp) /* receiver position */ fprintf(fp, "$POS,%d,%.3f,%d,%.4f,%.4f,%.4f,%.4f,%.4f,%.4f\n", week, tow, - rtk->sol.stat, rtk->x[0], rtk->x[1], rtk->x[2], 0.0, 0.0, 0.0); + rtk->sol.stat, rtk->x[0], rtk->x[1], rtk->x[2], 0.0, 0.0, 0.0); /* receiver velocity and acceleration */ if (rtk->opt.dynamics) { ecef2pos(rtk->sol.rr, pos); - ecef2enu(pos, rtk->x+3, vel); - ecef2enu(pos, rtk->x+6, acc); + ecef2enu(pos, rtk->x + 3, vel); + ecef2enu(pos, rtk->x + 6, acc); fprintf(fp, "$VELACC,%d,%.3f,%d,%.4f,%.4f,%.4f,%.5f,%.5f,%.5f,%.4f,%.4f,%.4f,%.5f,%.5f,%.5f\n", - week, tow, rtk->sol.stat, vel[0], vel[1], vel[2], acc[0], acc[1], acc[2], - 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); + week, tow, rtk->sol.stat, vel[0], vel[1], vel[2], acc[0], acc[1], acc[2], + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); } /* receiver clocks */ i = IC_PPP(0, &rtk->opt); fprintf(fp, "$CLK,%d,%.3f,%d,%d,%.3f,%.3f,%.3f,%.3f\n", - week, tow, rtk->sol.stat, 1, rtk->x[i]*1E9/SPEED_OF_LIGHT, rtk->x[i+1]*1E9/SPEED_OF_LIGHT, - 0.0, 0.0); + week, tow, rtk->sol.stat, 1, rtk->x[i] * 1E9 / SPEED_OF_LIGHT, rtk->x[i + 1] * 1E9 / SPEED_OF_LIGHT, + 0.0, 0.0); /* tropospheric parameters */ if (rtk->opt.tropopt == TROPOPT_EST || rtk->opt.tropopt == TROPOPT_ESTG) { i = IT_PPP(&rtk->opt); fprintf(fp, "$TROP,%d,%.3f,%d,%d,%.4f,%.4f\n", week, tow, rtk->sol.stat, - 1, rtk->x[i], 0.0); + 1, rtk->x[i], 0.0); } if (rtk->opt.tropopt == TROPOPT_ESTG) { i = IT_PPP(&rtk->opt); fprintf(fp, "$TRPG,%d,%.3f,%d,%d,%.5f,%.5f,%.5f,%.5f\n", week, tow, - rtk->sol.stat, 1, rtk->x[i+1], rtk->x[i+2], 0.0, 0.0); + rtk->sol.stat, 1, rtk->x[i + 1], rtk->x[i + 2], 0.0, 0.0); } if (rtk->sol.stat == SOLQ_NONE || level <= 1) return; /* residuals and status */ - for (i = 0;issat+i; + ssat = rtk->ssat + i; if (!ssat->vs) continue; - satno2id(i+1, id); - for (j = 0;jazel[0]*R2D, ssat->azel[1]*R2D, - ssat->resp[j], ssat->resc[j], ssat->vsat[j], ssat->snr[j]*0.25, - ssat->fix[j], ssat->slip[j]&3, ssat->lock[j], ssat->outc[j], - ssat->slipc[j], ssat->rejc[j]); + week, tow, id, j + 1, ssat->azel[0] * R2D, ssat->azel[1] * R2D, + ssat->resp[j], ssat->resc[j], ssat->vsat[j], ssat->snr[j] * 0.25, + ssat->fix[j], ssat->slip[j] & 3, ssat->lock[j], ssat->outc[j], + ssat->slipc[j], ssat->rejc[j]); } } } @@ -626,42 +675,45 @@ void pppoutsolstat(rtk_t *rtk, int level, FILE *fp) /* solar/lunar tides (ref [2] 7) ---------------------------------------------*/ 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; double r, ep[3], latp, lonp, p, K2, K3, a, H2, L2, dp, du, cosp, sinl, cosl; 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); if ((r = norm_rtk(rp, 3)) <= 0.0) return; - for (i = 0;i<3;i++) ep[i] = rp[i]/r; + for (i = 0; i < 3; i++) ep[i] = rp[i] / r; - K2 = GMp / GME * std::pow(RE_WGS84, 2.0) * std::pow(RE_WGS84, 2.0) / (r*r*r); - K3 = K2*RE_WGS84/r; - latp = asin(ep[2]); lonp = atan2(ep[1], ep[0]); - cosp = cos(latp); sinl = sin(pos[0]); cosl = cos(pos[0]); + K2 = GMp / GME * std::pow(RE_WGS84, 2.0) * std::pow(RE_WGS84, 2.0) / (r * r * r); + K3 = K2 * RE_WGS84 / r; + latp = asin(ep[2]); + lonp = atan2(ep[1], ep[0]); + cosp = cos(latp); + sinl = sin(pos[0]); + cosl = cos(pos[0]); /* step1 in phase (degree 2) */ - p = (3.0*sinl*sinl-1.0)/2.0; - H2 = 0.6078-0.0006*p; - L2 = 0.0847+0.0002*p; + p = (3.0 * sinl * sinl - 1.0) / 2.0; + H2 = 0.6078 - 0.0006 * p; + L2 = 0.0847 + 0.0002 * p; a = dot(ep, eu, 3); - dp = K2*3.0*L2*a; - du = K2*(H2*(1.5*a*a-0.5)-3.0*L2*a*a); + dp = K2 * 3.0 * L2 * a; + du = K2 * (H2 * (1.5 * a * a - 0.5) - 3.0 * L2 * a * a); /* step1 in phase (degree 3) */ - dp += K3*L3*(7.5*a*a-1.5); - du += K3*(H3*(2.5*a*a*a-1.5*a)-L3*(7.5*a*a-1.5)*a); + dp += K3 * L3 * (7.5 * a * a - 1.5); + du += K3 * (H3 * (2.5 * a * a * a - 1.5 * a) - L3 * (7.5 * a * a - 1.5) * a); /* step1 out-of-phase (only radial) */ - du += 3.0/4.0*0.0025*K2*sin(2.0*latp)*sin(2.0*pos[0])*sin(pos[1]-lonp); - du += 3.0/4.0*0.0022*K2*cosp*cosp*cosl*cosl*sin(2.0*(pos[1]-lonp)); + du += 3.0 / 4.0 * 0.0025 * K2 * sin(2.0 * latp) * sin(2.0 * pos[0]) * sin(pos[1] - lonp); + du += 3.0 / 4.0 * 0.0022 * K2 * cosp * cosp * cosl * cosl * sin(2.0 * (pos[1] - lonp)); - dr[0] = dp*ep[0]+du*eu[0]; - dr[1] = dp*ep[1]+du*eu[1]; - dr[2] = dp*ep[2]+du*eu[2]; + dr[0] = dp * ep[0] + du * eu[0]; + dr[1] = dp * ep[1] + du * eu[1]; + dr[2] = dp * ep[2] + du * eu[2]; trace(5, "tide_pl : dr=%.3f %.3f %.3f\n", dr[0], dr[1], dr[2]); } @@ -669,35 +721,37 @@ void tide_pl(const double *eu, const double *rp, double GMp, /* displacement by solid earth tide (ref [2] 7) ------------------------------*/ void tide_solid(const double *rsun, const double *rmoon, - const double *pos, const double *E, double gmst, int opt, - double *dr) + const double *pos, const double *E, double gmst, int opt, + double *dr) { double dr1[3], dr2[3], eu[3], du, dn, sinl, 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); /* step1: time domain */ - eu[0] = E[2]; eu[1] = E[5]; eu[2] = E[8]; - tide_pl(eu, rsun, GMS, pos, dr1); + eu[0] = E[2]; + eu[1] = E[5]; + eu[2] = E[8]; + tide_pl(eu, rsun, GMS, pos, dr1); tide_pl(eu, rmoon, GMM, pos, dr2); /* step2: frequency domain, only K1 radial */ - sin2l = sin(2.0*pos[0]); - du = -0.012*sin2l*sin(gmst+pos[1]); + sin2l = sin(2.0 * pos[0]); + du = -0.012 * sin2l * sin(gmst + pos[1]); - dr[0] = dr1[0]+dr2[0]+du*E[2]; - dr[1] = dr1[1]+dr2[1]+du*E[5]; - dr[2] = dr1[2]+dr2[2]+du*E[8]; + dr[0] = dr1[0] + dr2[0] + du * E[2]; + dr[1] = dr1[1] + dr2[1] + du * E[5]; + dr[2] = dr1[2] + dr2[2] + du * E[8]; /* eliminate permanent deformation */ - if (opt&8) + if (opt & 8) { sinl = sin(pos[0]); - du = 0.1196*(1.5*sinl*sinl-0.5); - dn = 0.0247*sin2l; - dr[0] += du*E[2]+dn*E[1]; - dr[1] += du*E[5]+dn*E[4]; - dr[2] += du*E[8]+dn*E[7]; + du = 0.1196 * (1.5 * sinl * sinl - 0.5); + dn = 0.0247 * sin2l; + dr[0] += du * E[2] + dn * E[1]; + dr[1] += du * E[5] + dn * E[4]; + dr[2] += du * E[8] + dn * E[7]; } trace(5, "tide_solid: dr=%.3f %.3f %.3f\n", dr[0], dr[1], dr[2]); } @@ -707,17 +761,17 @@ void tide_solid(const double *rsun, const double *rmoon, void tide_oload(gtime_t tut, const double *odisp, double *denu) { const double args[][5] = { - {1.40519E-4, 2.0,-2.0, 0.0, 0.00}, /* M2 */ - {1.45444E-4, 0.0, 0.0, 0.0, 0.00}, /* S2 */ - {1.37880E-4, 2.0,-3.0, 1.0, 0.00}, /* N2 */ - {1.45842E-4, 2.0, 0.0, 0.0, 0.00}, /* K2 */ - {0.72921E-4, 1.0, 0.0, 0.0, 0.25}, /* K1 */ - {0.67598E-4, 1.0,-2.0, 0.0,-0.25}, /* O1 */ - {0.72523E-4,-1.0, 0.0, 0.0,-0.25}, /* P1 */ - {0.64959E-4, 1.0,-3.0, 1.0,-0.25}, /* Q1 */ - {0.53234E-5, 0.0, 2.0, 0.0, 0.00}, /* Mf */ - {0.26392E-5, 0.0, 1.0,-1.0, 0.00}, /* Mm */ - {0.03982E-5, 2.0, 0.0, 0.0, 0.00} /* Ssa */ + {1.40519E-4, 2.0, -2.0, 0.0, 0.00}, /* M2 */ + {1.45444E-4, 0.0, 0.0, 0.0, 0.00}, /* S2 */ + {1.37880E-4, 2.0, -3.0, 1.0, 0.00}, /* N2 */ + {1.45842E-4, 2.0, 0.0, 0.0, 0.00}, /* K2 */ + {0.72921E-4, 1.0, 0.0, 0.0, 0.25}, /* K1 */ + {0.67598E-4, 1.0, -2.0, 0.0, -0.25}, /* O1 */ + {0.72523E-4, -1.0, 0.0, 0.0, -0.25}, /* P1 */ + {0.64959E-4, 1.0, -3.0, 1.0, -0.25}, /* Q1 */ + {0.53234E-5, 0.0, 2.0, 0.0, 0.00}, /* Mf */ + {0.26392E-5, 0.0, 1.0, -1.0, 0.00}, /* Mm */ + {0.03982E-5, 2.0, 0.0, 0.0, 0.00} /* Ssa */ }; const double ep1975[] = {1975, 1, 1, 0, 0, 0}; double ep[6], fday, days, t, t2, t3, a[5], ang, dp[3] = {0}; @@ -727,28 +781,29 @@ void tide_oload(gtime_t tut, const double *odisp, double *denu) /* angular argument: see subroutine arg.f for reference [1] */ time2epoch(tut, ep); - fday = ep[3]*3600.0+ep[4]*60.0+ep[5]; + fday = ep[3] * 3600.0 + ep[4] * 60.0 + ep[5]; ep[3] = ep[4] = ep[5] = 0.0; - days = timediff(epoch2time(ep), epoch2time(ep1975))/86400.0; - t = (27392.500528+1.000000035*days)/36525.0; - t2 = t*t; t3 = t2*t; + days = timediff(epoch2time(ep), epoch2time(ep1975)) / 86400.0; + t = (27392.500528 + 1.000000035 * days) / 36525.0; + t2 = t * t; + t3 = t2 * t; a[0] = fday; - a[1] = (279.69668+36000.768930485*t+3.03E-4*t2)*D2R; /* H0 */ - a[2] = (270.434358+481267.88314137*t-0.001133*t2+1.9E-6*t3)*D2R; /* S0 */ - a[3] = (334.329653+4069.0340329577*t-0.010325*t2-1.2E-5*t3)*D2R; /* P0 */ - a[4] = 2.0*PI; + a[1] = (279.69668 + 36000.768930485 * t + 3.03E-4 * t2) * D2R; /* H0 */ + a[2] = (270.434358 + 481267.88314137 * t - 0.001133 * t2 + 1.9E-6 * t3) * D2R; /* S0 */ + a[3] = (334.329653 + 4069.0340329577 * t - 0.010325 * t2 - 1.2E-5 * t3) * D2R; /* P0 */ + a[4] = 2.0 * PI; /* displacements by 11 constituents */ - for (i = 0;i<11;i++) + for (i = 0; i < 11; i++) { ang = 0.0; - for (j = 0;j<5;j++) ang += a[j]*args[i][j]; - for (j = 0;j<3;j++) dp[j] += odisp[j+i*6]*cos(ang-odisp[j+3+i*6]*D2R); + for (j = 0; j < 5; j++) ang += a[j] * args[i][j]; + for (j = 0; j < 3; j++) dp[j] += odisp[j + i * 6] * cos(ang - odisp[j + 3 + i * 6] * D2R); } denu[0] = -dp[1]; denu[1] = -dp[2]; - denu[2] = dp[0]; + denu[2] = dp[0]; trace(5, "tide_oload: denu=%.3f %.3f %.3f\n", denu[0], denu[1], denu[2]); } @@ -760,43 +815,44 @@ void iers_mean_pole(gtime_t tut, double *xp_bar, double *yp_bar) const double ep2000[] = {2000, 1, 1, 0, 0, 0}; double y, y2, y3; - y = timediff(tut, epoch2time(ep2000))/86400.0/365.25; + y = timediff(tut, epoch2time(ep2000)) / 86400.0 / 365.25; - if (y<3653.0/365.25) + if (y < 3653.0 / 365.25) { /* until 2010.0 */ - y2 = y*y; y3 = y2*y; - *xp_bar = 55.974+1.8243*y+0.18413*y2+0.007024*y3; /* (mas) */ - *yp_bar = 346.346+1.7896*y-0.10729*y2-0.000908*y3; + y2 = y * y; + y3 = y2 * y; + *xp_bar = 55.974 + 1.8243 * y + 0.18413 * y2 + 0.007024 * y3; /* (mas) */ + *yp_bar = 346.346 + 1.7896 * y - 0.10729 * y2 - 0.000908 * y3; } else - { /* after 2010.0 */ - *xp_bar = 23.513+7.6141*y; /* (mas) */ - *yp_bar = 358.891-0.6287*y; + { /* after 2010.0 */ + *xp_bar = 23.513 + 7.6141 * y; /* (mas) */ + *yp_bar = 358.891 - 0.6287 * y; } } /* displacement by pole tide (ref [7] eq.7.26) --------------------------------*/ 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; - 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); /* iers mean pole (mas) */ iers_mean_pole(tut, &xp_bar, &yp_bar); /* ref [7] eq.7.24 */ - m1 = erpv[0]/AS2R-xp_bar*1E-3; /* (as) */ - m2 = -erpv[1]/AS2R+yp_bar*1E-3; + m1 = erpv[0] / AS2R - xp_bar * 1E-3; /* (as) */ + m2 = -erpv[1] / AS2R + yp_bar * 1E-3; /* sin(2*theta) = sin(2*phi), cos(2*theta)=-cos(2*phi) */ cosl = cos(pos[1]); sinl = sin(pos[1]); - denu[0] = 9E-3*sin(pos[0]) *(m1*sinl-m2*cosl); /* de= Slambda (m) */ - denu[1] = -9E-3*cos(2.0*pos[0])*(m1*cosl+m2*sinl); /* dn=-Stheta (m) */ - denu[2] = -33E-3*sin(2.0*pos[0])*(m1*cosl+m2*sinl); /* du= Sr (m) */ + denu[0] = 9E-3 * sin(pos[0]) * (m1 * sinl - m2 * cosl); /* de= Slambda (m) */ + denu[1] = -9E-3 * cos(2.0 * pos[0]) * (m1 * cosl + m2 * sinl); /* dn=-Stheta (m) */ + denu[2] = -33E-3 * sin(2.0 * pos[0]) * (m1 * cosl + m2 * sinl); /* du= Sr (m) */ trace(5, "tide_pole : denu=%.3f %.3f %.3f\n", denu[0], denu[1], denu[2]); } @@ -828,7 +884,7 @@ void tide_pole(gtime_t tut, const double *pos, const double *erpv, * ver.2.4.0 does not use ocean loading and pole tide corrections *-----------------------------------------------------------------------------*/ 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; double pos[2], E[9], drt[3], denu[3], rs[3], rm[3], gmst, erpv[5] = {0}; @@ -848,11 +904,11 @@ void tidedisp(gtime_t tutc, const double *rr, int opt, const erp_t *erp, if (norm_rtk(rr, 3) <= 0.0) return; - pos[0] = asin(rr[2]/norm_rtk(rr, 3)); + pos[0] = asin(rr[2] / norm_rtk(rr, 3)); pos[1] = atan2(rr[1], rr[0]); xyz2enu(pos, E); - if (opt&1) + if (opt & 1) { /* solid earth tides */ /* sun and moon position in ecef */ @@ -861,28 +917,28 @@ void tidedisp(gtime_t tutc, const double *rr, int opt, const erp_t *erp, #ifdef IERS_MODEL time2epoch(tutc, ep); year = (int)ep[0]; - mon = (int)ep[1]; - day = (int)ep[2]; - fhr = ep[3]+ep[4]/60.0+ep[5]/3600.0; + mon = (int)ep[1]; + day = (int)ep[2]; + fhr = ep[3] + ep[4] / 60.0 + ep[5] / 3600.0; /* call DEHANTTIDEINEL */ dehanttideinel_((double *)rr, &year, &mon, &day, &fhr, rs, rm, drt); #else tide_solid(rs, rm, pos, E, gmst, opt, drt); #endif - for (i = 0;i<3;i++) dr[i] += drt[i]; + for (i = 0; i < 3; i++) dr[i] += drt[i]; } - if ((opt&2) && odisp) + if ((opt & 2) && odisp) { /* ocean tide loading */ tide_oload(tut, odisp, denu); matmul("TN", 3, 1, 3, 1.0, E, denu, 0.0, drt); - for (i = 0;i<3;i++) dr[i] += drt[i]; + for (i = 0; i < 3; i++) dr[i] += drt[i]; } - if ((opt&4) && erp) + if ((opt & 4) && erp) { /* pole tide */ tide_pole(tut, pos, erpv, denu); matmul("TN", 3, 1, 3, 1.0, E, denu, 0.0, drt); - for (i = 0;i<3;i++) dr[i] += drt[i]; + for (i = 0; i < 3; i++) dr[i] += drt[i]; } trace(5, "tidedisp: dr=%.3f %.3f %.3f\n", dr[0], dr[1], dr[2]); } @@ -899,29 +955,29 @@ void testeclipse(const obsd_t *obs, int n, const nav_t *nav, double *rs) /* unit vector of sun direction (ecef) */ sunmoonpos(gpst2utc(obs[0].time), erpv, rsun, NULL, NULL); - if(normv3(rsun, esun) == 0) trace(1, "Error computing the norm"); + if (normv3(rsun, esun) == 0) trace(1, "Error computing the norm"); - for (i = 0;ipcvs[obs[i].sat-1].type; + type = nav->pcvs[obs[i].sat - 1].type; - if ((r = norm_rtk(rs+i*6, 3)) <= 0.0) continue; + if ((r = norm_rtk(rs + i * 6, 3)) <= 0.0) continue; #if 1 /* only block IIA */ if (*type && !strstr(type, "BLOCK IIA")) continue; #endif /* sun-earth-satellite angle */ - cosa = dot(rs+i*6, esun, 3)/r; - cosa = cosa<-1.0?-1.0:(cosa>1.0?1.0:cosa); + cosa = dot(rs + i * 6, esun, 3) / r; + cosa = cosa < -1.0 ? -1.0 : (cosa > 1.0 ? 1.0 : cosa); ang = acos(cosa); /* test eclipse */ - if (angRE_WGS84) continue; + if (ang < PI / 2.0 || r * sin(ang) > RE_WGS84) continue; trace(2, "eclipsing sat excluded %s sat=%2d\n", time_str(obs[0].time, 0), - obs[i].sat); + obs[i].sat); - for (j = 0;j<3;j++) rs[j+i*6] = 0.0; + for (j = 0; j < 3; j++) rs[j + i * 6] = 0.0; } } @@ -931,7 +987,7 @@ double varerr(int sat __attribute__((unused)), int sys, double el, int type, con { double a, b, a2, b2, fact = 1.0; 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); /* extended error model */ if (type == 1 && opt->exterr.ena[0]) @@ -942,8 +998,8 @@ double varerr(int sat __attribute__((unused)), int sys, double el, int type, con { a2 = opt->exterr.cerr[i][2]; b2 = opt->exterr.cerr[i][3]; - a = std::sqrt(std::pow(2.55, 2.0)*a*a+std::pow(1.55, 2.0)*a2*a2); - b = std::sqrt(std::pow(2.55, 2.0)*b*b+std::pow(1.55, 2.0)*b2*b2); + a = std::sqrt(std::pow(2.55, 2.0) * a * a + std::pow(1.55, 2.0) * a2 * a2); + b = std::sqrt(std::pow(2.55, 2.0) * b * b + std::pow(1.55, 2.0) * b2 * b2); } } else if (type == 0 && opt->exterr.ena[1]) @@ -954,19 +1010,19 @@ double varerr(int sat __attribute__((unused)), int sys, double el, int type, con { a2 = opt->exterr.perr[i][2]; b2 = opt->exterr.perr[i][3]; - a = std::sqrt(std::pow(2.55, 2.0)*a*a+std::pow(1.55, 2.0)*a2*a2); - b = std::sqrt(std::pow(2.55, 2.0)*b*b+std::pow(1.55, 2.0)*b2*b2); + a = std::sqrt(std::pow(2.55, 2.0) * a * a + std::pow(1.55, 2.0) * a2 * a2); + b = std::sqrt(std::pow(2.55, 2.0) * b * b + std::pow(1.55, 2.0) * b2 * b2); } } else { /* normal error model */ if (type == 1) fact *= opt->eratio[0]; - 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); if (opt->ionoopt == IONOOPT_IFLC) fact *= 3.0; - a = fact*opt->err[1]; - b = fact*opt->err[2]; + a = fact * opt->err[1]; + b = fact * opt->err[2]; } - return a*a+b*b/sinel/sinel; + return a * a + b * b / sinel / sinel; } @@ -975,58 +1031,58 @@ void initx(rtk_t *rtk, double xi, double var, int i) { int j; rtk->x[i] = xi; - for (j = 0;jnx;j++) + for (j = 0; j < rtk->nx; j++) { - rtk->P[i+j*rtk->nx] = rtk->P[j+i*rtk->nx] = i == j?var:0.0; + rtk->P[i + j * rtk->nx] = rtk->P[j + i * rtk->nx] = i == j ? var : 0.0; } } /* dual-frequency iono-free measurements -------------------------------------*/ int ifmeas(const obsd_t *obs, const nav_t *nav, const double *azel, - const prcopt_t *opt, const double *dantr, const double *dants, - double phw, double *meas, double *var) + const prcopt_t *opt, const double *dantr, const double *dants, + 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; int i = 0, j = 1, k; trace(4, "ifmeas :\n"); /* L1-L2 for GPS/GLO/QZS, L1-L5 for GAL/SBS */ - if (NFREQ >= 3 && (satsys(obs->sat, NULL)&(SYS_GAL|SYS_SBS))) j = 2; + if (NFREQ >= 3 && (satsys(obs->sat, NULL) & (SYS_GAL | SYS_SBS))) j = 2; - if (NFREQ<2 || lam[i] == 0.0 || lam[j] == 0.0) return 0; + if (NFREQ < 2 || lam[i] == 0.0 || lam[j] == 0.0) return 0; /* test snr mask */ - if (testsnr(0, i, azel[1], obs->SNR[i]*0.25, &opt->snrmask) || - testsnr(0, j, azel[1], obs->SNR[j]*0.25, &opt->snrmask)) + if (testsnr(0, i, azel[1], obs->SNR[i] * 0.25, &opt->snrmask) || + testsnr(0, j, azel[1], obs->SNR[j] * 0.25, &opt->snrmask)) { return 0; } - gamma = std::pow(lam[j], 2.0)/std::pow(lam[i], 2.0); /* f1^2/f2^2 */ - c1 = gamma/(gamma-1.0); /* f1^2/(f1^2-f2^2) */ - c2 = -1.0 /(gamma-1.0); /* -f2^2/(f1^2-f2^2) */ + gamma = std::pow(lam[j], 2.0) / std::pow(lam[i], 2.0); /* f1^2/f2^2 */ + c1 = gamma / (gamma - 1.0); /* f1^2/(f1^2-f2^2) */ + c2 = -1.0 / (gamma - 1.0); /* -f2^2/(f1^2-f2^2) */ - L1 = obs->L[i]*lam[i]; /* cycle -> m */ - L2 = obs->L[j]*lam[j]; + L1 = obs->L[i] * lam[i]; /* cycle -> m */ + L2 = obs->L[j] * lam[j]; P1 = obs->P[i]; P2 = obs->P[j]; - P1_C1 = nav->cbias[obs->sat-1][1]; - P2_C2 = nav->cbias[obs->sat-1][2]; + P1_C1 = nav->cbias[obs->sat - 1][1]; + P2_C2 = nav->cbias[obs->sat - 1][2]; if (opt->sateph == EPHOPT_LEX) { - P1_C1 = nav->lexeph[obs->sat-1].isc[0]*SPEED_OF_LIGHT; /* ISC_L1C/A */ + P1_C1 = nav->lexeph[obs->sat - 1].isc[0] * SPEED_OF_LIGHT; /* ISC_L1C/A */ } if (L1 == 0.0 || L2 == 0.0 || P1 == 0.0 || P2 == 0.0) return 0; /* iono-free phase with windup correction */ - meas[0] = c1*L1+c2*L2-(c1*lam[i]+c2*lam[j])*phw; + meas[0] = c1 * L1 + c2 * L2 - (c1 * lam[i] + c2 * lam[j]) * phw; /* iono-free code with dcb correction */ if (obs->code[i] == CODE_L1C) P1 += P1_C1; /* C1->P1 */ if (obs->code[j] == CODE_L2C) P2 += P2_C2; /* C2->P2 */ - meas[1] = c1*P1+c2*P2; + meas[1] = c1 * P1 + c2 * P2; var[1] = std::pow(ERR_CBIAS, 2.0); if (opt->sateph == EPHOPT_SBAS) meas[1] -= P1_C1; /* sbas clock based C1 */ @@ -1034,13 +1090,13 @@ int ifmeas(const obsd_t *obs, const nav_t *nav, const double *azel, /* gps-glonass h/w bias correction for code */ if (opt->exterr.ena[3] && satsys(obs->sat, NULL) == SYS_GLO) { - meas[1] += c1*opt->exterr.gpsglob[0]+c2*opt->exterr.gpsglob[1]; + meas[1] += c1 * opt->exterr.gpsglob[0] + c2 * opt->exterr.gpsglob[1]; } /* antenna phase center variation correction */ - for (k = 0;k<2;k++) + for (k = 0; k < 2; k++) { - if (dants) meas[k] -= c1*dants[i]+c2*dants[j]; - if (dantr) meas[k] -= c1*dantr[i]+c2*dantr[j]; + if (dants) meas[k] -= c1 * dants[i] + c2 * dants[j]; + if (dantr) meas[k] -= c1 * dantr[i] + c2 * dantr[j]; } return 1; } @@ -1050,10 +1106,10 @@ int ifmeas(const obsd_t *obs, const nav_t *nav, const double *azel, double gettgd_ppp(int sat, const nav_t *nav) { int i; - for (i = 0;in;i++) + for (i = 0; i < nav->n; i++) { if (nav->eph[i].sat != sat) continue; - return SPEED_OF_LIGHT*nav->eph[i].tgd[0]; + return SPEED_OF_LIGHT * nav->eph[i].tgd[0]; } return 0.0; } @@ -1061,8 +1117,8 @@ double gettgd_ppp(int sat, const nav_t *nav) /* slant ionospheric delay ---------------------------------------------------*/ int corr_ion(gtime_t time, const nav_t *nav, int sat __attribute__((unused)), const double *pos, - const double *azel, int ionoopt, double *ion, double *var, - int *brk __attribute__((unused))) + const double *azel, int ionoopt, double *ion, double *var, + int *brk __attribute__((unused))) { #ifdef EXTSTEC double rate; @@ -1088,7 +1144,7 @@ int corr_ion(gtime_t time, const nav_t *nav, int sat __attribute__((unused)), co if (ionoopt == IONOOPT_BRDC) { *ion = ionmodel(time, nav->ion_gps, pos, azel); - *var = std::pow(*ion*ERR_BRDCI, 2.0); + *var = std::pow(*ion * ERR_BRDCI, 2.0); return 1; } /* ionosphere model off */ @@ -1100,11 +1156,11 @@ int corr_ion(gtime_t time, const nav_t *nav, int sat __attribute__((unused)), co /* ionosphere and antenna corrected measurements -----------------------------*/ int corrmeas(const obsd_t *obs, const nav_t *nav, const double *pos, - const double *azel, const prcopt_t *opt, - const double *dantr, const double *dants, double phw, - double *meas, double *var, int *brk) + const double *azel, const prcopt_t *opt, + const double *dantr, const double *dants, double phw, + 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; int i; @@ -1119,38 +1175,38 @@ int corrmeas(const obsd_t *obs, const nav_t *nav, const double *pos, } if (lam[0] == 0.0 || obs->L[0] == 0.0 || obs->P[0] == 0.0) return 0; - if (testsnr(0, 0, azel[1], obs->SNR[0]*0.25, &opt->snrmask)) return 0; + if (testsnr(0, 0, azel[1], obs->SNR[0] * 0.25, &opt->snrmask)) return 0; - L1 = obs->L[0]*lam[0]; + L1 = obs->L[0] * lam[0]; P1 = obs->P[0]; /* dcb correction */ - gamma = std::pow(lam[1]/lam[0], 2.0); /* f1^2/f2^2 */ - P1_P2 = nav->cbias[obs->sat-1][0]; - P1_C1 = nav->cbias[obs->sat-1][1]; - if (P1_P2 == 0.0 && (satsys(obs->sat, NULL)&(SYS_GPS|SYS_GAL|SYS_QZS))) + gamma = std::pow(lam[1] / lam[0], 2.0); /* f1^2/f2^2 */ + P1_P2 = nav->cbias[obs->sat - 1][0]; + P1_C1 = nav->cbias[obs->sat - 1][1]; + if (P1_P2 == 0.0 && (satsys(obs->sat, NULL) & (SYS_GPS | SYS_GAL | SYS_QZS))) { - P1_P2 = (1.0-gamma)*gettgd_ppp(obs->sat, nav); + P1_P2 = (1.0 - gamma) * gettgd_ppp(obs->sat, nav); } if (obs->code[0] == CODE_L1C) P1 += P1_C1; /* C1->P1 */ - PC = P1-P1_P2/(1.0-gamma); /* P1->PC */ + PC = P1 - P1_P2 / (1.0 - gamma); /* P1->PC */ /* slant ionospheric delay L1 (m) */ if (!corr_ion(obs->time, nav, obs->sat, pos, azel, opt->ionoopt, &ion, &vari, brk)) { trace(2, "iono correction error: time=%s sat=%2d ionoopt=%d\n", - time_str(obs->time, 2), obs->sat, opt->ionoopt); + time_str(obs->time, 2), obs->sat, opt->ionoopt); return 0; } /* ionosphere and windup corrected phase and code */ - meas[0] = L1+ion-lam[0]*phw; - meas[1] = PC-ion; + meas[0] = L1 + ion - lam[0] * phw; + meas[1] = PC - ion; var[0] += vari; - var[1] += vari+std::pow(ERR_CBIAS, 2.0); + var[1] += vari + std::pow(ERR_CBIAS, 2.0); /* antenna phase center variation correction */ - for (i = 0;i<2;i++) + for (i = 0; i < 2; i++) { if (dants) meas[i] -= dants[0]; if (dantr) meas[i] -= dantr[0]; @@ -1162,11 +1218,11 @@ int corrmeas(const obsd_t *obs, const nav_t *nav, const double *pos, /* L1/L2 geometry-free phase measurement -------------------------------------*/ double gfmeas(const obsd_t *obs, const nav_t *nav) { - const double *lam = nav->lam[obs->sat-1]; + const double *lam = nav->lam[obs->sat - 1]; if (lam[0] == 0.0 || lam[1] == 0.0 || obs->L[0] == 0.0 || obs->L[1] == 0.0) return 0.0; - return lam[0]*obs->L[0]-lam[1]*obs->L[1]; + return lam[0] * obs->L[0] - lam[1] * obs->L[1]; } @@ -1180,19 +1236,19 @@ void udpos_ppp(rtk_t *rtk) /* fixed mode */ if (rtk->opt.mode == PMODE_PPP_FIXED) { - for (i = 0;i<3;i++) initx(rtk, rtk->opt.ru[i], 1E-8, i); + for (i = 0; i < 3; i++) initx(rtk, rtk->opt.ru[i], 1E-8, i); return; } /* initialize position for first epoch */ if (norm_rtk(rtk->x, 3) <= 0.0) { - for (i = 0;i<3;i++) initx(rtk, rtk->sol.rr[i], VAR_POS_PPP, i); + for (i = 0; i < 3; i++) initx(rtk, rtk->sol.rr[i], VAR_POS_PPP, i); } /* static ppp mode */ if (rtk->opt.mode == PMODE_PPP_STATIC) return; /* kinmatic mode without dynamics */ - for (i = 0;i<3;i++) + for (i = 0; i < 3; i++) { initx(rtk, rtk->sol.rr[i], VAR_POS_PPP, i); } @@ -1208,7 +1264,7 @@ void udclk_ppp(rtk_t *rtk) trace(3, "udclk_ppp:\n"); /* initialize every epoch for clock (white noise) */ - for (i = 0;iopt.sateph == EPHOPT_PREC) { @@ -1218,9 +1274,9 @@ void udclk_ppp(rtk_t *rtk) } else { - dtr = i == 0?rtk->sol.dtr[0]:rtk->sol.dtr[0]+rtk->sol.dtr[i]; + dtr = i == 0 ? rtk->sol.dtr[0] : rtk->sol.dtr[0] + rtk->sol.dtr[i]; } - initx(rtk, SPEED_OF_LIGHT*dtr, VAR_CLK, IC_PPP(i, &rtk->opt)); + initx(rtk, SPEED_OF_LIGHT * dtr, VAR_CLK, IC_PPP(i, &rtk->opt)); } } @@ -1228,7 +1284,7 @@ void udclk_ppp(rtk_t *rtk) /* temporal update of tropospheric parameters --------------------------------*/ void udtrop_ppp(rtk_t *rtk) { - double pos[3], azel[] = {0.0, PI/2.0}, ztd, var; + double pos[3], azel[] = {0.0, PI / 2.0}, ztd, var; int i = IT_PPP(&rtk->opt), j; trace(3, "udtrop_ppp:\n"); @@ -1241,18 +1297,18 @@ void udtrop_ppp(rtk_t *rtk) if (rtk->opt.tropopt >= TROPOPT_ESTG) { - for (j = 0;j<2;j++) initx(rtk, 1E-6, VAR_GRA_PPP, ++i); + for (j = 0; j < 2; j++) initx(rtk, 1E-6, VAR_GRA_PPP, ++i); } } else { - rtk->P[i*(1+rtk->nx)] += std::pow(rtk->opt.prn[2], 2.0)*fabs(rtk->tt); + rtk->P[i * (1 + rtk->nx)] += std::pow(rtk->opt.prn[2], 2.0) * fabs(rtk->tt); if (rtk->opt.tropopt >= TROPOPT_ESTG) { - for (j = 0;j<2;j++) + for (j = 0; j < 2; j++) { - rtk->P[++i*(1+rtk->nx)] += std::pow(rtk->opt.prn[2]*0.1, 2.0)*fabs(rtk->tt); + rtk->P[++i * (1 + rtk->nx)] += std::pow(rtk->opt.prn[2] * 0.1, 2.0) * fabs(rtk->tt); } } } @@ -1266,14 +1322,15 @@ void detslp_ll(rtk_t *rtk, const obsd_t *obs, int n) trace(3, "detslp_ll: n=%d\n", n); - for (i = 0;iopt.nf;j++) - { - if (obs[i].L[j] == 0.0 || !(obs[i].LLI[j]&3)) continue; + for (i = 0; i < n && i < MAXOBS; i++) + for (j = 0; j < rtk->opt.nf; j++) + { + if (obs[i].L[j] == 0.0 || !(obs[i].LLI[j] & 3)) continue; - trace(3, "detslp_ll: slip detected sat=%2d f=%d\n", obs[i].sat, j+1); + trace(3, "detslp_ll: slip detected sat=%2d f=%d\n", obs[i].sat, j + 1); - rtk->ssat[obs[i].sat-1].slip[j] = 1; - } + rtk->ssat[obs[i].sat - 1].slip[j] = 1; + } } @@ -1285,21 +1342,21 @@ void detslp_gf(rtk_t *rtk, const obsd_t *obs, int n, const nav_t *nav) trace(3, "detslp_gf: n=%d\n", n); - for (i = 0;issat[obs[i].sat-1].gf; - rtk->ssat[obs[i].sat-1].gf = g1; + g0 = rtk->ssat[obs[i].sat - 1].gf; + rtk->ssat[obs[i].sat - 1].gf = g1; trace(4, "detslip_gf: sat=%2d gf0=%8.3f gf1=%8.3f\n", obs[i].sat, g0, g1); - if (g0 != 0.0 && fabs(g1-g0)>rtk->opt.thresslip) + if (g0 != 0.0 && fabs(g1 - g0) > rtk->opt.thresslip) { trace(3, "detslip_gf: slip detected sat=%2d gf=%8.3f->%8.3f\n", - obs[i].sat, g0, g1); + obs[i].sat, g0, g1); - for (j = 0;jopt.nf;j++) rtk->ssat[obs[i].sat-1].slip[j]|=1; + for (j = 0; j < rtk->opt.nf; j++) rtk->ssat[obs[i].sat - 1].slip[j] |= 1; } } } @@ -1313,10 +1370,11 @@ void udbias_ppp(rtk_t *rtk, const obsd_t *obs, int n, const nav_t *nav) trace(3, "udbias : n=%d\n", n); - for (i = 0;iopt.nf;j++) - { - rtk->ssat[i].slip[j] = 0; - } + for (i = 0; i < MAXSAT; i++) + for (j = 0; j < rtk->opt.nf; j++) + { + rtk->ssat[i].slip[j] = 0; + } /* detect cycle slip by LLI */ detslp_ll(rtk, obs, n); @@ -1324,60 +1382,60 @@ void udbias_ppp(rtk_t *rtk, const obsd_t *obs, int n, const nav_t *nav) detslp_gf(rtk, obs, n, nav); /* reset phase-bias if expire obs outage counter */ - for (i = 0;issat[i].outc[0]>(unsigned int)rtk->opt.maxout) + if (++rtk->ssat[i].outc[0] > (unsigned int)rtk->opt.maxout) { - initx(rtk, 0.0, 0.0, IB_PPP(i+1, &rtk->opt)); + initx(rtk, 0.0, 0.0, IB_PPP(i + 1, &rtk->opt)); } } ecef2pos(rtk->sol.rr, pos); - for (i = k = 0;iopt); - if (!corrmeas(obs+i, nav, pos, rtk->ssat[sat-1].azel, &rtk->opt, NULL, NULL, + if (!corrmeas(obs + i, nav, pos, rtk->ssat[sat - 1].azel, &rtk->opt, NULL, NULL, 0.0, meas, var, &brk)) continue; if (brk) { - rtk->ssat[sat-1].slip[0] = 1; + rtk->ssat[sat - 1].slip[0] = 1; trace(2, "%s: sat=%2d correction break\n", time_str(obs[i].time, 0), sat); } - bias[i] = meas[0]-meas[1]; + bias[i] = meas[0] - meas[1]; if (rtk->x[j] == 0.0 || - rtk->ssat[sat-1].slip[0] || rtk->ssat[sat-1].slip[1]) continue; - offset += bias[i]-rtk->x[j]; + rtk->ssat[sat - 1].slip[0] || rtk->ssat[sat - 1].slip[1]) continue; + offset += bias[i] - rtk->x[j]; k++; } /* correct phase-code jump to enssure phase-code coherency */ - if (k >= 2 && fabs(offset/k)>0.0005*SPEED_OF_LIGHT) + if (k >= 2 && fabs(offset / k) > 0.0005 * SPEED_OF_LIGHT) { - for (i = 0;iopt); - if (rtk->x[j] != 0.0) rtk->x[j] += offset/k; + j = IB_PPP(i + 1, &rtk->opt); + if (rtk->x[j] != 0.0) rtk->x[j] += offset / k; } trace(2, "phase-code jump corrected: %s n=%2d dt=%12.9fs\n", - time_str(rtk->sol.time, 0), k, offset/k/SPEED_OF_LIGHT); + time_str(rtk->sol.time, 0), k, offset / k / SPEED_OF_LIGHT); } - for (i = 0;iopt); - rtk->P[j+j*rtk->nx] += std::pow(rtk->opt.prn[0], 2.0)*fabs(rtk->tt); + rtk->P[j + j * rtk->nx] += std::pow(rtk->opt.prn[0], 2.0) * fabs(rtk->tt); if (rtk->x[j] != 0.0 && - !rtk->ssat[sat-1].slip[0] && !rtk->ssat[sat-1].slip[1]) continue; + !rtk->ssat[sat - 1].slip[0] && !rtk->ssat[sat - 1].slip[1]) continue; if (bias[i] == 0.0) continue; /* reinitialize phase-bias if detecting cycle slip */ initx(rtk, bias[i], VAR_BIAS, IB_PPP(sat, &rtk->opt)); - trace(5, "udbias_ppp: sat=%2d bias=%.3f\n", sat, meas[0]-meas[1]); + trace(5, "udbias_ppp: sat=%2d bias=%.3f\n", sat, meas[0] - meas[1]); } } @@ -1405,20 +1463,20 @@ void udstate_ppp(rtk_t *rtk, const obsd_t *obs, int n, const nav_t *nav) /* satellite antenna phase center variation ----------------------------------*/ 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; int i; - for (i = 0;i<3;i++) + for (i = 0; i < 3; i++) { - ru[i] = rr[i]-rs[i]; + ru[i] = rr[i] - rs[i]; rz[i] = -rs[i]; } if (!normv3(ru, eu) || !normv3(rz, ez)) return; cosa = dot(eu, ez, 3); - cosa = cosa<-1.0?-1.0:(cosa>1.0?1.0:cosa); + cosa = cosa < -1.0 ? -1.0 : (cosa > 1.0 ? 1.0 : cosa); nadir = acos(cosa); antmodel_s(pcv, nadir, dant); @@ -1427,10 +1485,10 @@ void satantpcv(const double *rs, const double *rr, const pcv_t *pcv, /* precise tropospheric model ------------------------------------------------*/ double prectrop(gtime_t time, const double *pos, const double *azel, - const prcopt_t *opt, const double *x, double *dtdx, - double *var) + const prcopt_t *opt, const double *x, double *dtdx, + 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; /* zenith hydrostatic delay */ @@ -1439,58 +1497,58 @@ double prectrop(gtime_t time, const double *pos, const double *azel, /* mapping function */ m_h = tropmapf(time, pos, azel, &m_w); - if ((opt->tropopt == TROPOPT_ESTG || opt->tropopt == TROPOPT_CORG) && azel[1]>0.0) + if ((opt->tropopt == TROPOPT_ESTG || opt->tropopt == TROPOPT_CORG) && azel[1] > 0.0) { /* m_w=m_0+m_0*cot(el)*(Gn*cos(az)+Ge*sin(az)): ref [6] */ - cotz = 1.0/tan(azel[1]); - grad_n = m_w*cotz*cos(azel[0]); - grad_e = m_w*cotz*sin(azel[0]); - m_w += grad_n*x[1]+grad_e*x[2]; - dtdx[1] = grad_n*(x[0]-zhd); - dtdx[2] = grad_e*(x[0]-zhd); + cotz = 1.0 / tan(azel[1]); + grad_n = m_w * cotz * cos(azel[0]); + grad_e = m_w * cotz * sin(azel[0]); + m_w += grad_n * x[1] + grad_e * x[2]; + dtdx[1] = grad_n * (x[0] - zhd); + dtdx[2] = grad_e * (x[0] - zhd); } dtdx[0] = m_w; *var = std::pow(0.01, 2.0); - return m_h*zhd+m_w*(x[0]-zhd); + return m_h * zhd + m_w * (x[0] - zhd); } /* phase and code residuals --------------------------------------------------*/ int res_ppp(int iter __attribute__((unused)), const obsd_t *obs, int n, const double *rs, - const double *dts, const double *vare, const int *svh, - const nav_t *nav, const double *x, rtk_t *rtk, double *v, - double *H, double *R, double *azel) + const double *dts, const double *vare, const int *svh, + const nav_t *nav, const double *x, rtk_t *rtk, double *v, + double *H, double *R, double *azel) { prcopt_t *opt = &rtk->opt; double r, rr[3], disp[3], pos[3], e[3], meas[2], dtdx[3], dantr[NFREQ] = {0}; - double dants[NFREQ] = {0}, var[MAXOBS*2], dtrp = 0.0, vart = 0.0, varm[2] = {0}; + double dants[NFREQ] = {0}, var[MAXOBS * 2], dtrp = 0.0, vart = 0.0, varm[2] = {0}; int i, j, k, sat, sys, nv = 0, nx = rtk->nx, brk, tideopt; trace(3, "res_ppp : n=%d nx=%d\n", n, nx); - for (i = 0;issat[i].vsat[0] = 0; + for (i = 0; i < MAXSAT; i++) rtk->ssat[i].vsat[0] = 0; - for (i = 0;i<3;i++) rr[i] = x[i]; + for (i = 0; i < 3; i++) rr[i] = x[i]; /* earth tides correction */ if (opt->tidecorr) { - tideopt = opt->tidecorr == 1?1:7; /* 1:solid, 2:solid+otl+pole */ + tideopt = opt->tidecorr == 1 ? 1 : 7; /* 1:solid, 2:solid+otl+pole */ tidedisp(gpst2utc(obs[0].time), rr, tideopt, &nav->erp, opt->odisp[0], - disp); - for (i = 0;i<3;i++) rr[i] += disp[i]; + disp); + for (i = 0; i < 3; i++) rr[i] += disp[i]; } ecef2pos(rr, pos); - for (i = 0;issat[sat-1].vs) continue; + if (!(sys = satsys(sat, NULL)) || !rtk->ssat[sat - 1].vs) continue; /* geometric distance/azimuth/elevation angle */ - if ((r = geodist(rs+i*6, rr, e)) <= 0.0 || - satazel(pos, e, azel+i*2)elmin) continue; + if ((r = geodist(rs + i * 6, rr, e)) <= 0.0 || + satazel(pos, e, azel + i * 2) < opt->elmin) continue; /* excluded satellite? */ if (satexclude(obs[i].sat, svh[i], opt)) continue; @@ -1498,111 +1556,118 @@ int res_ppp(int iter __attribute__((unused)), const obsd_t *obs, int n, const do /* tropospheric delay correction */ if (opt->tropopt == TROPOPT_SAAS) { - dtrp = tropmodel(obs[i].time, pos, azel+i*2, REL_HUMI); + dtrp = tropmodel(obs[i].time, pos, azel + i * 2, REL_HUMI); vart = std::pow(ERR_SAAS, 2.0); } else if (opt->tropopt == TROPOPT_SBAS) { - dtrp = sbstropcorr(obs[i].time, pos, azel+i*2, &vart); + dtrp = sbstropcorr(obs[i].time, pos, azel + i * 2, &vart); } else if (opt->tropopt == TROPOPT_EST || opt->tropopt == TROPOPT_ESTG) { - dtrp = prectrop(obs[i].time, pos, azel+i*2, opt, x+IT_PPP(opt), dtdx, &vart); + dtrp = prectrop(obs[i].time, pos, azel + i * 2, opt, x + IT_PPP(opt), dtdx, &vart); } else if (opt->tropopt == TROPOPT_COR || opt->tropopt == TROPOPT_CORG) { - dtrp = prectrop(obs[i].time, pos, azel+i*2, opt, x, dtdx, &vart); + dtrp = prectrop(obs[i].time, pos, azel + i * 2, opt, x, dtdx, &vart); } /* satellite antenna model */ if (opt->posopt[0]) { - satantpcv(rs+i*6, rr, nav->pcvs+sat-1, dants); + satantpcv(rs + i * 6, rr, nav->pcvs + sat - 1, dants); } /* receiver antenna model */ - antmodel(opt->pcvr, opt->antdel[0], azel+i*2, opt->posopt[1], dantr); + antmodel(opt->pcvr, opt->antdel[0], azel + i * 2, opt->posopt[1], dantr); /* phase windup correction */ if (opt->posopt[2]) { - windupcorr(rtk->sol.time, rs+i*6, rr, &rtk->ssat[sat-1].phw); + windupcorr(rtk->sol.time, rs + i * 6, rr, &rtk->ssat[sat - 1].phw); } /* ionosphere and antenna phase corrected measurements */ - if (!corrmeas(obs+i, nav, pos, azel+i*2, &rtk->opt, dantr, dants, - rtk->ssat[sat-1].phw, meas, varm, &brk)) + if (!corrmeas(obs + i, nav, pos, azel + i * 2, &rtk->opt, dantr, dants, + rtk->ssat[sat - 1].phw, meas, varm, &brk)) { continue; } /* satellite clock and tropospheric delay */ - r += -SPEED_OF_LIGHT*dts[i*2]+dtrp; + r += -SPEED_OF_LIGHT * dts[i * 2] + dtrp; trace(5, "sat=%2d azel=%6.1f %5.1f dtrp=%.3f dantr=%6.3f %6.3f dants=%6.3f %6.3f phw=%6.3f\n", - sat, azel[i*2]*R2D, azel[1+i*2]*R2D, dtrp, dantr[0], dantr[1], dants[0], - dants[1], rtk->ssat[sat-1].phw); + sat, azel[i * 2] * R2D, azel[1 + i * 2] * R2D, dtrp, dantr[0], dantr[1], dants[0], + dants[1], rtk->ssat[sat - 1].phw); - for (j = 0;j<2;j++) + for (j = 0; j < 2; j++) { /* for phase and code */ if (meas[j] == 0.0) continue; - for (k = 0;ktropopt >= TROPOPT_EST) { - for (k = 0;k<(opt->tropopt >= TROPOPT_ESTG?3:1);k++) + for (k = 0; k < (opt->tropopt >= TROPOPT_ESTG ? 3 : 1); k++) { - H[IT_PPP(opt)+k+nx*nv] = dtdx[k]; + H[IT_PPP(opt) + k + nx * nv] = dtdx[k]; } } if (j == 0) { v[nv] -= x[IB_PPP(obs[i].sat, opt)]; - H[IB_PPP(obs[i].sat, opt)+nx*nv] = 1.0; + H[IB_PPP(obs[i].sat, opt) + nx * nv] = 1.0; } - var[nv] = varerr(obs[i].sat, sys, azel[1+i*2], j, opt)+varm[j]+vare[i]+vart; + var[nv] = varerr(obs[i].sat, sys, azel[1 + i * 2], j, opt) + varm[j] + vare[i] + vart; - if (j == 0) rtk->ssat[sat-1].resc[0] = v[nv]; - else rtk->ssat[sat-1].resp[0] = v[nv]; + if (j == 0) + rtk->ssat[sat - 1].resc[0] = v[nv]; + else + rtk->ssat[sat - 1].resp[0] = v[nv]; - /* test innovation */ + /* test innovation */ #if 0 if (opt->maxinno>0.0 && fabs(v[nv])>opt->maxinno) { #else - if (opt->maxinno>0.0 && fabs(v[nv])>opt->maxinno && sys != SYS_GLO) - { + if (opt->maxinno > 0.0 && fabs(v[nv]) > opt->maxinno && sys != SYS_GLO) + { #endif - trace(2, "ppp outlier rejected %s sat=%2d type=%d v=%.3f\n", - time_str(obs[i].time, 0), sat, j, v[nv]); - rtk->ssat[sat-1].rejc[0]++; - continue; - } - if (j == 0) rtk->ssat[sat-1].vsat[0] = 1; - nv++; + trace(2, "ppp outlier rejected %s sat=%2d type=%d v=%.3f\n", + time_str(obs[i].time, 0), sat, j, v[nv]); + rtk->ssat[sat - 1].rejc[0]++; + continue; } + if (j == 0) rtk->ssat[sat - 1].vsat[0] = 1; + nv++; } - for (i = 0;inx, n); - rs = mat(6, n); dts = mat(2, n); var = mat(1, n); azel = zeros(2, n); + rs = mat(6, n); + dts = mat(2, n); + var = mat(1, n); + azel = zeros(2, n); for (i = 0; i < MAXSAT; i++) rtk->ssat[i].fix[0] = 0; /* temporal update of states */ udstate_ppp(rtk, obs, n, nav); - trace(4, "x(0)="); tracemat(4, rtk->x, 1, NR_PPP(opt), 13, 4); + trace(4, "x(0)="); + tracemat(4, rtk->x, 1, NR_PPP(opt), 13, 4); /* satellite positions and clocks */ satposs(obs[0].time, obs, n, nav, rtk->opt.sateph, rs, dts, var, svh); @@ -1639,9 +1708,13 @@ void pppos(rtk_t *rtk, const obsd_t *obs, int n, const nav_t *nav) { testeclipse(obs, n, nav, rs); } - xp = mat(rtk->nx, 1); Pp = zeros(rtk->nx, rtk->nx); + xp = mat(rtk->nx, 1); + Pp = zeros(rtk->nx, rtk->nx); matcpy(xp, rtk->x, rtk->nx, 1); - nv = n*rtk->opt.nf*2; v = mat(nv, 1); H = mat(rtk->nx, nv); R = mat(nv, nv); + nv = n * rtk->opt.nf * 2; + v = mat(nv, 1); + H = mat(rtk->nx, nv); + R = mat(nv, nv); for (i = 0; i < rtk->opt.niter; i++) { @@ -1656,7 +1729,8 @@ void pppos(rtk_t *rtk, const obsd_t *obs, int n, const nav_t *nav) trace(2, "ppp filter error %s info=%d\n", time_str(rtk->sol.time, 0), info); break; } - trace(4, "x(%d)=", i+1); tracemat(4, xp, 1, NR_PPP(opt), 13, 4); + trace(4, "x(%d)=", i + 1); + tracemat(4, xp, 1, NR_PPP(opt), 13, 4); stat = SOLQ_PPP; } @@ -1678,10 +1752,10 @@ void pppos(rtk_t *rtk, const obsd_t *obs, int n, const nav_t *nav) rtk->sol.ns = 0; for (i = 0; i < n && i < MAXOBS; i++) { - if (!rtk->ssat[obs[i].sat-1].vsat[0]) continue; - rtk->ssat[obs[i].sat-1].lock[0]++; - rtk->ssat[obs[i].sat-1].outc[0] = 0; - rtk->ssat[obs[i].sat-1].fix [0] = 4; + if (!rtk->ssat[obs[i].sat - 1].vsat[0]) continue; + rtk->ssat[obs[i].sat - 1].lock[0]++; + rtk->ssat[obs[i].sat - 1].outc[0] = 0; + rtk->ssat[obs[i].sat - 1].fix[0] = 4; rtk->sol.ns++; } rtk->sol.stat = stat; @@ -1689,22 +1763,29 @@ void pppos(rtk_t *rtk, const obsd_t *obs, int n, const nav_t *nav) for (i = 0; i < 3; i++) { rtk->sol.rr[i] = rtk->x[i]; - rtk->sol.qr[i] = (float)rtk->P[i+i*rtk->nx]; + rtk->sol.qr[i] = (float)rtk->P[i + i * rtk->nx]; } rtk->sol.qr[3] = (float)rtk->P[1]; - rtk->sol.qr[4] = (float)rtk->P[2+rtk->nx]; + rtk->sol.qr[4] = (float)rtk->P[2 + rtk->nx]; rtk->sol.qr[5] = (float)rtk->P[2]; rtk->sol.dtr[0] = rtk->x[IC_PPP(0, opt)]; - rtk->sol.dtr[1] = rtk->x[IC_PPP(1, opt)]-rtk->x[IC_PPP(0, opt)]; + rtk->sol.dtr[1] = rtk->x[IC_PPP(1, opt)] - rtk->x[IC_PPP(0, opt)]; for (i = 0; i < n && i < MAXOBS; i++) { - rtk->ssat[obs[i].sat-1].snr[0] = MIN_PPP(obs[i].SNR[0], obs[i].SNR[1]); + rtk->ssat[obs[i].sat - 1].snr[0] = MIN_PPP(obs[i].SNR[0], obs[i].SNR[1]); } for (i = 0; i < MAXSAT; i++) { - if (rtk->ssat[i].slip[0]&3) rtk->ssat[i].slipc[0]++; + if (rtk->ssat[i].slip[0] & 3) rtk->ssat[i].slipc[0]++; } } - free(rs); free(dts); free(var); free(azel); - free(xp); free(Pp); free(v); free(H); free(R); + free(rs); + free(dts); + free(var); + free(azel); + free(xp); + free(Pp); + free(v); + free(H); + free(R); } diff --git a/src/algorithms/libs/rtklib/rtklib_ppp.h b/src/algorithms/libs/rtklib/rtklib_ppp.h index 314e0d164..a613ecb8e 100644 --- a/src/algorithms/libs/rtklib/rtklib_ppp.h +++ b/src/algorithms/libs/rtklib/rtklib_ppp.h @@ -57,23 +57,37 @@ #include "rtklib.h" -#define MIN_PPP(x,y) ((x)<=(y)?(x):(y)) -#define ROUND_PPP(x) (int)floor((x)+0.5) +#define MIN_PPP(x, y) ((x) <= (y) ? (x) : (y)) +#define ROUND_PPP(x) (int)floor((x) + 0.5) -#define SWAP_I(x,y) do {int _z=x; x=y; y=_z;} while (0) -#define SWAP_D(x,y) do {double _z=x; x=y; y=_z;} while (0) +#define SWAP_I(x, y) \ + do \ + { \ + int _z = x; \ + x = y; \ + y = _z; \ + } \ + while (0) +#define SWAP_D(x, y) \ + do \ + { \ + double _z = x; \ + x = y; \ + y = _z; \ + } \ + while (0) -const double MIN_ARC_GAP = 300.0; /* min arc gap (s) */ -const double CONST_AMB = 0.001; /* constraint to fixed ambiguity */ -const double THRES_RES = 0.3; /* threashold of residuals test (m) */ +const double MIN_ARC_GAP = 300.0; /* min arc gap (s) */ +const double CONST_AMB = 0.001; /* constraint to fixed ambiguity */ +const double THRES_RES = 0.3; /* threashold of residuals test (m) */ const double LOG_PI = 1.14472988584940017; /* log(pi) */ -const double SQRT2 = 1.41421356237309510; /* sqrt(2) */ +const double SQRT2 = 1.41421356237309510; /* sqrt(2) */ -const double VAR_POS_PPP = std::pow(100.0, 2.0); /* init variance receiver position (m^2) */ -const double VAR_CLK = std::pow(100.0, 2.0); /* init variance receiver clock (m^2) */ -const double VAR_ZTD = std::pow( 0.3, 2.0); /* init variance ztd (m^2) */ -const double VAR_GRA_PPP = std::pow(0.001, 2.0); /* init variance gradient (m^2) */ -const double VAR_BIAS = std::pow(100.0, 2.0); /* init variance phase-bias (m^2) */ +const double VAR_POS_PPP = std::pow(100.0, 2.0); /* init variance receiver position (m^2) */ +const double VAR_CLK = std::pow(100.0, 2.0); /* init variance receiver clock (m^2) */ +const double VAR_ZTD = std::pow(0.3, 2.0); /* init variance ztd (m^2) */ +const double VAR_GRA_PPP = std::pow(0.001, 2.0); /* init variance gradient (m^2) */ +const double VAR_BIAS = std::pow(100.0, 2.0); /* init variance phase-bias (m^2) */ const double VAR_IONO_OFF = std::pow(10.0, 2.0); /* variance of iono-model-off */ @@ -112,15 +126,14 @@ int fix_amb_ILS(rtk_t *rtk, int *sat1, int *sat2, int *NW, int n); int pppamb(rtk_t *rtk, const obsd_t *obs, int n, const nav_t *nav, const double *azel); - /* functions originally included in RTKLIB/src/ppp.c v2.4.2 */ void pppoutsolstat(rtk_t *rtk, int level, FILE *fp); void tide_pl(const double *eu, const double *rp, double GMp, const double *pos, double *dr); void tide_solid(const double *rsun, const double *rmoon, - const double *pos, const double *E, double gmst, int opt, - double *dr); + const double *pos, const double *E, double gmst, int opt, + double *dr); void tide_oload(gtime_t tut, const double *odisp, double *denu); @@ -129,7 +142,7 @@ 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, double *denu); void tidedisp(gtime_t tutc, const double *rr, int opt, const erp_t *erp, - const double *odisp, double *dr); + const double *odisp, double *dr); void testeclipse(const obsd_t *obs, int n, const nav_t *nav, double *rs); @@ -138,19 +151,19 @@ double varerr(int sat, int sys, double el, int type, const prcopt_t *opt); void initx(rtk_t *rtk, double xi, double var, int i); int ifmeas(const obsd_t *obs, const nav_t *nav, const double *azel, - const prcopt_t *opt, const double *dantr, const double *dants, - double phw, double *meas, double *var); + const prcopt_t *opt, const double *dantr, const double *dants, + double phw, double *meas, double *var); double gettgd_ppp(int sat, const nav_t *nav); int corr_ion(gtime_t time, const nav_t *nav, int sat, const double *pos, - const double *azel, int ionoopt, double *ion, double *var, - int *brk); + const double *azel, int ionoopt, double *ion, double *var, + int *brk); int corrmeas(const obsd_t *obs, const nav_t *nav, const double *pos, - const double *azel, const prcopt_t *opt, - const double *dantr, const double *dants, double phw, - double *meas, double *var, int *brk); + const double *azel, const prcopt_t *opt, + const double *dantr, const double *dants, double phw, + double *meas, double *var, int *brk); double gfmeas(const obsd_t *obs, const nav_t *nav); @@ -171,13 +184,13 @@ 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, double *dant); double prectrop(gtime_t time, const double *pos, const double *azel, - const prcopt_t *opt, const double *x, double *dtdx, - double *var); + const prcopt_t *opt, const double *x, double *dtdx, + double *var); int res_ppp(int iter, const obsd_t *obs, int n, const double *rs, - const double *dts, const double *vare, const int *svh, - const nav_t *nav, const double *x, rtk_t *rtk, double *v, - double *H, double *R, double *azel); + const double *dts, const double *vare, const int *svh, + const nav_t *nav, const double *x, rtk_t *rtk, double *v, + double *H, double *R, double *azel); int pppnx(const prcopt_t *opt); diff --git a/src/algorithms/libs/rtklib/rtklib_preceph.cc b/src/algorithms/libs/rtklib/rtklib_preceph.cc index 2e4d73911..f883b3e44 100644 --- a/src/algorithms/libs/rtklib/rtklib_preceph.cc +++ b/src/algorithms/libs/rtklib/rtklib_preceph.cc @@ -78,14 +78,14 @@ int code2sys(char code) /* read sp3 header -----------------------------------------------------------*/ 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; char buff[1024]; trace(3, "readsp3h:\n"); - for (i = 0;i<22;i++) + for (i = 0; i < 22; i++) { if (!fgets(buff, sizeof(buff), fp)) break; @@ -94,26 +94,27 @@ int readsp3h(FILE *fp, gtime_t *time, char *type, int *sats, *type = buff[2]; if (str2time(buff, 3, 28, time)) return 0; } - else if (2<=i && i<=6) + else if (2 <= i && i <= 6) { if (i == 2) { ns = (int)str2num(buff, 4, 2); } - for (j = 0;j<17 && kne >= nav->nemax) { nav->nemax += 256; - if (!(nav_peph = (peph_t *)realloc(nav->peph, sizeof(peph_t)*nav->nemax))) + if (!(nav_peph = (peph_t *)realloc(nav->peph, sizeof(peph_t) * nav->nemax))) { trace(1, "readsp3b malloc error n=%d\n", nav->nemax); free(nav->peph); @@ -146,12 +147,12 @@ int addpeph(nav_t *nav, peph_t *peph) /* read sp3 body -------------------------------------------------------------*/ void readsp3b(FILE *fp, char type, int *sats __attribute__((unused)), int ns, double *bfact, - char *tsys, int index, int opt, nav_t *nav) + char *tsys, int index, int opt, nav_t *nav) { peph_t peph; gtime_t time; double val, std, base; - int i, j, sat, sys, prn, n = ns*(type == 'P' ? 1 : 2), pred_o, pred_c, v; + int i, j, sat, sys, prn, n = ns * (type == 'P' ? 1 : 2), pred_o, pred_c, v; char buff[1024]; trace(3, "readsp3b: type=%c ns=%d index=%d opt=%d\n", type, ns, index, opt); @@ -166,7 +167,7 @@ void readsp3b(FILE *fp, char type, int *sats __attribute__((unused)), int ns, do continue; } if (!strcmp(tsys, "UTC")) time = utc2gpst(time); /* utc->gpst */ - peph.time = time; + peph.time = time; peph.index = index; for (i = 0; i < MAXSAT; i++) @@ -184,14 +185,16 @@ void readsp3b(FILE *fp, char type, int *sats __attribute__((unused)), int ns, do peph.vco[i][j] = 0.0f; } } - for (i = pred_o = pred_c = v = 0;i= 76 && buff[75] == 'P'; pred_o = strlen(buff) >= 80 && buff[79] == 'P'; } - for (j = 0;j<4;j++) + for (j = 0; j < 4; j++) { /* read option for predicted value */ - if (j< 3 && (opt&1) && pred_o) continue; - if (j< 3 && (opt&2) && !pred_o) continue; - if (j == 3 && (opt&1) && pred_c) continue; - if (j == 3 && (opt&2) && !pred_c) continue; + if (j < 3 && (opt & 1) && pred_o) continue; + if (j < 3 && (opt & 2) && !pred_o) continue; + if (j == 3 && (opt & 1) && pred_c) continue; + if (j == 3 && (opt & 2) && !pred_c) continue; - val = str2num(buff, 4 + j * 14, 14); + val = str2num(buff, 4 + j * 14, 14); std = str2num(buff, 61 + j * 3, j < 3 ? 2 : 3); - if (buff[0] == 'P') { /* position */ + if (buff[0] == 'P') + { /* position */ if (val != 0.0 && fabs(val - 999999.999999) >= 1e-6) { - peph.pos[sat-1][j] = val*(j < 3 ? 1000.0 : 1e-6); + peph.pos[sat - 1][j] = val * (j < 3 ? 1000.0 : 1e-6); v = 1; /* valid epoch */ } if ((base = bfact[j < 3 ? 0 : 1]) > 0.0 && std > 0.0) { - peph.std[sat-1][j] = (float)(std::pow(base, std)*(j < 3 ? 1e-3 : 1e-12)); + peph.std[sat - 1][j] = (float)(std::pow(base, std) * (j < 3 ? 1e-3 : 1e-12)); } - } - else if (v) { /* velocity */ + } + else if (v) + { /* velocity */ if (val != 0.0 && fabs(val - 999999.999999) >= 1e-6) { - peph.vel[sat-1][j] = val*(j < 3 ? 0.1 : 1e-10); + peph.vel[sat - 1][j] = val * (j < 3 ? 0.1 : 1e-10); } if ((base = bfact[j < 3 ? 0 : 1]) > 0.0 && std > 0.0) { - peph.vst[sat-1][j] = (float)(std::pow(base, std)*(j < 3 ? 1e-7 : 1e-16)); + peph.vst[sat - 1][j] = (float)(std::pow(base, std) * (j < 3 ? 1e-7 : 1e-16)); } - } + } } } if (v) @@ -243,7 +248,7 @@ void readsp3b(FILE *fp, char type, int *sats __attribute__((unused)), int ns, do /* compare precise ephemeris -------------------------------------------------*/ -int cmppeph(const void *p1, const void *p2) +int cmppeph(const void *p1, const void *p2) { peph_t *q1 = (peph_t *)p1, *q2 = (peph_t *)p2; double tt = timediff(q1->time, q2->time); @@ -252,7 +257,7 @@ int cmppeph(const void *p1, const void *p2) /* combine precise ephemeris -------------------------------------------------*/ -void combpeph(nav_t *nav, int opt) +void combpeph(nav_t *nav, int opt) { int i, j, k, m; @@ -260,7 +265,7 @@ void combpeph(nav_t *nav, int opt) qsort(nav->peph, nav->ne, sizeof(peph_t), cmppeph); - if (opt&4) return; + if (opt & 4) return; for (i = 0, j = 1; j < nav->ne; j++) { @@ -269,15 +274,16 @@ void combpeph(nav_t *nav, int opt) for (k = 0; k < MAXSAT; k++) { if (norm_rtk(nav->peph[j].pos[k], 4) <= 0.0) continue; - for (m = 0;m < 4; m++) nav->peph[i].pos[k][m] = nav->peph[j].pos[k][m]; - for (m = 0;m < 4; m++) nav->peph[i].std[k][m] = nav->peph[j].std[k][m]; - for (m = 0;m < 4; m++) nav->peph[i].vel[k][m] = nav->peph[j].vel[k][m]; - for (m = 0;m < 4; m++) nav->peph[i].vst[k][m] = nav->peph[j].vst[k][m]; + for (m = 0; m < 4; m++) nav->peph[i].pos[k][m] = nav->peph[j].pos[k][m]; + for (m = 0; m < 4; m++) nav->peph[i].std[k][m] = nav->peph[j].std[k][m]; + for (m = 0; m < 4; m++) nav->peph[i].vel[k][m] = nav->peph[j].vel[k][m]; + for (m = 0; m < 4; m++) nav->peph[i].vst[k][m] = nav->peph[j].vst[k][m]; } } - else if (++i < j) nav->peph[i] = nav->peph[j]; + else if (++i < j) + nav->peph[i] = nav->peph[j]; } - nav->ne = i+1; + nav->ne = i + 1; trace(4, "combpeph: ne=%d\n", nav->ne); } @@ -323,7 +329,7 @@ void readsp3(const char *file, nav_t *nav, int opt) if (!(ext = strrchr(efiles[i], '.'))) continue; if (!strstr(ext + 1, "sp3") && !strstr(ext + 1, ".SP3") && - !strstr(ext + 1, "eph") && !strstr(ext + 1, ".EPH")) continue; + !strstr(ext + 1, "eph") && !strstr(ext + 1, ".EPH")) continue; if (!(fp = fopen(efiles[i], "r"))) { @@ -355,8 +361,8 @@ void readsp3(const char *file, nav_t *nav, int opt) *-----------------------------------------------------------------------------*/ int readsap(const char *file, gtime_t time, nav_t *nav) { - pcvs_t pcvs = {0, 0, (pcv_t*){ 0 } }; - pcv_t pcv0 = { 0, {}, {}, {0,0}, {0,0}, {{},{}}, {{},{}} }, *pcv; + pcvs_t pcvs = {0, 0, (pcv_t *){0}}; + pcv_t pcv0 = {0, {}, {}, {0, 0}, {0, 0}, {{}, {}}, {{}, {}}}, *pcv; int i; trace(3, "readsap : file=%s time=%s\n", file, time_str(time, 0)); @@ -390,9 +396,12 @@ int readdcbf(const char *file, nav_t *nav, const sta_t *sta) } while (fgets(buff, sizeof(buff), fp)) { - if (strstr(buff, "DIFFERENTIAL (P1-P2) CODE BIASES")) type = 1; - else if (strstr(buff, "DIFFERENTIAL (P1-C1) CODE BIASES")) type = 2; - else if (strstr(buff, "DIFFERENTIAL (P2-C2) CODE BIASES")) type = 3; + if (strstr(buff, "DIFFERENTIAL (P1-P2) CODE BIASES")) + type = 1; + else if (strstr(buff, "DIFFERENTIAL (P1-C1) CODE BIASES")) + type = 2; + else if (strstr(buff, "DIFFERENTIAL (P2-C2) CODE BIASES")) + type = 3; if (!type || sscanf(buff, "%s %s", str1, str2) < 1) continue; @@ -407,12 +416,12 @@ int readdcbf(const char *file, nav_t *nav, const sta_t *sta) if (i < MAXRCV) { j = !strcmp(str1, "G") ? 0 : 1; - nav->rbias[i][j][type-1] = cbias * 1e-9 * SPEED_OF_LIGHT; /* ns -> m */ + nav->rbias[i][j][type - 1] = cbias * 1e-9 * SPEED_OF_LIGHT; /* ns -> m */ } } else if ((sat = satid2no(str1))) - { /* satellite dcb */ - nav->cbias[sat-1][type-1] = cbias * 1e-9 * SPEED_OF_LIGHT; /* ns -> m */ + { /* satellite dcb */ + nav->cbias[sat - 1][type - 1] = cbias * 1e-9 * SPEED_OF_LIGHT; /* ns -> m */ } } fclose(fp); @@ -437,10 +446,11 @@ int readdcb(const char *file, nav_t *nav, const sta_t *sta) trace(3, "readdcb : file=%s\n", file); - for (i = 0;i < MAXSAT; i++) for (j = 0; j < 3; j++) - { - nav->cbias[i][j] = 0.0; - } + for (i = 0; i < MAXSAT; i++) + for (j = 0; j < 3; j++) + { + nav->cbias[i][j] = 0.0; + } for (i = 0; i < MAXEXFILE; i++) { if (!(efiles[i] = (char *)malloc(1024))) @@ -455,7 +465,7 @@ int readdcb(const char *file, nav_t *nav, const sta_t *sta) { readdcbf(efiles[i], nav, sta); } - for (i = 0; i < MAXEXFILE;i ++) free(efiles[i]); + for (i = 0; i < MAXEXFILE; i++) free(efiles[i]); return 1; } @@ -463,24 +473,24 @@ int readdcb(const char *file, nav_t *nav, const sta_t *sta) /* add satellite fcb ---------------------------------------------------------*/ 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; int i, 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) { for (i = 0; i < 3; i++) { - nav->fcb[nav->nf-1].bias[sat-1][i] = bias[i]; - nav->fcb[nav->nf-1].std [sat-1][i] = std [i]; + nav->fcb[nav->nf - 1].bias[sat - 1][i] = bias[i]; + nav->fcb[nav->nf - 1].std[sat - 1][i] = std[i]; } return 1; } if (nav->nf >= nav->nfmax) { nav->nfmax = nav->nfmax <= 0 ? 2048 : nav->nfmax * 2; - if (!(nav_fcb = (fcbd_t *)realloc(nav->fcb, sizeof(fcbd_t)*nav->nfmax))) + if (!(nav_fcb = (fcbd_t *)realloc(nav->fcb, sizeof(fcbd_t) * nav->nfmax))) { free(nav->fcb); nav->nf = nav->nfmax = 0; @@ -488,16 +498,17 @@ int addfcb(nav_t *nav, gtime_t ts, gtime_t te, int sat, } nav->fcb = nav_fcb; } - for (i = 0; i < MAXSAT; i++) for (j = 0; j < 3; j++) - { - nav->fcb[nav->nf].bias[i][j] = nav->fcb[nav->nf].std[i][j] = 0.0; - } + for (i = 0; i < MAXSAT; i++) + for (j = 0; j < 3; j++) + { + nav->fcb[nav->nf].bias[i][j] = nav->fcb[nav->nf].std[i][j] = 0.0; + } for (i = 0; i < 3; i++) { - nav->fcb[nav->nf].bias[sat-1][i] = bias[i]; - nav->fcb[nav->nf].std [sat-1][i] = std [i]; + nav->fcb[nav->nf].bias[sat - 1][i] = bias[i]; + nav->fcb[nav->nf].std[sat - 1][i] = std[i]; } - nav->fcb[nav->nf ].ts = ts; + nav->fcb[nav->nf].ts = ts; nav->fcb[nav->nf++].te = te; return 1; } @@ -522,10 +533,12 @@ int readfcbf(const char *file, nav_t *nav) while (fgets(buff, sizeof(buff), fp)) { if ((p = strchr(buff, '#'))) *p = '\0'; - if (sscanf(buff, "%lf/%lf/%lf %lf:%lf:%lf %lf/%lf/%lf %lf:%lf:%lf %s" - "%lf %lf %lf %lf %lf %lf", ep1, ep1+1, ep1+2, ep1+3, ep1+4, ep1+5, - ep2, ep2+1, ep2+2, ep2+3, ep2+4, ep2+5, str, bias, std, bias+1, std+1, - bias+2, std+2) < 17) continue; + if (sscanf(buff, + "%lf/%lf/%lf %lf:%lf:%lf %lf/%lf/%lf %lf:%lf:%lf %s" + "%lf %lf %lf %lf %lf %lf", + ep1, ep1 + 1, ep1 + 2, ep1 + 3, ep1 + 4, ep1 + 5, + ep2, ep2 + 1, ep2 + 2, ep2 + 3, ep2 + 4, ep2 + 5, str, bias, std, bias + 1, std + 1, + bias + 2, std + 2) < 17) continue; if (!(sat = satid2no(str))) continue; ts = epoch2time(ep1); te = epoch2time(ep2); @@ -596,7 +609,7 @@ double interppol(const double *x, double *y, int n) { for (i = 0; i < n - j; i++) { - y[i] = (x[i+j] * y[i] - x[i] * y[i+1]) / (x[i+j] - x[i]); + y[i] = (x[i + j] * y[i] - x[i] * y[i + 1]) / (x[i + j] - x[i]); } } return y[0]; @@ -605,9 +618,9 @@ double interppol(const double *x, double *y, int n) /* satellite position by precise ephemeris -----------------------------------*/ 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], p[3][NMAX + 1], c[2], *pos, std = 0.0, s[3], sinl, cosl; int i, j, k, index; trace(4, "pephpos : time=%s sat=%2d\n", time_str(time, 3), sat); @@ -615,8 +628,8 @@ int pephpos(gtime_t time, int sat, const nav_t *nav, double *rs, rs[0] = rs[1] = rs[2] = dts[0] = 0.0; if (nav->ne < NMAX + 1 || - timediff(time, nav->peph[0].time) < -MAXDTE || - timediff(time, nav->peph[nav->ne-1].time) > MAXDTE) + timediff(time, nav->peph[0].time) < -MAXDTE || + timediff(time, nav->peph[nav->ne - 1].time) > MAXDTE) { trace(3, "no prec ephem %s sat=%2d\n", time_str(time, 0), sat); return 0; @@ -625,26 +638,32 @@ int pephpos(gtime_t time, int sat, const nav_t *nav, double *rs, for (i = 0, j = nav->ne - 1; i < j;) { k = (i + j) / 2; - if (timediff(nav->peph[k].time, time) < 0.0) i = k + 1; else j = k; + if (timediff(nav->peph[k].time, time) < 0.0) + i = k + 1; + else + j = k; } - index = i <= 0 ? 0 : i-1; + index = i <= 0 ? 0 : i - 1; /* polynomial interpolation for orbit */ i = index - (NMAX + 1) / 2; - if (i < 0) i = 0; else if (i + NMAX >= nav->ne) i = nav->ne - NMAX - 1; + if (i < 0) + i = 0; + else if (i + NMAX >= nav->ne) + i = nav->ne - NMAX - 1; for (j = 0; j <= NMAX; j++) { - t[j] = timediff(nav->peph[i+j].time, time); - if (norm_rtk(nav->peph[i+j].pos[sat-1], 3) <= 0.0) + t[j] = timediff(nav->peph[i + j].time, time); + if (norm_rtk(nav->peph[i + j].pos[sat - 1], 3) <= 0.0) { trace(3, "prec ephem outage %s sat=%2d\n", time_str(time, 0), sat); return 0; } } - for (j = 0;j<=NMAX;j++) + for (j = 0; j <= NMAX; j++) { - pos = nav->peph[i+j].pos[sat-1]; + pos = nav->peph[i + j].pos[sat - 1]; #if 0 p[0][j] = pos[0]; p[1][j] = pos[1]; @@ -663,39 +682,41 @@ int pephpos(gtime_t time, int sat, const nav_t *nav, double *rs, } if (vare) { - for (i = 0; i < 3; i++) s[i] = nav->peph[index].std[sat-1][i]; + for (i = 0; i < 3; i++) s[i] = nav->peph[index].std[sat - 1][i]; std = norm_rtk(s, 3); /* extrapolation error for orbit */ - if (t[0 ] > 0.0) std += EXTERR_EPH * std::pow(t[0 ], 2.0) / 2.0; - else if (t[NMAX] < 0.0) std += EXTERR_EPH * std::pow(t[NMAX], 2.0) / 2.0; + if (t[0] > 0.0) + std += EXTERR_EPH * std::pow(t[0], 2.0) / 2.0; + else if (t[NMAX] < 0.0) + std += EXTERR_EPH * std::pow(t[NMAX], 2.0) / 2.0; *vare = std::pow(std, 2.0); } /* linear interpolation for clock */ - t[0] = timediff(time, nav->peph[index ].time); - t[1] = timediff(time, nav->peph[index+1].time); - c[0] = nav->peph[index ].pos[sat-1][3]; - c[1] = nav->peph[index+1].pos[sat-1][3]; + t[0] = timediff(time, nav->peph[index].time); + t[1] = timediff(time, nav->peph[index + 1].time); + c[0] = nav->peph[index].pos[sat - 1][3]; + c[1] = nav->peph[index + 1].pos[sat - 1][3]; if (t[0] <= 0.0) { if ((dts[0] = c[0]) != 0.0) { - std = nav->peph[index].std[sat-1][3] * SPEED_OF_LIGHT - EXTERR_CLK * t[0]; + std = nav->peph[index].std[sat - 1][3] * SPEED_OF_LIGHT - EXTERR_CLK * t[0]; } } else if (t[1] >= 0.0) { if ((dts[0] = c[1]) != 0.0) { - std = nav->peph[index+1].std[sat-1][3] * SPEED_OF_LIGHT + EXTERR_CLK * t[1]; + std = nav->peph[index + 1].std[sat - 1][3] * SPEED_OF_LIGHT + EXTERR_CLK * t[1]; } } else if (c[0] != 0.0 && c[1] != 0.0) { dts[0] = (c[1] * t[0] - c[0] * t[1]) / (t[0] - t[1]); - i = t[0] < -t[1] ? 0: 1; - std = nav->peph[index+i].std[sat-1][3] + EXTERR_CLK * fabs(t[i]); + i = t[0] < -t[1] ? 0 : 1; + std = nav->peph[index + i].std[sat - 1][3] + EXTERR_CLK * fabs(t[i]); } else { @@ -708,7 +729,7 @@ int pephpos(gtime_t time, int sat, const nav_t *nav, double *rs, /* satellite clock by precise clock ------------------------------------------*/ int pephclk(gtime_t time, int sat, const nav_t *nav, double *dts, - double *varc) + double *varc) { double t[2], c[2], std; int i, j, k, index; @@ -716,8 +737,8 @@ int pephclk(gtime_t time, int sat, const nav_t *nav, double *dts, trace(4, "pephclk : time=%s sat=%2d\n", time_str(time, 3), sat); if (nav->nc < 2 || - timediff(time, nav->pclk[0].time) < -MAXDTE || - timediff(time, nav->pclk[nav->nc-1].time) > MAXDTE) + timediff(time, nav->pclk[0].time) < -MAXDTE || + timediff(time, nav->pclk[nav->nc - 1].time) > MAXDTE) { trace(3, "no prec clock %s sat=%2d\n", time_str(time, 0), sat); return 1; @@ -726,31 +747,34 @@ int pephclk(gtime_t time, int sat, const nav_t *nav, double *dts, for (i = 0, j = nav->nc - 1; i < j;) { k = (i + j) / 2; - if (timediff(nav->pclk[k].time, time) < 0.0) i = k + 1; else j = k; + if (timediff(nav->pclk[k].time, time) < 0.0) + i = k + 1; + else + j = k; } - index = i<=0?0:i-1; + index = i <= 0 ? 0 : i - 1; /* linear interpolation for clock */ - t[0] = timediff(time, nav->pclk[index ].time); - t[1] = timediff(time, nav->pclk[index+1].time); - c[0] = nav->pclk[index ].clk[sat-1][0]; - c[1] = nav->pclk[index+1].clk[sat-1][0]; + t[0] = timediff(time, nav->pclk[index].time); + t[1] = timediff(time, nav->pclk[index + 1].time); + c[0] = nav->pclk[index].clk[sat - 1][0]; + c[1] = nav->pclk[index + 1].clk[sat - 1][0]; if (t[0] <= 0.0) { if ((dts[0] = c[0]) == 0.0) return 0; - std = nav->pclk[index].std[sat-1][0] * SPEED_OF_LIGHT - EXTERR_CLK * t[0]; + std = nav->pclk[index].std[sat - 1][0] * SPEED_OF_LIGHT - EXTERR_CLK * t[0]; } else if (t[1] >= 0.0) { if ((dts[0] = c[1]) == 0.0) return 0; - std = nav->pclk[index+1].std[sat-1][0] * SPEED_OF_LIGHT + EXTERR_CLK * t[1]; + std = nav->pclk[index + 1].std[sat - 1][0] * SPEED_OF_LIGHT + EXTERR_CLK * t[1]; } else if (c[0] != 0.0 && c[1] != 0.0) { - dts[0] = (c[1]*t[0]-c[0]*t[1]) / (t[0] - t[1]); + dts[0] = (c[1] * t[0] - c[0] * t[1]) / (t[0] - t[1]); i = t[0] < -t[1] ? 0 : 1; - std = nav->pclk[index+i].std[sat-1][0] * SPEED_OF_LIGHT + EXTERR_CLK * fabs(t[i]); + std = nav->pclk[index + i].std[sat - 1][0] * SPEED_OF_LIGHT + EXTERR_CLK * fabs(t[i]); } else { @@ -774,10 +798,10 @@ int pephclk(gtime_t time, int sat, const nav_t *nav, double *dts, * return : none *-----------------------------------------------------------------------------*/ void satantoff(gtime_t time, const double *rs, int sat, const nav_t *nav, - double *dant) + double *dant) { - const double *lam = nav->lam[sat-1]; - const pcv_t *pcv = nav->pcvs+sat-1; + const double *lam = nav->lam[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 gamma, C1, C2, dant1, dant2; int i, j = 0, k = 1; @@ -790,7 +814,7 @@ void satantoff(gtime_t time, const double *rs, int sat, const nav_t *nav, /* unit vectors of satellite fixed coordinates */ for (i = 0; i < 3; i++) r[i] = -rs[i]; if (!normv3(r, ez)) return; - for (i = 0; i < 3; i++) r[i] = rsun[i]-rs[i]; + for (i = 0; i < 3; i++) r[i] = rsun[i] - rs[i]; if (!normv3(r, es)) return; cross3(ez, es, r); if (!normv3(r, ey)) return; @@ -833,7 +857,7 @@ void satantoff(gtime_t time, const double *rs, int sat, const nav_t *nav, * if precise clocks are not set, clocks in sp3 are used instead *-----------------------------------------------------------------------------*/ 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; int i; @@ -844,26 +868,26 @@ int peph2pos(gtime_t time, int sat, const nav_t *nav, int opt, /* satellite position and clock bias */ if (!pephpos(time, sat, nav, rss, dtss, &vare, &varc) || - !pephclk(time, sat, nav, dtss, &varc)) return 0; + !pephclk(time, sat, nav, dtss, &varc)) return 0; time = timeadd(time, tt); if (!pephpos(time, sat, nav, rst, dtst, NULL, NULL) || - !pephclk(time, sat, nav, dtst, NULL)) return 0; + !pephclk(time, sat, nav, dtst, NULL)) return 0; /* satellite antenna offset correction */ if (opt) { satantoff(time, rss, sat, nav, dant); } - for (i = 0;i<3;i++) + for (i = 0; i < 3; i++) { - rs[i ] = rss[i] + dant[i]; - rs[i+3] = (rst[i] - rss[i]) / tt; + rs[i] = rss[i] + dant[i]; + rs[i + 3] = (rst[i] - rss[i]) / tt; } /* relativistic effect correction */ if (dtss[0] != 0.0) { - dts[0] = dtss[0] - 2.0 * dot(rs, rs+3, 3) / SPEED_OF_LIGHT / SPEED_OF_LIGHT; + dts[0] = dtss[0] - 2.0 * dot(rs, rs + 3, 3) / SPEED_OF_LIGHT / SPEED_OF_LIGHT; dts[1] = (dtst[0] - dtss[0]) / tt; } else diff --git a/src/algorithms/libs/rtklib/rtklib_preceph.h b/src/algorithms/libs/rtklib/rtklib_preceph.h index 056963916..24b0b610c 100644 --- a/src/algorithms/libs/rtklib/rtklib_preceph.h +++ b/src/algorithms/libs/rtklib/rtklib_preceph.h @@ -66,17 +66,17 @@ #include "rtklib.h" -const int NMAX = 10; /* order of polynomial interpolation */ -const double MAXDTE = 900.0; /* max time difference to ephem time (s) */ -const double EXTERR_CLK = 1e-3; /* extrapolation error for clock (m/s) */ -const double EXTERR_EPH = 5e-7; /* extrapolation error for ephem (m/s^2) */ +const int NMAX = 10; /* order of polynomial interpolation */ +const double MAXDTE = 900.0; /* max time difference to ephem time (s) */ +const double EXTERR_CLK = 1e-3; /* extrapolation error for clock (m/s) */ +const double EXTERR_EPH = 5e-7; /* extrapolation error for ephem (m/s^2) */ int code2sys(char code); int readsp3h(FILE *fp, gtime_t *time, char *type, int *sats, - double *bfact, char *tsys); + double *bfact, char *tsys); int addpeph(nav_t *nav, peph_t *peph); void readsp3b(FILE *fp, char type, int *sats, int ns, double *bfact, - char *tsys, int index, int opt, nav_t *nav); + char *tsys, int index, int opt, nav_t *nav); int cmppeph(const void *p1, const void *p2); void combpeph(nav_t *nav, int opt); void readsp3(const char *file, nav_t *nav, int opt); @@ -84,24 +84,24 @@ int readsap(const char *file, gtime_t time, nav_t *nav); 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 addfcb(nav_t *nav, gtime_t ts, gtime_t te, int sat, - const double *bias, const double *std); + const double *bias, const double *std); int readfcbf(const char *file, nav_t *nav); int readdcb(const char *file, nav_t *nav, const sta_t *sta); 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); int readfcbf(const char *file, nav_t *nav); int cmpfcb(const void *p1, const void *p2); int readfcb(const char *file, nav_t *nav); double interppol(const double *x, double *y, int n); 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); int pephclk(gtime_t time, int sat, const nav_t *nav, double *dts, - double *varc); + double *varc); void satantoff(gtime_t time, const double *rs, int sat, const nav_t *nav, - double *dant); + double *dant); 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); -#endif // GNSS_SDR_RTKLIB_PRECEPH_H_ +#endif // GNSS_SDR_RTKLIB_PRECEPH_H_ diff --git a/src/algorithms/libs/rtklib/rtklib_rtcm.cc b/src/algorithms/libs/rtklib/rtklib_rtcm.cc index e76632801..e3c0d15b9 100644 --- a/src/algorithms/libs/rtklib/rtklib_rtcm.cc +++ b/src/algorithms/libs/rtklib/rtklib_rtcm.cc @@ -67,12 +67,12 @@ int init_rtcm(rtcm_t *rtcm) { gtime_t time0 = {0, 0.0}; obsd_t data0 = {{0, 0.0}, 0, 0, {0}, {0}, {0}, {0.0}, {0.0}, {0.0}}; - eph_t eph0 = {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}; - 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}; - 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' }; + eph_t eph0 = {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}; + 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}; + 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; trace(3, "init_rtcm:\n"); @@ -83,38 +83,39 @@ int init_rtcm(rtcm_t *rtcm) rtcm->sta.antdes[0] = rtcm->sta.antsno[0] = '\0'; rtcm->sta.rectype[0] = rtcm->sta.recver[0] = rtcm->sta.recsno[0] = '\0'; rtcm->sta.antsetup = rtcm->sta.itrf = rtcm->sta.deltype = 0; - for (i = 0;i < 3;i++) + for (i = 0; i < 3; i++) { rtcm->sta.pos[i] = rtcm->sta.del[i] = 0.0; } rtcm->sta.hgt = 0.0; rtcm->dgps = NULL; - for (i = 0;i < MAXSAT;i++) + for (i = 0; i < MAXSAT; i++) { rtcm->ssr[i] = ssr0; } rtcm->msg[0] = rtcm->msgtype[0] = rtcm->opt[0] = '\0'; - for (i = 0;i < 6;i++) rtcm->msmtype[i][0] = '\0'; + for (i = 0; i < 6; i++) rtcm->msmtype[i][0] = '\0'; rtcm->obsflag = rtcm->ephsat = 0; - for (i = 0;i < MAXSAT;i++) for (j = 0;j < NFREQ+NEXOBS;j++) - { - rtcm->cp[i][j] = 0.0; - rtcm->lock[i][j] = rtcm->loss[i][j] = 0; - rtcm->lltime[i][j] = time0; - } + for (i = 0; i < MAXSAT; i++) + for (j = 0; j < NFREQ + NEXOBS; j++) + { + rtcm->cp[i][j] = 0.0; + rtcm->lock[i][j] = rtcm->loss[i][j] = 0; + rtcm->lltime[i][j] = time0; + } rtcm->nbyte = rtcm->nbit = rtcm->len = 0; rtcm->word = 0; - for (i = 0;i < 100;i++) rtcm->nmsg2[i] = 0; - for (i = 0;i < 300;i++) rtcm->nmsg3[i] = 0; + for (i = 0; i < 100; i++) rtcm->nmsg2[i] = 0; + for (i = 0; i < 300; i++) rtcm->nmsg3[i] = 0; rtcm->obs.data = NULL; - rtcm->nav.eph = NULL; + rtcm->nav.eph = NULL; rtcm->nav.geph = NULL; /* reallocate memory for observation and ephemris buffer */ - if (!(rtcm->obs.data = (obsd_t *)malloc(sizeof(obsd_t)*MAXOBS)) || - !(rtcm->nav.eph = (eph_t *)malloc(sizeof(eph_t )*MAXSAT)) || - !(rtcm->nav.geph = (geph_t *)malloc(sizeof(geph_t)*MAXPRNGLO))) + if (!(rtcm->obs.data = (obsd_t *)malloc(sizeof(obsd_t) * MAXOBS)) || + !(rtcm->nav.eph = (eph_t *)malloc(sizeof(eph_t) * MAXSAT)) || + !(rtcm->nav.geph = (geph_t *)malloc(sizeof(geph_t) * MAXPRNGLO))) { free_rtcm(rtcm); return 0; @@ -122,9 +123,9 @@ int init_rtcm(rtcm_t *rtcm) rtcm->obs.n = 0; rtcm->nav.n = MAXSAT; rtcm->nav.ng = MAXPRNGLO; - for (i = 0;i < MAXOBS ;i++) rtcm->obs.data[i] = data0; - for (i = 0;i < MAXSAT ;i++) rtcm->nav.eph [i] = eph0; - for (i = 0;i < MAXPRNGLO;i++) rtcm->nav.geph[i] = geph0; + for (i = 0; i < MAXOBS; i++) rtcm->obs.data[i] = data0; + for (i = 0; i < MAXSAT; i++) rtcm->nav.eph[i] = eph0; + for (i = 0; i < MAXPRNGLO; i++) rtcm->nav.geph[i] = geph0; return 1; } @@ -139,9 +140,15 @@ void free_rtcm(rtcm_t *rtcm) trace(3, "free_rtcm:\n"); /* free memory for observation and ephemeris buffer */ - free(rtcm->obs.data); rtcm->obs.data = NULL; rtcm->obs.n = 0; - free(rtcm->nav.eph ); rtcm->nav.eph = NULL; rtcm->nav.n = 0; - free(rtcm->nav.geph); rtcm->nav.geph = NULL; rtcm->nav.ng = 0; + free(rtcm->obs.data); + rtcm->obs.data = NULL; + rtcm->obs.n = 0; + free(rtcm->nav.eph); + rtcm->nav.eph = NULL; + rtcm->nav.n = 0; + free(rtcm->nav.geph); + rtcm->nav.geph = NULL; + rtcm->nav.ng = 0; } @@ -175,32 +182,38 @@ int input_rtcm2(rtcm_t *rtcm, unsigned char data) /* synchronize frame */ if (rtcm->nbyte == 0) { - preamb = (unsigned char)(rtcm->word>>22); + preamb = (unsigned char)(rtcm->word >> 22); if (rtcm->word & 0x40000000) preamb ^= 0xFF; /* decode preamble */ if (preamb != RTCM2PREAMB) continue; /* check parity */ if (!decode_word(rtcm->word, rtcm->buff)) continue; - rtcm->nbyte = 3; rtcm->nbit = 0; + rtcm->nbyte = 3; + rtcm->nbit = 0; continue; } - if (++rtcm->nbit < 30) continue; else rtcm->nbit = 0; + if (++rtcm->nbit < 30) + continue; + else + rtcm->nbit = 0; /* check parity */ - if (!decode_word(rtcm->word, rtcm->buff+rtcm->nbyte)) + if (!decode_word(rtcm->word, rtcm->buff + rtcm->nbyte)) { trace(2, "rtcm2 partity error: i=%d word=%08x\n", i, rtcm->word); - rtcm->nbyte = 0; rtcm->word &= 0x3; + rtcm->nbyte = 0; + rtcm->word &= 0x3; continue; } rtcm->nbyte += 3; - if (rtcm->nbyte == 6) rtcm->len = (rtcm->buff[5]>>3)*3+6; + if (rtcm->nbyte == 6) rtcm->len = (rtcm->buff[5] >> 3) * 3 + 6; if (rtcm->nbyte < rtcm->len) continue; - rtcm->nbyte = 0; rtcm->word &= 0x3; + rtcm->nbyte = 0; + rtcm->word &= 0x3; /* decode rtcm2 message */ return decode_rtcm2(rtcm); - } + } return 0; } @@ -285,13 +298,13 @@ int input_rtcm3(rtcm_t *rtcm, unsigned char data) if (rtcm->nbyte == 3) { - rtcm->len = getbitu(rtcm->buff, 14, 10)+3; /* length without parity */ + rtcm->len = getbitu(rtcm->buff, 14, 10) + 3; /* length without parity */ } - if (rtcm->nbyte < 3 || rtcm->nbyte < rtcm->len+3) return 0; + if (rtcm->nbyte < 3 || rtcm->nbyte < rtcm->len + 3) return 0; rtcm->nbyte = 0; /* check parity */ - if (rtk_crc24q(rtcm->buff, rtcm->len) != getbitu(rtcm->buff, rtcm->len*8, 24)) + if (rtk_crc24q(rtcm->buff, rtcm->len) != getbitu(rtcm->buff, rtcm->len * 8, 24)) { trace(2, "rtcm3 parity error: len=%d\n", rtcm->len); return 0; @@ -314,7 +327,7 @@ int input_rtcm2f(rtcm_t *rtcm, FILE *fp) trace(4, "input_rtcm2f: data=%02x\n", data); - for (i = 0;i < 4096;i++) + for (i = 0; i < 4096; i++) { if ((data = fgetc(fp)) == EOF) return -2; if ((ret = input_rtcm2(rtcm, (unsigned char)data))) return ret; @@ -336,7 +349,7 @@ int input_rtcm3f(rtcm_t *rtcm, FILE *fp) trace(4, "input_rtcm3f: data=%02x\n", data); - for (i = 0;i < 4096;i++) + for (i = 0; i < 4096; i++) { if ((data = fgetc(fp)) == EOF) return -2; if ((ret = input_rtcm3(rtcm, (unsigned char)data))) return ret; diff --git a/src/algorithms/libs/rtklib/rtklib_rtcm.h b/src/algorithms/libs/rtklib/rtklib_rtcm.h index 5a9128ce4..c2efbb378 100644 --- a/src/algorithms/libs/rtklib/rtklib_rtcm.h +++ b/src/algorithms/libs/rtklib/rtklib_rtcm.h @@ -59,8 +59,8 @@ #include "rtklib_rtcm2.h" #include "rtklib_rtcm3.h" -#define RTCM2PREAMB 0x66 /* rtcm ver.2 frame preamble */ -#define RTCM3PREAMB 0xD3 /* rtcm ver.3 frame preamble */ +#define RTCM2PREAMB 0x66 /* rtcm ver.2 frame preamble */ +#define RTCM3PREAMB 0xD3 /* rtcm ver.3 frame preamble */ int init_rtcm(rtcm_t *rtcm); diff --git a/src/algorithms/libs/rtklib/rtklib_rtcm2.cc b/src/algorithms/libs/rtklib/rtklib_rtcm2.cc index c404215c1..a754db2e0 100644 --- a/src/algorithms/libs/rtklib/rtklib_rtcm2.cc +++ b/src/algorithms/libs/rtklib/rtklib_rtcm2.cc @@ -52,7 +52,6 @@ *----------------------------------------------------------------------------*/ - #include "rtklib_rtcm2.h" #include "rtklib_rtkcmn.h" @@ -66,11 +65,13 @@ void adjhour(rtcm_t *rtcm, double zcnt) /* if no time, get cpu time */ if (rtcm->time.time == 0) rtcm->time = utc2gpst(timeget()); tow = time2gpst(rtcm->time, &week); - hour = floor(tow/3600.0); - sec = tow-hour*3600.0; - if (zcntsec+1800.0) zcnt-=3600.0; - rtcm->time = gpst2time(week, hour*3600+zcnt); + hour = floor(tow / 3600.0); + sec = tow - hour * 3600.0; + if (zcnt < sec - 1800.0) + zcnt += 3600.0; + else if (zcnt > sec + 1800.0) + zcnt -= 3600.0; + rtcm->time = gpst2time(week, hour * 3600 + zcnt); } @@ -79,7 +80,7 @@ int obsindex(obs_t *obs, gtime_t time, int sat) { int i, j; - for (i = 0; in; i++) + for (i = 0; i < obs->n; i++) { if (obs->data[i].sat == sat) return i; /* field already exists */ } @@ -88,7 +89,7 @@ int obsindex(obs_t *obs, gtime_t time, int sat) /* add new field */ obs->data[i].time = time; obs->data[i].sat = sat; - for (j = 0; jdata[i].L[j] = obs->data[i].P[j] = 0.0; obs->data[i].D[j] = 0.0; @@ -107,16 +108,22 @@ int decode_type1(rtcm_t *rtcm) trace(4, "decode_type1: len=%d\n", rtcm->len); - while (i+40 <= rtcm->len*8) + while (i + 40 <= rtcm->len * 8) { - fact = getbitu(rtcm->buff, i, 1); i += 1; - udre = getbitu(rtcm->buff, i, 2); i += 2; - prn = getbitu(rtcm->buff, i, 5); i += 5; - prc = getbits(rtcm->buff, i, 16); i += 16; - rrc = getbits(rtcm->buff, i, 8); i += 8; - iod = getbits(rtcm->buff, i, 8); i += 8; + fact = getbitu(rtcm->buff, i, 1); + i += 1; + udre = getbitu(rtcm->buff, i, 2); + i += 2; + prn = getbitu(rtcm->buff, i, 5); + i += 5; + prc = getbits(rtcm->buff, i, 16); + i += 16; + rrc = getbits(rtcm->buff, i, 8); + i += 8; + iod = getbits(rtcm->buff, i, 8); + i += 8; if (prn == 0) prn = 32; - if (prc == 0x80000000||rrc == 0xFFFF8000) + if (prc == 0x80000000 || rrc == 0xFFFF8000) { trace(2, "rtcm2 1 prc/rrc indicates satellite problem: prn=%d\n", prn); continue; @@ -124,11 +131,11 @@ int decode_type1(rtcm_t *rtcm) if (rtcm->dgps) { sat = satno(SYS_GPS, prn); - rtcm->dgps[sat-1].t0 = rtcm->time; - rtcm->dgps[sat-1].prc = prc*(fact?0.32:0.02); - rtcm->dgps[sat-1].rrc = rrc*(fact?0.032:0.002); - rtcm->dgps[sat-1].iod = iod; - rtcm->dgps[sat-1].udre = udre; + rtcm->dgps[sat - 1].t0 = rtcm->time; + rtcm->dgps[sat - 1].prc = prc * (fact ? 0.32 : 0.02); + rtcm->dgps[sat - 1].rrc = rrc * (fact ? 0.032 : 0.002); + rtcm->dgps[sat - 1].iod = iod; + rtcm->dgps[sat - 1].udre = udre; } } return 7; @@ -142,11 +149,13 @@ int decode_type3(rtcm_t *rtcm) trace(4, "decode_type3: len=%d\n", rtcm->len); - if (i+96 <= rtcm->len*8) + if (i + 96 <= rtcm->len * 8) { - rtcm->sta.pos[0] = getbits(rtcm->buff, i, 32)*0.01; i += 32; - rtcm->sta.pos[1] = getbits(rtcm->buff, i, 32)*0.01; i += 32; - rtcm->sta.pos[2] = getbits(rtcm->buff, i, 32)*0.01; + rtcm->sta.pos[0] = getbits(rtcm->buff, i, 32) * 0.01; + i += 32; + rtcm->sta.pos[1] = getbits(rtcm->buff, i, 32) * 0.01; + i += 32; + rtcm->sta.pos[2] = getbits(rtcm->buff, i, 32) * 0.01; } else { @@ -166,10 +175,12 @@ int decode_type14(rtcm_t *rtcm) trace(4, "decode_type14: len=%d\n", rtcm->len); zcnt = getbitu(rtcm->buff, 24, 13); - if (i+24 <= rtcm->len*8) + if (i + 24 <= rtcm->len * 8) { - week = getbitu(rtcm->buff, i, 10); i += 10; - hour = getbitu(rtcm->buff, i, 8); i += 8; + week = getbitu(rtcm->buff, i, 10); + i += 10; + hour = getbitu(rtcm->buff, i, 8); + i += 8; leaps = getbitu(rtcm->buff, i, 6); } else @@ -178,7 +189,7 @@ int decode_type14(rtcm_t *rtcm) return -1; } week = adjgpsweek(week); - rtcm->time = gpst2time(week, hour*3600.0+zcnt*0.6); + rtcm->time = gpst2time(week, hour * 3600.0 + zcnt * 0.6); rtcm->nav.leaps = leaps; return 6; } @@ -191,9 +202,10 @@ int decode_type16(rtcm_t *rtcm) trace(4, "decode_type16: len=%d\n", rtcm->len); - while (i+8 <= rtcm->len*8 && n<90) + while (i + 8 <= rtcm->len * 8 && n < 90) { - rtcm->msg[n++] = getbitu(rtcm->buff, i, 8); i += 8; + rtcm->msg[n++] = getbitu(rtcm->buff, i, 8); + i += 8; } rtcm->msg[n] = '\0'; @@ -205,45 +217,73 @@ int decode_type16(rtcm_t *rtcm) /* decode type 17: gps ephemerides -------------------------------------------*/ 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}, - 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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 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}; double toc, sqrtA; int i = 48, week, prn, sat; trace(4, "decode_type17: len=%d\n", rtcm->len); - if (i+480 <= rtcm->len*8) + if (i + 480 <= rtcm->len * 8) { - week = getbitu(rtcm->buff, i, 10); i += 10; - eph.idot = getbits(rtcm->buff, i, 14)*TWO_N43*SC2RAD; i += 14; - eph.iode = getbitu(rtcm->buff, i, 8); i += 8; - toc = getbitu(rtcm->buff, i, 16)*16.0; i += 16; - eph.f1 = getbits(rtcm->buff, i, 16)*TWO_N43; i += 16; - eph.f2 = getbits(rtcm->buff, i, 8)*TWO_N55; i += 8; - eph.crs = getbits(rtcm->buff, i, 16)*TWO_N5; i += 16; - eph.deln = getbits(rtcm->buff, i, 16)*TWO_N43*SC2RAD; i += 16; - eph.cuc = getbits(rtcm->buff, i, 16)*TWO_N29; i += 16; - eph.e = getbitu(rtcm->buff, i, 32)*TWO_N33; i += 32; - eph.cus = getbits(rtcm->buff, i, 16); i += 16; - sqrtA = getbitu(rtcm->buff, i, 32)*TWO_N19; i += 32; - eph.toes = getbitu(rtcm->buff, i, 16); i += 16; - eph.OMG0 = getbits(rtcm->buff, i, 32)*TWO_N31*SC2RAD; i += 32; - eph.cic = getbits(rtcm->buff, i, 16)*TWO_N29; i += 16; - eph.i0 = getbits(rtcm->buff, i, 32)*TWO_N31*SC2RAD; i += 32; - eph.cis = getbits(rtcm->buff, i, 16)*TWO_N29; i += 16; - eph.omg = getbits(rtcm->buff, i, 32)*TWO_N31*SC2RAD; i += 32; - eph.crc = getbits(rtcm->buff, i, 16)*TWO_N5; i += 16; - eph.OMGd = getbits(rtcm->buff, i, 24)*TWO_N43*SC2RAD; i += 24; - eph.M0 = getbits(rtcm->buff, i, 32)*TWO_N31*SC2RAD; i += 32; - eph.iodc = getbitu(rtcm->buff, i, 10); i += 10; - eph.f0 = getbits(rtcm->buff, i, 22)*TWO_N31; i += 22; - prn = getbitu(rtcm->buff, i, 5); i += 5+3; - eph.tgd[0] = getbits(rtcm->buff, i, 8)*TWO_N31; i += 8; - eph.code = getbitu(rtcm->buff, i, 2); i += 2; - eph.sva = getbitu(rtcm->buff, i, 4); i += 4; - eph.svh = getbitu(rtcm->buff, i, 6); i += 6; - eph.flag = getbitu(rtcm->buff, i, 1); + week = getbitu(rtcm->buff, i, 10); + i += 10; + eph.idot = getbits(rtcm->buff, i, 14) * TWO_N43 * SC2RAD; + i += 14; + eph.iode = getbitu(rtcm->buff, i, 8); + i += 8; + toc = getbitu(rtcm->buff, i, 16) * 16.0; + i += 16; + eph.f1 = getbits(rtcm->buff, i, 16) * TWO_N43; + i += 16; + eph.f2 = getbits(rtcm->buff, i, 8) * TWO_N55; + i += 8; + eph.crs = getbits(rtcm->buff, i, 16) * TWO_N5; + i += 16; + eph.deln = getbits(rtcm->buff, i, 16) * TWO_N43 * SC2RAD; + i += 16; + eph.cuc = getbits(rtcm->buff, i, 16) * TWO_N29; + i += 16; + eph.e = getbitu(rtcm->buff, i, 32) * TWO_N33; + i += 32; + eph.cus = getbits(rtcm->buff, i, 16); + i += 16; + sqrtA = getbitu(rtcm->buff, i, 32) * TWO_N19; + i += 32; + eph.toes = getbitu(rtcm->buff, i, 16); + i += 16; + eph.OMG0 = getbits(rtcm->buff, i, 32) * TWO_N31 * SC2RAD; + i += 32; + eph.cic = getbits(rtcm->buff, i, 16) * TWO_N29; + i += 16; + eph.i0 = getbits(rtcm->buff, i, 32) * TWO_N31 * SC2RAD; + i += 32; + eph.cis = getbits(rtcm->buff, i, 16) * TWO_N29; + i += 16; + eph.omg = getbits(rtcm->buff, i, 32) * TWO_N31 * SC2RAD; + i += 32; + eph.crc = getbits(rtcm->buff, i, 16) * TWO_N5; + i += 16; + eph.OMGd = getbits(rtcm->buff, i, 24) * TWO_N43 * SC2RAD; + i += 24; + eph.M0 = getbits(rtcm->buff, i, 32) * TWO_N31 * SC2RAD; + i += 32; + eph.iodc = getbitu(rtcm->buff, i, 10); + i += 10; + eph.f0 = getbits(rtcm->buff, i, 22) * TWO_N31; + i += 22; + prn = getbitu(rtcm->buff, i, 5); + i += 5 + 3; + eph.tgd[0] = getbits(rtcm->buff, i, 8) * TWO_N31; + i += 8; + eph.code = getbitu(rtcm->buff, i, 2); + i += 2; + eph.sva = getbitu(rtcm->buff, i, 4); + i += 4; + eph.svh = getbitu(rtcm->buff, i, 6); + i += 6; + eph.flag = getbitu(rtcm->buff, i, 1); } else { @@ -257,8 +297,8 @@ int decode_type17(rtcm_t *rtcm) eph.toe = gpst2time(eph.week, eph.toes); eph.toc = gpst2time(eph.week, toc); eph.ttr = rtcm->time; - eph.A = sqrtA*sqrtA; - rtcm->nav.eph[sat-1] = eph; + eph.A = sqrtA * sqrtA; + rtcm->nav.eph[sat - 1] = eph; rtcm->ephsat = sat; return 2; } @@ -273,56 +313,64 @@ int decode_type18(rtcm_t *rtcm) trace(4, "decode_type18: len=%d\n", rtcm->len); - if (i+24 <= rtcm->len*8) + if (i + 24 <= rtcm->len * 8) { - freq = getbitu(rtcm->buff, i, 2); i += 2+2; - usec = getbitu(rtcm->buff, i, 20); i += 20; + freq = getbitu(rtcm->buff, i, 2); + i += 2 + 2; + usec = getbitu(rtcm->buff, i, 20); + i += 20; } else { trace(2, "rtcm2 18 length error: len=%d\n", rtcm->len); return -1; } - if (freq&0x1) + if (freq & 0x1) { trace(2, "rtcm2 18 not supported frequency: freq=%d\n", freq); return -1; } - freq>>= 1; + freq >>= 1; - while (i+48 <= rtcm->len*8 && rtcm->obs.nlen * 8 && rtcm->obs.n < MAXOBS) { - sync = getbitu(rtcm->buff, i, 1); i += 1; - code = getbitu(rtcm->buff, i, 1); i += 1; - sys = getbitu(rtcm->buff, i, 1); i += 1; - prn = getbitu(rtcm->buff, i, 5); i += 5+3; - loss = getbitu(rtcm->buff, i, 5); i += 5; - cp = getbits(rtcm->buff, i, 32); i += 32; + sync = getbitu(rtcm->buff, i, 1); + i += 1; + code = getbitu(rtcm->buff, i, 1); + i += 1; + sys = getbitu(rtcm->buff, i, 1); + i += 1; + prn = getbitu(rtcm->buff, i, 5); + i += 5 + 3; + loss = getbitu(rtcm->buff, i, 5); + i += 5; + cp = getbits(rtcm->buff, i, 32); + i += 32; if (prn == 0) prn = 32; - if (!(sat = satno(sys?SYS_GLO:SYS_GPS, prn))) + if (!(sat = satno(sys ? SYS_GLO : SYS_GPS, prn))) { trace(2, "rtcm2 18 satellite number error: sys=%d prn=%d\n", sys, prn); continue; } - time = timeadd(rtcm->time, usec*1E-6); + time = timeadd(rtcm->time, usec * 1E-6); if (sys) time = utc2gpst(time); /* convert glonass time to gpst */ tt = timediff(rtcm->obs.data[0].time, time); - if (rtcm->obsflag||fabs(tt)>1E-9) + if (rtcm->obsflag || fabs(tt) > 1E-9) { rtcm->obs.n = rtcm->obsflag = 0; } if ((index = obsindex(&rtcm->obs, time, sat)) >= 0) { - rtcm->obs.data[index].L[freq] = -cp/256.0; - rtcm->obs.data[index].LLI[freq] = rtcm->loss[sat-1][freq] != loss; + rtcm->obs.data[index].L[freq] = -cp / 256.0; + rtcm->obs.data[index].LLI[freq] = rtcm->loss[sat - 1][freq] != loss; rtcm->obs.data[index].code[freq] = - !freq?(code?CODE_L1P:CODE_L1C):(code?CODE_L2P:CODE_L2C); - rtcm->loss[sat-1][freq] = loss; + !freq ? (code ? CODE_L1P : CODE_L1C) : (code ? CODE_L2P : CODE_L2C); + rtcm->loss[sat - 1][freq] = loss; } } rtcm->obsflag = !sync; - return sync?0:1; + return sync ? 0 : 1; } @@ -335,53 +383,60 @@ int decode_type19(rtcm_t *rtcm) trace(4, "decode_type19: len=%d\n", rtcm->len); - if (i+24 <= rtcm->len*8) + if (i + 24 <= rtcm->len * 8) { - freq = getbitu(rtcm->buff, i, 2); i += 2+2; - usec = getbitu(rtcm->buff, i, 20); i += 20; + freq = getbitu(rtcm->buff, i, 2); + i += 2 + 2; + usec = getbitu(rtcm->buff, i, 20); + i += 20; } else { trace(2, "rtcm2 19 length error: len=%d\n", rtcm->len); return -1; } - if (freq&0x1) + if (freq & 0x1) { trace(2, "rtcm2 19 not supported frequency: freq=%d\n", freq); return -1; } - freq>>=1; + freq >>= 1; - while (i+48 <= rtcm->len*8 && rtcm->obs.nlen * 8 && rtcm->obs.n < MAXOBS) { - sync = getbitu(rtcm->buff, i, 1); i += 1; - code = getbitu(rtcm->buff, i, 1); i += 1; - sys = getbitu(rtcm->buff, i, 1); i += 1; - prn = getbitu(rtcm->buff, i, 5); i += 5+8; - pr = getbitu(rtcm->buff, i, 32); i += 32; + sync = getbitu(rtcm->buff, i, 1); + i += 1; + code = getbitu(rtcm->buff, i, 1); + i += 1; + sys = getbitu(rtcm->buff, i, 1); + i += 1; + prn = getbitu(rtcm->buff, i, 5); + i += 5 + 8; + pr = getbitu(rtcm->buff, i, 32); + i += 32; if (prn == 0) prn = 32; - if (!(sat = satno(sys?SYS_GLO:SYS_GPS, prn))) + if (!(sat = satno(sys ? SYS_GLO : SYS_GPS, prn))) { trace(2, "rtcm2 19 satellite number error: sys=%d prn=%d\n", sys, prn); continue; } - time = timeadd(rtcm->time, usec*1E-6); + time = timeadd(rtcm->time, usec * 1E-6); if (sys) time = utc2gpst(time); /* convert glonass time to gpst */ tt = timediff(rtcm->obs.data[0].time, time); - if (rtcm->obsflag||fabs(tt)>1E-9) + if (rtcm->obsflag || fabs(tt) > 1E-9) { rtcm->obs.n = rtcm->obsflag = 0; } if ((index = obsindex(&rtcm->obs, time, sat)) >= 0) { - rtcm->obs.data[index].P[freq] = pr*0.02; + rtcm->obs.data[index].P[freq] = pr * 0.02; rtcm->obs.data[index].code[freq] = - !freq?(code?CODE_L1P:CODE_L1C):(code?CODE_L2P:CODE_L2C); + !freq ? (code ? CODE_L1P : CODE_L1C) : (code ? CODE_L2P : CODE_L2C); } } rtcm->obsflag = !sync; - return sync?0:1; + return sync ? 0 : 1; } @@ -393,31 +448,38 @@ int decode_type22(rtcm_t *rtcm) trace(4, "decode_type22: len=%d\n", rtcm->len); - if (i+24 <= rtcm->len*8) + if (i + 24 <= rtcm->len * 8) { - del[0][0] = getbits(rtcm->buff, i, 8)/25600.0; i += 8; - del[0][1] = getbits(rtcm->buff, i, 8)/25600.0; i += 8; - del[0][2] = getbits(rtcm->buff, i, 8)/25600.0; i += 8; + del[0][0] = getbits(rtcm->buff, i, 8) / 25600.0; + i += 8; + del[0][1] = getbits(rtcm->buff, i, 8) / 25600.0; + i += 8; + del[0][2] = getbits(rtcm->buff, i, 8) / 25600.0; + i += 8; } else { trace(2, "rtcm2 22 length error: len=%d\n", rtcm->len); return -1; } - if (i+24 <= rtcm->len*8) + if (i + 24 <= rtcm->len * 8) { - i += 5; noh = getbits(rtcm->buff, i, 1); i += 1; - hgt = noh?0.0:getbitu(rtcm->buff, i, 18)/25600.0; + i += 5; + noh = getbits(rtcm->buff, i, 1); + i += 1; + hgt = noh ? 0.0 : getbitu(rtcm->buff, i, 18) / 25600.0; i += 18; } - if (i+24 <= rtcm->len*8) + if (i + 24 <= rtcm->len * 8) { - del[1][0] = getbits(rtcm->buff, i, 8)/1600.0; i += 8; - del[1][1] = getbits(rtcm->buff, i, 8)/1600.0; i += 8; - del[1][2] = getbits(rtcm->buff, i, 8)/1600.0; + del[1][0] = getbits(rtcm->buff, i, 8) / 1600.0; + i += 8; + del[1][1] = getbits(rtcm->buff, i, 8) / 1600.0; + i += 8; + del[1][2] = getbits(rtcm->buff, i, 8) / 1600.0; } rtcm->sta.deltype = 1; /* xyz */ - for (j = 0; j<3; j++) rtcm->sta.del[j] = del[0][j]; + for (j = 0; j < 3; j++) rtcm->sta.del[j] = del[0][j]; rtcm->sta.hgt = hgt; return 5; } @@ -487,7 +549,7 @@ int decode_rtcm2(rtcm_t *rtcm) trace(3, "decode_rtcm2: type=%2d len=%3d\n", type, rtcm->len); - if ((zcnt = getbitu(rtcm->buff, 24, 13)*0.6) >= 3600.0) + if ((zcnt = getbitu(rtcm->buff, 24, 13) * 0.6) >= 3600.0) { trace(2, "rtcm2 modified z-count error: zcnt=%.1f\n", zcnt); return -1; @@ -495,20 +557,20 @@ int decode_rtcm2(rtcm_t *rtcm) adjhour(rtcm, zcnt); staid = getbitu(rtcm->buff, 14, 10); seqno = getbitu(rtcm->buff, 37, 3); - stah = getbitu(rtcm->buff, 45, 3); - if (seqno-rtcm->seqno != 1 && seqno-rtcm->seqno != -7) + stah = getbitu(rtcm->buff, 45, 3); + if (seqno - rtcm->seqno != 1 && seqno - rtcm->seqno != -7) { trace(2, "rtcm2 message outage: seqno=%d->%d\n", rtcm->seqno, seqno); } rtcm->seqno = seqno; - rtcm->stah = stah; + rtcm->stah = stah; if (rtcm->outtype) { sprintf(rtcm->msgtype, "RTCM %2d (%4d) zcnt=%7.1f staid=%3d seqno=%d", - type, rtcm->len, zcnt, staid, seqno); + type, rtcm->len, zcnt, staid, seqno); } - if (type == 3||type == 22||type == 23||type == 24) + if (type == 3 || type == 22 || type == 23 || type == 24) { if (rtcm->staid != 0 && staid != rtcm->staid) { @@ -522,28 +584,65 @@ int decode_rtcm2(rtcm_t *rtcm) return -1; } switch (type) - { - case 1: ret = decode_type1 (rtcm); break; - case 3: ret = decode_type3 (rtcm); break; - case 9: ret = decode_type1 (rtcm); break; - case 14: ret = decode_type14(rtcm); break; - case 16: ret = decode_type16(rtcm); break; - case 17: ret = decode_type17(rtcm); break; - case 18: ret = decode_type18(rtcm); break; - case 19: ret = decode_type19(rtcm); break; - case 22: ret = decode_type22(rtcm); break; - case 23: ret = decode_type23(rtcm); break; /* not supported */ - case 24: ret = decode_type24(rtcm); break; /* not supported */ - case 31: ret = decode_type31(rtcm); break; /* not supported */ - case 32: ret = decode_type32(rtcm); break; /* not supported */ - case 34: ret = decode_type34(rtcm); break; /* not supported */ - case 36: ret = decode_type36(rtcm); break; /* not supported */ - case 37: ret = decode_type37(rtcm); break; /* not supported */ - case 59: ret = decode_type59(rtcm); break; /* not supported */ - } + { + case 1: + ret = decode_type1(rtcm); + break; + case 3: + ret = decode_type3(rtcm); + break; + case 9: + ret = decode_type1(rtcm); + break; + case 14: + ret = decode_type14(rtcm); + break; + case 16: + ret = decode_type16(rtcm); + break; + case 17: + ret = decode_type17(rtcm); + break; + case 18: + ret = decode_type18(rtcm); + break; + case 19: + ret = decode_type19(rtcm); + break; + case 22: + ret = decode_type22(rtcm); + break; + case 23: + ret = decode_type23(rtcm); + break; /* not supported */ + case 24: + ret = decode_type24(rtcm); + break; /* not supported */ + case 31: + ret = decode_type31(rtcm); + break; /* not supported */ + case 32: + ret = decode_type32(rtcm); + break; /* not supported */ + case 34: + ret = decode_type34(rtcm); + break; /* not supported */ + case 36: + ret = decode_type36(rtcm); + break; /* not supported */ + case 37: + ret = decode_type37(rtcm); + break; /* not supported */ + case 59: + ret = decode_type59(rtcm); + break; /* not supported */ + } if (ret >= 0) { - if (1 <= type && type <= 99) rtcm->nmsg2[type]++; else rtcm->nmsg2[0]++; + if (1 <= type && type <= 99) + rtcm->nmsg2[type]++; + else + rtcm->nmsg2[0]++; } return ret; } diff --git a/src/algorithms/libs/rtklib/rtklib_rtcm3.cc b/src/algorithms/libs/rtklib/rtklib_rtcm3.cc index 67a3912d8..53e88739d 100644 --- a/src/algorithms/libs/rtklib/rtklib_rtcm3.cc +++ b/src/algorithms/libs/rtklib/rtklib_rtcm3.cc @@ -59,55 +59,50 @@ /* msm signal id table -------------------------------------------------------*/ const char *msm_sig_gps[32] = { /* GPS: ref [13] table 3.5-87, ref [14][15] table 3.5-91 */ - "" , "1C", "1P", "1W", "1Y", "1M", "" , "2C", "2P", "2W", "2Y", "2M", /* 1-12 */ - "" , "" , "2S", "2L", "2X", "" , "" , "" , "" , "5I", "5Q", "5X", /* 13-24 */ - "" , "" , "" , "" , "" , "1S", "1L", "1X" /* 25-32 */ + "", "1C", "1P", "1W", "1Y", "1M", "", "2C", "2P", "2W", "2Y", "2M", /* 1-12 */ + "", "", "2S", "2L", "2X", "", "", "", "", "5I", "5Q", "5X", /* 13-24 */ + "", "", "", "", "", "1S", "1L", "1X" /* 25-32 */ }; const char *msm_sig_glo[32] = { /* GLONASS: ref [13] table 3.5-93, ref [14][15] table 3.5-97 */ - "" , "1C", "1P", "" , "" , "" , "" , "2C", "2P", "" , "3I", "3Q", - "3X", "" , "" , "" , "" , "" , "" , "" , "" , "" , "" , "" , - "" , "" , "" , "" , "" , "" , "" , "" -}; + "", "1C", "1P", "", "", "", "", "2C", "2P", "", "3I", "3Q", + "3X", "", "", "", "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", ""}; const char *msm_sig_gal[32] = { /* Galileo: ref [15] table 3.5-100 */ - "" , "1C", "1A", "1B", "1X", "1Z", "" , "6C", "6A", "6B", "6X", "6Z", - "" , "7I", "7Q", "7X", "" , "8I", "8Q", "8X", "" , "5I", "5Q", "5X", - "" , "" , "" , "" , "" , "" , "" , "" -}; + "", "1C", "1A", "1B", "1X", "1Z", "", "6C", "6A", "6B", "6X", "6Z", + "", "7I", "7Q", "7X", "", "8I", "8Q", "8X", "", "5I", "5Q", "5X", + "", "", "", "", "", "", "", ""}; const char *msm_sig_qzs[32] = { /* QZSS: ref [15] table 3.5-103 */ - "" , "1C", "" , "" , "" , "" , "" , "" , "6S", "6L", "6X", "" , - "" , "" , "2S", "2L", "2X", "" , "" , "" , "" , "5I", "5Q", "5X", - "" , "" , "" , "" , "" , "1S", "1L", "1X" -}; + "", "1C", "", "", "", "", "", "", "6S", "6L", "6X", "", + "", "", "2S", "2L", "2X", "", "", "", "", "5I", "5Q", "5X", + "", "", "", "", "", "1S", "1L", "1X"}; const char *msm_sig_sbs[32] = { /* SBAS: ref [13] table 3.5-T+005 */ - "" , "1C", "" , "" , "" , "" , "" , "" , "" , "" , "" , "" , - "" , "" , "" , "" , "" , "" , "" , "" , "" , "5I", "5Q", "5X", - "" , "" , "" , "" , "" , "" , "" , "" -}; + "", "1C", "", "", "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", "", "5I", "5Q", "5X", + "", "", "", "", "", "", "", ""}; const char *msm_sig_cmp[32] = { /* BeiDou: ref [15] table 3.5-106 */ - "" , "1I", "1Q", "1X", "" , "" , "" , "6I", "6Q", "6X", "" , "" , - "" , "7I", "7Q", "7X", "" , "" , "" , "" , "" , "" , "" , "" , - "" , "" , "" , "" , "" , "" , "" , "" -}; + "", "1I", "1Q", "1X", "", "", "", "6I", "6Q", "6X", "", "", + "", "7I", "7Q", "7X", "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", ""}; /* get sign-magnitude bits ---------------------------------------------------*/ double getbitg(const unsigned char *buff, int pos, int len) { - double value = getbitu(buff, pos+1, len-1); + double value = getbitu(buff, pos + 1, len - 1); return getbitu(buff, pos, 1) ? -value : value; } @@ -121,8 +116,10 @@ void adjweek(rtcm_t *rtcm, double tow) /* if no time, get cpu time */ if (rtcm->time.time == 0) rtcm->time = utc2gpst(timeget()); tow_p = time2gpst(rtcm->time, &week); - if (tow < tow_p-302400.0) tow += 604800.0; - else if (tow > tow_p+302400.0) tow -= 604800.0; + if (tow < tow_p - 302400.0) + tow += 604800.0; + else if (tow > tow_p + 302400.0) + tow -= 604800.0; rtcm->time = gpst2time(week, tow); } @@ -133,7 +130,7 @@ int adjbdtweek(int week) int w; (void)time2bdt(gpst2bdt(utc2gpst(timeget())), &w); if (w < 1) w = 1; /* use 2006/1/1 if time is earlier than 2006/1/1 */ - return week+(w-week+512)/1024*1024; + return week + (w - week + 512) / 1024 * 1024; } @@ -147,10 +144,13 @@ void adjday_glot(rtcm_t *rtcm, double tod) if (rtcm->time.time == 0) rtcm->time = utc2gpst(timeget()); time = timeadd(gpst2utc(rtcm->time), 10800.0); /* glonass time */ tow = time2gpst(time, &week); - tod_p = fmod(tow, 86400.0); tow -= tod_p; - if (tod < tod_p-43200.0) tod += 86400.0; - else if (tod > tod_p+43200.0) tod -= 86400.0; - time = gpst2time(week, tow+tod); + tod_p = fmod(tow, 86400.0); + tow -= tod_p; + if (tod < tod_p - 43200.0) + tod += 86400.0; + else if (tod > tod_p + 43200.0) + tod -= 86400.0; + time = gpst2time(week, tow + tod); rtcm->time = utc2gpst(timeadd(time, -10800.0)); } @@ -158,10 +158,13 @@ void adjday_glot(rtcm_t *rtcm, double tod) /* adjust carrier-phase rollover ---------------------------------------------*/ double adjcp(rtcm_t *rtcm, int sat, int freq, double cp) { - if (rtcm->cp[sat-1][freq] == 0.0) ; - else if (cp < rtcm->cp[sat-1][freq]-750.0) cp += 1500.0; - else if (cp > rtcm->cp[sat-1][freq]+750.0) cp -= 1500.0; - rtcm->cp[sat-1][freq] = cp; + if (rtcm->cp[sat - 1][freq] == 0.0) + ; + else if (cp < rtcm->cp[sat - 1][freq] - 750.0) + cp += 1500.0; + else if (cp > rtcm->cp[sat - 1][freq] + 750.0) + cp -= 1500.0; + rtcm->cp[sat - 1][freq] = cp; return cp; } @@ -169,8 +172,8 @@ double adjcp(rtcm_t *rtcm, int sat, int freq, double cp) /* loss-of-lock indicator ----------------------------------------------------*/ int lossoflock(rtcm_t *rtcm, int sat, int freq, int lock) { - int lli = (!lock && !rtcm->lock[sat-1][freq]) || lock < rtcm->lock[sat-1][freq]; - rtcm->lock[sat-1][freq] = (unsigned short)lock; + int lli = (!lock && !rtcm->lock[sat - 1][freq]) || lock < rtcm->lock[sat - 1][freq]; + rtcm->lock[sat - 1][freq] = (unsigned short)lock; return lli; } @@ -178,7 +181,7 @@ int lossoflock(rtcm_t *rtcm, int sat, int freq, int lock) /* s/n ratio -----------------------------------------------------------------*/ unsigned char snratio(double snr) { - return (unsigned char)(snr <= 0.0 || 255.5 <= snr ? 0.0:snr*4.0+0.5); + return (unsigned char)(snr <= 0.0 || 255.5 <= snr ? 0.0 : snr * 4.0 + 0.5); } @@ -196,7 +199,7 @@ int obsindex3(obs_t *obs, gtime_t time, int sat) /* add new field */ obs->data[i].time = time; obs->data[i].sat = sat; - for (j = 0; j < NFREQ+NEXOBS; j++) + for (j = 0; j < NFREQ + NEXOBS; j++) { obs->data[i].L[j] = obs->data[i].P[j] = 0.0; obs->data[i].D[j] = 0.0; @@ -243,14 +246,18 @@ int decode_head1001(rtcm_t *rtcm, int *sync) char *msg; int i = 24, staid, nsat, type; - type = getbitu(rtcm->buff, i, 12); i += 12; + type = getbitu(rtcm->buff, i, 12); + i += 12; - if (i+52 <= rtcm->len*8) + if (i + 52 <= rtcm->len * 8) { - staid = getbitu(rtcm->buff, i, 12); i += 12; - tow = getbitu(rtcm->buff, i, 30)*0.001; i += 30; - *sync = getbitu(rtcm->buff, i, 1); i += 1; - nsat = getbitu(rtcm->buff, i, 5); + staid = getbitu(rtcm->buff, i, 12); + i += 12; + tow = getbitu(rtcm->buff, i, 30) * 0.001; + i += 30; + *sync = getbitu(rtcm->buff, i, 1); + i += 1; + nsat = getbitu(rtcm->buff, i, 5); } else { @@ -263,13 +270,13 @@ int decode_head1001(rtcm_t *rtcm, int *sync) adjweek(rtcm, tow); trace(4, "decode_head1001: time=%s nsat=%d sync=%d\n", time_str(rtcm->time, 2), - nsat, *sync); + nsat, *sync); if (rtcm->outtype) { - msg = rtcm->msgtype+strlen(rtcm->msgtype); + msg = rtcm->msgtype + strlen(rtcm->msgtype); sprintf(msg, " staid=%4d %s nsat=%2d sync=%d", staid, - time_str(rtcm->time, 2), nsat, *sync); + time_str(rtcm->time, 2), nsat, *sync); } return nsat; } @@ -280,8 +287,8 @@ int decode_type1001(rtcm_t *rtcm) { int sync; if (decode_head1001(rtcm, &sync) < 0) return -1; - rtcm->obsflag=!sync; - return sync ? 0:1; + rtcm->obsflag = !sync; + return sync ? 0 : 1; } @@ -289,26 +296,34 @@ int decode_type1001(rtcm_t *rtcm) int decode_type1002(rtcm_t *rtcm) { double pr1, cnr1, tt, cp1; - int i = 24+64, j, index, nsat, sync, prn, code, sat, ppr1, lock1, amb, sys; + int i = 24 + 64, j, index, nsat, sync, prn, code, sat, ppr1, lock1, amb, sys; if ((nsat = decode_head1001(rtcm, &sync)) < 0) return -1; - for (j = 0; j < nsat && rtcm->obs.n < MAXOBS && i+74 <= rtcm->len*8; j++) + for (j = 0; j < nsat && rtcm->obs.n < MAXOBS && i + 74 <= rtcm->len * 8; j++) { - prn = getbitu(rtcm->buff, i, 6); i += 6; - code = getbitu(rtcm->buff, i, 1); i += 1; - pr1 = getbitu(rtcm->buff, i, 24); i += 24; - ppr1 = getbits(rtcm->buff, i, 20); i += 20; - lock1 = getbitu(rtcm->buff, i, 7); i += 7; - amb = getbitu(rtcm->buff, i, 8); i += 8; - cnr1 = getbitu(rtcm->buff, i, 8); i += 8; + prn = getbitu(rtcm->buff, i, 6); + i += 6; + code = getbitu(rtcm->buff, i, 1); + i += 1; + pr1 = getbitu(rtcm->buff, i, 24); + i += 24; + ppr1 = getbits(rtcm->buff, i, 20); + i += 20; + lock1 = getbitu(rtcm->buff, i, 7); + i += 7; + amb = getbitu(rtcm->buff, i, 8); + i += 8; + cnr1 = getbitu(rtcm->buff, i, 8); + i += 8; if (prn < 40) { sys = SYS_GPS; } else { - sys = SYS_SBS; prn += 80; + sys = SYS_SBS; + prn += 80; } if (!(sat = satno(sys, prn))) { @@ -316,23 +331,23 @@ int decode_type1002(rtcm_t *rtcm) continue; } tt = timediff(rtcm->obs.data[0].time, rtcm->time); - if (rtcm->obsflag || fabs(tt)>1E-9) + if (rtcm->obsflag || fabs(tt) > 1E-9) { rtcm->obs.n = rtcm->obsflag = 0; } if ((index = obsindex3(&rtcm->obs, rtcm->time, sat)) < 0) continue; - pr1 = pr1*0.02+amb*PRUNIT_GPS; + pr1 = pr1 * 0.02 + amb * PRUNIT_GPS; if (ppr1 != (int)0xFFF80000) { rtcm->obs.data[index].P[0] = pr1; - cp1 = adjcp(rtcm, sat, 0, ppr1*0.0005/lam_carr[0]); - rtcm->obs.data[index].L[0] = pr1/lam_carr[0]+cp1; + cp1 = adjcp(rtcm, sat, 0, ppr1 * 0.0005 / lam_carr[0]); + rtcm->obs.data[index].L[0] = pr1 / lam_carr[0] + cp1; } rtcm->obs.data[index].LLI[0] = lossoflock(rtcm, sat, 0, lock1); - rtcm->obs.data[index].SNR[0] = snratio(cnr1*0.25); - rtcm->obs.data[index].code[0] = code ? CODE_L1P:CODE_L1C; + rtcm->obs.data[index].SNR[0] = snratio(cnr1 * 0.25); + rtcm->obs.data[index].code[0] = code ? CODE_L1P : CODE_L1C; } - return sync ? 0:1; + return sync ? 0 : 1; } @@ -342,7 +357,7 @@ int decode_type1003(rtcm_t *rtcm) int sync; if (decode_head1001(rtcm, &sync) < 0) return -1; rtcm->obsflag = !sync; - return sync ? 0:1; + return sync ? 0 : 1; } @@ -351,32 +366,45 @@ int decode_type1004(rtcm_t *rtcm) { const int L2codes[] = {CODE_L2X, CODE_L2P, CODE_L2D, CODE_L2W}; double pr1, cnr1, cnr2, tt, cp1, cp2; - int i = 24+64, j, index, nsat, sync, prn, sat, code1, code2, pr21, ppr1, ppr2; + int i = 24 + 64, j, index, nsat, sync, prn, sat, code1, code2, pr21, ppr1, ppr2; int lock1, lock2, amb, sys; if ((nsat = decode_head1001(rtcm, &sync)) < 0) return -1; - for (j = 0; j < nsat && rtcm->obs.n < MAXOBS && i+125 <= rtcm->len*8; j++) + for (j = 0; j < nsat && rtcm->obs.n < MAXOBS && i + 125 <= rtcm->len * 8; j++) { - prn = getbitu(rtcm->buff, i, 6); i += 6; - code1 = getbitu(rtcm->buff, i, 1); i += 1; - pr1 = getbitu(rtcm->buff, i, 24); i += 24; - ppr1 = getbits(rtcm->buff, i, 20); i += 20; - lock1 = getbitu(rtcm->buff, i, 7); i += 7; - amb = getbitu(rtcm->buff, i, 8); i += 8; - cnr1 = getbitu(rtcm->buff, i, 8); i += 8; - code2 = getbitu(rtcm->buff, i, 2); i += 2; - pr21 = getbits(rtcm->buff, i, 14); i += 14; - ppr2 = getbits(rtcm->buff, i, 20); i += 20; - lock2 = getbitu(rtcm->buff, i, 7); i += 7; - cnr2 = getbitu(rtcm->buff, i, 8); i += 8; + prn = getbitu(rtcm->buff, i, 6); + i += 6; + code1 = getbitu(rtcm->buff, i, 1); + i += 1; + pr1 = getbitu(rtcm->buff, i, 24); + i += 24; + ppr1 = getbits(rtcm->buff, i, 20); + i += 20; + lock1 = getbitu(rtcm->buff, i, 7); + i += 7; + amb = getbitu(rtcm->buff, i, 8); + i += 8; + cnr1 = getbitu(rtcm->buff, i, 8); + i += 8; + code2 = getbitu(rtcm->buff, i, 2); + i += 2; + pr21 = getbits(rtcm->buff, i, 14); + i += 14; + ppr2 = getbits(rtcm->buff, i, 20); + i += 20; + lock2 = getbitu(rtcm->buff, i, 7); + i += 7; + cnr2 = getbitu(rtcm->buff, i, 8); + i += 8; if (prn < 40) { sys = SYS_GPS; } else { - sys = SYS_SBS; prn += 80; + sys = SYS_SBS; + prn += 80; } if (!(sat = satno(sys, prn))) { @@ -384,44 +412,44 @@ int decode_type1004(rtcm_t *rtcm) continue; } tt = timediff(rtcm->obs.data[0].time, rtcm->time); - if (rtcm->obsflag || fabs(tt)>1E-9) + if (rtcm->obsflag || fabs(tt) > 1E-9) { rtcm->obs.n = rtcm->obsflag = 0; } if ((index = obsindex3(&rtcm->obs, rtcm->time, sat)) < 0) continue; - pr1 = pr1*0.02+amb*PRUNIT_GPS; + pr1 = pr1 * 0.02 + amb * PRUNIT_GPS; if (ppr1 != (int)0xFFF80000) { rtcm->obs.data[index].P[0] = pr1; - cp1 = adjcp(rtcm, sat, 0, ppr1*0.0005/lam_carr[0]); - rtcm->obs.data[index].L[0] = pr1/lam_carr[0]+cp1; + cp1 = adjcp(rtcm, sat, 0, ppr1 * 0.0005 / lam_carr[0]); + rtcm->obs.data[index].L[0] = pr1 / lam_carr[0] + cp1; } rtcm->obs.data[index].LLI[0] = lossoflock(rtcm, sat, 0, lock1); - rtcm->obs.data[index].SNR[0] = snratio(cnr1*0.25); - rtcm->obs.data[index].code[0] = code1 ? CODE_L1P:CODE_L1C; + rtcm->obs.data[index].SNR[0] = snratio(cnr1 * 0.25); + rtcm->obs.data[index].code[0] = code1 ? CODE_L1P : CODE_L1C; if (pr21 != (int)0xFFFFE000) { - rtcm->obs.data[index].P[1] = pr1+pr21*0.02; + rtcm->obs.data[index].P[1] = pr1 + pr21 * 0.02; } if (ppr2 != (int)0xFFF80000) { - cp2 = adjcp(rtcm, sat, 1, ppr2*0.0005/lam_carr[1]); - rtcm->obs.data[index].L[1] = pr1/lam_carr[1]+cp2; + cp2 = adjcp(rtcm, sat, 1, ppr2 * 0.0005 / lam_carr[1]); + rtcm->obs.data[index].L[1] = pr1 / lam_carr[1] + cp2; } rtcm->obs.data[index].LLI[1] = lossoflock(rtcm, sat, 1, lock2); - rtcm->obs.data[index].SNR[1] = snratio(cnr2*0.25); + rtcm->obs.data[index].SNR[1] = snratio(cnr2 * 0.25); rtcm->obs.data[index].code[1] = L2codes[code2]; } rtcm->obsflag = !sync; - return sync ? 0:1; + return sync ? 0 : 1; } /* get signed 38bit field ----------------------------------------------------*/ double getbits_38(const unsigned char *buff, int pos) { - return (double)getbits(buff, pos, 32)*64.0+getbitu(buff, pos+32, 6); + return (double)getbits(buff, pos, 32) * 64.0 + getbitu(buff, pos + 32, 6); } @@ -430,14 +458,18 @@ int decode_type1005(rtcm_t *rtcm) { double rr[3], re[3], pos[3]; char *msg; - int i = 24+12, j, staid, itrf; + int i = 24 + 12, j, staid, itrf; - if (i+140 == rtcm->len*8) + if (i + 140 == rtcm->len * 8) { - staid = getbitu(rtcm->buff, i, 12); i += 12; - itrf = getbitu(rtcm->buff, i, 6); i += 6+4; - rr[0] = getbits_38(rtcm->buff, i); i += 38+2; - rr[1] = getbits_38(rtcm->buff, i); i += 38+2; + staid = getbitu(rtcm->buff, i, 12); + i += 12; + itrf = getbitu(rtcm->buff, i, 6); + i += 6 + 4; + rr[0] = getbits_38(rtcm->buff, i); + i += 38 + 2; + rr[1] = getbits_38(rtcm->buff, i); + i += 38 + 2; rr[2] = getbits_38(rtcm->buff, i); } else @@ -447,11 +479,11 @@ int decode_type1005(rtcm_t *rtcm) } if (rtcm->outtype) { - msg = rtcm->msgtype+strlen(rtcm->msgtype); - for (j = 0; j < 3; j++) re[j] = rr[j]*0.0001; + msg = rtcm->msgtype + strlen(rtcm->msgtype); + for (j = 0; j < 3; j++) re[j] = rr[j] * 0.0001; ecef2pos(re, pos); - sprintf(msg, " staid=%4d pos=%.8f %.8f %.3f", staid, pos[0]*R2D, pos[1]*R2D, - pos[2]); + sprintf(msg, " staid=%4d pos=%.8f %.8f %.3f", staid, pos[0] * R2D, pos[1] * R2D, + pos[2]); } /* test station id */ if (!test_staid(rtcm, staid)) return -1; @@ -459,7 +491,7 @@ int decode_type1005(rtcm_t *rtcm) rtcm->sta.deltype = 0; /* xyz */ for (j = 0; j < 3; j++) { - rtcm->sta.pos[j] = rr[j]*0.0001; + rtcm->sta.pos[j] = rr[j] * 0.0001; rtcm->sta.del[j] = 0.0; } rtcm->sta.hgt = 0.0; @@ -473,16 +505,21 @@ int decode_type1006(rtcm_t *rtcm) { double rr[3], re[3], pos[3], anth; char *msg; - int i = 24+12, j, staid, itrf; + int i = 24 + 12, j, staid, itrf; - if (i+156 <= rtcm->len*8) + if (i + 156 <= rtcm->len * 8) { - staid = getbitu(rtcm->buff, i, 12); i += 12; - itrf = getbitu(rtcm->buff, i, 6); i += 6+4; - rr[0] = getbits_38(rtcm->buff, i); i += 38+2; - rr[1] = getbits_38(rtcm->buff, i); i += 38+2; - rr[2] = getbits_38(rtcm->buff, i); i += 38; - anth = getbitu(rtcm->buff, i, 16); + staid = getbitu(rtcm->buff, i, 12); + i += 12; + itrf = getbitu(rtcm->buff, i, 6); + i += 6 + 4; + rr[0] = getbits_38(rtcm->buff, i); + i += 38 + 2; + rr[1] = getbits_38(rtcm->buff, i); + i += 38 + 2; + rr[2] = getbits_38(rtcm->buff, i); + i += 38; + anth = getbitu(rtcm->buff, i, 16); } else { @@ -491,11 +528,11 @@ int decode_type1006(rtcm_t *rtcm) } if (rtcm->outtype) { - msg = rtcm->msgtype+strlen(rtcm->msgtype); - for (j = 0; j < 3; j++) re[j] = rr[j]*0.0001; + msg = rtcm->msgtype + strlen(rtcm->msgtype); + for (j = 0; j < 3; j++) re[j] = rr[j] * 0.0001; ecef2pos(re, pos); - sprintf(msg, " staid=%4d pos=%.8f %.8f %.3f anth=%.3f", staid, pos[0]*R2D, - pos[1]*R2D, pos[2], anth); + sprintf(msg, " staid=%4d pos=%.8f %.8f %.3f anth=%.3f", staid, pos[0] * R2D, + pos[1] * R2D, pos[2], anth); } /* test station id */ if (!test_staid(rtcm, staid)) return -1; @@ -503,10 +540,10 @@ int decode_type1006(rtcm_t *rtcm) rtcm->sta.deltype = 1; /* xyz */ for (j = 0; j < 3; j++) { - rtcm->sta.pos[j] = rr[j]*0.0001; + rtcm->sta.pos[j] = rr[j] * 0.0001; rtcm->sta.del[j] = 0.0; } - rtcm->sta.hgt = anth*0.0001; + rtcm->sta.hgt = anth * 0.0001; rtcm->sta.itrf = itrf; return 5; } @@ -517,16 +554,18 @@ int decode_type1007(rtcm_t *rtcm) { char des[32] = ""; char *msg; - int i = 24+12, j, staid, n, setup; + int i = 24 + 12, j, staid, n, setup; - n = getbitu(rtcm->buff, i+12, 8); + n = getbitu(rtcm->buff, i + 12, 8); - if (i+28+8*n <= rtcm->len*8) + if (i + 28 + 8 * n <= rtcm->len * 8) { - staid = getbitu(rtcm->buff, i, 12); i += 12+8; + staid = getbitu(rtcm->buff, i, 12); + i += 12 + 8; for (j = 0; j < n && j < 31; j++) { - des[j] = (char)getbitu(rtcm->buff, i, 8); i += 8; + des[j] = (char)getbitu(rtcm->buff, i, 8); + i += 8; } setup = getbitu(rtcm->buff, i, 8); } @@ -537,13 +576,14 @@ int decode_type1007(rtcm_t *rtcm) } if (rtcm->outtype) { - msg = rtcm->msgtype+strlen(rtcm->msgtype); + msg = rtcm->msgtype + strlen(rtcm->msgtype); sprintf(msg, " staid=%4d", staid); } /* test station id */ if (!test_staid(rtcm, staid)) return -1; - strncpy(rtcm->sta.antdes, des, n); rtcm->sta.antdes[n] = '\0'; + strncpy(rtcm->sta.antdes, des, n); + rtcm->sta.antdes[n] = '\0'; rtcm->sta.antsetup = setup; rtcm->sta.antsno[0] = '\0'; return 5; @@ -555,22 +595,26 @@ int decode_type1008(rtcm_t *rtcm) { char des[32] = "", sno[32] = ""; char *msg; - int i = 24+12, j, staid, n, m, setup; + int i = 24 + 12, j, staid, n, m, setup; - n = getbitu(rtcm->buff, i+12, 8); - m = getbitu(rtcm->buff, i+28+8*n, 8); + n = getbitu(rtcm->buff, i + 12, 8); + m = getbitu(rtcm->buff, i + 28 + 8 * n, 8); - if (i+36+8*(n+m) <= rtcm->len*8) + if (i + 36 + 8 * (n + m) <= rtcm->len * 8) { - staid = getbitu(rtcm->buff, i, 12); i += 12+8; + staid = getbitu(rtcm->buff, i, 12); + i += 12 + 8; for (j = 0; j < n && j < 31; j++) { - des[j] = (char)getbitu(rtcm->buff, i, 8); i += 8; + des[j] = (char)getbitu(rtcm->buff, i, 8); + i += 8; } - setup = getbitu(rtcm->buff, i, 8); i += 8+8; + setup = getbitu(rtcm->buff, i, 8); + i += 8 + 8; for (j = 0; j < m && j < 31; j++) { - sno[j] = (char)getbitu(rtcm->buff, i, 8); i += 8; + sno[j] = (char)getbitu(rtcm->buff, i, 8); + i += 8; } } else @@ -580,15 +624,17 @@ int decode_type1008(rtcm_t *rtcm) } if (rtcm->outtype) { - msg = rtcm->msgtype+strlen(rtcm->msgtype); + msg = rtcm->msgtype + strlen(rtcm->msgtype); sprintf(msg, " staid=%4d", staid); } /* test station id */ if (!test_staid(rtcm, staid)) return -1; - strncpy(rtcm->sta.antdes, des, n); rtcm->sta.antdes[n] = '\0'; + strncpy(rtcm->sta.antdes, des, n); + rtcm->sta.antdes[n] = '\0'; rtcm->sta.antsetup = setup; - strncpy(rtcm->sta.antsno, sno, m); rtcm->sta.antsno[m] = '\0'; + strncpy(rtcm->sta.antsno, sno, m); + rtcm->sta.antsno[m] = '\0'; return 5; } @@ -600,14 +646,18 @@ int decode_head1009(rtcm_t *rtcm, int *sync) char *msg; int i = 24, staid, nsat, type; - type = getbitu(rtcm->buff, i, 12); i += 12; + type = getbitu(rtcm->buff, i, 12); + i += 12; - if (i+49 <= rtcm->len*8) + if (i + 49 <= rtcm->len * 8) { - staid = getbitu(rtcm->buff, i, 12); i += 12; - tod = getbitu(rtcm->buff, i, 27)*0.001; i += 27; /* sec in a day */ - *sync = getbitu(rtcm->buff, i, 1); i += 1; - nsat = getbitu(rtcm->buff, i, 5); + staid = getbitu(rtcm->buff, i, 12); + i += 12; + tod = getbitu(rtcm->buff, i, 27) * 0.001; + i += 27; /* sec in a day */ + *sync = getbitu(rtcm->buff, i, 1); + i += 1; + nsat = getbitu(rtcm->buff, i, 5); } else { @@ -620,13 +670,13 @@ int decode_head1009(rtcm_t *rtcm, int *sync) adjday_glot(rtcm, tod); trace(4, "decode_head1009: time=%s nsat=%d sync=%d\n", time_str(rtcm->time, 2), - nsat, *sync); + nsat, *sync); if (rtcm->outtype) { - msg = rtcm->msgtype+strlen(rtcm->msgtype); + msg = rtcm->msgtype + strlen(rtcm->msgtype); sprintf(msg, " staid=%4d %s nsat=%2d sync=%d", staid, - time_str(rtcm->time, 2), nsat, *sync); + time_str(rtcm->time, 2), nsat, *sync); } return nsat; } @@ -638,7 +688,7 @@ int decode_type1009(rtcm_t *rtcm) int sync; if (decode_head1009(rtcm, &sync) < 0) return -1; rtcm->obsflag = !sync; - return sync ? 0:1; + return sync ? 0 : 1; } @@ -646,44 +696,52 @@ int decode_type1009(rtcm_t *rtcm) int decode_type1010(rtcm_t *rtcm) { double pr1, cnr1, tt, cp1, lam1; - int i = 24+61, j, index, nsat, sync, prn, sat, code, freq, ppr1, lock1, amb, sys = SYS_GLO; + int i = 24 + 61, j, index, nsat, sync, prn, sat, code, freq, ppr1, lock1, amb, sys = SYS_GLO; if ((nsat = decode_head1009(rtcm, &sync)) < 0) return -1; - for (j = 0; j < nsat && rtcm->obs.n < MAXOBS && i+79 <= rtcm->len*8; j++) + for (j = 0; j < nsat && rtcm->obs.n < MAXOBS && i + 79 <= rtcm->len * 8; j++) { - prn = getbitu(rtcm->buff, i, 6); i += 6; - code = getbitu(rtcm->buff, i, 1); i += 1; - freq = getbitu(rtcm->buff, i, 5); i += 5; - pr1 = getbitu(rtcm->buff, i, 25); i += 25; - ppr1 = getbits(rtcm->buff, i, 20); i += 20; - lock1 = getbitu(rtcm->buff, i, 7); i += 7; - amb = getbitu(rtcm->buff, i, 7); i += 7; - cnr1 = getbitu(rtcm->buff, i, 8); i += 8; + prn = getbitu(rtcm->buff, i, 6); + i += 6; + code = getbitu(rtcm->buff, i, 1); + i += 1; + freq = getbitu(rtcm->buff, i, 5); + i += 5; + pr1 = getbitu(rtcm->buff, i, 25); + i += 25; + ppr1 = getbits(rtcm->buff, i, 20); + i += 20; + lock1 = getbitu(rtcm->buff, i, 7); + i += 7; + amb = getbitu(rtcm->buff, i, 7); + i += 7; + cnr1 = getbitu(rtcm->buff, i, 8); + i += 8; if (!(sat = satno(sys, prn))) { trace(2, "rtcm3 1010 satellite number error: prn=%d\n", prn); continue; } tt = timediff(rtcm->obs.data[0].time, rtcm->time); - if (rtcm->obsflag || fabs(tt)>1E-9) + if (rtcm->obsflag || fabs(tt) > 1E-9) { rtcm->obs.n = rtcm->obsflag = 0; } if ((index = obsindex3(&rtcm->obs, rtcm->time, sat)) < 0) continue; - pr1 = pr1*0.02+amb*PRUNIT_GLO; + pr1 = pr1 * 0.02 + amb * PRUNIT_GLO; if (ppr1 != (int)0xFFF80000) { rtcm->obs.data[index].P[0] = pr1; - lam1 = SPEED_OF_LIGHT/(FREQ1_GLO+DFRQ1_GLO*(freq-7)); - cp1 = adjcp(rtcm, sat, 0, ppr1*0.0005/lam1); - rtcm->obs.data[index].L[0] = pr1/lam1+cp1; + lam1 = SPEED_OF_LIGHT / (FREQ1_GLO + DFRQ1_GLO * (freq - 7)); + cp1 = adjcp(rtcm, sat, 0, ppr1 * 0.0005 / lam1); + rtcm->obs.data[index].L[0] = pr1 / lam1 + cp1; } rtcm->obs.data[index].LLI[0] = lossoflock(rtcm, sat, 0, lock1); - rtcm->obs.data[index].SNR[0] = snratio(cnr1*0.25); - rtcm->obs.data[index].code[0] = code ? CODE_L1P:CODE_L1C; + rtcm->obs.data[index].SNR[0] = snratio(cnr1 * 0.25); + rtcm->obs.data[index].code[0] = code ? CODE_L1P : CODE_L1C; } - return sync ? 0:1; + return sync ? 0 : 1; } @@ -693,7 +751,7 @@ int decode_type1011(rtcm_t *rtcm) int sync; if (decode_head1009(rtcm, &sync) < 0) return -1; rtcm->obsflag = !sync; - return sync ? 0:1; + return sync ? 0 : 1; } @@ -701,65 +759,78 @@ int decode_type1011(rtcm_t *rtcm) int decode_type1012(rtcm_t *rtcm) { double pr1, cnr1, cnr2, tt, cp1, cp2, lam1, lam2; - int i = 24+61, j, index, nsat, sync, prn, sat, freq, code1, code2, pr21, ppr1, ppr2; + int i = 24 + 61, j, index, nsat, sync, prn, sat, freq, code1, code2, pr21, ppr1, ppr2; int lock1, lock2, amb, sys = SYS_GLO; if ((nsat = decode_head1009(rtcm, &sync)) < 0) return -1; - for (j = 0; j < nsat && rtcm->obs.n < MAXOBS && i+130 <= rtcm->len*8; j++) + for (j = 0; j < nsat && rtcm->obs.n < MAXOBS && i + 130 <= rtcm->len * 8; j++) { - prn = getbitu(rtcm->buff, i, 6); i += 6; - code1 = getbitu(rtcm->buff, i, 1); i += 1; - freq = getbitu(rtcm->buff, i, 5); i += 5; - pr1 = getbitu(rtcm->buff, i, 25); i += 25; - ppr1 = getbits(rtcm->buff, i, 20); i += 20; - lock1 = getbitu(rtcm->buff, i, 7); i += 7; - amb = getbitu(rtcm->buff, i, 7); i += 7; - cnr1 = getbitu(rtcm->buff, i, 8); i += 8; - code2 = getbitu(rtcm->buff, i, 2); i += 2; - pr21 = getbits(rtcm->buff, i, 14); i += 14; - ppr2 = getbits(rtcm->buff, i, 20); i += 20; - lock2 = getbitu(rtcm->buff, i, 7); i += 7; - cnr2 = getbitu(rtcm->buff, i, 8); i += 8; + prn = getbitu(rtcm->buff, i, 6); + i += 6; + code1 = getbitu(rtcm->buff, i, 1); + i += 1; + freq = getbitu(rtcm->buff, i, 5); + i += 5; + pr1 = getbitu(rtcm->buff, i, 25); + i += 25; + ppr1 = getbits(rtcm->buff, i, 20); + i += 20; + lock1 = getbitu(rtcm->buff, i, 7); + i += 7; + amb = getbitu(rtcm->buff, i, 7); + i += 7; + cnr1 = getbitu(rtcm->buff, i, 8); + i += 8; + code2 = getbitu(rtcm->buff, i, 2); + i += 2; + pr21 = getbits(rtcm->buff, i, 14); + i += 14; + ppr2 = getbits(rtcm->buff, i, 20); + i += 20; + lock2 = getbitu(rtcm->buff, i, 7); + i += 7; + cnr2 = getbitu(rtcm->buff, i, 8); + i += 8; if (!(sat = satno(sys, prn))) { trace(2, "rtcm3 1012 satellite number error: sys=%d prn=%d\n", sys, prn); continue; } tt = timediff(rtcm->obs.data[0].time, rtcm->time); - if (rtcm->obsflag || fabs(tt)>1E-9) + if (rtcm->obsflag || fabs(tt) > 1E-9) { rtcm->obs.n = rtcm->obsflag = 0; } if ((index = obsindex3(&rtcm->obs, rtcm->time, sat)) < 0) continue; - pr1 = pr1*0.02+amb*PRUNIT_GLO; + pr1 = pr1 * 0.02 + amb * PRUNIT_GLO; if (ppr1 != (int)0xFFF80000) { - lam1 = SPEED_OF_LIGHT/(FREQ1_GLO+DFRQ1_GLO*(freq-7)); + lam1 = SPEED_OF_LIGHT / (FREQ1_GLO + DFRQ1_GLO * (freq - 7)); rtcm->obs.data[index].P[0] = pr1; - cp1 = adjcp(rtcm, sat, 0, ppr1*0.0005/lam1); - rtcm->obs.data[index].L[0] = pr1/lam1+cp1; + cp1 = adjcp(rtcm, sat, 0, ppr1 * 0.0005 / lam1); + rtcm->obs.data[index].L[0] = pr1 / lam1 + cp1; } rtcm->obs.data[index].LLI[0] = lossoflock(rtcm, sat, 0, lock1); - rtcm->obs.data[index].SNR[0] = snratio(cnr1*0.25); - rtcm->obs.data[index].code[0] = code1 ? CODE_L1P:CODE_L1C; + rtcm->obs.data[index].SNR[0] = snratio(cnr1 * 0.25); + rtcm->obs.data[index].code[0] = code1 ? CODE_L1P : CODE_L1C; if (pr21 != (int)0xFFFFE000) { - rtcm->obs.data[index].P[1] = pr1+pr21*0.02; + rtcm->obs.data[index].P[1] = pr1 + pr21 * 0.02; } if (ppr2 != (int)0xFFF80000) { - lam2 = SPEED_OF_LIGHT/(FREQ2_GLO+DFRQ2_GLO*(freq-7)); - cp2 = adjcp(rtcm, sat, 1, ppr2*0.0005/lam2); - rtcm->obs.data[index].L[1] = pr1/lam2+cp2; + lam2 = SPEED_OF_LIGHT / (FREQ2_GLO + DFRQ2_GLO * (freq - 7)); + cp2 = adjcp(rtcm, sat, 1, ppr2 * 0.0005 / lam2); + rtcm->obs.data[index].L[1] = pr1 / lam2 + cp2; } rtcm->obs.data[index].LLI[1] = lossoflock(rtcm, sat, 1, lock2); - rtcm->obs.data[index].SNR[1] = snratio(cnr2*0.25); - rtcm->obs.data[index].code[1] = code2 ? CODE_L2P:CODE_L2C; + rtcm->obs.data[index].SNR[1] = snratio(cnr2 * 0.25); + rtcm->obs.data[index].code[1] = code2 ? CODE_L2P : CODE_L2C; } rtcm->obsflag = !sync; - return sync ? 0:1; + return sync ? 0 : 1; } @@ -773,45 +844,74 @@ int decode_type1013(rtcm_t *rtcm __attribute__((unused))) /* decode type 1019: gps ephemerides -----------------------------------------*/ 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}, - 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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 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}; double toc, sqrtA; char *msg; - int i = 24+12, prn, sat, week, sys = SYS_GPS; + int i = 24 + 12, prn, sat, week, sys = SYS_GPS; - if (i+476 <= rtcm->len*8) + if (i + 476 <= rtcm->len * 8) { - prn = getbitu(rtcm->buff, i, 6); i += 6; - week = getbitu(rtcm->buff, i, 10); i += 10; - eph.sva = getbitu(rtcm->buff, i, 4); i += 4; - eph.code = getbitu(rtcm->buff, i, 2); i += 2; - eph.idot = getbits(rtcm->buff, i, 14)*TWO_N43*SC2RAD; i += 14; - eph.iode = getbitu(rtcm->buff, i, 8); i += 8; - toc = getbitu(rtcm->buff, i, 16)*16.0; i += 16; - eph.f2 = getbits(rtcm->buff, i, 8)*TWO_N55; i += 8; - eph.f1 = getbits(rtcm->buff, i, 16)*TWO_N43; i += 16; - eph.f0 = getbits(rtcm->buff, i, 22)*TWO_N31; i += 22; - eph.iodc = getbitu(rtcm->buff, i, 10); i += 10; - eph.crs = getbits(rtcm->buff, i, 16)*TWO_N5; i += 16; - eph.deln = getbits(rtcm->buff, i, 16)*TWO_N43*SC2RAD; i += 16; - eph.M0 = getbits(rtcm->buff, i, 32)*TWO_N31*SC2RAD; i += 32; - eph.cuc = getbits(rtcm->buff, i, 16)*TWO_N29; i += 16; - eph.e = getbitu(rtcm->buff, i, 32)*TWO_N33; i += 32; - eph.cus = getbits(rtcm->buff, i, 16)*TWO_N29; i += 16; - sqrtA = getbitu(rtcm->buff, i, 32)*TWO_N19; i += 32; - eph.toes = getbitu(rtcm->buff, i, 16)*16.0; i += 16; - eph.cic = getbits(rtcm->buff, i, 16)*TWO_N29; i += 16; - eph.OMG0 = getbits(rtcm->buff, i, 32)*TWO_N31*SC2RAD; i += 32; - eph.cis = getbits(rtcm->buff, i, 16)*TWO_N29; i += 16; - eph.i0 = getbits(rtcm->buff, i, 32)*TWO_N31*SC2RAD; i += 32; - eph.crc = getbits(rtcm->buff, i, 16)*TWO_N5; i += 16; - eph.omg = getbits(rtcm->buff, i, 32)*TWO_N31*SC2RAD; i += 32; - eph.OMGd = getbits(rtcm->buff, i, 24)*TWO_N43*SC2RAD; i += 24; - eph.tgd[0] = getbits(rtcm->buff, i, 8)*TWO_N31; i += 8; - eph.svh = getbitu(rtcm->buff, i, 6); i += 6; - eph.flag = getbitu(rtcm->buff, i, 1); i += 1; - eph.fit = getbitu(rtcm->buff, i, 1) ? 0.0:4.0; /* 0:4hr, 1:>4hr */ + prn = getbitu(rtcm->buff, i, 6); + i += 6; + week = getbitu(rtcm->buff, i, 10); + i += 10; + eph.sva = getbitu(rtcm->buff, i, 4); + i += 4; + eph.code = getbitu(rtcm->buff, i, 2); + i += 2; + eph.idot = getbits(rtcm->buff, i, 14) * TWO_N43 * SC2RAD; + i += 14; + eph.iode = getbitu(rtcm->buff, i, 8); + i += 8; + toc = getbitu(rtcm->buff, i, 16) * 16.0; + i += 16; + eph.f2 = getbits(rtcm->buff, i, 8) * TWO_N55; + i += 8; + eph.f1 = getbits(rtcm->buff, i, 16) * TWO_N43; + i += 16; + eph.f0 = getbits(rtcm->buff, i, 22) * TWO_N31; + i += 22; + eph.iodc = getbitu(rtcm->buff, i, 10); + i += 10; + eph.crs = getbits(rtcm->buff, i, 16) * TWO_N5; + i += 16; + eph.deln = getbits(rtcm->buff, i, 16) * TWO_N43 * SC2RAD; + i += 16; + eph.M0 = getbits(rtcm->buff, i, 32) * TWO_N31 * SC2RAD; + i += 32; + eph.cuc = getbits(rtcm->buff, i, 16) * TWO_N29; + i += 16; + eph.e = getbitu(rtcm->buff, i, 32) * TWO_N33; + i += 32; + eph.cus = getbits(rtcm->buff, i, 16) * TWO_N29; + i += 16; + sqrtA = getbitu(rtcm->buff, i, 32) * TWO_N19; + i += 32; + eph.toes = getbitu(rtcm->buff, i, 16) * 16.0; + i += 16; + eph.cic = getbits(rtcm->buff, i, 16) * TWO_N29; + i += 16; + eph.OMG0 = getbits(rtcm->buff, i, 32) * TWO_N31 * SC2RAD; + i += 32; + eph.cis = getbits(rtcm->buff, i, 16) * TWO_N29; + i += 16; + eph.i0 = getbits(rtcm->buff, i, 32) * TWO_N31 * SC2RAD; + i += 32; + eph.crc = getbits(rtcm->buff, i, 16) * TWO_N5; + i += 16; + eph.omg = getbits(rtcm->buff, i, 32) * TWO_N31 * SC2RAD; + i += 32; + eph.OMGd = getbits(rtcm->buff, i, 24) * TWO_N43 * SC2RAD; + i += 24; + eph.tgd[0] = getbits(rtcm->buff, i, 8) * TWO_N31; + i += 8; + eph.svh = getbitu(rtcm->buff, i, 6); + i += 6; + eph.flag = getbitu(rtcm->buff, i, 1); + i += 1; + eph.fit = getbitu(rtcm->buff, i, 1) ? 0.0 : 4.0; /* 0:4hr, 1:>4hr */ } else { @@ -820,15 +920,16 @@ int decode_type1019(rtcm_t *rtcm) } if (prn >= 40) { - sys = SYS_SBS; prn += 80; + sys = SYS_SBS; + prn += 80; } trace(4, "decode_type1019: prn=%d iode=%d toe=%.0f\n", prn, eph.iode, eph.toes); if (rtcm->outtype) { - msg = rtcm->msgtype+strlen(rtcm->msgtype); + msg = rtcm->msgtype + strlen(rtcm->msgtype); sprintf(msg, " prn=%2d iode=%3d iodc=%3d week=%d toe=%6.0f toc=%6.0f svh=%02X", - prn, eph.iode, eph.iodc, week, eph.toes, toc, eph.svh); + prn, eph.iode, eph.iodc, week, eph.toes, toc, eph.svh); } if (!(sat = satno(sys, prn))) { @@ -840,12 +941,12 @@ int decode_type1019(rtcm_t *rtcm) eph.toe = gpst2time(eph.week, eph.toes); eph.toc = gpst2time(eph.week, toc); eph.ttr = rtcm->time; - eph.A = sqrtA*sqrtA; + eph.A = sqrtA * sqrtA; if (!strstr(rtcm->opt, "-EPHALL")) { - if (eph.iode == rtcm->nav.eph[sat-1].iode) return 0; /* unchanged */ + if (eph.iode == rtcm->nav.eph[sat - 1].iode) return 0; /* unchanged */ } - rtcm->nav.eph[sat-1] = eph; + rtcm->nav.eph[sat - 1] = eph; rtcm->ephsat = sat; return 2; } @@ -854,32 +955,49 @@ int decode_type1019(rtcm_t *rtcm) /* decode type 1020: glonass ephemerides -------------------------------------*/ 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}, - 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}; double tk_h, tk_m, tk_s, toe, tow, tod, tof; char *msg; - int i = 24+12, prn, sat, week, tb, bn, sys = SYS_GLO; + int i = 24 + 12, prn, sat, week, tb, bn, sys = SYS_GLO; - if (i+348 <= rtcm->len*8) + if (i + 348 <= rtcm->len * 8) { - prn = getbitu(rtcm->buff, i, 6); i += 6; - geph.frq = getbitu(rtcm->buff, i, 5)-7; i += 5+2+2; - tk_h = getbitu(rtcm->buff, i, 5); i += 5; - tk_m = getbitu(rtcm->buff, i, 6); i += 6; - tk_s = getbitu(rtcm->buff, i, 1)*30.0; i += 1; - bn = getbitu(rtcm->buff, i, 1); i += 1+1; - tb = getbitu(rtcm->buff, i, 7); i += 7; - geph.vel[0] = getbitg(rtcm->buff, i, 24)*TWO_N20*1E3; i += 24; - geph.pos[0] = getbitg(rtcm->buff, i, 27)*TWO_N11*1E3; i += 27; - geph.acc[0] = getbitg(rtcm->buff, i, 5)*TWO_N30*1E3; i += 5; - geph.vel[1] = getbitg(rtcm->buff, i, 24)*TWO_N20*1E3; i += 24; - geph.pos[1] = getbitg(rtcm->buff, i, 27)*TWO_N11*1E3; i += 27; - geph.acc[1] = getbitg(rtcm->buff, i, 5)*TWO_N30*1E3; i += 5; - geph.vel[2] = getbitg(rtcm->buff, i, 24)*TWO_N20*1E3; i += 24; - geph.pos[2] = getbitg(rtcm->buff, i, 27)*TWO_N11*1E3; i += 27; - geph.acc[2] = getbitg(rtcm->buff, i, 5)*TWO_N30*1E3; i += 5+1; - geph.gamn = getbitg(rtcm->buff, i, 11)*TWO_N40; i += 11+3; - geph.taun = getbitg(rtcm->buff, i, 22)*TWO_N30; + prn = getbitu(rtcm->buff, i, 6); + i += 6; + geph.frq = getbitu(rtcm->buff, i, 5) - 7; + i += 5 + 2 + 2; + tk_h = getbitu(rtcm->buff, i, 5); + i += 5; + tk_m = getbitu(rtcm->buff, i, 6); + i += 6; + tk_s = getbitu(rtcm->buff, i, 1) * 30.0; + i += 1; + bn = getbitu(rtcm->buff, i, 1); + i += 1 + 1; + tb = getbitu(rtcm->buff, i, 7); + i += 7; + geph.vel[0] = getbitg(rtcm->buff, i, 24) * TWO_N20 * 1E3; + i += 24; + geph.pos[0] = getbitg(rtcm->buff, i, 27) * TWO_N11 * 1E3; + i += 27; + geph.acc[0] = getbitg(rtcm->buff, i, 5) * TWO_N30 * 1E3; + i += 5; + geph.vel[1] = getbitg(rtcm->buff, i, 24) * TWO_N20 * 1E3; + i += 24; + geph.pos[1] = getbitg(rtcm->buff, i, 27) * TWO_N11 * 1E3; + i += 27; + geph.acc[1] = getbitg(rtcm->buff, i, 5) * TWO_N30 * 1E3; + i += 5; + geph.vel[2] = getbitg(rtcm->buff, i, 24) * TWO_N20 * 1E3; + i += 24; + geph.pos[2] = getbitg(rtcm->buff, i, 27) * TWO_N11 * 1E3; + i += 27; + geph.acc[2] = getbitg(rtcm->buff, i, 5) * TWO_N30 * 1E3; + i += 5 + 1; + geph.gamn = getbitg(rtcm->buff, i, 11) * TWO_N40; + i += 11 + 3; + geph.taun = getbitg(rtcm->buff, i, 22) * TWO_N30; } else { @@ -895,31 +1013,36 @@ int decode_type1020(rtcm_t *rtcm) if (rtcm->outtype) { - msg = rtcm->msgtype+strlen(rtcm->msgtype); + msg = rtcm->msgtype + strlen(rtcm->msgtype); sprintf(msg, " prn=%2d tk=%02.0f:%02.0f:%02.0f frq=%2d bn=%d tb=%d", - prn, tk_h, tk_m, tk_s, geph.frq, bn, tb); + prn, tk_h, tk_m, tk_s, geph.frq, bn, tb); } geph.sat = sat; geph.svh = bn; - geph.iode = tb&0x7F; + geph.iode = tb & 0x7F; if (rtcm->time.time == 0) rtcm->time = utc2gpst(timeget()); tow = time2gpst(gpst2utc(rtcm->time), &week); - tod = fmod(tow, 86400.0); tow -= tod; - tof = tk_h*3600.0+tk_m*60.0+tk_s-10800.0; /* lt->utc */ - if (tof < tod-43200.0) tof += 86400.0; - else if (tof>tod+43200.0) tof -= 86400.0; - geph.tof = utc2gpst(gpst2time(week, tow+tof)); - toe = tb*900.0-10800.0; /* lt->utc */ - if (toe < tod-43200.0) toe += 86400.0; - else if (toe>tod+43200.0) toe -= 86400.0; - geph.toe = utc2gpst(gpst2time(week, tow+toe)); /* utc->gpst */ + tod = fmod(tow, 86400.0); + tow -= tod; + tof = tk_h * 3600.0 + tk_m * 60.0 + tk_s - 10800.0; /* lt->utc */ + if (tof < tod - 43200.0) + tof += 86400.0; + else if (tof > tod + 43200.0) + tof -= 86400.0; + geph.tof = utc2gpst(gpst2time(week, tow + tof)); + toe = tb * 900.0 - 10800.0; /* lt->utc */ + if (toe < tod - 43200.0) + toe += 86400.0; + else if (toe > tod + 43200.0) + toe -= 86400.0; + geph.toe = utc2gpst(gpst2time(week, tow + toe)); /* utc->gpst */ if (!strstr(rtcm->opt, "-EPHALL")) { - if (fabs(timediff(geph.toe, rtcm->nav.geph[prn-1].toe)) < 1.0 && - geph.svh == rtcm->nav.geph[prn-1].svh) return 0; /* unchanged */ + if (fabs(timediff(geph.toe, rtcm->nav.geph[prn - 1].toe)) < 1.0 && + geph.svh == rtcm->nav.geph[prn - 1].svh) return 0; /* unchanged */ } - rtcm->nav.geph[prn-1] = geph; + rtcm->nav.geph[prn - 1] = geph; rtcm->ephsat = sat; return 2; } @@ -985,35 +1108,38 @@ int decode_type1027(rtcm_t *rtcm __attribute__((unused))) int decode_type1029(rtcm_t *rtcm) { char *msg; - int i = 24+12, j, staid, nchar; // mjd, tod, nchar, cunit; + int i = 24 + 12, j, staid, nchar; // mjd, tod, nchar, cunit; - if (i+60 <= rtcm->len*8) + if (i + 60 <= rtcm->len * 8) { - staid = getbitu(rtcm->buff, i, 12); i += 12; + staid = getbitu(rtcm->buff, i, 12); + i += 12; /* mjd = getbitu(rtcm->buff, i, 16); */ i += 16; /* tod = getbitu(rtcm->buff, i, 17); */ i += 17; - nchar = getbitu(rtcm->buff, i, 7); i += 7; - /* cunit = getbitu(rtcm->buff, i, 8); */ i += 8; + nchar = getbitu(rtcm->buff, i, 7); + i += 7; + /* cunit = getbitu(rtcm->buff, i, 8); */ i += 8; } else { trace(2, "rtcm3 1029 length error: len=%d\n", rtcm->len); return -1; } - if (i+nchar*8>rtcm->len*8) + if (i + nchar * 8 > rtcm->len * 8) { trace(2, "rtcm3 1029 length error: len=%d nchar=%d\n", rtcm->len, nchar); return -1; } for (j = 0; j < nchar && j < 126; j++) { - rtcm->msg[j] = getbitu(rtcm->buff, i, 8); i += 8; + rtcm->msg[j] = getbitu(rtcm->buff, i, 8); + i += 8; } rtcm->msg[j] = '\0'; if (rtcm->outtype) { - msg = rtcm->msgtype+strlen(rtcm->msgtype); + msg = rtcm->msgtype + strlen(rtcm->msgtype); sprintf(msg, " staid=%4d text=%s", staid, rtcm->msg); } return 0; @@ -1049,40 +1175,47 @@ int decode_type1033(rtcm_t *rtcm) { char des[32] = "", sno[32] = "", rec[32] = "", ver[32] = "", rsn[32] = ""; char *msg; - int i = 24+12, j, staid, n, m, n1, n2, n3, setup; + int i = 24 + 12, j, staid, n, m, n1, n2, n3, setup; - n = getbitu(rtcm->buff, i+12, 8); - m = getbitu(rtcm->buff, i+28+8*n, 8); - n1 = getbitu(rtcm->buff, i+36+8*(n+m), 8); - n2 = getbitu(rtcm->buff, i+44+8*(n+m+n1), 8); - n3 = getbitu(rtcm->buff, i+52+8*(n+m+n1+n2), 8); + n = getbitu(rtcm->buff, i + 12, 8); + m = getbitu(rtcm->buff, i + 28 + 8 * n, 8); + n1 = getbitu(rtcm->buff, i + 36 + 8 * (n + m), 8); + n2 = getbitu(rtcm->buff, i + 44 + 8 * (n + m + n1), 8); + n3 = getbitu(rtcm->buff, i + 52 + 8 * (n + m + n1 + n2), 8); - if (i+60+8*(n+m+n1+n2+n3) <= rtcm->len*8) + if (i + 60 + 8 * (n + m + n1 + n2 + n3) <= rtcm->len * 8) { - staid = getbitu(rtcm->buff, i, 12); i += 12+8; + staid = getbitu(rtcm->buff, i, 12); + i += 12 + 8; for (j = 0; j < n && j < 31; j++) { - des[j] = (char)getbitu(rtcm->buff, i, 8); i += 8; + des[j] = (char)getbitu(rtcm->buff, i, 8); + i += 8; } - setup = getbitu(rtcm->buff, i, 8); i += 8+8; + setup = getbitu(rtcm->buff, i, 8); + i += 8 + 8; for (j = 0; j < m && j < 31; j++) { - sno[j] = (char)getbitu(rtcm->buff, i, 8); i += 8; + sno[j] = (char)getbitu(rtcm->buff, i, 8); + i += 8; } i += 8; for (j = 0; j < n1 && j < 31; j++) { - rec[j] = (char)getbitu(rtcm->buff, i, 8); i += 8; + rec[j] = (char)getbitu(rtcm->buff, i, 8); + i += 8; } i += 8; for (j = 0; j < n2 && j < 31; j++) { - ver[j] = (char)getbitu(rtcm->buff, i, 8); i += 8; + ver[j] = (char)getbitu(rtcm->buff, i, 8); + i += 8; } i += 8; for (j = 0; j < n3 && j < 31; j++) { - rsn[j] = (char)getbitu(rtcm->buff, i, 8); i += 8; + rsn[j] = (char)getbitu(rtcm->buff, i, 8); + i += 8; } } else @@ -1092,18 +1225,23 @@ int decode_type1033(rtcm_t *rtcm) } if (rtcm->outtype) { - msg = rtcm->msgtype+strlen(rtcm->msgtype); + msg = rtcm->msgtype + strlen(rtcm->msgtype); sprintf(msg, " staid=%4d", staid); } /* test station id */ if (!test_staid(rtcm, staid)) return -1; - strncpy(rtcm->sta.antdes, des, n ); rtcm->sta.antdes [n] = '\0'; + strncpy(rtcm->sta.antdes, des, n); + rtcm->sta.antdes[n] = '\0'; rtcm->sta.antsetup = setup; - strncpy(rtcm->sta.antsno, sno, m ); rtcm->sta.antsno [m] = '\0'; - strncpy(rtcm->sta.rectype, rec, n1); rtcm->sta.rectype[n1] = '\0'; - strncpy(rtcm->sta.recver, ver, n2); rtcm->sta.recver [n2] = '\0'; - strncpy(rtcm->sta.recsno, rsn, n3); rtcm->sta.recsno [n3] = '\0'; + strncpy(rtcm->sta.antsno, sno, m); + rtcm->sta.antsno[m] = '\0'; + strncpy(rtcm->sta.rectype, rec, n1); + rtcm->sta.rectype[n1] = '\0'; + strncpy(rtcm->sta.recver, ver, n2); + rtcm->sta.recver[n2] = '\0'; + strncpy(rtcm->sta.recsno, rsn, n3); + rtcm->sta.recsno[n3] = '\0'; trace(3, "rtcm3 1033: ant=%s:%s rec=%s:%s:%s\n", des, sno, rec, ver, rsn); return 5; @@ -1153,44 +1291,72 @@ int decode_type1039(rtcm_t *rtcm __attribute__((unused))) /* decode type 1044: qzss ephemerides (ref [15]) -----------------------------*/ 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}, - 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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 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}; double toc, sqrtA; char *msg; - int i = 24+12, prn, sat, week, sys = SYS_QZS; + int i = 24 + 12, prn, sat, week, sys = SYS_QZS; - if (i+473 <= rtcm->len*8) + if (i + 473 <= rtcm->len * 8) { - prn = getbitu(rtcm->buff, i, 4)+192; i += 4; - toc = getbitu(rtcm->buff, i, 16)*16.0; i += 16; - eph.f2 = getbits(rtcm->buff, i, 8)*TWO_N55; i += 8; - eph.f1 = getbits(rtcm->buff, i, 16)*TWO_N43; i += 16; - eph.f0 = getbits(rtcm->buff, i, 22)*TWO_N31; i += 22; - eph.iode = getbitu(rtcm->buff, i, 8); i += 8; - eph.crs = getbits(rtcm->buff, i, 16)*TWO_N5; i += 16; - eph.deln = getbits(rtcm->buff, i, 16)*TWO_N43*SC2RAD; i += 16; - eph.M0 = getbits(rtcm->buff, i, 32)*TWO_N31*SC2RAD; i += 32; - eph.cuc = getbits(rtcm->buff, i, 16)*TWO_N29; i += 16; - eph.e = getbitu(rtcm->buff, i, 32)*TWO_N33; i += 32; - eph.cus = getbits(rtcm->buff, i, 16)*TWO_N29; i += 16; - sqrtA = getbitu(rtcm->buff, i, 32)*TWO_N19; i += 32; - eph.toes = getbitu(rtcm->buff, i, 16)*16.0; i += 16; - eph.cic = getbits(rtcm->buff, i, 16)*TWO_N29; i += 16; - eph.OMG0 = getbits(rtcm->buff, i, 32)*TWO_N31*SC2RAD; i += 32; - eph.cis = getbits(rtcm->buff, i, 16)*TWO_N29; i += 16; - eph.i0 = getbits(rtcm->buff, i, 32)*TWO_N31*SC2RAD; i += 32; - eph.crc = getbits(rtcm->buff, i, 16)*TWO_N5; i += 16; - eph.omg = getbits(rtcm->buff, i, 32)*TWO_N31*SC2RAD; i += 32; - eph.OMGd = getbits(rtcm->buff, i, 24)*TWO_N43*SC2RAD; i += 24; - eph.idot = getbits(rtcm->buff, i, 14)*TWO_N43*SC2RAD; i += 14; - eph.code = getbitu(rtcm->buff, i, 2); i += 2; - week = getbitu(rtcm->buff, i, 10); i += 10; - eph.sva = getbitu(rtcm->buff, i, 4); i += 4; - eph.svh = getbitu(rtcm->buff, i, 6); i += 6; - eph.tgd[0] = getbits(rtcm->buff, i, 8)*TWO_N31; i += 8; - eph.iodc = getbitu(rtcm->buff, i, 10); i += 10; - eph.fit = getbitu(rtcm->buff, i, 1) ? 0.0:2.0; /* 0:2hr, 1:>2hr */ + prn = getbitu(rtcm->buff, i, 4) + 192; + i += 4; + toc = getbitu(rtcm->buff, i, 16) * 16.0; + i += 16; + eph.f2 = getbits(rtcm->buff, i, 8) * TWO_N55; + i += 8; + eph.f1 = getbits(rtcm->buff, i, 16) * TWO_N43; + i += 16; + eph.f0 = getbits(rtcm->buff, i, 22) * TWO_N31; + i += 22; + eph.iode = getbitu(rtcm->buff, i, 8); + i += 8; + eph.crs = getbits(rtcm->buff, i, 16) * TWO_N5; + i += 16; + eph.deln = getbits(rtcm->buff, i, 16) * TWO_N43 * SC2RAD; + i += 16; + eph.M0 = getbits(rtcm->buff, i, 32) * TWO_N31 * SC2RAD; + i += 32; + eph.cuc = getbits(rtcm->buff, i, 16) * TWO_N29; + i += 16; + eph.e = getbitu(rtcm->buff, i, 32) * TWO_N33; + i += 32; + eph.cus = getbits(rtcm->buff, i, 16) * TWO_N29; + i += 16; + sqrtA = getbitu(rtcm->buff, i, 32) * TWO_N19; + i += 32; + eph.toes = getbitu(rtcm->buff, i, 16) * 16.0; + i += 16; + eph.cic = getbits(rtcm->buff, i, 16) * TWO_N29; + i += 16; + eph.OMG0 = getbits(rtcm->buff, i, 32) * TWO_N31 * SC2RAD; + i += 32; + eph.cis = getbits(rtcm->buff, i, 16) * TWO_N29; + i += 16; + eph.i0 = getbits(rtcm->buff, i, 32) * TWO_N31 * SC2RAD; + i += 32; + eph.crc = getbits(rtcm->buff, i, 16) * TWO_N5; + i += 16; + eph.omg = getbits(rtcm->buff, i, 32) * TWO_N31 * SC2RAD; + i += 32; + eph.OMGd = getbits(rtcm->buff, i, 24) * TWO_N43 * SC2RAD; + i += 24; + eph.idot = getbits(rtcm->buff, i, 14) * TWO_N43 * SC2RAD; + i += 14; + eph.code = getbitu(rtcm->buff, i, 2); + i += 2; + week = getbitu(rtcm->buff, i, 10); + i += 10; + eph.sva = getbitu(rtcm->buff, i, 4); + i += 4; + eph.svh = getbitu(rtcm->buff, i, 6); + i += 6; + eph.tgd[0] = getbits(rtcm->buff, i, 8) * TWO_N31; + i += 8; + eph.iodc = getbitu(rtcm->buff, i, 10); + i += 10; + eph.fit = getbitu(rtcm->buff, i, 1) ? 0.0 : 2.0; /* 0:2hr, 1:>2hr */ } else { @@ -1201,9 +1367,9 @@ int decode_type1044(rtcm_t *rtcm) if (rtcm->outtype) { - msg = rtcm->msgtype+strlen(rtcm->msgtype); + msg = rtcm->msgtype + strlen(rtcm->msgtype); sprintf(msg, " prn=%3d iode=%3d iodc=%3d week=%d toe=%6.0f toc=%6.0f svh=%02X", - prn, eph.iode, eph.iodc, week, eph.toes, toc, eph.svh); + prn, eph.iode, eph.iodc, week, eph.toes, toc, eph.svh); } if (!(sat = satno(sys, prn))) { @@ -1215,13 +1381,13 @@ int decode_type1044(rtcm_t *rtcm) eph.toe = gpst2time(eph.week, eph.toes); eph.toc = gpst2time(eph.week, toc); eph.ttr = rtcm->time; - eph.A = sqrtA*sqrtA; + eph.A = sqrtA * sqrtA; if (!strstr(rtcm->opt, "-EPHALL")) { - if (eph.iode == rtcm->nav.eph[sat-1].iode && - eph.iodc == rtcm->nav.eph[sat-1].iodc) return 0; /* unchanged */ + if (eph.iode == rtcm->nav.eph[sat - 1].iode && + eph.iodc == rtcm->nav.eph[sat - 1].iodc) return 0; /* unchanged */ } - rtcm->nav.eph[sat-1] = eph; + rtcm->nav.eph[sat - 1] = eph; rtcm->ephsat = sat; return 2; } @@ -1230,42 +1396,69 @@ int decode_type1044(rtcm_t *rtcm) /* decode type 1045: galileo satellite ephemerides (ref [15]) ----------------*/ 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}, - 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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 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}; double toc, sqrtA; char *msg; - int i = 24+12, prn, sat, week, e5a_hs, e5a_dvs, sys = SYS_GAL; + int i = 24 + 12, prn, sat, week, e5a_hs, e5a_dvs, sys = SYS_GAL; - if (i+484 <= rtcm->len*8) + if (i + 484 <= rtcm->len * 8) { - prn = getbitu(rtcm->buff, i, 6); i += 6; - week = getbitu(rtcm->buff, i, 12); i += 12; /* gst-week */ - eph.iode = getbitu(rtcm->buff, i, 10); i += 10; - eph.sva = getbitu(rtcm->buff, i, 8); i += 8; - eph.idot = getbits(rtcm->buff, i, 14)*TWO_N43*SC2RAD; i += 14; - toc = getbitu(rtcm->buff, i, 14)*60.0; i += 14; - eph.f2 = getbits(rtcm->buff, i, 6)*TWO_N59; i += 6; - eph.f1 = getbits(rtcm->buff, i, 21)*TWO_N46; i += 21; - eph.f0 = getbits(rtcm->buff, i, 31)*TWO_N34; i += 31; - eph.crs = getbits(rtcm->buff, i, 16)*TWO_N5; i += 16; - eph.deln = getbits(rtcm->buff, i, 16)*TWO_N43*SC2RAD; i += 16; - eph.M0 = getbits(rtcm->buff, i, 32)*TWO_N31*SC2RAD; i += 32; - eph.cuc = getbits(rtcm->buff, i, 16)*TWO_N29; i += 16; - eph.e = getbitu(rtcm->buff, i, 32)*TWO_N33; i += 32; - eph.cus = getbits(rtcm->buff, i, 16)*TWO_N29; i += 16; - sqrtA = getbitu(rtcm->buff, i, 32)*TWO_N19; i += 32; - eph.toes = getbitu(rtcm->buff, i, 14)*60.0; i += 14; - eph.cic = getbits(rtcm->buff, i, 16)*TWO_N29; i += 16; - eph.OMG0 = getbits(rtcm->buff, i, 32)*TWO_N31*SC2RAD; i += 32; - eph.cis = getbits(rtcm->buff, i, 16)*TWO_N29; i += 16; - eph.i0 = getbits(rtcm->buff, i, 32)*TWO_N31*SC2RAD; i += 32; - eph.crc = getbits(rtcm->buff, i, 16)*TWO_N5; i += 16; - eph.omg = getbits(rtcm->buff, i, 32)*TWO_N31*SC2RAD; i += 32; - eph.OMGd = getbits(rtcm->buff, i, 24)*TWO_N43*SC2RAD; i += 24; - eph.tgd[0] = getbits(rtcm->buff, i, 10)*TWO_N32; i += 10; /* E5a/E1 */ - e5a_hs = getbitu(rtcm->buff, i, 2); i += 2; /* OSHS */ - e5a_dvs = getbitu(rtcm->buff, i, 1); i += 1; /* OSDVS */ + prn = getbitu(rtcm->buff, i, 6); + i += 6; + week = getbitu(rtcm->buff, i, 12); + i += 12; /* gst-week */ + eph.iode = getbitu(rtcm->buff, i, 10); + i += 10; + eph.sva = getbitu(rtcm->buff, i, 8); + i += 8; + eph.idot = getbits(rtcm->buff, i, 14) * TWO_N43 * SC2RAD; + i += 14; + toc = getbitu(rtcm->buff, i, 14) * 60.0; + i += 14; + eph.f2 = getbits(rtcm->buff, i, 6) * TWO_N59; + i += 6; + eph.f1 = getbits(rtcm->buff, i, 21) * TWO_N46; + i += 21; + eph.f0 = getbits(rtcm->buff, i, 31) * TWO_N34; + i += 31; + eph.crs = getbits(rtcm->buff, i, 16) * TWO_N5; + i += 16; + eph.deln = getbits(rtcm->buff, i, 16) * TWO_N43 * SC2RAD; + i += 16; + eph.M0 = getbits(rtcm->buff, i, 32) * TWO_N31 * SC2RAD; + i += 32; + eph.cuc = getbits(rtcm->buff, i, 16) * TWO_N29; + i += 16; + eph.e = getbitu(rtcm->buff, i, 32) * TWO_N33; + i += 32; + eph.cus = getbits(rtcm->buff, i, 16) * TWO_N29; + i += 16; + sqrtA = getbitu(rtcm->buff, i, 32) * TWO_N19; + i += 32; + eph.toes = getbitu(rtcm->buff, i, 14) * 60.0; + i += 14; + eph.cic = getbits(rtcm->buff, i, 16) * TWO_N29; + i += 16; + eph.OMG0 = getbits(rtcm->buff, i, 32) * TWO_N31 * SC2RAD; + i += 32; + eph.cis = getbits(rtcm->buff, i, 16) * TWO_N29; + i += 16; + eph.i0 = getbits(rtcm->buff, i, 32) * TWO_N31 * SC2RAD; + i += 32; + eph.crc = getbits(rtcm->buff, i, 16) * TWO_N5; + i += 16; + eph.omg = getbits(rtcm->buff, i, 32) * TWO_N31 * SC2RAD; + i += 32; + eph.OMGd = getbits(rtcm->buff, i, 24) * TWO_N43 * SC2RAD; + i += 24; + eph.tgd[0] = getbits(rtcm->buff, i, 10) * TWO_N32; + i += 10; /* E5a/E1 */ + e5a_hs = getbitu(rtcm->buff, i, 2); + i += 2; /* OSHS */ + e5a_dvs = getbitu(rtcm->buff, i, 1); + i += 1; /* OSDVS */ //rsv = getbitu(rtcm->buff, i, 7); } else @@ -1277,9 +1470,9 @@ int decode_type1045(rtcm_t *rtcm) if (rtcm->outtype) { - msg = rtcm->msgtype+strlen(rtcm->msgtype); + msg = rtcm->msgtype + strlen(rtcm->msgtype); sprintf(msg, " prn=%2d iode=%3d week=%d toe=%6.0f toc=%6.0f hs=%d dvs=%d", - prn, eph.iode, week, eph.toes, toc, e5a_hs, e5a_dvs); + prn, eph.iode, week, eph.toes, toc, e5a_hs, e5a_dvs); } if (!(sat = satno(sys, prn))) { @@ -1287,18 +1480,18 @@ int decode_type1045(rtcm_t *rtcm) return -1; } eph.sat = sat; - eph.week = week+1024; /* gal-week = gst-week + 1024 */ + eph.week = week + 1024; /* gal-week = gst-week + 1024 */ eph.toe = gpst2time(eph.week, eph.toes); eph.toc = gpst2time(eph.week, toc); eph.ttr = rtcm->time; - eph.A = sqrtA*sqrtA; - eph.svh = (e5a_hs<<4)+(e5a_dvs<<3); + eph.A = sqrtA * sqrtA; + eph.svh = (e5a_hs << 4) + (e5a_dvs << 3); eph.code = 2; /* data source = f/nav e5a */ if (!strstr(rtcm->opt, "-EPHALL")) { - if (eph.iode == rtcm->nav.eph[sat-1].iode) return 0; /* unchanged */ + if (eph.iode == rtcm->nav.eph[sat - 1].iode) return 0; /* unchanged */ } - rtcm->nav.eph[sat-1] = eph; + rtcm->nav.eph[sat - 1] = eph; rtcm->ephsat = sat; return 2; } @@ -1307,42 +1500,69 @@ int decode_type1045(rtcm_t *rtcm) /* decode type 1046: galileo satellite ephemerides (extension for IGS MGEX) --*/ 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}, - 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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 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}; double toc, sqrtA; char *msg; - int i = 24+12, prn, sat, week, e5a_hs, e5a_dvs, sys = SYS_GAL; + int i = 24 + 12, prn, sat, week, e5a_hs, e5a_dvs, sys = SYS_GAL; - if (i+484 <= rtcm->len*8) + if (i + 484 <= rtcm->len * 8) { - prn = getbitu(rtcm->buff, i, 6); i += 6; - week = getbitu(rtcm->buff, i, 12); i += 12; /* gst-week */ - eph.iode = getbitu(rtcm->buff, i, 10); i += 10; - eph.sva = getbitu(rtcm->buff, i, 8); i += 8; - eph.idot = getbits(rtcm->buff, i, 14)*TWO_N43*SC2RAD; i += 14; - toc = getbitu(rtcm->buff, i, 14)*60.0; i += 14; - eph.f2 = getbits(rtcm->buff, i, 6)*TWO_N59; i += 6; - eph.f1 = getbits(rtcm->buff, i, 21)*TWO_N46; i += 21; - eph.f0 = getbits(rtcm->buff, i, 31)*TWO_N34; i += 31; - eph.crs = getbits(rtcm->buff, i, 16)*TWO_N5; i += 16; - eph.deln = getbits(rtcm->buff, i, 16)*TWO_N43*SC2RAD; i += 16; - eph.M0 = getbits(rtcm->buff, i, 32)*TWO_N31*SC2RAD; i += 32; - eph.cuc = getbits(rtcm->buff, i, 16)*TWO_N29; i += 16; - eph.e = getbitu(rtcm->buff, i, 32)*TWO_N33; i += 32; - eph.cus = getbits(rtcm->buff, i, 16)*TWO_N29; i += 16; - sqrtA = getbitu(rtcm->buff, i, 32)*TWO_N19; i += 32; - eph.toes = getbitu(rtcm->buff, i, 14)*60.0; i += 14; - eph.cic = getbits(rtcm->buff, i, 16)*TWO_N29; i += 16; - eph.OMG0 = getbits(rtcm->buff, i, 32)*TWO_N31*SC2RAD; i += 32; - eph.cis = getbits(rtcm->buff, i, 16)*TWO_N29; i += 16; - eph.i0 = getbits(rtcm->buff, i, 32)*TWO_N31*SC2RAD; i += 32; - eph.crc = getbits(rtcm->buff, i, 16)*TWO_N5; i += 16; - eph.omg = getbits(rtcm->buff, i, 32)*TWO_N31*SC2RAD; i += 32; - eph.OMGd = getbits(rtcm->buff, i, 24)*TWO_N43*SC2RAD; i += 24; - eph.tgd[0] = getbits(rtcm->buff, i, 10)*TWO_N32; i += 10; /* E5a/E1 */ - e5a_hs = getbitu(rtcm->buff, i, 2); i += 2; /* OSHS */ - e5a_dvs = getbitu(rtcm->buff, i, 1); i += 1; /* OSDVS */ + prn = getbitu(rtcm->buff, i, 6); + i += 6; + week = getbitu(rtcm->buff, i, 12); + i += 12; /* gst-week */ + eph.iode = getbitu(rtcm->buff, i, 10); + i += 10; + eph.sva = getbitu(rtcm->buff, i, 8); + i += 8; + eph.idot = getbits(rtcm->buff, i, 14) * TWO_N43 * SC2RAD; + i += 14; + toc = getbitu(rtcm->buff, i, 14) * 60.0; + i += 14; + eph.f2 = getbits(rtcm->buff, i, 6) * TWO_N59; + i += 6; + eph.f1 = getbits(rtcm->buff, i, 21) * TWO_N46; + i += 21; + eph.f0 = getbits(rtcm->buff, i, 31) * TWO_N34; + i += 31; + eph.crs = getbits(rtcm->buff, i, 16) * TWO_N5; + i += 16; + eph.deln = getbits(rtcm->buff, i, 16) * TWO_N43 * SC2RAD; + i += 16; + eph.M0 = getbits(rtcm->buff, i, 32) * TWO_N31 * SC2RAD; + i += 32; + eph.cuc = getbits(rtcm->buff, i, 16) * TWO_N29; + i += 16; + eph.e = getbitu(rtcm->buff, i, 32) * TWO_N33; + i += 32; + eph.cus = getbits(rtcm->buff, i, 16) * TWO_N29; + i += 16; + sqrtA = getbitu(rtcm->buff, i, 32) * TWO_N19; + i += 32; + eph.toes = getbitu(rtcm->buff, i, 14) * 60.0; + i += 14; + eph.cic = getbits(rtcm->buff, i, 16) * TWO_N29; + i += 16; + eph.OMG0 = getbits(rtcm->buff, i, 32) * TWO_N31 * SC2RAD; + i += 32; + eph.cis = getbits(rtcm->buff, i, 16) * TWO_N29; + i += 16; + eph.i0 = getbits(rtcm->buff, i, 32) * TWO_N31 * SC2RAD; + i += 32; + eph.crc = getbits(rtcm->buff, i, 16) * TWO_N5; + i += 16; + eph.omg = getbits(rtcm->buff, i, 32) * TWO_N31 * SC2RAD; + i += 32; + eph.OMGd = getbits(rtcm->buff, i, 24) * TWO_N43 * SC2RAD; + i += 24; + eph.tgd[0] = getbits(rtcm->buff, i, 10) * TWO_N32; + i += 10; /* E5a/E1 */ + e5a_hs = getbitu(rtcm->buff, i, 2); + i += 2; /* OSHS */ + e5a_dvs = getbitu(rtcm->buff, i, 1); + i += 1; /* OSDVS */ //rsv = getbitu(rtcm->buff, i, 7); } else @@ -1354,9 +1574,9 @@ int decode_type1046(rtcm_t *rtcm) if (rtcm->outtype) { - msg = rtcm->msgtype+strlen(rtcm->msgtype); + msg = rtcm->msgtype + strlen(rtcm->msgtype); sprintf(msg, " prn=%2d iode=%3d week=%d toe=%6.0f toc=%6.0f hs=%d dvs=%d", - prn, eph.iode, week, eph.toes, toc, e5a_hs, e5a_dvs); + prn, eph.iode, week, eph.toes, toc, e5a_hs, e5a_dvs); } if (!(sat = satno(sys, prn))) { @@ -1364,18 +1584,18 @@ int decode_type1046(rtcm_t *rtcm) return -1; } eph.sat = sat; - eph.week = week+1024; /* gal-week = gst-week + 1024 */ + eph.week = week + 1024; /* gal-week = gst-week + 1024 */ eph.toe = gpst2time(eph.week, eph.toes); eph.toc = gpst2time(eph.week, toc); eph.ttr = rtcm->time; - eph.A = sqrtA*sqrtA; - eph.svh = (e5a_hs<<4)+(e5a_dvs<<3); + eph.A = sqrtA * sqrtA; + eph.svh = (e5a_hs << 4) + (e5a_dvs << 3); eph.code = 2; /* data source = f/nav e5a */ if (!strstr(rtcm->opt, "-EPHALL")) { - if (eph.iode == rtcm->nav.eph[sat-1].iode) return 0; /* unchanged */ + if (eph.iode == rtcm->nav.eph[sat - 1].iode) return 0; /* unchanged */ } - rtcm->nav.eph[sat-1] = eph; + rtcm->nav.eph[sat - 1] = eph; rtcm->ephsat = sat; return 2; } @@ -1384,45 +1604,75 @@ int decode_type1046(rtcm_t *rtcm) /* decode type 1047: beidou ephemerides (tentative mt and format) ------------*/ int decode_type1047(rtcm_t *rtcm) { - 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};; + 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}; + ; double toc, sqrtA; char *msg; - int i = 24+12, prn, sat, week, sys = SYS_BDS; + int i = 24 + 12, prn, sat, week, sys = SYS_BDS; - if (i+476 <= rtcm->len*8) + if (i + 476 <= rtcm->len * 8) { - prn = getbitu(rtcm->buff, i, 6); i += 6; - week = getbitu(rtcm->buff, i, 10); i += 10; - eph.sva = getbitu(rtcm->buff, i, 4); i += 4; - eph.code = getbitu(rtcm->buff, i, 2); i += 2; - eph.idot = getbits(rtcm->buff, i, 14)*TWO_N43*SC2RAD; i += 14; - eph.iode = getbitu(rtcm->buff, i, 8); i += 8; - toc = getbitu(rtcm->buff, i, 16)*16.0; i += 16; - eph.f2 = getbits(rtcm->buff, i, 8)*TWO_N55; i += 8; - eph.f1 = getbits(rtcm->buff, i, 16)*TWO_N43; i += 16; - eph.f0 = getbits(rtcm->buff, i, 22)*TWO_N31; i += 22; - eph.iodc = getbitu(rtcm->buff, i, 10); i += 10; - eph.crs = getbits(rtcm->buff, i, 16)*TWO_N5; i += 16; - eph.deln = getbits(rtcm->buff, i, 16)*TWO_N43*SC2RAD; i += 16; - eph.M0 = getbits(rtcm->buff, i, 32)*TWO_N31*SC2RAD; i += 32; - eph.cuc = getbits(rtcm->buff, i, 16)*TWO_N29; i += 16; - eph.e = getbitu(rtcm->buff, i, 32)*TWO_N33; i += 32; - eph.cus = getbits(rtcm->buff, i, 16)*TWO_N29; i += 16; - sqrtA = getbitu(rtcm->buff, i, 32)*TWO_N19; i += 32; - eph.toes = getbitu(rtcm->buff, i, 16)*16.0; i += 16; - eph.cic = getbits(rtcm->buff, i, 16)*TWO_N29; i += 16; - eph.OMG0 = getbits(rtcm->buff, i, 32)*TWO_N31*SC2RAD; i += 32; - eph.cis = getbits(rtcm->buff, i, 16)*TWO_N29; i += 16; - eph.i0 = getbits(rtcm->buff, i, 32)*TWO_N31*SC2RAD; i += 32; - eph.crc = getbits(rtcm->buff, i, 16)*TWO_N5; i += 16; - eph.omg = getbits(rtcm->buff, i, 32)*TWO_N31*SC2RAD; i += 32; - eph.OMGd = getbits(rtcm->buff, i, 24)*TWO_N43*SC2RAD; i += 24; - eph.tgd[0] = getbits(rtcm->buff, i, 8)*TWO_N31; i += 8; - eph.svh = getbitu(rtcm->buff, i, 6); i += 6; - eph.flag = getbitu(rtcm->buff, i, 1); i += 1; - eph.fit = getbitu(rtcm->buff, i, 1) ? 0.0:4.0; /* 0:4hr, 1:>4hr */ + prn = getbitu(rtcm->buff, i, 6); + i += 6; + week = getbitu(rtcm->buff, i, 10); + i += 10; + eph.sva = getbitu(rtcm->buff, i, 4); + i += 4; + eph.code = getbitu(rtcm->buff, i, 2); + i += 2; + eph.idot = getbits(rtcm->buff, i, 14) * TWO_N43 * SC2RAD; + i += 14; + eph.iode = getbitu(rtcm->buff, i, 8); + i += 8; + toc = getbitu(rtcm->buff, i, 16) * 16.0; + i += 16; + eph.f2 = getbits(rtcm->buff, i, 8) * TWO_N55; + i += 8; + eph.f1 = getbits(rtcm->buff, i, 16) * TWO_N43; + i += 16; + eph.f0 = getbits(rtcm->buff, i, 22) * TWO_N31; + i += 22; + eph.iodc = getbitu(rtcm->buff, i, 10); + i += 10; + eph.crs = getbits(rtcm->buff, i, 16) * TWO_N5; + i += 16; + eph.deln = getbits(rtcm->buff, i, 16) * TWO_N43 * SC2RAD; + i += 16; + eph.M0 = getbits(rtcm->buff, i, 32) * TWO_N31 * SC2RAD; + i += 32; + eph.cuc = getbits(rtcm->buff, i, 16) * TWO_N29; + i += 16; + eph.e = getbitu(rtcm->buff, i, 32) * TWO_N33; + i += 32; + eph.cus = getbits(rtcm->buff, i, 16) * TWO_N29; + i += 16; + sqrtA = getbitu(rtcm->buff, i, 32) * TWO_N19; + i += 32; + eph.toes = getbitu(rtcm->buff, i, 16) * 16.0; + i += 16; + eph.cic = getbits(rtcm->buff, i, 16) * TWO_N29; + i += 16; + eph.OMG0 = getbits(rtcm->buff, i, 32) * TWO_N31 * SC2RAD; + i += 32; + eph.cis = getbits(rtcm->buff, i, 16) * TWO_N29; + i += 16; + eph.i0 = getbits(rtcm->buff, i, 32) * TWO_N31 * SC2RAD; + i += 32; + eph.crc = getbits(rtcm->buff, i, 16) * TWO_N5; + i += 16; + eph.omg = getbits(rtcm->buff, i, 32) * TWO_N31 * SC2RAD; + i += 32; + eph.OMGd = getbits(rtcm->buff, i, 24) * TWO_N43 * SC2RAD; + i += 24; + eph.tgd[0] = getbits(rtcm->buff, i, 8) * TWO_N31; + i += 8; + eph.svh = getbitu(rtcm->buff, i, 6); + i += 6; + eph.flag = getbitu(rtcm->buff, i, 1); + i += 1; + eph.fit = getbitu(rtcm->buff, i, 1) ? 0.0 : 4.0; /* 0:4hr, 1:>4hr */ } else { @@ -1433,9 +1683,9 @@ int decode_type1047(rtcm_t *rtcm) if (rtcm->outtype) { - msg = rtcm->msgtype+strlen(rtcm->msgtype); + msg = rtcm->msgtype + strlen(rtcm->msgtype); sprintf(msg, " prn=%2d iode=%3d iodc=%3d week=%d toe=%6.0f toc=%6.0f svh=%02X", - prn, eph.iode, eph.iodc, week, eph.toes, toc, eph.svh); + prn, eph.iode, eph.iodc, week, eph.toes, toc, eph.svh); } if (!(sat = satno(sys, prn))) { @@ -1447,15 +1697,15 @@ int decode_type1047(rtcm_t *rtcm) eph.toe = bdt2gpst(bdt2time(eph.week, eph.toes)); /* bdt -> gpst */ eph.toc = bdt2gpst(bdt2time(eph.week, toc)); /* bdt -> gpst */ eph.ttr = rtcm->time; - eph.A = sqrtA*sqrtA; + eph.A = sqrtA * sqrtA; if (!strstr(rtcm->opt, "-EPHALL")) { - if (timediff(eph.toe, rtcm->nav.eph[sat-1].toe) == 0.0 && - eph.iode == rtcm->nav.eph[sat-1].iode && - eph.iodc == rtcm->nav.eph[sat-1].iodc) return 0; /* unchanged */ + if (timediff(eph.toe, rtcm->nav.eph[sat - 1].toe) == 0.0 && + eph.iode == rtcm->nav.eph[sat - 1].iode && + eph.iodc == rtcm->nav.eph[sat - 1].iodc) return 0; /* unchanged */ } - rtcm->nav.eph[sat-1] = eph; + rtcm->nav.eph[sat - 1] = eph; rtcm->ephsat = sat; return 2; } @@ -1464,43 +1714,71 @@ int decode_type1047(rtcm_t *rtcm) /* decode type 63: beidou ephemerides (rtcm draft) ---------------------------*/ 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}, - 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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 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}; double toc, sqrtA; char *msg; - int i = 24+12, prn, sat, week, sys = SYS_BDS; + int i = 24 + 12, prn, sat, week, sys = SYS_BDS; - if (i+499 <= rtcm->len*8) + if (i + 499 <= rtcm->len * 8) { - prn = getbitu(rtcm->buff, i, 6); i += 6; - week = getbitu(rtcm->buff, i, 13); i += 13; - eph.sva = getbitu(rtcm->buff, i, 4); i += 4; - eph.idot = getbits(rtcm->buff, i, 14)*TWO_N43*SC2RAD; i += 14; - eph.iode = getbitu(rtcm->buff, i, 5); i += 5; /* AODE */ - toc = getbitu(rtcm->buff, i, 17)*8.0; i += 17; - eph.f2 = getbits(rtcm->buff, i, 11)*TWO_N55; i += 11; - eph.f1 = getbits(rtcm->buff, i, 22)*TWO_N50; i += 22; - eph.f0 = getbits(rtcm->buff, i, 24)*TWO_N33; i += 24; - eph.iodc = getbitu(rtcm->buff, i, 5); i += 5; /* AODC */ - eph.crs = getbits(rtcm->buff, i, 18)*TWO_N6; i += 18; - eph.deln = getbits(rtcm->buff, i, 16)*TWO_N43*SC2RAD; i += 16; - eph.M0 = getbits(rtcm->buff, i, 32)*TWO_N31*SC2RAD; i += 32; - eph.cuc = getbits(rtcm->buff, i, 18)*TWO_N31; i += 18; - eph.e = getbitu(rtcm->buff, i, 32)*TWO_N33; i += 32; - eph.cus = getbits(rtcm->buff, i, 18)*TWO_N31; i += 18; - sqrtA = getbitu(rtcm->buff, i, 32)*TWO_N19; i += 32; - eph.toes = getbitu(rtcm->buff, i, 17)*8.0; i += 17; - eph.cic = getbits(rtcm->buff, i, 18)*TWO_N31; i += 18; - eph.OMG0 = getbits(rtcm->buff, i, 32)*TWO_N31*SC2RAD; i += 32; - eph.cis = getbits(rtcm->buff, i, 18)*TWO_N31; i += 18; - eph.i0 = getbits(rtcm->buff, i, 32)*TWO_N31*SC2RAD; i += 32; - eph.crc = getbits(rtcm->buff, i, 18)*TWO_N6; i += 18; - eph.omg = getbits(rtcm->buff, i, 32)*TWO_N31*SC2RAD; i += 32; - eph.OMGd = getbits(rtcm->buff, i, 24)*TWO_N43*SC2RAD; i += 24; - eph.tgd[0] = getbits(rtcm->buff, i, 10)*1E-10; i += 10; - eph.tgd[1] = getbits(rtcm->buff, i, 10)*1E-10; i += 10; - eph.svh = getbitu(rtcm->buff, i, 1); i += 1; + prn = getbitu(rtcm->buff, i, 6); + i += 6; + week = getbitu(rtcm->buff, i, 13); + i += 13; + eph.sva = getbitu(rtcm->buff, i, 4); + i += 4; + eph.idot = getbits(rtcm->buff, i, 14) * TWO_N43 * SC2RAD; + i += 14; + eph.iode = getbitu(rtcm->buff, i, 5); + i += 5; /* AODE */ + toc = getbitu(rtcm->buff, i, 17) * 8.0; + i += 17; + eph.f2 = getbits(rtcm->buff, i, 11) * TWO_N55; + i += 11; + eph.f1 = getbits(rtcm->buff, i, 22) * TWO_N50; + i += 22; + eph.f0 = getbits(rtcm->buff, i, 24) * TWO_N33; + i += 24; + eph.iodc = getbitu(rtcm->buff, i, 5); + i += 5; /* AODC */ + eph.crs = getbits(rtcm->buff, i, 18) * TWO_N6; + i += 18; + eph.deln = getbits(rtcm->buff, i, 16) * TWO_N43 * SC2RAD; + i += 16; + eph.M0 = getbits(rtcm->buff, i, 32) * TWO_N31 * SC2RAD; + i += 32; + eph.cuc = getbits(rtcm->buff, i, 18) * TWO_N31; + i += 18; + eph.e = getbitu(rtcm->buff, i, 32) * TWO_N33; + i += 32; + eph.cus = getbits(rtcm->buff, i, 18) * TWO_N31; + i += 18; + sqrtA = getbitu(rtcm->buff, i, 32) * TWO_N19; + i += 32; + eph.toes = getbitu(rtcm->buff, i, 17) * 8.0; + i += 17; + eph.cic = getbits(rtcm->buff, i, 18) * TWO_N31; + i += 18; + eph.OMG0 = getbits(rtcm->buff, i, 32) * TWO_N31 * SC2RAD; + i += 32; + eph.cis = getbits(rtcm->buff, i, 18) * TWO_N31; + i += 18; + eph.i0 = getbits(rtcm->buff, i, 32) * TWO_N31 * SC2RAD; + i += 32; + eph.crc = getbits(rtcm->buff, i, 18) * TWO_N6; + i += 18; + eph.omg = getbits(rtcm->buff, i, 32) * TWO_N31 * SC2RAD; + i += 32; + eph.OMGd = getbits(rtcm->buff, i, 24) * TWO_N43 * SC2RAD; + i += 24; + eph.tgd[0] = getbits(rtcm->buff, i, 10) * 1E-10; + i += 10; + eph.tgd[1] = getbits(rtcm->buff, i, 10) * 1E-10; + i += 10; + eph.svh = getbitu(rtcm->buff, i, 1); + i += 1; } else { @@ -1511,9 +1789,9 @@ int decode_type63(rtcm_t *rtcm) if (rtcm->outtype) { - msg = rtcm->msgtype+strlen(rtcm->msgtype); + msg = rtcm->msgtype + strlen(rtcm->msgtype); sprintf(msg, " prn=%2d iode=%3d iodc=%3d week=%d toe=%6.0f toc=%6.0f svh=%02X", - prn, eph.iode, eph.iodc, week, eph.toes, toc, eph.svh); + prn, eph.iode, eph.iodc, week, eph.toes, toc, eph.svh); } if (!(sat = satno(sys, prn))) { @@ -1525,14 +1803,14 @@ int decode_type63(rtcm_t *rtcm) eph.toe = bdt2gpst(bdt2time(eph.week, eph.toes)); /* bdt -> gpst */ eph.toc = bdt2gpst(bdt2time(eph.week, toc)); /* bdt -> gpst */ eph.ttr = rtcm->time; - eph.A = sqrtA*sqrtA; + eph.A = sqrtA * sqrtA; if (!strstr(rtcm->opt, "-EPHALL")) { - if (timediff(eph.toe, rtcm->nav.eph[sat-1].toe) == 0.0 && - eph.iode == rtcm->nav.eph[sat-1].iode && - eph.iodc == rtcm->nav.eph[sat-1].iodc) return 0; /* unchanged */ + if (timediff(eph.toe, rtcm->nav.eph[sat - 1].toe) == 0.0 && + eph.iode == rtcm->nav.eph[sat - 1].iode && + eph.iodc == rtcm->nav.eph[sat - 1].iodc) return 0; /* unchanged */ } - rtcm->nav.eph[sat-1] = eph; + rtcm->nav.eph[sat - 1] = eph; rtcm->ephsat = sat; return 2; } @@ -1540,44 +1818,53 @@ int decode_type63(rtcm_t *rtcm) /* decode ssr 1, 4 message header ---------------------------------------------*/ 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; char *msg; - int i = 24+12, nsat, udi, provid = 0, solid = 0, ns = 6; + int i = 24 + 12, nsat, udi, provid = 0, solid = 0, ns = 6; #ifndef SSR_QZSS_DRAFT_V05 - ns = sys == SYS_QZS ? 4:6; + ns = sys == SYS_QZS ? 4 : 6; #endif - if (i+(sys == SYS_GLO ? 53:50+ns)>rtcm->len*8) return -1; + if (i + (sys == SYS_GLO ? 53 : 50 + ns) > rtcm->len * 8) return -1; if (sys == SYS_GLO) { - tod = getbitu(rtcm->buff, i, 17); i += 17; + tod = getbitu(rtcm->buff, i, 17); + i += 17; adjday_glot(rtcm, tod); } else { - tow = getbitu(rtcm->buff, i, 20); i += 20; + tow = getbitu(rtcm->buff, i, 20); + i += 20; adjweek(rtcm, tow); } - udi = getbitu(rtcm->buff, i, 4); i += 4; - *sync = getbitu(rtcm->buff, i, 1); i += 1; - *refd = getbitu(rtcm->buff, i, 1); i += 1; /* satellite ref datum */ - *iod = getbitu(rtcm->buff, i, 4); i += 4; /* iod */ - provid = getbitu(rtcm->buff, i, 16); i += 16; /* provider id */ - solid = getbitu(rtcm->buff, i, 4); i += 4; /* solution id */ - nsat = getbitu(rtcm->buff, i, ns); i += ns; + udi = getbitu(rtcm->buff, i, 4); + i += 4; + *sync = getbitu(rtcm->buff, i, 1); + i += 1; + *refd = getbitu(rtcm->buff, i, 1); + i += 1; /* satellite ref datum */ + *iod = getbitu(rtcm->buff, i, 4); + i += 4; /* iod */ + provid = getbitu(rtcm->buff, i, 16); + i += 16; /* provider id */ + solid = getbitu(rtcm->buff, i, 4); + i += 4; /* solution id */ + nsat = getbitu(rtcm->buff, i, ns); + i += ns; *udint = ssrudint[udi]; trace(4, "decode_ssr1_head: time=%s sys=%d nsat=%d sync=%d iod=%d provid=%d solid=%d\n", - time_str(rtcm->time, 2), sys, nsat, *sync, *iod, provid, solid); + time_str(rtcm->time, 2), sys, nsat, *sync, *iod, provid, solid); if (rtcm->outtype) { - msg = rtcm->msgtype+strlen(rtcm->msgtype); + msg = rtcm->msgtype + strlen(rtcm->msgtype); sprintf(msg, " %s nsat=%2d iod=%2d udi=%2d sync=%d", - time_str(rtcm->time, 2), nsat, *iod, udi, *sync); + time_str(rtcm->time, 2), nsat, *iod, udi, *sync); } *hsize = i; return nsat; @@ -1586,43 +1873,51 @@ int decode_ssr1_head(rtcm_t *rtcm, int sys, int *sync, int *iod, /* decode ssr 2, 3, 5, 6 message header -----------------------------------------*/ int decode_ssr2_head(rtcm_t *rtcm, int sys, int *sync, int *iod, - double *udint, int *hsize) + double *udint, int *hsize) { double tod, tow; char *msg; - int i = 24+12, nsat, udi, provid = 0, solid = 0, ns = 6; + int i = 24 + 12, nsat, udi, provid = 0, solid = 0, ns = 6; #ifndef SSR_QZSS_DRAFT_V05 - ns = sys == SYS_QZS ? 4:6; + ns = sys == SYS_QZS ? 4 : 6; #endif - if (i+(sys == SYS_GLO ? 52:49+ns)>rtcm->len*8) return -1; + if (i + (sys == SYS_GLO ? 52 : 49 + ns) > rtcm->len * 8) return -1; if (sys == SYS_GLO) { - tod = getbitu(rtcm->buff, i, 17); i += 17; + tod = getbitu(rtcm->buff, i, 17); + i += 17; adjday_glot(rtcm, tod); } else { - tow = getbitu(rtcm->buff, i, 20); i += 20; + tow = getbitu(rtcm->buff, i, 20); + i += 20; adjweek(rtcm, tow); } - udi = getbitu(rtcm->buff, i, 4); i += 4; - *sync = getbitu(rtcm->buff, i, 1); i += 1; - *iod = getbitu(rtcm->buff, i, 4); i += 4; - provid = getbitu(rtcm->buff, i, 16); i += 16; /* provider id */ - solid = getbitu(rtcm->buff, i, 4); i += 4; /* solution id */ - nsat = getbitu(rtcm->buff, i, ns); i += ns; + udi = getbitu(rtcm->buff, i, 4); + i += 4; + *sync = getbitu(rtcm->buff, i, 1); + i += 1; + *iod = getbitu(rtcm->buff, i, 4); + i += 4; + provid = getbitu(rtcm->buff, i, 16); + i += 16; /* provider id */ + solid = getbitu(rtcm->buff, i, 4); + i += 4; /* solution id */ + nsat = getbitu(rtcm->buff, i, ns); + i += ns; *udint = ssrudint[udi]; trace(4, "decode_ssr2_head: time=%s sys=%d nsat=%d sync=%d iod=%d provid=%d solid=%d\n", - time_str(rtcm->time, 2), sys, nsat, *sync, *iod, provid, solid); + time_str(rtcm->time, 2), sys, nsat, *sync, *iod, provid, solid); if (rtcm->outtype) { - msg = rtcm->msgtype+strlen(rtcm->msgtype); + msg = rtcm->msgtype + strlen(rtcm->msgtype); sprintf(msg, " %s nsat=%2d iod=%2d udi=%2d sync=%d", - time_str(rtcm->time, 2), nsat, *iod, udi, *sync); + time_str(rtcm->time, 2), nsat, *iod, udi, *sync); } *hsize = i; return nsat; @@ -1631,53 +1926,61 @@ int decode_ssr2_head(rtcm_t *rtcm, int sys, int *sync, int *iod, /* decode ssr 7 message header -----------------------------------------------*/ 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; char *msg; - int i = 24+12, nsat, udi, provid = 0, solid = 0, ns = 6; + int i = 24 + 12, nsat, udi, provid = 0, solid = 0, ns = 6; #ifndef SSR_QZSS_DRAFT_V05 - ns = sys == SYS_QZS ? 4:6; + ns = sys == SYS_QZS ? 4 : 6; #endif - if (i+(sys == SYS_GLO ? 54:51+ns)>rtcm->len*8) return -1; + if (i + (sys == SYS_GLO ? 54 : 51 + ns) > rtcm->len * 8) return -1; if (sys == SYS_GLO) { - tod = getbitu(rtcm->buff, i, 17); i += 17; + tod = getbitu(rtcm->buff, i, 17); + i += 17; adjday_glot(rtcm, tod); } else { - tow = getbitu(rtcm->buff, i, 20); i += 20; + tow = getbitu(rtcm->buff, i, 20); + i += 20; adjweek(rtcm, tow); } - udi = getbitu(rtcm->buff, i, 4); i += 4; - *sync = getbitu(rtcm->buff, i, 1); i += 1; - *iod = getbitu(rtcm->buff, i, 4); i += 4; - provid = getbitu(rtcm->buff, i, 16); i += 16; /* provider id */ - solid = getbitu(rtcm->buff, i, 4); i += 4; /* solution id */ - *dispe = getbitu(rtcm->buff, i, 1); i += 1; /* dispersive bias consistency ind */ - *mw = getbitu(rtcm->buff, i, 1); i += 1; /* MW consistency indicator */ - nsat = getbitu(rtcm->buff, i, ns); i += ns; + udi = getbitu(rtcm->buff, i, 4); + i += 4; + *sync = getbitu(rtcm->buff, i, 1); + i += 1; + *iod = getbitu(rtcm->buff, i, 4); + i += 4; + provid = getbitu(rtcm->buff, i, 16); + i += 16; /* provider id */ + solid = getbitu(rtcm->buff, i, 4); + i += 4; /* solution id */ + *dispe = getbitu(rtcm->buff, i, 1); + i += 1; /* dispersive bias consistency ind */ + *mw = getbitu(rtcm->buff, i, 1); + i += 1; /* MW consistency indicator */ + nsat = getbitu(rtcm->buff, i, ns); + i += ns; *udint = ssrudint[udi]; trace(4, "decode_ssr7_head: time=%s sys=%d nsat=%d sync=%d iod=%d provid=%d solid=%d\n", - time_str(rtcm->time, 2), sys, nsat, *sync, *iod, provid, solid); + time_str(rtcm->time, 2), sys, nsat, *sync, *iod, provid, solid); if (rtcm->outtype) { - msg = rtcm->msgtype+strlen(rtcm->msgtype); + msg = rtcm->msgtype + strlen(rtcm->msgtype); sprintf(msg, " %s nsat=%2d iod=%2d udi=%2d sync=%d", - time_str(rtcm->time, 2), nsat, *iod, udi, *sync); + time_str(rtcm->time, 2), nsat, *iod, udi, *sync); } *hsize = i; return nsat; } - - /* decode ssr 1: orbit corrections -------------------------------------------*/ int decode_ssr1(rtcm_t *rtcm, int sys) { @@ -1692,47 +1995,87 @@ int decode_ssr1(rtcm_t *rtcm, int sys) return -1; } switch (sys) - { - case SYS_GPS: np = 6; ni = 8; nj = 0; offp = 0; break; - case SYS_GLO: np = 5; ni = 8; nj = 0; offp = 0; break; - case SYS_GAL: np = 6; ni = 10; nj = 0; offp = 0; break; - case SYS_QZS: np = 4; ni = 8; nj = 0; offp = 192; break; - case SYS_BDS: np = 6; ni = 10; nj = 24; offp = 1; break; - case SYS_SBS: np = 6; ni = 9; nj = 24; offp = 120; break; - default: return sync ? 0:10; - } - for (j = 0; j < nsat && i+121+np+ni+nj <= rtcm->len*8; j++) { - prn = getbitu(rtcm->buff, i, np)+offp; i += np; - iode = getbitu(rtcm->buff, i, ni); i += ni; - iodcrc = getbitu(rtcm->buff, i, nj); i += nj; - deph [0] = getbits(rtcm->buff, i, 22)*1E-4; i += 22; - deph [1] = getbits(rtcm->buff, i, 20)*4E-4; i += 20; - deph [2] = getbits(rtcm->buff, i, 20)*4E-4; i += 20; - ddeph[0] = getbits(rtcm->buff, i, 21)*1E-6; i += 21; - ddeph[1] = getbits(rtcm->buff, i, 19)*4E-6; i += 19; - ddeph[2] = getbits(rtcm->buff, i, 19)*4E-6; i += 19; + case SYS_GPS: + np = 6; + ni = 8; + nj = 0; + offp = 0; + break; + case SYS_GLO: + np = 5; + ni = 8; + nj = 0; + offp = 0; + break; + case SYS_GAL: + np = 6; + ni = 10; + nj = 0; + offp = 0; + break; + case SYS_QZS: + np = 4; + ni = 8; + nj = 0; + offp = 192; + break; + case SYS_BDS: + np = 6; + ni = 10; + nj = 24; + offp = 1; + break; + case SYS_SBS: + np = 6; + ni = 9; + nj = 24; + offp = 120; + break; + default: + return sync ? 0 : 10; + } + for (j = 0; j < nsat && i + 121 + np + ni + nj <= rtcm->len * 8; j++) + { + prn = getbitu(rtcm->buff, i, np) + offp; + i += np; + iode = getbitu(rtcm->buff, i, ni); + i += ni; + iodcrc = getbitu(rtcm->buff, i, nj); + i += nj; + deph[0] = getbits(rtcm->buff, i, 22) * 1E-4; + i += 22; + deph[1] = getbits(rtcm->buff, i, 20) * 4E-4; + i += 20; + deph[2] = getbits(rtcm->buff, i, 20) * 4E-4; + i += 20; + ddeph[0] = getbits(rtcm->buff, i, 21) * 1E-6; + i += 21; + ddeph[1] = getbits(rtcm->buff, i, 19) * 4E-6; + i += 19; + ddeph[2] = getbits(rtcm->buff, i, 19) * 4E-6; + i += 19; if (!(sat = satno(sys, prn))) { trace(2, "rtcm3 %d satellite number error: prn=%d\n", type, prn); continue; } - rtcm->ssr[sat-1].t0 [0] = rtcm->time; - rtcm->ssr[sat-1].udi[0] = udint; - rtcm->ssr[sat-1].iod[0] = iod; - rtcm->ssr[sat-1].iode = iode; /* sbas/bds: toe/t0 modulo */ - rtcm->ssr[sat-1].iodcrc = iodcrc; /* sbas/bds: iod crc */ - rtcm->ssr[sat-1].refd = refd; + rtcm->ssr[sat - 1].t0[0] = rtcm->time; + rtcm->ssr[sat - 1].udi[0] = udint; + rtcm->ssr[sat - 1].iod[0] = iod; + rtcm->ssr[sat - 1].iode = iode; /* sbas/bds: toe/t0 modulo */ + rtcm->ssr[sat - 1].iodcrc = iodcrc; /* sbas/bds: iod crc */ + rtcm->ssr[sat - 1].refd = refd; for (k = 0; k < 3; k++) { - rtcm->ssr[sat-1].deph [k] = deph [k]; - rtcm->ssr[sat-1].ddeph[k] = ddeph[k]; + rtcm->ssr[sat - 1].deph[k] = deph[k]; + rtcm->ssr[sat - 1].ddeph[k] = ddeph[k]; } - rtcm->ssr[sat-1].update = 1; + rtcm->ssr[sat - 1].update = 1; } - return sync ? 0:10; + return sync ? 0 : 10; } @@ -1750,38 +2093,61 @@ int decode_ssr2(rtcm_t *rtcm, int sys) return -1; } switch (sys) - { - case SYS_GPS: np = 6; offp = 0; break; - case SYS_GLO: np = 5; offp = 0; break; - case SYS_GAL: np = 6; offp = 0; break; - case SYS_QZS: np = 4; offp = 192; break; - case SYS_BDS: np = 6; offp = 1; break; - case SYS_SBS: np = 6; offp = 120; break; - default: return sync ? 0:10; - } - for (j = 0; j < nsat && i+70+np <= rtcm->len*8; j++) { - prn = getbitu(rtcm->buff, i, np)+offp; i += np; - dclk[0] = getbits(rtcm->buff, i, 22)*1E-4; i += 22; - dclk[1] = getbits(rtcm->buff, i, 21)*1E-6; i += 21; - dclk[2] = getbits(rtcm->buff, i, 27)*2E-8; i += 27; + case SYS_GPS: + np = 6; + offp = 0; + break; + case SYS_GLO: + np = 5; + offp = 0; + break; + case SYS_GAL: + np = 6; + offp = 0; + break; + case SYS_QZS: + np = 4; + offp = 192; + break; + case SYS_BDS: + np = 6; + offp = 1; + break; + case SYS_SBS: + np = 6; + offp = 120; + break; + default: + return sync ? 0 : 10; + } + for (j = 0; j < nsat && i + 70 + np <= rtcm->len * 8; j++) + { + prn = getbitu(rtcm->buff, i, np) + offp; + i += np; + dclk[0] = getbits(rtcm->buff, i, 22) * 1E-4; + i += 22; + dclk[1] = getbits(rtcm->buff, i, 21) * 1E-6; + i += 21; + dclk[2] = getbits(rtcm->buff, i, 27) * 2E-8; + i += 27; if (!(sat = satno(sys, prn))) { trace(2, "rtcm3 %d satellite number error: prn=%d\n", type, prn); continue; } - rtcm->ssr[sat-1].t0 [1] = rtcm->time; - rtcm->ssr[sat-1].udi[1] = udint; - rtcm->ssr[sat-1].iod[1] = iod; + rtcm->ssr[sat - 1].t0[1] = rtcm->time; + rtcm->ssr[sat - 1].udi[1] = udint; + rtcm->ssr[sat - 1].iod[1] = iod; for (k = 0; k < 3; k++) { - rtcm->ssr[sat-1].dclk[k] = dclk[k]; + rtcm->ssr[sat - 1].dclk[k] = dclk[k]; } - rtcm->ssr[sat-1].update = 1; + rtcm->ssr[sat - 1].update = 1; } - return sync ? 0:10; + return sync ? 0 : 10; } @@ -1800,28 +2166,63 @@ int decode_ssr3(rtcm_t *rtcm, int sys) return -1; } switch (sys) - { - case SYS_GPS: np = 6; offp = 0; codes = codes_gps; ncode = 17; break; - case SYS_GLO: np = 5; offp = 0; codes = codes_glo; ncode = 4; break; - case SYS_GAL: np = 6; offp = 0; codes = codes_gal; ncode = 19; break; - case SYS_QZS: np = 4; offp = 192; codes = codes_qzs; ncode = 13; break; - case SYS_BDS: np = 6; offp = 1; codes = codes_bds; ncode = 9; break; - case SYS_SBS: np = 6; offp = 120; codes = codes_sbs; ncode = 4; break; - default: return sync ? 0:10; - } - for (j = 0; j < nsat && i+5+np <= rtcm->len*8; j++) { - prn = getbitu(rtcm->buff, i, np)+offp; i += np; - nbias = getbitu(rtcm->buff, i, 5); i += 5; + case SYS_GPS: + np = 6; + offp = 0; + codes = codes_gps; + ncode = 17; + break; + case SYS_GLO: + np = 5; + offp = 0; + codes = codes_glo; + ncode = 4; + break; + case SYS_GAL: + np = 6; + offp = 0; + codes = codes_gal; + ncode = 19; + break; + case SYS_QZS: + np = 4; + offp = 192; + codes = codes_qzs; + ncode = 13; + break; + case SYS_BDS: + np = 6; + offp = 1; + codes = codes_bds; + ncode = 9; + break; + case SYS_SBS: + np = 6; + offp = 120; + codes = codes_sbs; + ncode = 4; + break; + default: + return sync ? 0 : 10; + } + for (j = 0; j < nsat && i + 5 + np <= rtcm->len * 8; j++) + { + prn = getbitu(rtcm->buff, i, np) + offp; + i += np; + nbias = getbitu(rtcm->buff, i, 5); + i += 5; for (k = 0; k < MAXCODE; k++) cbias[k] = 0.0; - for (k = 0; k < nbias && i+19 <= rtcm->len*8; k++) + for (k = 0; k < nbias && i + 19 <= rtcm->len * 8; k++) { - mode = getbitu(rtcm->buff, i, 5); i += 5; - bias = getbits(rtcm->buff, i, 14)*0.01; i += 14; + mode = getbitu(rtcm->buff, i, 5); + i += 5; + bias = getbits(rtcm->buff, i, 14) * 0.01; + i += 14; if (mode <= ncode) { - cbias[codes[mode]-1] = (float)bias; + cbias[codes[mode] - 1] = (float)bias; } else { @@ -1833,17 +2234,17 @@ int decode_ssr3(rtcm_t *rtcm, int sys) trace(2, "rtcm3 %d satellite number error: prn=%d\n", type, prn); continue; } - rtcm->ssr[sat-1].t0 [4] = rtcm->time; - rtcm->ssr[sat-1].udi[4] = udint; - rtcm->ssr[sat-1].iod[4] = iod; + rtcm->ssr[sat - 1].t0[4] = rtcm->time; + rtcm->ssr[sat - 1].udi[4] = udint; + rtcm->ssr[sat - 1].iod[4] = iod; for (k = 0; k < MAXCODE; k++) { - rtcm->ssr[sat-1].cbias[k] = (float)cbias[k]; + rtcm->ssr[sat - 1].cbias[k] = (float)cbias[k]; } - rtcm->ssr[sat-1].update = 1; + rtcm->ssr[sat - 1].update = 1; } - return sync ? 0:10; + return sync ? 0 : 10; } @@ -1861,52 +2262,95 @@ int decode_ssr4(rtcm_t *rtcm, int sys) return -1; } switch (sys) - { - case SYS_GPS: np = 6; ni = 8; nj = 0; offp = 0; break; - case SYS_GLO: np = 5; ni = 8; nj = 0; offp = 0; break; - case SYS_GAL: np = 6; ni = 10; nj = 0; offp = 0; break; - case SYS_QZS: np = 4; ni = 8; nj = 0; offp = 192; break; - case SYS_BDS: np = 6; ni = 10; nj = 24; offp = 1; break; - case SYS_SBS: np = 6; ni = 9; nj = 24; offp = 120; break; - default: return sync ? 0:10; - } - for (j = 0; j < nsat && i+191+np+ni+nj <= rtcm->len*8; j++) { - prn = getbitu(rtcm->buff, i, np)+offp; i += np; - iode = getbitu(rtcm->buff, i, ni); i += ni; - iodcrc = getbitu(rtcm->buff, i, nj); i += nj; - deph [0] = getbits(rtcm->buff, i, 22)*1E-4; i += 22; - deph [1] = getbits(rtcm->buff, i, 20)*4E-4; i += 20; - deph [2] = getbits(rtcm->buff, i, 20)*4E-4; i += 20; - ddeph[0] = getbits(rtcm->buff, i, 21)*1E-6; i += 21; - ddeph[1] = getbits(rtcm->buff, i, 19)*4E-6; i += 19; - ddeph[2] = getbits(rtcm->buff, i, 19)*4E-6; i += 19; + case SYS_GPS: + np = 6; + ni = 8; + nj = 0; + offp = 0; + break; + case SYS_GLO: + np = 5; + ni = 8; + nj = 0; + offp = 0; + break; + case SYS_GAL: + np = 6; + ni = 10; + nj = 0; + offp = 0; + break; + case SYS_QZS: + np = 4; + ni = 8; + nj = 0; + offp = 192; + break; + case SYS_BDS: + np = 6; + ni = 10; + nj = 24; + offp = 1; + break; + case SYS_SBS: + np = 6; + ni = 9; + nj = 24; + offp = 120; + break; + default: + return sync ? 0 : 10; + } + for (j = 0; j < nsat && i + 191 + np + ni + nj <= rtcm->len * 8; j++) + { + prn = getbitu(rtcm->buff, i, np) + offp; + i += np; + iode = getbitu(rtcm->buff, i, ni); + i += ni; + iodcrc = getbitu(rtcm->buff, i, nj); + i += nj; + deph[0] = getbits(rtcm->buff, i, 22) * 1E-4; + i += 22; + deph[1] = getbits(rtcm->buff, i, 20) * 4E-4; + i += 20; + deph[2] = getbits(rtcm->buff, i, 20) * 4E-4; + i += 20; + ddeph[0] = getbits(rtcm->buff, i, 21) * 1E-6; + i += 21; + ddeph[1] = getbits(rtcm->buff, i, 19) * 4E-6; + i += 19; + ddeph[2] = getbits(rtcm->buff, i, 19) * 4E-6; + i += 19; - dclk [0] = getbits(rtcm->buff, i, 22)*1E-4; i += 22; - dclk [1] = getbits(rtcm->buff, i, 21)*1E-6; i += 21; - dclk [2] = getbits(rtcm->buff, i, 27)*2E-8; i += 27; + dclk[0] = getbits(rtcm->buff, i, 22) * 1E-4; + i += 22; + dclk[1] = getbits(rtcm->buff, i, 21) * 1E-6; + i += 21; + dclk[2] = getbits(rtcm->buff, i, 27) * 2E-8; + i += 27; if (!(sat = satno(sys, prn))) { trace(2, "rtcm3 %d satellite number error: prn=%d\n", type, prn); continue; } - rtcm->ssr[sat-1].t0 [0] = rtcm->ssr[sat-1].t0 [1] = rtcm->time; - rtcm->ssr[sat-1].udi[0] = rtcm->ssr[sat-1].udi[1] = udint; - rtcm->ssr[sat-1].iod[0] = rtcm->ssr[sat-1].iod[1] = iod; - rtcm->ssr[sat-1].iode = iode; - rtcm->ssr[sat-1].iodcrc = iodcrc; - rtcm->ssr[sat-1].refd = refd; + rtcm->ssr[sat - 1].t0[0] = rtcm->ssr[sat - 1].t0[1] = rtcm->time; + rtcm->ssr[sat - 1].udi[0] = rtcm->ssr[sat - 1].udi[1] = udint; + rtcm->ssr[sat - 1].iod[0] = rtcm->ssr[sat - 1].iod[1] = iod; + rtcm->ssr[sat - 1].iode = iode; + rtcm->ssr[sat - 1].iodcrc = iodcrc; + rtcm->ssr[sat - 1].refd = refd; for (k = 0; k < 3; k++) { - rtcm->ssr[sat-1].deph [k] = deph [k]; - rtcm->ssr[sat-1].ddeph[k] = ddeph[k]; - rtcm->ssr[sat-1].dclk [k] = dclk [k]; + rtcm->ssr[sat - 1].deph[k] = deph[k]; + rtcm->ssr[sat - 1].ddeph[k] = ddeph[k]; + rtcm->ssr[sat - 1].dclk[k] = dclk[k]; } - rtcm->ssr[sat-1].update = 1; + rtcm->ssr[sat - 1].update = 1; } - return sync ? 0:10; + return sync ? 0 : 10; } @@ -1924,32 +2368,53 @@ int decode_ssr5(rtcm_t *rtcm, int sys) return -1; } switch (sys) - { - case SYS_GPS: np = 6; offp = 0; break; - case SYS_GLO: np = 5; offp = 0; break; - case SYS_GAL: np = 6; offp = 0; break; - case SYS_QZS: np = 4; offp = 192; break; - case SYS_BDS: np = 6; offp = 1; break; - case SYS_SBS: np = 6; offp = 120; break; - default: return sync ? 0:10; - } - for (j = 0; j < nsat && i+6+np <= rtcm->len*8; j++) { - prn = getbitu(rtcm->buff, i, np)+offp; i += np; - ura = getbitu(rtcm->buff, i, 6); i += 6; + case SYS_GPS: + np = 6; + offp = 0; + break; + case SYS_GLO: + np = 5; + offp = 0; + break; + case SYS_GAL: + np = 6; + offp = 0; + break; + case SYS_QZS: + np = 4; + offp = 192; + break; + case SYS_BDS: + np = 6; + offp = 1; + break; + case SYS_SBS: + np = 6; + offp = 120; + break; + default: + return sync ? 0 : 10; + } + for (j = 0; j < nsat && i + 6 + np <= rtcm->len * 8; j++) + { + prn = getbitu(rtcm->buff, i, np) + offp; + i += np; + ura = getbitu(rtcm->buff, i, 6); + i += 6; if (!(sat = satno(sys, prn))) { trace(2, "rtcm3 %d satellite number error: prn=%d\n", type, prn); continue; } - rtcm->ssr[sat-1].t0 [3] = rtcm->time; - rtcm->ssr[sat-1].udi[3] = udint; - rtcm->ssr[sat-1].iod[3] = iod; - rtcm->ssr[sat-1].ura = ura; - rtcm->ssr[sat-1].update = 1; + rtcm->ssr[sat - 1].t0[3] = rtcm->time; + rtcm->ssr[sat - 1].udi[3] = udint; + rtcm->ssr[sat - 1].iod[3] = iod; + rtcm->ssr[sat - 1].ura = ura; + rtcm->ssr[sat - 1].update = 1; } - return sync ? 0:10; + return sync ? 0 : 10; } @@ -1967,32 +2432,53 @@ int decode_ssr6(rtcm_t *rtcm, int sys) return -1; } switch (sys) - { - case SYS_GPS: np = 6; offp = 0; break; - case SYS_GLO: np = 5; offp = 0; break; - case SYS_GAL: np = 6; offp = 0; break; - case SYS_QZS: np = 4; offp = 192; break; - case SYS_BDS: np = 6; offp = 1; break; - case SYS_SBS: np = 6; offp = 120; break; - default: return sync ? 0:10; - } - for (j = 0; j < nsat && i+22+np <= rtcm->len*8; j++) { - prn = getbitu(rtcm->buff, i, np)+offp; i += np; - hrclk = getbits(rtcm->buff, i, 22)*1E-4; i += 22; + case SYS_GPS: + np = 6; + offp = 0; + break; + case SYS_GLO: + np = 5; + offp = 0; + break; + case SYS_GAL: + np = 6; + offp = 0; + break; + case SYS_QZS: + np = 4; + offp = 192; + break; + case SYS_BDS: + np = 6; + offp = 1; + break; + case SYS_SBS: + np = 6; + offp = 120; + break; + default: + return sync ? 0 : 10; + } + for (j = 0; j < nsat && i + 22 + np <= rtcm->len * 8; j++) + { + prn = getbitu(rtcm->buff, i, np) + offp; + i += np; + hrclk = getbits(rtcm->buff, i, 22) * 1E-4; + i += 22; if (!(sat = satno(sys, prn))) { trace(2, "rtcm3 %d satellite number error: prn=%d\n", type, prn); continue; } - rtcm->ssr[sat-1].t0 [2] = rtcm->time; - rtcm->ssr[sat-1].udi[2] = udint; - rtcm->ssr[sat-1].iod[2] = iod; - rtcm->ssr[sat-1].hrclk = hrclk; - rtcm->ssr[sat-1].update = 1; + rtcm->ssr[sat - 1].t0[2] = rtcm->time; + rtcm->ssr[sat - 1].udi[2] = udint; + rtcm->ssr[sat - 1].iod[2] = iod; + rtcm->ssr[sat - 1].hrclk = hrclk; + rtcm->ssr[sat - 1].update = 1; } - return sync ? 0:10; + return sync ? 0 : 10; } @@ -2012,34 +2498,67 @@ int decode_ssr7(rtcm_t *rtcm, int sys) return -1; } switch (sys) - { - case SYS_GPS: np = 6; offp = 0; codes = codes_gps; ncode = 17; break; - case SYS_GLO: np = 5; offp = 0; codes = codes_glo; ncode = 4; break; - case SYS_GAL: np = 6; offp = 0; codes = codes_gal; ncode = 19; break; - case SYS_QZS: np = 4; offp = 192; codes = codes_qzs; ncode = 13; break; - case SYS_BDS: np = 6; offp = 1; codes = codes_bds; ncode = 9; break; - default: return sync ? 0:10; - } - for (j = 0; j < nsat && i+5+17+np <= rtcm->len*8; j++) { - prn = getbitu(rtcm->buff, i, np)+offp; i += np; - nbias = getbitu(rtcm->buff, i, 5); i += 5; - yaw_ang = getbitu(rtcm->buff, i, 9); i += 9; - yaw_rate = getbits(rtcm->buff, i, 8); i += 8; + case SYS_GPS: + np = 6; + offp = 0; + codes = codes_gps; + ncode = 17; + break; + case SYS_GLO: + np = 5; + offp = 0; + codes = codes_glo; + ncode = 4; + break; + case SYS_GAL: + np = 6; + offp = 0; + codes = codes_gal; + ncode = 19; + break; + case SYS_QZS: + np = 4; + offp = 192; + codes = codes_qzs; + ncode = 13; + break; + case SYS_BDS: + np = 6; + offp = 1; + codes = codes_bds; + ncode = 9; + break; + default: + return sync ? 0 : 10; + } + for (j = 0; j < nsat && i + 5 + 17 + np <= rtcm->len * 8; j++) + { + prn = getbitu(rtcm->buff, i, np) + offp; + i += np; + nbias = getbitu(rtcm->buff, i, 5); + i += 5; + yaw_ang = getbitu(rtcm->buff, i, 9); + i += 9; + yaw_rate = getbits(rtcm->buff, i, 8); + i += 8; for (k = 0; k < MAXCODE; k++) pbias[k] = stdpb[k] = 0.0; - for (k = 0; k < nbias && i+49 <= rtcm->len*8; k++) + for (k = 0; k < nbias && i + 49 <= rtcm->len * 8; k++) { - mode = getbitu(rtcm->buff, i, 5); i += 5; - /* sii = getbitu(rtcm->buff, i, 1); */ i += 1; /* integer-indicator */ - /* swl = getbitu(rtcm->buff, i, 2); */ i += 2; /* WL integer-indicator */ - /* sdc = getbitu(rtcm->buff, i, 4); */ i += 4; /* discontinuity counter */ - bias = getbits(rtcm->buff, i, 20); i += 20; /* phase bias (m) */ - std = getbitu(rtcm->buff, i, 17); i += 17; /* phase bias std-dev (m) */ + mode = getbitu(rtcm->buff, i, 5); + i += 5; + /* sii = getbitu(rtcm->buff, i, 1); */ i += 1; /* integer-indicator */ + /* swl = getbitu(rtcm->buff, i, 2); */ i += 2; /* WL integer-indicator */ + /* sdc = getbitu(rtcm->buff, i, 4); */ i += 4; /* discontinuity counter */ + bias = getbits(rtcm->buff, i, 20); + i += 20; /* phase bias (m) */ + std = getbitu(rtcm->buff, i, 17); + i += 17; /* phase bias std-dev (m) */ if (mode <= ncode) { - pbias[codes[mode]-1] = bias*0.0001; /* (m) */ - stdpb[codes[mode]-1] = std *0.0001; /* (m) */ + pbias[codes[mode] - 1] = bias * 0.0001; /* (m) */ + stdpb[codes[mode] - 1] = std * 0.0001; /* (m) */ } else { @@ -2051,16 +2570,16 @@ int decode_ssr7(rtcm_t *rtcm, int sys) trace(2, "rtcm3 %d satellite number error: prn=%d\n", type, prn); continue; } - rtcm->ssr[sat-1].t0 [5] = rtcm->time; - rtcm->ssr[sat-1].udi[5] = udint; - rtcm->ssr[sat-1].iod[5] = iod; - rtcm->ssr[sat-1].yaw_ang = yaw_ang / 256.0*180.0; /* (deg) */ - rtcm->ssr[sat-1].yaw_rate = yaw_rate / 8192.0*180.0; /* (deg/s) */ + rtcm->ssr[sat - 1].t0[5] = rtcm->time; + rtcm->ssr[sat - 1].udi[5] = udint; + rtcm->ssr[sat - 1].iod[5] = iod; + rtcm->ssr[sat - 1].yaw_ang = yaw_ang / 256.0 * 180.0; /* (deg) */ + rtcm->ssr[sat - 1].yaw_rate = yaw_rate / 8192.0 * 180.0; /* (deg/s) */ for (k = 0; k < MAXCODE; k++) { - rtcm->ssr[sat-1].pbias[k] = pbias[k]; - rtcm->ssr[sat-1].stdpb[k] = (float)stdpb[k]; + rtcm->ssr[sat - 1].pbias[k] = pbias[k]; + rtcm->ssr[sat - 1].stdpb[k] = (float)stdpb[k]; } } return 20; @@ -2069,7 +2588,7 @@ int decode_ssr7(rtcm_t *rtcm, int sys) /* get signal index ----------------------------------------------------------*/ 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}; @@ -2078,7 +2597,7 @@ void sigindex(int sys, const unsigned char *code, const int *freq, int n, { if (!code[i]) continue; - if (freq[i]>NFREQ) + if (freq[i] > NFREQ) { /* save as extended signal if freq > NFREQ */ ex[i] = 1; continue; @@ -2087,19 +2606,22 @@ void sigindex(int sys, const unsigned char *code, const int *freq, int n, pri = getcodepri(sys, code[i], opt); /* select highest priority signal */ - if (pri>pri_h[freq[i]-1]) + if (pri > pri_h[freq[i] - 1]) { - if (index[freq[i]-1]) ex[index[freq[i]-1]-1] = 1; - pri_h[freq[i]-1] = pri; - index[freq[i]-1] = i+1; + if (index[freq[i] - 1]) ex[index[freq[i] - 1] - 1] = 1; + pri_h[freq[i] - 1] = pri; + index[freq[i] - 1] = i + 1; } - else ex[i] = 1; + else + ex[i] = 1; } /* signal index in obs data */ for (i = nex = 0; i < n; i++) { - if (ex[i] == 0) ind[i] = freq[i]-1; - else if (nex < NEXOBS) ind[i] = NFREQ+nex++; + if (ex[i] == 0) + ind[i] = freq[i] - 1; + else if (nex < NEXOBS) + ind[i] = NFREQ + nex++; else { /* no space in obs data */ trace(2, "rtcm msm: no space in obs data sys=%d code=%d\n", sys, code[i]); @@ -2114,56 +2636,84 @@ void sigindex(int sys, const unsigned char *code, const int *freq, int n, /* save obs data in msm message ----------------------------------------------*/ void save_msm_obs(rtcm_t *rtcm, int sys, msm_h_t *h, const double *r, - const double *pr, const double *cp, const double *rr, - const double *rrf, const double *cnr, const int *lock, - const int *ex, const int *half) + const double *pr, const double *cp, const double *rr, + const double *rrf, const double *cnr, const int *lock, + const int *ex, const int *half) { const char *sig[32]; double tt, wl; unsigned char code[32]; - char *msm_type = (char*)"", *q = NULL; + char *msm_type = (char *)"", *q = NULL; int i, j, k, type, prn, sat, fn, index = 0, freq[32], ind[32]; type = getbitu(rtcm->buff, 24, 12); switch (sys) - { - case SYS_GPS: msm_type = q = rtcm->msmtype[0]; break; - case SYS_GLO: msm_type = q = rtcm->msmtype[1]; break; - case SYS_GAL: msm_type = q = rtcm->msmtype[2]; break; - case SYS_QZS: msm_type = q = rtcm->msmtype[3]; break; - case SYS_SBS: msm_type = q = rtcm->msmtype[4]; break; - case SYS_BDS: msm_type = q = rtcm->msmtype[5]; break; - } + { + case SYS_GPS: + msm_type = q = rtcm->msmtype[0]; + break; + case SYS_GLO: + msm_type = q = rtcm->msmtype[1]; + break; + case SYS_GAL: + msm_type = q = rtcm->msmtype[2]; + break; + case SYS_QZS: + msm_type = q = rtcm->msmtype[3]; + break; + case SYS_SBS: + msm_type = q = rtcm->msmtype[4]; + break; + case SYS_BDS: + msm_type = q = rtcm->msmtype[5]; + break; + } /* id to signal */ for (i = 0; i < h->nsig; i++) { switch (sys) - { - case SYS_GPS: sig[i] = msm_sig_gps[h->sigs[i]-1]; break; - case SYS_GLO: sig[i] = msm_sig_glo[h->sigs[i]-1]; break; - case SYS_GAL: sig[i] = msm_sig_gal[h->sigs[i]-1]; break; - case SYS_QZS: sig[i] = msm_sig_qzs[h->sigs[i]-1]; break; - case SYS_SBS: sig[i] = msm_sig_sbs[h->sigs[i]-1]; break; - case SYS_BDS: sig[i] = msm_sig_cmp[h->sigs[i]-1]; break; - default: sig[i] = ""; break; - } + { + case SYS_GPS: + sig[i] = msm_sig_gps[h->sigs[i] - 1]; + break; + case SYS_GLO: + sig[i] = msm_sig_glo[h->sigs[i] - 1]; + break; + case SYS_GAL: + sig[i] = msm_sig_gal[h->sigs[i] - 1]; + break; + case SYS_QZS: + sig[i] = msm_sig_qzs[h->sigs[i] - 1]; + break; + case SYS_SBS: + sig[i] = msm_sig_sbs[h->sigs[i] - 1]; + break; + case SYS_BDS: + sig[i] = msm_sig_cmp[h->sigs[i] - 1]; + break; + default: + sig[i] = ""; + break; + } /* signal to rinex obs type */ - code[i] = obs2code(sig[i], freq+i); + code[i] = obs2code(sig[i], freq + i); /* freqency index for beidou */ if (sys == SYS_BDS) { - if (freq[i] == 5) freq[i] = 2; /* B2 */ - else if (freq[i] == 4) freq[i] = 3; /* B3 */ + if (freq[i] == 5) + freq[i] = 2; /* B2 */ + else if (freq[i] == 4) + freq[i] = 3; /* B3 */ } if (code[i] != CODE_NONE) { - if (q) q += sprintf(q, "L%s%s", sig[i], i < h->nsig-1 ? ", ":""); + if (q) q += sprintf(q, "L%s%s", sig[i], i < h->nsig - 1 ? ", " : ""); } else { - if (q) q += sprintf(q, "(%d)%s", h->sigs[i], i < h->nsig-1 ? ", ":""); + if (q) q += sprintf(q, "(%d)%s", h->sigs[i], i < h->nsig - 1 ? ", " : ""); trace(2, "rtcm3 %d: unknown signal id=%2d\n", type, h->sigs[i]); } @@ -2176,13 +2726,15 @@ void save_msm_obs(rtcm_t *rtcm, int sys, msm_h_t *h, const double *r, for (i = j = 0; i < h->nsat; i++) { prn = h->sats[i]; - if (sys == SYS_QZS) prn += MINPRNQZS-1; - else if (sys == SYS_SBS) prn += MINPRNSBS-1; + if (sys == SYS_QZS) + prn += MINPRNQZS - 1; + else if (sys == SYS_SBS) + prn += MINPRNSBS - 1; if ((sat = satno(sys, prn))) { tt = timediff(rtcm->obs.data[0].time, rtcm->time); - if (rtcm->obsflag || fabs(tt)>1E-9) + if (rtcm->obsflag || fabs(tt) > 1E-9) { rtcm->obs.n = rtcm->obsflag = 0; } @@ -2194,38 +2746,38 @@ void save_msm_obs(rtcm_t *rtcm, int sys, msm_h_t *h, const double *r, } for (k = 0; k < h->nsig; k++) { - if (!h->cellmask[k+i*h->nsig]) continue; + if (!h->cellmask[k + i * h->nsig]) continue; if (sat && index >= 0 && ind[k] >= 0) { /* satellite carrier wave length */ - wl = satwavelen(sat, freq[k]-1, &rtcm->nav); + wl = satwavelen(sat, freq[k] - 1, &rtcm->nav); /* glonass wave length by extended info */ if (sys == SYS_GLO && ex && ex[i] <= 13) { - fn = ex[i]-7; - wl = SPEED_OF_LIGHT / ((freq[k] == 2 ? FREQ2_GLO : FREQ1_GLO)+ - (freq[k] == 2 ? DFRQ2_GLO : DFRQ1_GLO)*fn); + fn = ex[i] - 7; + wl = SPEED_OF_LIGHT / ((freq[k] == 2 ? FREQ2_GLO : FREQ1_GLO) + + (freq[k] == 2 ? DFRQ2_GLO : DFRQ1_GLO) * fn); } /* pseudorange (m) */ if (r[i] != 0.0 && pr[j] > -1E12) { - rtcm->obs.data[index].P[ind[k]] = r[i]+pr[j]; + rtcm->obs.data[index].P[ind[k]] = r[i] + pr[j]; } /* carrier-phase (cycle) */ if (r[i] != 0.0 && cp[j] > -1E12 && wl > 0.0) { - rtcm->obs.data[index].L[ind[k]] = (r[i]+cp[j])/wl; + rtcm->obs.data[index].L[ind[k]] = (r[i] + cp[j]) / wl; } /* doppler (hz) */ if (rr && rrf && rrf[j] > -1E12 && wl > 0.0) { - rtcm->obs.data[index].D[ind[k]] = (float)(-(rr[i]+rrf[j])/wl); + rtcm->obs.data[index].D[ind[k]] = (float)(-(rr[i] + rrf[j]) / wl); } rtcm->obs.data[index].LLI[ind[k]] = - lossoflock(rtcm, sat, ind[k], lock[j])+(half[j] ? 3 : 0); - rtcm->obs.data[index].SNR [ind[k]] = (unsigned char)(cnr[j]*4.0); + lossoflock(rtcm, sat, ind[k], lock[j]) + (half[j] ? 3 : 0); + rtcm->obs.data[index].SNR[ind[k]] = (unsigned char)(cnr[j] * 4.0); rtcm->obs.data[index].code[ind[k]] = code[k]; } j++; @@ -2234,55 +2786,68 @@ void save_msm_obs(rtcm_t *rtcm, int sys, msm_h_t *h, const double *r, } - /* decode type msm message header --------------------------------------------*/ 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}}; double tow, tod; char *msg; int i = 24, j, mask, staid, type, ncell = 0; - type = getbitu(rtcm->buff, i, 12); i += 12; + type = getbitu(rtcm->buff, i, 12); + i += 12; *h = h0; - if (i+157 <= rtcm->len*8) + if (i + 157 <= rtcm->len * 8) { - staid = getbitu(rtcm->buff, i, 12); i += 12; + staid = getbitu(rtcm->buff, i, 12); + i += 12; if (sys == SYS_GLO) { - /* dow = getbitu(rtcm->buff, i, 3); */ i += 3; - tod = getbitu(rtcm->buff, i, 27)*0.001; i += 27; + /* dow = getbitu(rtcm->buff, i, 3); */ i += 3; + tod = getbitu(rtcm->buff, i, 27) * 0.001; + i += 27; adjday_glot(rtcm, tod); } else if (sys == SYS_BDS) { - tow = getbitu(rtcm->buff, i, 30)*0.001; i += 30; + tow = getbitu(rtcm->buff, i, 30) * 0.001; + i += 30; tow += 14.0; /* BDT -> GPST */ adjweek(rtcm, tow); } else { - tow = getbitu(rtcm->buff, i, 30)*0.001; i += 30; + tow = getbitu(rtcm->buff, i, 30) * 0.001; + i += 30; adjweek(rtcm, tow); } - *sync = getbitu(rtcm->buff, i, 1); i += 1; - *iod = getbitu(rtcm->buff, i, 3); i += 3; - h->time_s = getbitu(rtcm->buff, i, 7); i += 7; - h->clk_str = getbitu(rtcm->buff, i, 2); i += 2; - h->clk_ext = getbitu(rtcm->buff, i, 2); i += 2; - h->smooth = getbitu(rtcm->buff, i, 1); i += 1; - h->tint_s = getbitu(rtcm->buff, i, 3); i += 3; + *sync = getbitu(rtcm->buff, i, 1); + i += 1; + *iod = getbitu(rtcm->buff, i, 3); + i += 3; + h->time_s = getbitu(rtcm->buff, i, 7); + i += 7; + h->clk_str = getbitu(rtcm->buff, i, 2); + i += 2; + h->clk_ext = getbitu(rtcm->buff, i, 2); + i += 2; + h->smooth = getbitu(rtcm->buff, i, 1); + i += 1; + h->tint_s = getbitu(rtcm->buff, i, 3); + i += 3; for (j = 1; j <= 64; j++) { - mask = getbitu(rtcm->buff, i, 1); i += 1; + mask = getbitu(rtcm->buff, i, 1); + i += 1; if (mask) h->sats[h->nsat++] = j; } for (j = 1; j <= 32; j++) { - mask = getbitu(rtcm->buff, i, 1); i += 1; + mask = getbitu(rtcm->buff, i, 1); + i += 1; if (mask) h->sigs[h->nsig++] = j; } } @@ -2294,33 +2859,34 @@ int decode_msm_head(rtcm_t *rtcm, int sys, int *sync, int *iod, /* test station id */ if (!test_staid(rtcm, staid)) return -1; - if (h->nsat*h->nsig>64) + if (h->nsat * h->nsig > 64) { trace(2, "rtcm3 %d number of sats and sigs error: nsat=%d nsig=%d\n", - type, h->nsat, h->nsig); + type, h->nsat, h->nsig); return -1; } - if (i+h->nsat*h->nsig>rtcm->len*8) + if (i + h->nsat * h->nsig > rtcm->len * 8) { trace(2, "rtcm3 %d length error: len=%d nsat=%d nsig=%d\n", type, - rtcm->len, h->nsat, h->nsig); + rtcm->len, h->nsat, h->nsig); return -1; } - for (j = 0; j < h->nsat*h->nsig; j++) + for (j = 0; j < h->nsat * h->nsig; j++) { - h->cellmask[j] = getbitu(rtcm->buff, i, 1); i += 1; + h->cellmask[j] = getbitu(rtcm->buff, i, 1); + i += 1; if (h->cellmask[j]) ncell++; } *hsize = i; trace(4, "decode_head_msm: time=%s sys=%d staid=%d nsat=%d nsig=%d sync=%d iod=%d ncell=%d\n", - time_str(rtcm->time, 2), sys, staid, h->nsat, h->nsig, *sync, *iod, ncell); + time_str(rtcm->time, 2), sys, staid, h->nsat, h->nsig, *sync, *iod, ncell); if (rtcm->outtype) { - msg = rtcm->msgtype+strlen(rtcm->msgtype); + msg = rtcm->msgtype + strlen(rtcm->msgtype); sprintf(msg, " staid=%4d %s nsat=%2d nsig=%2d iod=%2d ncell=%2d sync=%d", - staid, time_str(rtcm->time, 2), h->nsat, h->nsig, *iod, ncell, *sync); + staid, time_str(rtcm->time, 2), h->nsat, h->nsig, *iod, ncell, *sync); } return ncell; } @@ -2333,7 +2899,7 @@ int decode_msm0(rtcm_t *rtcm, int sys) int i, sync, iod; if (decode_msm_head(rtcm, sys, &sync, &iod, &h, &i) < 0) return -1; rtcm->obsflag = !sync; - return sync ? 0:1; + return sync ? 0 : 1; } @@ -2349,10 +2915,10 @@ int decode_msm4(rtcm_t *rtcm, int sys) /* decode msm header */ if ((ncell = decode_msm_head(rtcm, sys, &sync, &iod, &h, &i)) < 0) return -1; - if (i+h.nsat*18+ncell*48 > rtcm->len*8) + if (i + h.nsat * 18 + ncell * 48 > rtcm->len * 8) { trace(2, "rtcm3 %d length error: nsat=%d ncell=%d len=%d\n", type, h.nsat, - ncell, rtcm->len); + ncell, rtcm->len); return -1; } for (j = 0; j < h.nsat; j++) r[j] = 0.0; @@ -2361,42 +2927,49 @@ int decode_msm4(rtcm_t *rtcm, int sys) /* decode satellite data */ for (j = 0; j < h.nsat; j++) { /* range */ - rng = getbitu(rtcm->buff, i, 8); i += 8; - if (rng != 255) r[j] = rng*RANGE_MS; + rng = getbitu(rtcm->buff, i, 8); + i += 8; + if (rng != 255) r[j] = rng * RANGE_MS; } for (j = 0; j < h.nsat; j++) { - rng_m = getbitu(rtcm->buff, i, 10); i += 10; - if (r[j] != 0.0) r[j] += rng_m*TWO_N10*RANGE_MS; + rng_m = getbitu(rtcm->buff, i, 10); + i += 10; + if (r[j] != 0.0) r[j] += rng_m * TWO_N10 * RANGE_MS; } /* decode signal data */ for (j = 0; j < ncell; j++) { /* pseudorange */ - prv = getbits(rtcm->buff, i, 15); i += 15; - if (prv != -16384) pr[j] = prv*TWO_N24*RANGE_MS; + prv = getbits(rtcm->buff, i, 15); + i += 15; + if (prv != -16384) pr[j] = prv * TWO_N24 * RANGE_MS; } for (j = 0; j < ncell; j++) { /* phaserange */ - cpv = getbits(rtcm->buff, i, 22); i += 22; - if (cpv != -2097152) cp[j] = cpv*TWO_N29*RANGE_MS; + cpv = getbits(rtcm->buff, i, 22); + i += 22; + if (cpv != -2097152) cp[j] = cpv * TWO_N29 * RANGE_MS; } for (j = 0; j < ncell; j++) { /* lock time */ - lock[j] = getbitu(rtcm->buff, i, 4); i += 4; + lock[j] = getbitu(rtcm->buff, i, 4); + i += 4; } for (j = 0; j < ncell; j++) { /* half-cycle ambiguity */ - half[j] = getbitu(rtcm->buff, i, 1); i += 1; + half[j] = getbitu(rtcm->buff, i, 1); + i += 1; } for (j = 0; j < ncell; j++) { /* cnr */ - cnr[j] = getbitu(rtcm->buff, i, 6)*1.0; i += 6; + cnr[j] = getbitu(rtcm->buff, i, 6) * 1.0; + i += 6; } /* save obs data in msm message */ save_msm_obs(rtcm, sys, &h, r, pr, cp, NULL, NULL, cnr, lock, NULL, half); rtcm->obsflag = !sync; - return sync ? 0:1; + return sync ? 0 : 1; } @@ -2413,71 +2986,82 @@ int decode_msm5(rtcm_t *rtcm, int sys) /* decode msm header */ if ((ncell = decode_msm_head(rtcm, sys, &sync, &iod, &h, &i)) < 0) return -1; - if (i+h.nsat*36+ncell*63>rtcm->len*8) + if (i + h.nsat * 36 + ncell * 63 > rtcm->len * 8) { trace(2, "rtcm3 %d length error: nsat=%d ncell=%d len=%d\n", type, h.nsat, - ncell, rtcm->len); + ncell, rtcm->len); return -1; } for (j = 0; j < h.nsat; j++) { - r[j] = rr[j] = 0.0; ex[j] = 15; + r[j] = rr[j] = 0.0; + ex[j] = 15; } for (j = 0; j < ncell; j++) pr[j] = cp[j] = rrf[j] = -1E16; /* decode satellite data */ for (j = 0; j < h.nsat; j++) { /* range */ - rng = getbitu(rtcm->buff, i, 8); i += 8; - if (rng != 255) r[j] = rng*RANGE_MS; + rng = getbitu(rtcm->buff, i, 8); + i += 8; + if (rng != 255) r[j] = rng * RANGE_MS; } for (j = 0; j < h.nsat; j++) { /* extended info */ - ex[j] = getbitu(rtcm->buff, i, 4); i += 4; + ex[j] = getbitu(rtcm->buff, i, 4); + i += 4; } for (j = 0; j < h.nsat; j++) { - rng_m = getbitu(rtcm->buff, i, 10); i += 10; - if (r[j] != 0.0) r[j] += rng_m*TWO_N10*RANGE_MS; + rng_m = getbitu(rtcm->buff, i, 10); + i += 10; + if (r[j] != 0.0) r[j] += rng_m * TWO_N10 * RANGE_MS; } for (j = 0; j < h.nsat; j++) { /* phaserangerate */ - rate = getbits(rtcm->buff, i, 14); i += 14; - if (rate != -8192) rr[j] = rate*1.0; + rate = getbits(rtcm->buff, i, 14); + i += 14; + if (rate != -8192) rr[j] = rate * 1.0; } /* decode signal data */ for (j = 0; j < ncell; j++) { /* pseudorange */ - prv = getbits(rtcm->buff, i, 15); i += 15; - if (prv != -16384) pr[j] = prv*TWO_N24*RANGE_MS; + prv = getbits(rtcm->buff, i, 15); + i += 15; + if (prv != -16384) pr[j] = prv * TWO_N24 * RANGE_MS; } for (j = 0; j < ncell; j++) { /* phaserange */ - cpv = getbits(rtcm->buff, i, 22); i += 22; - if (cpv != -2097152) cp[j] = cpv*TWO_N29*RANGE_MS; + cpv = getbits(rtcm->buff, i, 22); + i += 22; + if (cpv != -2097152) cp[j] = cpv * TWO_N29 * RANGE_MS; } for (j = 0; j < ncell; j++) { /* lock time */ - lock[j] = getbitu(rtcm->buff, i, 4); i += 4; + lock[j] = getbitu(rtcm->buff, i, 4); + i += 4; } for (j = 0; j < ncell; j++) { /* half-cycle ambiguity */ - half[j] = getbitu(rtcm->buff, i, 1); i += 1; + half[j] = getbitu(rtcm->buff, i, 1); + i += 1; } for (j = 0; j < ncell; j++) { /* cnr */ - cnr[j] = getbitu(rtcm->buff, i, 6)*1.0; i += 6; + cnr[j] = getbitu(rtcm->buff, i, 6) * 1.0; + i += 6; } for (j = 0; j < ncell; j++) { /* phaserangerate */ - rrv = getbits(rtcm->buff, i, 15); i += 15; - if (rrv != -16384) rrf[j] = rrv*0.0001; + rrv = getbits(rtcm->buff, i, 15); + i += 15; + if (rrv != -16384) rrf[j] = rrv * 0.0001; } /* save obs data in msm message */ save_msm_obs(rtcm, sys, &h, r, pr, cp, rr, rrf, cnr, lock, ex, half); rtcm->obsflag = !sync; - return sync ? 0:1; + return sync ? 0 : 1; } @@ -2493,10 +3077,10 @@ int decode_msm6(rtcm_t *rtcm, int sys) /* decode msm header */ if ((ncell = decode_msm_head(rtcm, sys, &sync, &iod, &h, &i)) < 0) return -1; - if (i+h.nsat*18+ncell*65>rtcm->len*8) + if (i + h.nsat * 18 + ncell * 65 > rtcm->len * 8) { trace(2, "rtcm3 %d length error: nsat=%d ncell=%d len=%d\n", type, h.nsat, - ncell, rtcm->len); + ncell, rtcm->len); return -1; } for (j = 0; j < h.nsat; j++) r[j] = 0.0; @@ -2505,42 +3089,49 @@ int decode_msm6(rtcm_t *rtcm, int sys) /* decode satellite data */ for (j = 0; j < h.nsat; j++) { /* range */ - rng = getbitu(rtcm->buff, i, 8); i += 8; - if (rng != 255) r[j] = rng*RANGE_MS; + rng = getbitu(rtcm->buff, i, 8); + i += 8; + if (rng != 255) r[j] = rng * RANGE_MS; } for (j = 0; j < h.nsat; j++) { - rng_m = getbitu(rtcm->buff, i, 10); i += 10; - if (r[j] != 0.0) r[j] += rng_m*TWO_N10*RANGE_MS; + rng_m = getbitu(rtcm->buff, i, 10); + i += 10; + if (r[j] != 0.0) r[j] += rng_m * TWO_N10 * RANGE_MS; } /* decode signal data */ for (j = 0; j < ncell; j++) { /* pseudorange */ - prv = getbits(rtcm->buff, i, 20); i += 20; - if (prv != -524288) pr[j] = prv*TWO_N29*RANGE_MS; + prv = getbits(rtcm->buff, i, 20); + i += 20; + if (prv != -524288) pr[j] = prv * TWO_N29 * RANGE_MS; } for (j = 0; j < ncell; j++) { /* phaserange */ - cpv = getbits(rtcm->buff, i, 24); i += 24; - if (cpv != -8388608) cp[j] = cpv*TWO_N31*RANGE_MS; + cpv = getbits(rtcm->buff, i, 24); + i += 24; + if (cpv != -8388608) cp[j] = cpv * TWO_N31 * RANGE_MS; } for (j = 0; j < ncell; j++) { /* lock time */ - lock[j] = getbitu(rtcm->buff, i, 10); i += 10; + lock[j] = getbitu(rtcm->buff, i, 10); + i += 10; } for (j = 0; j < ncell; j++) { /* half-cycle ambiguity */ - half[j] = getbitu(rtcm->buff, i, 1); i += 1; + half[j] = getbitu(rtcm->buff, i, 1); + i += 1; } for (j = 0; j < ncell; j++) { /* cnr */ - cnr[j] = getbitu(rtcm->buff, i, 10)*0.0625; i += 10; + cnr[j] = getbitu(rtcm->buff, i, 10) * 0.0625; + i += 10; } /* save obs data in msm message */ save_msm_obs(rtcm, sys, &h, r, pr, cp, NULL, NULL, cnr, lock, NULL, half); rtcm->obsflag = !sync; - return sync ? 0:1; + return sync ? 0 : 1; } @@ -2557,71 +3148,82 @@ int decode_msm7(rtcm_t *rtcm, int sys) /* decode msm header */ if ((ncell = decode_msm_head(rtcm, sys, &sync, &iod, &h, &i)) < 0) return -1; - if (i+h.nsat*36+ncell*80 > rtcm->len*8) + if (i + h.nsat * 36 + ncell * 80 > rtcm->len * 8) { trace(2, "rtcm3 %d length error: nsat=%d ncell=%d len=%d\n", type, h.nsat, - ncell, rtcm->len); + ncell, rtcm->len); return -1; } for (j = 0; j < h.nsat; j++) { - r[j] = rr[j] = 0.0; ex[j] = 15; + r[j] = rr[j] = 0.0; + ex[j] = 15; } for (j = 0; j < ncell; j++) pr[j] = cp[j] = rrf[j] = -1E16; /* decode satellite data */ for (j = 0; j < h.nsat; j++) { /* range */ - rng = getbitu(rtcm->buff, i, 8); i += 8; - if (rng != 255) r[j] = rng*RANGE_MS; + rng = getbitu(rtcm->buff, i, 8); + i += 8; + if (rng != 255) r[j] = rng * RANGE_MS; } for (j = 0; j < h.nsat; j++) { /* extended info */ - ex[j] = getbitu(rtcm->buff, i, 4); i += 4; + ex[j] = getbitu(rtcm->buff, i, 4); + i += 4; } for (j = 0; j < h.nsat; j++) { - rng_m = getbitu(rtcm->buff, i, 10); i += 10; - if (r[j] != 0.0) r[j] += rng_m*TWO_N10*RANGE_MS; + rng_m = getbitu(rtcm->buff, i, 10); + i += 10; + if (r[j] != 0.0) r[j] += rng_m * TWO_N10 * RANGE_MS; } for (j = 0; j < h.nsat; j++) { /* phaserangerate */ - rate = getbits(rtcm->buff, i, 14); i += 14; - if (rate != -8192) rr[j] = rate*1.0; + rate = getbits(rtcm->buff, i, 14); + i += 14; + if (rate != -8192) rr[j] = rate * 1.0; } /* decode signal data */ for (j = 0; j < ncell; j++) { /* pseudorange */ - prv = getbits(rtcm->buff, i, 20); i += 20; - if (prv != -524288) pr[j] = prv*TWO_N29*RANGE_MS; + prv = getbits(rtcm->buff, i, 20); + i += 20; + if (prv != -524288) pr[j] = prv * TWO_N29 * RANGE_MS; } for (j = 0; j < ncell; j++) { /* phaserange */ - cpv = getbits(rtcm->buff, i, 24); i += 24; - if (cpv != -8388608) cp[j] = cpv*TWO_N31*RANGE_MS; + cpv = getbits(rtcm->buff, i, 24); + i += 24; + if (cpv != -8388608) cp[j] = cpv * TWO_N31 * RANGE_MS; } for (j = 0; j < ncell; j++) { /* lock time */ - lock[j] = getbitu(rtcm->buff, i, 10); i += 10; + lock[j] = getbitu(rtcm->buff, i, 10); + i += 10; } for (j = 0; j < ncell; j++) { /* half-cycle amiguity */ - half[j] = getbitu(rtcm->buff, i, 1); i += 1; + half[j] = getbitu(rtcm->buff, i, 1); + i += 1; } for (j = 0; j < ncell; j++) { /* cnr */ - cnr[j] = getbitu(rtcm->buff, i, 10)*0.0625; i += 10; + cnr[j] = getbitu(rtcm->buff, i, 10) * 0.0625; + i += 10; } for (j = 0; j < ncell; j++) { /* phaserangerate */ - rrv = getbits(rtcm->buff, i, 15); i += 15; - if (rrv != -16384) rrf[j] = rrv*0.0001; + rrv = getbits(rtcm->buff, i, 15); + i += 15; + if (rrv != -16384) rrf[j] = rrv * 0.0001; } /* save obs data in msm message */ save_msm_obs(rtcm, sys, &h, r, pr, cp, rr, rrf, cnr, lock, ex, half); rtcm->obsflag = !sync; - return sync ? 0:1; + return sync ? 0 : 1; } @@ -2652,135 +3254,380 @@ int decode_rtcm3(rtcm_t *rtcm) rtcm->time = gpst2time(week, floor(tow)); } switch (type) - { - case 1001: ret = decode_type1001(rtcm); break; /* not supported */ - case 1002: ret = decode_type1002(rtcm); break; - case 1003: ret = decode_type1003(rtcm); break; /* not supported */ - case 1004: ret = decode_type1004(rtcm); break; - case 1005: ret = decode_type1005(rtcm); break; - case 1006: ret = decode_type1006(rtcm); break; - case 1007: ret = decode_type1007(rtcm); break; - case 1008: ret = decode_type1008(rtcm); break; - case 1009: ret = decode_type1009(rtcm); break; /* not supported */ - case 1010: ret = decode_type1010(rtcm); break; - case 1011: ret = decode_type1011(rtcm); break; /* not supported */ - case 1012: ret = decode_type1012(rtcm); break; - case 1013: ret = decode_type1013(rtcm); break; /* not supported */ - case 1019: ret = decode_type1019(rtcm); break; - case 1020: ret = decode_type1020(rtcm); break; - case 1021: ret = decode_type1021(rtcm); break; /* not supported */ - case 1022: ret = decode_type1022(rtcm); break; /* not supported */ - case 1023: ret = decode_type1023(rtcm); break; /* not supported */ - case 1024: ret = decode_type1024(rtcm); break; /* not supported */ - case 1025: ret = decode_type1025(rtcm); break; /* not supported */ - case 1026: ret = decode_type1026(rtcm); break; /* not supported */ - case 1027: ret = decode_type1027(rtcm); break; /* not supported */ - case 1029: ret = decode_type1029(rtcm); break; - case 1030: ret = decode_type1030(rtcm); break; /* not supported */ - case 1031: ret = decode_type1031(rtcm); break; /* not supported */ - case 1032: ret = decode_type1032(rtcm); break; /* not supported */ - case 1033: ret = decode_type1033(rtcm); break; - case 1034: ret = decode_type1034(rtcm); break; /* not supported */ - case 1035: ret = decode_type1035(rtcm); break; /* not supported */ - case 1037: ret = decode_type1037(rtcm); break; /* not supported */ - case 1038: ret = decode_type1038(rtcm); break; /* not supported */ - case 1039: ret = decode_type1039(rtcm); break; /* not supported */ - case 1044: ret = decode_type1044(rtcm); break; - case 1045: ret = decode_type1045(rtcm); break; - case 1046: ret = decode_type1046(rtcm); break; /* extension for IGS MGEX */ - case 1047: ret = decode_type1047(rtcm); break; /* beidou ephemeris (tentative mt) */ - case 63: ret = decode_type63 (rtcm); break; /* beidou ephemeris (rtcm draft) */ - case 1057: ret = decode_ssr1(rtcm, SYS_GPS); break; - case 1058: ret = decode_ssr2(rtcm, SYS_GPS); break; - case 1059: ret = decode_ssr3(rtcm, SYS_GPS); break; - case 1060: ret = decode_ssr4(rtcm, SYS_GPS); break; - case 1061: ret = decode_ssr5(rtcm, SYS_GPS); break; - case 1062: ret = decode_ssr6(rtcm, SYS_GPS); break; - case 1063: ret = decode_ssr1(rtcm, SYS_GLO); break; - case 1064: ret = decode_ssr2(rtcm, SYS_GLO); break; - case 1065: ret = decode_ssr3(rtcm, SYS_GLO); break; - case 1066: ret = decode_ssr4(rtcm, SYS_GLO); break; - case 1067: ret = decode_ssr5(rtcm, SYS_GLO); break; - case 1068: ret = decode_ssr6(rtcm, SYS_GLO); break; - case 1071: ret = decode_msm0(rtcm, SYS_GPS); break; /* not supported */ - case 1072: ret = decode_msm0(rtcm, SYS_GPS); break; /* not supported */ - case 1073: ret = decode_msm0(rtcm, SYS_GPS); break; /* not supported */ - case 1074: ret = decode_msm4(rtcm, SYS_GPS); break; - case 1075: ret = decode_msm5(rtcm, SYS_GPS); break; - case 1076: ret = decode_msm6(rtcm, SYS_GPS); break; - case 1077: ret = decode_msm7(rtcm, SYS_GPS); break; - case 1081: ret = decode_msm0(rtcm, SYS_GLO); break; /* not supported */ - case 1082: ret = decode_msm0(rtcm, SYS_GLO); break; /* not supported */ - case 1083: ret = decode_msm0(rtcm, SYS_GLO); break; /* not supported */ - case 1084: ret = decode_msm4(rtcm, SYS_GLO); break; - case 1085: ret = decode_msm5(rtcm, SYS_GLO); break; - case 1086: ret = decode_msm6(rtcm, SYS_GLO); break; - case 1087: ret = decode_msm7(rtcm, SYS_GLO); break; - case 1091: ret = decode_msm0(rtcm, SYS_GAL); break; /* not supported */ - case 1092: ret = decode_msm0(rtcm, SYS_GAL); break; /* not supported */ - case 1093: ret = decode_msm0(rtcm, SYS_GAL); break; /* not supported */ - case 1094: ret = decode_msm4(rtcm, SYS_GAL); break; - case 1095: ret = decode_msm5(rtcm, SYS_GAL); break; - case 1096: ret = decode_msm6(rtcm, SYS_GAL); break; - case 1097: ret = decode_msm7(rtcm, SYS_GAL); break; - case 1101: ret = decode_msm0(rtcm, SYS_SBS); break; /* not supported */ - case 1102: ret = decode_msm0(rtcm, SYS_SBS); break; /* not supported */ - case 1103: ret = decode_msm0(rtcm, SYS_SBS); break; /* not supported */ - case 1104: ret = decode_msm4(rtcm, SYS_SBS); break; - case 1105: ret = decode_msm5(rtcm, SYS_SBS); break; - case 1106: ret = decode_msm6(rtcm, SYS_SBS); break; - case 1107: ret = decode_msm7(rtcm, SYS_SBS); break; - case 1111: ret = decode_msm0(rtcm, SYS_QZS); break; /* not supported */ - case 1112: ret = decode_msm0(rtcm, SYS_QZS); break; /* not supported */ - case 1113: ret = decode_msm0(rtcm, SYS_QZS); break; /* not supported */ - case 1114: ret = decode_msm4(rtcm, SYS_QZS); break; - case 1115: ret = decode_msm5(rtcm, SYS_QZS); break; - case 1116: ret = decode_msm6(rtcm, SYS_QZS); break; - case 1117: ret = decode_msm7(rtcm, SYS_QZS); break; - case 1121: ret = decode_msm0(rtcm, SYS_BDS); break; /* not supported */ - case 1122: ret = decode_msm0(rtcm, SYS_BDS); break; /* not supported */ - case 1123: ret = decode_msm0(rtcm, SYS_BDS); break; /* not supported */ - case 1124: ret = decode_msm4(rtcm, SYS_BDS); break; - case 1125: ret = decode_msm5(rtcm, SYS_BDS); break; - case 1126: ret = decode_msm6(rtcm, SYS_BDS); break; - case 1127: ret = decode_msm7(rtcm, SYS_BDS); break; - case 1230: ret = decode_type1230(rtcm); break; /* not supported */ - case 1240: ret = decode_ssr1(rtcm, SYS_GAL); break; - case 1241: ret = decode_ssr2(rtcm, SYS_GAL); break; - case 1242: ret = decode_ssr3(rtcm, SYS_GAL); break; - case 1243: ret = decode_ssr4(rtcm, SYS_GAL); break; - case 1244: ret = decode_ssr5(rtcm, SYS_GAL); break; - case 1245: ret = decode_ssr6(rtcm, SYS_GAL); break; - case 1246: ret = decode_ssr1(rtcm, SYS_QZS); break; - case 1247: ret = decode_ssr2(rtcm, SYS_QZS); break; - case 1248: ret = decode_ssr3(rtcm, SYS_QZS); break; - case 1249: ret = decode_ssr4(rtcm, SYS_QZS); break; - case 1250: ret = decode_ssr5(rtcm, SYS_QZS); break; - case 1251: ret = decode_ssr6(rtcm, SYS_QZS); break; - case 1252: ret = decode_ssr1(rtcm, SYS_SBS); break; - case 1253: ret = decode_ssr2(rtcm, SYS_SBS); break; - case 1254: ret = decode_ssr3(rtcm, SYS_SBS); break; - case 1255: ret = decode_ssr4(rtcm, SYS_SBS); break; - case 1256: ret = decode_ssr5(rtcm, SYS_SBS); break; - case 1257: ret = decode_ssr6(rtcm, SYS_SBS); break; - case 1258: ret = decode_ssr1(rtcm, SYS_BDS); break; - case 1259: ret = decode_ssr2(rtcm, SYS_BDS); break; - case 1260: ret = decode_ssr3(rtcm, SYS_BDS); break; - case 1261: ret = decode_ssr4(rtcm, SYS_BDS); break; - case 1262: ret = decode_ssr5(rtcm, SYS_BDS); break; - case 1263: ret = decode_ssr6(rtcm, SYS_BDS); break; - case 2065: ret = decode_ssr7(rtcm, SYS_GPS); break; /* tentative */ - case 2066: ret = decode_ssr7(rtcm, SYS_GLO); break; /* tentative */ - case 2067: ret = decode_ssr7(rtcm, SYS_GAL); break; /* tentative */ - case 2068: ret = decode_ssr7(rtcm, SYS_QZS); break; /* tentative */ - case 2070: ret = decode_ssr7(rtcm, SYS_BDS); break; /* tentative */ - } + { + case 1001: + ret = decode_type1001(rtcm); + break; /* not supported */ + case 1002: + ret = decode_type1002(rtcm); + break; + case 1003: + ret = decode_type1003(rtcm); + break; /* not supported */ + case 1004: + ret = decode_type1004(rtcm); + break; + case 1005: + ret = decode_type1005(rtcm); + break; + case 1006: + ret = decode_type1006(rtcm); + break; + case 1007: + ret = decode_type1007(rtcm); + break; + case 1008: + ret = decode_type1008(rtcm); + break; + case 1009: + ret = decode_type1009(rtcm); + break; /* not supported */ + case 1010: + ret = decode_type1010(rtcm); + break; + case 1011: + ret = decode_type1011(rtcm); + break; /* not supported */ + case 1012: + ret = decode_type1012(rtcm); + break; + case 1013: + ret = decode_type1013(rtcm); + break; /* not supported */ + case 1019: + ret = decode_type1019(rtcm); + break; + case 1020: + ret = decode_type1020(rtcm); + break; + case 1021: + ret = decode_type1021(rtcm); + break; /* not supported */ + case 1022: + ret = decode_type1022(rtcm); + break; /* not supported */ + case 1023: + ret = decode_type1023(rtcm); + break; /* not supported */ + case 1024: + ret = decode_type1024(rtcm); + break; /* not supported */ + case 1025: + ret = decode_type1025(rtcm); + break; /* not supported */ + case 1026: + ret = decode_type1026(rtcm); + break; /* not supported */ + case 1027: + ret = decode_type1027(rtcm); + break; /* not supported */ + case 1029: + ret = decode_type1029(rtcm); + break; + case 1030: + ret = decode_type1030(rtcm); + break; /* not supported */ + case 1031: + ret = decode_type1031(rtcm); + break; /* not supported */ + case 1032: + ret = decode_type1032(rtcm); + break; /* not supported */ + case 1033: + ret = decode_type1033(rtcm); + break; + case 1034: + ret = decode_type1034(rtcm); + break; /* not supported */ + case 1035: + ret = decode_type1035(rtcm); + break; /* not supported */ + case 1037: + ret = decode_type1037(rtcm); + break; /* not supported */ + case 1038: + ret = decode_type1038(rtcm); + break; /* not supported */ + case 1039: + ret = decode_type1039(rtcm); + break; /* not supported */ + case 1044: + ret = decode_type1044(rtcm); + break; + case 1045: + ret = decode_type1045(rtcm); + break; + case 1046: + ret = decode_type1046(rtcm); + break; /* extension for IGS MGEX */ + case 1047: + ret = decode_type1047(rtcm); + break; /* beidou ephemeris (tentative mt) */ + case 63: + ret = decode_type63(rtcm); + break; /* beidou ephemeris (rtcm draft) */ + case 1057: + ret = decode_ssr1(rtcm, SYS_GPS); + break; + case 1058: + ret = decode_ssr2(rtcm, SYS_GPS); + break; + case 1059: + ret = decode_ssr3(rtcm, SYS_GPS); + break; + case 1060: + ret = decode_ssr4(rtcm, SYS_GPS); + break; + case 1061: + ret = decode_ssr5(rtcm, SYS_GPS); + break; + case 1062: + ret = decode_ssr6(rtcm, SYS_GPS); + break; + case 1063: + ret = decode_ssr1(rtcm, SYS_GLO); + break; + case 1064: + ret = decode_ssr2(rtcm, SYS_GLO); + break; + case 1065: + ret = decode_ssr3(rtcm, SYS_GLO); + break; + case 1066: + ret = decode_ssr4(rtcm, SYS_GLO); + break; + case 1067: + ret = decode_ssr5(rtcm, SYS_GLO); + break; + case 1068: + ret = decode_ssr6(rtcm, SYS_GLO); + break; + case 1071: + ret = decode_msm0(rtcm, SYS_GPS); + break; /* not supported */ + case 1072: + ret = decode_msm0(rtcm, SYS_GPS); + break; /* not supported */ + case 1073: + ret = decode_msm0(rtcm, SYS_GPS); + break; /* not supported */ + case 1074: + ret = decode_msm4(rtcm, SYS_GPS); + break; + case 1075: + ret = decode_msm5(rtcm, SYS_GPS); + break; + case 1076: + ret = decode_msm6(rtcm, SYS_GPS); + break; + case 1077: + ret = decode_msm7(rtcm, SYS_GPS); + break; + case 1081: + ret = decode_msm0(rtcm, SYS_GLO); + break; /* not supported */ + case 1082: + ret = decode_msm0(rtcm, SYS_GLO); + break; /* not supported */ + case 1083: + ret = decode_msm0(rtcm, SYS_GLO); + break; /* not supported */ + case 1084: + ret = decode_msm4(rtcm, SYS_GLO); + break; + case 1085: + ret = decode_msm5(rtcm, SYS_GLO); + break; + case 1086: + ret = decode_msm6(rtcm, SYS_GLO); + break; + case 1087: + ret = decode_msm7(rtcm, SYS_GLO); + break; + case 1091: + ret = decode_msm0(rtcm, SYS_GAL); + break; /* not supported */ + case 1092: + ret = decode_msm0(rtcm, SYS_GAL); + break; /* not supported */ + case 1093: + ret = decode_msm0(rtcm, SYS_GAL); + break; /* not supported */ + case 1094: + ret = decode_msm4(rtcm, SYS_GAL); + break; + case 1095: + ret = decode_msm5(rtcm, SYS_GAL); + break; + case 1096: + ret = decode_msm6(rtcm, SYS_GAL); + break; + case 1097: + ret = decode_msm7(rtcm, SYS_GAL); + break; + case 1101: + ret = decode_msm0(rtcm, SYS_SBS); + break; /* not supported */ + case 1102: + ret = decode_msm0(rtcm, SYS_SBS); + break; /* not supported */ + case 1103: + ret = decode_msm0(rtcm, SYS_SBS); + break; /* not supported */ + case 1104: + ret = decode_msm4(rtcm, SYS_SBS); + break; + case 1105: + ret = decode_msm5(rtcm, SYS_SBS); + break; + case 1106: + ret = decode_msm6(rtcm, SYS_SBS); + break; + case 1107: + ret = decode_msm7(rtcm, SYS_SBS); + break; + case 1111: + ret = decode_msm0(rtcm, SYS_QZS); + break; /* not supported */ + case 1112: + ret = decode_msm0(rtcm, SYS_QZS); + break; /* not supported */ + case 1113: + ret = decode_msm0(rtcm, SYS_QZS); + break; /* not supported */ + case 1114: + ret = decode_msm4(rtcm, SYS_QZS); + break; + case 1115: + ret = decode_msm5(rtcm, SYS_QZS); + break; + case 1116: + ret = decode_msm6(rtcm, SYS_QZS); + break; + case 1117: + ret = decode_msm7(rtcm, SYS_QZS); + break; + case 1121: + ret = decode_msm0(rtcm, SYS_BDS); + break; /* not supported */ + case 1122: + ret = decode_msm0(rtcm, SYS_BDS); + break; /* not supported */ + case 1123: + ret = decode_msm0(rtcm, SYS_BDS); + break; /* not supported */ + case 1124: + ret = decode_msm4(rtcm, SYS_BDS); + break; + case 1125: + ret = decode_msm5(rtcm, SYS_BDS); + break; + case 1126: + ret = decode_msm6(rtcm, SYS_BDS); + break; + case 1127: + ret = decode_msm7(rtcm, SYS_BDS); + break; + case 1230: + ret = decode_type1230(rtcm); + break; /* not supported */ + case 1240: + ret = decode_ssr1(rtcm, SYS_GAL); + break; + case 1241: + ret = decode_ssr2(rtcm, SYS_GAL); + break; + case 1242: + ret = decode_ssr3(rtcm, SYS_GAL); + break; + case 1243: + ret = decode_ssr4(rtcm, SYS_GAL); + break; + case 1244: + ret = decode_ssr5(rtcm, SYS_GAL); + break; + case 1245: + ret = decode_ssr6(rtcm, SYS_GAL); + break; + case 1246: + ret = decode_ssr1(rtcm, SYS_QZS); + break; + case 1247: + ret = decode_ssr2(rtcm, SYS_QZS); + break; + case 1248: + ret = decode_ssr3(rtcm, SYS_QZS); + break; + case 1249: + ret = decode_ssr4(rtcm, SYS_QZS); + break; + case 1250: + ret = decode_ssr5(rtcm, SYS_QZS); + break; + case 1251: + ret = decode_ssr6(rtcm, SYS_QZS); + break; + case 1252: + ret = decode_ssr1(rtcm, SYS_SBS); + break; + case 1253: + ret = decode_ssr2(rtcm, SYS_SBS); + break; + case 1254: + ret = decode_ssr3(rtcm, SYS_SBS); + break; + case 1255: + ret = decode_ssr4(rtcm, SYS_SBS); + break; + case 1256: + ret = decode_ssr5(rtcm, SYS_SBS); + break; + case 1257: + ret = decode_ssr6(rtcm, SYS_SBS); + break; + case 1258: + ret = decode_ssr1(rtcm, SYS_BDS); + break; + case 1259: + ret = decode_ssr2(rtcm, SYS_BDS); + break; + case 1260: + ret = decode_ssr3(rtcm, SYS_BDS); + break; + case 1261: + ret = decode_ssr4(rtcm, SYS_BDS); + break; + case 1262: + ret = decode_ssr5(rtcm, SYS_BDS); + break; + case 1263: + ret = decode_ssr6(rtcm, SYS_BDS); + break; + case 2065: + ret = decode_ssr7(rtcm, SYS_GPS); + break; /* tentative */ + case 2066: + ret = decode_ssr7(rtcm, SYS_GLO); + break; /* tentative */ + case 2067: + ret = decode_ssr7(rtcm, SYS_GAL); + break; /* tentative */ + case 2068: + ret = decode_ssr7(rtcm, SYS_QZS); + break; /* tentative */ + case 2070: + ret = decode_ssr7(rtcm, SYS_BDS); + break; /* tentative */ + } if (ret >= 0) { type -= 1000; - if ( 1 <= type && type <= 299) rtcm->nmsg3[type ]++; /* 1001-1299 */ - else if (1000 <= type && type <= 1099) rtcm->nmsg3[type-700]++; /* 2000-2099 */ - else rtcm->nmsg3[0]++; + if (1 <= type && type <= 299) + rtcm->nmsg3[type]++; /* 1001-1299 */ + else if (1000 <= type && type <= 1099) + rtcm->nmsg3[type - 700]++; /* 2000-2099 */ + else + rtcm->nmsg3[0]++; } return ret; } diff --git a/src/algorithms/libs/rtklib/rtklib_rtcm3.h b/src/algorithms/libs/rtklib/rtklib_rtcm3.h index 045d6aa25..b907f223d 100644 --- a/src/algorithms/libs/rtklib/rtklib_rtcm3.h +++ b/src/algorithms/libs/rtklib/rtklib_rtcm3.h @@ -58,56 +58,48 @@ /* constants -----------------------------------------------------------------*/ -const double PRUNIT_GPS = 299792.458; /* rtcm ver.3 unit of gps pseudorange (m) */ -const double PRUNIT_GLO = 599584.916; /* rtcm ver.3 unit of glonass pseudorange (m) */ -const double RANGE_MS = SPEED_OF_LIGHT * 0.001; /* range in 1 ms */ - +const double PRUNIT_GPS = 299792.458; /* rtcm ver.3 unit of gps pseudorange (m) */ +const double PRUNIT_GLO = 599584.916; /* rtcm ver.3 unit of glonass pseudorange (m) */ +const double RANGE_MS = SPEED_OF_LIGHT * 0.001; /* range in 1 ms */ /* ssr update intervals ------------------------------------------------------*/ const double ssrudint[16] = { - 1, 2, 5, 10, 15, 30, 60, 120, 240, 300, 600, 900, 1800, 3600, 7200, 10800 -}; + 1, 2, 5, 10, 15, 30, 60, 120, 240, 300, 600, 900, 1800, 3600, 7200, 10800}; /* ssr 3 and 7 signal and tracking mode ids ----------------------------------*/ const int codes_gps[] = { CODE_L1C, CODE_L1P, CODE_L1W, CODE_L1Y, CODE_L1M, CODE_L2C, CODE_L2D, CODE_L2S, CODE_L2L, CODE_L2X, CODE_L2P, CODE_L2W, CODE_L2Y, CODE_L2M, CODE_L5I, CODE_L5Q, - CODE_L5X -}; + CODE_L5X}; const int codes_glo[] = { - CODE_L1C, CODE_L1P, CODE_L2C, CODE_L2P -}; + CODE_L1C, CODE_L1P, CODE_L2C, CODE_L2P}; const int codes_gal[] = { CODE_L1A, CODE_L1B, CODE_L1C, CODE_L1X, CODE_L1Z, CODE_L5I, CODE_L5Q, CODE_L5X, CODE_L7I, CODE_L7Q, CODE_L7X, CODE_L8I, CODE_L8Q, CODE_L8X, CODE_L6A, CODE_L6B, - CODE_L6C, CODE_L6X, CODE_L6Z -}; + CODE_L6C, CODE_L6X, CODE_L6Z}; const int codes_qzs[] = { CODE_L1C, CODE_L1S, CODE_L1L, CODE_L2S, CODE_L2L, CODE_L2X, CODE_L5I, CODE_L5Q, - CODE_L5X, CODE_L6S, CODE_L6L, CODE_L6X, CODE_L1X -}; + CODE_L5X, CODE_L6S, CODE_L6L, CODE_L6X, CODE_L1X}; const int codes_bds[] = { CODE_L1I, CODE_L1Q, CODE_L1X, CODE_L7I, CODE_L7Q, CODE_L7X, CODE_L6I, CODE_L6Q, - CODE_L6X -}; + CODE_L6X}; const int codes_sbs[] = { - CODE_L1C, CODE_L5I, CODE_L5Q, CODE_L5X -}; + CODE_L1C, CODE_L5I, CODE_L5Q, CODE_L5X}; -double getbitg(const unsigned char *buff, int pos, int len); +double getbitg(const unsigned char *buff, int pos, int len); void adjweek(rtcm_t *rtcm, double tow); @@ -206,13 +198,13 @@ int decode_type1047(rtcm_t *rtcm); int decode_type1063(rtcm_t *rtcm); 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); int decode_ssr2_head(rtcm_t *rtcm, int sys, int *sync, int *iod, - double *udint, int *hsize); + double *udint, int *hsize); 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); int decode_ssr1(rtcm_t *rtcm, int sys); @@ -229,15 +221,15 @@ int decode_ssr6(rtcm_t *rtcm, int sys); int decode_ssr7(rtcm_t *rtcm, int sys); void sigindex(int sys, const unsigned char *code, const int *freq, int n, - const char *opt, int *ind); + const char *opt, int *ind); void save_msm_obs(rtcm_t *rtcm, int sys, msm_h_t *h, const double *r, - const double *pr, const double *cp, const double *rr, - const double *rrf, const double *cnr, const int *lock, - const int *ex, const int *half); + const double *pr, const double *cp, const double *rr, + const double *rrf, const double *cnr, const int *lock, + const int *ex, const int *half); 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); int decode_msm0(rtcm_t *rtcm, int sys); diff --git a/src/algorithms/libs/rtklib/rtklib_rtkcmn.cc b/src/algorithms/libs/rtklib/rtklib_rtkcmn.cc index a9c74ab55..cf6f22508 100644 --- a/src/algorithms/libs/rtklib/rtklib_rtkcmn.cc +++ b/src/algorithms/libs/rtklib/rtklib_rtkcmn.cc @@ -59,124 +59,124 @@ #include -const double gpst0[] = {1980, 1, 6, 0, 0, 0}; /* gps time reference */ -const double gst0 [] = {1999, 8, 22, 0, 0, 0}; /* galileo system time reference */ -const double bdt0 [] = {2006, 1, 1, 0, 0, 0}; /* beidou time reference */ +const double gpst0[] = {1980, 1, 6, 0, 0, 0}; /* gps time reference */ +const double gst0[] = {1999, 8, 22, 0, 0, 0}; /* galileo system time reference */ +const double bdt0[] = {2006, 1, 1, 0, 0, 0}; /* beidou time reference */ static double timeoffset_ = 0.0; -double leaps[MAXLEAPS+1][7] = { /* leap seconds (y,m,d,h,m,s,utc-gpst) */ - {2017, 1, 1, 0, 0, 0, -18}, - {2015, 7, 1, 0, 0, 0, -17}, - {2012, 7, 1, 0, 0, 0, -16}, - {2009, 1, 1, 0, 0, 0, -15}, - {2006, 1, 1, 0, 0, 0, -14}, - {1999, 1, 1, 0, 0, 0, -13}, - {1997, 7, 1, 0, 0, 0, -12}, - {1996, 1, 1, 0, 0, 0, -11}, - {1994, 7, 1, 0, 0, 0, -10}, - {1993, 7, 1, 0, 0, 0, -9}, - {1992, 7, 1, 0, 0, 0, -8}, - {1991, 1, 1, 0, 0, 0, -7}, - {1990, 1, 1, 0, 0, 0, -6}, - {1988, 1, 1, 0, 0, 0, -5}, - {1985, 7, 1, 0, 0, 0, -4}, - {1983, 7, 1, 0, 0, 0, -3}, - {1982, 7, 1, 0, 0, 0, -2}, - {1981, 7, 1, 0, 0, 0, -1}, - {} +double leaps[MAXLEAPS + 1][7] = {/* leap seconds (y,m,d,h,m,s,utc-gpst) */ + {2017, 1, 1, 0, 0, 0, -18}, + {2015, 7, 1, 0, 0, 0, -17}, + {2012, 7, 1, 0, 0, 0, -16}, + {2009, 1, 1, 0, 0, 0, -15}, + {2006, 1, 1, 0, 0, 0, -14}, + {1999, 1, 1, 0, 0, 0, -13}, + {1997, 7, 1, 0, 0, 0, -12}, + {1996, 1, 1, 0, 0, 0, -11}, + {1994, 7, 1, 0, 0, 0, -10}, + {1993, 7, 1, 0, 0, 0, -9}, + {1992, 7, 1, 0, 0, 0, -8}, + {1991, 1, 1, 0, 0, 0, -7}, + {1990, 1, 1, 0, 0, 0, -6}, + {1988, 1, 1, 0, 0, 0, -5}, + {1985, 7, 1, 0, 0, 0, -4}, + {1983, 7, 1, 0, 0, 0, -3}, + {1982, 7, 1, 0, 0, 0, -2}, + {1981, 7, 1, 0, 0, 0, -1}, + {}}; + + +const prcopt_t prcopt_default = { /* defaults processing options */ + PMODE_SINGLE, 0, 2, SYS_GPS, /* mode, soltype, nf, navsys */ + 15.0 * D2R, {{}, {{}, {}}}, /* elmin, snrmask */ + 0, 1, 1, 1, /* sateph, modear, glomodear, bdsmodear */ + 5, 0, 10, 1, /* maxout, minlock, minfix, armaxiter */ + 0, 0, 0, 0, /* estion, esttrop, dynamics, tidecorr */ + 1, 0, 0, 0, 0, /* niter, codesmooth, intpref, sbascorr, sbassatsel */ + 0, 0, /* rovpos, refpos */ + {100.0, 100.0, 100.0}, /* eratio[] */ + {100.0, 0.003, 0.003, 0.0, 1.0}, /* err[] */ + {30.0, 0.03, 0.3}, /* std[] */ + {1e-4, 1e-3, 1e-4, 1e-1, 1e-2, 0.0}, /* prn[] */ + 5E-12, /* sclkstab */ + {3.0, 0.9999, 0.25, 0.1, 0.05, 0, 0, 0}, /* thresar */ + 0.0, 0.0, 0.05, /* elmaskar, almaskhold, thresslip */ + 30.0, 30.0, 30.0, /* maxtdif, maxinno, maxgdop */ + {}, {}, {}, /* baseline, ru, rb */ + {"", ""}, /* anttype */ + {}, {}, {}, /* antdel, pcv, exsats */ + 0, 0, 0, {"", ""}, {}, 0, {{}, {}}, {{}, {{}, {}}, {{}, {}}, {}, {}}, 0, {}}; + + +const solopt_t solopt_default = { + /* defaults solution output options */ + SOLF_LLH, TIMES_GPST, 1, 3, /* posf, times, timef, timeu */ + 0, 1, 0, 0, 0, 0, /* degf, outhead, outopt, datum, height, geoid */ + 0, 0, 0, /* solstatic, sstat, trace */ + {0.0, 0.0}, /* nmeaintv */ + " ", "", 0 /* separator/program name */ }; -const prcopt_t prcopt_default = { /* defaults processing options */ - PMODE_SINGLE, 0, 2, SYS_GPS, /* mode, soltype, nf, navsys */ - 15.0*D2R, { {}, {{},{}} }, /* elmin, snrmask */ - 0, 1, 1, 1, /* sateph, modear, glomodear, bdsmodear */ - 5, 0, 10, 1, /* maxout, minlock, minfix, armaxiter */ - 0, 0, 0, 0, /* estion, esttrop, dynamics, tidecorr */ - 1, 0, 0, 0, 0, /* niter, codesmooth, intpref, sbascorr, sbassatsel */ - 0, 0, /* rovpos, refpos */ - {100.0, 100.0, 100.0}, /* eratio[] */ - {100.0, 0.003, 0.003, 0.0, 1.0}, /* err[] */ - {30.0, 0.03, 0.3}, /* std[] */ - {1e-4, 1e-3, 1e-4, 1e-1, 1e-2, 0.0}, /* prn[] */ - 5E-12, /* sclkstab */ - {3.0, 0.9999, 0.25, 0.1, 0.05, 0, 0, 0}, /* thresar */ - 0.0, 0.0, 0.05, /* elmaskar, almaskhold, thresslip */ - 30.0, 30.0, 30.0, /* maxtdif, maxinno, maxgdop */ - {}, {}, {}, /* baseline, ru, rb */ - {"",""}, /* anttype */ - {} , {}, {}, /* antdel, pcv, exsats */ - 0, 0, 0, {"",""}, {}, 0, {{},{}}, { {}, {{},{}}, {{},{}}, {}, {} }, 0, {} -}; +const char *formatstrs[32] = {/* stream format strings */ + "RTCM 2", /* 0 */ + "RTCM 3", /* 1 */ + "NovAtel OEM6", /* 2 */ + "NovAtel OEM3", /* 3 */ + "u-blox", /* 4 */ + "Superstar II", /* 5 */ + "Hemisphere", /* 6 */ + "SkyTraq", /* 7 */ + "GW10", /* 8 */ + "Javad", /* 9 */ + "NVS BINR", /* 10 */ + "BINEX", /* 11 */ + "Trimble RT17", /* 12 */ + "Septentrio", /* 13 */ + "CMR/CMR+", /* 14 */ + "LEX Receiver", /* 15 */ + "RINEX", /* 16 */ + "SP3", /* 17 */ + "RINEX CLK", /* 18 */ + "SBAS", /* 19 */ + "NMEA 0183", /* 20 */ + NULL}; -const solopt_t solopt_default = { /* defaults solution output options */ - SOLF_LLH, TIMES_GPST, 1, 3, /* posf, times, timef, timeu */ - 0, 1, 0, 0, 0, 0, /* degf, outhead, outopt, datum, height, geoid */ - 0, 0, 0, /* solstatic, sstat, trace */ - {0.0, 0.0}, /* nmeaintv */ - " ", "", 0 /* separator/program name */ -}; - - -const char *formatstrs[32] = { /* stream format strings */ - "RTCM 2", /* 0 */ - "RTCM 3", /* 1 */ - "NovAtel OEM6", /* 2 */ - "NovAtel OEM3", /* 3 */ - "u-blox", /* 4 */ - "Superstar II", /* 5 */ - "Hemisphere", /* 6 */ - "SkyTraq", /* 7 */ - "GW10", /* 8 */ - "Javad", /* 9 */ - "NVS BINR", /* 10 */ - "BINEX", /* 11 */ - "Trimble RT17", /* 12 */ - "Septentrio", /* 13 */ - "CMR/CMR+", /* 14 */ - "LEX Receiver", /* 15 */ - "RINEX", /* 16 */ - "SP3", /* 17 */ - "RINEX CLK", /* 18 */ - "SBAS", /* 19 */ - "NMEA 0183", /* 20 */ - NULL -}; - - -char obscodes[][3] = { /* observation code strings */ - "" ,"1C","1P","1W","1Y", "1M","1N","1S","1L","1E", /* 0- 9 */ - "1A","1B","1X","1Z","2C", "2D","2S","2L","2X","2P", /* 10-19 */ - "2W","2Y","2M","2N","5I", "5Q","5X","7I","7Q","7X", /* 20-29 */ - "6A","6B","6C","6X","6Z", "6S","6L","8L","8Q","8X", /* 30-39 */ - "2I","2Q","6I","6Q","3I", "3Q","3X","1I","1Q","5A", /* 40-49 */ - "5B","5C","9A","9B","9C", "9X","" ,"" ,"" ,"" /* 50-59 */ +char obscodes[][3] = { + /* observation code strings */ + "", "1C", "1P", "1W", "1Y", "1M", "1N", "1S", "1L", "1E", /* 0- 9 */ + "1A", "1B", "1X", "1Z", "2C", "2D", "2S", "2L", "2X", "2P", /* 10-19 */ + "2W", "2Y", "2M", "2N", "5I", "5Q", "5X", "7I", "7Q", "7X", /* 20-29 */ + "6A", "6B", "6C", "6X", "6Z", "6S", "6L", "8L", "8Q", "8X", /* 30-39 */ + "2I", "2Q", "6I", "6Q", "3I", "3Q", "3X", "1I", "1Q", "5A", /* 40-49 */ + "5B", "5C", "9A", "9B", "9C", "9X", "", "", "", "" /* 50-59 */ }; unsigned char obsfreqs[] = { - /* 1:L1/E1, 2:L2/B1, 3:L5/E5a/L3, 4:L6/LEX/B3, 5:E5b/B2, 6:E5(a+b), 7:S */ - 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0- 9 */ - 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, /* 10-19 */ - 2, 2, 2, 2, 3, 3, 3, 5, 5, 5, /* 20-29 */ - 4, 4, 4, 4, 4, 4, 4, 6, 6, 6, /* 30-39 */ - 2, 2, 4, 4, 3, 3, 3, 1, 1, 3, /* 40-49 */ - 3, 3, 7, 7, 7, 7, 0, 0, 0, 0 /* 50-59 */ + /* 1:L1/E1, 2:L2/B1, 3:L5/E5a/L3, 4:L6/LEX/B3, 5:E5b/B2, 6:E5(a+b), 7:S */ + 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0- 9 */ + 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, /* 10-19 */ + 2, 2, 2, 2, 3, 3, 3, 5, 5, 5, /* 20-29 */ + 4, 4, 4, 4, 4, 4, 4, 6, 6, 6, /* 30-39 */ + 2, 2, 4, 4, 3, 3, 3, 1, 1, 3, /* 40-49 */ + 3, 3, 7, 7, 7, 7, 0, 0, 0, 0 /* 50-59 */ }; -char codepris[7][MAXFREQ][16] = { /* code priority table */ +char codepris[7][MAXFREQ][16] = { + /* code priority table */ - /* L1/E1 L2/B1 L5/E5a/L3 L6/LEX/B3 E5b/B2 E5(a+b) S */ - {"CPYWMNSL", "PYWCMNDSLX", "IQX" , "" , "" , "" , "" }, /* GPS */ - {"PC" , "PC" , "IQX" , "" , "" , "" , "" }, /* GLO */ - {"CABXZ" , "" , "IQX" , "ABCXZ" , "IQX" , "IQX" , "" }, /* GAL */ - {"CSLXZ" , "SLX" , "IQX" , "SLX" , "" , "" , "" }, /* QZS */ - {"C" , "" , "IQX" , "" , "" , "" , "" }, /* SBS */ - {"IQX" , "IQX" , "IQX" , "IQX" , "IQX" , "" , "" }, /* BDS */ - {"" , "" , "ABCX" , "" , "" , "" , "ABCX"} /* IRN */ + /* L1/E1 L2/B1 L5/E5a/L3 L6/LEX/B3 E5b/B2 E5(a+b) S */ + {"CPYWMNSL", "PYWCMNDSLX", "IQX", "", "", "", ""}, /* GPS */ + {"PC", "PC", "IQX", "", "", "", ""}, /* GLO */ + {"CABXZ", "", "IQX", "ABCXZ", "IQX", "IQX", ""}, /* GAL */ + {"CSLXZ", "SLX", "IQX", "SLX", "", "", ""}, /* QZS */ + {"C", "", "IQX", "", "", "", ""}, /* SBS */ + {"IQX", "IQX", "IQX", "IQX", "IQX", "", ""}, /* BDS */ + {"", "", "ABCX", "", "", "", "ABCX"} /* IRN */ }; @@ -184,78 +184,77 @@ fatalfunc_t *fatalfunc = NULL; /* fatal callback function */ /* crc tables generated by util/gencrc ---------------------------------------*/ const unsigned short tbl_CRC16[] = { - 0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50A5, 0x60C6, 0x70E7, - 0x8108, 0x9129, 0xA14A, 0xB16B, 0xC18C, 0xD1AD, 0xE1CE, 0xF1EF, - 0x1231, 0x0210, 0x3273, 0x2252, 0x52B5, 0x4294, 0x72F7, 0x62D6, - 0x9339, 0x8318, 0xB37B, 0xA35A, 0xD3BD, 0xC39C, 0xF3FF, 0xE3DE, - 0x2462, 0x3443, 0x0420, 0x1401, 0x64E6, 0x74C7, 0x44A4, 0x5485, - 0xA56A, 0xB54B, 0x8528, 0x9509, 0xE5EE, 0xF5CF, 0xC5AC, 0xD58D, - 0x3653, 0x2672, 0x1611, 0x0630, 0x76D7, 0x66F6, 0x5695, 0x46B4, - 0xB75B, 0xA77A, 0x9719, 0x8738, 0xF7DF, 0xE7FE, 0xD79D, 0xC7BC, - 0x48C4, 0x58E5, 0x6886, 0x78A7, 0x0840, 0x1861, 0x2802, 0x3823, - 0xC9CC, 0xD9ED, 0xE98E, 0xF9AF, 0x8948, 0x9969, 0xA90A, 0xB92B, - 0x5AF5, 0x4AD4, 0x7AB7, 0x6A96, 0x1A71, 0x0A50, 0x3A33, 0x2A12, - 0xDBFD, 0xCBDC, 0xFBBF, 0xEB9E, 0x9B79, 0x8B58, 0xBB3B, 0xAB1A, - 0x6CA6, 0x7C87, 0x4CE4, 0x5CC5, 0x2C22, 0x3C03, 0x0C60, 0x1C41, - 0xEDAE, 0xFD8F, 0xCDEC, 0xDDCD, 0xAD2A, 0xBD0B, 0x8D68, 0x9D49, - 0x7E97, 0x6EB6, 0x5ED5, 0x4EF4, 0x3E13, 0x2E32, 0x1E51, 0x0E70, - 0xFF9F, 0xEFBE, 0xDFDD, 0xCFFC, 0xBF1B, 0xAF3A, 0x9F59, 0x8F78, - 0x9188, 0x81A9, 0xB1CA, 0xA1EB, 0xD10C, 0xC12D, 0xF14E, 0xE16F, - 0x1080, 0x00A1, 0x30C2, 0x20E3, 0x5004, 0x4025, 0x7046, 0x6067, - 0x83B9, 0x9398, 0xA3FB, 0xB3DA, 0xC33D, 0xD31C, 0xE37F, 0xF35E, - 0x02B1, 0x1290, 0x22F3, 0x32D2, 0x4235, 0x5214, 0x6277, 0x7256, - 0xB5EA, 0xA5CB, 0x95A8, 0x8589, 0xF56E, 0xE54F, 0xD52C, 0xC50D, - 0x34E2, 0x24C3, 0x14A0, 0x0481, 0x7466, 0x6447, 0x5424, 0x4405, - 0xA7DB, 0xB7FA, 0x8799, 0x97B8, 0xE75F, 0xF77E, 0xC71D, 0xD73C, - 0x26D3, 0x36F2, 0x0691, 0x16B0, 0x6657, 0x7676, 0x4615, 0x5634, - 0xD94C, 0xC96D, 0xF90E, 0xE92F, 0x99C8, 0x89E9, 0xB98A, 0xA9AB, - 0x5844, 0x4865, 0x7806, 0x6827, 0x18C0, 0x08E1, 0x3882, 0x28A3, - 0xCB7D, 0xDB5C, 0xEB3F, 0xFB1E, 0x8BF9, 0x9BD8, 0xABBB, 0xBB9A, - 0x4A75, 0x5A54, 0x6A37, 0x7A16, 0x0AF1, 0x1AD0, 0x2AB3, 0x3A92, - 0xFD2E, 0xED0F, 0xDD6C, 0xCD4D, 0xBDAA, 0xAD8B, 0x9DE8, 0x8DC9, - 0x7C26, 0x6C07, 0x5C64, 0x4C45, 0x3CA2, 0x2C83, 0x1CE0, 0x0CC1, - 0xEF1F, 0xFF3E, 0xCF5D, 0xDF7C, 0xAF9B, 0xBFBA, 0x8FD9, 0x9FF8, - 0x6E17, 0x7E36, 0x4E55, 0x5E74, 0x2E93, 0x3EB2, 0x0ED1, 0x1EF0 -}; + 0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50A5, 0x60C6, 0x70E7, + 0x8108, 0x9129, 0xA14A, 0xB16B, 0xC18C, 0xD1AD, 0xE1CE, 0xF1EF, + 0x1231, 0x0210, 0x3273, 0x2252, 0x52B5, 0x4294, 0x72F7, 0x62D6, + 0x9339, 0x8318, 0xB37B, 0xA35A, 0xD3BD, 0xC39C, 0xF3FF, 0xE3DE, + 0x2462, 0x3443, 0x0420, 0x1401, 0x64E6, 0x74C7, 0x44A4, 0x5485, + 0xA56A, 0xB54B, 0x8528, 0x9509, 0xE5EE, 0xF5CF, 0xC5AC, 0xD58D, + 0x3653, 0x2672, 0x1611, 0x0630, 0x76D7, 0x66F6, 0x5695, 0x46B4, + 0xB75B, 0xA77A, 0x9719, 0x8738, 0xF7DF, 0xE7FE, 0xD79D, 0xC7BC, + 0x48C4, 0x58E5, 0x6886, 0x78A7, 0x0840, 0x1861, 0x2802, 0x3823, + 0xC9CC, 0xD9ED, 0xE98E, 0xF9AF, 0x8948, 0x9969, 0xA90A, 0xB92B, + 0x5AF5, 0x4AD4, 0x7AB7, 0x6A96, 0x1A71, 0x0A50, 0x3A33, 0x2A12, + 0xDBFD, 0xCBDC, 0xFBBF, 0xEB9E, 0x9B79, 0x8B58, 0xBB3B, 0xAB1A, + 0x6CA6, 0x7C87, 0x4CE4, 0x5CC5, 0x2C22, 0x3C03, 0x0C60, 0x1C41, + 0xEDAE, 0xFD8F, 0xCDEC, 0xDDCD, 0xAD2A, 0xBD0B, 0x8D68, 0x9D49, + 0x7E97, 0x6EB6, 0x5ED5, 0x4EF4, 0x3E13, 0x2E32, 0x1E51, 0x0E70, + 0xFF9F, 0xEFBE, 0xDFDD, 0xCFFC, 0xBF1B, 0xAF3A, 0x9F59, 0x8F78, + 0x9188, 0x81A9, 0xB1CA, 0xA1EB, 0xD10C, 0xC12D, 0xF14E, 0xE16F, + 0x1080, 0x00A1, 0x30C2, 0x20E3, 0x5004, 0x4025, 0x7046, 0x6067, + 0x83B9, 0x9398, 0xA3FB, 0xB3DA, 0xC33D, 0xD31C, 0xE37F, 0xF35E, + 0x02B1, 0x1290, 0x22F3, 0x32D2, 0x4235, 0x5214, 0x6277, 0x7256, + 0xB5EA, 0xA5CB, 0x95A8, 0x8589, 0xF56E, 0xE54F, 0xD52C, 0xC50D, + 0x34E2, 0x24C3, 0x14A0, 0x0481, 0x7466, 0x6447, 0x5424, 0x4405, + 0xA7DB, 0xB7FA, 0x8799, 0x97B8, 0xE75F, 0xF77E, 0xC71D, 0xD73C, + 0x26D3, 0x36F2, 0x0691, 0x16B0, 0x6657, 0x7676, 0x4615, 0x5634, + 0xD94C, 0xC96D, 0xF90E, 0xE92F, 0x99C8, 0x89E9, 0xB98A, 0xA9AB, + 0x5844, 0x4865, 0x7806, 0x6827, 0x18C0, 0x08E1, 0x3882, 0x28A3, + 0xCB7D, 0xDB5C, 0xEB3F, 0xFB1E, 0x8BF9, 0x9BD8, 0xABBB, 0xBB9A, + 0x4A75, 0x5A54, 0x6A37, 0x7A16, 0x0AF1, 0x1AD0, 0x2AB3, 0x3A92, + 0xFD2E, 0xED0F, 0xDD6C, 0xCD4D, 0xBDAA, 0xAD8B, 0x9DE8, 0x8DC9, + 0x7C26, 0x6C07, 0x5C64, 0x4C45, 0x3CA2, 0x2C83, 0x1CE0, 0x0CC1, + 0xEF1F, 0xFF3E, 0xCF5D, 0xDF7C, 0xAF9B, 0xBFBA, 0x8FD9, 0x9FF8, + 0x6E17, 0x7E36, 0x4E55, 0x5E74, 0x2E93, 0x3EB2, 0x0ED1, 0x1EF0}; const unsigned int tbl_CRC24Q[] = { - 0x000000, 0x864CFB, 0x8AD50D, 0x0C99F6, 0x93E6E1, 0x15AA1A, 0x1933EC, 0x9F7F17, - 0xA18139, 0x27CDC2, 0x2B5434, 0xAD18CF, 0x3267D8, 0xB42B23, 0xB8B2D5, 0x3EFE2E, - 0xC54E89, 0x430272, 0x4F9B84, 0xC9D77F, 0x56A868, 0xD0E493, 0xDC7D65, 0x5A319E, - 0x64CFB0, 0xE2834B, 0xEE1ABD, 0x685646, 0xF72951, 0x7165AA, 0x7DFC5C, 0xFBB0A7, - 0x0CD1E9, 0x8A9D12, 0x8604E4, 0x00481F, 0x9F3708, 0x197BF3, 0x15E205, 0x93AEFE, - 0xAD50D0, 0x2B1C2B, 0x2785DD, 0xA1C926, 0x3EB631, 0xB8FACA, 0xB4633C, 0x322FC7, - 0xC99F60, 0x4FD39B, 0x434A6D, 0xC50696, 0x5A7981, 0xDC357A, 0xD0AC8C, 0x56E077, - 0x681E59, 0xEE52A2, 0xE2CB54, 0x6487AF, 0xFBF8B8, 0x7DB443, 0x712DB5, 0xF7614E, - 0x19A3D2, 0x9FEF29, 0x9376DF, 0x153A24, 0x8A4533, 0x0C09C8, 0x00903E, 0x86DCC5, - 0xB822EB, 0x3E6E10, 0x32F7E6, 0xB4BB1D, 0x2BC40A, 0xAD88F1, 0xA11107, 0x275DFC, - 0xDCED5B, 0x5AA1A0, 0x563856, 0xD074AD, 0x4F0BBA, 0xC94741, 0xC5DEB7, 0x43924C, - 0x7D6C62, 0xFB2099, 0xF7B96F, 0x71F594, 0xEE8A83, 0x68C678, 0x645F8E, 0xE21375, - 0x15723B, 0x933EC0, 0x9FA736, 0x19EBCD, 0x8694DA, 0x00D821, 0x0C41D7, 0x8A0D2C, - 0xB4F302, 0x32BFF9, 0x3E260F, 0xB86AF4, 0x2715E3, 0xA15918, 0xADC0EE, 0x2B8C15, - 0xD03CB2, 0x567049, 0x5AE9BF, 0xDCA544, 0x43DA53, 0xC596A8, 0xC90F5E, 0x4F43A5, - 0x71BD8B, 0xF7F170, 0xFB6886, 0x7D247D, 0xE25B6A, 0x641791, 0x688E67, 0xEEC29C, - 0x3347A4, 0xB50B5F, 0xB992A9, 0x3FDE52, 0xA0A145, 0x26EDBE, 0x2A7448, 0xAC38B3, - 0x92C69D, 0x148A66, 0x181390, 0x9E5F6B, 0x01207C, 0x876C87, 0x8BF571, 0x0DB98A, - 0xF6092D, 0x7045D6, 0x7CDC20, 0xFA90DB, 0x65EFCC, 0xE3A337, 0xEF3AC1, 0x69763A, - 0x578814, 0xD1C4EF, 0xDD5D19, 0x5B11E2, 0xC46EF5, 0x42220E, 0x4EBBF8, 0xC8F703, - 0x3F964D, 0xB9DAB6, 0xB54340, 0x330FBB, 0xAC70AC, 0x2A3C57, 0x26A5A1, 0xA0E95A, - 0x9E1774, 0x185B8F, 0x14C279, 0x928E82, 0x0DF195, 0x8BBD6E, 0x872498, 0x016863, - 0xFAD8C4, 0x7C943F, 0x700DC9, 0xF64132, 0x693E25, 0xEF72DE, 0xE3EB28, 0x65A7D3, - 0x5B59FD, 0xDD1506, 0xD18CF0, 0x57C00B, 0xC8BF1C, 0x4EF3E7, 0x426A11, 0xC426EA, - 0x2AE476, 0xACA88D, 0xA0317B, 0x267D80, 0xB90297, 0x3F4E6C, 0x33D79A, 0xB59B61, - 0x8B654F, 0x0D29B4, 0x01B042, 0x87FCB9, 0x1883AE, 0x9ECF55, 0x9256A3, 0x141A58, - 0xEFAAFF, 0x69E604, 0x657FF2, 0xE33309, 0x7C4C1E, 0xFA00E5, 0xF69913, 0x70D5E8, - 0x4E2BC6, 0xC8673D, 0xC4FECB, 0x42B230, 0xDDCD27, 0x5B81DC, 0x57182A, 0xD154D1, - 0x26359F, 0xA07964, 0xACE092, 0x2AAC69, 0xB5D37E, 0x339F85, 0x3F0673, 0xB94A88, - 0x87B4A6, 0x01F85D, 0x0D61AB, 0x8B2D50, 0x145247, 0x921EBC, 0x9E874A, 0x18CBB1, - 0xE37B16, 0x6537ED, 0x69AE1B, 0xEFE2E0, 0x709DF7, 0xF6D10C, 0xFA48FA, 0x7C0401, - 0x42FA2F, 0xC4B6D4, 0xC82F22, 0x4E63D9, 0xD11CCE, 0x575035, 0x5BC9C3, 0xDD8538 -}; + 0x000000, 0x864CFB, 0x8AD50D, 0x0C99F6, 0x93E6E1, 0x15AA1A, 0x1933EC, 0x9F7F17, + 0xA18139, 0x27CDC2, 0x2B5434, 0xAD18CF, 0x3267D8, 0xB42B23, 0xB8B2D5, 0x3EFE2E, + 0xC54E89, 0x430272, 0x4F9B84, 0xC9D77F, 0x56A868, 0xD0E493, 0xDC7D65, 0x5A319E, + 0x64CFB0, 0xE2834B, 0xEE1ABD, 0x685646, 0xF72951, 0x7165AA, 0x7DFC5C, 0xFBB0A7, + 0x0CD1E9, 0x8A9D12, 0x8604E4, 0x00481F, 0x9F3708, 0x197BF3, 0x15E205, 0x93AEFE, + 0xAD50D0, 0x2B1C2B, 0x2785DD, 0xA1C926, 0x3EB631, 0xB8FACA, 0xB4633C, 0x322FC7, + 0xC99F60, 0x4FD39B, 0x434A6D, 0xC50696, 0x5A7981, 0xDC357A, 0xD0AC8C, 0x56E077, + 0x681E59, 0xEE52A2, 0xE2CB54, 0x6487AF, 0xFBF8B8, 0x7DB443, 0x712DB5, 0xF7614E, + 0x19A3D2, 0x9FEF29, 0x9376DF, 0x153A24, 0x8A4533, 0x0C09C8, 0x00903E, 0x86DCC5, + 0xB822EB, 0x3E6E10, 0x32F7E6, 0xB4BB1D, 0x2BC40A, 0xAD88F1, 0xA11107, 0x275DFC, + 0xDCED5B, 0x5AA1A0, 0x563856, 0xD074AD, 0x4F0BBA, 0xC94741, 0xC5DEB7, 0x43924C, + 0x7D6C62, 0xFB2099, 0xF7B96F, 0x71F594, 0xEE8A83, 0x68C678, 0x645F8E, 0xE21375, + 0x15723B, 0x933EC0, 0x9FA736, 0x19EBCD, 0x8694DA, 0x00D821, 0x0C41D7, 0x8A0D2C, + 0xB4F302, 0x32BFF9, 0x3E260F, 0xB86AF4, 0x2715E3, 0xA15918, 0xADC0EE, 0x2B8C15, + 0xD03CB2, 0x567049, 0x5AE9BF, 0xDCA544, 0x43DA53, 0xC596A8, 0xC90F5E, 0x4F43A5, + 0x71BD8B, 0xF7F170, 0xFB6886, 0x7D247D, 0xE25B6A, 0x641791, 0x688E67, 0xEEC29C, + 0x3347A4, 0xB50B5F, 0xB992A9, 0x3FDE52, 0xA0A145, 0x26EDBE, 0x2A7448, 0xAC38B3, + 0x92C69D, 0x148A66, 0x181390, 0x9E5F6B, 0x01207C, 0x876C87, 0x8BF571, 0x0DB98A, + 0xF6092D, 0x7045D6, 0x7CDC20, 0xFA90DB, 0x65EFCC, 0xE3A337, 0xEF3AC1, 0x69763A, + 0x578814, 0xD1C4EF, 0xDD5D19, 0x5B11E2, 0xC46EF5, 0x42220E, 0x4EBBF8, 0xC8F703, + 0x3F964D, 0xB9DAB6, 0xB54340, 0x330FBB, 0xAC70AC, 0x2A3C57, 0x26A5A1, 0xA0E95A, + 0x9E1774, 0x185B8F, 0x14C279, 0x928E82, 0x0DF195, 0x8BBD6E, 0x872498, 0x016863, + 0xFAD8C4, 0x7C943F, 0x700DC9, 0xF64132, 0x693E25, 0xEF72DE, 0xE3EB28, 0x65A7D3, + 0x5B59FD, 0xDD1506, 0xD18CF0, 0x57C00B, 0xC8BF1C, 0x4EF3E7, 0x426A11, 0xC426EA, + 0x2AE476, 0xACA88D, 0xA0317B, 0x267D80, 0xB90297, 0x3F4E6C, 0x33D79A, 0xB59B61, + 0x8B654F, 0x0D29B4, 0x01B042, 0x87FCB9, 0x1883AE, 0x9ECF55, 0x9256A3, 0x141A58, + 0xEFAAFF, 0x69E604, 0x657FF2, 0xE33309, 0x7C4C1E, 0xFA00E5, 0xF69913, 0x70D5E8, + 0x4E2BC6, 0xC8673D, 0xC4FECB, 0x42B230, 0xDDCD27, 0x5B81DC, 0x57182A, 0xD154D1, + 0x26359F, 0xA07964, 0xACE092, 0x2AAC69, 0xB5D37E, 0x339F85, 0x3F0673, 0xB94A88, + 0x87B4A6, 0x01F85D, 0x0D61AB, 0x8B2D50, 0x145247, 0x921EBC, 0x9E874A, 0x18CBB1, + 0xE37B16, 0x6537ED, 0x69AE1B, 0xEFE2E0, 0x709DF7, 0xF6D10C, 0xFA48FA, 0x7C0401, + 0x42FA2F, 0xC4B6D4, 0xC82F22, 0x4E63D9, 0xD11CCE, 0x575035, 0x5BC9C3, 0xDD8538}; -extern "C" { +extern "C" +{ void dgemm_(char *, char *, int *, int *, int *, double *, double *, int *, double *, int *, double *, double *, int *); extern void dgetrf_(int *, int *, double *, int *, int *, int *); extern void dgetri_(int *, double *, int *, int *, double *, int *, int *); @@ -268,7 +267,7 @@ extern "C" { #ifdef IERS_MODEL extern int gmf_(double *mjd, double *lat, double *lon, double *hgt, double *zd, - double *gmfh, double *gmfw); + double *gmfh, double *gmfw); #endif @@ -277,7 +276,9 @@ void fatalerr(const char *format, ...) { char msg[1024]; va_list ap; - va_start(ap, format); vsprintf(msg, format, ap); va_end(ap); + va_start(ap, format); + vsprintf(msg, format, ap); + va_end(ap); fprintf(stderr, "%s", msg); exit(-9); } @@ -293,34 +294,34 @@ int satno(int sys, int prn) { if (prn <= 0) return 0; switch (sys) - { - case SYS_GPS: - if (prnexsats[sat-1] == 1) + if (opt->exsats[sat - 1] == 1) { trace(3, "excluded satellite: sat=%3d svh=%02X\n", sat, svh); return 1; /* excluded satellite */ } - if (opt->exsats[sat-1] == 2) return 0; /* included satellite */ - if (!(sys&opt->navsys)) + if (opt->exsats[sat - 1] == 2) return 0; /* included satellite */ + if (!(sys & opt->navsys)) { trace(3, "unselected sat sys: sat=%3d svh=%02X\n", sat, svh); return 1; /* unselected sat sys */ @@ -494,20 +541,24 @@ int satexclude(int sat, int svh, const prcopt_t *opt) * return : status (1:masked,0:unmasked) *-----------------------------------------------------------------------------*/ int testsnr(int base, int freq, double el, double snr, - const snrmask_t *mask) + const snrmask_t *mask) { double minsnr, a; int i; - if (!mask->ena[base] || freq<0 || freq >= NFREQ) return 0; + if (!mask->ena[base] || freq < 0 || freq >= NFREQ) return 0; - a = (el*R2D+5.0)/10.0; - i = (int)floor(a); a -= i; - if (i<1) minsnr = mask->mask[freq][0]; - else if (i>8) minsnr = mask->mask[freq][8]; - else minsnr = (1.0-a)*mask->mask[freq][i-1]+a*mask->mask[freq][i]; + a = (el * R2D + 5.0) / 10.0; + i = (int)floor(a); + a -= i; + if (i < 1) + minsnr = mask->mask[freq][0]; + else if (i > 8) + minsnr = mask->mask[freq][8]; + else + minsnr = (1.0 - a) * mask->mask[freq][i - 1] + a * mask->mask[freq][i]; - return snr>(7-i%8))&1u); + for (i = pos; i < pos + len; i++) bits = (bits << 1) + ((buff[i / 8] >> (7 - i % 8)) & 1u); return bits; } @@ -637,8 +710,8 @@ unsigned int getbitu(const unsigned char *buff, int pos, int len) int getbits(const unsigned char *buff, int pos, int len) { unsigned int bits = getbitu(buff, pos, len); - if (len <= 0 || 32 <= len || !(bits&(1u<<(len-1)))) return (int)bits; - return (int)(bits|(~0u<>=1) + if (len <= 0 || 32 < len) return; + for (i = pos; i < pos + len; i++, mask >>= 1) { - if (data&mask) buff[i/8]|=1u<<(7-i%8); else buff[i/8]&=~(1u<<(7-i%8)); + if (data & mask) + buff[i / 8] |= 1u << (7 - i % 8); + else + buff[i / 8] &= ~(1u << (7 - i % 8)); } } void setbits(unsigned char *buff, int pos, int len, int data) { - if (data<0) data|=1<<(len-1); else data&=~(1<<(len-1)); /* set sign bit */ + if (data < 0) + data |= 1 << (len - 1); + else + data &= ~(1 << (len - 1)); /* set sign bit */ setbitu(buff, pos, len, (unsigned int)data); } @@ -683,12 +762,15 @@ unsigned int rtk_crc32(const unsigned char *buff, int len) trace(4, "rtk_crc32: len=%d\n", len); - for (i = 0; i>1)^POLYCRC32; else crc>>=1; + if (crc & 1) + crc = (crc >> 1) ^ POLYCRC32; + else + crc >>= 1; } } return crc; @@ -709,7 +791,7 @@ unsigned int rtk_crc24q(const unsigned char *buff, int len) trace(4, "rtk_crc24q: len=%d\n", len); - for (i = 0; i>16)^buff[i]]; + for (i = 0; i < len; i++) crc = ((crc << 8) & 0xFFFFFF) ^ tbl_CRC24Q[(crc >> 16) ^ buff[i]]; return crc; } @@ -728,9 +810,9 @@ unsigned short rtk_crc16(const unsigned char *buff, int len) trace(4, "rtk_crc16: len=%d\n", len); - for (i = 0; i>8)^buff[i])&0xFF]; + crc = (crc << 8) ^ tbl_CRC16[((crc >> 8) ^ buff[i]) & 0xFF]; } return crc; } @@ -748,23 +830,22 @@ unsigned short rtk_crc16(const unsigned char *buff, int len) int decode_word(unsigned int word, unsigned char *data) { const unsigned int hamming[] = { - 0xBB1F3480, 0x5D8F9A40, 0xAEC7CD00, 0x5763E680, 0x6BB1F340, 0x8B7A89C0 - }; + 0xBB1F3480, 0x5D8F9A40, 0xAEC7CD00, 0x5763E680, 0x6BB1F340, 0x8B7A89C0}; unsigned int parity = 0, w; int i; trace(5, "decodeword: word=%08x\n", word); - if (word&0x40000000) word^=0x3FFFFFC0; + if (word & 0x40000000) word ^= 0x3FFFFFC0; - for (i = 0; i<6; i++) + for (i = 0; i < 6; i++) { - parity<<= 1; - for (w = (word&hamming[i])>>6; w; w>>=1) parity^=w&1; + parity <<= 1; + for (w = (word & hamming[i]) >> 6; w; w >>= 1) parity ^= w & 1; } - if (parity != (word&0x3F)) return 0; + if (parity != (word & 0x3F)) return 0; - for (i = 0; i<3; i++) data[i] = (unsigned char)(word>>(22-i*8)); + for (i = 0; i < 3; i++) data[i] = (unsigned char)(word >> (22 - i * 8)); return 1; } @@ -779,7 +860,7 @@ double *mat(int n, int m) double *p; if (n <= 0 || m <= 0) return NULL; - if (!(p = (double *)malloc(sizeof(double)*n*m))) + if (!(p = (double *)malloc(sizeof(double) * n * m))) { fatalerr("matrix memory allocation error: n=%d,m=%d\n", n, m); } @@ -797,7 +878,7 @@ int *imat(int n, int m) int *p; if (n <= 0 || m <= 0) return NULL; - if (!(p = (int *)malloc(sizeof(int)*n*m))) + if (!(p = (int *)malloc(sizeof(int) * n * m))) { fatalerr("integer matrix memory allocation error: n=%d,m=%d\n", n, m); } @@ -815,12 +896,14 @@ double *zeros(int n, int m) double *p; #if NOCALLOC - if ((p = mat(n, m))) for (n = n*m-1; n >= 0; n--) p[n] = 0.0; + if ((p = mat(n, m))) + for (n = n * m - 1; n >= 0; n--) p[n] = 0.0; #else if (n <= 0 || m <= 0) return NULL; - if (!(p = (double *)calloc(sizeof(double), n*m))) { + if (!(p = (double *)calloc(sizeof(double), n * m))) + { fatalerr("matrix memory allocation error: n=%d,m=%d\n", n, m); - } + } #endif return p; } @@ -836,7 +919,8 @@ double *eye(int n) double *p; int i; - if ((p = zeros(n, n))) for (i = 0; i= 0) c += a[n]*b[n]; + while (--n >= 0) c += a[n] * b[n]; return c; } @@ -864,7 +948,7 @@ double dot(const double *a, const double *b, int n) *-----------------------------------------------------------------------------*/ double norm_rtk(const double *a, int n) { - return std::sqrt(dot(a, a, n)); + return std::sqrt(dot(a, a, n)); } @@ -876,9 +960,9 @@ double norm_rtk(const double *a, int n) *-----------------------------------------------------------------------------*/ void cross3(const double *a, const double *b, double *c) { - c[0] = a[1]*b[2]-a[2]*b[1]; - c[1] = a[2]*b[0]-a[0]*b[2]; - c[2] = a[0]*b[1]-a[1]*b[0]; + c[0] = a[1] * b[2] - a[2] * b[1]; + c[1] = a[2] * b[0] - a[0] * b[2]; + c[2] = a[0] * b[1] - a[1] * b[0]; } @@ -892,9 +976,9 @@ int normv3(const double *a, double *b) { double r; if ((r = norm_rtk(a, 3)) <= 0.0) return 0; - b[0] = a[0]/r; - b[1] = a[1]/r; - b[2] = a[2]/r; + b[0] = a[0] / r; + b[1] = a[1] / r; + b[2] = a[2] / r; return 1; } @@ -908,7 +992,7 @@ int normv3(const double *a, double *b) *-----------------------------------------------------------------------------*/ void matcpy(double *A, const double *B, int n, int m) { - memcpy(A, B, sizeof(double)*n*m); + memcpy(A, B, sizeof(double) * n * m); } /* matrix routines -----------------------------------------------------------*/ @@ -925,12 +1009,12 @@ void matcpy(double *A, const double *B, int n, int m) * return : none *-----------------------------------------------------------------------------*/ 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; - dgemm_((char *)tr, (char *)tr+1, &n, &k, &m, &alpha, (double *)A, &lda, (double *)B, - &ldb, &beta, C, &n); + dgemm_((char *)tr, (char *)tr + 1, &n, &k, &m, &alpha, (double *)A, &lda, (double *)B, + &ldb, &beta, C, &n); } @@ -943,12 +1027,13 @@ void matmul(const char *tr, int n, int k, int m, double alpha, int matinv(double *A, int n) { double *work; - int info, lwork = n*16, *ipiv = imat(n, 1); + int info, lwork = n * 16, *ipiv = imat(n, 1); work = mat(lwork, 1); dgetrf_(&n, &n, A, &n, ipiv, &info); if (!info) dgetri_(&n, A, &n, ipiv, work, &lwork, &info); - free(ipiv); free(work); + free(ipiv); + free(work); return info; } @@ -965,7 +1050,7 @@ int matinv(double *A, int n) * X can be same as Y *-----------------------------------------------------------------------------*/ 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); int info, *ipiv = imat(n, 1); @@ -974,7 +1059,8 @@ int solve(const char *tr, const double *A, const double *Y, int n, matcpy(X, Y, n, m); dgetrf_(&n, &n, B, &n, ipiv, &info); if (!info) dgetrs_((char *)tr, &n, &m, B, &n, ipiv, X, &n, &info); - free(ipiv); free(B); + free(ipiv); + free(B); return info; } @@ -993,15 +1079,15 @@ int solve(const char *tr, const double *A, const double *Y, int n, * matirix stored by column-major order (fortran convention) *-----------------------------------------------------------------------------*/ int lsq(const double *A, const double *y, int n, int m, double *x, - double *Q) + double *Q) { double *Ay; int info; - if (m0.0) ix[k++] = i; - x_ = mat(k, 1); xp_ = mat(k, 1); P_ = mat(k, k); Pp_ = mat(k, k); H_ = mat(k, m); - for (i = 0; i 0.0) ix[k++] = i; + x_ = mat(k, 1); + xp_ = mat(k, 1); + P_ = mat(k, k); + Pp_ = mat(k, k); + H_ = mat(k, m); + for (i = 0; i < k; i++) { x_[i] = x[ix[i]]; - for (j = 0; j= 0; s++) { - *p++=*s == 'd' || *s == 'D' ? 'E' : *s; + *p++ = *s == 'd' || *s == 'D' ? 'E' : *s; } *p = '\0'; return sscanf(str, "%lf", &value) == 1 ? value : 0.0; @@ -1188,15 +1291,15 @@ int str2time(const char *s, int i, int n, gtime_t *t) double ep[6]; char str[256], *p = str; - if (i<0 || (int)strlen(s)= 0;) { - *p++=*s++; + *p++ = *s++; } *p = '\0'; - if (sscanf(str, "%lf %lf %lf %lf %lf %lf", ep, ep+1, ep+2, ep+3, ep+4, ep+5)<6) + if (sscanf(str, "%lf %lf %lf %lf %lf %lf", ep, ep + 1, ep + 2, ep + 3, ep + 4, ep + 5) < 6) return -1; - if (ep[0]<100.0) ep[0] += ep[0]<80.0 ? 2000.0 : 1900.0; + if (ep[0] < 100.0) ep[0] += ep[0] < 80.0 ? 2000.0 : 1900.0; *t = epoch2time(ep); return 0; } @@ -1214,13 +1317,13 @@ gtime_t epoch2time(const double *ep) gtime_t time = {0, 0}; int days, sec, year = (int)ep[0], mon = (int)ep[1], day = (int)ep[2]; - if (year<1970 || 2099= 3 ? 1 : 0); + days = (year - 1970) * 365 + (year - 1969) / 4 + doy[mon - 1] + day - 2 + (year % 4 == 0 && mon >= 3 ? 1 : 0); sec = (int)floor(ep[5]); - time.time = (time_t)days*86400+(int)ep[3]*3600+(int)ep[4]*60+sec; - time.sec = ep[5]-sec; + time.time = (time_t)days * 86400 + (int)ep[3] * 3600 + (int)ep[4] * 60 + sec; + time.sec = ep[5] - sec; return time; } @@ -1234,21 +1337,27 @@ gtime_t epoch2time(const double *ep) *-----------------------------------------------------------------------------*/ void time2epoch(gtime_t t, double *ep) { - 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, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 - }; + 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, 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; /* leap year if year%4==0 in 1901-2099 */ - days = (int)(t.time/86400); - sec = (int)(t.time-(time_t)days*86400); - for (day = days%1461, mon = 0; mon<48; mon++) + days = (int)(t.time / 86400); + sec = (int)(t.time - (time_t)days * 86400); + for (day = days % 1461, mon = 0; mon < 48; mon++) { - if (day >= mday[mon]) day -= mday[mon]; else break; + if (day >= mday[mon]) + day -= mday[mon]; + else + break; } - ep[0] = 1970+days/1461*4+mon/12; ep[1] = mon%12+1; ep[2] = day+1; - ep[3] = sec/3600; ep[4] = sec%3600/60; ep[5] = sec%60+t.sec; + ep[0] = 1970 + days / 1461 * 4 + mon / 12; + ep[1] = mon % 12 + 1; + ep[2] = day + 1; + ep[3] = sec / 3600; + ep[4] = sec % 3600 / 60; + ep[5] = sec % 60 + t.sec; } @@ -1262,9 +1371,9 @@ gtime_t gpst2time(int week, double sec) { gtime_t t = epoch2time(gpst0); - if (sec<-1e9 || 1e9tm_year+1900; ep[1] = tt->tm_mon+1; ep[2] = tt->tm_mday; - ep[3] = tt->tm_hour; ep[4] = tt->tm_min; ep[5] = tt->tm_sec+tv.tv_usec*1e-6; + ep[0] = tt->tm_year + 1900; + ep[1] = tt->tm_mon + 1; + ep[2] = tt->tm_mday; + ep[3] = tt->tm_hour; + ep[4] = tt->tm_min; + ep[5] = tt->tm_sec + tv.tv_usec * 1e-6; } time = epoch2time(ep); @@ -1427,12 +1543,12 @@ int read_leaps_text(FILE *fp) rewind(fp); - while (fgets(buff, sizeof(buff), fp) && n= 13) continue; ls[n][0] = y; ls[n][1] = m; ls[n][2] = d; - ls[n++][6] = (char)(19.0-tai_utc); - } - for (i = 0; i0; i++) + for (i = 0; leaps[i][0] > 0; i++) { tu = timeadd(t, leaps[i][6]); if (timediff(tu, epoch2time(leaps[i])) >= 0.0) return tu; @@ -1531,7 +1648,7 @@ gtime_t utc2gpst(gtime_t t) { int i; - for (i = 0; leaps[i][0]>0; i++) + for (i = 0; leaps[i][0] > 0; i++) { if (timediff(t, epoch2time(leaps[i])) >= 0.0) return timeadd(t, -leaps[i][6]); } @@ -1570,7 +1687,7 @@ double time2sec(gtime_t time, gtime_t *day) { double ep[6], sec; 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; *day = epoch2time(ep); return sec; @@ -1591,12 +1708,13 @@ double utc2gmst(gtime_t t, double ut1_utc) tut = timeadd(t, ut1_utc); ut = time2sec(tut, &tut0); - t1 = timediff(tut0, epoch2time(ep2000))/86400.0/36525.0; - t2 = t1*t1; t3 = t2*t1; - gmst0 = 24110.54841+8640184.812866*t1+0.093104*t2-6.2E-6*t3; - gmst = gmst0+1.002737909350795*ut; + t1 = timediff(tut0, epoch2time(ep2000)) / 86400.0 / 36525.0; + t2 = t1 * t1; + t3 = t2 * t1; + gmst0 = 24110.54841 + 8640184.812866 * t1 + 0.093104 * t2 - 6.2E-6 * t3; + gmst = gmst0 + 1.002737909350795 * ut; - return fmod(gmst, 86400.0)*PI/43200.0; /* 0 <= gmst <= 2*PI */ + return fmod(gmst, 86400.0) * PI / 43200.0; /* 0 <= gmst <= 2*PI */ } @@ -1611,11 +1729,18 @@ void time2str(gtime_t t, char *s, int n) { double ep[6]; - if (n<0) n = 0; else if (n>12) n = 12; - if (1.0-t.sec<0.5/pow(10.0, n)) {t.time++; t.sec = 0.0;}; + if (n < 0) + n = 0; + else if (n > 12) + n = 12; + if (1.0 - t.sec < 0.5 / pow(10.0, n)) + { + t.time++; + t.sec = 0.0; + }; time2epoch(t, ep); sprintf(s, "%04.0f/%02.0f/%02.0f %02.0f:%02.0f:%0*.*f", ep[0], ep[1], ep[2], - ep[3], ep[4], n <= 0 ? 2:n+3, n <= 0 ? 0:n, ep[5]); + ep[3], ep[4], n <= 0 ? 2 : n + 3, n <= 0 ? 0 : n, ep[5]); } @@ -1644,8 +1769,9 @@ double time2doy(gtime_t t) double ep[6]; time2epoch(t, ep); - ep[1] = ep[2] = 1.0; ep[3] = ep[4] = ep[5] = 0.0; - return timediff(t, epoch2time(ep))/86400.0+1.0; + ep[1] = ep[2] = 1.0; + ep[3] = ep[4] = ep[5] = 0.0; + return timediff(t, epoch2time(ep)) / 86400.0 + 1.0; } @@ -1658,8 +1784,8 @@ int adjgpsweek(int week) { int w; (void)time2gpst(utc2gpst(timeget()), &w); - if (w<1560) w = 1560; /* use 2009/12/1 if time is earlier than 2009/12/1 */ - return week+(w-week+512)/1024*1024; + if (w < 1560) w = 1560; /* use 2009/12/1 if time is earlier than 2009/12/1 */ + return week + (w - week + 512) / 1024 * 1024; } @@ -1671,22 +1797,22 @@ int adjgpsweek(int week) unsigned int tickget(void) { struct timespec tp = {0, 0}; - struct timeval tv = {0, 0}; + struct timeval tv = {0, 0}; #ifdef CLOCK_MONOTONIC_RAW /* linux kernel > 2.6.28 */ if (!clock_gettime(CLOCK_MONOTONIC_RAW, &tp)) { - return tp.tv_sec*1000u+tp.tv_nsec/1000000u; + return tp.tv_sec * 1000u + tp.tv_nsec / 1000000u; } else { gettimeofday(&tv, NULL); - return tv.tv_sec*1000u+tv.tv_usec/1000u; + return tv.tv_sec * 1000u + tv.tv_usec / 1000u; } #else gettimeofday(&tv, NULL); - return tv.tv_sec*1000u+tv.tv_usec/1000u; + return tv.tv_sec * 1000u + tv.tv_usec / 1000u; #endif } @@ -1700,8 +1826,8 @@ void sleepms(int ms) { struct timespec ts = {0, 0}; if (ms <= 0) return; - ts.tv_sec = (time_t)(ms/1000); - ts.tv_nsec = (long)(ms%1000*1000000); + ts.tv_sec = (time_t)(ms / 1000); + ts.tv_nsec = (long)(ms % 1000 * 1000000); nanosleep(&ts, NULL); } @@ -1715,11 +1841,13 @@ void sleepms(int ms) *-----------------------------------------------------------------------------*/ 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, a = fabs(deg); double unit = pow(0.1, ndec); - dms[0] = floor(a); a = (a-dms[0])*60.0; - dms[1] = floor(a); a = (a-dms[1])*60.0; - dms[2] = floor(a/unit+0.5)*unit; + dms[0] = floor(a); + a = (a - dms[0]) * 60.0; + dms[1] = floor(a); + a = (a - dms[1]) * 60.0; + dms[2] = floor(a / unit + 0.5) * unit; if (dms[2] >= 60.0) { dms[2] = 0.0; @@ -1730,15 +1858,18 @@ void deg2dms(double deg, double *dms, int ndec) dms[0] += 1.0; } } - dms[0]*=sign; + dms[0] *= sign; } void deg2dms(double deg, double *dms) { - double sign=deg<0.0?-1.0:1.0,a=fabs(deg); - dms[0]=floor(a); a=(a-dms[0])*60.0; - dms[1]=floor(a); a=(a-dms[1])*60.0; - dms[2]=a; dms[0]*=sign; + double sign = deg < 0.0 ? -1.0 : 1.0, a = fabs(deg); + dms[0] = floor(a); + a = (a - dms[0]) * 60.0; + dms[1] = floor(a); + a = (a - dms[1]) * 60.0; + dms[2] = a; + dms[0] *= sign; } /* convert deg-min-sec to degree ----------------------------------------------- @@ -1748,8 +1879,8 @@ void deg2dms(double deg, double *dms) *-----------------------------------------------------------------------------*/ double dms2deg(const double *dms) { - double sign = dms[0]<0.0 ? -1.0 : 1.0; - return sign*(fabs(dms[0])+dms[1]/60.0+dms[2]/3600.0); + double sign = dms[0] < 0.0 ? -1.0 : 1.0; + return sign * (fabs(dms[0]) + dms[1] / 60.0 + dms[2] / 3600.0); } @@ -1762,18 +1893,18 @@ double dms2deg(const double *dms) *-----------------------------------------------------------------------------*/ 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), r2 = dot(r, r, 2), z, zk, v = RE_WGS84, 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;) { zk = z; - sinp = z/sqrt(r2+z*z); - v = RE_WGS84/sqrt(1.0-e2*sinp*sinp); - z = r[2]+v*e2*sinp; + sinp = z / sqrt(r2 + z * z); + v = RE_WGS84 / sqrt(1.0 - e2 * sinp * sinp); + z = r[2] + v * e2 * sinp; } - pos[0] = r2>1e-12 ? atan(z/sqrt(r2)) : (r[2]>0.0 ? PI/2.0 : -PI/2.0); - pos[1] = r2>1e-12 ? atan2(r[1], r[0]) : 0.0; - pos[2] = sqrt(r2+z*z)-v; + pos[0] = r2 > 1e-12 ? atan(z / sqrt(r2)) : (r[2] > 0.0 ? PI / 2.0 : -PI / 2.0); + pos[1] = r2 > 1e-12 ? atan2(r[1], r[0]) : 0.0; + pos[2] = sqrt(r2 + z * z) - v; } @@ -1787,11 +1918,11 @@ void ecef2pos(const double *r, double *pos) 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 e2 = FE_WGS84*(2.0-FE_WGS84), v = RE_WGS84/sqrt(1.0-e2*sinp*sinp); + double e2 = FE_WGS84 * (2.0 - FE_WGS84), v = RE_WGS84 / sqrt(1.0 - e2 * sinp * sinp); - r[0] = (v+pos[2])*cosp*cosl; - r[1] = (v+pos[2])*cosp*sinl; - r[2] = (v*(1.0-e2)+pos[2])*sinp; + r[0] = (v + pos[2]) * cosp * cosl; + r[1] = (v + pos[2]) * cosp * sinl; + r[2] = (v * (1.0 - e2) + pos[2]) * sinp; } @@ -1806,9 +1937,15 @@ void xyz2enu(const double *pos, double *E) { double sinp = sin(pos[0]), cosp = cos(pos[0]), sinl = sin(pos[1]), cosl = cos(pos[1]); - E[0] = -sinl; E[3] = cosl; E[6] = 0.0; - E[1] = -sinp*cosl; E[4] = -sinp*sinl; E[7] = cosp; - E[2] = cosp*cosl; E[5] = cosp*sinl; E[8] = sinp; + E[0] = -sinl; + E[3] = cosl; + E[6] = 0.0; + E[1] = -sinp * cosl; + E[4] = -sinp * sinl; + E[7] = cosp; + E[2] = cosp * cosl; + E[5] = cosp * sinl; + E[8] = sinp; } @@ -1823,7 +1960,7 @@ void ecef2enu(const double *pos, const double *r, double *e) { double E[9]; - xyz2enu(pos,E); + xyz2enu(pos, E); matmul("NN", 3, 1, 3, 1.0, E, r, 0.0, e); } @@ -1881,22 +2018,21 @@ void covecef(const double *pos, const double *Q, double *P) /* astronomical arguments: f={l,l',F,D,OMG} (rad) ----------------------------*/ void ast_args(double t, double *f) { - static const double fc[][5] = { /* coefficients for iau 1980 nutation */ - { 134.96340251, 1717915923.2178, 31.8792, 0.051635, -0.00024470}, - { 357.52910918, 129596581.0481, -0.5532, 0.000136, -0.00001149}, - { 93.27209062, 1739527262.8478, -12.7512, -0.001037, 0.00000417}, - { 297.85019547, 1602961601.2090, -6.3706, 0.006593, -0.00003169}, - { 125.04455501, -6962890.2665, 7.4722, 0.007702, -0.00005939} - }; + static const double fc[][5] = {/* coefficients for iau 1980 nutation */ + {134.96340251, 1717915923.2178, 31.8792, 0.051635, -0.00024470}, + {357.52910918, 129596581.0481, -0.5532, 0.000136, -0.00001149}, + {93.27209062, 1739527262.8478, -12.7512, -0.001037, 0.00000417}, + {297.85019547, 1602961601.2090, -6.3706, 0.006593, -0.00003169}, + {125.04455501, -6962890.2665, 7.4722, 0.007702, -0.00005939}}; double tt[4]; int i, j; - for (tt[0] = t, i = 1; i<4; i++) tt[i] = tt[i-1]*t; - for (i = 0; i<5; i++) + for (tt[0] = t, i = 1; i < 4; i++) tt[i] = tt[i - 1] * t; + for (i = 0; i < 5; i++) { - f[i] = fc[i][0]*3600.0; - for (j = 0; j<4; j++) f[i] += fc[i][j+1]*tt[j]; - f[i] = fmod(f[i]*AS2R, 2.0*PI); + f[i] = fc[i][0] * 3600.0; + for (j = 0; j < 4; j++) f[i] += fc[i][j + 1] * tt[j]; + f[i] = fmod(f[i] * AS2R, 2.0 * PI); } } @@ -1905,127 +2041,126 @@ void ast_args(double t, double *f) void nut_iau1980(double t, const double *f, double *dpsi, double *deps) { static const double nut[106][10] = { - { 0, 0, 0, 0, 1, -6798.4, -171996, -174.2, 92025, 8.9}, - { 0, 0, 2, -2, 2, 182.6, -13187, -1.6, 5736, -3.1}, - { 0, 0, 2, 0, 2, 13.7, -2274, -0.2, 977, -0.5}, - { 0, 0, 0, 0, 2, -3399.2, 2062, 0.2, -895, 0.5}, - { 0, -1, 0, 0, 0, -365.3, -1426, 3.4, 54, -0.1}, - { 1, 0, 0, 0, 0, 27.6, 712, 0.1, -7, 0.0}, - { 0, 1, 2, -2, 2, 121.7, -517, 1.2, 224, -0.6}, - { 0, 0, 2, 0, 1, 13.6, -386, -0.4, 200, 0.0}, - { 1, 0, 2, 0, 2, 9.1, -301, 0.0, 129, -0.1}, - { 0, -1, 2, -2, 2, 365.2, 217, -0.5, -95, 0.3}, - { -1, 0, 0, 2, 0, 31.8, 158, 0.0, -1, 0.0}, - { 0, 0, 2, -2, 1, 177.8, 129, 0.1, -70, 0.0}, - { -1, 0, 2, 0, 2, 27.1, 123, 0.0, -53, 0.0}, - { 1, 0, 0, 0, 1, 27.7, 63, 0.1, -33, 0.0}, - { 0, 0, 0, 2, 0, 14.8, 63, 0.0, -2, 0.0}, - { -1, 0, 2, 2, 2, 9.6, -59, 0.0, 26, 0.0}, - { -1, 0, 0, 0, 1, -27.4, -58, -0.1, 32, 0.0}, - { 1, 0, 2, 0, 1, 9.1, -51, 0.0, 27, 0.0}, - { -2, 0, 0, 2, 0, -205.9, -48, 0.0, 1, 0.0}, - { -2, 0, 2, 0, 1, 1305.5, 46, 0.0, -24, 0.0}, - { 0, 0, 2, 2, 2, 7.1, -38, 0.0, 16, 0.0}, - { 2, 0, 2, 0, 2, 6.9, -31, 0.0, 13, 0.0}, - { 2, 0, 0, 0, 0, 13.8, 29, 0.0, -1, 0.0}, - { 1, 0, 2, -2, 2, 23.9, 29, 0.0, -12, 0.0}, - { 0, 0, 2, 0, 0, 13.6, 26, 0.0, -1, 0.0}, - { 0, 0, 2, -2, 0, 173.3, -22, 0.0, 0, 0.0}, - { -1, 0, 2, 0, 1, 27.0, 21, 0.0, -10, 0.0}, - { 0, 2, 0, 0, 0, 182.6, 17, -0.1, 0, 0.0}, - { 0, 2, 2, -2, 2, 91.3, -16, 0.1, 7, 0.0}, - { -1, 0, 0, 2, 1, 32.0, 16, 0.0, -8, 0.0}, - { 0, 1, 0, 0, 1, 386.0, -15, 0.0, 9, 0.0}, - { 1, 0, 0, -2, 1, -31.7, -13, 0.0, 7, 0.0}, - { 0, -1, 0, 0, 1, -346.6, -12, 0.0, 6, 0.0}, - { 2, 0, -2, 0, 0, -1095.2, 11, 0.0, 0, 0.0}, - { -1, 0, 2, 2, 1, 9.5, -10, 0.0, 5, 0.0}, - { 1, 0, 2, 2, 2, 5.6, -8, 0.0, 3, 0.0}, - { 0, -1, 2, 0, 2, 14.2, -7, 0.0, 3, 0.0}, - { 0, 0, 2, 2, 1, 7.1, -7, 0.0, 3, 0.0}, - { 1, 1, 0, -2, 0, -34.8, -7, 0.0, 0, 0.0}, - { 0, 1, 2, 0, 2, 13.2, 7, 0.0, -3, 0.0}, - { -2, 0, 0, 2, 1, -199.8, -6, 0.0, 3, 0.0}, - { 0, 0, 0, 2, 1, 14.8, -6, 0.0, 3, 0.0}, - { 2, 0, 2, -2, 2, 12.8, 6, 0.0, -3, 0.0}, - { 1, 0, 0, 2, 0, 9.6, 6, 0.0, 0, 0.0}, - { 1, 0, 2, -2, 1, 23.9, 6, 0.0, -3, 0.0}, - { 0, 0, 0, -2, 1, -14.7, -5, 0.0, 3, 0.0}, - { 0, -1, 2, -2, 1, 346.6, -5, 0.0, 3, 0.0}, - { 2, 0, 2, 0, 1, 6.9, -5, 0.0, 3, 0.0}, - { 1, -1, 0, 0, 0, 29.8, 5, 0.0, 0, 0.0}, - { 1, 0, 0, -1, 0, 411.8, -4, 0.0, 0, 0.0}, - { 0, 0, 0, 1, 0, 29.5, -4, 0.0, 0, 0.0}, - { 0, 1, 0, -2, 0, -15.4, -4, 0.0, 0, 0.0}, - { 1, 0, -2, 0, 0, -26.9, 4, 0.0, 0, 0.0}, - { 2, 0, 0, -2, 1, 212.3, 4, 0.0, -2, 0.0}, - { 0, 1, 2, -2, 1, 119.6, 4, 0.0, -2, 0.0}, - { 1, 1, 0, 0, 0, 25.6, -3, 0.0, 0, 0.0}, - { 1, -1, 0, -1, 0, -3232.9, -3, 0.0, 0, 0.0}, - { -1, -1, 2, 2, 2, 9.8, -3, 0.0, 1, 0.0}, - { 0, -1, 2, 2, 2, 7.2, -3, 0.0, 1, 0.0}, - { 1, -1, 2, 0, 2, 9.4, -3, 0.0, 1, 0.0}, - { 3, 0, 2, 0, 2, 5.5, -3, 0.0, 1, 0.0}, - { -2, 0, 2, 0, 2, 1615.7, -3, 0.0, 1, 0.0}, - { 1, 0, 2, 0, 0, 9.1, 3, 0.0, 0, 0.0}, - { -1, 0, 2, 4, 2, 5.8, -2, 0.0, 1, 0.0}, - { 1, 0, 0, 0, 2, 27.8, -2, 0.0, 1, 0.0}, - { -1, 0, 2, -2, 1, -32.6, -2, 0.0, 1, 0.0}, - { 0, -2, 2, -2, 1, 6786.3, -2, 0.0, 1, 0.0}, - { -2, 0, 0, 0, 1, -13.7, -2, 0.0, 1, 0.0}, - { 2, 0, 0, 0, 1, 13.8, 2, 0.0, -1, 0.0}, - { 3, 0, 0, 0, 0, 9.2, 2, 0.0, 0, 0.0}, - { 1, 1, 2, 0, 2, 8.9, 2, 0.0, -1, 0.0}, - { 0, 0, 2, 1, 2, 9.3, 2, 0.0, -1, 0.0}, - { 1, 0, 0, 2, 1, 9.6, -1, 0.0, 0, 0.0}, - { 1, 0, 2, 2, 1, 5.6, -1, 0.0, 1, 0.0}, - { 1, 1, 0, -2, 1, -34.7, -1, 0.0, 0, 0.0}, - { 0, 1, 0, 2, 0, 14.2, -1, 0.0, 0, 0.0}, - { 0, 1, 2, -2, 0, 117.5, -1, 0.0, 0, 0.0}, - { 0, 1, -2, 2, 0, -329.8, -1, 0.0, 0, 0.0}, - { 1, 0, -2, 2, 0, 23.8, -1, 0.0, 0, 0.0}, - { 1, 0, -2, -2, 0, -9.5, -1, 0.0, 0, 0.0}, - { 1, 0, 2, -2, 0, 32.8, -1, 0.0, 0, 0.0}, - { 1, 0, 0, -4, 0, -10.1, -1, 0.0, 0, 0.0}, - { 2, 0, 0, -4, 0, -15.9, -1, 0.0, 0, 0.0}, - { 0, 0, 2, 4, 2, 4.8, -1, 0.0, 0, 0.0}, - { 0, 0, 2, -1, 2, 25.4, -1, 0.0, 0, 0.0}, - { -2, 0, 2, 4, 2, 7.3, -1, 0.0, 1, 0.0}, - { 2, 0, 2, 2, 2, 4.7, -1, 0.0, 0, 0.0}, - { 0, -1, 2, 0, 1, 14.2, -1, 0.0, 0, 0.0}, - { 0, 0, -2, 0, 1, -13.6, -1, 0.0, 0, 0.0}, - { 0, 0, 4, -2, 2, 12.7, 1, 0.0, 0, 0.0}, - { 0, 1, 0, 0, 2, 409.2, 1, 0.0, 0, 0.0}, - { 1, 1, 2, -2, 2, 22.5, 1, 0.0, -1, 0.0}, - { 3, 0, 2, -2, 2, 8.7, 1, 0.0, 0, 0.0}, - { -2, 0, 2, 2, 2, 14.6, 1, 0.0, -1, 0.0}, - { -1, 0, 0, 0, 2, -27.3, 1, 0.0, -1, 0.0}, - { 0, 0, -2, 2, 1, -169.0, 1, 0.0, 0, 0.0}, - { 0, 1, 2, 0, 1, 13.1, 1, 0.0, 0, 0.0}, - { -1, 0, 4, 0, 2, 9.1, 1, 0.0, 0, 0.0}, - { 2, 1, 0, -2, 0, 131.7, 1, 0.0, 0, 0.0}, - { 2, 0, 0, 2, 0, 7.1, 1, 0.0, 0, 0.0}, - { 2, 0, 2, -2, 1, 12.8, 1, 0.0, -1, 0.0}, - { 2, 0, -2, 0, 1, -943.2, 1, 0.0, 0, 0.0}, - { 1, -1, 0, -2, 0, -29.3, 1, 0.0, 0, 0.0}, - { -1, 0, 0, 1, 1, -388.3, 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, 0, 0, 0, 1, -6798.4, -171996, -174.2, 92025, 8.9}, + {0, 0, 2, -2, 2, 182.6, -13187, -1.6, 5736, -3.1}, + {0, 0, 2, 0, 2, 13.7, -2274, -0.2, 977, -0.5}, + {0, 0, 0, 0, 2, -3399.2, 2062, 0.2, -895, 0.5}, + {0, -1, 0, 0, 0, -365.3, -1426, 3.4, 54, -0.1}, + {1, 0, 0, 0, 0, 27.6, 712, 0.1, -7, 0.0}, + {0, 1, 2, -2, 2, 121.7, -517, 1.2, 224, -0.6}, + {0, 0, 2, 0, 1, 13.6, -386, -0.4, 200, 0.0}, + {1, 0, 2, 0, 2, 9.1, -301, 0.0, 129, -0.1}, + {0, -1, 2, -2, 2, 365.2, 217, -0.5, -95, 0.3}, + {-1, 0, 0, 2, 0, 31.8, 158, 0.0, -1, 0.0}, + {0, 0, 2, -2, 1, 177.8, 129, 0.1, -70, 0.0}, + {-1, 0, 2, 0, 2, 27.1, 123, 0.0, -53, 0.0}, + {1, 0, 0, 0, 1, 27.7, 63, 0.1, -33, 0.0}, + {0, 0, 0, 2, 0, 14.8, 63, 0.0, -2, 0.0}, + {-1, 0, 2, 2, 2, 9.6, -59, 0.0, 26, 0.0}, + {-1, 0, 0, 0, 1, -27.4, -58, -0.1, 32, 0.0}, + {1, 0, 2, 0, 1, 9.1, -51, 0.0, 27, 0.0}, + {-2, 0, 0, 2, 0, -205.9, -48, 0.0, 1, 0.0}, + {-2, 0, 2, 0, 1, 1305.5, 46, 0.0, -24, 0.0}, + {0, 0, 2, 2, 2, 7.1, -38, 0.0, 16, 0.0}, + {2, 0, 2, 0, 2, 6.9, -31, 0.0, 13, 0.0}, + {2, 0, 0, 0, 0, 13.8, 29, 0.0, -1, 0.0}, + {1, 0, 2, -2, 2, 23.9, 29, 0.0, -12, 0.0}, + {0, 0, 2, 0, 0, 13.6, 26, 0.0, -1, 0.0}, + {0, 0, 2, -2, 0, 173.3, -22, 0.0, 0, 0.0}, + {-1, 0, 2, 0, 1, 27.0, 21, 0.0, -10, 0.0}, + {0, 2, 0, 0, 0, 182.6, 17, -0.1, 0, 0.0}, + {0, 2, 2, -2, 2, 91.3, -16, 0.1, 7, 0.0}, + {-1, 0, 0, 2, 1, 32.0, 16, 0.0, -8, 0.0}, + {0, 1, 0, 0, 1, 386.0, -15, 0.0, 9, 0.0}, + {1, 0, 0, -2, 1, -31.7, -13, 0.0, 7, 0.0}, + {0, -1, 0, 0, 1, -346.6, -12, 0.0, 6, 0.0}, + {2, 0, -2, 0, 0, -1095.2, 11, 0.0, 0, 0.0}, + {-1, 0, 2, 2, 1, 9.5, -10, 0.0, 5, 0.0}, + {1, 0, 2, 2, 2, 5.6, -8, 0.0, 3, 0.0}, + {0, -1, 2, 0, 2, 14.2, -7, 0.0, 3, 0.0}, + {0, 0, 2, 2, 1, 7.1, -7, 0.0, 3, 0.0}, + {1, 1, 0, -2, 0, -34.8, -7, 0.0, 0, 0.0}, + {0, 1, 2, 0, 2, 13.2, 7, 0.0, -3, 0.0}, + {-2, 0, 0, 2, 1, -199.8, -6, 0.0, 3, 0.0}, + {0, 0, 0, 2, 1, 14.8, -6, 0.0, 3, 0.0}, + {2, 0, 2, -2, 2, 12.8, 6, 0.0, -3, 0.0}, + {1, 0, 0, 2, 0, 9.6, 6, 0.0, 0, 0.0}, + {1, 0, 2, -2, 1, 23.9, 6, 0.0, -3, 0.0}, + {0, 0, 0, -2, 1, -14.7, -5, 0.0, 3, 0.0}, + {0, -1, 2, -2, 1, 346.6, -5, 0.0, 3, 0.0}, + {2, 0, 2, 0, 1, 6.9, -5, 0.0, 3, 0.0}, + {1, -1, 0, 0, 0, 29.8, 5, 0.0, 0, 0.0}, + {1, 0, 0, -1, 0, 411.8, -4, 0.0, 0, 0.0}, + {0, 0, 0, 1, 0, 29.5, -4, 0.0, 0, 0.0}, + {0, 1, 0, -2, 0, -15.4, -4, 0.0, 0, 0.0}, + {1, 0, -2, 0, 0, -26.9, 4, 0.0, 0, 0.0}, + {2, 0, 0, -2, 1, 212.3, 4, 0.0, -2, 0.0}, + {0, 1, 2, -2, 1, 119.6, 4, 0.0, -2, 0.0}, + {1, 1, 0, 0, 0, 25.6, -3, 0.0, 0, 0.0}, + {1, -1, 0, -1, 0, -3232.9, -3, 0.0, 0, 0.0}, + {-1, -1, 2, 2, 2, 9.8, -3, 0.0, 1, 0.0}, + {0, -1, 2, 2, 2, 7.2, -3, 0.0, 1, 0.0}, + {1, -1, 2, 0, 2, 9.4, -3, 0.0, 1, 0.0}, + {3, 0, 2, 0, 2, 5.5, -3, 0.0, 1, 0.0}, + {-2, 0, 2, 0, 2, 1615.7, -3, 0.0, 1, 0.0}, + {1, 0, 2, 0, 0, 9.1, 3, 0.0, 0, 0.0}, + {-1, 0, 2, 4, 2, 5.8, -2, 0.0, 1, 0.0}, + {1, 0, 0, 0, 2, 27.8, -2, 0.0, 1, 0.0}, + {-1, 0, 2, -2, 1, -32.6, -2, 0.0, 1, 0.0}, + {0, -2, 2, -2, 1, 6786.3, -2, 0.0, 1, 0.0}, + {-2, 0, 0, 0, 1, -13.7, -2, 0.0, 1, 0.0}, + {2, 0, 0, 0, 1, 13.8, 2, 0.0, -1, 0.0}, + {3, 0, 0, 0, 0, 9.2, 2, 0.0, 0, 0.0}, + {1, 1, 2, 0, 2, 8.9, 2, 0.0, -1, 0.0}, + {0, 0, 2, 1, 2, 9.3, 2, 0.0, -1, 0.0}, + {1, 0, 0, 2, 1, 9.6, -1, 0.0, 0, 0.0}, + {1, 0, 2, 2, 1, 5.6, -1, 0.0, 1, 0.0}, + {1, 1, 0, -2, 1, -34.7, -1, 0.0, 0, 0.0}, + {0, 1, 0, 2, 0, 14.2, -1, 0.0, 0, 0.0}, + {0, 1, 2, -2, 0, 117.5, -1, 0.0, 0, 0.0}, + {0, 1, -2, 2, 0, -329.8, -1, 0.0, 0, 0.0}, + {1, 0, -2, 2, 0, 23.8, -1, 0.0, 0, 0.0}, + {1, 0, -2, -2, 0, -9.5, -1, 0.0, 0, 0.0}, + {1, 0, 2, -2, 0, 32.8, -1, 0.0, 0, 0.0}, + {1, 0, 0, -4, 0, -10.1, -1, 0.0, 0, 0.0}, + {2, 0, 0, -4, 0, -15.9, -1, 0.0, 0, 0.0}, + {0, 0, 2, 4, 2, 4.8, -1, 0.0, 0, 0.0}, + {0, 0, 2, -1, 2, 25.4, -1, 0.0, 0, 0.0}, + {-2, 0, 2, 4, 2, 7.3, -1, 0.0, 1, 0.0}, + {2, 0, 2, 2, 2, 4.7, -1, 0.0, 0, 0.0}, + {0, -1, 2, 0, 1, 14.2, -1, 0.0, 0, 0.0}, + {0, 0, -2, 0, 1, -13.6, -1, 0.0, 0, 0.0}, + {0, 0, 4, -2, 2, 12.7, 1, 0.0, 0, 0.0}, + {0, 1, 0, 0, 2, 409.2, 1, 0.0, 0, 0.0}, + {1, 1, 2, -2, 2, 22.5, 1, 0.0, -1, 0.0}, + {3, 0, 2, -2, 2, 8.7, 1, 0.0, 0, 0.0}, + {-2, 0, 2, 2, 2, 14.6, 1, 0.0, -1, 0.0}, + {-1, 0, 0, 0, 2, -27.3, 1, 0.0, -1, 0.0}, + {0, 0, -2, 2, 1, -169.0, 1, 0.0, 0, 0.0}, + {0, 1, 2, 0, 1, 13.1, 1, 0.0, 0, 0.0}, + {-1, 0, 4, 0, 2, 9.1, 1, 0.0, 0, 0.0}, + {2, 1, 0, -2, 0, 131.7, 1, 0.0, 0, 0.0}, + {2, 0, 0, 2, 0, 7.1, 1, 0.0, 0, 0.0}, + {2, 0, 2, -2, 1, 12.8, 1, 0.0, -1, 0.0}, + {2, 0, -2, 0, 1, -943.2, 1, 0.0, 0, 0.0}, + {1, -1, 0, -2, 0, -29.3, 1, 0.0, 0, 0.0}, + {-1, 0, 0, 1, 1, -388.3, 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}}; double ang; int i, j; *dpsi = *deps = 0.0; - for (i = 0; i<106; i++) + for (i = 0; i < 106; i++) { ang = 0.0; - for (j = 0; j<5; j++) ang += nut[i][j]*f[j]; - *dpsi += (nut[i][6]+nut[i][7]*t)*sin(ang); - *deps += (nut[i][8]+nut[i][9]*t)*cos(ang); + for (j = 0; j < 5; j++) ang += nut[i][j] * f[j]; + *dpsi += (nut[i][6] + nut[i][7] * t) * sin(ang); + *deps += (nut[i][8] + nut[i][9] * t) * cos(ang); } - *dpsi*=1e-4*AS2R; /* 0.1 mas -> rad */ - *deps*=1e-4*AS2R; + *dpsi *= 1e-4 * AS2R; /* 0.1 mas -> rad */ + *deps *= 1e-4 * AS2R; } @@ -2052,9 +2187,9 @@ void eci2ecef(gtime_t tutc, const double *erpv, double *U, double *gmst) trace(4, "eci2ecef: tutc=%s\n", time_str(tutc, 3)); - if (fabs(timediff(tutc, tutc_))<0.01) + if (fabs(timediff(tutc, tutc_)) < 0.01) { /* read cache */ - for (i = 0; i<9; i++) U[i] = U_[i]; + for (i = 0; i < 9; i++) U[i] = U_[i]; if (gmst) *gmst = gmst_; return; } @@ -2062,47 +2197,58 @@ void eci2ecef(gtime_t tutc, const double *erpv, double *U, double *gmst) /* terrestrial time */ tgps = utc2gpst(tutc_); - t = (timediff(tgps, epoch2time(ep2000))+19.0+32.184)/86400.0/36525.0; - t2 = t*t; t3 = t2*t; + t = (timediff(tgps, epoch2time(ep2000)) + 19.0 + 32.184) / 86400.0 / 36525.0; + t2 = t * t; + t3 = t2 * t; /* astronomical arguments */ ast_args(t, f); /* iau 1976 precession */ - ze = (2306.2181*t+0.30188*t2+0.017998*t3)*AS2R; - th = (2004.3109*t-0.42665*t2-0.041833*t3)*AS2R; - z = (2306.2181*t+1.09468*t2+0.018203*t3)*AS2R; - eps = (84381.448-46.8150*t-0.00059*t2+0.001813*t3)*AS2R; - Rz(-z, R1); Ry(th, R2); Rz(-ze, R3); + ze = (2306.2181 * t + 0.30188 * t2 + 0.017998 * t3) * AS2R; + th = (2004.3109 * t - 0.42665 * t2 - 0.041833 * t3) * AS2R; + z = (2306.2181 * t + 1.09468 * t2 + 0.018203 * t3) * AS2R; + eps = (84381.448 - 46.8150 * t - 0.00059 * t2 + 0.001813 * t3) * AS2R; + Rz(-z, R1); + Ry(th, R2); + Rz(-ze, R3); matmul("NN", 3, 3, 3, 1.0, R1, R2, 0.0, R); - matmul("NN", 3, 3, 3, 1.0, R, R3, 0.0, P); /* P=Rz(-z)*Ry(th)*Rz(-ze) */ + matmul("NN", 3, 3, 3, 1.0, R, R3, 0.0, P); /* P=Rz(-z)*Ry(th)*Rz(-ze) */ /* iau 1980 nutation */ nut_iau1980(t, f, &dpsi, &deps); - Rx(-eps-deps, R1); Rz(-dpsi, R2); Rx(eps, R3); + Rx(-eps - deps, R1); + Rz(-dpsi, R2); + Rx(eps, R3); matmul("NN", 3, 3, 3, 1.0, R1, R2, 0.0, R); - matmul("NN", 3, 3, 3, 1.0, R , R3, 0.0, N); /* N=Rx(-eps)*Rz(-dspi)*Rx(eps) */ + matmul("NN", 3, 3, 3, 1.0, R, R3, 0.0, N); /* N=Rx(-eps)*Rz(-dspi)*Rx(eps) */ /* greenwich aparent sidereal time (rad) */ gmst_ = utc2gmst(tutc_, erpv[2]); - gast = gmst_+dpsi*cos(eps); - gast += (0.00264*sin(f[4])+0.000063*sin(2.0*f[4]))*AS2R; + gast = gmst_ + dpsi * cos(eps); + gast += (0.00264 * sin(f[4]) + 0.000063 * sin(2.0 * f[4])) * AS2R; /* eci to ecef transformation matrix */ - Ry(-erpv[0], R1); Rx(-erpv[1], R2); Rz(gast, R3); - matmul("NN", 3, 3, 3, 1.0, R1, R2, 0.0, W ); - matmul("NN", 3, 3, 3, 1.0, W , R3, 0.0, R ); /* W=Ry(-xp)*Rx(-yp) */ - matmul("NN", 3, 3, 3, 1.0, N , P , 0.0, NP); - matmul("NN", 3, 3, 3, 1.0, R , NP, 0.0, U_); /* U=W*Rz(gast)*N*P */ + Ry(-erpv[0], R1); + Rx(-erpv[1], R2); + Rz(gast, R3); + matmul("NN", 3, 3, 3, 1.0, R1, R2, 0.0, W); + matmul("NN", 3, 3, 3, 1.0, W, R3, 0.0, R); /* W=Ry(-xp)*Rx(-yp) */ + matmul("NN", 3, 3, 3, 1.0, N, P, 0.0, NP); + matmul("NN", 3, 3, 3, 1.0, R, NP, 0.0, U_); /* U=W*Rz(gast)*N*P */ - for (i = 0; i<9; i++) U[i] = U_[i]; + for (i = 0; i < 9; i++) U[i] = U_[i]; if (gmst) *gmst = gmst_; trace(5, "gmst=%.12f gast=%.12f\n", gmst_, gast); - trace(5, "P=\n"); tracemat(5, P, 3, 3, 15, 12); - trace(5, "N=\n"); tracemat(5, N, 3, 3, 15, 12); - trace(5, "W=\n"); tracemat(5, W, 3, 3, 15, 12); - trace(5, "U=\n"); tracemat(5, U, 3, 3, 15, 12); + trace(5, "P=\n"); + tracemat(5, P, 3, 3, 15, 12); + trace(5, "N=\n"); + tracemat(5, N, 3, 3, 15, 12); + trace(5, "W=\n"); + tracemat(5, W, 3, 3, 15, 12); + trace(5, "U=\n"); + tracemat(5, U, 3, 3, 15, 12); } @@ -2111,27 +2257,29 @@ int decodef(char *p, int n, double *v) { int i; - for (i = 0; inmax <= pcvs->n) { pcvs->nmax += 256; - if (!(pcvs_pcv = (pcv_t *)realloc(pcvs->pcv, sizeof(pcv_t)*pcvs->nmax))) + if (!(pcvs_pcv = (pcv_t *)realloc(pcvs->pcv, sizeof(pcv_t) * pcvs->nmax))) { trace(1, "addpcv: memory allocation error\n"); - free(pcvs->pcv); pcvs->pcv = NULL; pcvs->n = pcvs->nmax = 0; + free(pcvs->pcv); + pcvs->pcv = NULL; + pcvs->n = pcvs->nmax = 0; return; } pcvs->pcv = pcvs_pcv; @@ -2144,8 +2292,8 @@ void addpcv(const pcv_t *pcv, pcvs_t *pcvs) int readngspcv(const char *file, pcvs_t *pcvs) { FILE *fp; - static const pcv_t pcv0 = {0, {}, {}, {0,0}, {0,0}, {{},{}}, {{},{}} }; - pcv_t pcv = {0, {}, {}, {0,0}, {0,0}, {{},{}}, {{},{}} }; + static const pcv_t pcv0 = {0, {}, {}, {0, 0}, {0, 0}, {{}, {}}, {{}, {}}}; + pcv_t pcv = {0, {}, {}, {0, 0}, {0, 0}, {{}, {}}, {{}, {}}}; double neu[3]; int n = 0; char buff[256]; @@ -2163,28 +2311,33 @@ int readngspcv(const char *file, pcvs_t *pcvs) if (++n == 1) { pcv = pcv0; - strncpy(pcv.type, buff, 61); pcv.type[61] = '\0'; + strncpy(pcv.type, buff, 61); + pcv.type[61] = '\0'; } else if (n == 2) { - if (decodef(buff, 3, neu)<3) continue; + if (decodef(buff, 3, neu) < 3) continue; pcv.off[0][0] = neu[1]; pcv.off[0][1] = neu[0]; pcv.off[0][2] = neu[2]; } - else if (n == 3) decodef(buff, 10, pcv.var[0]); - else if (n == 4) decodef(buff, 9, pcv.var[0]+10); + else if (n == 3) + decodef(buff, 10, pcv.var[0]); + else if (n == 4) + decodef(buff, 9, pcv.var[0] + 10); else if (n == 5) { - if (decodef(buff, 3, neu)<3) continue;; + if (decodef(buff, 3, neu) < 3) continue; + ; pcv.off[1][0] = neu[1]; pcv.off[1][1] = neu[0]; pcv.off[1][2] = neu[2]; } - else if (n == 6) decodef(buff, 10, pcv.var[1]); + else if (n == 6) + decodef(buff, 10, pcv.var[1]); else if (n == 7) { - decodef(buff, 9, pcv.var[1]+10); + decodef(buff, 9, pcv.var[1] + 10); addpcv(&pcv, pcvs); } } @@ -2198,8 +2351,8 @@ int readngspcv(const char *file, pcvs_t *pcvs) int readantex(const char *file, pcvs_t *pcvs) { FILE *fp; - static const pcv_t pcv0 = {0, {}, {}, {0,0}, {0,0}, {{},{}}, {{},{}} }; - pcv_t pcv = {0, {}, {}, {0,0}, {0,0}, {{},{}}, {{},{}} }; + static const pcv_t pcv0 = {0, {}, {}, {0, 0}, {0, 0}, {{}, {}}, {{}, {}}}; + pcv_t pcv = {0, {}, {}, {0, 0}, {0, 0}, {{}, {}}, {{}, {}}}; double neu[3]; int i, f, freq = 0, state = 0, freqs[] = {1, 2, 5, 6, 7, 8, 0}; char buff[256]; @@ -2213,60 +2366,63 @@ int readantex(const char *file, pcvs_t *pcvs) } while (fgets(buff, sizeof(buff), fp)) { - if (strlen(buff)<60 || strstr(buff+60, "COMMENT")) continue; + if (strlen(buff) < 60 || strstr(buff + 60, "COMMENT")) continue; - if (strstr(buff+60, "START OF ANTENNA")) + if (strstr(buff + 60, "START OF ANTENNA")) { pcv = pcv0; state = 1; } - if (strstr(buff+60, "END OF ANTENNA")) + if (strstr(buff + 60, "END OF ANTENNA")) { addpcv(&pcv, pcvs); state = 0; } if (!state) continue; - if (strstr(buff+60, "TYPE / SERIAL NO")) + if (strstr(buff + 60, "TYPE / SERIAL NO")) { - strncpy(pcv.type, buff , 20); pcv.type[20] = '\0'; - strncpy(pcv.code, buff+20, 20); pcv.code[20] = '\0'; - if (!strncmp(pcv.code+3, " ", 8)) + strncpy(pcv.type, buff, 20); + pcv.type[20] = '\0'; + strncpy(pcv.code, buff + 20, 20); + pcv.code[20] = '\0'; + if (!strncmp(pcv.code + 3, " ", 8)) { pcv.sat = satid2no(pcv.code); } } - else if (strstr(buff+60, "VALID FROM")) + else if (strstr(buff + 60, "VALID FROM")) { if (!str2time(buff, 0, 43, &pcv.ts)) continue; } - else if (strstr(buff+60, "VALID UNTIL")) + else if (strstr(buff + 60, "VALID UNTIL")) { if (!str2time(buff, 0, 43, &pcv.te)) continue; } - else if (strstr(buff+60, "START OF FREQUENCY")) + else if (strstr(buff + 60, "START OF FREQUENCY")) { - if (sscanf(buff+4, "%d", &f)<1) continue; - for (i = 0; in; i++) + for (i = 0; i < pcvs->n; i++) { - pcv = pcvs->pcv+i; + pcv = pcvs->pcv + i; trace(4, "sat=%2d type=%20s code=%s off=%8.4f %8.4f %8.4f %8.4f %8.4f %8.4f\n", - pcv->sat, pcv->type, pcv->code, pcv->off[0][0], pcv->off[0][1], - pcv->off[0][2], pcv->off[1][0], pcv->off[1][1], pcv->off[1][2]); + pcv->sat, pcv->type, pcv->code, pcv->off[0][0], pcv->off[0][1], + pcv->off[0][2], pcv->off[1][0], pcv->off[1][1], pcv->off[1][2]); } return stat; } @@ -2326,7 +2482,7 @@ int readpcv(const char *file, pcvs_t *pcvs) * return : antenna parameter (NULL: no antenna) *-----------------------------------------------------------------------------*/ pcv_t *searchpcv(int sat, const char *type, gtime_t time, - const pcvs_t *pcvs) + const pcvs_t *pcvs) { pcv_t *pcv; char buff[MAXANT] = "", *types[2], *p; @@ -2336,36 +2492,38 @@ pcv_t *searchpcv(int sat, const char *type, gtime_t time, if (sat) { /* search satellite antenna */ - for (i = 0; in; i++) + for (i = 0; i < pcvs->n; i++) { - pcv = pcvs->pcv+i; - if (pcv->sat != sat) continue; - if (pcv->ts.time != 0 && timediff(pcv->ts, time)>0.0) continue; - if (pcv->te.time != 0 && timediff(pcv->te, time)<0.0) continue; + pcv = pcvs->pcv + i; + if (pcv->sat != sat) continue; + if (pcv->ts.time != 0 && timediff(pcv->ts, time) > 0.0) continue; + if (pcv->te.time != 0 && timediff(pcv->te, time) < 0.0) continue; return pcv; } } else { - if(strlen(type) < MAXANT +1 ) strcpy(buff, type); + if (strlen(type) < MAXANT + 1) + strcpy(buff, type); else { trace(1, "type array is too long"); } - for (p = strtok(buff, " "); p && n<2; p = strtok(NULL, " ")) types[n++] = p; + for (p = strtok(buff, " "); p && n < 2; p = strtok(NULL, " ")) types[n++] = p; if (n <= 0) return NULL; /* search receiver antenna with radome at first */ - for (i = 0; in; i++) + for (i = 0; i < pcvs->n; i++) { - pcv = pcvs->pcv+i; - for (j = 0; jtype, types[j])) break; + pcv = pcvs->pcv + i; + for (j = 0; j < n; j++) + if (!strstr(pcv->type, types[j])) break; if (j >= n) return pcv; } /* search receiver antenna without radome */ - for (i = 0; in; i++) + for (i = 0; i < pcvs->n; i++) { - pcv = pcvs->pcv+i; + pcv = pcvs->pcv + i; if (strstr(pcv->type, types[0]) != pcv->type) continue; trace(2, "pcv without radome is used type=%s\n", type); @@ -2400,20 +2558,22 @@ void readpos(const char *file, const char *rcv, double *pos) fprintf(stderr, "reference position file open error : %s\n", file); return; } - while (np<2048 && fgets(buff, sizeof(buff), fp)) + while (np < 2048 && fgets(buff, sizeof(buff), fp)) { if (buff[0] == '%' || buff[0] == '#') continue; if (sscanf(buff, "%lf %lf %lf %s", &poss[np][0], &poss[np][1], &poss[np][2], - str)<4) continue; - strncpy(stas[np], str, 15); stas[np++][15] = '\0'; + str) < 4) continue; + strncpy(stas[np], str, 15); + stas[np++][15] = '\0'; } fclose(fp); len = (int)strlen(rcv); - for (i = 0; in >= erp->nmax) { - erp->nmax = erp->nmax <= 0 ? 128 : erp->nmax*2; - erp_data = (erpd_t *)realloc(erp->data, sizeof(erpd_t)*erp->nmax); + erp->nmax = erp->nmax <= 0 ? 128 : erp->nmax * 2; + erp_data = (erpd_t *)realloc(erp->data, sizeof(erpd_t) * erp->nmax); if (!erp_data) { - free(erp->data); erp->data = NULL; erp->n = erp->nmax = 0; + free(erp->data); + erp->data = NULL; + erp->n = erp->nmax = 0; fclose(fp); return 0; } erp->data = erp_data; } erp->data[erp->n].mjd = v[0]; - erp->data[erp->n].xp = v[1]*1e-6*AS2R; - erp->data[erp->n].yp = v[2]*1e-6*AS2R; - erp->data[erp->n].ut1_utc = v[3]*1e-7; - erp->data[erp->n].lod = v[4]*1e-7; - erp->data[erp->n].xpr = v[12]*1e-6*AS2R; - erp->data[erp->n++].ypr = v[13]*1e-6*AS2R; + erp->data[erp->n].xp = v[1] * 1e-6 * AS2R; + erp->data[erp->n].yp = v[2] * 1e-6 * AS2R; + erp->data[erp->n].ut1_utc = v[3] * 1e-7; + erp->data[erp->n].lod = v[4] * 1e-7; + erp->data[erp->n].xpr = v[12] * 1e-6 * AS2R; + erp->data[erp->n++].ypr = v[13] * 1e-6 * AS2R; } fclose(fp); return 1; } - /* get earth rotation parameter values ----------------------------------------- * get earth rotation parameter values * args : erp_t *erp I earth rotation parameters @@ -2550,43 +2714,46 @@ int geterp(const erp_t *erp, gtime_t time, double *erpv) if (erp->n <= 0) return 0; - mjd = 51544.5+(timediff(gpst2utc(time), epoch2time(ep)))/86400.0; + mjd = 51544.5 + (timediff(gpst2utc(time), epoch2time(ep))) / 86400.0; if (mjd <= erp->data[0].mjd) { - day = mjd-erp->data[0].mjd; - erpv[0] = erp->data[0].xp +erp->data[0].xpr*day; - erpv[1] = erp->data[0].yp +erp->data[0].ypr*day; - erpv[2] = erp->data[0].ut1_utc-erp->data[0].lod*day; + day = mjd - erp->data[0].mjd; + erpv[0] = erp->data[0].xp + erp->data[0].xpr * day; + erpv[1] = erp->data[0].yp + erp->data[0].ypr * day; + erpv[2] = erp->data[0].ut1_utc - erp->data[0].lod * day; erpv[3] = erp->data[0].lod; return 1; } - if (mjd >= erp->data[erp->n-1].mjd) + if (mjd >= erp->data[erp->n - 1].mjd) { - day = mjd-erp->data[erp->n-1].mjd; - erpv[0] = erp->data[erp->n-1].xp +erp->data[erp->n-1].xpr*day; - erpv[1] = erp->data[erp->n-1].yp +erp->data[erp->n-1].ypr*day; - erpv[2] = erp->data[erp->n-1].ut1_utc-erp->data[erp->n-1].lod*day; - erpv[3] = erp->data[erp->n-1].lod; + day = mjd - erp->data[erp->n - 1].mjd; + erpv[0] = erp->data[erp->n - 1].xp + erp->data[erp->n - 1].xpr * day; + erpv[1] = erp->data[erp->n - 1].yp + erp->data[erp->n - 1].ypr * day; + erpv[2] = erp->data[erp->n - 1].ut1_utc - erp->data[erp->n - 1].lod * day; + erpv[3] = erp->data[erp->n - 1].lod; return 1; } - for (j = 0, k = erp->n-1; jn - 1; j < k - 1;) { - i = (j+k)/2; - if (mjddata[i].mjd) k = i; else j = i; + i = (j + k) / 2; + if (mjd < erp->data[i].mjd) + k = i; + else + j = i; } - if (erp->data[j].mjd == erp->data[j+1].mjd) + if (erp->data[j].mjd == erp->data[j + 1].mjd) { a = 0.5; } else { - a = (mjd-erp->data[j].mjd)/(erp->data[j+1].mjd-erp->data[j].mjd); + a = (mjd - erp->data[j].mjd) / (erp->data[j + 1].mjd - erp->data[j].mjd); } - erpv[0] = (1.0-a)*erp->data[j].xp +a*erp->data[j+1].xp; - erpv[1] = (1.0-a)*erp->data[j].yp +a*erp->data[j+1].yp; - erpv[2] = (1.0-a)*erp->data[j].ut1_utc+a*erp->data[j+1].ut1_utc; - erpv[3] = (1.0-a)*erp->data[j].lod +a*erp->data[j+1].lod; + erpv[0] = (1.0 - a) * erp->data[j].xp + a * erp->data[j + 1].xp; + erpv[1] = (1.0 - a) * erp->data[j].yp + a * erp->data[j + 1].yp; + erpv[2] = (1.0 - a) * erp->data[j].ut1_utc + a * erp->data[j + 1].ut1_utc; + erpv[3] = (1.0 - a) * erp->data[j].lod + a * erp->data[j + 1].lod; return 1; } @@ -2594,9 +2761,7 @@ int geterp(const erp_t *erp, gtime_t time, double *erpv) int cmpeph(const void *p1, const void *p2) { eph_t *q1 = (eph_t *)p1, *q2 = (eph_t *)p2; - return q1->ttr.time != q2->ttr.time ? (int)(q1->ttr.time-q2->ttr.time) : - (q1->toe.time != q2->toe.time ? (int)(q1->toe.time-q2->toe.time) : - q1->sat-q2->sat); + return q1->ttr.time != q2->ttr.time ? (int)(q1->ttr.time - q2->ttr.time) : (q1->toe.time != q2->toe.time ? (int)(q1->toe.time - q2->toe.time) : q1->sat - q2->sat); } @@ -2604,7 +2769,7 @@ int cmpeph(const void *p1, const void *p2) void uniqeph(nav_t *nav) { eph_t *nav_eph; - int i,j; + int i, j; trace(3, "uniqeph: n=%d\n", nav->n); @@ -2612,20 +2777,22 @@ void uniqeph(nav_t *nav) qsort(nav->eph, nav->n, sizeof(eph_t), cmpeph); - for (i = 1, j = 0; in; i++) + for (i = 1, j = 0; i < nav->n; i++) { if (nav->eph[i].sat != nav->eph[j].sat || - nav->eph[i].iode != nav->eph[j].iode) + nav->eph[i].iode != nav->eph[j].iode) { nav->eph[++j] = nav->eph[i]; } } - nav->n = j+1; + nav->n = j + 1; - if (!(nav_eph = (eph_t *)realloc(nav->eph, sizeof(eph_t)*nav->n))) + if (!(nav_eph = (eph_t *)realloc(nav->eph, sizeof(eph_t) * nav->n))) { trace(1, "uniqeph malloc error n=%d\n", nav->n); - free(nav->eph); nav->eph = NULL; nav->n = nav->nmax = 0; + free(nav->eph); + nav->eph = NULL; + nav->n = nav->nmax = 0; return; } nav->eph = nav_eph; @@ -2639,9 +2806,7 @@ void uniqeph(nav_t *nav) int cmpgeph(const void *p1, const void *p2) { geph_t *q1 = (geph_t *)p1, *q2 = (geph_t *)p2; - return q1->tof.time != q2->tof.time ? (int)(q1->tof.time-q2->tof.time) : - (q1->toe.time != q2->toe.time ? (int)(q1->toe.time-q2->toe.time) : - q1->sat-q2->sat); + return q1->tof.time != q2->tof.time ? (int)(q1->tof.time - q2->tof.time) : (q1->toe.time != q2->toe.time ? (int)(q1->toe.time - q2->toe.time) : q1->sat - q2->sat); } @@ -2657,21 +2822,23 @@ void uniqgeph(nav_t *nav) qsort(nav->geph, nav->ng, sizeof(geph_t), cmpgeph); - for (i = j = 0; ing; i++) + for (i = j = 0; i < nav->ng; i++) { if (nav->geph[i].sat != nav->geph[j].sat || - nav->geph[i].toe.time != nav->geph[j].toe.time || - nav->geph[i].svh != nav->geph[j].svh) + nav->geph[i].toe.time != nav->geph[j].toe.time || + nav->geph[i].svh != nav->geph[j].svh) { nav->geph[++j] = nav->geph[i]; } } - nav->ng = j+1; + nav->ng = j + 1; - if (!(nav_geph = (geph_t *)realloc(nav->geph, sizeof(geph_t)*nav->ng))) + if (!(nav_geph = (geph_t *)realloc(nav->geph, sizeof(geph_t) * nav->ng))) { trace(1, "uniqgeph malloc error ng=%d\n", nav->ng); - free(nav->geph); nav->geph = NULL; nav->ng = nav->ngmax = 0; + free(nav->geph); + nav->geph = NULL; + nav->ng = nav->ngmax = 0; return; } nav->geph = nav_geph; @@ -2685,9 +2852,7 @@ void uniqgeph(nav_t *nav) int cmpseph(const void *p1, const void *p2) { seph_t *q1 = (seph_t *)p1, *q2 = (seph_t *)p2; - return q1->tof.time != q2->tof.time ? (int)(q1->tof.time-q2->tof.time) : - (q1->t0.time != q2->t0.time ? (int)(q1->t0.time-q2->t0.time) : - q1->sat-q2->sat); + return q1->tof.time != q2->tof.time ? (int)(q1->tof.time - q2->tof.time) : (q1->t0.time != q2->t0.time ? (int)(q1->t0.time - q2->t0.time) : q1->sat - q2->sat); } @@ -2703,20 +2868,22 @@ void uniqseph(nav_t *nav) qsort(nav->seph, nav->ns, sizeof(seph_t), cmpseph); - for (i = j = 0; ins; i++) + for (i = j = 0; i < nav->ns; i++) { if (nav->seph[i].sat != nav->seph[j].sat || - nav->seph[i].t0.time != nav->seph[j].t0.time) + nav->seph[i].t0.time != nav->seph[j].t0.time) { nav->seph[++j] = nav->seph[i]; } } - nav->ns = j+1; + nav->ns = j + 1; - if (!(nav_seph = (seph_t *)realloc(nav->seph, sizeof(seph_t)*nav->ns))) + if (!(nav_seph = (seph_t *)realloc(nav->seph, sizeof(seph_t) * nav->ns))) { trace(1, "uniqseph malloc error ns=%d\n", nav->ns); - free(nav->seph); nav->seph = NULL; nav->ns = nav->nsmax = 0; + free(nav->seph); + nav->seph = NULL; + nav->ns = nav->nsmax = 0; return; } nav->seph = nav_seph; @@ -2738,15 +2905,16 @@ void uniqnav(nav_t *nav) trace(3, "uniqnav: neph=%d ngeph=%d nseph=%d\n", nav->n, nav->ng, nav->ns); /* unique ephemeris */ - uniqeph (nav); + uniqeph(nav); uniqgeph(nav); uniqseph(nav); /* update carrier wave length */ - for (i = 0; ilam[i][j] = satwavelen(i+1, j, nav); - } + for (i = 0; i < MAXSAT; i++) + for (j = 0; j < NFREQ; j++) + { + nav->lam[i][j] = satwavelen(i + 1, j, nav); + } } @@ -2755,9 +2923,9 @@ int cmpobs(const void *p1, const void *p2) { obsd_t *q1 = (obsd_t *)p1, *q2 = (obsd_t *)p2; double tt = timediff(q1->time, q2->time); - if (fabs(tt)>DTTOL) return tt<0 ? -1 : 1; - if (q1->rcv != q2->rcv) return (int)q1->rcv-(int)q2->rcv; - return (int)q1->sat-(int)q2->sat; + if (fabs(tt) > DTTOL) return tt < 0 ? -1 : 1; + if (q1->rcv != q2->rcv) return (int)q1->rcv - (int)q2->rcv; + return (int)q1->sat - (int)q2->sat; } @@ -2777,22 +2945,22 @@ int sortobs(obs_t *obs) qsort(obs->data, obs->n, sizeof(obsd_t), cmpobs); /* delete duplicated data */ - for (i = j = 0; in; i++) + for (i = j = 0; i < obs->n; i++) { if (obs->data[i].sat != obs->data[j].sat || - obs->data[i].rcv != obs->data[j].rcv || - timediff(obs->data[i].time, obs->data[j].time) != 0.0) + obs->data[i].rcv != obs->data[j].rcv || + timediff(obs->data[i].time, obs->data[j].time) != 0.0) { obs->data[++j] = obs->data[i]; } } - obs->n = j+1; + obs->n = j + 1; - for (i = n = 0; in; i = j, n++) + for (i = n = 0; i < obs->n; i = j, n++) { - for (j = i+1; jn; j++) + for (j = i + 1; j < obs->n; j++) { - if (timediff(obs->data[j].time, obs->data[i].time)>DTTOL) break; + if (timediff(obs->data[j].time, obs->data[i].time) > DTTOL) break; } } return n; @@ -2809,9 +2977,9 @@ int sortobs(obs_t *obs) *-----------------------------------------------------------------------------*/ int screent(gtime_t time, gtime_t ts, gtime_t te, double tint) { - return (tint <= 0.0 || fmod(time2gpst(time, NULL)+DTTOL, tint) <= DTTOL*2.0) && - (ts.time == 0 || timediff(time, ts) >= -DTTOL) && - (te.time == 0 || timediff(time, te)< DTTOL); + return (tint <= 0.0 || fmod(time2gpst(time, NULL) + DTTOL, tint) <= DTTOL * 2.0) && + (ts.time == 0 || timediff(time, ts) >= -DTTOL) && + (te.time == 0 || timediff(time, te) < DTTOL); } @@ -2825,7 +2993,7 @@ int readnav(const char *file, nav_t *nav) { FILE *fp; 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}; char buff[4096], *p; long toe_time, tof_time, toc_time, ttr_time; @@ -2839,56 +3007,61 @@ int readnav(const char *file, nav_t *nav) { if (!strncmp(buff, "IONUTC", 6)) { - for (i = 0; i<8; i++) nav->ion_gps[i] = 0.0; - for (i = 0; i<4; i++) nav->utc_gps[i] = 0.0; + for (i = 0; i < 8; i++) nav->ion_gps[i] = 0.0; + for (i = 0; i < 4; i++) nav->utc_gps[i] = 0.0; nav->leaps = 0; sscanf(buff, "IONUTC,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%d", - &nav->ion_gps[0], &nav->ion_gps[1], &nav->ion_gps[2], &nav->ion_gps[3], - &nav->ion_gps[4], &nav->ion_gps[5], &nav->ion_gps[6], &nav->ion_gps[7], - &nav->utc_gps[0], &nav->utc_gps[1], &nav->utc_gps[2], &nav->utc_gps[3], - &nav->leaps); + &nav->ion_gps[0], &nav->ion_gps[1], &nav->ion_gps[2], &nav->ion_gps[3], + &nav->ion_gps[4], &nav->ion_gps[5], &nav->ion_gps[6], &nav->ion_gps[7], + &nav->utc_gps[0], &nav->utc_gps[1], &nav->utc_gps[2], &nav->utc_gps[3], + &nav->leaps); continue; } - if ((p = strchr(buff, ','))) *p = '\0'; else continue; + if ((p = strchr(buff, ','))) + *p = '\0'; + else + continue; if (!(sat = satid2no(buff))) continue; if (satsys(sat, &prn) == SYS_GLO) { - nav->geph[prn-1] = geph0; - nav->geph[prn-1].sat = sat; + nav->geph[prn - 1] = geph0; + nav->geph[prn - 1].sat = sat; toe_time = tof_time = 0; - sscanf(p+1, "%d,%d,%d,%d,%d,%ld,%ld,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf," + sscanf(p + 1, + "%d,%d,%d,%d,%d,%ld,%ld,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf," "%lf,%lf,%lf,%lf", - &nav->geph[prn-1].iode, &nav->geph[prn-1].frq, &nav->geph[prn-1].svh, - &nav->geph[prn-1].sva, &nav->geph[prn-1].age, - &toe_time, &tof_time, - &nav->geph[prn-1].pos[0], &nav->geph[prn-1].pos[1], &nav->geph[prn-1].pos[2], - &nav->geph[prn-1].vel[0], &nav->geph[prn-1].vel[1], &nav->geph[prn-1].vel[2], - &nav->geph[prn-1].acc[0], &nav->geph[prn-1].acc[1], &nav->geph[prn-1].acc[2], - &nav->geph[prn-1].taun , &nav->geph[prn-1].gamn , &nav->geph[prn-1].dtaun); - nav->geph[prn-1].toe.time = toe_time; - nav->geph[prn-1].tof.time = tof_time; + &nav->geph[prn - 1].iode, &nav->geph[prn - 1].frq, &nav->geph[prn - 1].svh, + &nav->geph[prn - 1].sva, &nav->geph[prn - 1].age, + &toe_time, &tof_time, + &nav->geph[prn - 1].pos[0], &nav->geph[prn - 1].pos[1], &nav->geph[prn - 1].pos[2], + &nav->geph[prn - 1].vel[0], &nav->geph[prn - 1].vel[1], &nav->geph[prn - 1].vel[2], + &nav->geph[prn - 1].acc[0], &nav->geph[prn - 1].acc[1], &nav->geph[prn - 1].acc[2], + &nav->geph[prn - 1].taun, &nav->geph[prn - 1].gamn, &nav->geph[prn - 1].dtaun); + nav->geph[prn - 1].toe.time = toe_time; + nav->geph[prn - 1].tof.time = tof_time; } else { - nav->eph[sat-1] = eph0; - nav->eph[sat-1].sat = sat; + nav->eph[sat - 1] = eph0; + nav->eph[sat - 1].sat = sat; toe_time = toc_time = ttr_time = 0; - sscanf(p+1, "%d,%d,%d,%d,%ld,%ld,%ld,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf," + sscanf(p + 1, + "%d,%d,%d,%d,%ld,%ld,%ld,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf," "%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%d,%d", - &nav->eph[sat-1].iode, &nav->eph[sat-1].iodc, &nav->eph[sat-1].sva , - &nav->eph[sat-1].svh , - &toe_time, &toc_time, &ttr_time, - &nav->eph[sat-1].A , &nav->eph[sat-1].e , &nav->eph[sat-1].i0 , - &nav->eph[sat-1].OMG0, &nav->eph[sat-1].omg , &nav->eph[sat-1].M0 , - &nav->eph[sat-1].deln, &nav->eph[sat-1].OMGd, &nav->eph[sat-1].idot, - &nav->eph[sat-1].crc , &nav->eph[sat-1].crs , &nav->eph[sat-1].cuc , - &nav->eph[sat-1].cus , &nav->eph[sat-1].cic , &nav->eph[sat-1].cis , - &nav->eph[sat-1].toes, &nav->eph[sat-1].fit , &nav->eph[sat-1].f0 , - &nav->eph[sat-1].f1 , &nav->eph[sat-1].f2 , &nav->eph[sat-1].tgd[0], - &nav->eph[sat-1].code, &nav->eph[sat-1].flag); - nav->eph[sat-1].toe.time = toe_time; - nav->eph[sat-1].toc.time = toc_time; - nav->eph[sat-1].ttr.time = ttr_time; + &nav->eph[sat - 1].iode, &nav->eph[sat - 1].iodc, &nav->eph[sat - 1].sva, + &nav->eph[sat - 1].svh, + &toe_time, &toc_time, &ttr_time, + &nav->eph[sat - 1].A, &nav->eph[sat - 1].e, &nav->eph[sat - 1].i0, + &nav->eph[sat - 1].OMG0, &nav->eph[sat - 1].omg, &nav->eph[sat - 1].M0, + &nav->eph[sat - 1].deln, &nav->eph[sat - 1].OMGd, &nav->eph[sat - 1].idot, + &nav->eph[sat - 1].crc, &nav->eph[sat - 1].crs, &nav->eph[sat - 1].cuc, + &nav->eph[sat - 1].cus, &nav->eph[sat - 1].cic, &nav->eph[sat - 1].cis, + &nav->eph[sat - 1].toes, &nav->eph[sat - 1].fit, &nav->eph[sat - 1].f0, + &nav->eph[sat - 1].f1, &nav->eph[sat - 1].f2, &nav->eph[sat - 1].tgd[0], + &nav->eph[sat - 1].code, &nav->eph[sat - 1].flag); + nav->eph[sat - 1].toe.time = toe_time; + nav->eph[sat - 1].toc.time = toc_time; + nav->eph[sat - 1].ttr.time = ttr_time; } } fclose(fp); @@ -2896,7 +3069,7 @@ int readnav(const char *file, nav_t *nav) } -int savenav(const char *file, const nav_t *nav) +int savenav(const char *file, const nav_t *nav) { FILE *fp; int i; @@ -2906,43 +3079,46 @@ int savenav(const char *file, const nav_t *nav) if (!(fp = fopen(file, "w"))) return 0; - for (i = 0; ieph[i].ttr.time == 0) continue; satno2id(nav->eph[i].sat, id); - fprintf(fp, "%s,%d,%d,%d,%d,%d,%d,%d,%.14E,%.14E,%.14E,%.14E,%.14E,%.14E," - "%.14E,%.14E,%.14E,%.14E,%.14E,%.14E,%.14E,%.14E,%.14E,%.14E," - "%.14E,%.14E,%.14E,%.14E,%.14E,%d,%d\n", - id, nav->eph[i].iode, nav->eph[i].iodc, nav->eph[i].sva , - nav->eph[i].svh , (int)nav->eph[i].toe.time, - (int)nav->eph[i].toc.time, (int)nav->eph[i].ttr.time, - nav->eph[i].A , nav->eph[i].e , nav->eph[i].i0 , nav->eph[i].OMG0, - nav->eph[i].omg , nav->eph[i].M0 , nav->eph[i].deln, nav->eph[i].OMGd, - nav->eph[i].idot, nav->eph[i].crc, nav->eph[i].crs , nav->eph[i].cuc , - nav->eph[i].cus , nav->eph[i].cic, nav->eph[i].cis , nav->eph[i].toes, - nav->eph[i].fit , nav->eph[i].f0 , nav->eph[i].f1 , nav->eph[i].f2 , - nav->eph[i].tgd[0], nav->eph[i].code, nav->eph[i].flag); + fprintf(fp, + "%s,%d,%d,%d,%d,%d,%d,%d,%.14E,%.14E,%.14E,%.14E,%.14E,%.14E," + "%.14E,%.14E,%.14E,%.14E,%.14E,%.14E,%.14E,%.14E,%.14E,%.14E," + "%.14E,%.14E,%.14E,%.14E,%.14E,%d,%d\n", + id, nav->eph[i].iode, nav->eph[i].iodc, nav->eph[i].sva, + nav->eph[i].svh, (int)nav->eph[i].toe.time, + (int)nav->eph[i].toc.time, (int)nav->eph[i].ttr.time, + nav->eph[i].A, nav->eph[i].e, nav->eph[i].i0, nav->eph[i].OMG0, + nav->eph[i].omg, nav->eph[i].M0, nav->eph[i].deln, nav->eph[i].OMGd, + nav->eph[i].idot, nav->eph[i].crc, nav->eph[i].crs, nav->eph[i].cuc, + nav->eph[i].cus, nav->eph[i].cic, nav->eph[i].cis, nav->eph[i].toes, + nav->eph[i].fit, nav->eph[i].f0, nav->eph[i].f1, nav->eph[i].f2, + nav->eph[i].tgd[0], nav->eph[i].code, nav->eph[i].flag); } - for (i = 0; igeph[i].tof.time == 0) continue; satno2id(nav->geph[i].sat, id); - fprintf(fp, "%s,%d,%d,%d,%d,%d,%d,%d,%.14E,%.14E,%.14E,%.14E,%.14E,%.14E," - "%.14E,%.14E,%.14E,%.14E,%.14E,%.14E\n", - id, nav->geph[i].iode, nav->geph[i].frq, nav->geph[i].svh, - nav->geph[i].sva, nav->geph[i].age, (int)nav->geph[i].toe.time, - (int)nav->geph[i].tof.time, - nav->geph[i].pos[0], nav->geph[i].pos[1], nav->geph[i].pos[2], - nav->geph[i].vel[0], nav->geph[i].vel[1], nav->geph[i].vel[2], - nav->geph[i].acc[0], nav->geph[i].acc[1], nav->geph[i].acc[2], - nav->geph[i].taun, nav->geph[i].gamn, nav->geph[i].dtaun); + fprintf(fp, + "%s,%d,%d,%d,%d,%d,%d,%d,%.14E,%.14E,%.14E,%.14E,%.14E,%.14E," + "%.14E,%.14E,%.14E,%.14E,%.14E,%.14E\n", + id, nav->geph[i].iode, nav->geph[i].frq, nav->geph[i].svh, + nav->geph[i].sva, nav->geph[i].age, (int)nav->geph[i].toe.time, + (int)nav->geph[i].tof.time, + nav->geph[i].pos[0], nav->geph[i].pos[1], nav->geph[i].pos[2], + nav->geph[i].vel[0], nav->geph[i].vel[1], nav->geph[i].vel[2], + nav->geph[i].acc[0], nav->geph[i].acc[1], nav->geph[i].acc[2], + nav->geph[i].taun, nav->geph[i].gamn, nav->geph[i].dtaun); } - fprintf(fp,"IONUTC,%.14E,%.14E,%.14E,%.14E,%.14E,%.14E,%.14E,%.14E,%.14E," - "%.14E,%.14E,%.14E,%d", - nav->ion_gps[0], nav->ion_gps[1], nav->ion_gps[2], nav->ion_gps[3], - nav->ion_gps[4], nav->ion_gps[5], nav->ion_gps[6], nav->ion_gps[7], - nav->utc_gps[0], nav->utc_gps[1], nav->utc_gps[2], nav->utc_gps[3], - nav->leaps); + fprintf(fp, + "IONUTC,%.14E,%.14E,%.14E,%.14E,%.14E,%.14E,%.14E,%.14E,%.14E," + "%.14E,%.14E,%.14E,%d", + nav->ion_gps[0], nav->ion_gps[1], nav->ion_gps[2], nav->ion_gps[3], + nav->ion_gps[4], nav->ion_gps[5], nav->ion_gps[6], nav->ion_gps[7], + nav->utc_gps[0], nav->utc_gps[1], nav->utc_gps[2], nav->utc_gps[3], + nav->leaps); fclose(fp); return 1; @@ -2956,7 +3132,9 @@ int savenav(const char *file, const nav_t *nav) *-----------------------------------------------------------------------------*/ void freeobs(obs_t *obs) { - free(obs->data); obs->data = NULL; obs->n = obs->nmax = 0; + free(obs->data); + obs->data = NULL; + obs->n = obs->nmax = 0; } @@ -2972,26 +3150,66 @@ void freeobs(obs_t *obs) *-----------------------------------------------------------------------------*/ void freenav(nav_t *nav, int opt) { - if (opt&0x01) {free(nav->eph ); nav->eph = NULL; nav->n = nav->nmax = 0;} - if (opt&0x02) {free(nav->geph); nav->geph = NULL; nav->ng = nav->ngmax = 0;} - if (opt&0x04) {free(nav->seph); nav->seph = NULL; nav->ns = nav->nsmax = 0;} - if (opt&0x08) {free(nav->peph); nav->peph = NULL; nav->ne = nav->nemax = 0;} - if (opt&0x10) {free(nav->pclk); nav->pclk = NULL; nav->nc = nav->ncmax = 0;} - if (opt&0x20) {free(nav->alm ); nav->alm = NULL; nav->na = nav->namax = 0;} - if (opt&0x40) {free(nav->tec ); nav->tec = NULL; nav->nt = nav->ntmax = 0;} - if (opt&0x80) {free(nav->fcb ); nav->fcb = NULL; nav->nf = nav->nfmax = 0;} + if (opt & 0x01) + { + free(nav->eph); + nav->eph = NULL; + nav->n = nav->nmax = 0; + } + if (opt & 0x02) + { + free(nav->geph); + nav->geph = NULL; + nav->ng = nav->ngmax = 0; + } + if (opt & 0x04) + { + free(nav->seph); + nav->seph = NULL; + nav->ns = nav->nsmax = 0; + } + if (opt & 0x08) + { + free(nav->peph); + nav->peph = NULL; + nav->ne = nav->nemax = 0; + } + if (opt & 0x10) + { + free(nav->pclk); + nav->pclk = NULL; + nav->nc = nav->ncmax = 0; + } + if (opt & 0x20) + { + free(nav->alm); + nav->alm = NULL; + nav->na = nav->namax = 0; + } + if (opt & 0x40) + { + free(nav->tec); + nav->tec = NULL; + nav->nt = nav->ntmax = 0; + } + if (opt & 0x80) + { + free(nav->fcb); + nav->fcb = NULL; + nav->nf = nav->nfmax = 0; + } } /* debug trace functions -----------------------------------------------------*/ //#ifdef TRACE // -FILE *fp_trace = NULL; /* file pointer of trace */ -char file_trace[1024]; /* trace file */ -static int level_trace = 0; /* level of trace */ -unsigned int tick_trace = 0; /* tick time at traceopen (ms) */ -gtime_t time_trace = {0, 0.0}; /* time at traceopen */ -pthread_mutex_t lock_trace; /* lock for trace */ +FILE *fp_trace = NULL; /* file pointer of trace */ +char file_trace[1024]; /* trace file */ +static int level_trace = 0; /* level of trace */ +unsigned int tick_trace = 0; /* tick time at traceopen (ms) */ +gtime_t time_trace = {0, 0.0}; /* time at traceopen */ +pthread_mutex_t lock_trace; /* lock for trace */ void traceswap(void) { @@ -3001,7 +3219,7 @@ void traceswap(void) rtk_lock(&lock_trace); if ((int)(time2gpst(time, NULL) / INT_SWAP_TRAC) == - (int)(time2gpst(time_trace, NULL) / INT_SWAP_TRAC)) + (int)(time2gpst(time_trace, NULL) / INT_SWAP_TRAC)) { rtk_unlock(&lock_trace); return; @@ -3030,8 +3248,10 @@ void traceopen(const char *file) reppath(file, path, time, "", ""); if (!*path || !(fp_trace = fopen(path, "w"))) fp_trace = stderr; - if (strlen(file) < 1025) strcpy(file_trace, file); - else trace(1, "file array is too long"); + if (strlen(file) < 1025) + strcpy(file_trace, file); + else + trace(1, "file array is too long"); tick_trace = tickget(); time_trace = time; initlock(&lock_trace); @@ -3070,8 +3290,10 @@ void tracet(int level, const char *format, ...) va_list ap; if (!fp_trace || level > level_trace) return; traceswap(); - fprintf(fp_trace, "%d %9.3f: ", level, (tickget() - tick_trace) /1000.0); - va_start(ap, format); vfprintf(fp_trace, format, ap); va_end(ap); + fprintf(fp_trace, "%d %9.3f: ", level, (tickget() - tick_trace) / 1000.0); + va_start(ap, format); + vfprintf(fp_trace, format, ap); + va_end(ap); fflush(fp_trace); } @@ -3085,19 +3307,19 @@ void tracemat(int level, const double *A, int n, int m, int p, int q) void traceobs(int level __attribute__((unused)), const obsd_t *obs __attribute__((unused)), int n __attribute__((unused))) { -// char str[64],id[16]; -// int i; -// -// if (!fp_trace||level>level_trace) return; -// for (i=0;ilevel_trace) return; + // for (i=0;i bbbb : base station id *-----------------------------------------------------------------------------*/ 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}; int week, dow, doy, stat = 0; @@ -3311,35 +3537,50 @@ int reppath(const char *path, char *rpath, gtime_t time, const char *rov, strcpy(rpath, path); if (!strstr(rpath, "%")) return 0; - if (*rov ) stat|=repstr(rpath, "%r", rov ); - if (*base) stat|=repstr(rpath, "%b", base); + if (*rov) stat |= repstr(rpath, "%r", rov); + if (*base) stat |= repstr(rpath, "%b", base); if (time.time != 0) { time2epoch(time, ep); ep0[0] = ep[0]; - dow = (int)floor(time2gpst(time, &week)/86400.0); - doy = (int)floor(timediff(time, epoch2time(ep0))/86400.0)+1; - sprintf(rep, "%02d", ((int)ep[3]/3)*3); stat|=repstr(rpath, "%ha", rep); - sprintf(rep, "%02d", ((int)ep[3]/6)*6); stat|=repstr(rpath, "%hb", rep); - sprintf(rep, "%02d", ((int)ep[3]/12)*12); stat|=repstr(rpath, "%hc", rep); - sprintf(rep, "%04.0f", ep[0]); stat|=repstr(rpath, "%Y", rep); - sprintf(rep, "%02.0f", fmod(ep[0], 100.0)); stat|=repstr(rpath, "%y", rep); - sprintf(rep, "%02.0f", ep[1]); stat|=repstr(rpath, "%m", rep); - sprintf(rep, "%02.0f", ep[2]); stat|=repstr(rpath, "%d", rep); - sprintf(rep, "%02.0f", ep[3]); stat|=repstr(rpath, "%h", rep); - sprintf(rep, "%02.0f", ep[4]); stat|=repstr(rpath, "%M", rep); - sprintf(rep, "%02.0f", floor(ep[5])); stat|=repstr(rpath, "%S", rep); - sprintf(rep, "%03d", doy); stat|=repstr(rpath, "%n", rep); - sprintf(rep, "%04d", week); stat|=repstr(rpath, "%W", rep); - sprintf(rep, "%d", dow); stat|=repstr(rpath, "%D", rep); - sprintf(rep, "%c", 'a'+(int)ep[3]); stat|=repstr(rpath, "%H", rep); - sprintf(rep, "%02d", ((int)ep[4]/15)*15); stat|=repstr(rpath, "%t", rep); + dow = (int)floor(time2gpst(time, &week) / 86400.0); + doy = (int)floor(timediff(time, epoch2time(ep0)) / 86400.0) + 1; + sprintf(rep, "%02d", ((int)ep[3] / 3) * 3); + stat |= repstr(rpath, "%ha", rep); + sprintf(rep, "%02d", ((int)ep[3] / 6) * 6); + stat |= repstr(rpath, "%hb", rep); + sprintf(rep, "%02d", ((int)ep[3] / 12) * 12); + stat |= repstr(rpath, "%hc", rep); + sprintf(rep, "%04.0f", ep[0]); + stat |= repstr(rpath, "%Y", rep); + sprintf(rep, "%02.0f", fmod(ep[0], 100.0)); + stat |= repstr(rpath, "%y", rep); + sprintf(rep, "%02.0f", ep[1]); + stat |= repstr(rpath, "%m", rep); + sprintf(rep, "%02.0f", ep[2]); + stat |= repstr(rpath, "%d", rep); + sprintf(rep, "%02.0f", ep[3]); + stat |= repstr(rpath, "%h", rep); + sprintf(rep, "%02.0f", ep[4]); + stat |= repstr(rpath, "%M", rep); + sprintf(rep, "%02.0f", floor(ep[5])); + stat |= repstr(rpath, "%S", rep); + sprintf(rep, "%03d", doy); + stat |= repstr(rpath, "%n", rep); + sprintf(rep, "%04d", week); + stat |= repstr(rpath, "%W", rep); + sprintf(rep, "%d", dow); + stat |= repstr(rpath, "%D", rep); + sprintf(rep, "%c", 'a' + (int)ep[3]); + stat |= repstr(rpath, "%H", rep); + sprintf(rep, "%02d", ((int)ep[4] / 15) * 15); + stat |= repstr(rpath, "%t", rep); } else if (strstr(rpath, "%ha") || strstr(rpath, "%hb") || strstr(rpath, "%hc") || - strstr(rpath, "%Y" ) || strstr(rpath, "%y" ) || strstr(rpath, "%m" ) || - strstr(rpath, "%d" ) || strstr(rpath, "%h" ) || strstr(rpath, "%M" ) || - strstr(rpath, "%S" ) || strstr(rpath, "%n" ) || strstr(rpath, "%W" ) || - strstr(rpath, "%D" ) || strstr(rpath, "%H" ) || strstr(rpath, "%t" )) + strstr(rpath, "%Y") || strstr(rpath, "%y") || strstr(rpath, "%m") || + strstr(rpath, "%d") || strstr(rpath, "%h") || strstr(rpath, "%M") || + strstr(rpath, "%S") || strstr(rpath, "%n") || strstr(rpath, "%W") || + strstr(rpath, "%D") || strstr(rpath, "%H") || strstr(rpath, "%t")) { return -1; /* no valid time */ } @@ -3362,7 +3603,7 @@ int reppath(const char *path, char *rpath, gtime_t time, const char *rov, * minimum interval of time replaced is 900s. *-----------------------------------------------------------------------------*/ 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; double tow, tint = 86400.0; @@ -3370,21 +3611,23 @@ int reppaths(const char *path, char *rpath[], int nmax, gtime_t ts, trace(3, "reppaths: path =%s nmax=%d rov=%s base=%s\n", path, nmax, rov, base); - if (ts.time == 0 || te.time == 0 || timediff(ts, te)>0.0) return 0; + if (ts.time == 0 || te.time == 0 || timediff(ts, te) > 0.0) return 0; - if (strstr(path, "%S") || strstr(path, "%M") || strstr(path, "%t")) tint = 900.0; - else if (strstr(path, "%h") || strstr(path, "%H")) tint = 3600.0; + if (strstr(path, "%S") || strstr(path, "%M") || strstr(path, "%t")) + tint = 900.0; + else if (strstr(path, "%h") || strstr(path, "%H")) + tint = 3600.0; tow = time2gpst(ts, &week); - time = gpst2time(week, floor(tow/tint)*tint); + time = gpst2time(week, floor(tow / tint) * tint); - while (timediff(time, te) <= 0.0 && nng; i++) + for (i = 0; i < nav->ng; i++) { if (nav->geph[i].sat != sat) continue; - return SPEED_OF_LIGHT/(freq_glo[frq]+dfrq_glo[frq]*nav->geph[i].frq); + return SPEED_OF_LIGHT / (freq_glo[frq] + dfrq_glo[frq] * nav->geph[i].frq); } } else if (frq == 2) { /* L3 */ - return SPEED_OF_LIGHT/FREQ3_GLO; + return SPEED_OF_LIGHT / FREQ3_GLO; } } else if (sys == SYS_BDS) { - if (frq == 0) return SPEED_OF_LIGHT/FREQ1_BDS; /* B1 */ - else if (frq == 1) return SPEED_OF_LIGHT/FREQ2_BDS; /* B2 */ - else if (frq == 2) return SPEED_OF_LIGHT/FREQ3_BDS; /* B3 */ + if (frq == 0) + return SPEED_OF_LIGHT / FREQ1_BDS; /* B1 */ + else if (frq == 1) + return SPEED_OF_LIGHT / FREQ2_BDS; /* B2 */ + else if (frq == 2) + return SPEED_OF_LIGHT / FREQ3_BDS; /* B3 */ } else { - if (frq == 0) return SPEED_OF_LIGHT/FREQ1; /* L1/E1 */ - else if (frq == 1) return SPEED_OF_LIGHT/FREQ2; /* L2 */ - else if (frq == 2) return SPEED_OF_LIGHT/FREQ5; /* L5/E5a */ - else if (frq == 3) return SPEED_OF_LIGHT/FREQ6; /* L6/LEX */ - else if (frq == 4) return SPEED_OF_LIGHT/FREQ7; /* E5b */ - else if (frq == 5) return SPEED_OF_LIGHT/FREQ8; /* E5a+b */ - else if (frq == 6) return SPEED_OF_LIGHT/FREQ9; /* S */ + if (frq == 0) + return SPEED_OF_LIGHT / FREQ1; /* L1/E1 */ + else if (frq == 1) + return SPEED_OF_LIGHT / FREQ2; /* L2 */ + else if (frq == 2) + return SPEED_OF_LIGHT / FREQ5; /* L5/E5a */ + else if (frq == 3) + return SPEED_OF_LIGHT / FREQ6; /* L6/LEX */ + else if (frq == 4) + return SPEED_OF_LIGHT / FREQ7; /* E5b */ + else if (frq == 5) + return SPEED_OF_LIGHT / FREQ8; /* E5a+b */ + else if (frq == 6) + return SPEED_OF_LIGHT / FREQ9; /* S */ } return 0.0; } @@ -3450,11 +3703,11 @@ double geodist(const double *rs, const double *rr, double *e) double r; int i; - if (norm_rtk(rs, 3)-RE_WGS84) + if (pos[2] > -RE_WGS84) { ecef2enu(pos, e, enu); - az = dot(enu, enu, 2)<1e-12 ? 0.0 : atan2(enu[0], enu[1]); - if (az<0.0) az += 2*PI; + az = dot(enu, enu, 2) < 1e-12 ? 0.0 : atan2(enu[0], enu[1]); + if (az < 0.0) az += 2 * PI; el = asin(enu[2]); } - if (azel) {azel[0] = az; azel[1] = el;} + if (azel) + { + azel[0] = az; + azel[1] = el; + } return el; } @@ -3493,29 +3750,29 @@ double satazel(const double *pos, const double *e, double *azel) *-----------------------------------------------------------------------------*/ void dops(int ns, const double *azel, double elmin, double *dop) { - double H[4*MAXSAT], Q[16], cosel, sinel; + double H[4 * MAXSAT], Q[16], cosel, sinel; int i, n; - for (i = 0; i<4; i++) dop[i] = 0.0; - for (i = n = 0; i 0.416) phi = 0.416; - else if (phi<-0.416) phi = -0.416; - lam = pos[1]/PI+psi*sin(azel[0])/cos(phi*PI); + phi = pos[0] / PI + psi * cos(azel[0]); + if (phi > 0.416) + phi = 0.416; + else if (phi < -0.416) + phi = -0.416; + lam = pos[1] / PI + psi * sin(azel[0]) / cos(phi * PI); /* geomagnetic latitude (semi-circle) */ - phi += 0.064*cos((lam-1.617)*PI); + phi += 0.064 * cos((lam - 1.617) * PI); /* local time (s) */ - tt = 43200.0*lam+time2gpst(t, &week); - tt -= floor(tt/86400.0)*86400.0; /* 0 <= tt<86400 */ + tt = 43200.0 * lam + time2gpst(t, &week); + tt -= floor(tt / 86400.0) * 86400.0; /* 0 <= tt<86400 */ /* slant factor */ - f = 1.0+16.0*pow(0.53-azel[1]/PI, 3.0); + f = 1.0 + 16.0 * pow(0.53 - azel[1] / PI, 3.0); /* ionospheric delay */ - amp = ion[0]+phi*(ion[1]+phi*(ion[2]+phi*ion[3])); - per = ion[4]+phi*(ion[5]+phi*(ion[6]+phi*ion[7])); - amp = amp< 0.0 ? 0.0 : amp; - per = per<72000.0 ? 72000.0 : per; - x = 2.0*PI*(tt-50400.0)/per; + amp = ion[0] + phi * (ion[1] + phi * (ion[2] + phi * ion[3])); + per = ion[4] + phi * (ion[5] + phi * (ion[6] + phi * ion[7])); + amp = amp < 0.0 ? 0.0 : amp; + per = per < 72000.0 ? 72000.0 : per; + x = 2.0 * PI * (tt - 50400.0) / per; - return SPEED_OF_LIGHT*f*(fabs(x)<1.57 ? 5E-9+amp*(1.0+x*x*(-0.5+x*x/24.0)) : 5E-9); + return SPEED_OF_LIGHT * f * (fabs(x) < 1.57 ? 5E-9 + amp * (1.0 + x * x * (-0.5 + x * x / 24.0)) : 5E-9); } @@ -3580,7 +3838,7 @@ double ionmodel(gtime_t t, const double *ion, const double *pos, double ionmapf(const double *pos, const double *azel) { if (pos[2] >= HION) return 1.0; - return 1.0/cos(asin((RE_WGS84+pos[2])/(RE_WGS84+HION)*sin(PI/2.0-azel[1]))); + return 1.0 / cos(asin((RE_WGS84 + pos[2]) / (RE_WGS84 + HION) * sin(PI / 2.0 - azel[1]))); } @@ -3596,27 +3854,27 @@ double ionmapf(const double *pos, const double *azel) * fixing bug on ref [2] A.4.4.10.1 A-22,23 *-----------------------------------------------------------------------------*/ double ionppp(const double *pos, const double *azel, double re, - double hion, double *posp) + double hion, double *posp) { double cosaz, rp, ap, sinap, tanap; - rp = re/(re+hion)*cos(azel[1]); - ap = PI/2.0-azel[1]-asin(rp); + rp = re / (re + hion) * cos(azel[1]); + ap = PI / 2.0 - azel[1] - asin(rp); sinap = sin(ap); tanap = tan(ap); cosaz = cos(azel[0]); - posp[0] = asin(sin(pos[0])*cos(ap)+cos(pos[0])*sinap*cosaz); + posp[0] = asin(sin(pos[0]) * cos(ap) + cos(pos[0]) * sinap * cosaz); - if ((pos[0]> 70.0*D2R && tanap*cosaz>tan(PI/2.0-pos[0])) || - (pos[0]<-70.0*D2R && -tanap*cosaz>tan(PI/2.0+pos[0]))) + if ((pos[0] > 70.0 * D2R && tanap * cosaz > tan(PI / 2.0 - pos[0])) || + (pos[0] < -70.0 * D2R && -tanap * cosaz > tan(PI / 2.0 + pos[0]))) { - posp[1] = pos[1]+PI-asin(sinap*sin(azel[0])/cos(posp[0])); + posp[1] = pos[1] + PI - asin(sinap * sin(azel[0]) / cos(posp[0])); } else { - posp[1] = pos[1]+asin(sinap*sin(azel[0])/cos(posp[0])); + posp[1] = pos[1] + asin(sinap * sin(azel[0]) / cos(posp[0])); } - return 1.0/sqrt(1.0-rp*rp); + return 1.0 / sqrt(1.0 - rp * rp); } @@ -3629,65 +3887,67 @@ double ionppp(const double *pos, const double *azel, double re, * return : tropospheric delay (m) *-----------------------------------------------------------------------------*/ double tropmodel(gtime_t time __attribute__((unused)), const double *pos, const double *azel, - double humi) + double humi) { const double temp0 = 15.0; /* temparature at sea level */ double hgt, pres, temp, e, z, trph, trpw; - if (pos[2]<-100.0 || 1e44) return coef[4]; - return coef[i-1]*(1.0-lat/15.0+i)+coef[i]*(lat/15.0-i); + int i = (int)(lat / 15.0); + if (i < 1) + return coef[0]; + else if (i > 4) + return coef[4]; + return coef[i - 1] * (1.0 - lat / 15.0 + i) + coef[i] * (lat / 15.0 - i); } double mapf(double el, double a, double b, double c) { double sinel = sin(el); - return (1.0+a/(1.0+b/(1.0+c)))/(sinel+(a/(sinel+b/(sinel+c)))); + return (1.0 + a / (1.0 + b / (1.0 + c))) / (sinel + (a / (sinel + b / (sinel + c)))); } double nmf(gtime_t time, const double pos[], const double azel[], - double *mapfw) + double *mapfw) { /* ref [5] table 3 */ /* hydro-ave-a,b,c, hydro-amp-a,b,c, wet-a,b,c at latitude 15,30,45,60,75 */ const double coef[][5] = { - { 1.2769934E-3, 1.2683230E-3, 1.2465397E-3, 1.2196049E-3, 1.2045996E-3}, - { 2.9153695E-3, 2.9152299E-3, 2.9288445E-3, 2.9022565E-3, 2.9024912E-3}, - { 62.610505E-3, 62.837393E-3, 63.721774E-3, 63.824265E-3, 64.258455E-3}, + {1.2769934E-3, 1.2683230E-3, 1.2465397E-3, 1.2196049E-3, 1.2045996E-3}, + {2.9153695E-3, 2.9152299E-3, 2.9288445E-3, 2.9022565E-3, 2.9024912E-3}, + {62.610505E-3, 62.837393E-3, 63.721774E-3, 63.824265E-3, 64.258455E-3}, - { 0.0000000E-0, 1.2709626E-5, 2.6523662E-5, 3.4000452E-5, 4.1202191e-5}, - { 0.0000000E-0, 2.1414979E-5, 3.0160779E-5, 7.2562722E-5, 11.723375E-5}, - { 0.0000000E-0, 9.0128400E-5, 4.3497037E-5, 84.795348E-5, 170.37206E-5}, + {0.0000000E-0, 1.2709626E-5, 2.6523662E-5, 3.4000452E-5, 4.1202191e-5}, + {0.0000000E-0, 2.1414979E-5, 3.0160779E-5, 7.2562722E-5, 11.723375E-5}, + {0.0000000E-0, 9.0128400E-5, 4.3497037E-5, 84.795348E-5, 170.37206E-5}, - { 5.8021897E-4, 5.6794847E-4, 5.8118019E-4, 5.9727542E-4, 6.1641693E-4}, - { 1.4275268E-3, 1.5138625E-3, 1.4572752E-3, 1.5007428E-3, 1.7599082E-3}, - { 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 */ + {5.8021897E-4, 5.6794847E-4, 5.8118019E-4, 5.9727542E-4, 6.1641693E-4}, + {1.4275268E-3, 1.5138625E-3, 1.4572752E-3, 1.5007428E-3, 1.7599082E-3}, + {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 */ - double y, cosy, ah[3], aw[3], dm, el = azel[1], lat = pos[0]*R2D, hgt = pos[2]; + double y, cosy, ah[3], aw[3], dm, el = azel[1], lat = pos[0] * R2D, hgt = pos[2]; int i; if (el <= 0.0) @@ -3696,22 +3956,22 @@ double nmf(gtime_t time, const double pos[], const double azel[], return 0.0; } /* year from doy 28, added half a year for southern latitudes */ - y = (time2doy(time)-28.0)/365.25+(lat<0.0 ? 0.5 : 0.0); + y = (time2doy(time) - 28.0) / 365.25 + (lat < 0.0 ? 0.5 : 0.0); - cosy = cos(2.0*PI*y); + cosy = cos(2.0 * PI * y); lat = fabs(lat); - for (i = 0; i<3; i++) + for (i = 0; i < 3; i++) { - ah[i] = interpc(coef[i ], lat)-interpc(coef[i+3], lat)*cosy; - aw[i] = interpc(coef[i+6], lat); + ah[i] = interpc(coef[i], lat) - interpc(coef[i + 3], lat) * cosy; + aw[i] = interpc(coef[i + 6], lat); } /* ellipsoidal height is used instead of height above sea level */ - dm = (1.0/sin(el)-mapf(el, aht[0], aht[1], aht[2]))*hgt/1e3; + dm = (1.0 / sin(el) - mapf(el, aht[0], aht[1], aht[2])) * hgt / 1e3; if (mapfw) *mapfw = mapf(el, aw[0], aw[1], aw[2]); - return mapf(el, ah[0], ah[1], ah[2])+dm; + return mapf(el, ah[0], ah[1], ah[2]) + dm; } #endif /* !IERS_MODEL */ @@ -3729,26 +3989,26 @@ double nmf(gtime_t time, const double pos[], const double azel[], * ftp://web.haystack.edu/pub/aen/nmf/NMF_JGR.pdf *-----------------------------------------------------------------------------*/ double tropmapf(gtime_t time, const double pos[], const double azel[], - double *mapfw) + double *mapfw) { #ifdef IERS_MODEL const double ep[] = {2000, 1, 1, 12, 0, 0}; double mjd, lat, lon, hgt, zd, gmfh, gmfw; #endif trace(4, "tropmapf: pos=%10.6f %11.6f %6.1f azel=%5.1f %4.1f\n", - pos[0]*R2D, pos[1]*R2D, pos[2], azel[0]*R2D, azel[1]*R2D); + pos[0] * R2D, pos[1] * R2D, pos[2], azel[0] * R2D, azel[1] * R2D); - if (pos[2]<-1000.0 || pos[2]>20000.0) + if (pos[2] < -1000.0 || pos[2] > 20000.0) { if (mapfw) *mapfw = 0.0; return 0.0; } #ifdef IERS_MODEL - mjd = 51544.5+(timediff(time, epoch2time(ep)))/86400.0; + mjd = 51544.5 + (timediff(time, epoch2time(ep))) / 86400.0; lat = pos[0]; lon = pos[1]; - hgt = pos[2]-geoidh(pos); /* height in m (mean sea level) */ - zd = PI/2.0-azel[1]; + hgt = pos[2] - geoidh(pos); /* height in m (mean sea level) */ + zd = PI / 2.0 - azel[1]; /* call GMF */ gmf_(&mjd, &lat, &lon, &hgt, &zd, &gmfh, &gmfw); @@ -3764,10 +4024,13 @@ double tropmapf(gtime_t time, const double pos[], const double azel[], /* interpolate antenna phase center variation --------------------------------*/ double interpvar(double ang, const double *var) { - double a = ang/5.0; /* ang=0-90 */ + double a = ang / 5.0; /* ang=0-90 */ int i = (int)a; - if (i<0) return var[0]; else if (i >= 18) return var[18]; - return var[i]*(1.0-a+i)+var[i+1]*(a-i); + if (i < 0) + return var[0]; + else if (i >= 18) + return var[18]; + return var[i] * (1.0 - a + i) + var[i + 1] * (a - i); } @@ -3781,22 +4044,22 @@ double interpvar(double ang, const double *var) * notes : current version does not support azimuth dependent terms *-----------------------------------------------------------------------------*/ 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]); int i, 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); - e[0] = sin(azel[0])*cosel; - e[1] = cos(azel[0])*cosel; + e[0] = sin(azel[0]) * cosel; + e[1] = cos(azel[0]) * cosel; e[2] = sin(azel[1]); - for (i = 0;ioff[i][j]+del[j]; + for (j = 0; j < 3; j++) off[j] = pcv->off[i][j] + del[j]; - dant[i] = -dot(off, e, 3)+(opt ? interpvar(90.0-azel[1]*R2D, pcv->var[i]) : 0.0); + dant[i] = -dot(off, e, 3) + (opt ? interpvar(90.0 - azel[1] * R2D, pcv->var[i]) : 0.0); } trace(5, "antmodel: dant=%6.3f %6.3f\n", dant[0], dant[1]); } @@ -3813,11 +4076,11 @@ void antmodel_s(const pcv_t *pcv, double nadir, double *dant) { int i; - trace(4, "antmodel_s: nadir=%6.1f\n", nadir*R2D); + trace(4, "antmodel_s: nadir=%6.1f\n", nadir * R2D); - for (i = 0; ivar[i]); + dant[i] = interpvar(nadir * R2D * 5.0, pcv->var[i]); } trace(5, "antmodel_s: dant=%6.3f %6.3f\n", dant[0], dant[1]); } @@ -3831,42 +4094,47 @@ void sunmoonpos_eci(gtime_t tut, double *rsun, double *rmoon) trace(4, "sunmoonpos_eci: tut=%s\n", time_str(tut, 3)); - t = timediff(tut, epoch2time(ep2000))/86400.0/36525.0; + t = timediff(tut, epoch2time(ep2000)) / 86400.0 / 36525.0; /* astronomical arguments */ ast_args(t, f); /* obliquity of the ecliptic */ - eps = 23.439291-0.0130042*t; - sine = sin(eps*D2R); cose = cos(eps*D2R); + eps = 23.439291 - 0.0130042 * t; + sine = sin(eps * D2R); + cose = cos(eps * D2R); /* sun position in eci */ if (rsun) { - Ms = 357.5277233+35999.05034*t; - ls = 280.460+36000.770*t+1.914666471*sin(Ms*D2R)+0.019994643*sin(2.0*Ms*D2R); - rs = AU*(1.000140612-0.016708617*cos(Ms*D2R)-0.000139589*cos(2.0*Ms*D2R)); - sinl = sin(ls*D2R); cosl = cos(ls*D2R); - rsun[0] = rs*cosl; - rsun[1] = rs*cose*sinl; - rsun[2] = rs*sine*sinl; + Ms = 357.5277233 + 35999.05034 * t; + ls = 280.460 + 36000.770 * t + 1.914666471 * sin(Ms * D2R) + 0.019994643 * sin(2.0 * Ms * D2R); + rs = AU * (1.000140612 - 0.016708617 * cos(Ms * D2R) - 0.000139589 * cos(2.0 * Ms * D2R)); + sinl = sin(ls * D2R); + cosl = cos(ls * D2R); + rsun[0] = rs * cosl; + rsun[1] = rs * cose * sinl; + rsun[2] = rs * sine * sinl; trace(5, "rsun =%.3f %.3f %.3f\n", rsun[0], rsun[1], rsun[2]); } /* moon position in eci */ if (rmoon) { - lm = 218.32+481267.883*t+6.29*sin(f[0])-1.27*sin(f[0]-2.0*f[3])+ - 0.66*sin(2.0*f[3])+0.21*sin(2.0*f[0])-0.19*sin(f[1])-0.11*sin(2.0*f[2]); - pm = 5.13*sin(f[2])+0.28*sin(f[0]+f[2])-0.28*sin(f[2]-f[0])- - 0.17*sin(f[2]-2.0*f[3]); - rm = RE_WGS84/sin((0.9508+0.0518*cos(f[0])+0.0095*cos(f[0]-2.0*f[3])+ - 0.0078*cos(2.0*f[3])+0.0028*cos(2.0*f[0]))*D2R); - sinl = sin(lm*D2R); cosl = cos(lm*D2R); - sinp = sin(pm*D2R); cosp = cos(pm*D2R); - rmoon[0] = rm*cosp*cosl; - rmoon[1] = rm*(cose*cosp*sinl-sine*sinp); - rmoon[2] = rm*(sine*cosp*sinl+cose*sinp); + lm = 218.32 + 481267.883 * t + 6.29 * sin(f[0]) - 1.27 * sin(f[0] - 2.0 * f[3]) + + 0.66 * sin(2.0 * f[3]) + 0.21 * sin(2.0 * f[0]) - 0.19 * sin(f[1]) - 0.11 * sin(2.0 * f[2]); + pm = 5.13 * sin(f[2]) + 0.28 * sin(f[0] + f[2]) - 0.28 * sin(f[2] - f[0]) - + 0.17 * sin(f[2] - 2.0 * f[3]); + rm = RE_WGS84 / sin((0.9508 + 0.0518 * cos(f[0]) + 0.0095 * cos(f[0] - 2.0 * f[3]) + + 0.0078 * cos(2.0 * f[3]) + 0.0028 * cos(2.0 * f[0])) * + D2R); + sinl = sin(lm * D2R); + cosl = cos(lm * D2R); + sinp = sin(pm * D2R); + cosp = cos(pm * D2R); + rmoon[0] = rm * cosp * cosl; + rmoon[1] = rm * (cose * cosp * sinl - sine * sinp); + rmoon[2] = rm * (sine * cosp * sinl + cose * sinp); trace(5, "rmoon=%.3f %.3f %.3f\n", rmoon[0], rmoon[1], rmoon[2]); } @@ -3883,7 +4151,7 @@ void sunmoonpos_eci(gtime_t tut, double *rsun, double *rmoon) * return : none *-----------------------------------------------------------------------------*/ void sunmoonpos(gtime_t tutc, const double *erpv, double *rsun, - double *rmoon, double *gmst) + double *rmoon, double *gmst) { gtime_t tut; double rs[3], rm[3], U[9], gmst_; @@ -3899,9 +4167,9 @@ void sunmoonpos(gtime_t tutc, const double *erpv, double *rsun, eci2ecef(tutc, erpv, U, &gmst_); /* sun and moon postion in ecef */ - if (rsun ) matmul("NN", 3, 1, 3, 1.0, U, rs, 0.0, rsun ); + if (rsun) matmul("NN", 3, 1, 3, 1.0, U, rs, 0.0, rsun); if (rmoon) matmul("NN", 3, 1, 3, 1.0, U, rm, 0.0, rmoon); - if (gmst ) *gmst = gmst_; + if (gmst) *gmst = gmst_; } @@ -3919,22 +4187,28 @@ void csmooth(obs_t *obs, int ns) trace(3, "csmooth: nobs=%d,ns=%d\n", obs->n, ns); - for (i = 0; in; i++) + for (i = 0; i < obs->n; i++) { - p = &obs->data[i]; s = p->sat; r = p->rcv; - for (j = 0; jdata[i]; + s = p->sat; + r = p->rcv; + for (j = 0; j < NFREQ; j++) { - if (s <= 0 || MAXSATP[j] == 0.0 || p->L[j] == 0.0) continue; - if (p->LLI[j]) n[r-1][s-1][j] = 0; - if (n[r-1][s-1][j] == 0) Ps[r-1][s-1][j] = p->P[j]; + if (p->LLI[j]) n[r - 1][s - 1][j] = 0; + if (n[r - 1][s - 1][j] == 0) + Ps[r - 1][s - 1][j] = p->P[j]; else { - dcp = lam_carr[j]*(p->L[j]-Lp[r-1][s-1][j]); - Ps[r-1][s-1][j] = p->P[j]/ns+(Ps[r-1][s-1][j]+dcp)*(ns-1)/ns; + dcp = lam_carr[j] * (p->L[j] - Lp[r - 1][s - 1][j]); + Ps[r - 1][s - 1][j] = p->P[j] / ns + (Ps[r - 1][s - 1][j] + dcp) * (ns - 1) / ns; } - if (++n[r-1][s-1][j]P[j] = 0.0; else p->P[j] = Ps[r-1][s-1][j]; - Lp[r-1][s-1][j] = p->L[j]; + if (++n[r - 1][s - 1][j] < ns) + p->P[j] = 0.0; + else + p->P[j] = Ps[r - 1][s - 1][j]; + Lp[r - 1][s - 1][j] = p->L[j]; } } } @@ -3951,64 +4225,73 @@ void csmooth(obs_t *obs, int ns) int rtk_uncompress(const char *file, char *uncfile) { int stat = 0; - char *p, cmd[2048] = "", tmpfile[1024] = "", buff[1024], *fname, *dir = (char*)""; + char *p, cmd[2048] = "", tmpfile[1024] = "", buff[1024], *fname, *dir = (char *)""; trace(3, "rtk_uncompress: file=%s\n", file); - if(strlen(file) < 1025) strcpy(tmpfile, file); - else trace(1, "file array is too long"); + if (strlen(file) < 1025) + strcpy(tmpfile, file); + else + trace(1, "file array is too long"); if (!(p = strrchr(tmpfile, '.'))) return 0; /* uncompress by gzip */ - if (!strcmp(p, ".z" ) || !strcmp(p, ".Z" ) || - !strcmp(p, ".gz" ) || !strcmp(p, ".GZ" ) || - !strcmp(p, ".zip") || !strcmp(p, ".ZIP")) + if (!strcmp(p, ".z") || !strcmp(p, ".Z") || + !strcmp(p, ".gz") || !strcmp(p, ".GZ") || + !strcmp(p, ".zip") || !strcmp(p, ".ZIP")) { - strcpy(uncfile, tmpfile); uncfile[p-tmpfile] = '\0'; + strcpy(uncfile, tmpfile); + uncfile[p - tmpfile] = '\0'; sprintf(cmd, "gzip -f -d -c \"%s\" > \"%s\"", tmpfile, uncfile); if (execcmd(cmd)) { - if(remove(uncfile) != 0) trace(1, "Error removing file"); + if (remove(uncfile) != 0) trace(1, "Error removing file"); return -1; } - if(strlen(uncfile) < 1025) strcpy(tmpfile, uncfile); + if (strlen(uncfile) < 1025) strcpy(tmpfile, uncfile); stat = 1; } /* extract tar file */ if ((p = strrchr(tmpfile, '.')) && !strcmp(p, ".tar")) { - strcpy(uncfile, tmpfile); uncfile[p-tmpfile] = '\0'; + strcpy(uncfile, tmpfile); + uncfile[p - tmpfile] = '\0'; strcpy(buff, tmpfile); fname = buff; if ((p = strrchr(buff, '/'))) { - *p = '\0'; dir = fname; fname = p+1; + *p = '\0'; + dir = fname; + fname = p + 1; } sprintf(cmd, "tar -C \"%s\" -xf \"%s\"", dir, tmpfile); if (execcmd(cmd)) { - if (stat) if(remove(tmpfile) != 0) trace(1, "Error removing file"); + if (stat) + if (remove(tmpfile) != 0) trace(1, "Error removing file"); return -1; } - if (stat) if(remove(tmpfile) != 0) trace(1, "Error removing file"); + if (stat) + if (remove(tmpfile) != 0) trace(1, "Error removing file"); stat = 1; } /* extract hatanaka-compressed file by cnx2rnx */ - else if ((p = strrchr(tmpfile, '.')) && strlen(p)>3 && (*(p+3) == 'd' || *(p+3) == 'D')) + else if ((p = strrchr(tmpfile, '.')) && strlen(p) > 3 && (*(p + 3) == 'd' || *(p + 3) == 'D')) { - strcpy(uncfile, tmpfile); - uncfile[p-tmpfile+3] = *(p+3) == 'D' ? 'O' : 'o'; + uncfile[p - tmpfile + 3] = *(p + 3) == 'D' ? 'O' : 'o'; sprintf(cmd, "crx2rnx < \"%s\" > \"%s\"", tmpfile, uncfile); if (execcmd(cmd)) { - if(remove(uncfile) != 0) trace(1, "Error removing file"); - if (stat) if(remove(tmpfile) != 0) trace(1, "Error removing file"); + if (remove(uncfile) != 0) trace(1, "Error removing file"); + if (stat) + if (remove(tmpfile) != 0) trace(1, "Error removing file"); return -1; } - if (stat) if(remove(tmpfile) != 0) trace(1, "Error removing file"); + if (stat) + if (remove(tmpfile) != 0) trace(1, "Error removing file"); stat = 1; } trace(3, "rtk_uncompress: stat=%d\n", stat); @@ -4045,24 +4328,28 @@ int expath(const char *path, char *paths[], int nmax) if (*(d->d_name) == '.') continue; sprintf(s1, "^%s$", d->d_name); sprintf(s2, "^%s$", file); - for (p = s1; *p;p++) *p = (char)tolower((int)*p); - for (p = s2; *p;p++) *p = (char)tolower((int)*p); + for (p = s1; *p; p++) *p = (char)tolower((int)*p); + for (p = s2; *p; p++) *p = (char)tolower((int)*p); for (p = s1, q = strtok_r(s2, "*", &r); q; q = strtok_r(NULL, "*", &r)) { - if ((p = strstr(p, q))) p += strlen(q); else break; + if ((p = strstr(p, q))) + p += strlen(q); + else + break; } - if (p && nd_name); + if (p && n < nmax) sprintf(paths[n++], "%s%s", dir, d->d_name); } closedir(dp); /* sort paths in alphabetical order */ - for (i = 0; i0) + if (strcmp(paths[i], paths[j]) > 0) { - if(strlen(paths[i]) < 1025) strcpy(tmp, paths[i]); + if (strlen(paths[i]) < 1025) + strcpy(tmp, paths[i]); else { trace(1, "Path is too long"); @@ -4072,7 +4359,7 @@ int expath(const char *path, char *paths[], int nmax) } } } - for (i = 0; i 1.0) cosp = 1.0; - ph = acos(cosp)/2.0/PI; + if (cosp < -1.0) + cosp = -1.0; + else if (cosp > 1.0) + cosp = 1.0; + ph = acos(cosp) / 2.0 / PI; cross3(ds, dr, drs); if (dot(ek, drs, 3) < 0.0) ph = -ph; diff --git a/src/algorithms/libs/rtklib/rtklib_rtkcmn.h b/src/algorithms/libs/rtklib/rtklib_rtkcmn.h index 99146bc42..f58e95193 100644 --- a/src/algorithms/libs/rtklib/rtklib_rtkcmn.h +++ b/src/algorithms/libs/rtklib/rtklib_rtkcmn.h @@ -82,22 +82,38 @@ #include /* coordinate rotation matrix ------------------------------------------------*/ -#define Rx(t,X) do { \ - (X)[0]=1.0; (X)[1]=(X)[2]=(X)[3]=(X)[6]=0.0; \ - (X)[4]=(X)[8]=cos(t); (X)[7]=sin(t); (X)[5]=-(X)[7]; \ -} while (0) - -#define Ry(t,X) do { \ - (X)[4]=1.0; (X)[1]=(X)[3]=(X)[5]=(X)[7]=0.0; \ - (X)[0]=(X)[8]=cos(t); (X)[2]=sin(t); (X)[6]=-(X)[2]; \ -} while (0) - -#define Rz(t,X) do { \ - (X)[8]=1.0; (X)[2]=(X)[5]=(X)[6]=(X)[7]=0.0; \ - (X)[0]=(X)[4]=cos(t); (X)[3]=sin(t); (X)[1]=-(X)[3]; \ -} while (0) +#define Rx(t, X) \ + do \ + { \ + (X)[0] = 1.0; \ + (X)[1] = (X)[2] = (X)[3] = (X)[6] = 0.0; \ + (X)[4] = (X)[8] = cos(t); \ + (X)[7] = sin(t); \ + (X)[5] = -(X)[7]; \ + } \ + while (0) +#define Ry(t, X) \ + do \ + { \ + (X)[4] = 1.0; \ + (X)[1] = (X)[3] = (X)[5] = (X)[7] = 0.0; \ + (X)[0] = (X)[8] = cos(t); \ + (X)[2] = sin(t); \ + (X)[6] = -(X)[2]; \ + } \ + while (0) +#define Rz(t, X) \ + do \ + { \ + (X)[8] = 1.0; \ + (X)[2] = (X)[5] = (X)[6] = (X)[7] = 0.0; \ + (X)[0] = (X)[4] = cos(t); \ + (X)[3] = sin(t); \ + (X)[1] = -(X)[3]; \ + } \ + while (0) void fatalerr(const char *format, ...); @@ -106,7 +122,7 @@ int satsys(int sat, int *prn); int satid2no(const char *id); void satno2id(int sat, char *id); int satexclude(int sat, int svh, const prcopt_t *opt); -int testsnr(int base, int freq, double el, double snr,const snrmask_t *mask); +int testsnr(int base, int freq, double el, double snr, const snrmask_t *mask); unsigned char obs2code(const char *obs, int *freq); char *code2obs(unsigned char code, int *freq); void setcodepri(int sys, int freq, const char *pri); @@ -129,21 +145,21 @@ void cross3(const double *a, const double *b, double *c); int normv3(const double *a, double *b); void matcpy(double *A, const double *B, int n, int m); 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 matinv(double *A, int n); int solve(const char *tr, const double *A, const double *Y, int n, - int m, double *X); + int m, double *X); int lsq(const double *A, const double *y, int n, int m, double *x, - double *Q); + double *Q); int filter_(const double *x, const double *P, const double *H, - const double *v, const double *R, int n, int m, - double *xp, double *Pp); + const double *v, const double *R, int n, int m, + double *xp, double *Pp); 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); 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); 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); void matprint(const double A[], int n, int m, int p, int q); double str2num(const char *s, int i, int n); int str2time(const char *s, int i, int n, gtime_t *t); @@ -193,7 +209,7 @@ int readngspcv(const char *file, pcvs_t *pcvs); int readantex(const char *file, pcvs_t *pcvs); int readpcv(const char *file, pcvs_t *pcvs); pcv_t *searchpcv(int sat, const char *type, gtime_t time, - const pcvs_t *pcvs); + const pcvs_t *pcvs); void readpos(const char *file, const char *rcv, double *pos); int readblqrecord(FILE *fp, double *odisp); int readblq(const char *file, const char *sta, double *odisp); @@ -218,8 +234,8 @@ void traceopen(const char *file); void traceclose(void); void tracelevel(int level); void traceswap(void); -void trace (int level, const char *format, ...); -void tracet (int level, const char *format, ...); +void trace(int level, const char *format, ...); +void tracet(int level, const char *format, ...); void tracemat(int level, const double *A, int n, int m, int p, int q); void traceobs(int level, const obsd_t *obs, int n); //void tracenav(int level, const nav_t *nav); @@ -233,9 +249,9 @@ int execcmd(const char *cmd); void createdir(const char *path); int repstr(char *str, const char *pat, const char *rep); int reppath(const char *path, char *rpath, gtime_t time, const char *rov, - const char *base); + const char *base); 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); double satwavelen(int sat, int frq, const nav_t *nav); double geodist(const double *rs, const double *rr, double *e); double satazel(const double *pos, const double *e, double *azel); @@ -243,27 +259,27 @@ double satazel(const double *pos, const double *e, double *azel); //#define SQRT(x) ((x)<0.0?0.0:sqrt(x)) void dops(int ns, const double *azel, double elmin, double *dop); double ionmodel(gtime_t t, const double *ion, const double *pos, - const double *azel); + const double *azel); double ionmapf(const double *pos, const double *azel); double ionppp(const double *pos, const double *azel, double re, - double hion, double *posp); + double hion, double *posp); double tropmodel(gtime_t time, const double *pos, const double *azel, - double humi); + double humi); double interpc(const double coef[], double lat); double mapf(double el, double a, double b, double c); double nmf(gtime_t time, const double pos[], const double azel[], - double *mapfw); + double *mapfw); double tropmapf(gtime_t time, const double pos[], const double azel[], - double *mapfw); + double *mapfw); double interpvar(double ang, const double *var); void antmodel(const pcv_t *pcv, const double *del, const double *azel, - int opt, double *dant); + int opt, double *dant); void antmodel_s(const pcv_t *pcv, double nadir, double *dant); void sunmoonpos_eci(gtime_t tut, double *rsun, double *rmoon); void sunmoonpos(gtime_t tutc, const double *erpv, double *rsun, - double *rmoon, double *gmst); + double *rmoon, double *gmst); void csmooth(obs_t *obs, int ns); int rtk_uncompress(const char *file, char *uncfile); int expath(const char *path, char *paths[], int nmax); diff --git a/src/algorithms/libs/rtklib/rtklib_rtkpos.cc b/src/algorithms/libs/rtklib/rtklib_rtkpos.cc index 6af5e200d..e5a43f517 100644 --- a/src/algorithms/libs/rtklib/rtklib_rtkpos.cc +++ b/src/algorithms/libs/rtklib/rtklib_rtkpos.cc @@ -59,17 +59,17 @@ #include "rtklib_lambda.h" static int resamb_WLNL(rtk_t *rtk __attribute((unused)), const obsd_t *obs __attribute((unused)), const int *sat __attribute((unused)), - const int *iu __attribute((unused)), const int *ir __attribute((unused)), int ns __attribute__((unused)), const nav_t *nav __attribute((unused)), - const double *azel __attribute((unused))) {return 0;} + const int *iu __attribute((unused)), const int *ir __attribute((unused)), int ns __attribute__((unused)), const nav_t *nav __attribute((unused)), + const double *azel __attribute((unused))) { return 0; } static int resamb_TCAR(rtk_t *rtk __attribute((unused)), const obsd_t *obs __attribute((unused)), const int *sat __attribute((unused)), - const int *iu __attribute((unused)), const int *ir __attribute((unused)), int ns __attribute((unused)), const nav_t *nav __attribute((unused)), - const double *azel __attribute((unused))) {return 0;} + const int *iu __attribute((unused)), const int *ir __attribute((unused)), int ns __attribute((unused)), const nav_t *nav __attribute((unused)), + const double *azel __attribute((unused))) { return 0; } /* global variables ----------------------------------------------------------*/ static int statlevel = 0; /* rtk status output level (0:off) */ static FILE *fp_stat = NULL; /* rtk status file pointer */ static char file_stat[1024] = ""; /* rtk status file original path */ -static gtime_t time_stat = {0, 0}; /* rtk status file time */ +static gtime_t time_stat = {0, 0}; /* rtk status file time */ /* open solution status file --------------------------------------------------- * open solution status file and set output level @@ -149,15 +149,17 @@ int rtkopenstat(const char *file, int level) if (level <= 0) return 0; - reppath(file, path, time, "",""); + reppath(file, path, time, "", ""); if (!(fp_stat = fopen(path, "w"))) { trace(1, "rtkopenstat: file open error path=%s\n", path); return 0; } - if(strlen(file) < 1025) strcpy(file_stat, file); - else trace(1, "File name is too long"); + if (strlen(file) < 1025) + strcpy(file_stat, file); + else + trace(1, "File name is too long"); time_stat = time; statlevel = level; return 1; @@ -181,7 +183,7 @@ void rtkclosestat(void) /* write solution status to buffer -------------------------------------------*/ -void rtkoutstat(rtk_t *rtk, char *buff __attribute__((unused))) +void rtkoutstat(rtk_t *rtk, char *buff __attribute__((unused))) { ssat_t *ssat; double tow, pos[3], vel[3], acc[3], vela[3] = {0}, acca[3] = {0}, xa[3]; @@ -202,92 +204,92 @@ void rtkoutstat(rtk_t *rtk, char *buff __attribute__((unused))) /* receiver position */ if (est) { - for (i = 0;i<3;i++) xa[i] = i < rtk->na ? rtk->xa[i] : 0.0; + for (i = 0; i < 3; i++) xa[i] = i < rtk->na ? rtk->xa[i] : 0.0; fprintf(fp_stat, "$POS,%d,%.3f,%d,%.4f,%.4f,%.4f,%.4f,%.4f,%.4f\n", week, tow, - rtk->sol.stat, rtk->x[0], rtk->x[1], rtk->x[2], xa[0], xa[1], xa[2]); + rtk->sol.stat, rtk->x[0], rtk->x[1], rtk->x[2], xa[0], xa[1], xa[2]); } else { fprintf(fp_stat, "$POS,%d,%.3f,%d,%.4f,%.4f,%.4f,%.4f,%.4f,%.4f\n", week, tow, - rtk->sol.stat, rtk->sol.rr[0], rtk->sol.rr[1], rtk->sol.rr[2], - 0.0, 0.0, 0.0); + rtk->sol.stat, rtk->sol.rr[0], rtk->sol.rr[1], rtk->sol.rr[2], + 0.0, 0.0, 0.0); } /* receiver velocity and acceleration */ if (est && rtk->opt.dynamics) { ecef2pos(rtk->sol.rr, pos); - ecef2enu(pos, rtk->x+3, vel); - ecef2enu(pos, rtk->x+6, acc); - if (rtk->na >= 6) ecef2enu(pos, rtk->xa+3, vela); - if (rtk->na >= 9) ecef2enu(pos, rtk->xa+6, acca); + ecef2enu(pos, rtk->x + 3, vel); + ecef2enu(pos, rtk->x + 6, acc); + if (rtk->na >= 6) ecef2enu(pos, rtk->xa + 3, vela); + if (rtk->na >= 9) ecef2enu(pos, rtk->xa + 6, acca); fprintf(fp_stat, "$VELACC,%d,%.3f,%d,%.4f,%.4f,%.4f,%.5f,%.5f,%.5f,%.4f,%.4f,%.4f,%.5f,%.5f,%.5f\n", - week, tow, rtk->sol.stat, vel[0], vel[1], vel[2], acc[0], acc[1], acc[2], - vela[0], vela[1], vela[2], acca[0], acca[1], acca[2]); + week, tow, rtk->sol.stat, vel[0], vel[1], vel[2], acc[0], acc[1], acc[2], + vela[0], vela[1], vela[2], acca[0], acca[1], acca[2]); } else { ecef2pos(rtk->sol.rr, pos); - ecef2enu(pos, rtk->sol.rr+3, vel); + ecef2enu(pos, rtk->sol.rr + 3, vel); fprintf(fp_stat, "$VELACC,%d,%.3f,%d,%.4f,%.4f,%.4f,%.5f,%.5f,%.5f,%.4f,%.4f,%.4f,%.5f,%.5f,%.5f\n", - week, tow, rtk->sol.stat, vel[0], vel[1], vel[2], - 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); + week, tow, rtk->sol.stat, vel[0], vel[1], vel[2], + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); } /* receiver clocks */ fprintf(fp_stat, "$CLK,%d,%.3f,%d,%d,%.3f,%.3f,%.3f,%.3f\n", - week, tow, rtk->sol.stat, 1, rtk->sol.dtr[0]*1E9, rtk->sol.dtr[1]*1E9, - rtk->sol.dtr[2]*1E9, rtk->sol.dtr[3]*1E9); + week, tow, rtk->sol.stat, 1, rtk->sol.dtr[0] * 1E9, rtk->sol.dtr[1] * 1E9, + rtk->sol.dtr[2] * 1E9, rtk->sol.dtr[3] * 1E9); /* ionospheric parameters */ if (est && rtk->opt.ionoopt == IONOOPT_EST) { - for (i = 0;issat+i; + ssat = rtk->ssat + i; if (!ssat->vs) continue; - satno2id(i+1, id); - j = II_RTK(i+1, &rtk->opt); + satno2id(i + 1, id); + j = II_RTK(i + 1, &rtk->opt); xa[0] = j < rtk->na ? rtk->xa[j] : 0.0; fprintf(fp_stat, "$ION,%d,%.3f,%d,%s,%.1f,%.1f,%.4f,%.4f\n", week, tow, rtk->sol.stat, - id, ssat->azel[0]*R2D, ssat->azel[1]*R2D, rtk->x[j], xa[0]); + id, ssat->azel[0] * R2D, ssat->azel[1] * R2D, rtk->x[j], xa[0]); } } /* tropospheric parameters */ if (est && (rtk->opt.tropopt == TROPOPT_EST || rtk->opt.tropopt == TROPOPT_ESTG)) { - for (i = 0;i<2;i++) + for (i = 0; i < 2; i++) { j = IT_RTK(i, &rtk->opt); xa[0] = j < rtk->na ? rtk->xa[j] : 0.0; fprintf(fp_stat, "$TROP,%d,%.3f,%d,%d,%.4f,%.4f\n", week, tow, rtk->sol.stat, - i+1, rtk->x[j], xa[0]); + i + 1, rtk->x[j], xa[0]); } } /* receiver h/w bias */ if (est && rtk->opt.glomodear == 2) { - for (i = 0;iopt); xa[0] = j < rtk->na ? rtk->xa[j] : 0.0; fprintf(fp_stat, "$HWBIAS,%d,%.3f,%d,%d,%.4f,%.4f\n", week, tow, rtk->sol.stat, - i+1, rtk->x[j], xa[0]); + i + 1, rtk->x[j], xa[0]); } } if (rtk->sol.stat == SOLQ_NONE || statlevel <= 1) return; /* residuals and status */ - for (i = 0;issat+i; + ssat = rtk->ssat + i; if (!ssat->vs) continue; - satno2id(i+1, id); - for (j = 0;jazel[0]*R2D, ssat->azel[1]*R2D, - ssat->resp [j], ssat->resc[j], ssat->vsat[j], ssat->snr[j]*0.25, - ssat->fix [j], ssat->slip[j]&3, ssat->lock[j], ssat->outc[j], - ssat->slipc[j], ssat->rejc[j]); + week, tow, id, j + 1, ssat->azel[0] * R2D, ssat->azel[1] * R2D, + ssat->resp[j], ssat->resc[j], ssat->vsat[j], ssat->snr[j] * 0.25, + ssat->fix[j], ssat->slip[j] & 3, ssat->lock[j], ssat->outc[j], + ssat->slipc[j], ssat->rejc[j]); } } } @@ -299,14 +301,14 @@ void swapsolstat(void) gtime_t time = utc2gpst(timeget()); char path[1024]; - if ((int)(time2gpst(time , NULL)/INT_SWAP_STAT) == - (int)(time2gpst(time_stat, NULL)/INT_SWAP_STAT)) + if ((int)(time2gpst(time, NULL) / INT_SWAP_STAT) == + (int)(time2gpst(time_stat, NULL) / INT_SWAP_STAT)) { return; } time_stat = time; - if (!reppath(file_stat, path, time, "","")) + if (!reppath(file_stat, path, time, "", "")) { return; } @@ -343,92 +345,92 @@ void outsolstat(rtk_t *rtk) /* receiver position */ if (est) { - for (i = 0;i<3;i++) xa[i] = i < rtk->na ? rtk->xa[i] : 0.0; + for (i = 0; i < 3; i++) xa[i] = i < rtk->na ? rtk->xa[i] : 0.0; fprintf(fp_stat, "$POS,%d,%.3f,%d,%.4f,%.4f,%.4f,%.4f,%.4f,%.4f\n", week, tow, - rtk->sol.stat, rtk->x[0], rtk->x[1], rtk->x[2], xa[0], xa[1], xa[2]); + rtk->sol.stat, rtk->x[0], rtk->x[1], rtk->x[2], xa[0], xa[1], xa[2]); } else { fprintf(fp_stat, "$POS,%d,%.3f,%d,%.4f,%.4f,%.4f,%.4f,%.4f,%.4f\n", week, tow, - rtk->sol.stat, rtk->sol.rr[0], rtk->sol.rr[1], rtk->sol.rr[2], - 0.0, 0.0, 0.0); + rtk->sol.stat, rtk->sol.rr[0], rtk->sol.rr[1], rtk->sol.rr[2], + 0.0, 0.0, 0.0); } /* receiver velocity and acceleration */ if (est && rtk->opt.dynamics) { ecef2pos(rtk->sol.rr, pos); - ecef2enu(pos, rtk->x+3, vel); - ecef2enu(pos, rtk->x+6, acc); - if (rtk->na >= 6) ecef2enu(pos, rtk->xa+3, vela); - if (rtk->na >= 9) ecef2enu(pos, rtk->xa+6, acca); + ecef2enu(pos, rtk->x + 3, vel); + ecef2enu(pos, rtk->x + 6, acc); + if (rtk->na >= 6) ecef2enu(pos, rtk->xa + 3, vela); + if (rtk->na >= 9) ecef2enu(pos, rtk->xa + 6, acca); fprintf(fp_stat, "$VELACC,%d,%.3f,%d,%.4f,%.4f,%.4f,%.5f,%.5f,%.5f,%.4f,%.4f,%.4f,%.5f,%.5f,%.5f\n", - week, tow, rtk->sol.stat, vel[0], vel[1], vel[2], acc[0], acc[1], acc[2], - vela[0], vela[1], vela[2], acca[0], acca[1], acca[2]); + week, tow, rtk->sol.stat, vel[0], vel[1], vel[2], acc[0], acc[1], acc[2], + vela[0], vela[1], vela[2], acca[0], acca[1], acca[2]); } else { ecef2pos(rtk->sol.rr, pos); - ecef2enu(pos, rtk->sol.rr+3, vel); + ecef2enu(pos, rtk->sol.rr + 3, vel); fprintf(fp_stat, "$VELACC,%d,%.3f,%d,%.4f,%.4f,%.4f,%.5f,%.5f,%.5f,%.4f,%.4f,%.4f,%.5f,%.5f,%.5f\n", - week, tow, rtk->sol.stat, vel[0], vel[1], vel[2], - 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); + week, tow, rtk->sol.stat, vel[0], vel[1], vel[2], + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); } /* receiver clocks */ fprintf(fp_stat, "$CLK,%d,%.3f,%d,%d,%.3f,%.3f,%.3f,%.3f\n", - week, tow, rtk->sol.stat, 1, rtk->sol.dtr[0]*1E9, rtk->sol.dtr[1]*1E9, - rtk->sol.dtr[2]*1E9, rtk->sol.dtr[3]*1E9); + week, tow, rtk->sol.stat, 1, rtk->sol.dtr[0] * 1E9, rtk->sol.dtr[1] * 1E9, + rtk->sol.dtr[2] * 1E9, rtk->sol.dtr[3] * 1E9); /* ionospheric parameters */ if (est && rtk->opt.ionoopt == IONOOPT_EST) { - for (i = 0;issat+i; + ssat = rtk->ssat + i; if (!ssat->vs) continue; - satno2id(i+1, id); - j = II_RTK(i+1, &rtk->opt); + satno2id(i + 1, id); + j = II_RTK(i + 1, &rtk->opt); xa[0] = j < rtk->na ? rtk->xa[j] : 0.0; fprintf(fp_stat, "$ION,%d,%.3f,%d,%s,%.1f,%.1f,%.4f,%.4f\n", week, tow, rtk->sol.stat, - id, ssat->azel[0]*R2D, ssat->azel[1]*R2D, rtk->x[j], xa[0]); + id, ssat->azel[0] * R2D, ssat->azel[1] * R2D, rtk->x[j], xa[0]); } } /* tropospheric parameters */ if (est && (rtk->opt.tropopt == TROPOPT_EST || rtk->opt.tropopt == TROPOPT_ESTG)) { - for (i = 0;i<2;i++) + for (i = 0; i < 2; i++) { j = IT_RTK(i, &rtk->opt); xa[0] = j < rtk->na ? rtk->xa[j] : 0.0; fprintf(fp_stat, "$TROP,%d,%.3f,%d,%d,%.4f,%.4f\n", week, tow, rtk->sol.stat, - i+1, rtk->x[j], xa[0]); + i + 1, rtk->x[j], xa[0]); } } /* receiver h/w bias */ if (est && rtk->opt.glomodear == 2) { - for (i = 0;iopt); xa[0] = j < rtk->na ? rtk->xa[j] : 0.0; fprintf(fp_stat, "$HWBIAS,%d,%.3f,%d,%d,%.4f,%.4f\n", week, tow, rtk->sol.stat, - i+1, rtk->x[j], xa[0]); + i + 1, rtk->x[j], xa[0]); } } if (rtk->sol.stat == SOLQ_NONE || statlevel <= 1) return; /* residuals and status */ - for (i = 0;issat+i; + ssat = rtk->ssat + i; if (!ssat->vs) continue; - satno2id(i+1, id); - for (j = 0;jazel[0]*R2D, ssat->azel[1]*R2D, - ssat->resp [j], ssat->resc[j], ssat->vsat[j], ssat->snr[j]*0.25, - ssat->fix [j], ssat->slip[j]&3, ssat->lock[j], ssat->outc[j], - ssat->slipc[j], ssat->rejc[j]); + week, tow, id, j + 1, ssat->azel[0] * R2D, ssat->azel[1] * R2D, + ssat->resp[j], ssat->resc[j], ssat->vsat[j], ssat->snr[j] * 0.25, + ssat->fix[j], ssat->slip[j] & 3, ssat->lock[j], ssat->outc[j], + ssat->slipc[j], ssat->rejc[j]); } } } @@ -441,12 +443,12 @@ void errmsg(rtk_t *rtk, const char *format, ...) int n; va_list ap; time2str(rtk->sol.time, tstr, 2); - n = sprintf(buff, "%s: ", tstr+11); + n = sprintf(buff, "%s: ", tstr + 11); va_start(ap, format); - n += vsprintf(buff+n, format, ap); + n += vsprintf(buff + n, format, ap); va_end(ap); - n = nneb ? n : MAXERRMSG-rtk->neb; - memcpy(rtk->errbuf+rtk->neb, buff, n); + n = n < MAXERRMSG - rtk->neb ? n : MAXERRMSG - rtk->neb; + memcpy(rtk->errbuf + rtk->neb, buff, n); rtk->neb += n; trace(2, "%s", buff); } @@ -455,57 +457,65 @@ void errmsg(rtk_t *rtk, const char *format, ...) /* single-differenced observable ---------------------------------------------*/ double sdobs(const obsd_t *obs, int i, int j, int f) { - double pi = ferr[3]*bl/1e4, d = SPEED_OF_LIGHT * opt->sclkstab*dt, fact = 1.0; + double a, b, c = opt->err[3] * bl / 1e4, d = SPEED_OF_LIGHT * opt->sclkstab * dt, fact = 1.0; double sinel = sin(el); int i = sys == SYS_GLO ? 1 : (sys == SYS_GAL ? 2 : 0), nf = NF_RTK(opt); /* extended error model */ if (f >= nf && opt->exterr.ena[0]) { /* code */ - a = opt->exterr.cerr[i][ (f-nf)*2]; - b = opt->exterr.cerr[i][1+(f-nf)*2]; - if (sys == SYS_SBS) {a *= EFACT_SBS; b *= EFACT_SBS;} + a = opt->exterr.cerr[i][(f - nf) * 2]; + b = opt->exterr.cerr[i][1 + (f - nf) * 2]; + if (sys == SYS_SBS) + { + a *= EFACT_SBS; + b *= EFACT_SBS; + } } - else if (fexterr.ena[1]) + else if (f < nf && opt->exterr.ena[1]) { /* phase */ - a = opt->exterr.perr[i][ f*2]; - b = opt->exterr.perr[i][1+f*2]; - if (sys == SYS_SBS) {a *= EFACT_SBS; b *= EFACT_SBS;} + a = opt->exterr.perr[i][f * 2]; + b = opt->exterr.perr[i][1 + f * 2]; + if (sys == SYS_SBS) + { + a *= EFACT_SBS; + b *= EFACT_SBS; + } } else { /* normal error model */ - if (f >= nf) fact=opt->eratio[f-nf]; - if (fact <= 0.0) fact=opt->eratio[0]; - fact*=sys == SYS_GLO ? EFACT_GLO : (sys == SYS_SBS ? EFACT_SBS : EFACT_GPS); - a = fact*opt->err[1]; - b = fact*opt->err[2]; + if (f >= nf) fact = opt->eratio[f - nf]; + if (fact <= 0.0) fact = opt->eratio[0]; + fact *= sys == SYS_GLO ? EFACT_GLO : (sys == SYS_SBS ? EFACT_SBS : EFACT_GPS); + a = fact * opt->err[1]; + b = fact * opt->err[2]; } - return 2.0*(opt->ionoopt == IONOOPT_IFLC ? 3.0 : 1.0)*(a*a+b*b/sinel/sinel+c*c)+d*d; + return 2.0 * (opt->ionoopt == IONOOPT_IFLC ? 3.0 : 1.0) * (a * a + b * b / sinel / sinel + c * c) + d * d; } @@ -513,7 +523,7 @@ double varerr(int sat __attribute((unused)), int sys, double el, double bl, doub double baseline(const double *ru, const double *rb, double *dr) { int i; - for (i = 0;i<3;i++) dr[i] = ru[i]-rb[i]; + for (i = 0; i < 3; i++) dr[i] = ru[i] - rb[i]; return norm_rtk(dr, 3); } @@ -523,29 +533,34 @@ void initx_rtk(rtk_t *rtk, double xi, double var, int i) { int j; rtk->x[i] = xi; - for (j = 0;jnx;j++) + for (j = 0; j < rtk->nx; j++) { - rtk->P[i+j*rtk->nx] = rtk->P[j+i*rtk->nx] = i == j ? var : 0.0; + rtk->P[i + j * rtk->nx] = rtk->P[j + i * rtk->nx] = i == j ? var : 0.0; } } /* select common satellites between rover and reference station --------------*/ int selsat(const obsd_t *obs, 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; trace(3, "selsat : nu=%d nr=%d\n", nu, nr); - for (i = 0, j = nu;iobs[j].sat) i--; - else if (azel[1+j*2] >= opt->elmin) { /* elevation at base station */ - sat[k] = obs[i].sat; iu[k] = i; ir[k++] = j; - trace(4, "(%2d) sat=%3d iu=%2d ir=%2d\n", k-1, obs[i].sat, i, j); - } + if (obs[i].sat < obs[j].sat) + j--; + else if (obs[i].sat > obs[j].sat) + i--; + else if (azel[1 + j * 2] >= opt->elmin) + { /* elevation at base station */ + sat[k] = obs[i].sat; + iu[k] = i; + ir[k++] = j; + trace(4, "(%2d) sat=%3d iu=%2d ir=%2d\n", k - 1, obs[i].sat, i, j); + } } return k; } @@ -562,17 +577,17 @@ void udpos(rtk_t *rtk, double tt) /* fixed mode */ if (rtk->opt.mode == PMODE_FIXED) { - for (i = 0;i<3;i++) initx_rtk(rtk, rtk->opt.ru[i], 1E-8, i); + for (i = 0; i < 3; i++) initx_rtk(rtk, rtk->opt.ru[i], 1E-8, i); return; } /* initialize position for first epoch */ - if (norm_rtk(rtk->x, 3) <= 0.0) + if (norm_rtk(rtk->x, 3) <= 0.0) { - for (i = 0;i<3;i++) initx_rtk(rtk, rtk->sol.rr[i], VAR_POS, i); + for (i = 0; i < 3; i++) initx_rtk(rtk, rtk->sol.rr[i], VAR_POS, i); if (rtk->opt.dynamics) { - for (i = 3;i<6;i++) initx_rtk(rtk, rtk->sol.rr[i], VAR_VEL, i); - for (i = 6;i<9;i++) initx_rtk(rtk, 1E-6, VAR_ACC, i); + for (i = 3; i < 6; i++) initx_rtk(rtk, rtk->sol.rr[i], VAR_VEL, i); + for (i = 6; i < 9; i++) initx_rtk(rtk, 1E-6, VAR_ACC, i); } } /* static mode */ @@ -581,31 +596,33 @@ void udpos(rtk_t *rtk, double tt) /* kinmatic mode without dynamics */ if (!rtk->opt.dynamics) { - for (i = 0;i<3;i++) initx_rtk(rtk, rtk->sol.rr[i], VAR_POS, i); + for (i = 0; i < 3; i++) initx_rtk(rtk, rtk->sol.rr[i], VAR_POS, i); return; } /* check variance of estimated postion */ - for (i = 0;i<3;i++) + for (i = 0; i < 3; i++) { - var += rtk->P[i+i*rtk->nx]; + var += rtk->P[i + i * rtk->nx]; } var /= 3.0; - if (var>VAR_POS) + if (var > VAR_POS) { /* reset position with large variance */ - for (i = 0;i<3;i++) initx_rtk(rtk, rtk->sol.rr[i], VAR_POS, i); - for (i = 3;i<6;i++) initx_rtk(rtk, rtk->sol.rr[i], VAR_VEL, i); - for (i = 6;i<9;i++) initx_rtk(rtk, 1E-6, VAR_ACC, i); + for (i = 0; i < 3; i++) initx_rtk(rtk, rtk->sol.rr[i], VAR_POS, i); + for (i = 3; i < 6; i++) initx_rtk(rtk, rtk->sol.rr[i], VAR_VEL, i); + for (i = 6; i < 9; i++) initx_rtk(rtk, 1E-6, VAR_ACC, i); trace(2, "reset rtk position due to large variance: var=%.3f\n", var); return; } /* state transition of position/velocity/acceleration */ - F = eye(rtk->nx); FP = mat(rtk->nx, rtk->nx); xp = mat(rtk->nx, 1); + F = eye(rtk->nx); + FP = mat(rtk->nx, rtk->nx); + xp = mat(rtk->nx, 1); - for (i = 0;i<6;i++) + for (i = 0; i < 6; i++) { - F[i+(i+3)*rtk->nx] = tt; + F[i + (i + 3) * rtk->nx] = tt; } /* x=F*x, P=F*P*F+Q */ matmul("NN", rtk->nx, 1, rtk->nx, 1.0, F, rtk->x, 0.0, xp); @@ -614,14 +631,18 @@ void udpos(rtk_t *rtk, double tt) matmul("NT", rtk->nx, rtk->nx, rtk->nx, 1.0, FP, F, 0.0, rtk->P); /* process noise added to only acceleration */ - Q[0] = Q[4] = std::pow(rtk->opt.prn[3], 2.0); Q[8] = std::pow(rtk->opt.prn[4], 2.0); + Q[0] = Q[4] = std::pow(rtk->opt.prn[3], 2.0); + Q[8] = std::pow(rtk->opt.prn[4], 2.0); ecef2pos(rtk->x, pos); covecef(pos, Q, Qv); - for (i = 0;i<3;i++) for (j = 0;j<3;j++) - { - rtk->P[i+6+(j+6)*rtk->nx] += Qv[i+j*3]; - } - free(F); free(FP); free(xp); + for (i = 0; i < 3; i++) + for (j = 0; j < 3; j++) + { + rtk->P[i + 6 + (j + 6) * rtk->nx] += Qv[i + j * 3]; + } + free(F); + free(FP); + free(xp); } @@ -633,27 +654,27 @@ void udion(rtk_t *rtk, double tt, double bl, const int *sat, int ns) trace(3, "udion : tt=%.1f bl=%.0f ns=%d\n", tt, bl, ns); - for (i = 1;i <= MAXSAT;i++) + for (i = 1; i <= MAXSAT; i++) { j = II_RTK(i, &rtk->opt); if (rtk->x[j] != 0.0 && - rtk->ssat[i-1].outc[0]>GAP_RESION && rtk->ssat[i-1].outc[1]>GAP_RESION) + rtk->ssat[i - 1].outc[0] > GAP_RESION && rtk->ssat[i - 1].outc[1] > GAP_RESION) rtk->x[j] = 0.0; } - for (i = 0;iopt); if (rtk->x[j] == 0.0) { - initx_rtk(rtk, 1E-6, std::pow(rtk->opt.std[1]*bl/1e4, 2.0), j); + initx_rtk(rtk, 1E-6, std::pow(rtk->opt.std[1] * bl / 1e4, 2.0), j); } else { /* elevation dependent factor of process noise */ - el = rtk->ssat[sat[i]-1].azel[1]; + el = rtk->ssat[sat[i] - 1].azel[1]; fact = cos(el); - rtk->P[j+j*rtk->nx] += std::pow(rtk->opt.prn[1]*bl/1e4*fact, 2.0)*tt; + rtk->P[j + j * rtk->nx] += std::pow(rtk->opt.prn[1] * bl / 1e4 * fact, 2.0) * tt; } } } @@ -666,28 +687,28 @@ void udtrop(rtk_t *rtk, double tt, double bl __attribute((unused))) trace(3, "udtrop : tt=%.1f\n", tt); - for (i = 0;i<2;i++) + for (i = 0; i < 2; i++) { j = IT_RTK(i, &rtk->opt); if (rtk->x[j] == 0.0) { - initx_rtk(rtk, INIT_ZWD, std::pow(rtk->opt.std[2], 2.0), j); /* initial zwd */ + initx_rtk(rtk, INIT_ZWD, std::pow(rtk->opt.std[2], 2.0), j); /* initial zwd */ if (rtk->opt.tropopt >= TROPOPT_ESTG) { - for (k = 0;k<2;k++) initx_rtk(rtk, 1e-6, VAR_GRA, ++j); + for (k = 0; k < 2; k++) initx_rtk(rtk, 1e-6, VAR_GRA, ++j); } } else { - rtk->P[j+j*rtk->nx] += std::pow(rtk->opt.prn[2], 2.0)*tt; + rtk->P[j + j * rtk->nx] += std::pow(rtk->opt.prn[2], 2.0) * tt; if (rtk->opt.tropopt >= TROPOPT_ESTG) { - for (k = 0;k<2;k++) + for (k = 0; k < 2; k++) { - rtk->P[++j*(1+rtk->nx)]+=std::pow(rtk->opt.prn[2]*0.3, 2.0)*fabs(rtk->tt); + rtk->P[++j * (1 + rtk->nx)] += std::pow(rtk->opt.prn[2] * 0.3, 2.0) * fabs(rtk->tt); } } } @@ -702,7 +723,7 @@ void udrcvbias(rtk_t *rtk, double tt) trace(3, "udrcvbias: tt=%.1f\n", tt); - for (i = 0;iopt); @@ -711,13 +732,13 @@ void udrcvbias(rtk_t *rtk, double tt) initx_rtk(rtk, 1E-6, VAR_HWBIAS, j); } /* hold to fixed solution */ - else if (rtk->nfix >= rtk->opt.minfix && rtk->sol.ratio>rtk->opt.thresar[0]) + else if (rtk->nfix >= rtk->opt.minfix && rtk->sol.ratio > rtk->opt.thresar[0]) { - initx_rtk(rtk, rtk->xa[j], rtk->Pa[j+j*rtk->na], j); + initx_rtk(rtk, rtk->xa[j], rtk->Pa[j + j * rtk->na], j); } else { - rtk->P[j+j*rtk->nx]+=std::pow(PRN_HWBIAS, 2.0)*tt; + rtk->P[j + j * rtk->nx] += std::pow(PRN_HWBIAS, 2.0) * tt; } } } @@ -731,69 +752,73 @@ void detslp_ll(rtk_t *rtk, const obsd_t *obs, int i, int rcv) trace(3, "detslp_ll: i=%d rcv=%d\n", i, rcv); - for (f = 0;fopt.nf;f++) + for (f = 0; f < rtk->opt.nf; f++) { - if (obs[i].L[f] == 0.0) continue; /* restore previous LLI */ - if (rcv == 1) LLI = getbitu(&rtk->ssat[sat-1].slip[f], 0, 2); /* rover */ - else LLI = getbitu(&rtk->ssat[sat-1].slip[f], 2, 2); /* base */ + if (rcv == 1) + LLI = getbitu(&rtk->ssat[sat - 1].slip[f], 0, 2); /* rover */ + else + LLI = getbitu(&rtk->ssat[sat - 1].slip[f], 2, 2); /* base */ /* detect slip by cycle slip flag in LLI */ - if (rtk->tt >= 0.0) { /* forward */ - if (obs[i].LLI[f]&1) + if (rtk->tt >= 0.0) + { /* forward */ + if (obs[i].LLI[f] & 1) { errmsg(rtk, "slip detected forward (sat=%2d rcv=%d F=%d LLI=%x)\n", - sat, rcv, f+1, obs[i].LLI[f]); + sat, rcv, f + 1, obs[i].LLI[f]); } slip = obs[i].LLI[f]; - } + } else { /* backward */ - if (LLI&1) + if (LLI & 1) { errmsg(rtk, "slip detected backward (sat=%2d rcv=%d F=%d LLI=%x)\n", - sat, rcv, f+1, LLI); + sat, rcv, f + 1, LLI); } slip = LLI; } /* detect slip by parity unknown flag transition in LLI */ - if (((LLI&2) && !(obs[i].LLI[f]&2)) || (!(LLI&2) && (obs[i].LLI[f]&2))) + if (((LLI & 2) && !(obs[i].LLI[f] & 2)) || (!(LLI & 2) && (obs[i].LLI[f] & 2))) { errmsg(rtk, "slip detected half-cyc (sat=%2d rcv=%d F=%d LLI=%x->%x)\n", - sat, rcv, f+1, LLI, obs[i].LLI[f]); - slip|=1; + sat, rcv, f + 1, LLI, obs[i].LLI[f]); + slip |= 1; } /* save current LLI */ - if (rcv == 1) setbitu(&rtk->ssat[sat-1].slip[f], 0, 2, obs[i].LLI[f]); - else setbitu(&rtk->ssat[sat-1].slip[f], 2, 2, obs[i].LLI[f]); + if (rcv == 1) + setbitu(&rtk->ssat[sat - 1].slip[f], 0, 2, obs[i].LLI[f]); + else + setbitu(&rtk->ssat[sat - 1].slip[f], 2, 2, obs[i].LLI[f]); /* save slip and half-cycle valid flag */ - rtk->ssat[sat-1].slip[f]|=(unsigned char)slip; - rtk->ssat[sat-1].half[f] = (obs[i].LLI[f]&2) ? 0 : 1; + rtk->ssat[sat - 1].slip[f] |= (unsigned char)slip; + rtk->ssat[sat - 1].half[f] = (obs[i].LLI[f] & 2) ? 0 : 1; } } /* detect cycle slip by L1-L2 geometry free phase jump -----------------------*/ 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; double g0, g1; trace(3, "detslp_gf_L1L2: i=%d j=%d\n", i, j); - if (rtk->opt.nf <= 1 || (g1=gfobs_L1L2(obs, i, j, nav->lam[sat-1])) == 0.0) return; + if (rtk->opt.nf <= 1 || (g1 = gfobs_L1L2(obs, i, j, nav->lam[sat - 1])) == 0.0) return; - g0 = rtk->ssat[sat-1].gf; rtk->ssat[sat-1].gf = g1; + g0 = rtk->ssat[sat - 1].gf; + rtk->ssat[sat - 1].gf = g1; - if (g0 != 0.0 && fabs(g1-g0)>rtk->opt.thresslip) + if (g0 != 0.0 && fabs(g1 - g0) > rtk->opt.thresslip) { - - rtk->ssat[sat-1].slip[0]|=1; - rtk->ssat[sat-1].slip[1]|=1; + rtk->ssat[sat - 1].slip[0] |= 1; + rtk->ssat[sat - 1].slip[1] |= 1; errmsg(rtk, "slip detected (sat=%2d GF_L1_L2=%.3f %.3f)\n", sat, g0, g1); } @@ -802,21 +827,22 @@ void detslp_gf_L1L2(rtk_t *rtk, const obsd_t *obs, int i, int j, /* detect cycle slip by L1-L5 geometry free phase jump -----------------------*/ 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; double g0, g1; trace(3, "detslp_gf_L1L5: i=%d j=%d\n", i, j); - if (rtk->opt.nf <= 2 || (g1=gfobs_L1L5(obs, i, j, nav->lam[sat-1])) == 0.0) return; + if (rtk->opt.nf <= 2 || (g1 = gfobs_L1L5(obs, i, j, nav->lam[sat - 1])) == 0.0) return; - g0 = rtk->ssat[sat-1].gf2; rtk->ssat[sat-1].gf2 = g1; + g0 = rtk->ssat[sat - 1].gf2; + rtk->ssat[sat - 1].gf2 = g1; - if (g0 != 0.0 && fabs(g1-g0)>rtk->opt.thresslip) + if (g0 != 0.0 && fabs(g1 - g0) > rtk->opt.thresslip) { - rtk->ssat[sat-1].slip[0]|=1; - rtk->ssat[sat-1].slip[2]|=1; + rtk->ssat[sat - 1].slip[0] |= 1; + rtk->ssat[sat - 1].slip[2] |= 1; errmsg(rtk, "slip detected (sat=%2d GF_L1_L5=%.3f %.3f)\n", sat, g0, g1); } @@ -825,9 +851,9 @@ void detslp_gf_L1L5(rtk_t *rtk, const obsd_t *obs, int i, int j, /* detect cycle slip by doppler and phase difference -------------------------*/ void detslp_dop(rtk_t *rtk __attribute__((unused)), const obsd_t *obs __attribute__((unused)), int i __attribute__((unused)), int rcv __attribute__((unused)), - const nav_t *nav __attribute__((unused))) + const nav_t *nav __attribute__((unused))) { - /* detection with doppler disabled because of clock-jump issue (v.2.3.0) */ +/* detection with doppler disabled because of clock-jump issue (v.2.3.0) */ #if 0 int f,sat = obs[i].sat; double tt,dph,dpt,lam,thres; @@ -863,17 +889,17 @@ void detslp_dop(rtk_t *rtk __attribute__((unused)), const obsd_t *obs __attribut /* temporal update of phase biases -------------------------------------------*/ 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; int i, j, f, slip, reset, nf = NF_RTK(&rtk->opt); trace(3, "udbias : tt=%.1f ns=%d\n", tt, ns); - for (i = 0;iopt.nf;f++) rtk->ssat[sat[i]-1].slip[f] &= 0xFC; + for (f = 0; f < rtk->opt.nf; f++) rtk->ssat[sat[i] - 1].slip[f] &= 0xFC; detslp_ll(rtk, obs, iu[i], 1); detslp_ll(rtk, obs, ir[i], 2); @@ -886,19 +912,18 @@ void udbias(rtk_t *rtk, double tt, const obsd_t *obs, const int *sat, detslp_dop(rtk, obs, ir[i], 2, nav); /* update half-cycle valid flag */ - for (f = 0;fssat[sat[i]-1].half[f] = - !((obs[iu[i]].LLI[f]&2) || (obs[ir[i]].LLI[f]&2)); + rtk->ssat[sat[i] - 1].half[f] = + !((obs[iu[i]].LLI[f] & 2) || (obs[ir[i]].LLI[f] & 2)); } } - for (f = 0;fssat[i-1].outc[f]>(unsigned int)rtk->opt.maxout; + reset = ++rtk->ssat[i - 1].outc[f] > (unsigned int)rtk->opt.maxout; if (rtk->opt.modear == ARMODE_INST && rtk->x[IB_RTK(i, f, &rtk->opt)] != 0.0) { @@ -908,71 +933,71 @@ void udbias(rtk_t *rtk, double tt, const obsd_t *obs, const int *sat, { initx_rtk(rtk, 0.0, 0.0, IB_RTK(i, f, &rtk->opt)); trace(3, "udbias : obs outage counter overflow (sat=%3d L%d n=%d)\n", - i, f+1, rtk->ssat[i-1].outc[f]); + i, f + 1, rtk->ssat[i - 1].outc[f]); } if (rtk->opt.modear != ARMODE_INST && reset) { - rtk->ssat[i-1].lock[f] = -rtk->opt.minlock; + rtk->ssat[i - 1].lock[f] = -rtk->opt.minlock; } } /* reset phase-bias if detecting cycle slip */ - for (i = 0;iopt); - rtk->P[j+j*rtk->nx]+=rtk->opt.prn[0]*rtk->opt.prn[0]*tt; - slip = rtk->ssat[sat[i]-1].slip[f]; - if (rtk->opt.ionoopt == IONOOPT_IFLC) slip|=rtk->ssat[sat[i]-1].slip[1]; - if (rtk->opt.modear == ARMODE_INST || !(slip&1)) continue; + rtk->P[j + j * rtk->nx] += rtk->opt.prn[0] * rtk->opt.prn[0] * tt; + slip = rtk->ssat[sat[i] - 1].slip[f]; + if (rtk->opt.ionoopt == IONOOPT_IFLC) slip |= rtk->ssat[sat[i] - 1].slip[1]; + if (rtk->opt.modear == ARMODE_INST || !(slip & 1)) continue; rtk->x[j] = 0.0; - rtk->ssat[sat[i]-1].lock[f] = -rtk->opt.minlock; + rtk->ssat[sat[i] - 1].lock[f] = -rtk->opt.minlock; } bias = zeros(ns, 1); /* estimate approximate phase-bias by phase - code */ - for (i = j = 0, offset = 0.0;iopt.ionoopt != IONOOPT_IFLC) { cp = sdobs(obs, iu[i], ir[i], f); /* cycle */ - pr = sdobs(obs, iu[i], ir[i], f+NFREQ); - lami = nav->lam[sat[i]-1][f]; + pr = sdobs(obs, iu[i], ir[i], f + NFREQ); + lami = nav->lam[sat[i] - 1][f]; if (cp == 0.0 || pr == 0.0 || lami <= 0.0) continue; - bias[i] = cp-pr/lami; + bias[i] = cp - pr / lami; } else { cp1 = sdobs(obs, iu[i], ir[i], 0); cp2 = sdobs(obs, iu[i], ir[i], 1); pr1 = sdobs(obs, iu[i], ir[i], NFREQ); - pr2 = sdobs(obs, iu[i], ir[i], NFREQ+1); - lam1 = nav->lam[sat[i]-1][0]; - lam2 = nav->lam[sat[i]-1][1]; + pr2 = sdobs(obs, iu[i], ir[i], NFREQ + 1); + lam1 = nav->lam[sat[i] - 1][0]; + lam2 = nav->lam[sat[i] - 1][1]; if (cp1 == 0.0 || cp2 == 0.0 || pr1 == 0.0 || pr2 == 0.0 || lam1 <= 0.0 || lam2 <= 0.0) continue; - C1 = std::pow(lam2, 2.0)/(std::pow(lam2, 2.0)-std::pow(lam1, 2.0)); - C2 = -std::pow(lam1, 2.0)/(std::pow(lam2, 2.0)-std::pow(lam1, 2.0)); - bias[i] = (C1*lam1*cp1+C2*lam2*cp2)-(C1*pr1+C2*pr2); + C1 = std::pow(lam2, 2.0) / (std::pow(lam2, 2.0) - std::pow(lam1, 2.0)); + C2 = -std::pow(lam1, 2.0) / (std::pow(lam2, 2.0) - std::pow(lam1, 2.0)); + bias[i] = (C1 * lam1 * cp1 + C2 * lam2 * cp2) - (C1 * pr1 + C2 * pr2); } if (rtk->x[IB_RTK(sat[i], f, &rtk->opt)] != 0.0) { - offset+=bias[i]-rtk->x[IB_RTK(sat[i], f, &rtk->opt)]; + offset += bias[i] - rtk->x[IB_RTK(sat[i], f, &rtk->opt)]; j++; } } /* correct phase-bias offset to enssure phase-code coherency */ - if (j>0) { - for (i = 1;i <= MAXSAT;i++) + if (j > 0) + { + for (i = 1; i <= MAXSAT; i++) { - if (rtk->x[IB_RTK(i, f, &rtk->opt)] != 0.0) rtk->x[IB_RTK(i, f, &rtk->opt)]+=offset/j; + if (rtk->x[IB_RTK(i, f, &rtk->opt)] != 0.0) rtk->x[IB_RTK(i, f, &rtk->opt)] += offset / j; } - } + } /* set initial states of phase-bias */ - for (i = 0;ix[IB_RTK(sat[i], f, &rtk->opt)] != 0.0) continue; - initx_rtk(rtk, bias[i], std::pow(rtk->opt.std[0], 2.0), IB_RTK(sat[i], f, &rtk->opt)); + initx_rtk(rtk, bias[i], std::pow(rtk->opt.std[0], 2.0), IB_RTK(sat[i], f, &rtk->opt)); } free(bias); } @@ -981,7 +1006,7 @@ void udbias(rtk_t *rtk, double tt, const obsd_t *obs, const int *sat, /* temporal update of states --------------------------------------------------*/ 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]; @@ -1002,12 +1027,12 @@ void udstate(rtk_t *rtk, const obsd_t *obs, const int *sat, udtrop(rtk, tt, bl); } /* temporal update of eceiver h/w bias */ - if (rtk->opt.glomodear == 2 && (rtk->opt.navsys&SYS_GLO)) + if (rtk->opt.glomodear == 2 && (rtk->opt.navsys & SYS_GLO)) { udrcvbias(rtk, tt); } /* temporal update of phase-bias */ - if (rtk->opt.mode>PMODE_DGPS) + if (rtk->opt.mode > PMODE_DGPS) { udbias(rtk, tt, obs, sat, iu, ir, ns, nav); } @@ -1016,10 +1041,10 @@ void udstate(rtk_t *rtk, const obsd_t *obs, const int *sat, /* undifferenced phase/code residual for satellite ---------------------------*/ void zdres_sat(int base, double r, const obsd_t *obs, const nav_t *nav, - const double *azel, const double *dant, - const prcopt_t *opt, double *y) + const double *azel, const double *dant, + 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; int i, nf = NF_RTK(opt); @@ -1027,38 +1052,38 @@ void zdres_sat(int base, double r, const obsd_t *obs, const nav_t *nav, { /* iono-free linear combination */ if (lam[0] == 0.0 || lam[1] == 0.0) return; - if (testsnr(base, 0, azel[1], obs->SNR[0]*0.25, &opt->snrmask) || - testsnr(base, 1, azel[1], obs->SNR[1]*0.25, &opt->snrmask)) return; + if (testsnr(base, 0, azel[1], obs->SNR[0] * 0.25, &opt->snrmask) || + testsnr(base, 1, azel[1], obs->SNR[1] * 0.25, &opt->snrmask)) return; - f1 = SPEED_OF_LIGHT/lam[0]; - f2 = SPEED_OF_LIGHT/lam[1]; - C1 = std::pow(f1, 2.0)/(std::pow(f1, 2.0)-std::pow(f2, 2.0)); - C2 = -std::pow(f2, 2.0)/(std::pow(f1, 2.0)-std::pow(f2, 2.0)); - dant_if = C1*dant[0]+C2*dant[1]; + f1 = SPEED_OF_LIGHT / lam[0]; + f2 = SPEED_OF_LIGHT / lam[1]; + C1 = std::pow(f1, 2.0) / (std::pow(f1, 2.0) - std::pow(f2, 2.0)); + C2 = -std::pow(f2, 2.0) / (std::pow(f1, 2.0) - std::pow(f2, 2.0)); + dant_if = C1 * dant[0] + C2 * dant[1]; if (obs->L[0] != 0.0 && obs->L[1] != 0.0) { - y[0] = C1*obs->L[0]*lam[0]+C2*obs->L[1]*lam[1]-r-dant_if; + y[0] = C1 * obs->L[0] * lam[0] + C2 * obs->L[1] * lam[1] - r - dant_if; } if (obs->P[0] != 0.0 && obs->P[1] != 0.0) { - y[1] = C1*obs->P[0]+C2*obs->P[1]-r-dant_if; + y[1] = C1 * obs->P[0] + C2 * obs->P[1] - r - dant_if; } } else { - for (i = 0;iSNR[i]*0.25, &opt->snrmask)) + if (testsnr(base, i, azel[1], obs->SNR[i] * 0.25, &opt->snrmask)) { continue; } /* residuals = observable - pseudorange */ - if (obs->L[i] != 0.0) y[i ] = obs->L[i]*lam[i]-r-dant[i]; - if (obs->P[i] != 0.0) y[i+nf] = obs->P[i] -r-dant[i]; + if (obs->L[i] != 0.0) y[i] = obs->L[i] * lam[i] - r - dant[i]; + if (obs->P[i] != 0.0) y[i + nf] = obs->P[i] - r - dant[i]; } } } @@ -1066,63 +1091,64 @@ void zdres_sat(int base, double r, const obsd_t *obs, const nav_t *nav, /* undifferenced phase/code residuals ----------------------------------------*/ int zdres(int base, const obsd_t *obs, int n, const double *rs, - const double *dts, const int *svh, const nav_t *nav, - const double *rr, const prcopt_t *opt, int index, double *y, - double *e, double *azel) + const double *dts, const int *svh, const nav_t *nav, + const double *rr, const prcopt_t *opt, int index, double *y, + double *e, double *azel) { double r, rr_[3], pos[3], dant[NFREQ] = {0}, disp[3]; - double zhd, zazel[] = {0.0, 90.0*D2R}; + double zhd, zazel[] = {0.0, 90.0 * D2R}; int i, nf = NF_RTK(opt); trace(3, "zdres : n=%d\n", n); - for (i = 0;itidecorr) { tidedisp(gpst2utc(obs[0].time), rr_, opt->tidecorr, &nav->erp, - opt->odisp[base], disp); - for (i = 0;i<3;i++) rr_[i]+=disp[i]; + opt->odisp[base], disp); + for (i = 0; i < 3; i++) rr_[i] += disp[i]; } ecef2pos(rr_, pos); - for (i = 0;ielmin) continue; + if ((r = geodist(rs + i * 6, rr_, e + i * 3)) <= 0.0) continue; + if (satazel(pos, e + i * 3, azel + i * 2) < opt->elmin) continue; /* excluded satellite? */ if (satexclude(obs[i].sat, svh[i], opt)) continue; /* satellite clock-bias */ - r+=-SPEED_OF_LIGHT*dts[i*2]; + r += -SPEED_OF_LIGHT * dts[i * 2]; /* troposphere delay model (hydrostatic) */ zhd = tropmodel(obs[0].time, pos, zazel, 0.0); - r+=tropmapf(obs[i].time, pos, azel+i*2, NULL)*zhd; + r += tropmapf(obs[i].time, pos, azel + i * 2, NULL) * zhd; /* receiver antenna phase center correction */ - antmodel(opt->pcvr+index, opt->antdel[index], azel+i*2, opt->posopt[1], - dant); + antmodel(opt->pcvr + index, opt->antdel[index], azel + i * 2, opt->posopt[1], + dant); /* undifferenced phase/code residual for satellite */ - zdres_sat(base, r, obs+i, nav, azel+i*2, dant, opt, y+i*nf*2); + zdres_sat(base, r, obs + i, nav, azel + i * 2, dant, opt, y + i * nf * 2); } trace(4, "rr_=%.3f %.3f %.3f\n", rr_[0], rr_[1], rr_[2]); - trace(4, "pos=%.9f %.9f %.3f\n", pos[0]*R2D, pos[1]*R2D, pos[2]); - for (i = 0;iopt.baseline[0] <= 0.0) return 0; /* time-adjusted baseline vector and length */ - for (i = 0;i<3;i++) + for (i = 0; i < 3; i++) { - xb[i] = rtk->rb[i]+rtk->rb[i+3]*rtk->sol.age; - b[i] = x[i]-xb[i]; + xb[i] = rtk->rb[i] + rtk->rb[i + 3] * rtk->sol.age; + b[i] = x[i] - xb[i]; } bb = norm_rtk(b, 3); /* approximate variance of solution */ if (P) { - for (i = 0;i<3;i++) + for (i = 0; i < 3; i++) { - var += P[i+i*rtk->nx]; + var += P[i + i * rtk->nx]; } var /= 3.0; } /* check nonlinearity */ - if (var>thres*thres*bb*bb) + if (var > thres * thres * bb * bb) { trace(3, "constbl : equation nonlinear (bb=%.3f var=%.3f)\n", bb, var); return 0; } /* constraint to baseline length */ - v[index] = rtk->opt.baseline[0]-bb; + v[index] = rtk->opt.baseline[0] - bb; if (H) { - for (i = 0;i<3;i++) H[i+index*rtk->nx] = b[i]/bb; + for (i = 0; i < 3; i++) H[i + index * rtk->nx] = b[i] / bb; } Ri[index] = 0.0; - Rj[index] = std::pow(rtk->opt.baseline[1], 2.0); + Rj[index] = std::pow(rtk->opt.baseline[1], 2.0); trace(4, "baseline len v=%13.3f R=%8.6f %8.6f\n", v[index], Ri[index], Rj[index]); @@ -1211,8 +1238,8 @@ int constbl(rtk_t *rtk, const double *x, const double *P, double *v, /* precise tropspheric model -------------------------------------------------*/ double prectrop(gtime_t time, const double *pos, int r, - const double *azel, const prcopt_t *opt, const double *x, - double *dtdx) + const double *azel, const prcopt_t *opt, const double *x, + double *dtdx) { double m_w = 0.0, cotz, grad_n, grad_e; int i = IT_RTK(r, opt); @@ -1220,33 +1247,34 @@ double prectrop(gtime_t time, const double *pos, int r, /* wet mapping function */ tropmapf(time, pos, azel, &m_w); - if (opt->tropopt >= TROPOPT_ESTG && azel[1]>0.0) + if (opt->tropopt >= TROPOPT_ESTG && azel[1] > 0.0) { /* m_w=m_0+m_0*cot(el)*(Gn*cos(az)+Ge*sin(az)): ref [6] */ - cotz = 1.0/tan(azel[1]); - grad_n = m_w*cotz*cos(azel[0]); - grad_e = m_w*cotz*sin(azel[0]); - m_w+=grad_n*x[i+1]+grad_e*x[i+2]; - dtdx[1] = grad_n*x[i]; - dtdx[2] = grad_e*x[i]; + cotz = 1.0 / tan(azel[1]); + grad_n = m_w * cotz * cos(azel[0]); + grad_e = m_w * cotz * sin(azel[0]); + m_w += grad_n * x[i + 1] + grad_e * x[i + 2]; + dtdx[1] = grad_n * x[i]; + dtdx[2] = grad_e * x[i]; } - else dtdx[1] = dtdx[2] = 0.0; + else + dtdx[1] = dtdx[2] = 0.0; dtdx[0] = m_w; - return m_w*x[i]; + return m_w * x[i]; } /* glonass inter-channel bias correction -------------------------------------*/ double gloicbcorr(int sat1 __attribute((unused)), int sat2 __attribute((unused)), const prcopt_t *opt, double lam1, - double lam2, int f) + double lam2, int f) { double dfreq; - if (f>=NFREQGLO || f >= opt->nf || !opt->exterr.ena[2]) return 0.0; + if (f >= NFREQGLO || f >= opt->nf || !opt->exterr.ena[2]) return 0.0; - dfreq = (SPEED_OF_LIGHT/lam1-SPEED_OF_LIGHT/lam2)/(f == 0 ? DFRQ1_GLO : DFRQ2_GLO); + dfreq = (SPEED_OF_LIGHT / lam1 - SPEED_OF_LIGHT / lam2) / (f == 0 ? DFRQ1_GLO : DFRQ2_GLO); - return opt->exterr.gloicb[f]*0.01*dfreq; /* (m) */ + return opt->exterr.gloicb[f] * 0.01 * dfreq; /* (m) */ } @@ -1254,190 +1282,204 @@ double gloicbcorr(int sat1 __attribute((unused)), int sat2 __attribute((unused)) int test_sys(int sys, int m) { switch (sys) - { - case SYS_GPS: return m == 0; - case SYS_QZS: return m == 0; - case SYS_SBS: return m == 0; - case SYS_GLO: return m == 1; - case SYS_GAL: return m == 2; - case SYS_BDS: return m == 3; - } + { + case SYS_GPS: + return m == 0; + case SYS_QZS: + return m == 0; + case SYS_SBS: + return m == 0; + case SYS_GLO: + return m == 1; + case SYS_GAL: + return m == 2; + case SYS_BDS: + return m == 3; + } return 0; } /* double-differenced phase/code residuals -----------------------------------*/ int ddres(rtk_t *rtk, const nav_t *nav, double dt, const double *x, - const double *P, const int *sat, double *y, double *e, - double *azel, const int *iu, const int *ir, int ns, double *v, - double *H, double *R, int *vflg) + const double *P, const int *sat, double *y, double *e, + double *azel, const int *iu, const int *ir, int ns, double *v, + double *H, double *R, int *vflg) { prcopt_t *opt = &rtk->opt; double bl, dr[3], posu[3], posr[3], didxi = 0.0, didxj = 0.0, *im; double *tropr, *tropu, *dtdxr, *dtdxu, *Ri, *Rj, lami, lamj, fi, fj, df, *Hi = NULL; - int i, j, k, m, f, ff, nv = 0, nb[NFREQ*4*2+2] = {0}, b = 0, sysi, sysj, nf = NF_RTK(opt); + int i, j, k, m, f, ff, nv = 0, nb[NFREQ * 4 * 2 + 2] = {0}, b = 0, sysi, sysj, nf = NF_RTK(opt); trace(3, "ddres : dt=%.1f nx=%d ns=%d\n", dt, rtk->nx, ns); bl = baseline(x, rtk->rb, dr); - ecef2pos(x, posu); ecef2pos(rtk->rb, posr); + ecef2pos(x, posu); + ecef2pos(rtk->rb, posr); - Ri = mat(ns*nf*2+2, 1); Rj = mat(ns*nf*2+2, 1); im = mat(ns, 1); - tropu = mat(ns, 1); tropr = mat(ns, 1); dtdxu = mat(ns, 3); dtdxr = mat(ns, 3); + Ri = mat(ns * nf * 2 + 2, 1); + Rj = mat(ns * nf * 2 + 2, 1); + im = mat(ns, 1); + tropu = mat(ns, 1); + tropr = mat(ns, 1); + dtdxu = mat(ns, 3); + dtdxr = mat(ns, 3); - for (i = 0;issat[i].resp[j] = rtk->ssat[i].resc[j] = 0.0; - } + for (i = 0; i < MAXSAT; i++) + for (j = 0; j < NFREQ; j++) + { + rtk->ssat[i].resp[j] = rtk->ssat[i].resc[j] = 0.0; + } /* compute factors of ionospheric and tropospheric delay */ - for (i = 0;iionoopt >= IONOOPT_EST) { - im[i] = (ionmapf(posu, azel+iu[i]*2)+ionmapf(posr, azel+ir[i]*2))/2.0; + im[i] = (ionmapf(posu, azel + iu[i] * 2) + ionmapf(posr, azel + ir[i] * 2)) / 2.0; } if (opt->tropopt >= TROPOPT_EST) { - tropu[i] = prectrop(rtk->sol.time, posu, 0, azel+iu[i]*2, opt, x, dtdxu+i*3); - tropr[i] = prectrop(rtk->sol.time, posr, 1, azel+ir[i]*2, opt, x, dtdxr+i*3); + tropu[i] = prectrop(rtk->sol.time, posu, 0, azel + iu[i] * 2, opt, x, dtdxu + i * 3); + tropr[i] = prectrop(rtk->sol.time, posr, 1, azel + ir[i] * 2, opt, x, dtdxr + i * 3); } } - for (m = 0;m<4;m++) /* m=0:gps/qzs/sbs, 1:glo, 2:gal, 3:bds */ + for (m = 0; m < 4; m++) /* m=0:gps/qzs/sbs, 1:glo, 2:gal, 3:bds */ - for (f = opt->mode>PMODE_DGPS ? 0 : nf;fmode > PMODE_DGPS ? 0 : nf; f < nf * 2; f++) { - /* search reference satellite with highest elevation */ - for (i = -1, j = 0;jssat[sat[j]-1].sys; + sysi = rtk->ssat[sat[j] - 1].sys; if (!test_sys(sysi, m)) continue; if (!validobs(iu[j], ir[j], f, nf, y)) continue; - if (i<0 || azel[1+iu[j]*2] >= azel[1+iu[i]*2]) i = j; + if (i < 0 || azel[1 + iu[j] * 2] >= azel[1 + iu[i] * 2]) i = j; } - if (i<0) continue; + if (i < 0) continue; /* make double difference */ - for (j = 0;jssat[sat[i]-1].sys; - sysj = rtk->ssat[sat[j]-1].sys; + sysi = rtk->ssat[sat[i] - 1].sys; + sysj = rtk->ssat[sat[j] - 1].sys; if (!test_sys(sysj, m)) continue; if (!validobs(iu[j], ir[j], f, nf, y)) continue; - ff = f%nf; - lami = nav->lam[sat[i]-1][ff]; - lamj = nav->lam[sat[j]-1][ff]; + ff = f % nf; + lami = nav->lam[sat[i] - 1][ff]; + lamj = nav->lam[sat[j] - 1][ff]; if (lami <= 0.0 || lamj <= 0.0) continue; if (H) { - Hi = H+nv*rtk->nx; - for (k = 0;knx;k++) Hi[k] = 0.0; + Hi = H + nv * rtk->nx; + for (k = 0; k < rtk->nx; k++) Hi[k] = 0.0; } /* double-differenced residual */ - v[nv] = (y[f+iu[i]*nf*2]-y[f+ir[i]*nf*2])- - (y[f+iu[j]*nf*2]-y[f+ir[j]*nf*2]); + v[nv] = (y[f + iu[i] * nf * 2] - y[f + ir[i] * nf * 2]) - + (y[f + iu[j] * nf * 2] - y[f + ir[j] * nf * 2]); /* partial derivatives by rover position */ if (H) { - for (k = 0;k<3;k++) + for (k = 0; k < 3; k++) { - Hi[k] = -e[k+iu[i]*3]+e[k+iu[j]*3]; + Hi[k] = -e[k + iu[i] * 3] + e[k + iu[j] * 3]; } } /* double-differenced ionospheric delay term */ if (opt->ionoopt == IONOOPT_EST) { - fi = lami/lam_carr[0]; fj = lamj/lam_carr[0]; - didxi = (ftropopt == TROPOPT_EST || opt->tropopt == TROPOPT_ESTG) { - v[nv] -= (tropu[i]-tropu[j])-(tropr[i]-tropr[j]); - for (k = 0;k<(opt->tropopttropopt < TROPOPT_ESTG ? 1 : 3); k++) { if (!H) continue; - Hi[IT_RTK(0, opt)+k] = (dtdxu[k+i*3]-dtdxu[k+j*3]); - Hi[IT_RTK(1, opt)+k] = -(dtdxr[k+i*3]-dtdxr[k+j*3]); + Hi[IT_RTK(0, opt) + k] = (dtdxu[k + i * 3] - dtdxu[k + j * 3]); + Hi[IT_RTK(1, opt) + k] = -(dtdxr[k + i * 3] - dtdxr[k + j * 3]); } } /* double-differenced phase-bias term */ - if (fionoopt != IONOOPT_IFLC) { - v[nv] -= lami*x[IB_RTK(sat[i], f, opt)]-lamj*x[IB_RTK(sat[j], f, opt)]; + v[nv] -= lami * x[IB_RTK(sat[i], f, opt)] - lamj * x[IB_RTK(sat[j], f, opt)]; if (H) { - Hi[IB_RTK(sat[i], f, opt)] = lami; + Hi[IB_RTK(sat[i], f, opt)] = lami; Hi[IB_RTK(sat[j], f, opt)] = -lamj; } } else { - v[nv] -= x[IB_RTK(sat[i], f, opt)]-x[IB_RTK(sat[j], f, opt)]; + v[nv] -= x[IB_RTK(sat[i], f, opt)] - x[IB_RTK(sat[j], f, opt)]; if (H) { - Hi[IB_RTK(sat[i], f, opt)] = 1.0; + Hi[IB_RTK(sat[i], f, opt)] = 1.0; Hi[IB_RTK(sat[j], f, opt)] = -1.0; } } } /* glonass receiver h/w bias term */ - if (rtk->opt.glomodear == 2 && sysi == SYS_GLO && sysj == SYS_GLO && ffopt.glomodear == 2 && sysi == SYS_GLO && sysj == SYS_GLO && ff < NFREQGLO) { - df = (SPEED_OF_LIGHT/lami-SPEED_OF_LIGHT/lamj)/1E6; /* freq-difference (MHz) */ - v[nv] -= df*x[IL_RTK(ff, opt)]; + df = (SPEED_OF_LIGHT / lami - SPEED_OF_LIGHT / lamj) / 1E6; /* freq-difference (MHz) */ + v[nv] -= df * x[IL_RTK(ff, opt)]; if (H) Hi[IL_RTK(ff, opt)] = df; } /* glonass interchannel bias correction */ else if (sysi == SYS_GLO && sysj == SYS_GLO) { - v[nv] -= gloicbcorr(sat[i], sat[j], &rtk->opt, lami, lamj, f); } - if (fssat[sat[j]-1].resc[f ] = v[nv]; - else rtk->ssat[sat[j]-1].resp[f-nf] = v[nv]; + if (f < nf) + rtk->ssat[sat[j] - 1].resc[f] = v[nv]; + else + rtk->ssat[sat[j] - 1].resp[f - nf] = v[nv]; /* test innovation */ - if (opt->maxinno>0.0 && fabs(v[nv])>opt->maxinno) + if (opt->maxinno > 0.0 && fabs(v[nv]) > opt->maxinno) { - if (fssat[sat[i]-1].rejc[f]++; - rtk->ssat[sat[j]-1].rejc[f]++; + rtk->ssat[sat[i] - 1].rejc[f]++; + rtk->ssat[sat[j] - 1].rejc[f]++; } errmsg(rtk, "outlier rejected (sat=%3d-%3d %s%d v=%.3f)\n", - sat[i], sat[j], fmode>PMODE_DGPS) + if (opt->mode > PMODE_DGPS) { - if (fssat[sat[i]-1].vsat[f] = rtk->ssat[sat[j]-1].vsat[f] = 1; + if (f < nf) rtk->ssat[sat[i] - 1].vsat[f] = rtk->ssat[sat[j] - 1].vsat[f] = 1; } else { - rtk->ssat[sat[i]-1].vsat[f-nf] = rtk->ssat[sat[j]-1].vsat[f-nf] = 1; + rtk->ssat[sat[i] - 1].vsat[f - nf] = rtk->ssat[sat[j] - 1].vsat[f - nf] = 1; } trace(4, "sat=%3d-%3d %s%d v=%13.3f R=%8.6f %8.6f\n", sat[i], - sat[j], fmode == PMODE_MOVEB && constbl(rtk, x, P, v, H, Ri, Rj, nv)) { - vflg[nv++] = 3<<4; + vflg[nv++] = 3 << 4; nb[b++]++; } - if (H) {trace(5, "H=\n"); tracemat(5, H, rtk->nx, nv, 7, 4);} + if (H) + { + trace(5, "H=\n"); + tracemat(5, H, rtk->nx, nv, 7, 4); + } /* double-differenced measurement error covariance */ ddcov(nb, b, Ri, Rj, nv, R); - free(Ri); free(Rj); free(im); - free(tropu); free(tropr); free(dtdxu); free(dtdxr); + free(Ri); + free(Rj); + free(im); + free(tropu); + free(tropr); + free(dtdxu); + free(dtdxr); return nv; } @@ -1486,25 +1537,26 @@ int ddres(rtk_t *rtk, const nav_t *nav, double dt, const double *x, /* time-interpolation of residuals (for post-mission) ------------------------*/ 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 double yb[MAXOBS*NFREQ*2], rs[MAXOBS*6], dts[MAXOBS*2], var[MAXOBS]; - static double e[MAXOBS*3], azel[MAXOBS*2]; - static int nb = 0, svh[MAXOBS*2]; + static double yb[MAXOBS * NFREQ * 2], rs[MAXOBS * 6], dts[MAXOBS * 2], var[MAXOBS]; + static double e[MAXOBS * 3], azel[MAXOBS * 2]; + static int nb = 0, svh[MAXOBS * 2]; prcopt_t *opt = &rtk->opt; double tt = timediff(time, obs[0].time), ttb, *p, *q; int i, j, k, nf = NF_RTK(opt); trace(3, "intpres : n=%d tt=%.1f\n", n, tt); - if (nb == 0 || fabs(tt)opt->maxtdiff*2.0 || ttb == tt) return tt; + if (fabs(ttb) > opt->maxtdiff * 2.0 || ttb == tt) return tt; satposs(time, obsb, nb, nav, opt->sateph, rs, dts, var, svh); @@ -1512,16 +1564,20 @@ double intpres(gtime_t time, const obsd_t *obs, int n, const nav_t *nav, { return tt; } - for (i = 0;i= nb) continue; - for (k = 0, p = y+i*nf*2, q = yb+j*nf*2;kfabs(tt) ? ttb : tt; + return fabs(ttb) > fabs(tt) ? ttb : tt; } @@ -1532,57 +1588,61 @@ int ddmat(rtk_t *rtk, double *D) trace(3, "ddmat :\n"); - for (i = 0;issat[i].fix[j] = 0; - } - for (i = 0;issat[i].fix[j] = 0; + } + for (i = 0; i < na; i++) D[i + i * nx] = 1.0; - for (m = 0;m<4;m++) + for (m = 0; m < 4; m++) { /* m=0:gps/qzs/sbs, 1:glo, 2:gal, 3:bds */ nofix = (m == 1 && rtk->opt.glomodear == 0) || (m == 3 && rtk->opt.bdsmodear == 0); - for (f = 0, k = na;fx[i] == 0.0 || !test_sys(rtk->ssat[i-k].sys, m) || - !rtk->ssat[i-k].vsat[f] || !rtk->ssat[i-k].half[f]) + if (rtk->x[i] == 0.0 || !test_sys(rtk->ssat[i - k].sys, m) || + !rtk->ssat[i - k].vsat[f] || !rtk->ssat[i - k].half[f]) { continue; } - if (rtk->ssat[i-k].lock[f]>0 && !(rtk->ssat[i-k].slip[f]&2) && - rtk->ssat[i-k].azel[1] >= rtk->opt.elmaskar && !nofix) + if (rtk->ssat[i - k].lock[f] > 0 && !(rtk->ssat[i - k].slip[f] & 2) && + rtk->ssat[i - k].azel[1] >= rtk->opt.elmaskar && !nofix) { - rtk->ssat[i-k].fix[f] = 2; /* fix */ + rtk->ssat[i - k].fix[f] = 2; /* fix */ break; } - else rtk->ssat[i-k].fix[f] = 1; + else + rtk->ssat[i - k].fix[f] = 1; } - for (j = k;jx[j] == 0.0 || !test_sys(rtk->ssat[j-k].sys, m) || - !rtk->ssat[j-k].vsat[f]) + if (i == j || rtk->x[j] == 0.0 || !test_sys(rtk->ssat[j - k].sys, m) || + !rtk->ssat[j - k].vsat[f]) { continue; } - if (rtk->ssat[j-k].lock[f]>0 && !(rtk->ssat[j-k].slip[f]&2) && - rtk->ssat[i-k].vsat[f] && - rtk->ssat[j-k].azel[1] >= rtk->opt.elmaskar && !nofix) + if (rtk->ssat[j - k].lock[f] > 0 && !(rtk->ssat[j - k].slip[f] & 2) && + rtk->ssat[i - k].vsat[f] && + rtk->ssat[j - k].azel[1] >= rtk->opt.elmaskar && !nofix) { - D[i+(na+nb)*nx] = 1.0; - D[j+(na+nb)*nx] = -1.0; + D[i + (na + nb) * nx] = 1.0; + D[j + (na + nb) * nx] = -1.0; nb++; - rtk->ssat[j-k].fix[f] = 2; /* fix */ + rtk->ssat[j - k].fix[f] = 2; /* fix */ } - else rtk->ssat[j-k].fix[f] = 1; + else + rtk->ssat[j - k].fix[f] = 1; } } } } - trace(5, "D=\n"); tracemat(5, D, nx, na+nb, 2, 0); + trace(5, "D=\n"); + tracemat(5, D, nx, na + nb, 2, 0); return nb; } @@ -1594,28 +1654,29 @@ void restamb(rtk_t *rtk, const double *bias, int nb __attribute((unused)), doubl trace(3, "restamb :\n"); - for (i = 0;inx;i++) xa[i] = rtk->x [i]; - for (i = 0;ina;i++) xa[i] = rtk->xa[i]; + for (i = 0; i < rtk->nx; i++) xa[i] = rtk->x[i]; + for (i = 0; i < rtk->na; i++) xa[i] = rtk->xa[i]; - for (m = 0;m<4;m++) for (f = 0;fssat[i].sys, m) || rtk->ssat[i].fix[f] != 2) - { - continue; - } - index[n++] = IB_RTK(i+1, f, &rtk->opt); - } - if (n<2) continue; + for (m = 0; m < 4; m++) + for (f = 0; f < nf; f++) + { + for (n = i = 0; i < MAXSAT; i++) + { + if (!test_sys(rtk->ssat[i].sys, m) || rtk->ssat[i].fix[f] != 2) + { + continue; + } + index[n++] = IB_RTK(i + 1, f, &rtk->opt); + } + if (n < 2) continue; - xa[index[0]] = rtk->x[index[0]]; + xa[index[0]] = rtk->x[index[0]]; - for (i = 1;inx-rtk->na, nv = 0, nf = NF_RTK(&rtk->opt); + int i, n, m, f, info, index[MAXSAT], nb = rtk->nx - rtk->na, nv = 0, nf = NF_RTK(&rtk->opt); trace(3, "holdamb :\n"); - v = mat(nb, 1); H = zeros(nb, rtk->nx); + v = mat(nb, 1); + H = zeros(nb, rtk->nx); - for (m = 0;m<4;m++) for (f = 0;fssat[i].sys, m) || rtk->ssat[i].fix[f] != 2 || - rtk->ssat[i].azel[1]opt.elmaskhold) - { - continue; - } - index[n++] = IB_RTK(i+1, f, &rtk->opt); - rtk->ssat[i].fix[f] = 3; /* hold */ - } - /* constraint to fixed ambiguity */ - for (i = 1;ix[index[0]]-rtk->x[index[i]]); + for (m = 0; m < 4; m++) + for (f = 0; f < nf; f++) + { + for (n = i = 0; i < MAXSAT; i++) + { + if (!test_sys(rtk->ssat[i].sys, m) || rtk->ssat[i].fix[f] != 2 || + rtk->ssat[i].azel[1] < rtk->opt.elmaskhold) + { + continue; + } + index[n++] = IB_RTK(i + 1, f, &rtk->opt); + rtk->ssat[i].fix[f] = 3; /* hold */ + } + /* constraint to fixed ambiguity */ + for (i = 1; i < n; i++) + { + v[nv] = (xa[index[0]] - xa[index[i]]) - (rtk->x[index[0]] - rtk->x[index[i]]); - H[index[0]+nv*rtk->nx] = 1.0; - H[index[i]+nv*rtk->nx] = -1.0; - nv++; - } - } - if (nv>0) + H[index[0] + nv * rtk->nx] = 1.0; + H[index[i] + nv * rtk->nx] = -1.0; + nv++; + } + } + if (nv > 0) { R = zeros(nv, nv); - for (i = 0;ix, rtk->P, H, v, R, rtk->nx, nv))) @@ -1663,7 +1726,8 @@ void holdamb(rtk_t *rtk, const double *xa) } free(R); } - free(v); free(H); + free(v); + free(H); } @@ -1679,7 +1743,7 @@ int resamb_LAMBDA(rtk_t *rtk, double *bias, double *xa) rtk->sol.ratio = 0.0; if (rtk->opt.mode <= PMODE_DGPS || rtk->opt.modear == ARMODE_OFF || - rtk->opt.thresar[0]<1.0) + rtk->opt.thresar[0] < 1.0) { return 0; } @@ -1691,64 +1755,77 @@ int resamb_LAMBDA(rtk_t *rtk, double *bias, double *xa) free(D); return 0; } - ny = na+nb; y = mat(ny, 1); Qy = mat(ny, ny); DP = mat(ny, nx); - b = mat(nb, 2); db = mat(nb, 1); Qb = mat(nb, nb); Qab = mat(na, nb); QQ = mat(na, nb); + ny = na + nb; + y = mat(ny, 1); + Qy = mat(ny, ny); + DP = mat(ny, nx); + b = mat(nb, 2); + db = mat(nb, 1); + Qb = mat(nb, nb); + Qab = mat(na, nb); + QQ = mat(na, nb); /* transform single to double-differenced phase-bias (y=D'*x, Qy=D'*P*D) */ - matmul("TN", ny, 1, nx, 1.0, D , rtk->x, 0.0, y ); - matmul("TN", ny, nx, nx, 1.0, D , rtk->P, 0.0, DP); - matmul("NN", ny, ny, nx, 1.0, DP, D , 0.0, Qy); + matmul("TN", ny, 1, nx, 1.0, D, rtk->x, 0.0, y); + matmul("TN", ny, nx, nx, 1.0, D, rtk->P, 0.0, DP); + matmul("NN", ny, ny, nx, 1.0, DP, D, 0.0, Qy); /* phase-bias covariance (Qb) and real-parameters to bias covariance (Qab) */ - for (i = 0;ixa); + matmul("NN", nb, 1, nb, 1.0, Qb, y + na, 0.0, db); + matmul("NN", na, 1, nb, -1.0, Qab, db, 1.0, rtk->xa); /* covariance of fixed solution (Qa=Qa-Qab*Qb^-1*Qab') */ - matmul("NN", na, nb, nb, 1.0, Qab, Qb , 0.0, QQ); - matmul("NT", na, na, nb, -1.0, QQ , Qab, 1.0, rtk->Pa); + matmul("NN", na, nb, nb, 1.0, Qab, Qb, 0.0, QQ); + matmul("NT", na, na, nb, -1.0, QQ, Qab, 1.0, rtk->Pa); trace(3, "resamb : validation ok (nb=%d ratio=%.2f s=%.2f/%.2f)\n", - nb, s[0] == 0.0 ? 0.0 : s[1]/s[0], s[0], s[1]); + nb, s[0] == 0.0 ? 0.0 : s[1] / s[0], s[0], s[1]); /* restore single-differenced ambiguity */ restamb(rtk, bias, nb, xa); } - else nb = 0; + else + nb = 0; } else { /* validation failed */ errmsg(rtk, "ambiguity validation failed (nb=%d ratio=%.2f s=%.2f/%.2f)\n", - nb, s[1]/s[0], s[0], s[1]); + nb, s[1] / s[0], s[0], s[1]); nb = 0; } } @@ -1756,38 +1833,45 @@ int resamb_LAMBDA(rtk_t *rtk, double *bias, double *xa) { errmsg(rtk, "lambda error (info=%d)\n", info); } - free(D); free(y); free(Qy); free(DP); - free(b); free(db); free(Qb); free(Qab); free(QQ); + free(D); + free(y); + free(Qy); + free(DP); + free(b); + free(db); + free(Qb); + free(Qab); + free(QQ); return nb; /* number of ambiguities */ } /* validation of solution ----------------------------------------------------*/ -int valpos(rtk_t *rtk, const double *v, const double *R, const int *vflg, - int nv, double thres) +int valpos(rtk_t *rtk, const double *v, const double *R, const int *vflg, + int nv, double thres) { #if 0 prcopt_t *opt = &rtk->opt; double vv = 0.0; #endif - double fact = thres*thres; + double fact = thres * thres; int i, stat = 1, sat1, sat2, type, freq; char stype; trace(3, "valpos : nv=%d thres=%.1f\n", nv, thres); /* post-fit residual test */ - for (i = 0;i>16)&0xFF; - sat2 = (vflg[i]>> 8)&0xFF; - type = (vflg[i]>> 4)&0xF; - freq = vflg[i]&0xF; + if (v[i] * v[i] <= fact * R[i + i * nv]) continue; + sat1 = (vflg[i] >> 16) & 0xFF; + sat2 = (vflg[i] >> 8) & 0xFF; + type = (vflg[i] >> 4) & 0xF; + freq = vflg[i] & 0xF; stype = type == 0 ? 'L' : (type == 1 ? 'L' : 'C'); errmsg(rtk, "large residual (sat=%2d-%2d %s%d v=%6.3f sig=%.3f)\n", - sat1, sat2, stype, freq+1, v[i], std::sqrt(R[i+i*nv])); + sat1, sat2, stype, freq + 1, v[i], std::sqrt(R[i + i * nv])); } #if 0 /* omitted v.2.4.0 */ if (stat&&nv>NP(opt)) @@ -1814,13 +1898,13 @@ int valpos(rtk_t *rtk, const double *v, const double *R, const int *vflg, /* relative positioning ------------------------------------------------------*/ int relpos(rtk_t *rtk, const obsd_t *obs, int nu, int nr, - const nav_t *nav) + const nav_t *nav) { prcopt_t *opt = &rtk->opt; gtime_t time = obs[0].time; double *rs, *dts, *var, *y, *e, *azel, *v, *H, *R, *xp, *Pp, *xa, *bias, dt; - int i, j, f, n = nu+nr, ns, ny, nv, sat[MAXSAT], iu[MAXSAT], ir[MAXSAT], niter; - int info, vflg[MAXOBS*NFREQ*2+1], svh[MAXOBS*2]; + int i, j, f, n = nu + nr, ns, ny, nv, sat[MAXSAT], iu[MAXSAT], ir[MAXSAT], niter; + int info, vflg[MAXOBS * NFREQ * 2 + 1], svh[MAXOBS * 2]; int stat = rtk->opt.mode <= PMODE_DGPS ? SOLQ_DGPS : SOLQ_FLOAT; int nf = opt->ionoopt == IONOOPT_IFLC ? 1 : opt->nf; @@ -1828,54 +1912,74 @@ int relpos(rtk_t *rtk, const obsd_t *obs, int nu, int nr, dt = timediff(time, obs[nu].time); - rs = mat(6, n); dts = mat(2, n); var = mat(1, n); y = mat(nf*2, n); e = mat(3, n); + rs = mat(6, n); + dts = mat(2, n); + var = mat(1, n); + y = mat(nf * 2, n); + e = mat(3, n); azel = zeros(2, n); - for (i = 0;issat[i].sys = satsys(i+1, NULL); - for (j = 0;jssat[i].vsat[j] = rtk->ssat[i].snr[j] = 0; + rtk->ssat[i].sys = satsys(i + 1, NULL); + for (j = 0; j < NFREQ; j++) rtk->ssat[i].vsat[j] = rtk->ssat[i].snr[j] = 0; } /* satellite positions/clocks */ satposs(time, obs, n, nav, opt->sateph, rs, dts, var, svh); /* undifferenced residuals for base station */ - if (!zdres(1, obs+nu, nr, rs+nu*6, dts+nu*2, svh+nu, nav, rtk->rb, opt, 1, - y+nu*nf*2, e+nu*3, azel+nu*2)) + if (!zdres(1, obs + nu, nr, rs + nu * 6, dts + nu * 2, svh + nu, nav, rtk->rb, opt, 1, + y + nu * nf * 2, e + nu * 3, azel + nu * 2)) { errmsg(rtk, "initial base station position error\n"); - free(rs); free(dts); free(var); free(y); free(e); free(azel); + free(rs); + free(dts); + free(var); + free(y); + free(e); + free(azel); return 0; } /* time-interpolation of residuals (for post-processing) */ if (opt->intpref) { - dt = intpres(time, obs+nu, nr, nav, rtk, y+nu*nf*2); + dt = intpres(time, obs + nu, nr, nav, rtk, y + nu * nf * 2); } /* select common satellites between rover and base-station */ if ((ns = selsat(obs, azel, nu, nr, opt, sat, iu, ir)) <= 0) { errmsg(rtk, "no common satellite\n"); - free(rs); free(dts); free(var); free(y); free(e); free(azel); + free(rs); + free(dts); + free(var); + free(y); + free(e); + free(azel); return 0; } /* temporal update of states */ udstate(rtk, obs, sat, iu, ir, ns, nav); - trace(4, "x(0)="); tracemat(4, rtk->x, 1, NR_RTK(opt), 13, 4); + trace(4, "x(0)="); + tracemat(4, rtk->x, 1, NR_RTK(opt), 13, 4); - xp = mat(rtk->nx, 1); Pp = zeros(rtk->nx, rtk->nx); xa = mat(rtk->nx, 1); + xp = mat(rtk->nx, 1); + Pp = zeros(rtk->nx, rtk->nx); + xa = mat(rtk->nx, 1); matcpy(xp, rtk->x, rtk->nx, 1); - ny = ns*nf*2+2; - v = mat(ny, 1); H = zeros(rtk->nx, ny); R = mat(ny, ny); bias = mat(rtk->nx, 1); + ny = ns * nf * 2 + 2; + v = mat(ny, 1); + H = zeros(rtk->nx, ny); + R = mat(ny, ny); + bias = mat(rtk->nx, 1); /* add 2 iterations for baseline-constraint moving-base */ - niter = opt->niter+(opt->mode == PMODE_MOVEB && opt->baseline[0]>0.0 ? 2 : 0); + niter = opt->niter + (opt->mode == PMODE_MOVEB && opt->baseline[0] > 0.0 ? 2 : 0); - for (i = 0;isol = sol0; - for (i = 0;i<6;i++) rtk->rb[i] = 0.0; + for (i = 0; i < 6; i++) rtk->rb[i] = 0.0; rtk->nx = opt->mode <= PMODE_FIXED ? NX_RTK(opt) : pppnx(opt); rtk->na = opt->mode <= PMODE_FIXED ? NR_RTK(opt) : pppnx(opt); rtk->tt = 0.0; @@ -2039,12 +2160,12 @@ void rtkinit(rtk_t *rtk, const prcopt_t *opt) rtk->xa = zeros(rtk->na, 1); rtk->Pa = zeros(rtk->na, rtk->na); rtk->nfix = rtk->neb = 0; - for (i = 0;iambc[i] = ambc0; rtk->ssat[i] = ssat0; } - for (i = 0;ierrbuf[i] = 0; + for (i = 0; i < MAXERRMSG; i++) rtk->errbuf[i] = 0; rtk->opt = *opt; } @@ -2059,10 +2180,14 @@ void rtkfree(rtk_t *rtk) trace(3, "rtkfree :\n"); rtk->nx = rtk->na = 0; - free(rtk->x ); rtk->x = NULL; - free(rtk->P ); rtk->P = NULL; - free(rtk->xa); rtk->xa = NULL; - free(rtk->Pa); rtk->Pa = NULL; + free(rtk->x); + rtk->x = NULL; + free(rtk->P); + rtk->P = NULL; + free(rtk->xa); + rtk->xa = NULL; + free(rtk->Pa); + rtk->Pa = NULL; } @@ -2127,24 +2252,27 @@ void rtkfree(rtk_t *rtk) int rtkpos(rtk_t *rtk, const obsd_t *obs, int n, const nav_t *nav) { 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; int i, nu, nr; char msg[128] = ""; trace(3, "rtkpos : time=%s n=%d\n", time_str(obs[0].time, 3), n); - trace(4, "obs=\n"); traceobs(4, obs, n); + trace(4, "obs=\n"); + traceobs(4, obs, n); /*trace(5,"nav=\n"); tracenav(5,nav);*/ /* set base staion position */ if (opt->refpos <= POSOPT_RINEX && opt->mode != PMODE_SINGLE && - opt->mode != PMODE_MOVEB) + opt->mode != PMODE_MOVEB) { - for (i = 0;i<6;i++) rtk->rb[i] = i < 3 ? opt->rb[i] : 0.0; + for (i = 0; i < 6; i++) rtk->rb[i] = i < 3 ? opt->rb[i] : 0.0; } /* count rover/base station observations */ - for (nu = 0;nu sol.time; /* previous epoch */ @@ -2189,22 +2317,22 @@ int rtkpos(rtk_t *rtk, const obsd_t *obs, int n, const nav_t *nav) { /* moving baseline */ /* estimate position/velocity of base station */ - if (!pntpos(obs+nu, nr, nav, &rtk->opt, &solb, NULL, NULL, msg)) + if (!pntpos(obs + nu, nr, nav, &rtk->opt, &solb, NULL, NULL, msg)) { errmsg(rtk, "base station position error (%s)\n", msg); return 0; } rtk->sol.age = (float)timediff(rtk->sol.time, solb.time); - if (fabs(rtk->sol.age)>TTOL_MOVEB) + if (fabs(rtk->sol.age) > TTOL_MOVEB) { errmsg(rtk, "time sync error for moving-base (age=%.1f)\n", rtk->sol.age); return 0; } - for (i = 0;i<6;i++) rtk->rb[i] = solb.rr[i]; + for (i = 0; i < 6; i++) rtk->rb[i] = solb.rr[i]; /* time-synchronized position of base station */ - for (i = 0;i<3;i++) rtk->rb[i] += rtk->rb[i+3]*rtk->sol.age; + for (i = 0; i < 3; i++) rtk->rb[i] += rtk->rb[i + 3] * rtk->sol.age; } else { diff --git a/src/algorithms/libs/rtklib/rtklib_rtkpos.h b/src/algorithms/libs/rtklib/rtklib_rtkpos.h index 2785f0026..81234a634 100644 --- a/src/algorithms/libs/rtklib/rtklib_rtkpos.h +++ b/src/algorithms/libs/rtklib/rtklib_rtkpos.h @@ -58,29 +58,29 @@ #include "rtklib_rtkcmn.h" /* constants/macros ----------------------------------------------------------*/ -const double VAR_POS = std::pow(30.0, 2.0); /* initial variance of receiver pos (m^2) */ -const double VAR_VEL = std::pow(10.0, 2.0); /* initial variance of receiver vel ((m/s)^2) */ -const double VAR_ACC = std::pow(10.0, 2.0); /* initial variance of receiver acc ((m/ss)^2) */ -const double VAR_HWBIAS = std::pow(1.0, 2.0); /* initial variance of h/w bias ((m/MHz)^2) */ -const double VAR_GRA = std::pow(0.001, 2.0); /* initial variance of gradient (m^2) */ -const double INIT_ZWD = 0.15; /* initial zwd (m) */ +const double VAR_POS = std::pow(30.0, 2.0); /* initial variance of receiver pos (m^2) */ +const double VAR_VEL = std::pow(10.0, 2.0); /* initial variance of receiver vel ((m/s)^2) */ +const double VAR_ACC = std::pow(10.0, 2.0); /* initial variance of receiver acc ((m/ss)^2) */ +const double VAR_HWBIAS = std::pow(1.0, 2.0); /* initial variance of h/w bias ((m/MHz)^2) */ +const double VAR_GRA = std::pow(0.001, 2.0); /* initial variance of gradient (m^2) */ +const double INIT_ZWD = 0.15; /* initial zwd (m) */ -const double PRN_HWBIA = 1E-6; /* process noise of h/w bias (m/MHz/sqrt(s)) */ +const double PRN_HWBIA = 1E-6; /* process noise of h/w bias (m/MHz/sqrt(s)) */ const double MAXAC = 30.0; /* max accel for doppler slip detection (m/s^2) */ -const double VAR_HOLDAMB = 0.001; /* constraint to hold ambiguity (cycle^2) */ +const double VAR_HOLDAMB = 0.001; /* constraint to hold ambiguity (cycle^2) */ -const double TTOL_MOVEB = (1.0+2*DTTOL); +const double TTOL_MOVEB = (1.0 + 2 * DTTOL); /* time sync tolerance for moving-baseline (s) */ /* number of parameters (pos,ionos,tropos,hw-bias,phase-bias,real,estimated) */ /* state variable index */ -#define II_RTK(s,opt) (NP_RTK(opt)+(s)-1) /* ionos (s:satellite no) */ -#define IT_RTK(r,opt) (NP_RTK(opt)+NI_RTK(opt)+NT_RTK(opt)/2*(r)) /* tropos (r:0=rov,1:ref) */ -#define IL_RTK(f,opt) (NP_RTK(opt)+NI_RTK(opt)+NT_RTK(opt)+(f)) /* receiver h/w bias */ -#define IB_RTK(s,f,opt) (NR_RTK(opt)+MAXSAT*(f)+(s)-1) /* phase bias (s:satno,f:freq) */ +#define II_RTK(s, opt) (NP_RTK(opt) + (s)-1) /* ionos (s:satellite no) */ +#define IT_RTK(r, opt) (NP_RTK(opt) + NI_RTK(opt) + NT_RTK(opt) / 2 * (r)) /* tropos (r:0=rov,1:ref) */ +#define IL_RTK(f, opt) (NP_RTK(opt) + NI_RTK(opt) + NT_RTK(opt) + (f)) /* receiver h/w bias */ +#define IB_RTK(s, f, opt) (NR_RTK(opt) + MAXSAT * (f) + (s)-1) /* phase bias (s:satno,f:freq) */ int rtkopenstat(const char *file, int level); @@ -101,7 +101,7 @@ double gfobs_L1L2(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 varerr(int sat, int sys, double el, double bl, double dt, int f, - const prcopt_t *opt); + const prcopt_t *opt); double baseline(const double *ru, const double *rb, double *dr); @@ -109,7 +109,7 @@ double baseline(const double *ru, const double *rb, double *dr); void initx_rtk(rtk_t *rtk, double xi, double var, int i); int selsat(const obsd_t *obs, 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); void udpos(rtk_t *rtk, double tt); @@ -121,53 +121,53 @@ void udrcvbias(rtk_t *rtk, double tt); void detslp_ll(rtk_t *rtk, const obsd_t *obs, int i, int rcv); void detslp_gf_L1L2(rtk_t *rtk, const obsd_t *obs, int i, int j, - const nav_t *nav); + const nav_t *nav); void detslp_gf_L1L5(rtk_t *rtk, const obsd_t *obs, int i, int j, - const nav_t *nav); + const nav_t *nav); void detslp_dop(rtk_t *rtk, const obsd_t *obs, int i, int rcv, - const nav_t *nav); + const nav_t *nav); 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); 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); void zdres_sat(int base, double r, const obsd_t *obs, const nav_t *nav, - const double *azel, const double *dant, - const prcopt_t *opt, double *y); + const double *azel, const double *dant, + const prcopt_t *opt, double *y); int zdres(int base, const obsd_t *obs, int n, const double *rs, - const double *dts, const int *svh, const nav_t *nav, - const double *rr, const prcopt_t *opt, int index, double *y, - double *e, double *azel); + const double *dts, const int *svh, const nav_t *nav, + const double *rr, const prcopt_t *opt, int index, double *y, + double *e, double *azel); int validobs(int i, int j, int f, int nf, double *y); void ddcov(const int *nb, int n, const double *Ri, const double *Rj, - int nv, double *R); + int nv, double *R); 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); double prectrop(gtime_t time, const double *pos, int r, - const double *azel, const prcopt_t *opt, const double *x, - double *dtdx); + const double *azel, const prcopt_t *opt, const double *x, + double *dtdx); double gloicbcorr(int sat1, int sat2, const prcopt_t *opt, double lam1, - double lam2, int f); + double lam2, int f); int test_sys(int sys, int m); int ddres(rtk_t *rtk, const nav_t *nav, double dt, const double *x, - const double *P, const int *sat, double *y, double *e, - double *azel, const int *iu, const int *ir, int ns, double *v, - double *H, double *R, int *vflg); + const double *P, const int *sat, double *y, double *e, + double *azel, const int *iu, const int *ir, int ns, double *v, + double *H, double *R, int *vflg); 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); int ddmat(rtk_t *rtk, double *D); @@ -179,10 +179,10 @@ void holdamb(rtk_t *rtk, const double *xa); int resamb_LAMBDA(rtk_t *rtk, double *bias, double *xa); int valpos(rtk_t *rtk, const double *v, const double *R, const int *vflg, - int nv, double thres); + int nv, double thres); int relpos(rtk_t *rtk, const obsd_t *obs, int nu, int nr, - const nav_t *nav); + const nav_t *nav); void rtkinit(rtk_t *rtk, const prcopt_t *opt); @@ -191,5 +191,4 @@ void rtkfree(rtk_t *rtk); int rtkpos(rtk_t *rtk, const obsd_t *obs, int n, const nav_t *nav); - #endif diff --git a/src/algorithms/libs/rtklib/rtklib_rtksvr.cc b/src/algorithms/libs/rtklib/rtklib_rtksvr.cc index 6d7ce21ec..732d5cc28 100644 --- a/src/algorithms/libs/rtklib/rtklib_rtksvr.cc +++ b/src/algorithms/libs/rtklib/rtklib_rtksvr.cc @@ -23,8 +23,8 @@ void saveoutbuf(rtksvr_t *svr, unsigned char *buff, int n, int index) { rtksvrlock(svr); - n = n < svr->buffsize-svr->nsb[index] ? n : svr->buffsize-svr->nsb[index]; - memcpy(svr->sbuf[index]+svr->nsb[index], buff, n); + n = n < svr->buffsize - svr->nsb[index] ? n : svr->buffsize - svr->nsb[index]; + memcpy(svr->sbuf[index] + svr->nsb[index], buff, n); svr->nsb[index] += n; rtksvrunlock(svr); @@ -43,15 +43,15 @@ void writesol(rtksvr_t *svr, int index) for (i = 0; i < 2; i++) { /* output solution */ - n = outsols(buff, &svr->rtk.sol, svr->rtk.rb, svr->solopt+i); - strwrite(svr->stream+i+3, buff, n); + n = outsols(buff, &svr->rtk.sol, svr->rtk.rb, svr->solopt + i); + strwrite(svr->stream + i + 3, buff, n); /* save output buffer */ saveoutbuf(svr, buff, n, i); /* output extended solution */ - n = outsolexs(buff, &svr->rtk.sol, svr->rtk.ssat, svr->solopt+i); - strwrite(svr->stream+i+3, buff, n); + n = outsolexs(buff, &svr->rtk.sol, svr->rtk.ssat, svr->solopt + i); + strwrite(svr->stream + i + 3, buff, n); /* save output buffer */ saveoutbuf(svr, buff, n, i); @@ -76,10 +76,11 @@ void writesol(rtksvr_t *svr, int index) void updatenav(nav_t *nav) { int i, j; - for (i = 0; i < MAXSAT; i++) for (j = 0; j < NFREQ; j++) - { - nav->lam[i][j] = satwavelen(i+1, j, nav); - } + for (i = 0; i < MAXSAT; i++) + for (j = 0; j < NFREQ; j++) + { + nav->lam[i][j] = satwavelen(i + 1, j, nav); + } } @@ -90,14 +91,14 @@ void updatefcn(rtksvr_t *svr) for (i = 0; i < MAXPRNGLO; i++) { - sat = satno(SYS_GLO, i+1); + sat = satno(SYS_GLO, i + 1); for (j = 0, frq = -999; j < 3; j++) { if (svr->raw[j].nav.geph[i].sat != sat) continue; frq = svr->raw[j].nav.geph[i].frq; } - if (frq < -7 || frq>6) continue; + if (frq < -7 || frq > 6) continue; for (j = 0; j < 3; j++) { @@ -111,7 +112,7 @@ void updatefcn(rtksvr_t *svr) /* update rtk server struct --------------------------------------------------*/ 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; geph_t *geph1, *geph2, *geph3; @@ -127,10 +128,10 @@ void updatesvr(rtksvr_t *svr, int ret, obs_t *obs, nav_t *nav, int sat, { for (i = 0; i < obs->n; i++) { - if (svr->rtk.opt.exsats[obs->data[i].sat-1] == 1 || - !(satsys(obs->data[i].sat, NULL)&svr->rtk.opt.navsys)) continue; + if (svr->rtk.opt.exsats[obs->data[i].sat - 1] == 1 || + !(satsys(obs->data[i].sat, NULL) & svr->rtk.opt.navsys)) continue; svr->obs[index][iobs].data[n] = obs->data[i]; - svr->obs[index][iobs].data[n++].rcv = index+1; + svr->obs[index][iobs].data[n++].rcv = index + 1; } svr->obs[index][iobs].n = n; sortobs(&svr->obs[index][iobs]); @@ -141,15 +142,15 @@ void updatesvr(rtksvr_t *svr, int ret, obs_t *obs, nav_t *nav, int sat, { /* ephemeris */ if (satsys(sat, &prn) != SYS_GLO) { - if (!svr->navsel || svr->navsel == index+1) + if (!svr->navsel || svr->navsel == index + 1) { - eph1 = nav->eph+sat-1; - eph2 = svr->nav.eph+sat-1; - eph3 = svr->nav.eph+sat-1+MAXSAT; + eph1 = nav->eph + sat - 1; + eph2 = svr->nav.eph + sat - 1; + eph3 = svr->nav.eph + sat - 1 + MAXSAT; if (eph2->ttr.time == 0 || - (eph1->iode != eph3->iode && eph1->iode != eph2->iode) || - (timediff(eph1->toe, eph3->toe) != 0.0 && - timediff(eph1->toe, eph2->toe) != 0.0)) + (eph1->iode != eph3->iode && eph1->iode != eph2->iode) || + (timediff(eph1->toe, eph3->toe) != 0.0 && + timediff(eph1->toe, eph2->toe) != 0.0)) { *eph3 = *eph2; *eph2 = *eph1; @@ -160,13 +161,13 @@ void updatesvr(rtksvr_t *svr, int ret, obs_t *obs, nav_t *nav, int sat, } else { - if (!svr->navsel || svr->navsel == index+1) + if (!svr->navsel || svr->navsel == index + 1) { - geph1 = nav->geph+prn-1; - geph2 = svr->nav.geph+prn-1; - geph3 = svr->nav.geph+prn-1+MAXPRNGLO; + geph1 = nav->geph + prn - 1; + geph2 = svr->nav.geph + prn - 1; + geph3 = svr->nav.geph + prn - 1 + MAXPRNGLO; if (geph2->tof.time == 0 || - (geph1->iode != geph3->iode && geph1->iode != geph2->iode)) + (geph1->iode != geph3->iode && geph1->iode != geph2->iode)) { *geph3 = *geph2; *geph2 = *geph1; @@ -187,7 +188,7 @@ void updatesvr(rtksvr_t *svr, int ret, obs_t *obs, nav_t *nav, int sat, } else { - for (i = 0; i < MAXSBSMSG-1; i++) svr->sbsmsg[i] = svr->sbsmsg[i+1]; + for (i = 0; i < MAXSBSMSG - 1; i++) svr->sbsmsg[i] = svr->sbsmsg[i + 1]; svr->sbsmsg[i] = *sbsmsg; } sbsupdatecorr(sbsmsg, &svr->nav); @@ -224,7 +225,7 @@ void updatesvr(rtksvr_t *svr, int ret, obs_t *obs, nav_t *nav, int sat, enu2ecef(pos, del, dr); for (i = 0; i < 3; i++) { - svr->rtk.rb[i] += svr->rtcm[1].sta.del[i]+dr[i]; + svr->rtk.rb[i] += svr->rtcm[1].sta.del[i] + dr[i]; } } else @@ -250,21 +251,21 @@ void updatesvr(rtksvr_t *svr, int ret, obs_t *obs, nav_t *nav, int sat, svr->rtcm[index].ssr[i].update = 0; iode = svr->rtcm[index].ssr[i].iode; - sys = satsys(i+1, &prn); + sys = satsys(i + 1, &prn); /* check corresponding ephemeris exists */ if (sys == SYS_GPS || sys == SYS_GAL || sys == SYS_QZS) { if (svr->nav.eph[i].iode != iode && - svr->nav.eph[i+MAXSAT].iode != iode) + svr->nav.eph[i + MAXSAT].iode != iode) { continue; } } else if (sys == SYS_GLO) { - if (svr->nav.geph[prn-1].iode != iode && - svr->nav.geph[prn-1+MAXPRNGLO].iode != iode) + if (svr->nav.geph[prn - 1].iode != iode && + svr->nav.geph[prn - 1 + MAXPRNGLO].iode != iode) { continue; } @@ -302,14 +303,14 @@ int decoderaw(rtksvr_t *svr, int index) /* input rtcm/receiver raw data from stream */ if (svr->format[index] == STRFMT_RTCM2) { - ret = input_rtcm2(svr->rtcm+index, svr->buff[index][i]); + ret = input_rtcm2(svr->rtcm + index, svr->buff[index][i]); obs = &svr->rtcm[index].obs; nav = &svr->rtcm[index].nav; sat = svr->rtcm[index].ephsat; } else if (svr->format[index] == STRFMT_RTCM3) { - ret = input_rtcm3(svr->rtcm+index, svr->buff[index][i]); + ret = input_rtcm3(svr->rtcm + index, svr->buff[index][i]); obs = &svr->rtcm[index].obs; nav = &svr->rtcm[index].nav; sat = svr->rtcm[index].ephsat; @@ -336,7 +337,10 @@ int decoderaw(rtksvr_t *svr, int index) /* observation data received */ if (ret == 1) { - if (fobs < MAXOBSBUF) fobs++; else svr->prcout++; + if (fobs < MAXOBSBUF) + fobs++; + else + svr->prcout++; } } svr->nb[index] = 0; @@ -350,30 +354,30 @@ int decoderaw(rtksvr_t *svr, int index) /* decode download file ------------------------------------------------------*/ void decodefile(rtksvr_t *svr, int index) { - int i = 0; - char glo_fcn[MAXPRNGLO+1]; + int i = 0; + char glo_fcn[MAXPRNGLO + 1]; - // Allocate space for GLONASS frequency channels depending on availability - for(i=0; i < MAXPRNGLO+1; i++) - glo_fcn[i]='0'; - pcv_t pcvt0[MAXSAT] = { {0, {'0'}, {'0'}, {0, 0.0}, {0, 0.0}, {{0.0},{0.0}}, {{0.0},{0.0}} } }; + // Allocate space for GLONASS frequency channels depending on availability + for (i = 0; i < MAXPRNGLO + 1; i++) + glo_fcn[i] = '0'; + pcv_t pcvt0[MAXSAT] = {{0, {'0'}, {'0'}, {0, 0.0}, {0, 0.0}, {{0.0}, {0.0}}, {{0.0}, {0.0}}}}; sbsfcorr_t sbsfcorr0 = {{0, 0.0}, 0.0, 0.0, 0.0, 0, 0, 0}; - sbslcorr_t sbslcorr0 = { {0, 0.0}, 0, {0.0}, {0.0}, 0.0, 0.0}; - sbssat_t sbssat0 = {0, 0, 0, { {0, sbsfcorr0, sbslcorr0 } }}; - sbsigp_t sbsigp0[MAXNIGP] = {{{0, 0.0}, 0, 0, 0, 0.0 }}; - sbsion_t sbsion0[MAXBAND+1] = {{0, 0, {*sbsigp0} }}; - dgps_t dgps0[MAXSAT] = { {{0, 0.0}, 0.0, 0.0, 0, 0.0 }}; - ssr_t ssr0[MAXSAT] = {{ {{0, 0.0}}, {0.0}, {0}, 0, 0, 0, 0, {0.0}, {0.0}, {0.0}, 0.0, {0.0}, {0.0}, {0.0}, 0.0, 0.0, '0' }}; - lexeph_t lexeph0[MAXSAT] = {{ {0,0.0}, {0,0.0}, 0, 0, 0, {0.0}, {0.0}, {0.0}, {0.0}, 0.0, 0.0, 0.0, {0.0} }}; - stec_t stec0[MAXSTA] = {{ {0,0.0}, 0, 0.0, 0.0, {0.0}, 0}}; - trop_t trop0[MAXSTA] = {{ {0, 0.0}, {0.0}, {0.0}}}; - pppcorr_t pppcorr0 = {0, {{0},{0}}, {{0.0},{0.0}}, {0}, {0}, {0}, {0}, {stec0}, {trop0} }; + sbslcorr_t sbslcorr0 = {{0, 0.0}, 0, {0.0}, {0.0}, 0.0, 0.0}; + sbssat_t sbssat0 = {0, 0, 0, {{0, sbsfcorr0, sbslcorr0}}}; + sbsigp_t sbsigp0[MAXNIGP] = {{{0, 0.0}, 0, 0, 0, 0.0}}; + sbsion_t sbsion0[MAXBAND + 1] = {{0, 0, {*sbsigp0}}}; + dgps_t dgps0[MAXSAT] = {{{0, 0.0}, 0.0, 0.0, 0, 0.0}}; + ssr_t ssr0[MAXSAT] = {{{{0, 0.0}}, {0.0}, {0}, 0, 0, 0, 0, {0.0}, {0.0}, {0.0}, 0.0, {0.0}, {0.0}, {0.0}, 0.0, 0.0, '0'}}; + lexeph_t lexeph0[MAXSAT] = {{{0, 0.0}, {0, 0.0}, 0, 0, 0, {0.0}, {0.0}, {0.0}, {0.0}, 0.0, 0.0, 0.0, {0.0}}}; + stec_t stec0[MAXSTA] = {{{0, 0.0}, 0, 0.0, 0.0, {0.0}, 0}}; + trop_t trop0[MAXSTA] = {{{0, 0.0}, {0.0}, {0.0}}}; + pppcorr_t pppcorr0 = {0, {{0}, {0}}, {{0.0}, {0.0}}, {0}, {0}, {0}, {0}, {stec0}, {trop0}}; nav_t nav = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - {0, 0, (erpd_t *){0}}, {0.0}, {0.0}, {0.0}, {0.0}, {0.0}, {0.0}, {0.0}, {0.0}, - {0.0}, {0.0}, {0.0}, {0.0}, 0, {{0.0},{0.0}}, {{0.0},{0.0}}, {{0.0}, {0.0}, {0.0}}, - {0.0}, {0.0}, {*glo_fcn}, {*pcvt0}, sbssat0, {*sbsion0}, {*dgps0}, {*ssr0}, {*lexeph0}, - {{0,0.0}, 0.0, {0.0}, {{0.0},{0.0}} }, pppcorr0} ; + {0, 0, (erpd_t *){0}}, {0.0}, {0.0}, {0.0}, {0.0}, {0.0}, {0.0}, {0.0}, {0.0}, + {0.0}, {0.0}, {0.0}, {0.0}, 0, {{0.0}, {0.0}}, {{0.0}, {0.0}}, {{0.0}, {0.0}, {0.0}}, + {0.0}, {0.0}, {*glo_fcn}, {*pcvt0}, sbssat0, {*sbsion0}, {*dgps0}, {*ssr0}, {*lexeph0}, + {{0, 0.0}, 0.0, {0.0}, {{0.0}, {0.0}}}, pppcorr0}; char file[1024]; int nb; @@ -384,17 +388,19 @@ void decodefile(rtksvr_t *svr, int index) /* check file path completed */ if ((nb = svr->nb[index]) <= 2 || - svr->buff[index][nb-2] != '\r' || svr->buff[index][nb-1] != '\n') + svr->buff[index][nb - 2] != '\r' || svr->buff[index][nb - 1] != '\n') { rtksvrunlock(svr); return; } - strncpy(file, (char *)svr->buff[index], nb-2); file[nb-2] = '\0'; + strncpy(file, (char *)svr->buff[index], nb - 2); + file[nb - 2] = '\0'; svr->nb[index] = 0; rtksvrunlock(svr); - if (svr->format[index] == STRFMT_SP3) { /* precise ephemeris */ + if (svr->format[index] == STRFMT_SP3) + { /* precise ephemeris */ /* read sp3 precise ephemeris */ readsp3(file, &nav, 0); @@ -413,14 +419,16 @@ void decodefile(rtksvr_t *svr, int index) strcpy(svr->files[index], file); rtksvrunlock(svr); - } - else if (svr->format[index] == STRFMT_RNXCLK) { /* precise clock */ + } + else if (svr->format[index] == STRFMT_RNXCLK) + { /* precise clock */ - /* read rinex clock */ // Disabled!! - if ( 1 /*readrnxc(file, &nav)<=0 */) { + /* read rinex clock */ // Disabled!! + if (1 /*readrnxc(file, &nav)<=0 */) + { tracet(1, "rinex clock file read error: %s\n", file); return; - } + } /* update precise clock */ rtksvrlock(svr); @@ -431,7 +439,7 @@ void decodefile(rtksvr_t *svr, int index) strcpy(svr->files[index], file); rtksvrunlock(svr); - } + } } @@ -440,7 +448,7 @@ void *rtksvrthread(void *arg) { rtksvr_t *svr = (rtksvr_t *)arg; obs_t obs; - obsd_t data[MAXOBS*2]; + obsd_t data[MAXOBS * 2]; double tt; unsigned int tick, ticknmea; unsigned char *p, *q; @@ -448,31 +456,33 @@ void *rtksvrthread(void *arg) tracet(3, "rtksvrthread:\n"); - svr->state = 1; obs.data = data; + svr->state = 1; + obs.data = data; svr->tick = tickget(); - ticknmea = svr->tick-1000; + ticknmea = svr->tick - 1000; - for (cycle = 0;svr->state;cycle++) + for (cycle = 0; svr->state; cycle++) { tick = tickget(); for (i = 0; i < 3; i++) { - p = svr->buff[i]+svr->nb[i]; q = svr->buff[i]+svr->buffsize; + p = svr->buff[i] + svr->nb[i]; + q = svr->buff[i] + svr->buffsize; /* read receiver raw/rtcm data from input stream */ - if ((n = strread(svr->stream+i, p, q-p)) <= 0) + if ((n = strread(svr->stream + i, p, q - p)) <= 0) { continue; } /* write receiver raw/rtcm data to log stream */ - strwrite(svr->stream+i+5, p, n); + strwrite(svr->stream + i + 5, p, n); svr->nb[i] += n; /* save peek buffer */ rtksvrlock(svr); - n = n < svr->buffsize-svr->npb[i] ? n : svr->buffsize-svr->npb[i]; - memcpy(svr->pbuf[i]+svr->npb[i], p, n); + n = n < svr->buffsize - svr->npb[i] ? n : svr->buffsize - svr->npb[i]; + memcpy(svr->pbuf[i] + svr->npb[i], p, n); svr->npb[i] += n; rtksvrunlock(svr); } @@ -492,11 +502,11 @@ void *rtksvrthread(void *arg) for (i = 0; i < fobs[0]; i++) { /* for each rover observation data */ obs.n = 0; - for (j = 0; j < svr->obs[0][i].n && obs.n < MAXOBS*2; j++) + for (j = 0; j < svr->obs[0][i].n && obs.n < MAXOBS * 2; j++) { obs.data[obs.n++] = svr->obs[0][i].data[j]; } - for (j = 0; j < svr->obs[1][0].n && obs.n < MAXOBS*2; j++) + for (j = 0; j < svr->obs[1][0].n && obs.n < MAXOBS * 2; j++) { obs.data[obs.n++] = svr->obs[1][0].data[j]; } @@ -508,60 +518,63 @@ void *rtksvrthread(void *arg) if (svr->rtk.sol.stat != SOLQ_NONE) { /* adjust current time */ - tt = (int)(tickget()-tick)/1000.0+DTTOL; + tt = (int)(tickget() - tick) / 1000.0 + DTTOL; timeset(gpst2utc(timeadd(svr->rtk.sol.time, tt))); /* write solution */ writesol(svr, i); } /* if cpu overload, inclement obs outage counter and break */ - if ((int)(tickget()-tick) >= svr->cycle) + if ((int)(tickget() - tick) >= svr->cycle) { - svr->prcout += fobs[0]-i-1; + svr->prcout += fobs[0] - i - 1; #if 0 /* omitted v.2.4.1 */ break; #endif } } /* send null solution if no solution (1hz) */ - if (svr->rtk.sol.stat == SOLQ_NONE && cycle%(1000/svr->cycle) == 0) + if (svr->rtk.sol.stat == SOLQ_NONE && cycle % (1000 / svr->cycle) == 0) { writesol(svr, 0); } /* send nmea request to base/nrtk input stream */ - if (svr->nmeacycle>0 && (int)(tick-ticknmea) >= svr->nmeacycle) + if (svr->nmeacycle > 0 && (int)(tick - ticknmea) >= svr->nmeacycle) { if (svr->stream[1].state == 1) { if (svr->nmeareq == 1) { - strsendnmea(svr->stream+1, svr->nmeapos); + strsendnmea(svr->stream + 1, svr->nmeapos); } - else if (svr->nmeareq == 2 && norm_rtk(svr->rtk.sol.rr, 3)>0.0) + else if (svr->nmeareq == 2 && norm_rtk(svr->rtk.sol.rr, 3) > 0.0) { - strsendnmea(svr->stream+1, svr->rtk.sol.rr); + strsendnmea(svr->stream + 1, svr->rtk.sol.rr); } } ticknmea = tick; } - if ((cputime = (int)(tickget()-tick))>0) svr->cputime = cputime; + if ((cputime = (int)(tickget() - tick)) > 0) svr->cputime = cputime; /* sleep until next cycle */ - sleepms(svr->cycle-cputime); + sleepms(svr->cycle - cputime); } - for (i = 0; i < MAXSTRRTK; i++) strclose(svr->stream+i); + for (i = 0; i < MAXSTRRTK; i++) strclose(svr->stream + i); for (i = 0; i < 3; i++) { svr->nb[i] = svr->npb[i] = 0; - free(svr->buff[i]); svr->buff[i] = NULL; - free(svr->pbuf[i]); svr->pbuf[i] = NULL; + free(svr->buff[i]); + svr->buff[i] = NULL; + free(svr->pbuf[i]); + svr->pbuf[i] = NULL; //free_raw (svr->raw +i); - free_rtcm(svr->rtcm+i); + free_rtcm(svr->rtcm + i); } for (i = 0; i < 2; i++) { svr->nsb[i] = 0; - free(svr->sbuf[i]); svr->sbuf[i] = NULL; + free(svr->sbuf[i]); + svr->sbuf[i] = NULL; } return 0; } @@ -575,14 +588,14 @@ void *rtksvrthread(void *arg) int rtksvrinit(rtksvr_t *svr) { gtime_t time0 = {0, 0.0}; - sol_t sol0 = {{0,0}, {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, -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}; - 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}; - seph_t seph0 = {0, {0,0.0}, {0,0.0}, 0, 0, {0.0}, {0.0}, {0.0}, 0.0, 0.0}; + sol_t sol0 = {{0, 0}, {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, -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}; + 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}; + 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; tracet(3, "rtksvrinit:\n"); @@ -601,7 +614,8 @@ int rtksvrinit(rtksvr_t *svr) for (i = 0; i < 2; i++) svr->sbuf[i] = NULL; for (i = 0; i < 3; i++) svr->pbuf[i] = NULL; for (i = 0; i < MAXSOLBUF; i++) svr->solbuf[i] = sol0; - for (i = 0; i < 3; i++) for (j = 0; j < 10; j++) svr->nmsg[i][j] = 0; + for (i = 0; i < 3; i++) + for (j = 0; j < 10; j++) svr->nmsg[i][j] = 0; for (i = 0; i < 3; i++) svr->ftime[i] = time0; for (i = 0; i < 3; i++) svr->files[i][0] = '\0'; svr->moni = NULL; @@ -609,34 +623,35 @@ int rtksvrinit(rtksvr_t *svr) svr->thread = 0; svr->cputime = svr->prcout = 0; - if (!(svr->nav.eph = (eph_t *)malloc(sizeof(eph_t )*MAXSAT *2)) || - !(svr->nav.geph = (geph_t *)malloc(sizeof(geph_t)*NSATGLO*2)) || - !(svr->nav.seph = (seph_t *)malloc(sizeof(seph_t)*NSATSBS*2))) + if (!(svr->nav.eph = (eph_t *)malloc(sizeof(eph_t) * MAXSAT * 2)) || + !(svr->nav.geph = (geph_t *)malloc(sizeof(geph_t) * NSATGLO * 2)) || + !(svr->nav.seph = (seph_t *)malloc(sizeof(seph_t) * NSATSBS * 2))) { tracet(1, "rtksvrinit: malloc error\n"); return 0; } - for (i = 0; i < MAXSAT *2; i++) svr->nav.eph [i] = eph0; - for (i = 0; i < NSATGLO*2; i++) svr->nav.geph[i] = geph0; - for (i = 0; i < NSATSBS*2; i++) svr->nav.seph[i] = seph0; - svr->nav.n = MAXSAT *2; - svr->nav.ng = NSATGLO*2; - svr->nav.ns = NSATSBS*2; + for (i = 0; i < MAXSAT * 2; i++) svr->nav.eph[i] = eph0; + for (i = 0; i < NSATGLO * 2; i++) svr->nav.geph[i] = geph0; + for (i = 0; i < NSATSBS * 2; i++) svr->nav.seph[i] = seph0; + svr->nav.n = MAXSAT * 2; + svr->nav.ng = NSATGLO * 2; + svr->nav.ns = NSATSBS * 2; - for (i = 0; i < 3; i++) for (j = 0; j < MAXOBSBUF; j++) - { - if (!(svr->obs[i][j].data = (obsd_t *)malloc(sizeof(obsd_t)*MAXOBS))) - { - tracet(1, "rtksvrinit: malloc error\n"); - return 0; - } - } + for (i = 0; i < 3; i++) + for (j = 0; j < MAXOBSBUF; j++) + { + if (!(svr->obs[i][j].data = (obsd_t *)malloc(sizeof(obsd_t) * MAXOBS))) + { + tracet(1, "rtksvrinit: malloc error\n"); + return 0; + } + } for (i = 0; i < 3; i++) { - memset(svr->raw +i, 0, sizeof(raw_t )); - memset(svr->rtcm+i, 0, sizeof(rtcm_t)); + memset(svr->raw + i, 0, sizeof(raw_t)); + memset(svr->rtcm + i, 0, sizeof(rtcm_t)); } - for (i = 0; i < MAXSTRRTK; i++) strinit(svr->stream+i); + for (i = 0; i < MAXSTRRTK; i++) strinit(svr->stream + i); initlock(&svr->lock); @@ -653,13 +668,14 @@ void rtksvrfree(rtksvr_t *svr) { int i, j; - free(svr->nav.eph ); + free(svr->nav.eph); free(svr->nav.geph); free(svr->nav.seph); - for (i = 0; i < 3; i++) for (j = 0; j < MAXOBSBUF; j++) - { - free(svr->obs[i][j].data); - } + for (i = 0; i < 3; i++) + for (j = 0; j < MAXOBSBUF; j++) + { + free(svr->obs[i][j].data); + } } @@ -668,10 +684,10 @@ void rtksvrfree(rtksvr_t *svr) * args : rtksvr_t *svr IO rtk server * return : status (1:ok 0:error) *-----------------------------------------------------------------------------*/ -void rtksvrlock (rtksvr_t *svr) {rtk_lock (&svr->lock);} +void rtksvrlock(rtksvr_t *svr) { rtk_lock(&svr->lock); } -void rtksvrunlock(rtksvr_t *svr) {rtk_unlock(&svr->lock);} +void rtksvrunlock(rtksvr_t *svr) { rtk_unlock(&svr->lock); } /* start rtk server ------------------------------------------------------------ @@ -714,16 +730,16 @@ void rtksvrunlock(rtksvr_t *svr) {rtk_unlock(&svr->lock);} * return : status (1:ok 0:error) *-----------------------------------------------------------------------------*/ int rtksvrstart(rtksvr_t *svr, int cycle, int buffsize, int *strs, - char **paths, int *formats, int navsel, char **cmds, - char **rcvopts, int nmeacycle, int nmeareq, - const double *nmeapos, prcopt_t *prcopt, - solopt_t *solopt, stream_t *moni) + char **paths, int *formats, int navsel, char **cmds, + char **rcvopts, int nmeacycle, int nmeareq, + const double *nmeapos, prcopt_t *prcopt, + solopt_t *solopt, stream_t *moni) { gtime_t time, time0 = {0, 0.0}; int i, j, rw; tracet(3, "rtksvrstart: cycle=%d buffsize=%d navsel=%d nmeacycle=%d nmeareq=%d\n", - cycle, buffsize, navsel, nmeacycle, nmeareq); + cycle, buffsize, navsel, nmeacycle, nmeareq); if (svr->state) return 0; @@ -745,7 +761,7 @@ int rtksvrstart(rtksvr_t *svr, int cycle, int buffsize, int *strs, { /* input/log streams */ svr->nb[i] = svr->npb[i] = 0; if (!(svr->buff[i] = (unsigned char *)malloc(buffsize)) || - !(svr->pbuf[i] = (unsigned char *)malloc(buffsize))) + !(svr->pbuf[i] = (unsigned char *)malloc(buffsize))) { tracet(1, "rtksvrstart: malloc error\n"); return 0; @@ -755,11 +771,11 @@ int rtksvrstart(rtksvr_t *svr, int cycle, int buffsize, int *strs, /* initialize receiver raw and rtcm control */ //init_raw (svr->raw +i); - init_rtcm(svr->rtcm+i); + init_rtcm(svr->rtcm + i); /* set receiver and rtcm option */ - if(strlen(rcvopts[i]) < 256 ) strcpy(svr->raw [i].opt, rcvopts[i]); - if(strlen(rcvopts[i]) < 256 ) strcpy(svr->rtcm[i].opt, rcvopts[i]); + if (strlen(rcvopts[i]) < 256) strcpy(svr->raw[i].opt, rcvopts[i]); + if (strlen(rcvopts[i]) < 256) strcpy(svr->rtcm[i].opt, rcvopts[i]); /* connect dgps corrections */ svr->rtcm[i].dgps = svr->nav.dgps; @@ -783,9 +799,9 @@ int rtksvrstart(rtksvr_t *svr, int cycle, int buffsize, int *strs, svr->rtk.rb[i] = i < 3 ? prcopt->rb[i] : 0.0; } /* update navigation data */ - for (i = 0; i < MAXSAT *2; i++) svr->nav.eph [i].ttr = time0; - for (i = 0; i < NSATGLO*2; i++) svr->nav.geph[i].tof = time0; - for (i = 0; i < NSATSBS*2; i++) svr->nav.seph[i].tof = time0; + for (i = 0; i < MAXSAT * 2; i++) svr->nav.eph[i].ttr = time0; + for (i = 0; i < NSATGLO * 2; i++) svr->nav.geph[i].tof = time0; + for (i = 0; i < NSATSBS * 2; i++) svr->nav.seph[i].tof = time0; updatenav(&svr->nav); /* set monitor stream */ @@ -796,37 +812,37 @@ int rtksvrstart(rtksvr_t *svr, int cycle, int buffsize, int *strs, { rw = i < 3 ? STR_MODE_R : STR_MODE_W; if (strs[i] != STR_FILE) rw |= STR_MODE_W; - if (!stropen(svr->stream+i, strs[i], rw, paths[i])) + if (!stropen(svr->stream + i, strs[i], rw, paths[i])) { - for (i--; i >= 0; i--) strclose(svr->stream+i); + for (i--; i >= 0; i--) strclose(svr->stream + i); return 0; } /* set initial time for rtcm and raw */ if (i < 3) { time = utc2gpst(timeget()); - svr->raw [i].time = strs[i] == STR_FILE ? strgettime(svr->stream+i) : time; - svr->rtcm[i].time = strs[i] == STR_FILE ? strgettime(svr->stream+i) : time; + svr->raw[i].time = strs[i] == STR_FILE ? strgettime(svr->stream + i) : time; + svr->rtcm[i].time = strs[i] == STR_FILE ? strgettime(svr->stream + i) : time; } } /* sync input streams */ - strsync(svr->stream, svr->stream+1); - strsync(svr->stream, svr->stream+2); + strsync(svr->stream, svr->stream + 1); + strsync(svr->stream, svr->stream + 2); /* write start commands to input streams */ for (i = 0; i < 3; i++) { - if (cmds[i]) strsendcmd(svr->stream+i, cmds[i]); + if (cmds[i]) strsendcmd(svr->stream + i, cmds[i]); } /* write solution header to solution streams */ for (i = 3; i < 5; i++) { - writesolhead(svr->stream+i, svr->solopt+i-3); + writesolhead(svr->stream + i, svr->solopt + i - 3); } /* create rtk server thread */ if (pthread_create(&svr->thread, NULL, rtksvrthread, svr)) { - for (i = 0; i < MAXSTRRTK; i++) strclose(svr->stream+i); + for (i = 0; i < MAXSTRRTK; i++) strclose(svr->stream + i); return 0; } return 1; @@ -852,7 +868,7 @@ void rtksvrstop(rtksvr_t *svr, char **cmds) rtksvrlock(svr); for (i = 0; i < 3; i++) { - if (cmds[i]) strsendcmd(svr->stream+i, cmds[i]); + if (cmds[i]) strsendcmd(svr->stream + i, cmds[i]); } rtksvrunlock(svr); @@ -876,7 +892,7 @@ void rtksvrstop(rtksvr_t *svr, char **cmds) * return : status (1:ok 0:error) *-----------------------------------------------------------------------------*/ int rtksvropenstr(rtksvr_t *svr, int index, int str, const char *path, - const solopt_t *solopt) + const solopt_t *solopt) { tracet(3, "rtksvropenstr: index=%d str=%d path=%s\n", index, str, path); @@ -884,12 +900,12 @@ int rtksvropenstr(rtksvr_t *svr, int index, int str, const char *path, rtksvrlock(svr); - if (svr->stream[index].state>0) + if (svr->stream[index].state > 0) { rtksvrunlock(svr); return 0; } - if (!stropen(svr->stream+index, str, STR_MODE_W, path)) + if (!stropen(svr->stream + index, str, STR_MODE_W, path)) { tracet(2, "stream open error: index=%d\n", index); rtksvrunlock(svr); @@ -897,10 +913,10 @@ int rtksvropenstr(rtksvr_t *svr, int index, int str, const char *path, } if (index <= 4) { - svr->solopt[index-3] = *solopt; + svr->solopt[index - 3] = *solopt; /* write solution header to solution stream */ - writesolhead(svr->stream+index, svr->solopt+index-3); + writesolhead(svr->stream + index, svr->solopt + index - 3); } rtksvrunlock(svr); return 1; @@ -919,11 +935,11 @@ void rtksvrclosestr(rtksvr_t *svr, int index) { tracet(3, "rtksvrclosestr: index=%d\n", index); - if (index < 3 || index>7 || !svr->state) return; + if (index < 3 || index > 7 || !svr->state) return; rtksvrlock(svr); - strclose(svr->stream+index); + strclose(svr->stream + index); rtksvrunlock(svr); } @@ -943,7 +959,7 @@ void rtksvrclosestr(rtksvr_t *svr, int index) * return : number of satellites *-----------------------------------------------------------------------------*/ 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; @@ -952,26 +968,26 @@ int rtksvrostat(rtksvr_t *svr, int rcv, gtime_t *time, int *sat, if (!svr->state) return 0; rtksvrlock(svr); ns = svr->obs[rcv][0].n; - if (ns>0) + if (ns > 0) { *time = svr->obs[rcv][0].data[0].time; } for (i = 0; i < ns; i++) { - sat [i] = svr->obs[rcv][0].data[i].sat; - az [i] = svr->rtk.ssat[sat[i]-1].azel[0]; - el [i] = svr->rtk.ssat[sat[i]-1].azel[1]; + sat[i] = svr->obs[rcv][0].data[i].sat; + az[i] = svr->rtk.ssat[sat[i] - 1].azel[0]; + el[i] = svr->rtk.ssat[sat[i] - 1].azel[1]; for (j = 0; j < NFREQ; j++) { - snr[i][j] = (int)(svr->obs[rcv][0].data[i].SNR[j]*0.25); + snr[i][j] = (int)(svr->obs[rcv][0].data[i].SNR[j] * 0.25); } - if (svr->rtk.sol.stat == SOLQ_NONE || svr->rtk.sol.stat == SOLQ_SINGLE) + if (svr->rtk.sol.stat == SOLQ_NONE || svr->rtk.sol.stat == SOLQ_SINGLE) { - vsat[i] = svr->rtk.ssat[sat[i]-1].vs; + vsat[i] = svr->rtk.ssat[sat[i] - 1].vs; } else { - vsat[i] = svr->rtk.ssat[sat[i]-1].vsat[0]; + vsat[i] = svr->rtk.ssat[sat[i] - 1].vsat[0]; } } rtksvrunlock(svr); @@ -996,8 +1012,8 @@ void rtksvrsstat(rtksvr_t *svr, int *sstat, char *msg) rtksvrlock(svr); for (i = 0; i < MAXSTRRTK; i++) { - sstat[i] = strstat(svr->stream+i, s); - if (*s) p += sprintf(p, "(%d) %s ", i+1, s); + sstat[i] = strstat(svr->stream + i, s); + if (*s) p += sprintf(p, "(%d) %s ", i + 1, s); } rtksvrunlock(svr); } diff --git a/src/algorithms/libs/rtklib/rtklib_rtksvr.h b/src/algorithms/libs/rtklib/rtklib_rtksvr.h index cb5a94a8b..0e6eb65e7 100644 --- a/src/algorithms/libs/rtklib/rtklib_rtksvr.h +++ b/src/algorithms/libs/rtklib/rtklib_rtksvr.h @@ -57,35 +57,35 @@ #include "rtklib.h" -const solopt_t solopt_default = { /* defaults solution output options */ - SOLF_LLH, TIMES_GPST, 1, 3, /* posf, times, timef, timeu */ - 0, 1, 0, 0, 0, 0, /* degf, outhead, outopt, datum, height, geoid */ - 0, 0, 0, /* solstatic, sstat, trace */ - {0.0, 0.0}, /* nmeaintv */ - " ", "", 0 /* separator/program name */ +const solopt_t solopt_default = { + /* defaults solution output options */ + SOLF_LLH, TIMES_GPST, 1, 3, /* posf, times, timef, timeu */ + 0, 1, 0, 0, 0, 0, /* degf, outhead, outopt, datum, height, geoid */ + 0, 0, 0, /* solstatic, sstat, trace */ + {0.0, 0.0}, /* nmeaintv */ + " ", "", 0 /* separator/program name */ }; -const prcopt_t prcopt_default = { /* defaults processing options */ - PMODE_SINGLE, 0, 2, SYS_GPS, /* mode, soltype, nf, navsys */ - 15.0*D2R, { {}, {{},{}} }, /* elmin, snrmask */ - 0, 1, 1, 1, /* sateph, modear, glomodear, bdsmodear */ - 5, 0, 10, 1, /* maxout, minlock, minfix, armaxiter */ - 0, 0, 0, 0, /* estion, esttrop, dynamics, tidecorr */ - 1, 0, 0, 0, 0, /* niter, codesmooth, intpref, sbascorr, sbassatsel */ - 0, 0, /* rovpos, refpos */ - {100.0, 100.0, 100.0}, /* eratio[] */ - {100.0, 0.003, 0.003, 0.0, 1.0}, /* err[] */ - {30.0, 0.03, 0.3}, /* std[] */ - {1e-4, 1e-3, 1e-4, 1e-1, 1e-2, 0.0}, /* prn[] */ - 5E-12, /* sclkstab */ - {3.0, 0.9999, 0.25, 0.1, 0.05, 0, 0, 0}, /* thresar */ - 0.0, 0.0, 0.05, /* elmaskar, almaskhold, thresslip */ - 30.0, 30.0, 30.0, /* maxtdif, maxinno, maxgdop */ - {}, {}, {}, /* baseline, ru, rb */ - {"",""}, /* anttype */ - {} , {}, {}, /* antdel, pcv, exsats */ - 0, 0, 0, {"",""}, {}, 0, {{},{}}, { {}, {{},{}}, {{},{}}, {}, {} }, 0, {} -}; +const prcopt_t prcopt_default = { /* defaults processing options */ + PMODE_SINGLE, 0, 2, SYS_GPS, /* mode, soltype, nf, navsys */ + 15.0 * D2R, {{}, {{}, {}}}, /* elmin, snrmask */ + 0, 1, 1, 1, /* sateph, modear, glomodear, bdsmodear */ + 5, 0, 10, 1, /* maxout, minlock, minfix, armaxiter */ + 0, 0, 0, 0, /* estion, esttrop, dynamics, tidecorr */ + 1, 0, 0, 0, 0, /* niter, codesmooth, intpref, sbascorr, sbassatsel */ + 0, 0, /* rovpos, refpos */ + {100.0, 100.0, 100.0}, /* eratio[] */ + {100.0, 0.003, 0.003, 0.0, 1.0}, /* err[] */ + {30.0, 0.03, 0.3}, /* std[] */ + {1e-4, 1e-3, 1e-4, 1e-1, 1e-2, 0.0}, /* prn[] */ + 5E-12, /* sclkstab */ + {3.0, 0.9999, 0.25, 0.1, 0.05, 0, 0, 0}, /* thresar */ + 0.0, 0.0, 0.05, /* elmaskar, almaskhold, thresslip */ + 30.0, 30.0, 30.0, /* maxtdif, maxinno, maxgdop */ + {}, {}, {}, /* baseline, ru, rb */ + {"", ""}, /* anttype */ + {}, {}, {}, /* antdel, pcv, exsats */ + 0, 0, 0, {"", ""}, {}, 0, {{}, {}}, {{}, {{}, {}}, {{}, {}}, {}, {}}, 0, {}}; void writesolhead(stream_t *stream, const solopt_t *solopt); @@ -99,7 +99,7 @@ void updatenav(nav_t *nav); void updatefcn(rtksvr_t *svr); 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); int decoderaw(rtksvr_t *svr, int index); @@ -111,28 +111,27 @@ int rtksvrinit(rtksvr_t *svr); void rtksvrfree(rtksvr_t *svr); -void rtksvrlock (rtksvr_t *svr); +void rtksvrlock(rtksvr_t *svr); void rtksvrunlock(rtksvr_t *svr); int rtksvrstart(rtksvr_t *svr, int cycle, int buffsize, int *strs, - char **paths, int *formats, int navsel, char **cmds, - char **rcvopts, int nmeacycle, int nmeareq, - const double *nmeapos, prcopt_t *prcopt, - solopt_t *solopt, stream_t *moni); + char **paths, int *formats, int navsel, char **cmds, + char **rcvopts, int nmeacycle, int nmeareq, + const double *nmeapos, prcopt_t *prcopt, + solopt_t *solopt, stream_t *moni); void rtksvrstop(rtksvr_t *svr, char **cmds); int rtksvropenstr(rtksvr_t *svr, int index, int str, const char *path, - const solopt_t *solopt); + const solopt_t *solopt); void rtksvrclosestr(rtksvr_t *svr, int index); 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); void rtksvrsstat(rtksvr_t *svr, int *sstat, char *msg); - #endif diff --git a/src/algorithms/libs/rtklib/rtklib_sbas.cc b/src/algorithms/libs/rtklib/rtklib_sbas.cc index 7ff71cca2..ec9649ac2 100644 --- a/src/algorithms/libs/rtklib/rtklib_sbas.cc +++ b/src/algorithms/libs/rtklib/rtklib_sbas.cc @@ -65,7 +65,8 @@ /* extract field from line ---------------------------------------------------*/ char *getfield(char *p, int pos) { - for (pos--; pos > 0 ; pos--, p++) if (!(p = strchr(p, ','))) return NULL; + for (pos--; pos > 0; pos--, p++) + if (!(p = strchr(p, ','))) return NULL; return p; } @@ -74,10 +75,9 @@ char *getfield(char *p, int pos) double varfcorr(int udre) { const double var[14] = { - 0.052, 0.0924, 0.1444, 0.283, 0.4678, 0.8315, 1.2992, 1.8709, 2.5465, 3.326, - 5.1968, 20.7870, 230.9661, 2078.695 - }; - return 0 < udre && udre <= 14 ? var[udre-1] : 0.0; + 0.052, 0.0924, 0.1444, 0.283, 0.4678, 0.8315, 1.2992, 1.8709, 2.5465, 3.326, + 5.1968, 20.7870, 230.9661, 2078.695}; + return 0 < udre && udre <= 14 ? var[udre - 1] : 0.0; } @@ -85,10 +85,9 @@ double varfcorr(int udre) double varicorr(int give) { const double var[15] = { - 0.0084, 0.0333, 0.0749, 0.1331, 0.2079, 0.2994, 0.4075, 0.5322, 0.6735, 0.8315, - 1.1974, 1.8709, 3.326, 20.787, 187.0826 - }; - return 0 < give && give <= 15 ? var[give-1] : 0.0; + 0.0084, 0.0333, 0.0749, 0.1331, 0.2079, 0.2994, 0.4075, 0.5322, 0.6735, 0.8315, + 1.1974, 1.8709, 3.326, 20.787, 187.0826}; + return 0 < give && give <= 15 ? var[give - 1] : 0.0; } @@ -96,9 +95,8 @@ double varicorr(int give) double degfcorr(int ai) { const double degf[16] = { - 0.00000, 0.00005, 0.00009, 0.00012, 0.00015, 0.00020, 0.00030, 0.00045, - 0.00060, 0.00090, 0.00150, 0.00210, 0.00270, 0.00330, 0.00460, 0.00580 - }; + 0.00000, 0.00005, 0.00009, 0.00012, 0.00015, 0.00020, 0.00030, 0.00045, + 0.00060, 0.00090, 0.00150, 0.00210, 0.00270, 0.00330, 0.00460, 0.00580}; return 0 < ai && ai <= 15 ? degf[ai] : 0.0058; } @@ -110,18 +108,26 @@ int decode_sbstype1(const sbsmsg_t *msg, sbssat_t *sbssat) trace(4, "decode_sbstype1:\n"); - for (i = 1, n = 0;i<=210 && nmsg, 13+i, 1)) + if (getbitu(msg->msg, 13 + i, 1)) { - if (i<= 37) sat = satno(SYS_GPS, i); /* 0- 37: gps */ - else if (i<= 61) sat = satno(SYS_GLO, i-37); /* 38- 61: glonass */ - else if (i<=119) sat = 0; /* 62-119: future gnss */ - else if (i<=138) sat = satno(SYS_SBS, i); /* 120-138: geo/waas */ - else if (i<=182) sat = 0; /* 139-182: reserved */ - else if (i<=192) sat = satno(SYS_SBS, i+10); /* 183-192: qzss ref [2] */ - else if (i<=202) sat = satno(SYS_QZS, i); /* 193-202: qzss ref [2] */ - else sat = 0; /* 203- : reserved */ + if (i <= 37) + sat = satno(SYS_GPS, i); /* 0- 37: gps */ + else if (i <= 61) + sat = satno(SYS_GLO, i - 37); /* 38- 61: glonass */ + else if (i <= 119) + sat = 0; /* 62-119: future gnss */ + else if (i <= 138) + sat = satno(SYS_SBS, i); /* 120-138: geo/waas */ + else if (i <= 182) + sat = 0; /* 139-182: reserved */ + else if (i <= 192) + sat = satno(SYS_SBS, i + 10); /* 183-192: qzss ref [2] */ + else if (i <= 202) + sat = satno(SYS_QZS, i); /* 193-202: qzss ref [2] */ + else + sat = 0; /* 203- : reserved */ sbssat->sat[n++].sat = sat; } } @@ -142,29 +148,29 @@ int decode_sbstype2(const sbsmsg_t *msg, sbssat_t *sbssat) trace(4, "decode_sbstype2:\n"); - if (sbssat->iodp!=(int)getbitu(msg->msg, 16, 2)) return 0; + if (sbssat->iodp != (int)getbitu(msg->msg, 16, 2)) return 0; - type = getbitu(msg->msg, 8, 6); + type = getbitu(msg->msg, 8, 6); iodf = getbitu(msg->msg, 14, 2); for (i = 0; i < 13; i++) { if ((j = 13 * ((type == 0 ? 2 : type) - 2) + i) >= sbssat->nsat) break; - udre = getbitu(msg->msg, 174+4*i, 4); - t0 = sbssat->sat[j].fcorr.t0; + udre = getbitu(msg->msg, 174 + 4 * i, 4); + t0 = sbssat->sat[j].fcorr.t0; prc = sbssat->sat[j].fcorr.prc; sbssat->sat[j].fcorr.t0 = gpst2time(msg->week, msg->tow); sbssat->sat[j].fcorr.prc = getbits(msg->msg, 18 + i * 12, 12) * 0.125f; sbssat->sat[j].fcorr.udre = udre + 1; dt = timediff(sbssat->sat[j].fcorr.t0, t0); - if (t0.time == 0||dt <= 0.0 || 18.0 < dt || sbssat->sat[j].fcorr.ai == 0) + if (t0.time == 0 || dt <= 0.0 || 18.0 < dt || sbssat->sat[j].fcorr.ai == 0) { sbssat->sat[j].fcorr.rrc = 0.0; sbssat->sat[j].fcorr.dt = 0.0; } else { - sbssat->sat[j].fcorr.rrc = (sbssat->sat[j].fcorr.prc-prc) / dt; + sbssat->sat[j].fcorr.rrc = (sbssat->sat[j].fcorr.prc - prc) / dt; sbssat->sat[j].fcorr.dt = dt; } sbssat->sat[j].fcorr.iodf = iodf; @@ -181,15 +187,15 @@ int decode_sbstype6(const sbsmsg_t *msg, sbssat_t *sbssat) trace(4, "decode_sbstype6:\n"); - for (i = 0;i<4;i++) + for (i = 0; i < 4; i++) { - iodf[i] = getbitu(msg->msg, 14+i*2, 2); + iodf[i] = getbitu(msg->msg, 14 + i * 2, 2); } for (i = 0; i < sbssat->nsat && i < MAXSAT; i++) { - if (sbssat->sat[i].fcorr.iodf != iodf[i/28]) continue; - udre = getbitu(msg->msg, 22+i*4, 4); - sbssat->sat[i].fcorr.udre = udre+1; + if (sbssat->sat[i].fcorr.iodf != iodf[i / 28]) continue; + udre = getbitu(msg->msg, 22 + i * 4, 4); + sbssat->sat[i].fcorr.udre = udre + 1; } trace(5, "decode_sbstype6: iodf=%d %d %d %d\n", iodf[0], iodf[1], iodf[2], iodf[3]); return 1; @@ -203,13 +209,13 @@ int decode_sbstype7(const sbsmsg_t *msg, sbssat_t *sbssat) trace(4, "decode_sbstype7\n"); - if (sbssat->iodp!=(int)getbitu(msg->msg, 18, 2)) return 0; + if (sbssat->iodp != (int)getbitu(msg->msg, 18, 2)) return 0; sbssat->tlat = getbitu(msg->msg, 14, 4); - for (i = 0;insat && insat && i < MAXSAT; i++) { - sbssat->sat[i].fcorr.ai = getbitu(msg->msg, 22+i*4, 4); + sbssat->sat[i].fcorr.ai = getbitu(msg->msg, 22 + i * 4, 4); } return 1; } @@ -218,7 +224,7 @@ int decode_sbstype7(const sbsmsg_t *msg, sbssat_t *sbssat) /* decode type 9: geo navigation message -------------------------------------*/ 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; trace(4, "decode_sbstype9:\n"); @@ -228,35 +234,37 @@ int decode_sbstype9(const sbsmsg_t *msg, nav_t *nav) trace(2, "invalid prn in sbas type 9: prn=%3d\n", msg->prn); return 0; } - t = (int)getbitu(msg->msg, 22, 13)*16-(int)msg->tow%86400; - if (t<=-43200) t+=86400; - else if (t> 43200) t-=86400; + t = (int)getbitu(msg->msg, 22, 13) * 16 - (int)msg->tow % 86400; + if (t <= -43200) + t += 86400; + else if (t > 43200) + t -= 86400; seph.sat = sat; - seph.t0 = gpst2time(msg->week, msg->tow+t); + seph.t0 = gpst2time(msg->week, msg->tow + t); seph.tof = gpst2time(msg->week, msg->tow); seph.sva = getbitu(msg->msg, 35, 4); seph.svh = seph.sva == 15 ? 1 : 0; /* unhealthy if ura==15 */ - seph.pos[0] = getbits(msg->msg, 39, 30)*0.08; - seph.pos[1] = getbits(msg->msg, 69, 30)*0.08; - seph.pos[2] = getbits(msg->msg, 99, 25)*0.4; - seph.vel[0] = getbits(msg->msg, 124, 17)*0.000625; - seph.vel[1] = getbits(msg->msg, 141, 17)*0.000625; - seph.vel[2] = getbits(msg->msg, 158, 18)*0.004; - seph.acc[0] = getbits(msg->msg, 176, 10)*0.0000125; - seph.acc[1] = getbits(msg->msg, 186, 10)*0.0000125; - seph.acc[2] = getbits(msg->msg, 196, 10)*0.0000625; + seph.pos[0] = getbits(msg->msg, 39, 30) * 0.08; + seph.pos[1] = getbits(msg->msg, 69, 30) * 0.08; + seph.pos[2] = getbits(msg->msg, 99, 25) * 0.4; + seph.vel[0] = getbits(msg->msg, 124, 17) * 0.000625; + seph.vel[1] = getbits(msg->msg, 141, 17) * 0.000625; + seph.vel[2] = getbits(msg->msg, 158, 18) * 0.004; + seph.acc[0] = getbits(msg->msg, 176, 10) * 0.0000125; + seph.acc[1] = getbits(msg->msg, 186, 10) * 0.0000125; + seph.acc[2] = getbits(msg->msg, 196, 10) * 0.0000625; - seph.af0 = getbits(msg->msg, 206, 12)*TWO_N31; - seph.af1 = getbits(msg->msg, 218, 8)*TWO_N39/2.0; + seph.af0 = getbits(msg->msg, 206, 12) * TWO_N31; + seph.af1 = getbits(msg->msg, 218, 8) * TWO_N39 / 2.0; - i = msg->prn-MINPRNSBS; - if (!nav->seph||fabs(timediff(nav->seph[i].t0, seph.t0))<1e-3) + i = msg->prn - MINPRNSBS; + if (!nav->seph || fabs(timediff(nav->seph[i].t0, seph.t0)) < 1e-3) { /* not change */ return 0; } - nav->seph[NSATSBS+i] = nav->seph[i]; /* previous */ - nav->seph[i] = seph; /* current */ + nav->seph[NSATSBS + i] = nav->seph[i]; /* previous */ + nav->seph[i] = seph; /* current */ trace(5, "decode_sbstype9: prn=%d\n", msg->prn); return 1; @@ -271,15 +279,24 @@ int decode_sbstype18(const sbsmsg_t *msg, sbsion_t *sbsion) trace(4, "decode_sbstype18:\n"); - if (0<=band && band<= 8) {p = igpband1[band ]; m = 8;} - else if (9<=band && band<=10) {p = igpband2[band-9]; m = 5;} - else return 0; + if (0 <= band && band <= 8) + { + p = igpband1[band]; + m = 8; + } + else if (9 <= band && band <= 10) + { + p = igpband2[band - 9]; + m = 5; + } + else + return 0; sbsion[band].iodi = (short)getbitu(msg->msg, 22, 2); - for (i = 1, n = 0; i<= 201;i++) + for (i = 1, n = 0; i <= 201; i++) { - if (!getbitu(msg->msg , 23 + i, 1)) continue; + if (!getbitu(msg->msg, 23 + i, 1)) continue; for (j = 0; j < m; j++) { if (i < p[j].bits || p[j].bite < i) continue; @@ -302,20 +319,20 @@ int decode_longcorr0(const sbsmsg_t *msg, int p, sbssat_t *sbssat) trace(4, "decode_longcorr0:\n"); - if (n == 0||n>MAXSAT) return 0; + if (n == 0 || n > MAXSAT) return 0; - sbssat->sat[n-1].lcorr.iode = getbitu(msg->msg, p+6, 8); + sbssat->sat[n - 1].lcorr.iode = getbitu(msg->msg, p + 6, 8); - for (i = 0;i<3;i++) + for (i = 0; i < 3; i++) { - sbssat->sat[n-1].lcorr.dpos[i] = getbits(msg->msg, p+14+9*i, 9)*0.125; - sbssat->sat[n-1].lcorr.dvel[i] = 0.0; + sbssat->sat[n - 1].lcorr.dpos[i] = getbits(msg->msg, p + 14 + 9 * i, 9) * 0.125; + sbssat->sat[n - 1].lcorr.dvel[i] = 0.0; } - sbssat->sat[n-1].lcorr.daf0 = getbits(msg->msg, p + 41, 10) * TWO_N31; - sbssat->sat[n-1].lcorr.daf1 = 0.0; - sbssat->sat[n-1].lcorr.t0 = gpst2time(msg->week, msg->tow); + sbssat->sat[n - 1].lcorr.daf0 = getbits(msg->msg, p + 41, 10) * TWO_N31; + sbssat->sat[n - 1].lcorr.daf1 = 0.0; + sbssat->sat[n - 1].lcorr.t0 = gpst2time(msg->week, msg->tow); - trace(5, "decode_longcorr0:sat=%2d\n", sbssat->sat[n-1].sat); + trace(5, "decode_longcorr0:sat=%2d\n", sbssat->sat[n - 1].sat); return 1; } @@ -327,23 +344,25 @@ int decode_longcorr1(const sbsmsg_t *msg, int p, sbssat_t *sbssat) trace(4, "decode_longcorr1:\n"); - if (n == 0||n>MAXSAT) return 0; + if (n == 0 || n > MAXSAT) return 0; - sbssat->sat[n-1].lcorr.iode = getbitu(msg->msg, p+6, 8); + sbssat->sat[n - 1].lcorr.iode = getbitu(msg->msg, p + 6, 8); - for (i = 0;i<3;i++) + for (i = 0; i < 3; i++) { - sbssat->sat[n-1].lcorr.dpos[i] = getbits(msg->msg, p + 14 + i * 11, 11) * 0.125; - sbssat->sat[n-1].lcorr.dvel[i] = getbits(msg->msg, p + 58 + i * 8, 8) * TWO_N11; + sbssat->sat[n - 1].lcorr.dpos[i] = getbits(msg->msg, p + 14 + i * 11, 11) * 0.125; + sbssat->sat[n - 1].lcorr.dvel[i] = getbits(msg->msg, p + 58 + i * 8, 8) * TWO_N11; } - sbssat->sat[n-1].lcorr.daf0 = getbits(msg->msg, p+47, 11) * TWO_N31; - sbssat->sat[n-1].lcorr.daf1 = getbits(msg->msg, p+82, 8) * TWO_N39; - t = (int)getbitu(msg->msg, p+90, 13)*16-(int)msg->tow%86400; - if (t<=-43200) t+=86400; - else if (t> 43200) t-=86400; - sbssat->sat[n-1].lcorr.t0 = gpst2time(msg->week, msg->tow+t); + sbssat->sat[n - 1].lcorr.daf0 = getbits(msg->msg, p + 47, 11) * TWO_N31; + sbssat->sat[n - 1].lcorr.daf1 = getbits(msg->msg, p + 82, 8) * TWO_N39; + t = (int)getbitu(msg->msg, p + 90, 13) * 16 - (int)msg->tow % 86400; + if (t <= -43200) + t += 86400; + else if (t > 43200) + t -= 86400; + sbssat->sat[n - 1].lcorr.t0 = gpst2time(msg->week, msg->tow + t); - trace(5, "decode_longcorr1: sat=%2d\n", sbssat->sat[n-1].sat); + trace(5, "decode_longcorr1: sat=%2d\n", sbssat->sat[n - 1].sat); return 1; } @@ -353,16 +372,17 @@ int decode_longcorrh(const sbsmsg_t *msg, int p, sbssat_t *sbssat) { trace(4, "decode_longcorrh:\n"); - if (getbitu(msg->msg, p, 1) == 0) { /* vel code=0 */ - if (sbssat->iodp == (int)getbitu(msg->msg, p+103, 2)) + if (getbitu(msg->msg, p, 1) == 0) + { /* vel code=0 */ + if (sbssat->iodp == (int)getbitu(msg->msg, p + 103, 2)) { - return decode_longcorr0(msg, p+ 1, sbssat) && - decode_longcorr0(msg, p+52, sbssat); + return decode_longcorr0(msg, p + 1, sbssat) && + decode_longcorr0(msg, p + 52, sbssat); } - } - else if (sbssat->iodp == (int)getbitu(msg->msg, p+104, 2)) + } + else if (sbssat->iodp == (int)getbitu(msg->msg, p + 104, 2)) { - return decode_longcorr1(msg, p+1, sbssat); + return decode_longcorr1(msg, p + 1, sbssat); } return 0; } @@ -375,19 +395,19 @@ int decode_sbstype24(const sbsmsg_t *msg, sbssat_t *sbssat) trace(4, "decode_sbstype24:\n"); - if (sbssat->iodp!=(int)getbitu(msg->msg, 110, 2)) return 0; /* check IODP */ + if (sbssat->iodp != (int)getbitu(msg->msg, 110, 2)) return 0; /* check IODP */ - blk = getbitu(msg->msg, 112, 2); + blk = getbitu(msg->msg, 112, 2); iodf = getbitu(msg->msg, 114, 2); - for (i = 0;i<6;i++) + for (i = 0; i < 6; i++) { - if ((j = 13*blk+i)>=sbssat->nsat) break; - udre = getbitu(msg->msg, 86+4*i, 4); + if ((j = 13 * blk + i) >= sbssat->nsat) break; + udre = getbitu(msg->msg, 86 + 4 * i, 4); - sbssat->sat[j].fcorr.t0 = gpst2time(msg->week, msg->tow); - sbssat->sat[j].fcorr.prc = getbits(msg->msg, 14+i*12, 12)*0.125f; - sbssat->sat[j].fcorr.udre = udre+1; + sbssat->sat[j].fcorr.t0 = gpst2time(msg->week, msg->tow); + sbssat->sat[j].fcorr.prc = getbits(msg->msg, 14 + i * 12, 12) * 0.125f; + sbssat->sat[j].fcorr.udre = udre + 1; sbssat->sat[j].fcorr.iodf = iodf; } return decode_longcorrh(msg, 120, sbssat); @@ -410,21 +430,21 @@ int decode_sbstype26(const sbsmsg_t *msg, sbsion_t *sbsion) trace(4, "decode_sbstype26:\n"); - if (band>MAXBAND || sbsion[band].iodi != (int)getbitu(msg->msg, 217, 2)) return 0; + if (band > MAXBAND || sbsion[band].iodi != (int)getbitu(msg->msg, 217, 2)) return 0; block = getbitu(msg->msg, 18, 4); - for (i = 0;i<15;i++) + for (i = 0; i < 15; i++) { - if ((j = block*15+i) >= sbsion[band].nigp) continue; - give = getbitu(msg->msg, 22+i*13+9, 4); + if ((j = block * 15 + i) >= sbsion[band].nigp) continue; + give = getbitu(msg->msg, 22 + i * 13 + 9, 4); - delay = getbitu(msg->msg, 22+i*13, 9); + delay = getbitu(msg->msg, 22 + i * 13, 9); sbsion[band].igp[j].t0 = gpst2time(msg->week, msg->tow); sbsion[band].igp[j].delay = delay == 0x1FF ? 0.0f : delay * 0.125f; - sbsion[band].igp[j].give = give+1; + sbsion[band].igp[j].give = give + 1; - if (sbsion[band].igp[j].give>=16) + if (sbsion[band].igp[j].give >= 16) { sbsion[band].igp[j].give = 0; } @@ -452,31 +472,52 @@ int sbsupdatecorr(const sbsmsg_t *msg, nav_t *nav) if (msg->week == 0) return -1; switch (type) - { - case 0: stat = decode_sbstype2 (msg, &nav->sbssat); break; - case 1: stat = decode_sbstype1 (msg, &nav->sbssat); break; - case 2: - case 3: - case 4: - case 5: stat = decode_sbstype2 (msg, &nav->sbssat); break; - case 6: stat = decode_sbstype6 (msg, &nav->sbssat); break; - case 7: stat = decode_sbstype7 (msg, &nav->sbssat); break; - case 9: stat = decode_sbstype9 (msg, nav); break; - case 18: stat = decode_sbstype18(msg, nav ->sbsion); break; - case 24: stat = decode_sbstype24(msg, &nav->sbssat); break; - case 25: stat = decode_sbstype25(msg, &nav->sbssat); break; - case 26: stat = decode_sbstype26(msg, nav ->sbsion); break; - case 63: break; /* null message */ + { + case 0: + stat = decode_sbstype2(msg, &nav->sbssat); + break; + case 1: + stat = decode_sbstype1(msg, &nav->sbssat); + break; + case 2: + case 3: + case 4: + case 5: + stat = decode_sbstype2(msg, &nav->sbssat); + break; + case 6: + stat = decode_sbstype6(msg, &nav->sbssat); + break; + case 7: + stat = decode_sbstype7(msg, &nav->sbssat); + break; + case 9: + stat = decode_sbstype9(msg, nav); + break; + case 18: + stat = decode_sbstype18(msg, nav->sbsion); + break; + case 24: + stat = decode_sbstype24(msg, &nav->sbssat); + break; + case 25: + stat = decode_sbstype25(msg, &nav->sbssat); + break; + case 26: + stat = decode_sbstype26(msg, nav->sbsion); + break; + case 63: + break; /* null message */ - /*default: trace(2, "unsupported sbas message: type=%d\n", type); break;*/ - } + /*default: trace(2, "unsupported sbas message: type=%d\n", type); break;*/ + } return stat ? type : -1; } /* read sbas log file --------------------------------------------------------*/ void readmsgs(const char *file, int sel, gtime_t ts, gtime_t te, - sbs_t *sbs) + sbs_t *sbs) { sbsmsg_t *sbs_msgs; int i, week, prn, ch, msg; @@ -495,48 +536,52 @@ void readmsgs(const char *file, int sel, gtime_t ts, gtime_t te, } while (fgets(buff, sizeof(buff), fp)) { - if (sscanf(buff, "%d %lf %d", &week, &tow, &prn) == 3 && (p = strstr(buff, ": "))) + if (sscanf(buff, "%d %lf %d", &week, &tow, &prn) == 3 && (p = strstr(buff, ": "))) { - p+=2; /* rtklib form */ + p += 2; /* rtklib form */ } else if (sscanf(buff, "%d %lf %lf %lf %lf %lf %lf %d", - &prn, ep, ep+1, ep+2, ep+3, ep+4, ep+5, &msg) == 8) + &prn, ep, ep + 1, ep + 2, ep + 3, ep + 4, ep + 5, &msg) == 8) { /* ems (EGNOS Message Service) form */ ep[0] += ep[0] < 70.0 ? 2000.0 : 1900.0; tow = time2gpst(epoch2time(ep), &week); p = buff + (msg >= 10 ? 25 : 24); } - else if (!strncmp(buff,"#RAWWAASFRAMEA",14)) + else if (!strncmp(buff, "#RAWWAASFRAMEA", 14)) { /* NovAtel OEM4/V */ - if (!(p = getfield(buff,6))) continue; - if (sscanf(p,"%d,%lf", &week, &tow) < 2) continue; + if (!(p = getfield(buff, 6))) continue; + if (sscanf(p, "%d,%lf", &week, &tow) < 2) continue; if (!(p = strchr(++p, ';'))) continue; if (sscanf(++p, "%d,%d", &ch, &prn) < 2) continue; if (!(p = getfield(p, 4))) continue; } - else if (!strncmp(buff,"$FRMA",5)) + else if (!strncmp(buff, "$FRMA", 5)) { /* NovAtel OEM3 */ - if (!(p = getfield(buff,2))) continue; + if (!(p = getfield(buff, 2))) continue; if (sscanf(p, "%d,%lf,%d", &week, &tow, &prn) < 3) continue; if (!(p = getfield(p, 6))) continue; if (week < WEEKOFFSET) week += WEEKOFFSET; } - else continue; + else + continue; if (sel != 0 && sel != prn) continue; time = gpst2time(week, tow); - if (!screent(time, ts,te,0.0)) continue; + if (!screent(time, ts, te, 0.0)) continue; - if (sbs->n>=sbs->nmax) + if (sbs->n >= sbs->nmax) { sbs->nmax = sbs->nmax == 0 ? 1024 : sbs->nmax * 2; if (!(sbs_msgs = (sbsmsg_t *)realloc(sbs->msgs, sbs->nmax * sizeof(sbsmsg_t)))) { trace(1, "readsbsmsg malloc error: nmax=%d\n", sbs->nmax); - free(sbs->msgs); sbs->msgs = NULL; sbs->n = sbs->nmax = 0; fclose(fp); + free(sbs->msgs); + sbs->msgs = NULL; + sbs->n = sbs->nmax = 0; + fclose(fp); return; } sbs->msgs = sbs_msgs; @@ -545,7 +590,7 @@ void readmsgs(const char *file, int sel, gtime_t ts, gtime_t te, sbs->msgs[sbs->n].tow = (int)(tow + 0.5); sbs->msgs[sbs->n].prn = prn; for (i = 0; i < 29; i++) sbs->msgs[sbs->n].msg[i] = 0; - for (i = 0; *(p-1) && *p && i < 29; p += 2, i++) + for (i = 0; *(p - 1) && *p && i < 29; p += 2, i++) { if (sscanf(p, "%2X", &b) == 1) sbs->msgs[sbs->n].msg[i] = (unsigned char)b; } @@ -558,9 +603,8 @@ void readmsgs(const char *file, int sel, gtime_t ts, gtime_t te, /* compare sbas messages -----------------------------------------------------*/ int cmpmsgs(const void *p1, const void *p2) { - sbsmsg_t *q1 = (sbsmsg_t *)p1,*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)); + sbsmsg_t *q1 = (sbsmsg_t *)p1, *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)); } @@ -580,14 +624,14 @@ int cmpmsgs(const void *p1, const void *p2) * .sbs, .SBS, .ems, .EMS *-----------------------------------------------------------------------------*/ int sbsreadmsgt(const char *file, int sel, gtime_t ts, gtime_t te, - sbs_t *sbs) + sbs_t *sbs) { - char *efiles[MAXEXFILE] = {},*ext; - int i,n; + char *efiles[MAXEXFILE] = {}, *ext; + int i, n; - trace(3,"sbsreadmsgt: file=%s sel=%d\n",file,sel); + trace(3, "sbsreadmsgt: file=%s sel=%d\n", file, sel); - for (i = 0; i < MAXEXFILE ; i++) + for (i = 0; i < MAXEXFILE; i++) { if (!(efiles[i] = (char *)malloc(1024))) { @@ -596,20 +640,20 @@ int sbsreadmsgt(const char *file, int sel, gtime_t ts, gtime_t te, } } /* expand wild card in file path */ - n = expath(file,efiles,MAXEXFILE); + n = expath(file, efiles, MAXEXFILE); for (i = 0; i < n; i++) { - if (!(ext = strrchr(efiles[i],'.'))) continue; + if (!(ext = strrchr(efiles[i], '.'))) continue; if (strcmp(ext, ".sbs") && strcmp(ext, ".SBS") && - strcmp(ext, ".ems") && strcmp(ext, ".EMS")) continue; + strcmp(ext, ".ems") && strcmp(ext, ".EMS")) continue; readmsgs(efiles[i], sel, ts, te, sbs); } for (i = 0; i < MAXEXFILE; i++) free(efiles[i]); /* sort messages */ - if (sbs->n >0) + if (sbs->n > 0) { qsort(sbs->msgs, sbs->n, sizeof(sbsmsg_t), cmpmsgs); } @@ -637,23 +681,23 @@ void sbsoutmsg(FILE *fp, sbsmsg_t *sbsmsg) { int i, type = sbsmsg->msg[1] >> 2; - trace(4,"sbsoutmsg:\n"); + trace(4, "sbsoutmsg:\n"); fprintf(fp, "%4d %6d %3d %2d : ", sbsmsg->week, sbsmsg->tow, sbsmsg->prn, type); for (i = 0; i < 29; i++) fprintf(fp, "%02X", sbsmsg->msg[i]); - fprintf(fp,"\n"); + fprintf(fp, "\n"); } /* search igps ---------------------------------------------------------------*/ 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]; - double lat = pos[0] * R2D,lon = pos[1] * R2D; + int i, latp[2], lonp[4]; + double lat = pos[0] * R2D, lon = pos[1] * R2D; 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); if (lon >= 180.0) lon -= 360.0; if (-55.0 <= lat && lat < 55.0) @@ -667,7 +711,7 @@ void searchigp(gtime_t time __attribute__((unused)), const double *pos, const sb } else { - latp[0] = (int)floor((lat-5.0) / 10.0) * 10 + 5; + latp[0] = (int)floor((lat - 5.0) / 10.0) * 10 + 5; latp[1] = latp[0] + 10; lonp[0] = lonp[1] = (int)floor(lon / 10.0) * 10; lonp[2] = lonp[3] = lonp[0] + 10; @@ -692,16 +736,21 @@ void searchigp(gtime_t time __attribute__((unused)), const double *pos, const sb for (i = 0; i < 4; i++) lonp[i] = (int)floor((lon - 50.0) / 90.0) * 90 + 40; } } - for (i = 0; i < 4; i++) if (lonp[i] == 180) lonp[i] = -180; + for (i = 0; i < 4; i++) + if (lonp[i] == 180) lonp[i] = -180; for (i = 0; i <= MAXBAND; i++) { for (p = ion[i].igp; p < ion[i].igp + ion[i].nigp; p++) { if (p->t0.time == 0) continue; - if (p->lat == latp[0] && p->lon == lonp[0] && p->give > 0) igp[0] = p; - else if (p->lat == latp[1] && p->lon == lonp[1] && p->give > 0) igp[1] = p; - else if (p->lat == latp[0] && p->lon == lonp[2] && p->give > 0) igp[2] = p; - else if (p->lat == latp[1] && p->lon == lonp[3] && p->give > 0) igp[3] = p; + if (p->lat == latp[0] && p->lon == lonp[0] && p->give > 0) + igp[0] = p; + else if (p->lat == latp[1] && p->lon == lonp[1] && p->give > 0) + igp[1] = p; + else if (p->lat == latp[0] && p->lon == lonp[2] && p->give > 0) + igp[2] = p; + else if (p->lat == latp[1] && p->lon == lonp[3] && p->give > 0) + igp[3] = p; if (igp[0] && igp[1] && igp[2] && igp[3]) return; } } @@ -722,24 +771,24 @@ void searchigp(gtime_t time __attribute__((unused)), const double *pos, const sb * sbsupdatecorr() *-----------------------------------------------------------------------------*/ 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; - int i,err = 0; - double fp,posp[2],x = 0.0,y = 0.0,t,w[4] = {}; + const double re = 6378.1363, hion = 350.0; + int i, err = 0; + double fp, posp[2], x = 0.0, y = 0.0, t, w[4] = {}; 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, - azel[0]*R2D,azel[1]*R2D); + trace(4, "sbsioncorr: pos=%.3f %.3f azel=%.3f %.3f\n", pos[0] * R2D, pos[1] * R2D, + azel[0] * R2D, azel[1] * R2D); *delay = *var = 0.0; - if (pos[2]<-100.0||azel[1]<=0) return 1; + if (pos[2] < -100.0 || azel[1] <= 0) return 1; /* ipp (ionospheric pierce point) position */ - fp = ionppp(pos,azel,re,hion,posp); + fp = ionppp(pos, azel, re, hion, posp); /* search igps around ipp */ - searchigp(time,posp,nav->sbsion,igp,&x,&y); + searchigp(time, posp, nav->sbsion, igp, &x, &y); /* weight of igps */ if (igp[0] && igp[1] && igp[2] && igp[3]) @@ -751,42 +800,48 @@ int sbsioncorr(gtime_t time, const nav_t *nav, const double *pos, } else if (igp[0] && igp[1] && igp[2]) { - w[1] = y; w[2] = x; - if ((w[0] = 1.0- w[1] - w[2]) < 0.0) err = 1; + w[1] = y; + w[2] = x; + if ((w[0] = 1.0 - w[1] - w[2]) < 0.0) err = 1; } else if (igp[0] && igp[2] && igp[3]) { - w[0] = 1.0 - x; w[3] = y; + w[0] = 1.0 - x; + w[3] = y; if ((w[2] = 1.0 - w[0] - w[3]) < 0.0) err = 1; } else if (igp[0] && igp[1] && igp[3]) { - w[0] = 1.0 - y; w[3] = x; + w[0] = 1.0 - y; + w[3] = x; if ((w[1] = 1.0 - w[0] - w[3]) < 0.0) err = 1; } else if (igp[1] && igp[2] && igp[3]) { - w[1] = 1.0-x; w[2] = 1.0-y; + w[1] = 1.0 - x; + w[2] = 1.0 - y; if ((w[3] = 1.0 - w[1] - w[2]) < 0.0) err = 1; } - else err = 1; + else + err = 1; if (err) { trace(2, "no sbas iono correction: lat=%3.0f lon=%4.0f\n", posp[0] * R2D, - posp[1] * R2D); + posp[1] * R2D); return 0; } for (i = 0; i < 4; i++) { if (!igp[i]) continue; - t = timediff(time,igp[i]->t0); + t = timediff(time, igp[i]->t0); *delay += w[i] * igp[i]->delay; *var += w[i] * varicorr(igp[i]->give) * 9e-8 * fabs(t); } - *delay *= fp; *var *= fp * fp; + *delay *= fp; + *var *= fp * fp; - trace(5,"sbsioncorr: dion=%7.2f sig=%7.2f\n",*delay,sqrt(*var)); + trace(5, "sbsioncorr: dion=%7.2f sig=%7.2f\n", *delay, sqrt(*var)); return 1; } @@ -794,22 +849,24 @@ int sbsioncorr(gtime_t time, const nav_t *nav, const double *pos, /* get meterological parameters ----------------------------------------------*/ void getmet(double lat, double *met) { - static const double metprm[][10] = { /* lat=15,30,45,60,75 */ - {1013.25,299.65,26.31,6.30E-3,2.77, 0.00, 0.00,0.00,0.00E-3,0.00}, - {1017.25,294.15,21.79,6.05E-3,3.15, -3.75, 7.00,8.85,0.25E-3,0.33}, - {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}, - {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; + static const double metprm[][10] = {/* lat=15,30,45,60,75 */ + {1013.25, 299.65, 26.31, 6.30E-3, 2.77, 0.00, 0.00, 0.00, 0.00E-3, 0.00}, + {1017.25, 294.15, 21.79, 6.05E-3, 3.15, -3.75, 7.00, 8.85, 0.25E-3, 0.33}, + {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}, + {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; double a; lat = fabs(lat); - if (lat <= 15.0) for (i = 0;i<10;i++) met[i] = metprm[0][i]; - else if (lat >= 75.0) for (i = 0;i<10;i++) met[i] = metprm[4][i]; + if (lat <= 15.0) + for (i = 0; i < 10; i++) met[i] = metprm[0][i]; + else if (lat >= 75.0) + for (i = 0; i < 10; i++) met[i] = metprm[4][i]; else { - j = (int)(lat / 15.0); a = (lat - j * 15.0) / 15.0; - for (i = 0; i < 10; i++) met[i] = (1.0 - a) * metprm[j-1][i] + a * metprm[j][i]; + j = (int)(lat / 15.0); + a = (lat - j * 15.0) / 15.0; + for (i = 0; i < 10; i++) met[i] = (1.0 - a) * metprm[j - 1][i] + a * metprm[j][i]; } } @@ -823,15 +880,15 @@ void getmet(double lat, double *met) * return : slant tropospheric delay (m) *-----------------------------------------------------------------------------*/ 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, k2 = 382000.0, rd = 287.054, gm = 9.784, g = 9.80665; static double pos_[3] = {}, zh = 0.0, zw = 0.0; int i; double c, met[10], sinel = sin(azel[1]), h = pos[2], m; 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); if (pos[2] < -100.0 || 10000.0 < pos[2] || azel[1] <= 0) { @@ -839,71 +896,71 @@ double sbstropcorr(gtime_t time, const double *pos, const double *azel, return 0.0; } if (zh == 0.0 || fabs(pos[0] - pos_[0]) > 1e-7 || fabs(pos[1] - pos_[1]) > 1e-7 || - fabs(pos[2] - pos_[2]) > 1.0) + fabs(pos[2] - pos_[2]) > 1.0) { - getmet(pos[0] * R2D,met); + getmet(pos[0] * R2D, met); c = cos(2.0 * PI * (time2doy(time) - (pos[0] >= 0.0 ? 28.0 : 211.0)) / 365.25); - for (i = 0; i < 5;i++) met[i] -= met[i+5] * c; + for (i = 0; i < 5; i++) met[i] -= met[i + 5] * c; zh = 1e-6 * k1 * rd * met[0] / gm; zw = 1e-6 * k2 * rd / (gm * (met[4] + 1.0) - met[3] * rd) * met[2] / met[1]; zh *= pow(1.0 - met[3] * h / met[1], g / (rd * met[3])); zw *= pow(1.0 - met[3] * h / met[1], (met[4] + 1.0) * g / (rd * met[3]) - 1.0); for (i = 0; i < 3; i++) pos_[i] = pos[i]; } - m = 1.001/sqrt(0.002001+sinel*sinel); - *var = 0.12*0.12*m*m; - return (zh+zw)*m; + m = 1.001 / sqrt(0.002001 + sinel * sinel); + *var = 0.12 * 0.12 * m * m; + return (zh + zw) * m; } /* long term correction ------------------------------------------------------*/ int sbslongcorr(gtime_t time, int sat, const sbssat_t *sbssat, - double *drs, double *ddts) + double *drs, double *ddts) { const sbssatp_t *p; double t; int i; - trace(3,"sbslongcorr: sat=%2d\n",sat); + trace(3, "sbslongcorr: sat=%2d\n", sat); - for (p = sbssat->sat;psat+sbssat->nsat;p++) + for (p = sbssat->sat; p < sbssat->sat + sbssat->nsat; p++) { if (p->sat != sat || p->lcorr.t0.time == 0) continue; t = timediff(time, p->lcorr.t0); if (fabs(t) > MAXSBSAGEL) { - trace(2,"sbas long-term correction expired: %s sat=%2d t=%5.0f\n", - time_str(time,0), sat, t); + trace(2, "sbas long-term correction expired: %s sat=%2d t=%5.0f\n", + time_str(time, 0), sat, t); return 0; } - for (i = 0; i < 3;i++) drs[i] = p->lcorr.dpos[i] + p->lcorr.dvel[i] * t; + for (i = 0; i < 3; i++) drs[i] = p->lcorr.dpos[i] + p->lcorr.dvel[i] * t; *ddts = p->lcorr.daf0 + p->lcorr.daf1 * t; - trace(5,"sbslongcorr: sat=%2d drs=%7.2f%7.2f%7.2f ddts=%7.2f\n", - sat, drs[0], drs[1], drs[2], *ddts * SPEED_OF_LIGHT); + trace(5, "sbslongcorr: sat=%2d drs=%7.2f%7.2f%7.2f ddts=%7.2f\n", + sat, drs[0], drs[1], drs[2], *ddts * SPEED_OF_LIGHT); return 1; } /* if sbas satellite without correction, no correction applied */ - if (satsys(sat,NULL) == SYS_SBS) return 1; + if (satsys(sat, NULL) == SYS_SBS) return 1; - trace(2,"no sbas long-term correction: %s sat=%2d\n",time_str(time,0),sat); + trace(2, "no sbas long-term correction: %s sat=%2d\n", time_str(time, 0), sat); return 0; } /* fast correction -----------------------------------------------------------*/ int sbsfastcorr(gtime_t time, int sat, const sbssat_t *sbssat, - double *prc, double *var) + double *prc, double *var) { const sbssatp_t *p; double t; - trace(3,"sbsfastcorr: sat=%2d\n",sat); + trace(3, "sbsfastcorr: sat=%2d\n", sat); - for (p = sbssat->sat;psat+sbssat->nsat;p++) + for (p = sbssat->sat; p < sbssat->sat + sbssat->nsat; p++) { - if (p->sat!=sat) continue; + if (p->sat != sat) continue; if (p->fcorr.t0.time == 0) break; t = timediff(time, p->fcorr.t0) + sbssat->tlat; @@ -918,11 +975,11 @@ int sbsfastcorr(gtime_t time, int sat, const sbssat_t *sbssat, #endif *var = varfcorr(p->fcorr.udre) + degfcorr(p->fcorr.ai) * t * t / 2.0; - trace(5,"sbsfastcorr: sat=%3d prc=%7.2f sig=%7.2f t=%5.0f\n",sat, - *prc, sqrt(*var), t); + trace(5, "sbsfastcorr: sat=%3d prc=%7.2f sig=%7.2f t=%5.0f\n", sat, + *prc, sqrt(*var), t); return 1; } - trace(2,"no sbas fast correction: %s sat=%2d\n", time_str(time, 0), sat); + trace(2, "no sbas fast correction: %s sat=%2d\n", time_str(time, 0), sat); return 0; } @@ -945,12 +1002,12 @@ int sbsfastcorr(gtime_t time, int sat, const sbssat_t *sbssat, * to be considered for other codes *-----------------------------------------------------------------------------*/ 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; int i; - trace(3,"sbssatcorr : sat=%2d\n",sat); + trace(3, "sbssatcorr : sat=%2d\n", sat); /* sbas long term corrections */ if (!sbslongcorr(time, sat, &nav->sbssat, drs, &dclk)) @@ -966,8 +1023,8 @@ int sbssatcorr(gtime_t time, int sat, const nav_t *nav, double *rs, dts[0] += dclk + prc / SPEED_OF_LIGHT; - trace(5,"sbssatcorr: sat=%2d drs=%6.3f %6.3f %6.3f dclk=%.3f %.3f var=%.3f\n", - sat, drs[0], drs[1], drs[2], dclk, prc / SPEED_OF_LIGHT, *var); + trace(5, "sbssatcorr: sat=%2d drs=%6.3f %6.3f %6.3f dclk=%.3f %.3f var=%.3f\n", + sat, drs[0], drs[1], drs[2], dclk, prc / SPEED_OF_LIGHT, *var); return 1; } @@ -982,24 +1039,25 @@ int sbssatcorr(gtime_t time, int sat, const nav_t *nav, double *rs, * return : status (1:ok,0:crc error) *-----------------------------------------------------------------------------*/ int sbsdecodemsg(gtime_t time, int prn, const unsigned int *words, - sbsmsg_t *sbsmsg) + sbsmsg_t *sbsmsg) { - int i,j; + int i, j; unsigned char f[29]; double tow; - trace(5,"sbsdecodemsg: prn=%d\n",prn); + trace(5, "sbsdecodemsg: prn=%d\n", prn); if (time.time == 0) return 0; - tow = time2gpst(time,&sbsmsg->week); + tow = time2gpst(time, &sbsmsg->week); sbsmsg->tow = (int)(tow + DTTOL); sbsmsg->prn = prn; - for (i = 0; i < 7; i++) for (j = 0; j < 4; j++) - { - sbsmsg->msg[i*4+j] = (unsigned char)(words[i] >> ((3-j)*8)); - } - sbsmsg->msg[28] = (unsigned char)(words[7] >> 18 ) & 0xC0; - for (i = 28; i > 0; i--) f[i] = (sbsmsg->msg[i] >> 6) + (sbsmsg->msg[i-1] << 2); + for (i = 0; i < 7; i++) + for (j = 0; j < 4; j++) + { + sbsmsg->msg[i * 4 + j] = (unsigned char)(words[i] >> ((3 - j) * 8)); + } + sbsmsg->msg[28] = (unsigned char)(words[7] >> 18) & 0xC0; + for (i = 28; i > 0; i--) f[i] = (sbsmsg->msg[i] >> 6) + (sbsmsg->msg[i - 1] << 2); f[0] = sbsmsg->msg[0] >> 6; return rtk_crc24q(f, 29) == (words[7] & 0xFFFFFF); /* check crc */ diff --git a/src/algorithms/libs/rtklib/rtklib_sbas.h b/src/algorithms/libs/rtklib/rtklib_sbas.h index 62ea1dd31..1ff7bf6ad 100644 --- a/src/algorithms/libs/rtklib/rtklib_sbas.h +++ b/src/algorithms/libs/rtklib/rtklib_sbas.h @@ -66,56 +66,54 @@ /* constants -----------------------------------------------------------------*/ -const int WEEKOFFSET = 1024; /* gps week offset for NovAtel OEM-3 */ +const int WEEKOFFSET = 1024; /* gps week offset for NovAtel OEM-3 */ /* sbas igp definition -------------------------------------------------------*/ static const short -x1[] = {-75, -65, -55, -50, -45, -40, -35, -30, -25, -20, -15, -10, - 5, 0, 5, 10, 15, 20, - 25, 30, 35, 40, 45, 50, 55, 65, 75, 85}, -x2[] = {-55, -50, -45, -40, -35, -30, -25, -20, -15, -10, -5, 0, 5, 10, 15, 20, 25, 30, - 35, 40, 45, 50, 55}, -x3[] = {-75, -65, -55, -50, -45, -40, -35, -30, -25, -20, -15, -10, - 5, 0, 5, 10, 15, 20, - 25, 30, 35, 40, 45, 50, 55, 65, 75}, -x4[] = {-85, -75, -65, -55, -50, -45, -40, -35, -30, -25, -20, -15, -10, - 5, 0, 5, 10, 15, - 20, 25, 30, 35, 40, 45, 50, 55, 65, 75}, -x5[] = {-180, -175, -170, -165, -160, -155, -150, -145, -140, -135, -130, -125, -120, -115, - -110, -105, -100, - 95, - 90, - 85, - 80, - 75, - 70, - 65, - 60, - 55, - 50, - 45, - - 40, - 35, - 30, - 25, - 20, - 15, - 10, - 5, 0, 5, 10, 15, 20, 25, - 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95, - 100, 105, 110, 115, 120, 125, 130, 135, 140, 145, 150, 155, 160, 165, - 170, 175}, -x6[] = {-180, -170, -160, -150, -140, -130, -120, -110, -100, - 90, - 80, - 70, - 60, - 50, - - 40, - 30, - 20, - 10, 0, 10, 20, 30, 40, 50, 60, 70, 80, 90, - 100, 110, 120, 130, 140, 150, 160, 170}, -x7[] = {-180, -150, -120, - 90, - 60, - 30, 0, 30, 60, 90, 120, 150}, -x8[] = {-170, -140, -110, - 80, - 50, - 20, 10, 40, 70, 100, 130, 160}; + x1[] = {-75, -65, -55, -50, -45, -40, -35, -30, -25, -20, -15, -10, -5, 0, 5, 10, 15, 20, + 25, 30, 35, 40, 45, 50, 55, 65, 75, 85}, + x2[] = {-55, -50, -45, -40, -35, -30, -25, -20, -15, -10, -5, 0, 5, 10, 15, 20, 25, 30, + 35, 40, 45, 50, 55}, + x3[] = {-75, -65, -55, -50, -45, -40, -35, -30, -25, -20, -15, -10, -5, 0, 5, 10, 15, 20, + 25, 30, 35, 40, 45, 50, 55, 65, 75}, + x4[] = {-85, -75, -65, -55, -50, -45, -40, -35, -30, -25, -20, -15, -10, -5, 0, 5, 10, 15, + 20, 25, 30, 35, 40, 45, 50, 55, 65, 75}, + x5[] = {-180, -175, -170, -165, -160, -155, -150, -145, -140, -135, -130, -125, -120, -115, + -110, -105, -100, -95, -90, -85, -80, -75, -70, -65, -60, -55, -50, -45, + -40, -35, -30, -25, -20, -15, -10, -5, 0, 5, 10, 15, 20, 25, + 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95, + 100, 105, 110, 115, 120, 125, 130, 135, 140, 145, 150, 155, 160, 165, + 170, 175}, + x6[] = {-180, -170, -160, -150, -140, -130, -120, -110, -100, -90, -80, -70, -60, -50, + -40, -30, -20, -10, 0, 10, 20, 30, 40, 50, 60, 70, 80, 90, + 100, 110, 120, 130, 140, 150, 160, 170}, + x7[] = {-180, -150, -120, -90, -60, -30, 0, 30, 60, 90, 120, 150}, + x8[] = {-170, -140, -110, -80, -50, -20, 10, 40, 70, 100, 130, 160}; -const sbsigpband_t igpband1[9][8] = { /* band 0-8 */ - {{-180, x1, 1, 28}, {-175, x2, 29, 51}, {-170, x3, 52, 78}, {-165, x2, 79, 101}, - {-160, x3, 102, 128}, {-155, x2, 129, 151}, {-150, x3, 152, 178}, {-145, x2, 179, 201}}, - {{-140, x4, 1, 28}, {-135, x2, 29, 51}, {-130, x3, 52, 78}, {-125, x2, 79, 101}, - {-120, x3, 102, 128}, {-115, x2, 129, 151}, {-110, x3, 152, 178}, {-105, x2, 179, 201}}, - {{-100, x3, 1, 27}, {- 95,x2, 28, 50},{- 90, x1, 51, 78}, {- 85, x2, 79, 101}, - {- 80, x3, 102, 128}, {- 75, x2, 129, 151}, {- 70, x3, 152, 178}, {- 65, x2,179, 201}}, - {{- 60, x3, 1, 27}, {- 55, x2, 28, 50}, {- 50,x4, 51, 78}, {- 45, x2, 79, 101}, - {- 40, x3, 102, 128}, {- 35, x2, 129, 151}, {- 30, x3, 152, 178}, {- 25, x2, 179, 201}}, - {{- 20, x3, 1, 27}, {- 15, x2, 28, 50}, {- 10, x3, 51, 77}, {- 5, x2, 78, 100}, - { 0, x1, 101, 128}, { 5, x2, 129, 151}, { 10, x3, 152, 178}, { 15, x2, 179, 201}}, - {{ 20, x3, 1, 27}, { 25, x2, 28, 50}, { 30, x3, 51, 77}, { 35, x2, 78, 100}, - { 40, x4, 101, 128}, { 45, x2, 129, 151},{ 50, x3, 152, 178}, { 55, x2, 179, 201}}, - {{ 60, x3, 1, 27}, { 65, x2, 28, 50}, { 70, x3, 51, 77}, { 75, x2, 78, 100}, - { 80, x3, 101, 127}, { 85, x2, 128, 150}, { 90,x1, 151, 178}, { 95, x2, 179, 201}}, - {{ 100, x3, 1, 27}, { 105, x2, 28, 50}, { 110, x3, 51, 77}, { 115, x2, 78 ,100}, - { 120, x3, 101, 127}, { 125, x2, 128, 150}, { 130, x4, 151, 178}, { 135, x2, 179, 201}}, - {{ 140, x3, 1, 27}, { 145, x2, 28, 50}, { 150, x3, 51, 77}, { 155, x2, 78, 100}, - { 160, x3, 101, 127}, { 165, x2,128, 150}, { 170, x3,151,177}, { 175, x2, 178, 200}} -}; -const sbsigpband_t igpband2[2][5] = { /* band 9-10 */ - {{ 60, x5, 1, 72}, { 65, x6, 73, 108}, { 70, x6, 109, 144}, { 75, x6, 145, 180}, - { 85, x7, 181, 192}}, - {{- 60, x5, 1, 72}, {- 65, x6, 73, 108}, {- 70, x6, 109, 144}, {- 75 ,x6, 145, 180}, - {- 85, x8, 181, 192}} -}; +const sbsigpband_t igpband1[9][8] = {/* band 0-8 */ + {{-180, x1, 1, 28}, {-175, x2, 29, 51}, {-170, x3, 52, 78}, {-165, x2, 79, 101}, + {-160, x3, 102, 128}, {-155, x2, 129, 151}, {-150, x3, 152, 178}, {-145, x2, 179, 201}}, + {{-140, x4, 1, 28}, {-135, x2, 29, 51}, {-130, x3, 52, 78}, {-125, x2, 79, 101}, + {-120, x3, 102, 128}, {-115, x2, 129, 151}, {-110, x3, 152, 178}, {-105, x2, 179, 201}}, + {{-100, x3, 1, 27}, {-95, x2, 28, 50}, {-90, x1, 51, 78}, {-85, x2, 79, 101}, + {-80, x3, 102, 128}, {-75, x2, 129, 151}, {-70, x3, 152, 178}, {-65, x2, 179, 201}}, + {{-60, x3, 1, 27}, {-55, x2, 28, 50}, {-50, x4, 51, 78}, {-45, x2, 79, 101}, + {-40, x3, 102, 128}, {-35, x2, 129, 151}, {-30, x3, 152, 178}, {-25, x2, 179, 201}}, + {{-20, x3, 1, 27}, {-15, x2, 28, 50}, {-10, x3, 51, 77}, {-5, x2, 78, 100}, + {0, x1, 101, 128}, {5, x2, 129, 151}, {10, x3, 152, 178}, {15, x2, 179, 201}}, + {{20, x3, 1, 27}, {25, x2, 28, 50}, {30, x3, 51, 77}, {35, x2, 78, 100}, + {40, x4, 101, 128}, {45, x2, 129, 151}, {50, x3, 152, 178}, {55, x2, 179, 201}}, + {{60, x3, 1, 27}, {65, x2, 28, 50}, {70, x3, 51, 77}, {75, x2, 78, 100}, + {80, x3, 101, 127}, {85, x2, 128, 150}, {90, x1, 151, 178}, {95, x2, 179, 201}}, + {{100, x3, 1, 27}, {105, x2, 28, 50}, {110, x3, 51, 77}, {115, x2, 78, 100}, + {120, x3, 101, 127}, {125, x2, 128, 150}, {130, x4, 151, 178}, {135, x2, 179, 201}}, + {{140, x3, 1, 27}, {145, x2, 28, 50}, {150, x3, 51, 77}, {155, x2, 78, 100}, + {160, x3, 101, 127}, {165, x2, 128, 150}, {170, x3, 151, 177}, {175, x2, 178, 200}}}; +const sbsigpband_t igpband2[2][5] = {/* band 9-10 */ + {{60, x5, 1, 72}, {65, x6, 73, 108}, {70, x6, 109, 144}, {75, x6, 145, 180}, + {85, x7, 181, 192}}, + {{-60, x5, 1, 72}, {-65, x6, 73, 108}, {-70, x6, 109, 144}, {-75, x6, 145, 180}, + {-85, x8, 181, 192}}}; char *getfield(char *p, int pos); @@ -137,29 +135,29 @@ int decode_sbstype25(const sbsmsg_t *msg, sbssat_t *sbssat); int decode_sbstype26(const sbsmsg_t *msg, sbsion_t *sbsion); int sbsupdatecorr(const sbsmsg_t *msg, nav_t *nav); -void readmsgs(const char *file, int sel, gtime_t ts, gtime_t te,sbs_t *sbs); +void readmsgs(const char *file, int sel, gtime_t ts, gtime_t te, sbs_t *sbs); int cmpmsgs(const void *p1, const void *p2); int sbsreadmsgt(const char *file, int sel, gtime_t ts, gtime_t te, - sbs_t *sbs); + sbs_t *sbs); int sbsreadmsg(const char *file, int sel, sbs_t *sbs); void sbsoutmsg(FILE *fp, sbsmsg_t *sbsmsg); void searchigp(gtime_t time, const double *pos, const sbsion_t *ion, - const sbsigp_t **igp, double *x, double *y); + const sbsigp_t **igp, double *x, double *y); 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); void getmet(double lat, double *met); double sbstropcorr(gtime_t time, const double *pos, const double *azel, - double *var); + double *var); int sbslongcorr(gtime_t time, int sat, const sbssat_t *sbssat, - double *drs, double *ddts); + double *drs, double *ddts); int sbsfastcorr(gtime_t time, int sat, const sbssat_t *sbssat, - double *prc, double *var); + double *prc, double *var); int sbssatcorr(gtime_t time, int sat, const nav_t *nav, double *rs, - double *dts, double *var); + double *dts, double *var); int sbsdecodemsg(gtime_t time, int prn, const unsigned int *words, - sbsmsg_t *sbsmsg); + sbsmsg_t *sbsmsg); #endif /* GNSS_SDR_RTKLIB_SBAS_H_ */ diff --git a/src/algorithms/libs/rtklib/rtklib_solution.cc b/src/algorithms/libs/rtklib/rtklib_solution.cc index 78daf0817..2b679ac25 100644 --- a/src/algorithms/libs/rtklib/rtklib_solution.cc +++ b/src/algorithms/libs/rtklib/rtklib_solution.cc @@ -59,28 +59,29 @@ /* constants and macros ------------------------------------------------------*/ -#define SQR_SOL(x) ((x)<0.0?-(x)*(x):(x)*(x)) -#define SQRT_SOL(x) ((x)<0.0?0.0:sqrt(x)) +#define SQR_SOL(x) ((x) < 0.0 ? -(x) * (x) : (x) * (x)) +#define SQRT_SOL(x) ((x) < 0.0 ? 0.0 : sqrt(x)) -const int MAXFIELD = 64; /* max number of fields in a record */ -const int MAXNMEA = 256; /* max length of nmea sentence */ +const int MAXFIELD = 64; /* max number of fields in a record */ +const int MAXNMEA = 256; /* max length of nmea sentence */ -const double KNOT2M = 0.514444444; /* m/knot */ +const double KNOT2M = 0.514444444; /* m/knot */ -static const int solq_nmea[] = { /* nmea quality flags to rtklib sol quality */ - /* nmea 0183 v.2.3 quality flags: */ - /* 0=invalid, 1=gps fix (sps), 2=dgps fix, 3=pps fix, 4=rtk, 5=float rtk */ - /* 6=estimated (dead reckoning), 7=manual input, 8=simulation */ - SOLQ_NONE ,SOLQ_SINGLE, SOLQ_DGPS, SOLQ_PPP , SOLQ_FIX, - SOLQ_FLOAT,SOLQ_DR , SOLQ_NONE, SOLQ_NONE, SOLQ_NONE -}; +static const int solq_nmea[] = {/* nmea quality flags to rtklib sol quality */ + /* nmea 0183 v.2.3 quality flags: */ + /* 0=invalid, 1=gps fix (sps), 2=dgps fix, 3=pps fix, 4=rtk, 5=float rtk */ + /* 6=estimated (dead reckoning), 7=manual input, 8=simulation */ + SOLQ_NONE, SOLQ_SINGLE, SOLQ_DGPS, SOLQ_PPP, SOLQ_FIX, + SOLQ_FLOAT, SOLQ_DR, SOLQ_NONE, SOLQ_NONE, SOLQ_NONE}; /* solution option to field separator ----------------------------------------*/ const char *opt2sep(const solopt_t *opt) { - if (!*opt->sep) return " "; - else if (!strcmp(opt->sep,"\\t")) return "\t"; + if (!*opt->sep) + return " "; + else if (!strcmp(opt->sep, "\\t")) + return "\t"; return opt->sep; } @@ -88,12 +89,12 @@ const char *opt2sep(const solopt_t *opt) /* separate fields -----------------------------------------------------------*/ int tonum(char *buff, const char *sep, double *v) { - int n,len = (int)strlen(sep); - char *p,*q; + int n, len = (int)strlen(sep); + char *p, *q; - for (p = buff,n = 0;nqr[0]; /* xx or ee */ - P[4] = sol->qr[1]; /* yy or nn */ - P[8] = sol->qr[2]; /* zz or uu */ + P[0] = sol->qr[0]; /* xx or ee */ + P[4] = sol->qr[1]; /* yy or nn */ + P[8] = sol->qr[2]; /* zz or uu */ P[1] = P[3] = sol->qr[3]; /* xy or en */ P[5] = P[7] = sol->qr[4]; /* yz or nu */ P[2] = P[6] = sol->qr[5]; /* zx or ue */ @@ -152,53 +153,77 @@ void covtosol(const double *P, sol_t *sol) /* decode nmea gprmc: recommended minumum data for gps -----------------------*/ 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, lat = 0.0, lon = 0.0, vel = 0.0, dir = 0.0, date = 0.0, ang = 0.0, ep[6]; double pos[3] = {0}; - char act = ' ',ns = 'N',ew = 'E',mew = 'E',mode = 'A'; + char act = ' ', ns = 'N', ew = 'E', mew = 'E', mode = 'A'; int i; - trace(4,"decode_nmearmc: n=%d\n",n); + trace(4, "decode_nmearmc: n=%d\n", n); - for (i = 0;inmea 2) */ - /* A=autonomous,D=differential */ - /* E=estimated,N=not valid,S=simulator */ - } + { + case 0: + tod = atof(val[i]); + break; /* time in utc (hhmmss) */ + case 1: + act = *val[i]; + break; /* A=active,V=void */ + case 2: + lat = atof(val[i]); + break; /* latitude (ddmm.mmm) */ + case 3: + ns = *val[i]; + break; /* N=north,S=south */ + case 4: + lon = atof(val[i]); + break; /* longitude (dddmm.mmm) */ + case 5: + ew = *val[i]; + break; /* E=east,W=west */ + case 6: + vel = atof(val[i]); + break; /* speed (knots) */ + case 7: + dir = atof(val[i]); + break; /* track angle (deg) */ + case 8: + date = atof(val[i]); + break; /* date (ddmmyy) */ + case 9: + ang = atof(val[i]); + break; /* magnetic variation */ + case 10: + mew = *val[i]; + break; /* E=east,W=west */ + case 11: + mode = *val[i]; + break; /* mode indicator (>nmea 2) */ + /* A=autonomous,D=differential */ + /* E=estimated,N=not valid,S=simulator */ + } } if ((act != 'A' && act != 'V') || (ns != 'N' && ns != 'S') || (ew != 'E' && ew != 'W')) { - trace(2,"invalid nmea gprmc format\n"); + trace(2, "invalid nmea gprmc format\n"); return 0; } - pos[0] = (ns == 'S'?-1.0:1.0)*dmm2deg(lat)*D2R; - pos[1] = (ew == 'W'?-1.0:1.0)*dmm2deg(lon)*D2R; - septime(date,ep+2,ep+1,ep); - septime(tod,ep+3,ep+4,ep+5); - ep[0] += ep[0]<80.0?2000.0:1900.0; + pos[0] = (ns == 'S' ? -1.0 : 1.0) * dmm2deg(lat) * D2R; + pos[1] = (ew == 'W' ? -1.0 : 1.0) * dmm2deg(lon) * D2R; + septime(date, ep + 2, ep + 1, ep); + septime(tod, ep + 3, ep + 4, ep + 5); + ep[0] += ep[0] < 80.0 ? 2000.0 : 1900.0; sol->time = utc2gpst(epoch2time(ep)); - pos2ecef(pos,sol->rr); - sol->stat = mode == 'D'?SOLQ_DGPS:SOLQ_SINGLE; + pos2ecef(pos, sol->rr); + sol->stat = mode == 'D' ? SOLQ_DGPS : SOLQ_SINGLE; sol->ns = 0; sol->type = 0; /* postion type = xyz */ - trace(5,"decode_nmearmc: %s rr=%.3f %.3f %.3f stat=%d ns=%d vel=%.2f dir=%.0f ang=%.0f mew=%c mode=%c\n", - time_str(sol->time,0),sol->rr[0],sol->rr[1],sol->rr[2],sol->stat,sol->ns, - vel,dir,ang,mew,mode); + trace(5, "decode_nmearmc: %s rr=%.3f %.3f %.3f stat=%d ns=%d vel=%.2f dir=%.0f ang=%.0f mew=%c mode=%c\n", + time_str(sol->time, 0), sol->rr[0], sol->rr[1], sol->rr[2], sol->stat, sol->ns, + vel, dir, ang, mew, mode); return 1; } @@ -208,61 +233,88 @@ int decode_nmearmc(char **val, int n, sol_t *sol) int decode_nmeagga(char **val, int n, sol_t *sol) { 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, lat = 0.0, lon = 0.0, hdop = 0.0, alt = 0.0, msl = 0.0, ep[6], tt; double pos[3] = {0}; - char ns = 'N',ew = 'E',ua = ' ',um = ' '; - int i,solq = 0,nrcv = 0; + char ns = 'N', ew = 'E', ua = ' ', um = ' '; + int i, solq = 0, nrcv = 0; - trace(4,"decode_nmeagga: n=%d\n",n); + trace(4, "decode_nmeagga: n=%d\n", n); - for (i = 0;itime.time == 0.0) { - trace(2,"no date info for nmea gpgga\n"); + trace(2, "no date info for nmea gpgga\n"); return 0; } - pos[0] = (ns == 'N'?1.0:-1.0)*dmm2deg(lat)*D2R; - pos[1] = (ew == 'E'?1.0:-1.0)*dmm2deg(lon)*D2R; - pos[2] = alt+msl; + pos[0] = (ns == 'N' ? 1.0 : -1.0) * dmm2deg(lat) * D2R; + pos[1] = (ew == 'E' ? 1.0 : -1.0) * dmm2deg(lon) * D2R; + pos[2] = alt + msl; - time2epoch(sol->time,ep); - septime(tod,ep+3,ep+4,ep+5); + time2epoch(sol->time, ep); + septime(tod, ep + 3, ep + 4, ep + 5); time = utc2gpst(epoch2time(ep)); - tt = timediff(time,sol->time); - if (tt<-43200.0) sol->time = timeadd(time, 86400.0); - else if (tt> 43200.0) sol->time = timeadd(time,-86400.0); - else sol->time = time; - pos2ecef(pos,sol->rr); - sol->stat = 0 <= solq && solq <= 8?solq_nmea[solq]:SOLQ_NONE; + tt = timediff(time, sol->time); + if (tt < -43200.0) + sol->time = timeadd(time, 86400.0); + else if (tt > 43200.0) + sol->time = timeadd(time, -86400.0); + else + sol->time = time; + pos2ecef(pos, sol->rr); + sol->stat = 0 <= solq && solq <= 8 ? solq_nmea[solq] : SOLQ_NONE; sol->ns = nrcv; sol->type = 0; /* postion type = xyz */ - trace(5,"decode_nmeagga: %s rr=%.3f %.3f %.3f stat=%d ns=%d hdop=%.1f ua=%c um=%c\n", - time_str(sol->time,0),sol->rr[0],sol->rr[1],sol->rr[2],sol->stat,sol->ns, - hdop,ua,um); + trace(5, "decode_nmeagga: %s rr=%.3f %.3f %.3f stat=%d ns=%d hdop=%.1f ua=%c um=%c\n", + time_str(sol->time, 0), sol->rr[0], sol->rr[1], sol->rr[2], sol->stat, sol->ns, + hdop, ua, um); return 1; } @@ -274,25 +326,27 @@ int decode_nmea(char *buff, sol_t *sol) char *p, *q, *val[MAXFIELD] = {0}; int n = 0; - trace(4,"decode_nmea: buff=%s\n",buff); + trace(4, "decode_nmea: buff=%s\n", buff); /* parse fields */ - for (p = buff;*p && nsep,"\\t")) strcpy(s,"\t"); - else if (*opt->sep) strcpy(s,opt->sep); + if (!strcmp(opt->sep, "\\t")) + strcpy(s, "\t"); + else if (*opt->sep) + strcpy(s, opt->sep); len = (int)strlen(s); /* yyyy/mm/dd hh:mm:ss or yyyy mm dd hh:mm:ss */ - if (sscanf(buff,"%lf/%lf/%lf %lf:%lf:%lf",v,v+1,v+2,v+3,v+4,v+5) >= 6) + if (sscanf(buff, "%lf/%lf/%lf %lf:%lf:%lf", v, v + 1, v + 2, v + 3, v + 4, v + 5) >= 6) { - if (v[0]<100.0) + if (v[0] < 100.0) { - v[0] += v[0]<80.0?2000.0:1900.0; + v[0] += v[0] < 80.0 ? 2000.0 : 1900.0; } *time = epoch2time(v); if (opt->times == TIMES_UTC) @@ -325,33 +381,33 @@ char *decode_soltime(char *buff, const solopt_t *opt, gtime_t *time) } else if (opt->times == TIMES_JST) { - *time = utc2gpst(timeadd(*time,-9*3600.0)); + *time = utc2gpst(timeadd(*time, -9 * 3600.0)); } - if (!(p = strchr(buff,':')) || !(p = strchr(p+1,':'))) return NULL; - for (p++;isdigit((int)*p) || *p == '.';) p++; - return p+len; + if (!(p = strchr(buff, ':')) || !(p = strchr(p + 1, ':'))) return NULL; + for (p++; isdigit((int)*p) || *p == '.';) p++; + return p + len; } if (opt->posf == SOLF_GSIF) { - if (sscanf(buff,"%lf %lf %lf %lf:%lf:%lf",v,v+1,v+2,v+3,v+4,v+5)<6) + if (sscanf(buff, "%lf %lf %lf %lf:%lf:%lf", v, v + 1, v + 2, v + 3, v + 4, v + 5) < 6) { return NULL; } - *time = timeadd(epoch2time(v),-12.0*3600.0); - if (!(p = strchr(buff,':')) || !(p = strchr(p+1,':'))) return NULL; - for (p++;isdigit((int)*p) || *p == '.';) p++; - return p+len; + *time = timeadd(epoch2time(v), -12.0 * 3600.0); + if (!(p = strchr(buff, ':')) || !(p = strchr(p + 1, ':'))) return NULL; + for (p++; isdigit((int)*p) || *p == '.';) p++; + return p + len; } /* wwww ssss */ - for (p = buff,n = 0;n<2;p = q+len) + for (p = buff, n = 0; n < 2; p = q + len) { - if ((q = strstr(p,s))) *q = '\0'; + if ((q = strstr(p, s))) *q = '\0'; if (*p) v[n++] = atof(p); if (!q) break; } - if (n >= 2 && 0.0 <= v[0] && v[0] <= 3000.0 && 0.0 <= v[1] && v[1]<604800.0) + if (n >= 2 && 0.0 <= v[0] && v[0] <= 3000.0 && 0.0 <= v[1] && v[1] < 604800.0) { - *time = gpst2time((int)v[0],v[1]); + *time = gpst2time((int)v[0], v[1]); return p; } return NULL; @@ -361,39 +417,45 @@ char *decode_soltime(char *buff, const solopt_t *opt, gtime_t *time) /* decode x/y/z-ecef ---------------------------------------------------------*/ int decode_solxyz(char *buff, const solopt_t *opt, sol_t *sol) { - double val[MAXFIELD],P[9] = {0}; - int i = 0,j,n; + double val[MAXFIELD], P[9] = {0}; + int i = 0, j, n; const char *sep = opt2sep(opt); - trace(4,"decode_solxyz:\n"); + trace(4, "decode_solxyz:\n"); - if ((n = tonum(buff,sep,val))<3) return 0; + if ((n = tonum(buff, sep, val)) < 3) return 0; - for (j = 0;j<3;j++) + for (j = 0; j < 3; j++) { sol->rr[j] = val[i++]; /* xyz */ } - if (istat = (unsigned char)val[i++]; - if (ins = (unsigned char)val[i++]; - if (i+3stat = (unsigned char)val[i++]; + if (i < n) sol->ns = (unsigned char)val[i++]; + if (i + 3 < n) { - P[0] = val[i]*val[i]; i++; /* sdx */ - P[4] = val[i]*val[i]; i++; /* sdy */ - P[8] = val[i]*val[i]; i++; /* sdz */ - if (i+3age = (float)val[i++]; - if (iratio = (float)val[i]; + if (i < n) sol->age = (float)val[i++]; + if (i < n) sol->ratio = (float)val[i]; sol->type = 0; /* postion type = xyz */ - if (MAXSOLQstat) sol->stat = SOLQ_NONE; + if (MAXSOLQ < sol->stat) sol->stat = SOLQ_NONE; return 1; } @@ -401,52 +463,58 @@ int decode_solxyz(char *buff, const solopt_t *opt, sol_t *sol) /* decode lat/lon/height -----------------------------------------------------*/ int decode_solllh(char *buff, const solopt_t *opt, sol_t *sol) { - double val[MAXFIELD],pos[3],Q[9] = {0},P[9]; - int i = 0,n; + double val[MAXFIELD], pos[3], Q[9] = {0}, P[9]; + int i = 0, n; const char *sep = opt2sep(opt); - trace(4,"decode_solllh:\n"); + trace(4, "decode_solllh:\n"); - n = tonum(buff,sep,val); + n = tonum(buff, sep, val); if (!opt->degf) { - if (n<3) return 0; - pos[0] = val[i++]*D2R; /* lat/lon/hgt (ddd.ddd) */ - pos[1] = val[i++]*D2R; + if (n < 3) return 0; + pos[0] = val[i++] * D2R; /* lat/lon/hgt (ddd.ddd) */ + pos[1] = val[i++] * D2R; pos[2] = val[i++]; } else { - if (n<7) return 0; - pos[0] = dms2deg(val )*D2R; /* lat/lon/hgt (ddd mm ss) */ - pos[1] = dms2deg(val+3)*D2R; + if (n < 7) return 0; + pos[0] = dms2deg(val) * D2R; /* lat/lon/hgt (ddd mm ss) */ + pos[1] = dms2deg(val + 3) * D2R; pos[2] = val[6]; - i += 7; + i += 7; } - pos2ecef(pos,sol->rr); - if (istat = (unsigned char)val[i++]; - if (ins = (unsigned char)val[i++]; - if (i+3rr); + if (i < n) sol->stat = (unsigned char)val[i++]; + if (i < n) sol->ns = (unsigned char)val[i++]; + if (i + 3 < n) { - Q[4] = val[i]*val[i]; i++; /* sdn */ - Q[0] = val[i]*val[i]; i++; /* sde */ - Q[8] = val[i]*val[i]; i++; /* sdu */ - if (i+3age = (float)val[i++]; - if (iratio = (float)val[i]; + if (i < n) sol->age = (float)val[i++]; + if (i < n) sol->ratio = (float)val[i]; sol->type = 0; /* postion type = xyz */ - if (MAXSOLQstat) sol->stat = SOLQ_NONE; + if (MAXSOLQ < sol->stat) sol->stat = SOLQ_NONE; return 1; } @@ -454,39 +522,45 @@ int decode_solllh(char *buff, const solopt_t *opt, sol_t *sol) /* decode e/n/u-baseline -----------------------------------------------------*/ int decode_solenu(char *buff, const solopt_t *opt, sol_t *sol) { - double val[MAXFIELD],Q[9] = {0}; - int i = 0,j,n; + double val[MAXFIELD], Q[9] = {0}; + int i = 0, j, n; const char *sep = opt2sep(opt); - trace(4,"decode_solenu:\n"); + trace(4, "decode_solenu:\n"); - if ((n = tonum(buff,sep,val))<3) return 0; + if ((n = tonum(buff, sep, val)) < 3) return 0; - for (j = 0;j<3;j++) + for (j = 0; j < 3; j++) { sol->rr[j] = val[i++]; /* enu */ } - if (istat = (unsigned char)val[i++]; - if (ins = (unsigned char)val[i++]; - if (i+3stat = (unsigned char)val[i++]; + if (i < n) sol->ns = (unsigned char)val[i++]; + if (i + 3 < n) { - Q[0] = val[i]*val[i]; i++; /* sde */ - Q[4] = val[i]*val[i]; i++; /* sdn */ - Q[8] = val[i]*val[i]; i++; /* sdu */ - if (i+3age = (float)val[i++]; - if (iratio = (float)val[i]; + if (i < n) sol->age = (float)val[i++]; + if (i < n) sol->ratio = (float)val[i]; sol->type = 1; /* postion type = enu */ - if (MAXSOLQstat) sol->stat = SOLQ_NONE; + if (MAXSOLQ < sol->stat) sol->stat = SOLQ_NONE; return 1; } @@ -495,13 +569,13 @@ 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) { double val[MAXFIELD]; - int i = 0,j; + int i = 0, j; - trace(4,"decode_solgsi:\n"); + trace(4, "decode_solgsi:\n"); - if (tonum(buff," ",val)<3) return 0; + if (tonum(buff, " ", val) < 3) return 0; - for (j = 0;j<3;j++) + for (j = 0; j < 3; j++) { sol->rr[j] = val[i++]; /* xyz */ } @@ -513,26 +587,30 @@ int decode_solgsi(char *buff, const solopt_t *opt __attribute((unused)), sol_t * /* decode solution position --------------------------------------------------*/ int decode_solpos(char *buff, const solopt_t *opt, sol_t *sol) { - sol_t sol0 = {{0,0}, {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 sol0 = {{0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, '0', '0', '0', 0, 0, 0}; char *p = buff; - trace(4,"decode_solpos: buff=%s\n",buff); + trace(4, "decode_solpos: buff=%s\n", buff); *sol = sol0; /* decode solution time */ - if (!(p = decode_soltime(p,opt,&sol->time))) + if (!(p = decode_soltime(p, opt, &sol->time))) { return 0; } /* decode solution position */ switch (opt->posf) - { - case SOLF_XYZ : return decode_solxyz(p,opt,sol); - case SOLF_LLH : return decode_solllh(p,opt,sol); - case SOLF_ENU : return decode_solenu(p,opt,sol); - case SOLF_GSIF: return decode_solgsi(p,opt,sol); - } + { + case SOLF_XYZ: + return decode_solxyz(p, opt, sol); + case SOLF_LLH: + return decode_solllh(p, opt, sol); + case SOLF_ENU: + return decode_solenu(p, opt, sol); + case SOLF_GSIF: + return decode_solgsi(p, opt, sol); + } return 0; } @@ -540,31 +618,31 @@ int decode_solpos(char *buff, const solopt_t *opt, sol_t *sol) /* decode reference position -------------------------------------------------*/ void decode_refpos(char *buff, const solopt_t *opt, double *rb) { - double val[MAXFIELD],pos[3]; - int i,n; + double val[MAXFIELD], pos[3]; + int i, n; const char *sep = opt2sep(opt); - trace(3,"decode_refpos: buff=%s\n",buff); + trace(3, "decode_refpos: buff=%s\n", buff); - if ((n = tonum(buff,sep,val))<3) return; + if ((n = tonum(buff, sep, val)) < 3) return; if (opt->posf == SOLF_XYZ) { /* xyz */ - for (i = 0;i<3;i++) rb[i] = val[i]; + for (i = 0; i < 3; i++) rb[i] = val[i]; } else if (opt->degf == 0) { /* lat/lon/hgt (ddd.ddd) */ - pos[0] = val[0]*D2R; - pos[1] = val[1]*D2R; + pos[0] = val[0] * D2R; + pos[1] = val[1] * D2R; pos[2] = val[2]; - pos2ecef(pos,rb); + pos2ecef(pos, rb); } else if (opt->degf == 1 && n >= 7) { /* lat/lon/hgt (ddd mm ss) */ - pos[0] = dms2deg(val )*D2R; - pos[1] = dms2deg(val+3)*D2R; + pos[0] = dms2deg(val) * D2R; + pos[1] = dms2deg(val + 3) * D2R; pos[2] = val[6]; - pos2ecef(pos,rb); + pos2ecef(pos, rb); } } @@ -574,25 +652,25 @@ int decode_sol(char *buff, const solopt_t *opt, sol_t *sol, double *rb) { char *p; - trace(4,"decode_sol: buff=%s\n",buff); + trace(4, "decode_sol: buff=%s\n", buff); - if (!strncmp(buff,COMMENTH,1)) + if (!strncmp(buff, COMMENTH, 1)) { /* reference position */ - if (!strstr(buff,"ref pos") && !strstr(buff,"slave pos")) return 0; - if (!(p = strchr(buff,':'))) return 0; - decode_refpos(p+1,opt,rb); + if (!strstr(buff, "ref pos") && !strstr(buff, "slave pos")) return 0; + if (!(p = strchr(buff, ':'))) return 0; + decode_refpos(p + 1, opt, rb); return 0; } - if (!strncmp(buff,"$GP",3)) + if (!strncmp(buff, "$GP", 3)) { /* decode nmea */ - if (!decode_nmea(buff,sol)) return 0; + if (!decode_nmea(buff, sol)) return 0; /* for time update only */ - if (opt->posf != SOLF_NMEA && !strncmp(buff,"$GPRMC",6)) return 2; + if (opt->posf != SOLF_NMEA && !strncmp(buff, "$GPRMC", 6)) return 2; } else { /* decode position record */ - if (!decode_solpos(buff,opt,sol)) return 0; + if (!decode_solpos(buff, opt, sol)) return 0; } return 1; } @@ -603,48 +681,51 @@ void decode_solopt(char *buff, solopt_t *opt) { char *p; - trace(4,"decode_solhead: buff=%s\n",buff); + trace(4, "decode_solhead: buff=%s\n", buff); - if (strncmp(buff,COMMENTH,1) && strncmp(buff,"+",1)) return; + if (strncmp(buff, COMMENTH, 1) && strncmp(buff, "+", 1)) return; - if (strstr(buff,"GPST")) opt->times = TIMES_GPST; - else if (strstr(buff,"UTC" )) opt->times = TIMES_UTC; - else if (strstr(buff,"JST" )) opt->times = TIMES_JST; + if (strstr(buff, "GPST")) + opt->times = TIMES_GPST; + else if (strstr(buff, "UTC")) + opt->times = TIMES_UTC; + else if (strstr(buff, "JST")) + opt->times = TIMES_JST; - if ((p = strstr(buff,"x-ecef(m)"))) + if ((p = strstr(buff, "x-ecef(m)"))) { opt->posf = SOLF_XYZ; opt->degf = 0; - strncpy(opt->sep,p+9,1); + strncpy(opt->sep, p + 9, 1); opt->sep[1] = '\0'; } - else if ((p = strstr(buff,"latitude(d'\")"))) + else if ((p = strstr(buff, "latitude(d'\")"))) { opt->posf = SOLF_LLH; opt->degf = 1; - strncpy(opt->sep,p+14,1); + strncpy(opt->sep, p + 14, 1); opt->sep[1] = '\0'; } - else if ((p = strstr(buff,"latitude(deg)"))) + else if ((p = strstr(buff, "latitude(deg)"))) { opt->posf = SOLF_LLH; opt->degf = 0; - strncpy(opt->sep,p+13,1); + strncpy(opt->sep, p + 13, 1); opt->sep[1] = '\0'; } - else if ((p = strstr(buff,"e-baseline(m)"))) + else if ((p = strstr(buff, "e-baseline(m)"))) { opt->posf = SOLF_ENU; opt->degf = 0; - strncpy(opt->sep,p+13,1); + strncpy(opt->sep, p + 13, 1); opt->sep[1] = '\0'; } - else if ((p = strstr(buff,"+SITE/INF"))) + else if ((p = strstr(buff, "+SITE/INF"))) { /* gsi f2/f3 solution */ opt->times = TIMES_GPST; opt->posf = SOLF_GSIF; opt->degf = 0; - strcpy(opt->sep," "); + strcpy(opt->sep, " "); } } @@ -652,15 +733,15 @@ void decode_solopt(char *buff, solopt_t *opt) /* read solution option ------------------------------------------------------*/ void readsolopt(FILE *fp, solopt_t *opt) { - char buff[MAXSOLMSG+1]; + char buff[MAXSOLMSG + 1]; int i; - trace(3,"readsolopt:\n"); + trace(3, "readsolopt:\n"); - for (i = 0;fgets(buff,sizeof(buff),fp) && i<100;i++) + for (i = 0; fgets(buff, sizeof(buff), fp) && i < 100; i++) { /* only 100 lines */ /* decode solution options */ - decode_solopt(buff,opt); + decode_solopt(buff, opt); } } @@ -676,12 +757,12 @@ void readsolopt(FILE *fp, solopt_t *opt) * return : status (1:solution received,0:no solution,-1:disconnect received) *-----------------------------------------------------------------------------*/ int inputsol(unsigned char data, gtime_t ts, gtime_t te, double tint, - int qflag, const solopt_t *opt, solbuf_t *solbuf) + int qflag, const solopt_t *opt, solbuf_t *solbuf) { - 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}; int stat; - trace(4,"inputsol: data=0x%02x\n",data); + trace(4, "inputsol: data=0x%02x\n", data); sol.time = solbuf->time; @@ -690,54 +771,54 @@ int inputsol(unsigned char data, gtime_t ts, gtime_t te, double tint, solbuf->nb = 0; } solbuf->buff[solbuf->nb++] = data; - if (data != '\n' && solbuf->nbnb < MAXSOLMSG) return 0; /* sync trailer */ solbuf->buff[solbuf->nb] = '\0'; solbuf->nb = 0; /* check disconnect message */ - if (!strcmp((char *)solbuf->buff,MSG_DISCONN)) + if (!strcmp((char *)solbuf->buff, MSG_DISCONN)) { - trace(3,"disconnect received\n"); + trace(3, "disconnect received\n"); return -1; } /* decode solution */ - if ((stat = decode_sol((char *)solbuf->buff,opt,&sol,solbuf->rb))>0) + if ((stat = decode_sol((char *)solbuf->buff, opt, &sol, solbuf->rb)) > 0) { solbuf->time = sol.time; /* update current time */ } - if (stat != 1 || !screent(sol.time,ts,te,tint) || (qflag && sol.stat != qflag)) + if (stat != 1 || !screent(sol.time, ts, te, tint) || (qflag && sol.stat != qflag)) { return 0; } /* add solution to solution buffer */ - return addsol(solbuf,&sol); + return addsol(solbuf, &sol); } /* read solution data --------------------------------------------------------*/ int readsoldata(FILE *fp, gtime_t ts, gtime_t te, double tint, int qflag, - const solopt_t *opt, solbuf_t *solbuf) + const solopt_t *opt, solbuf_t *solbuf) { int c; - trace(3,"readsoldata:\n"); + trace(3, "readsoldata:\n"); while ((c = fgetc(fp)) != EOF) { /* input solution */ - inputsol((unsigned char)c,ts,te,tint,qflag,opt,solbuf); + inputsol((unsigned char)c, ts, te, tint, qflag, opt, solbuf); } - return solbuf->n>0; + return solbuf->n > 0; } /* compare solution data -----------------------------------------------------*/ int cmpsol(const void *p1, const void *p2) { - sol_t *q1 = (sol_t *)p1,*q2 = (sol_t *)p2; - double tt = timediff(q1->time,q2->time); - return tt<-0.0?-1:(tt>0.0?1:0); + sol_t *q1 = (sol_t *)p1, *q2 = (sol_t *)p2; + double tt = timediff(q1->time, q2->time); + return tt < -0.0 ? -1 : (tt > 0.0 ? 1 : 0); } @@ -746,21 +827,23 @@ int sort_solbuf(solbuf_t *solbuf) { sol_t *solbuf_data; - trace(4,"sort_solbuf: n=%d\n",solbuf->n); + trace(4, "sort_solbuf: n=%d\n", solbuf->n); if (solbuf->n <= 0) return 0; - if (!(solbuf_data = (sol_t *)realloc(solbuf->data,sizeof(sol_t)*solbuf->n))) + if (!(solbuf_data = (sol_t *)realloc(solbuf->data, sizeof(sol_t) * solbuf->n))) { - trace(1,"sort_solbuf: memory allocation error\n"); - free(solbuf->data); solbuf->data = NULL; solbuf->n = solbuf->nmax = 0; + trace(1, "sort_solbuf: memory allocation error\n"); + free(solbuf->data); + solbuf->data = NULL; + solbuf->n = solbuf->nmax = 0; return 0; } solbuf->data = solbuf_data; - qsort(solbuf->data,solbuf->n,sizeof(sol_t),cmpsol); + qsort(solbuf->data, solbuf->n, sizeof(sol_t), cmpsol); solbuf->nmax = solbuf->n; solbuf->start = 0; - solbuf->end = solbuf->n-1; + solbuf->end = solbuf->n - 1; return 1; } @@ -777,31 +860,31 @@ int sort_solbuf(solbuf_t *solbuf) * return : status (1:ok,0:no data or error) *-----------------------------------------------------------------------------*/ int readsolt(char *files[], int nfile, gtime_t ts, gtime_t te, - double tint, int qflag, solbuf_t *solbuf) + double tint, int qflag, solbuf_t *solbuf) { FILE *fp; solopt_t opt = solopt_default; int i; - trace(3,"readsolt: nfile=%d\n",nfile); + trace(3, "readsolt: nfile=%d\n", nfile); - initsolbuf(solbuf,0,0); + initsolbuf(solbuf, 0, 0); - for (i = 0;icyclic) { /* ring buffer */ @@ -840,18 +923,21 @@ int addsol(solbuf_t *solbuf, const sol_t *sol) { if (++solbuf->start >= solbuf->nmax) solbuf->start = 0; } - else solbuf->n++; + else + solbuf->n++; return 1; } if (solbuf->n >= solbuf->nmax) { - solbuf->nmax = solbuf->nmax == 0?8192:solbuf->nmax*2; - if (!(solbuf_data = (sol_t *)realloc(solbuf->data,sizeof(sol_t)*solbuf->nmax))) + solbuf->nmax = solbuf->nmax == 0 ? 8192 : solbuf->nmax * 2; + if (!(solbuf_data = (sol_t *)realloc(solbuf->data, sizeof(sol_t) * solbuf->nmax))) { - trace(1,"addsol: memory allocation error\n"); - free(solbuf->data); solbuf->data = NULL; solbuf->n = solbuf->nmax = 0; + trace(1, "addsol: memory allocation error\n"); + free(solbuf->data); + solbuf->data = NULL; + solbuf->n = solbuf->nmax = 0; return 0; } solbuf->data = solbuf_data; @@ -869,14 +955,14 @@ int addsol(solbuf_t *solbuf, const sol_t *sol) *-----------------------------------------------------------------------------*/ sol_t *getsol(solbuf_t *solbuf, int index) { - trace(4,"getsol: index=%d\n",index); + trace(4, "getsol: index=%d\n", index); - if (index<0 || solbuf->n <= index) return NULL; - if ((index = solbuf->start+index) >= solbuf->nmax) + if (index < 0 || solbuf->n <= index) return NULL; + if ((index = solbuf->start + index) >= solbuf->nmax) { index -= solbuf->nmax; } - return solbuf->data+index; + return solbuf->data + index; } @@ -891,7 +977,7 @@ void initsolbuf(solbuf_t *solbuf, int cyclic, int nmax) { gtime_t time0 = {0, 0.0}; - trace(3,"initsolbuf: cyclic=%d nmax=%d\n",cyclic,nmax); + trace(3, "initsolbuf: cyclic=%d nmax=%d\n", cyclic, nmax); solbuf->n = solbuf->nmax = solbuf->start = solbuf->end = 0; solbuf->cyclic = cyclic; @@ -899,10 +985,10 @@ void initsolbuf(solbuf_t *solbuf, int cyclic, int nmax) solbuf->data = NULL; if (cyclic) { - if (nmax <= 2) nmax=2; - if (!(solbuf->data = (sol_t*)malloc(sizeof(sol_t)*nmax))) + if (nmax <= 2) nmax = 2; + if (!(solbuf->data = (sol_t *)malloc(sizeof(sol_t) * nmax))) { - trace(1,"initsolbuf: memory allocation error\n"); + trace(1, "initsolbuf: memory allocation error\n"); return; } solbuf->nmax = nmax; @@ -917,7 +1003,7 @@ void initsolbuf(solbuf_t *solbuf, int cyclic, int nmax) *-----------------------------------------------------------------------------*/ void freesolbuf(solbuf_t *solbuf) { - trace(3,"freesolbuf: n=%d\n",solbuf->n); + trace(3, "freesolbuf: n=%d\n", solbuf->n); free(solbuf->data); solbuf->n = solbuf->nmax = solbuf->start = solbuf->end = 0; @@ -927,7 +1013,7 @@ void freesolbuf(solbuf_t *solbuf) void freesolstatbuf(solstatbuf_t *solstatbuf) { - trace(3,"freesolstatbuf: n=%d\n",solstatbuf->n); + trace(3, "freesolstatbuf: n=%d\n", solstatbuf->n); solstatbuf->n = solstatbuf->nmax = 0; free(solstatbuf->data); @@ -938,9 +1024,9 @@ void freesolstatbuf(solstatbuf_t *solstatbuf) /* compare solution status ---------------------------------------------------*/ int cmpsolstat(const void *p1, const void *p2) { - solstat_t *q1 = (solstat_t *)p1,*q2 = (solstat_t *)p2; - double tt = timediff(q1->time,q2->time); - return tt<-0.0?-1:(tt>0.0?1:0); + solstat_t *q1 = (solstat_t *)p1, *q2 = (solstat_t *)p2; + double tt = timediff(q1->time, q2->time); + return tt < -0.0 ? -1 : (tt > 0.0 ? 1 : 0); } @@ -949,18 +1035,20 @@ int sort_solstat(solstatbuf_t *statbuf) { solstat_t *statbuf_data; - trace(4,"sort_solstat: n=%d\n",statbuf->n); + trace(4, "sort_solstat: n=%d\n", statbuf->n); if (statbuf->n <= 0) return 0; - if (!(statbuf_data = (solstat_t*)realloc(statbuf->data,sizeof(solstat_t)*statbuf->n))) + if (!(statbuf_data = (solstat_t *)realloc(statbuf->data, sizeof(solstat_t) * statbuf->n))) { - trace(1,"sort_solstat: memory allocation error\n"); - free(statbuf->data); statbuf->data = NULL; statbuf->n = statbuf->nmax = 0; + trace(1, "sort_solstat: memory allocation error\n"); + free(statbuf->data); + statbuf->data = NULL; + statbuf->n = statbuf->nmax = 0; return 0; } statbuf->data = statbuf_data; - qsort(statbuf->data,statbuf->n,sizeof(solstat_t),cmpsolstat); + qsort(statbuf->data, statbuf->n, sizeof(solstat_t), cmpsolstat); statbuf->nmax = statbuf->n; return 1; } @@ -970,44 +1058,45 @@ int sort_solstat(solstatbuf_t *statbuf) 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}; - double tow,az,el,resp,resc; - int n,week,sat,frq,vsat,snr,fix,slip,lock,outc,slipc,rejc; - char id[32] = "",*p; + double tow, az, el, resp, resc; + int n, week, sat, frq, vsat, snr, fix, slip, lock, outc, slipc, rejc; + char id[32] = "", *p; - trace(4,"decode_solstat: buff=%s\n",buff); + trace(4, "decode_solstat: buff=%s\n", buff); - if (strstr(buff,"$SAT") != buff) return 0; + if (strstr(buff, "$SAT") != buff) return 0; - for (p = buff;*p;p++) if (*p == ',') *p = ' '; + for (p = buff; *p; p++) + if (*p == ',') *p = ' '; - n = sscanf(buff,"$SAT%d%lf%s%d%lf%lf%lf%lf%d%d%d%d%d%d%d%d", - &week,&tow,id,&frq,&az,&el,&resp,&resc,&vsat,&snr,&fix,&slip, - &lock,&outc,&slipc,&rejc); + n = sscanf(buff, "$SAT%d%lf%s%d%lf%lf%lf%lf%d%d%d%d%d%d%d%d", + &week, &tow, id, &frq, &az, &el, &resp, &resc, &vsat, &snr, &fix, &slip, + &lock, &outc, &slipc, &rejc); - if (n<15) + if (n < 15) { - trace(2,"invalid format of solution status: %s\n",buff); + trace(2, "invalid format of solution status: %s\n", buff); return 0; } if ((sat = satid2no(id)) <= 0) { - trace(2,"invalid satellite in solution status: %s\n",id); + trace(2, "invalid satellite in solution status: %s\n", id); return 0; } *stat = stat0; - stat->time = gpst2time(week,tow); - stat->sat = (unsigned char)sat; - stat->frq = (unsigned char)frq; - stat->az = (float)(az*D2R); - stat->el = (float)(el*D2R); - stat->resp = (float)resp; - stat->resc = (float)resc; - stat->flag = (unsigned char)((vsat<<5)+(slip<<3)+fix); - stat->snr = (unsigned char)(snr*4.0+0.5); - stat->lock = (unsigned short)lock; - stat->outc = (unsigned short)outc; + stat->time = gpst2time(week, tow); + stat->sat = (unsigned char)sat; + stat->frq = (unsigned char)frq; + stat->az = (float)(az * D2R); + stat->el = (float)(el * D2R); + stat->resp = (float)resp; + stat->resc = (float)resc; + stat->flag = (unsigned char)((vsat << 5) + (slip << 3) + fix); + stat->snr = (unsigned char)(snr * 4.0 + 0.5); + stat->lock = (unsigned short)lock; + stat->outc = (unsigned short)outc; stat->slipc = (unsigned short)slipc; - stat->rejc = (unsigned short)rejc; + stat->rejc = (unsigned short)rejc; return 1; } @@ -1017,16 +1106,18 @@ void addsolstat(solstatbuf_t *statbuf, const solstat_t *stat) { solstat_t *statbuf_data; - trace(4,"addsolstat:\n"); + trace(4, "addsolstat:\n"); if (statbuf->n >= statbuf->nmax) { - statbuf->nmax = statbuf->nmax == 0?8192:statbuf->nmax*2; - if (!(statbuf_data = (solstat_t *)realloc(statbuf->data,sizeof(solstat_t)* - statbuf->nmax))) + statbuf->nmax = statbuf->nmax == 0 ? 8192 : statbuf->nmax * 2; + if (!(statbuf_data = (solstat_t *)realloc(statbuf->data, sizeof(solstat_t) * + statbuf->nmax))) { - trace(1,"addsolstat: memory allocation error\n"); - free(statbuf->data); statbuf->data = NULL; statbuf->n = statbuf->nmax = 0; + trace(1, "addsolstat: memory allocation error\n"); + free(statbuf->data); + statbuf->data = NULL; + statbuf->n = statbuf->nmax = 0; return; } statbuf->data = statbuf_data; @@ -1037,25 +1128,25 @@ void addsolstat(solstatbuf_t *statbuf, const solstat_t *stat) /* read solution status data -------------------------------------------------*/ int readsolstatdata(FILE *fp, gtime_t ts, gtime_t te, double tint, - solstatbuf_t *statbuf) + solstatbuf_t *statbuf) { solstat_t stat = {{0, 0.0}, '0', '0', 0, 0, 0, 0, '0', '0', 0, 0, 0, 0}; - char buff[MAXSOLMSG+1]; + char buff[MAXSOLMSG + 1]; - trace(3,"readsolstatdata:\n"); + trace(3, "readsolstatdata:\n"); - while (fgets(buff,sizeof(buff),fp)) + while (fgets(buff, sizeof(buff), fp)) { /* decode solution status */ - if (!decode_solstat(buff,&stat)) continue; + if (!decode_solstat(buff, &stat)) continue; /* add solution to solution buffer */ - if (screent(stat.time,ts,te,tint)) + if (screent(stat.time, ts, te, tint)) { - addsolstat(statbuf,&stat); + addsolstat(statbuf, &stat); } } - return statbuf->n>0; + return statbuf->n > 0; } @@ -1070,29 +1161,29 @@ int readsolstatdata(FILE *fp, gtime_t ts, gtime_t te, double tint, * return : status (1:ok,0:no data or error) *-----------------------------------------------------------------------------*/ int readsolstatt(char *files[], int nfile, gtime_t ts, gtime_t te, - double tint, solstatbuf_t *statbuf) + double tint, solstatbuf_t *statbuf) { FILE *fp; char path[1024]; int i; - trace(3,"readsolstatt: nfile=%d\n",nfile); + trace(3, "readsolstatt: nfile=%d\n", nfile); statbuf->n = statbuf->nmax = 0; statbuf->data = NULL; - for (i = 0;irr[0],sep,sol->rr[1],sep,sol->rr[2],sep,sol->stat,sep, - sol->ns,sep,SQRT_SOL(sol->qr[0]),sep,SQRT_SOL(sol->qr[1]),sep,SQRT_SOL(sol->qr[2]), - sep,sqvar(sol->qr[3]),sep,sqvar(sol->qr[4]),sep,sqvar(sol->qr[5]), - sep,sol->age,sep,sol->ratio); - return p-(char *)buff; + p += snprintf(p, 255, "%s%s%14.4f%s%14.4f%s%14.4f%s%3d%s%3d%s%8.4f%s%8.4f%s%8.4f%s%8.4f%s%8.4f%s%8.4f%s%6.2f%s%6.1f\n", + s, sep, sol->rr[0], sep, sol->rr[1], sep, sol->rr[2], sep, sol->stat, sep, + sol->ns, sep, SQRT_SOL(sol->qr[0]), sep, SQRT_SOL(sol->qr[1]), sep, SQRT_SOL(sol->qr[2]), + sep, sqvar(sol->qr[3]), sep, sqvar(sol->qr[4]), sep, sqvar(sol->qr[5]), + sep, sol->age, sep, sol->ratio); + return p - (char *)buff; } /* output solution as the form of lat/lon/height -----------------------------*/ 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], dms1[3], dms2[3], P[9], Q[9]; const char *sep = opt2sep(opt); char *p = (char *)buff; - trace(3,"outpos :\n"); + trace(3, "outpos :\n"); - ecef2pos(sol->rr,pos); - soltocov(sol,P); - covenu(pos,P,Q); + ecef2pos(sol->rr, pos); + soltocov(sol, P); + covenu(pos, P, Q); if (opt->height == 1) { /* geodetic height */ // pos[2] -= geoidh(pos); } if (opt->degf) { - deg2dms(pos[0]*R2D,dms1); - deg2dms(pos[1]*R2D,dms2); - p += sprintf(p,"%s%s%4.0f%s%02.0f%s%08.5f%s%4.0f%s%02.0f%s%08.5f",s,sep, - dms1[0],sep,dms1[1],sep,dms1[2],sep,dms2[0],sep,dms2[1],sep, - dms2[2]); + deg2dms(pos[0] * R2D, dms1); + deg2dms(pos[1] * R2D, dms2); + p += sprintf(p, "%s%s%4.0f%s%02.0f%s%08.5f%s%4.0f%s%02.0f%s%08.5f", s, sep, + dms1[0], sep, dms1[1], sep, dms1[2], sep, dms2[0], sep, dms2[1], sep, + dms2[2]); } - else p += sprintf(p,"%s%s%14.9f%s%14.9f",s,sep,pos[0]*R2D,sep,pos[1]*R2D); - p += sprintf(p,"%s%10.4f%s%3d%s%3d%s%8.4f%s%8.4f%s%8.4f%s%8.4f%s%8.4f%s%8.4f%s%6.2f%s%6.1f\n", - sep,pos[2],sep,sol->stat,sep,sol->ns,sep,SQRT_SOL(Q[4]),sep, - SQRT_SOL(Q[0]),sep,SQRT_SOL(Q[8]),sep,sqvar(Q[1]),sep,sqvar(Q[2]), - sep,sqvar(Q[5]),sep,sol->age,sep,sol->ratio); - return p-(char *)buff; + else + p += sprintf(p, "%s%s%14.9f%s%14.9f", s, sep, pos[0] * R2D, sep, pos[1] * R2D); + p += sprintf(p, "%s%10.4f%s%3d%s%3d%s%8.4f%s%8.4f%s%8.4f%s%8.4f%s%8.4f%s%8.4f%s%6.2f%s%6.1f\n", + sep, pos[2], sep, sol->stat, sep, sol->ns, sep, SQRT_SOL(Q[4]), sep, + SQRT_SOL(Q[0]), sep, SQRT_SOL(Q[8]), sep, sqvar(Q[1]), sep, sqvar(Q[2]), + sep, sqvar(Q[5]), sep, sol->age, sep, sol->ratio); + return p - (char *)buff; } /* output solution as the form of e/n/u-baseline -----------------------------*/ 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], rr[3], enu[3], P[9], Q[9]; int i; const char *sep = opt2sep(opt); char *p = (char *)buff; - trace(3,"outenu :\n"); + trace(3, "outenu :\n"); - for (i = 0;i<3;i++) rr[i] = sol->rr[i]-rb[i]; - ecef2pos(rb,pos); - soltocov(sol,P); - covenu(pos,P,Q); - ecef2enu(pos,rr,enu); - p += sprintf(p,"%s%s%14.4f%s%14.4f%s%14.4f%s%3d%s%3d%s%8.4f%s%8.4f%s%8.4f%s%8.4f%s%8.4f%s%8.4f%s%6.2f%s%6.1f\n", - s,sep,enu[0],sep,enu[1],sep,enu[2],sep,sol->stat,sep,sol->ns,sep, - SQRT_SOL(Q[0]),sep,SQRT_SOL(Q[4]),sep,SQRT_SOL(Q[8]),sep,sqvar(Q[1]), - sep,sqvar(Q[5]),sep,sqvar(Q[2]),sep,sol->age,sep,sol->ratio); - return p-(char *)buff; + for (i = 0; i < 3; i++) rr[i] = sol->rr[i] - rb[i]; + ecef2pos(rb, pos); + soltocov(sol, P); + covenu(pos, P, Q); + ecef2enu(pos, rr, enu); + p += sprintf(p, "%s%s%14.4f%s%14.4f%s%14.4f%s%3d%s%3d%s%8.4f%s%8.4f%s%8.4f%s%8.4f%s%8.4f%s%8.4f%s%6.2f%s%6.1f\n", + s, sep, enu[0], sep, enu[1], sep, enu[2], sep, sol->stat, sep, sol->ns, sep, + SQRT_SOL(Q[0]), sep, SQRT_SOL(Q[4]), sep, SQRT_SOL(Q[8]), sep, sqvar(Q[1]), + sep, sqvar(Q[5]), sep, sqvar(Q[2]), sep, sol->age, sep, sol->ratio); + return p - (char *)buff; } @@ -1191,41 +1283,46 @@ int outnmea_rmc(unsigned char *buff, const sol_t *sol) { static double dirp = 0.0; gtime_t time; - double ep[6],pos[3],enuv[3],dms1[3],dms2[3],vel,dir,amag = 0.0; - char *p = (char *)buff,*q,sum,*emag = (char*)"E"; + double ep[6], pos[3], enuv[3], dms1[3], dms2[3], vel, dir, amag = 0.0; + char *p = (char *)buff, *q, sum, *emag = (char *)"E"; - trace(3,"outnmea_rmc:\n"); + trace(3, "outnmea_rmc:\n"); if (sol->stat <= SOLQ_NONE) { - p += sprintf(p,"$GPRMC,,,,,,,,,,,,"); - for (q=(char *)buff+1,sum = 0;*q;q++) sum ^= *q; - p += sprintf(p,"*%02X%c%c",sum,0x0D,0x0A); - return p-(char *)buff; + p += sprintf(p, "$GPRMC,,,,,,,,,,,,"); + for (q = (char *)buff + 1, sum = 0; *q; q++) sum ^= *q; + p += sprintf(p, "*%02X%c%c", sum, 0x0D, 0x0A); + return p - (char *)buff; } time = gpst2utc(sol->time); - if (time.sec >= 0.995) {time.time++; time.sec = 0.0;} - time2epoch(time,ep); - ecef2pos(sol->rr,pos); - ecef2enu(pos,sol->rr+3,enuv); - vel = norm_rtk(enuv,3); + if (time.sec >= 0.995) + { + time.time++; + time.sec = 0.0; + } + time2epoch(time, ep); + ecef2pos(sol->rr, pos); + ecef2enu(pos, sol->rr + 3, enuv); + vel = norm_rtk(enuv, 3); if (vel >= 1.0) { - dir = atan2(enuv[0],enuv[1])*R2D; - if (dir<0.0) dir += 360.0; + dir = atan2(enuv[0], enuv[1]) * R2D; + if (dir < 0.0) dir += 360.0; dirp = dir; } - else dir = dirp; - deg2dms(fabs(pos[0])*R2D,dms1); - deg2dms(fabs(pos[1])*R2D,dms2); - p += sprintf(p,"$GPRMC,%02.0f%02.0f%05.2f,A,%02.0f%010.7f,%s,%03.0f%010.7f,%s,%4.2f,%4.2f,%02.0f%02.0f%02d,%.1f,%s,%s", - ep[3],ep[4],ep[5],dms1[0],dms1[1]+dms1[2]/60.0,pos[0] >= 0?"N":"S", - dms2[0],dms2[1]+dms2[2]/60.0,pos[1] >= 0?"E":"W",vel/KNOT2M,dir, - ep[2],ep[1],(int)ep[0]%100,amag,emag, - sol->stat == SOLQ_DGPS || sol->stat == SOLQ_FLOAT || sol->stat == SOLQ_FIX?"D":"A"); - for (q = (char *)buff+1,sum = 0;*q;q++) sum ^= *q; /* check-sum */ - p += sprintf(p,"*%02X%c%c",sum,0x0D,0x0A); - return p-(char *)buff; + else + dir = dirp; + deg2dms(fabs(pos[0]) * R2D, dms1); + deg2dms(fabs(pos[1]) * R2D, dms2); + p += sprintf(p, "$GPRMC,%02.0f%02.0f%05.2f,A,%02.0f%010.7f,%s,%03.0f%010.7f,%s,%4.2f,%4.2f,%02.0f%02.0f%02d,%.1f,%s,%s", + ep[3], ep[4], ep[5], dms1[0], dms1[1] + dms1[2] / 60.0, pos[0] >= 0 ? "N" : "S", + dms2[0], dms2[1] + dms2[2] / 60.0, pos[1] >= 0 ? "E" : "W", vel / KNOT2M, dir, + ep[2], ep[1], (int)ep[0] % 100, amag, emag, + sol->stat == SOLQ_DGPS || sol->stat == SOLQ_FLOAT || sol->stat == SOLQ_FIX ? "D" : "A"); + for (q = (char *)buff + 1, sum = 0; *q; q++) sum ^= *q; /* check-sum */ + p += sprintf(p, "*%02X%c%c", sum, 0x0D, 0x0A); + return p - (char *)buff; } @@ -1233,234 +1330,252 @@ int outnmea_rmc(unsigned char *buff, const sol_t *sol) int outnmea_gga(unsigned char *buff, const sol_t *sol) { gtime_t time; - double h,ep[6],pos[3],dms1[3],dms2[3],dop = 1.0; + double h, ep[6], pos[3], dms1[3], dms2[3], dop = 1.0; int solq; - char *p = (char *)buff,*q,sum; + char *p = (char *)buff, *q, sum; - trace(3,"outnmea_gga:\n"); + trace(3, "outnmea_gga:\n"); if (sol->stat <= SOLQ_NONE) { - p += sprintf(p,"$GPGGA,,,,,,,,,,,,,,"); - for (q = (char *)buff+1,sum = 0;*q;q++) sum ^= *q; - p += sprintf(p,"*%02X%c%c",sum,0x0D,0x0A); - return p-(char *)buff; + p += sprintf(p, "$GPGGA,,,,,,,,,,,,,,"); + for (q = (char *)buff + 1, sum = 0; *q; q++) sum ^= *q; + p += sprintf(p, "*%02X%c%c", sum, 0x0D, 0x0A); + return p - (char *)buff; } - for (solq = 0;solq<8;solq++) if (solq_nmea[solq] == sol->stat) break; + for (solq = 0; solq < 8; solq++) + if (solq_nmea[solq] == sol->stat) break; if (solq >= 8) solq = 0; time = gpst2utc(sol->time); - if (time.sec >= 0.995) {time.time++; time.sec = 0.0;} - time2epoch(time,ep); - ecef2pos(sol->rr,pos); - h = 0;//geoidh(pos); - deg2dms(fabs(pos[0])*R2D,dms1); - deg2dms(fabs(pos[1])*R2D,dms2); - p += sprintf(p,"$GPGGA,%02.0f%02.0f%05.2f,%02.0f%010.7f,%s,%03.0f%010.7f,%s,%d,%02d,%.1f,%.3f,M,%.3f,M,%.1f,", - ep[3],ep[4],ep[5],dms1[0],dms1[1]+dms1[2]/60.0,pos[0] >= 0?"N":"S", - dms2[0],dms2[1]+dms2[2]/60.0,pos[1] >= 0?"E":"W",solq, - sol->ns,dop,pos[2]-h,h,sol->age); - for (q = (char *)buff+1,sum = 0;*q;q++) sum ^= *q; /* check-sum */ - p += sprintf(p,"*%02X%c%c",sum,0x0D,0x0A); - return p-(char *)buff; + if (time.sec >= 0.995) + { + time.time++; + time.sec = 0.0; + } + time2epoch(time, ep); + ecef2pos(sol->rr, pos); + h = 0; //geoidh(pos); + deg2dms(fabs(pos[0]) * R2D, dms1); + deg2dms(fabs(pos[1]) * R2D, dms2); + p += sprintf(p, "$GPGGA,%02.0f%02.0f%05.2f,%02.0f%010.7f,%s,%03.0f%010.7f,%s,%d,%02d,%.1f,%.3f,M,%.3f,M,%.1f,", + ep[3], ep[4], ep[5], dms1[0], dms1[1] + dms1[2] / 60.0, pos[0] >= 0 ? "N" : "S", + dms2[0], dms2[1] + dms2[2] / 60.0, pos[1] >= 0 ? "E" : "W", solq, + sol->ns, dop, pos[2] - h, h, sol->age); + for (q = (char *)buff + 1, sum = 0; *q; q++) sum ^= *q; /* check-sum */ + p += sprintf(p, "*%02X%c%c", sum, 0x0D, 0x0A); + return p - (char *)buff; } /* output solution in the form of nmea GSA sentences -------------------------*/ int outnmea_gsa(unsigned char *buff, const sol_t *sol, - const ssat_t *ssat) + const ssat_t *ssat) { - double azel[MAXSAT*2],dop[4]; - int i,sat,sys,nsat,prn[MAXSAT]; - char *p = (char *)buff,*q,*s,sum; + double azel[MAXSAT * 2], dop[4]; + int i, sat, sys, nsat, prn[MAXSAT]; + char *p = (char *)buff, *q, *s, sum; - trace(3,"outnmea_gsa:\n"); + trace(3, "outnmea_gsa:\n"); if (sol->stat <= SOLQ_NONE) { - p += sprintf(p,"$GPGSA,A,1,,,,,,,,,,,,,,,"); - for (q = (char *)buff+1,sum = 0;*q;q++) sum ^= *q; - p += sprintf(p,"*%02X%c%c",sum,0x0D,0x0A); - return p-(char *)buff; + p += sprintf(p, "$GPGSA,A,1,,,,,,,,,,,,,,,"); + for (q = (char *)buff + 1, sum = 0; *q; q++) sum ^= *q; + p += sprintf(p, "*%02X%c%c", sum, 0x0D, 0x0A); + return p - (char *)buff; } /* GPGSA: gps/sbas */ - for (sat = 1,nsat = 0;sat <= MAXSAT&&nsat<12;sat++) + for (sat = 1, nsat = 0; sat <= MAXSAT && nsat < 12; sat++) { - if (!ssat[sat-1].vs || ssat[sat-1].azel[1] <= 0.0) continue; - sys = satsys(sat,prn+nsat); + if (!ssat[sat - 1].vs || ssat[sat - 1].azel[1] <= 0.0) continue; + sys = satsys(sat, prn + nsat); if (sys != SYS_GPS && sys != SYS_SBS) continue; - if (sys == SYS_SBS) prn[nsat] += 33-MINPRNSBS; - for (i = 0;i<2;i++) azel[i+nsat*2] = ssat[sat-1].azel[i]; + if (sys == SYS_SBS) prn[nsat] += 33 - MINPRNSBS; + for (i = 0; i < 2; i++) azel[i + nsat * 2] = ssat[sat - 1].azel[i]; nsat++; } - if (nsat>0) + if (nsat > 0) { s = p; - p += sprintf(p,"$GPGSA,A,%d",sol->stat <= 0?1:3); - for (i = 0;i<12;i++) + p += sprintf(p, "$GPGSA,A,%d", sol->stat <= 0 ? 1 : 3); + for (i = 0; i < 12; i++) { - if (i0) + if (nsat > 0) { s = p; - p += sprintf(p,"$GLGSA,A,%d",sol->stat <= 0?1:3); - for (i = 0;i<12;i++) + p += sprintf(p, "$GLGSA,A,%d", sol->stat <= 0 ? 1 : 3); + for (i = 0; i < 12; i++) { - if (i0) + if (nsat > 0) { s = p; - p += sprintf(p,"$GAGSA,A,%d",sol->stat <= 0?1:3); - for (i = 0;i<12;i++) + p += sprintf(p, "$GAGSA,A,%d", sol->stat <= 0 ? 1 : 3); + for (i = 0; i < 12; i++) { - if (istat <= SOLQ_NONE) { - p += sprintf(p,"$GPGSV,1,1,0,,,,,,,,,,,,,,,,"); - for (q = (char *)buff+1,sum = 0;*q;q++) sum ^= *q; - p += sprintf(p,"*%02X%c%c",sum,0x0D,0x0A); - return p-(char *)buff; + p += sprintf(p, "$GPGSV,1,1,0,,,,,,,,,,,,,,,,"); + for (q = (char *)buff + 1, sum = 0; *q; q++) sum ^= *q; + p += sprintf(p, "*%02X%c%c", sum, 0x0D, 0x0A); + return p - (char *)buff; } /* GPGSV: gps/sbas */ - for (sat = 1,n = 0;sat0.0) sats[n++] = sat; + if (ssat[sat - 1].vs && ssat[sat - 1].azel[1] > 0.0) sats[n++] = sat; } - nmsg = n <= 0?0:(n-1)/4+1; + nmsg = n <= 0 ? 0 : (n - 1) / 4 + 1; - for (i = k = 0;i0.0) sats[n++] = sat; + if (satsys(sat, &prn) != SYS_GLO) continue; + if (ssat[sat - 1].vs && ssat[sat - 1].azel[1] > 0.0) sats[n++] = sat; } - nmsg = n <= 0?0:(n-1)/4+1; + nmsg = n <= 0 ? 0 : (n - 1) / 4 + 1; - for (i = k = 0;i0.0) sats[n++] = sat; + if (satsys(sat, &prn) != SYS_GAL) continue; + if (ssat[sat - 1].vs && ssat[sat - 1].azel[1] > 0.0) sats[n++] = sat; } - nmsg = n <= 0?0:(n-1)/4+1; + nmsg = n <= 0 ? 0 : (n - 1) / 4 + 1; - for (i = k = 0;imode]); + p += sprintf(p, "%s pos mode : %s\n", COMMENTH, s1[opt->mode]); if (PMODE_DGPS <= opt->mode && opt->mode <= PMODE_FIXED) { - p += sprintf(p,"%s freqs : %s\n",COMMENTH,s2[opt->nf-1]); + p += sprintf(p, "%s freqs : %s\n", COMMENTH, s2[opt->nf - 1]); } - if (opt->mode>PMODE_SINGLE) + if (opt->mode > PMODE_SINGLE) { - p += sprintf(p,"%s solution : %s\n",COMMENTH,s3[opt->soltype]); + p += sprintf(p, "%s solution : %s\n", COMMENTH, s3[opt->soltype]); } - p += sprintf(p,"%s elev mask : %.1f deg\n",COMMENTH,opt->elmin*R2D); - if (opt->mode>PMODE_SINGLE) + p += sprintf(p, "%s elev mask : %.1f deg\n", COMMENTH, opt->elmin * R2D); + if (opt->mode > PMODE_SINGLE) { - p += sprintf(p,"%s dynamics : %s\n",COMMENTH,opt->dynamics?"on":"off"); - p += sprintf(p,"%s tidecorr : %s\n",COMMENTH,opt->tidecorr?"on":"off"); + p += sprintf(p, "%s dynamics : %s\n", COMMENTH, opt->dynamics ? "on" : "off"); + p += sprintf(p, "%s tidecorr : %s\n", COMMENTH, opt->tidecorr ? "on" : "off"); } if (opt->mode <= PMODE_FIXED) { - p += sprintf(p,"%s ionos opt : %s\n",COMMENTH,s4[opt->ionoopt]); + p += sprintf(p, "%s ionos opt : %s\n", COMMENTH, s4[opt->ionoopt]); } - p += sprintf(p,"%s tropo opt : %s\n",COMMENTH,s5[opt->tropopt]); - p += sprintf(p,"%s ephemeris : %s\n",COMMENTH,s6[opt->sateph]); + p += sprintf(p, "%s tropo opt : %s\n", COMMENTH, s5[opt->tropopt]); + p += sprintf(p, "%s ephemeris : %s\n", COMMENTH, s6[opt->sateph]); if (opt->navsys != SYS_GPS) { - p += sprintf(p,"%s navi sys :",COMMENTH); - for (i = 0;sys[i];i++) + p += sprintf(p, "%s navi sys :", COMMENTH); + for (i = 0; sys[i]; i++) { - if (opt->navsys&sys[i]) p += sprintf(p," %s",s7[i]); + if (opt->navsys & sys[i]) p += sprintf(p, " %s", s7[i]); } - p += sprintf(p,"\n"); + p += sprintf(p, "\n"); } if (PMODE_KINEMA <= opt->mode && opt->mode <= PMODE_FIXED) { - p += sprintf(p,"%s amb res : %s\n",COMMENTH,s8[opt->modear]); - if (opt->navsys&SYS_GLO) + p += sprintf(p, "%s amb res : %s\n", COMMENTH, s8[opt->modear]); + if (opt->navsys & SYS_GLO) { - p += sprintf(p,"%s amb glo : %s\n",COMMENTH,s9[opt->glomodear]); + p += sprintf(p, "%s amb glo : %s\n", COMMENTH, s9[opt->glomodear]); } - if (opt->thresar[0]>0.0) + if (opt->thresar[0] > 0.0) { - p += sprintf(p,"%s val thres : %.1f\n",COMMENTH,opt->thresar[0]); + p += sprintf(p, "%s val thres : %.1f\n", COMMENTH, opt->thresar[0]); } } - if (opt->mode == PMODE_MOVEB && opt->baseline[0]>0.0) + if (opt->mode == PMODE_MOVEB && opt->baseline[0] > 0.0) { - p += sprintf(p,"%s baseline : %.4f %.4f m\n",COMMENTH, - opt->baseline[0],opt->baseline[1]); + p += sprintf(p, "%s baseline : %.4f %.4f m\n", COMMENTH, + opt->baseline[0], opt->baseline[1]); } - for (i = 0;i<2;i++) + for (i = 0; i < 2; i++) { - if (opt->mode == PMODE_SINGLE || (i >= 1 && opt->mode>PMODE_FIXED)) continue; - p += sprintf(p,"%s antenna%d : %-21s (%7.4f %7.4f %7.4f)\n",COMMENTH, - i+1,opt->anttype[i],opt->antdel[i][0],opt->antdel[i][1], - opt->antdel[i][2]); + if (opt->mode == PMODE_SINGLE || (i >= 1 && opt->mode > PMODE_FIXED)) continue; + p += sprintf(p, "%s antenna%d : %-21s (%7.4f %7.4f %7.4f)\n", COMMENTH, + i + 1, opt->anttype[i], opt->antdel[i][0], opt->antdel[i][1], + opt->antdel[i][2]); } - return p-(char *)buff; + return p - (char *)buff; } @@ -1558,57 +1673,60 @@ int outprcopts(unsigned char *buff, const prcopt_t *opt) *-----------------------------------------------------------------------------*/ int outsolheads(unsigned char *buff, const solopt_t *opt) { - const char *s1[] = {"WGS84","Tokyo"},*s2[] = {"ellipsoidal","geodetic"}; - const char *s3[] = {"GPST","UTC ","JST "},*sep = opt2sep(opt); + const char *s1[] = {"WGS84", "Tokyo"}, *s2[] = {"ellipsoidal", "geodetic"}; + const char *s3[] = {"GPST", "UTC ", "JST "}, *sep = opt2sep(opt); char *p = (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); - trace(3,"outsolheads:\n"); + trace(3, "outsolheads:\n"); if (opt->posf == SOLF_NMEA) return 0; if (opt->outhead) { - p += sprintf(p,"%s (",COMMENTH); - if (opt->posf == SOLF_XYZ) p += sprintf(p,"x/y/z-ecef=WGS84"); - else if (opt->posf == SOLF_ENU) p += sprintf(p,"e/n/u-baseline=WGS84"); - else p += sprintf(p,"lat/lon/height=%s/%s",s1[opt->datum],s2[opt->height]); - p += sprintf(p,",Q=1:fix,2:float,3:sbas,4:dgps,5:single,6:ppp,ns=# of satellites)\n"); + p += sprintf(p, "%s (", COMMENTH); + if (opt->posf == SOLF_XYZ) + p += sprintf(p, "x/y/z-ecef=WGS84"); + else if (opt->posf == SOLF_ENU) + p += sprintf(p, "e/n/u-baseline=WGS84"); + else + p += sprintf(p, "lat/lon/height=%s/%s", s1[opt->datum], s2[opt->height]); + p += sprintf(p, ",Q=1:fix,2:float,3:sbas,4:dgps,5:single,6:ppp,ns=# of satellites)\n"); } - p += sprintf(p,"%s %-*s%s",COMMENTH,(opt->timef?16:8)+timeu+1,s3[opt->times],sep); + p += sprintf(p, "%s %-*s%s", COMMENTH, (opt->timef ? 16 : 8) + timeu + 1, s3[opt->times], sep); if (opt->posf == SOLF_LLH) { /* lat/lon/hgt */ if (opt->degf) { - p += sprintf(p,"%16s%s%16s%s%10s%s%3s%s%3s%s%8s%s%8s%s%8s%s%8s%s%8s%s%8s%s%6s%s%6s\n", - "latitude(d'\")",sep,"longitude(d'\")",sep,"height(m)",sep, - "Q",sep,"ns",sep,"sdn(m)",sep,"sde(m)",sep,"sdu(m)",sep, - "sdne(m)",sep,"sdeu(m)",sep,"sdue(m)",sep,"age(s)",sep,"ratio"); + p += sprintf(p, "%16s%s%16s%s%10s%s%3s%s%3s%s%8s%s%8s%s%8s%s%8s%s%8s%s%8s%s%6s%s%6s\n", + "latitude(d'\")", sep, "longitude(d'\")", sep, "height(m)", sep, + "Q", sep, "ns", sep, "sdn(m)", sep, "sde(m)", sep, "sdu(m)", sep, + "sdne(m)", sep, "sdeu(m)", sep, "sdue(m)", sep, "age(s)", sep, "ratio"); } else { - p += sprintf(p,"%14s%s%14s%s%10s%s%3s%s%3s%s%8s%s%8s%s%8s%s%8s%s%8s%s%8s%s%6s%s%6s\n", - "latitude(deg)",sep,"longitude(deg)",sep,"height(m)",sep, - "Q",sep,"ns",sep,"sdn(m)",sep,"sde(m)",sep,"sdu(m)",sep, - "sdne(m)",sep,"sdeu(m)",sep,"sdun(m)",sep,"age(s)",sep,"ratio"); + p += sprintf(p, "%14s%s%14s%s%10s%s%3s%s%3s%s%8s%s%8s%s%8s%s%8s%s%8s%s%8s%s%6s%s%6s\n", + "latitude(deg)", sep, "longitude(deg)", sep, "height(m)", sep, + "Q", sep, "ns", sep, "sdn(m)", sep, "sde(m)", sep, "sdu(m)", sep, + "sdne(m)", sep, "sdeu(m)", sep, "sdun(m)", sep, "age(s)", sep, "ratio"); } } else if (opt->posf == SOLF_XYZ) { /* x/y/z-ecef */ - p += sprintf(p,"%14s%s%14s%s%14s%s%3s%s%3s%s%8s%s%8s%s%8s%s%8s%s%8s%s%8s%s%6s%s%6s\n", - "x-ecef(m)",sep,"y-ecef(m)",sep,"z-ecef(m)",sep,"Q",sep,"ns",sep, - "sdx(m)",sep,"sdy(m)",sep,"sdz(m)",sep,"sdxy(m)",sep, - "sdyz(m)",sep,"sdzx(m)",sep,"age(s)",sep,"ratio"); + p += sprintf(p, "%14s%s%14s%s%14s%s%3s%s%3s%s%8s%s%8s%s%8s%s%8s%s%8s%s%8s%s%6s%s%6s\n", + "x-ecef(m)", sep, "y-ecef(m)", sep, "z-ecef(m)", sep, "Q", sep, "ns", sep, + "sdx(m)", sep, "sdy(m)", sep, "sdz(m)", sep, "sdxy(m)", sep, + "sdyz(m)", sep, "sdzx(m)", sep, "age(s)", sep, "ratio"); } else if (opt->posf == SOLF_ENU) { /* e/n/u-baseline */ - p += sprintf(p,"%14s%s%14s%s%14s%s%3s%s%3s%s%8s%s%8s%s%8s%s%8s%s%8s%s%8s%s%6s%s%6s\n", - "e-baseline(m)",sep,"n-baseline(m)",sep,"u-baseline(m)",sep, - "Q",sep,"ns",sep,"sde(m)",sep,"sdn(m)",sep,"sdu(m)",sep, - "sden(m)",sep,"sdnu(m)",sep,"sdue(m)",sep,"age(s)",sep,"ratio"); + p += sprintf(p, "%14s%s%14s%s%14s%s%3s%s%3s%s%8s%s%8s%s%8s%s%8s%s%8s%s%8s%s%6s%s%6s\n", + "e-baseline(m)", sep, "n-baseline(m)", sep, "u-baseline(m)", sep, + "Q", sep, "ns", sep, "sde(m)", sep, "sdn(m)", sep, "sdu(m)", sep, + "sden(m)", sep, "sdnu(m)", sep, "sdue(m)", sep, "age(s)", sep, "ratio"); } - return p-(char *)buff; + return p - (char *)buff; } @@ -1621,23 +1739,23 @@ int outsolheads(unsigned char *buff, const solopt_t *opt) * return : number of output bytes *-----------------------------------------------------------------------------*/ 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, ts = {0, 0.0}; double gpst; - int week,timeu; + int week, timeu; const char *sep = opt2sep(opt); char s[255]; unsigned char *p = buff; - trace(3,"outsols :\n"); + trace(3, "outsols :\n"); if (opt->posf == SOLF_NMEA) { if (opt->nmeaintv[0] < 0.0) return 0; if (!screent(sol->time, ts, ts, opt->nmeaintv[0])) return 0; } - if (sol->stat <= SOLQ_NONE || (opt->posf == SOLF_ENU && norm_rtk(rb,3) <= 0.0)) + if (sol->stat <= SOLQ_NONE || (opt->posf == SOLF_ENU && norm_rtk(rb, 3) <= 0.0)) { return 0; } @@ -1645,9 +1763,10 @@ int outsols(unsigned char *buff, const sol_t *sol, const double *rb, time = sol->time; if (opt->times >= TIMES_UTC) time = gpst2utc(time); - if (opt->times == TIMES_JST) time = timeadd(time, 9*3600.0); + if (opt->times == TIMES_JST) time = timeadd(time, 9 * 3600.0); - if (opt->timef) time2str(time, s, timeu); + if (opt->timef) + time2str(time, s, timeu); else { gpst = time2gpst(time, &week); @@ -1656,16 +1775,24 @@ int outsols(unsigned char *buff, const sol_t *sol, const double *rb, week++; gpst = 0.0; } - snprintf(s, 255, "%4d%s%*.*f", week, sep, 6 + (timeu <= 0 ? 0 : timeu+1), timeu, gpst); + snprintf(s, 255, "%4d%s%*.*f", week, sep, 6 + (timeu <= 0 ? 0 : timeu + 1), timeu, gpst); } switch (opt->posf) - { - case SOLF_LLH: p += outpos(p, s, sol, opt); break; - case SOLF_XYZ: p += outecef(p, s, sol, opt); break; - case SOLF_ENU: p += outenu(p, s, sol, rb, opt); break; - case SOLF_NMEA: p += outnmea_rmc(p, sol); - p += outnmea_gga(p, sol); break; - } + { + case SOLF_LLH: + p += outpos(p, s, sol, opt); + break; + case SOLF_XYZ: + p += outecef(p, s, sol, opt); + break; + case SOLF_ENU: + p += outenu(p, s, sol, rb, opt); + break; + case SOLF_NMEA: + p += outnmea_rmc(p, sol); + p += outnmea_gga(p, sol); + break; + } return p - buff; } @@ -1680,24 +1807,24 @@ int outsols(unsigned char *buff, const sol_t *sol, const double *rb, * notes : only support nmea *-----------------------------------------------------------------------------*/ int outsolexs(unsigned char *buff, const sol_t *sol, const ssat_t *ssat, - const solopt_t *opt) + const solopt_t *opt) { gtime_t ts = {0, 0.0}; unsigned char *p = buff; - trace(3,"outsolexs:\n"); + trace(3, "outsolexs:\n"); if (opt->posf == SOLF_NMEA) { - if (opt->nmeaintv[1]<0.0) return 0; - if (!screent(sol->time,ts,ts,opt->nmeaintv[1])) return 0; + if (opt->nmeaintv[1] < 0.0) return 0; + if (!screent(sol->time, ts, ts, opt->nmeaintv[1])) return 0; } if (opt->posf == SOLF_NMEA) { - p += outnmea_gsa(p,sol,ssat); - p += outnmea_gsv(p,sol,ssat); + p += outnmea_gsa(p, sol, ssat); + p += outnmea_gsv(p, sol, ssat); } - return p-buff; + return p - buff; } @@ -1709,7 +1836,7 @@ int outsolexs(unsigned char *buff, const sol_t *sol, const ssat_t *ssat, *-----------------------------------------------------------------------------*/ void outprcopt(FILE *fp, const prcopt_t *opt) { - unsigned char buff[MAXSOLMSG+1]; + unsigned char buff[MAXSOLMSG + 1]; int n; trace(3, "outprcopt:\n"); @@ -1729,7 +1856,7 @@ void outprcopt(FILE *fp, const prcopt_t *opt) *-----------------------------------------------------------------------------*/ void outsolhead(FILE *fp, const solopt_t *opt) { - unsigned char buff[MAXSOLMSG+1]; + unsigned char buff[MAXSOLMSG + 1]; int n; trace(3, "outsolhead:\n"); @@ -1750,9 +1877,9 @@ void outsolhead(FILE *fp, const solopt_t *opt) * return : none *-----------------------------------------------------------------------------*/ void outsol(FILE *fp, const sol_t *sol, const double *rb, - const solopt_t *opt) + const solopt_t *opt) { - unsigned char buff[MAXSOLMSG+1]; + unsigned char buff[MAXSOLMSG + 1]; int n; trace(3, "outsol :\n"); @@ -1774,9 +1901,9 @@ void outsol(FILE *fp, const sol_t *sol, const double *rb, * notes : only support nmea *-----------------------------------------------------------------------------*/ void outsolex(FILE *fp, const sol_t *sol, const ssat_t *ssat, - const solopt_t *opt) + const solopt_t *opt) { - unsigned char buff[MAXSOLMSG+1]; + unsigned char buff[MAXSOLMSG + 1]; int n; trace(3, "outsolex:\n"); diff --git a/src/algorithms/libs/rtklib/rtklib_solution.h b/src/algorithms/libs/rtklib/rtklib_solution.h index 0a97cb1da..10906c01a 100644 --- a/src/algorithms/libs/rtklib/rtklib_solution.h +++ b/src/algorithms/libs/rtklib/rtklib_solution.h @@ -55,8 +55,8 @@ #include "rtklib.h" -#define COMMENTH "%" /* comment line indicator for solution */ -#define MSG_DISCONN "$_DISCONNECT\r\n" /* disconnect message */ +#define COMMENTH "%" /* comment line indicator for solution */ +#define MSG_DISCONN "$_DISCONNECT\r\n" /* disconnect message */ const char *opt2sep(const solopt_t *opt); @@ -99,17 +99,17 @@ void decode_solopt(char *buff, solopt_t *opt); void readsolopt(FILE *fp, solopt_t *opt); int inputsol(unsigned char data, gtime_t ts, gtime_t te, double tint, - int qflag, const solopt_t *opt, solbuf_t *solbuf); + int qflag, const solopt_t *opt, solbuf_t *solbuf); int readsoldata(FILE *fp, gtime_t ts, gtime_t te, double tint, int qflag, - const solopt_t *opt, solbuf_t *solbuf); + const solopt_t *opt, solbuf_t *solbuf); int cmpsol(const void *p1, const void *p2); int sort_solbuf(solbuf_t *solbuf); int readsolt(char *files[], int nfile, gtime_t ts, gtime_t te, - double tint, int qflag, solbuf_t *solbuf); + double tint, int qflag, solbuf_t *solbuf); int readsol(char *files[], int nfile, solbuf_t *sol); @@ -132,51 +132,50 @@ int decode_solstat(char *buff, solstat_t *stat); void addsolstat(solstatbuf_t *statbuf, const solstat_t *stat); int readsolstatdata(FILE *fp, gtime_t ts, gtime_t te, double tint, - solstatbuf_t *statbuf); + solstatbuf_t *statbuf); int readsolstatt(char *files[], int nfile, gtime_t ts, gtime_t te, - double tint, solstatbuf_t *statbuf); + double tint, solstatbuf_t *statbuf); int readsolstat(char *files[], int nfile, solstatbuf_t *statbuf); int outecef(unsigned char *buff, const char *s, const sol_t *sol, - const solopt_t *opt); + const solopt_t *opt); int outpos(unsigned char *buff, const char *s, const sol_t *sol, const solopt_t *opt); 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); int outnmea_rmc(unsigned char *buff, const sol_t *sol); int outnmea_gga(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); int outnmea_gsv(unsigned char *buff, const sol_t *sol, - const ssat_t *ssat); + const ssat_t *ssat); int outprcopts(unsigned char *buff, const prcopt_t *opt); int outsolheads(unsigned char *buff, const solopt_t *opt); int outsols(unsigned char *buff, const sol_t *sol, const double *rb, - const solopt_t *opt); + const solopt_t *opt); int outsolexs(unsigned char *buff, const sol_t *sol, const ssat_t *ssat, - const solopt_t *opt); + const solopt_t *opt); void outprcopt(FILE *fp, const prcopt_t *opt); void outsolhead(FILE *fp, const solopt_t *opt); void outsol(FILE *fp, const sol_t *sol, const double *rb, - const solopt_t *opt); + const solopt_t *opt); void outsolex(FILE *fp, const sol_t *sol, const ssat_t *ssat, - const solopt_t *opt); - + const solopt_t *opt); #endif diff --git a/src/algorithms/libs/rtklib/rtklib_stream.cc b/src/algorithms/libs/rtklib/rtklib_stream.cc index 8844f9e1c..e7a7204b7 100644 --- a/src/algorithms/libs/rtklib/rtklib_stream.cc +++ b/src/algorithms/libs/rtklib/rtklib_stream.cc @@ -68,45 +68,44 @@ /* global options ------------------------------------------------------------*/ -static int toinact = 10000; /* inactive timeout (ms) */ -static int ticonnect = 10000; /* interval to re-connect (ms) */ -static int tirate = 1000; /* avraging time for data rate (ms) */ -static int buffsize = 32768; /* receive/send buffer size (bytes) */ -static char localdir[1024] = ""; /* local directory for ftp/http */ -static char proxyaddr[256] = ""; /* http/ntrip/ftp proxy address */ +static int toinact = 10000; /* inactive timeout (ms) */ +static int ticonnect = 10000; /* interval to re-connect (ms) */ +static int tirate = 1000; /* avraging time for data rate (ms) */ +static int buffsize = 32768; /* receive/send buffer size (bytes) */ +static char localdir[1024] = ""; /* local directory for ftp/http */ +static char proxyaddr[256] = ""; /* http/ntrip/ftp proxy address */ static unsigned int tick_master = 0; /* time tick master for replay */ -static int fswapmargin = 30; /* file swap margin (s) */ - - +static int fswapmargin = 30; /* file swap margin (s) */ /* open serial ---------------------------------------------------------------*/ serial_t *openserial(const char *path, int mode, char *msg) { 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; int i, brate = 9600, bsize = 8, stopb = 1; char *p, parity = 'N', dev[128], port[128], fctr[64] = ""; 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}; struct termios ios; int rw = 0; tracet(3, "openserial: path=%s mode=%d\n", path, mode); if (!(serial = (serial_t *)malloc(sizeof(serial_t)))) return NULL; - if ((p = strchr((char*)path, ':'))) + if ((p = strchr((char *)path, ':'))) { - strncpy(port, path, p-path); port[p-path] = '\0'; + strncpy(port, path, p - path); + port[p - path] = '\0'; sscanf(p, ":%d:%d:%c:%d:%s", &brate, &bsize, &parity, &stopb, fctr); } - else if(strlen(path) < 128) strcpy(port, path); + else if (strlen(path) < 128) + strcpy(port, path); - for (i = 0;i < 10; i++) if (br[i] == brate) break; + for (i = 0; i < 10; i++) + if (br[i] == brate) break; if (i >= 11) { sprintf(msg, "bitrate error (%d)", brate); @@ -118,11 +117,14 @@ serial_t *openserial(const char *path, int mode, char *msg) sprintf(dev, "/dev/%s", port); - if ((mode&STR_MODE_R) && (mode&STR_MODE_W)) rw = O_RDWR; - else if (mode&STR_MODE_R) rw = O_RDONLY; - else if (mode&STR_MODE_W) rw = O_WRONLY; + if ((mode & STR_MODE_R) && (mode & STR_MODE_W)) + rw = O_RDWR; + else if (mode & STR_MODE_R) + rw = O_RDONLY; + else if (mode & STR_MODE_W) + rw = O_WRONLY; - if ((serial->dev = open(dev, rw|O_NOCTTY|O_NONBLOCK)) < 0) + if ((serial->dev = open(dev, rw | O_NOCTTY | O_NONBLOCK)) < 0) { sprintf(msg, "device open error (%d)", errno); tracet(1, "openserial: %s dev=%s\n", msg, dev); @@ -132,13 +134,13 @@ serial_t *openserial(const char *path, int mode, char *msg) tcgetattr(serial->dev, &ios); ios.c_iflag = 0; ios.c_oflag = 0; - ios.c_lflag = 0; /* non-canonical */ - ios.c_cc[VMIN ] = 0; /* non-block-mode */ + ios.c_lflag = 0; /* non-canonical */ + ios.c_cc[VMIN] = 0; /* non-block-mode */ ios.c_cc[VTIME] = 0; cfsetospeed(&ios, bs[i]); cfsetispeed(&ios, bs[i]); ios.c_cflag |= bsize == 7 ? CS7 : CS8; - ios.c_cflag |= parity == 'O' ? (PARENB|PARODD) : (parity == 'E' ? PARENB:0); + ios.c_cflag |= parity == 'O' ? (PARENB | PARODD) : (parity == 'E' ? PARENB : 0); ios.c_cflag |= stopb == 2 ? CSTOPB : 0; ios.c_cflag |= !strcmp(fctr, "rts") ? CRTSCTS : 0; tcsetattr(serial->dev, TCSANOW, &ios); @@ -184,7 +186,7 @@ int writeserial(serial_t *serial, unsigned char *buff, int n, char *msg __attrib /* get state serial ----------------------------------------------------------*/ int stateserial(serial_t *serial) { - return !serial ? 0:(serial->error ? -1:2); + return !serial ? 0 : (serial->error ? -1 : 2); } @@ -192,8 +194,8 @@ int stateserial(serial_t *serial) int openfile_(file_t *file, gtime_t time, char *msg) { FILE *fp; - char *rw, tagpath[MAXSTRPATH+4] = ""; - char tagh[TIMETAGH_LEN+1] = ""; + char *rw, tagpath[MAXSTRPATH + 4] = ""; + char tagh[TIMETAGH_LEN + 1] = ""; tracet(3, "openfile_: path=%s time=%s\n", file->path, time_str(time, 0)); @@ -204,18 +206,21 @@ int openfile_(file_t *file, gtime_t time, char *msg) /* use stdin or stdout if file path is null */ if (!*file->path) { - file->fp = file->mode&STR_MODE_R ? stdin : stdout; + file->fp = file->mode & STR_MODE_R ? stdin : stdout; return 1; } /* replace keywords */ reppath(file->path, file->openpath, time, "", ""); /* create directory */ - if ((file->mode&STR_MODE_W) && !(file->mode&STR_MODE_R)) + if ((file->mode & STR_MODE_W) && !(file->mode & STR_MODE_R)) { createdir(file->openpath); } - if (file->mode&STR_MODE_R) rw = (char*)"rb"; else rw = (char*)"wb"; + if (file->mode & STR_MODE_R) + rw = (char *)"rb"; + else + rw = (char *)"wb"; if (!(file->fp = fopen(file->openpath, rw))) { @@ -238,12 +243,12 @@ int openfile_(file_t *file, gtime_t time, char *msg) } tracet(4, "openfile_: open tag file %s (%s)\n", tagpath, rw); - if (file->mode&STR_MODE_R) + if (file->mode & STR_MODE_R) { if (fread(&tagh, TIMETAGH_LEN, 1, file->fp_tag) == 1 && - fread(&file->time, sizeof(file->time), 1, file->fp_tag) == 1) + fread(&file->time, sizeof(file->time), 1, file->fp_tag) == 1) { - memcpy(&file->tick_f, tagh+TIMETAGH_LEN-4, sizeof(file->tick_f)); + memcpy(&file->tick_f, tagh + TIMETAGH_LEN - 4, sizeof(file->tick_f)); } else { @@ -255,7 +260,7 @@ int openfile_(file_t *file, gtime_t time, char *msg) else { sprintf(tagh, "TIMETAG RTKLIB %s", VER_RTKLIB); - memcpy(tagh+TIMETAGH_LEN-4, &file->tick_f, sizeof(file->tick_f)); + memcpy(tagh + TIMETAGH_LEN - 4, &file->tick_f, sizeof(file->tick_f)); fwrite(&tagh, 1, TIMETAGH_LEN, file->fp_tag); fwrite(&file->time, 1, sizeof(file->time), file->fp_tag); /* time tag file structure */ @@ -264,7 +269,7 @@ int openfile_(file_t *file, gtime_t time, char *msg) /* TICK1(4)+FPOS1(4/8)+... */ } } - else if (file->mode&STR_MODE_W) + else if (file->mode & STR_MODE_W) { /* remove time-tag */ if ((fp = fopen(tagpath, "rb"))) { @@ -299,15 +304,19 @@ file_t *openfile(const char *path, int mode, char *msg) tracet(3, "openfile: path=%s mode=%d\n", path, mode); - if (!(mode&(STR_MODE_R|STR_MODE_W))) return NULL; + if (!(mode & (STR_MODE_R | STR_MODE_W))) return NULL; /* file options */ - for (p = (char *)path;(p = strstr(p, "::"));p += 2) + for (p = (char *)path; (p = strstr(p, "::")); p += 2) { /* file options */ - if (*(p+2) == 'T') timetag = 1; - else if (*(p+2) == '+') sscanf(p+2, "+%lf", &start); - else if (*(p+2) == 'x') sscanf(p+2, "x%lf", &speed); - else if (*(p+2) == 'S') sscanf(p+2, "S=%lf", &swapintv); + if (*(p + 2) == 'T') + timetag = 1; + else if (*(p + 2) == '+') + sscanf(p + 2, "+%lf", &start); + else if (*(p + 2) == 'x') + sscanf(p + 2, "x%lf", &speed); + else if (*(p + 2) == 'S') + sscanf(p + 2, "S=%lf", &swapintv); } if (start <= 0.0) start = 0.0; if (swapintv <= 0.0) swapintv = 0.0; @@ -315,7 +324,7 @@ file_t *openfile(const char *path, int mode, char *msg) if (!(file = (file_t *)malloc(sizeof(file_t)))) return NULL; file->fp = file->fp_tag = file->fp_tmp = file->fp_tag_tmp = NULL; - if(strlen(path) < MAXSTRPATH) strcpy(file->path, path); + if (strlen(path) < MAXSTRPATH) strcpy(file->path, path); if ((p = strstr(file->path, "::"))) *p = '\0'; file->openpath[0] = '\0'; file->mode = mode; @@ -382,7 +391,7 @@ void swapfile(file_t *file, gtime_t time, char *msg) void swapclose(file_t *file) { tracet(3, "swapclose: fp_tmp=%d\n", file->fp_tmp); - if (file->fp_tmp ) fclose(file->fp_tmp ); + if (file->fp_tmp) fclose(file->fp_tmp); if (file->fp_tag_tmp) fclose(file->fp_tag_tmp); file->fp_tmp = file->fp_tag_tmp = NULL; } @@ -398,7 +407,7 @@ int statefile(file_t *file) /* read file -----------------------------------------------------------------*/ 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; unsigned int t, tick; int nr = 0; @@ -410,7 +419,8 @@ int readfile(file_t *file, unsigned char *buff, int nmax, char *msg) if (file->fp == stdin) { /* input from stdin */ - FD_ZERO(&rs); FD_SET(0, &rs); + FD_ZERO(&rs); + FD_SET(0, &rs); if (!select(1, &rs, NULL, NULL, &tv)) return 0; if ((nr = read(0, buff, nmax)) < 0) return 0; return nr; @@ -419,45 +429,45 @@ int readfile(file_t *file, unsigned char *buff, int nmax, char *msg) { if (file->repmode) { /* slave */ - t = (unsigned int)(tick_master+file->offset); + t = (unsigned int)(tick_master + file->offset); } else { /* master */ - t = (unsigned int)((tickget()-file->tick)*file->speed+file->start*1000.0); + t = (unsigned int)((tickget() - file->tick) * file->speed + file->start * 1000.0); } for (;;) { /* seek file position */ if (fread(&tick, sizeof(tick), 1, file->fp_tag) < 1 || - fread(&fpos, sizeof(fpos), 1, file->fp_tag) < 1) + fread(&fpos, sizeof(fpos), 1, file->fp_tag) < 1) { - if(fseek(file->fp, 0, SEEK_END) != 0) trace(1, "fseek error"); + if (fseek(file->fp, 0, SEEK_END) != 0) trace(1, "fseek error"); sprintf(msg, "end"); break; } - if (file->repmode || file->speed>0.0) + if (file->repmode || file->speed > 0.0) { - if ((int)(tick-t) < 1) continue; + if ((int)(tick - t) < 1) continue; } if (!file->repmode) tick_master = tick; - sprintf(msg, "T%+.1fs", (int)tick < 0 ? 0.0 : (int)tick/1000.0); + sprintf(msg, "T%+.1fs", (int)tick < 0 ? 0.0 : (int)tick / 1000.0); - if ((int)(fpos-file->fpos) >= nmax) + if ((int)(fpos - file->fpos) >= nmax) { - if(fseek(file->fp, fpos, SEEK_SET) != 0) trace(1, "Error fseek"); + if (fseek(file->fp, fpos, SEEK_SET) != 0) trace(1, "Error fseek"); file->fpos = fpos; return 0; } - nmax = (int)(fpos-file->fpos); + nmax = (int)(fpos - file->fpos); - if (file->repmode || file->speed>0.0) + if (file->repmode || file->speed > 0.0) { - if(fseek(file->fp_tag, -(long)(sizeof(tick)+sizeof(fpos)), SEEK_CUR) !=0) trace(1, "Error fseek"); + if (fseek(file->fp_tag, -(long)(sizeof(tick) + sizeof(fpos)), SEEK_CUR) != 0) trace(1, "Error fseek"); } break; } } - if (nmax>0) + if (nmax > 0) { nr = fread(buff, 1, nmax, file->fp); file->fpos += nr; @@ -483,20 +493,20 @@ int writefile(file_t *file, unsigned char *buff, int n, char *msg) wtime = utc2gpst(timeget()); /* write time in gpst */ /* swap writing file */ - if (file->swapintv>0.0 && file->wtime.time != 0) + if (file->swapintv > 0.0 && file->wtime.time != 0) { - intv = file->swapintv*3600.0; + intv = file->swapintv * 3600.0; tow1 = time2gpst(file->wtime, &week1); tow2 = time2gpst(wtime, &week2); - tow2 += 604800.0*(week2-week1); + tow2 += 604800.0 * (week2 - week1); /* open new swap file */ - if (floor((tow1+fswapmargin)/intv) < floor((tow2+fswapmargin)/intv)) + if (floor((tow1 + fswapmargin) / intv) < floor((tow2 + fswapmargin) / intv)) { swapfile(file, timeadd(wtime, fswapmargin), msg); } /* close old swap file */ - if (floor((tow1-fswapmargin)/intv) < floor((tow2-fswapmargin)/intv)) + if (floor((tow1 - fswapmargin) / intv) < floor((tow2 - fswapmargin) / intv)) { swapclose(file); } @@ -540,13 +550,13 @@ void syncfile(file_t *file1, file_t *file2) if (!file1->fp_tag || !file2->fp_tag) return; file1->repmode = 0; file2->repmode = 1; - file2->offset = (int)(file1->tick_f-file2->tick_f); + file2->offset = (int)(file1->tick_f - file2->tick_f); } /* decode tcp/ntrip path (path=[user[:passwd]@]addr[:port][/mntpnt[:str]]) ---*/ 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; @@ -558,51 +568,56 @@ void decodetcppath(const char *path, char *addr, char *port, char *user, if (mntpnt) *mntpnt = '\0'; if (str) *str = '\0'; - if(strlen(path) < MAXSTRPATH) strcpy(buff, path); + if (strlen(path) < MAXSTRPATH) strcpy(buff, path); if (!(p = strrchr(buff, '@'))) p = buff; if ((p = strchr(p, '/'))) { - if ((q = strchr(p+1, ':'))) + if ((q = strchr(p + 1, ':'))) { - *q = '\0'; if (str) strcpy(str, q+1); + *q = '\0'; + if (str) strcpy(str, q + 1); } - *p = '\0'; if (mntpnt) strcpy(mntpnt, p+1); + *p = '\0'; + if (mntpnt) strcpy(mntpnt, p + 1); } if ((p = strrchr(buff, '@'))) { *p++ = '\0'; if ((q = strchr(buff, ':'))) { - *q = '\0'; if (passwd) strcpy(passwd, q+1); + *q = '\0'; + if (passwd) strcpy(passwd, q + 1); } if (user) strcpy(user, buff); } - else p = buff; + else + p = buff; if ((q = strchr(p, ':'))) { - *q = '\0'; if (port) strcpy(port, q+1); + *q = '\0'; + if (port) strcpy(port, q + 1); } if (addr) strcpy(addr, p); } /* get socket error ----------------------------------------------------------*/ -int errsock(void) {return errno;} +int errsock(void) { return errno; } /* set socket option ---------------------------------------------------------*/ int setsock(socket_t sock, char *msg) { int bs = buffsize, mode = 1; - struct timeval tv = { 0, 0 }; + struct timeval tv = {0, 0}; tracet(3, "setsock: sock=%d\n", sock); if (setsockopt(sock, SOL_SOCKET, SO_RCVTIMEO, (const char *)&tv, sizeof(tv)) == -1 || - setsockopt(sock, SOL_SOCKET, SO_SNDTIMEO, (const char *)&tv, sizeof(tv)) == -1) + setsockopt(sock, SOL_SOCKET, SO_SNDTIMEO, (const char *)&tv, sizeof(tv)) == -1) { sprintf(msg, "sockopt error: notimeo"); tracet(1, "setsock: setsockopt error 1 sock=%d err=%d\n", sock, errsock()); @@ -610,7 +625,7 @@ int setsock(socket_t sock, char *msg) return 0; } if (setsockopt(sock, SOL_SOCKET, SO_RCVBUF, (const char *)&bs, sizeof(bs)) == -1 || - setsockopt(sock, SOL_SOCKET, SO_SNDBUF, (const char *)&bs, sizeof(bs)) == -1) + setsockopt(sock, SOL_SOCKET, SO_SNDBUF, (const char *)&bs, sizeof(bs)) == -1) { tracet(1, "setsock: setsockopt error 2 sock=%d err=%d bs=%d\n", sock, errsock(), bs); sprintf(msg, "sockopt error: bufsiz"); @@ -627,10 +642,11 @@ int setsock(socket_t sock, char *msg) /* non-block accept ----------------------------------------------------------*/ socket_t accept_nb(socket_t sock, struct sockaddr *addr, socklen_t *len) { - struct timeval tv = { 0, 0 }; + struct timeval tv = {0, 0}; fd_set rs; - FD_ZERO(&rs); FD_SET(sock, &rs); - if (!select(sock+1, &rs, NULL, NULL, &tv)) return 0; + FD_ZERO(&rs); + FD_SET(sock, &rs); + if (!select(sock + 1, &rs, NULL, NULL, &tv)) return 0; return accept(sock, addr, len); } @@ -638,18 +654,20 @@ socket_t accept_nb(socket_t sock, struct sockaddr *addr, socklen_t *len) /* non-block connect ---------------------------------------------------------*/ 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; int err, flag; flag = fcntl(sock, F_GETFL, 0); - if(fcntl(sock, F_SETFL, flag|O_NONBLOCK) == -1) trace(1, "fcntl error"); + if (fcntl(sock, F_SETFL, flag | O_NONBLOCK) == -1) trace(1, "fcntl error"); if (connect(sock, addr, len) == -1) { err = errsock(); if (err != EISCONN && err != EINPROGRESS && err != EALREADY) return -1; - FD_ZERO(&rs); FD_SET(sock, &rs); ws = rs; - if (select(sock+1, &rs, &ws, NULL, &tv) == 0) return 0; + FD_ZERO(&rs); + FD_SET(sock, &rs); + ws = rs; + if (select(sock + 1, &rs, &ws, NULL, &tv) == 0) return 0; } return 1; } @@ -658,10 +676,11 @@ int connect_nb(socket_t sock, struct sockaddr *addr, socklen_t len) /* non-block receive ---------------------------------------------------------*/ int recv_nb(socket_t sock, unsigned char *buff, int n) { - struct timeval tv = { 0, 0 }; + struct timeval tv = {0, 0}; fd_set rs; - FD_ZERO(&rs); FD_SET(sock, &rs); - if (!select(sock+1, &rs, NULL, NULL, &tv)) return 0; + FD_ZERO(&rs); + FD_SET(sock, &rs); + if (!select(sock + 1, &rs, NULL, NULL, &tv)) return 0; return recv(sock, (char *)buff, n, 0); } @@ -669,10 +688,11 @@ int recv_nb(socket_t sock, unsigned char *buff, int n) /* non-block send ------------------------------------------------------------*/ int send_nb(socket_t sock, unsigned char *buff, int n) { - struct timeval tv = { 0, 0 }; + struct timeval tv = {0, 0}; fd_set ws; - FD_ZERO(&ws); FD_SET(sock, &ws); - if (!select(sock+1, NULL, &ws, NULL, &tv)) return 0; + FD_ZERO(&ws); + FD_SET(sock, &ws); + if (!select(sock + 1, NULL, &ws, NULL, &tv)) return 0; return send(sock, (char *)buff, n, 0); } @@ -710,7 +730,7 @@ int gentcp(tcp_t *tcp, int type, char *msg) #ifdef SVR_REUSEADDR /* multiple-use of server socket */ setsockopt(tcp->sock, SOL_SOCKET, SO_REUSEADDR, (const char *)&opt, - sizeof(opt)); + sizeof(opt)); #endif if (bind(tcp->sock, (struct sockaddr *)&tcp->addr, sizeof(tcp->addr)) == -1) { @@ -757,9 +777,9 @@ void discontcp(tcp_t *tcp, int tcon) /* open tcp server -----------------------------------------------------------*/ tcpsvr_t *opentcpsvr(const char *path, char *msg) { - tcpsvr_t *tcpsvr, tcpsvr0; // = {{0}}; + tcpsvr_t *tcpsvr, tcpsvr0; // = {{0}}; char port[256] = ""; - tcpsvr0 = { {0, {0}, 0, {0,0,0,{0}},0,0,0,0}, { 0, {0}, 0,{0,0,0,{0}},0,0,0,0} }; + tcpsvr0 = {{0, {0}, 0, {0, 0, 0, {0}}, 0, 0, 0, 0}, {0, {0}, 0, {0, 0, 0, {0}}, 0, 0, 0, 0}}; tracet(3, "opentcpsvr: path=%s\n", path); if (!(tcpsvr = (tcpsvr_t *)malloc(sizeof(tcpsvr_t)))) return NULL; @@ -787,7 +807,7 @@ void closetcpsvr(tcpsvr_t *tcpsvr) { int i; tracet(3, "closetcpsvr:\n"); - for (i = 0;i < MAXCLI;i++) + for (i = 0; i < MAXCLI; i++) { if (tcpsvr->cli[i].state) closesocket(tcpsvr->cli[i].sock); } @@ -806,10 +826,10 @@ void updatetcpsvr(tcpsvr_t *tcpsvr, char *msg) if (tcpsvr->svr.state == 0) return; - for (i = 0;i < MAXCLI;i++) + for (i = 0; i < MAXCLI; i++) { if (tcpsvr->cli[i].state) continue; - for (j = i+1;j < MAXCLI;j++) + for (j = i + 1; j < MAXCLI; j++) { if (!tcpsvr->cli[j].state) continue; tcpsvr->cli[i] = tcpsvr->cli[j]; @@ -817,7 +837,7 @@ void updatetcpsvr(tcpsvr_t *tcpsvr, char *msg) break; } } - for (i = 0;i < MAXCLI;i++) + for (i = 0; i < MAXCLI; i++) { if (!tcpsvr->cli[i].state) continue; strcpy(saddr, tcpsvr->cli[i].saddr); @@ -830,11 +850,13 @@ void updatetcpsvr(tcpsvr_t *tcpsvr, char *msg) return; } tcpsvr->svr.state = 2; - if (n == 1) sprintf(msg, "%s", saddr); else sprintf(msg, "%d clients", n); + if (n == 1) + sprintf(msg, "%s", saddr); + else + sprintf(msg, "%d clients", n); } - /* accept client connection --------------------------------------------------*/ int accsock(tcpsvr_t *tcpsvr, char *msg) { @@ -845,7 +867,8 @@ int accsock(tcpsvr_t *tcpsvr, char *msg) tracet(3, "accsock: sock=%d\n", tcpsvr->svr.sock); - for (i = 0;i < MAXCLI;i++) if (tcpsvr->cli[i].state == 0) break; + for (i = 0; i < MAXCLI; i++) + if (tcpsvr->cli[i].state == 0) break; if (i >= MAXCLI) return 0; /* too many client */ if ((sock = accept_nb(tcpsvr->svr.sock, (struct sockaddr *)&addr, &len)) == (socket_t)-1) @@ -853,7 +876,8 @@ int accsock(tcpsvr_t *tcpsvr, char *msg) err = errsock(); sprintf(msg, "accept error (%d)", err); tracet(1, "accsock: accept error sock=%d err=%d\n", tcpsvr->svr.sock, err); - closesocket(tcpsvr->svr.sock); tcpsvr->svr.state = 0; + closesocket(tcpsvr->svr.sock); + tcpsvr->svr.state = 0; return 0; } if (sock == 0) return 0; @@ -861,7 +885,7 @@ int accsock(tcpsvr_t *tcpsvr, char *msg) tcpsvr->cli[i].sock = sock; if (!setsock(tcpsvr->cli[i].sock, msg)) return 0; memcpy(&tcpsvr->cli[i].addr, &addr, sizeof(addr)); - if(strlen(inet_ntoa(addr.sin_addr)) < 256) strcpy(tcpsvr->cli[i].saddr, inet_ntoa(addr.sin_addr)); + if (strlen(inet_ntoa(addr.sin_addr)) < 256) strcpy(tcpsvr->cli[i].saddr, inet_ntoa(addr.sin_addr)); sprintf(msg, "%s", tcpsvr->cli[i].saddr); tracet(2, "accsock: connected sock=%d addr=%s\n", tcpsvr->cli[i].sock, tcpsvr->cli[i].saddr); tcpsvr->cli[i].state = 2; @@ -875,7 +899,8 @@ int waittcpsvr(tcpsvr_t *tcpsvr, char *msg) { tracet(4, "waittcpsvr: sock=%d state=%d\n", tcpsvr->svr.sock, tcpsvr->svr.state); if (tcpsvr->svr.state <= 0) return 0; - while (accsock(tcpsvr, msg)) ; + while (accsock(tcpsvr, msg)) + ; updatetcpsvr(tcpsvr, msg); return tcpsvr->svr.state == 2; } @@ -899,7 +924,7 @@ int readtcpsvr(tcpsvr_t *tcpsvr, unsigned char *buff, int n, char *msg) updatetcpsvr(tcpsvr, msg); return 0; } - if (nr>0) tcpsvr->cli[0].tact = tickget(); + if (nr > 0) tcpsvr->cli[0].tact = tickget(); tracet(5, "readtcpsvr: exit sock=%d nr=%d\n", tcpsvr->cli[0].sock, nr); return nr; } @@ -914,7 +939,7 @@ int writetcpsvr(tcpsvr_t *tcpsvr, unsigned char *buff, int n, char *msg) if (!waittcpsvr(tcpsvr, msg)) return 0; - for (i = 0;i < MAXCLI;i++) + for (i = 0; i < MAXCLI; i++) { if (tcpsvr->cli[i].state != 2) continue; @@ -927,7 +952,7 @@ int writetcpsvr(tcpsvr_t *tcpsvr, unsigned char *buff, int n, char *msg) updatetcpsvr(tcpsvr, msg); return 0; } - if (ns>0) tcpsvr->cli[i].tact = tickget(); + if (ns > 0) tcpsvr->cli[i].tact = tickget(); tracet(5, "writetcpsvr: send i=%d ns=%d\n", i, ns); } return ns; @@ -950,13 +975,13 @@ int consock(tcpcli_t *tcpcli, char *msg) /* wait re-connect */ if (tcpcli->svr.tcon < 0 || (tcpcli->svr.tcon > 0 && - (int)(tickget()-tcpcli->svr.tdis) < tcpcli->svr.tcon)) + (int)(tickget() - tcpcli->svr.tdis) < tcpcli->svr.tcon)) { return 0; } /* non-block connect */ if ((stat = connect_nb(tcpcli->svr.sock, (struct sockaddr *)&tcpcli->svr.addr, - sizeof(tcpcli->svr.addr))) == -1) + sizeof(tcpcli->svr.addr))) == -1) { err = errsock(); sprintf(msg, "connect error (%d)", err); @@ -981,9 +1006,9 @@ int consock(tcpcli_t *tcpcli, char *msg) /* open tcp client -----------------------------------------------------------*/ tcpcli_t *opentcpcli(const char *path, char *msg) { - tcpcli_t *tcpcli, tcpcli0; // = {{0}}; + tcpcli_t *tcpcli, tcpcli0; // = {{0}}; char port[256] = ""; - tcpcli0 = {{0, {0}, 0, {0,0,0,{0}},0,0,0,0}, 0, 0}; + tcpcli0 = {{0, {0}, 0, {0, 0, 0, {0}}, 0, 0, 0, 0}, 0, 0}; tracet(3, "opentcpcli: path=%s\n", path); @@ -1030,8 +1055,8 @@ int waittcpcli(tcpcli_t *tcpcli, char *msg) } if (tcpcli->svr.state == 2) { /* connect */ - if (tcpcli->toinact>0 && - (int)(tickget()-tcpcli->svr.tact)>tcpcli->toinact) + if (tcpcli->toinact > 0 && + (int)(tickget() - tcpcli->svr.tact) > tcpcli->toinact) { sprintf(msg, "timeout"); tracet(2, "waittcpcli: inactive timeout sock=%d\n", tcpcli->svr.sock); @@ -1060,7 +1085,7 @@ int readtcpcli(tcpcli_t *tcpcli, unsigned char *buff, int n, char *msg) discontcp(&tcpcli->svr, tcpcli->tirecon); return 0; } - if (nr>0) tcpcli->svr.tact = tickget(); + if (nr > 0) tcpcli->svr.tact = tickget(); tracet(5, "readtcpcli: exit sock=%d nr=%d\n", tcpcli->svr.sock, nr); return nr; } @@ -1083,7 +1108,7 @@ int writetcpcli(tcpcli_t *tcpcli, unsigned char *buff, int n, char *msg) discontcp(&tcpcli->svr, tcpcli->tirecon); return 0; } - if (ns>0) tcpcli->svr.tact = tickget(); + if (ns > 0) tcpcli->svr.tact = tickget(); tracet(5, "writetcpcli: exit sock=%d ns=%d\n", tcpcli->svr.sock, ns); return ns; } @@ -1100,20 +1125,21 @@ int statetcpcli(tcpcli_t *tcpcli) int encbase64(char *str, const unsigned char *byte, int n) { const char table[] = - "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; int i, j, k, b; tracet(4, "encbase64: n=%d\n", n); - for (i = j = 0;i/8 < n;) + for (i = j = 0; i / 8 < n;) { - for (k = b = 0;k < 6;k++, i++) + for (k = b = 0; k < 6; k++, i++) { - b<<=1; if (i/8 < n) b |= (byte[i/8] >> (7-i%8)) & 0x1; + b <<= 1; + if (i / 8 < n) b |= (byte[i / 8] >> (7 - i % 8)) & 0x1; } str[j++] = table[b]; } - while (j&0x3) str[j++] = '='; + while (j & 0x3) str[j++] = '='; str[j] = '\0'; tracet(5, "encbase64: str=%s\n", str); return j; @@ -1123,7 +1149,7 @@ int encbase64(char *str, const unsigned char *byte, int n) /* send ntrip server request -------------------------------------------------*/ int reqntrip_s(ntrip_t *ntrip, char *msg) { - char buff[256+NTRIP_MAXSTR], *p = buff; + char buff[256 + NTRIP_MAXSTR], *p = buff; tracet(3, "reqntrip_s: state=%d\n", ntrip->state); @@ -1132,10 +1158,10 @@ int reqntrip_s(ntrip_t *ntrip, char *msg) p += sprintf(p, "STR: %s\r\n", ntrip->str); p += sprintf(p, "\r\n"); - if (writetcpcli(ntrip->tcp, (unsigned char *)buff, p-buff, msg) != p-buff) return 0; + if (writetcpcli(ntrip->tcp, (unsigned char *)buff, p - buff, msg) != p - buff) return 0; - tracet(2, "reqntrip_s: send request state=%d ns=%d\n", ntrip->state, p-buff); - tracet(5, "reqntrip_s: n=%d buff=\n%s\n", p-buff, buff); + tracet(2, "reqntrip_s: send request state=%d ns=%d\n", ntrip->state, p - buff); + tracet(5, "reqntrip_s: n=%d buff=\n%s\n", p - buff, buff); ntrip->state = 1; return 1; } @@ -1165,10 +1191,10 @@ int reqntrip_c(ntrip_t *ntrip, char *msg) } p += sprintf(p, "\r\n"); - if (writetcpcli(ntrip->tcp, (unsigned char *)buff, p-buff, msg) != p-buff) return 0; + if (writetcpcli(ntrip->tcp, (unsigned char *)buff, p - buff, msg) != p - buff) return 0; - tracet(2, "reqntrip_c: send request state=%d ns=%d\n", ntrip->state, p-buff); - tracet(5, "reqntrip_c: n=%d buff=\n%s\n", p-buff, buff); + tracet(2, "reqntrip_c: send request state=%d ns=%d\n", ntrip->state, p - buff); + tracet(5, "reqntrip_c: n=%d buff=\n%s\n", p - buff, buff); ntrip->state = 1; return 1; } @@ -1188,8 +1214,8 @@ int rspntrip_s(ntrip_t *ntrip, char *msg) { /* ok */ q = (char *)ntrip->buff; p += strlen(NTRIP_RSP_OK_SVR); - ntrip->nb -= p-q; - for (i = 0;i < ntrip->nb;i++) *q++ = *p++; + ntrip->nb -= p - q; + for (i = 0; i < ntrip->nb; i++) *q++ = *p++; ntrip->state = 2; sprintf(msg, "%s/%s", ntrip->tcp->svr.saddr, ntrip->mntpnt); tracet(2, "rspntrip_s: response ok nb=%d\n", ntrip->nb); @@ -1198,7 +1224,8 @@ int rspntrip_s(ntrip_t *ntrip, char *msg) else if ((p = strstr((char *)ntrip->buff, NTRIP_RSP_ERROR))) { /* error */ nb = ntrip->nb < MAXSTATMSG ? ntrip->nb : MAXSTATMSG; - strncpy(msg, (char *)ntrip->buff, nb); msg[nb] = 0; + strncpy(msg, (char *)ntrip->buff, nb); + msg[nb] = 0; tracet(1, "rspntrip_s: %s nb=%d\n", msg, ntrip->nb); ntrip->nb = 0; ntrip->buff[0] = '\0'; @@ -1233,8 +1260,8 @@ int rspntrip_c(ntrip_t *ntrip, char *msg) { /* ok */ q = (char *)ntrip->buff; p += strlen(NTRIP_RSP_OK_CLI); - ntrip->nb -= p-q; - for (i = 0;i < ntrip->nb;i++) *q++ = *p++; + ntrip->nb -= p - q; + for (i = 0; i < ntrip->nb; i++) *q++ = *p++; ntrip->state = 2; sprintf(msg, "%s/%s", ntrip->tcp->svr.saddr, ntrip->mntpnt); tracet(2, "rspntrip_c: response ok nb=%d\n", ntrip->nb); @@ -1258,7 +1285,10 @@ int rspntrip_c(ntrip_t *ntrip, char *msg) } else if ((p = strstr((char *)ntrip->buff, NTRIP_RSP_HTTP))) { /* http response */ - if ((q = strchr(p, '\r'))) *q = '\0'; else ntrip->buff[128] = '\0'; + if ((q = strchr(p, '\r'))) + *q = '\0'; + else + ntrip->buff[128] = '\0'; strcpy(msg, p); tracet(1, "rspntrip_s: %s nb=%d\n", msg, ntrip->nb); ntrip->nb = 0; @@ -1300,18 +1330,20 @@ int waitntrip(ntrip_t *ntrip, char *msg) } tracet(2, "waitntrip: state=%d nb=%d\n", ntrip->state, ntrip->nb); } - if (ntrip->state == 1) { /* read response */ - p = (char *)ntrip->buff+ntrip->nb; - if ((n = readtcpcli(ntrip->tcp, (unsigned char *)p, NTRIP_MAXRSP-ntrip->nb-1, msg)) == 0) + if (ntrip->state == 1) + { /* read response */ + p = (char *)ntrip->buff + ntrip->nb; + if ((n = readtcpcli(ntrip->tcp, (unsigned char *)p, NTRIP_MAXRSP - ntrip->nb - 1, msg)) == 0) { tracet(5, "waitntrip: readtcp n=%d\n", n); return 0; } - ntrip->nb += n; ntrip->buff[ntrip->nb] = '\0'; + ntrip->nb += n; + ntrip->buff[ntrip->nb] = '\0'; /* wait response */ return ntrip->type == 0 ? rspntrip_s(ntrip, msg) : rspntrip_c(ntrip, msg); - } + } return 1; } @@ -1332,11 +1364,11 @@ ntrip_t *openntrip(const char *path, int type, char *msg) ntrip->nb = 0; ntrip->url[0] = '\0'; ntrip->mntpnt[0] = ntrip->user[0] = ntrip->passwd[0] = ntrip->str[0] = '\0'; - for (i = 0;i < NTRIP_MAXRSP;i++) ntrip->buff[i] = 0; + for (i = 0; i < NTRIP_MAXRSP; i++) ntrip->buff[i] = 0; /* decode tcp/ntrip path */ decodetcppath(path, addr, port, ntrip->user, ntrip->passwd, ntrip->mntpnt, - ntrip->str); + ntrip->str); /* use default port if no port specified */ if (!*port) @@ -1379,10 +1411,10 @@ int readntrip(ntrip_t *ntrip, unsigned char *buff, int n, char *msg) tracet(4, "readntrip: n=%d\n", n); if (!waitntrip(ntrip, msg)) return 0; - if (ntrip->nb>0) + if (ntrip->nb > 0) { /* read response buffer first */ nb = ntrip->nb <= n ? ntrip->nb : n; - memcpy(buff, ntrip->buff+ntrip->nb-nb, nb); + memcpy(buff, ntrip->buff + ntrip->nb - nb, nb); ntrip->nb = 0; return nb; } @@ -1409,7 +1441,7 @@ int statentrip(ntrip_t *ntrip) /* decode ftp path ----------------------------------------------------------*/ void decodeftppath(const char *path, char *addr, char *file, char *user, - char *passwd, int *topts) + char *passwd, int *topts) { char buff[MAXSTRPATH], *p, *q; @@ -1424,30 +1456,34 @@ void decodeftppath(const char *path, char *addr, char *file, char *user, topts[2] = 0; /* download time offset (s) */ topts[3] = 0; /* retry interval (s) (0: no retry) */ } - if(strlen(path) < MAXSTRPATH) strcpy(buff, path); + if (strlen(path) < MAXSTRPATH) strcpy(buff, path); if ((p = strchr(buff, '/'))) { - if ((q = strstr(p+1, "::"))) + if ((q = strstr(p + 1, "::"))) { *q = '\0'; - if (topts) sscanf(q+2, "T=%d, %d, %d, %d", topts, topts+1, topts+2, topts+3); + if (topts) sscanf(q + 2, "T=%d, %d, %d, %d", topts, topts + 1, topts + 2, topts + 3); } - strcpy(file, p+1); + strcpy(file, p + 1); *p = '\0'; } - else file[0] = '\0'; + else + file[0] = '\0'; if ((p = strrchr(buff, '@'))) { *p++ = '\0'; if ((q = strchr(buff, ':'))) { - *q = '\0'; if (passwd) strcpy(passwd, q+1); + *q = '\0'; + if (passwd) strcpy(passwd, q + 1); } - *q = '\0'; if (user) strcpy(user, buff); + *q = '\0'; + if (user) strcpy(user, buff); } - else p = buff; + else + p = buff; strcpy(addr, p); } @@ -1461,21 +1497,21 @@ gtime_t nextdltime(const int *topts, int stat) int week, tint; 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); /* current time (gpst) */ time = utc2gpst(timeget()); tow = time2gpst(time, &week); /* next retry time */ - if (stat == 0 && topts[3]>0) + if (stat == 0 && topts[3] > 0) { - tow = (floor((tow-topts[2])/topts[3])+1.0)*topts[3]+topts[2]; + tow = (floor((tow - topts[2]) / topts[3]) + 1.0) * topts[3] + topts[2]; return gpst2time(week, tow); } /* next interval time */ - tint = topts[1] <= 0 ? 3600:topts[1]; - tow = (floor((tow-topts[2])/tint)+1.0)*tint+topts[2]; + tint = topts[1] <= 0 ? 3600 : topts[1]; + tow = (floor((tow - topts[2]) / tint) + 1.0) * tint + topts[2]; time = gpst2time(week, tow); return time; @@ -1489,7 +1525,7 @@ void *ftpthread(void *arg) FILE *fp; gtime_t time; char remote[1024], local[1024], tmpfile[1024], errfile[1024], *p; - char cmd[2048], env[1024] = "", opt[1024], *proxyopt = (char*)"", *proto; + char cmd[2048], env[1024] = "", opt[1024], *proxyopt = (char *)"", *proto; int ret; tracet(3, "ftpthread:\n"); @@ -1505,15 +1541,18 @@ void *ftpthread(void *arg) time = timeadd(utc2gpst(timeget()), ftp->topts[0]); reppath(ftp->file, remote, time, "", ""); - if ((p = strrchr(remote, '/'))) p++; else p = remote; + if ((p = strrchr(remote, '/'))) + p++; + else + p = remote; sprintf(local, "%s%c%s", localdir, FILEPATHSEP, p); sprintf(errfile, "%s.err", local); /* if local file exist, skip download */ strcpy(tmpfile, local); if ((p = strrchr(tmpfile, '.')) && - (!strcmp(p, ".z") || !strcmp(p, ".gz") || !strcmp(p, ".zip") || - !strcmp(p, ".Z") || !strcmp(p, ".GZ") || !strcmp(p, ".ZIP"))) + (!strcmp(p, ".z") || !strcmp(p, ".gz") || !strcmp(p, ".zip") || + !strcmp(p, ".Z") || !strcmp(p, ".GZ") || !strcmp(p, ".ZIP"))) { *p = '\0'; } @@ -1528,44 +1567,44 @@ void *ftpthread(void *arg) /* proxy settings for wget (ref [2]) */ if (*proxyaddr) { - proto = ftp->proto ? (char*)"http" : (char*)"ftp"; + proto = ftp->proto ? (char *)"http" : (char *)"ftp"; sprintf(env, "set %s_proxy=http://%s & ", proto, proxyaddr); - proxyopt = (char*)"--proxy=on "; + proxyopt = (char *)"--proxy=on "; } /* download command (ref [2]) */ if (ftp->proto == 0) { /* ftp */ sprintf(opt, "--ftp-user=%s --ftp-password=%s --glob=off --passive-ftp %s-t 1 -T %d -O \"%s\"", - ftp->user, ftp->passwd, proxyopt, FTP_TIMEOUT, local); + ftp->user, ftp->passwd, proxyopt, FTP_TIMEOUT, local); sprintf(cmd, "%s%s %s \"ftp://%s/%s\" 2> \"%s\"\n", env, FTP_CMD, opt, ftp->addr, - remote, errfile); + remote, errfile); } else { /* http */ sprintf(opt, "%s-t 1 -T %d -O \"%s\"", proxyopt, FTP_TIMEOUT, local); sprintf(cmd, "%s%s %s \"http://%s/%s\" 2> \"%s\"\n", env, FTP_CMD, opt, ftp->addr, - remote, errfile); + remote, errfile); } /* execute download command */ if ((ret = execcmd(cmd))) { - if(remove(local) != 0) trace(1, "Error removing file"); + if (remove(local) != 0) trace(1, "Error removing file"); tracet(1, "execcmd error: cmd=%s ret=%d\n", cmd, ret); ftp->error = ret; ftp->state = 3; return 0; } - if(remove(errfile) != 0) trace(1, "Error removing file"); + if (remove(errfile) != 0) trace(1, "Error removing file"); /* uncompress downloaded file */ if ((p = strrchr(local, '.')) && - (!strcmp(p, ".z") || !strcmp(p, ".gz") || !strcmp(p, ".zip") || - !strcmp(p, ".Z") || !strcmp(p, ".GZ") || !strcmp(p, ".ZIP"))) + (!strcmp(p, ".z") || !strcmp(p, ".gz") || !strcmp(p, ".zip") || + !strcmp(p, ".Z") || !strcmp(p, ".GZ") || !strcmp(p, ".ZIP"))) { if (rtk_uncompress(local, tmpfile)) { - if(remove(local) != 0) trace(1, "Error removing file"); - if(strlen(tmpfile) < 1024) strcpy(local, tmpfile); + if (remove(local) != 0) trace(1, "Error removing file"); + if (strlen(tmpfile) < 1024) strcpy(local, tmpfile); } else { @@ -1575,7 +1614,7 @@ void *ftpthread(void *arg) return 0; } } - if(strlen(local) < 1024 ) strcpy(ftp->local, local); + if (strlen(local) < 1024) strcpy(ftp->local, local); ftp->state = 2; /* ftp completed */ tracet(3, "ftpthread: complete cmd=%s\n", cmd); @@ -1660,7 +1699,7 @@ int readftp(ftp_t *ftp, unsigned char *buff, int n, char *msg) /* return local file path if ftp completed */ p = buff; q = (unsigned char *)ftp->local; - while (*q && (int)(p-buff) < n) *p++ = *q++; + while (*q && (int)(p - buff) < n) *p++ = *q++; p += sprintf((char *)p, "\r\n"); /* set next download time */ @@ -1669,7 +1708,7 @@ int readftp(ftp_t *ftp, unsigned char *buff, int n, char *msg) strcpy(msg, ""); - return (int)(p-buff); + return (int)(p - buff); } @@ -1708,7 +1747,7 @@ void strinit(stream_t *stream) initlock(&stream->lock); stream->port = NULL; stream->path[0] = '\0'; - stream->msg [0] = '\0'; + stream->msg[0] = '\0'; } @@ -1753,24 +1792,42 @@ int stropen(stream_t *stream, int type, int mode, const char *path) stream->type = type; stream->mode = mode; - if(strlen(path) < MAXSTRPATH ) strcpy(stream->path, path); + if (strlen(path) < MAXSTRPATH) strcpy(stream->path, path); stream->inb = stream->inr = stream->outb = stream->outr = 0; stream->tick = tickget(); stream->inbt = stream->outbt = 0; stream->msg[0] = '\0'; stream->port = NULL; switch (type) - { - case STR_SERIAL : stream->port = openserial(path, mode, stream->msg); break; - case STR_FILE : stream->port = openfile(path, mode, stream->msg); break; - case STR_TCPSVR : stream->port = opentcpsvr(path, stream->msg); break; - case STR_TCPCLI : stream->port = opentcpcli(path, stream->msg); break; - case STR_NTRIPSVR: stream->port = openntrip(path, 0, stream->msg); break; - case STR_NTRIPCLI: stream->port = openntrip(path, 1, stream->msg); break; - case STR_FTP : stream->port = openftp(path, 0, stream->msg); break; - case STR_HTTP : stream->port = openftp(path, 1, stream->msg); break; - default: stream->state = 0; return 1; - } + { + case STR_SERIAL: + stream->port = openserial(path, mode, stream->msg); + break; + case STR_FILE: + stream->port = openfile(path, mode, stream->msg); + break; + case STR_TCPSVR: + stream->port = opentcpsvr(path, stream->msg); + break; + case STR_TCPCLI: + stream->port = opentcpcli(path, stream->msg); + break; + case STR_NTRIPSVR: + stream->port = openntrip(path, 0, stream->msg); + break; + case STR_NTRIPCLI: + stream->port = openntrip(path, 1, stream->msg); + break; + case STR_FTP: + stream->port = openftp(path, 0, stream->msg); + break; + case STR_HTTP: + stream->port = openftp(path, 1, stream->msg); + break; + default: + stream->state = 0; + return 1; + } stream->state = !stream->port ? -1 : 1; return stream->port != NULL; } @@ -1788,16 +1845,32 @@ void strclose(stream_t *stream) if (stream->port) { switch (stream->type) - { - case STR_SERIAL : closeserial((serial_t *)stream->port); break; - case STR_FILE : closefile ((file_t *)stream->port); break; - case STR_TCPSVR : closetcpsvr((tcpsvr_t *)stream->port); break; - case STR_TCPCLI : closetcpcli((tcpcli_t *)stream->port); break; - case STR_NTRIPSVR: closentrip ((ntrip_t *)stream->port); break; - case STR_NTRIPCLI: closentrip ((ntrip_t *)stream->port); break; - case STR_FTP : closeftp ((ftp_t *)stream->port); break; - case STR_HTTP : closeftp ((ftp_t *)stream->port); break; - } + { + case STR_SERIAL: + closeserial((serial_t *)stream->port); + break; + case STR_FILE: + closefile((file_t *)stream->port); + break; + case STR_TCPSVR: + closetcpsvr((tcpsvr_t *)stream->port); + break; + case STR_TCPCLI: + closetcpcli((tcpcli_t *)stream->port); + break; + case STR_NTRIPSVR: + closentrip((ntrip_t *)stream->port); + break; + case STR_NTRIPCLI: + closentrip((ntrip_t *)stream->port); + break; + case STR_FTP: + closeftp((ftp_t *)stream->port); + break; + case STR_HTTP: + closeftp((ftp_t *)stream->port); + break; + } } else { @@ -1824,8 +1897,8 @@ void strsync(stream_t *stream1, stream_t *stream2) { file_t *file1, *file2; if (stream1->type != STR_FILE || stream2->type != STR_FILE) return; - file1 = (file_t*)stream1->port; - file2 = (file_t*)stream2->port; + file1 = (file_t *)stream1->port; + file2 = (file_t *)stream2->port; if (file1 && file2) syncfile(file1, file2); } @@ -1835,9 +1908,9 @@ void strsync(stream_t *stream1, stream_t *stream2) * args : stream_t *stream I stream * return : none *-----------------------------------------------------------------------------*/ -void strlock (stream_t *stream) {rtk_lock (&stream->lock);} +void strlock(stream_t *stream) { rtk_lock(&stream->lock); } -void strunlock(stream_t *stream) {rtk_unlock(&stream->lock);} +void strunlock(stream_t *stream) { rtk_unlock(&stream->lock); } /* read stream ----------------------------------------------------------------- @@ -1856,30 +1929,46 @@ int strread(stream_t *stream, unsigned char *buff, int n) tracet(4, "strread: n=%d\n", n); - if (!(stream->mode&STR_MODE_R) || !stream->port) return 0; + if (!(stream->mode & STR_MODE_R) || !stream->port) return 0; strlock(stream); switch (stream->type) - { - case STR_SERIAL : nr = readserial((serial_t *)stream->port, buff, n, msg); break; - case STR_FILE : nr = readfile ((file_t *)stream->port, buff, n, msg); break; - case STR_TCPSVR : nr = readtcpsvr((tcpsvr_t *)stream->port, buff, n, msg); break; - case STR_TCPCLI : nr = readtcpcli((tcpcli_t *)stream->port, buff, n, msg); break; - case STR_NTRIPCLI: nr = readntrip ((ntrip_t *)stream->port, buff, n, msg); break; - case STR_FTP : nr = readftp ((ftp_t *)stream->port, buff, n, msg); break; - case STR_HTTP : nr = readftp ((ftp_t *)stream->port, buff, n, msg); break; - default: - strunlock(stream); - return 0; - } - stream->inb += nr; - tick = tickget(); if (nr>0) stream->tact = tick; - - if ((int)(tick-stream->tick) >= tirate) { - stream->inr = (stream->inb-stream->inbt)*8000/(tick-stream->tick); - stream->tick = tick; stream->inbt = stream->inb; + case STR_SERIAL: + nr = readserial((serial_t *)stream->port, buff, n, msg); + break; + case STR_FILE: + nr = readfile((file_t *)stream->port, buff, n, msg); + break; + case STR_TCPSVR: + nr = readtcpsvr((tcpsvr_t *)stream->port, buff, n, msg); + break; + case STR_TCPCLI: + nr = readtcpcli((tcpcli_t *)stream->port, buff, n, msg); + break; + case STR_NTRIPCLI: + nr = readntrip((ntrip_t *)stream->port, buff, n, msg); + break; + case STR_FTP: + nr = readftp((ftp_t *)stream->port, buff, n, msg); + break; + case STR_HTTP: + nr = readftp((ftp_t *)stream->port, buff, n, msg); + break; + default: + strunlock(stream); + return 0; + } + stream->inb += nr; + tick = tickget(); + if (nr > 0) stream->tact = tick; + + if ((int)(tick - stream->tick) >= tirate) + { + stream->inr = (stream->inb - stream->inbt) * 8000 / (tick - stream->tick); + stream->tick = tick; + stream->inbt = stream->inb; } strunlock(stream); return nr; @@ -1902,31 +1991,43 @@ int strwrite(stream_t *stream, unsigned char *buff, int n) tracet(3, "strwrite: n=%d\n", n); - if (!(stream->mode&STR_MODE_W) || !stream->port) return 0; + if (!(stream->mode & STR_MODE_W) || !stream->port) return 0; strlock(stream); switch (stream->type) - { - case STR_SERIAL : ns = writeserial((serial_t *)stream->port, buff, n, msg); break; - case STR_FILE : ns = writefile ((file_t *)stream->port, buff, n, msg); break; - case STR_TCPSVR : ns = writetcpsvr((tcpsvr_t *)stream->port, buff, n, msg); break; - case STR_TCPCLI : ns = writetcpcli((tcpcli_t *)stream->port, buff, n, msg); break; - case STR_NTRIPCLI: - case STR_NTRIPSVR: ns = writentrip ((ntrip_t *)stream->port, buff, n, msg); break; - case STR_FTP : - case STR_HTTP : - default: - strunlock(stream); - return 0; - } - stream->outb += ns; - tick = tickget(); if (ns>0) stream->tact = tick; - - if ((int)(tick-stream->tick)>tirate) { - stream->outr = (stream->outb-stream->outbt)*8000/(tick-stream->tick); - stream->tick = tick; stream->outbt = stream->outb; + case STR_SERIAL: + ns = writeserial((serial_t *)stream->port, buff, n, msg); + break; + case STR_FILE: + ns = writefile((file_t *)stream->port, buff, n, msg); + break; + case STR_TCPSVR: + ns = writetcpsvr((tcpsvr_t *)stream->port, buff, n, msg); + break; + case STR_TCPCLI: + ns = writetcpcli((tcpcli_t *)stream->port, buff, n, msg); + break; + case STR_NTRIPCLI: + case STR_NTRIPSVR: + ns = writentrip((ntrip_t *)stream->port, buff, n, msg); + break; + case STR_FTP: + case STR_HTTP: + default: + strunlock(stream); + return 0; + } + stream->outb += ns; + tick = tickget(); + if (ns > 0) stream->tact = tick; + + if ((int)(tick - stream->tick) > tirate) + { + stream->outr = (stream->outb - stream->outbt) * 8000 / (tick - stream->tick); + stream->tick = tick; + stream->outbt = stream->outb; } strunlock(stream); return ns; @@ -1948,7 +2049,8 @@ int strstat(stream_t *stream, char *msg) strlock(stream); if (msg) { - strncpy(msg, stream->msg, MAXSTRMSG-1); msg[MAXSTRMSG-1] = '\0'; + strncpy(msg, stream->msg, MAXSTRMSG - 1); + msg[MAXSTRMSG - 1] = '\0'; } if (!stream->port) { @@ -1956,20 +2058,34 @@ int strstat(stream_t *stream, char *msg) return stream->state; } switch (stream->type) - { - case STR_SERIAL : state = stateserial((serial_t *)stream->port); break; - case STR_FILE : state = statefile ((file_t *)stream->port); break; - case STR_TCPSVR : state = statetcpsvr((tcpsvr_t *)stream->port); break; - case STR_TCPCLI : state = statetcpcli((tcpcli_t *)stream->port); break; - case STR_NTRIPSVR: - case STR_NTRIPCLI: state = statentrip ((ntrip_t *)stream->port); break; - case STR_FTP : state = stateftp ((ftp_t *)stream->port); break; - case STR_HTTP : state = stateftp ((ftp_t *)stream->port); break; - default: - strunlock(stream); - return 0; - } - if (state == 2 && (int)(tickget()-stream->tact) <= TINTACT) state = 3; + { + case STR_SERIAL: + state = stateserial((serial_t *)stream->port); + break; + case STR_FILE: + state = statefile((file_t *)stream->port); + break; + case STR_TCPSVR: + state = statetcpsvr((tcpsvr_t *)stream->port); + break; + case STR_TCPCLI: + state = statetcpcli((tcpcli_t *)stream->port); + break; + case STR_NTRIPSVR: + case STR_NTRIPCLI: + state = statentrip((ntrip_t *)stream->port); + break; + case STR_FTP: + state = stateftp((ftp_t *)stream->port); + break; + case STR_HTTP: + state = stateftp((ftp_t *)stream->port); + break; + default: + strunlock(stream); + return 0; + } + if (state == 2 && (int)(tickget() - stream->tact) <= TINTACT) state = 3; strunlock(stream); return state; } @@ -1989,8 +2105,8 @@ void strsum(stream_t *stream, int *inb, int *inr, int *outb, int *outr) tracet(4, "strsum:\n"); strlock(stream); - if (inb) *inb = stream->inb; - if (inr) *inr = stream->inr; + if (inb) *inb = stream->inb; + if (inr) *inr = stream->inr; if (outb) *outb = stream->outb; if (outr) *outr = stream->outr; strunlock(stream); @@ -2013,12 +2129,12 @@ void strsum(stream_t *stream, int *inb, int *inr, int *outb, int *outr) void strsetopt(const int *opt) { tracet(3, "strsetopt: opt=%d %d %d %d %d %d %d %d\n", opt[0], opt[1], opt[2], - opt[3], opt[4], opt[5], opt[6], opt[7]); + opt[3], opt[4], opt[5], opt[6], opt[7]); - toinact = 0 < opt[0] && opt[0] < 1000 ? 1000 : opt[0]; /* >=1s */ - ticonnect = opt[1] < 1000 ? 1000 : opt[1]; /* >=1s */ - tirate = opt[2] < 100 ? 100 : opt[2]; /* >=0.1s */ - buffsize = opt[3] < 4096 ? 4096 : opt[3]; /* >=4096byte */ + toinact = 0 < opt[0] && opt[0] < 1000 ? 1000 : opt[0]; /* >=1s */ + ticonnect = opt[1] < 1000 ? 1000 : opt[1]; /* >=1s */ + tirate = opt[2] < 100 ? 100 : opt[2]; /* >=0.1s */ + buffsize = opt[3] < 4096 ? 4096 : opt[3]; /* >=4096byte */ fswapmargin = opt[4] < 0 ? 0 : opt[4]; } @@ -2044,7 +2160,8 @@ void strsettimeout(stream_t *stream, int toinact, int tirecon) { tcpcli = ((ntrip_t *)stream->port)->tcp; } - else return; + else + return; tcpcli->toinact = toinact; tcpcli->tirecon = tirecon; @@ -2071,7 +2188,7 @@ void strsetdir(const char *dir) void strsetproxy(const char *addr) { tracet(3, "strsetproxy: addr=%s\n", addr); - if(strlen(addr) < 256) strcpy(proxyaddr, addr); + if (strlen(addr) < 256) strcpy(proxyaddr, addr); } @@ -2083,8 +2200,8 @@ void strsetproxy(const char *addr) gtime_t strgettime(stream_t *stream) { file_t *file; - if (stream->type == STR_FILE && (stream->mode&STR_MODE_R) && - (file = (file_t *)stream->port)) + if (stream->type == STR_FILE && (stream->mode & STR_MODE_R) && + (file = (file_t *)stream->port)) { return timeadd(file->time, file->start); /* replay start time */ } @@ -2100,7 +2217,7 @@ gtime_t strgettime(stream_t *stream) *-----------------------------------------------------------------------------*/ 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]; int i, n; @@ -2108,7 +2225,7 @@ void strsendnmea(stream_t *stream, const double *pos) sol.stat = SOLQ_SINGLE; sol.time = utc2gpst(timeget()); - for (i = 0;i < 3;i++) sol.rr[i] = pos[i]; + for (i = 0; i < 3; i++) sol.rr[i] = pos[i]; n = outnmea_gga(buff, &sol); strwrite(stream, buff, n); } @@ -2125,15 +2242,15 @@ int gen_hex(const char *msg, unsigned char *buff) trace(4, "gen_hex: msg=%s\n", msg); strncpy(mbuff, msg, 1023); - for (p = strtok(mbuff, " ");p && narg < 256;p = strtok(NULL, " ")) + for (p = strtok(mbuff, " "); p && narg < 256; p = strtok(NULL, " ")) { args[narg++] = p; } - for (i = 0;i < narg;i++) + for (i = 0; i < narg; i++) { if (sscanf(args[i], "%x", &byte)) *q++ = (unsigned char)byte; } - return (int)(q-buff); + return (int)(q - buff); } @@ -2154,8 +2271,11 @@ void strsendcmd(stream_t *str, const char *cmd) for (;;) { - for (q = p;;q++) if (*q == '\r' || *q == '\n' || *q == '\0') break; - n = (int)(q-p); strncpy(msg, p, n); msg[n] = '\0'; + for (q = p;; q++) + if (*q == '\r' || *q == '\n' || *q == '\0') break; + n = (int)(q - p); + strncpy(msg, p, n); + msg[n] = '\0'; if (!*msg || *msg == '#') { /* null or comment */ @@ -2163,10 +2283,10 @@ void strsendcmd(stream_t *str, const char *cmd) } else if (*msg == '!') { /* binary escape */ - if (!strncmp(msg+1, "WAIT", 4)) + if (!strncmp(msg + 1, "WAIT", 4)) { /* wait */ - if (sscanf(msg+5, "%d", &ms) < 1) ms = 100; - if (ms>3000) ms = 3000; /* max 3 s */ + if (sscanf(msg + 5, "%d", &ms) < 1) ms = 100; + if (ms > 3000) ms = 3000; /* max 3 s */ sleepms(ms); } @@ -2186,9 +2306,9 @@ void strsendcmd(stream_t *str, const char *cmd) //{ /* lex receiver */ // if ((m=gen_lexr(msg+5, buff))>0) strwrite(str, buff, m); //} - else if (!strncmp(msg+1, "HEX", 3)) + else if (!strncmp(msg + 1, "HEX", 3)) { /* general hex message */ - if ((m = gen_hex(msg+4, buff))>0) strwrite(str, buff, m); + if ((m = gen_hex(msg + 4, buff)) > 0) strwrite(str, buff, m); } } else @@ -2196,6 +2316,9 @@ void strsendcmd(stream_t *str, const char *cmd) strwrite(str, (unsigned char *)msg, n); strwrite(str, (unsigned char *)cmdend, 2); } - if (*q == '\0') break; else p = q+1; + if (*q == '\0') + break; + else + p = q + 1; } } diff --git a/src/algorithms/libs/rtklib/rtklib_stream.h b/src/algorithms/libs/rtklib/rtklib_stream.h index 113d004c7..175c5b063 100644 --- a/src/algorithms/libs/rtklib/rtklib_stream.h +++ b/src/algorithms/libs/rtklib/rtklib_stream.h @@ -50,34 +50,34 @@ * *-----------------------------------------------------------------------------*/ - #ifndef GNSS_SDR_RTKLIB_STREAM_H_ - #define GNSS_SDR_RTKLIB_STREAM_H_ +#ifndef GNSS_SDR_RTKLIB_STREAM_H_ +#define GNSS_SDR_RTKLIB_STREAM_H_ #include "rtklib.h" /* constants -----------------------------------------------------------------*/ -#define TINTACT 200 /* period for stream active (ms) */ -#define SERIBUFFSIZE 4096 /* serial buffer size (bytes) */ -#define TIMETAGH_LEN 64 /* time tag file header length */ -#define MAXCLI 32 /* max client connection for tcp svr */ -#define MAXSTATMSG 32 /* max length of status message */ +#define TINTACT 200 /* period for stream active (ms) */ +#define SERIBUFFSIZE 4096 /* serial buffer size (bytes) */ +#define TIMETAGH_LEN 64 /* time tag file header length */ +#define MAXCLI 32 /* max client connection for tcp svr */ +#define MAXSTATMSG 32 /* max length of status message */ -#define VER_RTKLIB "2.4.2" -#define NTRIP_AGENT "RTKLIB/" VER_RTKLIB -#define NTRIP_CLI_PORT 2101 /* default ntrip-client connection port */ -#define NTRIP_SVR_PORT 80 /* default ntrip-server connection port */ -#define NTRIP_MAXRSP 32768 /* max size of ntrip response */ -#define NTRIP_MAXSTR 256 /* max length of mountpoint string */ -#define NTRIP_RSP_OK_CLI "ICY 200 OK\r\n" /* ntrip response: client */ -#define NTRIP_RSP_OK_SVR "OK\r\n" /* ntrip response: server */ -#define NTRIP_RSP_SRCTBL "SOURCETABLE 200 OK\r\n" /* ntrip response: source table */ -#define NTRIP_RSP_TBLEND "ENDSOURCETABLE" -#define NTRIP_RSP_HTTP "HTTP/" /* ntrip response: http */ -#define NTRIP_RSP_ERROR "ERROR" /* ntrip response: error */ +#define VER_RTKLIB "2.4.2" +#define NTRIP_AGENT "RTKLIB/" VER_RTKLIB +#define NTRIP_CLI_PORT 2101 /* default ntrip-client connection port */ +#define NTRIP_SVR_PORT 80 /* default ntrip-server connection port */ +#define NTRIP_MAXRSP 32768 /* max size of ntrip response */ +#define NTRIP_MAXSTR 256 /* max length of mountpoint string */ +#define NTRIP_RSP_OK_CLI "ICY 200 OK\r\n" /* ntrip response: client */ +#define NTRIP_RSP_OK_SVR "OK\r\n" /* ntrip response: server */ +#define NTRIP_RSP_SRCTBL "SOURCETABLE 200 OK\r\n" /* ntrip response: source table */ +#define NTRIP_RSP_TBLEND "ENDSOURCETABLE" +#define NTRIP_RSP_HTTP "HTTP/" /* ntrip response: http */ +#define NTRIP_RSP_ERROR "ERROR" /* ntrip response: error */ -#define FTP_CMD "wget" /* ftp/http command */ -#define FTP_TIMEOUT 30 /* ftp/http timeout (s) */ +#define FTP_CMD "wget" /* ftp/http command */ +#define FTP_TIMEOUT 30 /* ftp/http timeout (s) */ serial_t *openserial(const char *path, int mode, char *msg); @@ -111,7 +111,7 @@ int writefile(file_t *file, unsigned char *buff, int n, char *msg); void syncfile(file_t *file1, file_t *file2); void decodetcppath(const char *path, char *addr, char *port, char *user, - char *passwd, char *mntpnt, char *str); + char *passwd, char *mntpnt, char *str); int errsock(void); @@ -182,7 +182,7 @@ int writentrip(ntrip_t *ntrip, unsigned char *buff, int n, char *msg); int statentrip(ntrip_t *ntrip); void decodeftppath(const char *path, char *addr, char *file, char *user, - char *passwd, int *topts); + char *passwd, int *topts); gtime_t nextdltime(const int *topts, int stat); diff --git a/src/algorithms/libs/rtklib/rtklib_tides.cc b/src/algorithms/libs/rtklib/rtklib_tides.cc index 96a23417a..c53d5cd98 100644 --- a/src/algorithms/libs/rtklib/rtklib_tides.cc +++ b/src/algorithms/libs/rtklib/rtklib_tides.cc @@ -54,84 +54,88 @@ #include "rtklib_rtkcmn.h" - /* solar/lunar tides (ref [2] 7) ---------------------------------------------*/ //#ifndef IERS_MODEL 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; - double r,ep[3],latp,lonp,p,K2,K3,a,H2,L2,dp,du,cosp,sinl,cosl; + const double H3 = 0.292, L3 = 0.015; + double r, ep[3], latp, lonp, p, K2, K3, a, H2, L2, dp, du, cosp, sinl, cosl; 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); - if ((r=norm_rtk(rp,3))<=0.0) return; + if ((r = norm_rtk(rp, 3)) <= 0.0) return; - for (i=0;i<3;i++) ep[i]=rp[i]/r; + for (i = 0; i < 3; i++) ep[i] = rp[i] / r; - K2=GMp/GME*std::pow(RE_WGS84, 2.04)*std::pow(RE_WGS84, 2.0)/(r*r*r); - K3=K2*RE_WGS84/r; - latp=asin(ep[2]); lonp=atan2(ep[1],ep[0]); - cosp=cos(latp); sinl=sin(pos[0]); cosl=cos(pos[0]); + K2 = GMp / GME * std::pow(RE_WGS84, 2.04) * std::pow(RE_WGS84, 2.0) / (r * r * r); + K3 = K2 * RE_WGS84 / r; + latp = asin(ep[2]); + lonp = atan2(ep[1], ep[0]); + cosp = cos(latp); + sinl = sin(pos[0]); + cosl = cos(pos[0]); /* step1 in phase (degree 2) */ - p=(3.0*sinl*sinl-1.0)/2.0; - H2=0.6078-0.0006*p; - L2=0.0847+0.0002*p; - a=dot(ep,eu,3); - dp=K2*3.0*L2*a; - du=K2*(H2*(1.5*a*a-0.5)-3.0*L2*a*a); + p = (3.0 * sinl * sinl - 1.0) / 2.0; + H2 = 0.6078 - 0.0006 * p; + L2 = 0.0847 + 0.0002 * p; + a = dot(ep, eu, 3); + dp = K2 * 3.0 * L2 * a; + du = K2 * (H2 * (1.5 * a * a - 0.5) - 3.0 * L2 * a * a); /* step1 in phase (degree 3) */ - dp+=K3*L3*(7.5*a*a-1.5); - du+=K3*(H3*(2.5*a*a*a-1.5*a)-L3*(7.5*a*a-1.5)*a); + dp += K3 * L3 * (7.5 * a * a - 1.5); + du += K3 * (H3 * (2.5 * a * a * a - 1.5 * a) - L3 * (7.5 * a * a - 1.5) * a); /* step1 out-of-phase (only radial) */ - du+=3.0/4.0*0.0025*K2*sin(2.0*latp)*sin(2.0*pos[0])*sin(pos[1]-lonp); - du+=3.0/4.0*0.0022*K2*cosp*cosp*cosl*cosl*sin(2.0*(pos[1]-lonp)); + du += 3.0 / 4.0 * 0.0025 * K2 * sin(2.0 * latp) * sin(2.0 * pos[0]) * sin(pos[1] - lonp); + du += 3.0 / 4.0 * 0.0022 * K2 * cosp * cosp * cosl * cosl * sin(2.0 * (pos[1] - lonp)); - dr[0]=dp*ep[0]+du*eu[0]; - dr[1]=dp*ep[1]+du*eu[1]; - dr[2]=dp*ep[2]+du*eu[2]; + dr[0] = dp * ep[0] + du * eu[0]; + dr[1] = dp * ep[1] + du * eu[1]; + dr[2] = dp * ep[2] + du * eu[2]; - trace(5,"tide_pl : dr=%.3f %.3f %.3f\n",dr[0],dr[1],dr[2]); + trace(5, "tide_pl : dr=%.3f %.3f %.3f\n", dr[0], dr[1], dr[2]); } /* displacement by solid earth tide (ref [2] 7) ------------------------------*/ void tide_solid(const double *rsun, const double *rmoon, - const double *pos, const double *E, double gmst, int opt, - double *dr) + const double *pos, const double *E, double gmst, int opt, + double *dr) { - double dr1[3],dr2[3],eu[3],du,dn,sinl,sin2l; + double dr1[3], dr2[3], eu[3], du, dn, sinl, 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); /* step1: time domain */ - eu[0]=E[2]; eu[1]=E[5]; eu[2]=E[8]; - tide_pl(eu,rsun, GMS,pos,dr1); - tide_pl(eu,rmoon,GMM,pos,dr2); + eu[0] = E[2]; + eu[1] = E[5]; + eu[2] = E[8]; + tide_pl(eu, rsun, GMS, pos, dr1); + tide_pl(eu, rmoon, GMM, pos, dr2); /* step2: frequency domain, only K1 radial */ - sin2l=sin(2.0*pos[0]); - du=-0.012*sin2l*sin(gmst+pos[1]); + sin2l = sin(2.0 * pos[0]); + du = -0.012 * sin2l * sin(gmst + pos[1]); - dr[0]=dr1[0]+dr2[0]+du*E[2]; - dr[1]=dr1[1]+dr2[1]+du*E[5]; - dr[2]=dr1[2]+dr2[2]+du*E[8]; + dr[0] = dr1[0] + dr2[0] + du * E[2]; + dr[1] = dr1[1] + dr2[1] + du * E[5]; + dr[2] = dr1[2] + dr2[2] + du * E[8]; /* eliminate permanent deformation */ - if (opt&8) + if (opt & 8) { - sinl=sin(pos[0]); - du=0.1196*(1.5*sinl*sinl-0.5); - dn=0.0247*sin2l; - dr[0]+=du*E[2]+dn*E[1]; - dr[1]+=du*E[5]+dn*E[4]; - dr[2]+=du*E[8]+dn*E[7]; + sinl = sin(pos[0]); + du = 0.1196 * (1.5 * sinl * sinl - 0.5); + dn = 0.0247 * sin2l; + dr[0] += du * E[2] + dn * E[1]; + dr[1] += du * E[5] + dn * E[4]; + dr[2] += du * E[8] + dn * E[7]; } - trace(5,"tide_solid: dr=%.3f %.3f %.3f\n",dr[0],dr[1],dr[2]); + trace(5, "tide_solid: dr=%.3f %.3f %.3f\n", dr[0], dr[1], dr[2]); } //#endif /* !IERS_MODEL */ @@ -139,99 +143,101 @@ void tide_solid(const double *rsun, const double *rmoon, /* displacement by ocean tide loading (ref [2] 7) ----------------------------*/ void tide_oload(gtime_t tut, const double *odisp, double *denu) { - const double args[][5]={ - {1.40519E-4, 2.0,-2.0, 0.0, 0.00}, /* M2 */ - {1.45444E-4, 0.0, 0.0, 0.0, 0.00}, /* S2 */ - {1.37880E-4, 2.0,-3.0, 1.0, 0.00}, /* N2 */ - {1.45842E-4, 2.0, 0.0, 0.0, 0.00}, /* K2 */ - {0.72921E-4, 1.0, 0.0, 0.0, 0.25}, /* K1 */ - {0.67598E-4, 1.0,-2.0, 0.0,-0.25}, /* O1 */ - {0.72523E-4,-1.0, 0.0, 0.0,-0.25}, /* P1 */ - {0.64959E-4, 1.0,-3.0, 1.0,-0.25}, /* Q1 */ - {0.53234E-5, 0.0, 2.0, 0.0, 0.00}, /* Mf */ - {0.26392E-5, 0.0, 1.0,-1.0, 0.00}, /* Mm */ - {0.03982E-5, 2.0, 0.0, 0.0, 0.00} /* Ssa */ + const double args[][5] = { + {1.40519E-4, 2.0, -2.0, 0.0, 0.00}, /* M2 */ + {1.45444E-4, 0.0, 0.0, 0.0, 0.00}, /* S2 */ + {1.37880E-4, 2.0, -3.0, 1.0, 0.00}, /* N2 */ + {1.45842E-4, 2.0, 0.0, 0.0, 0.00}, /* K2 */ + {0.72921E-4, 1.0, 0.0, 0.0, 0.25}, /* K1 */ + {0.67598E-4, 1.0, -2.0, 0.0, -0.25}, /* O1 */ + {0.72523E-4, -1.0, 0.0, 0.0, -0.25}, /* P1 */ + {0.64959E-4, 1.0, -3.0, 1.0, -0.25}, /* Q1 */ + {0.53234E-5, 0.0, 2.0, 0.0, 0.00}, /* Mf */ + {0.26392E-5, 0.0, 1.0, -1.0, 0.00}, /* Mm */ + {0.03982E-5, 2.0, 0.0, 0.0, 0.00} /* Ssa */ }; - const double ep1975[]={1975,1,1,0,0,0}; - double ep[6],fday,days,t,t2,t3,a[5],ang,dp[3]={0}; - int i,j; + const double ep1975[] = {1975, 1, 1, 0, 0, 0}; + double ep[6], fday, days, t, t2, t3, a[5], ang, dp[3] = {0}; + int i, j; - trace(3,"tide_oload:\n"); + trace(3, "tide_oload:\n"); /* angular argument: see subroutine arg.f for reference [1] */ - time2epoch(tut,ep); - fday=ep[3]*3600.0+ep[4]*60.0+ep[5]; - ep[3]=ep[4]=ep[5]=0.0; - days=timediff(epoch2time(ep),epoch2time(ep1975))/86400.0+1.0; - t=(27392.500528+1.000000035*days)/36525.0; - t2=t*t; t3=t2*t; + time2epoch(tut, ep); + fday = ep[3] * 3600.0 + ep[4] * 60.0 + ep[5]; + ep[3] = ep[4] = ep[5] = 0.0; + days = timediff(epoch2time(ep), epoch2time(ep1975)) / 86400.0 + 1.0; + t = (27392.500528 + 1.000000035 * days) / 36525.0; + t2 = t * t; + t3 = t2 * t; - a[0]=fday; - a[1]=(279.69668+36000.768930485*t+3.03E-4*t2)*D2R; /* H0 */ - a[2]=(270.434358+481267.88314137*t-0.001133*t2+1.9E-6*t3)*D2R; /* S0 */ - a[3]=(334.329653+4069.0340329577*t-0.010325*t2-1.2E-5*t3)*D2R; /* P0 */ - a[4]=2.0*PI; + a[0] = fday; + a[1] = (279.69668 + 36000.768930485 * t + 3.03E-4 * t2) * D2R; /* H0 */ + a[2] = (270.434358 + 481267.88314137 * t - 0.001133 * t2 + 1.9E-6 * t3) * D2R; /* S0 */ + a[3] = (334.329653 + 4069.0340329577 * t - 0.010325 * t2 - 1.2E-5 * t3) * D2R; /* P0 */ + a[4] = 2.0 * PI; /* displacements by 11 constituents */ - for (i=0;i<11;i++) + for (i = 0; i < 11; i++) { - ang=0.0; - for (j=0;j<5;j++) ang+=a[j]*args[i][j]; - for (j=0;j<3;j++) dp[j]+=odisp[j+i*6]*cos(ang-odisp[j+3+i*6]*D2R); + ang = 0.0; + for (j = 0; j < 5; j++) ang += a[j] * args[i][j]; + for (j = 0; j < 3; j++) dp[j] += odisp[j + i * 6] * cos(ang - odisp[j + 3 + i * 6] * D2R); } - denu[0]=-dp[1]; - denu[1]=-dp[2]; - denu[2]= dp[0]; + denu[0] = -dp[1]; + denu[1] = -dp[2]; + denu[2] = dp[0]; - trace(5,"tide_oload: denu=%.3f %.3f %.3f\n",denu[0],denu[1],denu[2]); + trace(5, "tide_oload: denu=%.3f %.3f %.3f\n", denu[0], denu[1], denu[2]); } /* iers mean pole (ref [7] eq.7.25) ------------------------------------------*/ void iers_mean_pole(gtime_t tut, double *xp_bar, double *yp_bar) { - const double ep2000[]={2000,1,1,0,0,0}; - double y,y2,y3; + const double ep2000[] = {2000, 1, 1, 0, 0, 0}; + double y, y2, y3; - y=timediff(tut,epoch2time(ep2000))/86400.0/365.25; + y = timediff(tut, epoch2time(ep2000)) / 86400.0 / 365.25; - if (y<3653.0/365.25) + if (y < 3653.0 / 365.25) { /* until 2010.0 */ - y2=y*y; y3=y2*y; - *xp_bar= 55.974+1.8243*y+0.18413*y2+0.007024*y3; /* (mas) */ - *yp_bar=346.346+1.7896*y-0.10729*y2-0.000908*y3; + y2 = y * y; + y3 = y2 * y; + *xp_bar = 55.974 + 1.8243 * y + 0.18413 * y2 + 0.007024 * y3; /* (mas) */ + *yp_bar = 346.346 + 1.7896 * y - 0.10729 * y2 - 0.000908 * y3; } else - { /* after 2010.0 */ - *xp_bar= 23.513+7.6141*y; /* (mas) */ - *yp_bar=358.891-0.6287*y; + { /* after 2010.0 */ + *xp_bar = 23.513 + 7.6141 * y; /* (mas) */ + *yp_bar = 358.891 - 0.6287 * y; } } /* displacement by pole tide (ref [7] eq.7.26) --------------------------------*/ 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, yp_bar, m1, m2, cosl, 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); /* iers mean pole (mas) */ - iers_mean_pole(tut,&xp_bar,&yp_bar); + iers_mean_pole(tut, &xp_bar, &yp_bar); /* ref [7] eq.7.24 */ - m1= erpv[0]/AS2R-xp_bar*1E-3; /* (as) */ - m2=-erpv[1]/AS2R+yp_bar*1E-3; + m1 = erpv[0] / AS2R - xp_bar * 1E-3; /* (as) */ + m2 = -erpv[1] / AS2R + yp_bar * 1E-3; /* sin(2*theta) = sin(2*phi), cos(2*theta)=-cos(2*phi) */ - cosl=cos(pos[1]); - sinl=sin(pos[1]); - denu[0]= 9E-3*sin(pos[0]) *(m1*sinl-m2*cosl); /* de= Slambda (m) */ - denu[1]= -9E-3*cos(2.0*pos[0])*(m1*cosl+m2*sinl); /* dn=-Stheta (m) */ - denu[2]=-33E-3*sin(2.0*pos[0])*(m1*cosl+m2*sinl); /* du= Sr (m) */ + cosl = cos(pos[1]); + sinl = sin(pos[1]); + denu[0] = 9E-3 * sin(pos[0]) * (m1 * sinl - m2 * cosl); /* de= Slambda (m) */ + denu[1] = -9E-3 * cos(2.0 * pos[0]) * (m1 * cosl + m2 * sinl); /* dn=-Stheta (m) */ + denu[2] = -33E-3 * sin(2.0 * pos[0]) * (m1 * cosl + m2 * sinl); /* du= Sr (m) */ - trace(5,"tide_pole : denu=%.3f %.3f %.3f\n",denu[0],denu[1],denu[2]); + trace(5, "tide_pole : denu=%.3f %.3f %.3f\n", denu[0], denu[1], denu[2]); } @@ -261,61 +267,61 @@ void tide_pole(gtime_t tut, const double *pos, const double *erpv, * ver.2.4.0 does not use ocean loading and pole tide corrections *-----------------------------------------------------------------------------*/ 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; - double pos[2],E[9],drt[3],denu[3],rs[3],rm[3],gmst,erpv[5]={0}; + double pos[2], E[9], drt[3], denu[3], rs[3], rm[3], gmst, erpv[5] = {0}; int i; #ifdef IERS_MODEL - double ep[6],fhr; - int year,mon,day; + double ep[6], fhr; + int year, mon, day; #endif - trace(3,"tidedisp: tutc=%s\n",time_str(tutc,0)); + trace(3, "tidedisp: tutc=%s\n", time_str(tutc, 0)); - if (erp) geterp(erp,tutc,erpv); + if (erp) geterp(erp, tutc, erpv); - tut=timeadd(tutc,erpv[2]); + tut = timeadd(tutc, erpv[2]); - dr[0]=dr[1]=dr[2]=0.0; + dr[0] = dr[1] = dr[2] = 0.0; - if (norm_rtk(rr,3)<=0.0) return; + if (norm_rtk(rr, 3) <= 0.0) return; - pos[0]=asin(rr[2]/norm_rtk(rr,3)); - pos[1]=atan2(rr[1],rr[0]); - xyz2enu(pos,E); + pos[0] = asin(rr[2] / norm_rtk(rr, 3)); + pos[1] = atan2(rr[1], rr[0]); + xyz2enu(pos, E); - if (opt&1) + if (opt & 1) { /* solid earth tides */ /* sun and moon position in ecef */ - sunmoonpos(tutc,erpv,rs,rm,&gmst); + sunmoonpos(tutc, erpv, rs, rm, &gmst); #ifdef IERS_MODEL - time2epoch(tutc,ep); - year=(int)ep[0]; - mon =(int)ep[1]; - day =(int)ep[2]; - fhr =ep[3]+ep[4]/60.0+ep[5]/3600.0; + time2epoch(tutc, ep); + year = (int)ep[0]; + mon = (int)ep[1]; + day = (int)ep[2]; + fhr = ep[3] + ep[4] / 60.0 + ep[5] / 3600.0; /* call DEHANTTIDEINEL */ // dehanttideinel_((double *)rr,&year,&mon,&day,&fhr,rs,rm,drt); #else - tide_solid(rs,rm,pos,E,gmst,opt,drt); + tide_solid(rs, rm, pos, E, gmst, opt, drt); #endif - for (i=0;i<3;i++) dr[i]+=drt[i]; + for (i = 0; i < 3; i++) dr[i] += drt[i]; } - if ((opt&2)&&odisp) + if ((opt & 2) && odisp) { /* ocean tide loading */ - tide_oload(tut,odisp,denu); - matmul("TN",3,1,3,1.0,E,denu,0.0,drt); - for (i=0;i<3;i++) dr[i]+=drt[i]; + tide_oload(tut, odisp, denu); + matmul("TN", 3, 1, 3, 1.0, E, denu, 0.0, drt); + for (i = 0; i < 3; i++) dr[i] += drt[i]; } - if ((opt&4)&&erp) + if ((opt & 4) && erp) { /* pole tide */ - tide_pole(tut,pos,erpv,denu); - matmul("TN",3,1,3,1.0,E,denu,0.0,drt); - for (i=0;i<3;i++) dr[i]+=drt[i]; + tide_pole(tut, pos, erpv, denu); + matmul("TN", 3, 1, 3, 1.0, E, denu, 0.0, drt); + for (i = 0; i < 3; i++) dr[i] += drt[i]; } - trace(5,"tidedisp: dr=%.3f %.3f %.3f\n",dr[0],dr[1],dr[2]); + trace(5, "tidedisp: dr=%.3f %.3f %.3f\n", dr[0], dr[1], dr[2]); } diff --git a/src/algorithms/libs/rtklib/rtklib_tides.h b/src/algorithms/libs/rtklib/rtklib_tides.h index 44124604a..cb21f495a 100644 --- a/src/algorithms/libs/rtklib/rtklib_tides.h +++ b/src/algorithms/libs/rtklib/rtklib_tides.h @@ -73,11 +73,11 @@ const double GMS = 1.327124E+20; /* sun gravitational constant */ const double GMM = 4.902801E+12; /* moon gravitational constant */ void tide_pl(const double *eu, const double *rp, double GMp, - const double *pos, double *dr); + const double *pos, double *dr); void tide_solid(const double *rsun, const double *rmoon, - const double *pos, const double *E, double gmst, int opt, - double *dr); + const double *pos, const double *E, double gmst, int opt, + double *dr); void tide_oload(gtime_t tut, const double *odisp, double *denu); @@ -85,8 +85,8 @@ 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, - double *denu); + double *denu); void tidedisp(gtime_t tutc, const double *rr, int opt, const erp_t *erp, - const double *odisp, double *dr); + const double *odisp, double *dr); #endif diff --git a/src/algorithms/libs/short_x2_to_cshort.cc b/src/algorithms/libs/short_x2_to_cshort.cc index d722a6cdd..b53635172 100644 --- a/src/algorithms/libs/short_x2_to_cshort.cc +++ b/src/algorithms/libs/short_x2_to_cshort.cc @@ -40,10 +40,9 @@ short_x2_to_cshort_sptr make_short_x2_to_cshort() } - short_x2_to_cshort::short_x2_to_cshort() : sync_block("short_x2_to_cshort", - gr::io_signature::make (2, 2, sizeof(short)), - gr::io_signature::make (1, 1, sizeof(lv_16sc_t))) // lv_8sc_t is a Volk's typedef for std::complex + gr::io_signature::make(2, 2, sizeof(short)), + gr::io_signature::make(1, 1, sizeof(lv_16sc_t))) // lv_8sc_t is a Volk's typedef for std::complex { const int alignment_multiple = volk_get_alignment() / sizeof(lv_16sc_t); set_alignment(std::max(1, alignment_multiple)); @@ -51,8 +50,8 @@ short_x2_to_cshort::short_x2_to_cshort() : sync_block("short_x2_to_cshort", int short_x2_to_cshort::work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items) { const short *in0 = reinterpret_cast(input_items[0]); const short *in1 = reinterpret_cast(input_items[1]); @@ -60,7 +59,7 @@ int short_x2_to_cshort::work(int noutput_items, // This could be put into a volk kernel short real_part; short imag_part; - for(int number = 0; number < noutput_items; number++) + for (int number = 0; number < noutput_items; number++) { // lv_cmake(r, i) defined at volk/volk_complex.h real_part = *in0++; diff --git a/src/algorithms/libs/short_x2_to_cshort.h b/src/algorithms/libs/short_x2_to_cshort.h index 6bd44fddf..aec984732 100644 --- a/src/algorithms/libs/short_x2_to_cshort.h +++ b/src/algorithms/libs/short_x2_to_cshort.h @@ -48,12 +48,13 @@ class short_x2_to_cshort : public gr::sync_block { private: friend short_x2_to_cshort_sptr make_short_x2_to_cshort(); + public: short_x2_to_cshort(); int work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items); }; #endif diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/volk_gnsssdr-config-info.cc b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/volk_gnsssdr-config-info.cc index 3a2c7c39f..60c421be3 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/volk_gnsssdr-config-info.cc +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/volk_gnsssdr-config-info.cc @@ -20,30 +20,30 @@ #include #endif -#include "volk_gnsssdr/volk_gnsssdr.h" // for volk_gnsssdr_get_alignment, volk_gnsssdr_get_machine -#include "volk_gnsssdr_option_helpers.h" // for option_list, option_t -#include // for volk_gnsssdr_available_machines, volk_gnsssdr_c_compiler ... -#include // for operator<<, endl, cout, ostream -#include // for string +#include "volk_gnsssdr/volk_gnsssdr.h" // for volk_gnsssdr_get_alignment, volk_gnsssdr_get_machine +#include "volk_gnsssdr_option_helpers.h" // for option_list, option_t +#include // for volk_gnsssdr_available_machines, volk_gnsssdr_c_compiler ... +#include // for operator<<, endl, cout, ostream +#include // for string void print_alignment() { - std::cout << "Alignment in bytes: " << volk_gnsssdr_get_alignment() << std::endl; + std::cout << "Alignment in bytes: " << volk_gnsssdr_get_alignment() << std::endl; } void print_malloc() { - // You don't want to change the volk_malloc code, so just copy the if/else - // structure from there and give an explanation for the implementations - std::cout << "Used malloc implementation: "; - #if _POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600 || HAVE_POSIX_MEMALIGN - std::cout << "posix_memalign" << std::endl; - #elif _MSC_VER >= 1400 - std::cout << "aligned_malloc" << std::endl; - #else - std::cout << "No standard handler available, using own implementation." << std::endl; - #endif + // You don't want to change the volk_malloc code, so just copy the if/else + // structure from there and give an explanation for the implementations + std::cout << "Used malloc implementation: "; +#if _POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600 || HAVE_POSIX_MEMALIGN + std::cout << "posix_memalign" << std::endl; +#elif _MSC_VER >= 1400 + std::cout << "aligned_malloc" << std::endl; +#else + std::cout << "No standard handler available, using own implementation." << std::endl; +#endif } @@ -54,22 +54,24 @@ int main(int argc, char **argv) our_options.add(option_t("cc", "", "print the VOLK_GNSSDR C compiler version", volk_gnsssdr_c_compiler())); our_options.add(option_t("cflags", "", "print the VOLK_GNSSSDR CFLAGS", volk_gnsssdr_compiler_flags())); our_options.add(option_t("all-machines", "", "print VOLK_GNSSSDR machines built", volk_gnsssdr_available_machines())); - our_options.add(option_t("avail-machines", "", "print VOLK_GNSSSDR machines on the current " - "platform", volk_gnsssdr_list_machines)); + our_options.add(option_t("avail-machines", "", + "print VOLK_GNSSSDR machines on the current " + "platform", + volk_gnsssdr_list_machines)); our_options.add(option_t("machine", "", "print the current VOLK_GNSSSDR machine that will be used", - volk_gnsssdr_get_machine())); + volk_gnsssdr_get_machine())); our_options.add(option_t("alignment", "", "print the memory alignment", print_alignment)); our_options.add(option_t("malloc", "", "print the malloc implementation used in volk_gnsssdr_malloc", - print_malloc)); + print_malloc)); our_options.add(option_t("version", "v", "print the VOLK_GNSSSDR version", volk_gnsssdr_version())); try - { + { our_options.parse(argc, argv); - } - catch(...) - { + } + catch (...) + { return 1; - } + } return 0; } diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/volk_gnsssdr_option_helpers.cc b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/volk_gnsssdr_option_helpers.cc index 61e085423..a6a263a20 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/volk_gnsssdr_option_helpers.cc +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/volk_gnsssdr_option_helpers.cc @@ -17,157 +17,182 @@ */ #include "volk_gnsssdr_option_helpers.h" -#include // IWYU pragma: keep -#include // IWYU pragma: keep -#include // IWYU pragma: keep -#include // for exception -#include // for operator<<, endl, basic_ostream, cout, ostream -#include // for pair - +#include // IWYU pragma: keep +#include // IWYU pragma: keep +#include // IWYU pragma: keep +#include // for exception +#include // for operator<<, endl, basic_ostream, cout, ostream +#include // for pair /* * Option type */ option_t::option_t(std::string longform, std::string shortform, std::string msg, void (*callback)()) - : longform("--" + longform), - shortform("-" + shortform), - msg(msg), - callback(callback) { option_type = VOID_CALLBACK; } + : longform("--" + longform), + shortform("-" + shortform), + msg(msg), + callback(callback) { option_type = VOID_CALLBACK; } option_t::option_t(std::string longform, std::string shortform, std::string msg, void (*callback)(int)) - : longform("--" + longform), - shortform("-" + shortform), - msg(msg), - callback((void (*)()) callback) { option_type = INT_CALLBACK; } + : longform("--" + longform), + shortform("-" + shortform), + msg(msg), + callback((void (*)())callback) { option_type = INT_CALLBACK; } option_t::option_t(std::string longform, std::string shortform, std::string msg, void (*callback)(float)) - : longform("--" + longform), - shortform("-" + shortform), - msg(msg), - callback((void (*)()) callback) { option_type = FLOAT_CALLBACK; } + : longform("--" + longform), + shortform("-" + shortform), + msg(msg), + callback((void (*)())callback) { option_type = FLOAT_CALLBACK; } option_t::option_t(std::string longform, std::string shortform, std::string msg, void (*callback)(bool)) - : longform("--" + longform), - shortform("-" + shortform), - msg(msg), - callback((void (*)()) callback) { option_type = BOOL_CALLBACK; } + : longform("--" + longform), + shortform("-" + shortform), + msg(msg), + callback((void (*)())callback) { option_type = BOOL_CALLBACK; } option_t::option_t(std::string longform, std::string shortform, std::string msg, void (*callback)(std::string)) - : longform("--" + longform), - shortform("-" + shortform), - msg(msg), - callback((void (*)()) callback) { option_type = STRING_CALLBACK; } + : longform("--" + longform), + shortform("-" + shortform), + msg(msg), + callback((void (*)())callback) { option_type = STRING_CALLBACK; } option_t::option_t(std::string longform, std::string shortform, std::string msg, std::string printval) - : longform("--" + longform), - shortform("-" + shortform), - msg(msg), - printval(printval) { option_type = STRING; } + : longform("--" + longform), + shortform("-" + shortform), + msg(msg), + printval(printval) { option_type = STRING; } /* * Option List */ -option_list::option_list(std::string program_name) : - program_name(program_name) { - { internal_list = std::vector(); } -} - -void option_list::add(const option_t & opt) { internal_list.push_back(opt); } - -void option_list::parse(int argc, char **argv) { - for (int arg_number = 0; arg_number < argc; ++arg_number) { - for (std::vector::iterator this_option = internal_list.begin(); - this_option != internal_list.end(); - this_option++) { - if (this_option->longform == std::string(argv[arg_number]) || - this_option->shortform == std::string(argv[arg_number])) { - switch (this_option->option_type) { - case VOID_CALLBACK: - this_option->callback(); - break; - case INT_CALLBACK: - try { - int int_val = std::stoi(argv[++arg_number]); - ((void (*)(int)) this_option->callback)(int_val); - } catch (std::exception &exc) { - std::cout << "An int option can only receive a number" << std::endl; - throw std::exception(); - }; - break; - case FLOAT_CALLBACK: - try { - int int_val = std::stof(argv[++arg_number]); - ((void (*)(float)) this_option->callback)(int_val); - } catch (std::exception &exc) { - std::cout << "A float option can only receive a number" << std::endl; - throw std::exception(); - }; - break; - case BOOL_CALLBACK: - try { - bool int_val = (bool) std::stoi(argv[++arg_number]); - ((void (*)(bool)) this_option->callback)(int_val); - } catch (std::exception &exc) { - std::cout << "A bool option can only receive 0 or 1" << std::endl; - throw std::exception(); - }; - break; - case STRING_CALLBACK: - try { - ((void (*)(std::string)) this_option->callback)(argv[++arg_number]); - } catch (std::exception &exc) { - throw std::exception(); - }; - break; - case STRING: - std::cout << this_option->printval << std::endl; - break; - default: - this_option->callback(); - break; - } - } - } - if (std::string("--help") == std::string(argv[arg_number]) || - std::string("-h") == std::string(argv[arg_number])) { - help(); - } +option_list::option_list(std::string program_name) : program_name(program_name) +{ + { + internal_list = std::vector(); } } -void option_list::help() { +void option_list::add(const option_t &opt) { internal_list.push_back(opt); } + +void option_list::parse(int argc, char **argv) +{ + for (int arg_number = 0; arg_number < argc; ++arg_number) + { + for (std::vector::iterator this_option = internal_list.begin(); + this_option != internal_list.end(); + this_option++) + { + if (this_option->longform == std::string(argv[arg_number]) || + this_option->shortform == std::string(argv[arg_number])) + { + switch (this_option->option_type) + { + case VOID_CALLBACK: + this_option->callback(); + break; + case INT_CALLBACK: + try + { + int int_val = std::stoi(argv[++arg_number]); + ((void (*)(int))this_option->callback)(int_val); + } + catch (std::exception &exc) + { + std::cout << "An int option can only receive a number" << std::endl; + throw std::exception(); + }; + break; + case FLOAT_CALLBACK: + try + { + int int_val = std::stof(argv[++arg_number]); + ((void (*)(float))this_option->callback)(int_val); + } + catch (std::exception &exc) + { + std::cout << "A float option can only receive a number" << std::endl; + throw std::exception(); + }; + break; + case BOOL_CALLBACK: + try + { + bool int_val = (bool)std::stoi(argv[++arg_number]); + ((void (*)(bool))this_option->callback)(int_val); + } + catch (std::exception &exc) + { + std::cout << "A bool option can only receive 0 or 1" << std::endl; + throw std::exception(); + }; + break; + case STRING_CALLBACK: + try + { + ((void (*)(std::string))this_option->callback)(argv[++arg_number]); + } + catch (std::exception &exc) + { + throw std::exception(); + }; + break; + case STRING: + std::cout << this_option->printval << std::endl; + break; + default: + this_option->callback(); + break; + } + } + } + if (std::string("--help") == std::string(argv[arg_number]) || + std::string("-h") == std::string(argv[arg_number])) + { + help(); + } + } +} + +void option_list::help() +{ std::cout << program_name << std::endl; std::cout << " -h [ --help ] \t\tDisplay this help message" << std::endl; for (std::vector::iterator this_option = internal_list.begin(); this_option != internal_list.end(); - this_option++) { - std::string help_line(" "); - if (this_option->shortform == "-") { - help_line += this_option->longform + " "; - } else { - help_line += this_option->shortform + " [ " + this_option->longform + " ]"; - } + this_option++) + { + std::string help_line(" "); + if (this_option->shortform == "-") + { + help_line += this_option->longform + " "; + } + else + { + help_line += this_option->shortform + " [ " + this_option->longform + " ]"; + } - switch (help_line.size() / 8) { - case 0: - help_line += "\t\t\t\t"; - break; - case 1: - help_line += "\t\t\t"; - break; - case 2: - help_line += "\t\t"; - break; - case 3: - help_line += "\t"; - break; - default: - break; + switch (help_line.size() / 8) + { + case 0: + help_line += "\t\t\t\t"; + break; + case 1: + help_line += "\t\t\t"; + break; + case 2: + help_line += "\t\t"; + break; + case 3: + help_line += "\t"; + break; + default: + break; + } + help_line += this_option->msg; + std::cout << help_line << std::endl; } - help_line += this_option->msg; - std::cout << help_line << std::endl; - } } diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/volk_gnsssdr_option_helpers.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/volk_gnsssdr_option_helpers.h index 30cb98210..da1e12821 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/volk_gnsssdr_option_helpers.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/volk_gnsssdr_option_helpers.h @@ -36,7 +36,8 @@ typedef enum STRING, } VOLK_OPTYPE; -class option_t { +class option_t +{ public: option_t(std::string longform, std::string shortform, std::string msg, void (*callback)()); option_t(std::string longform, std::string shortform, std::string msg, void (*callback)(int)); @@ -51,7 +52,6 @@ public: VOLK_OPTYPE option_type; std::string printval; void (*callback)(); - }; class option_list @@ -59,15 +59,16 @@ class option_list public: option_list(std::string program_name); - void add(const option_t & opt); + void add(const option_t &opt); void parse(int argc, char **argv); void help(); + private: std::string program_name; std::vector internal_list; }; -#endif //VOLK_VOLK_OPTION_HELPERS_H +#endif //VOLK_VOLK_OPTION_HELPERS_H diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/volk_gnsssdr_profile.cc b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/volk_gnsssdr_profile.cc index 5b9a1a653..f59c0cb60 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/volk_gnsssdr_profile.cc +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/volk_gnsssdr_profile.cc @@ -16,23 +16,22 @@ * along with GNSS-SDR. If not, see . */ -#include "kernel_tests.h" // for init_test_list -#include "qa_utils.h" // for volk_gnsssdr_test_results_t -#include "volk_gnsssdr/volk_gnsssdr_complex.h" // for lv_32fc_t -#include "volk_gnsssdr_option_helpers.h" // for option_list, option_t +#include "kernel_tests.h" // for init_test_list +#include "qa_utils.h" // for volk_gnsssdr_test_results_t +#include "volk_gnsssdr/volk_gnsssdr_complex.h" // for lv_32fc_t +#include "volk_gnsssdr_option_helpers.h" // for option_list, option_t #include "volk_gnsssdr_profile.h" -#include "volk_gnsssdr/volk_gnsssdr_prefs.h" // for volk_gnsssdr_get_config_path -#include // for create_directories, exists -#include // for path, operator<< -#include // for filesystem -#include // for stat -#include // for size_t -#include // for operator<<, basic_ostream -#include // IWYU pragma: keep -#include // for map, map<>::iterator -#include // for pair -#include // for vector, vector<>::const_.. - +#include "volk_gnsssdr/volk_gnsssdr_prefs.h" // for volk_gnsssdr_get_config_path +#include // for create_directories, exists +#include // for path, operator<< +#include // for filesystem +#include // for stat +#include // for size_t +#include // for operator<<, basic_ostream +#include // IWYU pragma: keep +#include // for map, map<>::iterator +#include // for pair +#include // for vector, vector<>::const_.. namespace fs = boost::filesystem; @@ -67,92 +66,112 @@ int main(int argc, char *argv[]) profile_options.add((option_t("path", "p", "Specify the volk_config path", set_volk_config))); try - { + { profile_options.parse(argc, argv); - } - catch(...) - { - return 1; - } + } + catch (...) + { + return 1; + } - for (int arg_number = 0; arg_number < argc; ++arg_number) { + for (int arg_number = 0; arg_number < argc; ++arg_number) + { if (std::string("--help") == std::string(argv[arg_number]) || - std::string("-h") == std::string(argv[arg_number])) { + std::string("-h") == std::string(argv[arg_number])) + { return 0; - } - } + } + } // Adding program options std::ofstream json_file; std::string config_file; - if ( json_filename != "" ) { - json_file.open( json_filename.c_str() ); - } + if (json_filename != "") + { + json_file.open(json_filename.c_str()); + } - if ( volk_config_path != "" ) { - config_file = volk_config_path + "/volk_config"; - } + if (volk_config_path != "") + { + config_file = volk_config_path + "/volk_config"; + } // Run tests std::vector results; - if(update_mode) { - if( config_file != "" ) read_results(&results, config_file); - else read_results(&results); - } + if (update_mode) + { + if (config_file != "") + read_results(&results, config_file); + else + read_results(&results); + } // Initialize the list of tests std::vector test_cases = init_test_list(test_params); // Iterate through list of tests running each one std::string substr_to_match(test_params.kernel_regex()); - for(unsigned int ii = 0; ii < test_cases.size(); ++ii) { - bool regex_match = true; + for (unsigned int ii = 0; ii < test_cases.size(); ++ii) + { + bool regex_match = true; - volk_gnsssdr_test_case_t test_case = test_cases[ii]; - // if the kernel name matches regex then do the test - std::string test_case_name = test_case.name(); - if(test_case_name.find(substr_to_match) == std::string::npos) { - regex_match = false; - } - - // if we are in update mode check if we've already got results - // if we have any, then no need to test that kernel - bool update = true; - if(update_mode) { - for(unsigned int jj=0; jj < results.size(); ++jj) { - if(results[jj].name == test_case.name() || - results[jj].name == test_case.puppet_master_name()) { - update = false; - break; + volk_gnsssdr_test_case_t test_case = test_cases[ii]; + // if the kernel name matches regex then do the test + std::string test_case_name = test_case.name(); + if (test_case_name.find(substr_to_match) == std::string::npos) + { + regex_match = false; } - } - } - if( regex_match && update ) { - try { - run_volk_gnsssdr_tests(test_case.desc(), test_case.kernel_ptr(), test_case.name(), - test_case.test_parameters(), &results, test_case.puppet_master_name()); - } - catch (std::string &error) { - std::cerr << "Caught Exception in 'run_volk_gnssdr_tests': " << error << std::endl; - } + // if we are in update mode check if we've already got results + // if we have any, then no need to test that kernel + bool update = true; + if (update_mode) + { + for (unsigned int jj = 0; jj < results.size(); ++jj) + { + if (results[jj].name == test_case.name() || + results[jj].name == test_case.puppet_master_name()) + { + update = false; + break; + } + } + } + + if (regex_match && update) + { + try + { + run_volk_gnsssdr_tests(test_case.desc(), test_case.kernel_ptr(), test_case.name(), + test_case.test_parameters(), &results, test_case.puppet_master_name()); + } + catch (std::string &error) + { + std::cerr << "Caught Exception in 'run_volk_gnssdr_tests': " << error << std::endl; + } + } } - } // Output results according to provided options - if(json_filename != "") { - write_json(json_file, results); - json_file.close(); - } + if (json_filename != "") + { + write_json(json_file, results); + json_file.close(); + } - if(!dry_run) { - if(config_file != "") write_results(&results, false, config_file); - else write_results(&results, false); - } - else { - std::cout << "Warning: this was a dry-run. Config not generated" << std::endl; - } + if (!dry_run) + { + if (config_file != "") + write_results(&results, false, config_file); + else + write_results(&results, false); + } + else + { + std::cout << "Warning: this was a dry-run. Config not generated" << std::endl; + } } @@ -167,51 +186,55 @@ void read_results(std::vector *results) void read_results(std::vector *results, std::string path) { struct stat buffer; - bool config_status = (stat (path.c_str(), &buffer) == 0); + bool config_status = (stat(path.c_str(), &buffer) == 0); - if( config_status ) { - // a config exists and we are reading results from it - std::ifstream config(path.c_str()); - char config_line[256]; - while(config.getline(config_line, 255)) { - // tokenize the input line by kernel_name unaligned aligned - // then push back in the results vector with fields filled in + if (config_status) + { + // a config exists and we are reading results from it + std::ifstream config(path.c_str()); + char config_line[256]; + while (config.getline(config_line, 255)) + { + // tokenize the input line by kernel_name unaligned aligned + // then push back in the results vector with fields filled in - std::vector single_kernel_result; - std::string config_str(config_line); - std::size_t str_size = config_str.size(); - std::size_t found = 1; + std::vector single_kernel_result; + std::string config_str(config_line); + std::size_t str_size = config_str.size(); + std::size_t found = 1; - found = config_str.find(' '); - // Split line by spaces - while(found && found < str_size) { found = config_str.find(' '); - // kernel names MUST be less than 128 chars, which is - // a length restricted by volk/volk_prefs.c - // on the last token in the parsed string we won't find a space - // so make sure we copy at most 128 chars. - if(found > 127) { - found = 127; - } - str_size = config_str.size(); - char buffer[128] = {'\0'}; - config_str.copy(buffer, found + 1, 0); - buffer[found] = '\0'; - single_kernel_result.push_back(std::string(buffer)); - config_str.erase(0, found+1); - } + // Split line by spaces + while (found && found < str_size) + { + found = config_str.find(' '); + // kernel names MUST be less than 128 chars, which is + // a length restricted by volk/volk_prefs.c + // on the last token in the parsed string we won't find a space + // so make sure we copy at most 128 chars. + if (found > 127) + { + found = 127; + } + str_size = config_str.size(); + char buffer[128] = {'\0'}; + config_str.copy(buffer, found + 1, 0); + buffer[found] = '\0'; + single_kernel_result.push_back(std::string(buffer)); + config_str.erase(0, found + 1); + } - if(single_kernel_result.size() == 3) { - volk_gnsssdr_test_results_t kernel_result; - kernel_result.name = std::string(single_kernel_result[0]); - kernel_result.config_name = std::string(single_kernel_result[0]); - kernel_result.best_arch_u = std::string(single_kernel_result[1]); - kernel_result.best_arch_a = std::string(single_kernel_result[2]); - results->push_back(kernel_result); - } + if (single_kernel_result.size() == 3) + { + volk_gnsssdr_test_results_t kernel_result; + kernel_result.name = std::string(single_kernel_result[0]); + kernel_result.config_name = std::string(single_kernel_result[0]); + kernel_result.best_arch_u = std::string(single_kernel_result[1]); + kernel_result.best_arch_a = std::string(single_kernel_result[2]); + results->push_back(kernel_result); + } + } } - } - } void write_results(const std::vector *results, bool update_result) @@ -219,7 +242,7 @@ void write_results(const std::vector *results, bool char path[1024]; volk_gnsssdr_get_config_path(path); - write_results( results, update_result, std::string(path)); + write_results(results, update_result, std::string(path)); } void write_results(const std::vector *results, bool update_result, const std::string path) @@ -227,39 +250,44 @@ void write_results(const std::vector *results, bool const fs::path config_path(path); // Until we can update the config on a kernel by kernel basis // do not overwrite volk_gnsssdr_config when using a regex. - if (! fs::exists(config_path.branch_path())) - { - std::cout << "Creating " << config_path.branch_path() << " ..." << std::endl; - fs::create_directories(config_path.branch_path()); - } + if (!fs::exists(config_path.branch_path())) + { + std::cout << "Creating " << config_path.branch_path() << " ..." << std::endl; + fs::create_directories(config_path.branch_path()); + } std::ofstream config; - if(update_result) { - std::cout << "Updating " << path << " ..." << std::endl; - config.open(path.c_str(), std::ofstream::app); - if (!config.is_open()) { //either we don't have write access or we don't have the dir yet - std::cout << "Error opening file " << path << std::endl; - } - } - else { - std::cout << "Writing " << path << " ..." << std::endl; - config.open(path.c_str()); - if (!config.is_open()) { //either we don't have write access or we don't have the dir yet - std::cout << "Error opening file " << path << std::endl; + if (update_result) + { + std::cout << "Updating " << path << " ..." << std::endl; + config.open(path.c_str(), std::ofstream::app); + if (!config.is_open()) + { //either we don't have write access or we don't have the dir yet + std::cout << "Error opening file " << path << std::endl; + } } + else + { + std::cout << "Writing " << path << " ..." << std::endl; + config.open(path.c_str()); + if (!config.is_open()) + { //either we don't have write access or we don't have the dir yet + std::cout << "Error opening file " << path << std::endl; + } - config << "\ + config << "\ #this file is generated by volk_gnsssdr_profile.\n\ #the function name is followed by the preferred architecture.\n\ "; - } + } std::vector::const_iterator profile_results; - for(profile_results = results->begin(); profile_results != results->end(); ++profile_results) { - config << profile_results->config_name << " " - << profile_results->best_arch_a << " " - << profile_results->best_arch_u << std::endl; - } + for (profile_results = results->begin(); profile_results != results->end(); ++profile_results) + { + config << profile_results->config_name << " " + << profile_results->best_arch_a << " " + << profile_results->best_arch_u << std::endl; + } config.close(); } @@ -270,43 +298,45 @@ void write_json(std::ofstream &json_file, std::vector::iterator result; - for(result = results.begin(); result != results.end(); ++result) { - json_file << " {" << std::endl; - json_file << " \"name\": \"" << result->name << "\"," << std::endl; - json_file << " \"vlen\": " << (int)(result->vlen) << "," << std::endl; - json_file << " \"iter\": " << result->iter << "," << std::endl; - json_file << " \"best_arch_a\": \"" << result->best_arch_a - << "\"," << std::endl; - json_file << " \"best_arch_u\": \"" << result->best_arch_u - << "\"," << std::endl; - json_file << " \"results\": {" << std::endl; - size_t results_len = result->results.size(); - size_t ri = 0; + for (result = results.begin(); result != results.end(); ++result) + { + json_file << " {" << std::endl; + json_file << " \"name\": \"" << result->name << "\"," << std::endl; + json_file << " \"vlen\": " << (int)(result->vlen) << "," << std::endl; + json_file << " \"iter\": " << result->iter << "," << std::endl; + json_file << " \"best_arch_a\": \"" << result->best_arch_a + << "\"," << std::endl; + json_file << " \"best_arch_u\": \"" << result->best_arch_u + << "\"," << std::endl; + json_file << " \"results\": {" << std::endl; + size_t results_len = result->results.size(); + size_t ri = 0; - std::map::iterator kernel_time_pair; - for(kernel_time_pair = result->results.begin(); kernel_time_pair != result->results.end(); ++kernel_time_pair) { - volk_gnsssdr_test_time_t time = kernel_time_pair->second; - json_file << " \"" << time.name << "\": {" << std::endl; - json_file << " \"name\": \"" << time.name << "\"," << std::endl; - json_file << " \"time\": " << time.time << "," << std::endl; - json_file << " \"units\": \"" << time.units << "\"" << std::endl; - json_file << " }" ; - if(ri+1 != results_len) { - json_file << ","; - } + std::map::iterator kernel_time_pair; + for (kernel_time_pair = result->results.begin(); kernel_time_pair != result->results.end(); ++kernel_time_pair) + { + volk_gnsssdr_test_time_t time = kernel_time_pair->second; + json_file << " \"" << time.name << "\": {" << std::endl; + json_file << " \"name\": \"" << time.name << "\"," << std::endl; + json_file << " \"time\": " << time.time << "," << std::endl; + json_file << " \"units\": \"" << time.units << "\"" << std::endl; + json_file << " }"; + if (ri + 1 != results_len) + { + json_file << ","; + } + json_file << std::endl; + ri++; + } + json_file << " }" << std::endl; + json_file << " }"; + if (i + 1 != len) + { + json_file << ","; + } json_file << std::endl; - ri++; + i++; } - json_file << " }" << std::endl; - json_file << " }"; - if(i+1 != len) { - json_file << ","; - } - json_file << std::endl; - i++; - } json_file << " ]" << std::endl; json_file << "}" << std::endl; } - - diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/volk_gnsssdr_profile.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/volk_gnsssdr_profile.h index 26ff1249b..0b1a6a46e 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/volk_gnsssdr_profile.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/volk_gnsssdr_profile.h @@ -27,10 +27,10 @@ * ------------------------------------------------------------------------- */ -#include // for bool -#include // for ofstream -#include // for string -#include // for vector +#include // for bool +#include // for ofstream +#include // for string +#include // for vector class volk_test_results_t; diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/msvc/config.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/msvc/config.h index 8b12c2a47..5da8f1bff 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/msvc/config.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/msvc/config.h @@ -1,15 +1,15 @@ -#ifndef _MSC_VER // [ +#ifndef _MSC_VER // [ #error "Use this header only with Microsoft Visual C++ compilers!" -#endif // _MSC_VER ] +#endif // _MSC_VER ] -#ifndef _MSC_CONFIG_H_ // [ +#ifndef _MSC_CONFIG_H_ // [ #define _MSC_CONFIG_H_ //////////////////////////////////////////////////////////////////////// // enable inline functions for C code //////////////////////////////////////////////////////////////////////// #ifndef __cplusplus -# define inline __inline +#define inline __inline #endif //////////////////////////////////////////////////////////////////////// @@ -23,12 +23,15 @@ typedef ptrdiff_t ssize_t; //////////////////////////////////////////////////////////////////////// #if _MSC_VER < 1800 #include -static inline long lrint(double x){return (long)(x > 0.0 ? x + 0.5 : x - 0.5);} -static inline long lrintf(float x){return (long)(x > 0.0f ? x + 0.5f : x - 0.5f);} -static inline long long llrint(double x){return (long long)(x > 0.0 ? x + 0.5 : x - 0.5);} -static inline long long llrintf(float x){return (long long)(x > 0.0f ? x + 0.5f : x - 0.5f);} -static inline double rint(double x){return (x > 0.0)? floor(x + 0.5) : ceil(x - 0.5);} -static inline float rintf(float x){return (x > 0.0f)? floorf(x + 0.5f) : ceilf(x - 0.5f);} +static inline long lrint(double x) +{ + return (long)(x > 0.0 ? x + 0.5 : x - 0.5); +} +static inline long lrintf(float x) { return (long)(x > 0.0f ? x + 0.5f : x - 0.5f); } +static inline long long llrint(double x) { return (long long)(x > 0.0 ? x + 0.5 : x - 0.5); } +static inline long long llrintf(float x) { return (long long)(x > 0.0f ? x + 0.5f : x - 0.5f); } +static inline double rint(double x) { return (x > 0.0) ? floor(x + 0.5) : ceil(x - 0.5); } +static inline float rintf(float x) { return (x > 0.0f) ? floorf(x + 0.5f) : ceilf(x - 0.5f); } #endif //////////////////////////////////////////////////////////////////////// @@ -43,7 +46,10 @@ static inline float rintf(float x){return (x > 0.0f)? floorf(x + 0.5f) : ceilf(x // random and srandom //////////////////////////////////////////////////////////////////////// #include -static inline long int random (void) { return rand(); } -static inline void srandom (unsigned int seed) { srand(seed); } +static inline long int random(void) +{ + return rand(); +} +static inline void srandom(unsigned int seed) { srand(seed); } -#endif // _MSC_CONFIG_H_ ] +#endif // _MSC_CONFIG_H_ ] diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/include/volk_gnsssdr/saturation_arithmetic.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/include/volk_gnsssdr/saturation_arithmetic.h index 194bb46e3..77a6cc84d 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/include/volk_gnsssdr/saturation_arithmetic.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/include/volk_gnsssdr/saturation_arithmetic.h @@ -29,7 +29,7 @@ static inline int16_t sat_adds16i(int16_t x, int16_t y) { - int32_t res = (int32_t) x + (int32_t) y; + int32_t res = (int32_t)x + (int32_t)y; if (res < SHRT_MIN) res = SHRT_MIN; if (res > SHRT_MAX) res = SHRT_MAX; @@ -39,7 +39,7 @@ static inline int16_t sat_adds16i(int16_t x, int16_t y) static inline int16_t sat_muls16i(int16_t x, int16_t y) { - int32_t res = (int32_t) x * (int32_t) y; + int32_t res = (int32_t)x * (int32_t)y; if (res < SHRT_MIN) res = SHRT_MIN; if (res > SHRT_MAX) res = SHRT_MAX; diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/include/volk_gnsssdr/volk_gnsssdr_avx_intrinsics.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/include/volk_gnsssdr/volk_gnsssdr_avx_intrinsics.h index 809aa98f9..dbb67f986 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/include/volk_gnsssdr/volk_gnsssdr_avx_intrinsics.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/include/volk_gnsssdr/volk_gnsssdr_avx_intrinsics.h @@ -30,38 +30,42 @@ static inline __m256 _mm256_complexmul_ps(__m256 x, __m256 y) { - __m256 yl, yh, tmp1, tmp2; - yl = _mm256_moveldup_ps(y); // Load yl with cr,cr,dr,dr ... - yh = _mm256_movehdup_ps(y); // Load yh with ci,ci,di,di ... - tmp1 = _mm256_mul_ps(x, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr ... - x = _mm256_shuffle_ps(x, x, 0xB1); // Re-arrange x to be ai,ar,bi,br ... - tmp2 = _mm256_mul_ps(x, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di - return _mm256_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di + __m256 yl, yh, tmp1, tmp2; + yl = _mm256_moveldup_ps(y); // Load yl with cr,cr,dr,dr ... + yh = _mm256_movehdup_ps(y); // Load yh with ci,ci,di,di ... + tmp1 = _mm256_mul_ps(x, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr ... + x = _mm256_shuffle_ps(x, x, 0xB1); // Re-arrange x to be ai,ar,bi,br ... + tmp2 = _mm256_mul_ps(x, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di + return _mm256_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di } static inline __m256 -_mm256_conjugate_ps(__m256 x){ - const __m256 conjugator = _mm256_setr_ps(0, -0.f, 0, -0.f, 0, -0.f, 0, -0.f); - return _mm256_xor_ps(x, conjugator); // conjugate y +_mm256_conjugate_ps(__m256 x) +{ + const __m256 conjugator = _mm256_setr_ps(0, -0.f, 0, -0.f, 0, -0.f, 0, -0.f); + return _mm256_xor_ps(x, conjugator); // conjugate y } static inline __m256 -_mm256_complexconjugatemul_ps(__m256 x, __m256 y){ - y = _mm256_conjugate_ps(y); - return _mm256_complexmul_ps(x, y); +_mm256_complexconjugatemul_ps(__m256 x, __m256 y) +{ + y = _mm256_conjugate_ps(y); + return _mm256_complexmul_ps(x, y); } static inline __m256 -_mm256_magnitudesquared_ps(__m256 cplxValue1, __m256 cplxValue2){ - __m256 complex1, complex2; - cplxValue1 = _mm256_mul_ps(cplxValue1, cplxValue1); // Square the values - cplxValue2 = _mm256_mul_ps(cplxValue2, cplxValue2); // Square the Values - complex1 = _mm256_permute2f128_ps(cplxValue1, cplxValue2, 0x20); - complex2 = _mm256_permute2f128_ps(cplxValue1, cplxValue2, 0x31); - return _mm256_hadd_ps(complex1, complex2); // Add the I2 and Q2 values +_mm256_magnitudesquared_ps(__m256 cplxValue1, __m256 cplxValue2) +{ + __m256 complex1, complex2; + cplxValue1 = _mm256_mul_ps(cplxValue1, cplxValue1); // Square the values + cplxValue2 = _mm256_mul_ps(cplxValue2, cplxValue2); // Square the Values + complex1 = _mm256_permute2f128_ps(cplxValue1, cplxValue2, 0x20); + complex2 = _mm256_permute2f128_ps(cplxValue1, cplxValue2, 0x31); + return _mm256_hadd_ps(complex1, complex2); // Add the I2 and Q2 values } -static inline __m256 _mm256_complexnormalise_ps( __m256 z ){ +static inline __m256 _mm256_complexnormalise_ps(__m256 z) +{ __m256 tmp1 = _mm256_mul_ps(z, z); __m256 tmp2 = _mm256_hadd_ps(tmp1, tmp1); tmp1 = _mm256_shuffle_ps(tmp2, tmp2, 0xD8); @@ -70,8 +74,9 @@ static inline __m256 _mm256_complexnormalise_ps( __m256 z ){ } static inline __m256 -_mm256_magnitude_ps(__m256 cplxValue1, __m256 cplxValue2){ - return _mm256_sqrt_ps(_mm256_magnitudesquared_ps(cplxValue1, cplxValue2)); +_mm256_magnitude_ps(__m256 cplxValue1, __m256 cplxValue2) +{ + return _mm256_sqrt_ps(_mm256_magnitudesquared_ps(cplxValue1, cplxValue2)); } #endif /* INCLUDE_VOLK_VOLK_AVX_INTRINSICS_H_ */ diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/include/volk_gnsssdr/volk_gnsssdr_common.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/include/volk_gnsssdr/volk_gnsssdr_common.h index 24b6501b8..d97ce89b1 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/include/volk_gnsssdr/volk_gnsssdr_common.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/include/volk_gnsssdr/volk_gnsssdr_common.h @@ -28,14 +28,14 @@ // Cross-platform attribute macros not included in VOLK //////////////////////////////////////////////////////////////////////// #if defined __GNUC__ -# define __VOLK_GNSSSDR_PREFETCH(addr) __builtin_prefetch(addr) -# define __VOLK_GNSSSDR_PREFETCH_LOCALITY(addr, rw, locality) __builtin_prefetch(addr, rw, locality) +#define __VOLK_GNSSSDR_PREFETCH(addr) __builtin_prefetch(addr) +#define __VOLK_GNSSSDR_PREFETCH_LOCALITY(addr, rw, locality) __builtin_prefetch(addr, rw, locality) #elif _MSC_VER -# define __VOLK_GNSSSDR_PREFETCH(addr) -# define __VOLK_GNSSSDR_PREFETCH_LOCALITY(addr, rw, locality) +#define __VOLK_GNSSSDR_PREFETCH(addr) +#define __VOLK_GNSSSDR_PREFETCH_LOCALITY(addr, rw, locality) #else -# define __VOLK_GNSSSDR_PREFETCH(addr) -# define __VOLK_GNSSSDR_PREFETCH_LOCALITY(addr, rw, locality) +#define __VOLK_GNSSSDR_PREFETCH(addr) +#define __VOLK_GNSSSDR_PREFETCH_LOCALITY(addr, rw, locality) #endif #ifndef INCLUDED_LIBVOLK_COMMON_H @@ -45,45 +45,45 @@ // Cross-platform attribute macros //////////////////////////////////////////////////////////////////////// #if defined __GNUC__ -# define __VOLK_ATTR_ALIGNED(x) __attribute__((aligned(x))) -# define __VOLK_ATTR_UNUSED __attribute__((unused)) -# define __VOLK_ATTR_INLINE __attribute__((always_inline)) -# define __VOLK_ATTR_DEPRECATED __attribute__((deprecated)) -# define __VOLK_ASM __asm__ -# define __VOLK_VOLATILE __volatile__ -# if __GNUC__ >= 4 -# define __VOLK_ATTR_EXPORT __attribute__((visibility("default"))) -# define __VOLK_ATTR_IMPORT __attribute__((visibility("default"))) -# else -# define __VOLK_ATTR_EXPORT -# define __VOLK_ATTR_IMPORT -# endif -#elif _MSC_VER -# define __VOLK_ATTR_ALIGNED(x) __declspec(align(x)) -# define __VOLK_ATTR_UNUSED -# define __VOLK_ATTR_INLINE __forceinline -# define __VOLK_ATTR_DEPRECATED __declspec(deprecated) -# define __VOLK_ATTR_EXPORT __declspec(dllexport) -# define __VOLK_ATTR_IMPORT __declspec(dllimport) -# define __VOLK_ASM __asm -# define __VOLK_VOLATILE +#define __VOLK_ATTR_ALIGNED(x) __attribute__((aligned(x))) +#define __VOLK_ATTR_UNUSED __attribute__((unused)) +#define __VOLK_ATTR_INLINE __attribute__((always_inline)) +#define __VOLK_ATTR_DEPRECATED __attribute__((deprecated)) +#define __VOLK_ASM __asm__ +#define __VOLK_VOLATILE __volatile__ +#if __GNUC__ >= 4 +#define __VOLK_ATTR_EXPORT __attribute__((visibility("default"))) +#define __VOLK_ATTR_IMPORT __attribute__((visibility("default"))) #else -# define __VOLK_ATTR_ALIGNED(x) -# define __VOLK_ATTR_UNUSED -# define __VOLK_ATTR_INLINE -# define __VOLK_ATTR_DEPRECATED -# define __VOLK_ATTR_EXPORT -# define __VOLK_ATTR_IMPORT -# define __VOLK_ASM __asm__ -# define __VOLK_VOLATILE __volatile__ +#define __VOLK_ATTR_EXPORT +#define __VOLK_ATTR_IMPORT +#endif +#elif _MSC_VER +#define __VOLK_ATTR_ALIGNED(x) __declspec(align(x)) +#define __VOLK_ATTR_UNUSED +#define __VOLK_ATTR_INLINE __forceinline +#define __VOLK_ATTR_DEPRECATED __declspec(deprecated) +#define __VOLK_ATTR_EXPORT __declspec(dllexport) +#define __VOLK_ATTR_IMPORT __declspec(dllimport) +#define __VOLK_ASM __asm +#define __VOLK_VOLATILE +#else +#define __VOLK_ATTR_ALIGNED(x) +#define __VOLK_ATTR_UNUSED +#define __VOLK_ATTR_INLINE +#define __VOLK_ATTR_DEPRECATED +#define __VOLK_ATTR_EXPORT +#define __VOLK_ATTR_IMPORT +#define __VOLK_ASM __asm__ +#define __VOLK_VOLATILE __volatile__ #endif //////////////////////////////////////////////////////////////////////// // Ignore annoying warnings in MSVC //////////////////////////////////////////////////////////////////////// #if defined(_MSC_VER) -# pragma warning(disable: 4244) //'conversion' conversion from 'type1' to 'type2', possible loss of data -# pragma warning(disable: 4305) //'identifier' : truncation from 'type1' to 'type2' +#pragma warning(disable : 4244) //'conversion' conversion from 'type1' to 'type2', possible loss of data +#pragma warning(disable : 4305) //'identifier' : truncation from 'type1' to 'type2' #endif //////////////////////////////////////////////////////////////////////// @@ -91,11 +91,13 @@ // FIXME: due to the usage of complex.h, require gcc for c-linkage //////////////////////////////////////////////////////////////////////// #if defined(__cplusplus) && (__GNUC__) -# define __VOLK_DECL_BEGIN extern "C" { -# define __VOLK_DECL_END } +#define __VOLK_DECL_BEGIN \ + extern "C" \ + { +#define __VOLK_DECL_END } #else -# define __VOLK_DECL_BEGIN -# define __VOLK_DECL_END +#define __VOLK_DECL_BEGIN +#define __VOLK_DECL_END #endif //////////////////////////////////////////////////////////////////////// @@ -103,9 +105,9 @@ // http://gcc.gnu.org/wiki/Visibility //////////////////////////////////////////////////////////////////////// #ifdef volk_gnsssdr_EXPORTS -# define VOLK_API __VOLK_ATTR_EXPORT +#define VOLK_API __VOLK_ATTR_EXPORT #else -# define VOLK_API __VOLK_ATTR_IMPORT +#define VOLK_API __VOLK_ATTR_IMPORT #endif //////////////////////////////////////////////////////////////////////// @@ -121,35 +123,37 @@ #endif #endif -union bit128{ - uint8_t i8[16]; - uint16_t i16[8]; - uint32_t i[4]; - float f[4]; - double d[2]; +union bit128 +{ + uint8_t i8[16]; + uint16_t i16[8]; + uint32_t i[4]; + float f[4]; + double d[2]; - #ifdef LV_HAVE_SSE - __m128 float_vec; - #endif +#ifdef LV_HAVE_SSE + __m128 float_vec; +#endif - #ifdef LV_HAVE_SSE2 - __m128i int_vec; - __m128d double_vec; - #endif +#ifdef LV_HAVE_SSE2 + __m128i int_vec; + __m128d double_vec; +#endif }; -union bit256{ - uint8_t i8[32]; - uint16_t i16[16]; - uint32_t i[8]; - float f[8]; - double d[4]; +union bit256 +{ + uint8_t i8[32]; + uint16_t i16[16]; + uint32_t i[8]; + float f[8]; + double d[4]; - #ifdef LV_HAVE_AVX - __m256 float_vec; - __m256i int_vec; - __m256d double_vec; - #endif +#ifdef LV_HAVE_AVX + __m256 float_vec; + __m256i int_vec; + __m256d double_vec; +#endif }; #define bit128_p(x) ((union bit128 *)(x)) diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/include/volk_gnsssdr/volk_gnsssdr_complex.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/include/volk_gnsssdr/volk_gnsssdr_complex.h index 237266679..648eb26f9 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/include/volk_gnsssdr/volk_gnsssdr_complex.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/include/volk_gnsssdr/volk_gnsssdr_complex.h @@ -48,26 +48,34 @@ #include #include -typedef std::complex lv_8sc_t; +typedef std::complex lv_8sc_t; typedef std::complex lv_16sc_t; typedef std::complex lv_32sc_t; typedef std::complex lv_64sc_t; -typedef std::complex lv_32fc_t; -typedef std::complex lv_64fc_t; +typedef std::complex lv_32fc_t; +typedef std::complex lv_64fc_t; -template inline std::complex lv_cmake(const T &r, const T &i){ +template +inline std::complex lv_cmake(const T &r, const T &i) +{ return std::complex(r, i); } -template inline typename T::value_type lv_creal(const T &x){ +template +inline typename T::value_type lv_creal(const T &x) +{ return x.real(); } -template inline typename T::value_type lv_cimag(const T &x){ +template +inline typename T::value_type lv_cimag(const T &x) +{ return x.imag(); } -template inline T lv_conj(const T &x){ +template +inline T lv_conj(const T &x) +{ return std::conj(x); } @@ -80,14 +88,14 @@ template inline T lv_conj(const T &x){ #include -typedef char complex lv_8sc_t; -typedef short complex lv_16sc_t; -typedef long complex lv_32sc_t; -typedef long long complex lv_64sc_t; -typedef float complex lv_32fc_t; -typedef double complex lv_64fc_t; +typedef char complex lv_8sc_t; +typedef short complex lv_16sc_t; +typedef long complex lv_32sc_t; +typedef long long complex lv_64sc_t; +typedef float complex lv_32fc_t; +typedef double complex lv_64fc_t; -#define lv_cmake(r, i) ((r) + _Complex_I*(i)) +#define lv_cmake(r, i) ((r) + _Complex_I * (i)) // When GNUC is available, use the complex extensions. // The extensions always return the correct value type. diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/include/volk_gnsssdr/volk_gnsssdr_neon_intrinsics.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/include/volk_gnsssdr/volk_gnsssdr_neon_intrinsics.h index 49aa561d1..0de07d600 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/include/volk_gnsssdr/volk_gnsssdr_neon_intrinsics.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/include/volk_gnsssdr/volk_gnsssdr_neon_intrinsics.h @@ -27,30 +27,30 @@ #include -static inline float32x4_t vdivq_f32( float32x4_t num, float32x4_t den ) +static inline float32x4_t vdivq_f32(float32x4_t num, float32x4_t den) { - const float32x4_t q_inv0 = vrecpeq_f32( den ); - const float32x4_t q_step0 = vrecpsq_f32( q_inv0, den ); + const float32x4_t q_inv0 = vrecpeq_f32(den); + const float32x4_t q_step0 = vrecpsq_f32(q_inv0, den); - const float32x4_t q_inv1 = vmulq_f32( q_step0, q_inv0 ); - return vmulq_f32( num, q_inv1 ); + const float32x4_t q_inv1 = vmulq_f32(q_step0, q_inv0); + return vmulq_f32(num, q_inv1); } -static inline float32x4_t vsqrtq_f32( float32x4_t q_x ) +static inline float32x4_t vsqrtq_f32(float32x4_t q_x) { - const float32x4_t q_step_0 = vrsqrteq_f32( q_x ); + const float32x4_t q_step_0 = vrsqrteq_f32(q_x); // step - const float32x4_t q_step_parm0 = vmulq_f32( q_x, q_step_0 ); - const float32x4_t q_step_result0 = vrsqrtsq_f32( q_step_parm0, q_step_0 ); + const float32x4_t q_step_parm0 = vmulq_f32(q_x, q_step_0); + const float32x4_t q_step_result0 = vrsqrtsq_f32(q_step_parm0, q_step_0); // step - const float32x4_t q_step_1 = vmulq_f32( q_step_0, q_step_result0 ); - const float32x4_t q_step_parm1 = vmulq_f32( q_x, q_step_1 ); - const float32x4_t q_step_result1 = vrsqrtsq_f32( q_step_parm1, q_step_1 ); + const float32x4_t q_step_1 = vmulq_f32(q_step_0, q_step_result0); + const float32x4_t q_step_parm1 = vmulq_f32(q_x, q_step_1); + const float32x4_t q_step_result1 = vrsqrtsq_f32(q_step_parm1, q_step_1); // take the res - const float32x4_t q_step_2 = vmulq_f32( q_step_1, q_step_result1 ); + const float32x4_t q_step_2 = vmulq_f32(q_step_1, q_step_result1); // mul by x to get sqrt, not rsqrt - return vmulq_f32( q_x, q_step_2 ); + return vmulq_f32(q_x, q_step_2); } #endif /* INCLUDED_VOLK_GNSSSDR_NEON_INTRINSICS_H_ */ diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/include/volk_gnsssdr/volk_gnsssdr_prefs.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/include/volk_gnsssdr/volk_gnsssdr_prefs.h index bb03e4407..372079450 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/include/volk_gnsssdr/volk_gnsssdr_prefs.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/include/volk_gnsssdr/volk_gnsssdr_prefs.h @@ -32,9 +32,9 @@ __VOLK_DECL_BEGIN typedef struct volk_gnsssdr_arch_pref { - char name[128]; //name of the kernel - char impl_a[128]; //best aligned impl - char impl_u[128]; //best unaligned impl + char name[128]; //name of the kernel + char impl_a[128]; //best aligned impl + char impl_u[128]; //best unaligned impl } volk_gnsssdr_arch_pref_t; //////////////////////////////////////////////////////////////////////// diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/include/volk_gnsssdr/volk_gnsssdr_sine_table.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/include/volk_gnsssdr/volk_gnsssdr_sine_table.h index 90bd78569..4ba0bb631 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/include/volk_gnsssdr/volk_gnsssdr_sine_table.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/include/volk_gnsssdr/volk_gnsssdr_sine_table.h @@ -29,1030 +29,1030 @@ * max_error = 2.353084136763606e-06 */ static const float sine_table_10bits[1 << 10][2] = { -{ 2.925817799165007e-09, 7.219194364267018e-09 }, - { 2.925707643778599e-09, 2.526699001579799e-07 }, - { 2.925487337153070e-09, 1.191140162167675e-06 }, - { 2.925156887582842e-09, 3.284585035595589e-06 }, - { 2.924716307509151e-09, 6.994872605695784e-06 }, - { 2.924165613519592e-09, 1.278374920658798e-05 }, - { 2.923504826347475e-09, 2.111280464718590e-05 }, - { 2.922733970871080e-09, 3.244343744537165e-05 }, - { 2.921853076112655e-09, 4.723682007436170e-05 }, - { 2.920862175237416e-09, 6.595386421935634e-05 }, - { 2.919761305552202e-09, 8.905518605213658e-05 }, - { 2.918550508504146e-09, 1.170010715193098e-04 }, - { 2.917229829679050e-09, 1.502514416517192e-04 }, - { 2.915799318799769e-09, 1.892658178912071e-04 }, - { 2.914259029724184e-09, 2.345032874456615e-04 }, - { 2.912609020443340e-09, 2.864224686607020e-04 }, - { 2.910849353079123e-09, 3.454814764261432e-04 }, - { 2.908980093882049e-09, 4.121378876027343e-04 }, - { 2.907001313228646e-09, 4.868487064877691e-04 }, - { 2.904913085618902e-09, 5.700703303049837e-04 }, - { 2.902715489673383e-09, 6.622585147355725e-04 }, - { 2.900408608130373e-09, 7.638683394782519e-04 }, - { 2.897992527842612e-09, 8.753541738578119e-04 }, - { 2.895467339774186e-09, 9.971696424604937e-04 }, - { 2.892833138996999e-09, 1.129767590823255e-03 }, - { 2.890090024687216e-09, 1.273600051161478e-03 }, - { 2.887238100121550e-09, 1.429118208142094e-03 }, - { 2.884277472673313e-09, 1.596772364709564e-03 }, - { 2.881208253808507e-09, 1.777011907950626e-03 }, - { 2.878030559081432e-09, 1.970285275029487e-03 }, - { 2.874744508130554e-09, 2.177039919152579e-03 }, - { 2.871350224673798e-09, 2.397722275614272e-03 }, - { 2.867847836504030e-09, 2.632777727878843e-03 }, - { 2.864237475484149e-09, 2.882650573737405e-03 }, - { 2.860519277542297e-09, 3.147783991507308e-03 }, - { 2.856693382666432e-09, 3.428620006328931e-03 }, - { 2.852759934899389e-09, 3.725599456482154e-03 }, - { 2.848719082333207e-09, 4.039161959812243e-03 }, - { 2.844570977103752e-09, 4.369745880190706e-03 }, - { 2.840315775384800e-09, 4.717788294077374e-03 }, - { 2.835953637382310e-09, 5.083724957128360e-03 }, - { 2.831484727328322e-09, 5.467990270896617e-03 }, - { 2.826909213474759e-09, 5.871017249604038e-03 }, - { 2.822227268087134e-09, 6.293237486988512e-03 }, - { 2.817439067438018e-09, 6.735081123237729e-03 }, - { 2.812544791800534e-09, 7.196976811989608e-03 }, - { 2.807544625441273e-09, 7.679351687456759e-03 }, - { 2.802438756613836e-09, 8.182631331563162e-03 }, - { 2.797227377551135e-09, 8.707239741274575e-03 }, - { 2.791910684458716e-09, 9.253599295902304e-03 }, - { 2.786488877507140e-09, 9.822130724578715e-03 }, - { 2.780962160824228e-09, 1.041325307382490e-02 }, - { 2.775330742487884e-09, 1.102738367513773e-02 }, - { 2.769594834517682e-09, 1.166493811278924e-02 }, - { 2.763754652867477e-09, 1.232633019159818e-02 }, - { 2.757810417416620e-09, 1.301197190494069e-02 }, - { 2.751762351962413e-09, 1.372227340270610e-02 }, - { 2.745610684210923e-09, 1.445764295952962e-02 }, - { 2.739355645769094e-09, 1.521848694296229e-02 }, - { 2.732997472135539e-09, 1.600520978188769e-02 }, - { 2.726536402691907e-09, 1.681821393496225e-02 }, - { 2.719972680693777e-09, 1.765789985920713e-02 }, - { 2.713306553261610e-09, 1.852466597868779e-02 }, - { 2.706538271371373e-09, 1.941890865333146e-02 }, - { 2.699668089844909e-09, 2.034102214787814e-02 }, - { 2.692696267340880e-09, 2.129139860085272e-02 }, - { 2.685623066344263e-09, 2.227042799383416e-02 }, - { 2.678448753157212e-09, 2.327849812064098e-02 }, - { 2.671173597888530e-09, 2.431599455681316e-02 }, - { 2.663797874443630e-09, 2.538330062913108e-02 }, - { 2.656321860514457e-09, 2.648079738524795e-02 }, - { 2.648745837568575e-09, 2.760886356354952e-02 }, - { 2.641070090839117e-09, 2.876787556300114e-02 }, - { 2.633294909313421e-09, 2.995820741329835e-02 }, - { 2.625420585722845e-09, 3.118023074495535e-02 }, - { 2.617447416531143e-09, 3.243431475972608e-02 }, - { 2.609375701923643e-09, 3.372082620101990e-02 }, - { 2.601205745795833e-09, 3.504012932452527e-02 }, - { 2.592937855741933e-09, 3.639258586895711e-02 }, - { 2.584572343043400e-09, 3.777855502693250e-02 }, - { 2.576109522656942e-09, 3.919839341605197e-02 }, - { 2.567549713203028e-09, 4.065245505002102e-02 }, - { 2.558893236953688e-09, 4.214109131001403e-02 }, - { 2.550140419820252e-09, 4.366465091617666e-02 }, - { 2.541291591341445e-09, 4.522347989919473e-02 }, - { 2.532347084670572e-09, 4.681792157215026e-02 }, - { 2.523307236563343e-09, 4.844831650239501e-02 }, - { 2.514172387364900e-09, 5.011500248369893e-02 }, - { 2.504942880997064e-09, 5.181831450849345e-02 }, - { 2.495619064945627e-09, 5.355858474024022e-02 }, - { 2.486201290246928e-09, 5.533614248606705e-02 }, - { 2.476689911475047e-09, 5.715131416942842e-02 }, - { 2.467085286727668e-09, 5.900442330315692e-02 }, - { 2.457387777613798e-09, 6.089579046229943e-02 }, - { 2.447597749239101e-09, 6.282573325755320e-02 }, - { 2.437715570192557e-09, 6.479456630859221e-02 }, - { 2.427741612532542e-09, 6.680260121764925e-02 }, - { 2.417676251773166e-09, 6.885014654319160e-02 }, - { 2.407519866869294e-09, 7.093750777401114e-02 }, - { 2.397272840203310e-09, 7.306498730310884e-02 }, - { 2.386935557569868e-09, 7.523288440214027e-02 }, - { 2.376508408161815e-09, 7.744149519577415e-02 }, - { 2.365991784555363e-09, 7.969111263635709e-02 }, - { 2.355386082695641e-09, 8.198202647865405e-02 }, - { 2.344691701881232e-09, 8.431452325495814e-02 }, - { 2.333909044749407e-09, 8.668888625021409e-02 }, - { 2.323038517261246e-09, 8.910539547731611e-02 }, - { 2.312080528685971e-09, 9.156432765274414e-02 }, - { 2.301035491585642e-09, 9.406595617227698e-02 }, - { 2.289903821799651e-09, 9.661055108691619e-02 }, - { 2.278685938428940e-09, 9.919837907903295e-02 }, - { 2.267382263820762e-09, 1.018297034385580e-01 }, - { 2.255993223551837e-09, 1.045047840397028e-01 }, - { 2.244519246413220e-09, 1.072238773174577e-01 }, - { 2.232960764393620e-09, 1.099872362446146e-01 }, - { 2.221318212663309e-09, 1.127951103088245e-01 }, - { 2.209592029557811e-09, 1.156477454898748e-01 }, - { 2.197782656561395e-09, 1.185453842371912e-01 }, - { 2.185890538290176e-09, 1.214882654476019e-01 }, - { 2.173916122475606e-09, 1.244766244431883e-01 }, - { 2.161859859947797e-09, 1.275106929493488e-01 }, - { 2.149722204618256e-09, 1.305906990731841e-01 }, - { 2.137503613462743e-09, 1.337168672820376e-01 }, - { 2.125204546504321e-09, 1.368894183821595e-01 }, - { 2.112825466795944e-09, 1.401085694976751e-01 }, - { 2.100366840402933e-09, 1.433745340497602e-01 }, - { 2.087829136385612e-09, 1.466875217359607e-01 }, - { 2.075212826781308e-09, 1.500477385098620e-01 }, - { 2.062518386587093e-09, 1.534553865607503e-01 }, - { 2.049746293741359e-09, 1.569106642937665e-01 }, - { 2.036897029106193e-09, 1.604137663100403e-01 }, - { 2.023971076449323e-09, 1.639648833871233e-01 }, - { 2.010968922425217e-09, 1.675642024598467e-01 }, - { 1.997891056557933e-09, 1.712119066008896e-01 }, - { 1.984737971221581e-09, 1.749081750021970e-01 }, - { 1.971510161622434e-09, 1.786531829561379e-01 }, - { 1.958208125780130e-09, 1.824471018371070e-01 }, - { 1.944832364508511e-09, 1.862900990834311e-01 }, - { 1.931383381397782e-09, 1.901823381790926e-01 }, - { 1.917861682794392e-09, 1.941239786363039e-01 }, - { 1.904267777782611e-09, 1.981151759777950e-01 }, - { 1.890602178165317e-09, 2.021560817195309e-01 }, - { 1.876865398444616e-09, 2.062468433536743e-01 }, - { 1.863057955802572e-09, 2.103876043317229e-01 }, - { 1.849180370081465e-09, 2.145785040479915e-01 }, - { 1.835233163764673e-09, 2.188196778231083e-01 }, - { 1.821216861956509e-09, 2.231112568880342e-01 }, - { 1.807131992362945e-09, 2.274533683680190e-01 }, - { 1.792979085271234e-09, 2.318461352671018e-01 }, - { 1.778758673530482e-09, 2.362896764525300e-01 }, - { 1.764471292530943e-09, 2.407841066397789e-01 }, - { 1.750117480184598e-09, 2.453295363773890e-01 }, - { 1.735697776904342e-09, 2.499260720324433e-01 }, - { 1.721212725583874e-09, 2.545738157760434e-01 }, - { 1.706662871577097e-09, 2.592728655691494e-01 }, - { 1.692048762677849e-09, 2.640233151485341e-01 }, - { 1.677370949099090e-09, 2.688252540131204e-01 }, - { 1.662629983452104e-09, 2.736787674105404e-01 }, - { 1.647826420726167e-09, 2.785839363237506e-01 }, - { 1.632960818266680e-09, 2.835408374583758e-01 }, - { 1.618033735755429e-09, 2.885495432295704e-01 }, - { 1.603045735188609e-09, 2.936101217498361e-01 }, - { 1.587997380855918e-09, 2.987226368167127e-01 }, - { 1.572889239319430e-09, 3.038871479007593e-01 }, - { 1.557721879392051e-09, 3.091037101339017e-01 }, - { 1.542495872116447e-09, 3.143723742978435e-01 }, - { 1.527211790743024e-09, 3.196931868130269e-01 }, - { 1.511870210708909e-09, 3.250661897274744e-01 }, - { 1.496471709615926e-09, 3.304914207062036e-01 }, - { 1.481016867208896e-09, 3.359689130207621e-01 }, - { 1.465506265353924e-09, 3.414986955389885e-01 }, - { 1.449940488016384e-09, 3.470807927151147e-01 }, - { 1.434320121238994e-09, 3.527152245800635e-01 }, - { 1.418645753119802e-09, 3.584020067320109e-01 }, - { 1.402917973789838e-09, 3.641411503272979e-01 }, - { 1.387137375391042e-09, 3.699326620714776e-01 }, - { 1.371304552054134e-09, 3.757765442106153e-01 }, - { 1.355420099875958e-09, 3.816727945230153e-01 }, - { 1.339484616897137e-09, 3.876214063110671e-01 }, - { 1.323498703079580e-09, 3.936223683933865e-01 }, - { 1.307462960283922e-09, 3.996756650972121e-01 }, - { 1.291377992246768e-09, 4.057812762511174e-01 }, - { 1.275244404558188e-09, 4.119391771778626e-01 }, - { 1.259062804638585e-09, 4.181493386877248e-01 }, - { 1.242833801715929e-09, 4.244117270719281e-01 }, - { 1.226558006803155e-09, 4.307263040962509e-01 }, - { 1.210236032674760e-09, 4.370930269951803e-01 }, - { 1.193868493843725e-09, 4.435118484661861e-01 }, - { 1.177456006538695e-09, 4.499827166641340e-01 }, - { 1.160999188680582e-09, 4.565055751961679e-01 }, - { 1.144498659859216e-09, 4.630803631168164e-01 }, - { 1.127955041310214e-09, 4.697070149232604e-01 }, - { 1.111368955891417e-09, 4.763854605510119e-01 }, - { 1.094741028059551e-09, 4.831156253697562e-01 }, - { 1.078071883846871e-09, 4.898974301794375e-01 }, - { 1.061362150836978e-09, 4.967307912069362e-01 }, - { 1.044612458142151e-09, 5.036156201023686e-01 }, - { 1.027823436378632e-09, 5.105518239364775e-01 }, - { 1.010995717643647e-09, 5.175393051975563e-01 }, - { 9.941299354913699e-10, 5.245779617890562e-01 }, - { 9.772267249089968e-10, 5.316676870274011e-01 }, - { 9.602867222926046e-10, 5.388083696401416e-01 }, - { 9.433105654240147e-10, 5.459998937639375e-01 }, - { 9.262988934458084e-10, 5.532421389435711e-01 }, - { 9.092523468378193e-10, 5.605349801305876e-01 }, - { 8.921715673928355e-10, 5.678782876825250e-01 }, - { 8.750571981926701e-10, 5.752719273622372e-01 }, - { 8.579098835836508e-10, 5.827157603377209e-01 }, - { 8.407302691522673e-10, 5.902096431821322e-01 }, - { 8.235190017016133e-10, 5.977534278737073e-01 }, - { 8.062767292259225e-10, 6.053469617967722e-01 }, - { 7.890041008871165e-10, 6.129900877421282e-01 }, - { 7.717017669898175e-10, 6.206826439083659e-01 }, - { 7.543703789572603e-10, 6.284244639030392e-01 }, - { 7.370105893063053e-10, 6.362153767444958e-01 }, - { 7.196230516231919e-10, 6.440552068636356e-01 }, - { 7.022084205389746e-10, 6.519437741060674e-01 }, - { 6.847673517046416e-10, 6.598808937346672e-01 }, - { 6.673005017664976e-10, 6.678663764322770e-01 }, - { 6.498085283416530e-10, 6.759000283046127e-01 }, - { 6.322920899929834e-10, 6.839816508836737e-01 }, - { 6.147518462045659e-10, 6.921110411311926e-01 }, - { 5.971884573565851e-10, 7.002879914425926e-01 }, - { 5.796025847007168e-10, 7.085122896509806e-01 }, - { 5.619948903351406e-10, 7.167837190315758e-01 }, - { 5.443660371796048e-10, 7.251020583063744e-01 }, - { 5.267166889504394e-10, 7.334670816491009e-01 }, - { 5.090475101356742e-10, 7.418785586903696e-01 }, - { 4.913591659698399e-10, 7.503362545232619e-01 }, - { 4.736523224091392e-10, 7.588399297089872e-01 }, - { 4.559276461062478e-10, 7.673893402829834e-01 }, - { 4.381858043851147e-10, 7.759842377612828e-01 }, - { 4.204274652161870e-10, 7.846243691469355e-01 }, - { 4.026532971908398e-10, 7.933094769370790e-01 }, - { 3.848639694963359e-10, 8.020392991300200e-01 }, - { 3.670601518910503e-10, 8.108135692324444e-01 }, - { 3.492425146784233e-10, 8.196320162675177e-01 }, - { 3.314117286825031e-10, 8.284943647824689e-01 }, - { 3.135684652223755e-10, 8.374003348569865e-01 }, - { 2.957133960867535e-10, 8.463496421118015e-01 }, - { 2.778471935089361e-10, 8.553419977173513e-01 }, - { 2.599705301412391e-10, 8.643771084029740e-01 }, - { 2.420840790301135e-10, 8.734546764660205e-01 }, - { 2.241885135902046e-10, 8.825743997817682e-01 }, - { 2.062845075795238e-10, 8.917359718130367e-01 }, - { 1.883727350736140e-10, 9.009390816205823e-01 }, - { 1.704538704408269e-10, 9.101834138731877e-01 }, - { 1.525285883160648e-10, 9.194686488588080e-01 }, - { 1.345975635762696e-10, 9.287944624950824e-01 }, - { 1.166614713141648e-10, 9.381605263410157e-01 }, - { 9.872098681369190e-11, 9.475665076080466e-01 }, - { 8.077678552380464e-11, 9.570120691722380e-01 }, - { 6.282954303364090e-11, 9.664968695860140e-01 }, - { 4.487993504668797e-11, 9.760205630906909e-01 }, - { 2.692863735553042e-11, 9.855827996289697e-01 }, - { 8.976325816439114e-12, 9.951832248577780e-01 }, - { -8.976323676304494e-12, 1.004821480161519e+00 }, - { -2.692863521550168e-11, 1.014497202665280e+00 }, - { -4.487993290681805e-11, 1.024210025248670e+00 }, - { -6.282954089398273e-11, 1.033959576559617e+00 }, - { -8.077678338451706e-11, 1.043745481028715e+00 }, - { -9.872098467477489e-11, 1.053567358883467e+00 }, - { -1.166614691757772e-10, 1.063424826163223e+00 }, - { -1.345975614383584e-10, 1.073317494734013e+00 }, - { -1.525285861788948e-10, 1.083244972303963e+00 }, - { -1.704538683042922e-10, 1.093206862438572e+00 }, - { -1.883727329379793e-10, 1.103202764576806e+00 }, - { -2.062845054446831e-10, 1.113232274046796e+00 }, - { -2.241885114563697e-10, 1.123294982082432e+00 }, - { -2.420840768973375e-10, 1.133390475839767e+00 }, - { -2.599705280096278e-10, 1.143518338413855e+00 }, - { -2.778471913784365e-10, 1.153678148855860e+00 }, - { -2.957133939575774e-10, 1.163869482190458e+00 }, - { -3.135684630945758e-10, 1.174091909433296e+00 }, - { -3.314117265561857e-10, 1.184344997608959e+00 }, - { -3.492425125535882e-10, 1.194628309769018e+00 }, - { -3.670601497678034e-10, 1.204941405010466e+00 }, - { -3.848639673748360e-10, 1.215283838494269e+00 }, - { -4.026532950710339e-10, 1.225655161464298e+00 }, - { -4.204274630982869e-10, 1.236054921266445e+00 }, - { -4.381858022691734e-10, 1.246482661367958e+00 }, - { -4.559276439922654e-10, 1.256937921377146e+00 }, - { -4.736523202972214e-10, 1.267420237063216e+00 }, - { -4.913591638600925e-10, 1.277929140376502e+00 }, - { -5.090475080282032e-10, 1.288464159468706e+00 }, - { -5.267166868452449e-10, 1.299024818713528e+00 }, - { -5.443660350768455e-10, 1.309610638727845e+00 }, - { -5.619948882348695e-10, 1.320221136392390e+00 }, - { -5.796025826029868e-10, 1.330855824873457e+00 }, - { -5.971884552615020e-10, 1.341514213644420e+00 }, - { -6.147518441122357e-10, 1.352195808507556e+00 }, - { -6.322920879034590e-10, 1.362900111616144e+00 }, - { -6.498085262549874e-10, 1.373626621496939e+00 }, - { -6.673004996827436e-10, 1.384374833072571e+00 }, - { -6.847673496239581e-10, 1.395144237684605e+00 }, - { -7.022084184613616e-10, 1.405934323116231e+00 }, - { -7.196230495488082e-10, 1.416744573616104e+00 }, - { -7.370105872352039e-10, 1.427574469921397e+00 }, - { -7.543703768894941e-10, 1.438423489281758e+00 }, - { -7.717017649255453e-10, 1.449291105483472e+00 }, - { -7.890040988262324e-10, 1.460176788873383e+00 }, - { -8.062767271686383e-10, 1.471080006383765e+00 }, - { -8.235189996479819e-10, 1.482000221556656e+00 }, - { -8.407302671024475e-10, 1.492936894569018e+00 }, - { -8.579098815375368e-10, 1.503889482257845e+00 }, - { -8.750571961505266e-10, 1.514857438145604e+00 }, - { -8.921715653546624e-10, 1.525840212465756e+00 }, - { -9.092523448036167e-10, 1.536837252188703e+00 }, - { -9.262988914157881e-10, 1.547848001047890e+00 }, - { -9.433105633981766e-10, 1.558871899565883e+00 }, - { -9.602867202711075e-10, 1.569908385081254e+00 }, - { -9.772267228916820e-10, 1.580956891774897e+00 }, - { -9.941299334786078e-10, 1.592016850697478e+00 }, - { -1.010995715635332e-09, 1.603087689796053e+00 }, - { -1.027823434374870e-09, 1.614168833942028e+00 }, - { -1.044612456143047e-09, 1.625259704958335e+00 }, - { -1.061362148842745e-09, 1.636359721647526e+00 }, - { -1.078071881857297e-09, 1.647468299819543e+00 }, - { -1.094741026074900e-09, 1.658584852320419e+00 }, - { -1.111368953911690e-09, 1.669708789060341e+00 }, - { -1.127955039335462e-09, 1.680839517042381e+00 }, - { -1.144498657889600e-09, 1.691976440391624e+00 }, - { -1.160999186716154e-09, 1.703118960383971e+00 }, - { -1.177456004579561e-09, 1.714266475475616e+00 }, - { -1.193868491889832e-09, 1.725418381332405e+00 }, - { -1.210236030726319e-09, 1.736574070859850e+00 }, - { -1.226558004860220e-09, 1.747732934232508e+00 }, - { -1.242833799778447e-09, 1.758894358924547e+00 }, - { -1.259062802706714e-09, 1.770057729740021e+00 }, - { -1.275244402631982e-09, 1.781222428842935e+00 }, - { -1.291377990326492e-09, 1.792387835788660e+00 }, - { -1.307462958369363e-09, 1.803553327553897e+00 }, - { -1.323498701170897e-09, 1.814718278568759e+00 }, - { -1.339484614994490e-09, 1.825882060747428e+00 }, - { -1.355420097979292e-09, 1.837044043519582e+00 }, - { -1.371304550163662e-09, 1.848203593862598e+00 }, - { -1.387137373506711e-09, 1.859360076332671e+00 }, - { -1.402917971911754e-09, 1.870512853097495e+00 }, - { -1.418645751248018e-09, 1.881661283967967e+00 }, - { -1.434320119373722e-09, 1.892804726431080e+00 }, - { -1.449940486157623e-09, 1.903942535681972e+00 }, - { -1.465506263501516e-09, 1.915074064656886e+00 }, - { -1.481016865363264e-09, 1.926198664066737e+00 }, - { -1.496471707776859e-09, 1.937315682428795e+00 }, - { -1.511870208876724e-09, 1.948424466101625e+00 }, - { -1.527211788917509e-09, 1.959524359317042e+00 }, - { -1.542495870297867e-09, 1.970614704215133e+00 }, - { -1.557721877580406e-09, 1.981694840876775e+00 }, - { -1.572889237514880e-09, 1.992764107358707e+00 }, - { -1.587997379058514e-09, 2.003821839726753e+00 }, - { -1.603045733398246e-09, 2.014867372090665e+00 }, - { -1.618033733972424e-09, 2.025900036638798e+00 }, - { -1.632960816490822e-09, 2.036919163671778e+00 }, - { -1.647826418957721e-09, 2.047924081638631e+00 }, - { -1.662629981691070e-09, 2.058914117170269e+00 }, - { -1.677370947345626e-09, 2.069888595116115e+00 }, - { -1.692048760931849e-09, 2.080846838577820e+00 }, - { -1.706662869838827e-09, 2.091788168946183e+00 }, - { -1.721212723853279e-09, 2.102711905935372e+00 }, - { -1.735697775181424e-09, 2.113617367619504e+00 }, - { -1.750117478469621e-09, 2.124503870468520e+00 }, - { -1.764471290823748e-09, 2.135370729383332e+00 }, - { -1.778758671831281e-09, 2.146217257733207e+00 }, - { -1.792979083579974e-09, 2.157042767390815e+00 }, - { -1.807131990679890e-09, 2.167846568770014e+00 }, - { -1.821216860281448e-09, 2.178627970860822e+00 }, - { -1.835233162097977e-09, 2.189386281268046e+00 }, - { -1.849180368423027e-09, 2.200120806246095e+00 }, - { -1.863057954152340e-09, 2.210830850737588e+00 }, - { -1.876865396802907e-09, 2.221515718409926e+00 }, - { -1.890602176531920e-09, 2.232174711691990e+00 }, - { -1.904267776157843e-09, 2.242807131812679e+00 }, - { -1.917861681178094e-09, 2.253412278837029e+00 }, - { -1.931383379790273e-09, 2.263989451705295e+00 }, - { -1.944832362909578e-09, 2.274537948269257e+00 }, - { -1.958208124189984e-09, 2.285057065331676e+00 }, - { -1.971510160041235e-09, 2.295546098682665e+00 }, - { -1.984737969649064e-09, 2.306004343138794e+00 }, - { -1.997891054994522e-09, 2.316431092581699e+00 }, - { -2.010968920870647e-09, 2.326825639994779e+00 }, - { -2.023971074903858e-09, 2.337187277503834e+00 }, - { -2.036897027569834e-09, 2.347515296413520e+00 }, - { -2.049746292214264e-09, 2.357808987247877e+00 }, - { -2.062518385069210e-09, 2.368067639787542e+00 }, - { -2.075212825272584e-09, 2.378290543109652e+00 }, - { -2.087829134886364e-09, 2.388476985626922e+00 }, - { -2.100366838912949e-09, 2.398626255125417e+00 }, - { -2.112825465315542e-09, 2.408737638805759e+00 }, - { -2.125204545033289e-09, 2.418810423320288e+00 }, - { -2.137503612001452e-09, 2.428843894814472e+00 }, - { -2.149722203166389e-09, 2.438837338964302e+00 }, - { -2.161859858505829e-09, 2.448790041018174e+00 }, - { -2.173916121043380e-09, 2.458701285834241e+00 }, - { -2.185890536867478e-09, 2.468570357921585e+00 }, - { -2.197782655148702e-09, 2.478396541480230e+00 }, - { -2.209592028154913e-09, 2.488179120439544e+00 }, - { -2.221318211270522e-09, 2.497917378500214e+00 }, - { -2.232960763010574e-09, 2.507610599172123e+00 }, - { -2.244519245040444e-09, 2.517258065817044e+00 }, - { -2.255993222189014e-09, 2.526859061686102e+00 }, - { -2.267382262468209e-09, 2.536412869962689e+00 }, - { -2.278685937086658e-09, 2.545918773800664e+00 }, - { -2.289903820467374e-09, 2.555376056366064e+00 }, - { -2.301035490263848e-09, 2.564784000877677e+00 }, - { -2.312080527374447e-09, 2.574141890646339e+00 }, - { -2.323038515960257e-09, 2.583449009117307e+00 }, - { -2.333909043458635e-09, 2.592704639909166e+00 }, - { -2.344691700601153e-09, 2.601908066856634e+00 }, - { -2.355386081425938e-09, 2.611058574048749e+00 }, - { -2.365991783296513e-09, 2.620155445872768e+00 }, - { -2.376508406913500e-09, 2.629197967052127e+00 }, - { -2.386935556332088e-09, 2.638185422689490e+00 }, - { -2.397272838976436e-09, 2.647117098307332e+00 }, - { -2.407519865653114e-09, 2.655992279887846e+00 }, - { -2.417676250567891e-09, 2.664810253915885e+00 }, - { -2.427741611338014e-09, 2.673570307418169e+00 }, - { -2.437715569009093e-09, 2.682271728006635e+00 }, - { -2.447597748066437e-09, 2.690913803917100e+00 }, - { -2.457387776452357e-09, 2.699495824053297e+00 }, - { -2.467085285577292e-09, 2.708017078025636e+00 }, - { -2.476689910335470e-09, 2.716476856194105e+00 }, - { -2.486201289118733e-09, 2.724874449709689e+00 }, - { -2.495619063828443e-09, 2.733209150554255e+00 }, - { -2.504942879891263e-09, 2.741480251583985e+00 }, - { -2.514172386270163e-09, 2.749687046568741e+00 }, - { -2.523307235480146e-09, 2.757828830235740e+00 }, - { -2.532347083598520e-09, 2.765904898308531e+00 }, - { -2.541291590280960e-09, 2.773914547551261e+00 }, - { -2.550140418771202e-09, 2.781857075807392e+00 }, - { -2.558893235915887e-09, 2.789731782043156e+00 }, - { -2.567549712176927e-09, 2.797537966388929e+00 }, - { -2.576109521642196e-09, 2.805274930179221e+00 }, - { -2.584572342040407e-09, 2.812941975996573e+00 }, - { -2.592937854750428e-09, 2.820538407710556e+00 }, - { -2.601205744816134e-09, 2.828063530521908e+00 }, - { -2.609375700955458e-09, 2.835516651001539e+00 }, - { -2.617447415574869e-09, 2.842897077134583e+00 }, - { -2.625420584778350e-09, 2.850204118359573e+00 }, - { -2.633294908380520e-09, 2.857437085611509e+00 }, - { -2.641070089918234e-09, 2.864595291363663e+00 }, - { -2.648745836659391e-09, 2.871678049666939e+00 }, - { -2.656321859617343e-09, 2.878684676194483e+00 }, - { -2.663797873558322e-09, 2.885614488280000e+00 }, - { -2.671173597015318e-09, 2.892466804962122e+00 }, - { -2.678448752295859e-09, 2.899240947023252e+00 }, - { -2.685623065495139e-09, 2.905936237033475e+00 }, - { -2.692696266503800e-09, 2.912551999389617e+00 }, - { -2.699668089019767e-09, 2.919087560358171e+00 }, - { -2.706538270558513e-09, 2.925542248116882e+00 }, - { -2.713306552460767e-09, 2.931915392794031e+00 }, - { -2.719972679905295e-09, 2.938206326512581e+00 }, - { -2.726536401915442e-09, 2.944414383428562e+00 }, - { -2.732997471371516e-09, 2.950538899775061e+00 }, - { -2.739355645017194e-09, 2.956579213900666e+00 }, - { -2.745610683471516e-09, 2.962534666313284e+00 }, - { -2.751762351235315e-09, 2.968404599718795e+00 }, - { -2.757810416701751e-09, 2.974188359063684e+00 }, - { -2.763754652165128e-09, 2.979885291576143e+00 }, - { -2.769594833827588e-09, 2.985494746805227e+00 }, - { -2.775330741810390e-09, 2.991016076664491e+00 }, - { -2.780962160159068e-09, 2.996448635469842e+00 }, - { -2.786488876854607e-09, 3.001791779983262e+00 }, - { -2.791910683818570e-09, 3.007044869450794e+00 }, - { -2.797227376923695e-09, 3.012207265645876e+00 }, - { -2.802438755998943e-09, 3.017278332907412e+00 }, - { -2.807544624838820e-09, 3.022257438182037e+00 }, - { -2.812544791210840e-09, 3.027143951064684e+00 }, - { -2.817439066860792e-09, 3.031937243837070e+00 }, - { -2.822227267522746e-09, 3.036636691510884e+00 }, - { -2.826909212922864e-09, 3.041241671864994e+00 }, - { -2.831484726789317e-09, 3.045751565488710e+00 }, - { -2.835953636855826e-09, 3.050165755818853e+00 }, - { -2.840315774871260e-09, 3.054483629182857e+00 }, - { -2.844570976602957e-09, 3.058704574835744e+00 }, - { -2.848719081844986e-09, 3.062827985002047e+00 }, - { -2.852759934424164e-09, 3.066853254915581e+00 }, - { -2.856693382203833e-09, 3.070779782857041e+00 }, - { -2.860519277092708e-09, 3.074606970196721e+00 }, - { -2.864237475047239e-09, 3.078334221430809e+00 }, - { -2.867847836080156e-09, 3.081960944223928e+00 }, - { -2.871350224262603e-09, 3.085486549445314e+00 }, - { -2.874744507732462e-09, 3.088910451211251e+00 }, - { -2.878030558696270e-09, 3.092232066921130e+00 }, - { -2.881208253436038e-09, 3.095450817298478e+00 }, - { -2.884277472313999e-09, 3.098566126429974e+00 }, - { -2.887238099774968e-09, 3.101577421802070e+00 }, - { -2.890090024353816e-09, 3.104484134342861e+00 }, - { -2.892833138676371e-09, 3.107285698457308e+00 }, - { -2.895467339466766e-09, 3.109981552069083e+00 }, - { -2.897992527547963e-09, 3.112571136655481e+00 }, - { -2.900408607848946e-09, 3.115053897289195e+00 }, - { -2.902715489404992e-09, 3.117429282673042e+00 }, - { -2.904913085363323e-09, 3.119696745180238e+00 }, - { -2.907001312986328e-09, 3.121855740892224e+00 }, - { -2.908980093652563e-09, 3.123905729634218e+00 }, - { -2.910849352862924e-09, 3.125846175016163e+00 }, - { -2.912609020239985e-09, 3.127676544466606e+00 }, - { -2.914259029534118e-09, 3.129396309273659e+00 }, - { -2.915799318622574e-09, 3.131004944618667e+00 }, - { -2.917229829515169e-09, 3.132501929616775e+00 }, - { -2.918550508353347e-09, 3.133886747350606e+00 }, - { -2.919761305414294e-09, 3.135158884909254e+00 }, - { -2.920862175112829e-09, 3.136317833424958e+00 }, - { -2.921853076000972e-09, 3.137363088107359e+00 }, - { -2.922733970772719e-09, 3.138294148283254e+00 }, - { -2.923504826262027e-09, 3.139110517429204e+00 }, - { -2.924165613447473e-09, 3.139811703211207e+00 }, - { -2.924716307449950e-09, 3.140397217517018e+00 }, - { -2.925156887536978e-09, 3.140866576495489e+00 }, - { -2.925487337120335e-09, 3.141219300588825e+00 }, - { -2.925707643758784e-09, 3.141454914570261e+00 }, - { -2.925817799158535e-09, 3.141572947579352e+00 }, - { -2.925817799171455e-09, 3.141572933154836e+00 }, - { -2.925707643798390e-09, 3.141454409272987e+00 }, - { -2.925487337185779e-09, 3.141216918378770e+00 }, - { -2.925156887628892e-09, 3.140860007424112e+00 }, - { -2.924716307568119e-09, 3.140383227898687e+00 }, - { -2.924165613591896e-09, 3.139786135867868e+00 }, - { -2.923504826432903e-09, 3.139068292003385e+00 }, - { -2.922733970969412e-09, 3.138229261619561e+00 }, - { -2.921853076224321e-09, 3.137268614707029e+00 }, - { -2.920862175361976e-09, 3.136185925964038e+00 }, - { -2.919761305690083e-09, 3.134980774833275e+00 }, - { -2.918550508654911e-09, 3.133652745531368e+00 }, - { -2.917229829843137e-09, 3.132201427085629e+00 }, - { -2.915799318976726e-09, 3.130626413363146e+00 }, - { -2.914259029914435e-09, 3.128927303107136e+00 }, - { -2.912609020646661e-09, 3.127103699965947e+00 }, - { -2.910849353295315e-09, 3.125155212527586e+00 }, - { -2.908980094111509e-09, 3.123081454351802e+00 }, - { -2.907001313470937e-09, 3.120882043999591e+00 }, - { -2.904913085874448e-09, 3.118556605068443e+00 }, - { -2.902715489941767e-09, 3.116104766219928e+00 }, - { -2.900408608411958e-09, 3.113526161214776e+00 }, - { -2.897992528137022e-09, 3.110820428940251e+00 }, - { -2.895467340081818e-09, 3.107987213444579e+00 }, - { -2.892833139317615e-09, 3.105026163964191e+00 }, - { -2.890090025020589e-09, 3.101936934956479e+00 }, - { -2.887238100468092e-09, 3.098719186130021e+00 }, - { -2.884277473032614e-09, 3.095372582472161e+00 }, - { -2.881208254180937e-09, 3.091896794282404e+00 }, - { -2.878030559466594e-09, 3.088291497198199e+00 }, - { -2.874744508528832e-09, 3.084556372228054e+00 }, - { -2.871350225084755e-09, 3.080691105776848e+00 }, - { -2.867847836928063e-09, 3.076695389678615e+00 }, - { -2.864237475921086e-09, 3.072568921221621e+00 }, - { -2.860519277991847e-09, 3.068311403179147e+00 }, - { -2.856693383129018e-09, 3.063922543837792e+00 }, - { -2.852759935374575e-09, 3.059402057023109e+00 }, - { -2.848719082821403e-09, 3.054749662130841e+00 }, - { -2.844570977604520e-09, 3.049965084150782e+00 }, - { -2.840315775898525e-09, 3.045048053697736e+00 }, - { -2.835953637908582e-09, 3.039998307034967e+00 }, - { -2.831484727867511e-09, 3.034815586104635e+00 }, - { -2.826909214026628e-09, 3.029499638550941e+00 }, - { -2.822227268651470e-09, 3.024050217748861e+00 }, - { -2.817439068015245e-09, 3.018467082830179e+00 }, - { -2.812544792390175e-09, 3.012749998707001e+00 }, - { -2.807544626043751e-09, 3.006898736100911e+00 }, - { -2.802438757228650e-09, 3.000913071564665e+00 }, - { -2.797227378178760e-09, 2.994792787510961e+00 }, - { -2.791910685098702e-09, 2.988537672233504e+00 }, - { -2.786488878159805e-09, 2.982147519935565e+00 }, - { -2.780962161489413e-09, 2.975622130750641e+00 }, - { -2.775330743165298e-09, 2.968961310769028e+00 }, - { -2.769594835207775e-09, 2.962164872061613e+00 }, - { -2.763754653569747e-09, 2.955232632701135e+00 }, - { -2.757810418131543e-09, 2.948164416789036e+00 }, - { -2.751762352689432e-09, 2.940960054474719e+00 }, - { -2.745610684950541e-09, 2.933619381982341e+00 }, - { -2.739355646520809e-09, 2.926142241629213e+00 }, - { -2.732997472899722e-09, 2.918528481852205e+00 }, - { -2.726536403468318e-09, 2.910777957226018e+00 }, - { -2.719972681482232e-09, 2.902890528487386e+00 }, - { -2.713306554062453e-09, 2.894866062556452e+00 }, - { -2.706538272184154e-09, 2.886704432555728e+00 }, - { -2.699668090670078e-09, 2.878405517834426e+00 }, - { -2.692696268177908e-09, 2.869969203985464e+00 }, - { -2.685623067193599e-09, 2.861395382869544e+00 }, - { -2.678448754018380e-09, 2.852683952631486e+00 }, - { -2.671173598761847e-09, 2.843834817723832e+00 }, - { -2.663797875328991e-09, 2.834847888922988e+00 }, - { -2.656321861411517e-09, 2.825723083350459e+00 }, - { -2.648745838477759e-09, 2.816460324492298e+00 }, - { -2.641070091759922e-09, 2.807059542215146e+00 }, - { -2.633294910246296e-09, 2.797520672788269e+00 }, - { -2.625420586667340e-09, 2.787843658897949e+00 }, - { -2.617447417487602e-09, 2.778028449668942e+00 }, - { -2.609375702891616e-09, 2.768075000678399e+00 }, - { -2.601205746775692e-09, 2.757983273976943e+00 }, - { -2.592937856733464e-09, 2.747753238101915e+00 }, - { -2.584572344046340e-09, 2.737384868096553e+00 }, - { -2.576109523671634e-09, 2.726878145526201e+00 }, - { -2.567549714229129e-09, 2.716233058492422e+00 }, - { -2.558893237991435e-09, 2.705449601651722e+00 }, - { -2.550140420869302e-09, 2.694527776227857e+00 }, - { -2.541291592402089e-09, 2.683467590030445e+00 }, - { -2.532347085742440e-09, 2.672269057466213e+00 }, - { -2.523307237646751e-09, 2.660932199557362e+00 }, - { -2.514172388459584e-09, 2.649457043952206e+00 }, - { -2.504942882102813e-09, 2.637843624941622e+00 }, - { -2.495619066062810e-09, 2.626091983472908e+00 }, - { -2.486201291375123e-09, 2.614202167160335e+00 }, - { -2.476689912614465e-09, 2.602174230302269e+00 }, - { -2.467085287878098e-09, 2.590008233889805e+00 }, - { -2.457387778775451e-09, 2.577704245623143e+00 }, - { -2.447597750411553e-09, 2.565262339920002e+00 }, - { -2.437715571376127e-09, 2.552682597931055e+00 }, - { -2.427741613727123e-09, 2.539965107548168e+00 }, - { -2.417676252978335e-09, 2.527109963417675e+00 }, - { -2.407519868085581e-09, 2.514117266951687e+00 }, - { -2.397272841430131e-09, 2.500987126335739e+00 }, - { -2.386935558807595e-09, 2.487719656543254e+00 }, - { -2.376508409410024e-09, 2.474314979341178e+00 }, - { -2.365991785814531e-09, 2.460773223303822e+00 }, - { -2.355386083965131e-09, 2.447094523817833e+00 }, - { -2.344691703161363e-09, 2.433279023095734e+00 }, - { -2.333909046040126e-09, 2.419326870180582e+00 }, - { -2.323038518562289e-09, 2.405238220956597e+00 }, - { -2.312080529997549e-09, 2.391013238157397e+00 }, - { -2.301035492907384e-09, 2.376652091371587e+00 }, - { -2.289903823131822e-09, 2.362154957053137e+00 }, - { -2.278685939771276e-09, 2.347522018525197e+00 }, - { -2.267382265173420e-09, 2.332753465990296e+00 }, - { -2.255993224914501e-09, 2.317849496533128e+00 }, - { -2.244519247786155e-09, 2.302810314130351e+00 }, - { -2.232960765776561e-09, 2.287636129652823e+00 }, - { -2.221318214056095e-09, 2.272327160873552e+00 }, - { -2.209592030960763e-09, 2.256883632472565e+00 }, - { -2.197782657974034e-09, 2.241305776039511e+00 }, - { -2.185890539712767e-09, 2.225593830081461e+00 }, - { -2.173916123907886e-09, 2.209748040023618e+00 }, - { -2.161859861389976e-09, 2.193768658216360e+00 }, - { -2.149722206070124e-09, 2.177655943935795e+00 }, - { -2.137503614923981e-09, 2.161410163388424e+00 }, - { -2.125204547975352e-09, 2.145031589714984e+00 }, - { -2.112825468276292e-09, 2.128520502989477e+00 }, - { -2.100366841892917e-09, 2.111877190225612e+00 }, - { -2.087829137884807e-09, 2.095101945374541e+00 }, - { -2.075212828290086e-09, 2.078195069329960e+00 }, - { -2.062518388104923e-09, 2.061156869925600e+00 }, - { -2.049746295268559e-09, 2.043987661939897e+00 }, - { -2.036897030642658e-09, 2.026687767092888e+00 }, - { -2.023971077994576e-09, 2.009257514048162e+00 }, - { -2.010968923979840e-09, 1.991697238413571e+00 }, - { -1.997891058121344e-09, 1.974007282737320e+00 }, - { -1.984737972794098e-09, 1.956187996511354e+00 }, - { -1.971510163203686e-09, 1.938239736166060e+00 }, - { -1.958208127370276e-09, 1.920162865072273e+00 }, - { -1.944832366107339e-09, 1.901957753535934e+00 }, - { -1.931383383005451e-09, 1.883624778799427e+00 }, - { -1.917861684410531e-09, 1.865164325035177e+00 }, - { -1.904267779407432e-09, 1.846576783346324e+00 }, - { -1.890602179798714e-09, 1.827862551760622e+00 }, - { -1.876865400086483e-09, 1.809022035228338e+00 }, - { -1.863057957452539e-09, 1.790055645617624e+00 }, - { -1.849180371740008e-09, 1.770963801711725e+00 }, - { -1.835233165431475e-09, 1.751746929201178e+00 }, - { -1.821216863631569e-09, 1.732405460681919e+00 }, - { -1.807131994045840e-09, 1.712939835648088e+00 }, - { -1.792979086962494e-09, 1.693350500488565e+00 }, - { -1.778758675229683e-09, 1.673637908477153e+00 }, - { -1.764471294238191e-09, 1.653802519770021e+00 }, - { -1.750117481899733e-09, 1.633844801396848e+00 }, - { -1.735697778626995e-09, 1.613765227254186e+00 }, - { -1.721212727314574e-09, 1.593564278099856e+00 }, - { -1.706662873315474e-09, 1.573242441540939e+00 }, - { -1.692048764423848e-09, 1.552800212030258e+00 }, - { -1.677370950852395e-09, 1.532238090855187e+00 }, - { -1.662629985213192e-09, 1.511556586131055e+00 }, - { -1.647826422494560e-09, 1.490756212788764e+00 }, - { -1.632960820042537e-09, 1.469837492568651e+00 }, - { -1.618033737538645e-09, 1.448800954008929e+00 }, - { -1.603045736978760e-09, 1.427647132435469e+00 }, - { -1.587997382653428e-09, 1.406376569953373e+00 }, - { -1.572889241124034e-09, 1.384989815432507e+00 }, - { -1.557721881203696e-09, 1.363487424499449e+00 }, - { -1.542495873934815e-09, 1.341869959524515e+00 }, - { -1.527211792568486e-09, 1.320137989611176e+00 }, - { -1.511870212541253e-09, 1.298292090581491e+00 }, - { -1.496471711454994e-09, 1.276332844965754e+00 }, - { -1.481016869054634e-09, 1.254260841988828e+00 }, - { -1.465506267206068e-09, 1.232076677556547e+00 }, - { -1.449940489875303e-09, 1.209780954243628e+00 }, - { -1.434320123104372e-09, 1.187374281276747e+00 }, - { -1.418645754991533e-09, 1.164857274523495e+00 }, - { -1.402917975667710e-09, 1.142230556475749e+00 }, - { -1.387137377275425e-09, 1.119494756236361e+00 }, - { -1.371304553944712e-09, 1.096650509501278e+00 }, - { -1.355420101772623e-09, 1.073698458546610e+00 }, - { -1.339484618799891e-09, 1.050639252211352e+00 }, - { -1.323498704988051e-09, 1.027473545880543e+00 }, - { -1.307462962198534e-09, 1.004202001471034e+00 }, - { -1.291377994167204e-09, 9.808252874104182e-01 }, - { -1.275244406484394e-09, 9.573440786237052e-01 }, - { -1.259062806570190e-09, 9.337590565128454e-01 }, - { -1.242833803653464e-09, 9.100709089414796e-01 }, - { -1.226558008746195e-09, 8.862803302125812e-01 }, - { -1.210236034623253e-09, 8.623880210538113e-01 }, - { -1.193868495797618e-09, 8.383946885959868e-01 }, - { -1.177456008497777e-09, 8.143010463544786e-01 }, - { -1.160999190645010e-09, 7.901078142102129e-01 }, - { -1.144498661828833e-09, 7.658157183877095e-01 }, - { -1.127955043284965e-09, 7.414254914366063e-01 }, - { -1.111368957870986e-09, 7.169378722095157e-01 }, - { -1.094741030044308e-09, 6.923536058430697e-01 }, - { -1.078071885836393e-09, 6.676734437331688e-01 }, - { -1.061362152831423e-09, 6.428981435165511e-01 }, - { -1.044612460141255e-09, 6.180284690466404e-01 }, - { -1.027823438382183e-09, 5.930651903718045e-01 }, - { -1.010995719652015e-09, 5.680090837138436e-01 }, - { -9.941299375042378e-10, 5.428609314418970e-01 }, - { -9.772267269262058e-10, 5.176215220520872e-01 }, - { -9.602867243141016e-10, 4.922916501421032e-01 }, - { -9.433105674499058e-10, 4.668721163885412e-01 }, - { -9.262988954758817e-10, 4.413637275202624e-01 }, - { -9.092523488719689e-10, 4.157672962958654e-01 }, - { -8.921715694311144e-10, 3.900836414778084e-01 }, - { -8.750572002347607e-10, 3.643135878065193e-01 }, - { -8.579098856296589e-10, 3.384579659762392e-01 }, - { -8.407302712022458e-10, 3.125176126069478e-01 }, - { -8.235190037551917e-10, 2.864933702193017e-01 }, - { -8.062767312831008e-10, 2.603860872080448e-01 }, - { -7.890041029479477e-10, 2.341966178147619e-01 }, - { -7.717017690542486e-10, 2.079258220999725e-01 }, - { -7.543703810250266e-10, 1.815745659161734e-01 }, - { -7.370105913774597e-10, 1.551437208801425e-01 }, - { -7.196230536974697e-10, 1.286341643433767e-01 }, - { -7.022084226165876e-10, 1.020467793657360e-01 }, - { -6.847673537853251e-10, 7.538245468350446e-02 }, - { -6.673005038502516e-10, 4.864208468284503e-02 }, - { -6.498085304282128e-10, 2.182656936863137e-02 }, - { -6.322920920826137e-10, -5.063185663820913e-03 }, - { -6.147518482969490e-10, -3.202626926150343e-02 }, - { -5.971884594516681e-10, -5.906176474160862e-02 }, - { -5.796025867984469e-10, -8.616874992366363e-02 }, - { -5.619948924353588e-10, -1.133462971605448e-01 }, - { -5.443660392823640e-10, -1.405934733692621e-01 }, - { -5.267166910556339e-10, -1.679093400638023e-01 }, - { -5.090475122431451e-10, -1.952929533862739e-01 }, - { -4.913591680795342e-10, -2.227433641394564e-01 }, - { -4.736523245210571e-10, -2.502596178194491e-01 }, - { -4.559276482202303e-10, -2.778407546490776e-01 }, - { -4.381858065011618e-10, -3.054858096104932e-01 }, - { -4.204274673340870e-10, -3.331938124792702e-01 }, - { -4.026532993105397e-10, -3.609637878577768e-01 }, - { -3.848639716178888e-10, -3.887947552098022e-01 }, - { -3.670601540142443e-10, -4.166857288948674e-01 }, - { -3.492425168032583e-10, -4.446357182029681e-01 }, - { -3.314117308088734e-10, -4.726437273896633e-01 }, - { -3.135684673501752e-10, -5.007087557112619e-01 }, - { -2.957133982159296e-10, -5.288297974607742e-01 }, - { -2.778471956393828e-10, -5.570058420037128e-01 }, - { -2.599705322729564e-10, -5.852358738143247e-01 }, - { -2.420840811628366e-10, -6.135188725122560e-01 }, - { -2.241885157240923e-10, -6.418538128986450e-01 }, - { -2.062845097142585e-10, -6.702396649949099e-01 }, - { -1.883727372093546e-10, -6.986753940779493e-01 }, - { -1.704538725773087e-10, -7.271599607197149e-01 }, - { -1.525285904532877e-10, -7.556923208240308e-01 }, - { -1.345975657140748e-10, -7.842714256651911e-01 }, - { -1.166614734526054e-10, -8.128962219265712e-01 }, - { -9.872098895260891e-11, -8.415656517393372e-01 }, - { -8.077678766314517e-11, -8.702786527215916e-01 }, - { -6.282954517324612e-11, -8.990341580176152e-01 }, - { -4.487993718655790e-11, -9.278310963373758e-01 }, - { -2.692863949561210e-11, -9.566683919968972e-01 }, - { -8.976327956520795e-12, -9.855449649582175e-01 }, - { 8.976321536169872e-12, -1.014459730869357e+00 }, - { 2.692863307547294e-11, -1.043411601105914e+00 }, - { 4.487993076694813e-11, -1.072399482811314e+00 }, - { 6.282953875437751e-11, -1.101422278938424e+00 }, - { 8.077678124517653e-11, -1.130478888291020e+00 }, - { 9.872098253591082e-11, -1.159568205565684e+00 }, - { 1.166614670373367e-10, -1.188689121393192e+00 }, - { 1.345975593005002e-10, -1.217840522381901e+00 }, - { 1.525285840416718e-10, -1.247021291159495e+00 }, - { 1.704538661678104e-10, -1.276230306415868e+00 }, - { 1.883727308022916e-10, -1.305466442946703e+00 }, - { 2.062845033098954e-10, -1.334728571696106e+00 }, - { 2.241885093225349e-10, -1.364015559800721e+00 }, - { 2.420840747645085e-10, -1.393326270633325e+00 }, - { 2.599705258779635e-10, -1.422659563847049e+00 }, - { 2.778471892479898e-10, -1.452014295419243e+00 }, - { 2.957133918284542e-10, -1.481389317696831e+00 }, - { 3.135684609667761e-10, -1.510783479440191e+00 }, - { 3.314117244297624e-10, -1.540195625869043e+00 }, - { 3.492425104288060e-10, -1.569624598707558e+00 }, - { 3.670601476445565e-10, -1.599069236228850e+00 }, - { 3.848639652533361e-10, -1.628528373302631e+00 }, - { 4.026532929512281e-10, -1.658000841439269e+00 }, - { 4.204274609803869e-10, -1.687485468837799e+00 }, - { 4.381858001531792e-10, -1.716981080430596e+00 }, - { 4.559276418782829e-10, -1.746486497931567e+00 }, - { 4.736523181853565e-10, -1.776000539882225e+00 }, - { 4.913591617503452e-10, -1.805522021699094e+00 }, - { 5.090475059206794e-10, -1.835049755721194e+00 }, - { 5.267166847401562e-10, -1.864582551257262e+00 }, - { 5.443660329740862e-10, -1.894119214633676e+00 }, - { 5.619948861345454e-10, -1.923658549242818e+00 }, - { 5.796025805053097e-10, -1.953199355591180e+00 }, - { 5.971884531664190e-10, -1.982740431347091e+00 }, - { 6.147518420199055e-10, -2.012280571390674e+00 }, - { 6.322920858139346e-10, -2.041818567861395e+00 }, - { 6.498085241682158e-10, -2.071353210208005e+00 }, - { 6.673004975990425e-10, -2.100883285238127e+00 }, - { 6.847673475432746e-10, -2.130407577166309e+00 }, - { 7.022084163838545e-10, -2.159924867664933e+00 }, - { 7.196230474743716e-10, -2.189433935913779e+00 }, - { 7.370105851640495e-10, -2.218933558650552e+00 }, - { 7.543703748217808e-10, -2.248422510220072e+00 }, - { 7.717017628611672e-10, -2.277899562625407e+00 }, - { 7.890040967654542e-10, -2.307363485579104e+00 }, - { 8.062767251113011e-10, -2.336813046552684e+00 }, - { 8.235189975944034e-10, -2.366247010829556e+00 }, - { 8.407302650525749e-10, -2.395664141553858e+00 }, - { 8.579098794915287e-10, -2.425063199784153e+00 }, - { 8.750571941082773e-10, -2.454442944543319e+00 }, - { 8.921715633164894e-10, -2.483802132872044e+00 }, - { 9.092523427695200e-10, -2.513139519878584e+00 }, - { 9.262988893857148e-10, -2.542453858792682e+00 }, - { 9.433105613723914e-10, -2.571743901017465e+00 }, - { 9.602867182493987e-10, -2.601008396180870e+00 }, - { 9.772267208744730e-10, -2.630246092190425e+00 }, - { 9.941299314658458e-10, -2.659455735283526e+00 }, - { 1.010995713627070e-09, -2.688636070081818e+00 }, - { 1.027823432371055e-09, -2.717785839644439e+00 }, - { 1.044612454143997e-09, -2.746903785521352e+00 }, - { 1.061362146848353e-09, -2.775988647805256e+00 }, - { 1.078071879867828e-09, -2.805039165187255e+00 }, - { 1.094741024090249e-09, -2.834054075009077e+00 }, - { 1.111368951931856e-09, -2.863032113318052e+00 }, - { 1.127955037360817e-09, -2.891972014920939e+00 }, - { 1.144498655920037e-09, -2.920872513436805e+00 }, - { 1.160999184751779e-09, -2.949732341353290e+00 }, - { 1.177456002620215e-09, -2.978550230079517e+00 }, - { 1.193868489936097e-09, -3.007324910002949e+00 }, - { 1.210236028777826e-09, -3.036055110540183e+00 }, - { 1.226558002917232e-09, -3.064739560196251e+00 }, - { 1.242833797841123e-09, -3.093376986616735e+00 }, - { 1.259062800774685e-09, -3.121966116643377e+00 }, - { 1.275244400705935e-09, -3.150505676371791e+00 }, - { 1.291377988406056e-09, -3.178994391202159e+00 }, - { 1.307462956454857e-09, -3.207430985899192e+00 }, - { 1.323498699262108e-09, -3.235814184645077e+00 }, - { 1.339484613091842e-09, -3.264142711097884e+00 }, - { 1.355420096082785e-09, -3.292415288443373e+00 }, - { 1.371304548273191e-09, -3.320630639454825e+00 }, - { 1.387137371622433e-09, -3.348787486547389e+00 }, - { 1.402917970033511e-09, -3.376884551834256e+00 }, - { 1.418645749376393e-09, -3.404920557184582e+00 }, - { 1.434320117508396e-09, -3.432894224276359e+00 }, - { 1.449940484298756e-09, -3.460804274656981e+00 }, - { 1.465506261649108e-09, -3.488649429796768e+00 }, - { 1.481016863517580e-09, -3.516428411149154e+00 }, - { 1.496471705937951e-09, -3.544139940202303e+00 }, - { 1.511870207044433e-09, -3.571782738540999e+00 }, - { 1.527211787092206e-09, -3.599355527901174e+00 }, - { 1.542495868479076e-09, -3.626857030226671e+00 }, - { 1.557721875768920e-09, -3.654285967729458e+00 }, - { 1.572889235710329e-09, -3.681641062941412e+00 }, - { 1.587997377261005e-09, -3.708921038776707e+00 }, - { 1.603045731607830e-09, -3.736124618586623e+00 }, - { 1.618033732189314e-09, -3.763250526218862e+00 }, - { 1.632960814715177e-09, -3.790297486071938e+00 }, - { 1.647826417189275e-09, -3.817264223155802e+00 }, - { 1.662629979930247e-09, -3.844149463148589e+00 }, - { 1.677370945591844e-09, -3.870951932452996e+00 }, - { 1.692048759186008e-09, -3.897670358257890e+00 }, - { 1.706662868100504e-09, -3.924303468590212e+00 }, - { 1.721212722122685e-09, -3.950849992378278e+00 }, - { 1.735697773458400e-09, -3.977308659506432e+00 }, - { 1.750117476754591e-09, -4.003678200876669e+00 }, - { 1.764471289116712e-09, -4.029957348461003e+00 }, - { 1.778758670132079e-09, -4.056144835364877e+00 }, - { 1.792979081888926e-09, -4.082239395882965e+00 }, - { 1.807131988996465e-09, -4.108239765556996e+00 }, - { 1.821216858606652e-09, -4.134144681236933e+00 }, - { 1.835233160431175e-09, -4.159952881133585e+00 }, - { 1.849180366764537e-09, -4.185663104882633e+00 }, - { 1.863057952502055e-09, -4.211274093599509e+00 }, - { 1.876865395161145e-09, -4.236784589940537e+00 }, - { 1.890602174898734e-09, -4.262193338157148e+00 }, - { 1.904267774533022e-09, -4.287499084158302e+00 }, - { 1.917861679562008e-09, -4.312700575567174e+00 }, - { 1.931383378182392e-09, -4.337796561778708e+00 }, - { 1.944832361310856e-09, -4.362785794021793e+00 }, - { 1.958208122599839e-09, -4.387667025411434e+00 }, - { 1.971510158459931e-09, -4.412439011013396e+00 }, - { 1.984737968076495e-09, -4.437100507898339e+00 }, - { 1.997891053431005e-09, -4.461650275204912e+00 }, - { 2.010968919316289e-09, -4.486087074191693e+00 }, - { 2.023971073358447e-09, -4.510409668301784e+00 }, - { 2.036897026033634e-09, -4.534616823217992e+00 }, - { 2.049746290686799e-09, -4.558707306921882e+00 }, - { 2.062518383551274e-09, -4.582679889754607e+00 }, - { 2.075212823764071e-09, -4.606533344469879e+00 }, - { 2.087829133387063e-09, -4.630266446298172e+00 }, - { 2.100366837422912e-09, -4.653877973001258e+00 }, - { 2.112825463835087e-09, -4.677366704934605e+00 }, - { 2.125204543562522e-09, -4.700731425099899e+00 }, - { 2.137503610540056e-09, -4.723970919208608e+00 }, - { 2.149722201714786e-09, -4.747083975738060e+00 }, - { 2.161859857063438e-09, -4.770069385989595e+00 }, - { 2.173916119610994e-09, -4.792925944149308e+00 }, - { 2.185890535445098e-09, -4.815652447340950e+00 }, - { 2.197782653735957e-09, -4.838247695689436e+00 }, - { 2.209592026751962e-09, -4.860710492376411e+00 }, - { 2.221318209877576e-09, -4.883039643700314e+00 }, - { 2.232960761627846e-09, -4.905233959130168e+00 }, - { 2.244519243667616e-09, -4.927292251368517e+00 }, - { 2.255993220826402e-09, -4.949213336406265e+00 }, - { 2.267382261115285e-09, -4.970996033581527e+00 }, - { 2.278685935744269e-09, -4.992639165639563e+00 }, - { 2.289903819135414e-09, -5.014141558784778e+00 }, - { 2.301035488942000e-09, -5.035502042744443e+00 }, - { 2.312080526062763e-09, -5.056719450823151e+00 }, - { 2.323038514659161e-09, -5.077792619963239e+00 }, - { 2.333909042168180e-09, -5.098720390796817e+00 }, - { 2.344691699320969e-09, -5.119501607709159e+00 }, - { 2.355386080156553e-09, -5.140135118892792e+00 }, - { 2.365991782037187e-09, -5.160619776404897e+00 }, - { 2.376508405665132e-09, -5.180954436227641e+00 }, - { 2.386935555094626e-09, -5.201137958319343e+00 }, - { 2.397272837749508e-09, -5.221169206676762e+00 }, - { 2.407519864436774e-09, -5.241047049389645e+00 }, - { 2.417676249362563e-09, -5.260770358700167e+00 }, - { 2.427741610143750e-09, -5.280338011053974e+00 }, - { 2.437715567825576e-09, -5.299748887163106e+00 }, - { 2.447597746894037e-09, -5.319001872058887e+00 }, - { 2.457387775290440e-09, -5.338095855149190e+00 }, - { 2.467085284426756e-09, -5.357029730277389e+00 }, - { 2.476689909196263e-09, -5.375802395772283e+00 }, - { 2.486201287990485e-09, -5.394412754510426e+00 }, - { 2.495619062711154e-09, -5.412859713968929e+00 }, - { 2.504942878785408e-09, -5.431142186284682e+00 }, - { 2.514172385175743e-09, -5.449259088303476e+00 }, - { 2.523307234396791e-09, -5.467209341642627e+00 }, - { 2.532347082526785e-09, -5.484991872743321e+00 }, - { 2.541291589219998e-09, -5.502605612925014e+00 }, - { 2.550140417722072e-09, -5.520049498445633e+00 }, - { 2.558893234878378e-09, -5.537322470548212e+00 }, - { 2.567549711150773e-09, -5.554423475524196e+00 }, - { 2.576109520627371e-09, -5.571351464763084e+00 }, - { 2.584572341037361e-09, -5.588105394812198e+00 }, - { 2.592937853759161e-09, -5.604684227423386e+00 }, - { 2.601205743836355e-09, -5.621086929615246e+00 }, - { 2.609375699987564e-09, -5.637312473723475e+00 }, - { 2.617447414618146e-09, -5.653359837454964e+00 }, - { 2.625420583833750e-09, -5.669228003945694e+00 }, - { 2.633294907447937e-09, -5.684915961806963e+00 }, - { 2.641070088997271e-09, -5.700422705186584e+00 }, - { 2.648745835750128e-09, -5.715747233817712e+00 }, - { 2.656321858720176e-09, -5.730888553077074e+00 }, - { 2.663797872673252e-09, -5.745845674030161e+00 }, - { 2.671173596142054e-09, -5.760617613492118e+00 }, - { 2.678448751434797e-09, -5.775203394076705e+00 }, - { 2.685623064645538e-09, -5.789602044248679e+00 }, - { 2.692696265666640e-09, -5.803812598380606e+00 }, - { 2.699668088194915e-09, -5.817834096797069e+00 }, - { 2.706538269745573e-09, -5.831665585834668e+00 }, - { 2.713306551659817e-09, -5.845306117889361e+00 }, - { 2.719972679116734e-09, -5.858754751472542e+00 }, - { 2.726536401139295e-09, -5.872010551255358e+00 }, - { 2.732997470607439e-09, -5.885072588127400e+00 }, - { 2.739355644265558e-09, -5.897939939244211e+00 }, - { 2.745610682731633e-09, -5.910611688078208e+00 }, - { 2.751762350508137e-09, -5.923086924473290e+00 }, - { 2.757810415987146e-09, -5.935364744687794e+00 }, - { 2.763754651462700e-09, -5.947444251452243e+00 }, - { 2.769594833137415e-09, -5.959324554015538e+00 }, - { 2.775330741132843e-09, -5.971004768198829e+00 }, - { 2.780962159494174e-09, -5.982484016437981e+00 }, - { 2.786488876202047e-09, -5.993761427840588e+00 }, - { 2.791910683178690e-09, -6.004836138231525e+00 }, - { 2.797227376295779e-09, -6.015707290202086e+00 }, - { 2.802438755383971e-09, -6.026374033162623e+00 }, - { 2.807544624236659e-09, -6.036835523383457e+00 }, - { 2.812544790621093e-09, -6.047090924050914e+00 }, - { 2.817439066283459e-09, -6.057139405311101e+00 }, - { 2.822227266958278e-09, -6.066980144322601e+00 }, - { 2.826909212371261e-09, -6.076612325295799e+00 }, - { 2.831484726250221e-09, -6.086035139548830e+00 }, - { 2.835953636329660e-09, -6.095247785550617e+00 }, - { 2.840315774357203e-09, -6.104249468967751e+00 }, - { 2.844570976102082e-09, -6.113039402715685e+00 }, - { 2.848719081357095e-09, -6.121616806996519e+00 }, - { 2.852759933948860e-09, -6.129980909353977e+00 }, - { 2.856693381741114e-09, -6.138130944714082e+00 }, - { 2.860519276643053e-09, -6.146066155436312e+00 }, - { 2.864237474610633e-09, -6.153785791350256e+00 }, - { 2.867847835656203e-09, -6.161289109809551e+00 }, - { 2.871350223851726e-09, -6.168575375732642e+00 }, - { 2.874744507333867e-09, -6.175643861647406e+00 }, - { 2.878030558310989e-09, -6.182493847739853e+00 }, - { 2.881208253063899e-09, -6.189124621889823e+00 }, - { 2.884277471954592e-09, -6.195535479723423e+00 }, - { 2.887238099428306e-09, -6.201725724651554e+00 }, - { 2.890090024020323e-09, -6.207694667918394e+00 }, - { 2.892833138356060e-09, -6.213441628635915e+00 }, - { 2.895467339159240e-09, -6.218965933835304e+00 }, - { 2.897992527253659e-09, -6.224266918505075e+00 }, - { 2.900408607567016e-09, -6.229343925633495e+00 }, - { 2.902715489136496e-09, -6.234196306254763e+00 }, - { 2.904913085108075e-09, -6.238823419482017e+00 }, - { 2.907001312743911e-09, -6.243224632557377e+00 }, - { 2.908980093422997e-09, -6.247399320887848e+00 }, - { 2.910849352646620e-09, -6.251346868091392e+00 }, - { 2.912609020036956e-09, -6.255066666028537e+00 }, - { 2.914259029343965e-09, -6.258558114851525e+00 }, - { 2.915799318445710e-09, -6.261820623039620e+00 }, - { 2.917229829350759e-09, -6.264853607438842e+00 }, - { 2.918550508202463e-09, -6.267656493305673e+00 }, - { 2.919761305276718e-09, -6.270228714337005e+00 }, - { 2.920862174988150e-09, -6.272569712717951e+00 }, - { 2.921853075889193e-09, -6.274678939154603e+00 }, - { 2.922733970674264e-09, -6.276555852917634e+00 }, - { 2.923504826176907e-09, -6.278199921870962e+00 }, - { 2.924165613375264e-09, -6.279610622518139e+00 }, - { 2.924716307391075e-09, -6.280787440034993e+00 }, - { 2.925156887490598e-09, -6.281729868306345e+00 }, - { 2.925487337087508e-09, -6.282437409966992e+00 }, - { 2.925707643739298e-09, -6.282909576428774e+00 }, - { 2.925817799151970e-09, -6.283145887925411e+00 }, + {2.925817799165007e-09, 7.219194364267018e-09}, + {2.925707643778599e-09, 2.526699001579799e-07}, + {2.925487337153070e-09, 1.191140162167675e-06}, + {2.925156887582842e-09, 3.284585035595589e-06}, + {2.924716307509151e-09, 6.994872605695784e-06}, + {2.924165613519592e-09, 1.278374920658798e-05}, + {2.923504826347475e-09, 2.111280464718590e-05}, + {2.922733970871080e-09, 3.244343744537165e-05}, + {2.921853076112655e-09, 4.723682007436170e-05}, + {2.920862175237416e-09, 6.595386421935634e-05}, + {2.919761305552202e-09, 8.905518605213658e-05}, + {2.918550508504146e-09, 1.170010715193098e-04}, + {2.917229829679050e-09, 1.502514416517192e-04}, + {2.915799318799769e-09, 1.892658178912071e-04}, + {2.914259029724184e-09, 2.345032874456615e-04}, + {2.912609020443340e-09, 2.864224686607020e-04}, + {2.910849353079123e-09, 3.454814764261432e-04}, + {2.908980093882049e-09, 4.121378876027343e-04}, + {2.907001313228646e-09, 4.868487064877691e-04}, + {2.904913085618902e-09, 5.700703303049837e-04}, + {2.902715489673383e-09, 6.622585147355725e-04}, + {2.900408608130373e-09, 7.638683394782519e-04}, + {2.897992527842612e-09, 8.753541738578119e-04}, + {2.895467339774186e-09, 9.971696424604937e-04}, + {2.892833138996999e-09, 1.129767590823255e-03}, + {2.890090024687216e-09, 1.273600051161478e-03}, + {2.887238100121550e-09, 1.429118208142094e-03}, + {2.884277472673313e-09, 1.596772364709564e-03}, + {2.881208253808507e-09, 1.777011907950626e-03}, + {2.878030559081432e-09, 1.970285275029487e-03}, + {2.874744508130554e-09, 2.177039919152579e-03}, + {2.871350224673798e-09, 2.397722275614272e-03}, + {2.867847836504030e-09, 2.632777727878843e-03}, + {2.864237475484149e-09, 2.882650573737405e-03}, + {2.860519277542297e-09, 3.147783991507308e-03}, + {2.856693382666432e-09, 3.428620006328931e-03}, + {2.852759934899389e-09, 3.725599456482154e-03}, + {2.848719082333207e-09, 4.039161959812243e-03}, + {2.844570977103752e-09, 4.369745880190706e-03}, + {2.840315775384800e-09, 4.717788294077374e-03}, + {2.835953637382310e-09, 5.083724957128360e-03}, + {2.831484727328322e-09, 5.467990270896617e-03}, + {2.826909213474759e-09, 5.871017249604038e-03}, + {2.822227268087134e-09, 6.293237486988512e-03}, + {2.817439067438018e-09, 6.735081123237729e-03}, + {2.812544791800534e-09, 7.196976811989608e-03}, + {2.807544625441273e-09, 7.679351687456759e-03}, + {2.802438756613836e-09, 8.182631331563162e-03}, + {2.797227377551135e-09, 8.707239741274575e-03}, + {2.791910684458716e-09, 9.253599295902304e-03}, + {2.786488877507140e-09, 9.822130724578715e-03}, + {2.780962160824228e-09, 1.041325307382490e-02}, + {2.775330742487884e-09, 1.102738367513773e-02}, + {2.769594834517682e-09, 1.166493811278924e-02}, + {2.763754652867477e-09, 1.232633019159818e-02}, + {2.757810417416620e-09, 1.301197190494069e-02}, + {2.751762351962413e-09, 1.372227340270610e-02}, + {2.745610684210923e-09, 1.445764295952962e-02}, + {2.739355645769094e-09, 1.521848694296229e-02}, + {2.732997472135539e-09, 1.600520978188769e-02}, + {2.726536402691907e-09, 1.681821393496225e-02}, + {2.719972680693777e-09, 1.765789985920713e-02}, + {2.713306553261610e-09, 1.852466597868779e-02}, + {2.706538271371373e-09, 1.941890865333146e-02}, + {2.699668089844909e-09, 2.034102214787814e-02}, + {2.692696267340880e-09, 2.129139860085272e-02}, + {2.685623066344263e-09, 2.227042799383416e-02}, + {2.678448753157212e-09, 2.327849812064098e-02}, + {2.671173597888530e-09, 2.431599455681316e-02}, + {2.663797874443630e-09, 2.538330062913108e-02}, + {2.656321860514457e-09, 2.648079738524795e-02}, + {2.648745837568575e-09, 2.760886356354952e-02}, + {2.641070090839117e-09, 2.876787556300114e-02}, + {2.633294909313421e-09, 2.995820741329835e-02}, + {2.625420585722845e-09, 3.118023074495535e-02}, + {2.617447416531143e-09, 3.243431475972608e-02}, + {2.609375701923643e-09, 3.372082620101990e-02}, + {2.601205745795833e-09, 3.504012932452527e-02}, + {2.592937855741933e-09, 3.639258586895711e-02}, + {2.584572343043400e-09, 3.777855502693250e-02}, + {2.576109522656942e-09, 3.919839341605197e-02}, + {2.567549713203028e-09, 4.065245505002102e-02}, + {2.558893236953688e-09, 4.214109131001403e-02}, + {2.550140419820252e-09, 4.366465091617666e-02}, + {2.541291591341445e-09, 4.522347989919473e-02}, + {2.532347084670572e-09, 4.681792157215026e-02}, + {2.523307236563343e-09, 4.844831650239501e-02}, + {2.514172387364900e-09, 5.011500248369893e-02}, + {2.504942880997064e-09, 5.181831450849345e-02}, + {2.495619064945627e-09, 5.355858474024022e-02}, + {2.486201290246928e-09, 5.533614248606705e-02}, + {2.476689911475047e-09, 5.715131416942842e-02}, + {2.467085286727668e-09, 5.900442330315692e-02}, + {2.457387777613798e-09, 6.089579046229943e-02}, + {2.447597749239101e-09, 6.282573325755320e-02}, + {2.437715570192557e-09, 6.479456630859221e-02}, + {2.427741612532542e-09, 6.680260121764925e-02}, + {2.417676251773166e-09, 6.885014654319160e-02}, + {2.407519866869294e-09, 7.093750777401114e-02}, + {2.397272840203310e-09, 7.306498730310884e-02}, + {2.386935557569868e-09, 7.523288440214027e-02}, + {2.376508408161815e-09, 7.744149519577415e-02}, + {2.365991784555363e-09, 7.969111263635709e-02}, + {2.355386082695641e-09, 8.198202647865405e-02}, + {2.344691701881232e-09, 8.431452325495814e-02}, + {2.333909044749407e-09, 8.668888625021409e-02}, + {2.323038517261246e-09, 8.910539547731611e-02}, + {2.312080528685971e-09, 9.156432765274414e-02}, + {2.301035491585642e-09, 9.406595617227698e-02}, + {2.289903821799651e-09, 9.661055108691619e-02}, + {2.278685938428940e-09, 9.919837907903295e-02}, + {2.267382263820762e-09, 1.018297034385580e-01}, + {2.255993223551837e-09, 1.045047840397028e-01}, + {2.244519246413220e-09, 1.072238773174577e-01}, + {2.232960764393620e-09, 1.099872362446146e-01}, + {2.221318212663309e-09, 1.127951103088245e-01}, + {2.209592029557811e-09, 1.156477454898748e-01}, + {2.197782656561395e-09, 1.185453842371912e-01}, + {2.185890538290176e-09, 1.214882654476019e-01}, + {2.173916122475606e-09, 1.244766244431883e-01}, + {2.161859859947797e-09, 1.275106929493488e-01}, + {2.149722204618256e-09, 1.305906990731841e-01}, + {2.137503613462743e-09, 1.337168672820376e-01}, + {2.125204546504321e-09, 1.368894183821595e-01}, + {2.112825466795944e-09, 1.401085694976751e-01}, + {2.100366840402933e-09, 1.433745340497602e-01}, + {2.087829136385612e-09, 1.466875217359607e-01}, + {2.075212826781308e-09, 1.500477385098620e-01}, + {2.062518386587093e-09, 1.534553865607503e-01}, + {2.049746293741359e-09, 1.569106642937665e-01}, + {2.036897029106193e-09, 1.604137663100403e-01}, + {2.023971076449323e-09, 1.639648833871233e-01}, + {2.010968922425217e-09, 1.675642024598467e-01}, + {1.997891056557933e-09, 1.712119066008896e-01}, + {1.984737971221581e-09, 1.749081750021970e-01}, + {1.971510161622434e-09, 1.786531829561379e-01}, + {1.958208125780130e-09, 1.824471018371070e-01}, + {1.944832364508511e-09, 1.862900990834311e-01}, + {1.931383381397782e-09, 1.901823381790926e-01}, + {1.917861682794392e-09, 1.941239786363039e-01}, + {1.904267777782611e-09, 1.981151759777950e-01}, + {1.890602178165317e-09, 2.021560817195309e-01}, + {1.876865398444616e-09, 2.062468433536743e-01}, + {1.863057955802572e-09, 2.103876043317229e-01}, + {1.849180370081465e-09, 2.145785040479915e-01}, + {1.835233163764673e-09, 2.188196778231083e-01}, + {1.821216861956509e-09, 2.231112568880342e-01}, + {1.807131992362945e-09, 2.274533683680190e-01}, + {1.792979085271234e-09, 2.318461352671018e-01}, + {1.778758673530482e-09, 2.362896764525300e-01}, + {1.764471292530943e-09, 2.407841066397789e-01}, + {1.750117480184598e-09, 2.453295363773890e-01}, + {1.735697776904342e-09, 2.499260720324433e-01}, + {1.721212725583874e-09, 2.545738157760434e-01}, + {1.706662871577097e-09, 2.592728655691494e-01}, + {1.692048762677849e-09, 2.640233151485341e-01}, + {1.677370949099090e-09, 2.688252540131204e-01}, + {1.662629983452104e-09, 2.736787674105404e-01}, + {1.647826420726167e-09, 2.785839363237506e-01}, + {1.632960818266680e-09, 2.835408374583758e-01}, + {1.618033735755429e-09, 2.885495432295704e-01}, + {1.603045735188609e-09, 2.936101217498361e-01}, + {1.587997380855918e-09, 2.987226368167127e-01}, + {1.572889239319430e-09, 3.038871479007593e-01}, + {1.557721879392051e-09, 3.091037101339017e-01}, + {1.542495872116447e-09, 3.143723742978435e-01}, + {1.527211790743024e-09, 3.196931868130269e-01}, + {1.511870210708909e-09, 3.250661897274744e-01}, + {1.496471709615926e-09, 3.304914207062036e-01}, + {1.481016867208896e-09, 3.359689130207621e-01}, + {1.465506265353924e-09, 3.414986955389885e-01}, + {1.449940488016384e-09, 3.470807927151147e-01}, + {1.434320121238994e-09, 3.527152245800635e-01}, + {1.418645753119802e-09, 3.584020067320109e-01}, + {1.402917973789838e-09, 3.641411503272979e-01}, + {1.387137375391042e-09, 3.699326620714776e-01}, + {1.371304552054134e-09, 3.757765442106153e-01}, + {1.355420099875958e-09, 3.816727945230153e-01}, + {1.339484616897137e-09, 3.876214063110671e-01}, + {1.323498703079580e-09, 3.936223683933865e-01}, + {1.307462960283922e-09, 3.996756650972121e-01}, + {1.291377992246768e-09, 4.057812762511174e-01}, + {1.275244404558188e-09, 4.119391771778626e-01}, + {1.259062804638585e-09, 4.181493386877248e-01}, + {1.242833801715929e-09, 4.244117270719281e-01}, + {1.226558006803155e-09, 4.307263040962509e-01}, + {1.210236032674760e-09, 4.370930269951803e-01}, + {1.193868493843725e-09, 4.435118484661861e-01}, + {1.177456006538695e-09, 4.499827166641340e-01}, + {1.160999188680582e-09, 4.565055751961679e-01}, + {1.144498659859216e-09, 4.630803631168164e-01}, + {1.127955041310214e-09, 4.697070149232604e-01}, + {1.111368955891417e-09, 4.763854605510119e-01}, + {1.094741028059551e-09, 4.831156253697562e-01}, + {1.078071883846871e-09, 4.898974301794375e-01}, + {1.061362150836978e-09, 4.967307912069362e-01}, + {1.044612458142151e-09, 5.036156201023686e-01}, + {1.027823436378632e-09, 5.105518239364775e-01}, + {1.010995717643647e-09, 5.175393051975563e-01}, + {9.941299354913699e-10, 5.245779617890562e-01}, + {9.772267249089968e-10, 5.316676870274011e-01}, + {9.602867222926046e-10, 5.388083696401416e-01}, + {9.433105654240147e-10, 5.459998937639375e-01}, + {9.262988934458084e-10, 5.532421389435711e-01}, + {9.092523468378193e-10, 5.605349801305876e-01}, + {8.921715673928355e-10, 5.678782876825250e-01}, + {8.750571981926701e-10, 5.752719273622372e-01}, + {8.579098835836508e-10, 5.827157603377209e-01}, + {8.407302691522673e-10, 5.902096431821322e-01}, + {8.235190017016133e-10, 5.977534278737073e-01}, + {8.062767292259225e-10, 6.053469617967722e-01}, + {7.890041008871165e-10, 6.129900877421282e-01}, + {7.717017669898175e-10, 6.206826439083659e-01}, + {7.543703789572603e-10, 6.284244639030392e-01}, + {7.370105893063053e-10, 6.362153767444958e-01}, + {7.196230516231919e-10, 6.440552068636356e-01}, + {7.022084205389746e-10, 6.519437741060674e-01}, + {6.847673517046416e-10, 6.598808937346672e-01}, + {6.673005017664976e-10, 6.678663764322770e-01}, + {6.498085283416530e-10, 6.759000283046127e-01}, + {6.322920899929834e-10, 6.839816508836737e-01}, + {6.147518462045659e-10, 6.921110411311926e-01}, + {5.971884573565851e-10, 7.002879914425926e-01}, + {5.796025847007168e-10, 7.085122896509806e-01}, + {5.619948903351406e-10, 7.167837190315758e-01}, + {5.443660371796048e-10, 7.251020583063744e-01}, + {5.267166889504394e-10, 7.334670816491009e-01}, + {5.090475101356742e-10, 7.418785586903696e-01}, + {4.913591659698399e-10, 7.503362545232619e-01}, + {4.736523224091392e-10, 7.588399297089872e-01}, + {4.559276461062478e-10, 7.673893402829834e-01}, + {4.381858043851147e-10, 7.759842377612828e-01}, + {4.204274652161870e-10, 7.846243691469355e-01}, + {4.026532971908398e-10, 7.933094769370790e-01}, + {3.848639694963359e-10, 8.020392991300200e-01}, + {3.670601518910503e-10, 8.108135692324444e-01}, + {3.492425146784233e-10, 8.196320162675177e-01}, + {3.314117286825031e-10, 8.284943647824689e-01}, + {3.135684652223755e-10, 8.374003348569865e-01}, + {2.957133960867535e-10, 8.463496421118015e-01}, + {2.778471935089361e-10, 8.553419977173513e-01}, + {2.599705301412391e-10, 8.643771084029740e-01}, + {2.420840790301135e-10, 8.734546764660205e-01}, + {2.241885135902046e-10, 8.825743997817682e-01}, + {2.062845075795238e-10, 8.917359718130367e-01}, + {1.883727350736140e-10, 9.009390816205823e-01}, + {1.704538704408269e-10, 9.101834138731877e-01}, + {1.525285883160648e-10, 9.194686488588080e-01}, + {1.345975635762696e-10, 9.287944624950824e-01}, + {1.166614713141648e-10, 9.381605263410157e-01}, + {9.872098681369190e-11, 9.475665076080466e-01}, + {8.077678552380464e-11, 9.570120691722380e-01}, + {6.282954303364090e-11, 9.664968695860140e-01}, + {4.487993504668797e-11, 9.760205630906909e-01}, + {2.692863735553042e-11, 9.855827996289697e-01}, + {8.976325816439114e-12, 9.951832248577780e-01}, + {-8.976323676304494e-12, 1.004821480161519e+00}, + {-2.692863521550168e-11, 1.014497202665280e+00}, + {-4.487993290681805e-11, 1.024210025248670e+00}, + {-6.282954089398273e-11, 1.033959576559617e+00}, + {-8.077678338451706e-11, 1.043745481028715e+00}, + {-9.872098467477489e-11, 1.053567358883467e+00}, + {-1.166614691757772e-10, 1.063424826163223e+00}, + {-1.345975614383584e-10, 1.073317494734013e+00}, + {-1.525285861788948e-10, 1.083244972303963e+00}, + {-1.704538683042922e-10, 1.093206862438572e+00}, + {-1.883727329379793e-10, 1.103202764576806e+00}, + {-2.062845054446831e-10, 1.113232274046796e+00}, + {-2.241885114563697e-10, 1.123294982082432e+00}, + {-2.420840768973375e-10, 1.133390475839767e+00}, + {-2.599705280096278e-10, 1.143518338413855e+00}, + {-2.778471913784365e-10, 1.153678148855860e+00}, + {-2.957133939575774e-10, 1.163869482190458e+00}, + {-3.135684630945758e-10, 1.174091909433296e+00}, + {-3.314117265561857e-10, 1.184344997608959e+00}, + {-3.492425125535882e-10, 1.194628309769018e+00}, + {-3.670601497678034e-10, 1.204941405010466e+00}, + {-3.848639673748360e-10, 1.215283838494269e+00}, + {-4.026532950710339e-10, 1.225655161464298e+00}, + {-4.204274630982869e-10, 1.236054921266445e+00}, + {-4.381858022691734e-10, 1.246482661367958e+00}, + {-4.559276439922654e-10, 1.256937921377146e+00}, + {-4.736523202972214e-10, 1.267420237063216e+00}, + {-4.913591638600925e-10, 1.277929140376502e+00}, + {-5.090475080282032e-10, 1.288464159468706e+00}, + {-5.267166868452449e-10, 1.299024818713528e+00}, + {-5.443660350768455e-10, 1.309610638727845e+00}, + {-5.619948882348695e-10, 1.320221136392390e+00}, + {-5.796025826029868e-10, 1.330855824873457e+00}, + {-5.971884552615020e-10, 1.341514213644420e+00}, + {-6.147518441122357e-10, 1.352195808507556e+00}, + {-6.322920879034590e-10, 1.362900111616144e+00}, + {-6.498085262549874e-10, 1.373626621496939e+00}, + {-6.673004996827436e-10, 1.384374833072571e+00}, + {-6.847673496239581e-10, 1.395144237684605e+00}, + {-7.022084184613616e-10, 1.405934323116231e+00}, + {-7.196230495488082e-10, 1.416744573616104e+00}, + {-7.370105872352039e-10, 1.427574469921397e+00}, + {-7.543703768894941e-10, 1.438423489281758e+00}, + {-7.717017649255453e-10, 1.449291105483472e+00}, + {-7.890040988262324e-10, 1.460176788873383e+00}, + {-8.062767271686383e-10, 1.471080006383765e+00}, + {-8.235189996479819e-10, 1.482000221556656e+00}, + {-8.407302671024475e-10, 1.492936894569018e+00}, + {-8.579098815375368e-10, 1.503889482257845e+00}, + {-8.750571961505266e-10, 1.514857438145604e+00}, + {-8.921715653546624e-10, 1.525840212465756e+00}, + {-9.092523448036167e-10, 1.536837252188703e+00}, + {-9.262988914157881e-10, 1.547848001047890e+00}, + {-9.433105633981766e-10, 1.558871899565883e+00}, + {-9.602867202711075e-10, 1.569908385081254e+00}, + {-9.772267228916820e-10, 1.580956891774897e+00}, + {-9.941299334786078e-10, 1.592016850697478e+00}, + {-1.010995715635332e-09, 1.603087689796053e+00}, + {-1.027823434374870e-09, 1.614168833942028e+00}, + {-1.044612456143047e-09, 1.625259704958335e+00}, + {-1.061362148842745e-09, 1.636359721647526e+00}, + {-1.078071881857297e-09, 1.647468299819543e+00}, + {-1.094741026074900e-09, 1.658584852320419e+00}, + {-1.111368953911690e-09, 1.669708789060341e+00}, + {-1.127955039335462e-09, 1.680839517042381e+00}, + {-1.144498657889600e-09, 1.691976440391624e+00}, + {-1.160999186716154e-09, 1.703118960383971e+00}, + {-1.177456004579561e-09, 1.714266475475616e+00}, + {-1.193868491889832e-09, 1.725418381332405e+00}, + {-1.210236030726319e-09, 1.736574070859850e+00}, + {-1.226558004860220e-09, 1.747732934232508e+00}, + {-1.242833799778447e-09, 1.758894358924547e+00}, + {-1.259062802706714e-09, 1.770057729740021e+00}, + {-1.275244402631982e-09, 1.781222428842935e+00}, + {-1.291377990326492e-09, 1.792387835788660e+00}, + {-1.307462958369363e-09, 1.803553327553897e+00}, + {-1.323498701170897e-09, 1.814718278568759e+00}, + {-1.339484614994490e-09, 1.825882060747428e+00}, + {-1.355420097979292e-09, 1.837044043519582e+00}, + {-1.371304550163662e-09, 1.848203593862598e+00}, + {-1.387137373506711e-09, 1.859360076332671e+00}, + {-1.402917971911754e-09, 1.870512853097495e+00}, + {-1.418645751248018e-09, 1.881661283967967e+00}, + {-1.434320119373722e-09, 1.892804726431080e+00}, + {-1.449940486157623e-09, 1.903942535681972e+00}, + {-1.465506263501516e-09, 1.915074064656886e+00}, + {-1.481016865363264e-09, 1.926198664066737e+00}, + {-1.496471707776859e-09, 1.937315682428795e+00}, + {-1.511870208876724e-09, 1.948424466101625e+00}, + {-1.527211788917509e-09, 1.959524359317042e+00}, + {-1.542495870297867e-09, 1.970614704215133e+00}, + {-1.557721877580406e-09, 1.981694840876775e+00}, + {-1.572889237514880e-09, 1.992764107358707e+00}, + {-1.587997379058514e-09, 2.003821839726753e+00}, + {-1.603045733398246e-09, 2.014867372090665e+00}, + {-1.618033733972424e-09, 2.025900036638798e+00}, + {-1.632960816490822e-09, 2.036919163671778e+00}, + {-1.647826418957721e-09, 2.047924081638631e+00}, + {-1.662629981691070e-09, 2.058914117170269e+00}, + {-1.677370947345626e-09, 2.069888595116115e+00}, + {-1.692048760931849e-09, 2.080846838577820e+00}, + {-1.706662869838827e-09, 2.091788168946183e+00}, + {-1.721212723853279e-09, 2.102711905935372e+00}, + {-1.735697775181424e-09, 2.113617367619504e+00}, + {-1.750117478469621e-09, 2.124503870468520e+00}, + {-1.764471290823748e-09, 2.135370729383332e+00}, + {-1.778758671831281e-09, 2.146217257733207e+00}, + {-1.792979083579974e-09, 2.157042767390815e+00}, + {-1.807131990679890e-09, 2.167846568770014e+00}, + {-1.821216860281448e-09, 2.178627970860822e+00}, + {-1.835233162097977e-09, 2.189386281268046e+00}, + {-1.849180368423027e-09, 2.200120806246095e+00}, + {-1.863057954152340e-09, 2.210830850737588e+00}, + {-1.876865396802907e-09, 2.221515718409926e+00}, + {-1.890602176531920e-09, 2.232174711691990e+00}, + {-1.904267776157843e-09, 2.242807131812679e+00}, + {-1.917861681178094e-09, 2.253412278837029e+00}, + {-1.931383379790273e-09, 2.263989451705295e+00}, + {-1.944832362909578e-09, 2.274537948269257e+00}, + {-1.958208124189984e-09, 2.285057065331676e+00}, + {-1.971510160041235e-09, 2.295546098682665e+00}, + {-1.984737969649064e-09, 2.306004343138794e+00}, + {-1.997891054994522e-09, 2.316431092581699e+00}, + {-2.010968920870647e-09, 2.326825639994779e+00}, + {-2.023971074903858e-09, 2.337187277503834e+00}, + {-2.036897027569834e-09, 2.347515296413520e+00}, + {-2.049746292214264e-09, 2.357808987247877e+00}, + {-2.062518385069210e-09, 2.368067639787542e+00}, + {-2.075212825272584e-09, 2.378290543109652e+00}, + {-2.087829134886364e-09, 2.388476985626922e+00}, + {-2.100366838912949e-09, 2.398626255125417e+00}, + {-2.112825465315542e-09, 2.408737638805759e+00}, + {-2.125204545033289e-09, 2.418810423320288e+00}, + {-2.137503612001452e-09, 2.428843894814472e+00}, + {-2.149722203166389e-09, 2.438837338964302e+00}, + {-2.161859858505829e-09, 2.448790041018174e+00}, + {-2.173916121043380e-09, 2.458701285834241e+00}, + {-2.185890536867478e-09, 2.468570357921585e+00}, + {-2.197782655148702e-09, 2.478396541480230e+00}, + {-2.209592028154913e-09, 2.488179120439544e+00}, + {-2.221318211270522e-09, 2.497917378500214e+00}, + {-2.232960763010574e-09, 2.507610599172123e+00}, + {-2.244519245040444e-09, 2.517258065817044e+00}, + {-2.255993222189014e-09, 2.526859061686102e+00}, + {-2.267382262468209e-09, 2.536412869962689e+00}, + {-2.278685937086658e-09, 2.545918773800664e+00}, + {-2.289903820467374e-09, 2.555376056366064e+00}, + {-2.301035490263848e-09, 2.564784000877677e+00}, + {-2.312080527374447e-09, 2.574141890646339e+00}, + {-2.323038515960257e-09, 2.583449009117307e+00}, + {-2.333909043458635e-09, 2.592704639909166e+00}, + {-2.344691700601153e-09, 2.601908066856634e+00}, + {-2.355386081425938e-09, 2.611058574048749e+00}, + {-2.365991783296513e-09, 2.620155445872768e+00}, + {-2.376508406913500e-09, 2.629197967052127e+00}, + {-2.386935556332088e-09, 2.638185422689490e+00}, + {-2.397272838976436e-09, 2.647117098307332e+00}, + {-2.407519865653114e-09, 2.655992279887846e+00}, + {-2.417676250567891e-09, 2.664810253915885e+00}, + {-2.427741611338014e-09, 2.673570307418169e+00}, + {-2.437715569009093e-09, 2.682271728006635e+00}, + {-2.447597748066437e-09, 2.690913803917100e+00}, + {-2.457387776452357e-09, 2.699495824053297e+00}, + {-2.467085285577292e-09, 2.708017078025636e+00}, + {-2.476689910335470e-09, 2.716476856194105e+00}, + {-2.486201289118733e-09, 2.724874449709689e+00}, + {-2.495619063828443e-09, 2.733209150554255e+00}, + {-2.504942879891263e-09, 2.741480251583985e+00}, + {-2.514172386270163e-09, 2.749687046568741e+00}, + {-2.523307235480146e-09, 2.757828830235740e+00}, + {-2.532347083598520e-09, 2.765904898308531e+00}, + {-2.541291590280960e-09, 2.773914547551261e+00}, + {-2.550140418771202e-09, 2.781857075807392e+00}, + {-2.558893235915887e-09, 2.789731782043156e+00}, + {-2.567549712176927e-09, 2.797537966388929e+00}, + {-2.576109521642196e-09, 2.805274930179221e+00}, + {-2.584572342040407e-09, 2.812941975996573e+00}, + {-2.592937854750428e-09, 2.820538407710556e+00}, + {-2.601205744816134e-09, 2.828063530521908e+00}, + {-2.609375700955458e-09, 2.835516651001539e+00}, + {-2.617447415574869e-09, 2.842897077134583e+00}, + {-2.625420584778350e-09, 2.850204118359573e+00}, + {-2.633294908380520e-09, 2.857437085611509e+00}, + {-2.641070089918234e-09, 2.864595291363663e+00}, + {-2.648745836659391e-09, 2.871678049666939e+00}, + {-2.656321859617343e-09, 2.878684676194483e+00}, + {-2.663797873558322e-09, 2.885614488280000e+00}, + {-2.671173597015318e-09, 2.892466804962122e+00}, + {-2.678448752295859e-09, 2.899240947023252e+00}, + {-2.685623065495139e-09, 2.905936237033475e+00}, + {-2.692696266503800e-09, 2.912551999389617e+00}, + {-2.699668089019767e-09, 2.919087560358171e+00}, + {-2.706538270558513e-09, 2.925542248116882e+00}, + {-2.713306552460767e-09, 2.931915392794031e+00}, + {-2.719972679905295e-09, 2.938206326512581e+00}, + {-2.726536401915442e-09, 2.944414383428562e+00}, + {-2.732997471371516e-09, 2.950538899775061e+00}, + {-2.739355645017194e-09, 2.956579213900666e+00}, + {-2.745610683471516e-09, 2.962534666313284e+00}, + {-2.751762351235315e-09, 2.968404599718795e+00}, + {-2.757810416701751e-09, 2.974188359063684e+00}, + {-2.763754652165128e-09, 2.979885291576143e+00}, + {-2.769594833827588e-09, 2.985494746805227e+00}, + {-2.775330741810390e-09, 2.991016076664491e+00}, + {-2.780962160159068e-09, 2.996448635469842e+00}, + {-2.786488876854607e-09, 3.001791779983262e+00}, + {-2.791910683818570e-09, 3.007044869450794e+00}, + {-2.797227376923695e-09, 3.012207265645876e+00}, + {-2.802438755998943e-09, 3.017278332907412e+00}, + {-2.807544624838820e-09, 3.022257438182037e+00}, + {-2.812544791210840e-09, 3.027143951064684e+00}, + {-2.817439066860792e-09, 3.031937243837070e+00}, + {-2.822227267522746e-09, 3.036636691510884e+00}, + {-2.826909212922864e-09, 3.041241671864994e+00}, + {-2.831484726789317e-09, 3.045751565488710e+00}, + {-2.835953636855826e-09, 3.050165755818853e+00}, + {-2.840315774871260e-09, 3.054483629182857e+00}, + {-2.844570976602957e-09, 3.058704574835744e+00}, + {-2.848719081844986e-09, 3.062827985002047e+00}, + {-2.852759934424164e-09, 3.066853254915581e+00}, + {-2.856693382203833e-09, 3.070779782857041e+00}, + {-2.860519277092708e-09, 3.074606970196721e+00}, + {-2.864237475047239e-09, 3.078334221430809e+00}, + {-2.867847836080156e-09, 3.081960944223928e+00}, + {-2.871350224262603e-09, 3.085486549445314e+00}, + {-2.874744507732462e-09, 3.088910451211251e+00}, + {-2.878030558696270e-09, 3.092232066921130e+00}, + {-2.881208253436038e-09, 3.095450817298478e+00}, + {-2.884277472313999e-09, 3.098566126429974e+00}, + {-2.887238099774968e-09, 3.101577421802070e+00}, + {-2.890090024353816e-09, 3.104484134342861e+00}, + {-2.892833138676371e-09, 3.107285698457308e+00}, + {-2.895467339466766e-09, 3.109981552069083e+00}, + {-2.897992527547963e-09, 3.112571136655481e+00}, + {-2.900408607848946e-09, 3.115053897289195e+00}, + {-2.902715489404992e-09, 3.117429282673042e+00}, + {-2.904913085363323e-09, 3.119696745180238e+00}, + {-2.907001312986328e-09, 3.121855740892224e+00}, + {-2.908980093652563e-09, 3.123905729634218e+00}, + {-2.910849352862924e-09, 3.125846175016163e+00}, + {-2.912609020239985e-09, 3.127676544466606e+00}, + {-2.914259029534118e-09, 3.129396309273659e+00}, + {-2.915799318622574e-09, 3.131004944618667e+00}, + {-2.917229829515169e-09, 3.132501929616775e+00}, + {-2.918550508353347e-09, 3.133886747350606e+00}, + {-2.919761305414294e-09, 3.135158884909254e+00}, + {-2.920862175112829e-09, 3.136317833424958e+00}, + {-2.921853076000972e-09, 3.137363088107359e+00}, + {-2.922733970772719e-09, 3.138294148283254e+00}, + {-2.923504826262027e-09, 3.139110517429204e+00}, + {-2.924165613447473e-09, 3.139811703211207e+00}, + {-2.924716307449950e-09, 3.140397217517018e+00}, + {-2.925156887536978e-09, 3.140866576495489e+00}, + {-2.925487337120335e-09, 3.141219300588825e+00}, + {-2.925707643758784e-09, 3.141454914570261e+00}, + {-2.925817799158535e-09, 3.141572947579352e+00}, + {-2.925817799171455e-09, 3.141572933154836e+00}, + {-2.925707643798390e-09, 3.141454409272987e+00}, + {-2.925487337185779e-09, 3.141216918378770e+00}, + {-2.925156887628892e-09, 3.140860007424112e+00}, + {-2.924716307568119e-09, 3.140383227898687e+00}, + {-2.924165613591896e-09, 3.139786135867868e+00}, + {-2.923504826432903e-09, 3.139068292003385e+00}, + {-2.922733970969412e-09, 3.138229261619561e+00}, + {-2.921853076224321e-09, 3.137268614707029e+00}, + {-2.920862175361976e-09, 3.136185925964038e+00}, + {-2.919761305690083e-09, 3.134980774833275e+00}, + {-2.918550508654911e-09, 3.133652745531368e+00}, + {-2.917229829843137e-09, 3.132201427085629e+00}, + {-2.915799318976726e-09, 3.130626413363146e+00}, + {-2.914259029914435e-09, 3.128927303107136e+00}, + {-2.912609020646661e-09, 3.127103699965947e+00}, + {-2.910849353295315e-09, 3.125155212527586e+00}, + {-2.908980094111509e-09, 3.123081454351802e+00}, + {-2.907001313470937e-09, 3.120882043999591e+00}, + {-2.904913085874448e-09, 3.118556605068443e+00}, + {-2.902715489941767e-09, 3.116104766219928e+00}, + {-2.900408608411958e-09, 3.113526161214776e+00}, + {-2.897992528137022e-09, 3.110820428940251e+00}, + {-2.895467340081818e-09, 3.107987213444579e+00}, + {-2.892833139317615e-09, 3.105026163964191e+00}, + {-2.890090025020589e-09, 3.101936934956479e+00}, + {-2.887238100468092e-09, 3.098719186130021e+00}, + {-2.884277473032614e-09, 3.095372582472161e+00}, + {-2.881208254180937e-09, 3.091896794282404e+00}, + {-2.878030559466594e-09, 3.088291497198199e+00}, + {-2.874744508528832e-09, 3.084556372228054e+00}, + {-2.871350225084755e-09, 3.080691105776848e+00}, + {-2.867847836928063e-09, 3.076695389678615e+00}, + {-2.864237475921086e-09, 3.072568921221621e+00}, + {-2.860519277991847e-09, 3.068311403179147e+00}, + {-2.856693383129018e-09, 3.063922543837792e+00}, + {-2.852759935374575e-09, 3.059402057023109e+00}, + {-2.848719082821403e-09, 3.054749662130841e+00}, + {-2.844570977604520e-09, 3.049965084150782e+00}, + {-2.840315775898525e-09, 3.045048053697736e+00}, + {-2.835953637908582e-09, 3.039998307034967e+00}, + {-2.831484727867511e-09, 3.034815586104635e+00}, + {-2.826909214026628e-09, 3.029499638550941e+00}, + {-2.822227268651470e-09, 3.024050217748861e+00}, + {-2.817439068015245e-09, 3.018467082830179e+00}, + {-2.812544792390175e-09, 3.012749998707001e+00}, + {-2.807544626043751e-09, 3.006898736100911e+00}, + {-2.802438757228650e-09, 3.000913071564665e+00}, + {-2.797227378178760e-09, 2.994792787510961e+00}, + {-2.791910685098702e-09, 2.988537672233504e+00}, + {-2.786488878159805e-09, 2.982147519935565e+00}, + {-2.780962161489413e-09, 2.975622130750641e+00}, + {-2.775330743165298e-09, 2.968961310769028e+00}, + {-2.769594835207775e-09, 2.962164872061613e+00}, + {-2.763754653569747e-09, 2.955232632701135e+00}, + {-2.757810418131543e-09, 2.948164416789036e+00}, + {-2.751762352689432e-09, 2.940960054474719e+00}, + {-2.745610684950541e-09, 2.933619381982341e+00}, + {-2.739355646520809e-09, 2.926142241629213e+00}, + {-2.732997472899722e-09, 2.918528481852205e+00}, + {-2.726536403468318e-09, 2.910777957226018e+00}, + {-2.719972681482232e-09, 2.902890528487386e+00}, + {-2.713306554062453e-09, 2.894866062556452e+00}, + {-2.706538272184154e-09, 2.886704432555728e+00}, + {-2.699668090670078e-09, 2.878405517834426e+00}, + {-2.692696268177908e-09, 2.869969203985464e+00}, + {-2.685623067193599e-09, 2.861395382869544e+00}, + {-2.678448754018380e-09, 2.852683952631486e+00}, + {-2.671173598761847e-09, 2.843834817723832e+00}, + {-2.663797875328991e-09, 2.834847888922988e+00}, + {-2.656321861411517e-09, 2.825723083350459e+00}, + {-2.648745838477759e-09, 2.816460324492298e+00}, + {-2.641070091759922e-09, 2.807059542215146e+00}, + {-2.633294910246296e-09, 2.797520672788269e+00}, + {-2.625420586667340e-09, 2.787843658897949e+00}, + {-2.617447417487602e-09, 2.778028449668942e+00}, + {-2.609375702891616e-09, 2.768075000678399e+00}, + {-2.601205746775692e-09, 2.757983273976943e+00}, + {-2.592937856733464e-09, 2.747753238101915e+00}, + {-2.584572344046340e-09, 2.737384868096553e+00}, + {-2.576109523671634e-09, 2.726878145526201e+00}, + {-2.567549714229129e-09, 2.716233058492422e+00}, + {-2.558893237991435e-09, 2.705449601651722e+00}, + {-2.550140420869302e-09, 2.694527776227857e+00}, + {-2.541291592402089e-09, 2.683467590030445e+00}, + {-2.532347085742440e-09, 2.672269057466213e+00}, + {-2.523307237646751e-09, 2.660932199557362e+00}, + {-2.514172388459584e-09, 2.649457043952206e+00}, + {-2.504942882102813e-09, 2.637843624941622e+00}, + {-2.495619066062810e-09, 2.626091983472908e+00}, + {-2.486201291375123e-09, 2.614202167160335e+00}, + {-2.476689912614465e-09, 2.602174230302269e+00}, + {-2.467085287878098e-09, 2.590008233889805e+00}, + {-2.457387778775451e-09, 2.577704245623143e+00}, + {-2.447597750411553e-09, 2.565262339920002e+00}, + {-2.437715571376127e-09, 2.552682597931055e+00}, + {-2.427741613727123e-09, 2.539965107548168e+00}, + {-2.417676252978335e-09, 2.527109963417675e+00}, + {-2.407519868085581e-09, 2.514117266951687e+00}, + {-2.397272841430131e-09, 2.500987126335739e+00}, + {-2.386935558807595e-09, 2.487719656543254e+00}, + {-2.376508409410024e-09, 2.474314979341178e+00}, + {-2.365991785814531e-09, 2.460773223303822e+00}, + {-2.355386083965131e-09, 2.447094523817833e+00}, + {-2.344691703161363e-09, 2.433279023095734e+00}, + {-2.333909046040126e-09, 2.419326870180582e+00}, + {-2.323038518562289e-09, 2.405238220956597e+00}, + {-2.312080529997549e-09, 2.391013238157397e+00}, + {-2.301035492907384e-09, 2.376652091371587e+00}, + {-2.289903823131822e-09, 2.362154957053137e+00}, + {-2.278685939771276e-09, 2.347522018525197e+00}, + {-2.267382265173420e-09, 2.332753465990296e+00}, + {-2.255993224914501e-09, 2.317849496533128e+00}, + {-2.244519247786155e-09, 2.302810314130351e+00}, + {-2.232960765776561e-09, 2.287636129652823e+00}, + {-2.221318214056095e-09, 2.272327160873552e+00}, + {-2.209592030960763e-09, 2.256883632472565e+00}, + {-2.197782657974034e-09, 2.241305776039511e+00}, + {-2.185890539712767e-09, 2.225593830081461e+00}, + {-2.173916123907886e-09, 2.209748040023618e+00}, + {-2.161859861389976e-09, 2.193768658216360e+00}, + {-2.149722206070124e-09, 2.177655943935795e+00}, + {-2.137503614923981e-09, 2.161410163388424e+00}, + {-2.125204547975352e-09, 2.145031589714984e+00}, + {-2.112825468276292e-09, 2.128520502989477e+00}, + {-2.100366841892917e-09, 2.111877190225612e+00}, + {-2.087829137884807e-09, 2.095101945374541e+00}, + {-2.075212828290086e-09, 2.078195069329960e+00}, + {-2.062518388104923e-09, 2.061156869925600e+00}, + {-2.049746295268559e-09, 2.043987661939897e+00}, + {-2.036897030642658e-09, 2.026687767092888e+00}, + {-2.023971077994576e-09, 2.009257514048162e+00}, + {-2.010968923979840e-09, 1.991697238413571e+00}, + {-1.997891058121344e-09, 1.974007282737320e+00}, + {-1.984737972794098e-09, 1.956187996511354e+00}, + {-1.971510163203686e-09, 1.938239736166060e+00}, + {-1.958208127370276e-09, 1.920162865072273e+00}, + {-1.944832366107339e-09, 1.901957753535934e+00}, + {-1.931383383005451e-09, 1.883624778799427e+00}, + {-1.917861684410531e-09, 1.865164325035177e+00}, + {-1.904267779407432e-09, 1.846576783346324e+00}, + {-1.890602179798714e-09, 1.827862551760622e+00}, + {-1.876865400086483e-09, 1.809022035228338e+00}, + {-1.863057957452539e-09, 1.790055645617624e+00}, + {-1.849180371740008e-09, 1.770963801711725e+00}, + {-1.835233165431475e-09, 1.751746929201178e+00}, + {-1.821216863631569e-09, 1.732405460681919e+00}, + {-1.807131994045840e-09, 1.712939835648088e+00}, + {-1.792979086962494e-09, 1.693350500488565e+00}, + {-1.778758675229683e-09, 1.673637908477153e+00}, + {-1.764471294238191e-09, 1.653802519770021e+00}, + {-1.750117481899733e-09, 1.633844801396848e+00}, + {-1.735697778626995e-09, 1.613765227254186e+00}, + {-1.721212727314574e-09, 1.593564278099856e+00}, + {-1.706662873315474e-09, 1.573242441540939e+00}, + {-1.692048764423848e-09, 1.552800212030258e+00}, + {-1.677370950852395e-09, 1.532238090855187e+00}, + {-1.662629985213192e-09, 1.511556586131055e+00}, + {-1.647826422494560e-09, 1.490756212788764e+00}, + {-1.632960820042537e-09, 1.469837492568651e+00}, + {-1.618033737538645e-09, 1.448800954008929e+00}, + {-1.603045736978760e-09, 1.427647132435469e+00}, + {-1.587997382653428e-09, 1.406376569953373e+00}, + {-1.572889241124034e-09, 1.384989815432507e+00}, + {-1.557721881203696e-09, 1.363487424499449e+00}, + {-1.542495873934815e-09, 1.341869959524515e+00}, + {-1.527211792568486e-09, 1.320137989611176e+00}, + {-1.511870212541253e-09, 1.298292090581491e+00}, + {-1.496471711454994e-09, 1.276332844965754e+00}, + {-1.481016869054634e-09, 1.254260841988828e+00}, + {-1.465506267206068e-09, 1.232076677556547e+00}, + {-1.449940489875303e-09, 1.209780954243628e+00}, + {-1.434320123104372e-09, 1.187374281276747e+00}, + {-1.418645754991533e-09, 1.164857274523495e+00}, + {-1.402917975667710e-09, 1.142230556475749e+00}, + {-1.387137377275425e-09, 1.119494756236361e+00}, + {-1.371304553944712e-09, 1.096650509501278e+00}, + {-1.355420101772623e-09, 1.073698458546610e+00}, + {-1.339484618799891e-09, 1.050639252211352e+00}, + {-1.323498704988051e-09, 1.027473545880543e+00}, + {-1.307462962198534e-09, 1.004202001471034e+00}, + {-1.291377994167204e-09, 9.808252874104182e-01}, + {-1.275244406484394e-09, 9.573440786237052e-01}, + {-1.259062806570190e-09, 9.337590565128454e-01}, + {-1.242833803653464e-09, 9.100709089414796e-01}, + {-1.226558008746195e-09, 8.862803302125812e-01}, + {-1.210236034623253e-09, 8.623880210538113e-01}, + {-1.193868495797618e-09, 8.383946885959868e-01}, + {-1.177456008497777e-09, 8.143010463544786e-01}, + {-1.160999190645010e-09, 7.901078142102129e-01}, + {-1.144498661828833e-09, 7.658157183877095e-01}, + {-1.127955043284965e-09, 7.414254914366063e-01}, + {-1.111368957870986e-09, 7.169378722095157e-01}, + {-1.094741030044308e-09, 6.923536058430697e-01}, + {-1.078071885836393e-09, 6.676734437331688e-01}, + {-1.061362152831423e-09, 6.428981435165511e-01}, + {-1.044612460141255e-09, 6.180284690466404e-01}, + {-1.027823438382183e-09, 5.930651903718045e-01}, + {-1.010995719652015e-09, 5.680090837138436e-01}, + {-9.941299375042378e-10, 5.428609314418970e-01}, + {-9.772267269262058e-10, 5.176215220520872e-01}, + {-9.602867243141016e-10, 4.922916501421032e-01}, + {-9.433105674499058e-10, 4.668721163885412e-01}, + {-9.262988954758817e-10, 4.413637275202624e-01}, + {-9.092523488719689e-10, 4.157672962958654e-01}, + {-8.921715694311144e-10, 3.900836414778084e-01}, + {-8.750572002347607e-10, 3.643135878065193e-01}, + {-8.579098856296589e-10, 3.384579659762392e-01}, + {-8.407302712022458e-10, 3.125176126069478e-01}, + {-8.235190037551917e-10, 2.864933702193017e-01}, + {-8.062767312831008e-10, 2.603860872080448e-01}, + {-7.890041029479477e-10, 2.341966178147619e-01}, + {-7.717017690542486e-10, 2.079258220999725e-01}, + {-7.543703810250266e-10, 1.815745659161734e-01}, + {-7.370105913774597e-10, 1.551437208801425e-01}, + {-7.196230536974697e-10, 1.286341643433767e-01}, + {-7.022084226165876e-10, 1.020467793657360e-01}, + {-6.847673537853251e-10, 7.538245468350446e-02}, + {-6.673005038502516e-10, 4.864208468284503e-02}, + {-6.498085304282128e-10, 2.182656936863137e-02}, + {-6.322920920826137e-10, -5.063185663820913e-03}, + {-6.147518482969490e-10, -3.202626926150343e-02}, + {-5.971884594516681e-10, -5.906176474160862e-02}, + {-5.796025867984469e-10, -8.616874992366363e-02}, + {-5.619948924353588e-10, -1.133462971605448e-01}, + {-5.443660392823640e-10, -1.405934733692621e-01}, + {-5.267166910556339e-10, -1.679093400638023e-01}, + {-5.090475122431451e-10, -1.952929533862739e-01}, + {-4.913591680795342e-10, -2.227433641394564e-01}, + {-4.736523245210571e-10, -2.502596178194491e-01}, + {-4.559276482202303e-10, -2.778407546490776e-01}, + {-4.381858065011618e-10, -3.054858096104932e-01}, + {-4.204274673340870e-10, -3.331938124792702e-01}, + {-4.026532993105397e-10, -3.609637878577768e-01}, + {-3.848639716178888e-10, -3.887947552098022e-01}, + {-3.670601540142443e-10, -4.166857288948674e-01}, + {-3.492425168032583e-10, -4.446357182029681e-01}, + {-3.314117308088734e-10, -4.726437273896633e-01}, + {-3.135684673501752e-10, -5.007087557112619e-01}, + {-2.957133982159296e-10, -5.288297974607742e-01}, + {-2.778471956393828e-10, -5.570058420037128e-01}, + {-2.599705322729564e-10, -5.852358738143247e-01}, + {-2.420840811628366e-10, -6.135188725122560e-01}, + {-2.241885157240923e-10, -6.418538128986450e-01}, + {-2.062845097142585e-10, -6.702396649949099e-01}, + {-1.883727372093546e-10, -6.986753940779493e-01}, + {-1.704538725773087e-10, -7.271599607197149e-01}, + {-1.525285904532877e-10, -7.556923208240308e-01}, + {-1.345975657140748e-10, -7.842714256651911e-01}, + {-1.166614734526054e-10, -8.128962219265712e-01}, + {-9.872098895260891e-11, -8.415656517393372e-01}, + {-8.077678766314517e-11, -8.702786527215916e-01}, + {-6.282954517324612e-11, -8.990341580176152e-01}, + {-4.487993718655790e-11, -9.278310963373758e-01}, + {-2.692863949561210e-11, -9.566683919968972e-01}, + {-8.976327956520795e-12, -9.855449649582175e-01}, + {8.976321536169872e-12, -1.014459730869357e+00}, + {2.692863307547294e-11, -1.043411601105914e+00}, + {4.487993076694813e-11, -1.072399482811314e+00}, + {6.282953875437751e-11, -1.101422278938424e+00}, + {8.077678124517653e-11, -1.130478888291020e+00}, + {9.872098253591082e-11, -1.159568205565684e+00}, + {1.166614670373367e-10, -1.188689121393192e+00}, + {1.345975593005002e-10, -1.217840522381901e+00}, + {1.525285840416718e-10, -1.247021291159495e+00}, + {1.704538661678104e-10, -1.276230306415868e+00}, + {1.883727308022916e-10, -1.305466442946703e+00}, + {2.062845033098954e-10, -1.334728571696106e+00}, + {2.241885093225349e-10, -1.364015559800721e+00}, + {2.420840747645085e-10, -1.393326270633325e+00}, + {2.599705258779635e-10, -1.422659563847049e+00}, + {2.778471892479898e-10, -1.452014295419243e+00}, + {2.957133918284542e-10, -1.481389317696831e+00}, + {3.135684609667761e-10, -1.510783479440191e+00}, + {3.314117244297624e-10, -1.540195625869043e+00}, + {3.492425104288060e-10, -1.569624598707558e+00}, + {3.670601476445565e-10, -1.599069236228850e+00}, + {3.848639652533361e-10, -1.628528373302631e+00}, + {4.026532929512281e-10, -1.658000841439269e+00}, + {4.204274609803869e-10, -1.687485468837799e+00}, + {4.381858001531792e-10, -1.716981080430596e+00}, + {4.559276418782829e-10, -1.746486497931567e+00}, + {4.736523181853565e-10, -1.776000539882225e+00}, + {4.913591617503452e-10, -1.805522021699094e+00}, + {5.090475059206794e-10, -1.835049755721194e+00}, + {5.267166847401562e-10, -1.864582551257262e+00}, + {5.443660329740862e-10, -1.894119214633676e+00}, + {5.619948861345454e-10, -1.923658549242818e+00}, + {5.796025805053097e-10, -1.953199355591180e+00}, + {5.971884531664190e-10, -1.982740431347091e+00}, + {6.147518420199055e-10, -2.012280571390674e+00}, + {6.322920858139346e-10, -2.041818567861395e+00}, + {6.498085241682158e-10, -2.071353210208005e+00}, + {6.673004975990425e-10, -2.100883285238127e+00}, + {6.847673475432746e-10, -2.130407577166309e+00}, + {7.022084163838545e-10, -2.159924867664933e+00}, + {7.196230474743716e-10, -2.189433935913779e+00}, + {7.370105851640495e-10, -2.218933558650552e+00}, + {7.543703748217808e-10, -2.248422510220072e+00}, + {7.717017628611672e-10, -2.277899562625407e+00}, + {7.890040967654542e-10, -2.307363485579104e+00}, + {8.062767251113011e-10, -2.336813046552684e+00}, + {8.235189975944034e-10, -2.366247010829556e+00}, + {8.407302650525749e-10, -2.395664141553858e+00}, + {8.579098794915287e-10, -2.425063199784153e+00}, + {8.750571941082773e-10, -2.454442944543319e+00}, + {8.921715633164894e-10, -2.483802132872044e+00}, + {9.092523427695200e-10, -2.513139519878584e+00}, + {9.262988893857148e-10, -2.542453858792682e+00}, + {9.433105613723914e-10, -2.571743901017465e+00}, + {9.602867182493987e-10, -2.601008396180870e+00}, + {9.772267208744730e-10, -2.630246092190425e+00}, + {9.941299314658458e-10, -2.659455735283526e+00}, + {1.010995713627070e-09, -2.688636070081818e+00}, + {1.027823432371055e-09, -2.717785839644439e+00}, + {1.044612454143997e-09, -2.746903785521352e+00}, + {1.061362146848353e-09, -2.775988647805256e+00}, + {1.078071879867828e-09, -2.805039165187255e+00}, + {1.094741024090249e-09, -2.834054075009077e+00}, + {1.111368951931856e-09, -2.863032113318052e+00}, + {1.127955037360817e-09, -2.891972014920939e+00}, + {1.144498655920037e-09, -2.920872513436805e+00}, + {1.160999184751779e-09, -2.949732341353290e+00}, + {1.177456002620215e-09, -2.978550230079517e+00}, + {1.193868489936097e-09, -3.007324910002949e+00}, + {1.210236028777826e-09, -3.036055110540183e+00}, + {1.226558002917232e-09, -3.064739560196251e+00}, + {1.242833797841123e-09, -3.093376986616735e+00}, + {1.259062800774685e-09, -3.121966116643377e+00}, + {1.275244400705935e-09, -3.150505676371791e+00}, + {1.291377988406056e-09, -3.178994391202159e+00}, + {1.307462956454857e-09, -3.207430985899192e+00}, + {1.323498699262108e-09, -3.235814184645077e+00}, + {1.339484613091842e-09, -3.264142711097884e+00}, + {1.355420096082785e-09, -3.292415288443373e+00}, + {1.371304548273191e-09, -3.320630639454825e+00}, + {1.387137371622433e-09, -3.348787486547389e+00}, + {1.402917970033511e-09, -3.376884551834256e+00}, + {1.418645749376393e-09, -3.404920557184582e+00}, + {1.434320117508396e-09, -3.432894224276359e+00}, + {1.449940484298756e-09, -3.460804274656981e+00}, + {1.465506261649108e-09, -3.488649429796768e+00}, + {1.481016863517580e-09, -3.516428411149154e+00}, + {1.496471705937951e-09, -3.544139940202303e+00}, + {1.511870207044433e-09, -3.571782738540999e+00}, + {1.527211787092206e-09, -3.599355527901174e+00}, + {1.542495868479076e-09, -3.626857030226671e+00}, + {1.557721875768920e-09, -3.654285967729458e+00}, + {1.572889235710329e-09, -3.681641062941412e+00}, + {1.587997377261005e-09, -3.708921038776707e+00}, + {1.603045731607830e-09, -3.736124618586623e+00}, + {1.618033732189314e-09, -3.763250526218862e+00}, + {1.632960814715177e-09, -3.790297486071938e+00}, + {1.647826417189275e-09, -3.817264223155802e+00}, + {1.662629979930247e-09, -3.844149463148589e+00}, + {1.677370945591844e-09, -3.870951932452996e+00}, + {1.692048759186008e-09, -3.897670358257890e+00}, + {1.706662868100504e-09, -3.924303468590212e+00}, + {1.721212722122685e-09, -3.950849992378278e+00}, + {1.735697773458400e-09, -3.977308659506432e+00}, + {1.750117476754591e-09, -4.003678200876669e+00}, + {1.764471289116712e-09, -4.029957348461003e+00}, + {1.778758670132079e-09, -4.056144835364877e+00}, + {1.792979081888926e-09, -4.082239395882965e+00}, + {1.807131988996465e-09, -4.108239765556996e+00}, + {1.821216858606652e-09, -4.134144681236933e+00}, + {1.835233160431175e-09, -4.159952881133585e+00}, + {1.849180366764537e-09, -4.185663104882633e+00}, + {1.863057952502055e-09, -4.211274093599509e+00}, + {1.876865395161145e-09, -4.236784589940537e+00}, + {1.890602174898734e-09, -4.262193338157148e+00}, + {1.904267774533022e-09, -4.287499084158302e+00}, + {1.917861679562008e-09, -4.312700575567174e+00}, + {1.931383378182392e-09, -4.337796561778708e+00}, + {1.944832361310856e-09, -4.362785794021793e+00}, + {1.958208122599839e-09, -4.387667025411434e+00}, + {1.971510158459931e-09, -4.412439011013396e+00}, + {1.984737968076495e-09, -4.437100507898339e+00}, + {1.997891053431005e-09, -4.461650275204912e+00}, + {2.010968919316289e-09, -4.486087074191693e+00}, + {2.023971073358447e-09, -4.510409668301784e+00}, + {2.036897026033634e-09, -4.534616823217992e+00}, + {2.049746290686799e-09, -4.558707306921882e+00}, + {2.062518383551274e-09, -4.582679889754607e+00}, + {2.075212823764071e-09, -4.606533344469879e+00}, + {2.087829133387063e-09, -4.630266446298172e+00}, + {2.100366837422912e-09, -4.653877973001258e+00}, + {2.112825463835087e-09, -4.677366704934605e+00}, + {2.125204543562522e-09, -4.700731425099899e+00}, + {2.137503610540056e-09, -4.723970919208608e+00}, + {2.149722201714786e-09, -4.747083975738060e+00}, + {2.161859857063438e-09, -4.770069385989595e+00}, + {2.173916119610994e-09, -4.792925944149308e+00}, + {2.185890535445098e-09, -4.815652447340950e+00}, + {2.197782653735957e-09, -4.838247695689436e+00}, + {2.209592026751962e-09, -4.860710492376411e+00}, + {2.221318209877576e-09, -4.883039643700314e+00}, + {2.232960761627846e-09, -4.905233959130168e+00}, + {2.244519243667616e-09, -4.927292251368517e+00}, + {2.255993220826402e-09, -4.949213336406265e+00}, + {2.267382261115285e-09, -4.970996033581527e+00}, + {2.278685935744269e-09, -4.992639165639563e+00}, + {2.289903819135414e-09, -5.014141558784778e+00}, + {2.301035488942000e-09, -5.035502042744443e+00}, + {2.312080526062763e-09, -5.056719450823151e+00}, + {2.323038514659161e-09, -5.077792619963239e+00}, + {2.333909042168180e-09, -5.098720390796817e+00}, + {2.344691699320969e-09, -5.119501607709159e+00}, + {2.355386080156553e-09, -5.140135118892792e+00}, + {2.365991782037187e-09, -5.160619776404897e+00}, + {2.376508405665132e-09, -5.180954436227641e+00}, + {2.386935555094626e-09, -5.201137958319343e+00}, + {2.397272837749508e-09, -5.221169206676762e+00}, + {2.407519864436774e-09, -5.241047049389645e+00}, + {2.417676249362563e-09, -5.260770358700167e+00}, + {2.427741610143750e-09, -5.280338011053974e+00}, + {2.437715567825576e-09, -5.299748887163106e+00}, + {2.447597746894037e-09, -5.319001872058887e+00}, + {2.457387775290440e-09, -5.338095855149190e+00}, + {2.467085284426756e-09, -5.357029730277389e+00}, + {2.476689909196263e-09, -5.375802395772283e+00}, + {2.486201287990485e-09, -5.394412754510426e+00}, + {2.495619062711154e-09, -5.412859713968929e+00}, + {2.504942878785408e-09, -5.431142186284682e+00}, + {2.514172385175743e-09, -5.449259088303476e+00}, + {2.523307234396791e-09, -5.467209341642627e+00}, + {2.532347082526785e-09, -5.484991872743321e+00}, + {2.541291589219998e-09, -5.502605612925014e+00}, + {2.550140417722072e-09, -5.520049498445633e+00}, + {2.558893234878378e-09, -5.537322470548212e+00}, + {2.567549711150773e-09, -5.554423475524196e+00}, + {2.576109520627371e-09, -5.571351464763084e+00}, + {2.584572341037361e-09, -5.588105394812198e+00}, + {2.592937853759161e-09, -5.604684227423386e+00}, + {2.601205743836355e-09, -5.621086929615246e+00}, + {2.609375699987564e-09, -5.637312473723475e+00}, + {2.617447414618146e-09, -5.653359837454964e+00}, + {2.625420583833750e-09, -5.669228003945694e+00}, + {2.633294907447937e-09, -5.684915961806963e+00}, + {2.641070088997271e-09, -5.700422705186584e+00}, + {2.648745835750128e-09, -5.715747233817712e+00}, + {2.656321858720176e-09, -5.730888553077074e+00}, + {2.663797872673252e-09, -5.745845674030161e+00}, + {2.671173596142054e-09, -5.760617613492118e+00}, + {2.678448751434797e-09, -5.775203394076705e+00}, + {2.685623064645538e-09, -5.789602044248679e+00}, + {2.692696265666640e-09, -5.803812598380606e+00}, + {2.699668088194915e-09, -5.817834096797069e+00}, + {2.706538269745573e-09, -5.831665585834668e+00}, + {2.713306551659817e-09, -5.845306117889361e+00}, + {2.719972679116734e-09, -5.858754751472542e+00}, + {2.726536401139295e-09, -5.872010551255358e+00}, + {2.732997470607439e-09, -5.885072588127400e+00}, + {2.739355644265558e-09, -5.897939939244211e+00}, + {2.745610682731633e-09, -5.910611688078208e+00}, + {2.751762350508137e-09, -5.923086924473290e+00}, + {2.757810415987146e-09, -5.935364744687794e+00}, + {2.763754651462700e-09, -5.947444251452243e+00}, + {2.769594833137415e-09, -5.959324554015538e+00}, + {2.775330741132843e-09, -5.971004768198829e+00}, + {2.780962159494174e-09, -5.982484016437981e+00}, + {2.786488876202047e-09, -5.993761427840588e+00}, + {2.791910683178690e-09, -6.004836138231525e+00}, + {2.797227376295779e-09, -6.015707290202086e+00}, + {2.802438755383971e-09, -6.026374033162623e+00}, + {2.807544624236659e-09, -6.036835523383457e+00}, + {2.812544790621093e-09, -6.047090924050914e+00}, + {2.817439066283459e-09, -6.057139405311101e+00}, + {2.822227266958278e-09, -6.066980144322601e+00}, + {2.826909212371261e-09, -6.076612325295799e+00}, + {2.831484726250221e-09, -6.086035139548830e+00}, + {2.835953636329660e-09, -6.095247785550617e+00}, + {2.840315774357203e-09, -6.104249468967751e+00}, + {2.844570976102082e-09, -6.113039402715685e+00}, + {2.848719081357095e-09, -6.121616806996519e+00}, + {2.852759933948860e-09, -6.129980909353977e+00}, + {2.856693381741114e-09, -6.138130944714082e+00}, + {2.860519276643053e-09, -6.146066155436312e+00}, + {2.864237474610633e-09, -6.153785791350256e+00}, + {2.867847835656203e-09, -6.161289109809551e+00}, + {2.871350223851726e-09, -6.168575375732642e+00}, + {2.874744507333867e-09, -6.175643861647406e+00}, + {2.878030558310989e-09, -6.182493847739853e+00}, + {2.881208253063899e-09, -6.189124621889823e+00}, + {2.884277471954592e-09, -6.195535479723423e+00}, + {2.887238099428306e-09, -6.201725724651554e+00}, + {2.890090024020323e-09, -6.207694667918394e+00}, + {2.892833138356060e-09, -6.213441628635915e+00}, + {2.895467339159240e-09, -6.218965933835304e+00}, + {2.897992527253659e-09, -6.224266918505075e+00}, + {2.900408607567016e-09, -6.229343925633495e+00}, + {2.902715489136496e-09, -6.234196306254763e+00}, + {2.904913085108075e-09, -6.238823419482017e+00}, + {2.907001312743911e-09, -6.243224632557377e+00}, + {2.908980093422997e-09, -6.247399320887848e+00}, + {2.910849352646620e-09, -6.251346868091392e+00}, + {2.912609020036956e-09, -6.255066666028537e+00}, + {2.914259029343965e-09, -6.258558114851525e+00}, + {2.915799318445710e-09, -6.261820623039620e+00}, + {2.917229829350759e-09, -6.264853607438842e+00}, + {2.918550508202463e-09, -6.267656493305673e+00}, + {2.919761305276718e-09, -6.270228714337005e+00}, + {2.920862174988150e-09, -6.272569712717951e+00}, + {2.921853075889193e-09, -6.274678939154603e+00}, + {2.922733970674264e-09, -6.276555852917634e+00}, + {2.923504826176907e-09, -6.278199921870962e+00}, + {2.924165613375264e-09, -6.279610622518139e+00}, + {2.924716307391075e-09, -6.280787440034993e+00}, + {2.925156887490598e-09, -6.281729868306345e+00}, + {2.925487337087508e-09, -6.282437409966992e+00}, + {2.925707643739298e-09, -6.282909576428774e+00}, + {2.925817799151970e-09, -6.283145887925411e+00}, }; #endif diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/include/volk_gnsssdr/volk_gnsssdr_sse3_intrinsics.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/include/volk_gnsssdr/volk_gnsssdr_sse3_intrinsics.h index f48e84aa1..6f5b25673 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/include/volk_gnsssdr/volk_gnsssdr_sse3_intrinsics.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/include/volk_gnsssdr/volk_gnsssdr_sse3_intrinsics.h @@ -30,33 +30,35 @@ static inline __m128 _mm_complexmul_ps(__m128 x, __m128 y) { - __m128 yl, yh, tmp1, tmp2; - yl = _mm_moveldup_ps(y); // Load yl with cr,cr,dr,dr - yh = _mm_movehdup_ps(y); // Load yh with ci,ci,di,di - tmp1 = _mm_mul_ps(x, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr - x = _mm_shuffle_ps(x, x, 0xB1); // Re-arrange x to be ai,ar,bi,br - tmp2 = _mm_mul_ps(x, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di - return _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di + __m128 yl, yh, tmp1, tmp2; + yl = _mm_moveldup_ps(y); // Load yl with cr,cr,dr,dr + yh = _mm_movehdup_ps(y); // Load yh with ci,ci,di,di + tmp1 = _mm_mul_ps(x, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr + x = _mm_shuffle_ps(x, x, 0xB1); // Re-arrange x to be ai,ar,bi,br + tmp2 = _mm_mul_ps(x, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di + return _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di } static inline __m128 _mm_complexconjugatemul_ps(__m128 x, __m128 y) { - const __m128 conjugator = _mm_setr_ps(0, -0.f, 0, -0.f); - y = _mm_xor_ps(y, conjugator); // conjugate y - return _mm_complexmul_ps(x, y); + const __m128 conjugator = _mm_setr_ps(0, -0.f, 0, -0.f); + y = _mm_xor_ps(y, conjugator); // conjugate y + return _mm_complexmul_ps(x, y); } static inline __m128 -_mm_magnitudesquared_ps_sse3(__m128 cplxValue1, __m128 cplxValue2){ - cplxValue1 = _mm_mul_ps(cplxValue1, cplxValue1); // Square the values - cplxValue2 = _mm_mul_ps(cplxValue2, cplxValue2); // Square the Values - return _mm_hadd_ps(cplxValue1, cplxValue2); // Add the I2 and Q2 values +_mm_magnitudesquared_ps_sse3(__m128 cplxValue1, __m128 cplxValue2) +{ + cplxValue1 = _mm_mul_ps(cplxValue1, cplxValue1); // Square the values + cplxValue2 = _mm_mul_ps(cplxValue2, cplxValue2); // Square the Values + return _mm_hadd_ps(cplxValue1, cplxValue2); // Add the I2 and Q2 values } static inline __m128 -_mm_magnitude_ps_sse3(__m128 cplxValue1, __m128 cplxValue2){ - return _mm_sqrt_ps(_mm_magnitudesquared_ps_sse3(cplxValue1, cplxValue2)); +_mm_magnitude_ps_sse3(__m128 cplxValue1, __m128 cplxValue2) +{ + return _mm_sqrt_ps(_mm_magnitudesquared_ps_sse3(cplxValue1, cplxValue2)); } #endif /* INCLUDE_VOLK_VOLK_SSE3_INTRINSICS_H_ */ diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/include/volk_gnsssdr/volk_gnsssdr_sse_intrinsics.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/include/volk_gnsssdr/volk_gnsssdr_sse_intrinsics.h index 6136efba3..9de170708 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/include/volk_gnsssdr/volk_gnsssdr_sse_intrinsics.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/include/volk_gnsssdr/volk_gnsssdr_sse_intrinsics.h @@ -27,20 +27,22 @@ #include static inline __m128 -_mm_magnitudesquared_ps(__m128 cplxValue1, __m128 cplxValue2){ - __m128 iValue, qValue; - // Arrange in i1i2i3i4 format - iValue = _mm_shuffle_ps(cplxValue1, cplxValue2, _MM_SHUFFLE(2,0,2,0)); - // Arrange in q1q2q3q4 format - qValue = _mm_shuffle_ps(cplxValue1, cplxValue2, _MM_SHUFFLE(3,1,3,1)); - iValue = _mm_mul_ps(iValue, iValue); // Square the I values - qValue = _mm_mul_ps(qValue, qValue); // Square the Q Values - return _mm_add_ps(iValue, qValue); // Add the I2 and Q2 values +_mm_magnitudesquared_ps(__m128 cplxValue1, __m128 cplxValue2) +{ + __m128 iValue, qValue; + // Arrange in i1i2i3i4 format + iValue = _mm_shuffle_ps(cplxValue1, cplxValue2, _MM_SHUFFLE(2, 0, 2, 0)); + // Arrange in q1q2q3q4 format + qValue = _mm_shuffle_ps(cplxValue1, cplxValue2, _MM_SHUFFLE(3, 1, 3, 1)); + iValue = _mm_mul_ps(iValue, iValue); // Square the I values + qValue = _mm_mul_ps(qValue, qValue); // Square the Q Values + return _mm_add_ps(iValue, qValue); // Add the I2 and Q2 values } static inline __m128 -_mm_magnitude_ps(__m128 cplxValue1, __m128 cplxValue2){ - return _mm_sqrt_ps(_mm_magnitudesquared_ps(cplxValue1, cplxValue2)); +_mm_magnitude_ps(__m128 cplxValue1, __m128 cplxValue2) +{ + return _mm_sqrt_ps(_mm_magnitudesquared_ps(cplxValue1, cplxValue2)); } #endif /* INCLUDED_VOLK_VOLK_SSE_INTRINSICS_H_ */ diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16i_resamplerxnpuppet_16i.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16i_resamplerxnpuppet_16i.h index 3c1c0f817..ffce85d32 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16i_resamplerxnpuppet_16i.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16i_resamplerxnpuppet_16i.h @@ -45,55 +45,55 @@ static inline void volk_gnsssdr_16i_resamplerxnpuppet_16i_generic(int16_t* result, const int16_t* local_code, unsigned int num_points) { int code_length_chips = 2046; - float code_phase_step_chips = ((float)(code_length_chips) + 0.1 )/( (float) num_points ); + float code_phase_step_chips = ((float)(code_length_chips) + 0.1) / ((float)num_points); int num_out_vectors = 3; unsigned int n; float rem_code_phase_chips = -0.234; - float shifts_chips[3] = { -0.1, 0.0, 0.1 }; - int16_t** result_aux = (int16_t**)volk_gnsssdr_malloc(sizeof(int16_t*) * num_out_vectors, volk_gnsssdr_get_alignment()); + float shifts_chips[3] = {-0.1, 0.0, 0.1}; + int16_t** result_aux = (int16_t**)volk_gnsssdr_malloc(sizeof(int16_t*) * num_out_vectors, volk_gnsssdr_get_alignment()); - for(n = 0; n < num_out_vectors; n++) - { - result_aux[n] = (int16_t*)volk_gnsssdr_malloc(sizeof(int16_t) * num_points, volk_gnsssdr_get_alignment()); - } + for (n = 0; n < num_out_vectors; n++) + { + result_aux[n] = (int16_t*)volk_gnsssdr_malloc(sizeof(int16_t) * num_points, volk_gnsssdr_get_alignment()); + } volk_gnsssdr_16i_xn_resampler_16i_xn_generic(result_aux, local_code, rem_code_phase_chips, code_phase_step_chips, shifts_chips, code_length_chips, num_out_vectors, num_points); memcpy((int16_t*)result, (int16_t*)result_aux[0], sizeof(int16_t) * num_points); - for(n = 0; n < num_out_vectors; n++) - { - volk_gnsssdr_free(result_aux[n]); - } + for (n = 0; n < num_out_vectors; n++) + { + volk_gnsssdr_free(result_aux[n]); + } volk_gnsssdr_free(result_aux); } #endif /* LV_HAVE_GENERIC */ - + #ifdef LV_HAVE_SSE3 static inline void volk_gnsssdr_16i_resamplerxnpuppet_16i_a_sse3(int16_t* result, const int16_t* local_code, unsigned int num_points) { int code_length_chips = 2046; - float code_phase_step_chips = ((float)(code_length_chips) + 0.1 )/( (float) num_points ); + float code_phase_step_chips = ((float)(code_length_chips) + 0.1) / ((float)num_points); int num_out_vectors = 3; float rem_code_phase_chips = -0.234; unsigned int n; - float shifts_chips[3] = { -0.1, 0.0, 0.1 }; - int16_t** result_aux = (int16_t**)volk_gnsssdr_malloc(sizeof(int16_t*) * num_out_vectors, volk_gnsssdr_get_alignment()); + float shifts_chips[3] = {-0.1, 0.0, 0.1}; + int16_t** result_aux = (int16_t**)volk_gnsssdr_malloc(sizeof(int16_t*) * num_out_vectors, volk_gnsssdr_get_alignment()); - for(n = 0; n < num_out_vectors; n++) - { - result_aux[n] = (int16_t*)volk_gnsssdr_malloc(sizeof(int16_t) * num_points, volk_gnsssdr_get_alignment()); - } + for (n = 0; n < num_out_vectors; n++) + { + result_aux[n] = (int16_t*)volk_gnsssdr_malloc(sizeof(int16_t) * num_points, volk_gnsssdr_get_alignment()); + } volk_gnsssdr_16i_xn_resampler_16i_xn_a_sse3(result_aux, local_code, rem_code_phase_chips, code_phase_step_chips, shifts_chips, code_length_chips, num_out_vectors, num_points); memcpy((int16_t*)result, (int16_t*)result_aux[0], sizeof(int16_t) * num_points); - for(n = 0; n < num_out_vectors; n++) - { - volk_gnsssdr_free(result_aux[n]); - } + for (n = 0; n < num_out_vectors; n++) + { + volk_gnsssdr_free(result_aux[n]); + } volk_gnsssdr_free(result_aux); } @@ -103,26 +103,26 @@ static inline void volk_gnsssdr_16i_resamplerxnpuppet_16i_a_sse3(int16_t* result static inline void volk_gnsssdr_16i_resamplerxnpuppet_16i_u_sse3(int16_t* result, const int16_t* local_code, unsigned int num_points) { int code_length_chips = 2046; - float code_phase_step_chips = ((float)(code_length_chips) + 0.1 )/( (float) num_points ); + float code_phase_step_chips = ((float)(code_length_chips) + 0.1) / ((float)num_points); int num_out_vectors = 3; float rem_code_phase_chips = -0.234; unsigned int n; - float shifts_chips[3] = { -0.1, 0.0, 0.1 }; - int16_t** result_aux = (int16_t**)volk_gnsssdr_malloc(sizeof(int16_t*) * num_out_vectors, volk_gnsssdr_get_alignment()); + float shifts_chips[3] = {-0.1, 0.0, 0.1}; + int16_t** result_aux = (int16_t**)volk_gnsssdr_malloc(sizeof(int16_t*) * num_out_vectors, volk_gnsssdr_get_alignment()); - for(n = 0; n < num_out_vectors; n++) - { - result_aux[n] = (int16_t*)volk_gnsssdr_malloc(sizeof(int16_t) * num_points, volk_gnsssdr_get_alignment()); - } + for (n = 0; n < num_out_vectors; n++) + { + result_aux[n] = (int16_t*)volk_gnsssdr_malloc(sizeof(int16_t) * num_points, volk_gnsssdr_get_alignment()); + } volk_gnsssdr_16i_xn_resampler_16i_xn_u_sse3(result_aux, local_code, rem_code_phase_chips, code_phase_step_chips, shifts_chips, code_length_chips, num_out_vectors, num_points); memcpy((int16_t*)result, (int16_t*)result_aux[0], sizeof(int16_t) * num_points); - for(n = 0; n < num_out_vectors; n++) - { - volk_gnsssdr_free(result_aux[n]); - } + for (n = 0; n < num_out_vectors; n++) + { + volk_gnsssdr_free(result_aux[n]); + } volk_gnsssdr_free(result_aux); } @@ -133,26 +133,26 @@ static inline void volk_gnsssdr_16i_resamplerxnpuppet_16i_u_sse3(int16_t* result static inline void volk_gnsssdr_16i_resamplerxnpuppet_16i_u_sse4_1(int16_t* result, const int16_t* local_code, unsigned int num_points) { int code_length_chips = 2046; - float code_phase_step_chips = ((float)(code_length_chips) + 0.1 )/( (float) num_points ); + float code_phase_step_chips = ((float)(code_length_chips) + 0.1) / ((float)num_points); int num_out_vectors = 3; float rem_code_phase_chips = -0.234; unsigned int n; - float shifts_chips[3] = { -0.1, 0.0, 0.1 }; - int16_t** result_aux = (int16_t**)volk_gnsssdr_malloc(sizeof(int16_t*) * num_out_vectors, volk_gnsssdr_get_alignment()); + float shifts_chips[3] = {-0.1, 0.0, 0.1}; + int16_t** result_aux = (int16_t**)volk_gnsssdr_malloc(sizeof(int16_t*) * num_out_vectors, volk_gnsssdr_get_alignment()); - for(n = 0; n < num_out_vectors; n++) - { - result_aux[n] = (int16_t*)volk_gnsssdr_malloc(sizeof(int16_t) * num_points, volk_gnsssdr_get_alignment()); - } + for (n = 0; n < num_out_vectors; n++) + { + result_aux[n] = (int16_t*)volk_gnsssdr_malloc(sizeof(int16_t) * num_points, volk_gnsssdr_get_alignment()); + } volk_gnsssdr_16i_xn_resampler_16i_xn_u_sse4_1(result_aux, local_code, rem_code_phase_chips, code_phase_step_chips, shifts_chips, code_length_chips, num_out_vectors, num_points); memcpy((int16_t*)result, (int16_t*)result_aux[0], sizeof(int16_t) * num_points); - for(n = 0; n < num_out_vectors; n++) - { - volk_gnsssdr_free(result_aux[n]); - } + for (n = 0; n < num_out_vectors; n++) + { + volk_gnsssdr_free(result_aux[n]); + } volk_gnsssdr_free(result_aux); } @@ -163,26 +163,26 @@ static inline void volk_gnsssdr_16i_resamplerxnpuppet_16i_u_sse4_1(int16_t* resu static inline void volk_gnsssdr_16i_resamplerxnpuppet_16i_a_sse4_1(int16_t* result, const int16_t* local_code, unsigned int num_points) { int code_length_chips = 2046; - float code_phase_step_chips = ((float)(code_length_chips) + 0.1 )/( (float) num_points ); + float code_phase_step_chips = ((float)(code_length_chips) + 0.1) / ((float)num_points); int num_out_vectors = 3; float rem_code_phase_chips = -0.234; unsigned int n; - float shifts_chips[3] = { -0.1, 0.0, 0.1 }; - int16_t** result_aux = (int16_t**)volk_gnsssdr_malloc(sizeof(int16_t*) * num_out_vectors, volk_gnsssdr_get_alignment()); + float shifts_chips[3] = {-0.1, 0.0, 0.1}; + int16_t** result_aux = (int16_t**)volk_gnsssdr_malloc(sizeof(int16_t*) * num_out_vectors, volk_gnsssdr_get_alignment()); - for(n = 0; n < num_out_vectors; n++) - { - result_aux[n] = (int16_t*)volk_gnsssdr_malloc(sizeof(int16_t) * num_points, volk_gnsssdr_get_alignment()); - } + for (n = 0; n < num_out_vectors; n++) + { + result_aux[n] = (int16_t*)volk_gnsssdr_malloc(sizeof(int16_t) * num_points, volk_gnsssdr_get_alignment()); + } volk_gnsssdr_16i_xn_resampler_16i_xn_a_sse4_1(result_aux, local_code, rem_code_phase_chips, code_phase_step_chips, shifts_chips, code_length_chips, num_out_vectors, num_points); memcpy((int16_t*)result, (int16_t*)result_aux[0], sizeof(int16_t) * num_points); - for(n = 0; n < num_out_vectors; n++) - { - volk_gnsssdr_free(result_aux[n]); - } + for (n = 0; n < num_out_vectors; n++) + { + volk_gnsssdr_free(result_aux[n]); + } volk_gnsssdr_free(result_aux); } @@ -193,26 +193,26 @@ static inline void volk_gnsssdr_16i_resamplerxnpuppet_16i_a_sse4_1(int16_t* resu static inline void volk_gnsssdr_16i_resamplerxnpuppet_16i_u_avx(int16_t* result, const int16_t* local_code, unsigned int num_points) { int code_length_chips = 2046; - float code_phase_step_chips = ((float)(code_length_chips) + 0.1 )/( (float) num_points ); + float code_phase_step_chips = ((float)(code_length_chips) + 0.1) / ((float)num_points); int num_out_vectors = 3; float rem_code_phase_chips = -0.234; unsigned int n; - float shifts_chips[3] = { -0.1, 0.0, 0.1 }; - int16_t** result_aux = (int16_t**)volk_gnsssdr_malloc(sizeof(int16_t*) * num_out_vectors, volk_gnsssdr_get_alignment()); + float shifts_chips[3] = {-0.1, 0.0, 0.1}; + int16_t** result_aux = (int16_t**)volk_gnsssdr_malloc(sizeof(int16_t*) * num_out_vectors, volk_gnsssdr_get_alignment()); - for(n = 0; n < num_out_vectors; n++) - { - result_aux[n] = (int16_t*)volk_gnsssdr_malloc(sizeof(int16_t) * num_points, volk_gnsssdr_get_alignment()); - } + for (n = 0; n < num_out_vectors; n++) + { + result_aux[n] = (int16_t*)volk_gnsssdr_malloc(sizeof(int16_t) * num_points, volk_gnsssdr_get_alignment()); + } volk_gnsssdr_16i_xn_resampler_16i_xn_u_avx(result_aux, local_code, rem_code_phase_chips, code_phase_step_chips, shifts_chips, code_length_chips, num_out_vectors, num_points); memcpy((int16_t*)result, (int16_t*)result_aux[0], sizeof(int16_t) * num_points); - for(n = 0; n < num_out_vectors; n++) - { - volk_gnsssdr_free(result_aux[n]); - } + for (n = 0; n < num_out_vectors; n++) + { + volk_gnsssdr_free(result_aux[n]); + } volk_gnsssdr_free(result_aux); } @@ -223,26 +223,26 @@ static inline void volk_gnsssdr_16i_resamplerxnpuppet_16i_u_avx(int16_t* result, static inline void volk_gnsssdr_16i_resamplerxnpuppet_16i_a_avx(int16_t* result, const int16_t* local_code, unsigned int num_points) { int code_length_chips = 2046; - float code_phase_step_chips = ((float)(code_length_chips) + 0.1 )/( (float) num_points ); + float code_phase_step_chips = ((float)(code_length_chips) + 0.1) / ((float)num_points); int num_out_vectors = 3; float rem_code_phase_chips = -0.234; unsigned int n; - float shifts_chips[3] = { -0.1, 0.0, 0.1 }; - int16_t** result_aux = (int16_t**)volk_gnsssdr_malloc(sizeof(int16_t*) * num_out_vectors, volk_gnsssdr_get_alignment()); + float shifts_chips[3] = {-0.1, 0.0, 0.1}; + int16_t** result_aux = (int16_t**)volk_gnsssdr_malloc(sizeof(int16_t*) * num_out_vectors, volk_gnsssdr_get_alignment()); - for(n = 0; n < num_out_vectors; n++) - { - result_aux[n] = (int16_t*)volk_gnsssdr_malloc(sizeof(int16_t) * num_points, volk_gnsssdr_get_alignment()); - } + for (n = 0; n < num_out_vectors; n++) + { + result_aux[n] = (int16_t*)volk_gnsssdr_malloc(sizeof(int16_t) * num_points, volk_gnsssdr_get_alignment()); + } volk_gnsssdr_16i_xn_resampler_16i_xn_a_avx(result_aux, local_code, rem_code_phase_chips, code_phase_step_chips, shifts_chips, code_length_chips, num_out_vectors, num_points); memcpy((int16_t*)result, (int16_t*)result_aux[0], sizeof(int16_t) * num_points); - for(n = 0; n < num_out_vectors; n++) - { - volk_gnsssdr_free(result_aux[n]); - } + for (n = 0; n < num_out_vectors; n++) + { + volk_gnsssdr_free(result_aux[n]); + } volk_gnsssdr_free(result_aux); } @@ -253,30 +253,29 @@ static inline void volk_gnsssdr_16i_resamplerxnpuppet_16i_a_avx(int16_t* result, static inline void volk_gnsssdr_16i_resamplerxnpuppet_16i_neon(int16_t* result, const int16_t* local_code, unsigned int num_points) { int code_length_chips = 2046; - float code_phase_step_chips = ((float)(code_length_chips) + 0.1 )/( (float) num_points ); + float code_phase_step_chips = ((float)(code_length_chips) + 0.1) / ((float)num_points); int num_out_vectors = 3; float rem_code_phase_chips = -0.234; unsigned int n; - float shifts_chips[3] = { -0.1, 0.0, 0.1 }; - int16_t** result_aux = (int16_t**)volk_gnsssdr_malloc(sizeof(int16_t*) * num_out_vectors, volk_gnsssdr_get_alignment()); + float shifts_chips[3] = {-0.1, 0.0, 0.1}; + int16_t** result_aux = (int16_t**)volk_gnsssdr_malloc(sizeof(int16_t*) * num_out_vectors, volk_gnsssdr_get_alignment()); - for(n = 0; n < num_out_vectors; n++) - { - result_aux[n] = (int16_t*)volk_gnsssdr_malloc(sizeof(int16_t) * num_points, volk_gnsssdr_get_alignment()); - } + for (n = 0; n < num_out_vectors; n++) + { + result_aux[n] = (int16_t*)volk_gnsssdr_malloc(sizeof(int16_t) * num_points, volk_gnsssdr_get_alignment()); + } volk_gnsssdr_16i_xn_resampler_16i_xn_neon(result_aux, local_code, rem_code_phase_chips, code_phase_step_chips, shifts_chips, code_length_chips, num_out_vectors, num_points); memcpy((int16_t*)result, (int16_t*)result_aux[0], sizeof(int16_t) * num_points); - for(n = 0; n < num_out_vectors; n++) - { - volk_gnsssdr_free(result_aux[n]); - } + for (n = 0; n < num_out_vectors; n++) + { + volk_gnsssdr_free(result_aux[n]); + } volk_gnsssdr_free(result_aux); } #endif -#endif // INCLUDED_volk_gnsssdr_16i_resamplerpuppet_16i_H - +#endif // INCLUDED_volk_gnsssdr_16i_resamplerpuppet_16i_H diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16i_xn_resampler_16i_xn.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16i_xn_resampler_16i_xn.h index 0d09df273..3628ccf8c 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16i_xn_resampler_16i_xn.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16i_xn_resampler_16i_xn.h @@ -107,7 +107,8 @@ static inline void volk_gnsssdr_16i_xn_resampler_16i_xn_a_sse4_1(int16_t** resul const __m128 rem_code_phase_chips_reg = _mm_set_ps1(rem_code_phase_chips); const __m128 code_phase_step_chips_reg = _mm_set_ps1(code_phase_step_chips); - __VOLK_ATTR_ALIGNED(16) int local_code_chip_index[4]; + __VOLK_ATTR_ALIGNED(16) + int local_code_chip_index[4]; int local_code_chip_index_; const __m128i zeros = _mm_setzero_si128(); @@ -121,7 +122,7 @@ static inline void volk_gnsssdr_16i_xn_resampler_16i_xn_a_sse4_1(int16_t** resul shifts_chips_reg = _mm_set_ps1((float)shifts_chips[current_correlator_tap]); aux2 = _mm_sub_ps(shifts_chips_reg, rem_code_phase_chips_reg); __m128 indexn = _mm_set_ps(3.0f, 2.0f, 1.0f, 0.0f); - for(n = 0; n < quarterPoints; n++) + for (n = 0; n < quarterPoints; n++) { aux = _mm_mul_ps(code_phase_step_chips_reg, indexn); aux = _mm_add_ps(aux, aux2); @@ -139,13 +140,13 @@ static inline void volk_gnsssdr_16i_xn_resampler_16i_xn_a_sse4_1(int16_t** resul aux_i = _mm_and_si128(code_length_chips_reg_i, negatives); local_code_chip_index_reg = _mm_add_epi32(local_code_chip_index_reg, aux_i); _mm_store_si128((__m128i*)local_code_chip_index, local_code_chip_index_reg); - for(k = 0; k < 4; ++k) + for (k = 0; k < 4; ++k) { _result[current_correlator_tap][n * 4 + k] = local_code[local_code_chip_index[k]]; } indexn = _mm_add_ps(indexn, fours); } - for(n = quarterPoints * 4; n < num_points; n++) + for (n = quarterPoints * 4; n < num_points; n++) { // resample code for current tap local_code_chip_index_ = (int)floor(code_phase_step_chips * (float)n + shifts_chips[current_correlator_tap] - rem_code_phase_chips); @@ -157,7 +158,7 @@ static inline void volk_gnsssdr_16i_xn_resampler_16i_xn_a_sse4_1(int16_t** resul } } -#endif +#endif #ifdef LV_HAVE_SSE4_1 @@ -173,7 +174,8 @@ static inline void volk_gnsssdr_16i_xn_resampler_16i_xn_u_sse4_1(int16_t** resul const __m128 rem_code_phase_chips_reg = _mm_set_ps1(rem_code_phase_chips); const __m128 code_phase_step_chips_reg = _mm_set_ps1(code_phase_step_chips); - __VOLK_ATTR_ALIGNED(16) int local_code_chip_index[4]; + __VOLK_ATTR_ALIGNED(16) + int local_code_chip_index[4]; int local_code_chip_index_; const __m128i zeros = _mm_setzero_si128(); @@ -187,7 +189,7 @@ static inline void volk_gnsssdr_16i_xn_resampler_16i_xn_u_sse4_1(int16_t** resul shifts_chips_reg = _mm_set_ps1((float)shifts_chips[current_correlator_tap]); aux2 = _mm_sub_ps(shifts_chips_reg, rem_code_phase_chips_reg); __m128 indexn = _mm_set_ps(3.0f, 2.0f, 1.0f, 0.0f); - for(n = 0; n < quarterPoints; n++) + for (n = 0; n < quarterPoints; n++) { aux = _mm_mul_ps(code_phase_step_chips_reg, indexn); aux = _mm_add_ps(aux, aux2); @@ -205,13 +207,13 @@ static inline void volk_gnsssdr_16i_xn_resampler_16i_xn_u_sse4_1(int16_t** resul aux_i = _mm_and_si128(code_length_chips_reg_i, negatives); local_code_chip_index_reg = _mm_add_epi32(local_code_chip_index_reg, aux_i); _mm_store_si128((__m128i*)local_code_chip_index, local_code_chip_index_reg); - for(k = 0; k < 4; ++k) + for (k = 0; k < 4; ++k) { _result[current_correlator_tap][n * 4 + k] = local_code[local_code_chip_index[k]]; } indexn = _mm_add_ps(indexn, fours); } - for(n = quarterPoints * 4; n < num_points; n++) + for (n = quarterPoints * 4; n < num_points; n++) { // resample code for current tap local_code_chip_index_ = (int)floor(code_phase_step_chips * (float)n + shifts_chips[current_correlator_tap] - rem_code_phase_chips); @@ -240,7 +242,8 @@ static inline void volk_gnsssdr_16i_xn_resampler_16i_xn_a_sse3(int16_t** result, const __m128 rem_code_phase_chips_reg = _mm_set_ps1(rem_code_phase_chips); const __m128 code_phase_step_chips_reg = _mm_set_ps1(code_phase_step_chips); - __VOLK_ATTR_ALIGNED(16) int local_code_chip_index[4]; + __VOLK_ATTR_ALIGNED(16) + int local_code_chip_index[4]; int local_code_chip_index_; const __m128i zeros = _mm_setzero_si128(); @@ -254,7 +257,7 @@ static inline void volk_gnsssdr_16i_xn_resampler_16i_xn_a_sse3(int16_t** result, shifts_chips_reg = _mm_set_ps1((float)shifts_chips[current_correlator_tap]); aux2 = _mm_sub_ps(shifts_chips_reg, rem_code_phase_chips_reg); __m128 indexn = _mm_set_ps(3.0f, 2.0f, 1.0f, 0.0f); - for(n = 0; n < quarterPoints; n++) + for (n = 0; n < quarterPoints; n++) { aux = _mm_mul_ps(code_phase_step_chips_reg, indexn); aux = _mm_add_ps(aux, aux2); @@ -275,13 +278,13 @@ static inline void volk_gnsssdr_16i_xn_resampler_16i_xn_a_sse3(int16_t** result, aux_i = _mm_and_si128(code_length_chips_reg_i, negatives); local_code_chip_index_reg = _mm_add_epi32(local_code_chip_index_reg, aux_i); _mm_store_si128((__m128i*)local_code_chip_index, local_code_chip_index_reg); - for(k = 0; k < 4; ++k) + for (k = 0; k < 4; ++k) { _result[current_correlator_tap][n * 4 + k] = local_code[local_code_chip_index[k]]; } indexn = _mm_add_ps(indexn, fours); } - for(n = quarterPoints * 4; n < num_points; n++) + for (n = quarterPoints * 4; n < num_points; n++) { // resample code for current tap local_code_chip_index_ = (int)floor(code_phase_step_chips * (float)n + shifts_chips[current_correlator_tap] - rem_code_phase_chips); @@ -310,7 +313,8 @@ static inline void volk_gnsssdr_16i_xn_resampler_16i_xn_u_sse3(int16_t** result, const __m128 rem_code_phase_chips_reg = _mm_set_ps1(rem_code_phase_chips); const __m128 code_phase_step_chips_reg = _mm_set_ps1(code_phase_step_chips); - __VOLK_ATTR_ALIGNED(16) int local_code_chip_index[4]; + __VOLK_ATTR_ALIGNED(16) + int local_code_chip_index[4]; int local_code_chip_index_; const __m128i zeros = _mm_setzero_si128(); @@ -324,7 +328,7 @@ static inline void volk_gnsssdr_16i_xn_resampler_16i_xn_u_sse3(int16_t** result, shifts_chips_reg = _mm_set_ps1((float)shifts_chips[current_correlator_tap]); aux2 = _mm_sub_ps(shifts_chips_reg, rem_code_phase_chips_reg); __m128 indexn = _mm_set_ps(3.0f, 2.0f, 1.0f, 0.0f); - for(n = 0; n < quarterPoints; n++) + for (n = 0; n < quarterPoints; n++) { aux = _mm_mul_ps(code_phase_step_chips_reg, indexn); aux = _mm_add_ps(aux, aux2); @@ -345,13 +349,13 @@ static inline void volk_gnsssdr_16i_xn_resampler_16i_xn_u_sse3(int16_t** result, aux_i = _mm_and_si128(code_length_chips_reg_i, negatives); local_code_chip_index_reg = _mm_add_epi32(local_code_chip_index_reg, aux_i); _mm_store_si128((__m128i*)local_code_chip_index, local_code_chip_index_reg); - for(k = 0; k < 4; ++k) + for (k = 0; k < 4; ++k) { _result[current_correlator_tap][n * 4 + k] = local_code[local_code_chip_index[k]]; } indexn = _mm_add_ps(indexn, fours); } - for(n = quarterPoints * 4; n < num_points; n++) + for (n = quarterPoints * 4; n < num_points; n++) { // resample code for current tap local_code_chip_index_ = (int)floor(code_phase_step_chips * (float)n + shifts_chips[current_correlator_tap] - rem_code_phase_chips); @@ -379,7 +383,8 @@ static inline void volk_gnsssdr_16i_xn_resampler_16i_xn_a_avx(int16_t** result, const __m256 rem_code_phase_chips_reg = _mm256_set1_ps(rem_code_phase_chips); const __m256 code_phase_step_chips_reg = _mm256_set1_ps(code_phase_step_chips); - __VOLK_ATTR_ALIGNED(32) int local_code_chip_index[8]; + __VOLK_ATTR_ALIGNED(32) + int local_code_chip_index[8]; int local_code_chip_index_; const __m256 zeros = _mm256_setzero_ps(); @@ -394,7 +399,7 @@ static inline void volk_gnsssdr_16i_xn_resampler_16i_xn_a_avx(int16_t** result, shifts_chips_reg = _mm256_set1_ps((float)shifts_chips[current_correlator_tap]); aux2 = _mm256_sub_ps(shifts_chips_reg, rem_code_phase_chips_reg); indexn = n0; - for(n = 0; n < avx_iters; n++) + for (n = 0; n < avx_iters; n++) { __VOLK_GNSSSDR_PREFETCH_LOCALITY(&_result[current_correlator_tap][8 * n + 7], 1, 0); __VOLK_GNSSSDR_PREFETCH_LOCALITY(&local_code_chip_index[8], 1, 3); @@ -412,13 +417,13 @@ static inline void volk_gnsssdr_16i_xn_resampler_16i_xn_a_avx(int16_t** result, // no negatives c = _mm256_cvtepi32_ps(local_code_chip_index_reg); - negatives = _mm256_cmp_ps(c, zeros, 0x01 ); + negatives = _mm256_cmp_ps(c, zeros, 0x01); aux3 = _mm256_and_ps(code_length_chips_reg_f, negatives); aux = _mm256_add_ps(c, aux3); local_code_chip_index_reg = _mm256_cvttps_epi32(aux); _mm256_store_si256((__m256i*)local_code_chip_index, local_code_chip_index_reg); - for(k = 0; k < 8; ++k) + for (k = 0; k < 8; ++k) { _result[current_correlator_tap][n * 8 + k] = local_code[local_code_chip_index[k]]; } @@ -428,7 +433,7 @@ static inline void volk_gnsssdr_16i_xn_resampler_16i_xn_a_avx(int16_t** result, _mm256_zeroupper(); for (current_correlator_tap = 0; current_correlator_tap < num_out_vectors; current_correlator_tap++) { - for(n = avx_iters * 8; n < num_points; n++) + for (n = avx_iters * 8; n < num_points; n++) { // resample code for current tap local_code_chip_index_ = (int)floor(code_phase_step_chips * (float)n + shifts_chips[current_correlator_tap] - rem_code_phase_chips); @@ -456,7 +461,8 @@ static inline void volk_gnsssdr_16i_xn_resampler_16i_xn_u_avx(int16_t** result, const __m256 rem_code_phase_chips_reg = _mm256_set1_ps(rem_code_phase_chips); const __m256 code_phase_step_chips_reg = _mm256_set1_ps(code_phase_step_chips); - __VOLK_ATTR_ALIGNED(32) int local_code_chip_index[8]; + __VOLK_ATTR_ALIGNED(32) + int local_code_chip_index[8]; int local_code_chip_index_; const __m256 zeros = _mm256_setzero_ps(); @@ -471,7 +477,7 @@ static inline void volk_gnsssdr_16i_xn_resampler_16i_xn_u_avx(int16_t** result, shifts_chips_reg = _mm256_set1_ps((float)shifts_chips[current_correlator_tap]); aux2 = _mm256_sub_ps(shifts_chips_reg, rem_code_phase_chips_reg); indexn = n0; - for(n = 0; n < avx_iters; n++) + for (n = 0; n < avx_iters; n++) { __VOLK_GNSSSDR_PREFETCH_LOCALITY(&_result[current_correlator_tap][8 * n + 7], 1, 0); __VOLK_GNSSSDR_PREFETCH_LOCALITY(&local_code_chip_index[8], 1, 3); @@ -489,13 +495,13 @@ static inline void volk_gnsssdr_16i_xn_resampler_16i_xn_u_avx(int16_t** result, // no negatives c = _mm256_cvtepi32_ps(local_code_chip_index_reg); - negatives = _mm256_cmp_ps(c, zeros, 0x01 ); + negatives = _mm256_cmp_ps(c, zeros, 0x01); aux3 = _mm256_and_ps(code_length_chips_reg_f, negatives); aux = _mm256_add_ps(c, aux3); local_code_chip_index_reg = _mm256_cvttps_epi32(aux); _mm256_store_si256((__m256i*)local_code_chip_index, local_code_chip_index_reg); - for(k = 0; k < 8; ++k) + for (k = 0; k < 8; ++k) { _result[current_correlator_tap][n * 8 + k] = local_code[local_code_chip_index[k]]; } @@ -505,7 +511,7 @@ static inline void volk_gnsssdr_16i_xn_resampler_16i_xn_u_avx(int16_t** result, _mm256_zeroupper(); for (current_correlator_tap = 0; current_correlator_tap < num_out_vectors; current_correlator_tap++) { - for(n = avx_iters * 8; n < num_points; n++) + for (n = avx_iters * 8; n < num_points; n++) { // resample code for current tap local_code_chip_index_ = (int)floor(code_phase_step_chips * (float)n + shifts_chips[current_correlator_tap] - rem_code_phase_chips); @@ -531,7 +537,8 @@ static inline void volk_gnsssdr_16i_xn_resampler_16i_xn_neon(int16_t** result, c const float32x4_t rem_code_phase_chips_reg = vdupq_n_f32(rem_code_phase_chips); const float32x4_t code_phase_step_chips_reg = vdupq_n_f32(code_phase_step_chips); - __VOLK_ATTR_ALIGNED(16) int32_t local_code_chip_index[4]; + __VOLK_ATTR_ALIGNED(16) + int32_t local_code_chip_index[4]; int32_t local_code_chip_index_; const int32x4_t zeros = vdupq_n_s32(0); @@ -539,11 +546,12 @@ static inline void volk_gnsssdr_16i_xn_resampler_16i_xn_neon(int16_t** result, c const int32x4_t code_length_chips_reg_i = vdupq_n_s32((int32_t)code_length_chips); int32x4_t local_code_chip_index_reg, aux_i, negatives, i; float32x4_t aux, aux2, shifts_chips_reg, fi, c, j, cTrunc, base, indexn, reciprocal; - __VOLK_ATTR_ALIGNED(16) const float vec[4] = { 0.0f, 1.0f, 2.0f, 3.0f }; + __VOLK_ATTR_ALIGNED(16) + const float vec[4] = {0.0f, 1.0f, 2.0f, 3.0f}; uint32x4_t igx; reciprocal = vrecpeq_f32(code_length_chips_reg_f); reciprocal = vmulq_f32(vrecpsq_f32(code_length_chips_reg_f, reciprocal), reciprocal); - reciprocal = vmulq_f32(vrecpsq_f32(code_length_chips_reg_f, reciprocal), reciprocal); // this refinement is required! + reciprocal = vmulq_f32(vrecpsq_f32(code_length_chips_reg_f, reciprocal), reciprocal); // this refinement is required! float32x4_t n0 = vld1q_f32((float*)vec); int current_correlator_tap; unsigned int n; @@ -553,7 +561,7 @@ static inline void volk_gnsssdr_16i_xn_resampler_16i_xn_neon(int16_t** result, c shifts_chips_reg = vdupq_n_f32((float)shifts_chips[current_correlator_tap]); aux2 = vsubq_f32(shifts_chips_reg, rem_code_phase_chips_reg); indexn = n0; - for(n = 0; n < neon_iters; n++) + for (n = 0; n < neon_iters; n++) { __VOLK_GNSSSDR_PREFETCH_LOCALITY(&_result[current_correlator_tap][4 * n + 3], 1, 0); __VOLK_GNSSSDR_PREFETCH(&local_code_chip_index[4]); @@ -569,7 +577,7 @@ static inline void volk_gnsssdr_16i_xn_resampler_16i_xn_neon(int16_t** result, c // fmod c = vmulq_f32(aux, reciprocal); - i = vcvtq_s32_f32(c); + i = vcvtq_s32_f32(c); cTrunc = vcvtq_f32_s32(i); base = vmulq_f32(cTrunc, code_length_chips_reg_f); aux = vsubq_f32(aux, base); @@ -581,13 +589,13 @@ static inline void volk_gnsssdr_16i_xn_resampler_16i_xn_neon(int16_t** result, c vst1q_s32((int32_t*)local_code_chip_index, local_code_chip_index_reg); - for(k = 0; k < 4; ++k) + for (k = 0; k < 4; ++k) { _result[current_correlator_tap][n * 4 + k] = local_code[local_code_chip_index[k]]; } indexn = vaddq_f32(indexn, fours); } - for(n = neon_iters * 4; n < num_points; n++) + for (n = neon_iters * 4; n < num_points; n++) { __VOLK_GNSSSDR_PREFETCH_LOCALITY(&_result[current_correlator_tap][n], 1, 0); // resample code for current tap @@ -605,4 +613,3 @@ static inline void volk_gnsssdr_16i_xn_resampler_16i_xn_neon(int16_t** result, c #endif /*INCLUDED_volk_gnsssdr_16i_xn_resampler_16i_xn_H*/ - diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn.h index 230401ccb..fbf7e31f1 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn.h @@ -86,11 +86,11 @@ static inline void volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_generic(lv_16s unsigned int n; for (n_vec = 0; n_vec < num_a_vectors; n_vec++) { - result[n_vec] = lv_cmake(0,0); + result[n_vec] = lv_cmake(0, 0); } for (n = 0; n < num_points; n++) { - tmp16 = *in_common++; //if(n<10 || n >= 8108) printf("generic phase %i: %f,%f\n", n,lv_creal(*phase),lv_cimag(*phase)); + tmp16 = *in_common++; //if(n<10 || n >= 8108) printf("generic phase %i: %f,%f\n", n,lv_creal(*phase),lv_cimag(*phase)); tmp32 = lv_cmake((float)lv_creal(tmp16), (float)lv_cimag(tmp16)) * (*phase); tmp16 = lv_cmake((int16_t)rintf(lv_creal(tmp32)), (int16_t)rintf(lv_cimag(tmp32))); @@ -131,14 +131,14 @@ static inline void volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_generic_reload const unsigned int ROTATOR_RELOAD = 256; for (n_vec = 0; n_vec < num_a_vectors; n_vec++) { - result[n_vec] = lv_cmake(0,0); + result[n_vec] = lv_cmake(0, 0); } for (n = 0; n < num_points / ROTATOR_RELOAD; n++) { for (j = 0; j < ROTATOR_RELOAD; j++) { - tmp16 = *in_common++; //if(n<10 || n >= 8108) printf("generic phase %i: %f,%f\n", n,lv_creal(*phase),lv_cimag(*phase)); + tmp16 = *in_common++; //if(n<10 || n >= 8108) printf("generic phase %i: %f,%f\n", n,lv_creal(*phase),lv_cimag(*phase)); tmp32 = lv_cmake((float)lv_creal(tmp16), (float)lv_cimag(tmp16)) * (*phase); tmp16 = lv_cmake((int16_t)rintf(lv_creal(tmp32)), (int16_t)rintf(lv_cimag(tmp32))); (*phase) *= phase_inc; @@ -149,7 +149,7 @@ static inline void volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_generic_reload result[n_vec] = lv_cmake(sat_adds16i(lv_creal(result[n_vec]), lv_creal(tmp)), sat_adds16i(lv_cimag(result[n_vec]), lv_cimag(tmp))); } } - /* Regenerate phase */ + /* Regenerate phase */ #ifdef __cplusplus (*phase) /= std::abs((*phase)); #else @@ -160,13 +160,13 @@ static inline void volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_generic_reload for (j = 0; j < num_points % ROTATOR_RELOAD; j++) { - tmp16 = *in_common++; //if(n<10 || n >= 8108) printf("generic phase %i: %f,%f\n", n,lv_creal(*phase),lv_cimag(*phase)); + tmp16 = *in_common++; //if(n<10 || n >= 8108) printf("generic phase %i: %f,%f\n", n,lv_creal(*phase),lv_cimag(*phase)); tmp32 = lv_cmake((float)lv_creal(tmp16), (float)lv_cimag(tmp16)) * (*phase); tmp16 = lv_cmake((int16_t)rintf(lv_creal(tmp32)), (int16_t)rintf(lv_cimag(tmp32))); (*phase) *= phase_inc; for (n_vec = 0; n_vec < num_a_vectors; n_vec++) { - lv_16sc_t tmp = tmp16 * in_a[n_vec][ (num_points / ROTATOR_RELOAD) * ROTATOR_RELOAD + j ]; + lv_16sc_t tmp = tmp16 * in_a[n_vec][(num_points / ROTATOR_RELOAD) * ROTATOR_RELOAD + j]; //lv_16sc_t tmp = lv_cmake(sat_adds16i(sat_muls16i(lv_creal(tmp16), lv_creal(in_a[n_vec][n])), - sat_muls16i(lv_cimag(tmp16), lv_cimag(in_a[n_vec][n]))) , sat_adds16i(sat_muls16i(lv_creal(tmp16), lv_cimag(in_a[n_vec][n])), sat_muls16i(lv_cimag(tmp16), lv_creal(in_a[n_vec][n])))); result[n_vec] = lv_cmake(sat_adds16i(lv_creal(result[n_vec]), lv_creal(tmp)), sat_adds16i(lv_cimag(result[n_vec]), lv_cimag(tmp))); } @@ -179,9 +179,9 @@ static inline void volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_generic_reload #ifdef LV_HAVE_SSE3 #include -static inline void volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_a_sse3(lv_16sc_t* result, const lv_16sc_t* in_common, const lv_32fc_t phase_inc, lv_32fc_t* phase, const int16_t** in_a, int num_a_vectors, unsigned int num_points) +static inline void volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_a_sse3(lv_16sc_t* result, const lv_16sc_t* in_common, const lv_32fc_t phase_inc, lv_32fc_t* phase, const int16_t** in_a, int num_a_vectors, unsigned int num_points) { - lv_16sc_t dotProduct = lv_cmake(0,0); + lv_16sc_t dotProduct = lv_cmake(0, 0); const unsigned int sse_iters = num_points / 4; int n_vec; @@ -192,7 +192,8 @@ static inline void volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_a_sse3(lv_16sc const lv_16sc_t* _in_common = in_common; lv_16sc_t* _out = result; - __VOLK_ATTR_ALIGNED(16) lv_16sc_t dotProductVector[4]; + __VOLK_ATTR_ALIGNED(16) + lv_16sc_t dotProductVector[4]; __m128i* cacc = (__m128i*)volk_gnsssdr_malloc(num_a_vectors * sizeof(__m128i), volk_gnsssdr_get_alignment()); @@ -206,11 +207,13 @@ static inline void volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_a_sse3(lv_16sc // phase rotation registers __m128 pa, pb, two_phase_acc_reg, two_phase_inc_reg; __m128i pc1, pc2; - __VOLK_ATTR_ALIGNED(16) lv_32fc_t two_phase_inc[2]; + __VOLK_ATTR_ALIGNED(16) + lv_32fc_t two_phase_inc[2]; two_phase_inc[0] = phase_inc * phase_inc; two_phase_inc[1] = phase_inc * phase_inc; - two_phase_inc_reg = _mm_load_ps((float*) two_phase_inc); - __VOLK_ATTR_ALIGNED(16) lv_32fc_t two_phase_acc[2]; + two_phase_inc_reg = _mm_load_ps((float*)two_phase_inc); + __VOLK_ATTR_ALIGNED(16) + lv_32fc_t two_phase_acc[2]; two_phase_acc[0] = (*phase); two_phase_acc[1] = (*phase) * phase_inc; two_phase_acc_reg = _mm_load_ps((float*)two_phase_acc); @@ -218,62 +221,62 @@ static inline void volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_a_sse3(lv_16sc lv_16sc_t tmp16; lv_32fc_t tmp32; - for(number = 0; number < sse_iters; number++) + for (number = 0; number < sse_iters; number++) { // Phase rotation on operand in_common starts here: //printf("generic phase %i: %f,%f\n", n*4,lv_creal(*phase),lv_cimag(*phase)); - pa = _mm_set_ps((float)(lv_cimag(_in_common[1])), (float)(lv_creal(_in_common[1])), (float)(lv_cimag(_in_common[0])), (float)(lv_creal(_in_common[0]))); // //load (2 byte imag, 2 byte real) x 2 into 128 bits reg + pa = _mm_set_ps((float)(lv_cimag(_in_common[1])), (float)(lv_creal(_in_common[1])), (float)(lv_cimag(_in_common[0])), (float)(lv_creal(_in_common[0]))); // //load (2 byte imag, 2 byte real) x 2 into 128 bits reg //complex 32fc multiplication b=a*two_phase_acc_reg - yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr - yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di - tmp1 = _mm_mul_ps(pa, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr - pa = _mm_shuffle_ps(pa, pa, 0xB1); // Re-arrange x to be ai,ar,bi,br - tmp2 = _mm_mul_ps(pa, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di - pb = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di - pc1 = _mm_cvtps_epi32(pb); // convert from 32fc to 32ic + yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr + yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di + tmp1 = _mm_mul_ps(pa, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr + pa = _mm_shuffle_ps(pa, pa, 0xB1); // Re-arrange x to be ai,ar,bi,br + tmp2 = _mm_mul_ps(pa, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di + pb = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di + pc1 = _mm_cvtps_epi32(pb); // convert from 32fc to 32ic //complex 32fc multiplication two_phase_acc_reg=two_phase_acc_reg*two_phase_inc_reg - yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr - yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di - tmp1 = _mm_mul_ps(two_phase_inc_reg, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr - tmp3 = _mm_shuffle_ps(two_phase_inc_reg, two_phase_inc_reg, 0xB1); // Re-arrange x to be ai,ar,bi,br - tmp2 = _mm_mul_ps(tmp3, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di - two_phase_acc_reg = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di + yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr + yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di + tmp1 = _mm_mul_ps(two_phase_inc_reg, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr + tmp3 = _mm_shuffle_ps(two_phase_inc_reg, two_phase_inc_reg, 0xB1); // Re-arrange x to be ai,ar,bi,br + tmp2 = _mm_mul_ps(tmp3, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di + two_phase_acc_reg = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di //next two samples _in_common += 2; - pa = _mm_set_ps((float)(lv_cimag(_in_common[1])), (float)(lv_creal(_in_common[1])), (float)(lv_cimag(_in_common[0])), (float)(lv_creal(_in_common[0]))); // //load (2 byte imag, 2 byte real) x 2 into 128 bits reg + pa = _mm_set_ps((float)(lv_cimag(_in_common[1])), (float)(lv_creal(_in_common[1])), (float)(lv_cimag(_in_common[0])), (float)(lv_creal(_in_common[0]))); // //load (2 byte imag, 2 byte real) x 2 into 128 bits reg __VOLK_GNSSSDR_PREFETCH(_in_common + 8); //complex 32fc multiplication b=a*two_phase_acc_reg - yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr - yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di - tmp1 = _mm_mul_ps(pa, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr - pa = _mm_shuffle_ps(pa, pa, 0xB1); // Re-arrange x to be ai,ar,bi,br - tmp2 = _mm_mul_ps(pa, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di - pb = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di - pc2 = _mm_cvtps_epi32(pb); // convert from 32fc to 32ic + yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr + yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di + tmp1 = _mm_mul_ps(pa, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr + pa = _mm_shuffle_ps(pa, pa, 0xB1); // Re-arrange x to be ai,ar,bi,br + tmp2 = _mm_mul_ps(pa, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di + pb = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di + pc2 = _mm_cvtps_epi32(pb); // convert from 32fc to 32ic //complex 32fc multiplication two_phase_acc_reg=two_phase_acc_reg*two_phase_inc_reg - yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr - yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di - tmp1 = _mm_mul_ps(two_phase_inc_reg, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr - tmp3 = _mm_shuffle_ps(two_phase_inc_reg, two_phase_inc_reg, 0xB1); // Re-arrange x to be ai,ar,bi,br - tmp2 = _mm_mul_ps(tmp3, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di - two_phase_acc_reg = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di + yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr + yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di + tmp1 = _mm_mul_ps(two_phase_inc_reg, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr + tmp3 = _mm_shuffle_ps(two_phase_inc_reg, two_phase_inc_reg, 0xB1); // Re-arrange x to be ai,ar,bi,br + tmp2 = _mm_mul_ps(tmp3, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di + two_phase_acc_reg = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di // store four rotated in_common samples in the register b - b = _mm_packs_epi32(pc1, pc2);// convert from 32ic to 16ic + b = _mm_packs_epi32(pc1, pc2); // convert from 32ic to 16ic //next two samples _in_common += 2; for (n_vec = 0; n_vec < num_a_vectors; n_vec++) { - a = _mm_loadl_epi64((__m128i*)&(_in_a[n_vec][number*4])); //load (2 byte imag, 2 byte real) x 4 into 128 bits reg + a = _mm_loadl_epi64((__m128i*)&(_in_a[n_vec][number * 4])); //load (2 byte imag, 2 byte real) x 4 into 128 bits reg - a = _mm_unpacklo_epi16( a, a ); + a = _mm_unpacklo_epi16(a, a); - c = _mm_mullo_epi16(a, b); // a3.i*b3.i, a3.r*b3.r, .... + c = _mm_mullo_epi16(a, b); // a3.i*b3.i, a3.r*b3.r, .... cacc[n_vec] = _mm_adds_epi16(cacc[n_vec], c); } @@ -290,14 +293,13 @@ static inline void volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_a_sse3(lv_16sc for (n_vec = 0; n_vec < num_a_vectors; n_vec++) { - a = cacc[n_vec]; - _mm_store_si128((__m128i*)dotProductVector, a); // Store the results back into the dot product vector - dotProduct = lv_cmake(0,0); + _mm_store_si128((__m128i*)dotProductVector, a); // Store the results back into the dot product vector + dotProduct = lv_cmake(0, 0); for (i = 0; i < 4; ++i) { dotProduct = lv_cmake(sat_adds16i(lv_creal(dotProduct), lv_creal(dotProductVector[i])), - sat_adds16i(lv_cimag(dotProduct), lv_cimag(dotProductVector[i]))); + sat_adds16i(lv_cimag(dotProduct), lv_cimag(dotProductVector[i]))); } _out[n_vec] = dotProduct; } @@ -313,7 +315,7 @@ static inline void volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_a_sse3(lv_16sc //(*phase) = lv_cmake((float*)two_phase_acc[0], (float*)two_phase_acc[1]); (*phase) = two_phase_acc[0]; - for(n = sse_iters * 4; n < num_points; n++) + for (n = sse_iters * 4; n < num_points; n++) { tmp16 = in_common[n]; //printf("a_sse phase %i: %f,%f\n", n,lv_creal(*phase),lv_cimag(*phase)); tmp32 = lv_cmake((float)lv_creal(tmp16), (float)lv_cimag(tmp16)) * (*phase); @@ -325,7 +327,7 @@ static inline void volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_a_sse3(lv_16sc lv_16sc_t tmp = tmp16 * in_a[n_vec][n]; //lv_16sc_t tmp = lv_cmake(sat_adds16i(sat_muls16i(lv_creal(tmp16), lv_creal(in_a[n_vec][n])), - sat_muls16i(lv_cimag(tmp16), lv_cimag(in_a[n_vec][n]))) , sat_adds16i(sat_muls16i(lv_creal(tmp16), lv_cimag(in_a[n_vec][n])), sat_muls16i(lv_cimag(tmp16), lv_creal(in_a[n_vec][n])))); _out[n_vec] = lv_cmake(sat_adds16i(lv_creal(_out[n_vec]), lv_creal(tmp)), - sat_adds16i(lv_cimag(_out[n_vec]), lv_cimag(tmp))); + sat_adds16i(lv_cimag(_out[n_vec]), lv_cimag(tmp))); } } } @@ -337,245 +339,245 @@ static inline void volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_a_sse3(lv_16sc //static inline void volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_a_sse3_reload(lv_16sc_t* result, const lv_16sc_t* in_common, const lv_32fc_t phase_inc, lv_32fc_t* phase, const int16_t** in_a, int num_a_vectors, unsigned int num_points) //{ - //lv_16sc_t dotProduct = lv_cmake(0,0); +//lv_16sc_t dotProduct = lv_cmake(0,0); - //const unsigned int sse_iters = num_points / 4; - //const unsigned int ROTATOR_RELOAD = 128; - //int n_vec; - //int i; - //unsigned int number; - //unsigned int j; - //unsigned int n; +//const unsigned int sse_iters = num_points / 4; +//const unsigned int ROTATOR_RELOAD = 128; +//int n_vec; +//int i; +//unsigned int number; +//unsigned int j; +//unsigned int n; - //const int16_t** _in_a = in_a; - //const lv_16sc_t* _in_common = in_common; - //lv_16sc_t* _out = result; +//const int16_t** _in_a = in_a; +//const lv_16sc_t* _in_common = in_common; +//lv_16sc_t* _out = result; - //__VOLK_ATTR_ALIGNED(16) lv_16sc_t dotProductVector[4]; +//__VOLK_ATTR_ALIGNED(16) lv_16sc_t dotProductVector[4]; - //__m128i* realcacc = (__m128i*)volk_gnsssdr_malloc(num_a_vectors * sizeof(__m128i), volk_gnsssdr_get_alignment()); - //__m128i* imagcacc = (__m128i*)volk_gnsssdr_malloc(num_a_vectors * sizeof(__m128i), volk_gnsssdr_get_alignment()); +//__m128i* realcacc = (__m128i*)volk_gnsssdr_malloc(num_a_vectors * sizeof(__m128i), volk_gnsssdr_get_alignment()); +//__m128i* imagcacc = (__m128i*)volk_gnsssdr_malloc(num_a_vectors * sizeof(__m128i), volk_gnsssdr_get_alignment()); - //for (n_vec = 0; n_vec < num_a_vectors; n_vec++) - //{ - //realcacc[n_vec] = _mm_setzero_si128(); - //imagcacc[n_vec] = _mm_setzero_si128(); - //} +//for (n_vec = 0; n_vec < num_a_vectors; n_vec++) +//{ +//realcacc[n_vec] = _mm_setzero_si128(); +//imagcacc[n_vec] = _mm_setzero_si128(); +//} - //__m128i a, b, c, c_sr, mask_imag, mask_real, real, imag, imag1, imag2, b_sl, a_sl; +//__m128i a, b, c, c_sr, mask_imag, mask_real, real, imag, imag1, imag2, b_sl, a_sl; - //mask_imag = _mm_set_epi8(255, 255, 0, 0, 255, 255, 0, 0, 255, 255, 0, 0, 255, 255, 0, 0); - //mask_real = _mm_set_epi8(0, 0, 255, 255, 0, 0, 255, 255, 0, 0, 255, 255, 0, 0, 255, 255); +//mask_imag = _mm_set_epi8(255, 255, 0, 0, 255, 255, 0, 0, 255, 255, 0, 0, 255, 255, 0, 0); +//mask_real = _mm_set_epi8(0, 0, 255, 255, 0, 0, 255, 255, 0, 0, 255, 255, 0, 0, 255, 255); - //// phase rotation registers - //__m128 pa, pb, two_phase_acc_reg, two_phase_inc_reg; - //__m128i pc1, pc2; - //__VOLK_ATTR_ALIGNED(16) lv_32fc_t two_phase_inc[2]; - //two_phase_inc[0] = phase_inc * phase_inc; - //two_phase_inc[1] = phase_inc * phase_inc; - //two_phase_inc_reg = _mm_load_ps((float*) two_phase_inc); - //__VOLK_ATTR_ALIGNED(16) lv_32fc_t two_phase_acc[2]; - //two_phase_acc[0] = (*phase); - //two_phase_acc[1] = (*phase) * phase_inc; - //two_phase_acc_reg = _mm_load_ps((float*)two_phase_acc); - //__m128 yl, yh, tmp1, tmp2, tmp3; - //lv_16sc_t tmp16; - //lv_32fc_t tmp32; +//// phase rotation registers +//__m128 pa, pb, two_phase_acc_reg, two_phase_inc_reg; +//__m128i pc1, pc2; +//__VOLK_ATTR_ALIGNED(16) lv_32fc_t two_phase_inc[2]; +//two_phase_inc[0] = phase_inc * phase_inc; +//two_phase_inc[1] = phase_inc * phase_inc; +//two_phase_inc_reg = _mm_load_ps((float*) two_phase_inc); +//__VOLK_ATTR_ALIGNED(16) lv_32fc_t two_phase_acc[2]; +//two_phase_acc[0] = (*phase); +//two_phase_acc[1] = (*phase) * phase_inc; +//two_phase_acc_reg = _mm_load_ps((float*)two_phase_acc); +//__m128 yl, yh, tmp1, tmp2, tmp3; +//lv_16sc_t tmp16; +//lv_32fc_t tmp32; - //for (number = 0; number < sse_iters / ROTATOR_RELOAD; ++number) - //{ - //for (j = 0; j < ROTATOR_RELOAD; j++) - //{ - //// Phase rotation on operand in_common starts here: - ////printf("generic phase %i: %f,%f\n", n*4,lv_creal(*phase),lv_cimag(*phase)); - //pa = _mm_set_ps((float)(lv_cimag(_in_common[1])), (float)(lv_creal(_in_common[1])), (float)(lv_cimag(_in_common[0])), (float)(lv_creal(_in_common[0]))); // //load (2 byte imag, 2 byte real) x 2 into 128 bits reg - ////complex 32fc multiplication b=a*two_phase_acc_reg - //yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr - //yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di - //tmp1 = _mm_mul_ps(pa, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr - //pa = _mm_shuffle_ps(pa, pa, 0xB1); // Re-arrange x to be ai,ar,bi,br - //tmp2 = _mm_mul_ps(pa, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di - //pb = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di - //pc1 = _mm_cvtps_epi32(pb); // convert from 32fc to 32ic +//for (number = 0; number < sse_iters / ROTATOR_RELOAD; ++number) +//{ +//for (j = 0; j < ROTATOR_RELOAD; j++) +//{ +//// Phase rotation on operand in_common starts here: +////printf("generic phase %i: %f,%f\n", n*4,lv_creal(*phase),lv_cimag(*phase)); +//pa = _mm_set_ps((float)(lv_cimag(_in_common[1])), (float)(lv_creal(_in_common[1])), (float)(lv_cimag(_in_common[0])), (float)(lv_creal(_in_common[0]))); // //load (2 byte imag, 2 byte real) x 2 into 128 bits reg +////complex 32fc multiplication b=a*two_phase_acc_reg +//yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr +//yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di +//tmp1 = _mm_mul_ps(pa, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr +//pa = _mm_shuffle_ps(pa, pa, 0xB1); // Re-arrange x to be ai,ar,bi,br +//tmp2 = _mm_mul_ps(pa, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di +//pb = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di +//pc1 = _mm_cvtps_epi32(pb); // convert from 32fc to 32ic - ////complex 32fc multiplication two_phase_acc_reg=two_phase_acc_reg*two_phase_inc_reg - //yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr - //yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di - //tmp1 = _mm_mul_ps(two_phase_inc_reg, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr - //tmp3 = _mm_shuffle_ps(two_phase_inc_reg, two_phase_inc_reg, 0xB1); // Re-arrange x to be ai,ar,bi,br - //tmp2 = _mm_mul_ps(tmp3, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di - //two_phase_acc_reg = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di +////complex 32fc multiplication two_phase_acc_reg=two_phase_acc_reg*two_phase_inc_reg +//yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr +//yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di +//tmp1 = _mm_mul_ps(two_phase_inc_reg, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr +//tmp3 = _mm_shuffle_ps(two_phase_inc_reg, two_phase_inc_reg, 0xB1); // Re-arrange x to be ai,ar,bi,br +//tmp2 = _mm_mul_ps(tmp3, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di +//two_phase_acc_reg = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di - ////next two samples - //_in_common += 2; - //pa = _mm_set_ps((float)(lv_cimag(_in_common[1])), (float)(lv_creal(_in_common[1])), (float)(lv_cimag(_in_common[0])), (float)(lv_creal(_in_common[0]))); // //load (2 byte imag, 2 byte real) x 2 into 128 bits reg - //__VOLK_GNSSSDR_PREFETCH(_in_common + 8); - ////complex 32fc multiplication b=a*two_phase_acc_reg - //yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr - //yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di - //tmp1 = _mm_mul_ps(pa, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr - //pa = _mm_shuffle_ps(pa, pa, 0xB1); // Re-arrange x to be ai,ar,bi,br - //tmp2 = _mm_mul_ps(pa, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di - //pb = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di - //pc2 = _mm_cvtps_epi32(pb); // convert from 32fc to 32ic +////next two samples +//_in_common += 2; +//pa = _mm_set_ps((float)(lv_cimag(_in_common[1])), (float)(lv_creal(_in_common[1])), (float)(lv_cimag(_in_common[0])), (float)(lv_creal(_in_common[0]))); // //load (2 byte imag, 2 byte real) x 2 into 128 bits reg +//__VOLK_GNSSSDR_PREFETCH(_in_common + 8); +////complex 32fc multiplication b=a*two_phase_acc_reg +//yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr +//yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di +//tmp1 = _mm_mul_ps(pa, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr +//pa = _mm_shuffle_ps(pa, pa, 0xB1); // Re-arrange x to be ai,ar,bi,br +//tmp2 = _mm_mul_ps(pa, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di +//pb = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di +//pc2 = _mm_cvtps_epi32(pb); // convert from 32fc to 32ic - ////complex 32fc multiplication two_phase_acc_reg=two_phase_acc_reg*two_phase_inc_reg - //yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr - //yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di - //tmp1 = _mm_mul_ps(two_phase_inc_reg, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr - //tmp3 = _mm_shuffle_ps(two_phase_inc_reg, two_phase_inc_reg, 0xB1); // Re-arrange x to be ai,ar,bi,br - //tmp2 = _mm_mul_ps(tmp3, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di - //two_phase_acc_reg = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di +////complex 32fc multiplication two_phase_acc_reg=two_phase_acc_reg*two_phase_inc_reg +//yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr +//yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di +//tmp1 = _mm_mul_ps(two_phase_inc_reg, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr +//tmp3 = _mm_shuffle_ps(two_phase_inc_reg, two_phase_inc_reg, 0xB1); // Re-arrange x to be ai,ar,bi,br +//tmp2 = _mm_mul_ps(tmp3, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di +//two_phase_acc_reg = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di - //// store four rotated in_common samples in the register b - //b = _mm_packs_epi32(pc1, pc2);// convert from 32ic to 16ic +//// store four rotated in_common samples in the register b +//b = _mm_packs_epi32(pc1, pc2);// convert from 32ic to 16ic - ////next two samples - //_in_common += 2; +////next two samples +//_in_common += 2; - //for (n_vec = 0; n_vec < num_a_vectors; n_vec++) - //{ - //a = _mm_load_si128((__m128i*)&(_in_a[n_vec][(number * ROTATOR_RELOAD + j) * 4])); //load (2 byte imag, 2 byte real) x 4 into 128 bits reg +//for (n_vec = 0; n_vec < num_a_vectors; n_vec++) +//{ +//a = _mm_load_si128((__m128i*)&(_in_a[n_vec][(number * ROTATOR_RELOAD + j) * 4])); //load (2 byte imag, 2 byte real) x 4 into 128 bits reg - //c = _mm_mullo_epi16(a, b); // a3.i*b3.i, a3.r*b3.r, .... +//c = _mm_mullo_epi16(a, b); // a3.i*b3.i, a3.r*b3.r, .... - //c_sr = _mm_srli_si128(c, 2); // Shift a right by imm8 bytes while shifting in zeros, and store the results in dst. - //real = _mm_subs_epi16(c, c_sr); +//c_sr = _mm_srli_si128(c, 2); // Shift a right by imm8 bytes while shifting in zeros, and store the results in dst. +//real = _mm_subs_epi16(c, c_sr); - //b_sl = _mm_slli_si128(b, 2); // b3.r, b2.i .... - //a_sl = _mm_slli_si128(a, 2); // a3.r, a2.i .... +//b_sl = _mm_slli_si128(b, 2); // b3.r, b2.i .... +//a_sl = _mm_slli_si128(a, 2); // a3.r, a2.i .... - //imag1 = _mm_mullo_epi16(a, b_sl); // a3.i*b3.r, .... - //imag2 = _mm_mullo_epi16(b, a_sl); // b3.i*a3.r, .... +//imag1 = _mm_mullo_epi16(a, b_sl); // a3.i*b3.r, .... +//imag2 = _mm_mullo_epi16(b, a_sl); // b3.i*a3.r, .... - //imag = _mm_adds_epi16(imag1, imag2); +//imag = _mm_adds_epi16(imag1, imag2); - //realcacc[n_vec] = _mm_adds_epi16(realcacc[n_vec], real); - //imagcacc[n_vec] = _mm_adds_epi16(imagcacc[n_vec], imag); - //} - //} - //// regenerate phase - //tmp1 = _mm_mul_ps(two_phase_acc_reg, two_phase_acc_reg); - //tmp2 = _mm_hadd_ps(tmp1, tmp1); - //tmp1 = _mm_shuffle_ps(tmp2, tmp2, 0xD8); - //tmp2 = _mm_sqrt_ps(tmp1); - //two_phase_acc_reg = _mm_div_ps(two_phase_acc_reg, tmp2); - //} +//realcacc[n_vec] = _mm_adds_epi16(realcacc[n_vec], real); +//imagcacc[n_vec] = _mm_adds_epi16(imagcacc[n_vec], imag); +//} +//} +//// regenerate phase +//tmp1 = _mm_mul_ps(two_phase_acc_reg, two_phase_acc_reg); +//tmp2 = _mm_hadd_ps(tmp1, tmp1); +//tmp1 = _mm_shuffle_ps(tmp2, tmp2, 0xD8); +//tmp2 = _mm_sqrt_ps(tmp1); +//two_phase_acc_reg = _mm_div_ps(two_phase_acc_reg, tmp2); +//} - //for (j = 0; j < sse_iters % ROTATOR_RELOAD; j++) - //{ - //pa = _mm_set_ps((float)(lv_cimag(_in_common[1])), (float)(lv_creal(_in_common[1])), (float)(lv_cimag(_in_common[0])), (float)(lv_creal(_in_common[0]))); // //load (2 byte imag, 2 byte real) x 2 into 128 bits reg - ////complex 32fc multiplication b=a*two_phase_acc_reg - //yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr - //yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di - //tmp1 = _mm_mul_ps(pa, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr - //pa = _mm_shuffle_ps(pa, pa, 0xB1); // Re-arrange x to be ai,ar,bi,br - //tmp2 = _mm_mul_ps(pa, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di - //pb = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di - //pc1 = _mm_cvtps_epi32(pb); // convert from 32fc to 32ic +//for (j = 0; j < sse_iters % ROTATOR_RELOAD; j++) +//{ +//pa = _mm_set_ps((float)(lv_cimag(_in_common[1])), (float)(lv_creal(_in_common[1])), (float)(lv_cimag(_in_common[0])), (float)(lv_creal(_in_common[0]))); // //load (2 byte imag, 2 byte real) x 2 into 128 bits reg +////complex 32fc multiplication b=a*two_phase_acc_reg +//yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr +//yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di +//tmp1 = _mm_mul_ps(pa, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr +//pa = _mm_shuffle_ps(pa, pa, 0xB1); // Re-arrange x to be ai,ar,bi,br +//tmp2 = _mm_mul_ps(pa, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di +//pb = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di +//pc1 = _mm_cvtps_epi32(pb); // convert from 32fc to 32ic - ////complex 32fc multiplication two_phase_acc_reg=two_phase_acc_reg*two_phase_inc_reg - //yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr - //yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di - //tmp1 = _mm_mul_ps(two_phase_inc_reg, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr - //tmp3 = _mm_shuffle_ps(two_phase_inc_reg, two_phase_inc_reg, 0xB1); // Re-arrange x to be ai,ar,bi,br - //tmp2 = _mm_mul_ps(tmp3, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di - //two_phase_acc_reg = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di +////complex 32fc multiplication two_phase_acc_reg=two_phase_acc_reg*two_phase_inc_reg +//yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr +//yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di +//tmp1 = _mm_mul_ps(two_phase_inc_reg, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr +//tmp3 = _mm_shuffle_ps(two_phase_inc_reg, two_phase_inc_reg, 0xB1); // Re-arrange x to be ai,ar,bi,br +//tmp2 = _mm_mul_ps(tmp3, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di +//two_phase_acc_reg = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di - ////next two samples - //_in_common += 2; - //pa = _mm_set_ps((float)(lv_cimag(_in_common[1])), (float)(lv_creal(_in_common[1])), (float)(lv_cimag(_in_common[0])), (float)(lv_creal(_in_common[0]))); // //load (2 byte imag, 2 byte real) x 2 into 128 bits reg - //__VOLK_GNSSSDR_PREFETCH(_in_common + 8); - ////complex 32fc multiplication b=a*two_phase_acc_reg - //yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr - //yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di - //tmp1 = _mm_mul_ps(pa, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr - //pa = _mm_shuffle_ps(pa, pa, 0xB1); // Re-arrange x to be ai,ar,bi,br - //tmp2 = _mm_mul_ps(pa, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di - //pb = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di - //pc2 = _mm_cvtps_epi32(pb); // convert from 32fc to 32ic +////next two samples +//_in_common += 2; +//pa = _mm_set_ps((float)(lv_cimag(_in_common[1])), (float)(lv_creal(_in_common[1])), (float)(lv_cimag(_in_common[0])), (float)(lv_creal(_in_common[0]))); // //load (2 byte imag, 2 byte real) x 2 into 128 bits reg +//__VOLK_GNSSSDR_PREFETCH(_in_common + 8); +////complex 32fc multiplication b=a*two_phase_acc_reg +//yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr +//yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di +//tmp1 = _mm_mul_ps(pa, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr +//pa = _mm_shuffle_ps(pa, pa, 0xB1); // Re-arrange x to be ai,ar,bi,br +//tmp2 = _mm_mul_ps(pa, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di +//pb = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di +//pc2 = _mm_cvtps_epi32(pb); // convert from 32fc to 32ic - ////complex 32fc multiplication two_phase_acc_reg=two_phase_acc_reg*two_phase_inc_reg - //yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr - //yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di - //tmp1 = _mm_mul_ps(two_phase_inc_reg, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr - //tmp3 = _mm_shuffle_ps(two_phase_inc_reg, two_phase_inc_reg, 0xB1); // Re-arrange x to be ai,ar,bi,br - //tmp2 = _mm_mul_ps(tmp3, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di - //two_phase_acc_reg = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di +////complex 32fc multiplication two_phase_acc_reg=two_phase_acc_reg*two_phase_inc_reg +//yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr +//yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di +//tmp1 = _mm_mul_ps(two_phase_inc_reg, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr +//tmp3 = _mm_shuffle_ps(two_phase_inc_reg, two_phase_inc_reg, 0xB1); // Re-arrange x to be ai,ar,bi,br +//tmp2 = _mm_mul_ps(tmp3, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di +//two_phase_acc_reg = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di - //// store four rotated in_common samples in the register b - //b = _mm_packs_epi32(pc1, pc2);// convert from 32ic to 16ic +//// store four rotated in_common samples in the register b +//b = _mm_packs_epi32(pc1, pc2);// convert from 32ic to 16ic - ////next two samples - //_in_common += 2; +////next two samples +//_in_common += 2; - //for (n_vec = 0; n_vec < num_a_vectors; n_vec++) - //{ - //a = _mm_load_si128((__m128i*)&(_in_a[n_vec][((sse_iters / ROTATOR_RELOAD) * ROTATOR_RELOAD + j) * 4])); //load (2 byte imag, 2 byte real) x 4 into 128 bits reg +//for (n_vec = 0; n_vec < num_a_vectors; n_vec++) +//{ +//a = _mm_load_si128((__m128i*)&(_in_a[n_vec][((sse_iters / ROTATOR_RELOAD) * ROTATOR_RELOAD + j) * 4])); //load (2 byte imag, 2 byte real) x 4 into 128 bits reg - //c = _mm_mullo_epi16(a, b); // a3.i*b3.i, a3.r*b3.r, .... +//c = _mm_mullo_epi16(a, b); // a3.i*b3.i, a3.r*b3.r, .... - //c_sr = _mm_srli_si128(c, 2); // Shift a right by imm8 bytes while shifting in zeros, and store the results in dst. - //real = _mm_subs_epi16(c, c_sr); +//c_sr = _mm_srli_si128(c, 2); // Shift a right by imm8 bytes while shifting in zeros, and store the results in dst. +//real = _mm_subs_epi16(c, c_sr); - //b_sl = _mm_slli_si128(b, 2); // b3.r, b2.i .... - //a_sl = _mm_slli_si128(a, 2); // a3.r, a2.i .... +//b_sl = _mm_slli_si128(b, 2); // b3.r, b2.i .... +//a_sl = _mm_slli_si128(a, 2); // a3.r, a2.i .... - //imag1 = _mm_mullo_epi16(a, b_sl); // a3.i*b3.r, .... - //imag2 = _mm_mullo_epi16(b, a_sl); // b3.i*a3.r, .... +//imag1 = _mm_mullo_epi16(a, b_sl); // a3.i*b3.r, .... +//imag2 = _mm_mullo_epi16(b, a_sl); // b3.i*a3.r, .... - //imag = _mm_adds_epi16(imag1, imag2); +//imag = _mm_adds_epi16(imag1, imag2); - //realcacc[n_vec] = _mm_adds_epi16(realcacc[n_vec], real); - //imagcacc[n_vec] = _mm_adds_epi16(imagcacc[n_vec], imag); - //} - //} +//realcacc[n_vec] = _mm_adds_epi16(realcacc[n_vec], real); +//imagcacc[n_vec] = _mm_adds_epi16(imagcacc[n_vec], imag); +//} +//} - //for (n_vec = 0; n_vec < num_a_vectors; n_vec++) - //{ - //realcacc[n_vec] = _mm_and_si128(realcacc[n_vec], mask_real); - //imagcacc[n_vec] = _mm_and_si128(imagcacc[n_vec], mask_imag); +//for (n_vec = 0; n_vec < num_a_vectors; n_vec++) +//{ +//realcacc[n_vec] = _mm_and_si128(realcacc[n_vec], mask_real); +//imagcacc[n_vec] = _mm_and_si128(imagcacc[n_vec], mask_imag); - //a = _mm_or_si128(realcacc[n_vec], imagcacc[n_vec]); +//a = _mm_or_si128(realcacc[n_vec], imagcacc[n_vec]); - //_mm_store_si128((__m128i*)dotProductVector, a); // Store the results back into the dot product vector - //dotProduct = lv_cmake(0,0); - //for (i = 0; i < 4; ++i) - //{ - //dotProduct = lv_cmake(sat_adds16i(lv_creal(dotProduct), lv_creal(dotProductVector[i])), - //sat_adds16i(lv_cimag(dotProduct), lv_cimag(dotProductVector[i]))); - //} - //_out[n_vec] = dotProduct; - //} +//_mm_store_si128((__m128i*)dotProductVector, a); // Store the results back into the dot product vector +//dotProduct = lv_cmake(0,0); +//for (i = 0; i < 4; ++i) +//{ +//dotProduct = lv_cmake(sat_adds16i(lv_creal(dotProduct), lv_creal(dotProductVector[i])), +//sat_adds16i(lv_cimag(dotProduct), lv_cimag(dotProductVector[i]))); +//} +//_out[n_vec] = dotProduct; +//} - //volk_gnsssdr_free(realcacc); - //volk_gnsssdr_free(imagcacc); +//volk_gnsssdr_free(realcacc); +//volk_gnsssdr_free(imagcacc); - //tmp1 = _mm_mul_ps(two_phase_acc_reg, two_phase_acc_reg); - //tmp2 = _mm_hadd_ps(tmp1, tmp1); - //tmp1 = _mm_shuffle_ps(tmp2, tmp2, 0xD8); - //tmp2 = _mm_sqrt_ps(tmp1); - //two_phase_acc_reg = _mm_div_ps(two_phase_acc_reg, tmp2); +//tmp1 = _mm_mul_ps(two_phase_acc_reg, two_phase_acc_reg); +//tmp2 = _mm_hadd_ps(tmp1, tmp1); +//tmp1 = _mm_shuffle_ps(tmp2, tmp2, 0xD8); +//tmp2 = _mm_sqrt_ps(tmp1); +//two_phase_acc_reg = _mm_div_ps(two_phase_acc_reg, tmp2); - //_mm_store_ps((float*)two_phase_acc, two_phase_acc_reg); - ////(*phase) = lv_cmake((float*)two_phase_acc[0], (float*)two_phase_acc[1]); - //(*phase) = two_phase_acc[0]; +//_mm_store_ps((float*)two_phase_acc, two_phase_acc_reg); +////(*phase) = lv_cmake((float*)two_phase_acc[0], (float*)two_phase_acc[1]); +//(*phase) = two_phase_acc[0]; - //for(n = sse_iters * 4; n < num_points; n++) - //{ - //tmp16 = in_common[n]; //printf("a_sse phase %i: %f,%f\n", n,lv_creal(*phase),lv_cimag(*phase)); - //tmp32 = lv_cmake((float)lv_creal(tmp16), (float)lv_cimag(tmp16)) * (*phase); - //tmp16 = lv_cmake((int16_t)rintf(lv_creal(tmp32)), (int16_t)rintf(lv_cimag(tmp32))); - //(*phase) *= phase_inc; +//for(n = sse_iters * 4; n < num_points; n++) +//{ +//tmp16 = in_common[n]; //printf("a_sse phase %i: %f,%f\n", n,lv_creal(*phase),lv_cimag(*phase)); +//tmp32 = lv_cmake((float)lv_creal(tmp16), (float)lv_cimag(tmp16)) * (*phase); +//tmp16 = lv_cmake((int16_t)rintf(lv_creal(tmp32)), (int16_t)rintf(lv_cimag(tmp32))); +//(*phase) *= phase_inc; - //for (n_vec = 0; n_vec < num_a_vectors; n_vec++) - //{ - //lv_16sc_t tmp = tmp16 * in_a[n_vec][n]; - ////lv_16sc_t tmp = lv_cmake(sat_adds16i(sat_muls16i(lv_creal(tmp16), lv_creal(in_a[n_vec][n])), - sat_muls16i(lv_cimag(tmp16), lv_cimag(in_a[n_vec][n]))) , sat_adds16i(sat_muls16i(lv_creal(tmp16), lv_cimag(in_a[n_vec][n])), sat_muls16i(lv_cimag(tmp16), lv_creal(in_a[n_vec][n])))); - //_out[n_vec] = lv_cmake(sat_adds16i(lv_creal(_out[n_vec]), lv_creal(tmp)), - //sat_adds16i(lv_cimag(_out[n_vec]), lv_cimag(tmp))); - //} - //} +//for (n_vec = 0; n_vec < num_a_vectors; n_vec++) +//{ +//lv_16sc_t tmp = tmp16 * in_a[n_vec][n]; +////lv_16sc_t tmp = lv_cmake(sat_adds16i(sat_muls16i(lv_creal(tmp16), lv_creal(in_a[n_vec][n])), - sat_muls16i(lv_cimag(tmp16), lv_cimag(in_a[n_vec][n]))) , sat_adds16i(sat_muls16i(lv_creal(tmp16), lv_cimag(in_a[n_vec][n])), sat_muls16i(lv_cimag(tmp16), lv_creal(in_a[n_vec][n])))); +//_out[n_vec] = lv_cmake(sat_adds16i(lv_creal(_out[n_vec]), lv_creal(tmp)), +//sat_adds16i(lv_cimag(_out[n_vec]), lv_cimag(tmp))); +//} +//} //} //#endif [> LV_HAVE_SSE3 <] @@ -584,9 +586,9 @@ static inline void volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_a_sse3(lv_16sc #ifdef LV_HAVE_SSE3 #include -static inline void volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_u_sse3(lv_16sc_t* result, const lv_16sc_t* in_common, const lv_32fc_t phase_inc, lv_32fc_t* phase, const int16_t** in_a, int num_a_vectors, unsigned int num_points) +static inline void volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_u_sse3(lv_16sc_t* result, const lv_16sc_t* in_common, const lv_32fc_t phase_inc, lv_32fc_t* phase, const int16_t** in_a, int num_a_vectors, unsigned int num_points) { - lv_16sc_t dotProduct = lv_cmake(0,0); + lv_16sc_t dotProduct = lv_cmake(0, 0); const unsigned int sse_iters = num_points / 4; int n_vec; @@ -597,7 +599,8 @@ static inline void volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_u_sse3(lv_16sc const lv_16sc_t* _in_common = in_common; lv_16sc_t* _out = result; - __VOLK_ATTR_ALIGNED(16) lv_16sc_t dotProductVector[4]; + __VOLK_ATTR_ALIGNED(16) + lv_16sc_t dotProductVector[4]; __m128i* cacc = (__m128i*)volk_gnsssdr_malloc(num_a_vectors * sizeof(__m128i), volk_gnsssdr_get_alignment()); @@ -611,11 +614,13 @@ static inline void volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_u_sse3(lv_16sc // phase rotation registers __m128 pa, pb, two_phase_acc_reg, two_phase_inc_reg; __m128i pc1, pc2; - __VOLK_ATTR_ALIGNED(16) lv_32fc_t two_phase_inc[2]; + __VOLK_ATTR_ALIGNED(16) + lv_32fc_t two_phase_inc[2]; two_phase_inc[0] = phase_inc * phase_inc; two_phase_inc[1] = phase_inc * phase_inc; - two_phase_inc_reg = _mm_load_ps((float*) two_phase_inc); - __VOLK_ATTR_ALIGNED(16) lv_32fc_t two_phase_acc[2]; + two_phase_inc_reg = _mm_load_ps((float*)two_phase_inc); + __VOLK_ATTR_ALIGNED(16) + lv_32fc_t two_phase_acc[2]; two_phase_acc[0] = (*phase); two_phase_acc[1] = (*phase) * phase_inc; two_phase_acc_reg = _mm_load_ps((float*)two_phase_acc); @@ -623,62 +628,62 @@ static inline void volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_u_sse3(lv_16sc lv_16sc_t tmp16; lv_32fc_t tmp32; - for(number = 0; number < sse_iters; number++) + for (number = 0; number < sse_iters; number++) { // Phase rotation on operand in_common starts here: //printf("generic phase %i: %f,%f\n", n*4,lv_creal(*phase),lv_cimag(*phase)); - pa = _mm_set_ps((float)(lv_cimag(_in_common[1])), (float)(lv_creal(_in_common[1])), (float)(lv_cimag(_in_common[0])), (float)(lv_creal(_in_common[0]))); // //load (2 byte imag, 2 byte real) x 2 into 128 bits reg + pa = _mm_set_ps((float)(lv_cimag(_in_common[1])), (float)(lv_creal(_in_common[1])), (float)(lv_cimag(_in_common[0])), (float)(lv_creal(_in_common[0]))); // //load (2 byte imag, 2 byte real) x 2 into 128 bits reg //complex 32fc multiplication b=a*two_phase_acc_reg - yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr - yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di - tmp1 = _mm_mul_ps(pa, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr - pa = _mm_shuffle_ps(pa, pa, 0xB1); // Re-arrange x to be ai,ar,bi,br - tmp2 = _mm_mul_ps(pa, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di - pb = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di - pc1 = _mm_cvtps_epi32(pb); // convert from 32fc to 32ic + yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr + yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di + tmp1 = _mm_mul_ps(pa, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr + pa = _mm_shuffle_ps(pa, pa, 0xB1); // Re-arrange x to be ai,ar,bi,br + tmp2 = _mm_mul_ps(pa, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di + pb = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di + pc1 = _mm_cvtps_epi32(pb); // convert from 32fc to 32ic //complex 32fc multiplication two_phase_acc_reg=two_phase_acc_reg*two_phase_inc_reg - yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr - yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di - tmp1 = _mm_mul_ps(two_phase_inc_reg, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr - tmp3 = _mm_shuffle_ps(two_phase_inc_reg, two_phase_inc_reg, 0xB1); // Re-arrange x to be ai,ar,bi,br - tmp2 = _mm_mul_ps(tmp3, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di - two_phase_acc_reg = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di + yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr + yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di + tmp1 = _mm_mul_ps(two_phase_inc_reg, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr + tmp3 = _mm_shuffle_ps(two_phase_inc_reg, two_phase_inc_reg, 0xB1); // Re-arrange x to be ai,ar,bi,br + tmp2 = _mm_mul_ps(tmp3, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di + two_phase_acc_reg = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di //next two samples _in_common += 2; - pa = _mm_set_ps((float)(lv_cimag(_in_common[1])), (float)(lv_creal(_in_common[1])), (float)(lv_cimag(_in_common[0])), (float)(lv_creal(_in_common[0]))); // //load (2 byte imag, 2 byte real) x 2 into 128 bits reg + pa = _mm_set_ps((float)(lv_cimag(_in_common[1])), (float)(lv_creal(_in_common[1])), (float)(lv_cimag(_in_common[0])), (float)(lv_creal(_in_common[0]))); // //load (2 byte imag, 2 byte real) x 2 into 128 bits reg __VOLK_GNSSSDR_PREFETCH(_in_common + 8); //complex 32fc multiplication b=a*two_phase_acc_reg - yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr - yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di - tmp1 = _mm_mul_ps(pa, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr - pa = _mm_shuffle_ps(pa, pa, 0xB1); // Re-arrange x to be ai,ar,bi,br - tmp2 = _mm_mul_ps(pa, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di - pb = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di - pc2 = _mm_cvtps_epi32(pb); // convert from 32fc to 32ic + yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr + yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di + tmp1 = _mm_mul_ps(pa, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr + pa = _mm_shuffle_ps(pa, pa, 0xB1); // Re-arrange x to be ai,ar,bi,br + tmp2 = _mm_mul_ps(pa, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di + pb = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di + pc2 = _mm_cvtps_epi32(pb); // convert from 32fc to 32ic //complex 32fc multiplication two_phase_acc_reg=two_phase_acc_reg*two_phase_inc_reg - yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr - yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di - tmp1 = _mm_mul_ps(two_phase_inc_reg, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr - tmp3 = _mm_shuffle_ps(two_phase_inc_reg, two_phase_inc_reg, 0xB1); // Re-arrange x to be ai,ar,bi,br - tmp2 = _mm_mul_ps(tmp3, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di - two_phase_acc_reg = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di + yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr + yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di + tmp1 = _mm_mul_ps(two_phase_inc_reg, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr + tmp3 = _mm_shuffle_ps(two_phase_inc_reg, two_phase_inc_reg, 0xB1); // Re-arrange x to be ai,ar,bi,br + tmp2 = _mm_mul_ps(tmp3, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di + two_phase_acc_reg = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di // store four rotated in_common samples in the register b - b = _mm_packs_epi32(pc1, pc2);// convert from 32ic to 16ic + b = _mm_packs_epi32(pc1, pc2); // convert from 32ic to 16ic //next two samples _in_common += 2; for (n_vec = 0; n_vec < num_a_vectors; n_vec++) { - a = _mm_loadl_epi64((__m128i*)&(_in_a[n_vec][number*4])); //load (2 byte imag, 2 byte real) x 4 into 128 bits reg + a = _mm_loadl_epi64((__m128i*)&(_in_a[n_vec][number * 4])); //load (2 byte imag, 2 byte real) x 4 into 128 bits reg - a = _mm_unpacklo_epi16( a, a ); + a = _mm_unpacklo_epi16(a, a); - c = _mm_mullo_epi16(a, b); // a3.i*b3.i, a3.r*b3.r, .... + c = _mm_mullo_epi16(a, b); // a3.i*b3.i, a3.r*b3.r, .... cacc[n_vec] = _mm_adds_epi16(cacc[n_vec], c); } @@ -695,14 +700,13 @@ static inline void volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_u_sse3(lv_16sc for (n_vec = 0; n_vec < num_a_vectors; n_vec++) { - a = cacc[n_vec]; - _mm_store_si128((__m128i*)dotProductVector, a); // Store the results back into the dot product vector - dotProduct = lv_cmake(0,0); + _mm_store_si128((__m128i*)dotProductVector, a); // Store the results back into the dot product vector + dotProduct = lv_cmake(0, 0); for (i = 0; i < 4; ++i) { dotProduct = lv_cmake(sat_adds16i(lv_creal(dotProduct), lv_creal(dotProductVector[i])), - sat_adds16i(lv_cimag(dotProduct), lv_cimag(dotProductVector[i]))); + sat_adds16i(lv_cimag(dotProduct), lv_cimag(dotProductVector[i]))); } _out[n_vec] = dotProduct; } @@ -718,7 +722,7 @@ static inline void volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_u_sse3(lv_16sc //(*phase) = lv_cmake((float*)two_phase_acc[0], (float*)two_phase_acc[1]); (*phase) = two_phase_acc[0]; - for(n = sse_iters * 4; n < num_points; n++) + for (n = sse_iters * 4; n < num_points; n++) { tmp16 = in_common[n]; //printf("a_sse phase %i: %f,%f\n", n,lv_creal(*phase),lv_cimag(*phase)); tmp32 = lv_cmake((float)lv_creal(tmp16), (float)lv_cimag(tmp16)) * (*phase); @@ -730,7 +734,7 @@ static inline void volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_u_sse3(lv_16sc lv_16sc_t tmp = tmp16 * in_a[n_vec][n]; //lv_16sc_t tmp = lv_cmake(sat_adds16i(sat_muls16i(lv_creal(tmp16), lv_creal(in_a[n_vec][n])), - sat_muls16i(lv_cimag(tmp16), lv_cimag(in_a[n_vec][n]))) , sat_adds16i(sat_muls16i(lv_creal(tmp16), lv_cimag(in_a[n_vec][n])), sat_muls16i(lv_cimag(tmp16), lv_creal(in_a[n_vec][n])))); _out[n_vec] = lv_cmake(sat_adds16i(lv_creal(_out[n_vec]), lv_creal(tmp)), - sat_adds16i(lv_cimag(_out[n_vec]), lv_cimag(tmp))); + sat_adds16i(lv_cimag(_out[n_vec]), lv_cimag(tmp))); } } } @@ -742,7 +746,7 @@ static inline void volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_u_sse3(lv_16sc #include #include -static inline void volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_a_avx2(lv_16sc_t* result, const lv_16sc_t* in_common, const lv_32fc_t phase_inc, lv_32fc_t* phase, const int16_t** in_a, int num_a_vectors, unsigned int num_points) +static inline void volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_a_avx2(lv_16sc_t* result, const lv_16sc_t* in_common, const lv_32fc_t phase_inc, lv_32fc_t* phase, const int16_t** in_a, int num_a_vectors, unsigned int num_points) { const unsigned int avx2_iters = num_points / 8; const int16_t** _in_a = in_a; @@ -755,8 +759,9 @@ static inline void volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_a_avx2(lv_16sc lv_16sc_t tmp16; lv_32fc_t tmp32; - __VOLK_ATTR_ALIGNED(32) lv_16sc_t dotProductVector[8]; - lv_16sc_t dotProduct = lv_cmake(0,0); + __VOLK_ATTR_ALIGNED(32) + lv_16sc_t dotProductVector[8]; + lv_16sc_t dotProduct = lv_cmake(0, 0); __m256i* cacc = (__m256i*)volk_gnsssdr_malloc(num_a_vectors * sizeof(__m256i), volk_gnsssdr_get_alignment()); @@ -771,7 +776,7 @@ static inline void volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_a_avx2(lv_16sc __m256 four_phase_acc_reg, four_phase_inc_reg; - lv_32fc_t _phase_inc = phase_inc*phase_inc*phase_inc*phase_inc; + lv_32fc_t _phase_inc = phase_inc * phase_inc * phase_inc * phase_inc; // Normalise the 4*phase increment #ifdef __cplusplus @@ -780,55 +785,57 @@ static inline void volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_a_avx2(lv_16sc _phase_inc /= hypotf(lv_creal(_phase_inc), lv_cimag(_phase_inc)); #endif - __VOLK_ATTR_ALIGNED(32) lv_32fc_t four_phase_inc[4]; - __VOLK_ATTR_ALIGNED(32) lv_32fc_t four_phase_acc[4]; - for( n = 0; n < 4; ++n ) - { - four_phase_inc[n] = _phase_inc; - four_phase_acc[n] = *phase; - *phase *= phase_inc; - } - four_phase_acc_reg = _mm256_load_ps((float*) four_phase_acc); - four_phase_inc_reg = _mm256_load_ps((float*) four_phase_inc); + __VOLK_ATTR_ALIGNED(32) + lv_32fc_t four_phase_inc[4]; + __VOLK_ATTR_ALIGNED(32) + lv_32fc_t four_phase_acc[4]; + for (n = 0; n < 4; ++n) + { + four_phase_inc[n] = _phase_inc; + four_phase_acc[n] = *phase; + *phase *= phase_inc; + } + four_phase_acc_reg = _mm256_load_ps((float*)four_phase_acc); + four_phase_inc_reg = _mm256_load_ps((float*)four_phase_inc); __m256i a2, b2, c, c1, c2, perm_idx; - perm_idx = _mm256_set_epi32( 7, 6, 3, 2, 5, 4, 1, 0); + perm_idx = _mm256_set_epi32(7, 6, 3, 2, 5, 4, 1, 0); //perm_idx = _mm256_set_epi32( 0, 1, 4, 5, 2, 3, 6, 7); - for(number = 0; number < avx2_iters; number++) + for (number = 0; number < avx2_iters; number++) { - a128 = _mm_load_si128( (__m128i *)_in_common ); - ai = _mm256_cvtepi16_epi32( a128 ); - a = _mm256_cvtepi32_ps( ai ); + a128 = _mm_load_si128((__m128i*)_in_common); + ai = _mm256_cvtepi16_epi32(a128); + a = _mm256_cvtepi32_ps(ai); //complex 32fc multiplication b=a*two_phase_acc_reg - b = _mm256_complexmul_ps( a, four_phase_acc_reg ); - c1 = _mm256_cvtps_epi32(b); // convert from 32fc to 32ic + b = _mm256_complexmul_ps(a, four_phase_acc_reg); + c1 = _mm256_cvtps_epi32(b); // convert from 32fc to 32ic //complex 32fc multiplication two_phase_acc_reg=two_phase_acc_reg*two_phase_inc_reg - four_phase_acc_reg = _mm256_complexmul_ps( four_phase_inc_reg, four_phase_acc_reg ); + four_phase_acc_reg = _mm256_complexmul_ps(four_phase_inc_reg, four_phase_acc_reg); //next four samples _in_common += 4; - a128 = _mm_load_si128( (__m128i *)_in_common ); - ai = _mm256_cvtepi16_epi32( a128 ); - a = _mm256_cvtepi32_ps( ai ); + a128 = _mm_load_si128((__m128i*)_in_common); + ai = _mm256_cvtepi16_epi32(a128); + a = _mm256_cvtepi32_ps(ai); //complex 32fc multiplication b=a*two_phase_acc_reg - b = _mm256_complexmul_ps( a, four_phase_acc_reg ); - c2 = _mm256_cvtps_epi32(b); // convert from 32fc to 32ic + b = _mm256_complexmul_ps(a, four_phase_acc_reg); + c2 = _mm256_cvtps_epi32(b); // convert from 32fc to 32ic //complex 32fc multiplication two_phase_acc_reg=two_phase_acc_reg*two_phase_inc_reg - four_phase_acc_reg = _mm256_complexmul_ps( four_phase_inc_reg, four_phase_acc_reg ); + four_phase_acc_reg = _mm256_complexmul_ps(four_phase_inc_reg, four_phase_acc_reg); __VOLK_GNSSSDR_PREFETCH(_in_common + 16); // Store and convert 32ic to 16ic: - b2 = _mm256_packs_epi32( c1, c2 ); + b2 = _mm256_packs_epi32(c1, c2); - b2 = _mm256_permutevar8x32_epi32( b2, perm_idx ); + b2 = _mm256_permutevar8x32_epi32(b2, perm_idx); _in_common += 4; @@ -836,10 +843,10 @@ static inline void volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_a_avx2(lv_16sc { ain_128 = _mm_load_si128((__m128i*)&(_in_a[n_vec][number * 8])); - ain_128_lo = _mm_unpacklo_epi16( ain_128, ain_128 ); - ain_128_hi = _mm_unpackhi_epi16( ain_128, ain_128 ); + ain_128_lo = _mm_unpacklo_epi16(ain_128, ain_128); + ain_128_hi = _mm_unpackhi_epi16(ain_128, ain_128); - a2 = _mm256_insertf128_si256( _mm256_castsi128_si256(ain_128_lo), ain_128_hi, 1); + a2 = _mm256_insertf128_si256(_mm256_castsi128_si256(ain_128_lo), ain_128_hi, 1); c = _mm256_mullo_epi16(a2, b2); @@ -856,12 +863,12 @@ static inline void volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_a_avx2(lv_16sc { a2 = cacc[n_vec]; - _mm256_store_si256((__m256i*)dotProductVector, a2); // Store the results back into the dot product vector - dotProduct = lv_cmake(0,0); + _mm256_store_si256((__m256i*)dotProductVector, a2); // Store the results back into the dot product vector + dotProduct = lv_cmake(0, 0); for (number = 0; number < 8; ++number) { dotProduct = lv_cmake(sat_adds16i(lv_creal(dotProduct), lv_creal(dotProductVector[number])), - sat_adds16i(lv_cimag(dotProduct), lv_cimag(dotProductVector[number]))); + sat_adds16i(lv_cimag(dotProduct), lv_cimag(dotProductVector[number]))); } _out[n_vec] = dotProduct; } @@ -872,7 +879,7 @@ static inline void volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_a_avx2(lv_16sc _mm256_store_ps((float*)four_phase_acc, four_phase_acc_reg); (*phase) = four_phase_acc[0]; - for(n = avx2_iters * 8; n < num_points; n++) + for (n = avx2_iters * 8; n < num_points; n++) { tmp16 = in_common[n]; tmp32 = lv_cmake((float)lv_creal(tmp16), (float)lv_cimag(tmp16)) * (*phase); @@ -882,10 +889,9 @@ static inline void volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_a_avx2(lv_16sc { lv_16sc_t tmp = tmp16 * in_a[n_vec][n]; _out[n_vec] = lv_cmake(sat_adds16i(lv_creal(_out[n_vec]), lv_creal(tmp)), - sat_adds16i(lv_cimag(_out[n_vec]), lv_cimag(tmp))); + sat_adds16i(lv_cimag(_out[n_vec]), lv_cimag(tmp))); } } - } #endif /* LV_HAVE_AVX2 */ @@ -894,7 +900,7 @@ static inline void volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_a_avx2(lv_16sc #include #include -static inline void volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_u_avx2(lv_16sc_t* result, const lv_16sc_t* in_common, const lv_32fc_t phase_inc, lv_32fc_t* phase, const int16_t** in_a, int num_a_vectors, unsigned int num_points) +static inline void volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_u_avx2(lv_16sc_t* result, const lv_16sc_t* in_common, const lv_32fc_t phase_inc, lv_32fc_t* phase, const int16_t** in_a, int num_a_vectors, unsigned int num_points) { const unsigned int avx2_iters = num_points / 8; const int16_t** _in_a = in_a; @@ -907,8 +913,9 @@ static inline void volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_u_avx2(lv_16sc lv_16sc_t tmp16; lv_32fc_t tmp32; - __VOLK_ATTR_ALIGNED(32) lv_16sc_t dotProductVector[8]; - lv_16sc_t dotProduct = lv_cmake(0,0); + __VOLK_ATTR_ALIGNED(32) + lv_16sc_t dotProductVector[8]; + lv_16sc_t dotProduct = lv_cmake(0, 0); __m256i* cacc = (__m256i*)volk_gnsssdr_malloc(num_a_vectors * sizeof(__m256i), volk_gnsssdr_get_alignment()); @@ -923,7 +930,7 @@ static inline void volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_u_avx2(lv_16sc __m256 four_phase_acc_reg, four_phase_inc_reg; - lv_32fc_t _phase_inc = phase_inc*phase_inc*phase_inc*phase_inc; + lv_32fc_t _phase_inc = phase_inc * phase_inc * phase_inc * phase_inc; // Normalise the 4*phase increment #ifdef __cplusplus @@ -932,55 +939,57 @@ static inline void volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_u_avx2(lv_16sc _phase_inc /= hypotf(lv_creal(_phase_inc), lv_cimag(_phase_inc)); #endif - __VOLK_ATTR_ALIGNED(32) lv_32fc_t four_phase_inc[4]; - __VOLK_ATTR_ALIGNED(32) lv_32fc_t four_phase_acc[4]; - for( n = 0; n < 4; ++n ) - { - four_phase_inc[n] = _phase_inc; - four_phase_acc[n] = *phase; - *phase *= phase_inc; - } - four_phase_acc_reg = _mm256_load_ps((float*) four_phase_acc); - four_phase_inc_reg = _mm256_load_ps((float*) four_phase_inc); + __VOLK_ATTR_ALIGNED(32) + lv_32fc_t four_phase_inc[4]; + __VOLK_ATTR_ALIGNED(32) + lv_32fc_t four_phase_acc[4]; + for (n = 0; n < 4; ++n) + { + four_phase_inc[n] = _phase_inc; + four_phase_acc[n] = *phase; + *phase *= phase_inc; + } + four_phase_acc_reg = _mm256_load_ps((float*)four_phase_acc); + four_phase_inc_reg = _mm256_load_ps((float*)four_phase_inc); __m256i a2, b2, c, c1, c2, perm_idx; - perm_idx = _mm256_set_epi32( 7, 6, 3, 2, 5, 4, 1, 0); + perm_idx = _mm256_set_epi32(7, 6, 3, 2, 5, 4, 1, 0); //perm_idx = _mm256_set_epi32( 0, 1, 4, 5, 2, 3, 6, 7); - for(number = 0; number < avx2_iters; number++) + for (number = 0; number < avx2_iters; number++) { - a128 = _mm_loadu_si128( (__m128i *)_in_common ); - ai = _mm256_cvtepi16_epi32( a128 ); - a = _mm256_cvtepi32_ps( ai ); + a128 = _mm_loadu_si128((__m128i*)_in_common); + ai = _mm256_cvtepi16_epi32(a128); + a = _mm256_cvtepi32_ps(ai); //complex 32fc multiplication b=a*two_phase_acc_reg - b = _mm256_complexmul_ps( a, four_phase_acc_reg ); - c1 = _mm256_cvtps_epi32(b); // convert from 32fc to 32ic + b = _mm256_complexmul_ps(a, four_phase_acc_reg); + c1 = _mm256_cvtps_epi32(b); // convert from 32fc to 32ic //complex 32fc multiplication two_phase_acc_reg=two_phase_acc_reg*two_phase_inc_reg - four_phase_acc_reg = _mm256_complexmul_ps( four_phase_inc_reg, four_phase_acc_reg ); + four_phase_acc_reg = _mm256_complexmul_ps(four_phase_inc_reg, four_phase_acc_reg); //next four samples _in_common += 4; - a128 = _mm_loadu_si128( (__m128i *)_in_common ); - ai = _mm256_cvtepi16_epi32( a128 ); - a = _mm256_cvtepi32_ps( ai ); + a128 = _mm_loadu_si128((__m128i*)_in_common); + ai = _mm256_cvtepi16_epi32(a128); + a = _mm256_cvtepi32_ps(ai); //complex 32fc multiplication b=a*two_phase_acc_reg - b = _mm256_complexmul_ps( a, four_phase_acc_reg ); - c2 = _mm256_cvtps_epi32(b); // convert from 32fc to 32ic + b = _mm256_complexmul_ps(a, four_phase_acc_reg); + c2 = _mm256_cvtps_epi32(b); // convert from 32fc to 32ic //complex 32fc multiplication two_phase_acc_reg=two_phase_acc_reg*two_phase_inc_reg - four_phase_acc_reg = _mm256_complexmul_ps( four_phase_inc_reg, four_phase_acc_reg ); + four_phase_acc_reg = _mm256_complexmul_ps(four_phase_inc_reg, four_phase_acc_reg); __VOLK_GNSSSDR_PREFETCH(_in_common + 16); // Store and convert 32ic to 16ic: - b2 = _mm256_packs_epi32( c1, c2 ); + b2 = _mm256_packs_epi32(c1, c2); - b2 = _mm256_permutevar8x32_epi32( b2, perm_idx ); + b2 = _mm256_permutevar8x32_epi32(b2, perm_idx); _in_common += 4; @@ -988,10 +997,10 @@ static inline void volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_u_avx2(lv_16sc { ain_128 = _mm_loadu_si128((__m128i*)&(_in_a[n_vec][number * 8])); - ain_128_lo = _mm_unpacklo_epi16( ain_128, ain_128 ); - ain_128_hi = _mm_unpackhi_epi16( ain_128, ain_128 ); + ain_128_lo = _mm_unpacklo_epi16(ain_128, ain_128); + ain_128_hi = _mm_unpackhi_epi16(ain_128, ain_128); - a2 = _mm256_insertf128_si256( _mm256_castsi128_si256(ain_128_lo), ain_128_hi, 1); + a2 = _mm256_insertf128_si256(_mm256_castsi128_si256(ain_128_lo), ain_128_hi, 1); c = _mm256_mullo_epi16(a2, b2); @@ -1008,12 +1017,12 @@ static inline void volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_u_avx2(lv_16sc { a2 = cacc[n_vec]; - _mm256_store_si256((__m256i*)dotProductVector, a2); // Store the results back into the dot product vector - dotProduct = lv_cmake(0,0); + _mm256_store_si256((__m256i*)dotProductVector, a2); // Store the results back into the dot product vector + dotProduct = lv_cmake(0, 0); for (number = 0; number < 8; ++number) { dotProduct = lv_cmake(sat_adds16i(lv_creal(dotProduct), lv_creal(dotProductVector[number])), - sat_adds16i(lv_cimag(dotProduct), lv_cimag(dotProductVector[number]))); + sat_adds16i(lv_cimag(dotProduct), lv_cimag(dotProductVector[number]))); } _out[n_vec] = dotProduct; } @@ -1024,7 +1033,7 @@ static inline void volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_u_avx2(lv_16sc _mm256_store_ps((float*)four_phase_acc, four_phase_acc_reg); (*phase) = four_phase_acc[0]; - for(n = avx2_iters * 8; n < num_points; n++) + for (n = avx2_iters * 8; n < num_points; n++) { tmp16 = in_common[n]; tmp32 = lv_cmake((float)lv_creal(tmp16), (float)lv_cimag(tmp16)) * (*phase); @@ -1034,10 +1043,9 @@ static inline void volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_u_avx2(lv_16sc { lv_16sc_t tmp = tmp16 * in_a[n_vec][n]; _out[n_vec] = lv_cmake(sat_adds16i(lv_creal(_out[n_vec]), lv_creal(tmp)), - sat_adds16i(lv_cimag(_out[n_vec]), lv_cimag(tmp))); + sat_adds16i(lv_cimag(_out[n_vec]), lv_cimag(tmp))); } } - } #endif /* LV_HAVE_AVX2 */ @@ -1046,178 +1054,178 @@ static inline void volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_u_avx2(lv_16sc //static inline void volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_neon(lv_16sc_t* result, const lv_16sc_t* in_common, const lv_32fc_t phase_inc, lv_32fc_t* phase, const int16_t** in_a, int num_a_vectors, unsigned int num_points) //{ - //const unsigned int neon_iters = num_points / 4; +//const unsigned int neon_iters = num_points / 4; - //const int16_t** _in_a = in_a; - //const lv_16sc_t* _in_common = in_common; - //lv_16sc_t* _out = result; - //int n_vec; - //int i; - //unsigned int number; - //unsigned int n; - //lv_16sc_t tmp16_, tmp; - //lv_32fc_t tmp32_; +//const int16_t** _in_a = in_a; +//const lv_16sc_t* _in_common = in_common; +//lv_16sc_t* _out = result; +//int n_vec; +//int i; +//unsigned int number; +//unsigned int n; +//lv_16sc_t tmp16_, tmp; +//lv_32fc_t tmp32_; - //if (neon_iters > 0) - //{ - //lv_16sc_t dotProduct = lv_cmake(0,0); - //float arg_phase0 = cargf(*phase); - //float arg_phase_inc = cargf(phase_inc); - //float phase_est; +//if (neon_iters > 0) +//{ +//lv_16sc_t dotProduct = lv_cmake(0,0); +//float arg_phase0 = cargf(*phase); +//float arg_phase_inc = cargf(phase_inc); +//float phase_est; - //lv_32fc_t ___phase4 = phase_inc * phase_inc * phase_inc * phase_inc; - //__VOLK_ATTR_ALIGNED(16) float32_t __phase4_real[4] = { lv_creal(___phase4), lv_creal(___phase4), lv_creal(___phase4), lv_creal(___phase4) }; - //__VOLK_ATTR_ALIGNED(16) float32_t __phase4_imag[4] = { lv_cimag(___phase4), lv_cimag(___phase4), lv_cimag(___phase4), lv_cimag(___phase4) }; +//lv_32fc_t ___phase4 = phase_inc * phase_inc * phase_inc * phase_inc; +//__VOLK_ATTR_ALIGNED(16) float32_t __phase4_real[4] = { lv_creal(___phase4), lv_creal(___phase4), lv_creal(___phase4), lv_creal(___phase4) }; +//__VOLK_ATTR_ALIGNED(16) float32_t __phase4_imag[4] = { lv_cimag(___phase4), lv_cimag(___phase4), lv_cimag(___phase4), lv_cimag(___phase4) }; - //float32x4_t _phase4_real = vld1q_f32(__phase4_real); - //float32x4_t _phase4_imag = vld1q_f32(__phase4_imag); +//float32x4_t _phase4_real = vld1q_f32(__phase4_real); +//float32x4_t _phase4_imag = vld1q_f32(__phase4_imag); - //lv_32fc_t phase2 = (lv_32fc_t)(*phase) * phase_inc; - //lv_32fc_t phase3 = phase2 * phase_inc; - //lv_32fc_t phase4 = phase3 * phase_inc; +//lv_32fc_t phase2 = (lv_32fc_t)(*phase) * phase_inc; +//lv_32fc_t phase3 = phase2 * phase_inc; +//lv_32fc_t phase4 = phase3 * phase_inc; - //__VOLK_ATTR_ALIGNED(16) float32_t __phase_real[4] = { lv_creal((*phase)), lv_creal(phase2), lv_creal(phase3), lv_creal(phase4) }; - //__VOLK_ATTR_ALIGNED(16) float32_t __phase_imag[4] = { lv_cimag((*phase)), lv_cimag(phase2), lv_cimag(phase3), lv_cimag(phase4) }; +//__VOLK_ATTR_ALIGNED(16) float32_t __phase_real[4] = { lv_creal((*phase)), lv_creal(phase2), lv_creal(phase3), lv_creal(phase4) }; +//__VOLK_ATTR_ALIGNED(16) float32_t __phase_imag[4] = { lv_cimag((*phase)), lv_cimag(phase2), lv_cimag(phase3), lv_cimag(phase4) }; - //float32x4_t _phase_real = vld1q_f32(__phase_real); - //float32x4_t _phase_imag = vld1q_f32(__phase_imag); +//float32x4_t _phase_real = vld1q_f32(__phase_real); +//float32x4_t _phase_imag = vld1q_f32(__phase_imag); - //int16x4x2_t a_val, b_val, c_val; - //__VOLK_ATTR_ALIGNED(16) lv_16sc_t dotProductVector[4]; - //float32x4_t half = vdupq_n_f32(0.5f); - //int16x4x2_t tmp16; - //int32x4x2_t tmp32i; +//int16x4x2_t a_val, b_val, c_val; +//__VOLK_ATTR_ALIGNED(16) lv_16sc_t dotProductVector[4]; +//float32x4_t half = vdupq_n_f32(0.5f); +//int16x4x2_t tmp16; +//int32x4x2_t tmp32i; - //float32x4x2_t tmp32f, tmp32_real, tmp32_imag; - //float32x4_t sign, PlusHalf, Round; +//float32x4x2_t tmp32f, tmp32_real, tmp32_imag; +//float32x4_t sign, PlusHalf, Round; - //int16x4x2_t* accumulator = (int16x4x2_t*)volk_gnsssdr_malloc(num_a_vectors * sizeof(int16x4x2_t), volk_gnsssdr_get_alignment()); +//int16x4x2_t* accumulator = (int16x4x2_t*)volk_gnsssdr_malloc(num_a_vectors * sizeof(int16x4x2_t), volk_gnsssdr_get_alignment()); - //for(n_vec = 0; n_vec < num_a_vectors; n_vec++) - //{ - //accumulator[n_vec].val[0] = vdup_n_s16(0); - //accumulator[n_vec].val[1] = vdup_n_s16(0); - //} +//for(n_vec = 0; n_vec < num_a_vectors; n_vec++) +//{ +//accumulator[n_vec].val[0] = vdup_n_s16(0); +//accumulator[n_vec].val[1] = vdup_n_s16(0); +//} - //for(number = 0; number < neon_iters; number++) - //{ - //[> load 4 complex numbers (int 16 bits each component) <] - //tmp16 = vld2_s16((int16_t*)_in_common); - //__VOLK_GNSSSDR_PREFETCH(_in_common + 8); - //_in_common += 4; +//for(number = 0; number < neon_iters; number++) +//{ +//[> load 4 complex numbers (int 16 bits each component) <] +//tmp16 = vld2_s16((int16_t*)_in_common); +//__VOLK_GNSSSDR_PREFETCH(_in_common + 8); +//_in_common += 4; - //[> promote them to int 32 bits <] - //tmp32i.val[0] = vmovl_s16(tmp16.val[0]); - //tmp32i.val[1] = vmovl_s16(tmp16.val[1]); +//[> promote them to int 32 bits <] +//tmp32i.val[0] = vmovl_s16(tmp16.val[0]); +//tmp32i.val[1] = vmovl_s16(tmp16.val[1]); - //[> promote them to float 32 bits <] - //tmp32f.val[0] = vcvtq_f32_s32(tmp32i.val[0]); - //tmp32f.val[1] = vcvtq_f32_s32(tmp32i.val[1]); +//[> promote them to float 32 bits <] +//tmp32f.val[0] = vcvtq_f32_s32(tmp32i.val[0]); +//tmp32f.val[1] = vcvtq_f32_s32(tmp32i.val[1]); - //[> complex multiplication of four complex samples (float 32 bits each component) <] - //tmp32_real.val[0] = vmulq_f32(tmp32f.val[0], _phase_real); - //tmp32_real.val[1] = vmulq_f32(tmp32f.val[1], _phase_imag); - //tmp32_imag.val[0] = vmulq_f32(tmp32f.val[0], _phase_imag); - //tmp32_imag.val[1] = vmulq_f32(tmp32f.val[1], _phase_real); +//[> complex multiplication of four complex samples (float 32 bits each component) <] +//tmp32_real.val[0] = vmulq_f32(tmp32f.val[0], _phase_real); +//tmp32_real.val[1] = vmulq_f32(tmp32f.val[1], _phase_imag); +//tmp32_imag.val[0] = vmulq_f32(tmp32f.val[0], _phase_imag); +//tmp32_imag.val[1] = vmulq_f32(tmp32f.val[1], _phase_real); - //tmp32f.val[0] = vsubq_f32(tmp32_real.val[0], tmp32_real.val[1]); - //tmp32f.val[1] = vaddq_f32(tmp32_imag.val[0], tmp32_imag.val[1]); +//tmp32f.val[0] = vsubq_f32(tmp32_real.val[0], tmp32_real.val[1]); +//tmp32f.val[1] = vaddq_f32(tmp32_imag.val[0], tmp32_imag.val[1]); - //[> downcast results to int32 <] - //[> in __aarch64__ we can do that with vcvtaq_s32_f32(ret1); vcvtaq_s32_f32(ret2); <] - //sign = vcvtq_f32_u32((vshrq_n_u32(vreinterpretq_u32_f32(tmp32f.val[0]), 31))); - //PlusHalf = vaddq_f32(tmp32f.val[0], half); - //Round = vsubq_f32(PlusHalf, sign); - //tmp32i.val[0] = vcvtq_s32_f32(Round); +//[> downcast results to int32 <] +//[> in __aarch64__ we can do that with vcvtaq_s32_f32(ret1); vcvtaq_s32_f32(ret2); <] +//sign = vcvtq_f32_u32((vshrq_n_u32(vreinterpretq_u32_f32(tmp32f.val[0]), 31))); +//PlusHalf = vaddq_f32(tmp32f.val[0], half); +//Round = vsubq_f32(PlusHalf, sign); +//tmp32i.val[0] = vcvtq_s32_f32(Round); - //sign = vcvtq_f32_u32((vshrq_n_u32(vreinterpretq_u32_f32(tmp32f.val[1]), 31))); - //PlusHalf = vaddq_f32(tmp32f.val[1], half); - //Round = vsubq_f32(PlusHalf, sign); - //tmp32i.val[1] = vcvtq_s32_f32(Round); +//sign = vcvtq_f32_u32((vshrq_n_u32(vreinterpretq_u32_f32(tmp32f.val[1]), 31))); +//PlusHalf = vaddq_f32(tmp32f.val[1], half); +//Round = vsubq_f32(PlusHalf, sign); +//tmp32i.val[1] = vcvtq_s32_f32(Round); - //[> downcast results to int16 <] - //tmp16.val[0] = vqmovn_s32(tmp32i.val[0]); - //tmp16.val[1] = vqmovn_s32(tmp32i.val[1]); +//[> downcast results to int16 <] +//tmp16.val[0] = vqmovn_s32(tmp32i.val[0]); +//tmp16.val[1] = vqmovn_s32(tmp32i.val[1]); - //[> compute next four phases <] - //tmp32_real.val[0] = vmulq_f32(_phase_real, _phase4_real); - //tmp32_real.val[1] = vmulq_f32(_phase_imag, _phase4_imag); - //tmp32_imag.val[0] = vmulq_f32(_phase_real, _phase4_imag); - //tmp32_imag.val[1] = vmulq_f32(_phase_imag, _phase4_real); +//[> compute next four phases <] +//tmp32_real.val[0] = vmulq_f32(_phase_real, _phase4_real); +//tmp32_real.val[1] = vmulq_f32(_phase_imag, _phase4_imag); +//tmp32_imag.val[0] = vmulq_f32(_phase_real, _phase4_imag); +//tmp32_imag.val[1] = vmulq_f32(_phase_imag, _phase4_real); - //_phase_real = vsubq_f32(tmp32_real.val[0], tmp32_real.val[1]); - //_phase_imag = vaddq_f32(tmp32_imag.val[0], tmp32_imag.val[1]); +//_phase_real = vsubq_f32(tmp32_real.val[0], tmp32_real.val[1]); +//_phase_imag = vaddq_f32(tmp32_imag.val[0], tmp32_imag.val[1]); - //for (n_vec = 0; n_vec < num_a_vectors; n_vec++) - //{ - //a_val = vld2_s16((int16_t*)&(_in_a[n_vec][number*4])); //load (2 byte imag, 2 byte real) x 4 into 128 bits reg - ////__VOLK_GNSSSDR_PREFETCH(&_in_a[n_vec][number*4] + 8); +//for (n_vec = 0; n_vec < num_a_vectors; n_vec++) +//{ +//a_val = vld2_s16((int16_t*)&(_in_a[n_vec][number*4])); //load (2 byte imag, 2 byte real) x 4 into 128 bits reg +////__VOLK_GNSSSDR_PREFETCH(&_in_a[n_vec][number*4] + 8); - //// multiply the real*real and imag*imag to get real result - //// a0r*b0r|a1r*b1r|a2r*b2r|a3r*b3r - //b_val.val[0] = vmul_s16(a_val.val[0], tmp16.val[0]); - //// a0i*b0i|a1i*b1i|a2i*b2i|a3i*b3i - //b_val.val[1] = vmul_s16(a_val.val[1], tmp16.val[1]); - //c_val.val[0] = vqsub_s16(b_val.val[0], b_val.val[1]); +//// multiply the real*real and imag*imag to get real result +//// a0r*b0r|a1r*b1r|a2r*b2r|a3r*b3r +//b_val.val[0] = vmul_s16(a_val.val[0], tmp16.val[0]); +//// a0i*b0i|a1i*b1i|a2i*b2i|a3i*b3i +//b_val.val[1] = vmul_s16(a_val.val[1], tmp16.val[1]); +//c_val.val[0] = vqsub_s16(b_val.val[0], b_val.val[1]); - //// Multiply cross terms to get the imaginary result - //// a0r*b0i|a1r*b1i|a2r*b2i|a3r*b3i - //b_val.val[0] = vmul_s16(a_val.val[0], tmp16.val[1]); - //// a0i*b0r|a1i*b1r|a2i*b2r|a3i*b3r - //b_val.val[1] = vmul_s16(a_val.val[1], tmp16.val[0]); - //c_val.val[1] = vqadd_s16(b_val.val[0], b_val.val[1]); +//// Multiply cross terms to get the imaginary result +//// a0r*b0i|a1r*b1i|a2r*b2i|a3r*b3i +//b_val.val[0] = vmul_s16(a_val.val[0], tmp16.val[1]); +//// a0i*b0r|a1i*b1r|a2i*b2r|a3i*b3r +//b_val.val[1] = vmul_s16(a_val.val[1], tmp16.val[0]); +//c_val.val[1] = vqadd_s16(b_val.val[0], b_val.val[1]); - //accumulator[n_vec].val[0] = vqadd_s16(accumulator[n_vec].val[0], c_val.val[0]); - //accumulator[n_vec].val[1] = vqadd_s16(accumulator[n_vec].val[1], c_val.val[1]); - //} - //// Regenerate phase - //if ((number % 256) == 0) - //{ - //phase_est = arg_phase0 + (number + 1) * 4 * arg_phase_inc; +//accumulator[n_vec].val[0] = vqadd_s16(accumulator[n_vec].val[0], c_val.val[0]); +//accumulator[n_vec].val[1] = vqadd_s16(accumulator[n_vec].val[1], c_val.val[1]); +//} +//// Regenerate phase +//if ((number % 256) == 0) +//{ +//phase_est = arg_phase0 + (number + 1) * 4 * arg_phase_inc; - //*phase = lv_cmake(cos(phase_est), sin(phase_est)); - //phase2 = (lv_32fc_t)(*phase) * phase_inc; - //phase3 = phase2 * phase_inc; - //phase4 = phase3 * phase_inc; +//*phase = lv_cmake(cos(phase_est), sin(phase_est)); +//phase2 = (lv_32fc_t)(*phase) * phase_inc; +//phase3 = phase2 * phase_inc; +//phase4 = phase3 * phase_inc; - //__VOLK_ATTR_ALIGNED(16) float32_t ____phase_real[4] = { lv_creal((*phase)), lv_creal(phase2), lv_creal(phase3), lv_creal(phase4) }; - //__VOLK_ATTR_ALIGNED(16) float32_t ____phase_imag[4] = { lv_cimag((*phase)), lv_cimag(phase2), lv_cimag(phase3), lv_cimag(phase4) }; +//__VOLK_ATTR_ALIGNED(16) float32_t ____phase_real[4] = { lv_creal((*phase)), lv_creal(phase2), lv_creal(phase3), lv_creal(phase4) }; +//__VOLK_ATTR_ALIGNED(16) float32_t ____phase_imag[4] = { lv_cimag((*phase)), lv_cimag(phase2), lv_cimag(phase3), lv_cimag(phase4) }; - //_phase_real = vld1q_f32(____phase_real); - //_phase_imag = vld1q_f32(____phase_imag); - //} - //} +//_phase_real = vld1q_f32(____phase_real); +//_phase_imag = vld1q_f32(____phase_imag); +//} +//} - //for (n_vec = 0; n_vec < num_a_vectors; n_vec++) - //{ - //vst2_s16((int16_t*)dotProductVector, accumulator[n_vec]); // Store the results back into the dot product vector - //dotProduct = lv_cmake(0,0); - //for (i = 0; i < 4; ++i) - //{ - //dotProduct = lv_cmake(sat_adds16i(lv_creal(dotProduct), lv_creal(dotProductVector[i])), - //sat_adds16i(lv_cimag(dotProduct), lv_cimag(dotProductVector[i]))); - //} - //_out[n_vec] = dotProduct; - //} - //volk_gnsssdr_free(accumulator); - //vst1q_f32((float32_t*)__phase_real, _phase_real); - //vst1q_f32((float32_t*)__phase_imag, _phase_imag); +//for (n_vec = 0; n_vec < num_a_vectors; n_vec++) +//{ +//vst2_s16((int16_t*)dotProductVector, accumulator[n_vec]); // Store the results back into the dot product vector +//dotProduct = lv_cmake(0,0); +//for (i = 0; i < 4; ++i) +//{ +//dotProduct = lv_cmake(sat_adds16i(lv_creal(dotProduct), lv_creal(dotProductVector[i])), +//sat_adds16i(lv_cimag(dotProduct), lv_cimag(dotProductVector[i]))); +//} +//_out[n_vec] = dotProduct; +//} +//volk_gnsssdr_free(accumulator); +//vst1q_f32((float32_t*)__phase_real, _phase_real); +//vst1q_f32((float32_t*)__phase_imag, _phase_imag); - //(*phase) = lv_cmake((float32_t)__phase_real[0], (float32_t)__phase_imag[0]); - //} +//(*phase) = lv_cmake((float32_t)__phase_real[0], (float32_t)__phase_imag[0]); +//} - //for (n = neon_iters * 4; n < num_points; n++) - //{ - //tmp16_ = in_common[n]; //printf("neon phase %i: %f,%f\n", n,lv_creal(*phase),lv_cimag(*phase)); - //tmp32_ = lv_cmake((float32_t)lv_creal(tmp16_), (float32_t)lv_cimag(tmp16_)) * (*phase); - //tmp16_ = lv_cmake((int16_t)rintf(lv_creal(tmp32_)), (int16_t)rintf(lv_cimag(tmp32_))); - //(*phase) *= phase_inc; - //for (n_vec = 0; n_vec < num_a_vectors; n_vec++) - //{ - //tmp = tmp16_ * in_a[n_vec][n]; - //_out[n_vec] = lv_cmake(sat_adds16i(lv_creal(_out[n_vec]), lv_creal(tmp)), sat_adds16i(lv_cimag(_out[n_vec]), lv_cimag(tmp))); - //} - //} +//for (n = neon_iters * 4; n < num_points; n++) +//{ +//tmp16_ = in_common[n]; //printf("neon phase %i: %f,%f\n", n,lv_creal(*phase),lv_cimag(*phase)); +//tmp32_ = lv_cmake((float32_t)lv_creal(tmp16_), (float32_t)lv_cimag(tmp16_)) * (*phase); +//tmp16_ = lv_cmake((int16_t)rintf(lv_creal(tmp32_)), (int16_t)rintf(lv_cimag(tmp32_))); +//(*phase) *= phase_inc; +//for (n_vec = 0; n_vec < num_a_vectors; n_vec++) +//{ +//tmp = tmp16_ * in_a[n_vec][n]; +//_out[n_vec] = lv_cmake(sat_adds16i(lv_creal(_out[n_vec]), lv_creal(tmp)), sat_adds16i(lv_cimag(_out[n_vec]), lv_cimag(tmp))); +//} +//} //} //#endif [> LV_HAVE_NEON <] @@ -1229,186 +1237,186 @@ static inline void volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_u_avx2(lv_16sc //static inline void volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_neon_vma(lv_16sc_t* result, const lv_16sc_t* in_common, const lv_32fc_t phase_inc, lv_32fc_t* phase, const int16_t** in_a, int num_a_vectors, unsigned int num_points) //{ - //const unsigned int neon_iters = num_points / 4; +//const unsigned int neon_iters = num_points / 4; - //const int16_t** _in_a = in_a; - //const lv_16sc_t* _in_common = in_common; - //lv_16sc_t* _out = result; - //int n_vec; - //int i; - //unsigned int number; - //unsigned int n; - //lv_16sc_t tmp16_, tmp; - //lv_32fc_t tmp32_; +//const int16_t** _in_a = in_a; +//const lv_16sc_t* _in_common = in_common; +//lv_16sc_t* _out = result; +//int n_vec; +//int i; +//unsigned int number; +//unsigned int n; +//lv_16sc_t tmp16_, tmp; +//lv_32fc_t tmp32_; - //if (neon_iters > 0) - //{ - //lv_16sc_t dotProduct = lv_cmake(0,0); - //float arg_phase0 = cargf(*phase); - //float arg_phase_inc = cargf(phase_inc); - //float phase_est; - ////printf("arg phase0: %f", arg_phase0); - //lv_32fc_t ___phase4 = phase_inc * phase_inc * phase_inc * phase_inc; - //__VOLK_ATTR_ALIGNED(16) float32_t __phase4_real[4] = { lv_creal(___phase4), lv_creal(___phase4), lv_creal(___phase4), lv_creal(___phase4) }; - //__VOLK_ATTR_ALIGNED(16) float32_t __phase4_imag[4] = { lv_cimag(___phase4), lv_cimag(___phase4), lv_cimag(___phase4), lv_cimag(___phase4) }; +//if (neon_iters > 0) +//{ +//lv_16sc_t dotProduct = lv_cmake(0,0); +//float arg_phase0 = cargf(*phase); +//float arg_phase_inc = cargf(phase_inc); +//float phase_est; +////printf("arg phase0: %f", arg_phase0); +//lv_32fc_t ___phase4 = phase_inc * phase_inc * phase_inc * phase_inc; +//__VOLK_ATTR_ALIGNED(16) float32_t __phase4_real[4] = { lv_creal(___phase4), lv_creal(___phase4), lv_creal(___phase4), lv_creal(___phase4) }; +//__VOLK_ATTR_ALIGNED(16) float32_t __phase4_imag[4] = { lv_cimag(___phase4), lv_cimag(___phase4), lv_cimag(___phase4), lv_cimag(___phase4) }; - //float32x4_t _phase4_real = vld1q_f32(__phase4_real); - //float32x4_t _phase4_imag = vld1q_f32(__phase4_imag); +//float32x4_t _phase4_real = vld1q_f32(__phase4_real); +//float32x4_t _phase4_imag = vld1q_f32(__phase4_imag); - //lv_32fc_t phase2 = (lv_32fc_t)(*phase) * phase_inc; - //lv_32fc_t phase3 = phase2 * phase_inc; - //lv_32fc_t phase4 = phase3 * phase_inc; +//lv_32fc_t phase2 = (lv_32fc_t)(*phase) * phase_inc; +//lv_32fc_t phase3 = phase2 * phase_inc; +//lv_32fc_t phase4 = phase3 * phase_inc; - //__VOLK_ATTR_ALIGNED(16) float32_t __phase_real[4] = { lv_creal((*phase)), lv_creal(phase2), lv_creal(phase3), lv_creal(phase4) }; - //__VOLK_ATTR_ALIGNED(16) float32_t __phase_imag[4] = { lv_cimag((*phase)), lv_cimag(phase2), lv_cimag(phase3), lv_cimag(phase4) }; +//__VOLK_ATTR_ALIGNED(16) float32_t __phase_real[4] = { lv_creal((*phase)), lv_creal(phase2), lv_creal(phase3), lv_creal(phase4) }; +//__VOLK_ATTR_ALIGNED(16) float32_t __phase_imag[4] = { lv_cimag((*phase)), lv_cimag(phase2), lv_cimag(phase3), lv_cimag(phase4) }; - //float32x4_t _phase_real = vld1q_f32(__phase_real); - //float32x4_t _phase_imag = vld1q_f32(__phase_imag); +//float32x4_t _phase_real = vld1q_f32(__phase_real); +//float32x4_t _phase_imag = vld1q_f32(__phase_imag); - //int16x4x2_t a_val, b_val; - //__VOLK_ATTR_ALIGNED(16) lv_16sc_t dotProductVector[4]; - //float32x4_t half = vdupq_n_f32(0.5f); - //int16x4x2_t tmp16; - //int32x4x2_t tmp32i; +//int16x4x2_t a_val, b_val; +//__VOLK_ATTR_ALIGNED(16) lv_16sc_t dotProductVector[4]; +//float32x4_t half = vdupq_n_f32(0.5f); +//int16x4x2_t tmp16; +//int32x4x2_t tmp32i; - //float32x4x2_t tmp32f, tmp32_real, tmp32_imag; - //float32x4_t sign, PlusHalf, Round; +//float32x4x2_t tmp32f, tmp32_real, tmp32_imag; +//float32x4_t sign, PlusHalf, Round; - //int16x4x2_t* accumulator = (int16x4x2_t*)volk_gnsssdr_malloc(num_a_vectors * sizeof(int16x4x2_t), volk_gnsssdr_get_alignment()); +//int16x4x2_t* accumulator = (int16x4x2_t*)volk_gnsssdr_malloc(num_a_vectors * sizeof(int16x4x2_t), volk_gnsssdr_get_alignment()); - //for(n_vec = 0; n_vec < num_a_vectors; n_vec++) - //{ - //accumulator[n_vec].val[0] = vdup_n_s16(0); - //accumulator[n_vec].val[1] = vdup_n_s16(0); - //} +//for(n_vec = 0; n_vec < num_a_vectors; n_vec++) +//{ +//accumulator[n_vec].val[0] = vdup_n_s16(0); +//accumulator[n_vec].val[1] = vdup_n_s16(0); +//} - //for(number = 0; number < neon_iters; number++) - //{ - //[> load 4 complex numbers (int 16 bits each component) <] - //tmp16 = vld2_s16((int16_t*)_in_common); - //__VOLK_GNSSSDR_PREFETCH(_in_common + 8); - //_in_common += 4; +//for(number = 0; number < neon_iters; number++) +//{ +//[> load 4 complex numbers (int 16 bits each component) <] +//tmp16 = vld2_s16((int16_t*)_in_common); +//__VOLK_GNSSSDR_PREFETCH(_in_common + 8); +//_in_common += 4; - //[> promote them to int 32 bits <] - //tmp32i.val[0] = vmovl_s16(tmp16.val[0]); - //tmp32i.val[1] = vmovl_s16(tmp16.val[1]); +//[> promote them to int 32 bits <] +//tmp32i.val[0] = vmovl_s16(tmp16.val[0]); +//tmp32i.val[1] = vmovl_s16(tmp16.val[1]); - //[> promote them to float 32 bits <] - //tmp32f.val[0] = vcvtq_f32_s32(tmp32i.val[0]); - //tmp32f.val[1] = vcvtq_f32_s32(tmp32i.val[1]); +//[> promote them to float 32 bits <] +//tmp32f.val[0] = vcvtq_f32_s32(tmp32i.val[0]); +//tmp32f.val[1] = vcvtq_f32_s32(tmp32i.val[1]); - //[> complex multiplication of four complex samples (float 32 bits each component) <] - //tmp32_real.val[0] = vmulq_f32(tmp32f.val[0], _phase_real); - //tmp32_real.val[1] = vmulq_f32(tmp32f.val[1], _phase_imag); - //tmp32_imag.val[0] = vmulq_f32(tmp32f.val[0], _phase_imag); - //tmp32_imag.val[1] = vmulq_f32(tmp32f.val[1], _phase_real); +//[> complex multiplication of four complex samples (float 32 bits each component) <] +//tmp32_real.val[0] = vmulq_f32(tmp32f.val[0], _phase_real); +//tmp32_real.val[1] = vmulq_f32(tmp32f.val[1], _phase_imag); +//tmp32_imag.val[0] = vmulq_f32(tmp32f.val[0], _phase_imag); +//tmp32_imag.val[1] = vmulq_f32(tmp32f.val[1], _phase_real); - //tmp32f.val[0] = vsubq_f32(tmp32_real.val[0], tmp32_real.val[1]); - //tmp32f.val[1] = vaddq_f32(tmp32_imag.val[0], tmp32_imag.val[1]); +//tmp32f.val[0] = vsubq_f32(tmp32_real.val[0], tmp32_real.val[1]); +//tmp32f.val[1] = vaddq_f32(tmp32_imag.val[0], tmp32_imag.val[1]); - //[> downcast results to int32 <] - //[> in __aarch64__ we can do that with vcvtaq_s32_f32(ret1); vcvtaq_s32_f32(ret2); <] - //sign = vcvtq_f32_u32((vshrq_n_u32(vreinterpretq_u32_f32(tmp32f.val[0]), 31))); - //PlusHalf = vaddq_f32(tmp32f.val[0], half); - //Round = vsubq_f32(PlusHalf, sign); - //tmp32i.val[0] = vcvtq_s32_f32(Round); +//[> downcast results to int32 <] +//[> in __aarch64__ we can do that with vcvtaq_s32_f32(ret1); vcvtaq_s32_f32(ret2); <] +//sign = vcvtq_f32_u32((vshrq_n_u32(vreinterpretq_u32_f32(tmp32f.val[0]), 31))); +//PlusHalf = vaddq_f32(tmp32f.val[0], half); +//Round = vsubq_f32(PlusHalf, sign); +//tmp32i.val[0] = vcvtq_s32_f32(Round); - //sign = vcvtq_f32_u32((vshrq_n_u32(vreinterpretq_u32_f32(tmp32f.val[1]), 31))); - //PlusHalf = vaddq_f32(tmp32f.val[1], half); - //Round = vsubq_f32(PlusHalf, sign); - //tmp32i.val[1] = vcvtq_s32_f32(Round); +//sign = vcvtq_f32_u32((vshrq_n_u32(vreinterpretq_u32_f32(tmp32f.val[1]), 31))); +//PlusHalf = vaddq_f32(tmp32f.val[1], half); +//Round = vsubq_f32(PlusHalf, sign); +//tmp32i.val[1] = vcvtq_s32_f32(Round); - //[> downcast results to int16 <] - //tmp16.val[0] = vqmovn_s32(tmp32i.val[0]); - //tmp16.val[1] = vqmovn_s32(tmp32i.val[1]); +//[> downcast results to int16 <] +//tmp16.val[0] = vqmovn_s32(tmp32i.val[0]); +//tmp16.val[1] = vqmovn_s32(tmp32i.val[1]); - //[> compute next four phases <] - //tmp32_real.val[0] = vmulq_f32(_phase_real, _phase4_real); - //tmp32_real.val[1] = vmulq_f32(_phase_imag, _phase4_imag); - //tmp32_imag.val[0] = vmulq_f32(_phase_real, _phase4_imag); - //tmp32_imag.val[1] = vmulq_f32(_phase_imag, _phase4_real); +//[> compute next four phases <] +//tmp32_real.val[0] = vmulq_f32(_phase_real, _phase4_real); +//tmp32_real.val[1] = vmulq_f32(_phase_imag, _phase4_imag); +//tmp32_imag.val[0] = vmulq_f32(_phase_real, _phase4_imag); +//tmp32_imag.val[1] = vmulq_f32(_phase_imag, _phase4_real); - //_phase_real = vsubq_f32(tmp32_real.val[0], tmp32_real.val[1]); - //_phase_imag = vaddq_f32(tmp32_imag.val[0], tmp32_imag.val[1]); +//_phase_real = vsubq_f32(tmp32_real.val[0], tmp32_real.val[1]); +//_phase_imag = vaddq_f32(tmp32_imag.val[0], tmp32_imag.val[1]); - //// Regenerate phase - //if ((number % 256) == 0) - //{ - ////printf("computed phase: %f\n", cos(cargf(lv_cmake(_phase_real[0],_phase_imag[0])))); - //phase_est = arg_phase0 + (number + 1) * 4 * arg_phase_inc; - ////printf("Estimated phase: %f\n\n", cos(phase_est)); +//// Regenerate phase +//if ((number % 256) == 0) +//{ +////printf("computed phase: %f\n", cos(cargf(lv_cmake(_phase_real[0],_phase_imag[0])))); +//phase_est = arg_phase0 + (number + 1) * 4 * arg_phase_inc; +////printf("Estimated phase: %f\n\n", cos(phase_est)); - //*phase = lv_cmake(cos(phase_est), sin(phase_est)); - //phase2 = (lv_32fc_t)(*phase) * phase_inc; - //phase3 = phase2 * phase_inc; - //phase4 = phase3 * phase_inc; +//*phase = lv_cmake(cos(phase_est), sin(phase_est)); +//phase2 = (lv_32fc_t)(*phase) * phase_inc; +//phase3 = phase2 * phase_inc; +//phase4 = phase3 * phase_inc; - //__VOLK_ATTR_ALIGNED(16) float32_t ____phase_real[4] = { lv_creal((*phase)), lv_creal(phase2), lv_creal(phase3), lv_creal(phase4) }; - //__VOLK_ATTR_ALIGNED(16) float32_t ____phase_imag[4] = { lv_cimag((*phase)), lv_cimag(phase2), lv_cimag(phase3), lv_cimag(phase4) }; +//__VOLK_ATTR_ALIGNED(16) float32_t ____phase_real[4] = { lv_creal((*phase)), lv_creal(phase2), lv_creal(phase3), lv_creal(phase4) }; +//__VOLK_ATTR_ALIGNED(16) float32_t ____phase_imag[4] = { lv_cimag((*phase)), lv_cimag(phase2), lv_cimag(phase3), lv_cimag(phase4) }; - //_phase_real = vld1q_f32(____phase_real); - //_phase_imag = vld1q_f32(____phase_imag); +//_phase_real = vld1q_f32(____phase_real); +//_phase_imag = vld1q_f32(____phase_imag); - //// Round = vmulq_f32(_phase_real, _phase_real); - //// Round = vmlaq_f32(Round, _phase_imag, _phase_imag); - //// Round = vsqrtq_f32(Round);//printf("sqrt: %f \n", Round[0]); - ////Round = vrsqrteq_f32(Round);printf("1/sqtr: %f \n",Round[0]); - ////Round = vrecpeq_f32((Round); - //// _phase_real = vdivq_f32(_phase_real, Round); - //// _phase_imag = vdivq_f32(_phase_imag, Round); - ////_phase_real = vmulq_f32(_phase_real, Round); - ////_phase_imag = vmulq_f32(_phase_imag, Round); - ////printf("After %i: %f,%f, %f\n\n", number, _phase_real[0], _phase_imag[0], sqrt(_phase_real[0]*_phase_real[0]+_phase_imag[0]*_phase_imag[0])); +//// Round = vmulq_f32(_phase_real, _phase_real); +//// Round = vmlaq_f32(Round, _phase_imag, _phase_imag); +//// Round = vsqrtq_f32(Round);//printf("sqrt: %f \n", Round[0]); +////Round = vrsqrteq_f32(Round);printf("1/sqtr: %f \n",Round[0]); +////Round = vrecpeq_f32((Round); +//// _phase_real = vdivq_f32(_phase_real, Round); +//// _phase_imag = vdivq_f32(_phase_imag, Round); +////_phase_real = vmulq_f32(_phase_real, Round); +////_phase_imag = vmulq_f32(_phase_imag, Round); +////printf("After %i: %f,%f, %f\n\n", number, _phase_real[0], _phase_imag[0], sqrt(_phase_real[0]*_phase_real[0]+_phase_imag[0]*_phase_imag[0])); - //} +//} - //for (n_vec = 0; n_vec < num_a_vectors; n_vec++) - //{ - //a_val = vld2_s16((int16_t*)&(_in_a[n_vec][number*4])); +//for (n_vec = 0; n_vec < num_a_vectors; n_vec++) +//{ +//a_val = vld2_s16((int16_t*)&(_in_a[n_vec][number*4])); - //b_val.val[0] = vmul_s16(a_val.val[0], tmp16.val[0]); - //b_val.val[1] = vmul_s16(a_val.val[1], tmp16.val[0]); +//b_val.val[0] = vmul_s16(a_val.val[0], tmp16.val[0]); +//b_val.val[1] = vmul_s16(a_val.val[1], tmp16.val[0]); - //// use multiply accumulate/subtract to get result - //b_val.val[0] = vmls_s16(b_val.val[0], a_val.val[1], tmp16.val[1]); - //b_val.val[1] = vmla_s16(b_val.val[1], a_val.val[0], tmp16.val[1]); +//// use multiply accumulate/subtract to get result +//b_val.val[0] = vmls_s16(b_val.val[0], a_val.val[1], tmp16.val[1]); +//b_val.val[1] = vmla_s16(b_val.val[1], a_val.val[0], tmp16.val[1]); - //accumulator[n_vec].val[0] = vqadd_s16(accumulator[n_vec].val[0], b_val.val[0]); - //accumulator[n_vec].val[1] = vqadd_s16(accumulator[n_vec].val[1], b_val.val[1]); - //} - //} +//accumulator[n_vec].val[0] = vqadd_s16(accumulator[n_vec].val[0], b_val.val[0]); +//accumulator[n_vec].val[1] = vqadd_s16(accumulator[n_vec].val[1], b_val.val[1]); +//} +//} - //for (n_vec = 0; n_vec < num_a_vectors; n_vec++) - //{ - //vst2_s16((int16_t*)dotProductVector, accumulator[n_vec]); // Store the results back into the dot product vector - //dotProduct = lv_cmake(0,0); - //for (i = 0; i < 4; ++i) - //{ - //dotProduct = lv_cmake(sat_adds16i(lv_creal(dotProduct), lv_creal(dotProductVector[i])), - //sat_adds16i(lv_cimag(dotProduct), lv_cimag(dotProductVector[i]))); - //} - //_out[n_vec] = dotProduct; - //} - //volk_gnsssdr_free(accumulator); +//for (n_vec = 0; n_vec < num_a_vectors; n_vec++) +//{ +//vst2_s16((int16_t*)dotProductVector, accumulator[n_vec]); // Store the results back into the dot product vector +//dotProduct = lv_cmake(0,0); +//for (i = 0; i < 4; ++i) +//{ +//dotProduct = lv_cmake(sat_adds16i(lv_creal(dotProduct), lv_creal(dotProductVector[i])), +//sat_adds16i(lv_cimag(dotProduct), lv_cimag(dotProductVector[i]))); +//} +//_out[n_vec] = dotProduct; +//} +//volk_gnsssdr_free(accumulator); - //vst1q_f32((float32_t*)__phase_real, _phase_real); - //vst1q_f32((float32_t*)__phase_imag, _phase_imag); +//vst1q_f32((float32_t*)__phase_real, _phase_real); +//vst1q_f32((float32_t*)__phase_imag, _phase_imag); - //(*phase) = lv_cmake((float32_t)__phase_real[0], (float32_t)__phase_imag[0]); - //} +//(*phase) = lv_cmake((float32_t)__phase_real[0], (float32_t)__phase_imag[0]); +//} - //for (n = neon_iters * 4; n < num_points; n++) - //{ - //tmp16_ = in_common[n]; //printf("neon phase %i: %f,%f\n", n,lv_creal(*phase),lv_cimag(*phase)); - //tmp32_ = lv_cmake((float32_t)lv_creal(tmp16_), (float32_t)lv_cimag(tmp16_)) * (*phase); - //tmp16_ = lv_cmake((int16_t)rintf(lv_creal(tmp32_)), (int16_t)rintf(lv_cimag(tmp32_))); - //(*phase) *= phase_inc; - //for (n_vec = 0; n_vec < num_a_vectors; n_vec++) - //{ - //tmp = tmp16_ * in_a[n_vec][n]; - //_out[n_vec] = lv_cmake(sat_adds16i(lv_creal(_out[n_vec]), lv_creal(tmp)), sat_adds16i(lv_cimag(_out[n_vec]), lv_cimag(tmp))); - //} - //} +//for (n = neon_iters * 4; n < num_points; n++) +//{ +//tmp16_ = in_common[n]; //printf("neon phase %i: %f,%f\n", n,lv_creal(*phase),lv_cimag(*phase)); +//tmp32_ = lv_cmake((float32_t)lv_creal(tmp16_), (float32_t)lv_cimag(tmp16_)) * (*phase); +//tmp16_ = lv_cmake((int16_t)rintf(lv_creal(tmp32_)), (int16_t)rintf(lv_cimag(tmp32_))); +//(*phase) *= phase_inc; +//for (n_vec = 0; n_vec < num_a_vectors; n_vec++) +//{ +//tmp = tmp16_ * in_a[n_vec][n]; +//_out[n_vec] = lv_cmake(sat_adds16i(lv_creal(_out[n_vec]), lv_creal(tmp)), sat_adds16i(lv_cimag(_out[n_vec]), lv_cimag(tmp))); +//} +//} //} //#endif [> LV_HAVE_NEON <] @@ -1420,181 +1428,179 @@ static inline void volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_u_avx2(lv_16sc //static inline void volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_neon_optvma(lv_16sc_t* result, const lv_16sc_t* in_common, const lv_32fc_t phase_inc, lv_32fc_t* phase, const int16_t** in_a, int num_a_vectors, unsigned int num_points) //{ - //const unsigned int neon_iters = num_points / 4; +//const unsigned int neon_iters = num_points / 4; - //const int16_t** _in_a = in_a; - //const lv_16sc_t* _in_common = in_common; - //lv_16sc_t* _out = result; - //int n_vec; - //int i; - //unsigned int number; - //unsigned int n; - //lv_16sc_t tmp16_, tmp; - //lv_32fc_t tmp32_; +//const int16_t** _in_a = in_a; +//const lv_16sc_t* _in_common = in_common; +//lv_16sc_t* _out = result; +//int n_vec; +//int i; +//unsigned int number; +//unsigned int n; +//lv_16sc_t tmp16_, tmp; +//lv_32fc_t tmp32_; - //if (neon_iters > 0) - //{ - //lv_16sc_t dotProduct = lv_cmake(0,0); - //float arg_phase0 = cargf(*phase); - //float arg_phase_inc = cargf(phase_inc); - //float phase_est; +//if (neon_iters > 0) +//{ +//lv_16sc_t dotProduct = lv_cmake(0,0); +//float arg_phase0 = cargf(*phase); +//float arg_phase_inc = cargf(phase_inc); +//float phase_est; - //lv_32fc_t ___phase4 = phase_inc * phase_inc * phase_inc * phase_inc; - //__VOLK_ATTR_ALIGNED(16) float32_t __phase4_real[4] = { lv_creal(___phase4), lv_creal(___phase4), lv_creal(___phase4), lv_creal(___phase4) }; - //__VOLK_ATTR_ALIGNED(16) float32_t __phase4_imag[4] = { lv_cimag(___phase4), lv_cimag(___phase4), lv_cimag(___phase4), lv_cimag(___phase4) }; +//lv_32fc_t ___phase4 = phase_inc * phase_inc * phase_inc * phase_inc; +//__VOLK_ATTR_ALIGNED(16) float32_t __phase4_real[4] = { lv_creal(___phase4), lv_creal(___phase4), lv_creal(___phase4), lv_creal(___phase4) }; +//__VOLK_ATTR_ALIGNED(16) float32_t __phase4_imag[4] = { lv_cimag(___phase4), lv_cimag(___phase4), lv_cimag(___phase4), lv_cimag(___phase4) }; - //float32x4_t _phase4_real = vld1q_f32(__phase4_real); - //float32x4_t _phase4_imag = vld1q_f32(__phase4_imag); +//float32x4_t _phase4_real = vld1q_f32(__phase4_real); +//float32x4_t _phase4_imag = vld1q_f32(__phase4_imag); - //lv_32fc_t phase2 = (lv_32fc_t)(*phase) * phase_inc; - //lv_32fc_t phase3 = phase2 * phase_inc; - //lv_32fc_t phase4 = phase3 * phase_inc; +//lv_32fc_t phase2 = (lv_32fc_t)(*phase) * phase_inc; +//lv_32fc_t phase3 = phase2 * phase_inc; +//lv_32fc_t phase4 = phase3 * phase_inc; - //__VOLK_ATTR_ALIGNED(16) float32_t __phase_real[4] = { lv_creal((*phase)), lv_creal(phase2), lv_creal(phase3), lv_creal(phase4) }; - //__VOLK_ATTR_ALIGNED(16) float32_t __phase_imag[4] = { lv_cimag((*phase)), lv_cimag(phase2), lv_cimag(phase3), lv_cimag(phase4) }; +//__VOLK_ATTR_ALIGNED(16) float32_t __phase_real[4] = { lv_creal((*phase)), lv_creal(phase2), lv_creal(phase3), lv_creal(phase4) }; +//__VOLK_ATTR_ALIGNED(16) float32_t __phase_imag[4] = { lv_cimag((*phase)), lv_cimag(phase2), lv_cimag(phase3), lv_cimag(phase4) }; - //float32x4_t _phase_real = vld1q_f32(__phase_real); - //float32x4_t _phase_imag = vld1q_f32(__phase_imag); +//float32x4_t _phase_real = vld1q_f32(__phase_real); +//float32x4_t _phase_imag = vld1q_f32(__phase_imag); - //int16x4x2_t a_val, b_val; - //__VOLK_ATTR_ALIGNED(16) lv_16sc_t dotProductVector[4]; - //float32x4_t half = vdupq_n_f32(0.5f); - //int32x4x2_t tmp32i; +//int16x4x2_t a_val, b_val; +//__VOLK_ATTR_ALIGNED(16) lv_16sc_t dotProductVector[4]; +//float32x4_t half = vdupq_n_f32(0.5f); +//int32x4x2_t tmp32i; - //float32x4x2_t tmp32f, tmp32_real, tmp32_imag; - //float32x4_t sign, PlusHalf, Round; +//float32x4x2_t tmp32f, tmp32_real, tmp32_imag; +//float32x4_t sign, PlusHalf, Round; - //int16x4x2_t* accumulator1 = (int16x4x2_t*)volk_gnsssdr_malloc(num_a_vectors * sizeof(int16x4x2_t), volk_gnsssdr_get_alignment()); - //int16x4x2_t* accumulator2 = (int16x4x2_t*)volk_gnsssdr_malloc(num_a_vectors * sizeof(int16x4x2_t), volk_gnsssdr_get_alignment()); +//int16x4x2_t* accumulator1 = (int16x4x2_t*)volk_gnsssdr_malloc(num_a_vectors * sizeof(int16x4x2_t), volk_gnsssdr_get_alignment()); +//int16x4x2_t* accumulator2 = (int16x4x2_t*)volk_gnsssdr_malloc(num_a_vectors * sizeof(int16x4x2_t), volk_gnsssdr_get_alignment()); - //for(n_vec = 0; n_vec < num_a_vectors; n_vec++) - //{ - //accumulator1[n_vec].val[0] = vdup_n_s16(0); - //accumulator1[n_vec].val[1] = vdup_n_s16(0); - //accumulator2[n_vec].val[0] = vdup_n_s16(0); - //accumulator2[n_vec].val[1] = vdup_n_s16(0); - //} +//for(n_vec = 0; n_vec < num_a_vectors; n_vec++) +//{ +//accumulator1[n_vec].val[0] = vdup_n_s16(0); +//accumulator1[n_vec].val[1] = vdup_n_s16(0); +//accumulator2[n_vec].val[0] = vdup_n_s16(0); +//accumulator2[n_vec].val[1] = vdup_n_s16(0); +//} - //for(number = 0; number < neon_iters; number++) - //{ - //[> load 4 complex numbers (int 16 bits each component) <] - //b_val = vld2_s16((int16_t*)_in_common); - //__VOLK_GNSSSDR_PREFETCH(_in_common + 8); - //_in_common += 4; +//for(number = 0; number < neon_iters; number++) +//{ +//[> load 4 complex numbers (int 16 bits each component) <] +//b_val = vld2_s16((int16_t*)_in_common); +//__VOLK_GNSSSDR_PREFETCH(_in_common + 8); +//_in_common += 4; - //[> promote them to int 32 bits <] - //tmp32i.val[0] = vmovl_s16(b_val.val[0]); - //tmp32i.val[1] = vmovl_s16(b_val.val[1]); +//[> promote them to int 32 bits <] +//tmp32i.val[0] = vmovl_s16(b_val.val[0]); +//tmp32i.val[1] = vmovl_s16(b_val.val[1]); - //[> promote them to float 32 bits <] - //tmp32f.val[0] = vcvtq_f32_s32(tmp32i.val[0]); - //tmp32f.val[1] = vcvtq_f32_s32(tmp32i.val[1]); +//[> promote them to float 32 bits <] +//tmp32f.val[0] = vcvtq_f32_s32(tmp32i.val[0]); +//tmp32f.val[1] = vcvtq_f32_s32(tmp32i.val[1]); - //[> complex multiplication of four complex samples (float 32 bits each component) <] - //tmp32_real.val[0] = vmulq_f32(tmp32f.val[0], _phase_real); - //tmp32_real.val[1] = vmulq_f32(tmp32f.val[1], _phase_imag); - //tmp32_imag.val[0] = vmulq_f32(tmp32f.val[0], _phase_imag); - //tmp32_imag.val[1] = vmulq_f32(tmp32f.val[1], _phase_real); +//[> complex multiplication of four complex samples (float 32 bits each component) <] +//tmp32_real.val[0] = vmulq_f32(tmp32f.val[0], _phase_real); +//tmp32_real.val[1] = vmulq_f32(tmp32f.val[1], _phase_imag); +//tmp32_imag.val[0] = vmulq_f32(tmp32f.val[0], _phase_imag); +//tmp32_imag.val[1] = vmulq_f32(tmp32f.val[1], _phase_real); - //tmp32f.val[0] = vsubq_f32(tmp32_real.val[0], tmp32_real.val[1]); - //tmp32f.val[1] = vaddq_f32(tmp32_imag.val[0], tmp32_imag.val[1]); +//tmp32f.val[0] = vsubq_f32(tmp32_real.val[0], tmp32_real.val[1]); +//tmp32f.val[1] = vaddq_f32(tmp32_imag.val[0], tmp32_imag.val[1]); - //[> downcast results to int32 <] - //[> in __aarch64__ we can do that with vcvtaq_s32_f32(ret1); vcvtaq_s32_f32(ret2); <] - //sign = vcvtq_f32_u32((vshrq_n_u32(vreinterpretq_u32_f32(tmp32f.val[0]), 31))); - //PlusHalf = vaddq_f32(tmp32f.val[0], half); - //Round = vsubq_f32(PlusHalf, sign); - //tmp32i.val[0] = vcvtq_s32_f32(Round); +//[> downcast results to int32 <] +//[> in __aarch64__ we can do that with vcvtaq_s32_f32(ret1); vcvtaq_s32_f32(ret2); <] +//sign = vcvtq_f32_u32((vshrq_n_u32(vreinterpretq_u32_f32(tmp32f.val[0]), 31))); +//PlusHalf = vaddq_f32(tmp32f.val[0], half); +//Round = vsubq_f32(PlusHalf, sign); +//tmp32i.val[0] = vcvtq_s32_f32(Round); - //sign = vcvtq_f32_u32((vshrq_n_u32(vreinterpretq_u32_f32(tmp32f.val[1]), 31))); - //PlusHalf = vaddq_f32(tmp32f.val[1], half); - //Round = vsubq_f32(PlusHalf, sign); - //tmp32i.val[1] = vcvtq_s32_f32(Round); +//sign = vcvtq_f32_u32((vshrq_n_u32(vreinterpretq_u32_f32(tmp32f.val[1]), 31))); +//PlusHalf = vaddq_f32(tmp32f.val[1], half); +//Round = vsubq_f32(PlusHalf, sign); +//tmp32i.val[1] = vcvtq_s32_f32(Round); - //[> downcast results to int16 <] - //b_val.val[0] = vqmovn_s32(tmp32i.val[0]); - //b_val.val[1] = vqmovn_s32(tmp32i.val[1]); +//[> downcast results to int16 <] +//b_val.val[0] = vqmovn_s32(tmp32i.val[0]); +//b_val.val[1] = vqmovn_s32(tmp32i.val[1]); - //[> compute next four phases <] - //tmp32_real.val[0] = vmulq_f32(_phase_real, _phase4_real); - //tmp32_real.val[1] = vmulq_f32(_phase_imag, _phase4_imag); - //tmp32_imag.val[0] = vmulq_f32(_phase_real, _phase4_imag); - //tmp32_imag.val[1] = vmulq_f32(_phase_imag, _phase4_real); +//[> compute next four phases <] +//tmp32_real.val[0] = vmulq_f32(_phase_real, _phase4_real); +//tmp32_real.val[1] = vmulq_f32(_phase_imag, _phase4_imag); +//tmp32_imag.val[0] = vmulq_f32(_phase_real, _phase4_imag); +//tmp32_imag.val[1] = vmulq_f32(_phase_imag, _phase4_real); - //_phase_real = vsubq_f32(tmp32_real.val[0], tmp32_real.val[1]); - //_phase_imag = vaddq_f32(tmp32_imag.val[0], tmp32_imag.val[1]); +//_phase_real = vsubq_f32(tmp32_real.val[0], tmp32_real.val[1]); +//_phase_imag = vaddq_f32(tmp32_imag.val[0], tmp32_imag.val[1]); - //// Regenerate phase - //if ((number % 256) == 0) - //{ - ////printf("computed phase: %f\n", cos(cargf(lv_cmake(_phase_real[0],_phase_imag[0])))); - //phase_est = arg_phase0 + (number + 1) * 4 * arg_phase_inc; - ////printf("Estimated phase: %f\n\n", cos(phase_est)); +//// Regenerate phase +//if ((number % 256) == 0) +//{ +////printf("computed phase: %f\n", cos(cargf(lv_cmake(_phase_real[0],_phase_imag[0])))); +//phase_est = arg_phase0 + (number + 1) * 4 * arg_phase_inc; +////printf("Estimated phase: %f\n\n", cos(phase_est)); - //*phase = lv_cmake(cos(phase_est), sin(phase_est)); - //phase2 = (lv_32fc_t)(*phase) * phase_inc; - //phase3 = phase2 * phase_inc; - //phase4 = phase3 * phase_inc; +//*phase = lv_cmake(cos(phase_est), sin(phase_est)); +//phase2 = (lv_32fc_t)(*phase) * phase_inc; +//phase3 = phase2 * phase_inc; +//phase4 = phase3 * phase_inc; - //__VOLK_ATTR_ALIGNED(16) float32_t ____phase_real[4] = { lv_creal((*phase)), lv_creal(phase2), lv_creal(phase3), lv_creal(phase4) }; - //__VOLK_ATTR_ALIGNED(16) float32_t ____phase_imag[4] = { lv_cimag((*phase)), lv_cimag(phase2), lv_cimag(phase3), lv_cimag(phase4) }; +//__VOLK_ATTR_ALIGNED(16) float32_t ____phase_real[4] = { lv_creal((*phase)), lv_creal(phase2), lv_creal(phase3), lv_creal(phase4) }; +//__VOLK_ATTR_ALIGNED(16) float32_t ____phase_imag[4] = { lv_cimag((*phase)), lv_cimag(phase2), lv_cimag(phase3), lv_cimag(phase4) }; - //_phase_real = vld1q_f32(____phase_real); - //_phase_imag = vld1q_f32(____phase_imag); - //} +//_phase_real = vld1q_f32(____phase_real); +//_phase_imag = vld1q_f32(____phase_imag); +//} - //for (n_vec = 0; n_vec < num_a_vectors; n_vec++) - //{ - //a_val = vld2_s16((int16_t*)&(_in_a[n_vec][number*4])); +//for (n_vec = 0; n_vec < num_a_vectors; n_vec++) +//{ +//a_val = vld2_s16((int16_t*)&(_in_a[n_vec][number*4])); - //// use 2 accumulators to remove inter-instruction data dependencies - //accumulator1[n_vec].val[0] = vmla_s16(accumulator1[n_vec].val[0], a_val.val[0], b_val.val[0]); - //accumulator1[n_vec].val[1] = vmla_s16(accumulator1[n_vec].val[1], a_val.val[0], b_val.val[1]); - //accumulator2[n_vec].val[0] = vmls_s16(accumulator2[n_vec].val[0], a_val.val[1], b_val.val[1]); - //accumulator2[n_vec].val[1] = vmla_s16(accumulator2[n_vec].val[1], a_val.val[1], b_val.val[0]); - //} - //} - //for (n_vec = 0; n_vec < num_a_vectors; n_vec++) - //{ - //accumulator1[n_vec].val[0] = vqadd_s16(accumulator1[n_vec].val[0], accumulator2[n_vec].val[0]); - //accumulator1[n_vec].val[1] = vqadd_s16(accumulator1[n_vec].val[1], accumulator2[n_vec].val[1]); - //} - //for (n_vec = 0; n_vec < num_a_vectors; n_vec++) - //{ - //vst2_s16((int16_t*)dotProductVector, accumulator1[n_vec]); // Store the results back into the dot product vector - //dotProduct = lv_cmake(0,0); - //for (i = 0; i < 4; ++i) - //{ - //dotProduct = lv_cmake(sat_adds16i(lv_creal(dotProduct), lv_creal(dotProductVector[i])), - //sat_adds16i(lv_cimag(dotProduct), lv_cimag(dotProductVector[i]))); - //} - //_out[n_vec] = dotProduct; - //} - //volk_gnsssdr_free(accumulator1); - //volk_gnsssdr_free(accumulator2); +//// use 2 accumulators to remove inter-instruction data dependencies +//accumulator1[n_vec].val[0] = vmla_s16(accumulator1[n_vec].val[0], a_val.val[0], b_val.val[0]); +//accumulator1[n_vec].val[1] = vmla_s16(accumulator1[n_vec].val[1], a_val.val[0], b_val.val[1]); +//accumulator2[n_vec].val[0] = vmls_s16(accumulator2[n_vec].val[0], a_val.val[1], b_val.val[1]); +//accumulator2[n_vec].val[1] = vmla_s16(accumulator2[n_vec].val[1], a_val.val[1], b_val.val[0]); +//} +//} +//for (n_vec = 0; n_vec < num_a_vectors; n_vec++) +//{ +//accumulator1[n_vec].val[0] = vqadd_s16(accumulator1[n_vec].val[0], accumulator2[n_vec].val[0]); +//accumulator1[n_vec].val[1] = vqadd_s16(accumulator1[n_vec].val[1], accumulator2[n_vec].val[1]); +//} +//for (n_vec = 0; n_vec < num_a_vectors; n_vec++) +//{ +//vst2_s16((int16_t*)dotProductVector, accumulator1[n_vec]); // Store the results back into the dot product vector +//dotProduct = lv_cmake(0,0); +//for (i = 0; i < 4; ++i) +//{ +//dotProduct = lv_cmake(sat_adds16i(lv_creal(dotProduct), lv_creal(dotProductVector[i])), +//sat_adds16i(lv_cimag(dotProduct), lv_cimag(dotProductVector[i]))); +//} +//_out[n_vec] = dotProduct; +//} +//volk_gnsssdr_free(accumulator1); +//volk_gnsssdr_free(accumulator2); - //vst1q_f32((float32_t*)__phase_real, _phase_real); - //vst1q_f32((float32_t*)__phase_imag, _phase_imag); +//vst1q_f32((float32_t*)__phase_real, _phase_real); +//vst1q_f32((float32_t*)__phase_imag, _phase_imag); - //(*phase) = lv_cmake((float32_t)__phase_real[0], (float32_t)__phase_imag[0]); - //} +//(*phase) = lv_cmake((float32_t)__phase_real[0], (float32_t)__phase_imag[0]); +//} - //for (n = neon_iters * 4; n < num_points; n++) - //{ - //tmp16_ = in_common[n]; //printf("neon phase %i: %f,%f\n", n,lv_creal(*phase),lv_cimag(*phase)); - //tmp32_ = lv_cmake((float32_t)lv_creal(tmp16_), (float32_t)lv_cimag(tmp16_)) * (*phase); - //tmp16_ = lv_cmake((int16_t)rintf(lv_creal(tmp32_)), (int16_t)rintf(lv_cimag(tmp32_))); - //(*phase) *= phase_inc; - //for (n_vec = 0; n_vec < num_a_vectors; n_vec++) - //{ - //tmp = tmp16_ * in_a[n_vec][n]; - //_out[n_vec] = lv_cmake(sat_adds16i(lv_creal(_out[n_vec]), lv_creal(tmp)), sat_adds16i(lv_cimag(_out[n_vec]), lv_cimag(tmp))); - //} - //} +//for (n = neon_iters * 4; n < num_points; n++) +//{ +//tmp16_ = in_common[n]; //printf("neon phase %i: %f,%f\n", n,lv_creal(*phase),lv_cimag(*phase)); +//tmp32_ = lv_cmake((float32_t)lv_creal(tmp16_), (float32_t)lv_cimag(tmp16_)) * (*phase); +//tmp16_ = lv_cmake((int16_t)rintf(lv_creal(tmp32_)), (int16_t)rintf(lv_cimag(tmp32_))); +//(*phase) *= phase_inc; +//for (n_vec = 0; n_vec < num_a_vectors; n_vec++) +//{ +//tmp = tmp16_ * in_a[n_vec][n]; +//_out[n_vec] = lv_cmake(sat_adds16i(lv_creal(_out[n_vec]), lv_creal(tmp)), sat_adds16i(lv_cimag(_out[n_vec]), lv_cimag(tmp))); +//} +//} //} //#endif [> LV_HAVE_NEON <] #endif /*INCLUDED_volk_gnsssdr_16ic_16i_dot_prod_16ic_xn_H*/ - - diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_16i_rotator_dotprodxnpuppet_16ic.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_16i_rotator_dotprodxnpuppet_16ic.h index a666c0270..6880b8d11 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_16i_rotator_dotprodxnpuppet_16ic.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_16i_rotator_dotprodxnpuppet_16ic.h @@ -41,7 +41,7 @@ #include #ifdef LV_HAVE_GENERIC -static inline void volk_gnsssdr_16ic_16i_rotator_dotprodxnpuppet_16ic_generic(lv_16sc_t* result, const lv_16sc_t* local_code, const lv_16sc_t* in, unsigned int num_points) +static inline void volk_gnsssdr_16ic_16i_rotator_dotprodxnpuppet_16ic_generic(lv_16sc_t* result, const lv_16sc_t* local_code, const lv_16sc_t* in, unsigned int num_points) { // phases must be normalized. Phase rotator expects a complex exponential input! float rem_carrier_phase_in_rad = 0.345; @@ -53,14 +53,14 @@ static inline void volk_gnsssdr_16ic_16i_rotator_dotprodxnpuppet_16ic_generic(lv unsigned int n; int num_a_vectors = 3; int16_t** in_a = (int16_t**)volk_gnsssdr_malloc(sizeof(int16_t*) * num_a_vectors, volk_gnsssdr_get_alignment()); - for(n = 0; n < num_a_vectors; n++) + for (n = 0; n < num_a_vectors; n++) { in_a[n] = (int16_t*)volk_gnsssdr_malloc(sizeof(int16_t) * num_points, volk_gnsssdr_get_alignment()); memcpy((int16_t*)in_a[n], (int16_t*)in, sizeof(int16_t) * num_points); } - volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_generic(result, local_code, phase_inc[0], phase,(const int16_t**) in_a, num_a_vectors, num_points); + volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_generic(result, local_code, phase_inc[0], phase, (const int16_t**)in_a, num_a_vectors, num_points); - for(n = 0; n < num_a_vectors; n++) + for (n = 0; n < num_a_vectors; n++) { volk_gnsssdr_free(in_a[n]); } @@ -71,7 +71,7 @@ static inline void volk_gnsssdr_16ic_16i_rotator_dotprodxnpuppet_16ic_generic(lv #ifdef LV_HAVE_GENERIC -static inline void volk_gnsssdr_16ic_16i_rotator_dotprodxnpuppet_16ic_generic_reload(lv_16sc_t* result, const lv_16sc_t* local_code, const lv_16sc_t* in, unsigned int num_points) +static inline void volk_gnsssdr_16ic_16i_rotator_dotprodxnpuppet_16ic_generic_reload(lv_16sc_t* result, const lv_16sc_t* local_code, const lv_16sc_t* in, unsigned int num_points) { // phases must be normalized. Phase rotator expects a complex exponential input! float rem_carrier_phase_in_rad = 0.345; @@ -83,14 +83,14 @@ static inline void volk_gnsssdr_16ic_16i_rotator_dotprodxnpuppet_16ic_generic_re unsigned int n; int num_a_vectors = 3; int16_t** in_a = (int16_t**)volk_gnsssdr_malloc(sizeof(int16_t*) * num_a_vectors, volk_gnsssdr_get_alignment()); - for(n = 0; n < num_a_vectors; n++) + for (n = 0; n < num_a_vectors; n++) { in_a[n] = (int16_t*)volk_gnsssdr_malloc(sizeof(int16_t) * num_points, volk_gnsssdr_get_alignment()); memcpy((int16_t*)in_a[n], (int16_t*)in, sizeof(int16_t) * num_points); } - volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_generic_reload(result, local_code, phase_inc[0], phase,(const int16_t**) in_a, num_a_vectors, num_points); + volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_generic_reload(result, local_code, phase_inc[0], phase, (const int16_t**)in_a, num_a_vectors, num_points); - for(n = 0; n < num_a_vectors; n++) + for (n = 0; n < num_a_vectors; n++) { volk_gnsssdr_free(in_a[n]); } @@ -113,50 +113,50 @@ static inline void volk_gnsssdr_16ic_16i_rotator_dotprodxnpuppet_16ic_a_sse3(lv_ unsigned int n; int num_a_vectors = 3; int16_t** in_a = (int16_t**)volk_gnsssdr_malloc(sizeof(int16_t*) * num_a_vectors, volk_gnsssdr_get_alignment()); - for(n = 0; n < num_a_vectors; n++) + for (n = 0; n < num_a_vectors; n++) { in_a[n] = (int16_t*)volk_gnsssdr_malloc(sizeof(int16_t) * num_points, volk_gnsssdr_get_alignment()); memcpy((int16_t*)in_a[n], (int16_t*)in, sizeof(int16_t) * num_points); } - volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_a_sse3(result, local_code, phase_inc[0], phase, (const int16_t**) in_a, num_a_vectors, num_points); + volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_a_sse3(result, local_code, phase_inc[0], phase, (const int16_t**)in_a, num_a_vectors, num_points); - for(n = 0; n < num_a_vectors; n++) + for (n = 0; n < num_a_vectors; n++) { volk_gnsssdr_free(in_a[n]); } volk_gnsssdr_free(in_a); } -#endif // SSE3 +#endif // SSE3 //#ifdef LV_HAVE_SSE3 //static inline void volk_gnsssdr_16ic_16i_rotator_dotprodxnpuppet_16ic_a_sse3_reload(lv_16sc_t* result, const lv_16sc_t* local_code, const lv_16sc_t* in, unsigned int num_points) //{ - //// phases must be normalized. Phase rotator expects a complex exponential input! - //float rem_carrier_phase_in_rad = 0.345; - //float phase_step_rad = 0.1; - //lv_32fc_t phase[1]; - //phase[0] = lv_cmake(cos(rem_carrier_phase_in_rad), sin(rem_carrier_phase_in_rad)); - //lv_32fc_t phase_inc[1]; - //phase_inc[0] = lv_cmake(cos(phase_step_rad), sin(phase_step_rad)); - //unsigned int n; - //int num_a_vectors = 3; - //int16_t** in_a = (int16_t**)volk_gnsssdr_malloc(sizeof(int16_t*) * num_a_vectors, volk_gnsssdr_get_alignment()); - //for(n = 0; n < num_a_vectors; n++) - //{ - //in_a[n] = (int16_t*)volk_gnsssdr_malloc(sizeof(int16_t) * num_points, volk_gnsssdr_get_alignment()); - //memcpy((int16_t*)in_a[n], (int16_t*)in, sizeof(int16_t) * num_points); - //} +//// phases must be normalized. Phase rotator expects a complex exponential input! +//float rem_carrier_phase_in_rad = 0.345; +//float phase_step_rad = 0.1; +//lv_32fc_t phase[1]; +//phase[0] = lv_cmake(cos(rem_carrier_phase_in_rad), sin(rem_carrier_phase_in_rad)); +//lv_32fc_t phase_inc[1]; +//phase_inc[0] = lv_cmake(cos(phase_step_rad), sin(phase_step_rad)); +//unsigned int n; +//int num_a_vectors = 3; +//int16_t** in_a = (int16_t**)volk_gnsssdr_malloc(sizeof(int16_t*) * num_a_vectors, volk_gnsssdr_get_alignment()); +//for(n = 0; n < num_a_vectors; n++) +//{ +//in_a[n] = (int16_t*)volk_gnsssdr_malloc(sizeof(int16_t) * num_points, volk_gnsssdr_get_alignment()); +//memcpy((int16_t*)in_a[n], (int16_t*)in, sizeof(int16_t) * num_points); +//} - //volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_a_sse3_reload(result, local_code, phase_inc[0], phase, (const int16_t**) in_a, num_a_vectors, num_points); +//volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_a_sse3_reload(result, local_code, phase_inc[0], phase, (const int16_t**) in_a, num_a_vectors, num_points); - //for(n = 0; n < num_a_vectors; n++) - //{ - //volk_gnsssdr_free(in_a[n]); - //} - //volk_gnsssdr_free(in_a); +//for(n = 0; n < num_a_vectors; n++) +//{ +//volk_gnsssdr_free(in_a[n]); +//} +//volk_gnsssdr_free(in_a); //} //#endif // SSE3 @@ -175,22 +175,22 @@ static inline void volk_gnsssdr_16ic_16i_rotator_dotprodxnpuppet_16ic_u_sse3(lv_ unsigned int n; int num_a_vectors = 3; int16_t** in_a = (int16_t**)volk_gnsssdr_malloc(sizeof(int16_t*) * num_a_vectors, volk_gnsssdr_get_alignment()); - for(n = 0; n < num_a_vectors; n++) + for (n = 0; n < num_a_vectors; n++) { in_a[n] = (int16_t*)volk_gnsssdr_malloc(sizeof(int16_t) * num_points, volk_gnsssdr_get_alignment()); memcpy((int16_t*)in_a[n], (int16_t*)in, sizeof(int16_t) * num_points); } - volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_u_sse3(result, local_code, phase_inc[0], phase, (const int16_t**) in_a, num_a_vectors, num_points); + volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_u_sse3(result, local_code, phase_inc[0], phase, (const int16_t**)in_a, num_a_vectors, num_points); - for(n = 0; n < num_a_vectors; n++) + for (n = 0; n < num_a_vectors; n++) { volk_gnsssdr_free(in_a[n]); } volk_gnsssdr_free(in_a); } -#endif // SSE3 +#endif // SSE3 #ifdef LV_HAVE_AVX2 @@ -206,50 +206,50 @@ static inline void volk_gnsssdr_16ic_16i_rotator_dotprodxnpuppet_16ic_a_avx2(lv_ unsigned int n; int num_a_vectors = 3; int16_t** in_a = (int16_t**)volk_gnsssdr_malloc(sizeof(int16_t*) * num_a_vectors, volk_gnsssdr_get_alignment()); - for(n = 0; n < num_a_vectors; n++) + for (n = 0; n < num_a_vectors; n++) { in_a[n] = (int16_t*)volk_gnsssdr_malloc(sizeof(int16_t) * num_points, volk_gnsssdr_get_alignment()); memcpy((int16_t*)in_a[n], (int16_t*)in, sizeof(int16_t) * num_points); } - volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_a_avx2(result, local_code, phase_inc[0], phase, (const int16_t**) in_a, num_a_vectors, num_points); + volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_a_avx2(result, local_code, phase_inc[0], phase, (const int16_t**)in_a, num_a_vectors, num_points); - for(n = 0; n < num_a_vectors; n++) + for (n = 0; n < num_a_vectors; n++) { volk_gnsssdr_free(in_a[n]); } volk_gnsssdr_free(in_a); } -#endif // AVX2 +#endif // AVX2 //#ifdef LV_HAVE_AVX2 //static inline void volk_gnsssdr_16ic_16i_rotator_dotprodxnpuppet_16ic_a_avx2_reload(lv_16sc_t* result, const lv_16sc_t* local_code, const lv_16sc_t* in, unsigned int num_points) //{ - //// phases must be normalized. Phase rotator expects a complex exponential input! - //float rem_carrier_phase_in_rad = 0.345; - //float phase_step_rad = 0.1; - //lv_32fc_t phase[1]; - //phase[0] = lv_cmake(cos(rem_carrier_phase_in_rad), sin(rem_carrier_phase_in_rad)); - //lv_32fc_t phase_inc[1]; - //phase_inc[0] = lv_cmake(cos(phase_step_rad), sin(phase_step_rad)); - //unsigned int n; - //int num_a_vectors = 3; - //int16_t** in_a = (int16_t**)volk_gnsssdr_malloc(sizeof(int16_t*) * num_a_vectors, volk_gnsssdr_get_alignment()); - //for(n = 0; n < num_a_vectors; n++) - //{ - //in_a[n] = (int16_t*)volk_gnsssdr_malloc(sizeof(int16_t) * num_points, volk_gnsssdr_get_alignment()); - //memcpy((int16_t*)in_a[n], (int16_t*)in, sizeof(int16_t) * num_points); - //} +//// phases must be normalized. Phase rotator expects a complex exponential input! +//float rem_carrier_phase_in_rad = 0.345; +//float phase_step_rad = 0.1; +//lv_32fc_t phase[1]; +//phase[0] = lv_cmake(cos(rem_carrier_phase_in_rad), sin(rem_carrier_phase_in_rad)); +//lv_32fc_t phase_inc[1]; +//phase_inc[0] = lv_cmake(cos(phase_step_rad), sin(phase_step_rad)); +//unsigned int n; +//int num_a_vectors = 3; +//int16_t** in_a = (int16_t**)volk_gnsssdr_malloc(sizeof(int16_t*) * num_a_vectors, volk_gnsssdr_get_alignment()); +//for(n = 0; n < num_a_vectors; n++) +//{ +//in_a[n] = (int16_t*)volk_gnsssdr_malloc(sizeof(int16_t) * num_points, volk_gnsssdr_get_alignment()); +//memcpy((int16_t*)in_a[n], (int16_t*)in, sizeof(int16_t) * num_points); +//} - //volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_a_avx2_reload(result, local_code, phase_inc[0], phase, (const int16_t**) in_a, num_a_vectors, num_points); +//volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_a_avx2_reload(result, local_code, phase_inc[0], phase, (const int16_t**) in_a, num_a_vectors, num_points); - //for(n = 0; n < num_a_vectors; n++) - //{ - //volk_gnsssdr_free(in_a[n]); - //} - //volk_gnsssdr_free(in_a); +//for(n = 0; n < num_a_vectors; n++) +//{ +//volk_gnsssdr_free(in_a[n]); +//} +//volk_gnsssdr_free(in_a); //} //#endif // AVX2 @@ -268,50 +268,50 @@ static inline void volk_gnsssdr_16ic_16i_rotator_dotprodxnpuppet_16ic_u_avx2(lv_ unsigned int n; int num_a_vectors = 3; int16_t** in_a = (int16_t**)volk_gnsssdr_malloc(sizeof(int16_t*) * num_a_vectors, volk_gnsssdr_get_alignment()); - for(n = 0; n < num_a_vectors; n++) + for (n = 0; n < num_a_vectors; n++) { in_a[n] = (int16_t*)volk_gnsssdr_malloc(sizeof(int16_t) * num_points, volk_gnsssdr_get_alignment()); memcpy((int16_t*)in_a[n], (int16_t*)in, sizeof(int16_t) * num_points); } - volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_u_avx2(result, local_code, phase_inc[0], phase, (const int16_t**) in_a, num_a_vectors, num_points); + volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_u_avx2(result, local_code, phase_inc[0], phase, (const int16_t**)in_a, num_a_vectors, num_points); - for(n = 0; n < num_a_vectors; n++) + for (n = 0; n < num_a_vectors; n++) { volk_gnsssdr_free(in_a[n]); } volk_gnsssdr_free(in_a); } -#endif // AVX2 +#endif // AVX2 //#ifdef LV_HAVE_AVX2 //static inline void volk_gnsssdr_16ic_16i_rotator_dotprodxnpuppet_16ic_u_avx2_reload(lv_16sc_t* result, const lv_16sc_t* local_code, const lv_16sc_t* in, unsigned int num_points) //{ - //// phases must be normalized. Phase rotator expects a complex exponential input! - //float rem_carrier_phase_in_rad = 0.345; - //float phase_step_rad = 0.1; - //lv_32fc_t phase[1]; - //phase[0] = lv_cmake(cos(rem_carrier_phase_in_rad), sin(rem_carrier_phase_in_rad)); - //lv_32fc_t phase_inc[1]; - //phase_inc[0] = lv_cmake(cos(phase_step_rad), sin(phase_step_rad)); - //unsigned int n; - //int num_a_vectors = 3; - //int16_t** in_a = (int16_t**)volk_gnsssdr_malloc(sizeof(int16_t*) * num_a_vectors, volk_gnsssdr_get_alignment()); - //for(n = 0; n < num_a_vectors; n++) - //{ - //in_a[n] = (int16_t*)volk_gnsssdr_malloc(sizeof(int16_t) * num_points, volk_gnsssdr_get_alignment()); - //memcpy((int16_t*)in_a[n], (int16_t*)in, sizeof(int16_t) * num_points); - //} +//// phases must be normalized. Phase rotator expects a complex exponential input! +//float rem_carrier_phase_in_rad = 0.345; +//float phase_step_rad = 0.1; +//lv_32fc_t phase[1]; +//phase[0] = lv_cmake(cos(rem_carrier_phase_in_rad), sin(rem_carrier_phase_in_rad)); +//lv_32fc_t phase_inc[1]; +//phase_inc[0] = lv_cmake(cos(phase_step_rad), sin(phase_step_rad)); +//unsigned int n; +//int num_a_vectors = 3; +//int16_t** in_a = (int16_t**)volk_gnsssdr_malloc(sizeof(int16_t*) * num_a_vectors, volk_gnsssdr_get_alignment()); +//for(n = 0; n < num_a_vectors; n++) +//{ +//in_a[n] = (int16_t*)volk_gnsssdr_malloc(sizeof(int16_t) * num_points, volk_gnsssdr_get_alignment()); +//memcpy((int16_t*)in_a[n], (int16_t*)in, sizeof(int16_t) * num_points); +//} - //volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_a_avx2_reload(result, local_code, phase_inc[0], phase, (const int16_t**) in_a, num_a_vectors, num_points); +//volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_a_avx2_reload(result, local_code, phase_inc[0], phase, (const int16_t**) in_a, num_a_vectors, num_points); - //for(n = 0; n < num_a_vectors; n++) - //{ - //volk_gnsssdr_free(in_a[n]); - //} - //volk_gnsssdr_free(in_a); +//for(n = 0; n < num_a_vectors; n++) +//{ +//volk_gnsssdr_free(in_a[n]); +//} +//volk_gnsssdr_free(in_a); //} //#endif // AVX2 @@ -320,29 +320,29 @@ static inline void volk_gnsssdr_16ic_16i_rotator_dotprodxnpuppet_16ic_u_avx2(lv_ //#ifdef LV_HAVE_NEON //static inline void volk_gnsssdr_16ic_16i_rotator_dotprodxnpuppet_16ic_neon(lv_16sc_t* result, const lv_16sc_t* local_code, const lv_16sc_t* in, unsigned int num_points) //{ - //// phases must be normalized. Phase rotator expects a complex exponential input! - //float rem_carrier_phase_in_rad = 0.345; - //float phase_step_rad = 0.1; - //lv_32fc_t phase[1]; - //phase[0] = lv_cmake(cos(rem_carrier_phase_in_rad), sin(rem_carrier_phase_in_rad)); - //lv_32fc_t phase_inc[1]; - //phase_inc[0] = lv_cmake(cos(phase_step_rad), sin(phase_step_rad)); - //unsigned int n; - //int num_a_vectors = 3; - //int16_t** in_a = (int16_t**)volk_gnsssdr_malloc(sizeof(int16_t*) * num_a_vectors, volk_gnsssdr_get_alignment()); - //for(n = 0; n < num_a_vectors; n++) - //{ - //in_a[n] = (int16_t*)volk_gnsssdr_malloc(sizeof(int16_t) * num_points, volk_gnsssdr_get_alignment()); - //memcpy((int16_t*)in_a[n], (int16_t*)in, sizeof(int16_t) * num_points); - //} +//// phases must be normalized. Phase rotator expects a complex exponential input! +//float rem_carrier_phase_in_rad = 0.345; +//float phase_step_rad = 0.1; +//lv_32fc_t phase[1]; +//phase[0] = lv_cmake(cos(rem_carrier_phase_in_rad), sin(rem_carrier_phase_in_rad)); +//lv_32fc_t phase_inc[1]; +//phase_inc[0] = lv_cmake(cos(phase_step_rad), sin(phase_step_rad)); +//unsigned int n; +//int num_a_vectors = 3; +//int16_t** in_a = (int16_t**)volk_gnsssdr_malloc(sizeof(int16_t*) * num_a_vectors, volk_gnsssdr_get_alignment()); +//for(n = 0; n < num_a_vectors; n++) +//{ +//in_a[n] = (int16_t*)volk_gnsssdr_malloc(sizeof(int16_t) * num_points, volk_gnsssdr_get_alignment()); +//memcpy((int16_t*)in_a[n], (int16_t*)in, sizeof(int16_t) * num_points); +//} - //volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_neon(result, local_code, phase_inc[0], phase, (const int16_t**) in_a, num_a_vectors, num_points); +//volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_neon(result, local_code, phase_inc[0], phase, (const int16_t**) in_a, num_a_vectors, num_points); - //for(n = 0; n < num_a_vectors; n++) - //{ - //volk_gnsssdr_free(in_a[n]); - //} - //volk_gnsssdr_free(in_a); +//for(n = 0; n < num_a_vectors; n++) +//{ +//volk_gnsssdr_free(in_a[n]); +//} +//volk_gnsssdr_free(in_a); //} //#endif // NEON @@ -351,34 +351,31 @@ static inline void volk_gnsssdr_16ic_16i_rotator_dotprodxnpuppet_16ic_u_avx2(lv_ //#ifdef LV_HAVE_NEON //static inline void volk_gnsssdr_16ic_16i_rotator_dotprodxnpuppet_16ic_neon_vma(lv_16sc_t* result, const lv_16sc_t* local_code, const lv_16sc_t* in, unsigned int num_points) //{ - //// phases must be normalized. Phase rotator expects a complex exponential input! - //float rem_carrier_phase_in_rad = 0.345; - //float phase_step_rad = 0.1; - //lv_32fc_t phase[1]; - //phase[0] = lv_cmake(cos(rem_carrier_phase_in_rad), sin(rem_carrier_phase_in_rad)); - //lv_32fc_t phase_inc[1]; - //phase_inc[0] = lv_cmake(cos(phase_step_rad), sin(phase_step_rad)); - //unsigned int n; - //int num_a_vectors = 3; - //int16_t** in_a = (int16_t**)volk_gnsssdr_malloc(sizeof(int16_t*) * num_a_vectors, volk_gnsssdr_get_alignment()); - //for(n = 0; n < num_a_vectors; n++) - //{ - //in_a[n] = (int16_t*)volk_gnsssdr_malloc(sizeof(int16_t) * num_points, volk_gnsssdr_get_alignment()); - //memcpy((int16_t*)in_a[n], (int16_t*)in, sizeof(int16_t) * num_points); - //} +//// phases must be normalized. Phase rotator expects a complex exponential input! +//float rem_carrier_phase_in_rad = 0.345; +//float phase_step_rad = 0.1; +//lv_32fc_t phase[1]; +//phase[0] = lv_cmake(cos(rem_carrier_phase_in_rad), sin(rem_carrier_phase_in_rad)); +//lv_32fc_t phase_inc[1]; +//phase_inc[0] = lv_cmake(cos(phase_step_rad), sin(phase_step_rad)); +//unsigned int n; +//int num_a_vectors = 3; +//int16_t** in_a = (int16_t**)volk_gnsssdr_malloc(sizeof(int16_t*) * num_a_vectors, volk_gnsssdr_get_alignment()); +//for(n = 0; n < num_a_vectors; n++) +//{ +//in_a[n] = (int16_t*)volk_gnsssdr_malloc(sizeof(int16_t) * num_points, volk_gnsssdr_get_alignment()); +//memcpy((int16_t*)in_a[n], (int16_t*)in, sizeof(int16_t) * num_points); +//} - //volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_neon_vma(result, local_code, phase_inc[0], phase, (const int16_t**) in_a, num_a_vectors, num_points); +//volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_neon_vma(result, local_code, phase_inc[0], phase, (const int16_t**) in_a, num_a_vectors, num_points); - //for(n = 0; n < num_a_vectors; n++) - //{ - //volk_gnsssdr_free(in_a[n]); - //} - //volk_gnsssdr_free(in_a); +//for(n = 0; n < num_a_vectors; n++) +//{ +//volk_gnsssdr_free(in_a[n]); +//} +//volk_gnsssdr_free(in_a); //} //#endif // NEON #endif // INCLUDED_volk_gnsssdr_16ic_16i_rotator_dotprodxnpuppet_16ic_H - - - diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_conjugate_16ic.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_conjugate_16ic.h index 5aae17266..b294d5ca9 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_conjugate_16ic.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_conjugate_16ic.h @@ -68,7 +68,7 @@ static inline void volk_gnsssdr_16ic_conjugate_16ic_generic(lv_16sc_t* cVector, const lv_16sc_t* aPtr = aVector; unsigned int number; - for(number = 0; number < num_points; number++) + for (number = 0; number < num_points; number++) { *cPtr++ = lv_conj(*aPtr++); } @@ -231,4 +231,3 @@ static inline void volk_gnsssdr_16ic_conjugate_16ic_u_avx2(lv_16sc_t* cVector, c //#endif /* LV_HAVE_NEON */ #endif /* INCLUDED_volk_gnsssdr_16ic_conjugate_16ic_H */ - diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_convert_32fc.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_convert_32fc.h index fa9517b76..5d66452e0 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_convert_32fc.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_convert_32fc.h @@ -63,7 +63,7 @@ static inline void volk_gnsssdr_16ic_convert_32fc_generic(lv_32fc_t* outputVector, const lv_16sc_t* inputVector, unsigned int num_points) { unsigned int i; - for(i = 0; i < num_points; i++) + for (i = 0; i < num_points; i++) { outputVector[i] = lv_cmake((float)lv_creal(inputVector[i]), (float)lv_cimag(inputVector[i])); } @@ -82,9 +82,9 @@ static inline void volk_gnsssdr_16ic_convert_32fc_a_sse2(lv_32fc_t* outputVector lv_32fc_t* _out = outputVector; __m128 a; - for(i = 0; i < sse_iters; i++) + for (i = 0; i < sse_iters; i++) { - a = _mm_set_ps((float)(lv_cimag(_in[1])), (float)(lv_creal(_in[1])), (float)(lv_cimag(_in[0])), (float)(lv_creal(_in[0]))); // load (2 byte imag, 2 byte real) x 2 into 128 bits reg + a = _mm_set_ps((float)(lv_cimag(_in[1])), (float)(lv_creal(_in[1])), (float)(lv_cimag(_in[0])), (float)(lv_creal(_in[0]))); // load (2 byte imag, 2 byte real) x 2 into 128 bits reg _mm_store_ps((float*)_out, a); _in += 2; _out += 2; @@ -109,9 +109,9 @@ static inline void volk_gnsssdr_16ic_convert_32fc_u_sse2(lv_32fc_t* outputVector lv_32fc_t* _out = outputVector; __m128 a; - for(i = 0; i < sse_iters; i++) + for (i = 0; i < sse_iters; i++) { - a = _mm_set_ps((float)(lv_cimag(_in[1])), (float)(lv_creal(_in[1])), (float)(lv_cimag(_in[0])), (float)(lv_creal(_in[0]))); // //load (2 byte imag, 2 byte real) x 2 into 128 bits reg + a = _mm_set_ps((float)(lv_cimag(_in[1])), (float)(lv_creal(_in[1])), (float)(lv_cimag(_in[0])), (float)(lv_creal(_in[0]))); // //load (2 byte imag, 2 byte real) x 2 into 128 bits reg _mm_storeu_ps((float*)_out, a); _in += 2; _out += 2; @@ -136,15 +136,15 @@ static inline void volk_gnsssdr_16ic_convert_32fc_u_axv(lv_32fc_t* outputVector, lv_32fc_t* _out = outputVector; __m256 a; - for(i = 0; i < sse_iters; i++) + for (i = 0; i < sse_iters; i++) { - a = _mm256_set_ps((float)(lv_cimag(_in[3])), (float)(lv_creal(_in[3])), (float)(lv_cimag(_in[2])), (float)(lv_creal(_in[2])), (float)(lv_cimag(_in[1])), (float)(lv_creal(_in[1])), (float)(lv_cimag(_in[0])), (float)(lv_creal(_in[0]))); // //load (2 byte imag, 2 byte real) x 2 into 128 bits reg + a = _mm256_set_ps((float)(lv_cimag(_in[3])), (float)(lv_creal(_in[3])), (float)(lv_cimag(_in[2])), (float)(lv_creal(_in[2])), (float)(lv_cimag(_in[1])), (float)(lv_creal(_in[1])), (float)(lv_cimag(_in[0])), (float)(lv_creal(_in[0]))); // //load (2 byte imag, 2 byte real) x 2 into 128 bits reg _mm256_storeu_ps((float*)_out, a); _in += 4; _out += 4; } _mm256_zeroupper(); - for(i = 0; i < (num_points % 4); ++i) + for (i = 0; i < (num_points % 4); ++i) { *_out++ = lv_cmake((float)lv_creal(*_in), (float)lv_cimag(*_in)); _in++; @@ -163,15 +163,15 @@ static inline void volk_gnsssdr_16ic_convert_32fc_a_axv(lv_32fc_t* outputVector, lv_32fc_t* _out = outputVector; __m256 a; - for(i = 0; i < sse_iters; i++) + for (i = 0; i < sse_iters; i++) { - a = _mm256_set_ps((float)(lv_cimag(_in[3])), (float)(lv_creal(_in[3])), (float)(lv_cimag(_in[2])), (float)(lv_creal(_in[2])), (float)(lv_cimag(_in[1])), (float)(lv_creal(_in[1])), (float)(lv_cimag(_in[0])), (float)(lv_creal(_in[0]))); // //load (2 byte imag, 2 byte real) x 2 into 128 bits reg + a = _mm256_set_ps((float)(lv_cimag(_in[3])), (float)(lv_creal(_in[3])), (float)(lv_cimag(_in[2])), (float)(lv_creal(_in[2])), (float)(lv_cimag(_in[1])), (float)(lv_creal(_in[1])), (float)(lv_cimag(_in[0])), (float)(lv_creal(_in[0]))); // //load (2 byte imag, 2 byte real) x 2 into 128 bits reg _mm256_store_ps((float*)_out, a); _in += 4; _out += 4; } _mm256_zeroupper(); - for(i = 0; i < (num_points % 4); ++i) + for (i = 0; i < (num_points % 4); ++i) { *_out++ = lv_cmake((float)lv_creal(*_in), (float)lv_cimag(*_in)); _in++; @@ -194,7 +194,7 @@ static inline void volk_gnsssdr_16ic_convert_32fc_neon(lv_32fc_t* outputVector, int32x4_t a32x4; float32x4_t f32x4; - for(i = 0; i < sse_iters; i++) + for (i = 0; i < sse_iters; i++) { a16x4 = vld1_s16((const int16_t*)_in); __VOLK_GNSSSDR_PREFETCH(_in + 4); diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_resampler_fast_16ic.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_resampler_fast_16ic.h index 8f35d59b8..cca2efa0d 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_resampler_fast_16ic.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_resampler_fast_16ic.h @@ -78,7 +78,7 @@ static inline void volk_gnsssdr_16ic_resampler_fast_16ic_generic(lv_16sc_t* resu // resample code for current tap local_code_chip_index = round(code_phase_step_chips * (float)n + rem_code_phase_chips - 0.5f); if (local_code_chip_index < 0.0) local_code_chip_index += code_length_chips; - if (local_code_chip_index > (code_length_chips-1)) local_code_chip_index -= code_length_chips; + if (local_code_chip_index > (code_length_chips - 1)) local_code_chip_index -= code_length_chips; result[n] = local_code[local_code_chip_index]; } } @@ -89,61 +89,66 @@ static inline void volk_gnsssdr_16ic_resampler_fast_16ic_generic(lv_16sc_t* resu #ifdef LV_HAVE_SSE2 #include -static inline void volk_gnsssdr_16ic_resampler_fast_16ic_a_sse2(lv_16sc_t* result, const lv_16sc_t* local_code, float rem_code_phase_chips, float code_phase_step_chips, int code_length_chips, unsigned int num_output_samples)//, int* scratch_buffer, float* scratch_buffer_float) +static inline void volk_gnsssdr_16ic_resampler_fast_16ic_a_sse2(lv_16sc_t* result, const lv_16sc_t* local_code, float rem_code_phase_chips, float code_phase_step_chips, int code_length_chips, unsigned int num_output_samples) //, int* scratch_buffer, float* scratch_buffer_float) { - _MM_SET_ROUNDING_MODE (_MM_ROUND_NEAREST);//_MM_ROUND_NEAREST, _MM_ROUND_DOWN, _MM_ROUND_UP, _MM_ROUND_TOWARD_ZERO + _MM_SET_ROUNDING_MODE(_MM_ROUND_NEAREST); //_MM_ROUND_NEAREST, _MM_ROUND_DOWN, _MM_ROUND_UP, _MM_ROUND_TOWARD_ZERO unsigned int number; const unsigned int quarterPoints = num_output_samples / 4; lv_16sc_t* _result = result; - __VOLK_ATTR_ALIGNED(16) int local_code_chip_index[4]; + __VOLK_ATTR_ALIGNED(16) + int local_code_chip_index[4]; __m128 _rem_code_phase, _code_phase_step_chips; __m128i _code_length_chips, _code_length_chips_minus1; __m128 _code_phase_out, _code_phase_out_with_offset; rem_code_phase_chips = rem_code_phase_chips - 0.5f; - _rem_code_phase = _mm_load1_ps(&rem_code_phase_chips); //load float to all four float values in m128 register - _code_phase_step_chips = _mm_load1_ps(&code_phase_step_chips); //load float to all four float values in m128 register - __VOLK_ATTR_ALIGNED(16) int four_times_code_length_chips_minus1[4]; - four_times_code_length_chips_minus1[0] = code_length_chips-1; - four_times_code_length_chips_minus1[1] = code_length_chips-1; - four_times_code_length_chips_minus1[2] = code_length_chips-1; - four_times_code_length_chips_minus1[3] = code_length_chips-1; + _rem_code_phase = _mm_load1_ps(&rem_code_phase_chips); //load float to all four float values in m128 register + _code_phase_step_chips = _mm_load1_ps(&code_phase_step_chips); //load float to all four float values in m128 register + __VOLK_ATTR_ALIGNED(16) + int four_times_code_length_chips_minus1[4]; + four_times_code_length_chips_minus1[0] = code_length_chips - 1; + four_times_code_length_chips_minus1[1] = code_length_chips - 1; + four_times_code_length_chips_minus1[2] = code_length_chips - 1; + four_times_code_length_chips_minus1[3] = code_length_chips - 1; - __VOLK_ATTR_ALIGNED(16) int four_times_code_length_chips[4]; + __VOLK_ATTR_ALIGNED(16) + int four_times_code_length_chips[4]; four_times_code_length_chips[0] = code_length_chips; four_times_code_length_chips[1] = code_length_chips; four_times_code_length_chips[2] = code_length_chips; four_times_code_length_chips[3] = code_length_chips; - _code_length_chips = _mm_load_si128((__m128i*)&four_times_code_length_chips); //load float to all four float values in m128 register - _code_length_chips_minus1 = _mm_load_si128((__m128i*)&four_times_code_length_chips_minus1); //load float to all four float values in m128 register + _code_length_chips = _mm_load_si128((__m128i*)&four_times_code_length_chips); //load float to all four float values in m128 register + _code_length_chips_minus1 = _mm_load_si128((__m128i*)&four_times_code_length_chips_minus1); //load float to all four float values in m128 register __m128i negative_indexes, overflow_indexes, _code_phase_out_int, _code_phase_out_int_neg, _code_phase_out_int_over; __m128i zero = _mm_setzero_si128(); - __VOLK_ATTR_ALIGNED(16) float init_idx_float[4] = { 0.0f, 1.0f, 2.0f, 3.0f }; + __VOLK_ATTR_ALIGNED(16) + float init_idx_float[4] = {0.0f, 1.0f, 2.0f, 3.0f}; __m128 _4output_index = _mm_load_ps(init_idx_float); - __VOLK_ATTR_ALIGNED(16) float init_4constant_float[4] = { 4.0f, 4.0f, 4.0f, 4.0f }; + __VOLK_ATTR_ALIGNED(16) + float init_4constant_float[4] = {4.0f, 4.0f, 4.0f, 4.0f}; __m128 _4constant_float = _mm_load_ps(init_4constant_float); - for(number = 0; number < quarterPoints; number++) + for (number = 0; number < quarterPoints; number++) { - _code_phase_out = _mm_mul_ps(_code_phase_step_chips, _4output_index); //compute the code phase point with the phase step - _code_phase_out_with_offset = _mm_add_ps(_code_phase_out, _rem_code_phase); //add the phase offset - _code_phase_out_int = _mm_cvtps_epi32(_code_phase_out_with_offset); //convert to integer + _code_phase_out = _mm_mul_ps(_code_phase_step_chips, _4output_index); //compute the code phase point with the phase step + _code_phase_out_with_offset = _mm_add_ps(_code_phase_out, _rem_code_phase); //add the phase offset + _code_phase_out_int = _mm_cvtps_epi32(_code_phase_out_with_offset); //convert to integer - negative_indexes = _mm_cmplt_epi32(_code_phase_out_int, zero); //test for negative values - _code_phase_out_int_neg = _mm_add_epi32(_code_phase_out_int, _code_length_chips); //the negative values branch - _code_phase_out_int_neg = _mm_xor_si128(_code_phase_out_int, _mm_and_si128( negative_indexes, _mm_xor_si128( _code_phase_out_int_neg, _code_phase_out_int ))); + negative_indexes = _mm_cmplt_epi32(_code_phase_out_int, zero); //test for negative values + _code_phase_out_int_neg = _mm_add_epi32(_code_phase_out_int, _code_length_chips); //the negative values branch + _code_phase_out_int_neg = _mm_xor_si128(_code_phase_out_int, _mm_and_si128(negative_indexes, _mm_xor_si128(_code_phase_out_int_neg, _code_phase_out_int))); - overflow_indexes = _mm_cmpgt_epi32(_code_phase_out_int_neg, _code_length_chips_minus1); //test for overflow values - _code_phase_out_int_over = _mm_sub_epi32(_code_phase_out_int_neg, _code_length_chips); //the negative values branch - _code_phase_out_int_over = _mm_xor_si128(_code_phase_out_int_neg, _mm_and_si128( overflow_indexes, _mm_xor_si128( _code_phase_out_int_over, _code_phase_out_int_neg ))); + overflow_indexes = _mm_cmpgt_epi32(_code_phase_out_int_neg, _code_length_chips_minus1); //test for overflow values + _code_phase_out_int_over = _mm_sub_epi32(_code_phase_out_int_neg, _code_length_chips); //the negative values branch + _code_phase_out_int_over = _mm_xor_si128(_code_phase_out_int_neg, _mm_and_si128(overflow_indexes, _mm_xor_si128(_code_phase_out_int_over, _code_phase_out_int_neg))); - _mm_store_si128((__m128i*)local_code_chip_index, _code_phase_out_int_over); // Store the results back + _mm_store_si128((__m128i*)local_code_chip_index, _code_phase_out_int_over); // Store the results back //todo: optimize the local code lookup table with intrinsics, if possible *_result++ = local_code[local_code_chip_index[0]]; @@ -154,7 +159,7 @@ static inline void volk_gnsssdr_16ic_resampler_fast_16ic_a_sse2(lv_16sc_t* resul _4output_index = _mm_add_ps(_4output_index, _4constant_float); } - for(number = quarterPoints * 4; number < num_output_samples; number++) + for (number = quarterPoints * 4; number < num_output_samples; number++) { local_code_chip_index[0] = (int)(code_phase_step_chips * (float)number + rem_code_phase_chips + 0.5f); if (local_code_chip_index[0] < 0.0) local_code_chip_index[0] += code_length_chips - 1; @@ -169,61 +174,66 @@ static inline void volk_gnsssdr_16ic_resampler_fast_16ic_a_sse2(lv_16sc_t* resul #ifdef LV_HAVE_SSE2 #include -static inline void volk_gnsssdr_16ic_resampler_fast_16ic_u_sse2(lv_16sc_t* result, const lv_16sc_t* local_code, float rem_code_phase_chips, float code_phase_step_chips, int code_length_chips, unsigned int num_output_samples)//, int* scratch_buffer, float* scratch_buffer_float) +static inline void volk_gnsssdr_16ic_resampler_fast_16ic_u_sse2(lv_16sc_t* result, const lv_16sc_t* local_code, float rem_code_phase_chips, float code_phase_step_chips, int code_length_chips, unsigned int num_output_samples) //, int* scratch_buffer, float* scratch_buffer_float) { - _MM_SET_ROUNDING_MODE (_MM_ROUND_NEAREST);//_MM_ROUND_NEAREST, _MM_ROUND_DOWN, _MM_ROUND_UP, _MM_ROUND_TOWARD_ZERO + _MM_SET_ROUNDING_MODE(_MM_ROUND_NEAREST); //_MM_ROUND_NEAREST, _MM_ROUND_DOWN, _MM_ROUND_UP, _MM_ROUND_TOWARD_ZERO unsigned int number; const unsigned int quarterPoints = num_output_samples / 4; lv_16sc_t* _result = result; - __VOLK_ATTR_ALIGNED(16) int local_code_chip_index[4]; + __VOLK_ATTR_ALIGNED(16) + int local_code_chip_index[4]; __m128 _rem_code_phase, _code_phase_step_chips; __m128i _code_length_chips, _code_length_chips_minus1; __m128 _code_phase_out, _code_phase_out_with_offset; rem_code_phase_chips = rem_code_phase_chips - 0.5f; - _rem_code_phase = _mm_load1_ps(&rem_code_phase_chips); //load float to all four float values in m128 register - _code_phase_step_chips = _mm_load1_ps(&code_phase_step_chips); //load float to all four float values in m128 register - __VOLK_ATTR_ALIGNED(16) int four_times_code_length_chips_minus1[4]; - four_times_code_length_chips_minus1[0] = code_length_chips-1; - four_times_code_length_chips_minus1[1] = code_length_chips-1; - four_times_code_length_chips_minus1[2] = code_length_chips-1; - four_times_code_length_chips_minus1[3] = code_length_chips-1; + _rem_code_phase = _mm_load1_ps(&rem_code_phase_chips); //load float to all four float values in m128 register + _code_phase_step_chips = _mm_load1_ps(&code_phase_step_chips); //load float to all four float values in m128 register + __VOLK_ATTR_ALIGNED(16) + int four_times_code_length_chips_minus1[4]; + four_times_code_length_chips_minus1[0] = code_length_chips - 1; + four_times_code_length_chips_minus1[1] = code_length_chips - 1; + four_times_code_length_chips_minus1[2] = code_length_chips - 1; + four_times_code_length_chips_minus1[3] = code_length_chips - 1; - __VOLK_ATTR_ALIGNED(16) int four_times_code_length_chips[4]; + __VOLK_ATTR_ALIGNED(16) + int four_times_code_length_chips[4]; four_times_code_length_chips[0] = code_length_chips; four_times_code_length_chips[1] = code_length_chips; four_times_code_length_chips[2] = code_length_chips; four_times_code_length_chips[3] = code_length_chips; - _code_length_chips = _mm_loadu_si128((__m128i*)&four_times_code_length_chips); //load float to all four float values in m128 register - _code_length_chips_minus1 = _mm_loadu_si128((__m128i*)&four_times_code_length_chips_minus1); //load float to all four float values in m128 register + _code_length_chips = _mm_loadu_si128((__m128i*)&four_times_code_length_chips); //load float to all four float values in m128 register + _code_length_chips_minus1 = _mm_loadu_si128((__m128i*)&four_times_code_length_chips_minus1); //load float to all four float values in m128 register __m128i negative_indexes, overflow_indexes, _code_phase_out_int, _code_phase_out_int_neg, _code_phase_out_int_over; __m128i zero = _mm_setzero_si128(); - __VOLK_ATTR_ALIGNED(16) float init_idx_float[4] = { 0.0f, 1.0f, 2.0f, 3.0f }; + __VOLK_ATTR_ALIGNED(16) + float init_idx_float[4] = {0.0f, 1.0f, 2.0f, 3.0f}; __m128 _4output_index = _mm_loadu_ps(init_idx_float); - __VOLK_ATTR_ALIGNED(16) float init_4constant_float[4] = { 4.0f, 4.0f, 4.0f, 4.0f }; + __VOLK_ATTR_ALIGNED(16) + float init_4constant_float[4] = {4.0f, 4.0f, 4.0f, 4.0f}; __m128 _4constant_float = _mm_loadu_ps(init_4constant_float); - for(number = 0; number < quarterPoints; number++) + for (number = 0; number < quarterPoints; number++) { - _code_phase_out = _mm_mul_ps(_code_phase_step_chips, _4output_index); //compute the code phase point with the phase step - _code_phase_out_with_offset = _mm_add_ps(_code_phase_out, _rem_code_phase); //add the phase offset - _code_phase_out_int = _mm_cvtps_epi32(_code_phase_out_with_offset); //convert to integer + _code_phase_out = _mm_mul_ps(_code_phase_step_chips, _4output_index); //compute the code phase point with the phase step + _code_phase_out_with_offset = _mm_add_ps(_code_phase_out, _rem_code_phase); //add the phase offset + _code_phase_out_int = _mm_cvtps_epi32(_code_phase_out_with_offset); //convert to integer - negative_indexes = _mm_cmplt_epi32(_code_phase_out_int, zero); //test for negative values - _code_phase_out_int_neg = _mm_add_epi32(_code_phase_out_int, _code_length_chips); //the negative values branch - _code_phase_out_int_neg = _mm_xor_si128(_code_phase_out_int, _mm_and_si128( negative_indexes, _mm_xor_si128( _code_phase_out_int_neg, _code_phase_out_int ))); + negative_indexes = _mm_cmplt_epi32(_code_phase_out_int, zero); //test for negative values + _code_phase_out_int_neg = _mm_add_epi32(_code_phase_out_int, _code_length_chips); //the negative values branch + _code_phase_out_int_neg = _mm_xor_si128(_code_phase_out_int, _mm_and_si128(negative_indexes, _mm_xor_si128(_code_phase_out_int_neg, _code_phase_out_int))); - overflow_indexes = _mm_cmpgt_epi32(_code_phase_out_int_neg, _code_length_chips_minus1); //test for overflow values - _code_phase_out_int_over = _mm_sub_epi32(_code_phase_out_int_neg, _code_length_chips); //the negative values branch - _code_phase_out_int_over = _mm_xor_si128(_code_phase_out_int_neg, _mm_and_si128( overflow_indexes, _mm_xor_si128( _code_phase_out_int_over, _code_phase_out_int_neg ))); + overflow_indexes = _mm_cmpgt_epi32(_code_phase_out_int_neg, _code_length_chips_minus1); //test for overflow values + _code_phase_out_int_over = _mm_sub_epi32(_code_phase_out_int_neg, _code_length_chips); //the negative values branch + _code_phase_out_int_over = _mm_xor_si128(_code_phase_out_int_neg, _mm_and_si128(overflow_indexes, _mm_xor_si128(_code_phase_out_int_over, _code_phase_out_int_neg))); - _mm_storeu_si128((__m128i*)local_code_chip_index, _code_phase_out_int_over); // Store the results back + _mm_storeu_si128((__m128i*)local_code_chip_index, _code_phase_out_int_over); // Store the results back //todo: optimize the local code lookup table with intrinsics, if possible *_result++ = local_code[local_code_chip_index[0]]; @@ -234,7 +244,7 @@ static inline void volk_gnsssdr_16ic_resampler_fast_16ic_u_sse2(lv_16sc_t* resul _4output_index = _mm_add_ps(_4output_index, _4constant_float); } - for(number = quarterPoints * 4; number < num_output_samples; number++) + for (number = quarterPoints * 4; number < num_output_samples; number++) { local_code_chip_index[0] = (int)(code_phase_step_chips * (float)number + rem_code_phase_chips + 0.5f); if (local_code_chip_index[0] < 0.0) local_code_chip_index[0] += code_length_chips - 1; @@ -249,7 +259,7 @@ static inline void volk_gnsssdr_16ic_resampler_fast_16ic_u_sse2(lv_16sc_t* resul #ifdef LV_HAVE_NEON #include -static inline void volk_gnsssdr_16ic_resampler_fast_16ic_neon(lv_16sc_t* result, const lv_16sc_t* local_code, float rem_code_phase_chips, float code_phase_step_chips, int code_length_chips, unsigned int num_output_samples)//, int* scratch_buffer, float* scratch_buffer_float) +static inline void volk_gnsssdr_16ic_resampler_fast_16ic_neon(lv_16sc_t* result, const lv_16sc_t* local_code, float rem_code_phase_chips, float code_phase_step_chips, int code_length_chips, unsigned int num_output_samples) //, int* scratch_buffer, float* scratch_buffer_float) { unsigned int number; const unsigned int quarterPoints = num_output_samples / 4; @@ -257,57 +267,62 @@ static inline void volk_gnsssdr_16ic_resampler_fast_16ic_neon(lv_16sc_t* result, lv_16sc_t* _result = result; - __VOLK_ATTR_ALIGNED(16) int local_code_chip_index[4]; + __VOLK_ATTR_ALIGNED(16) + int local_code_chip_index[4]; float32x4_t _rem_code_phase, _code_phase_step_chips; int32x4_t _code_length_chips, _code_length_chips_minus1; float32x4_t _code_phase_out, _code_phase_out_with_offset; rem_code_phase_chips = rem_code_phase_chips - 0.5f; float32x4_t sign, PlusHalf, Round; - _rem_code_phase = vld1q_dup_f32(&rem_code_phase_chips); //load float to all four float values in m128 register - _code_phase_step_chips = vld1q_dup_f32(&code_phase_step_chips); //load float to all four float values in m128 register - __VOLK_ATTR_ALIGNED(16) int four_times_code_length_chips_minus1[4]; + _rem_code_phase = vld1q_dup_f32(&rem_code_phase_chips); //load float to all four float values in m128 register + _code_phase_step_chips = vld1q_dup_f32(&code_phase_step_chips); //load float to all four float values in m128 register + __VOLK_ATTR_ALIGNED(16) + int four_times_code_length_chips_minus1[4]; four_times_code_length_chips_minus1[0] = code_length_chips - 1; four_times_code_length_chips_minus1[1] = code_length_chips - 1; four_times_code_length_chips_minus1[2] = code_length_chips - 1; four_times_code_length_chips_minus1[3] = code_length_chips - 1; - __VOLK_ATTR_ALIGNED(16) int four_times_code_length_chips[4]; + __VOLK_ATTR_ALIGNED(16) + int four_times_code_length_chips[4]; four_times_code_length_chips[0] = code_length_chips; four_times_code_length_chips[1] = code_length_chips; four_times_code_length_chips[2] = code_length_chips; four_times_code_length_chips[3] = code_length_chips; - _code_length_chips = vld1q_s32((int32_t*)&four_times_code_length_chips); //load float to all four float values in m128 register - _code_length_chips_minus1 = vld1q_s32((int32_t*)&four_times_code_length_chips_minus1); //load float to all four float values in m128 register + _code_length_chips = vld1q_s32((int32_t*)&four_times_code_length_chips); //load float to all four float values in m128 register + _code_length_chips_minus1 = vld1q_s32((int32_t*)&four_times_code_length_chips_minus1); //load float to all four float values in m128 register - int32x4_t _code_phase_out_int, _code_phase_out_int_neg, _code_phase_out_int_over; + int32x4_t _code_phase_out_int, _code_phase_out_int_neg, _code_phase_out_int_over; uint32x4_t negative_indexes, overflow_indexes; int32x4_t zero = vmovq_n_s32(0); - __VOLK_ATTR_ALIGNED(16) float init_idx_float[4] = { 0.0f, 1.0f, 2.0f, 3.0f }; + __VOLK_ATTR_ALIGNED(16) + float init_idx_float[4] = {0.0f, 1.0f, 2.0f, 3.0f}; float32x4_t _4output_index = vld1q_f32(init_idx_float); - __VOLK_ATTR_ALIGNED(16) float init_4constant_float[4] = { 4.0f, 4.0f, 4.0f, 4.0f }; + __VOLK_ATTR_ALIGNED(16) + float init_4constant_float[4] = {4.0f, 4.0f, 4.0f, 4.0f}; float32x4_t _4constant_float = vld1q_f32(init_4constant_float); - for(number = 0; number < quarterPoints; number++) + for (number = 0; number < quarterPoints; number++) { - _code_phase_out = vmulq_f32(_code_phase_step_chips, _4output_index); //compute the code phase point with the phase step - _code_phase_out_with_offset = vaddq_f32(_code_phase_out, _rem_code_phase); //add the phase offset + _code_phase_out = vmulq_f32(_code_phase_step_chips, _4output_index); //compute the code phase point with the phase step + _code_phase_out_with_offset = vaddq_f32(_code_phase_out, _rem_code_phase); //add the phase offset sign = vcvtq_f32_u32((vshrq_n_u32(vreinterpretq_u32_f32(_code_phase_out_with_offset), 31))); PlusHalf = vaddq_f32(_code_phase_out_with_offset, half); Round = vsubq_f32(PlusHalf, sign); _code_phase_out_int = vcvtq_s32_f32(Round); - negative_indexes = vcltq_s32(_code_phase_out_int, zero); //test for negative values - _code_phase_out_int_neg = vaddq_s32(_code_phase_out_int, _code_length_chips); //the negative values branch - _code_phase_out_int_neg = veorq_s32(_code_phase_out_int, vandq_s32( (int32x4_t)negative_indexes, veorq_s32( _code_phase_out_int_neg, _code_phase_out_int ))); + negative_indexes = vcltq_s32(_code_phase_out_int, zero); //test for negative values + _code_phase_out_int_neg = vaddq_s32(_code_phase_out_int, _code_length_chips); //the negative values branch + _code_phase_out_int_neg = veorq_s32(_code_phase_out_int, vandq_s32((int32x4_t)negative_indexes, veorq_s32(_code_phase_out_int_neg, _code_phase_out_int))); - overflow_indexes = vcgtq_s32(_code_phase_out_int_neg, _code_length_chips_minus1); //test for overflow values - _code_phase_out_int_over = vsubq_s32(_code_phase_out_int_neg, _code_length_chips); //the negative values branch - _code_phase_out_int_over = veorq_s32(_code_phase_out_int_neg, vandq_s32( (int32x4_t)overflow_indexes, veorq_s32( _code_phase_out_int_over, _code_phase_out_int_neg ))); + overflow_indexes = vcgtq_s32(_code_phase_out_int_neg, _code_length_chips_minus1); //test for overflow values + _code_phase_out_int_over = vsubq_s32(_code_phase_out_int_neg, _code_length_chips); //the negative values branch + _code_phase_out_int_over = veorq_s32(_code_phase_out_int_neg, vandq_s32((int32x4_t)overflow_indexes, veorq_s32(_code_phase_out_int_over, _code_phase_out_int_neg))); - vst1q_s32((int32_t*)local_code_chip_index, _code_phase_out_int_over); // Store the results back + vst1q_s32((int32_t*)local_code_chip_index, _code_phase_out_int_over); // Store the results back //todo: optimize the local code lookup table with intrinsics, if possible *_result++ = local_code[local_code_chip_index[0]]; @@ -318,7 +333,7 @@ static inline void volk_gnsssdr_16ic_resampler_fast_16ic_neon(lv_16sc_t* result, _4output_index = vaddq_f32(_4output_index, _4constant_float); } - for(number = quarterPoints * 4; number < num_output_samples; number++) + for (number = quarterPoints * 4; number < num_output_samples; number++) { local_code_chip_index[0] = (int)(code_phase_step_chips * (float)number + rem_code_phase_chips + 0.5f); if (local_code_chip_index[0] < 0.0) local_code_chip_index[0] += code_length_chips - 1; diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_resamplerfastpuppet_16ic.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_resamplerfastpuppet_16ic.h index 0b67ce73c..038e70108 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_resamplerfastpuppet_16ic.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_resamplerfastpuppet_16ic.h @@ -44,7 +44,7 @@ static inline void volk_gnsssdr_16ic_resamplerfastpuppet_16ic_generic(lv_16sc_t* float rem_code_phase_chips = -0.123; float code_phase_step_chips = 0.1; int code_length_chips = 1023; - volk_gnsssdr_16ic_resampler_fast_16ic_generic(result, local_code, rem_code_phase_chips, code_phase_step_chips, code_length_chips, num_points); + volk_gnsssdr_16ic_resampler_fast_16ic_generic(result, local_code, rem_code_phase_chips, code_phase_step_chips, code_length_chips, num_points); } #endif /* LV_HAVE_GENERIC */ @@ -55,7 +55,7 @@ static inline void volk_gnsssdr_16ic_resamplerfastpuppet_16ic_a_sse2(lv_16sc_t* float rem_code_phase_chips = -0.123; float code_phase_step_chips = 0.1; int code_length_chips = 1023; - volk_gnsssdr_16ic_resampler_fast_16ic_a_sse2(result, local_code, rem_code_phase_chips, code_phase_step_chips, code_length_chips, num_points ); + volk_gnsssdr_16ic_resampler_fast_16ic_a_sse2(result, local_code, rem_code_phase_chips, code_phase_step_chips, code_length_chips, num_points); } #endif /* LV_HAVE_SSE2 */ @@ -67,7 +67,7 @@ static inline void volk_gnsssdr_16ic_resamplerfastpuppet_16ic_u_sse2(lv_16sc_t* float rem_code_phase_chips = -0.123; float code_phase_step_chips = 0.1; int code_length_chips = 1023; - volk_gnsssdr_16ic_resampler_fast_16ic_u_sse2(result, local_code, rem_code_phase_chips, code_phase_step_chips, code_length_chips, num_points ); + volk_gnsssdr_16ic_resampler_fast_16ic_u_sse2(result, local_code, rem_code_phase_chips, code_phase_step_chips, code_length_chips, num_points); } #endif /* LV_HAVE_SSE2 */ @@ -79,9 +79,9 @@ static inline void volk_gnsssdr_16ic_resamplerfastpuppet_16ic_neon(lv_16sc_t* re float rem_code_phase_chips = -0.123; float code_phase_step_chips = 0.1; int code_length_chips = 1023; - volk_gnsssdr_16ic_resampler_fast_16ic_neon(result, local_code, rem_code_phase_chips, code_phase_step_chips, code_length_chips, num_points ); + volk_gnsssdr_16ic_resampler_fast_16ic_neon(result, local_code, rem_code_phase_chips, code_phase_step_chips, code_length_chips, num_points); } #endif /* LV_HAVE_NEON */ -#endif // INCLUDED_volk_gnsssdr_16ic_resamplerfastpuppet_16ic_H +#endif // INCLUDED_volk_gnsssdr_16ic_resamplerfastpuppet_16ic_H diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_resamplerfastxnpuppet_16ic.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_resamplerfastxnpuppet_16ic.h index bc4c2faa8..934af8e88 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_resamplerfastxnpuppet_16ic.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_resamplerfastxnpuppet_16ic.h @@ -49,21 +49,21 @@ static inline void volk_gnsssdr_16ic_resamplerfastxnpuppet_16ic_generic(lv_16sc_ int num_out_vectors = 3; unsigned int n; float* rem_code_phase_chips = (float*)volk_gnsssdr_malloc(sizeof(float) * num_out_vectors, volk_gnsssdr_get_alignment()); - lv_16sc_t** result_aux = (lv_16sc_t**)volk_gnsssdr_malloc(sizeof(lv_16sc_t*) * num_out_vectors, volk_gnsssdr_get_alignment()); + lv_16sc_t** result_aux = (lv_16sc_t**)volk_gnsssdr_malloc(sizeof(lv_16sc_t*) * num_out_vectors, volk_gnsssdr_get_alignment()); - for(n = 0; n < num_out_vectors; n++) - { - rem_code_phase_chips[n] = -0.234; - result_aux[n] = (lv_16sc_t*)volk_gnsssdr_malloc(sizeof(lv_16sc_t) * num_points, volk_gnsssdr_get_alignment()); - } + for (n = 0; n < num_out_vectors; n++) + { + rem_code_phase_chips[n] = -0.234; + result_aux[n] = (lv_16sc_t*)volk_gnsssdr_malloc(sizeof(lv_16sc_t) * num_points, volk_gnsssdr_get_alignment()); + } volk_gnsssdr_16ic_xn_resampler_fast_16ic_xn_generic(result_aux, local_code, rem_code_phase_chips, code_phase_step_chips, code_length_chips, num_out_vectors, num_points); memcpy((lv_16sc_t*)result, (lv_16sc_t*)result_aux[0], sizeof(lv_16sc_t) * num_points); volk_gnsssdr_free(rem_code_phase_chips); - for(n = 0; n < num_out_vectors; n++) - { - volk_gnsssdr_free(result_aux[n]); - } + for (n = 0; n < num_out_vectors; n++) + { + volk_gnsssdr_free(result_aux[n]); + } volk_gnsssdr_free(result_aux); } @@ -77,22 +77,22 @@ static inline void volk_gnsssdr_16ic_resamplerfastxnpuppet_16ic_a_sse2(lv_16sc_t int code_length_chips = 2046; int num_out_vectors = 3; unsigned int n; - float * rem_code_phase_chips = (float*)volk_gnsssdr_malloc(sizeof(float) * num_out_vectors, volk_gnsssdr_get_alignment()); - lv_16sc_t** result_aux = (lv_16sc_t**)volk_gnsssdr_malloc(sizeof(lv_16sc_t*) * num_out_vectors, volk_gnsssdr_get_alignment()); + float* rem_code_phase_chips = (float*)volk_gnsssdr_malloc(sizeof(float) * num_out_vectors, volk_gnsssdr_get_alignment()); + lv_16sc_t** result_aux = (lv_16sc_t**)volk_gnsssdr_malloc(sizeof(lv_16sc_t*) * num_out_vectors, volk_gnsssdr_get_alignment()); - for(n = 0; n < num_out_vectors; n++) - { - rem_code_phase_chips[n] = -0.234; - result_aux[n] = (lv_16sc_t*)volk_gnsssdr_malloc(sizeof(lv_16sc_t) * num_points, volk_gnsssdr_get_alignment()); - } + for (n = 0; n < num_out_vectors; n++) + { + rem_code_phase_chips[n] = -0.234; + result_aux[n] = (lv_16sc_t*)volk_gnsssdr_malloc(sizeof(lv_16sc_t) * num_points, volk_gnsssdr_get_alignment()); + } volk_gnsssdr_16ic_xn_resampler_fast_16ic_xn_a_sse2(result_aux, local_code, rem_code_phase_chips, code_phase_step_chips, code_length_chips, num_out_vectors, num_points); memcpy(result, result_aux[0], sizeof(lv_16sc_t) * num_points); volk_gnsssdr_free(rem_code_phase_chips); - for(n = 0; n < num_out_vectors; n++) - { - volk_gnsssdr_free(result_aux[n]); - } + for (n = 0; n < num_out_vectors; n++) + { + volk_gnsssdr_free(result_aux[n]); + } volk_gnsssdr_free(result_aux); } @@ -106,22 +106,22 @@ static inline void volk_gnsssdr_16ic_resamplerfastxnpuppet_16ic_u_sse2(lv_16sc_t int code_length_chips = 2046; int num_out_vectors = 3; unsigned int n; - float * rem_code_phase_chips = (float*)volk_gnsssdr_malloc(sizeof(float) * num_out_vectors, volk_gnsssdr_get_alignment()); - lv_16sc_t** result_aux = (lv_16sc_t**)volk_gnsssdr_malloc(sizeof(lv_16sc_t*) * num_out_vectors, volk_gnsssdr_get_alignment()); + float* rem_code_phase_chips = (float*)volk_gnsssdr_malloc(sizeof(float) * num_out_vectors, volk_gnsssdr_get_alignment()); + lv_16sc_t** result_aux = (lv_16sc_t**)volk_gnsssdr_malloc(sizeof(lv_16sc_t*) * num_out_vectors, volk_gnsssdr_get_alignment()); - for(n = 0; n < num_out_vectors; n++) - { - rem_code_phase_chips[n] = -0.234; - result_aux[n] = (lv_16sc_t*)volk_gnsssdr_malloc(sizeof(lv_16sc_t) * num_points, volk_gnsssdr_get_alignment()); - } + for (n = 0; n < num_out_vectors; n++) + { + rem_code_phase_chips[n] = -0.234; + result_aux[n] = (lv_16sc_t*)volk_gnsssdr_malloc(sizeof(lv_16sc_t) * num_points, volk_gnsssdr_get_alignment()); + } volk_gnsssdr_16ic_xn_resampler_fast_16ic_xn_u_sse2(result_aux, local_code, rem_code_phase_chips, code_phase_step_chips, code_length_chips, num_out_vectors, num_points); memcpy(result, result_aux[0], sizeof(lv_16sc_t) * num_points); volk_gnsssdr_free(rem_code_phase_chips); - for(n = 0; n < num_out_vectors; n++) - { - volk_gnsssdr_free(result_aux[n]); - } + for (n = 0; n < num_out_vectors; n++) + { + volk_gnsssdr_free(result_aux[n]); + } volk_gnsssdr_free(result_aux); } @@ -135,26 +135,26 @@ static inline void volk_gnsssdr_16ic_resamplerfastxnpuppet_16ic_neon(lv_16sc_t* int code_length_chips = 2046; int num_out_vectors = 3; unsigned int n; - float * rem_code_phase_chips = (float*)volk_gnsssdr_malloc(sizeof(float) * num_out_vectors, volk_gnsssdr_get_alignment()); - lv_16sc_t** result_aux = (lv_16sc_t**)volk_gnsssdr_malloc(sizeof(lv_16sc_t*) * num_out_vectors, volk_gnsssdr_get_alignment()); + float* rem_code_phase_chips = (float*)volk_gnsssdr_malloc(sizeof(float) * num_out_vectors, volk_gnsssdr_get_alignment()); + lv_16sc_t** result_aux = (lv_16sc_t**)volk_gnsssdr_malloc(sizeof(lv_16sc_t*) * num_out_vectors, volk_gnsssdr_get_alignment()); - for(n = 0; n < num_out_vectors; n++) - { - rem_code_phase_chips[n] = -0.234; - result_aux[n] = (lv_16sc_t*)volk_gnsssdr_malloc(sizeof(lv_16sc_t) * num_points, volk_gnsssdr_get_alignment()); - } + for (n = 0; n < num_out_vectors; n++) + { + rem_code_phase_chips[n] = -0.234; + result_aux[n] = (lv_16sc_t*)volk_gnsssdr_malloc(sizeof(lv_16sc_t) * num_points, volk_gnsssdr_get_alignment()); + } volk_gnsssdr_16ic_xn_resampler_fast_16ic_xn_neon(result_aux, local_code, rem_code_phase_chips, code_phase_step_chips, code_length_chips, num_out_vectors, num_points); memcpy(result, result_aux[0], sizeof(lv_16sc_t) * num_points); volk_gnsssdr_free(rem_code_phase_chips); - for(n = 0; n < num_out_vectors; n++) - { - volk_gnsssdr_free(result_aux[n]); - } + for (n = 0; n < num_out_vectors; n++) + { + volk_gnsssdr_free(result_aux[n]); + } volk_gnsssdr_free(result_aux); } #endif -#endif // INCLUDED_volk_gnsssdr_16ic_resamplerpuppet_16ic_H +#endif // INCLUDED_volk_gnsssdr_16ic_resamplerpuppet_16ic_H diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_resamplerxnpuppet_16ic.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_resamplerxnpuppet_16ic.h index 85e6fcb08..4582d6961 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_resamplerxnpuppet_16ic.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_resamplerxnpuppet_16ic.h @@ -45,56 +45,56 @@ static inline void volk_gnsssdr_16ic_resamplerxnpuppet_16ic_generic(lv_16sc_t* result, const lv_16sc_t* local_code, unsigned int num_points) { int code_length_chips = 2046; - float code_phase_step_chips = ((float)(code_length_chips) + 0.1 )/( (float) num_points ); + float code_phase_step_chips = ((float)(code_length_chips) + 0.1) / ((float)num_points); int num_out_vectors = 3; unsigned int n; float rem_code_phase_chips = -0.234; - float shifts_chips[3] = { -0.1, 0.0, 0.1 }; - lv_16sc_t** result_aux = (lv_16sc_t**)volk_gnsssdr_malloc(sizeof(lv_16sc_t*) * num_out_vectors, volk_gnsssdr_get_alignment()); + float shifts_chips[3] = {-0.1, 0.0, 0.1}; + lv_16sc_t** result_aux = (lv_16sc_t**)volk_gnsssdr_malloc(sizeof(lv_16sc_t*) * num_out_vectors, volk_gnsssdr_get_alignment()); - for(n = 0; n < num_out_vectors; n++) - { - result_aux[n] = (lv_16sc_t*)volk_gnsssdr_malloc(sizeof(lv_16sc_t) * num_points, volk_gnsssdr_get_alignment()); - } + for (n = 0; n < num_out_vectors; n++) + { + result_aux[n] = (lv_16sc_t*)volk_gnsssdr_malloc(sizeof(lv_16sc_t) * num_points, volk_gnsssdr_get_alignment()); + } volk_gnsssdr_16ic_xn_resampler_16ic_xn_generic(result_aux, local_code, rem_code_phase_chips, code_phase_step_chips, shifts_chips, code_length_chips, num_out_vectors, num_points); memcpy((lv_16sc_t*)result, (lv_16sc_t*)result_aux[0], sizeof(lv_16sc_t) * num_points); - for(n = 0; n < num_out_vectors; n++) - { - volk_gnsssdr_free(result_aux[n]); - } + for (n = 0; n < num_out_vectors; n++) + { + volk_gnsssdr_free(result_aux[n]); + } volk_gnsssdr_free(result_aux); } #endif /* LV_HAVE_GENERIC */ - + #ifdef LV_HAVE_SSE3 static inline void volk_gnsssdr_16ic_resamplerxnpuppet_16ic_a_sse3(lv_16sc_t* result, const lv_16sc_t* local_code, unsigned int num_points) { int code_length_chips = 2046; - float code_phase_step_chips = ((float)(code_length_chips) + 0.1 )/( (float) num_points ); + float code_phase_step_chips = ((float)(code_length_chips) + 0.1) / ((float)num_points); int num_out_vectors = 3; float rem_code_phase_chips = -0.234; unsigned int n; - float shifts_chips[3] = { -0.1, 0.0, 0.1 }; - lv_16sc_t** result_aux = (lv_16sc_t**)volk_gnsssdr_malloc(sizeof(lv_16sc_t*) * num_out_vectors, volk_gnsssdr_get_alignment()); + float shifts_chips[3] = {-0.1, 0.0, 0.1}; + lv_16sc_t** result_aux = (lv_16sc_t**)volk_gnsssdr_malloc(sizeof(lv_16sc_t*) * num_out_vectors, volk_gnsssdr_get_alignment()); - for(n = 0; n < num_out_vectors; n++) - { - result_aux[n] = (lv_16sc_t*)volk_gnsssdr_malloc(sizeof(lv_16sc_t) * num_points, volk_gnsssdr_get_alignment()); - } + for (n = 0; n < num_out_vectors; n++) + { + result_aux[n] = (lv_16sc_t*)volk_gnsssdr_malloc(sizeof(lv_16sc_t) * num_points, volk_gnsssdr_get_alignment()); + } volk_gnsssdr_16ic_xn_resampler_16ic_xn_a_sse3(result_aux, local_code, rem_code_phase_chips, code_phase_step_chips, shifts_chips, code_length_chips, num_out_vectors, num_points); memcpy((lv_16sc_t*)result, (lv_16sc_t*)result_aux[0], sizeof(lv_16sc_t) * num_points); - for(n = 0; n < num_out_vectors; n++) - { - volk_gnsssdr_free(result_aux[n]); - } + for (n = 0; n < num_out_vectors; n++) + { + volk_gnsssdr_free(result_aux[n]); + } volk_gnsssdr_free(result_aux); } @@ -104,26 +104,26 @@ static inline void volk_gnsssdr_16ic_resamplerxnpuppet_16ic_a_sse3(lv_16sc_t* re static inline void volk_gnsssdr_16ic_resamplerxnpuppet_16ic_u_sse3(lv_16sc_t* result, const lv_16sc_t* local_code, unsigned int num_points) { int code_length_chips = 2046; - float code_phase_step_chips = ((float)(code_length_chips) + 0.1 )/( (float) num_points ); + float code_phase_step_chips = ((float)(code_length_chips) + 0.1) / ((float)num_points); int num_out_vectors = 3; float rem_code_phase_chips = -0.234; unsigned int n; - float shifts_chips[3] = { -0.1, 0.0, 0.1 }; - lv_16sc_t** result_aux = (lv_16sc_t**)volk_gnsssdr_malloc(sizeof(lv_16sc_t*) * num_out_vectors, volk_gnsssdr_get_alignment()); + float shifts_chips[3] = {-0.1, 0.0, 0.1}; + lv_16sc_t** result_aux = (lv_16sc_t**)volk_gnsssdr_malloc(sizeof(lv_16sc_t*) * num_out_vectors, volk_gnsssdr_get_alignment()); - for(n = 0; n < num_out_vectors; n++) - { - result_aux[n] = (lv_16sc_t*)volk_gnsssdr_malloc(sizeof(lv_16sc_t) * num_points, volk_gnsssdr_get_alignment()); - } + for (n = 0; n < num_out_vectors; n++) + { + result_aux[n] = (lv_16sc_t*)volk_gnsssdr_malloc(sizeof(lv_16sc_t) * num_points, volk_gnsssdr_get_alignment()); + } volk_gnsssdr_16ic_xn_resampler_16ic_xn_u_sse3(result_aux, local_code, rem_code_phase_chips, code_phase_step_chips, shifts_chips, code_length_chips, num_out_vectors, num_points); memcpy((lv_16sc_t*)result, (lv_16sc_t*)result_aux[0], sizeof(lv_16sc_t) * num_points); - for(n = 0; n < num_out_vectors; n++) - { - volk_gnsssdr_free(result_aux[n]); - } + for (n = 0; n < num_out_vectors; n++) + { + volk_gnsssdr_free(result_aux[n]); + } volk_gnsssdr_free(result_aux); } @@ -134,26 +134,26 @@ static inline void volk_gnsssdr_16ic_resamplerxnpuppet_16ic_u_sse3(lv_16sc_t* re static inline void volk_gnsssdr_16ic_resamplerxnpuppet_16ic_u_sse4_1(lv_16sc_t* result, const lv_16sc_t* local_code, unsigned int num_points) { int code_length_chips = 2046; - float code_phase_step_chips = ((float)(code_length_chips) + 0.1 )/( (float) num_points ); + float code_phase_step_chips = ((float)(code_length_chips) + 0.1) / ((float)num_points); int num_out_vectors = 3; float rem_code_phase_chips = -0.234; unsigned int n; - float shifts_chips[3] = { -0.1, 0.0, 0.1 }; - lv_16sc_t** result_aux = (lv_16sc_t**)volk_gnsssdr_malloc(sizeof(lv_16sc_t*) * num_out_vectors, volk_gnsssdr_get_alignment()); + float shifts_chips[3] = {-0.1, 0.0, 0.1}; + lv_16sc_t** result_aux = (lv_16sc_t**)volk_gnsssdr_malloc(sizeof(lv_16sc_t*) * num_out_vectors, volk_gnsssdr_get_alignment()); - for(n = 0; n < num_out_vectors; n++) - { - result_aux[n] = (lv_16sc_t*)volk_gnsssdr_malloc(sizeof(lv_16sc_t) * num_points, volk_gnsssdr_get_alignment()); - } + for (n = 0; n < num_out_vectors; n++) + { + result_aux[n] = (lv_16sc_t*)volk_gnsssdr_malloc(sizeof(lv_16sc_t) * num_points, volk_gnsssdr_get_alignment()); + } volk_gnsssdr_16ic_xn_resampler_16ic_xn_u_sse4_1(result_aux, local_code, rem_code_phase_chips, code_phase_step_chips, shifts_chips, code_length_chips, num_out_vectors, num_points); memcpy((lv_16sc_t*)result, (lv_16sc_t*)result_aux[0], sizeof(lv_16sc_t) * num_points); - for(n = 0; n < num_out_vectors; n++) - { - volk_gnsssdr_free(result_aux[n]); - } + for (n = 0; n < num_out_vectors; n++) + { + volk_gnsssdr_free(result_aux[n]); + } volk_gnsssdr_free(result_aux); } @@ -164,26 +164,26 @@ static inline void volk_gnsssdr_16ic_resamplerxnpuppet_16ic_u_sse4_1(lv_16sc_t* static inline void volk_gnsssdr_16ic_resamplerxnpuppet_16ic_a_sse4_1(lv_16sc_t* result, const lv_16sc_t* local_code, unsigned int num_points) { int code_length_chips = 2046; - float code_phase_step_chips = ((float)(code_length_chips) + 0.1 )/( (float) num_points ); + float code_phase_step_chips = ((float)(code_length_chips) + 0.1) / ((float)num_points); int num_out_vectors = 3; float rem_code_phase_chips = -0.234; unsigned int n; - float shifts_chips[3] = { -0.1, 0.0, 0.1 }; - lv_16sc_t** result_aux = (lv_16sc_t**)volk_gnsssdr_malloc(sizeof(lv_16sc_t*) * num_out_vectors, volk_gnsssdr_get_alignment()); + float shifts_chips[3] = {-0.1, 0.0, 0.1}; + lv_16sc_t** result_aux = (lv_16sc_t**)volk_gnsssdr_malloc(sizeof(lv_16sc_t*) * num_out_vectors, volk_gnsssdr_get_alignment()); - for(n = 0; n < num_out_vectors; n++) - { - result_aux[n] = (lv_16sc_t*)volk_gnsssdr_malloc(sizeof(lv_16sc_t) * num_points, volk_gnsssdr_get_alignment()); - } + for (n = 0; n < num_out_vectors; n++) + { + result_aux[n] = (lv_16sc_t*)volk_gnsssdr_malloc(sizeof(lv_16sc_t) * num_points, volk_gnsssdr_get_alignment()); + } volk_gnsssdr_16ic_xn_resampler_16ic_xn_a_sse4_1(result_aux, local_code, rem_code_phase_chips, code_phase_step_chips, shifts_chips, code_length_chips, num_out_vectors, num_points); memcpy((lv_16sc_t*)result, (lv_16sc_t*)result_aux[0], sizeof(lv_16sc_t) * num_points); - for(n = 0; n < num_out_vectors; n++) - { - volk_gnsssdr_free(result_aux[n]); - } + for (n = 0; n < num_out_vectors; n++) + { + volk_gnsssdr_free(result_aux[n]); + } volk_gnsssdr_free(result_aux); } @@ -194,26 +194,26 @@ static inline void volk_gnsssdr_16ic_resamplerxnpuppet_16ic_a_sse4_1(lv_16sc_t* static inline void volk_gnsssdr_16ic_resamplerxnpuppet_16ic_u_avx(lv_16sc_t* result, const lv_16sc_t* local_code, unsigned int num_points) { int code_length_chips = 2046; - float code_phase_step_chips = ((float)(code_length_chips) + 0.1 )/( (float) num_points ); + float code_phase_step_chips = ((float)(code_length_chips) + 0.1) / ((float)num_points); int num_out_vectors = 3; float rem_code_phase_chips = -0.234; unsigned int n; - float shifts_chips[3] = { -0.1, 0.0, 0.1 }; - lv_16sc_t** result_aux = (lv_16sc_t**)volk_gnsssdr_malloc(sizeof(lv_16sc_t*) * num_out_vectors, volk_gnsssdr_get_alignment()); + float shifts_chips[3] = {-0.1, 0.0, 0.1}; + lv_16sc_t** result_aux = (lv_16sc_t**)volk_gnsssdr_malloc(sizeof(lv_16sc_t*) * num_out_vectors, volk_gnsssdr_get_alignment()); - for(n = 0; n < num_out_vectors; n++) - { - result_aux[n] = (lv_16sc_t*)volk_gnsssdr_malloc(sizeof(lv_16sc_t) * num_points, volk_gnsssdr_get_alignment()); - } + for (n = 0; n < num_out_vectors; n++) + { + result_aux[n] = (lv_16sc_t*)volk_gnsssdr_malloc(sizeof(lv_16sc_t) * num_points, volk_gnsssdr_get_alignment()); + } volk_gnsssdr_16ic_xn_resampler_16ic_xn_u_avx(result_aux, local_code, rem_code_phase_chips, code_phase_step_chips, shifts_chips, code_length_chips, num_out_vectors, num_points); memcpy((lv_16sc_t*)result, (lv_16sc_t*)result_aux[0], sizeof(lv_16sc_t) * num_points); - for(n = 0; n < num_out_vectors; n++) - { - volk_gnsssdr_free(result_aux[n]); - } + for (n = 0; n < num_out_vectors; n++) + { + volk_gnsssdr_free(result_aux[n]); + } volk_gnsssdr_free(result_aux); } @@ -224,26 +224,26 @@ static inline void volk_gnsssdr_16ic_resamplerxnpuppet_16ic_u_avx(lv_16sc_t* res static inline void volk_gnsssdr_16ic_resamplerxnpuppet_16ic_a_avx(lv_16sc_t* result, const lv_16sc_t* local_code, unsigned int num_points) { int code_length_chips = 2046; - float code_phase_step_chips = ((float)(code_length_chips) + 0.1 )/( (float) num_points ); + float code_phase_step_chips = ((float)(code_length_chips) + 0.1) / ((float)num_points); int num_out_vectors = 3; float rem_code_phase_chips = -0.234; unsigned int n; - float shifts_chips[3] = { -0.1, 0.0, 0.1 }; - lv_16sc_t** result_aux = (lv_16sc_t**)volk_gnsssdr_malloc(sizeof(lv_16sc_t*) * num_out_vectors, volk_gnsssdr_get_alignment()); + float shifts_chips[3] = {-0.1, 0.0, 0.1}; + lv_16sc_t** result_aux = (lv_16sc_t**)volk_gnsssdr_malloc(sizeof(lv_16sc_t*) * num_out_vectors, volk_gnsssdr_get_alignment()); - for(n = 0; n < num_out_vectors; n++) - { - result_aux[n] = (lv_16sc_t*)volk_gnsssdr_malloc(sizeof(lv_16sc_t) * num_points, volk_gnsssdr_get_alignment()); - } + for (n = 0; n < num_out_vectors; n++) + { + result_aux[n] = (lv_16sc_t*)volk_gnsssdr_malloc(sizeof(lv_16sc_t) * num_points, volk_gnsssdr_get_alignment()); + } volk_gnsssdr_16ic_xn_resampler_16ic_xn_a_avx(result_aux, local_code, rem_code_phase_chips, code_phase_step_chips, shifts_chips, code_length_chips, num_out_vectors, num_points); memcpy((lv_16sc_t*)result, (lv_16sc_t*)result_aux[0], sizeof(lv_16sc_t) * num_points); - for(n = 0; n < num_out_vectors; n++) - { - volk_gnsssdr_free(result_aux[n]); - } + for (n = 0; n < num_out_vectors; n++) + { + volk_gnsssdr_free(result_aux[n]); + } volk_gnsssdr_free(result_aux); } @@ -254,29 +254,29 @@ static inline void volk_gnsssdr_16ic_resamplerxnpuppet_16ic_a_avx(lv_16sc_t* res static inline void volk_gnsssdr_16ic_resamplerxnpuppet_16ic_neon(lv_16sc_t* result, const lv_16sc_t* local_code, unsigned int num_points) { int code_length_chips = 2046; - float code_phase_step_chips = ((float)(code_length_chips) + 0.1 )/( (float) num_points ); + float code_phase_step_chips = ((float)(code_length_chips) + 0.1) / ((float)num_points); int num_out_vectors = 3; float rem_code_phase_chips = -0.234; unsigned int n; - float shifts_chips[3] = { -0.1, 0.0, 0.1 }; - lv_16sc_t** result_aux = (lv_16sc_t**)volk_gnsssdr_malloc(sizeof(lv_16sc_t*) * num_out_vectors, volk_gnsssdr_get_alignment()); + float shifts_chips[3] = {-0.1, 0.0, 0.1}; + lv_16sc_t** result_aux = (lv_16sc_t**)volk_gnsssdr_malloc(sizeof(lv_16sc_t*) * num_out_vectors, volk_gnsssdr_get_alignment()); - for(n = 0; n < num_out_vectors; n++) - { - result_aux[n] = (lv_16sc_t*)volk_gnsssdr_malloc(sizeof(lv_16sc_t) * num_points, volk_gnsssdr_get_alignment()); - } + for (n = 0; n < num_out_vectors; n++) + { + result_aux[n] = (lv_16sc_t*)volk_gnsssdr_malloc(sizeof(lv_16sc_t) * num_points, volk_gnsssdr_get_alignment()); + } volk_gnsssdr_16ic_xn_resampler_16ic_xn_neon(result_aux, local_code, rem_code_phase_chips, code_phase_step_chips, shifts_chips, code_length_chips, num_out_vectors, num_points); memcpy((lv_16sc_t*)result, (lv_16sc_t*)result_aux[0], sizeof(lv_16sc_t) * num_points); - for(n = 0; n < num_out_vectors; n++) - { - volk_gnsssdr_free(result_aux[n]); - } + for (n = 0; n < num_out_vectors; n++) + { + volk_gnsssdr_free(result_aux[n]); + } volk_gnsssdr_free(result_aux); } #endif -#endif // INCLUDED_volk_gnsssdr_16ic_resamplerpuppet_16ic_H +#endif // INCLUDED_volk_gnsssdr_16ic_resamplerpuppet_16ic_H diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_s32fc_x2_rotator_16ic.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_s32fc_x2_rotator_16ic.h index 15303ead5..0de39ebc3 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_s32fc_x2_rotator_16ic.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_s32fc_x2_rotator_16ic.h @@ -70,7 +70,7 @@ static inline void volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_generic(lv_16sc_t* ou unsigned int i = 0; lv_16sc_t tmp16; lv_32fc_t tmp32; - for(i = 0; i < (unsigned int)(num_points); ++i) + for (i = 0; i < (unsigned int)(num_points); ++i) { tmp16 = *inVector++; tmp32 = lv_cmake((float)lv_creal(tmp16), (float)lv_cimag(tmp16)) * (*phase); @@ -111,8 +111,8 @@ static inline void volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_generic_reload(lv_16s *outVector++ = lv_cmake((int16_t)rintf(lv_creal(tmp32)), (int16_t)rintf(lv_cimag(tmp32))); (*phase) *= phase_inc; } - // Regenerate phase - //printf("Phase before regeneration %i: %f,%f Modulus: %f\n", n,lv_creal(*phase),lv_cimag(*phase), cabsf(*phase)); + // Regenerate phase + //printf("Phase before regeneration %i: %f,%f Modulus: %f\n", n,lv_creal(*phase),lv_cimag(*phase), cabsf(*phase)); #ifdef __cplusplus (*phase) /= std::abs((*phase)); #else @@ -141,11 +141,13 @@ static inline void volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_a_sse3(lv_16sc_t* out unsigned int number; __m128 a, b, two_phase_acc_reg, two_phase_inc_reg; __m128i c1, c2, result; - __VOLK_ATTR_ALIGNED(16) lv_32fc_t two_phase_inc[2]; + __VOLK_ATTR_ALIGNED(16) + lv_32fc_t two_phase_inc[2]; two_phase_inc[0] = phase_inc * phase_inc; two_phase_inc[1] = phase_inc * phase_inc; - two_phase_inc_reg = _mm_load_ps((float*) two_phase_inc); - __VOLK_ATTR_ALIGNED(16) lv_32fc_t two_phase_acc[2]; + two_phase_inc_reg = _mm_load_ps((float*)two_phase_inc); + __VOLK_ATTR_ALIGNED(16) + lv_32fc_t two_phase_acc[2]; two_phase_acc[0] = (*phase); two_phase_acc[1] = (*phase) * phase_inc; two_phase_acc_reg = _mm_load_ps((float*)two_phase_acc); @@ -157,49 +159,49 @@ static inline void volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_a_sse3(lv_16sc_t* out lv_16sc_t tmp16; lv_32fc_t tmp32; - for(number = 0; number < sse_iters; number++) + for (number = 0; number < sse_iters; number++) { - a = _mm_set_ps((float)(lv_cimag(_in[1])), (float)(lv_creal(_in[1])), (float)(lv_cimag(_in[0])), (float)(lv_creal(_in[0]))); // //load (2 byte imag, 2 byte real) x 2 into 128 bits reg + a = _mm_set_ps((float)(lv_cimag(_in[1])), (float)(lv_creal(_in[1])), (float)(lv_cimag(_in[0])), (float)(lv_creal(_in[0]))); // //load (2 byte imag, 2 byte real) x 2 into 128 bits reg //complex 32fc multiplication b=a*two_phase_acc_reg - yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr - yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di - tmp1 = _mm_mul_ps(a, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr - a = _mm_shuffle_ps(a, a, 0xB1); // Re-arrange x to be ai,ar,bi,br - tmp2 = _mm_mul_ps(a, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di - b = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di - c1 = _mm_cvtps_epi32(b); // convert from 32fc to 32ic + yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr + yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di + tmp1 = _mm_mul_ps(a, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr + a = _mm_shuffle_ps(a, a, 0xB1); // Re-arrange x to be ai,ar,bi,br + tmp2 = _mm_mul_ps(a, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di + b = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di + c1 = _mm_cvtps_epi32(b); // convert from 32fc to 32ic //complex 32fc multiplication two_phase_acc_reg=two_phase_acc_reg*two_phase_inc_reg - yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr - yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di - tmp1 = _mm_mul_ps(two_phase_inc_reg, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr - tmp3 = _mm_shuffle_ps(two_phase_inc_reg, two_phase_inc_reg, 0xB1); // Re-arrange x to be ai,ar,bi,br - tmp2 = _mm_mul_ps(tmp3, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di - two_phase_acc_reg = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di + yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr + yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di + tmp1 = _mm_mul_ps(two_phase_inc_reg, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr + tmp3 = _mm_shuffle_ps(two_phase_inc_reg, two_phase_inc_reg, 0xB1); // Re-arrange x to be ai,ar,bi,br + tmp2 = _mm_mul_ps(tmp3, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di + two_phase_acc_reg = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di //next two samples _in += 2; - a = _mm_set_ps((float)(lv_cimag(_in[1])), (float)(lv_creal(_in[1])), (float)(lv_cimag(_in[0])), (float)(lv_creal(_in[0]))); // //load (2 byte imag, 2 byte real) x 2 into 128 bits reg + a = _mm_set_ps((float)(lv_cimag(_in[1])), (float)(lv_creal(_in[1])), (float)(lv_cimag(_in[0])), (float)(lv_creal(_in[0]))); // //load (2 byte imag, 2 byte real) x 2 into 128 bits reg __VOLK_GNSSSDR_PREFETCH(_in + 8); //complex 32fc multiplication b=a*two_phase_acc_reg - yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr - yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di - tmp1 = _mm_mul_ps(a, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr - a = _mm_shuffle_ps(a, a, 0xB1); // Re-arrange x to be ai,ar,bi,br - tmp2 = _mm_mul_ps(a, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di - b = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di - c2 = _mm_cvtps_epi32(b); // convert from 32fc to 32ic + yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr + yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di + tmp1 = _mm_mul_ps(a, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr + a = _mm_shuffle_ps(a, a, 0xB1); // Re-arrange x to be ai,ar,bi,br + tmp2 = _mm_mul_ps(a, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di + b = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di + c2 = _mm_cvtps_epi32(b); // convert from 32fc to 32ic //complex 32fc multiplication two_phase_acc_reg=two_phase_acc_reg*two_phase_inc_reg - yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr - yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di - tmp1 = _mm_mul_ps(two_phase_inc_reg, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr - tmp3 = _mm_shuffle_ps(two_phase_inc_reg, two_phase_inc_reg, 0xB1); // Re-arrange x to be ai,ar,bi,br - tmp2 = _mm_mul_ps(tmp3, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di - two_phase_acc_reg = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di + yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr + yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di + tmp1 = _mm_mul_ps(two_phase_inc_reg, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr + tmp3 = _mm_shuffle_ps(two_phase_inc_reg, two_phase_inc_reg, 0xB1); // Re-arrange x to be ai,ar,bi,br + tmp2 = _mm_mul_ps(tmp3, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di + two_phase_acc_reg = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di // store four output samples - result = _mm_packs_epi32(c1, c2);// convert from 32ic to 16ic + result = _mm_packs_epi32(c1, c2); // convert from 32ic to 16ic _mm_store_si128((__m128i*)_out, result); // Regenerate phase @@ -232,7 +234,6 @@ static inline void volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_a_sse3(lv_16sc_t* out #endif /* LV_HAVE_SSE3 */ - #ifdef LV_HAVE_SSE3 #include @@ -244,11 +245,13 @@ static inline void volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_a_sse3_reload(lv_16sc unsigned int j; __m128 a, b, two_phase_acc_reg, two_phase_inc_reg; __m128i c1, c2, result; - __VOLK_ATTR_ALIGNED(16) lv_32fc_t two_phase_inc[2]; + __VOLK_ATTR_ALIGNED(16) + lv_32fc_t two_phase_inc[2]; two_phase_inc[0] = phase_inc * phase_inc; two_phase_inc[1] = phase_inc * phase_inc; - two_phase_inc_reg = _mm_load_ps((float*) two_phase_inc); - __VOLK_ATTR_ALIGNED(16) lv_32fc_t two_phase_acc[2]; + two_phase_inc_reg = _mm_load_ps((float*)two_phase_inc); + __VOLK_ATTR_ALIGNED(16) + lv_32fc_t two_phase_acc[2]; two_phase_acc[0] = (*phase); two_phase_acc[1] = (*phase) * phase_inc; two_phase_acc_reg = _mm_load_ps((float*)two_phase_acc); @@ -265,47 +268,47 @@ static inline void volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_a_sse3_reload(lv_16sc { for (j = 0; j < ROTATOR_RELOAD; j++) { - a = _mm_set_ps((float)(lv_cimag(_in[1])), (float)(lv_creal(_in[1])), (float)(lv_cimag(_in[0])), (float)(lv_creal(_in[0]))); // //load (2 byte imag, 2 byte real) x 2 into 128 bits reg + a = _mm_set_ps((float)(lv_cimag(_in[1])), (float)(lv_creal(_in[1])), (float)(lv_cimag(_in[0])), (float)(lv_creal(_in[0]))); // //load (2 byte imag, 2 byte real) x 2 into 128 bits reg //complex 32fc multiplication b=a*two_phase_acc_reg - yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr - yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di - tmp1 = _mm_mul_ps(a, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr - a = _mm_shuffle_ps(a, a, 0xB1); // Re-arrange x to be ai,ar,bi,br - tmp2 = _mm_mul_ps(a, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di - b = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di - c1 = _mm_cvtps_epi32(b); // convert from 32fc to 32ic + yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr + yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di + tmp1 = _mm_mul_ps(a, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr + a = _mm_shuffle_ps(a, a, 0xB1); // Re-arrange x to be ai,ar,bi,br + tmp2 = _mm_mul_ps(a, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di + b = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di + c1 = _mm_cvtps_epi32(b); // convert from 32fc to 32ic //complex 32fc multiplication two_phase_acc_reg=two_phase_acc_reg*two_phase_inc_reg - yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr - yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di - tmp1 = _mm_mul_ps(two_phase_inc_reg, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr - tmp3 = _mm_shuffle_ps(two_phase_inc_reg, two_phase_inc_reg, 0xB1); // Re-arrange x to be ai,ar,bi,br - tmp2 = _mm_mul_ps(tmp3, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di - two_phase_acc_reg = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di + yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr + yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di + tmp1 = _mm_mul_ps(two_phase_inc_reg, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr + tmp3 = _mm_shuffle_ps(two_phase_inc_reg, two_phase_inc_reg, 0xB1); // Re-arrange x to be ai,ar,bi,br + tmp2 = _mm_mul_ps(tmp3, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di + two_phase_acc_reg = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di //next two samples _in += 2; - a = _mm_set_ps((float)(lv_cimag(_in[1])), (float)(lv_creal(_in[1])), (float)(lv_cimag(_in[0])), (float)(lv_creal(_in[0]))); // //load (2 byte imag, 2 byte real) x 2 into 128 bits reg + a = _mm_set_ps((float)(lv_cimag(_in[1])), (float)(lv_creal(_in[1])), (float)(lv_cimag(_in[0])), (float)(lv_creal(_in[0]))); // //load (2 byte imag, 2 byte real) x 2 into 128 bits reg __VOLK_GNSSSDR_PREFETCH(_in + 8); //complex 32fc multiplication b=a*two_phase_acc_reg - yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr - yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di - tmp1 = _mm_mul_ps(a, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr - a = _mm_shuffle_ps(a, a, 0xB1); // Re-arrange x to be ai,ar,bi,br - tmp2 = _mm_mul_ps(a, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di - b = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di - c2 = _mm_cvtps_epi32(b); // convert from 32fc to 32ic + yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr + yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di + tmp1 = _mm_mul_ps(a, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr + a = _mm_shuffle_ps(a, a, 0xB1); // Re-arrange x to be ai,ar,bi,br + tmp2 = _mm_mul_ps(a, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di + b = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di + c2 = _mm_cvtps_epi32(b); // convert from 32fc to 32ic //complex 32fc multiplication two_phase_acc_reg=two_phase_acc_reg*two_phase_inc_reg - yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr - yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di - tmp1 = _mm_mul_ps(two_phase_inc_reg, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr - tmp3 = _mm_shuffle_ps(two_phase_inc_reg, two_phase_inc_reg, 0xB1); // Re-arrange x to be ai,ar,bi,br - tmp2 = _mm_mul_ps(tmp3, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di - two_phase_acc_reg = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di + yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr + yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di + tmp1 = _mm_mul_ps(two_phase_inc_reg, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr + tmp3 = _mm_shuffle_ps(two_phase_inc_reg, two_phase_inc_reg, 0xB1); // Re-arrange x to be ai,ar,bi,br + tmp2 = _mm_mul_ps(tmp3, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di + two_phase_acc_reg = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di // store four output samples - result = _mm_packs_epi32(c1, c2);// convert from 32ic to 16ic + result = _mm_packs_epi32(c1, c2); // convert from 32ic to 16ic _mm_store_si128((__m128i*)_out, result); //next two samples @@ -322,47 +325,47 @@ static inline void volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_a_sse3_reload(lv_16sc for (j = 0; j < sse_iters % ROTATOR_RELOAD; j++) { - a = _mm_set_ps((float)(lv_cimag(_in[1])), (float)(lv_creal(_in[1])), (float)(lv_cimag(_in[0])), (float)(lv_creal(_in[0]))); // //load (2 byte imag, 2 byte real) x 2 into 128 bits reg + a = _mm_set_ps((float)(lv_cimag(_in[1])), (float)(lv_creal(_in[1])), (float)(lv_cimag(_in[0])), (float)(lv_creal(_in[0]))); // //load (2 byte imag, 2 byte real) x 2 into 128 bits reg //complex 32fc multiplication b=a*two_phase_acc_reg - yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr - yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di - tmp1 = _mm_mul_ps(a, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr - a = _mm_shuffle_ps(a, a, 0xB1); // Re-arrange x to be ai,ar,bi,br - tmp2 = _mm_mul_ps(a, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di - b = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di - c1 = _mm_cvtps_epi32(b); // convert from 32fc to 32ic + yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr + yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di + tmp1 = _mm_mul_ps(a, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr + a = _mm_shuffle_ps(a, a, 0xB1); // Re-arrange x to be ai,ar,bi,br + tmp2 = _mm_mul_ps(a, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di + b = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di + c1 = _mm_cvtps_epi32(b); // convert from 32fc to 32ic //complex 32fc multiplication two_phase_acc_reg=two_phase_acc_reg*two_phase_inc_reg - yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr - yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di - tmp1 = _mm_mul_ps(two_phase_inc_reg, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr - tmp3 = _mm_shuffle_ps(two_phase_inc_reg, two_phase_inc_reg, 0xB1); // Re-arrange x to be ai,ar,bi,br - tmp2 = _mm_mul_ps(tmp3, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di - two_phase_acc_reg = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di + yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr + yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di + tmp1 = _mm_mul_ps(two_phase_inc_reg, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr + tmp3 = _mm_shuffle_ps(two_phase_inc_reg, two_phase_inc_reg, 0xB1); // Re-arrange x to be ai,ar,bi,br + tmp2 = _mm_mul_ps(tmp3, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di + two_phase_acc_reg = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di //next two samples _in += 2; - a = _mm_set_ps((float)(lv_cimag(_in[1])), (float)(lv_creal(_in[1])), (float)(lv_cimag(_in[0])), (float)(lv_creal(_in[0]))); // //load (2 byte imag, 2 byte real) x 2 into 128 bits reg + a = _mm_set_ps((float)(lv_cimag(_in[1])), (float)(lv_creal(_in[1])), (float)(lv_cimag(_in[0])), (float)(lv_creal(_in[0]))); // //load (2 byte imag, 2 byte real) x 2 into 128 bits reg __VOLK_GNSSSDR_PREFETCH(_in + 8); //complex 32fc multiplication b=a*two_phase_acc_reg - yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr - yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di - tmp1 = _mm_mul_ps(a, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr - a = _mm_shuffle_ps(a, a, 0xB1); // Re-arrange x to be ai,ar,bi,br - tmp2 = _mm_mul_ps(a, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di - b = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di - c2 = _mm_cvtps_epi32(b); // convert from 32fc to 32ic + yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr + yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di + tmp1 = _mm_mul_ps(a, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr + a = _mm_shuffle_ps(a, a, 0xB1); // Re-arrange x to be ai,ar,bi,br + tmp2 = _mm_mul_ps(a, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di + b = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di + c2 = _mm_cvtps_epi32(b); // convert from 32fc to 32ic //complex 32fc multiplication two_phase_acc_reg=two_phase_acc_reg*two_phase_inc_reg - yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr - yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di - tmp1 = _mm_mul_ps(two_phase_inc_reg, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr - tmp3 = _mm_shuffle_ps(two_phase_inc_reg, two_phase_inc_reg, 0xB1); // Re-arrange x to be ai,ar,bi,br - tmp2 = _mm_mul_ps(tmp3, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di - two_phase_acc_reg = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di + yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr + yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di + tmp1 = _mm_mul_ps(two_phase_inc_reg, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr + tmp3 = _mm_shuffle_ps(two_phase_inc_reg, two_phase_inc_reg, 0xB1); // Re-arrange x to be ai,ar,bi,br + tmp2 = _mm_mul_ps(tmp3, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di + two_phase_acc_reg = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di // store four output samples - result = _mm_packs_epi32(c1, c2);// convert from 32ic to 16ic + result = _mm_packs_epi32(c1, c2); // convert from 32ic to 16ic _mm_store_si128((__m128i*)_out, result); //next two samples @@ -385,7 +388,6 @@ static inline void volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_a_sse3_reload(lv_16sc #endif /* LV_HAVE_SSE3 */ - #ifdef LV_HAVE_SSE3 #include @@ -395,14 +397,16 @@ static inline void volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_u_sse3(lv_16sc_t* out unsigned int number; __m128 a, b, two_phase_acc_reg, two_phase_inc_reg; __m128i c1, c2, result; - __VOLK_ATTR_ALIGNED(16) lv_32fc_t two_phase_inc[2]; + __VOLK_ATTR_ALIGNED(16) + lv_32fc_t two_phase_inc[2]; two_phase_inc[0] = phase_inc * phase_inc; two_phase_inc[1] = phase_inc * phase_inc; - two_phase_inc_reg = _mm_load_ps((float*) two_phase_inc); - __VOLK_ATTR_ALIGNED(16) lv_32fc_t two_phase_acc[2]; + two_phase_inc_reg = _mm_load_ps((float*)two_phase_inc); + __VOLK_ATTR_ALIGNED(16) + lv_32fc_t two_phase_acc[2]; two_phase_acc[0] = (*phase); two_phase_acc[1] = (*phase) * phase_inc; - two_phase_acc_reg = _mm_load_ps((float*) two_phase_acc); + two_phase_acc_reg = _mm_load_ps((float*)two_phase_acc); const lv_16sc_t* _in = inVector; @@ -412,49 +416,49 @@ static inline void volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_u_sse3(lv_16sc_t* out lv_16sc_t tmp16; lv_32fc_t tmp32; - for(number = 0; number < sse_iters; number++) + for (number = 0; number < sse_iters; number++) { - a = _mm_set_ps((float)(lv_cimag(_in[1])), (float)(lv_creal(_in[1])), (float)(lv_cimag(_in[0])), (float)(lv_creal(_in[0]))); // //load (2 byte imag, 2 byte real) x 2 into 128 bits reg + a = _mm_set_ps((float)(lv_cimag(_in[1])), (float)(lv_creal(_in[1])), (float)(lv_cimag(_in[0])), (float)(lv_creal(_in[0]))); // //load (2 byte imag, 2 byte real) x 2 into 128 bits reg //complex 32fc multiplication b=a*two_phase_acc_reg - yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr - yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di - tmp1 = _mm_mul_ps(a, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr - a = _mm_shuffle_ps(a, a, 0xB1); // Re-arrange x to be ai,ar,bi,br - tmp2 = _mm_mul_ps(a, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di - b = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di - c1 = _mm_cvtps_epi32(b); // convert from 32fc to 32ic + yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr + yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di + tmp1 = _mm_mul_ps(a, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr + a = _mm_shuffle_ps(a, a, 0xB1); // Re-arrange x to be ai,ar,bi,br + tmp2 = _mm_mul_ps(a, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di + b = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di + c1 = _mm_cvtps_epi32(b); // convert from 32fc to 32ic //complex 32fc multiplication two_phase_acc_reg=two_phase_acc_reg*two_phase_inc_reg - yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr - yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di - tmp1 = _mm_mul_ps(two_phase_inc_reg, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr - tmp3 = _mm_shuffle_ps(two_phase_inc_reg, two_phase_inc_reg, 0xB1); // Re-arrange x to be ai,ar,bi,br - tmp2 = _mm_mul_ps(tmp3, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di - two_phase_acc_reg = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di + yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr + yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di + tmp1 = _mm_mul_ps(two_phase_inc_reg, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr + tmp3 = _mm_shuffle_ps(two_phase_inc_reg, two_phase_inc_reg, 0xB1); // Re-arrange x to be ai,ar,bi,br + tmp2 = _mm_mul_ps(tmp3, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di + two_phase_acc_reg = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di //next two samples _in += 2; - a = _mm_set_ps((float)(lv_cimag(_in[1])), (float)(lv_creal(_in[1])), (float)(lv_cimag(_in[0])), (float)(lv_creal(_in[0]))); // //load (2 byte imag, 2 byte real) x 2 into 128 bits reg + a = _mm_set_ps((float)(lv_cimag(_in[1])), (float)(lv_creal(_in[1])), (float)(lv_cimag(_in[0])), (float)(lv_creal(_in[0]))); // //load (2 byte imag, 2 byte real) x 2 into 128 bits reg __VOLK_GNSSSDR_PREFETCH(_in + 8); //complex 32fc multiplication b=a*two_phase_acc_reg - yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr - yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di - tmp1 = _mm_mul_ps(a, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr - a = _mm_shuffle_ps(a, a, 0xB1); // Re-arrange x to be ai,ar,bi,br - tmp2 = _mm_mul_ps(a, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di - b = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di - c2 = _mm_cvtps_epi32(b); // convert from 32fc to 32ic + yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr + yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di + tmp1 = _mm_mul_ps(a, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr + a = _mm_shuffle_ps(a, a, 0xB1); // Re-arrange x to be ai,ar,bi,br + tmp2 = _mm_mul_ps(a, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di + b = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di + c2 = _mm_cvtps_epi32(b); // convert from 32fc to 32ic //complex 32fc multiplication two_phase_acc_reg=two_phase_acc_reg*two_phase_inc_reg - yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr - yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di - tmp1 = _mm_mul_ps(two_phase_inc_reg, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr - tmp3 = _mm_shuffle_ps(two_phase_inc_reg, two_phase_inc_reg, 0xB1); // Re-arrange x to be ai,ar,bi,br - tmp2 = _mm_mul_ps(tmp3, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di - two_phase_acc_reg = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di + yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr + yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di + tmp1 = _mm_mul_ps(two_phase_inc_reg, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr + tmp3 = _mm_shuffle_ps(two_phase_inc_reg, two_phase_inc_reg, 0xB1); // Re-arrange x to be ai,ar,bi,br + tmp2 = _mm_mul_ps(tmp3, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di + two_phase_acc_reg = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di // store four output samples - result = _mm_packs_epi32(c1, c2);// convert from 32ic to 16ic + result = _mm_packs_epi32(c1, c2); // convert from 32ic to 16ic _mm_storeu_si128((__m128i*)_out, result); // Regenerate phase @@ -493,147 +497,149 @@ static inline void volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_u_sse3(lv_16sc_t* out static inline void volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_u_sse3_reload(lv_16sc_t* outVector, const lv_16sc_t* inVector, const lv_32fc_t phase_inc, lv_32fc_t* phase, unsigned int num_points) { const unsigned int sse_iters = num_points / 4; - unsigned int ROTATOR_RELOAD = 512; - unsigned int n; - unsigned int j; - __m128 a, b, two_phase_acc_reg, two_phase_inc_reg; - __m128i c1, c2, result; - __VOLK_ATTR_ALIGNED(16) lv_32fc_t two_phase_inc[2]; - two_phase_inc[0] = phase_inc * phase_inc; - two_phase_inc[1] = phase_inc * phase_inc; - two_phase_inc_reg = _mm_load_ps((float*) two_phase_inc); - __VOLK_ATTR_ALIGNED(16) lv_32fc_t two_phase_acc[2]; - two_phase_acc[0] = (*phase); - two_phase_acc[1] = (*phase) * phase_inc; - two_phase_acc_reg = _mm_load_ps((float*) two_phase_acc); + unsigned int ROTATOR_RELOAD = 512; + unsigned int n; + unsigned int j; + __m128 a, b, two_phase_acc_reg, two_phase_inc_reg; + __m128i c1, c2, result; + __VOLK_ATTR_ALIGNED(16) + lv_32fc_t two_phase_inc[2]; + two_phase_inc[0] = phase_inc * phase_inc; + two_phase_inc[1] = phase_inc * phase_inc; + two_phase_inc_reg = _mm_load_ps((float*)two_phase_inc); + __VOLK_ATTR_ALIGNED(16) + lv_32fc_t two_phase_acc[2]; + two_phase_acc[0] = (*phase); + two_phase_acc[1] = (*phase) * phase_inc; + two_phase_acc_reg = _mm_load_ps((float*)two_phase_acc); - const lv_16sc_t* _in = inVector; + const lv_16sc_t* _in = inVector; - lv_16sc_t* _out = outVector; + lv_16sc_t* _out = outVector; - __m128 yl, yh, tmp1, tmp2, tmp3; - lv_16sc_t tmp16; - lv_32fc_t tmp32; + __m128 yl, yh, tmp1, tmp2, tmp3; + lv_16sc_t tmp16; + lv_32fc_t tmp32; - for (n = 0; n < sse_iters / ROTATOR_RELOAD; n++) - { - for (j = 0; j < ROTATOR_RELOAD; j++) - { - a = _mm_set_ps((float)(lv_cimag(_in[1])), (float)(lv_creal(_in[1])), (float)(lv_cimag(_in[0])), (float)(lv_creal(_in[0]))); // //load (2 byte imag, 2 byte real) x 2 into 128 bits reg - //complex 32fc multiplication b=a*two_phase_acc_reg - yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr - yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di - tmp1 = _mm_mul_ps(a, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr - a = _mm_shuffle_ps(a, a, 0xB1); // Re-arrange x to be ai,ar,bi,br - tmp2 = _mm_mul_ps(a, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di - b = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di - c1 = _mm_cvtps_epi32(b); // convert from 32fc to 32ic + for (n = 0; n < sse_iters / ROTATOR_RELOAD; n++) + { + for (j = 0; j < ROTATOR_RELOAD; j++) + { + a = _mm_set_ps((float)(lv_cimag(_in[1])), (float)(lv_creal(_in[1])), (float)(lv_cimag(_in[0])), (float)(lv_creal(_in[0]))); // //load (2 byte imag, 2 byte real) x 2 into 128 bits reg + //complex 32fc multiplication b=a*two_phase_acc_reg + yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr + yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di + tmp1 = _mm_mul_ps(a, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr + a = _mm_shuffle_ps(a, a, 0xB1); // Re-arrange x to be ai,ar,bi,br + tmp2 = _mm_mul_ps(a, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di + b = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di + c1 = _mm_cvtps_epi32(b); // convert from 32fc to 32ic - //complex 32fc multiplication two_phase_acc_reg=two_phase_acc_reg*two_phase_inc_reg - yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr - yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di - tmp1 = _mm_mul_ps(two_phase_inc_reg, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr - tmp3 = _mm_shuffle_ps(two_phase_inc_reg, two_phase_inc_reg, 0xB1); // Re-arrange x to be ai,ar,bi,br - tmp2 = _mm_mul_ps(tmp3, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di - two_phase_acc_reg = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di + //complex 32fc multiplication two_phase_acc_reg=two_phase_acc_reg*two_phase_inc_reg + yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr + yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di + tmp1 = _mm_mul_ps(two_phase_inc_reg, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr + tmp3 = _mm_shuffle_ps(two_phase_inc_reg, two_phase_inc_reg, 0xB1); // Re-arrange x to be ai,ar,bi,br + tmp2 = _mm_mul_ps(tmp3, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di + two_phase_acc_reg = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di - //next two samples - _in += 2; - a = _mm_set_ps((float)(lv_cimag(_in[1])), (float)(lv_creal(_in[1])), (float)(lv_cimag(_in[0])), (float)(lv_creal(_in[0]))); // //load (2 byte imag, 2 byte real) x 2 into 128 bits reg - __VOLK_GNSSSDR_PREFETCH(_in + 8); - //complex 32fc multiplication b=a*two_phase_acc_reg - yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr - yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di - tmp1 = _mm_mul_ps(a, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr - a = _mm_shuffle_ps(a, a, 0xB1); // Re-arrange x to be ai,ar,bi,br - tmp2 = _mm_mul_ps(a, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di - b = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di - c2 = _mm_cvtps_epi32(b); // convert from 32fc to 32ic + //next two samples + _in += 2; + a = _mm_set_ps((float)(lv_cimag(_in[1])), (float)(lv_creal(_in[1])), (float)(lv_cimag(_in[0])), (float)(lv_creal(_in[0]))); // //load (2 byte imag, 2 byte real) x 2 into 128 bits reg + __VOLK_GNSSSDR_PREFETCH(_in + 8); + //complex 32fc multiplication b=a*two_phase_acc_reg + yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr + yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di + tmp1 = _mm_mul_ps(a, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr + a = _mm_shuffle_ps(a, a, 0xB1); // Re-arrange x to be ai,ar,bi,br + tmp2 = _mm_mul_ps(a, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di + b = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di + c2 = _mm_cvtps_epi32(b); // convert from 32fc to 32ic - //complex 32fc multiplication two_phase_acc_reg=two_phase_acc_reg*two_phase_inc_reg - yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr - yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di - tmp1 = _mm_mul_ps(two_phase_inc_reg, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr - tmp3 = _mm_shuffle_ps(two_phase_inc_reg, two_phase_inc_reg, 0xB1); // Re-arrange x to be ai,ar,bi,br - tmp2 = _mm_mul_ps(tmp3, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di - two_phase_acc_reg = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di + //complex 32fc multiplication two_phase_acc_reg=two_phase_acc_reg*two_phase_inc_reg + yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr + yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di + tmp1 = _mm_mul_ps(two_phase_inc_reg, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr + tmp3 = _mm_shuffle_ps(two_phase_inc_reg, two_phase_inc_reg, 0xB1); // Re-arrange x to be ai,ar,bi,br + tmp2 = _mm_mul_ps(tmp3, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di + two_phase_acc_reg = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di - // store four output samples - result = _mm_packs_epi32(c1, c2);// convert from 32ic to 16ic - _mm_storeu_si128((__m128i*)_out, result); + // store four output samples + result = _mm_packs_epi32(c1, c2); // convert from 32ic to 16ic + _mm_storeu_si128((__m128i*)_out, result); - //next two samples - _in += 2; - _out += 4; - } - // Regenerate phase - tmp1 = _mm_mul_ps(two_phase_acc_reg, two_phase_acc_reg); - tmp2 = _mm_hadd_ps(tmp1, tmp1); - tmp1 = _mm_shuffle_ps(tmp2, tmp2, 0xD8); - tmp2 = _mm_sqrt_ps(tmp1); - two_phase_acc_reg = _mm_div_ps(two_phase_acc_reg, tmp2); - } + //next two samples + _in += 2; + _out += 4; + } + // Regenerate phase + tmp1 = _mm_mul_ps(two_phase_acc_reg, two_phase_acc_reg); + tmp2 = _mm_hadd_ps(tmp1, tmp1); + tmp1 = _mm_shuffle_ps(tmp2, tmp2, 0xD8); + tmp2 = _mm_sqrt_ps(tmp1); + two_phase_acc_reg = _mm_div_ps(two_phase_acc_reg, tmp2); + } - for (j = 0; j < sse_iters % ROTATOR_RELOAD; j++) - { - a = _mm_set_ps((float)(lv_cimag(_in[1])), (float)(lv_creal(_in[1])), (float)(lv_cimag(_in[0])), (float)(lv_creal(_in[0]))); // //load (2 byte imag, 2 byte real) x 2 into 128 bits reg - //complex 32fc multiplication b=a*two_phase_acc_reg - yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr - yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di - tmp1 = _mm_mul_ps(a, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr - a = _mm_shuffle_ps(a, a, 0xB1); // Re-arrange x to be ai,ar,bi,br - tmp2 = _mm_mul_ps(a, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di - b = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di - c1 = _mm_cvtps_epi32(b); // convert from 32fc to 32ic + for (j = 0; j < sse_iters % ROTATOR_RELOAD; j++) + { + a = _mm_set_ps((float)(lv_cimag(_in[1])), (float)(lv_creal(_in[1])), (float)(lv_cimag(_in[0])), (float)(lv_creal(_in[0]))); // //load (2 byte imag, 2 byte real) x 2 into 128 bits reg + //complex 32fc multiplication b=a*two_phase_acc_reg + yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr + yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di + tmp1 = _mm_mul_ps(a, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr + a = _mm_shuffle_ps(a, a, 0xB1); // Re-arrange x to be ai,ar,bi,br + tmp2 = _mm_mul_ps(a, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di + b = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di + c1 = _mm_cvtps_epi32(b); // convert from 32fc to 32ic - //complex 32fc multiplication two_phase_acc_reg=two_phase_acc_reg*two_phase_inc_reg - yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr - yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di - tmp1 = _mm_mul_ps(two_phase_inc_reg, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr - tmp3 = _mm_shuffle_ps(two_phase_inc_reg, two_phase_inc_reg, 0xB1); // Re-arrange x to be ai,ar,bi,br - tmp2 = _mm_mul_ps(tmp3, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di - two_phase_acc_reg = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di + //complex 32fc multiplication two_phase_acc_reg=two_phase_acc_reg*two_phase_inc_reg + yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr + yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di + tmp1 = _mm_mul_ps(two_phase_inc_reg, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr + tmp3 = _mm_shuffle_ps(two_phase_inc_reg, two_phase_inc_reg, 0xB1); // Re-arrange x to be ai,ar,bi,br + tmp2 = _mm_mul_ps(tmp3, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di + two_phase_acc_reg = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di - //next two samples - _in += 2; - a = _mm_set_ps((float)(lv_cimag(_in[1])), (float)(lv_creal(_in[1])), (float)(lv_cimag(_in[0])), (float)(lv_creal(_in[0]))); // //load (2 byte imag, 2 byte real) x 2 into 128 bits reg - __VOLK_GNSSSDR_PREFETCH(_in + 8); - //complex 32fc multiplication b=a*two_phase_acc_reg - yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr - yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di - tmp1 = _mm_mul_ps(a, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr - a = _mm_shuffle_ps(a, a, 0xB1); // Re-arrange x to be ai,ar,bi,br - tmp2 = _mm_mul_ps(a, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di - b = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di - c2 = _mm_cvtps_epi32(b); // convert from 32fc to 32ic + //next two samples + _in += 2; + a = _mm_set_ps((float)(lv_cimag(_in[1])), (float)(lv_creal(_in[1])), (float)(lv_cimag(_in[0])), (float)(lv_creal(_in[0]))); // //load (2 byte imag, 2 byte real) x 2 into 128 bits reg + __VOLK_GNSSSDR_PREFETCH(_in + 8); + //complex 32fc multiplication b=a*two_phase_acc_reg + yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr + yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di + tmp1 = _mm_mul_ps(a, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr + a = _mm_shuffle_ps(a, a, 0xB1); // Re-arrange x to be ai,ar,bi,br + tmp2 = _mm_mul_ps(a, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di + b = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di + c2 = _mm_cvtps_epi32(b); // convert from 32fc to 32ic - //complex 32fc multiplication two_phase_acc_reg=two_phase_acc_reg*two_phase_inc_reg - yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr - yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di - tmp1 = _mm_mul_ps(two_phase_inc_reg, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr - tmp3 = _mm_shuffle_ps(two_phase_inc_reg, two_phase_inc_reg, 0xB1); // Re-arrange x to be ai,ar,bi,br - tmp2 = _mm_mul_ps(tmp3, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di - two_phase_acc_reg = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di + //complex 32fc multiplication two_phase_acc_reg=two_phase_acc_reg*two_phase_inc_reg + yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr + yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di + tmp1 = _mm_mul_ps(two_phase_inc_reg, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr + tmp3 = _mm_shuffle_ps(two_phase_inc_reg, two_phase_inc_reg, 0xB1); // Re-arrange x to be ai,ar,bi,br + tmp2 = _mm_mul_ps(tmp3, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di + two_phase_acc_reg = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di - // store four output samples - result = _mm_packs_epi32(c1, c2);// convert from 32ic to 16ic - _mm_storeu_si128((__m128i*)_out, result); + // store four output samples + result = _mm_packs_epi32(c1, c2); // convert from 32ic to 16ic + _mm_storeu_si128((__m128i*)_out, result); - //next two samples - _in += 2; - _out += 4; - } + //next two samples + _in += 2; + _out += 4; + } - _mm_store_ps((float*)two_phase_acc, two_phase_acc_reg); - (*phase) = two_phase_acc[0]; + _mm_store_ps((float*)two_phase_acc, two_phase_acc_reg); + (*phase) = two_phase_acc[0]; - for (n = sse_iters * 4; n < num_points; ++n) - { - tmp16 = *_in++; - tmp32 = lv_cmake((float)lv_creal(tmp16), (float)lv_cimag(tmp16)) * (*phase); - *_out++ = lv_cmake((int16_t)rintf(lv_creal(tmp32)), (int16_t)rintf(lv_cimag(tmp32))); - (*phase) *= phase_inc; - } + for (n = sse_iters * 4; n < num_points; ++n) + { + tmp16 = *_in++; + tmp32 = lv_cmake((float)lv_creal(tmp16), (float)lv_cimag(tmp16)) * (*phase); + *_out++ = lv_cmake((int16_t)rintf(lv_creal(tmp32)), (int16_t)rintf(lv_cimag(tmp32))); + (*phase) *= phase_inc; + } } #endif /* LV_HAVE_SSE3 */ @@ -657,8 +663,10 @@ static inline void volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_neon(lv_16sc_t* outVe lv_16sc_t* _out = outVector; lv_32fc_t ___phase4 = phase_inc * phase_inc * phase_inc * phase_inc; - __VOLK_ATTR_ALIGNED(16) float32_t __phase4_real[4] = { lv_creal(___phase4), lv_creal(___phase4), lv_creal(___phase4), lv_creal(___phase4) }; - __VOLK_ATTR_ALIGNED(16) float32_t __phase4_imag[4] = { lv_cimag(___phase4), lv_cimag(___phase4), lv_cimag(___phase4), lv_cimag(___phase4) }; + __VOLK_ATTR_ALIGNED(16) + float32_t __phase4_real[4] = {lv_creal(___phase4), lv_creal(___phase4), lv_creal(___phase4), lv_creal(___phase4)}; + __VOLK_ATTR_ALIGNED(16) + float32_t __phase4_imag[4] = {lv_cimag(___phase4), lv_cimag(___phase4), lv_cimag(___phase4), lv_cimag(___phase4)}; float32x4_t _phase4_real = vld1q_f32(__phase4_real); float32x4_t _phase4_imag = vld1q_f32(__phase4_imag); @@ -667,8 +675,10 @@ static inline void volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_neon(lv_16sc_t* outVe lv_32fc_t phase3 = phase2 * phase_inc; lv_32fc_t phase4 = phase3 * phase_inc; - __VOLK_ATTR_ALIGNED(16) float32_t __phase_real[4] = { lv_creal((*phase)), lv_creal(phase2), lv_creal(phase3), lv_creal(phase4) }; - __VOLK_ATTR_ALIGNED(16) float32_t __phase_imag[4] = { lv_cimag((*phase)), lv_cimag(phase2), lv_cimag(phase3), lv_cimag(phase4) }; + __VOLK_ATTR_ALIGNED(16) + float32_t __phase_real[4] = {lv_creal((*phase)), lv_creal(phase2), lv_creal(phase3), lv_creal(phase4)}; + __VOLK_ATTR_ALIGNED(16) + float32_t __phase_imag[4] = {lv_cimag((*phase)), lv_cimag(phase2), lv_cimag(phase3), lv_cimag(phase4)}; float32x4_t _phase_real = vld1q_f32(__phase_real); float32x4_t _phase_imag = vld1q_f32(__phase_imag); @@ -681,7 +691,7 @@ static inline void volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_neon(lv_16sc_t* outVe if (neon_iters > 0) { - for(; i < neon_iters; ++i) + for (; i < neon_iters; ++i) { /* load 4 complex numbers (int 16 bits each component) */ tmp16 = vld2_s16((int16_t*)_in); @@ -745,8 +755,10 @@ static inline void volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_neon(lv_16sc_t* outVe phase3 = phase2 * phase_inc; phase4 = phase3 * phase_inc; - __VOLK_ATTR_ALIGNED(16) float32_t ____phase_real[4] = { lv_creal((*phase)), lv_creal(phase2), lv_creal(phase3), lv_creal(phase4) }; - __VOLK_ATTR_ALIGNED(16) float32_t ____phase_imag[4] = { lv_cimag((*phase)), lv_cimag(phase2), lv_cimag(phase3), lv_cimag(phase4) }; + __VOLK_ATTR_ALIGNED(16) + float32_t ____phase_real[4] = {lv_creal((*phase)), lv_creal(phase2), lv_creal(phase3), lv_creal(phase4)}; + __VOLK_ATTR_ALIGNED(16) + float32_t ____phase_imag[4] = {lv_cimag((*phase)), lv_cimag(phase2), lv_cimag(phase3), lv_cimag(phase4)}; _phase_real = vld1q_f32(____phase_real); _phase_imag = vld1q_f32(____phase_imag); @@ -757,7 +769,7 @@ static inline void volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_neon(lv_16sc_t* outVe (*phase) = lv_cmake((float32_t)__phase_real[0], (float32_t)__phase_imag[0]); } - for(i = 0; i < neon_iters % 4; ++i) + for (i = 0; i < neon_iters % 4; ++i) { tmp16_ = *_in++; tmp32_ = lv_cmake((float32_t)lv_creal(tmp16_), (float32_t)lv_cimag(tmp16_)) * (*phase); @@ -791,8 +803,10 @@ static inline void volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_neon_reload(lv_16sc_t lv_16sc_t* _out = outVector; lv_32fc_t ___phase4 = phase_inc * phase_inc * phase_inc * phase_inc; - __VOLK_ATTR_ALIGNED(16) float32_t __phase4_real[4] = { lv_creal(___phase4), lv_creal(___phase4), lv_creal(___phase4), lv_creal(___phase4) }; - __VOLK_ATTR_ALIGNED(16) float32_t __phase4_imag[4] = { lv_cimag(___phase4), lv_cimag(___phase4), lv_cimag(___phase4), lv_cimag(___phase4) }; + __VOLK_ATTR_ALIGNED(16) + float32_t __phase4_real[4] = {lv_creal(___phase4), lv_creal(___phase4), lv_creal(___phase4), lv_creal(___phase4)}; + __VOLK_ATTR_ALIGNED(16) + float32_t __phase4_imag[4] = {lv_cimag(___phase4), lv_cimag(___phase4), lv_cimag(___phase4), lv_cimag(___phase4)}; float32x4_t _phase4_real = vld1q_f32(__phase4_real); float32x4_t _phase4_imag = vld1q_f32(__phase4_imag); @@ -801,8 +815,10 @@ static inline void volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_neon_reload(lv_16sc_t lv_32fc_t phase3 = phase2 * phase_inc; lv_32fc_t phase4 = phase3 * phase_inc; - __VOLK_ATTR_ALIGNED(16) float32_t __phase_real[4] = { lv_creal((*phase)), lv_creal(phase2), lv_creal(phase3), lv_creal(phase4) }; - __VOLK_ATTR_ALIGNED(16) float32_t __phase_imag[4] = { lv_cimag((*phase)), lv_cimag(phase2), lv_cimag(phase3), lv_cimag(phase4) }; + __VOLK_ATTR_ALIGNED(16) + float32_t __phase_real[4] = {lv_creal((*phase)), lv_creal(phase2), lv_creal(phase3), lv_creal(phase4)}; + __VOLK_ATTR_ALIGNED(16) + float32_t __phase_imag[4] = {lv_cimag((*phase)), lv_cimag(phase2), lv_cimag(phase3), lv_cimag(phase4)}; float32x4_t _phase_real = vld1q_f32(__phase_real); float32x4_t _phase_imag = vld1q_f32(__phase_imag); @@ -879,8 +895,10 @@ static inline void volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_neon_reload(lv_16sc_t phase3 = phase2 * phase_inc; phase4 = phase3 * phase_inc; - __VOLK_ATTR_ALIGNED(16) float32_t ____phase_real[4] = { lv_creal((*phase)), lv_creal(phase2), lv_creal(phase3), lv_creal(phase4) }; - __VOLK_ATTR_ALIGNED(16) float32_t ____phase_imag[4] = { lv_cimag((*phase)), lv_cimag(phase2), lv_cimag(phase3), lv_cimag(phase4) }; + __VOLK_ATTR_ALIGNED(16) + float32_t ____phase_real[4] = {lv_creal((*phase)), lv_creal(phase2), lv_creal(phase3), lv_creal(phase4)}; + __VOLK_ATTR_ALIGNED(16) + float32_t ____phase_imag[4] = {lv_cimag((*phase)), lv_cimag(phase2), lv_cimag(phase3), lv_cimag(phase4)}; _phase_real = vld1q_f32(____phase_real); _phase_imag = vld1q_f32(____phase_imag); @@ -945,7 +963,7 @@ static inline void volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_neon_reload(lv_16sc_t (*phase) = lv_cmake((float32_t)__phase_real[0], (float32_t)__phase_imag[0]); } - for(i = 0; i < neon_iters % 4; ++i) + for (i = 0; i < neon_iters % 4; ++i) { tmp16_ = *_in++; tmp32_ = lv_cmake((float32_t)lv_creal(tmp16_), (float32_t)lv_cimag(tmp16_)) * (*phase); diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_x2_dot_prod_16ic.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_x2_dot_prod_16ic.h index 7f6219468..313824556 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_x2_dot_prod_16ic.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_x2_dot_prod_16ic.h @@ -73,7 +73,7 @@ static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_generic(lv_16sc_t* result, for (n = 0; n < num_points; n++) { lv_16sc_t tmp = in_a[n] * in_b[n]; - result[0] = lv_cmake(sat_adds16i(lv_creal(result[0]), lv_creal(tmp)), sat_adds16i(lv_cimag(result[0]), lv_cimag(tmp) )); + result[0] = lv_cmake(sat_adds16i(lv_creal(result[0]), lv_creal(tmp)), sat_adds16i(lv_cimag(result[0]), lv_cimag(tmp))); } } @@ -96,7 +96,8 @@ static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_a_sse2(lv_16sc_t* out, con if (sse_iters > 0) { __m128i a, b, c, c_sr, mask_imag, mask_real, real, imag, imag1, imag2, b_sl, a_sl, realcacc, imagcacc; - __VOLK_ATTR_ALIGNED(16) lv_16sc_t dotProductVector[4]; + __VOLK_ATTR_ALIGNED(16) + lv_16sc_t dotProductVector[4]; realcacc = _mm_setzero_si128(); imagcacc = _mm_setzero_si128(); @@ -104,25 +105,25 @@ static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_a_sse2(lv_16sc_t* out, con mask_imag = _mm_set_epi8(0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0); mask_real = _mm_set_epi8(0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF); - for(number = 0; number < sse_iters; number++) + for (number = 0; number < sse_iters; number++) { // a[127:0]=[a3.i,a3.r,a2.i,a2.r,a1.i,a1.r,a0.i,a0.r] - a = _mm_load_si128((__m128i*)_in_a); //load (2 byte imag, 2 byte real) x 4 into 128 bits reg + a = _mm_load_si128((__m128i*)_in_a); //load (2 byte imag, 2 byte real) x 4 into 128 bits reg __VOLK_GNSSSDR_PREFETCH(_in_a + 8); b = _mm_load_si128((__m128i*)_in_b); __VOLK_GNSSSDR_PREFETCH(_in_b + 8); - c = _mm_mullo_epi16(a, b); // a3.i*b3.i, a3.r*b3.r, .... + c = _mm_mullo_epi16(a, b); // a3.i*b3.i, a3.r*b3.r, .... - c_sr = _mm_srli_si128(c, 2); // Shift a right by imm8 bytes while shifting in zeros, and store the results in dst. + c_sr = _mm_srli_si128(c, 2); // Shift a right by imm8 bytes while shifting in zeros, and store the results in dst. real = _mm_subs_epi16(c, c_sr); - b_sl = _mm_slli_si128(b, 2); // b3.r, b2.i .... - a_sl = _mm_slli_si128(a, 2); // a3.r, a2.i .... + b_sl = _mm_slli_si128(b, 2); // b3.r, b2.i .... + a_sl = _mm_slli_si128(a, 2); // a3.r, a2.i .... - imag1 = _mm_mullo_epi16(a, b_sl); // a3.i*b3.r, .... - imag2 = _mm_mullo_epi16(b, a_sl); // b3.i*a3.r, .... + imag1 = _mm_mullo_epi16(a, b_sl); // a3.i*b3.r, .... + imag2 = _mm_mullo_epi16(b, a_sl); // b3.i*a3.r, .... - imag = _mm_adds_epi16(imag1, imag2); //with saturation arithmetic! + imag = _mm_adds_epi16(imag1, imag2); //with saturation arithmetic! realcacc = _mm_adds_epi16(realcacc, real); imagcacc = _mm_adds_epi16(imagcacc, imag); @@ -136,7 +137,7 @@ static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_a_sse2(lv_16sc_t* out, con a = _mm_or_si128(realcacc, imagcacc); - _mm_store_si128((__m128i*)dotProductVector, a); // Store the results back into the dot product vector + _mm_store_si128((__m128i*)dotProductVector, a); // Store the results back into the dot product vector for (number = 0; number < 4; ++number) { @@ -174,7 +175,8 @@ static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_u_sse2(lv_16sc_t* out, con if (sse_iters > 0) { __m128i a, b, c, c_sr, mask_imag, mask_real, real, imag, imag1, imag2, b_sl, a_sl, realcacc, imagcacc, result; - __VOLK_ATTR_ALIGNED(16) lv_16sc_t dotProductVector[4]; + __VOLK_ATTR_ALIGNED(16) + lv_16sc_t dotProductVector[4]; realcacc = _mm_setzero_si128(); imagcacc = _mm_setzero_si128(); @@ -182,27 +184,27 @@ static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_u_sse2(lv_16sc_t* out, con mask_imag = _mm_set_epi8(0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0); mask_real = _mm_set_epi8(0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF); - for(number = 0; number < sse_iters; number++) + for (number = 0; number < sse_iters; number++) { //std::complex memory structure: real part -> reinterpret_cast(a)[2*i] //imaginery part -> reinterpret_cast(a)[2*i + 1] // a[127:0]=[a3.i,a3.r,a2.i,a2.r,a1.i,a1.r,a0.i,a0.r] - a = _mm_loadu_si128((__m128i*)_in_a); //load (2 byte imag, 2 byte real) x 4 into 128 bits reg + a = _mm_loadu_si128((__m128i*)_in_a); //load (2 byte imag, 2 byte real) x 4 into 128 bits reg __VOLK_GNSSSDR_PREFETCH(_in_a + 8); b = _mm_loadu_si128((__m128i*)_in_b); __VOLK_GNSSSDR_PREFETCH(_in_b + 8); - c = _mm_mullo_epi16(a, b); // a3.i*b3.i, a3.r*b3.r, .... + c = _mm_mullo_epi16(a, b); // a3.i*b3.i, a3.r*b3.r, .... - c_sr = _mm_srli_si128(c, 2); // Shift a right by imm8 bytes while shifting in zeros, and store the results in dst. + c_sr = _mm_srli_si128(c, 2); // Shift a right by imm8 bytes while shifting in zeros, and store the results in dst. real = _mm_subs_epi16(c, c_sr); - b_sl = _mm_slli_si128(b, 2); // b3.r, b2.i .... - a_sl = _mm_slli_si128(a, 2); // a3.r, a2.i .... + b_sl = _mm_slli_si128(b, 2); // b3.r, b2.i .... + a_sl = _mm_slli_si128(a, 2); // a3.r, a2.i .... - imag1 = _mm_mullo_epi16(a, b_sl); // a3.i*b3.r, .... - imag2 = _mm_mullo_epi16(b, a_sl); // b3.i*a3.r, .... + imag1 = _mm_mullo_epi16(a, b_sl); // a3.i*b3.r, .... + imag2 = _mm_mullo_epi16(b, a_sl); // b3.i*a3.r, .... - imag = _mm_adds_epi16(imag1, imag2); //with saturation arithmetic! + imag = _mm_adds_epi16(imag1, imag2); //with saturation arithmetic! realcacc = _mm_adds_epi16(realcacc, real); imagcacc = _mm_adds_epi16(imagcacc, imag); @@ -216,7 +218,7 @@ static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_u_sse2(lv_16sc_t* out, con result = _mm_or_si128(realcacc, imagcacc); - _mm_storeu_si128((__m128i*)dotProductVector, result); // Store the results back into the dot product vector + _mm_storeu_si128((__m128i*)dotProductVector, result); // Store the results back into the dot product vector for (i = 0; i < 4; ++i) { @@ -253,7 +255,8 @@ static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_u_axv2(lv_16sc_t* out, con if (avx_iters > 0) { __m256i a, b, c, c_sr, mask_imag, mask_real, real, imag, imag1, imag2, b_sl, a_sl, realcacc, imagcacc, result; - __VOLK_ATTR_ALIGNED(32) lv_16sc_t dotProductVector[8]; + __VOLK_ATTR_ALIGNED(32) + lv_16sc_t dotProductVector[8]; realcacc = _mm256_setzero_si256(); imagcacc = _mm256_setzero_si256(); @@ -261,7 +264,7 @@ static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_u_axv2(lv_16sc_t* out, con mask_imag = _mm256_set_epi8(0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0); mask_real = _mm256_set_epi8(0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF); - for(number = 0; number < avx_iters; number++) + for (number = 0; number < avx_iters; number++) { a = _mm256_loadu_si256((__m256i*)_in_a); __VOLK_GNSSSDR_PREFETCH(_in_a + 16); @@ -269,7 +272,7 @@ static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_u_axv2(lv_16sc_t* out, con __VOLK_GNSSSDR_PREFETCH(_in_b + 16); c = _mm256_mullo_epi16(a, b); - c_sr = _mm256_srli_si256(c, 2); // Shift a right by imm8 bytes while shifting in zeros, and store the results in dst. + c_sr = _mm256_srli_si256(c, 2); // Shift a right by imm8 bytes while shifting in zeros, and store the results in dst. real = _mm256_subs_epi16(c, c_sr); b_sl = _mm256_slli_si256(b, 2); @@ -278,7 +281,7 @@ static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_u_axv2(lv_16sc_t* out, con imag1 = _mm256_mullo_epi16(a, b_sl); imag2 = _mm256_mullo_epi16(b, a_sl); - imag = _mm256_adds_epi16(imag1, imag2); //with saturation arithmetic! + imag = _mm256_adds_epi16(imag1, imag2); //with saturation arithmetic! realcacc = _mm256_adds_epi16(realcacc, real); imagcacc = _mm256_adds_epi16(imagcacc, imag); @@ -292,7 +295,7 @@ static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_u_axv2(lv_16sc_t* out, con result = _mm256_or_si256(realcacc, imagcacc); - _mm256_storeu_si256((__m256i*)dotProductVector, result); // Store the results back into the dot product vector + _mm256_storeu_si256((__m256i*)dotProductVector, result); // Store the results back into the dot product vector _mm256_zeroupper(); for (i = 0; i < 8; ++i) @@ -330,7 +333,8 @@ static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_a_axv2(lv_16sc_t* out, con if (avx_iters > 0) { __m256i a, b, c, c_sr, mask_imag, mask_real, real, imag, imag1, imag2, b_sl, a_sl, realcacc, imagcacc, result; - __VOLK_ATTR_ALIGNED(32) lv_16sc_t dotProductVector[8]; + __VOLK_ATTR_ALIGNED(32) + lv_16sc_t dotProductVector[8]; realcacc = _mm256_setzero_si256(); imagcacc = _mm256_setzero_si256(); @@ -338,7 +342,7 @@ static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_a_axv2(lv_16sc_t* out, con mask_imag = _mm256_set_epi8(0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0); mask_real = _mm256_set_epi8(0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF); - for(number = 0; number < avx_iters; number++) + for (number = 0; number < avx_iters; number++) { a = _mm256_load_si256((__m256i*)_in_a); __VOLK_GNSSSDR_PREFETCH(_in_a + 16); @@ -346,7 +350,7 @@ static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_a_axv2(lv_16sc_t* out, con __VOLK_GNSSSDR_PREFETCH(_in_b + 16); c = _mm256_mullo_epi16(a, b); - c_sr = _mm256_srli_si256(c, 2); // Shift a right by imm8 bytes while shifting in zeros, and store the results in dst. + c_sr = _mm256_srli_si256(c, 2); // Shift a right by imm8 bytes while shifting in zeros, and store the results in dst. real = _mm256_subs_epi16(c, c_sr); b_sl = _mm256_slli_si256(b, 2); @@ -355,7 +359,7 @@ static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_a_axv2(lv_16sc_t* out, con imag1 = _mm256_mullo_epi16(a, b_sl); imag2 = _mm256_mullo_epi16(b, a_sl); - imag = _mm256_adds_epi16(imag1, imag2); //with saturation arithmetic! + imag = _mm256_adds_epi16(imag1, imag2); //with saturation arithmetic! realcacc = _mm256_adds_epi16(realcacc, real); imagcacc = _mm256_adds_epi16(imagcacc, imag); @@ -369,7 +373,7 @@ static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_a_axv2(lv_16sc_t* out, con result = _mm256_or_si256(realcacc, imagcacc); - _mm256_store_si256((__m256i*)dotProductVector, result); // Store the results back into the dot product vector + _mm256_store_si256((__m256i*)dotProductVector, result); // Store the results back into the dot product vector _mm256_zeroupper(); for (i = 0; i < 8; ++i) @@ -397,8 +401,8 @@ static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_neon(lv_16sc_t* out, const unsigned int quarter_points = num_points / 4; unsigned int number; - lv_16sc_t* a_ptr = (lv_16sc_t*) in_a; - lv_16sc_t* b_ptr = (lv_16sc_t*) in_b; + lv_16sc_t* a_ptr = (lv_16sc_t*)in_a; + lv_16sc_t* b_ptr = (lv_16sc_t*)in_b; *out = lv_cmake((int16_t)0, (int16_t)0); if (quarter_points > 0) @@ -407,15 +411,16 @@ static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_neon(lv_16sc_t* out, const // 2nd lane holds the imaginary part int16x4x2_t a_val, b_val, c_val, accumulator; int16x4x2_t tmp_real, tmp_imag; - __VOLK_ATTR_ALIGNED(16) lv_16sc_t accum_result[4]; + __VOLK_ATTR_ALIGNED(16) + lv_16sc_t accum_result[4]; accumulator.val[0] = vdup_n_s16(0); accumulator.val[1] = vdup_n_s16(0); lv_16sc_t dotProduct = lv_cmake((int16_t)0, (int16_t)0); - for(number = 0; number < quarter_points; ++number) + for (number = 0; number < quarter_points; ++number) { - a_val = vld2_s16((int16_t*)a_ptr); // a0r|a1r|a2r|a3r || a0i|a1i|a2i|a3i - b_val = vld2_s16((int16_t*)b_ptr); // b0r|b1r|b2r|b3r || b0i|b1i|b2i|b3i + a_val = vld2_s16((int16_t*)a_ptr); // a0r|a1r|a2r|a3r || a0i|a1i|a2i|a3i + b_val = vld2_s16((int16_t*)b_ptr); // b0r|b1r|b2r|b3r || b0i|b1i|b2i|b3i __VOLK_GNSSSDR_PREFETCH(a_ptr + 8); __VOLK_GNSSSDR_PREFETCH(b_ptr + 8); @@ -451,7 +456,7 @@ static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_neon(lv_16sc_t* out, const } // tail case - for(number = quarter_points * 4; number < num_points; ++number) + for (number = quarter_points * 4; number < num_points; ++number) { *out += (*a_ptr++) * (*b_ptr++); } @@ -468,20 +473,21 @@ static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_neon_vma(lv_16sc_t* out, c unsigned int quarter_points = num_points / 4; unsigned int number; - lv_16sc_t* a_ptr = (lv_16sc_t*) in_a; - lv_16sc_t* b_ptr = (lv_16sc_t*) in_b; + lv_16sc_t* a_ptr = (lv_16sc_t*)in_a; + lv_16sc_t* b_ptr = (lv_16sc_t*)in_b; // for 2-lane vectors, 1st lane holds the real part, // 2nd lane holds the imaginary part int16x4x2_t a_val, b_val, accumulator; int16x4x2_t tmp; - __VOLK_ATTR_ALIGNED(16) lv_16sc_t accum_result[4]; + __VOLK_ATTR_ALIGNED(16) + lv_16sc_t accum_result[4]; accumulator.val[0] = vdup_n_s16(0); accumulator.val[1] = vdup_n_s16(0); - for(number = 0; number < quarter_points; ++number) + for (number = 0; number < quarter_points; ++number) { - a_val = vld2_s16((int16_t*)a_ptr); // a0r|a1r|a2r|a3r || a0i|a1i|a2i|a3i - b_val = vld2_s16((int16_t*)b_ptr); // b0r|b1r|b2r|b3r || b0i|b1i|b2i|b3i + a_val = vld2_s16((int16_t*)a_ptr); // a0r|a1r|a2r|a3r || a0i|a1i|a2i|a3i + b_val = vld2_s16((int16_t*)b_ptr); // b0r|b1r|b2r|b3r || b0i|b1i|b2i|b3i __VOLK_GNSSSDR_PREFETCH(a_ptr + 8); __VOLK_GNSSSDR_PREFETCH(b_ptr + 8); @@ -503,7 +509,7 @@ static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_neon_vma(lv_16sc_t* out, c *out = accum_result[0] + accum_result[1] + accum_result[2] + accum_result[3]; // tail case - for(number = quarter_points * 4; number < num_points; ++number) + for (number = quarter_points * 4; number < num_points; ++number) { *out += (*a_ptr++) * (*b_ptr++); } @@ -520,22 +526,23 @@ static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_neon_optvma(lv_16sc_t* out unsigned int quarter_points = num_points / 4; unsigned int number; - lv_16sc_t* a_ptr = (lv_16sc_t*) in_a; - lv_16sc_t* b_ptr = (lv_16sc_t*) in_b; + lv_16sc_t* a_ptr = (lv_16sc_t*)in_a; + lv_16sc_t* b_ptr = (lv_16sc_t*)in_b; // for 2-lane vectors, 1st lane holds the real part, // 2nd lane holds the imaginary part int16x4x2_t a_val, b_val, accumulator1, accumulator2; - __VOLK_ATTR_ALIGNED(16) lv_16sc_t accum_result[4]; + __VOLK_ATTR_ALIGNED(16) + lv_16sc_t accum_result[4]; accumulator1.val[0] = vdup_n_s16(0); accumulator1.val[1] = vdup_n_s16(0); accumulator2.val[0] = vdup_n_s16(0); accumulator2.val[1] = vdup_n_s16(0); - for(number = 0; number < quarter_points; ++number) + for (number = 0; number < quarter_points; ++number) { - a_val = vld2_s16((int16_t*)a_ptr); // a0r|a1r|a2r|a3r || a0i|a1i|a2i|a3i - b_val = vld2_s16((int16_t*)b_ptr); // b0r|b1r|b2r|b3r || b0i|b1i|b2i|b3i + a_val = vld2_s16((int16_t*)a_ptr); // a0r|a1r|a2r|a3r || a0i|a1i|a2i|a3i + b_val = vld2_s16((int16_t*)b_ptr); // b0r|b1r|b2r|b3r || b0i|b1i|b2i|b3i __VOLK_GNSSSDR_PREFETCH(a_ptr + 8); __VOLK_GNSSSDR_PREFETCH(b_ptr + 8); @@ -556,7 +563,7 @@ static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_neon_optvma(lv_16sc_t* out *out = accum_result[0] + accum_result[1] + accum_result[2] + accum_result[3]; // tail case - for(number = quarter_points * 4; number < num_points; ++number) + for (number = quarter_points * 4; number < num_points; ++number) { *out += (*a_ptr++) * (*b_ptr++); } diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_x2_dot_prod_16ic_xn.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_x2_dot_prod_16ic_xn.h index c1beceead..065fc75a8 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_x2_dot_prod_16ic_xn.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_x2_dot_prod_16ic_xn.h @@ -74,7 +74,7 @@ static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_xn_generic(lv_16sc_t* resu unsigned int n; for (n_vec = 0; n_vec < num_a_vectors; n_vec++) { - result[n_vec] = lv_cmake(0,0); + result[n_vec] = lv_cmake(0, 0); for (n = 0; n < num_points; n++) { //r*a.r - i*a.i, i*a.r + r*a.i @@ -96,11 +96,11 @@ static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_xn_generic_sat(lv_16sc_t* unsigned int n; for (n_vec = 0; n_vec < num_a_vectors; n_vec++) { - result[n_vec] = lv_cmake(0,0); + result[n_vec] = lv_cmake(0, 0); for (n = 0; n < num_points; n++) { - lv_16sc_t tmp = lv_cmake(sat_adds16i(sat_muls16i(lv_creal(in_common[n]), lv_creal(in_a[n_vec][n])), - sat_muls16i(lv_cimag(in_common[n]), lv_cimag(in_a[n_vec][n]))), - sat_adds16i(sat_muls16i(lv_creal(in_common[n]), lv_cimag(in_a[n_vec][n])), sat_muls16i(lv_cimag(in_common[n]), lv_creal(in_a[n_vec][n])))); + lv_16sc_t tmp = lv_cmake(sat_adds16i(sat_muls16i(lv_creal(in_common[n]), lv_creal(in_a[n_vec][n])), -sat_muls16i(lv_cimag(in_common[n]), lv_cimag(in_a[n_vec][n]))), + sat_adds16i(sat_muls16i(lv_creal(in_common[n]), lv_cimag(in_a[n_vec][n])), sat_muls16i(lv_cimag(in_common[n]), lv_creal(in_a[n_vec][n])))); result[n_vec] = lv_cmake(sat_adds16i(lv_creal(result[n_vec]), lv_creal(tmp)), sat_adds16i(lv_cimag(result[n_vec]), lv_cimag(tmp))); } } @@ -112,9 +112,9 @@ static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_xn_generic_sat(lv_16sc_t* #ifdef LV_HAVE_SSE2 #include -static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_xn_a_sse2(lv_16sc_t* result, const lv_16sc_t* in_common, const lv_16sc_t** in_a, int num_a_vectors, unsigned int num_points) +static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_xn_a_sse2(lv_16sc_t* result, const lv_16sc_t* in_common, const lv_16sc_t** in_a, int num_a_vectors, unsigned int num_points) { - lv_16sc_t dotProduct = lv_cmake(0,0); + lv_16sc_t dotProduct = lv_cmake(0, 0); int n_vec; unsigned int index; const unsigned int sse_iters = num_points / 4; @@ -125,7 +125,8 @@ static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_xn_a_sse2(lv_16sc_t* resul if (sse_iters > 0) { - __VOLK_ATTR_ALIGNED(16) lv_16sc_t dotProductVector[4]; + __VOLK_ATTR_ALIGNED(16) + lv_16sc_t dotProductVector[4]; __m128i* realcacc = (__m128i*)volk_gnsssdr_malloc(num_a_vectors * sizeof(__m128i), volk_gnsssdr_get_alignment()); __m128i* imagcacc = (__m128i*)volk_gnsssdr_malloc(num_a_vectors * sizeof(__m128i), volk_gnsssdr_get_alignment()); @@ -141,25 +142,25 @@ static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_xn_a_sse2(lv_16sc_t* resul mask_imag = _mm_set_epi8(0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0); mask_real = _mm_set_epi8(0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF); - for(index = 0; index < sse_iters; index++) + for (index = 0; index < sse_iters; index++) { // b[127:0]=[a3.i,a3.r,a2.i,a2.r,a1.i,a1.r,a0.i,a0.r] - b = _mm_load_si128((__m128i*)_in_common); //load (2 byte imag, 2 byte real) x 4 into 128 bits reg + b = _mm_load_si128((__m128i*)_in_common); //load (2 byte imag, 2 byte real) x 4 into 128 bits reg __VOLK_GNSSSDR_PREFETCH(_in_common + 8); for (n_vec = 0; n_vec < num_a_vectors; n_vec++) { - a = _mm_load_si128((__m128i*)&(_in_a[n_vec][index*4])); //load (2 byte imag, 2 byte real) x 4 into 128 bits reg + a = _mm_load_si128((__m128i*)&(_in_a[n_vec][index * 4])); //load (2 byte imag, 2 byte real) x 4 into 128 bits reg - c = _mm_mullo_epi16(a, b); // a3.i*b3.i, a3.r*b3.r, .... + c = _mm_mullo_epi16(a, b); // a3.i*b3.i, a3.r*b3.r, .... - c_sr = _mm_srli_si128(c, 2); // Shift a right by imm8 bytes while shifting in zeros, and store the results in dst. + c_sr = _mm_srli_si128(c, 2); // Shift a right by imm8 bytes while shifting in zeros, and store the results in dst. real = _mm_subs_epi16(c, c_sr); - c_sr = _mm_slli_si128(b, 2); // b3.r, b2.i .... - c = _mm_mullo_epi16(a, c_sr); // a3.i*b3.r, .... + c_sr = _mm_slli_si128(b, 2); // b3.r, b2.i .... + c = _mm_mullo_epi16(a, c_sr); // a3.i*b3.r, .... - c_sr = _mm_slli_si128(a, 2); // a3.r, a2.i .... - imag = _mm_mullo_epi16(b, c_sr); // b3.i*a3.r, .... + c_sr = _mm_slli_si128(a, 2); // a3.r, a2.i .... + imag = _mm_mullo_epi16(b, c_sr); // b3.i*a3.r, .... imag = _mm_adds_epi16(c, imag); @@ -176,12 +177,12 @@ static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_xn_a_sse2(lv_16sc_t* resul a = _mm_or_si128(realcacc[n_vec], imagcacc[n_vec]); - _mm_store_si128((__m128i*)dotProductVector, a); // Store the results back into the dot product vector - dotProduct = lv_cmake(0,0); + _mm_store_si128((__m128i*)dotProductVector, a); // Store the results back into the dot product vector + dotProduct = lv_cmake(0, 0); for (index = 0; index < 4; ++index) { dotProduct = lv_cmake(sat_adds16i(lv_creal(dotProduct), lv_creal(dotProductVector[index])), - sat_adds16i(lv_cimag(dotProduct), lv_cimag(dotProductVector[index]))); + sat_adds16i(lv_cimag(dotProduct), lv_cimag(dotProductVector[index]))); } _out[n_vec] = dotProduct; } @@ -191,12 +192,12 @@ static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_xn_a_sse2(lv_16sc_t* resul for (n_vec = 0; n_vec < num_a_vectors; n_vec++) { - for(index = sse_iters * 4; index < num_points; index++) + for (index = sse_iters * 4; index < num_points; index++) { lv_16sc_t tmp = in_common[index] * in_a[n_vec][index]; _out[n_vec] = lv_cmake(sat_adds16i(lv_creal(_out[n_vec]), lv_creal(tmp)), - sat_adds16i(lv_cimag(_out[n_vec]), lv_cimag(tmp))); + sat_adds16i(lv_cimag(_out[n_vec]), lv_cimag(tmp))); } } } @@ -206,9 +207,9 @@ static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_xn_a_sse2(lv_16sc_t* resul #ifdef LV_HAVE_SSE2 #include -static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_xn_u_sse2(lv_16sc_t* result, const lv_16sc_t* in_common, const lv_16sc_t** in_a, int num_a_vectors, unsigned int num_points) +static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_xn_u_sse2(lv_16sc_t* result, const lv_16sc_t* in_common, const lv_16sc_t** in_a, int num_a_vectors, unsigned int num_points) { - lv_16sc_t dotProduct = lv_cmake(0,0); + lv_16sc_t dotProduct = lv_cmake(0, 0); int n_vec; unsigned int index; const unsigned int sse_iters = num_points / 4; @@ -219,7 +220,8 @@ static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_xn_u_sse2(lv_16sc_t* resul if (sse_iters > 0) { - __VOLK_ATTR_ALIGNED(16) lv_16sc_t dotProductVector[4]; + __VOLK_ATTR_ALIGNED(16) + lv_16sc_t dotProductVector[4]; __m128i* realcacc = (__m128i*)volk_gnsssdr_malloc(num_a_vectors * sizeof(__m128i), volk_gnsssdr_get_alignment()); __m128i* imagcacc = (__m128i*)volk_gnsssdr_malloc(num_a_vectors * sizeof(__m128i), volk_gnsssdr_get_alignment()); @@ -235,25 +237,25 @@ static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_xn_u_sse2(lv_16sc_t* resul mask_imag = _mm_set_epi8(0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0); mask_real = _mm_set_epi8(0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF); - for(index = 0; index < sse_iters; index++) + for (index = 0; index < sse_iters; index++) { // b[127:0]=[a3.i,a3.r,a2.i,a2.r,a1.i,a1.r,a0.i,a0.r] - b = _mm_loadu_si128((__m128i*)_in_common); //load (2 byte imag, 2 byte real) x 4 into 128 bits reg + b = _mm_loadu_si128((__m128i*)_in_common); //load (2 byte imag, 2 byte real) x 4 into 128 bits reg __VOLK_GNSSSDR_PREFETCH(_in_common + 8); for (n_vec = 0; n_vec < num_a_vectors; n_vec++) { - a = _mm_loadu_si128((__m128i*)&(_in_a[n_vec][index*4])); //load (2 byte imag, 2 byte real) x 4 into 128 bits reg + a = _mm_loadu_si128((__m128i*)&(_in_a[n_vec][index * 4])); //load (2 byte imag, 2 byte real) x 4 into 128 bits reg - c = _mm_mullo_epi16(a, b); // a3.i*b3.i, a3.r*b3.r, .... + c = _mm_mullo_epi16(a, b); // a3.i*b3.i, a3.r*b3.r, .... - c_sr = _mm_srli_si128(c, 2); // Shift a right by imm8 bytes while shifting in zeros, and store the results in dst. + c_sr = _mm_srli_si128(c, 2); // Shift a right by imm8 bytes while shifting in zeros, and store the results in dst. real = _mm_subs_epi16(c, c_sr); - c_sr = _mm_slli_si128(b, 2); // b3.r, b2.i .... - c = _mm_mullo_epi16(a, c_sr); // a3.i*b3.r, .... + c_sr = _mm_slli_si128(b, 2); // b3.r, b2.i .... + c = _mm_mullo_epi16(a, c_sr); // a3.i*b3.r, .... - c_sr = _mm_slli_si128(a, 2); // a3.r, a2.i .... - imag = _mm_mullo_epi16(b, c_sr); // b3.i*a3.r, .... + c_sr = _mm_slli_si128(a, 2); // a3.r, a2.i .... + imag = _mm_mullo_epi16(b, c_sr); // b3.i*a3.r, .... imag = _mm_adds_epi16(c, imag); @@ -270,12 +272,12 @@ static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_xn_u_sse2(lv_16sc_t* resul a = _mm_or_si128(realcacc[n_vec], imagcacc[n_vec]); - _mm_store_si128((__m128i*)dotProductVector, a); // Store the results back into the dot product vector - dotProduct = lv_cmake(0,0); + _mm_store_si128((__m128i*)dotProductVector, a); // Store the results back into the dot product vector + dotProduct = lv_cmake(0, 0); for (index = 0; index < 4; ++index) { dotProduct = lv_cmake(sat_adds16i(lv_creal(dotProduct), lv_creal(dotProductVector[index])), - sat_adds16i(lv_cimag(dotProduct), lv_cimag(dotProductVector[index]))); + sat_adds16i(lv_cimag(dotProduct), lv_cimag(dotProductVector[index]))); } _out[n_vec] = dotProduct; } @@ -285,12 +287,12 @@ static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_xn_u_sse2(lv_16sc_t* resul for (n_vec = 0; n_vec < num_a_vectors; n_vec++) { - for(index = sse_iters * 4; index < num_points; index++) + for (index = sse_iters * 4; index < num_points; index++) { lv_16sc_t tmp = in_common[index] * in_a[n_vec][index]; _out[n_vec] = lv_cmake(sat_adds16i(lv_creal(_out[n_vec]), lv_creal(tmp)), - sat_adds16i(lv_cimag(_out[n_vec]), lv_cimag(tmp))); + sat_adds16i(lv_cimag(_out[n_vec]), lv_cimag(tmp))); } } } @@ -300,9 +302,9 @@ static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_xn_u_sse2(lv_16sc_t* resul #ifdef LV_HAVE_AVX2 #include -static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_xn_a_avx2(lv_16sc_t* result, const lv_16sc_t* in_common, const lv_16sc_t** in_a, int num_a_vectors, unsigned int num_points) +static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_xn_a_avx2(lv_16sc_t* result, const lv_16sc_t* in_common, const lv_16sc_t** in_a, int num_a_vectors, unsigned int num_points) { - lv_16sc_t dotProduct = lv_cmake(0,0); + lv_16sc_t dotProduct = lv_cmake(0, 0); int n_vec; unsigned int index; const unsigned int sse_iters = num_points / 8; @@ -313,7 +315,8 @@ static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_xn_a_avx2(lv_16sc_t* resul if (sse_iters > 0) { - __VOLK_ATTR_ALIGNED(32) lv_16sc_t dotProductVector[8]; + __VOLK_ATTR_ALIGNED(32) + lv_16sc_t dotProductVector[8]; __m256i* realcacc = (__m256i*)volk_gnsssdr_malloc(num_a_vectors * sizeof(__m256i), volk_gnsssdr_get_alignment()); __m256i* imagcacc = (__m256i*)volk_gnsssdr_malloc(num_a_vectors * sizeof(__m256i), volk_gnsssdr_get_alignment()); @@ -329,24 +332,24 @@ static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_xn_a_avx2(lv_16sc_t* resul mask_imag = _mm256_set_epi8(0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0); mask_real = _mm256_set_epi8(0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF); - for(index = 0; index < sse_iters; index++) + for (index = 0; index < sse_iters; index++) { b = _mm256_load_si256((__m256i*)_in_common); __VOLK_GNSSSDR_PREFETCH(_in_common + 16); for (n_vec = 0; n_vec < num_a_vectors; n_vec++) { - a = _mm256_load_si256((__m256i*)&(_in_a[n_vec][index*8])); + a = _mm256_load_si256((__m256i*)&(_in_a[n_vec][index * 8])); c = _mm256_mullo_epi16(a, b); - c_sr = _mm256_srli_si256(c, 2); // Shift a right by imm8 bytes while shifting in zeros, and store the results in dst. + c_sr = _mm256_srli_si256(c, 2); // Shift a right by imm8 bytes while shifting in zeros, and store the results in dst. real = _mm256_subs_epi16(c, c_sr); - c_sr = _mm256_slli_si256(b, 2); // b3.r, b2.i .... - c = _mm256_mullo_epi16(a, c_sr); // a3.i*b3.r, .... + c_sr = _mm256_slli_si256(b, 2); // b3.r, b2.i .... + c = _mm256_mullo_epi16(a, c_sr); // a3.i*b3.r, .... - c_sr = _mm256_slli_si256(a, 2); // a3.r, a2.i .... - imag = _mm256_mullo_epi16(b, c_sr); // b3.i*a3.r, .... + c_sr = _mm256_slli_si256(a, 2); // a3.r, a2.i .... + imag = _mm256_mullo_epi16(b, c_sr); // b3.i*a3.r, .... imag = _mm256_adds_epi16(c, imag); @@ -363,12 +366,12 @@ static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_xn_a_avx2(lv_16sc_t* resul a = _mm256_or_si256(realcacc[n_vec], imagcacc[n_vec]); - _mm256_store_si256((__m256i*)dotProductVector, a); // Store the results back into the dot product vector - dotProduct = lv_cmake(0,0); + _mm256_store_si256((__m256i*)dotProductVector, a); // Store the results back into the dot product vector + dotProduct = lv_cmake(0, 0); for (index = 0; index < 8; ++index) { dotProduct = lv_cmake(sat_adds16i(lv_creal(dotProduct), lv_creal(dotProductVector[index])), - sat_adds16i(lv_cimag(dotProduct), lv_cimag(dotProductVector[index]))); + sat_adds16i(lv_cimag(dotProduct), lv_cimag(dotProductVector[index]))); } _out[n_vec] = dotProduct; } @@ -379,12 +382,12 @@ static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_xn_a_avx2(lv_16sc_t* resul for (n_vec = 0; n_vec < num_a_vectors; n_vec++) { - for(index = sse_iters * 8; index < num_points; index++) + for (index = sse_iters * 8; index < num_points; index++) { lv_16sc_t tmp = in_common[index] * in_a[n_vec][index]; _out[n_vec] = lv_cmake(sat_adds16i(lv_creal(_out[n_vec]), lv_creal(tmp)), - sat_adds16i(lv_cimag(_out[n_vec]), lv_cimag(tmp))); + sat_adds16i(lv_cimag(_out[n_vec]), lv_cimag(tmp))); } } } @@ -394,9 +397,9 @@ static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_xn_a_avx2(lv_16sc_t* resul #ifdef LV_HAVE_AVX2 #include -static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_xn_u_avx2(lv_16sc_t* result, const lv_16sc_t* in_common, const lv_16sc_t** in_a, int num_a_vectors, unsigned int num_points) +static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_xn_u_avx2(lv_16sc_t* result, const lv_16sc_t* in_common, const lv_16sc_t** in_a, int num_a_vectors, unsigned int num_points) { - lv_16sc_t dotProduct = lv_cmake(0,0); + lv_16sc_t dotProduct = lv_cmake(0, 0); const unsigned int sse_iters = num_points / 8; int n_vec; @@ -407,7 +410,8 @@ static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_xn_u_avx2(lv_16sc_t* resul if (sse_iters > 0) { - __VOLK_ATTR_ALIGNED(32) lv_16sc_t dotProductVector[8]; + __VOLK_ATTR_ALIGNED(32) + lv_16sc_t dotProductVector[8]; __m256i* realcacc = (__m256i*)volk_gnsssdr_malloc(num_a_vectors * sizeof(__m256i), volk_gnsssdr_get_alignment()); __m256i* imagcacc = (__m256i*)volk_gnsssdr_malloc(num_a_vectors * sizeof(__m256i), volk_gnsssdr_get_alignment()); @@ -423,24 +427,24 @@ static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_xn_u_avx2(lv_16sc_t* resul mask_imag = _mm256_set_epi8(0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0); mask_real = _mm256_set_epi8(0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF); - for(index = 0; index < sse_iters; index++) + for (index = 0; index < sse_iters; index++) { b = _mm256_loadu_si256((__m256i*)_in_common); __VOLK_GNSSSDR_PREFETCH(_in_common + 16); for (n_vec = 0; n_vec < num_a_vectors; n_vec++) { - a = _mm256_loadu_si256((__m256i*)&(_in_a[n_vec][index*8])); + a = _mm256_loadu_si256((__m256i*)&(_in_a[n_vec][index * 8])); c = _mm256_mullo_epi16(a, b); - c_sr = _mm256_srli_si256(c, 2); // Shift a right by imm8 bytes while shifting in zeros, and store the results in dst. + c_sr = _mm256_srli_si256(c, 2); // Shift a right by imm8 bytes while shifting in zeros, and store the results in dst. real = _mm256_subs_epi16(c, c_sr); - c_sr = _mm256_slli_si256(b, 2); // b3.r, b2.i .... - c = _mm256_mullo_epi16(a, c_sr); // a3.i*b3.r, .... + c_sr = _mm256_slli_si256(b, 2); // b3.r, b2.i .... + c = _mm256_mullo_epi16(a, c_sr); // a3.i*b3.r, .... - c_sr = _mm256_slli_si256(a, 2); // a3.r, a2.i .... - imag = _mm256_mullo_epi16(b, c_sr); // b3.i*a3.r, .... + c_sr = _mm256_slli_si256(a, 2); // a3.r, a2.i .... + imag = _mm256_mullo_epi16(b, c_sr); // b3.i*a3.r, .... imag = _mm256_adds_epi16(c, imag); @@ -457,12 +461,12 @@ static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_xn_u_avx2(lv_16sc_t* resul a = _mm256_or_si256(realcacc[n_vec], imagcacc[n_vec]); - _mm256_store_si256((__m256i*)dotProductVector, a); // Store the results back into the dot product vector - dotProduct = lv_cmake(0,0); + _mm256_store_si256((__m256i*)dotProductVector, a); // Store the results back into the dot product vector + dotProduct = lv_cmake(0, 0); for (index = 0; index < 8; ++index) { dotProduct = lv_cmake(sat_adds16i(lv_creal(dotProduct), lv_creal(dotProductVector[index])), - sat_adds16i(lv_cimag(dotProduct), lv_cimag(dotProductVector[index]))); + sat_adds16i(lv_cimag(dotProduct), lv_cimag(dotProductVector[index]))); } _out[n_vec] = dotProduct; } @@ -473,12 +477,12 @@ static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_xn_u_avx2(lv_16sc_t* resul for (n_vec = 0; n_vec < num_a_vectors; n_vec++) { - for(index = sse_iters * 8; index < num_points; index++) + for (index = sse_iters * 8; index < num_points; index++) { lv_16sc_t tmp = in_common[index] * in_a[n_vec][index]; _out[n_vec] = lv_cmake(sat_adds16i(lv_creal(_out[n_vec]), lv_creal(tmp)), - sat_adds16i(lv_cimag(_out[n_vec]), lv_cimag(tmp))); + sat_adds16i(lv_cimag(_out[n_vec]), lv_cimag(tmp))); } } } @@ -488,9 +492,9 @@ static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_xn_u_avx2(lv_16sc_t* resul #ifdef LV_HAVE_NEON #include -static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_xn_neon(lv_16sc_t* result, const lv_16sc_t* in_common, const lv_16sc_t** in_a, int num_a_vectors, unsigned int num_points) +static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_xn_neon(lv_16sc_t* result, const lv_16sc_t* in_common, const lv_16sc_t** in_a, int num_a_vectors, unsigned int num_points) { - lv_16sc_t dotProduct = lv_cmake(0,0); + lv_16sc_t dotProduct = lv_cmake(0, 0); int n_vec; unsigned int index; const unsigned int neon_iters = num_points / 4; @@ -501,7 +505,8 @@ static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_xn_neon(lv_16sc_t* result, if (neon_iters > 0) { - __VOLK_ATTR_ALIGNED(16) lv_16sc_t dotProductVector[4]; + __VOLK_ATTR_ALIGNED(16) + lv_16sc_t dotProductVector[4]; int16x4x2_t a_val, b_val, c_val; @@ -509,19 +514,19 @@ static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_xn_neon(lv_16sc_t* result, int16x4x2_t tmp_real, tmp_imag; - for(n_vec = 0; n_vec < num_a_vectors; n_vec++) + for (n_vec = 0; n_vec < num_a_vectors; n_vec++) { accumulator[n_vec].val[0] = vdup_n_s16(0); accumulator[n_vec].val[1] = vdup_n_s16(0); } - for(index = 0; index < neon_iters; index++) + for (index = 0; index < neon_iters; index++) { - b_val = vld2_s16((int16_t*)_in_common); //load (2 byte imag, 2 byte real) x 4 into 128 bits reg + b_val = vld2_s16((int16_t*)_in_common); //load (2 byte imag, 2 byte real) x 4 into 128 bits reg __VOLK_GNSSSDR_PREFETCH(_in_common + 8); for (n_vec = 0; n_vec < num_a_vectors; n_vec++) { - a_val = vld2_s16((int16_t*)&(_in_a[n_vec][index*4])); //load (2 byte imag, 2 byte real) x 4 into 128 bits reg + a_val = vld2_s16((int16_t*)&(_in_a[n_vec][index * 4])); //load (2 byte imag, 2 byte real) x 4 into 128 bits reg //__VOLK_GNSSSDR_PREFETCH(&_in_a[n_vec][index*4] + 8); // multiply the real*real and imag*imag to get real result @@ -547,12 +552,12 @@ static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_xn_neon(lv_16sc_t* result, for (n_vec = 0; n_vec < num_a_vectors; n_vec++) { - vst2_s16((int16_t*)dotProductVector, accumulator[n_vec]); // Store the results back into the dot product vector - dotProduct = lv_cmake(0,0); + vst2_s16((int16_t*)dotProductVector, accumulator[n_vec]); // Store the results back into the dot product vector + dotProduct = lv_cmake(0, 0); for (index = 0; index < 4; ++index) { dotProduct = lv_cmake(sat_adds16i(lv_creal(dotProduct), lv_creal(dotProductVector[index])), - sat_adds16i(lv_cimag(dotProduct), lv_cimag(dotProductVector[index]))); + sat_adds16i(lv_cimag(dotProduct), lv_cimag(dotProductVector[index]))); } _out[n_vec] = dotProduct; } @@ -561,12 +566,12 @@ static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_xn_neon(lv_16sc_t* result, for (n_vec = 0; n_vec < num_a_vectors; n_vec++) { - for(index = neon_iters * 4; index < num_points; index++) + for (index = neon_iters * 4; index < num_points; index++) { lv_16sc_t tmp = in_common[index] * in_a[n_vec][index]; _out[n_vec] = lv_cmake(sat_adds16i(lv_creal(_out[n_vec]), lv_creal(tmp)), - sat_adds16i(lv_cimag(_out[n_vec]), lv_cimag(tmp))); + sat_adds16i(lv_cimag(_out[n_vec]), lv_cimag(tmp))); } } } @@ -576,9 +581,9 @@ static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_xn_neon(lv_16sc_t* result, #ifdef LV_HAVE_NEON #include -static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_xn_neon_vma(lv_16sc_t* result, const lv_16sc_t* in_common, const lv_16sc_t** in_a, int num_a_vectors, unsigned int num_points) +static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_xn_neon_vma(lv_16sc_t* result, const lv_16sc_t* in_common, const lv_16sc_t** in_a, int num_a_vectors, unsigned int num_points) { - lv_16sc_t dotProduct = lv_cmake(0,0); + lv_16sc_t dotProduct = lv_cmake(0, 0); const unsigned int neon_iters = num_points / 4; int n_vec; @@ -589,25 +594,26 @@ static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_xn_neon_vma(lv_16sc_t* res if (neon_iters > 0) { - __VOLK_ATTR_ALIGNED(16) lv_16sc_t dotProductVector[4]; + __VOLK_ATTR_ALIGNED(16) + lv_16sc_t dotProductVector[4]; int16x4x2_t a_val, b_val, tmp; int16x4x2_t* accumulator = (int16x4x2_t*)volk_gnsssdr_malloc(num_a_vectors * sizeof(int16x4x2_t), volk_gnsssdr_get_alignment()); - for(n_vec = 0; n_vec < num_a_vectors; n_vec++) + for (n_vec = 0; n_vec < num_a_vectors; n_vec++) { accumulator[n_vec].val[0] = vdup_n_s16(0); accumulator[n_vec].val[1] = vdup_n_s16(0); } - for(index = 0; index < neon_iters; index++) + for (index = 0; index < neon_iters; index++) { - b_val = vld2_s16((int16_t*)_in_common); //load (2 byte imag, 2 byte real) x 4 into 128 bits reg + b_val = vld2_s16((int16_t*)_in_common); //load (2 byte imag, 2 byte real) x 4 into 128 bits reg __VOLK_GNSSSDR_PREFETCH(_in_common + 8); for (n_vec = 0; n_vec < num_a_vectors; n_vec++) { - a_val = vld2_s16((int16_t*)&(_in_a[n_vec][index*4])); + a_val = vld2_s16((int16_t*)&(_in_a[n_vec][index * 4])); tmp.val[0] = vmul_s16(a_val.val[0], b_val.val[0]); tmp.val[1] = vmul_s16(a_val.val[1], b_val.val[0]); @@ -624,12 +630,12 @@ static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_xn_neon_vma(lv_16sc_t* res for (n_vec = 0; n_vec < num_a_vectors; n_vec++) { - vst2_s16((int16_t*)dotProductVector, accumulator[n_vec]); // Store the results back into the dot product vector - dotProduct = lv_cmake(0,0); + vst2_s16((int16_t*)dotProductVector, accumulator[n_vec]); // Store the results back into the dot product vector + dotProduct = lv_cmake(0, 0); for (index = 0; index < 4; ++index) { dotProduct = lv_cmake(sat_adds16i(lv_creal(dotProduct), lv_creal(dotProductVector[index])), - sat_adds16i(lv_cimag(dotProduct), lv_cimag(dotProductVector[index]))); + sat_adds16i(lv_cimag(dotProduct), lv_cimag(dotProductVector[index]))); } _out[n_vec] = dotProduct; } @@ -638,12 +644,12 @@ static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_xn_neon_vma(lv_16sc_t* res for (n_vec = 0; n_vec < num_a_vectors; n_vec++) { - for(index = neon_iters * 4; index < num_points; index++) + for (index = neon_iters * 4; index < num_points; index++) { lv_16sc_t tmp = in_common[index] * in_a[n_vec][index]; _out[n_vec] = lv_cmake(sat_adds16i(lv_creal(_out[n_vec]), lv_creal(tmp)), - sat_adds16i(lv_cimag(_out[n_vec]), lv_cimag(tmp))); + sat_adds16i(lv_cimag(_out[n_vec]), lv_cimag(tmp))); } } } @@ -653,9 +659,9 @@ static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_xn_neon_vma(lv_16sc_t* res #ifdef LV_HAVE_NEON #include -static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_xn_neon_optvma(lv_16sc_t* result, const lv_16sc_t* in_common, const lv_16sc_t** in_a, int num_a_vectors, unsigned int num_points) +static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_xn_neon_optvma(lv_16sc_t* result, const lv_16sc_t* in_common, const lv_16sc_t** in_a, int num_a_vectors, unsigned int num_points) { - lv_16sc_t dotProduct = lv_cmake(0,0); + lv_16sc_t dotProduct = lv_cmake(0, 0); const unsigned int neon_iters = num_points / 4; int n_vec; @@ -666,14 +672,15 @@ static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_xn_neon_optvma(lv_16sc_t* if (neon_iters > 0) { - __VOLK_ATTR_ALIGNED(16) lv_16sc_t dotProductVector[4]; + __VOLK_ATTR_ALIGNED(16) + lv_16sc_t dotProductVector[4]; int16x4x2_t a_val, b_val; int16x4x2_t* accumulator1 = (int16x4x2_t*)volk_gnsssdr_malloc(num_a_vectors * sizeof(int16x4x2_t), volk_gnsssdr_get_alignment()); int16x4x2_t* accumulator2 = (int16x4x2_t*)volk_gnsssdr_malloc(num_a_vectors * sizeof(int16x4x2_t), volk_gnsssdr_get_alignment()); - for(n_vec = 0; n_vec < num_a_vectors; n_vec++) + for (n_vec = 0; n_vec < num_a_vectors; n_vec++) { accumulator1[n_vec].val[0] = vdup_n_s16(0); accumulator1[n_vec].val[1] = vdup_n_s16(0); @@ -681,13 +688,13 @@ static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_xn_neon_optvma(lv_16sc_t* accumulator2[n_vec].val[1] = vdup_n_s16(0); } - for(index = 0; index < neon_iters; index++) + for (index = 0; index < neon_iters; index++) { - b_val = vld2_s16((int16_t*)_in_common); //load (2 byte imag, 2 byte real) x 4 into 128 bits reg + b_val = vld2_s16((int16_t*)_in_common); //load (2 byte imag, 2 byte real) x 4 into 128 bits reg __VOLK_GNSSSDR_PREFETCH(_in_common + 8); for (n_vec = 0; n_vec < num_a_vectors; n_vec++) { - a_val = vld2_s16((int16_t*)&(_in_a[n_vec][index*4])); + a_val = vld2_s16((int16_t*)&(_in_a[n_vec][index * 4])); accumulator1[n_vec].val[0] = vmla_s16(accumulator1[n_vec].val[0], a_val.val[0], b_val.val[0]); accumulator1[n_vec].val[1] = vmla_s16(accumulator1[n_vec].val[1], a_val.val[0], b_val.val[1]); @@ -705,12 +712,12 @@ static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_xn_neon_optvma(lv_16sc_t* for (n_vec = 0; n_vec < num_a_vectors; n_vec++) { - vst2_s16((int16_t*)dotProductVector, accumulator1[n_vec]); // Store the results back into the dot product vector - dotProduct = lv_cmake(0,0); + vst2_s16((int16_t*)dotProductVector, accumulator1[n_vec]); // Store the results back into the dot product vector + dotProduct = lv_cmake(0, 0); for (index = 0; index < 4; ++index) { dotProduct = lv_cmake(sat_adds16i(lv_creal(dotProduct), lv_creal(dotProductVector[index])), - sat_adds16i(lv_cimag(dotProduct), lv_cimag(dotProductVector[index]))); + sat_adds16i(lv_cimag(dotProduct), lv_cimag(dotProductVector[index]))); } _out[n_vec] = dotProduct; } @@ -720,12 +727,12 @@ static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_xn_neon_optvma(lv_16sc_t* for (n_vec = 0; n_vec < num_a_vectors; n_vec++) { - for(index = neon_iters * 4; index < num_points; index++) + for (index = neon_iters * 4; index < num_points; index++) { lv_16sc_t tmp = in_common[index] * in_a[n_vec][index]; _out[n_vec] = lv_cmake(sat_adds16i(lv_creal(_out[n_vec]), lv_creal(tmp)), - sat_adds16i(lv_cimag(_out[n_vec]), lv_cimag(tmp))); + sat_adds16i(lv_cimag(_out[n_vec]), lv_cimag(tmp))); } } } diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_x2_dotprodxnpuppet_16ic.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_x2_dotprodxnpuppet_16ic.h index 549fff25d..ad2ec4a77 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_x2_dotprodxnpuppet_16ic.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_x2_dotprodxnpuppet_16ic.h @@ -47,22 +47,22 @@ static inline void volk_gnsssdr_16ic_x2_dotprodxnpuppet_16ic_generic(lv_16sc_t* int num_a_vectors = 3; lv_16sc_t** in_a = (lv_16sc_t**)volk_gnsssdr_malloc(sizeof(lv_16sc_t*) * num_a_vectors, volk_gnsssdr_get_alignment()); unsigned int n; - for(n = 0; n < num_a_vectors; n++) - { - in_a[n] = (lv_16sc_t*)volk_gnsssdr_malloc(sizeof(lv_16sc_t) * num_points, volk_gnsssdr_get_alignment()); - memcpy((lv_16sc_t*)in_a[n], (lv_16sc_t*)in, sizeof(lv_16sc_t) * num_points); - } + for (n = 0; n < num_a_vectors; n++) + { + in_a[n] = (lv_16sc_t*)volk_gnsssdr_malloc(sizeof(lv_16sc_t) * num_points, volk_gnsssdr_get_alignment()); + memcpy((lv_16sc_t*)in_a[n], (lv_16sc_t*)in, sizeof(lv_16sc_t) * num_points); + } - volk_gnsssdr_16ic_x2_dot_prod_16ic_xn_generic(result, local_code, (const lv_16sc_t**) in_a, num_a_vectors, num_points); + volk_gnsssdr_16ic_x2_dot_prod_16ic_xn_generic(result, local_code, (const lv_16sc_t**)in_a, num_a_vectors, num_points); - for(n = 0; n < num_a_vectors; n++) - { - volk_gnsssdr_free(in_a[n]); - } + for (n = 0; n < num_a_vectors; n++) + { + volk_gnsssdr_free(in_a[n]); + } volk_gnsssdr_free(in_a); } -#endif /* Generic */ +#endif /* Generic */ #ifdef LV_HAVE_GENERIC @@ -71,22 +71,22 @@ static inline void volk_gnsssdr_16ic_x2_dotprodxnpuppet_16ic_generic_sat(lv_16sc int num_a_vectors = 3; lv_16sc_t** in_a = (lv_16sc_t**)volk_gnsssdr_malloc(sizeof(lv_16sc_t*) * num_a_vectors, volk_gnsssdr_get_alignment()); unsigned int n; - for(n = 0; n < num_a_vectors; n++) - { - in_a[n] = (lv_16sc_t*)volk_gnsssdr_malloc(sizeof(lv_16sc_t) * num_points, volk_gnsssdr_get_alignment()); - memcpy((lv_16sc_t*)in_a[n], (lv_16sc_t*)in, sizeof(lv_16sc_t) * num_points); - } + for (n = 0; n < num_a_vectors; n++) + { + in_a[n] = (lv_16sc_t*)volk_gnsssdr_malloc(sizeof(lv_16sc_t) * num_points, volk_gnsssdr_get_alignment()); + memcpy((lv_16sc_t*)in_a[n], (lv_16sc_t*)in, sizeof(lv_16sc_t) * num_points); + } - volk_gnsssdr_16ic_x2_dot_prod_16ic_xn_generic_sat(result, local_code, (const lv_16sc_t**) in_a, num_a_vectors, num_points); + volk_gnsssdr_16ic_x2_dot_prod_16ic_xn_generic_sat(result, local_code, (const lv_16sc_t**)in_a, num_a_vectors, num_points); - for(n = 0; n < num_a_vectors; n++) - { - volk_gnsssdr_free(in_a[n]); - } + for (n = 0; n < num_a_vectors; n++) + { + volk_gnsssdr_free(in_a[n]); + } volk_gnsssdr_free(in_a); } -#endif /* Generic */ +#endif /* Generic */ #ifdef LV_HAVE_SSE2 @@ -95,18 +95,18 @@ static inline void volk_gnsssdr_16ic_x2_dotprodxnpuppet_16ic_a_sse2(lv_16sc_t* r int num_a_vectors = 3; lv_16sc_t** in_a = (lv_16sc_t**)volk_gnsssdr_malloc(sizeof(lv_16sc_t*) * num_a_vectors, volk_gnsssdr_get_alignment()); unsigned int n; - for(n = 0; n < num_a_vectors; n++) - { - in_a[n] = (lv_16sc_t*)volk_gnsssdr_malloc(sizeof(lv_16sc_t) * num_points, volk_gnsssdr_get_alignment()); - memcpy((lv_16sc_t*)in_a[n], (lv_16sc_t*)in, sizeof(lv_16sc_t) * num_points); - } + for (n = 0; n < num_a_vectors; n++) + { + in_a[n] = (lv_16sc_t*)volk_gnsssdr_malloc(sizeof(lv_16sc_t) * num_points, volk_gnsssdr_get_alignment()); + memcpy((lv_16sc_t*)in_a[n], (lv_16sc_t*)in, sizeof(lv_16sc_t) * num_points); + } - volk_gnsssdr_16ic_x2_dot_prod_16ic_xn_a_sse2(result, local_code, (const lv_16sc_t**) in_a, num_a_vectors, num_points); + volk_gnsssdr_16ic_x2_dot_prod_16ic_xn_a_sse2(result, local_code, (const lv_16sc_t**)in_a, num_a_vectors, num_points); - for(n = 0; n < num_a_vectors; n++) - { - volk_gnsssdr_free(in_a[n]); - } + for (n = 0; n < num_a_vectors; n++) + { + volk_gnsssdr_free(in_a[n]); + } volk_gnsssdr_free(in_a); } @@ -120,18 +120,18 @@ static inline void volk_gnsssdr_16ic_x2_dotprodxnpuppet_16ic_u_sse2(lv_16sc_t* r int num_a_vectors = 3; lv_16sc_t** in_a = (lv_16sc_t**)volk_gnsssdr_malloc(sizeof(lv_16sc_t*) * num_a_vectors, volk_gnsssdr_get_alignment()); unsigned int n; - for(n = 0; n < num_a_vectors; n++) - { - in_a[n] = (lv_16sc_t*)volk_gnsssdr_malloc(sizeof(lv_16sc_t)*num_points, volk_gnsssdr_get_alignment()); - memcpy((lv_16sc_t*)in_a[n], (lv_16sc_t*)in, sizeof(lv_16sc_t)*num_points); - } + for (n = 0; n < num_a_vectors; n++) + { + in_a[n] = (lv_16sc_t*)volk_gnsssdr_malloc(sizeof(lv_16sc_t) * num_points, volk_gnsssdr_get_alignment()); + memcpy((lv_16sc_t*)in_a[n], (lv_16sc_t*)in, sizeof(lv_16sc_t) * num_points); + } - volk_gnsssdr_16ic_x2_dot_prod_16ic_xn_u_sse2(result, local_code, (const lv_16sc_t**) in_a, num_a_vectors, num_points); + volk_gnsssdr_16ic_x2_dot_prod_16ic_xn_u_sse2(result, local_code, (const lv_16sc_t**)in_a, num_a_vectors, num_points); - for(n = 0; n < num_a_vectors; n++) - { - volk_gnsssdr_free(in_a[n]); - } + for (n = 0; n < num_a_vectors; n++) + { + volk_gnsssdr_free(in_a[n]); + } volk_gnsssdr_free(in_a); } @@ -145,18 +145,18 @@ static inline void volk_gnsssdr_16ic_x2_dotprodxnpuppet_16ic_a_avx2(lv_16sc_t* r int num_a_vectors = 3; lv_16sc_t** in_a = (lv_16sc_t**)volk_gnsssdr_malloc(sizeof(lv_16sc_t*) * num_a_vectors, volk_gnsssdr_get_alignment()); unsigned int n; - for(n = 0; n < num_a_vectors; n++) - { - in_a[n] = (lv_16sc_t*)volk_gnsssdr_malloc(sizeof(lv_16sc_t)*num_points, volk_gnsssdr_get_alignment()); - memcpy((lv_16sc_t*)in_a[n], (lv_16sc_t*)in, sizeof(lv_16sc_t)*num_points); - } + for (n = 0; n < num_a_vectors; n++) + { + in_a[n] = (lv_16sc_t*)volk_gnsssdr_malloc(sizeof(lv_16sc_t) * num_points, volk_gnsssdr_get_alignment()); + memcpy((lv_16sc_t*)in_a[n], (lv_16sc_t*)in, sizeof(lv_16sc_t) * num_points); + } - volk_gnsssdr_16ic_x2_dot_prod_16ic_xn_a_avx2(result, local_code, (const lv_16sc_t**) in_a, num_a_vectors, num_points); + volk_gnsssdr_16ic_x2_dot_prod_16ic_xn_a_avx2(result, local_code, (const lv_16sc_t**)in_a, num_a_vectors, num_points); - for(n = 0; n < num_a_vectors; n++) - { - volk_gnsssdr_free(in_a[n]); - } + for (n = 0; n < num_a_vectors; n++) + { + volk_gnsssdr_free(in_a[n]); + } volk_gnsssdr_free(in_a); } @@ -170,18 +170,18 @@ static inline void volk_gnsssdr_16ic_x2_dotprodxnpuppet_16ic_u_avx2(lv_16sc_t* r int num_a_vectors = 3; lv_16sc_t** in_a = (lv_16sc_t**)volk_gnsssdr_malloc(sizeof(lv_16sc_t*) * num_a_vectors, volk_gnsssdr_get_alignment()); unsigned int n; - for(n = 0; n < num_a_vectors; n++) - { - in_a[n] = (lv_16sc_t*)volk_gnsssdr_malloc(sizeof(lv_16sc_t)*num_points, volk_gnsssdr_get_alignment()); - memcpy((lv_16sc_t*)in_a[n], (lv_16sc_t*)in, sizeof(lv_16sc_t)*num_points); - } + for (n = 0; n < num_a_vectors; n++) + { + in_a[n] = (lv_16sc_t*)volk_gnsssdr_malloc(sizeof(lv_16sc_t) * num_points, volk_gnsssdr_get_alignment()); + memcpy((lv_16sc_t*)in_a[n], (lv_16sc_t*)in, sizeof(lv_16sc_t) * num_points); + } - volk_gnsssdr_16ic_x2_dot_prod_16ic_xn_u_avx2(result, local_code, (const lv_16sc_t**) in_a, num_a_vectors, num_points); + volk_gnsssdr_16ic_x2_dot_prod_16ic_xn_u_avx2(result, local_code, (const lv_16sc_t**)in_a, num_a_vectors, num_points); - for(n = 0; n < num_a_vectors; n++) - { - volk_gnsssdr_free(in_a[n]); - } + for (n = 0; n < num_a_vectors; n++) + { + volk_gnsssdr_free(in_a[n]); + } volk_gnsssdr_free(in_a); } @@ -195,22 +195,22 @@ static inline void volk_gnsssdr_16ic_x2_dotprodxnpuppet_16ic_neon(lv_16sc_t* res int num_a_vectors = 3; lv_16sc_t** in_a = (lv_16sc_t**)volk_gnsssdr_malloc(sizeof(lv_16sc_t*) * num_a_vectors, volk_gnsssdr_get_alignment()); unsigned int n; - for(n = 0; n < num_a_vectors; n++) - { - in_a[n] = (lv_16sc_t*)volk_gnsssdr_malloc(sizeof(lv_16sc_t)*num_points, volk_gnsssdr_get_alignment()); - memcpy((lv_16sc_t*)in_a[n], (lv_16sc_t*)in, sizeof(lv_16sc_t)*num_points); - } + for (n = 0; n < num_a_vectors; n++) + { + in_a[n] = (lv_16sc_t*)volk_gnsssdr_malloc(sizeof(lv_16sc_t) * num_points, volk_gnsssdr_get_alignment()); + memcpy((lv_16sc_t*)in_a[n], (lv_16sc_t*)in, sizeof(lv_16sc_t) * num_points); + } - volk_gnsssdr_16ic_x2_dot_prod_16ic_xn_neon(result, local_code, (const lv_16sc_t**) in_a, num_a_vectors, num_points); + volk_gnsssdr_16ic_x2_dot_prod_16ic_xn_neon(result, local_code, (const lv_16sc_t**)in_a, num_a_vectors, num_points); - for(n = 0; n < num_a_vectors; n++) - { - volk_gnsssdr_free(in_a[n]); - } + for (n = 0; n < num_a_vectors; n++) + { + volk_gnsssdr_free(in_a[n]); + } volk_gnsssdr_free(in_a); } -#endif // NEON +#endif // NEON #ifdef LV_HAVE_NEON @@ -220,22 +220,22 @@ static inline void volk_gnsssdr_16ic_x2_dotprodxnpuppet_16ic_neon_vma(lv_16sc_t* int num_a_vectors = 3; lv_16sc_t** in_a = (lv_16sc_t**)volk_gnsssdr_malloc(sizeof(lv_16sc_t*) * num_a_vectors, volk_gnsssdr_get_alignment()); unsigned int n; - for(n = 0; n < num_a_vectors; n++) - { - in_a[n] = (lv_16sc_t*)volk_gnsssdr_malloc(sizeof(lv_16sc_t)*num_points, volk_gnsssdr_get_alignment()); - memcpy((lv_16sc_t*)in_a[n], (lv_16sc_t*)in, sizeof(lv_16sc_t)*num_points); - } + for (n = 0; n < num_a_vectors; n++) + { + in_a[n] = (lv_16sc_t*)volk_gnsssdr_malloc(sizeof(lv_16sc_t) * num_points, volk_gnsssdr_get_alignment()); + memcpy((lv_16sc_t*)in_a[n], (lv_16sc_t*)in, sizeof(lv_16sc_t) * num_points); + } - volk_gnsssdr_16ic_x2_dot_prod_16ic_xn_neon_vma(result, local_code, (const lv_16sc_t**) in_a, num_a_vectors, num_points); + volk_gnsssdr_16ic_x2_dot_prod_16ic_xn_neon_vma(result, local_code, (const lv_16sc_t**)in_a, num_a_vectors, num_points); - for(n = 0; n < num_a_vectors; n++) - { - volk_gnsssdr_free(in_a[n]); - } + for (n = 0; n < num_a_vectors; n++) + { + volk_gnsssdr_free(in_a[n]); + } volk_gnsssdr_free(in_a); } -#endif // NEON +#endif // NEON #ifdef LV_HAVE_NEON @@ -244,23 +244,21 @@ static inline void volk_gnsssdr_16ic_x2_dotprodxnpuppet_16ic_neon_optvma(lv_16sc int num_a_vectors = 3; lv_16sc_t** in_a = (lv_16sc_t**)volk_gnsssdr_malloc(sizeof(lv_16sc_t*) * num_a_vectors, volk_gnsssdr_get_alignment()); unsigned int n; - for(n = 0; n < num_a_vectors; n++) - { - in_a[n] = (lv_16sc_t*)volk_gnsssdr_malloc(sizeof(lv_16sc_t)*num_points, volk_gnsssdr_get_alignment()); - memcpy((lv_16sc_t*)in_a[n], (lv_16sc_t*)in, sizeof(lv_16sc_t)*num_points); - } + for (n = 0; n < num_a_vectors; n++) + { + in_a[n] = (lv_16sc_t*)volk_gnsssdr_malloc(sizeof(lv_16sc_t) * num_points, volk_gnsssdr_get_alignment()); + memcpy((lv_16sc_t*)in_a[n], (lv_16sc_t*)in, sizeof(lv_16sc_t) * num_points); + } - volk_gnsssdr_16ic_x2_dot_prod_16ic_xn_neon_optvma(result, local_code, (const lv_16sc_t**) in_a, num_a_vectors, num_points); + volk_gnsssdr_16ic_x2_dot_prod_16ic_xn_neon_optvma(result, local_code, (const lv_16sc_t**)in_a, num_a_vectors, num_points); - for(n = 0; n < num_a_vectors; n++) - { - volk_gnsssdr_free(in_a[n]); - } + for (n = 0; n < num_a_vectors; n++) + { + volk_gnsssdr_free(in_a[n]); + } volk_gnsssdr_free(in_a); } -#endif // NEON +#endif // NEON #endif // INCLUDED_volk_gnsssdr_16ic_x2_dotprodxnpuppet_16ic_H - - diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_x2_multiply_16ic.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_x2_multiply_16ic.h index 2f1036953..596c13bf5 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_x2_multiply_16ic.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_x2_multiply_16ic.h @@ -91,29 +91,29 @@ static inline void volk_gnsssdr_16ic_x2_multiply_16ic_a_sse2(lv_16sc_t* out, con const lv_16sc_t* _in_a = in_a; const lv_16sc_t* _in_b = in_b; lv_16sc_t* _out = out; - for(number = 0; number < sse_iters; number++) + for (number = 0; number < sse_iters; number++) { //std::complex memory structure: real part -> reinterpret_cast(a)[2*i] //imaginery part -> reinterpret_cast(a)[2*i + 1] // a[127:0]=[a3.i,a3.r,a2.i,a2.r,a1.i,a1.r,a0.i,a0.r] - a = _mm_load_si128((__m128i*)_in_a); //load (2 byte imag, 2 byte real) x 4 into 128 bits reg + a = _mm_load_si128((__m128i*)_in_a); //load (2 byte imag, 2 byte real) x 4 into 128 bits reg b = _mm_load_si128((__m128i*)_in_b); - c = _mm_mullo_epi16 (a, b); // a3.i*b3.i, a3.r*b3.r, .... + c = _mm_mullo_epi16(a, b); // a3.i*b3.i, a3.r*b3.r, .... - c_sr = _mm_srli_si128 (c, 2); // Shift a right by imm8 bytes while shifting in zeros, and store the results in dst. - real = _mm_subs_epi16 (c, c_sr); - real = _mm_and_si128 (real, mask_real); // a3.r*b3.r-a3.i*b3.i , 0, a3.r*b3.r- a3.i*b3.i + c_sr = _mm_srli_si128(c, 2); // Shift a right by imm8 bytes while shifting in zeros, and store the results in dst. + real = _mm_subs_epi16(c, c_sr); + real = _mm_and_si128(real, mask_real); // a3.r*b3.r-a3.i*b3.i , 0, a3.r*b3.r- a3.i*b3.i - b_sl = _mm_slli_si128(b, 2); // b3.r, b2.i .... - a_sl = _mm_slli_si128(a, 2); // a3.r, a2.i .... + b_sl = _mm_slli_si128(b, 2); // b3.r, b2.i .... + a_sl = _mm_slli_si128(a, 2); // a3.r, a2.i .... - imag1 = _mm_mullo_epi16(a, b_sl); // a3.i*b3.r, .... - imag2 = _mm_mullo_epi16(b, a_sl); // b3.i*a3.r, .... + imag1 = _mm_mullo_epi16(a, b_sl); // a3.i*b3.r, .... + imag2 = _mm_mullo_epi16(b, a_sl); // b3.i*a3.r, .... imag = _mm_adds_epi16(imag1, imag2); - imag = _mm_and_si128 (imag, mask_imag); // a3.i*b3.r+b3.i*a3.r, 0, ... + imag = _mm_and_si128(imag, mask_imag); // a3.i*b3.r+b3.i*a3.r, 0, ... - result = _mm_or_si128 (real, imag); + result = _mm_or_si128(real, imag); _mm_store_si128((__m128i*)_out, result); @@ -137,7 +137,7 @@ static inline void volk_gnsssdr_16ic_x2_multiply_16ic_u_sse2(lv_16sc_t* out, con { const unsigned int sse_iters = num_points / 4; unsigned int number; - __m128i a, b, c, c_sr, mask_imag, mask_real, real, imag, imag1,imag2, b_sl, a_sl, result; + __m128i a, b, c, c_sr, mask_imag, mask_real, real, imag, imag1, imag2, b_sl, a_sl, result; mask_imag = _mm_set_epi8(0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0); mask_real = _mm_set_epi8(0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF); @@ -145,29 +145,29 @@ static inline void volk_gnsssdr_16ic_x2_multiply_16ic_u_sse2(lv_16sc_t* out, con const lv_16sc_t* _in_a = in_a; const lv_16sc_t* _in_b = in_b; lv_16sc_t* _out = out; - for(number = 0; number < sse_iters; number++) + for (number = 0; number < sse_iters; number++) { //std::complex memory structure: real part -> reinterpret_cast(a)[2*i] //imaginery part -> reinterpret_cast(a)[2*i + 1] // a[127:0]=[a3.i,a3.r,a2.i,a2.r,a1.i,a1.r,a0.i,a0.r] - a = _mm_loadu_si128((__m128i*)_in_a); //load (2 byte imag, 2 byte real) x 4 into 128 bits reg + a = _mm_loadu_si128((__m128i*)_in_a); //load (2 byte imag, 2 byte real) x 4 into 128 bits reg b = _mm_loadu_si128((__m128i*)_in_b); - c = _mm_mullo_epi16 (a, b); // a3.i*b3.i, a3.r*b3.r, .... + c = _mm_mullo_epi16(a, b); // a3.i*b3.i, a3.r*b3.r, .... - c_sr = _mm_srli_si128 (c, 2); // Shift a right by imm8 bytes while shifting in zeros, and store the results in dst. - real = _mm_subs_epi16 (c, c_sr); - real = _mm_and_si128 (real, mask_real); // a3.r*b3.r-a3.i*b3.i , 0, a3.r*b3.r- a3.i*b3.i + c_sr = _mm_srli_si128(c, 2); // Shift a right by imm8 bytes while shifting in zeros, and store the results in dst. + real = _mm_subs_epi16(c, c_sr); + real = _mm_and_si128(real, mask_real); // a3.r*b3.r-a3.i*b3.i , 0, a3.r*b3.r- a3.i*b3.i - b_sl = _mm_slli_si128(b, 2); // b3.r, b2.i .... - a_sl = _mm_slli_si128(a, 2); // a3.r, a2.i .... + b_sl = _mm_slli_si128(b, 2); // b3.r, b2.i .... + a_sl = _mm_slli_si128(a, 2); // a3.r, a2.i .... - imag1 = _mm_mullo_epi16(a, b_sl); // a3.i*b3.r, .... - imag2 = _mm_mullo_epi16(b, a_sl); // b3.i*a3.r, .... + imag1 = _mm_mullo_epi16(a, b_sl); // a3.i*b3.r, .... + imag2 = _mm_mullo_epi16(b, a_sl); // b3.i*a3.r, .... imag = _mm_adds_epi16(imag1, imag2); - imag = _mm_and_si128 (imag, mask_imag); // a3.i*b3.r+b3.i*a3.r, 0, ... + imag = _mm_and_si128(imag, mask_imag); // a3.i*b3.r+b3.i*a3.r, 0, ... - result = _mm_or_si128 (real, imag); + result = _mm_or_si128(real, imag); _mm_storeu_si128((__m128i*)_out, result); @@ -196,29 +196,29 @@ static inline void volk_gnsssdr_16ic_x2_multiply_16ic_u_avx2(lv_16sc_t* out, con const lv_16sc_t* _in_b = in_b; lv_16sc_t* _out = out; - __m256i a, b, c, c_sr, real, imag, imag1, imag2, b_sl, a_sl, result; + __m256i a, b, c, c_sr, real, imag, imag1, imag2, b_sl, a_sl, result; const __m256i mask_imag = _mm256_set_epi8(0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0); const __m256i mask_real = _mm256_set_epi8(0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF); - for(;number < avx2_points; number++) + for (; number < avx2_points; number++) { - a = _mm256_loadu_si256((__m256i*)_in_a); // Load the ar + ai, br + bi as ar,ai,br,bi - b = _mm256_loadu_si256((__m256i*)_in_b); // Load the cr + ci, dr + di as cr,ci,dr,di + a = _mm256_loadu_si256((__m256i*)_in_a); // Load the ar + ai, br + bi as ar,ai,br,bi + b = _mm256_loadu_si256((__m256i*)_in_b); // Load the cr + ci, dr + di as cr,ci,dr,di c = _mm256_mullo_epi16(a, b); - c_sr = _mm256_srli_si256(c, 2); // Shift a right by imm8 bytes while shifting in zeros, and store the results in dst. + c_sr = _mm256_srli_si256(c, 2); // Shift a right by imm8 bytes while shifting in zeros, and store the results in dst. real = _mm256_subs_epi16(c, c_sr); - real = _mm256_and_si256(real, mask_real); // a3.r*b3.r-a3.i*b3.i , 0, a3.r*b3.r- a3.i*b3.i + real = _mm256_and_si256(real, mask_real); // a3.r*b3.r-a3.i*b3.i , 0, a3.r*b3.r- a3.i*b3.i - b_sl = _mm256_slli_si256(b, 2); // b3.r, b2.i .... - a_sl = _mm256_slli_si256(a, 2); // a3.r, a2.i .... + b_sl = _mm256_slli_si256(b, 2); // b3.r, b2.i .... + a_sl = _mm256_slli_si256(a, 2); // a3.r, a2.i .... - imag1 = _mm256_mullo_epi16(a, b_sl); // a3.i*b3.r, .... - imag2 = _mm256_mullo_epi16(b, a_sl); // b3.i*a3.r, .... + imag1 = _mm256_mullo_epi16(a, b_sl); // a3.i*b3.r, .... + imag2 = _mm256_mullo_epi16(b, a_sl); // b3.i*a3.r, .... imag = _mm256_adds_epi16(imag1, imag2); - imag = _mm256_and_si256(imag, mask_imag); // a3.i*b3.r+b3.i*a3.r, 0, ... + imag = _mm256_and_si256(imag, mask_imag); // a3.i*b3.r+b3.i*a3.r, 0, ... result = _mm256_or_si256(real, imag); @@ -230,7 +230,7 @@ static inline void volk_gnsssdr_16ic_x2_multiply_16ic_u_avx2(lv_16sc_t* out, con } _mm256_zeroupper(); number = avx2_points * 8; - for(;number < num_points; number++) + for (; number < num_points; number++) { *_out++ = (*_in_a++) * (*_in_b++); } @@ -250,29 +250,29 @@ static inline void volk_gnsssdr_16ic_x2_multiply_16ic_a_avx2(lv_16sc_t* out, con const lv_16sc_t* _in_b = in_b; lv_16sc_t* _out = out; - __m256i a, b, c, c_sr, real, imag, imag1, imag2, b_sl, a_sl, result; + __m256i a, b, c, c_sr, real, imag, imag1, imag2, b_sl, a_sl, result; const __m256i mask_imag = _mm256_set_epi8(0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0); const __m256i mask_real = _mm256_set_epi8(0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF); - for(;number < avx2_points; number++) + for (; number < avx2_points; number++) { - a = _mm256_load_si256((__m256i*)_in_a); // Load the ar + ai, br + bi as ar,ai,br,bi - b = _mm256_load_si256((__m256i*)_in_b); // Load the cr + ci, dr + di as cr,ci,dr,di + a = _mm256_load_si256((__m256i*)_in_a); // Load the ar + ai, br + bi as ar,ai,br,bi + b = _mm256_load_si256((__m256i*)_in_b); // Load the cr + ci, dr + di as cr,ci,dr,di c = _mm256_mullo_epi16(a, b); - c_sr = _mm256_srli_si256(c, 2); // Shift a right by imm8 bytes while shifting in zeros, and store the results in dst. + c_sr = _mm256_srli_si256(c, 2); // Shift a right by imm8 bytes while shifting in zeros, and store the results in dst. real = _mm256_subs_epi16(c, c_sr); - real = _mm256_and_si256(real, mask_real); // a3.r*b3.r-a3.i*b3.i , 0, a3.r*b3.r- a3.i*b3.i + real = _mm256_and_si256(real, mask_real); // a3.r*b3.r-a3.i*b3.i , 0, a3.r*b3.r- a3.i*b3.i - b_sl = _mm256_slli_si256(b, 2); // b3.r, b2.i .... - a_sl = _mm256_slli_si256(a, 2); // a3.r, a2.i .... + b_sl = _mm256_slli_si256(b, 2); // b3.r, b2.i .... + a_sl = _mm256_slli_si256(a, 2); // a3.r, a2.i .... - imag1 = _mm256_mullo_epi16(a, b_sl); // a3.i*b3.r, .... - imag2 = _mm256_mullo_epi16(b, a_sl); // b3.i*a3.r, .... + imag1 = _mm256_mullo_epi16(a, b_sl); // a3.i*b3.r, .... + imag2 = _mm256_mullo_epi16(b, a_sl); // b3.i*a3.r, .... imag = _mm256_adds_epi16(imag1, imag2); - imag = _mm256_and_si256(imag, mask_imag); // a3.i*b3.r+b3.i*a3.r, 0, ... + imag = _mm256_and_si256(imag, mask_imag); // a3.i*b3.r+b3.i*a3.r, 0, ... result = _mm256_or_si256(real, imag); @@ -284,7 +284,7 @@ static inline void volk_gnsssdr_16ic_x2_multiply_16ic_a_avx2(lv_16sc_t* out, con } _mm256_zeroupper(); number = avx2_points * 8; - for(;number < num_points; number++) + for (; number < num_points; number++) { *_out++ = (*_in_a++) * (*_in_b++); } @@ -292,23 +292,22 @@ static inline void volk_gnsssdr_16ic_x2_multiply_16ic_a_avx2(lv_16sc_t* out, con #endif /* LV_HAVE_AVX2 */ - #ifdef LV_HAVE_NEON #include static inline void volk_gnsssdr_16ic_x2_multiply_16ic_neon(lv_16sc_t* out, const lv_16sc_t* in_a, const lv_16sc_t* in_b, unsigned int num_points) { - lv_16sc_t *a_ptr = (lv_16sc_t*) in_a; - lv_16sc_t *b_ptr = (lv_16sc_t*) in_b; + lv_16sc_t* a_ptr = (lv_16sc_t*)in_a; + lv_16sc_t* b_ptr = (lv_16sc_t*)in_b; unsigned int quarter_points = num_points / 4; int16x4x2_t a_val, b_val, c_val; int16x4x2_t tmp_real, tmp_imag; unsigned int number = 0; - for(number = 0; number < quarter_points; ++number) + for (number = 0; number < quarter_points; ++number) { - a_val = vld2_s16((int16_t*)a_ptr); // a0r|a1r|a2r|a3r || a0i|a1i|a2i|a3i - b_val = vld2_s16((int16_t*)b_ptr); // b0r|b1r|b2r|b3r || b0i|b1i|b2i|b3i + a_val = vld2_s16((int16_t*)a_ptr); // a0r|a1r|a2r|a3r || a0i|a1i|a2i|a3i + b_val = vld2_s16((int16_t*)b_ptr); // b0r|b1r|b2r|b3r || b0i|b1i|b2i|b3i __VOLK_GNSSSDR_PREFETCH(a_ptr + 4); __VOLK_GNSSSDR_PREFETCH(b_ptr + 4); @@ -334,7 +333,7 @@ static inline void volk_gnsssdr_16ic_x2_multiply_16ic_neon(lv_16sc_t* out, const out += 4; } - for(number = quarter_points * 4; number < num_points; number++) + for (number = quarter_points * 4; number < num_points; number++) { *out++ = (*a_ptr++) * (*b_ptr++); } diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn.h index 0cfc9df61..60b5b7b38 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn.h @@ -85,11 +85,11 @@ static inline void volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_generic(lv_16sc unsigned int n; for (n_vec = 0; n_vec < num_a_vectors; n_vec++) { - result[n_vec] = lv_cmake(0,0); + result[n_vec] = lv_cmake(0, 0); } for (n = 0; n < num_points; n++) { - tmp16 = *in_common++; //if(n<10 || n >= 8108) printf("generic phase %i: %f,%f\n", n,lv_creal(*phase),lv_cimag(*phase)); + tmp16 = *in_common++; //if(n<10 || n >= 8108) printf("generic phase %i: %f,%f\n", n,lv_creal(*phase),lv_cimag(*phase)); tmp32 = lv_cmake((float)lv_creal(tmp16), (float)lv_cimag(tmp16)) * (*phase); tmp16 = lv_cmake((int16_t)rintf(lv_creal(tmp32)), (int16_t)rintf(lv_cimag(tmp32))); @@ -130,14 +130,14 @@ static inline void volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_generic_reload( const unsigned int ROTATOR_RELOAD = 256; for (n_vec = 0; n_vec < num_a_vectors; n_vec++) { - result[n_vec] = lv_cmake(0,0); + result[n_vec] = lv_cmake(0, 0); } for (n = 0; n < num_points / ROTATOR_RELOAD; n++) { for (j = 0; j < ROTATOR_RELOAD; j++) { - tmp16 = *in_common++; //if(n<10 || n >= 8108) printf("generic phase %i: %f,%f\n", n,lv_creal(*phase),lv_cimag(*phase)); + tmp16 = *in_common++; //if(n<10 || n >= 8108) printf("generic phase %i: %f,%f\n", n,lv_creal(*phase),lv_cimag(*phase)); tmp32 = lv_cmake((float)lv_creal(tmp16), (float)lv_cimag(tmp16)) * (*phase); tmp16 = lv_cmake((int16_t)rintf(lv_creal(tmp32)), (int16_t)rintf(lv_cimag(tmp32))); (*phase) *= phase_inc; @@ -148,7 +148,7 @@ static inline void volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_generic_reload( result[n_vec] = lv_cmake(sat_adds16i(lv_creal(result[n_vec]), lv_creal(tmp)), sat_adds16i(lv_cimag(result[n_vec]), lv_cimag(tmp))); } } - /* Regenerate phase */ + /* Regenerate phase */ #ifdef __cplusplus (*phase) /= std::abs((*phase)); #else @@ -159,13 +159,13 @@ static inline void volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_generic_reload( for (j = 0; j < num_points % ROTATOR_RELOAD; j++) { - tmp16 = *in_common++; //if(n<10 || n >= 8108) printf("generic phase %i: %f,%f\n", n,lv_creal(*phase),lv_cimag(*phase)); + tmp16 = *in_common++; //if(n<10 || n >= 8108) printf("generic phase %i: %f,%f\n", n,lv_creal(*phase),lv_cimag(*phase)); tmp32 = lv_cmake((float)lv_creal(tmp16), (float)lv_cimag(tmp16)) * (*phase); tmp16 = lv_cmake((int16_t)rintf(lv_creal(tmp32)), (int16_t)rintf(lv_cimag(tmp32))); (*phase) *= phase_inc; for (n_vec = 0; n_vec < num_a_vectors; n_vec++) { - lv_16sc_t tmp = tmp16 * in_a[n_vec][ (num_points / ROTATOR_RELOAD) * ROTATOR_RELOAD + j ]; + lv_16sc_t tmp = tmp16 * in_a[n_vec][(num_points / ROTATOR_RELOAD) * ROTATOR_RELOAD + j]; //lv_16sc_t tmp = lv_cmake(sat_adds16i(sat_muls16i(lv_creal(tmp16), lv_creal(in_a[n_vec][n])), - sat_muls16i(lv_cimag(tmp16), lv_cimag(in_a[n_vec][n]))) , sat_adds16i(sat_muls16i(lv_creal(tmp16), lv_cimag(in_a[n_vec][n])), sat_muls16i(lv_cimag(tmp16), lv_creal(in_a[n_vec][n])))); result[n_vec] = lv_cmake(sat_adds16i(lv_creal(result[n_vec]), lv_creal(tmp)), sat_adds16i(lv_cimag(result[n_vec]), lv_cimag(tmp))); } @@ -178,9 +178,9 @@ static inline void volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_generic_reload( #ifdef LV_HAVE_SSE3 #include -static inline void volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_a_sse3(lv_16sc_t* result, const lv_16sc_t* in_common, const lv_32fc_t phase_inc, lv_32fc_t* phase, const lv_16sc_t** in_a, int num_a_vectors, unsigned int num_points) +static inline void volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_a_sse3(lv_16sc_t* result, const lv_16sc_t* in_common, const lv_32fc_t phase_inc, lv_32fc_t* phase, const lv_16sc_t** in_a, int num_a_vectors, unsigned int num_points) { - lv_16sc_t dotProduct = lv_cmake(0,0); + lv_16sc_t dotProduct = lv_cmake(0, 0); const unsigned int sse_iters = num_points / 4; int n_vec; @@ -191,7 +191,8 @@ static inline void volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_a_sse3(lv_16sc_ const lv_16sc_t* _in_common = in_common; lv_16sc_t* _out = result; - __VOLK_ATTR_ALIGNED(16) lv_16sc_t dotProductVector[4]; + __VOLK_ATTR_ALIGNED(16) + lv_16sc_t dotProductVector[4]; __m128i* realcacc = (__m128i*)volk_gnsssdr_malloc(num_a_vectors * sizeof(__m128i), volk_gnsssdr_get_alignment()); __m128i* imagcacc = (__m128i*)volk_gnsssdr_malloc(num_a_vectors * sizeof(__m128i), volk_gnsssdr_get_alignment()); @@ -210,11 +211,13 @@ static inline void volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_a_sse3(lv_16sc_ // phase rotation registers __m128 pa, pb, two_phase_acc_reg, two_phase_inc_reg; __m128i pc1, pc2; - __VOLK_ATTR_ALIGNED(16) lv_32fc_t two_phase_inc[2]; + __VOLK_ATTR_ALIGNED(16) + lv_32fc_t two_phase_inc[2]; two_phase_inc[0] = phase_inc * phase_inc; two_phase_inc[1] = phase_inc * phase_inc; - two_phase_inc_reg = _mm_load_ps((float*) two_phase_inc); - __VOLK_ATTR_ALIGNED(16) lv_32fc_t two_phase_acc[2]; + two_phase_inc_reg = _mm_load_ps((float*)two_phase_inc); + __VOLK_ATTR_ALIGNED(16) + lv_32fc_t two_phase_acc[2]; two_phase_acc[0] = (*phase); two_phase_acc[1] = (*phase) * phase_inc; two_phase_acc_reg = _mm_load_ps((float*)two_phase_acc); @@ -222,69 +225,69 @@ static inline void volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_a_sse3(lv_16sc_ lv_16sc_t tmp16; lv_32fc_t tmp32; - for(number = 0; number < sse_iters; number++) + for (number = 0; number < sse_iters; number++) { // Phase rotation on operand in_common starts here: //printf("generic phase %i: %f,%f\n", n*4,lv_creal(*phase),lv_cimag(*phase)); - pa = _mm_set_ps((float)(lv_cimag(_in_common[1])), (float)(lv_creal(_in_common[1])), (float)(lv_cimag(_in_common[0])), (float)(lv_creal(_in_common[0]))); // //load (2 byte imag, 2 byte real) x 2 into 128 bits reg + pa = _mm_set_ps((float)(lv_cimag(_in_common[1])), (float)(lv_creal(_in_common[1])), (float)(lv_cimag(_in_common[0])), (float)(lv_creal(_in_common[0]))); // //load (2 byte imag, 2 byte real) x 2 into 128 bits reg //complex 32fc multiplication b=a*two_phase_acc_reg - yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr - yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di - tmp1 = _mm_mul_ps(pa, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr - pa = _mm_shuffle_ps(pa, pa, 0xB1); // Re-arrange x to be ai,ar,bi,br - tmp2 = _mm_mul_ps(pa, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di - pb = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di - pc1 = _mm_cvtps_epi32(pb); // convert from 32fc to 32ic + yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr + yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di + tmp1 = _mm_mul_ps(pa, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr + pa = _mm_shuffle_ps(pa, pa, 0xB1); // Re-arrange x to be ai,ar,bi,br + tmp2 = _mm_mul_ps(pa, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di + pb = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di + pc1 = _mm_cvtps_epi32(pb); // convert from 32fc to 32ic //complex 32fc multiplication two_phase_acc_reg=two_phase_acc_reg*two_phase_inc_reg - yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr - yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di - tmp1 = _mm_mul_ps(two_phase_inc_reg, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr - tmp3 = _mm_shuffle_ps(two_phase_inc_reg, two_phase_inc_reg, 0xB1); // Re-arrange x to be ai,ar,bi,br - tmp2 = _mm_mul_ps(tmp3, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di - two_phase_acc_reg = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di + yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr + yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di + tmp1 = _mm_mul_ps(two_phase_inc_reg, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr + tmp3 = _mm_shuffle_ps(two_phase_inc_reg, two_phase_inc_reg, 0xB1); // Re-arrange x to be ai,ar,bi,br + tmp2 = _mm_mul_ps(tmp3, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di + two_phase_acc_reg = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di //next two samples _in_common += 2; - pa = _mm_set_ps((float)(lv_cimag(_in_common[1])), (float)(lv_creal(_in_common[1])), (float)(lv_cimag(_in_common[0])), (float)(lv_creal(_in_common[0]))); // //load (2 byte imag, 2 byte real) x 2 into 128 bits reg + pa = _mm_set_ps((float)(lv_cimag(_in_common[1])), (float)(lv_creal(_in_common[1])), (float)(lv_cimag(_in_common[0])), (float)(lv_creal(_in_common[0]))); // //load (2 byte imag, 2 byte real) x 2 into 128 bits reg __VOLK_GNSSSDR_PREFETCH(_in_common + 8); //complex 32fc multiplication b=a*two_phase_acc_reg - yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr - yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di - tmp1 = _mm_mul_ps(pa, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr - pa = _mm_shuffle_ps(pa, pa, 0xB1); // Re-arrange x to be ai,ar,bi,br - tmp2 = _mm_mul_ps(pa, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di - pb = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di - pc2 = _mm_cvtps_epi32(pb); // convert from 32fc to 32ic + yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr + yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di + tmp1 = _mm_mul_ps(pa, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr + pa = _mm_shuffle_ps(pa, pa, 0xB1); // Re-arrange x to be ai,ar,bi,br + tmp2 = _mm_mul_ps(pa, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di + pb = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di + pc2 = _mm_cvtps_epi32(pb); // convert from 32fc to 32ic //complex 32fc multiplication two_phase_acc_reg=two_phase_acc_reg*two_phase_inc_reg - yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr - yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di - tmp1 = _mm_mul_ps(two_phase_inc_reg, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr - tmp3 = _mm_shuffle_ps(two_phase_inc_reg, two_phase_inc_reg, 0xB1); // Re-arrange x to be ai,ar,bi,br - tmp2 = _mm_mul_ps(tmp3, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di - two_phase_acc_reg = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di + yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr + yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di + tmp1 = _mm_mul_ps(two_phase_inc_reg, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr + tmp3 = _mm_shuffle_ps(two_phase_inc_reg, two_phase_inc_reg, 0xB1); // Re-arrange x to be ai,ar,bi,br + tmp2 = _mm_mul_ps(tmp3, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di + two_phase_acc_reg = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di // store four rotated in_common samples in the register b - b = _mm_packs_epi32(pc1, pc2);// convert from 32ic to 16ic + b = _mm_packs_epi32(pc1, pc2); // convert from 32ic to 16ic //next two samples _in_common += 2; for (n_vec = 0; n_vec < num_a_vectors; n_vec++) { - a = _mm_load_si128((__m128i*)&(_in_a[n_vec][number*4])); //load (2 byte imag, 2 byte real) x 4 into 128 bits reg + a = _mm_load_si128((__m128i*)&(_in_a[n_vec][number * 4])); //load (2 byte imag, 2 byte real) x 4 into 128 bits reg - c = _mm_mullo_epi16(a, b); // a3.i*b3.i, a3.r*b3.r, .... + c = _mm_mullo_epi16(a, b); // a3.i*b3.i, a3.r*b3.r, .... - c_sr = _mm_srli_si128(c, 2); // Shift a right by imm8 bytes while shifting in zeros, and store the results in dst. + c_sr = _mm_srli_si128(c, 2); // Shift a right by imm8 bytes while shifting in zeros, and store the results in dst. real = _mm_subs_epi16(c, c_sr); - b_sl = _mm_slli_si128(b, 2); // b3.r, b2.i .... - a_sl = _mm_slli_si128(a, 2); // a3.r, a2.i .... + b_sl = _mm_slli_si128(b, 2); // b3.r, b2.i .... + a_sl = _mm_slli_si128(a, 2); // a3.r, a2.i .... - imag1 = _mm_mullo_epi16(a, b_sl); // a3.i*b3.r, .... - imag2 = _mm_mullo_epi16(b, a_sl); // b3.i*a3.r, .... + imag1 = _mm_mullo_epi16(a, b_sl); // a3.i*b3.r, .... + imag2 = _mm_mullo_epi16(b, a_sl); // b3.i*a3.r, .... imag = _mm_adds_epi16(imag1, imag2); @@ -309,12 +312,12 @@ static inline void volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_a_sse3(lv_16sc_ a = _mm_or_si128(realcacc[n_vec], imagcacc[n_vec]); - _mm_store_si128((__m128i*)dotProductVector, a); // Store the results back into the dot product vector - dotProduct = lv_cmake(0,0); + _mm_store_si128((__m128i*)dotProductVector, a); // Store the results back into the dot product vector + dotProduct = lv_cmake(0, 0); for (i = 0; i < 4; ++i) { dotProduct = lv_cmake(sat_adds16i(lv_creal(dotProduct), lv_creal(dotProductVector[i])), - sat_adds16i(lv_cimag(dotProduct), lv_cimag(dotProductVector[i]))); + sat_adds16i(lv_cimag(dotProduct), lv_cimag(dotProductVector[i]))); } _out[n_vec] = dotProduct; } @@ -331,7 +334,7 @@ static inline void volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_a_sse3(lv_16sc_ //(*phase) = lv_cmake((float*)two_phase_acc[0], (float*)two_phase_acc[1]); (*phase) = two_phase_acc[0]; - for(n = sse_iters * 4; n < num_points; n++) + for (n = sse_iters * 4; n < num_points; n++) { tmp16 = in_common[n]; //printf("a_sse phase %i: %f,%f\n", n,lv_creal(*phase),lv_cimag(*phase)); tmp32 = lv_cmake((float)lv_creal(tmp16), (float)lv_cimag(tmp16)) * (*phase); @@ -343,7 +346,7 @@ static inline void volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_a_sse3(lv_16sc_ lv_16sc_t tmp = tmp16 * in_a[n_vec][n]; //lv_16sc_t tmp = lv_cmake(sat_adds16i(sat_muls16i(lv_creal(tmp16), lv_creal(in_a[n_vec][n])), - sat_muls16i(lv_cimag(tmp16), lv_cimag(in_a[n_vec][n]))) , sat_adds16i(sat_muls16i(lv_creal(tmp16), lv_cimag(in_a[n_vec][n])), sat_muls16i(lv_cimag(tmp16), lv_creal(in_a[n_vec][n])))); _out[n_vec] = lv_cmake(sat_adds16i(lv_creal(_out[n_vec]), lv_creal(tmp)), - sat_adds16i(lv_cimag(_out[n_vec]), lv_cimag(tmp))); + sat_adds16i(lv_cimag(_out[n_vec]), lv_cimag(tmp))); } } } @@ -353,9 +356,9 @@ static inline void volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_a_sse3(lv_16sc_ #ifdef LV_HAVE_SSE3 #include -static inline void volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_a_sse3_reload(lv_16sc_t* result, const lv_16sc_t* in_common, const lv_32fc_t phase_inc, lv_32fc_t* phase, const lv_16sc_t** in_a, int num_a_vectors, unsigned int num_points) +static inline void volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_a_sse3_reload(lv_16sc_t* result, const lv_16sc_t* in_common, const lv_32fc_t phase_inc, lv_32fc_t* phase, const lv_16sc_t** in_a, int num_a_vectors, unsigned int num_points) { - lv_16sc_t dotProduct = lv_cmake(0,0); + lv_16sc_t dotProduct = lv_cmake(0, 0); const unsigned int sse_iters = num_points / 4; const unsigned int ROTATOR_RELOAD = 128; @@ -369,7 +372,8 @@ static inline void volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_a_sse3_reload(l const lv_16sc_t* _in_common = in_common; lv_16sc_t* _out = result; - __VOLK_ATTR_ALIGNED(16) lv_16sc_t dotProductVector[4]; + __VOLK_ATTR_ALIGNED(16) + lv_16sc_t dotProductVector[4]; __m128i* realcacc = (__m128i*)volk_gnsssdr_malloc(num_a_vectors * sizeof(__m128i), volk_gnsssdr_get_alignment()); __m128i* imagcacc = (__m128i*)volk_gnsssdr_malloc(num_a_vectors * sizeof(__m128i), volk_gnsssdr_get_alignment()); @@ -388,11 +392,13 @@ static inline void volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_a_sse3_reload(l // phase rotation registers __m128 pa, pb, two_phase_acc_reg, two_phase_inc_reg; __m128i pc1, pc2; - __VOLK_ATTR_ALIGNED(16) lv_32fc_t two_phase_inc[2]; + __VOLK_ATTR_ALIGNED(16) + lv_32fc_t two_phase_inc[2]; two_phase_inc[0] = phase_inc * phase_inc; two_phase_inc[1] = phase_inc * phase_inc; - two_phase_inc_reg = _mm_load_ps((float*) two_phase_inc); - __VOLK_ATTR_ALIGNED(16) lv_32fc_t two_phase_acc[2]; + two_phase_inc_reg = _mm_load_ps((float*)two_phase_inc); + __VOLK_ATTR_ALIGNED(16) + lv_32fc_t two_phase_acc[2]; two_phase_acc[0] = (*phase); two_phase_acc[1] = (*phase) * phase_inc; two_phase_acc_reg = _mm_load_ps((float*)two_phase_acc); @@ -400,71 +406,71 @@ static inline void volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_a_sse3_reload(l lv_16sc_t tmp16; lv_32fc_t tmp32; - for (number = 0; number < sse_iters / ROTATOR_RELOAD; ++number) + for (number = 0; number < sse_iters / ROTATOR_RELOAD; ++number) { for (j = 0; j < ROTATOR_RELOAD; j++) { // Phase rotation on operand in_common starts here: //printf("generic phase %i: %f,%f\n", n*4,lv_creal(*phase),lv_cimag(*phase)); - pa = _mm_set_ps((float)(lv_cimag(_in_common[1])), (float)(lv_creal(_in_common[1])), (float)(lv_cimag(_in_common[0])), (float)(lv_creal(_in_common[0]))); // //load (2 byte imag, 2 byte real) x 2 into 128 bits reg + pa = _mm_set_ps((float)(lv_cimag(_in_common[1])), (float)(lv_creal(_in_common[1])), (float)(lv_cimag(_in_common[0])), (float)(lv_creal(_in_common[0]))); // //load (2 byte imag, 2 byte real) x 2 into 128 bits reg //complex 32fc multiplication b=a*two_phase_acc_reg - yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr - yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di - tmp1 = _mm_mul_ps(pa, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr - pa = _mm_shuffle_ps(pa, pa, 0xB1); // Re-arrange x to be ai,ar,bi,br - tmp2 = _mm_mul_ps(pa, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di - pb = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di - pc1 = _mm_cvtps_epi32(pb); // convert from 32fc to 32ic + yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr + yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di + tmp1 = _mm_mul_ps(pa, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr + pa = _mm_shuffle_ps(pa, pa, 0xB1); // Re-arrange x to be ai,ar,bi,br + tmp2 = _mm_mul_ps(pa, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di + pb = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di + pc1 = _mm_cvtps_epi32(pb); // convert from 32fc to 32ic //complex 32fc multiplication two_phase_acc_reg=two_phase_acc_reg*two_phase_inc_reg - yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr - yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di - tmp1 = _mm_mul_ps(two_phase_inc_reg, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr - tmp3 = _mm_shuffle_ps(two_phase_inc_reg, two_phase_inc_reg, 0xB1); // Re-arrange x to be ai,ar,bi,br - tmp2 = _mm_mul_ps(tmp3, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di - two_phase_acc_reg = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di + yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr + yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di + tmp1 = _mm_mul_ps(two_phase_inc_reg, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr + tmp3 = _mm_shuffle_ps(two_phase_inc_reg, two_phase_inc_reg, 0xB1); // Re-arrange x to be ai,ar,bi,br + tmp2 = _mm_mul_ps(tmp3, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di + two_phase_acc_reg = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di //next two samples _in_common += 2; - pa = _mm_set_ps((float)(lv_cimag(_in_common[1])), (float)(lv_creal(_in_common[1])), (float)(lv_cimag(_in_common[0])), (float)(lv_creal(_in_common[0]))); // //load (2 byte imag, 2 byte real) x 2 into 128 bits reg + pa = _mm_set_ps((float)(lv_cimag(_in_common[1])), (float)(lv_creal(_in_common[1])), (float)(lv_cimag(_in_common[0])), (float)(lv_creal(_in_common[0]))); // //load (2 byte imag, 2 byte real) x 2 into 128 bits reg __VOLK_GNSSSDR_PREFETCH(_in_common + 8); //complex 32fc multiplication b=a*two_phase_acc_reg - yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr - yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di - tmp1 = _mm_mul_ps(pa, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr - pa = _mm_shuffle_ps(pa, pa, 0xB1); // Re-arrange x to be ai,ar,bi,br - tmp2 = _mm_mul_ps(pa, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di - pb = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di - pc2 = _mm_cvtps_epi32(pb); // convert from 32fc to 32ic + yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr + yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di + tmp1 = _mm_mul_ps(pa, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr + pa = _mm_shuffle_ps(pa, pa, 0xB1); // Re-arrange x to be ai,ar,bi,br + tmp2 = _mm_mul_ps(pa, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di + pb = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di + pc2 = _mm_cvtps_epi32(pb); // convert from 32fc to 32ic //complex 32fc multiplication two_phase_acc_reg=two_phase_acc_reg*two_phase_inc_reg - yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr - yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di - tmp1 = _mm_mul_ps(two_phase_inc_reg, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr - tmp3 = _mm_shuffle_ps(two_phase_inc_reg, two_phase_inc_reg, 0xB1); // Re-arrange x to be ai,ar,bi,br - tmp2 = _mm_mul_ps(tmp3, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di - two_phase_acc_reg = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di + yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr + yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di + tmp1 = _mm_mul_ps(two_phase_inc_reg, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr + tmp3 = _mm_shuffle_ps(two_phase_inc_reg, two_phase_inc_reg, 0xB1); // Re-arrange x to be ai,ar,bi,br + tmp2 = _mm_mul_ps(tmp3, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di + two_phase_acc_reg = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di // store four rotated in_common samples in the register b - b = _mm_packs_epi32(pc1, pc2);// convert from 32ic to 16ic + b = _mm_packs_epi32(pc1, pc2); // convert from 32ic to 16ic //next two samples _in_common += 2; for (n_vec = 0; n_vec < num_a_vectors; n_vec++) { - a = _mm_load_si128((__m128i*)&(_in_a[n_vec][(number * ROTATOR_RELOAD + j) * 4])); //load (2 byte imag, 2 byte real) x 4 into 128 bits reg + a = _mm_load_si128((__m128i*)&(_in_a[n_vec][(number * ROTATOR_RELOAD + j) * 4])); //load (2 byte imag, 2 byte real) x 4 into 128 bits reg - c = _mm_mullo_epi16(a, b); // a3.i*b3.i, a3.r*b3.r, .... + c = _mm_mullo_epi16(a, b); // a3.i*b3.i, a3.r*b3.r, .... - c_sr = _mm_srli_si128(c, 2); // Shift a right by imm8 bytes while shifting in zeros, and store the results in dst. + c_sr = _mm_srli_si128(c, 2); // Shift a right by imm8 bytes while shifting in zeros, and store the results in dst. real = _mm_subs_epi16(c, c_sr); - b_sl = _mm_slli_si128(b, 2); // b3.r, b2.i .... - a_sl = _mm_slli_si128(a, 2); // a3.r, a2.i .... + b_sl = _mm_slli_si128(b, 2); // b3.r, b2.i .... + a_sl = _mm_slli_si128(a, 2); // a3.r, a2.i .... - imag1 = _mm_mullo_epi16(a, b_sl); // a3.i*b3.r, .... - imag2 = _mm_mullo_epi16(b, a_sl); // b3.i*a3.r, .... + imag1 = _mm_mullo_epi16(a, b_sl); // a3.i*b3.r, .... + imag2 = _mm_mullo_epi16(b, a_sl); // b3.i*a3.r, .... imag = _mm_adds_epi16(imag1, imag2); @@ -482,65 +488,65 @@ static inline void volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_a_sse3_reload(l for (j = 0; j < sse_iters % ROTATOR_RELOAD; j++) { - pa = _mm_set_ps((float)(lv_cimag(_in_common[1])), (float)(lv_creal(_in_common[1])), (float)(lv_cimag(_in_common[0])), (float)(lv_creal(_in_common[0]))); // //load (2 byte imag, 2 byte real) x 2 into 128 bits reg + pa = _mm_set_ps((float)(lv_cimag(_in_common[1])), (float)(lv_creal(_in_common[1])), (float)(lv_cimag(_in_common[0])), (float)(lv_creal(_in_common[0]))); // //load (2 byte imag, 2 byte real) x 2 into 128 bits reg //complex 32fc multiplication b=a*two_phase_acc_reg - yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr - yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di - tmp1 = _mm_mul_ps(pa, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr - pa = _mm_shuffle_ps(pa, pa, 0xB1); // Re-arrange x to be ai,ar,bi,br - tmp2 = _mm_mul_ps(pa, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di - pb = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di - pc1 = _mm_cvtps_epi32(pb); // convert from 32fc to 32ic + yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr + yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di + tmp1 = _mm_mul_ps(pa, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr + pa = _mm_shuffle_ps(pa, pa, 0xB1); // Re-arrange x to be ai,ar,bi,br + tmp2 = _mm_mul_ps(pa, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di + pb = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di + pc1 = _mm_cvtps_epi32(pb); // convert from 32fc to 32ic //complex 32fc multiplication two_phase_acc_reg=two_phase_acc_reg*two_phase_inc_reg - yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr - yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di - tmp1 = _mm_mul_ps(two_phase_inc_reg, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr - tmp3 = _mm_shuffle_ps(two_phase_inc_reg, two_phase_inc_reg, 0xB1); // Re-arrange x to be ai,ar,bi,br - tmp2 = _mm_mul_ps(tmp3, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di - two_phase_acc_reg = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di + yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr + yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di + tmp1 = _mm_mul_ps(two_phase_inc_reg, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr + tmp3 = _mm_shuffle_ps(two_phase_inc_reg, two_phase_inc_reg, 0xB1); // Re-arrange x to be ai,ar,bi,br + tmp2 = _mm_mul_ps(tmp3, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di + two_phase_acc_reg = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di //next two samples _in_common += 2; - pa = _mm_set_ps((float)(lv_cimag(_in_common[1])), (float)(lv_creal(_in_common[1])), (float)(lv_cimag(_in_common[0])), (float)(lv_creal(_in_common[0]))); // //load (2 byte imag, 2 byte real) x 2 into 128 bits reg + pa = _mm_set_ps((float)(lv_cimag(_in_common[1])), (float)(lv_creal(_in_common[1])), (float)(lv_cimag(_in_common[0])), (float)(lv_creal(_in_common[0]))); // //load (2 byte imag, 2 byte real) x 2 into 128 bits reg __VOLK_GNSSSDR_PREFETCH(_in_common + 8); //complex 32fc multiplication b=a*two_phase_acc_reg - yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr - yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di - tmp1 = _mm_mul_ps(pa, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr - pa = _mm_shuffle_ps(pa, pa, 0xB1); // Re-arrange x to be ai,ar,bi,br - tmp2 = _mm_mul_ps(pa, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di - pb = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di - pc2 = _mm_cvtps_epi32(pb); // convert from 32fc to 32ic + yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr + yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di + tmp1 = _mm_mul_ps(pa, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr + pa = _mm_shuffle_ps(pa, pa, 0xB1); // Re-arrange x to be ai,ar,bi,br + tmp2 = _mm_mul_ps(pa, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di + pb = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di + pc2 = _mm_cvtps_epi32(pb); // convert from 32fc to 32ic //complex 32fc multiplication two_phase_acc_reg=two_phase_acc_reg*two_phase_inc_reg - yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr - yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di - tmp1 = _mm_mul_ps(two_phase_inc_reg, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr - tmp3 = _mm_shuffle_ps(two_phase_inc_reg, two_phase_inc_reg, 0xB1); // Re-arrange x to be ai,ar,bi,br - tmp2 = _mm_mul_ps(tmp3, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di - two_phase_acc_reg = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di + yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr + yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di + tmp1 = _mm_mul_ps(two_phase_inc_reg, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr + tmp3 = _mm_shuffle_ps(two_phase_inc_reg, two_phase_inc_reg, 0xB1); // Re-arrange x to be ai,ar,bi,br + tmp2 = _mm_mul_ps(tmp3, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di + two_phase_acc_reg = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di // store four rotated in_common samples in the register b - b = _mm_packs_epi32(pc1, pc2);// convert from 32ic to 16ic + b = _mm_packs_epi32(pc1, pc2); // convert from 32ic to 16ic //next two samples _in_common += 2; for (n_vec = 0; n_vec < num_a_vectors; n_vec++) { - a = _mm_load_si128((__m128i*)&(_in_a[n_vec][((sse_iters / ROTATOR_RELOAD) * ROTATOR_RELOAD + j) * 4])); //load (2 byte imag, 2 byte real) x 4 into 128 bits reg + a = _mm_load_si128((__m128i*)&(_in_a[n_vec][((sse_iters / ROTATOR_RELOAD) * ROTATOR_RELOAD + j) * 4])); //load (2 byte imag, 2 byte real) x 4 into 128 bits reg - c = _mm_mullo_epi16(a, b); // a3.i*b3.i, a3.r*b3.r, .... + c = _mm_mullo_epi16(a, b); // a3.i*b3.i, a3.r*b3.r, .... - c_sr = _mm_srli_si128(c, 2); // Shift a right by imm8 bytes while shifting in zeros, and store the results in dst. + c_sr = _mm_srli_si128(c, 2); // Shift a right by imm8 bytes while shifting in zeros, and store the results in dst. real = _mm_subs_epi16(c, c_sr); - b_sl = _mm_slli_si128(b, 2); // b3.r, b2.i .... - a_sl = _mm_slli_si128(a, 2); // a3.r, a2.i .... + b_sl = _mm_slli_si128(b, 2); // b3.r, b2.i .... + a_sl = _mm_slli_si128(a, 2); // a3.r, a2.i .... - imag1 = _mm_mullo_epi16(a, b_sl); // a3.i*b3.r, .... - imag2 = _mm_mullo_epi16(b, a_sl); // b3.i*a3.r, .... + imag1 = _mm_mullo_epi16(a, b_sl); // a3.i*b3.r, .... + imag2 = _mm_mullo_epi16(b, a_sl); // b3.i*a3.r, .... imag = _mm_adds_epi16(imag1, imag2); @@ -556,12 +562,12 @@ static inline void volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_a_sse3_reload(l a = _mm_or_si128(realcacc[n_vec], imagcacc[n_vec]); - _mm_store_si128((__m128i*)dotProductVector, a); // Store the results back into the dot product vector - dotProduct = lv_cmake(0,0); + _mm_store_si128((__m128i*)dotProductVector, a); // Store the results back into the dot product vector + dotProduct = lv_cmake(0, 0); for (i = 0; i < 4; ++i) { dotProduct = lv_cmake(sat_adds16i(lv_creal(dotProduct), lv_creal(dotProductVector[i])), - sat_adds16i(lv_cimag(dotProduct), lv_cimag(dotProductVector[i]))); + sat_adds16i(lv_cimag(dotProduct), lv_cimag(dotProductVector[i]))); } _out[n_vec] = dotProduct; } @@ -579,7 +585,7 @@ static inline void volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_a_sse3_reload(l //(*phase) = lv_cmake((float*)two_phase_acc[0], (float*)two_phase_acc[1]); (*phase) = two_phase_acc[0]; - for(n = sse_iters * 4; n < num_points; n++) + for (n = sse_iters * 4; n < num_points; n++) { tmp16 = in_common[n]; //printf("a_sse phase %i: %f,%f\n", n,lv_creal(*phase),lv_cimag(*phase)); tmp32 = lv_cmake((float)lv_creal(tmp16), (float)lv_cimag(tmp16)) * (*phase); @@ -591,10 +597,9 @@ static inline void volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_a_sse3_reload(l lv_16sc_t tmp = tmp16 * in_a[n_vec][n]; //lv_16sc_t tmp = lv_cmake(sat_adds16i(sat_muls16i(lv_creal(tmp16), lv_creal(in_a[n_vec][n])), - sat_muls16i(lv_cimag(tmp16), lv_cimag(in_a[n_vec][n]))) , sat_adds16i(sat_muls16i(lv_creal(tmp16), lv_cimag(in_a[n_vec][n])), sat_muls16i(lv_cimag(tmp16), lv_creal(in_a[n_vec][n])))); _out[n_vec] = lv_cmake(sat_adds16i(lv_creal(_out[n_vec]), lv_creal(tmp)), - sat_adds16i(lv_cimag(_out[n_vec]), lv_cimag(tmp))); + sat_adds16i(lv_cimag(_out[n_vec]), lv_cimag(tmp))); } } - } #endif /* LV_HAVE_SSE3 */ @@ -602,9 +607,9 @@ static inline void volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_a_sse3_reload(l #ifdef LV_HAVE_SSE3 #include -static inline void volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_u_sse3(lv_16sc_t* result, const lv_16sc_t* in_common, const lv_32fc_t phase_inc, lv_32fc_t* phase, const lv_16sc_t** in_a, int num_a_vectors, unsigned int num_points) +static inline void volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_u_sse3(lv_16sc_t* result, const lv_16sc_t* in_common, const lv_32fc_t phase_inc, lv_32fc_t* phase, const lv_16sc_t** in_a, int num_a_vectors, unsigned int num_points) { - lv_16sc_t dotProduct = lv_cmake(0,0); + lv_16sc_t dotProduct = lv_cmake(0, 0); const unsigned int sse_iters = num_points / 4; int n_vec; @@ -615,7 +620,8 @@ static inline void volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_u_sse3(lv_16sc_ const lv_16sc_t* _in_common = in_common; lv_16sc_t* _out = result; - __VOLK_ATTR_ALIGNED(16) lv_16sc_t dotProductVector[4]; + __VOLK_ATTR_ALIGNED(16) + lv_16sc_t dotProductVector[4]; __m128i* realcacc = (__m128i*)volk_gnsssdr_malloc(num_a_vectors * sizeof(__m128i), volk_gnsssdr_get_alignment()); __m128i* imagcacc = (__m128i*)volk_gnsssdr_malloc(num_a_vectors * sizeof(__m128i), volk_gnsssdr_get_alignment()); @@ -634,11 +640,13 @@ static inline void volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_u_sse3(lv_16sc_ // phase rotation registers __m128 pa, pb, two_phase_acc_reg, two_phase_inc_reg; __m128i pc1, pc2; - __VOLK_ATTR_ALIGNED(16) lv_32fc_t two_phase_inc[2]; + __VOLK_ATTR_ALIGNED(16) + lv_32fc_t two_phase_inc[2]; two_phase_inc[0] = phase_inc * phase_inc; two_phase_inc[1] = phase_inc * phase_inc; - two_phase_inc_reg = _mm_loadu_ps((float*) two_phase_inc); - __VOLK_ATTR_ALIGNED(16) lv_32fc_t two_phase_acc[2]; + two_phase_inc_reg = _mm_loadu_ps((float*)two_phase_inc); + __VOLK_ATTR_ALIGNED(16) + lv_32fc_t two_phase_acc[2]; two_phase_acc[0] = (*phase); two_phase_acc[1] = (*phase) * phase_inc; two_phase_acc_reg = _mm_loadu_ps((float*)two_phase_acc); @@ -646,69 +654,69 @@ static inline void volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_u_sse3(lv_16sc_ lv_16sc_t tmp16; lv_32fc_t tmp32; - for(number = 0; number < sse_iters; number++) + for (number = 0; number < sse_iters; number++) { // Phase rotation on operand in_common starts here: - pa = _mm_set_ps((float)(lv_cimag(_in_common[1])), (float)(lv_creal(_in_common[1])), (float)(lv_cimag(_in_common[0])), (float)(lv_creal(_in_common[0]))); // //load (2 byte imag, 2 byte real) x 2 into 128 bits reg + pa = _mm_set_ps((float)(lv_cimag(_in_common[1])), (float)(lv_creal(_in_common[1])), (float)(lv_cimag(_in_common[0])), (float)(lv_creal(_in_common[0]))); // //load (2 byte imag, 2 byte real) x 2 into 128 bits reg __VOLK_GNSSSDR_PREFETCH(_in_common + 8); //complex 32fc multiplication b=a*two_phase_acc_reg - yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr - yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di - tmp1 = _mm_mul_ps(pa, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr - pa = _mm_shuffle_ps(pa, pa, 0xB1); // Re-arrange x to be ai,ar,bi,br - tmp2 = _mm_mul_ps(pa, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di - pb = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di - pc1 = _mm_cvtps_epi32(pb); // convert from 32fc to 32ic + yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr + yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di + tmp1 = _mm_mul_ps(pa, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr + pa = _mm_shuffle_ps(pa, pa, 0xB1); // Re-arrange x to be ai,ar,bi,br + tmp2 = _mm_mul_ps(pa, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di + pb = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di + pc1 = _mm_cvtps_epi32(pb); // convert from 32fc to 32ic //complex 32fc multiplication two_phase_acc_reg=two_phase_acc_reg*two_phase_inc_reg - yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr - yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di - tmp1 = _mm_mul_ps(two_phase_inc_reg, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr - tmp3 = _mm_shuffle_ps(two_phase_inc_reg, two_phase_inc_reg, 0xB1); // Re-arrange x to be ai,ar,bi,br - tmp2 = _mm_mul_ps(tmp3, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di - two_phase_acc_reg = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di + yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr + yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di + tmp1 = _mm_mul_ps(two_phase_inc_reg, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr + tmp3 = _mm_shuffle_ps(two_phase_inc_reg, two_phase_inc_reg, 0xB1); // Re-arrange x to be ai,ar,bi,br + tmp2 = _mm_mul_ps(tmp3, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di + two_phase_acc_reg = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di //next two samples _in_common += 2; - pa = _mm_set_ps((float)(lv_cimag(_in_common[1])), (float)(lv_creal(_in_common[1])), (float)(lv_cimag(_in_common[0])), (float)(lv_creal(_in_common[0]))); // //load (2 byte imag, 2 byte real) x 2 into 128 bits reg + pa = _mm_set_ps((float)(lv_cimag(_in_common[1])), (float)(lv_creal(_in_common[1])), (float)(lv_cimag(_in_common[0])), (float)(lv_creal(_in_common[0]))); // //load (2 byte imag, 2 byte real) x 2 into 128 bits reg __VOLK_GNSSSDR_PREFETCH(_in_common + 8); //complex 32fc multiplication b=a*two_phase_acc_reg - yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr - yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di - tmp1 = _mm_mul_ps(pa, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr - pa = _mm_shuffle_ps(pa, pa, 0xB1); // Re-arrange x to be ai,ar,bi,br - tmp2 = _mm_mul_ps(pa, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di - pb = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di - pc2 = _mm_cvtps_epi32(pb); // convert from 32fc to 32ic + yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr + yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di + tmp1 = _mm_mul_ps(pa, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr + pa = _mm_shuffle_ps(pa, pa, 0xB1); // Re-arrange x to be ai,ar,bi,br + tmp2 = _mm_mul_ps(pa, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di + pb = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di + pc2 = _mm_cvtps_epi32(pb); // convert from 32fc to 32ic //complex 32fc multiplication two_phase_acc_reg=two_phase_acc_reg*two_phase_inc_reg - yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr - yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di - tmp1 = _mm_mul_ps(two_phase_inc_reg, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr - tmp3 = _mm_shuffle_ps(two_phase_inc_reg, two_phase_inc_reg, 0xB1); // Re-arrange x to be ai,ar,bi,br - tmp2 = _mm_mul_ps(tmp3, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di - two_phase_acc_reg = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di + yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr + yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di + tmp1 = _mm_mul_ps(two_phase_inc_reg, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr + tmp3 = _mm_shuffle_ps(two_phase_inc_reg, two_phase_inc_reg, 0xB1); // Re-arrange x to be ai,ar,bi,br + tmp2 = _mm_mul_ps(tmp3, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di + two_phase_acc_reg = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di // store four rotated in_common samples in the register b - b = _mm_packs_epi32(pc1, pc2);// convert from 32ic to 16ic + b = _mm_packs_epi32(pc1, pc2); // convert from 32ic to 16ic //next two samples _in_common += 2; for (n_vec = 0; n_vec < num_a_vectors; n_vec++) { - a = _mm_loadu_si128((__m128i*)&(_in_a[n_vec][number*4])); //load (2 byte imag, 2 byte real) x 4 into 128 bits reg + a = _mm_loadu_si128((__m128i*)&(_in_a[n_vec][number * 4])); //load (2 byte imag, 2 byte real) x 4 into 128 bits reg - c = _mm_mullo_epi16(a, b); // a3.i*b3.i, a3.r*b3.r, .... + c = _mm_mullo_epi16(a, b); // a3.i*b3.i, a3.r*b3.r, .... - c_sr = _mm_srli_si128(c, 2); // Shift a right by imm8 bytes while shifting in zeros, and store the results in dst. + c_sr = _mm_srli_si128(c, 2); // Shift a right by imm8 bytes while shifting in zeros, and store the results in dst. real = _mm_subs_epi16(c, c_sr); - b_sl = _mm_slli_si128(b, 2); // b3.r, b2.i .... - a_sl = _mm_slli_si128(a, 2); // a3.r, a2.i .... + b_sl = _mm_slli_si128(b, 2); // b3.r, b2.i .... + a_sl = _mm_slli_si128(a, 2); // a3.r, a2.i .... - imag1 = _mm_mullo_epi16(a, b_sl); // a3.i*b3.r, .... - imag2 = _mm_mullo_epi16(b, a_sl); // b3.i*a3.r, .... + imag1 = _mm_mullo_epi16(a, b_sl); // a3.i*b3.r, .... + imag2 = _mm_mullo_epi16(b, a_sl); // b3.i*a3.r, .... imag = _mm_adds_epi16(imag1, imag2); @@ -733,12 +741,12 @@ static inline void volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_u_sse3(lv_16sc_ a = _mm_or_si128(realcacc[n_vec], imagcacc[n_vec]); - _mm_store_si128((__m128i*)dotProductVector, a); // Store the results back into the dot product vector - dotProduct = lv_cmake(0,0); + _mm_store_si128((__m128i*)dotProductVector, a); // Store the results back into the dot product vector + dotProduct = lv_cmake(0, 0); for (j = 0; j < 4; ++j) { dotProduct = lv_cmake(sat_adds16i(lv_creal(dotProduct), lv_creal(dotProductVector[j])), - sat_adds16i(lv_cimag(dotProduct), lv_cimag(dotProductVector[j]))); + sat_adds16i(lv_cimag(dotProduct), lv_cimag(dotProductVector[j]))); } _out[n_vec] = dotProduct; } @@ -748,7 +756,7 @@ static inline void volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_u_sse3(lv_16sc_ _mm_store_ps((float*)two_phase_acc, two_phase_acc_reg); (*phase) = two_phase_acc[0]; - for(n = sse_iters * 4; n < num_points; n++) + for (n = sse_iters * 4; n < num_points; n++) { tmp16 = in_common[n]; tmp32 = lv_cmake((float)lv_creal(tmp16), (float)lv_cimag(tmp16)) * (*phase); @@ -758,7 +766,7 @@ static inline void volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_u_sse3(lv_16sc_ { lv_16sc_t tmp = tmp16 * in_a[n_vec][n]; _out[n_vec] = lv_cmake(sat_adds16i(lv_creal(_out[n_vec]), lv_creal(tmp)), - sat_adds16i(lv_cimag(_out[n_vec]), lv_cimag(tmp))); + sat_adds16i(lv_cimag(_out[n_vec]), lv_cimag(tmp))); } } } @@ -768,7 +776,7 @@ static inline void volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_u_sse3(lv_16sc_ #ifdef LV_HAVE_AVX2 #include -static inline void volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_a_avx2(lv_16sc_t* result, const lv_16sc_t* in_common, const lv_32fc_t phase_inc, lv_32fc_t* phase, const lv_16sc_t** in_a, int num_a_vectors, unsigned int num_points) +static inline void volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_a_avx2(lv_16sc_t* result, const lv_16sc_t* in_common, const lv_32fc_t phase_inc, lv_32fc_t* phase, const lv_16sc_t** in_a, int num_a_vectors, unsigned int num_points) { const unsigned int avx2_iters = num_points / 8; const lv_16sc_t** _in_a = in_a; @@ -781,8 +789,9 @@ static inline void volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_a_avx2(lv_16sc_ lv_16sc_t tmp16; lv_32fc_t tmp32; - __VOLK_ATTR_ALIGNED(32) lv_16sc_t dotProductVector[8]; - lv_16sc_t dotProduct = lv_cmake(0,0); + __VOLK_ATTR_ALIGNED(32) + lv_16sc_t dotProductVector[8]; + lv_16sc_t dotProduct = lv_cmake(0, 0); __m256i* realcacc = (__m256i*)volk_gnsssdr_malloc(num_a_vectors * sizeof(__m256i), volk_gnsssdr_get_alignment()); __m256i* imagcacc = (__m256i*)volk_gnsssdr_malloc(num_a_vectors * sizeof(__m256i), volk_gnsssdr_get_alignment()); @@ -798,104 +807,106 @@ static inline void volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_a_avx2(lv_16sc_ __m128 a, b, two_phase_acc_reg, two_phase_inc_reg; __m128i c1, c2, result1, result2; - __VOLK_ATTR_ALIGNED(16) lv_32fc_t two_phase_inc[2]; + __VOLK_ATTR_ALIGNED(16) + lv_32fc_t two_phase_inc[2]; two_phase_inc[0] = phase_inc * phase_inc; two_phase_inc[1] = phase_inc * phase_inc; - two_phase_inc_reg = _mm_load_ps((float*) two_phase_inc); - __VOLK_ATTR_ALIGNED(16) lv_32fc_t two_phase_acc[2]; + two_phase_inc_reg = _mm_load_ps((float*)two_phase_inc); + __VOLK_ATTR_ALIGNED(16) + lv_32fc_t two_phase_acc[2]; two_phase_acc[0] = (*phase); two_phase_acc[1] = (*phase) * phase_inc; - two_phase_acc_reg = _mm_load_ps((float*) two_phase_acc); + two_phase_acc_reg = _mm_load_ps((float*)two_phase_acc); __m256i a2, b2, c, c_sr, real, imag; __m128 yl, yh, tmp1, tmp2, tmp3; - for(number = 0; number < avx2_iters; number++) + for (number = 0; number < avx2_iters; number++) { - a = _mm_set_ps((float)(lv_cimag(_in_common[1])), (float)(lv_creal(_in_common[1])), (float)(lv_cimag(_in_common[0])), (float)(lv_creal(_in_common[0]))); // //load (2 byte imag, 2 byte real) x 2 into 128 bits reg + a = _mm_set_ps((float)(lv_cimag(_in_common[1])), (float)(lv_creal(_in_common[1])), (float)(lv_cimag(_in_common[0])), (float)(lv_creal(_in_common[0]))); // //load (2 byte imag, 2 byte real) x 2 into 128 bits reg //complex 32fc multiplication b=a*two_phase_acc_reg - yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr - yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di - tmp1 = _mm_mul_ps(a, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr - a = _mm_shuffle_ps(a, a, 0xB1); // Re-arrange x to be ai,ar,bi,br - tmp2 = _mm_mul_ps(a, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di - b = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di - c1 = _mm_cvtps_epi32(b); // convert from 32fc to 32ic + yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr + yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di + tmp1 = _mm_mul_ps(a, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr + a = _mm_shuffle_ps(a, a, 0xB1); // Re-arrange x to be ai,ar,bi,br + tmp2 = _mm_mul_ps(a, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di + b = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di + c1 = _mm_cvtps_epi32(b); // convert from 32fc to 32ic //complex 32fc multiplication two_phase_acc_reg=two_phase_acc_reg*two_phase_inc_reg - yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr - yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di - tmp1 = _mm_mul_ps(two_phase_inc_reg, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr - tmp3 = _mm_shuffle_ps(two_phase_inc_reg, two_phase_inc_reg, 0xB1); // Re-arrange x to be ai,ar,bi,br - tmp2 = _mm_mul_ps(tmp3, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di - two_phase_acc_reg = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di + yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr + yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di + tmp1 = _mm_mul_ps(two_phase_inc_reg, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr + tmp3 = _mm_shuffle_ps(two_phase_inc_reg, two_phase_inc_reg, 0xB1); // Re-arrange x to be ai,ar,bi,br + tmp2 = _mm_mul_ps(tmp3, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di + two_phase_acc_reg = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di //next two samples _in_common += 2; - a = _mm_set_ps((float)(lv_cimag(_in_common[1])), (float)(lv_creal(_in_common[1])), (float)(lv_cimag(_in_common[0])), (float)(lv_creal(_in_common[0]))); // //load (2 byte imag, 2 byte real) x 2 into 128 bits reg + a = _mm_set_ps((float)(lv_cimag(_in_common[1])), (float)(lv_creal(_in_common[1])), (float)(lv_cimag(_in_common[0])), (float)(lv_creal(_in_common[0]))); // //load (2 byte imag, 2 byte real) x 2 into 128 bits reg //complex 32fc multiplication b=a*two_phase_acc_reg - yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr - yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di - tmp1 = _mm_mul_ps(a, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr - a = _mm_shuffle_ps(a, a, 0xB1); // Re-arrange x to be ai,ar,bi,br - tmp2 = _mm_mul_ps(a, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di - b = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di - c2 = _mm_cvtps_epi32(b); // convert from 32fc to 32ic + yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr + yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di + tmp1 = _mm_mul_ps(a, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr + a = _mm_shuffle_ps(a, a, 0xB1); // Re-arrange x to be ai,ar,bi,br + tmp2 = _mm_mul_ps(a, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di + b = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di + c2 = _mm_cvtps_epi32(b); // convert from 32fc to 32ic //complex 32fc multiplication two_phase_acc_reg=two_phase_acc_reg*two_phase_inc_reg - yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr - yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di - tmp1 = _mm_mul_ps(two_phase_inc_reg, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr - tmp3 = _mm_shuffle_ps(two_phase_inc_reg, two_phase_inc_reg, 0xB1); // Re-arrange x to be ai,ar,bi,br - tmp2 = _mm_mul_ps(tmp3, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di - two_phase_acc_reg = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di + yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr + yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di + tmp1 = _mm_mul_ps(two_phase_inc_reg, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr + tmp3 = _mm_shuffle_ps(two_phase_inc_reg, two_phase_inc_reg, 0xB1); // Re-arrange x to be ai,ar,bi,br + tmp2 = _mm_mul_ps(tmp3, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di + two_phase_acc_reg = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di // store four output samples - result1 = _mm_packs_epi32(c1, c2);// convert from 32ic to 16ic + result1 = _mm_packs_epi32(c1, c2); // convert from 32ic to 16ic _in_common += 2; - a = _mm_set_ps((float)(lv_cimag(_in_common[1])), (float)(lv_creal(_in_common[1])), (float)(lv_cimag(_in_common[0])), (float)(lv_creal(_in_common[0]))); // //load (2 byte imag, 2 byte real) x 2 into 128 bits reg + a = _mm_set_ps((float)(lv_cimag(_in_common[1])), (float)(lv_creal(_in_common[1])), (float)(lv_cimag(_in_common[0])), (float)(lv_creal(_in_common[0]))); // //load (2 byte imag, 2 byte real) x 2 into 128 bits reg //complex 32fc multiplication b=a*two_phase_acc_reg - yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr - yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di - tmp1 = _mm_mul_ps(a, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr - a = _mm_shuffle_ps(a, a, 0xB1); // Re-arrange x to be ai,ar,bi,br - tmp2 = _mm_mul_ps(a, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di - b = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di - c1 = _mm_cvtps_epi32(b); // convert from 32fc to 32ic + yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr + yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di + tmp1 = _mm_mul_ps(a, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr + a = _mm_shuffle_ps(a, a, 0xB1); // Re-arrange x to be ai,ar,bi,br + tmp2 = _mm_mul_ps(a, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di + b = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di + c1 = _mm_cvtps_epi32(b); // convert from 32fc to 32ic //complex 32fc multiplication two_phase_acc_reg=two_phase_acc_reg*two_phase_inc_reg - yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr - yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di - tmp1 = _mm_mul_ps(two_phase_inc_reg, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr - tmp3 = _mm_shuffle_ps(two_phase_inc_reg, two_phase_inc_reg, 0xB1); // Re-arrange x to be ai,ar,bi,br - tmp2 = _mm_mul_ps(tmp3, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di - two_phase_acc_reg = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di + yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr + yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di + tmp1 = _mm_mul_ps(two_phase_inc_reg, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr + tmp3 = _mm_shuffle_ps(two_phase_inc_reg, two_phase_inc_reg, 0xB1); // Re-arrange x to be ai,ar,bi,br + tmp2 = _mm_mul_ps(tmp3, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di + two_phase_acc_reg = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di //next two samples _in_common += 2; - a = _mm_set_ps((float)(lv_cimag(_in_common[1])), (float)(lv_creal(_in_common[1])), (float)(lv_cimag(_in_common[0])), (float)(lv_creal(_in_common[0]))); // //load (2 byte imag, 2 byte real) x 2 into 128 bits reg + a = _mm_set_ps((float)(lv_cimag(_in_common[1])), (float)(lv_creal(_in_common[1])), (float)(lv_cimag(_in_common[0])), (float)(lv_creal(_in_common[0]))); // //load (2 byte imag, 2 byte real) x 2 into 128 bits reg __VOLK_GNSSSDR_PREFETCH(_in_common + 16); //complex 32fc multiplication b=a*two_phase_acc_reg - yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr - yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di - tmp1 = _mm_mul_ps(a, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr - a = _mm_shuffle_ps(a, a, 0xB1); // Re-arrange x to be ai,ar,bi,br - tmp2 = _mm_mul_ps(a, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di - b = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di - c2 = _mm_cvtps_epi32(b); // convert from 32fc to 32ic + yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr + yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di + tmp1 = _mm_mul_ps(a, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr + a = _mm_shuffle_ps(a, a, 0xB1); // Re-arrange x to be ai,ar,bi,br + tmp2 = _mm_mul_ps(a, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di + b = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di + c2 = _mm_cvtps_epi32(b); // convert from 32fc to 32ic //complex 32fc multiplication two_phase_acc_reg=two_phase_acc_reg*two_phase_inc_reg - yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr - yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di - tmp1 = _mm_mul_ps(two_phase_inc_reg, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr - tmp3 = _mm_shuffle_ps(two_phase_inc_reg, two_phase_inc_reg, 0xB1); // Re-arrange x to be ai,ar,bi,br - tmp2 = _mm_mul_ps(tmp3, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di - two_phase_acc_reg = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di + yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr + yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di + tmp1 = _mm_mul_ps(two_phase_inc_reg, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr + tmp3 = _mm_shuffle_ps(two_phase_inc_reg, two_phase_inc_reg, 0xB1); // Re-arrange x to be ai,ar,bi,br + tmp2 = _mm_mul_ps(tmp3, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di + two_phase_acc_reg = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di // store four output samples - result2 = _mm_packs_epi32(c1, c2);// convert from 32ic to 16ic + result2 = _mm_packs_epi32(c1, c2); // convert from 32ic to 16ic _in_common += 2; b2 = _mm256_insertf128_si256(_mm256_castsi128_si256(result1), (result2), 1); for (n_vec = 0; n_vec < num_a_vectors; n_vec++) @@ -904,7 +915,7 @@ static inline void volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_a_avx2(lv_16sc_ c = _mm256_mullo_epi16(a2, b2); - c_sr = _mm256_srli_si256(c, 2); // Shift a right by imm8 bytes while shifting in zeros, and store the results in dst. + c_sr = _mm256_srli_si256(c, 2); // Shift a right by imm8 bytes while shifting in zeros, and store the results in dst. real = _mm256_subs_epi16(c, c_sr); c_sr = _mm256_slli_si256(b2, 2); @@ -936,12 +947,12 @@ static inline void volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_a_avx2(lv_16sc_ a2 = _mm256_or_si256(realcacc[n_vec], imagcacc[n_vec]); - _mm256_store_si256((__m256i*)dotProductVector, a2); // Store the results back into the dot product vector - dotProduct = lv_cmake(0,0); + _mm256_store_si256((__m256i*)dotProductVector, a2); // Store the results back into the dot product vector + dotProduct = lv_cmake(0, 0); for (number = 0; number < 8; ++number) { dotProduct = lv_cmake(sat_adds16i(lv_creal(dotProduct), lv_creal(dotProductVector[number])), - sat_adds16i(lv_cimag(dotProduct), lv_cimag(dotProductVector[number]))); + sat_adds16i(lv_cimag(dotProduct), lv_cimag(dotProductVector[number]))); } _out[n_vec] = dotProduct; } @@ -953,7 +964,7 @@ static inline void volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_a_avx2(lv_16sc_ _mm_store_ps((float*)two_phase_acc, two_phase_acc_reg); (*phase) = two_phase_acc[0]; - for(n = avx2_iters * 8; n < num_points; n++) + for (n = avx2_iters * 8; n < num_points; n++) { tmp16 = in_common[n]; tmp32 = lv_cmake((float)lv_creal(tmp16), (float)lv_cimag(tmp16)) * (*phase); @@ -963,10 +974,9 @@ static inline void volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_a_avx2(lv_16sc_ { lv_16sc_t tmp = tmp16 * in_a[n_vec][n]; _out[n_vec] = lv_cmake(sat_adds16i(lv_creal(_out[n_vec]), lv_creal(tmp)), - sat_adds16i(lv_cimag(_out[n_vec]), lv_cimag(tmp))); + sat_adds16i(lv_cimag(_out[n_vec]), lv_cimag(tmp))); } } - } #endif /* LV_HAVE_AVX2 */ @@ -974,7 +984,7 @@ static inline void volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_a_avx2(lv_16sc_ #ifdef LV_HAVE_AVX2 #include -static inline void volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_a_avx2_reload(lv_16sc_t* result, const lv_16sc_t* in_common, const lv_32fc_t phase_inc, lv_32fc_t* phase, const lv_16sc_t** in_a, int num_a_vectors, unsigned int num_points) +static inline void volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_a_avx2_reload(lv_16sc_t* result, const lv_16sc_t* in_common, const lv_32fc_t phase_inc, lv_32fc_t* phase, const lv_16sc_t** in_a, int num_a_vectors, unsigned int num_points) { const unsigned int avx2_iters = num_points / 8; const unsigned int ROTATOR_RELOAD = 128; @@ -989,8 +999,9 @@ static inline void volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_a_avx2_reload(l lv_16sc_t tmp16; lv_32fc_t tmp32; - __VOLK_ATTR_ALIGNED(32) lv_16sc_t dotProductVector[8]; - lv_16sc_t dotProduct = lv_cmake(0,0); + __VOLK_ATTR_ALIGNED(32) + lv_16sc_t dotProductVector[8]; + lv_16sc_t dotProduct = lv_cmake(0, 0); __m256i* realcacc = (__m256i*)volk_gnsssdr_malloc(num_a_vectors * sizeof(__m256i), volk_gnsssdr_get_alignment()); __m256i* imagcacc = (__m256i*)volk_gnsssdr_malloc(num_a_vectors * sizeof(__m256i), volk_gnsssdr_get_alignment()); @@ -1006,106 +1017,108 @@ static inline void volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_a_avx2_reload(l __m128 a, b, two_phase_acc_reg, two_phase_inc_reg; __m128i c1, c2, result1, result2; - __VOLK_ATTR_ALIGNED(16) lv_32fc_t two_phase_inc[2]; + __VOLK_ATTR_ALIGNED(16) + lv_32fc_t two_phase_inc[2]; two_phase_inc[0] = phase_inc * phase_inc; two_phase_inc[1] = phase_inc * phase_inc; - two_phase_inc_reg = _mm_load_ps((float*) two_phase_inc); - __VOLK_ATTR_ALIGNED(16) lv_32fc_t two_phase_acc[2]; + two_phase_inc_reg = _mm_load_ps((float*)two_phase_inc); + __VOLK_ATTR_ALIGNED(16) + lv_32fc_t two_phase_acc[2]; two_phase_acc[0] = (*phase); two_phase_acc[1] = (*phase) * phase_inc; - two_phase_acc_reg = _mm_load_ps((float*) two_phase_acc); + two_phase_acc_reg = _mm_load_ps((float*)two_phase_acc); __m256i a2, b2, c, c_sr, real, imag; __m128 yl, yh, tmp1, tmp2, tmp3; - for (number = 0; number < avx2_iters / ROTATOR_RELOAD; ++number) + for (number = 0; number < avx2_iters / ROTATOR_RELOAD; ++number) { for (j = 0; j < ROTATOR_RELOAD; j++) { - a = _mm_set_ps((float)(lv_cimag(_in_common[1])), (float)(lv_creal(_in_common[1])), (float)(lv_cimag(_in_common[0])), (float)(lv_creal(_in_common[0]))); // //load (2 byte imag, 2 byte real) x 2 into 128 bits reg + a = _mm_set_ps((float)(lv_cimag(_in_common[1])), (float)(lv_creal(_in_common[1])), (float)(lv_cimag(_in_common[0])), (float)(lv_creal(_in_common[0]))); // //load (2 byte imag, 2 byte real) x 2 into 128 bits reg //complex 32fc multiplication b=a*two_phase_acc_reg - yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr - yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di - tmp1 = _mm_mul_ps(a, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr - a = _mm_shuffle_ps(a, a, 0xB1); // Re-arrange x to be ai,ar,bi,br - tmp2 = _mm_mul_ps(a, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di - b = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di - c1 = _mm_cvtps_epi32(b); // convert from 32fc to 32ic + yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr + yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di + tmp1 = _mm_mul_ps(a, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr + a = _mm_shuffle_ps(a, a, 0xB1); // Re-arrange x to be ai,ar,bi,br + tmp2 = _mm_mul_ps(a, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di + b = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di + c1 = _mm_cvtps_epi32(b); // convert from 32fc to 32ic //complex 32fc multiplication two_phase_acc_reg=two_phase_acc_reg*two_phase_inc_reg - yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr - yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di - tmp1 = _mm_mul_ps(two_phase_inc_reg, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr - tmp3 = _mm_shuffle_ps(two_phase_inc_reg, two_phase_inc_reg, 0xB1); // Re-arrange x to be ai,ar,bi,br - tmp2 = _mm_mul_ps(tmp3, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di - two_phase_acc_reg = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di + yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr + yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di + tmp1 = _mm_mul_ps(two_phase_inc_reg, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr + tmp3 = _mm_shuffle_ps(two_phase_inc_reg, two_phase_inc_reg, 0xB1); // Re-arrange x to be ai,ar,bi,br + tmp2 = _mm_mul_ps(tmp3, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di + two_phase_acc_reg = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di //next two samples _in_common += 2; - a = _mm_set_ps((float)(lv_cimag(_in_common[1])), (float)(lv_creal(_in_common[1])), (float)(lv_cimag(_in_common[0])), (float)(lv_creal(_in_common[0]))); // //load (2 byte imag, 2 byte real) x 2 into 128 bits reg + a = _mm_set_ps((float)(lv_cimag(_in_common[1])), (float)(lv_creal(_in_common[1])), (float)(lv_cimag(_in_common[0])), (float)(lv_creal(_in_common[0]))); // //load (2 byte imag, 2 byte real) x 2 into 128 bits reg //complex 32fc multiplication b=a*two_phase_acc_reg - yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr - yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di - tmp1 = _mm_mul_ps(a, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr - a = _mm_shuffle_ps(a, a, 0xB1); // Re-arrange x to be ai,ar,bi,br - tmp2 = _mm_mul_ps(a, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di - b = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di - c2 = _mm_cvtps_epi32(b); // convert from 32fc to 32ic + yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr + yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di + tmp1 = _mm_mul_ps(a, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr + a = _mm_shuffle_ps(a, a, 0xB1); // Re-arrange x to be ai,ar,bi,br + tmp2 = _mm_mul_ps(a, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di + b = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di + c2 = _mm_cvtps_epi32(b); // convert from 32fc to 32ic //complex 32fc multiplication two_phase_acc_reg=two_phase_acc_reg*two_phase_inc_reg - yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr - yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di - tmp1 = _mm_mul_ps(two_phase_inc_reg, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr - tmp3 = _mm_shuffle_ps(two_phase_inc_reg, two_phase_inc_reg, 0xB1); // Re-arrange x to be ai,ar,bi,br - tmp2 = _mm_mul_ps(tmp3, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di - two_phase_acc_reg = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di + yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr + yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di + tmp1 = _mm_mul_ps(two_phase_inc_reg, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr + tmp3 = _mm_shuffle_ps(two_phase_inc_reg, two_phase_inc_reg, 0xB1); // Re-arrange x to be ai,ar,bi,br + tmp2 = _mm_mul_ps(tmp3, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di + two_phase_acc_reg = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di // store four output samples - result1 = _mm_packs_epi32(c1, c2);// convert from 32ic to 16ic + result1 = _mm_packs_epi32(c1, c2); // convert from 32ic to 16ic _in_common += 2; - a = _mm_set_ps((float)(lv_cimag(_in_common[1])), (float)(lv_creal(_in_common[1])), (float)(lv_cimag(_in_common[0])), (float)(lv_creal(_in_common[0]))); // //load (2 byte imag, 2 byte real) x 2 into 128 bits reg + a = _mm_set_ps((float)(lv_cimag(_in_common[1])), (float)(lv_creal(_in_common[1])), (float)(lv_cimag(_in_common[0])), (float)(lv_creal(_in_common[0]))); // //load (2 byte imag, 2 byte real) x 2 into 128 bits reg //complex 32fc multiplication b=a*two_phase_acc_reg - yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr - yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di - tmp1 = _mm_mul_ps(a, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr - a = _mm_shuffle_ps(a, a, 0xB1); // Re-arrange x to be ai,ar,bi,br - tmp2 = _mm_mul_ps(a, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di - b = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di - c1 = _mm_cvtps_epi32(b); // convert from 32fc to 32ic + yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr + yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di + tmp1 = _mm_mul_ps(a, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr + a = _mm_shuffle_ps(a, a, 0xB1); // Re-arrange x to be ai,ar,bi,br + tmp2 = _mm_mul_ps(a, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di + b = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di + c1 = _mm_cvtps_epi32(b); // convert from 32fc to 32ic //complex 32fc multiplication two_phase_acc_reg=two_phase_acc_reg*two_phase_inc_reg - yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr - yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di - tmp1 = _mm_mul_ps(two_phase_inc_reg, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr - tmp3 = _mm_shuffle_ps(two_phase_inc_reg, two_phase_inc_reg, 0xB1); // Re-arrange x to be ai,ar,bi,br - tmp2 = _mm_mul_ps(tmp3, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di - two_phase_acc_reg = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di + yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr + yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di + tmp1 = _mm_mul_ps(two_phase_inc_reg, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr + tmp3 = _mm_shuffle_ps(two_phase_inc_reg, two_phase_inc_reg, 0xB1); // Re-arrange x to be ai,ar,bi,br + tmp2 = _mm_mul_ps(tmp3, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di + two_phase_acc_reg = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di //next two samples _in_common += 2; - a = _mm_set_ps((float)(lv_cimag(_in_common[1])), (float)(lv_creal(_in_common[1])), (float)(lv_cimag(_in_common[0])), (float)(lv_creal(_in_common[0]))); // //load (2 byte imag, 2 byte real) x 2 into 128 bits reg + a = _mm_set_ps((float)(lv_cimag(_in_common[1])), (float)(lv_creal(_in_common[1])), (float)(lv_cimag(_in_common[0])), (float)(lv_creal(_in_common[0]))); // //load (2 byte imag, 2 byte real) x 2 into 128 bits reg __VOLK_GNSSSDR_PREFETCH(_in_common + 16); //complex 32fc multiplication b=a*two_phase_acc_reg - yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr - yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di - tmp1 = _mm_mul_ps(a, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr - a = _mm_shuffle_ps(a, a, 0xB1); // Re-arrange x to be ai,ar,bi,br - tmp2 = _mm_mul_ps(a, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di - b = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di - c2 = _mm_cvtps_epi32(b); // convert from 32fc to 32ic + yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr + yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di + tmp1 = _mm_mul_ps(a, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr + a = _mm_shuffle_ps(a, a, 0xB1); // Re-arrange x to be ai,ar,bi,br + tmp2 = _mm_mul_ps(a, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di + b = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di + c2 = _mm_cvtps_epi32(b); // convert from 32fc to 32ic //complex 32fc multiplication two_phase_acc_reg=two_phase_acc_reg*two_phase_inc_reg - yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr - yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di - tmp1 = _mm_mul_ps(two_phase_inc_reg, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr - tmp3 = _mm_shuffle_ps(two_phase_inc_reg, two_phase_inc_reg, 0xB1); // Re-arrange x to be ai,ar,bi,br - tmp2 = _mm_mul_ps(tmp3, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di - two_phase_acc_reg = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di + yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr + yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di + tmp1 = _mm_mul_ps(two_phase_inc_reg, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr + tmp3 = _mm_shuffle_ps(two_phase_inc_reg, two_phase_inc_reg, 0xB1); // Re-arrange x to be ai,ar,bi,br + tmp2 = _mm_mul_ps(tmp3, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di + two_phase_acc_reg = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di // store four output samples - result2 = _mm_packs_epi32(c1, c2);// convert from 32ic to 16ic + result2 = _mm_packs_epi32(c1, c2); // convert from 32ic to 16ic _in_common += 2; b2 = _mm256_insertf128_si256(_mm256_castsi128_si256(result1), (result2), 1); for (n_vec = 0; n_vec < num_a_vectors; n_vec++) @@ -1114,7 +1127,7 @@ static inline void volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_a_avx2_reload(l c = _mm256_mullo_epi16(a2, b2); - c_sr = _mm256_srli_si256(c, 2); // Shift a right by imm8 bytes while shifting in zeros, and store the results in dst. + c_sr = _mm256_srli_si256(c, 2); // Shift a right by imm8 bytes while shifting in zeros, and store the results in dst. real = _mm256_subs_epi16(c, c_sr); c_sr = _mm256_slli_si256(b2, 2); @@ -1139,98 +1152,98 @@ static inline void volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_a_avx2_reload(l for (j = 0; j < avx2_iters % ROTATOR_RELOAD; j++) { - a = _mm_set_ps((float)(lv_cimag(_in_common[1])), (float)(lv_creal(_in_common[1])), (float)(lv_cimag(_in_common[0])), (float)(lv_creal(_in_common[0]))); // //load (2 byte imag, 2 byte real) x 2 into 128 bits reg + a = _mm_set_ps((float)(lv_cimag(_in_common[1])), (float)(lv_creal(_in_common[1])), (float)(lv_cimag(_in_common[0])), (float)(lv_creal(_in_common[0]))); // //load (2 byte imag, 2 byte real) x 2 into 128 bits reg //complex 32fc multiplication b=a*two_phase_acc_reg - yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr - yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di - tmp1 = _mm_mul_ps(a, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr - a = _mm_shuffle_ps(a, a, 0xB1); // Re-arrange x to be ai,ar,bi,br - tmp2 = _mm_mul_ps(a, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di - b = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di - c1 = _mm_cvtps_epi32(b); // convert from 32fc to 32ic + yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr + yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di + tmp1 = _mm_mul_ps(a, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr + a = _mm_shuffle_ps(a, a, 0xB1); // Re-arrange x to be ai,ar,bi,br + tmp2 = _mm_mul_ps(a, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di + b = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di + c1 = _mm_cvtps_epi32(b); // convert from 32fc to 32ic //complex 32fc multiplication two_phase_acc_reg=two_phase_acc_reg*two_phase_inc_reg - yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr - yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di - tmp1 = _mm_mul_ps(two_phase_inc_reg, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr - tmp3 = _mm_shuffle_ps(two_phase_inc_reg, two_phase_inc_reg, 0xB1); // Re-arrange x to be ai,ar,bi,br - tmp2 = _mm_mul_ps(tmp3, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di - two_phase_acc_reg = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di + yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr + yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di + tmp1 = _mm_mul_ps(two_phase_inc_reg, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr + tmp3 = _mm_shuffle_ps(two_phase_inc_reg, two_phase_inc_reg, 0xB1); // Re-arrange x to be ai,ar,bi,br + tmp2 = _mm_mul_ps(tmp3, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di + two_phase_acc_reg = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di //next two samples _in_common += 2; - a = _mm_set_ps((float)(lv_cimag(_in_common[1])), (float)(lv_creal(_in_common[1])), (float)(lv_cimag(_in_common[0])), (float)(lv_creal(_in_common[0]))); // //load (2 byte imag, 2 byte real) x 2 into 128 bits reg + a = _mm_set_ps((float)(lv_cimag(_in_common[1])), (float)(lv_creal(_in_common[1])), (float)(lv_cimag(_in_common[0])), (float)(lv_creal(_in_common[0]))); // //load (2 byte imag, 2 byte real) x 2 into 128 bits reg //complex 32fc multiplication b=a*two_phase_acc_reg - yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr - yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di - tmp1 = _mm_mul_ps(a, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr - a = _mm_shuffle_ps(a, a, 0xB1); // Re-arrange x to be ai,ar,bi,br - tmp2 = _mm_mul_ps(a, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di - b = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di - c2 = _mm_cvtps_epi32(b); // convert from 32fc to 32ic + yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr + yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di + tmp1 = _mm_mul_ps(a, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr + a = _mm_shuffle_ps(a, a, 0xB1); // Re-arrange x to be ai,ar,bi,br + tmp2 = _mm_mul_ps(a, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di + b = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di + c2 = _mm_cvtps_epi32(b); // convert from 32fc to 32ic //complex 32fc multiplication two_phase_acc_reg=two_phase_acc_reg*two_phase_inc_reg - yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr - yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di - tmp1 = _mm_mul_ps(two_phase_inc_reg, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr - tmp3 = _mm_shuffle_ps(two_phase_inc_reg, two_phase_inc_reg, 0xB1); // Re-arrange x to be ai,ar,bi,br - tmp2 = _mm_mul_ps(tmp3, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di - two_phase_acc_reg = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di + yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr + yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di + tmp1 = _mm_mul_ps(two_phase_inc_reg, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr + tmp3 = _mm_shuffle_ps(two_phase_inc_reg, two_phase_inc_reg, 0xB1); // Re-arrange x to be ai,ar,bi,br + tmp2 = _mm_mul_ps(tmp3, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di + two_phase_acc_reg = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di // store four output samples - result1 = _mm_packs_epi32(c1, c2);// convert from 32ic to 16ic + result1 = _mm_packs_epi32(c1, c2); // convert from 32ic to 16ic _in_common += 2; - a = _mm_set_ps((float)(lv_cimag(_in_common[1])), (float)(lv_creal(_in_common[1])), (float)(lv_cimag(_in_common[0])), (float)(lv_creal(_in_common[0]))); // //load (2 byte imag, 2 byte real) x 2 into 128 bits reg + a = _mm_set_ps((float)(lv_cimag(_in_common[1])), (float)(lv_creal(_in_common[1])), (float)(lv_cimag(_in_common[0])), (float)(lv_creal(_in_common[0]))); // //load (2 byte imag, 2 byte real) x 2 into 128 bits reg //complex 32fc multiplication b=a*two_phase_acc_reg - yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr - yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di - tmp1 = _mm_mul_ps(a, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr - a = _mm_shuffle_ps(a, a, 0xB1); // Re-arrange x to be ai,ar,bi,br - tmp2 = _mm_mul_ps(a, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di - b = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di - c1 = _mm_cvtps_epi32(b); // convert from 32fc to 32ic + yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr + yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di + tmp1 = _mm_mul_ps(a, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr + a = _mm_shuffle_ps(a, a, 0xB1); // Re-arrange x to be ai,ar,bi,br + tmp2 = _mm_mul_ps(a, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di + b = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di + c1 = _mm_cvtps_epi32(b); // convert from 32fc to 32ic //complex 32fc multiplication two_phase_acc_reg=two_phase_acc_reg*two_phase_inc_reg - yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr - yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di - tmp1 = _mm_mul_ps(two_phase_inc_reg, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr - tmp3 = _mm_shuffle_ps(two_phase_inc_reg, two_phase_inc_reg, 0xB1); // Re-arrange x to be ai,ar,bi,br - tmp2 = _mm_mul_ps(tmp3, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di - two_phase_acc_reg = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di + yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr + yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di + tmp1 = _mm_mul_ps(two_phase_inc_reg, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr + tmp3 = _mm_shuffle_ps(two_phase_inc_reg, two_phase_inc_reg, 0xB1); // Re-arrange x to be ai,ar,bi,br + tmp2 = _mm_mul_ps(tmp3, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di + two_phase_acc_reg = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di //next two samples _in_common += 2; - a = _mm_set_ps((float)(lv_cimag(_in_common[1])), (float)(lv_creal(_in_common[1])), (float)(lv_cimag(_in_common[0])), (float)(lv_creal(_in_common[0]))); // //load (2 byte imag, 2 byte real) x 2 into 128 bits reg + a = _mm_set_ps((float)(lv_cimag(_in_common[1])), (float)(lv_creal(_in_common[1])), (float)(lv_cimag(_in_common[0])), (float)(lv_creal(_in_common[0]))); // //load (2 byte imag, 2 byte real) x 2 into 128 bits reg __VOLK_GNSSSDR_PREFETCH(_in_common + 16); //complex 32fc multiplication b=a*two_phase_acc_reg - yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr - yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di - tmp1 = _mm_mul_ps(a, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr - a = _mm_shuffle_ps(a, a, 0xB1); // Re-arrange x to be ai,ar,bi,br - tmp2 = _mm_mul_ps(a, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di - b = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di - c2 = _mm_cvtps_epi32(b); // convert from 32fc to 32ic + yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr + yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di + tmp1 = _mm_mul_ps(a, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr + a = _mm_shuffle_ps(a, a, 0xB1); // Re-arrange x to be ai,ar,bi,br + tmp2 = _mm_mul_ps(a, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di + b = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di + c2 = _mm_cvtps_epi32(b); // convert from 32fc to 32ic //complex 32fc multiplication two_phase_acc_reg=two_phase_acc_reg*two_phase_inc_reg - yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr - yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di - tmp1 = _mm_mul_ps(two_phase_inc_reg, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr - tmp3 = _mm_shuffle_ps(two_phase_inc_reg, two_phase_inc_reg, 0xB1); // Re-arrange x to be ai,ar,bi,br - tmp2 = _mm_mul_ps(tmp3, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di - two_phase_acc_reg = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di + yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr + yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di + tmp1 = _mm_mul_ps(two_phase_inc_reg, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr + tmp3 = _mm_shuffle_ps(two_phase_inc_reg, two_phase_inc_reg, 0xB1); // Re-arrange x to be ai,ar,bi,br + tmp2 = _mm_mul_ps(tmp3, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di + two_phase_acc_reg = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di // store four output samples - result2 = _mm_packs_epi32(c1, c2);// convert from 32ic to 16ic + result2 = _mm_packs_epi32(c1, c2); // convert from 32ic to 16ic _in_common += 2; b2 = _mm256_insertf128_si256(_mm256_castsi128_si256(result1), (result2), 1); for (n_vec = 0; n_vec < num_a_vectors; n_vec++) { - a2 = _mm256_load_si256((__m256i*)&(_in_a[n_vec][((avx2_iters / ROTATOR_RELOAD) * ROTATOR_RELOAD + j) * 8])); + a2 = _mm256_load_si256((__m256i*)&(_in_a[n_vec][((avx2_iters / ROTATOR_RELOAD) * ROTATOR_RELOAD + j) * 8])); c = _mm256_mullo_epi16(a2, b2); - c_sr = _mm256_srli_si256(c, 2); // Shift a right by imm8 bytes while shifting in zeros, and store the results in dst. + c_sr = _mm256_srli_si256(c, 2); // Shift a right by imm8 bytes while shifting in zeros, and store the results in dst. real = _mm256_subs_epi16(c, c_sr); c_sr = _mm256_slli_si256(b2, 2); @@ -1253,12 +1266,12 @@ static inline void volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_a_avx2_reload(l a2 = _mm256_or_si256(realcacc[n_vec], imagcacc[n_vec]); - _mm256_store_si256((__m256i*)dotProductVector, a2); // Store the results back into the dot product vector - dotProduct = lv_cmake(0,0); + _mm256_store_si256((__m256i*)dotProductVector, a2); // Store the results back into the dot product vector + dotProduct = lv_cmake(0, 0); for (j = 0; j < 8; ++j) { dotProduct = lv_cmake(sat_adds16i(lv_creal(dotProduct), lv_creal(dotProductVector[j])), - sat_adds16i(lv_cimag(dotProduct), lv_cimag(dotProductVector[j]))); + sat_adds16i(lv_cimag(dotProduct), lv_cimag(dotProductVector[j]))); } _out[n_vec] = dotProduct; } @@ -1269,7 +1282,7 @@ static inline void volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_a_avx2_reload(l _mm_store_ps((float*)two_phase_acc, two_phase_acc_reg); (*phase) = two_phase_acc[0]; - for(n = avx2_iters * 8; n < num_points; n++) + for (n = avx2_iters * 8; n < num_points; n++) { tmp16 = in_common[n]; tmp32 = lv_cmake((float)lv_creal(tmp16), (float)lv_cimag(tmp16)) * (*phase); @@ -1279,7 +1292,7 @@ static inline void volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_a_avx2_reload(l { lv_16sc_t tmp = tmp16 * in_a[n_vec][n]; _out[n_vec] = lv_cmake(sat_adds16i(lv_creal(_out[n_vec]), lv_creal(tmp)), - sat_adds16i(lv_cimag(_out[n_vec]), lv_cimag(tmp))); + sat_adds16i(lv_cimag(_out[n_vec]), lv_cimag(tmp))); } } } @@ -1290,7 +1303,7 @@ static inline void volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_a_avx2_reload(l #ifdef LV_HAVE_NEON #include -static inline void volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_neon(lv_16sc_t* result, const lv_16sc_t* in_common, const lv_32fc_t phase_inc, lv_32fc_t* phase, const lv_16sc_t** in_a, int num_a_vectors, unsigned int num_points) +static inline void volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_neon(lv_16sc_t* result, const lv_16sc_t* in_common, const lv_32fc_t phase_inc, lv_32fc_t* phase, const lv_16sc_t** in_a, int num_a_vectors, unsigned int num_points) { const unsigned int neon_iters = num_points / 4; @@ -1306,14 +1319,16 @@ static inline void volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_neon(lv_16sc_t* if (neon_iters > 0) { - lv_16sc_t dotProduct = lv_cmake(0,0); + lv_16sc_t dotProduct = lv_cmake(0, 0); float arg_phase0 = cargf(*phase); float arg_phase_inc = cargf(phase_inc); float phase_est; lv_32fc_t ___phase4 = phase_inc * phase_inc * phase_inc * phase_inc; - __VOLK_ATTR_ALIGNED(16) float32_t __phase4_real[4] = { lv_creal(___phase4), lv_creal(___phase4), lv_creal(___phase4), lv_creal(___phase4) }; - __VOLK_ATTR_ALIGNED(16) float32_t __phase4_imag[4] = { lv_cimag(___phase4), lv_cimag(___phase4), lv_cimag(___phase4), lv_cimag(___phase4) }; + __VOLK_ATTR_ALIGNED(16) + float32_t __phase4_real[4] = {lv_creal(___phase4), lv_creal(___phase4), lv_creal(___phase4), lv_creal(___phase4)}; + __VOLK_ATTR_ALIGNED(16) + float32_t __phase4_imag[4] = {lv_cimag(___phase4), lv_cimag(___phase4), lv_cimag(___phase4), lv_cimag(___phase4)}; float32x4_t _phase4_real = vld1q_f32(__phase4_real); float32x4_t _phase4_imag = vld1q_f32(__phase4_imag); @@ -1322,14 +1337,17 @@ static inline void volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_neon(lv_16sc_t* lv_32fc_t phase3 = phase2 * phase_inc; lv_32fc_t phase4 = phase3 * phase_inc; - __VOLK_ATTR_ALIGNED(16) float32_t __phase_real[4] = { lv_creal((*phase)), lv_creal(phase2), lv_creal(phase3), lv_creal(phase4) }; - __VOLK_ATTR_ALIGNED(16) float32_t __phase_imag[4] = { lv_cimag((*phase)), lv_cimag(phase2), lv_cimag(phase3), lv_cimag(phase4) }; + __VOLK_ATTR_ALIGNED(16) + float32_t __phase_real[4] = {lv_creal((*phase)), lv_creal(phase2), lv_creal(phase3), lv_creal(phase4)}; + __VOLK_ATTR_ALIGNED(16) + float32_t __phase_imag[4] = {lv_cimag((*phase)), lv_cimag(phase2), lv_cimag(phase3), lv_cimag(phase4)}; float32x4_t _phase_real = vld1q_f32(__phase_real); float32x4_t _phase_imag = vld1q_f32(__phase_imag); int16x4x2_t a_val, b_val, c_val; - __VOLK_ATTR_ALIGNED(16) lv_16sc_t dotProductVector[4]; + __VOLK_ATTR_ALIGNED(16) + lv_16sc_t dotProductVector[4]; float32x4_t half = vdupq_n_f32(0.5f); int16x4x2_t tmp16; int32x4x2_t tmp32i; @@ -1339,13 +1357,13 @@ static inline void volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_neon(lv_16sc_t* int16x4x2_t* accumulator = (int16x4x2_t*)volk_gnsssdr_malloc(num_a_vectors * sizeof(int16x4x2_t), volk_gnsssdr_get_alignment()); - for(n_vec = 0; n_vec < num_a_vectors; n_vec++) + for (n_vec = 0; n_vec < num_a_vectors; n_vec++) { accumulator[n_vec].val[0] = vdup_n_s16(0); accumulator[n_vec].val[1] = vdup_n_s16(0); } - for(number = 0; number < neon_iters; number++) + for (number = 0; number < neon_iters; number++) { /* load 4 complex numbers (int 16 bits each component) */ tmp16 = vld2_s16((int16_t*)_in_common); @@ -1396,7 +1414,7 @@ static inline void volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_neon(lv_16sc_t* for (n_vec = 0; n_vec < num_a_vectors; n_vec++) { - a_val = vld2_s16((int16_t*)&(_in_a[n_vec][number*4])); //load (2 byte imag, 2 byte real) x 4 into 128 bits reg + a_val = vld2_s16((int16_t*)&(_in_a[n_vec][number * 4])); //load (2 byte imag, 2 byte real) x 4 into 128 bits reg //__VOLK_GNSSSDR_PREFETCH(&_in_a[n_vec][number*4] + 8); // multiply the real*real and imag*imag to get real result @@ -1426,8 +1444,10 @@ static inline void volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_neon(lv_16sc_t* phase3 = phase2 * phase_inc; phase4 = phase3 * phase_inc; - __VOLK_ATTR_ALIGNED(16) float32_t ____phase_real[4] = { lv_creal((*phase)), lv_creal(phase2), lv_creal(phase3), lv_creal(phase4) }; - __VOLK_ATTR_ALIGNED(16) float32_t ____phase_imag[4] = { lv_cimag((*phase)), lv_cimag(phase2), lv_cimag(phase3), lv_cimag(phase4) }; + __VOLK_ATTR_ALIGNED(16) + float32_t ____phase_real[4] = {lv_creal((*phase)), lv_creal(phase2), lv_creal(phase3), lv_creal(phase4)}; + __VOLK_ATTR_ALIGNED(16) + float32_t ____phase_imag[4] = {lv_cimag((*phase)), lv_cimag(phase2), lv_cimag(phase3), lv_cimag(phase4)}; _phase_real = vld1q_f32(____phase_real); _phase_imag = vld1q_f32(____phase_imag); @@ -1436,12 +1456,12 @@ static inline void volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_neon(lv_16sc_t* for (n_vec = 0; n_vec < num_a_vectors; n_vec++) { - vst2_s16((int16_t*)dotProductVector, accumulator[n_vec]); // Store the results back into the dot product vector - dotProduct = lv_cmake(0,0); + vst2_s16((int16_t*)dotProductVector, accumulator[n_vec]); // Store the results back into the dot product vector + dotProduct = lv_cmake(0, 0); for (i = 0; i < 4; ++i) { dotProduct = lv_cmake(sat_adds16i(lv_creal(dotProduct), lv_creal(dotProductVector[i])), - sat_adds16i(lv_cimag(dotProduct), lv_cimag(dotProductVector[i]))); + sat_adds16i(lv_cimag(dotProduct), lv_cimag(dotProductVector[i]))); } _out[n_vec] = dotProduct; } @@ -1473,7 +1493,7 @@ static inline void volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_neon(lv_16sc_t* #include #include -static inline void volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_neon_vma(lv_16sc_t* result, const lv_16sc_t* in_common, const lv_32fc_t phase_inc, lv_32fc_t* phase, const lv_16sc_t** in_a, int num_a_vectors, unsigned int num_points) +static inline void volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_neon_vma(lv_16sc_t* result, const lv_16sc_t* in_common, const lv_32fc_t phase_inc, lv_32fc_t* phase, const lv_16sc_t** in_a, int num_a_vectors, unsigned int num_points) { const unsigned int neon_iters = num_points / 4; @@ -1489,14 +1509,16 @@ static inline void volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_neon_vma(lv_16s if (neon_iters > 0) { - lv_16sc_t dotProduct = lv_cmake(0,0); + lv_16sc_t dotProduct = lv_cmake(0, 0); float arg_phase0 = cargf(*phase); float arg_phase_inc = cargf(phase_inc); float phase_est; //printf("arg phase0: %f", arg_phase0); lv_32fc_t ___phase4 = phase_inc * phase_inc * phase_inc * phase_inc; - __VOLK_ATTR_ALIGNED(16) float32_t __phase4_real[4] = { lv_creal(___phase4), lv_creal(___phase4), lv_creal(___phase4), lv_creal(___phase4) }; - __VOLK_ATTR_ALIGNED(16) float32_t __phase4_imag[4] = { lv_cimag(___phase4), lv_cimag(___phase4), lv_cimag(___phase4), lv_cimag(___phase4) }; + __VOLK_ATTR_ALIGNED(16) + float32_t __phase4_real[4] = {lv_creal(___phase4), lv_creal(___phase4), lv_creal(___phase4), lv_creal(___phase4)}; + __VOLK_ATTR_ALIGNED(16) + float32_t __phase4_imag[4] = {lv_cimag(___phase4), lv_cimag(___phase4), lv_cimag(___phase4), lv_cimag(___phase4)}; float32x4_t _phase4_real = vld1q_f32(__phase4_real); float32x4_t _phase4_imag = vld1q_f32(__phase4_imag); @@ -1505,14 +1527,17 @@ static inline void volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_neon_vma(lv_16s lv_32fc_t phase3 = phase2 * phase_inc; lv_32fc_t phase4 = phase3 * phase_inc; - __VOLK_ATTR_ALIGNED(16) float32_t __phase_real[4] = { lv_creal((*phase)), lv_creal(phase2), lv_creal(phase3), lv_creal(phase4) }; - __VOLK_ATTR_ALIGNED(16) float32_t __phase_imag[4] = { lv_cimag((*phase)), lv_cimag(phase2), lv_cimag(phase3), lv_cimag(phase4) }; + __VOLK_ATTR_ALIGNED(16) + float32_t __phase_real[4] = {lv_creal((*phase)), lv_creal(phase2), lv_creal(phase3), lv_creal(phase4)}; + __VOLK_ATTR_ALIGNED(16) + float32_t __phase_imag[4] = {lv_cimag((*phase)), lv_cimag(phase2), lv_cimag(phase3), lv_cimag(phase4)}; float32x4_t _phase_real = vld1q_f32(__phase_real); float32x4_t _phase_imag = vld1q_f32(__phase_imag); int16x4x2_t a_val, b_val; - __VOLK_ATTR_ALIGNED(16) lv_16sc_t dotProductVector[4]; + __VOLK_ATTR_ALIGNED(16) + lv_16sc_t dotProductVector[4]; float32x4_t half = vdupq_n_f32(0.5f); int16x4x2_t tmp16; int32x4x2_t tmp32i; @@ -1522,13 +1547,13 @@ static inline void volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_neon_vma(lv_16s int16x4x2_t* accumulator = (int16x4x2_t*)volk_gnsssdr_malloc(num_a_vectors * sizeof(int16x4x2_t), volk_gnsssdr_get_alignment()); - for(n_vec = 0; n_vec < num_a_vectors; n_vec++) + for (n_vec = 0; n_vec < num_a_vectors; n_vec++) { accumulator[n_vec].val[0] = vdup_n_s16(0); accumulator[n_vec].val[1] = vdup_n_s16(0); } - for(number = 0; number < neon_iters; number++) + for (number = 0; number < neon_iters; number++) { /* load 4 complex numbers (int 16 bits each component) */ tmp16 = vld2_s16((int16_t*)_in_common); @@ -1589,8 +1614,10 @@ static inline void volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_neon_vma(lv_16s phase3 = phase2 * phase_inc; phase4 = phase3 * phase_inc; - __VOLK_ATTR_ALIGNED(16) float32_t ____phase_real[4] = { lv_creal((*phase)), lv_creal(phase2), lv_creal(phase3), lv_creal(phase4) }; - __VOLK_ATTR_ALIGNED(16) float32_t ____phase_imag[4] = { lv_cimag((*phase)), lv_cimag(phase2), lv_cimag(phase3), lv_cimag(phase4) }; + __VOLK_ATTR_ALIGNED(16) + float32_t ____phase_real[4] = {lv_creal((*phase)), lv_creal(phase2), lv_creal(phase3), lv_creal(phase4)}; + __VOLK_ATTR_ALIGNED(16) + float32_t ____phase_imag[4] = {lv_cimag((*phase)), lv_cimag(phase2), lv_cimag(phase3), lv_cimag(phase4)}; _phase_real = vld1q_f32(____phase_real); _phase_imag = vld1q_f32(____phase_imag); @@ -1598,19 +1625,18 @@ static inline void volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_neon_vma(lv_16s // Round = vmulq_f32(_phase_real, _phase_real); // Round = vmlaq_f32(Round, _phase_imag, _phase_imag); // Round = vsqrtq_f32(Round);//printf("sqrt: %f \n", Round[0]); - //Round = vrsqrteq_f32(Round);printf("1/sqtr: %f \n",Round[0]); + //Round = vrsqrteq_f32(Round);printf("1/sqtr: %f \n",Round[0]); //Round = vrecpeq_f32((Round); // _phase_real = vdivq_f32(_phase_real, Round); // _phase_imag = vdivq_f32(_phase_imag, Round); //_phase_real = vmulq_f32(_phase_real, Round); //_phase_imag = vmulq_f32(_phase_imag, Round); //printf("After %i: %f,%f, %f\n\n", number, _phase_real[0], _phase_imag[0], sqrt(_phase_real[0]*_phase_real[0]+_phase_imag[0]*_phase_imag[0])); - } for (n_vec = 0; n_vec < num_a_vectors; n_vec++) { - a_val = vld2_s16((int16_t*)&(_in_a[n_vec][number*4])); + a_val = vld2_s16((int16_t*)&(_in_a[n_vec][number * 4])); b_val.val[0] = vmul_s16(a_val.val[0], tmp16.val[0]); b_val.val[1] = vmul_s16(a_val.val[1], tmp16.val[0]); @@ -1626,12 +1652,12 @@ static inline void volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_neon_vma(lv_16s for (n_vec = 0; n_vec < num_a_vectors; n_vec++) { - vst2_s16((int16_t*)dotProductVector, accumulator[n_vec]); // Store the results back into the dot product vector - dotProduct = lv_cmake(0,0); + vst2_s16((int16_t*)dotProductVector, accumulator[n_vec]); // Store the results back into the dot product vector + dotProduct = lv_cmake(0, 0); for (i = 0; i < 4; ++i) { dotProduct = lv_cmake(sat_adds16i(lv_creal(dotProduct), lv_creal(dotProductVector[i])), - sat_adds16i(lv_cimag(dotProduct), lv_cimag(dotProductVector[i]))); + sat_adds16i(lv_cimag(dotProduct), lv_cimag(dotProductVector[i]))); } _out[n_vec] = dotProduct; } @@ -1664,7 +1690,7 @@ static inline void volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_neon_vma(lv_16s #include #include -static inline void volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_neon_optvma(lv_16sc_t* result, const lv_16sc_t* in_common, const lv_32fc_t phase_inc, lv_32fc_t* phase, const lv_16sc_t** in_a, int num_a_vectors, unsigned int num_points) +static inline void volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_neon_optvma(lv_16sc_t* result, const lv_16sc_t* in_common, const lv_32fc_t phase_inc, lv_32fc_t* phase, const lv_16sc_t** in_a, int num_a_vectors, unsigned int num_points) { const unsigned int neon_iters = num_points / 4; @@ -1680,14 +1706,16 @@ static inline void volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_neon_optvma(lv_ if (neon_iters > 0) { - lv_16sc_t dotProduct = lv_cmake(0,0); + lv_16sc_t dotProduct = lv_cmake(0, 0); float arg_phase0 = cargf(*phase); float arg_phase_inc = cargf(phase_inc); float phase_est; lv_32fc_t ___phase4 = phase_inc * phase_inc * phase_inc * phase_inc; - __VOLK_ATTR_ALIGNED(16) float32_t __phase4_real[4] = { lv_creal(___phase4), lv_creal(___phase4), lv_creal(___phase4), lv_creal(___phase4) }; - __VOLK_ATTR_ALIGNED(16) float32_t __phase4_imag[4] = { lv_cimag(___phase4), lv_cimag(___phase4), lv_cimag(___phase4), lv_cimag(___phase4) }; + __VOLK_ATTR_ALIGNED(16) + float32_t __phase4_real[4] = {lv_creal(___phase4), lv_creal(___phase4), lv_creal(___phase4), lv_creal(___phase4)}; + __VOLK_ATTR_ALIGNED(16) + float32_t __phase4_imag[4] = {lv_cimag(___phase4), lv_cimag(___phase4), lv_cimag(___phase4), lv_cimag(___phase4)}; float32x4_t _phase4_real = vld1q_f32(__phase4_real); float32x4_t _phase4_imag = vld1q_f32(__phase4_imag); @@ -1696,14 +1724,17 @@ static inline void volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_neon_optvma(lv_ lv_32fc_t phase3 = phase2 * phase_inc; lv_32fc_t phase4 = phase3 * phase_inc; - __VOLK_ATTR_ALIGNED(16) float32_t __phase_real[4] = { lv_creal((*phase)), lv_creal(phase2), lv_creal(phase3), lv_creal(phase4) }; - __VOLK_ATTR_ALIGNED(16) float32_t __phase_imag[4] = { lv_cimag((*phase)), lv_cimag(phase2), lv_cimag(phase3), lv_cimag(phase4) }; + __VOLK_ATTR_ALIGNED(16) + float32_t __phase_real[4] = {lv_creal((*phase)), lv_creal(phase2), lv_creal(phase3), lv_creal(phase4)}; + __VOLK_ATTR_ALIGNED(16) + float32_t __phase_imag[4] = {lv_cimag((*phase)), lv_cimag(phase2), lv_cimag(phase3), lv_cimag(phase4)}; float32x4_t _phase_real = vld1q_f32(__phase_real); float32x4_t _phase_imag = vld1q_f32(__phase_imag); int16x4x2_t a_val, b_val; - __VOLK_ATTR_ALIGNED(16) lv_16sc_t dotProductVector[4]; + __VOLK_ATTR_ALIGNED(16) + lv_16sc_t dotProductVector[4]; float32x4_t half = vdupq_n_f32(0.5f); int32x4x2_t tmp32i; @@ -1713,7 +1744,7 @@ static inline void volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_neon_optvma(lv_ int16x4x2_t* accumulator1 = (int16x4x2_t*)volk_gnsssdr_malloc(num_a_vectors * sizeof(int16x4x2_t), volk_gnsssdr_get_alignment()); int16x4x2_t* accumulator2 = (int16x4x2_t*)volk_gnsssdr_malloc(num_a_vectors * sizeof(int16x4x2_t), volk_gnsssdr_get_alignment()); - for(n_vec = 0; n_vec < num_a_vectors; n_vec++) + for (n_vec = 0; n_vec < num_a_vectors; n_vec++) { accumulator1[n_vec].val[0] = vdup_n_s16(0); accumulator1[n_vec].val[1] = vdup_n_s16(0); @@ -1721,7 +1752,7 @@ static inline void volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_neon_optvma(lv_ accumulator2[n_vec].val[1] = vdup_n_s16(0); } - for(number = 0; number < neon_iters; number++) + for (number = 0; number < neon_iters; number++) { /* load 4 complex numbers (int 16 bits each component) */ b_val = vld2_s16((int16_t*)_in_common); @@ -1782,8 +1813,10 @@ static inline void volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_neon_optvma(lv_ phase3 = phase2 * phase_inc; phase4 = phase3 * phase_inc; - __VOLK_ATTR_ALIGNED(16) float32_t ____phase_real[4] = { lv_creal((*phase)), lv_creal(phase2), lv_creal(phase3), lv_creal(phase4) }; - __VOLK_ATTR_ALIGNED(16) float32_t ____phase_imag[4] = { lv_cimag((*phase)), lv_cimag(phase2), lv_cimag(phase3), lv_cimag(phase4) }; + __VOLK_ATTR_ALIGNED(16) + float32_t ____phase_real[4] = {lv_creal((*phase)), lv_creal(phase2), lv_creal(phase3), lv_creal(phase4)}; + __VOLK_ATTR_ALIGNED(16) + float32_t ____phase_imag[4] = {lv_cimag((*phase)), lv_cimag(phase2), lv_cimag(phase3), lv_cimag(phase4)}; _phase_real = vld1q_f32(____phase_real); _phase_imag = vld1q_f32(____phase_imag); @@ -1791,7 +1824,7 @@ static inline void volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_neon_optvma(lv_ for (n_vec = 0; n_vec < num_a_vectors; n_vec++) { - a_val = vld2_s16((int16_t*)&(_in_a[n_vec][number*4])); + a_val = vld2_s16((int16_t*)&(_in_a[n_vec][number * 4])); // use 2 accumulators to remove inter-instruction data dependencies accumulator1[n_vec].val[0] = vmla_s16(accumulator1[n_vec].val[0], a_val.val[0], b_val.val[0]); @@ -1807,12 +1840,12 @@ static inline void volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_neon_optvma(lv_ } for (n_vec = 0; n_vec < num_a_vectors; n_vec++) { - vst2_s16((int16_t*)dotProductVector, accumulator1[n_vec]); // Store the results back into the dot product vector - dotProduct = lv_cmake(0,0); + vst2_s16((int16_t*)dotProductVector, accumulator1[n_vec]); // Store the results back into the dot product vector + dotProduct = lv_cmake(0, 0); for (i = 0; i < 4; ++i) { dotProduct = lv_cmake(sat_adds16i(lv_creal(dotProduct), lv_creal(dotProductVector[i])), - sat_adds16i(lv_cimag(dotProduct), lv_cimag(dotProductVector[i]))); + sat_adds16i(lv_cimag(dotProduct), lv_cimag(dotProductVector[i]))); } _out[n_vec] = dotProduct; } @@ -1842,4 +1875,3 @@ static inline void volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_neon_optvma(lv_ #endif /* LV_HAVE_NEON */ #endif /*INCLUDED_volk_gnsssdr_16ic_x2_dot_prod_16ic_xn_H*/ - diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_x2_rotator_dotprodxnpuppet_16ic.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_x2_rotator_dotprodxnpuppet_16ic.h index cf002bf6c..9b30bdbbd 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_x2_rotator_dotprodxnpuppet_16ic.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_x2_rotator_dotprodxnpuppet_16ic.h @@ -41,7 +41,7 @@ #include #ifdef LV_HAVE_GENERIC -static inline void volk_gnsssdr_16ic_x2_rotator_dotprodxnpuppet_16ic_generic(lv_16sc_t* result, const lv_16sc_t* local_code, const lv_16sc_t* in, unsigned int num_points) +static inline void volk_gnsssdr_16ic_x2_rotator_dotprodxnpuppet_16ic_generic(lv_16sc_t* result, const lv_16sc_t* local_code, const lv_16sc_t* in, unsigned int num_points) { // phases must be normalized. Phase rotator expects a complex exponential input! float rem_carrier_phase_in_rad = 0.345; @@ -53,14 +53,14 @@ static inline void volk_gnsssdr_16ic_x2_rotator_dotprodxnpuppet_16ic_generic(lv_ unsigned int n; int num_a_vectors = 3; lv_16sc_t** in_a = (lv_16sc_t**)volk_gnsssdr_malloc(sizeof(lv_16sc_t*) * num_a_vectors, volk_gnsssdr_get_alignment()); - for(n = 0; n < num_a_vectors; n++) + for (n = 0; n < num_a_vectors; n++) { in_a[n] = (lv_16sc_t*)volk_gnsssdr_malloc(sizeof(lv_16sc_t) * num_points, volk_gnsssdr_get_alignment()); memcpy((lv_16sc_t*)in_a[n], (lv_16sc_t*)in, sizeof(lv_16sc_t) * num_points); } - volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_generic(result, local_code, phase_inc[0], phase,(const lv_16sc_t**) in_a, num_a_vectors, num_points); + volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_generic(result, local_code, phase_inc[0], phase, (const lv_16sc_t**)in_a, num_a_vectors, num_points); - for(n = 0; n < num_a_vectors; n++) + for (n = 0; n < num_a_vectors; n++) { volk_gnsssdr_free(in_a[n]); } @@ -71,7 +71,7 @@ static inline void volk_gnsssdr_16ic_x2_rotator_dotprodxnpuppet_16ic_generic(lv_ #ifdef LV_HAVE_GENERIC -static inline void volk_gnsssdr_16ic_x2_rotator_dotprodxnpuppet_16ic_generic_reload(lv_16sc_t* result, const lv_16sc_t* local_code, const lv_16sc_t* in, unsigned int num_points) +static inline void volk_gnsssdr_16ic_x2_rotator_dotprodxnpuppet_16ic_generic_reload(lv_16sc_t* result, const lv_16sc_t* local_code, const lv_16sc_t* in, unsigned int num_points) { // phases must be normalized. Phase rotator expects a complex exponential input! float rem_carrier_phase_in_rad = 0.345; @@ -83,14 +83,14 @@ static inline void volk_gnsssdr_16ic_x2_rotator_dotprodxnpuppet_16ic_generic_rel unsigned int n; int num_a_vectors = 3; lv_16sc_t** in_a = (lv_16sc_t**)volk_gnsssdr_malloc(sizeof(lv_16sc_t*) * num_a_vectors, volk_gnsssdr_get_alignment()); - for(n = 0; n < num_a_vectors; n++) + for (n = 0; n < num_a_vectors; n++) { in_a[n] = (lv_16sc_t*)volk_gnsssdr_malloc(sizeof(lv_16sc_t) * num_points, volk_gnsssdr_get_alignment()); memcpy((lv_16sc_t*)in_a[n], (lv_16sc_t*)in, sizeof(lv_16sc_t) * num_points); } - volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_generic_reload(result, local_code, phase_inc[0], phase,(const lv_16sc_t**) in_a, num_a_vectors, num_points); + volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_generic_reload(result, local_code, phase_inc[0], phase, (const lv_16sc_t**)in_a, num_a_vectors, num_points); - for(n = 0; n < num_a_vectors; n++) + for (n = 0; n < num_a_vectors; n++) { volk_gnsssdr_free(in_a[n]); } @@ -113,22 +113,22 @@ static inline void volk_gnsssdr_16ic_x2_rotator_dotprodxnpuppet_16ic_a_sse3(lv_1 unsigned int n; int num_a_vectors = 3; lv_16sc_t** in_a = (lv_16sc_t**)volk_gnsssdr_malloc(sizeof(lv_16sc_t*) * num_a_vectors, volk_gnsssdr_get_alignment()); - for(n = 0; n < num_a_vectors; n++) + for (n = 0; n < num_a_vectors; n++) { in_a[n] = (lv_16sc_t*)volk_gnsssdr_malloc(sizeof(lv_16sc_t) * num_points, volk_gnsssdr_get_alignment()); memcpy((lv_16sc_t*)in_a[n], (lv_16sc_t*)in, sizeof(lv_16sc_t) * num_points); } - volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_a_sse3(result, local_code, phase_inc[0], phase, (const lv_16sc_t**) in_a, num_a_vectors, num_points); + volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_a_sse3(result, local_code, phase_inc[0], phase, (const lv_16sc_t**)in_a, num_a_vectors, num_points); - for(n = 0; n < num_a_vectors; n++) + for (n = 0; n < num_a_vectors; n++) { volk_gnsssdr_free(in_a[n]); } volk_gnsssdr_free(in_a); } -#endif // SSE3 +#endif // SSE3 #ifdef LV_HAVE_SSE3 @@ -144,22 +144,22 @@ static inline void volk_gnsssdr_16ic_x2_rotator_dotprodxnpuppet_16ic_a_sse3_relo unsigned int n; int num_a_vectors = 3; lv_16sc_t** in_a = (lv_16sc_t**)volk_gnsssdr_malloc(sizeof(lv_16sc_t*) * num_a_vectors, volk_gnsssdr_get_alignment()); - for(n = 0; n < num_a_vectors; n++) + for (n = 0; n < num_a_vectors; n++) { in_a[n] = (lv_16sc_t*)volk_gnsssdr_malloc(sizeof(lv_16sc_t) * num_points, volk_gnsssdr_get_alignment()); memcpy((lv_16sc_t*)in_a[n], (lv_16sc_t*)in, sizeof(lv_16sc_t) * num_points); } - volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_a_sse3_reload(result, local_code, phase_inc[0], phase, (const lv_16sc_t**) in_a, num_a_vectors, num_points); + volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_a_sse3_reload(result, local_code, phase_inc[0], phase, (const lv_16sc_t**)in_a, num_a_vectors, num_points); - for(n = 0; n < num_a_vectors; n++) + for (n = 0; n < num_a_vectors; n++) { volk_gnsssdr_free(in_a[n]); } volk_gnsssdr_free(in_a); } -#endif // SSE3 +#endif // SSE3 #ifdef LV_HAVE_SSE3 @@ -175,22 +175,22 @@ static inline void volk_gnsssdr_16ic_x2_rotator_dotprodxnpuppet_16ic_u_sse3(lv_1 unsigned int n; int num_a_vectors = 3; lv_16sc_t** in_a = (lv_16sc_t**)volk_gnsssdr_malloc(sizeof(lv_16sc_t*) * num_a_vectors, volk_gnsssdr_get_alignment()); - for(n = 0; n < num_a_vectors; n++) + for (n = 0; n < num_a_vectors; n++) { in_a[n] = (lv_16sc_t*)volk_gnsssdr_malloc(sizeof(lv_16sc_t) * num_points, volk_gnsssdr_get_alignment()); memcpy((lv_16sc_t*)in_a[n], (lv_16sc_t*)in, sizeof(lv_16sc_t) * num_points); } - volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_u_sse3(result, local_code, phase_inc[0], phase, (const lv_16sc_t**) in_a, num_a_vectors, num_points); + volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_u_sse3(result, local_code, phase_inc[0], phase, (const lv_16sc_t**)in_a, num_a_vectors, num_points); - for(n = 0; n < num_a_vectors; n++) + for (n = 0; n < num_a_vectors; n++) { volk_gnsssdr_free(in_a[n]); } volk_gnsssdr_free(in_a); } -#endif // SSE3 +#endif // SSE3 #ifdef LV_HAVE_AVX2 @@ -206,22 +206,22 @@ static inline void volk_gnsssdr_16ic_x2_rotator_dotprodxnpuppet_16ic_a_avx2(lv_1 unsigned int n; int num_a_vectors = 3; lv_16sc_t** in_a = (lv_16sc_t**)volk_gnsssdr_malloc(sizeof(lv_16sc_t*) * num_a_vectors, volk_gnsssdr_get_alignment()); - for(n = 0; n < num_a_vectors; n++) + for (n = 0; n < num_a_vectors; n++) { in_a[n] = (lv_16sc_t*)volk_gnsssdr_malloc(sizeof(lv_16sc_t) * num_points, volk_gnsssdr_get_alignment()); memcpy((lv_16sc_t*)in_a[n], (lv_16sc_t*)in, sizeof(lv_16sc_t) * num_points); } - volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_a_avx2(result, local_code, phase_inc[0], phase, (const lv_16sc_t**) in_a, num_a_vectors, num_points); + volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_a_avx2(result, local_code, phase_inc[0], phase, (const lv_16sc_t**)in_a, num_a_vectors, num_points); - for(n = 0; n < num_a_vectors; n++) + for (n = 0; n < num_a_vectors; n++) { volk_gnsssdr_free(in_a[n]); } volk_gnsssdr_free(in_a); } -#endif // AVX2 +#endif // AVX2 #ifdef LV_HAVE_AVX2 @@ -237,22 +237,22 @@ static inline void volk_gnsssdr_16ic_x2_rotator_dotprodxnpuppet_16ic_a_avx2_relo unsigned int n; int num_a_vectors = 3; lv_16sc_t** in_a = (lv_16sc_t**)volk_gnsssdr_malloc(sizeof(lv_16sc_t*) * num_a_vectors, volk_gnsssdr_get_alignment()); - for(n = 0; n < num_a_vectors; n++) + for (n = 0; n < num_a_vectors; n++) { in_a[n] = (lv_16sc_t*)volk_gnsssdr_malloc(sizeof(lv_16sc_t) * num_points, volk_gnsssdr_get_alignment()); memcpy((lv_16sc_t*)in_a[n], (lv_16sc_t*)in, sizeof(lv_16sc_t) * num_points); } - volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_a_avx2_reload(result, local_code, phase_inc[0], phase, (const lv_16sc_t**) in_a, num_a_vectors, num_points); + volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_a_avx2_reload(result, local_code, phase_inc[0], phase, (const lv_16sc_t**)in_a, num_a_vectors, num_points); - for(n = 0; n < num_a_vectors; n++) + for (n = 0; n < num_a_vectors; n++) { volk_gnsssdr_free(in_a[n]); } volk_gnsssdr_free(in_a); } -#endif // AVX2 +#endif // AVX2 #ifdef LV_HAVE_AVX2 @@ -268,22 +268,22 @@ static inline void volk_gnsssdr_16ic_x2_rotator_dotprodxnpuppet_16ic_u_avx2(lv_1 unsigned int n; int num_a_vectors = 3; lv_16sc_t** in_a = (lv_16sc_t**)volk_gnsssdr_malloc(sizeof(lv_16sc_t*) * num_a_vectors, volk_gnsssdr_get_alignment()); - for(n = 0; n < num_a_vectors; n++) + for (n = 0; n < num_a_vectors; n++) { in_a[n] = (lv_16sc_t*)volk_gnsssdr_malloc(sizeof(lv_16sc_t) * num_points, volk_gnsssdr_get_alignment()); memcpy((lv_16sc_t*)in_a[n], (lv_16sc_t*)in, sizeof(lv_16sc_t) * num_points); } - volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_a_avx2(result, local_code, phase_inc[0], phase, (const lv_16sc_t**) in_a, num_a_vectors, num_points); + volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_a_avx2(result, local_code, phase_inc[0], phase, (const lv_16sc_t**)in_a, num_a_vectors, num_points); - for(n = 0; n < num_a_vectors; n++) + for (n = 0; n < num_a_vectors; n++) { volk_gnsssdr_free(in_a[n]); } volk_gnsssdr_free(in_a); } -#endif // AVX2 +#endif // AVX2 #ifdef LV_HAVE_AVX2 @@ -299,22 +299,22 @@ static inline void volk_gnsssdr_16ic_x2_rotator_dotprodxnpuppet_16ic_u_avx2_relo unsigned int n; int num_a_vectors = 3; lv_16sc_t** in_a = (lv_16sc_t**)volk_gnsssdr_malloc(sizeof(lv_16sc_t*) * num_a_vectors, volk_gnsssdr_get_alignment()); - for(n = 0; n < num_a_vectors; n++) + for (n = 0; n < num_a_vectors; n++) { in_a[n] = (lv_16sc_t*)volk_gnsssdr_malloc(sizeof(lv_16sc_t) * num_points, volk_gnsssdr_get_alignment()); memcpy((lv_16sc_t*)in_a[n], (lv_16sc_t*)in, sizeof(lv_16sc_t) * num_points); } - volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_a_avx2_reload(result, local_code, phase_inc[0], phase, (const lv_16sc_t**) in_a, num_a_vectors, num_points); + volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_a_avx2_reload(result, local_code, phase_inc[0], phase, (const lv_16sc_t**)in_a, num_a_vectors, num_points); - for(n = 0; n < num_a_vectors; n++) + for (n = 0; n < num_a_vectors; n++) { volk_gnsssdr_free(in_a[n]); } volk_gnsssdr_free(in_a); } -#endif // AVX2 +#endif // AVX2 #ifdef LV_HAVE_NEON @@ -330,22 +330,22 @@ static inline void volk_gnsssdr_16ic_x2_rotator_dotprodxnpuppet_16ic_neon(lv_16s unsigned int n; int num_a_vectors = 3; lv_16sc_t** in_a = (lv_16sc_t**)volk_gnsssdr_malloc(sizeof(lv_16sc_t*) * num_a_vectors, volk_gnsssdr_get_alignment()); - for(n = 0; n < num_a_vectors; n++) + for (n = 0; n < num_a_vectors; n++) { in_a[n] = (lv_16sc_t*)volk_gnsssdr_malloc(sizeof(lv_16sc_t) * num_points, volk_gnsssdr_get_alignment()); memcpy((lv_16sc_t*)in_a[n], (lv_16sc_t*)in, sizeof(lv_16sc_t) * num_points); } - volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_neon(result, local_code, phase_inc[0], phase, (const lv_16sc_t**) in_a, num_a_vectors, num_points); + volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_neon(result, local_code, phase_inc[0], phase, (const lv_16sc_t**)in_a, num_a_vectors, num_points); - for(n = 0; n < num_a_vectors; n++) + for (n = 0; n < num_a_vectors; n++) { volk_gnsssdr_free(in_a[n]); } volk_gnsssdr_free(in_a); } -#endif // NEON +#endif // NEON #ifdef LV_HAVE_NEON @@ -361,23 +361,21 @@ static inline void volk_gnsssdr_16ic_x2_rotator_dotprodxnpuppet_16ic_neon_vma(lv unsigned int n; int num_a_vectors = 3; lv_16sc_t** in_a = (lv_16sc_t**)volk_gnsssdr_malloc(sizeof(lv_16sc_t*) * num_a_vectors, volk_gnsssdr_get_alignment()); - for(n = 0; n < num_a_vectors; n++) + for (n = 0; n < num_a_vectors; n++) { in_a[n] = (lv_16sc_t*)volk_gnsssdr_malloc(sizeof(lv_16sc_t) * num_points, volk_gnsssdr_get_alignment()); memcpy((lv_16sc_t*)in_a[n], (lv_16sc_t*)in, sizeof(lv_16sc_t) * num_points); } - volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_neon_vma(result, local_code, phase_inc[0], phase, (const lv_16sc_t**) in_a, num_a_vectors, num_points); + volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_neon_vma(result, local_code, phase_inc[0], phase, (const lv_16sc_t**)in_a, num_a_vectors, num_points); - for(n = 0; n < num_a_vectors; n++) + for (n = 0; n < num_a_vectors; n++) { volk_gnsssdr_free(in_a[n]); } volk_gnsssdr_free(in_a); } -#endif // NEON +#endif // NEON #endif // INCLUDED_volk_gnsssdr_16ic_x2_rotator_dotprodxnpuppet_16ic_H - - diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_xn_resampler_16ic_xn.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_xn_resampler_16ic_xn.h index 843fa8ed2..661f4ace9 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_xn_resampler_16ic_xn.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_xn_resampler_16ic_xn.h @@ -106,7 +106,8 @@ static inline void volk_gnsssdr_16ic_xn_resampler_16ic_xn_a_sse4_1(lv_16sc_t** r const __m128 rem_code_phase_chips_reg = _mm_set_ps1(rem_code_phase_chips); const __m128 code_phase_step_chips_reg = _mm_set_ps1(code_phase_step_chips); - __VOLK_ATTR_ALIGNED(16) int local_code_chip_index[4]; + __VOLK_ATTR_ALIGNED(16) + int local_code_chip_index[4]; int local_code_chip_index_; const __m128i zeros = _mm_setzero_si128(); @@ -120,7 +121,7 @@ static inline void volk_gnsssdr_16ic_xn_resampler_16ic_xn_a_sse4_1(lv_16sc_t** r shifts_chips_reg = _mm_set_ps1((float)shifts_chips[current_correlator_tap]); aux2 = _mm_sub_ps(shifts_chips_reg, rem_code_phase_chips_reg); __m128 indexn = _mm_set_ps(3.0f, 2.0f, 1.0f, 0.0f); - for(n = 0; n < quarterPoints; n++) + for (n = 0; n < quarterPoints; n++) { aux = _mm_mul_ps(code_phase_step_chips_reg, indexn); aux = _mm_add_ps(aux, aux2); @@ -138,13 +139,13 @@ static inline void volk_gnsssdr_16ic_xn_resampler_16ic_xn_a_sse4_1(lv_16sc_t** r aux_i = _mm_and_si128(code_length_chips_reg_i, negatives); local_code_chip_index_reg = _mm_add_epi32(local_code_chip_index_reg, aux_i); _mm_store_si128((__m128i*)local_code_chip_index, local_code_chip_index_reg); - for(k = 0; k < 4; ++k) + for (k = 0; k < 4; ++k) { _result[current_correlator_tap][n * 4 + k] = local_code[local_code_chip_index[k]]; } indexn = _mm_add_ps(indexn, fours); } - for(n = quarterPoints * 4; n < num_points; n++) + for (n = quarterPoints * 4; n < num_points; n++) { // resample code for current tap local_code_chip_index_ = (int)floor(code_phase_step_chips * (float)n + shifts_chips[current_correlator_tap] - rem_code_phase_chips); @@ -156,7 +157,7 @@ static inline void volk_gnsssdr_16ic_xn_resampler_16ic_xn_a_sse4_1(lv_16sc_t** r } } -#endif +#endif #ifdef LV_HAVE_SSE4_1 @@ -172,7 +173,8 @@ static inline void volk_gnsssdr_16ic_xn_resampler_16ic_xn_u_sse4_1(lv_16sc_t** r const __m128 rem_code_phase_chips_reg = _mm_set_ps1(rem_code_phase_chips); const __m128 code_phase_step_chips_reg = _mm_set_ps1(code_phase_step_chips); - __VOLK_ATTR_ALIGNED(16) int local_code_chip_index[4]; + __VOLK_ATTR_ALIGNED(16) + int local_code_chip_index[4]; int local_code_chip_index_; const __m128i zeros = _mm_setzero_si128(); @@ -186,7 +188,7 @@ static inline void volk_gnsssdr_16ic_xn_resampler_16ic_xn_u_sse4_1(lv_16sc_t** r shifts_chips_reg = _mm_set_ps1((float)shifts_chips[current_correlator_tap]); aux2 = _mm_sub_ps(shifts_chips_reg, rem_code_phase_chips_reg); __m128 indexn = _mm_set_ps(3.0f, 2.0f, 1.0f, 0.0f); - for(n = 0; n < quarterPoints; n++) + for (n = 0; n < quarterPoints; n++) { aux = _mm_mul_ps(code_phase_step_chips_reg, indexn); aux = _mm_add_ps(aux, aux2); @@ -204,13 +206,13 @@ static inline void volk_gnsssdr_16ic_xn_resampler_16ic_xn_u_sse4_1(lv_16sc_t** r aux_i = _mm_and_si128(code_length_chips_reg_i, negatives); local_code_chip_index_reg = _mm_add_epi32(local_code_chip_index_reg, aux_i); _mm_store_si128((__m128i*)local_code_chip_index, local_code_chip_index_reg); - for(k = 0; k < 4; ++k) + for (k = 0; k < 4; ++k) { _result[current_correlator_tap][n * 4 + k] = local_code[local_code_chip_index[k]]; } indexn = _mm_add_ps(indexn, fours); } - for(n = quarterPoints * 4; n < num_points; n++) + for (n = quarterPoints * 4; n < num_points; n++) { // resample code for current tap local_code_chip_index_ = (int)floor(code_phase_step_chips * (float)n + shifts_chips[current_correlator_tap] - rem_code_phase_chips); @@ -239,7 +241,8 @@ static inline void volk_gnsssdr_16ic_xn_resampler_16ic_xn_a_sse3(lv_16sc_t** res const __m128 rem_code_phase_chips_reg = _mm_set_ps1(rem_code_phase_chips); const __m128 code_phase_step_chips_reg = _mm_set_ps1(code_phase_step_chips); - __VOLK_ATTR_ALIGNED(16) int local_code_chip_index[4]; + __VOLK_ATTR_ALIGNED(16) + int local_code_chip_index[4]; int local_code_chip_index_; const __m128i zeros = _mm_setzero_si128(); @@ -253,7 +256,7 @@ static inline void volk_gnsssdr_16ic_xn_resampler_16ic_xn_a_sse3(lv_16sc_t** res shifts_chips_reg = _mm_set_ps1((float)shifts_chips[current_correlator_tap]); aux2 = _mm_sub_ps(shifts_chips_reg, rem_code_phase_chips_reg); __m128 indexn = _mm_set_ps(3.0f, 2.0f, 1.0f, 0.0f); - for(n = 0; n < quarterPoints; n++) + for (n = 0; n < quarterPoints; n++) { aux = _mm_mul_ps(code_phase_step_chips_reg, indexn); aux = _mm_add_ps(aux, aux2); @@ -274,13 +277,13 @@ static inline void volk_gnsssdr_16ic_xn_resampler_16ic_xn_a_sse3(lv_16sc_t** res aux_i = _mm_and_si128(code_length_chips_reg_i, negatives); local_code_chip_index_reg = _mm_add_epi32(local_code_chip_index_reg, aux_i); _mm_store_si128((__m128i*)local_code_chip_index, local_code_chip_index_reg); - for(k = 0; k < 4; ++k) + for (k = 0; k < 4; ++k) { _result[current_correlator_tap][n * 4 + k] = local_code[local_code_chip_index[k]]; } indexn = _mm_add_ps(indexn, fours); } - for(n = quarterPoints * 4; n < num_points; n++) + for (n = quarterPoints * 4; n < num_points; n++) { // resample code for current tap local_code_chip_index_ = (int)floor(code_phase_step_chips * (float)n + shifts_chips[current_correlator_tap] - rem_code_phase_chips); @@ -309,7 +312,8 @@ static inline void volk_gnsssdr_16ic_xn_resampler_16ic_xn_u_sse3(lv_16sc_t** res const __m128 rem_code_phase_chips_reg = _mm_set_ps1(rem_code_phase_chips); const __m128 code_phase_step_chips_reg = _mm_set_ps1(code_phase_step_chips); - __VOLK_ATTR_ALIGNED(16) int local_code_chip_index[4]; + __VOLK_ATTR_ALIGNED(16) + int local_code_chip_index[4]; int local_code_chip_index_; const __m128i zeros = _mm_setzero_si128(); @@ -323,7 +327,7 @@ static inline void volk_gnsssdr_16ic_xn_resampler_16ic_xn_u_sse3(lv_16sc_t** res shifts_chips_reg = _mm_set_ps1((float)shifts_chips[current_correlator_tap]); aux2 = _mm_sub_ps(shifts_chips_reg, rem_code_phase_chips_reg); __m128 indexn = _mm_set_ps(3.0f, 2.0f, 1.0f, 0.0f); - for(n = 0; n < quarterPoints; n++) + for (n = 0; n < quarterPoints; n++) { aux = _mm_mul_ps(code_phase_step_chips_reg, indexn); aux = _mm_add_ps(aux, aux2); @@ -344,13 +348,13 @@ static inline void volk_gnsssdr_16ic_xn_resampler_16ic_xn_u_sse3(lv_16sc_t** res aux_i = _mm_and_si128(code_length_chips_reg_i, negatives); local_code_chip_index_reg = _mm_add_epi32(local_code_chip_index_reg, aux_i); _mm_store_si128((__m128i*)local_code_chip_index, local_code_chip_index_reg); - for(k = 0; k < 4; ++k) + for (k = 0; k < 4; ++k) { _result[current_correlator_tap][n * 4 + k] = local_code[local_code_chip_index[k]]; } indexn = _mm_add_ps(indexn, fours); } - for(n = quarterPoints * 4; n < num_points; n++) + for (n = quarterPoints * 4; n < num_points; n++) { // resample code for current tap local_code_chip_index_ = (int)floor(code_phase_step_chips * (float)n + shifts_chips[current_correlator_tap] - rem_code_phase_chips); @@ -378,7 +382,8 @@ static inline void volk_gnsssdr_16ic_xn_resampler_16ic_xn_a_avx(lv_16sc_t** resu const __m256 rem_code_phase_chips_reg = _mm256_set1_ps(rem_code_phase_chips); const __m256 code_phase_step_chips_reg = _mm256_set1_ps(code_phase_step_chips); - __VOLK_ATTR_ALIGNED(32) int local_code_chip_index[8]; + __VOLK_ATTR_ALIGNED(32) + int local_code_chip_index[8]; int local_code_chip_index_; const __m256 zeros = _mm256_setzero_ps(); @@ -393,7 +398,7 @@ static inline void volk_gnsssdr_16ic_xn_resampler_16ic_xn_a_avx(lv_16sc_t** resu shifts_chips_reg = _mm256_set1_ps((float)shifts_chips[current_correlator_tap]); aux2 = _mm256_sub_ps(shifts_chips_reg, rem_code_phase_chips_reg); indexn = n0; - for(n = 0; n < avx_iters; n++) + for (n = 0; n < avx_iters; n++) { __VOLK_GNSSSDR_PREFETCH_LOCALITY(&_result[current_correlator_tap][8 * n + 7], 1, 0); __VOLK_GNSSSDR_PREFETCH_LOCALITY(&local_code_chip_index[8], 1, 3); @@ -411,13 +416,13 @@ static inline void volk_gnsssdr_16ic_xn_resampler_16ic_xn_a_avx(lv_16sc_t** resu // no negatives c = _mm256_cvtepi32_ps(local_code_chip_index_reg); - negatives = _mm256_cmp_ps(c, zeros, 0x01 ); + negatives = _mm256_cmp_ps(c, zeros, 0x01); aux3 = _mm256_and_ps(code_length_chips_reg_f, negatives); aux = _mm256_add_ps(c, aux3); local_code_chip_index_reg = _mm256_cvttps_epi32(aux); _mm256_store_si256((__m256i*)local_code_chip_index, local_code_chip_index_reg); - for(k = 0; k < 8; ++k) + for (k = 0; k < 8; ++k) { _result[current_correlator_tap][n * 8 + k] = local_code[local_code_chip_index[k]]; } @@ -427,7 +432,7 @@ static inline void volk_gnsssdr_16ic_xn_resampler_16ic_xn_a_avx(lv_16sc_t** resu _mm256_zeroupper(); for (current_correlator_tap = 0; current_correlator_tap < num_out_vectors; current_correlator_tap++) { - for(n = avx_iters * 8; n < num_points; n++) + for (n = avx_iters * 8; n < num_points; n++) { // resample code for current tap local_code_chip_index_ = (int)floor(code_phase_step_chips * (float)n + shifts_chips[current_correlator_tap] - rem_code_phase_chips); @@ -455,7 +460,8 @@ static inline void volk_gnsssdr_16ic_xn_resampler_16ic_xn_u_avx(lv_16sc_t** resu const __m256 rem_code_phase_chips_reg = _mm256_set1_ps(rem_code_phase_chips); const __m256 code_phase_step_chips_reg = _mm256_set1_ps(code_phase_step_chips); - __VOLK_ATTR_ALIGNED(32) int local_code_chip_index[8]; + __VOLK_ATTR_ALIGNED(32) + int local_code_chip_index[8]; int local_code_chip_index_; const __m256 zeros = _mm256_setzero_ps(); @@ -470,7 +476,7 @@ static inline void volk_gnsssdr_16ic_xn_resampler_16ic_xn_u_avx(lv_16sc_t** resu shifts_chips_reg = _mm256_set1_ps((float)shifts_chips[current_correlator_tap]); aux2 = _mm256_sub_ps(shifts_chips_reg, rem_code_phase_chips_reg); indexn = n0; - for(n = 0; n < avx_iters; n++) + for (n = 0; n < avx_iters; n++) { __VOLK_GNSSSDR_PREFETCH_LOCALITY(&_result[current_correlator_tap][8 * n + 7], 1, 0); __VOLK_GNSSSDR_PREFETCH_LOCALITY(&local_code_chip_index[8], 1, 3); @@ -488,13 +494,13 @@ static inline void volk_gnsssdr_16ic_xn_resampler_16ic_xn_u_avx(lv_16sc_t** resu // no negatives c = _mm256_cvtepi32_ps(local_code_chip_index_reg); - negatives = _mm256_cmp_ps(c, zeros, 0x01 ); + negatives = _mm256_cmp_ps(c, zeros, 0x01); aux3 = _mm256_and_ps(code_length_chips_reg_f, negatives); aux = _mm256_add_ps(c, aux3); local_code_chip_index_reg = _mm256_cvttps_epi32(aux); _mm256_store_si256((__m256i*)local_code_chip_index, local_code_chip_index_reg); - for(k = 0; k < 8; ++k) + for (k = 0; k < 8; ++k) { _result[current_correlator_tap][n * 8 + k] = local_code[local_code_chip_index[k]]; } @@ -504,7 +510,7 @@ static inline void volk_gnsssdr_16ic_xn_resampler_16ic_xn_u_avx(lv_16sc_t** resu _mm256_zeroupper(); for (current_correlator_tap = 0; current_correlator_tap < num_out_vectors; current_correlator_tap++) { - for(n = avx_iters * 8; n < num_points; n++) + for (n = avx_iters * 8; n < num_points; n++) { // resample code for current tap local_code_chip_index_ = (int)floor(code_phase_step_chips * (float)n + shifts_chips[current_correlator_tap] - rem_code_phase_chips); @@ -530,7 +536,8 @@ static inline void volk_gnsssdr_16ic_xn_resampler_16ic_xn_neon(lv_16sc_t** resul const float32x4_t rem_code_phase_chips_reg = vdupq_n_f32(rem_code_phase_chips); const float32x4_t code_phase_step_chips_reg = vdupq_n_f32(code_phase_step_chips); - __VOLK_ATTR_ALIGNED(16) int32_t local_code_chip_index[4]; + __VOLK_ATTR_ALIGNED(16) + int32_t local_code_chip_index[4]; int32_t local_code_chip_index_; const int32x4_t zeros = vdupq_n_s32(0); @@ -538,11 +545,12 @@ static inline void volk_gnsssdr_16ic_xn_resampler_16ic_xn_neon(lv_16sc_t** resul const int32x4_t code_length_chips_reg_i = vdupq_n_s32((int32_t)code_length_chips); int32x4_t local_code_chip_index_reg, aux_i, negatives, i; float32x4_t aux, aux2, shifts_chips_reg, fi, c, j, cTrunc, base, indexn, reciprocal; - __VOLK_ATTR_ALIGNED(16) const float vec[4] = { 0.0f, 1.0f, 2.0f, 3.0f }; + __VOLK_ATTR_ALIGNED(16) + const float vec[4] = {0.0f, 1.0f, 2.0f, 3.0f}; uint32x4_t igx; reciprocal = vrecpeq_f32(code_length_chips_reg_f); reciprocal = vmulq_f32(vrecpsq_f32(code_length_chips_reg_f, reciprocal), reciprocal); - reciprocal = vmulq_f32(vrecpsq_f32(code_length_chips_reg_f, reciprocal), reciprocal); // this refinement is required! + reciprocal = vmulq_f32(vrecpsq_f32(code_length_chips_reg_f, reciprocal), reciprocal); // this refinement is required! float32x4_t n0 = vld1q_f32((float*)vec); int current_correlator_tap; unsigned int n; @@ -552,7 +560,7 @@ static inline void volk_gnsssdr_16ic_xn_resampler_16ic_xn_neon(lv_16sc_t** resul shifts_chips_reg = vdupq_n_f32((float)shifts_chips[current_correlator_tap]); aux2 = vsubq_f32(shifts_chips_reg, rem_code_phase_chips_reg); indexn = n0; - for(n = 0; n < neon_iters; n++) + for (n = 0; n < neon_iters; n++) { __VOLK_GNSSSDR_PREFETCH_LOCALITY(&_result[current_correlator_tap][4 * n + 3], 1, 0); __VOLK_GNSSSDR_PREFETCH(&local_code_chip_index[4]); @@ -568,7 +576,7 @@ static inline void volk_gnsssdr_16ic_xn_resampler_16ic_xn_neon(lv_16sc_t** resul // fmod c = vmulq_f32(aux, reciprocal); - i = vcvtq_s32_f32(c); + i = vcvtq_s32_f32(c); cTrunc = vcvtq_f32_s32(i); base = vmulq_f32(cTrunc, code_length_chips_reg_f); aux = vsubq_f32(aux, base); @@ -580,13 +588,13 @@ static inline void volk_gnsssdr_16ic_xn_resampler_16ic_xn_neon(lv_16sc_t** resul vst1q_s32((int32_t*)local_code_chip_index, local_code_chip_index_reg); - for(k = 0; k < 4; ++k) + for (k = 0; k < 4; ++k) { _result[current_correlator_tap][n * 4 + k] = local_code[local_code_chip_index[k]]; } indexn = vaddq_f32(indexn, fours); } - for(n = neon_iters * 4; n < num_points; n++) + for (n = neon_iters * 4; n < num_points; n++) { __VOLK_GNSSSDR_PREFETCH_LOCALITY(&_result[current_correlator_tap][n], 1, 0); // resample code for current tap @@ -604,4 +612,3 @@ static inline void volk_gnsssdr_16ic_xn_resampler_16ic_xn_neon(lv_16sc_t** resul #endif /*INCLUDED_volk_gnsssdr_16ic_xn_resampler_16ic_xn_H*/ - diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_xn_resampler_fast_16ic_xn.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_xn_resampler_fast_16ic_xn.h index a31cba3a5..d583595a4 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_xn_resampler_fast_16ic_xn.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_xn_resampler_fast_16ic_xn.h @@ -95,69 +95,74 @@ static inline void volk_gnsssdr_16ic_xn_resampler_fast_16ic_xn_generic(lv_16sc_t #ifdef LV_HAVE_SSE2 #include -static inline void volk_gnsssdr_16ic_xn_resampler_fast_16ic_xn_a_sse2(lv_16sc_t** result, const lv_16sc_t* local_code, float* rem_code_phase_chips ,float code_phase_step_chips, unsigned int code_length_chips, int num_out_vectors, unsigned int num_output_samples) +static inline void volk_gnsssdr_16ic_xn_resampler_fast_16ic_xn_a_sse2(lv_16sc_t** result, const lv_16sc_t* local_code, float* rem_code_phase_chips, float code_phase_step_chips, unsigned int code_length_chips, int num_out_vectors, unsigned int num_output_samples) { - _MM_SET_ROUNDING_MODE(_MM_ROUND_NEAREST);//_MM_ROUND_NEAREST, _MM_ROUND_DOWN, _MM_ROUND_UP, _MM_ROUND_TOWARD_ZERO + _MM_SET_ROUNDING_MODE(_MM_ROUND_NEAREST); //_MM_ROUND_NEAREST, _MM_ROUND_DOWN, _MM_ROUND_UP, _MM_ROUND_TOWARD_ZERO unsigned int number; const unsigned int quarterPoints = num_output_samples / 4; lv_16sc_t** _result = result; - __VOLK_ATTR_ALIGNED(16) int local_code_chip_index[4]; + __VOLK_ATTR_ALIGNED(16) + int local_code_chip_index[4]; float tmp_rem_code_phase_chips; - __m128 _rem_code_phase,_code_phase_step_chips; - __m128i _code_length_chips,_code_length_chips_minus1; - __m128 _code_phase_out,_code_phase_out_with_offset; + __m128 _rem_code_phase, _code_phase_step_chips; + __m128i _code_length_chips, _code_length_chips_minus1; + __m128 _code_phase_out, _code_phase_out_with_offset; - _code_phase_step_chips = _mm_load1_ps(&code_phase_step_chips); //load float to all four float values in m128 register - __VOLK_ATTR_ALIGNED(16) int four_times_code_length_chips_minus1[4]; + _code_phase_step_chips = _mm_load1_ps(&code_phase_step_chips); //load float to all four float values in m128 register + __VOLK_ATTR_ALIGNED(16) + int four_times_code_length_chips_minus1[4]; four_times_code_length_chips_minus1[0] = code_length_chips - 1; four_times_code_length_chips_minus1[1] = code_length_chips - 1; four_times_code_length_chips_minus1[2] = code_length_chips - 1; four_times_code_length_chips_minus1[3] = code_length_chips - 1; - __VOLK_ATTR_ALIGNED(16) int four_times_code_length_chips[4]; + __VOLK_ATTR_ALIGNED(16) + int four_times_code_length_chips[4]; four_times_code_length_chips[0] = code_length_chips; four_times_code_length_chips[1] = code_length_chips; four_times_code_length_chips[2] = code_length_chips; four_times_code_length_chips[3] = code_length_chips; - _code_length_chips = _mm_load_si128((__m128i*)&four_times_code_length_chips); //load float to all four float values in m128 register - _code_length_chips_minus1 = _mm_load_si128((__m128i*)&four_times_code_length_chips_minus1); //load float to all four float values in m128 register + _code_length_chips = _mm_load_si128((__m128i*)&four_times_code_length_chips); //load float to all four float values in m128 register + _code_length_chips_minus1 = _mm_load_si128((__m128i*)&four_times_code_length_chips_minus1); //load float to all four float values in m128 register - __m128i negative_indexes, overflow_indexes,_code_phase_out_int, _code_phase_out_int_neg,_code_phase_out_int_over; + __m128i negative_indexes, overflow_indexes, _code_phase_out_int, _code_phase_out_int_neg, _code_phase_out_int_over; __m128i zero = _mm_setzero_si128(); - __VOLK_ATTR_ALIGNED(16) float init_idx_float[4] = { 0.0f, 1.0f, 2.0f, 3.0f }; + __VOLK_ATTR_ALIGNED(16) + float init_idx_float[4] = {0.0f, 1.0f, 2.0f, 3.0f}; __m128 _4output_index = _mm_load_ps(init_idx_float); - __VOLK_ATTR_ALIGNED(16) float init_4constant_float[4] = { 4.0f, 4.0f, 4.0f, 4.0f }; + __VOLK_ATTR_ALIGNED(16) + float init_4constant_float[4] = {4.0f, 4.0f, 4.0f, 4.0f}; __m128 _4constant_float = _mm_load_ps(init_4constant_float); int current_vector = 0; int sample_idx = 0; - for(number = 0; number < quarterPoints; number++) + for (number = 0; number < quarterPoints; number++) { //common to all outputs - _code_phase_out = _mm_mul_ps(_code_phase_step_chips, _4output_index); //compute the code phase point with the phase step + _code_phase_out = _mm_mul_ps(_code_phase_step_chips, _4output_index); //compute the code phase point with the phase step //output vector dependant (different code phase offset) - for(current_vector = 0; current_vector < num_out_vectors; current_vector++) + for (current_vector = 0; current_vector < num_out_vectors; current_vector++) { - tmp_rem_code_phase_chips = rem_code_phase_chips[current_vector] - 0.5f; // adjust offset to perform correct rounding (chip transition at 0) - _rem_code_phase = _mm_load1_ps(&tmp_rem_code_phase_chips); //load float to all four float values in m128 register + tmp_rem_code_phase_chips = rem_code_phase_chips[current_vector] - 0.5f; // adjust offset to perform correct rounding (chip transition at 0) + _rem_code_phase = _mm_load1_ps(&tmp_rem_code_phase_chips); //load float to all four float values in m128 register - _code_phase_out_with_offset = _mm_add_ps(_code_phase_out, _rem_code_phase); //add the phase offset - _code_phase_out_int = _mm_cvtps_epi32(_code_phase_out_with_offset); //convert to integer + _code_phase_out_with_offset = _mm_add_ps(_code_phase_out, _rem_code_phase); //add the phase offset + _code_phase_out_int = _mm_cvtps_epi32(_code_phase_out_with_offset); //convert to integer - negative_indexes = _mm_cmplt_epi32(_code_phase_out_int, zero); //test for negative values - _code_phase_out_int_neg = _mm_add_epi32(_code_phase_out_int, _code_length_chips); //the negative values branch - _code_phase_out_int_neg = _mm_xor_si128(_code_phase_out_int, _mm_and_si128( negative_indexes, _mm_xor_si128( _code_phase_out_int_neg, _code_phase_out_int ))); + negative_indexes = _mm_cmplt_epi32(_code_phase_out_int, zero); //test for negative values + _code_phase_out_int_neg = _mm_add_epi32(_code_phase_out_int, _code_length_chips); //the negative values branch + _code_phase_out_int_neg = _mm_xor_si128(_code_phase_out_int, _mm_and_si128(negative_indexes, _mm_xor_si128(_code_phase_out_int_neg, _code_phase_out_int))); - overflow_indexes = _mm_cmpgt_epi32(_code_phase_out_int_neg, _code_length_chips_minus1); //test for overflow values - _code_phase_out_int_over = _mm_sub_epi32(_code_phase_out_int_neg, _code_length_chips); //the negative values branch - _code_phase_out_int_over = _mm_xor_si128(_code_phase_out_int_neg, _mm_and_si128( overflow_indexes, _mm_xor_si128( _code_phase_out_int_over, _code_phase_out_int_neg ))); + overflow_indexes = _mm_cmpgt_epi32(_code_phase_out_int_neg, _code_length_chips_minus1); //test for overflow values + _code_phase_out_int_over = _mm_sub_epi32(_code_phase_out_int_neg, _code_length_chips); //the negative values branch + _code_phase_out_int_over = _mm_xor_si128(_code_phase_out_int_neg, _mm_and_si128(overflow_indexes, _mm_xor_si128(_code_phase_out_int_over, _code_phase_out_int_neg))); - _mm_store_si128((__m128i*)local_code_chip_index, _code_phase_out_int_over); // Store the results back + _mm_store_si128((__m128i*)local_code_chip_index, _code_phase_out_int_over); // Store the results back //todo: optimize the local code lookup table with intrinsics, if possible _result[current_vector][sample_idx] = local_code[local_code_chip_index[0]]; @@ -169,9 +174,9 @@ static inline void volk_gnsssdr_16ic_xn_resampler_fast_16ic_xn_a_sse2(lv_16sc_t* sample_idx += 4; } - for(number = quarterPoints * 4; number < num_output_samples; number++) + for (number = quarterPoints * 4; number < num_output_samples; number++) { - for(current_vector = 0; current_vector < num_out_vectors; current_vector++) + for (current_vector = 0; current_vector < num_out_vectors; current_vector++) { local_code_chip_index[0] = (int)(code_phase_step_chips * (float)(number) + rem_code_phase_chips[current_vector]); if (local_code_chip_index[0] < 0.0) local_code_chip_index[0] += code_length_chips - 1; @@ -186,69 +191,74 @@ static inline void volk_gnsssdr_16ic_xn_resampler_fast_16ic_xn_a_sse2(lv_16sc_t* #ifdef LV_HAVE_SSE2 #include -static inline void volk_gnsssdr_16ic_xn_resampler_fast_16ic_xn_u_sse2(lv_16sc_t** result, const lv_16sc_t* local_code, float* rem_code_phase_chips ,float code_phase_step_chips, unsigned int code_length_chips, int num_out_vectors, unsigned int num_output_samples) +static inline void volk_gnsssdr_16ic_xn_resampler_fast_16ic_xn_u_sse2(lv_16sc_t** result, const lv_16sc_t* local_code, float* rem_code_phase_chips, float code_phase_step_chips, unsigned int code_length_chips, int num_out_vectors, unsigned int num_output_samples) { - _MM_SET_ROUNDING_MODE(_MM_ROUND_NEAREST);//_MM_ROUND_NEAREST, _MM_ROUND_DOWN, _MM_ROUND_UP, _MM_ROUND_TOWARD_ZERO + _MM_SET_ROUNDING_MODE(_MM_ROUND_NEAREST); //_MM_ROUND_NEAREST, _MM_ROUND_DOWN, _MM_ROUND_UP, _MM_ROUND_TOWARD_ZERO unsigned int number; const unsigned int quarterPoints = num_output_samples / 4; lv_16sc_t** _result = result; - __VOLK_ATTR_ALIGNED(16) int local_code_chip_index[4]; + __VOLK_ATTR_ALIGNED(16) + int local_code_chip_index[4]; float tmp_rem_code_phase_chips; - __m128 _rem_code_phase,_code_phase_step_chips; - __m128i _code_length_chips,_code_length_chips_minus1; - __m128 _code_phase_out,_code_phase_out_with_offset; + __m128 _rem_code_phase, _code_phase_step_chips; + __m128i _code_length_chips, _code_length_chips_minus1; + __m128 _code_phase_out, _code_phase_out_with_offset; - _code_phase_step_chips = _mm_load1_ps(&code_phase_step_chips); //load float to all four float values in m128 register - __VOLK_ATTR_ALIGNED(16) int four_times_code_length_chips_minus1[4]; + _code_phase_step_chips = _mm_load1_ps(&code_phase_step_chips); //load float to all four float values in m128 register + __VOLK_ATTR_ALIGNED(16) + int four_times_code_length_chips_minus1[4]; four_times_code_length_chips_minus1[0] = code_length_chips - 1; four_times_code_length_chips_minus1[1] = code_length_chips - 1; four_times_code_length_chips_minus1[2] = code_length_chips - 1; four_times_code_length_chips_minus1[3] = code_length_chips - 1; - __VOLK_ATTR_ALIGNED(16) int four_times_code_length_chips[4]; + __VOLK_ATTR_ALIGNED(16) + int four_times_code_length_chips[4]; four_times_code_length_chips[0] = code_length_chips; four_times_code_length_chips[1] = code_length_chips; four_times_code_length_chips[2] = code_length_chips; four_times_code_length_chips[3] = code_length_chips; - _code_length_chips = _mm_loadu_si128((__m128i*)&four_times_code_length_chips); //load float to all four float values in m128 register - _code_length_chips_minus1 = _mm_loadu_si128((__m128i*)&four_times_code_length_chips_minus1); //load float to all four float values in m128 register + _code_length_chips = _mm_loadu_si128((__m128i*)&four_times_code_length_chips); //load float to all four float values in m128 register + _code_length_chips_minus1 = _mm_loadu_si128((__m128i*)&four_times_code_length_chips_minus1); //load float to all four float values in m128 register - __m128i negative_indexes, overflow_indexes,_code_phase_out_int, _code_phase_out_int_neg,_code_phase_out_int_over; + __m128i negative_indexes, overflow_indexes, _code_phase_out_int, _code_phase_out_int_neg, _code_phase_out_int_over; __m128i zero = _mm_setzero_si128(); - __VOLK_ATTR_ALIGNED(16) float init_idx_float[4] = { 0.0f, 1.0f, 2.0f, 3.0f }; + __VOLK_ATTR_ALIGNED(16) + float init_idx_float[4] = {0.0f, 1.0f, 2.0f, 3.0f}; __m128 _4output_index = _mm_loadu_ps(init_idx_float); - __VOLK_ATTR_ALIGNED(16) float init_4constant_float[4] = { 4.0f, 4.0f, 4.0f, 4.0f }; + __VOLK_ATTR_ALIGNED(16) + float init_4constant_float[4] = {4.0f, 4.0f, 4.0f, 4.0f}; __m128 _4constant_float = _mm_loadu_ps(init_4constant_float); int current_vector = 0; int sample_idx = 0; - for(number = 0; number < quarterPoints; number++) + for (number = 0; number < quarterPoints; number++) { //common to all outputs - _code_phase_out = _mm_mul_ps(_code_phase_step_chips, _4output_index); //compute the code phase point with the phase step + _code_phase_out = _mm_mul_ps(_code_phase_step_chips, _4output_index); //compute the code phase point with the phase step //output vector dependant (different code phase offset) - for(current_vector = 0; current_vector < num_out_vectors; current_vector++) + for (current_vector = 0; current_vector < num_out_vectors; current_vector++) { - tmp_rem_code_phase_chips = rem_code_phase_chips[current_vector] - 0.5f; // adjust offset to perform correct rounding (chip transition at 0) - _rem_code_phase = _mm_load1_ps(&tmp_rem_code_phase_chips); //load float to all four float values in m128 register + tmp_rem_code_phase_chips = rem_code_phase_chips[current_vector] - 0.5f; // adjust offset to perform correct rounding (chip transition at 0) + _rem_code_phase = _mm_load1_ps(&tmp_rem_code_phase_chips); //load float to all four float values in m128 register - _code_phase_out_with_offset = _mm_add_ps(_code_phase_out, _rem_code_phase); //add the phase offset - _code_phase_out_int = _mm_cvtps_epi32(_code_phase_out_with_offset); //convert to integer + _code_phase_out_with_offset = _mm_add_ps(_code_phase_out, _rem_code_phase); //add the phase offset + _code_phase_out_int = _mm_cvtps_epi32(_code_phase_out_with_offset); //convert to integer - negative_indexes = _mm_cmplt_epi32(_code_phase_out_int, zero); //test for negative values - _code_phase_out_int_neg = _mm_add_epi32(_code_phase_out_int, _code_length_chips); //the negative values branch - _code_phase_out_int_neg = _mm_xor_si128(_code_phase_out_int, _mm_and_si128( negative_indexes, _mm_xor_si128( _code_phase_out_int_neg, _code_phase_out_int ))); + negative_indexes = _mm_cmplt_epi32(_code_phase_out_int, zero); //test for negative values + _code_phase_out_int_neg = _mm_add_epi32(_code_phase_out_int, _code_length_chips); //the negative values branch + _code_phase_out_int_neg = _mm_xor_si128(_code_phase_out_int, _mm_and_si128(negative_indexes, _mm_xor_si128(_code_phase_out_int_neg, _code_phase_out_int))); - overflow_indexes = _mm_cmpgt_epi32(_code_phase_out_int_neg, _code_length_chips_minus1); //test for overflow values - _code_phase_out_int_over = _mm_sub_epi32(_code_phase_out_int_neg, _code_length_chips); //the negative values branch - _code_phase_out_int_over = _mm_xor_si128(_code_phase_out_int_neg, _mm_and_si128( overflow_indexes, _mm_xor_si128( _code_phase_out_int_over, _code_phase_out_int_neg ))); + overflow_indexes = _mm_cmpgt_epi32(_code_phase_out_int_neg, _code_length_chips_minus1); //test for overflow values + _code_phase_out_int_over = _mm_sub_epi32(_code_phase_out_int_neg, _code_length_chips); //the negative values branch + _code_phase_out_int_over = _mm_xor_si128(_code_phase_out_int_neg, _mm_and_si128(overflow_indexes, _mm_xor_si128(_code_phase_out_int_over, _code_phase_out_int_neg))); - _mm_storeu_si128((__m128i*)local_code_chip_index, _code_phase_out_int_over); // Store the results back + _mm_storeu_si128((__m128i*)local_code_chip_index, _code_phase_out_int_over); // Store the results back //todo: optimize the local code lookup table with intrinsics, if possible _result[current_vector][sample_idx] = local_code[local_code_chip_index[0]]; @@ -260,9 +270,9 @@ static inline void volk_gnsssdr_16ic_xn_resampler_fast_16ic_xn_u_sse2(lv_16sc_t* sample_idx += 4; } - for(number = quarterPoints * 4; number < num_output_samples; number++) + for (number = quarterPoints * 4; number < num_output_samples; number++) { - for(current_vector = 0; current_vector < num_out_vectors; current_vector++) + for (current_vector = 0; current_vector < num_out_vectors; current_vector++) { local_code_chip_index[0] = (int)(code_phase_step_chips * (float)(number) + rem_code_phase_chips[current_vector]); if (local_code_chip_index[0] < 0.0) local_code_chip_index[0] += code_length_chips - 1; @@ -278,74 +288,79 @@ static inline void volk_gnsssdr_16ic_xn_resampler_fast_16ic_xn_u_sse2(lv_16sc_t* #ifdef LV_HAVE_NEON #include -static inline void volk_gnsssdr_16ic_xn_resampler_fast_16ic_xn_neon(lv_16sc_t** result, const lv_16sc_t* local_code, float* rem_code_phase_chips ,float code_phase_step_chips, unsigned int code_length_chips, int num_out_vectors, unsigned int num_output_samples) +static inline void volk_gnsssdr_16ic_xn_resampler_fast_16ic_xn_neon(lv_16sc_t** result, const lv_16sc_t* local_code, float* rem_code_phase_chips, float code_phase_step_chips, unsigned int code_length_chips, int num_out_vectors, unsigned int num_output_samples) { unsigned int number; const unsigned int quarterPoints = num_output_samples / 4; float32x4_t half = vdupq_n_f32(0.5f); lv_16sc_t** _result = result; - __VOLK_ATTR_ALIGNED(16) int local_code_chip_index[4]; + __VOLK_ATTR_ALIGNED(16) + int local_code_chip_index[4]; float tmp_rem_code_phase_chips; float32x4_t _rem_code_phase, _code_phase_step_chips; int32x4_t _code_length_chips, _code_length_chips_minus1; float32x4_t _code_phase_out, _code_phase_out_with_offset; float32x4_t sign, PlusHalf, Round; - _code_phase_step_chips = vld1q_dup_f32(&code_phase_step_chips); //load float to all four float values in float32x4_t register - __VOLK_ATTR_ALIGNED(16) int four_times_code_length_chips_minus1[4]; + _code_phase_step_chips = vld1q_dup_f32(&code_phase_step_chips); //load float to all four float values in float32x4_t register + __VOLK_ATTR_ALIGNED(16) + int four_times_code_length_chips_minus1[4]; four_times_code_length_chips_minus1[0] = code_length_chips - 1; four_times_code_length_chips_minus1[1] = code_length_chips - 1; four_times_code_length_chips_minus1[2] = code_length_chips - 1; four_times_code_length_chips_minus1[3] = code_length_chips - 1; - __VOLK_ATTR_ALIGNED(16) int four_times_code_length_chips[4]; + __VOLK_ATTR_ALIGNED(16) + int four_times_code_length_chips[4]; four_times_code_length_chips[0] = code_length_chips; four_times_code_length_chips[1] = code_length_chips; four_times_code_length_chips[2] = code_length_chips; four_times_code_length_chips[3] = code_length_chips; - _code_length_chips = vld1q_s32((int32_t*)&four_times_code_length_chips); //load float to all four float values in float32x4_t register - _code_length_chips_minus1 = vld1q_s32((int32_t*)&four_times_code_length_chips_minus1); //load float to all four float values in float32x4_t register + _code_length_chips = vld1q_s32((int32_t*)&four_times_code_length_chips); //load float to all four float values in float32x4_t register + _code_length_chips_minus1 = vld1q_s32((int32_t*)&four_times_code_length_chips_minus1); //load float to all four float values in float32x4_t register - int32x4_t _code_phase_out_int, _code_phase_out_int_neg, _code_phase_out_int_over; + int32x4_t _code_phase_out_int, _code_phase_out_int_neg, _code_phase_out_int_over; uint32x4_t negative_indexes, overflow_indexes; int32x4_t zero = vmovq_n_s32(0); - __VOLK_ATTR_ALIGNED(16) float init_idx_float[4] = { 0.0f, 1.0f, 2.0f, 3.0f }; + __VOLK_ATTR_ALIGNED(16) + float init_idx_float[4] = {0.0f, 1.0f, 2.0f, 3.0f}; float32x4_t _4output_index = vld1q_f32(init_idx_float); - __VOLK_ATTR_ALIGNED(16) float init_4constant_float[4] = { 4.0f, 4.0f, 4.0f, 4.0f }; + __VOLK_ATTR_ALIGNED(16) + float init_4constant_float[4] = {4.0f, 4.0f, 4.0f, 4.0f}; float32x4_t _4constant_float = vld1q_f32(init_4constant_float); int current_vector = 0; int sample_idx = 0; - for(number = 0; number < quarterPoints; number++) + for (number = 0; number < quarterPoints; number++) { //common to all outputs - _code_phase_out = vmulq_f32(_code_phase_step_chips, _4output_index); //compute the code phase point with the phase step + _code_phase_out = vmulq_f32(_code_phase_step_chips, _4output_index); //compute the code phase point with the phase step //output vector dependant (different code phase offset) - for(current_vector = 0; current_vector < num_out_vectors; current_vector++) + for (current_vector = 0; current_vector < num_out_vectors; current_vector++) { - tmp_rem_code_phase_chips = rem_code_phase_chips[current_vector] - 0.5f; // adjust offset to perform correct rounding (chip transition at 0) - _rem_code_phase = vld1q_dup_f32(&tmp_rem_code_phase_chips); //load float to all four float values in float32x4_t register + tmp_rem_code_phase_chips = rem_code_phase_chips[current_vector] - 0.5f; // adjust offset to perform correct rounding (chip transition at 0) + _rem_code_phase = vld1q_dup_f32(&tmp_rem_code_phase_chips); //load float to all four float values in float32x4_t register - _code_phase_out_with_offset = vaddq_f32(_code_phase_out, _rem_code_phase); //add the phase offset + _code_phase_out_with_offset = vaddq_f32(_code_phase_out, _rem_code_phase); //add the phase offset //_code_phase_out_int = _mm_cvtps_epi32(_code_phase_out_with_offset); //convert to integer sign = vcvtq_f32_u32((vshrq_n_u32(vreinterpretq_u32_f32(_code_phase_out_with_offset), 31))); PlusHalf = vaddq_f32(_code_phase_out_with_offset, half); Round = vsubq_f32(PlusHalf, sign); _code_phase_out_int = vcvtq_s32_f32(Round); - negative_indexes = vcltq_s32(_code_phase_out_int, zero); //test for negative values - _code_phase_out_int_neg = vaddq_s32(_code_phase_out_int, _code_length_chips); //the negative values branch - _code_phase_out_int_neg = veorq_s32(_code_phase_out_int, vandq_s32( (int32x4_t)negative_indexes, veorq_s32( _code_phase_out_int_neg, _code_phase_out_int ))); + negative_indexes = vcltq_s32(_code_phase_out_int, zero); //test for negative values + _code_phase_out_int_neg = vaddq_s32(_code_phase_out_int, _code_length_chips); //the negative values branch + _code_phase_out_int_neg = veorq_s32(_code_phase_out_int, vandq_s32((int32x4_t)negative_indexes, veorq_s32(_code_phase_out_int_neg, _code_phase_out_int))); - overflow_indexes = vcgtq_s32(_code_phase_out_int_neg, _code_length_chips_minus1); //test for overflow values - _code_phase_out_int_over = vsubq_s32(_code_phase_out_int_neg, _code_length_chips); //the negative values branch - _code_phase_out_int_over = veorq_s32(_code_phase_out_int_neg, vandq_s32( (int32x4_t)overflow_indexes, veorq_s32( _code_phase_out_int_over, _code_phase_out_int_neg ))); + overflow_indexes = vcgtq_s32(_code_phase_out_int_neg, _code_length_chips_minus1); //test for overflow values + _code_phase_out_int_over = vsubq_s32(_code_phase_out_int_neg, _code_length_chips); //the negative values branch + _code_phase_out_int_over = veorq_s32(_code_phase_out_int_neg, vandq_s32((int32x4_t)overflow_indexes, veorq_s32(_code_phase_out_int_over, _code_phase_out_int_neg))); - vst1q_s32((int32_t*)local_code_chip_index, _code_phase_out_int_over); // Store the results back + vst1q_s32((int32_t*)local_code_chip_index, _code_phase_out_int_over); // Store the results back //todo: optimize the local code lookup table with intrinsics, if possible _result[current_vector][sample_idx] = local_code[local_code_chip_index[0]]; @@ -357,9 +372,9 @@ static inline void volk_gnsssdr_16ic_xn_resampler_fast_16ic_xn_neon(lv_16sc_t** sample_idx += 4; } - for(number = quarterPoints * 4; number < num_output_samples; number++) + for (number = quarterPoints * 4; number < num_output_samples; number++) { - for(current_vector = 0; current_vector < num_out_vectors; current_vector++) + for (current_vector = 0; current_vector < num_out_vectors; current_vector++) { local_code_chip_index[0] = (int)(code_phase_step_chips * (float)(number) + rem_code_phase_chips[current_vector]); if (local_code_chip_index[0] < 0.0) local_code_chip_index[0] += code_length_chips - 1; diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32f_index_max_32u.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32f_index_max_32u.h index af5e609cb..ace8271ea 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32f_index_max_32u.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32f_index_max_32u.h @@ -29,7 +29,6 @@ */ - /*! * \page volk_gnsssdr_32f_index_max_32u.h * @@ -63,7 +62,7 @@ static inline void volk_gnsssdr_32f_index_max_32u_a_avx(uint32_t* target, const float* src0, uint32_t num_points) { - if(num_points > 0) + if (num_points > 0) { uint32_t number = 0; const uint32_t quarterPoints = num_points / 8; @@ -71,7 +70,7 @@ static inline void volk_gnsssdr_32f_index_max_32u_a_avx(uint32_t* target, const float* inputPtr = (float*)src0; __m256 indexIncrementValues = _mm256_set1_ps(8); - __m256 currentIndexes = _mm256_set_ps(-1,-2,-3,-4,-5,-6,-7,-8); + __m256 currentIndexes = _mm256_set_ps(-1, -2, -3, -4, -5, -6, -7, -8); float max = src0[0]; float index = 0; @@ -80,25 +79,28 @@ static inline void volk_gnsssdr_32f_index_max_32u_a_avx(uint32_t* target, const __m256 compareResults; __m256 currentValues; - __VOLK_ATTR_ALIGNED(32) float maxValuesBuffer[8]; - __VOLK_ATTR_ALIGNED(32) float maxIndexesBuffer[8]; + __VOLK_ATTR_ALIGNED(32) + float maxValuesBuffer[8]; + __VOLK_ATTR_ALIGNED(32) + float maxIndexesBuffer[8]; - for(;number < quarterPoints; number++) + for (; number < quarterPoints; number++) { - currentValues = _mm256_load_ps(inputPtr); inputPtr += 8; + currentValues = _mm256_load_ps(inputPtr); + inputPtr += 8; currentIndexes = _mm256_add_ps(currentIndexes, indexIncrementValues); compareResults = _mm256_cmp_ps(maxValues, currentValues, 0x1e); maxValuesIndex = _mm256_blendv_ps(currentIndexes, maxValuesIndex, compareResults); - maxValues = _mm256_blendv_ps(currentValues, maxValues, compareResults); + maxValues = _mm256_blendv_ps(currentValues, maxValues, compareResults); } // Calculate the largest value from the remaining 8 points _mm256_store_ps(maxValuesBuffer, maxValues); _mm256_store_ps(maxIndexesBuffer, maxValuesIndex); - for(number = 0; number < 8; number++) + for (number = 0; number < 8; number++) { - if(maxValuesBuffer[number] > max) + if (maxValuesBuffer[number] > max) { index = maxIndexesBuffer[number]; max = maxValuesBuffer[number]; @@ -106,9 +108,9 @@ static inline void volk_gnsssdr_32f_index_max_32u_a_avx(uint32_t* target, const } number = quarterPoints * 8; - for(;number < num_points; number++) + for (; number < num_points; number++) { - if(src0[number] > max) + if (src0[number] > max) { index = number; max = src0[number]; @@ -126,7 +128,7 @@ static inline void volk_gnsssdr_32f_index_max_32u_a_avx(uint32_t* target, const static inline void volk_gnsssdr_32f_index_max_32u_u_avx(uint32_t* target, const float* src0, uint32_t num_points) { - if(num_points > 0) + if (num_points > 0) { uint32_t number = 0; const uint32_t quarterPoints = num_points / 8; @@ -134,7 +136,7 @@ static inline void volk_gnsssdr_32f_index_max_32u_u_avx(uint32_t* target, const float* inputPtr = (float*)src0; __m256 indexIncrementValues = _mm256_set1_ps(8); - __m256 currentIndexes = _mm256_set_ps(-1,-2,-3,-4,-5,-6,-7,-8); + __m256 currentIndexes = _mm256_set_ps(-1, -2, -3, -4, -5, -6, -7, -8); float max = src0[0]; float index = 0; @@ -143,25 +145,28 @@ static inline void volk_gnsssdr_32f_index_max_32u_u_avx(uint32_t* target, const __m256 compareResults; __m256 currentValues; - __VOLK_ATTR_ALIGNED(32) float maxValuesBuffer[8]; - __VOLK_ATTR_ALIGNED(32) float maxIndexesBuffer[8]; + __VOLK_ATTR_ALIGNED(32) + float maxValuesBuffer[8]; + __VOLK_ATTR_ALIGNED(32) + float maxIndexesBuffer[8]; - for(;number < quarterPoints; number++) + for (; number < quarterPoints; number++) { - currentValues = _mm256_loadu_ps(inputPtr); inputPtr += 8; + currentValues = _mm256_loadu_ps(inputPtr); + inputPtr += 8; currentIndexes = _mm256_add_ps(currentIndexes, indexIncrementValues); compareResults = _mm256_cmp_ps(maxValues, currentValues, 0x1e); maxValuesIndex = _mm256_blendv_ps(currentIndexes, maxValuesIndex, compareResults); - maxValues = _mm256_blendv_ps(currentValues, maxValues, compareResults); + maxValues = _mm256_blendv_ps(currentValues, maxValues, compareResults); } // Calculate the largest value from the remaining 8 points _mm256_store_ps(maxValuesBuffer, maxValues); _mm256_store_ps(maxIndexesBuffer, maxValuesIndex); - for(number = 0; number < 8; number++) + for (number = 0; number < 8; number++) { - if(maxValuesBuffer[number] > max) + if (maxValuesBuffer[number] > max) { index = maxIndexesBuffer[number]; max = maxValuesBuffer[number]; @@ -169,9 +174,9 @@ static inline void volk_gnsssdr_32f_index_max_32u_u_avx(uint32_t* target, const } number = quarterPoints * 8; - for(;number < num_points; number++) + for (; number < num_points; number++) { - if(src0[number] > max) + if (src0[number] > max) { index = number; max = src0[number]; @@ -185,11 +190,11 @@ static inline void volk_gnsssdr_32f_index_max_32u_u_avx(uint32_t* target, const #ifdef LV_HAVE_SSE4_1 -#include +#include static inline void volk_gnsssdr_32f_index_max_32u_a_sse4_1(uint32_t* target, const float* src0, uint32_t num_points) { - if(num_points > 0) + if (num_points > 0) { uint32_t number = 0; const uint32_t quarterPoints = num_points / 4; @@ -197,7 +202,7 @@ static inline void volk_gnsssdr_32f_index_max_32u_a_sse4_1(uint32_t* target, con float* inputPtr = (float*)src0; __m128 indexIncrementValues = _mm_set1_ps(4); - __m128 currentIndexes = _mm_set_ps(-1,-2,-3,-4); + __m128 currentIndexes = _mm_set_ps(-1, -2, -3, -4); float max = src0[0]; float index = 0; @@ -206,25 +211,28 @@ static inline void volk_gnsssdr_32f_index_max_32u_a_sse4_1(uint32_t* target, con __m128 compareResults; __m128 currentValues; - __VOLK_ATTR_ALIGNED(16) float maxValuesBuffer[4]; - __VOLK_ATTR_ALIGNED(16) float maxIndexesBuffer[4]; + __VOLK_ATTR_ALIGNED(16) + float maxValuesBuffer[4]; + __VOLK_ATTR_ALIGNED(16) + float maxIndexesBuffer[4]; - for(;number < quarterPoints; number++) + for (; number < quarterPoints; number++) { - currentValues = _mm_load_ps(inputPtr); inputPtr += 4; + currentValues = _mm_load_ps(inputPtr); + inputPtr += 4; currentIndexes = _mm_add_ps(currentIndexes, indexIncrementValues); compareResults = _mm_cmpgt_ps(maxValues, currentValues); maxValuesIndex = _mm_blendv_ps(currentIndexes, maxValuesIndex, compareResults); - maxValues = _mm_blendv_ps(currentValues, maxValues, compareResults); + maxValues = _mm_blendv_ps(currentValues, maxValues, compareResults); } // Calculate the largest value from the remaining 4 points _mm_store_ps(maxValuesBuffer, maxValues); _mm_store_ps(maxIndexesBuffer, maxValuesIndex); - for(number = 0; number < 4; number++) + for (number = 0; number < 4; number++) { - if(maxValuesBuffer[number] > max) + if (maxValuesBuffer[number] > max) { index = maxIndexesBuffer[number]; max = maxValuesBuffer[number]; @@ -232,9 +240,9 @@ static inline void volk_gnsssdr_32f_index_max_32u_a_sse4_1(uint32_t* target, con } number = quarterPoints * 4; - for(;number < num_points; number++) + for (; number < num_points; number++) { - if(src0[number] > max) + if (src0[number] > max) { index = number; max = src0[number]; @@ -248,11 +256,11 @@ static inline void volk_gnsssdr_32f_index_max_32u_a_sse4_1(uint32_t* target, con #ifdef LV_HAVE_SSE4_1 -#include +#include static inline void volk_gnsssdr_32f_index_max_32u_u_sse4_1(uint32_t* target, const float* src0, uint32_t num_points) { - if(num_points > 0) + if (num_points > 0) { uint32_t number = 0; const uint32_t quarterPoints = num_points / 4; @@ -260,7 +268,7 @@ static inline void volk_gnsssdr_32f_index_max_32u_u_sse4_1(uint32_t* target, con float* inputPtr = (float*)src0; __m128 indexIncrementValues = _mm_set1_ps(4); - __m128 currentIndexes = _mm_set_ps(-1,-2,-3,-4); + __m128 currentIndexes = _mm_set_ps(-1, -2, -3, -4); float max = src0[0]; float index = 0; @@ -269,25 +277,28 @@ static inline void volk_gnsssdr_32f_index_max_32u_u_sse4_1(uint32_t* target, con __m128 compareResults; __m128 currentValues; - __VOLK_ATTR_ALIGNED(16) float maxValuesBuffer[4]; - __VOLK_ATTR_ALIGNED(16) float maxIndexesBuffer[4]; + __VOLK_ATTR_ALIGNED(16) + float maxValuesBuffer[4]; + __VOLK_ATTR_ALIGNED(16) + float maxIndexesBuffer[4]; - for(;number < quarterPoints; number++) + for (; number < quarterPoints; number++) { - currentValues = _mm_loadu_ps(inputPtr); inputPtr += 4; + currentValues = _mm_loadu_ps(inputPtr); + inputPtr += 4; currentIndexes = _mm_add_ps(currentIndexes, indexIncrementValues); compareResults = _mm_cmpgt_ps(maxValues, currentValues); maxValuesIndex = _mm_blendv_ps(currentIndexes, maxValuesIndex, compareResults); - maxValues = _mm_blendv_ps(currentValues, maxValues, compareResults); + maxValues = _mm_blendv_ps(currentValues, maxValues, compareResults); } // Calculate the largest value from the remaining 4 points _mm_store_ps(maxValuesBuffer, maxValues); _mm_store_ps(maxIndexesBuffer, maxValuesIndex); - for(number = 0; number < 4; number++) + for (number = 0; number < 4; number++) { - if(maxValuesBuffer[number] > max) + if (maxValuesBuffer[number] > max) { index = maxIndexesBuffer[number]; max = maxValuesBuffer[number]; @@ -295,9 +306,9 @@ static inline void volk_gnsssdr_32f_index_max_32u_u_sse4_1(uint32_t* target, con } number = quarterPoints * 4; - for(;number < num_points; number++) + for (; number < num_points; number++) { - if(src0[number] > max) + if (src0[number] > max) { index = number; max = src0[number]; @@ -312,11 +323,11 @@ static inline void volk_gnsssdr_32f_index_max_32u_u_sse4_1(uint32_t* target, con #ifdef LV_HAVE_SSE -#include +#include static inline void volk_gnsssdr_32f_index_max_32u_a_sse(uint32_t* target, const float* src0, uint32_t num_points) { - if(num_points > 0) + if (num_points > 0) { uint32_t number = 0; const uint32_t quarterPoints = num_points / 4; @@ -324,7 +335,7 @@ static inline void volk_gnsssdr_32f_index_max_32u_a_sse(uint32_t* target, const float* inputPtr = (float*)src0; __m128 indexIncrementValues = _mm_set1_ps(4); - __m128 currentIndexes = _mm_set_ps(-1,-2,-3,-4); + __m128 currentIndexes = _mm_set_ps(-1, -2, -3, -4); float max = src0[0]; float index = 0; @@ -333,25 +344,28 @@ static inline void volk_gnsssdr_32f_index_max_32u_a_sse(uint32_t* target, const __m128 compareResults; __m128 currentValues; - __VOLK_ATTR_ALIGNED(16) float maxValuesBuffer[4]; - __VOLK_ATTR_ALIGNED(16) float maxIndexesBuffer[4]; + __VOLK_ATTR_ALIGNED(16) + float maxValuesBuffer[4]; + __VOLK_ATTR_ALIGNED(16) + float maxIndexesBuffer[4]; - for(;number < quarterPoints; number++) + for (; number < quarterPoints; number++) { - currentValues = _mm_load_ps(inputPtr); inputPtr += 4; + currentValues = _mm_load_ps(inputPtr); + inputPtr += 4; currentIndexes = _mm_add_ps(currentIndexes, indexIncrementValues); compareResults = _mm_cmpgt_ps(maxValues, currentValues); - maxValuesIndex = _mm_or_ps(_mm_and_ps(compareResults, maxValuesIndex) , _mm_andnot_ps(compareResults, currentIndexes)); - maxValues = _mm_or_ps(_mm_and_ps(compareResults, maxValues) , _mm_andnot_ps(compareResults, currentValues)); + maxValuesIndex = _mm_or_ps(_mm_and_ps(compareResults, maxValuesIndex), _mm_andnot_ps(compareResults, currentIndexes)); + maxValues = _mm_or_ps(_mm_and_ps(compareResults, maxValues), _mm_andnot_ps(compareResults, currentValues)); } // Calculate the largest value from the remaining 4 points _mm_store_ps(maxValuesBuffer, maxValues); _mm_store_ps(maxIndexesBuffer, maxValuesIndex); - for(number = 0; number < 4; number++) + for (number = 0; number < 4; number++) { - if(maxValuesBuffer[number] > max) + if (maxValuesBuffer[number] > max) { index = maxIndexesBuffer[number]; max = maxValuesBuffer[number]; @@ -359,9 +373,9 @@ static inline void volk_gnsssdr_32f_index_max_32u_a_sse(uint32_t* target, const } number = quarterPoints * 4; - for(;number < num_points; number++) + for (; number < num_points; number++) { - if(src0[number] > max) + if (src0[number] > max) { index = number; max = src0[number]; @@ -376,11 +390,11 @@ static inline void volk_gnsssdr_32f_index_max_32u_a_sse(uint32_t* target, const #ifdef LV_HAVE_SSE -#include +#include static inline void volk_gnsssdr_32f_index_max_32u_u_sse(uint32_t* target, const float* src0, uint32_t num_points) { - if(num_points > 0) + if (num_points > 0) { uint32_t number = 0; const uint32_t quarterPoints = num_points / 4; @@ -388,7 +402,7 @@ static inline void volk_gnsssdr_32f_index_max_32u_u_sse(uint32_t* target, const float* inputPtr = (float*)src0; __m128 indexIncrementValues = _mm_set1_ps(4); - __m128 currentIndexes = _mm_set_ps(-1,-2,-3,-4); + __m128 currentIndexes = _mm_set_ps(-1, -2, -3, -4); float max = src0[0]; float index = 0; @@ -397,25 +411,28 @@ static inline void volk_gnsssdr_32f_index_max_32u_u_sse(uint32_t* target, const __m128 compareResults; __m128 currentValues; - __VOLK_ATTR_ALIGNED(16) float maxValuesBuffer[4]; - __VOLK_ATTR_ALIGNED(16) float maxIndexesBuffer[4]; + __VOLK_ATTR_ALIGNED(16) + float maxValuesBuffer[4]; + __VOLK_ATTR_ALIGNED(16) + float maxIndexesBuffer[4]; - for(;number < quarterPoints; number++) + for (; number < quarterPoints; number++) { - currentValues = _mm_loadu_ps(inputPtr); inputPtr += 4; + currentValues = _mm_loadu_ps(inputPtr); + inputPtr += 4; currentIndexes = _mm_add_ps(currentIndexes, indexIncrementValues); compareResults = _mm_cmpgt_ps(maxValues, currentValues); - maxValuesIndex = _mm_or_ps(_mm_and_ps(compareResults, maxValuesIndex) , _mm_andnot_ps(compareResults, currentIndexes)); - maxValues = _mm_or_ps(_mm_and_ps(compareResults, maxValues) , _mm_andnot_ps(compareResults, currentValues)); + maxValuesIndex = _mm_or_ps(_mm_and_ps(compareResults, maxValuesIndex), _mm_andnot_ps(compareResults, currentIndexes)); + maxValues = _mm_or_ps(_mm_and_ps(compareResults, maxValues), _mm_andnot_ps(compareResults, currentValues)); } // Calculate the largest value from the remaining 4 points _mm_store_ps(maxValuesBuffer, maxValues); _mm_store_ps(maxIndexesBuffer, maxValuesIndex); - for(number = 0; number < 4; number++) + for (number = 0; number < 4; number++) { - if(maxValuesBuffer[number] > max) + if (maxValuesBuffer[number] > max) { index = maxIndexesBuffer[number]; max = maxValuesBuffer[number]; @@ -423,9 +440,9 @@ static inline void volk_gnsssdr_32f_index_max_32u_u_sse(uint32_t* target, const } number = quarterPoints * 4; - for(;number < num_points; number++) + for (; number < num_points; number++) { - if(src0[number] > max) + if (src0[number] > max) { index = number; max = src0[number]; @@ -442,16 +459,16 @@ static inline void volk_gnsssdr_32f_index_max_32u_u_sse(uint32_t* target, const static inline void volk_gnsssdr_32f_index_max_32u_generic(uint32_t* target, const float* src0, uint32_t num_points) { - if(num_points > 0) + if (num_points > 0) { float max = src0[0]; uint32_t index = 0; uint32_t i = 1; - for(; i < num_points; ++i) + for (; i < num_points; ++i) { - if(src0[i] > max) + if (src0[i] > max) { index = i; max = src0[i]; @@ -469,14 +486,15 @@ static inline void volk_gnsssdr_32f_index_max_32u_generic(uint32_t* target, cons static inline void volk_gnsssdr_32f_index_max_32u_neon(uint32_t* target, const float* src0, uint32_t num_points) { - if(num_points > 0) + if (num_points > 0) { uint32_t number = 0; const uint32_t quarterPoints = num_points / 4; float* inputPtr = (float*)src0; float32x4_t indexIncrementValues = vdupq_n_f32(4); - __VOLK_ATTR_ALIGNED(16) float currentIndexes_float[4] = { -4.0f, -3.0f, -2.0f, -1.0f }; + __VOLK_ATTR_ALIGNED(16) + float currentIndexes_float[4] = {-4.0f, -3.0f, -2.0f, -1.0f}; float32x4_t currentIndexes = vld1q_f32(currentIndexes_float); float max = src0[0]; @@ -487,25 +505,28 @@ static inline void volk_gnsssdr_32f_index_max_32u_neon(uint32_t* target, const f uint32x4_t currentIndexes_u; float32x4_t currentValues; - __VOLK_ATTR_ALIGNED(16) float maxValuesBuffer[4]; - __VOLK_ATTR_ALIGNED(16) float maxIndexesBuffer[4]; + __VOLK_ATTR_ALIGNED(16) + float maxValuesBuffer[4]; + __VOLK_ATTR_ALIGNED(16) + float maxIndexesBuffer[4]; - for(;number < quarterPoints; number++) + for (; number < quarterPoints; number++) { - currentValues = vld1q_f32(inputPtr); inputPtr += 4; - currentIndexes = vaddq_f32(currentIndexes, indexIncrementValues); + currentValues = vld1q_f32(inputPtr); + inputPtr += 4; + currentIndexes = vaddq_f32(currentIndexes, indexIncrementValues); currentIndexes_u = vcvtq_u32_f32(currentIndexes); - compareResults = vcgtq_f32( maxValues, currentValues); - maxValuesIndex = vorrq_u32( vandq_u32( compareResults, maxValuesIndex ), vbicq_u32(currentIndexes_u, compareResults) ); - maxValues = vmaxq_f32(currentValues, maxValues); + compareResults = vcgtq_f32(maxValues, currentValues); + maxValuesIndex = vorrq_u32(vandq_u32(compareResults, maxValuesIndex), vbicq_u32(currentIndexes_u, compareResults)); + maxValues = vmaxq_f32(currentValues, maxValues); } // Calculate the largest value from the remaining 4 points vst1q_f32(maxValuesBuffer, maxValues); vst1q_f32(maxIndexesBuffer, vcvtq_f32_u32(maxValuesIndex)); - for(number = 0; number < 4; number++) + for (number = 0; number < 4; number++) { - if(maxValuesBuffer[number] > max) + if (maxValuesBuffer[number] > max) { index = maxIndexesBuffer[number]; max = maxValuesBuffer[number]; @@ -513,9 +534,9 @@ static inline void volk_gnsssdr_32f_index_max_32u_neon(uint32_t* target, const f } number = quarterPoints * 4; - for(;number < num_points; number++) + for (; number < num_points; number++) { - if(src0[number] > max) + if (src0[number] > max) { index = number; max = src0[number]; @@ -528,4 +549,3 @@ static inline void volk_gnsssdr_32f_index_max_32u_neon(uint32_t* target, const f #endif /*LV_HAVE_NEON*/ #endif /*INCLUDED_volk_gnsssdr_32f_index_max_32u_H*/ - diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32f_resamplerxnpuppet_32f.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32f_resamplerxnpuppet_32f.h index cf2a80f52..b425ecb9b 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32f_resamplerxnpuppet_32f.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32f_resamplerxnpuppet_32f.h @@ -42,31 +42,30 @@ #include - #ifdef LV_HAVE_GENERIC static inline void volk_gnsssdr_32f_resamplerxnpuppet_32f_generic(float* result, const float* local_code, unsigned int num_points) { int code_length_chips = 2046; - float code_phase_step_chips = ((float)(code_length_chips) + 0.1 )/( (float) num_points ); + float code_phase_step_chips = ((float)(code_length_chips) + 0.1) / ((float)num_points); int num_out_vectors = 3; float rem_code_phase_chips = -0.234; unsigned int n; - float shifts_chips[3] = { -0.1, 0.0, 0.1 }; + float shifts_chips[3] = {-0.1, 0.0, 0.1}; - float** result_aux = (float**)volk_gnsssdr_malloc(sizeof(float*) * num_out_vectors, volk_gnsssdr_get_alignment()); - for(n = 0; n < num_out_vectors; n++) - { - result_aux[n] = (float*)volk_gnsssdr_malloc(sizeof(float) * num_points, volk_gnsssdr_get_alignment()); - } + float** result_aux = (float**)volk_gnsssdr_malloc(sizeof(float*) * num_out_vectors, volk_gnsssdr_get_alignment()); + for (n = 0; n < num_out_vectors; n++) + { + result_aux[n] = (float*)volk_gnsssdr_malloc(sizeof(float) * num_points, volk_gnsssdr_get_alignment()); + } volk_gnsssdr_32f_xn_resampler_32f_xn_generic(result_aux, local_code, rem_code_phase_chips, code_phase_step_chips, shifts_chips, code_length_chips, num_out_vectors, num_points); memcpy((float*)result, (float*)result_aux[0], sizeof(float) * num_points); - for(n = 0; n < num_out_vectors; n++) - { - volk_gnsssdr_free(result_aux[n]); - } + for (n = 0; n < num_out_vectors; n++) + { + volk_gnsssdr_free(result_aux[n]); + } volk_gnsssdr_free(result_aux); } @@ -77,26 +76,26 @@ static inline void volk_gnsssdr_32f_resamplerxnpuppet_32f_generic(float* result, static inline void volk_gnsssdr_32f_resamplerxnpuppet_32f_a_sse3(float* result, const float* local_code, unsigned int num_points) { int code_length_chips = 2046; - float code_phase_step_chips = ((float)(code_length_chips) + 0.1 )/( (float) num_points ); + float code_phase_step_chips = ((float)(code_length_chips) + 0.1) / ((float)num_points); int num_out_vectors = 3; float rem_code_phase_chips = -0.234; unsigned int n; - float shifts_chips[3] = { -0.1, 0.0, 0.1 }; + float shifts_chips[3] = {-0.1, 0.0, 0.1}; - float** result_aux = (float**)volk_gnsssdr_malloc(sizeof(float*) * num_out_vectors, volk_gnsssdr_get_alignment()); - for(n = 0; n < num_out_vectors; n++) - { - result_aux[n] = (float*)volk_gnsssdr_malloc(sizeof(float) * num_points, volk_gnsssdr_get_alignment()); - } + float** result_aux = (float**)volk_gnsssdr_malloc(sizeof(float*) * num_out_vectors, volk_gnsssdr_get_alignment()); + for (n = 0; n < num_out_vectors; n++) + { + result_aux[n] = (float*)volk_gnsssdr_malloc(sizeof(float) * num_points, volk_gnsssdr_get_alignment()); + } volk_gnsssdr_32f_xn_resampler_32f_xn_a_sse3(result_aux, local_code, rem_code_phase_chips, code_phase_step_chips, shifts_chips, code_length_chips, num_out_vectors, num_points); memcpy((float*)result, (float*)result_aux[0], sizeof(float) * num_points); - for(n = 0; n < num_out_vectors; n++) - { - volk_gnsssdr_free(result_aux[n]); - } + for (n = 0; n < num_out_vectors; n++) + { + volk_gnsssdr_free(result_aux[n]); + } volk_gnsssdr_free(result_aux); } @@ -106,26 +105,26 @@ static inline void volk_gnsssdr_32f_resamplerxnpuppet_32f_a_sse3(float* result, static inline void volk_gnsssdr_32f_resamplerxnpuppet_32f_u_sse3(float* result, const float* local_code, unsigned int num_points) { int code_length_chips = 2046; - float code_phase_step_chips = ((float)(code_length_chips) + 0.1 )/( (float) num_points ); + float code_phase_step_chips = ((float)(code_length_chips) + 0.1) / ((float)num_points); int num_out_vectors = 3; float rem_code_phase_chips = -0.234; unsigned int n; - float shifts_chips[3] = { -0.1, 0.0, 0.1 }; + float shifts_chips[3] = {-0.1, 0.0, 0.1}; - float** result_aux = (float**)volk_gnsssdr_malloc(sizeof(float*) * num_out_vectors, volk_gnsssdr_get_alignment()); - for(n = 0; n < num_out_vectors; n++) - { - result_aux[n] = (float*)volk_gnsssdr_malloc(sizeof(float) * num_points, volk_gnsssdr_get_alignment()); - } + float** result_aux = (float**)volk_gnsssdr_malloc(sizeof(float*) * num_out_vectors, volk_gnsssdr_get_alignment()); + for (n = 0; n < num_out_vectors; n++) + { + result_aux[n] = (float*)volk_gnsssdr_malloc(sizeof(float) * num_points, volk_gnsssdr_get_alignment()); + } volk_gnsssdr_32f_xn_resampler_32f_xn_u_sse3(result_aux, local_code, rem_code_phase_chips, code_phase_step_chips, shifts_chips, code_length_chips, num_out_vectors, num_points); memcpy((float*)result, (float*)result_aux[0], sizeof(float) * num_points); - for(n = 0; n < num_out_vectors; n++) - { - volk_gnsssdr_free(result_aux[n]); - } + for (n = 0; n < num_out_vectors; n++) + { + volk_gnsssdr_free(result_aux[n]); + } volk_gnsssdr_free(result_aux); } @@ -136,26 +135,26 @@ static inline void volk_gnsssdr_32f_resamplerxnpuppet_32f_u_sse3(float* result, static inline void volk_gnsssdr_32f_resamplerxnpuppet_32f_u_sse4_1(float* result, const float* local_code, unsigned int num_points) { int code_length_chips = 2046; - float code_phase_step_chips = ((float)(code_length_chips) + 0.1 )/( (float) num_points ); + float code_phase_step_chips = ((float)(code_length_chips) + 0.1) / ((float)num_points); int num_out_vectors = 3; float rem_code_phase_chips = -0.234; unsigned int n; - float shifts_chips[3] = { -0.1, 0.0, 0.1 }; + float shifts_chips[3] = {-0.1, 0.0, 0.1}; - float** result_aux = (float**)volk_gnsssdr_malloc(sizeof(float*) * num_out_vectors, volk_gnsssdr_get_alignment()); - for(n = 0; n < num_out_vectors; n++) - { - result_aux[n] = (float*)volk_gnsssdr_malloc(sizeof(float) * num_points, volk_gnsssdr_get_alignment()); - } + float** result_aux = (float**)volk_gnsssdr_malloc(sizeof(float*) * num_out_vectors, volk_gnsssdr_get_alignment()); + for (n = 0; n < num_out_vectors; n++) + { + result_aux[n] = (float*)volk_gnsssdr_malloc(sizeof(float) * num_points, volk_gnsssdr_get_alignment()); + } volk_gnsssdr_32f_xn_resampler_32f_xn_u_sse4_1(result_aux, local_code, rem_code_phase_chips, code_phase_step_chips, shifts_chips, code_length_chips, num_out_vectors, num_points); memcpy((float*)result, (float*)result_aux[0], sizeof(float) * num_points); - for(n = 0; n < num_out_vectors; n++) - { - volk_gnsssdr_free(result_aux[n]); - } + for (n = 0; n < num_out_vectors; n++) + { + volk_gnsssdr_free(result_aux[n]); + } volk_gnsssdr_free(result_aux); } @@ -165,26 +164,26 @@ static inline void volk_gnsssdr_32f_resamplerxnpuppet_32f_u_sse4_1(float* result static inline void volk_gnsssdr_32f_resamplerxnpuppet_32f_a_sse4_1(float* result, const float* local_code, unsigned int num_points) { int code_length_chips = 2046; - float code_phase_step_chips = ((float)(code_length_chips) + 0.1 )/( (float) num_points ); + float code_phase_step_chips = ((float)(code_length_chips) + 0.1) / ((float)num_points); int num_out_vectors = 3; float rem_code_phase_chips = -0.234; unsigned int n; - float shifts_chips[3] = { -0.1, 0.0, 0.1 }; + float shifts_chips[3] = {-0.1, 0.0, 0.1}; - float** result_aux = (float**)volk_gnsssdr_malloc(sizeof(float*) * num_out_vectors, volk_gnsssdr_get_alignment()); - for(n = 0; n < num_out_vectors; n++) - { - result_aux[n] = (float*)volk_gnsssdr_malloc(sizeof(float) * num_points, volk_gnsssdr_get_alignment()); - } + float** result_aux = (float**)volk_gnsssdr_malloc(sizeof(float*) * num_out_vectors, volk_gnsssdr_get_alignment()); + for (n = 0; n < num_out_vectors; n++) + { + result_aux[n] = (float*)volk_gnsssdr_malloc(sizeof(float) * num_points, volk_gnsssdr_get_alignment()); + } volk_gnsssdr_32f_xn_resampler_32f_xn_a_sse4_1(result_aux, local_code, rem_code_phase_chips, code_phase_step_chips, shifts_chips, code_length_chips, num_out_vectors, num_points); memcpy((float*)result, (float*)result_aux[0], sizeof(float) * num_points); - for(n = 0; n < num_out_vectors; n++) - { - volk_gnsssdr_free(result_aux[n]); - } + for (n = 0; n < num_out_vectors; n++) + { + volk_gnsssdr_free(result_aux[n]); + } volk_gnsssdr_free(result_aux); } @@ -194,26 +193,26 @@ static inline void volk_gnsssdr_32f_resamplerxnpuppet_32f_a_sse4_1(float* result static inline void volk_gnsssdr_32f_resamplerxnpuppet_32f_a_avx(float* result, const float* local_code, unsigned int num_points) { int code_length_chips = 2046; - float code_phase_step_chips = ((float)(code_length_chips) + 0.1 )/( (float) num_points ); + float code_phase_step_chips = ((float)(code_length_chips) + 0.1) / ((float)num_points); int num_out_vectors = 3; float rem_code_phase_chips = -0.234; unsigned int n; - float shifts_chips[3] = { -0.1, 0.0, 0.1 }; + float shifts_chips[3] = {-0.1, 0.0, 0.1}; - float** result_aux = (float**)volk_gnsssdr_malloc(sizeof(float*) * num_out_vectors, volk_gnsssdr_get_alignment()); - for(n = 0; n < num_out_vectors; n++) - { - result_aux[n] = (float*)volk_gnsssdr_malloc(sizeof(float) * num_points, volk_gnsssdr_get_alignment()); - } + float** result_aux = (float**)volk_gnsssdr_malloc(sizeof(float*) * num_out_vectors, volk_gnsssdr_get_alignment()); + for (n = 0; n < num_out_vectors; n++) + { + result_aux[n] = (float*)volk_gnsssdr_malloc(sizeof(float) * num_points, volk_gnsssdr_get_alignment()); + } volk_gnsssdr_32f_xn_resampler_32f_xn_a_avx(result_aux, local_code, rem_code_phase_chips, code_phase_step_chips, shifts_chips, code_length_chips, num_out_vectors, num_points); memcpy((float*)result, (float*)result_aux[0], sizeof(float) * num_points); - for(n = 0; n < num_out_vectors; n++) - { - volk_gnsssdr_free(result_aux[n]); - } + for (n = 0; n < num_out_vectors; n++) + { + volk_gnsssdr_free(result_aux[n]); + } volk_gnsssdr_free(result_aux); } #endif @@ -223,26 +222,26 @@ static inline void volk_gnsssdr_32f_resamplerxnpuppet_32f_a_avx(float* result, c static inline void volk_gnsssdr_32f_resamplerxnpuppet_32f_u_avx(float* result, const float* local_code, unsigned int num_points) { int code_length_chips = 2046; - float code_phase_step_chips = ((float)(code_length_chips) + 0.1 )/( (float) num_points ); + float code_phase_step_chips = ((float)(code_length_chips) + 0.1) / ((float)num_points); int num_out_vectors = 3; float rem_code_phase_chips = -0.234; unsigned int n; - float shifts_chips[3] = { -0.1, 0.0, 0.1 }; + float shifts_chips[3] = {-0.1, 0.0, 0.1}; - float** result_aux = (float**)volk_gnsssdr_malloc(sizeof(float*) * num_out_vectors, volk_gnsssdr_get_alignment()); - for(n = 0; n < num_out_vectors; n++) - { - result_aux[n] = (float*)volk_gnsssdr_malloc(sizeof(float) * num_points, volk_gnsssdr_get_alignment()); - } + float** result_aux = (float**)volk_gnsssdr_malloc(sizeof(float*) * num_out_vectors, volk_gnsssdr_get_alignment()); + for (n = 0; n < num_out_vectors; n++) + { + result_aux[n] = (float*)volk_gnsssdr_malloc(sizeof(float) * num_points, volk_gnsssdr_get_alignment()); + } volk_gnsssdr_32f_xn_resampler_32f_xn_u_avx(result_aux, local_code, rem_code_phase_chips, code_phase_step_chips, shifts_chips, code_length_chips, num_out_vectors, num_points); memcpy((float*)result, (float*)result_aux[0], sizeof(float) * num_points); - for(n = 0; n < num_out_vectors; n++) - { - volk_gnsssdr_free(result_aux[n]); - } + for (n = 0; n < num_out_vectors; n++) + { + volk_gnsssdr_free(result_aux[n]); + } volk_gnsssdr_free(result_aux); } #endif @@ -251,29 +250,28 @@ static inline void volk_gnsssdr_32f_resamplerxnpuppet_32f_u_avx(float* result, c static inline void volk_gnsssdr_32f_resamplerxnpuppet_32f_neon(float* result, const float* local_code, unsigned int num_points) { int code_length_chips = 2046; - float code_phase_step_chips = ((float)(code_length_chips) + 0.1 )/( (float) num_points ); + float code_phase_step_chips = ((float)(code_length_chips) + 0.1) / ((float)num_points); int num_out_vectors = 3; float rem_code_phase_chips = -0.234; unsigned int n; - float shifts_chips[3] = { -0.1, 0.0, 0.1 }; + float shifts_chips[3] = {-0.1, 0.0, 0.1}; - float** result_aux = (float**)volk_gnsssdr_malloc(sizeof(float*) * num_out_vectors, volk_gnsssdr_get_alignment()); - for(n = 0; n < num_out_vectors; n++) - { - result_aux[n] = (float*)volk_gnsssdr_malloc(sizeof(float) * num_points, volk_gnsssdr_get_alignment()); - } + float** result_aux = (float**)volk_gnsssdr_malloc(sizeof(float*) * num_out_vectors, volk_gnsssdr_get_alignment()); + for (n = 0; n < num_out_vectors; n++) + { + result_aux[n] = (float*)volk_gnsssdr_malloc(sizeof(float) * num_points, volk_gnsssdr_get_alignment()); + } volk_gnsssdr_32f_xn_resampler_32f_xn_neon(result_aux, local_code, rem_code_phase_chips, code_phase_step_chips, shifts_chips, code_length_chips, num_out_vectors, num_points); memcpy((float*)result, (float*)result_aux[0], sizeof(float) * num_points); - for(n = 0; n < num_out_vectors; n++) - { - volk_gnsssdr_free(result_aux[n]); - } + for (n = 0; n < num_out_vectors; n++) + { + volk_gnsssdr_free(result_aux[n]); + } volk_gnsssdr_free(result_aux); } #endif -#endif // INCLUDED_volk_gnsssdr_32f_resamplerpuppet_32f_H - +#endif // INCLUDED_volk_gnsssdr_32f_resamplerpuppet_32f_H diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32f_sincos_32fc.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32f_sincos_32fc.h index 5568976e8..b067c5f3d 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32f_sincos_32fc.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32f_sincos_32fc.h @@ -97,7 +97,7 @@ static inline void volk_gnsssdr_32f_sincos_32fc_u_sse4_1(lv_32fc_t* out, const f cp4 = _mm_set1_ps(0.49603e-4); cp5 = _mm_set1_ps(0.551e-6); - for(;number < quarterPoints; number++) + for (; number < quarterPoints; number++) { aVal = _mm_loadu_ps(aPtr); __VOLK_GNSSSDR_PREFETCH(aPtr + 8); @@ -108,12 +108,12 @@ static inline void volk_gnsssdr_32f_sincos_32fc_u_sse4_1(lv_32fc_t* out, const f s = _mm_sub_ps(s, _mm_mul_ps(_mm_cvtepi32_ps(r), pio4A)); s = _mm_sub_ps(s, _mm_mul_ps(_mm_cvtepi32_ps(r), pio4B)); - s = _mm_div_ps(s, _mm_set1_ps(8.0)); // The constant is 2^N, for 3 times argument reduction + s = _mm_div_ps(s, _mm_set1_ps(8.0)); // The constant is 2^N, for 3 times argument reduction s = _mm_mul_ps(s, s); // Evaluate Taylor series s = _mm_mul_ps(_mm_add_ps(_mm_mul_ps(_mm_sub_ps(_mm_mul_ps(_mm_add_ps(_mm_mul_ps(_mm_sub_ps(_mm_mul_ps(s, cp5), cp4), s), cp3), s), cp2), s), cp1), s); - for(i = 0; i < 3; i++) + for (i = 0; i < 3; i++) { s = _mm_mul_ps(s, _mm_sub_ps(ffours, s)); } @@ -145,7 +145,7 @@ static inline void volk_gnsssdr_32f_sincos_32fc_u_sse4_1(lv_32fc_t* out, const f } number = quarterPoints * 4; - for(;number < num_points; number++) + for (; number < num_points; number++) { float _in = *aPtr++; *bPtr++ = lv_cmake(cosf(_in), sinf(_in)); @@ -191,7 +191,7 @@ static inline void volk_gnsssdr_32f_sincos_32fc_a_sse4_1(lv_32fc_t* out, const f cp4 = _mm_set1_ps(0.49603e-4); cp5 = _mm_set1_ps(0.551e-6); - for(;number < quarterPoints; number++) + for (; number < quarterPoints; number++) { aVal = _mm_load_ps(aPtr); __VOLK_GNSSSDR_PREFETCH(aPtr + 8); @@ -202,12 +202,12 @@ static inline void volk_gnsssdr_32f_sincos_32fc_a_sse4_1(lv_32fc_t* out, const f s = _mm_sub_ps(s, _mm_mul_ps(_mm_cvtepi32_ps(r), pio4A)); s = _mm_sub_ps(s, _mm_mul_ps(_mm_cvtepi32_ps(r), pio4B)); - s = _mm_div_ps(s, _mm_set1_ps(8.0)); // The constant is 2^N, for 3 times argument reduction + s = _mm_div_ps(s, _mm_set1_ps(8.0)); // The constant is 2^N, for 3 times argument reduction s = _mm_mul_ps(s, s); // Evaluate Taylor series s = _mm_mul_ps(_mm_add_ps(_mm_mul_ps(_mm_sub_ps(_mm_mul_ps(_mm_add_ps(_mm_mul_ps(_mm_sub_ps(_mm_mul_ps(s, cp5), cp4), s), cp3), s), cp2), s), cp1), s); - for(i = 0; i < 3; i++) + for (i = 0; i < 3; i++) { s = _mm_mul_ps(s, _mm_sub_ps(ffours, s)); } @@ -239,7 +239,7 @@ static inline void volk_gnsssdr_32f_sincos_32fc_a_sse4_1(lv_32fc_t* out, const f } number = quarterPoints * 4; - for(;number < num_points; number++) + for (; number < num_points; number++) { float _in = *aPtr++; *bPtr++ = lv_cmake(cosf(_in), sinf(_in)); @@ -265,31 +265,49 @@ static inline void volk_gnsssdr_32f_sincos_32fc_a_sse2(lv_32fc_t* out, const flo __m128 sine, cosine, aux, x; __m128 xmm1, xmm2, xmm3 = _mm_setzero_ps(), sign_bit_sin, y; - __m128i emm0, emm2, emm4; + __m128i emm0, emm2, emm4; /* declare some SSE constants */ - __VOLK_ATTR_ALIGNED(16) static const int _ps_inv_sign_mask[4] = { ~0x80000000, ~0x80000000, ~0x80000000, ~0x80000000 }; - __VOLK_ATTR_ALIGNED(16) static const int _ps_sign_mask[4] = { (int)0x80000000, (int)0x80000000, (int)0x80000000, (int)0x80000000 }; + __VOLK_ATTR_ALIGNED(16) + static const int _ps_inv_sign_mask[4] = {~0x80000000, ~0x80000000, ~0x80000000, ~0x80000000}; + __VOLK_ATTR_ALIGNED(16) + static const int _ps_sign_mask[4] = {(int)0x80000000, (int)0x80000000, (int)0x80000000, (int)0x80000000}; - __VOLK_ATTR_ALIGNED(16) static const float _ps_cephes_FOPI[4] = { 1.27323954473516, 1.27323954473516, 1.27323954473516, 1.27323954473516 }; - __VOLK_ATTR_ALIGNED(16) static const int _pi32_1[4] = { 1, 1, 1, 1 }; - __VOLK_ATTR_ALIGNED(16) static const int _pi32_inv1[4] = { ~1, ~1, ~1, ~1 }; - __VOLK_ATTR_ALIGNED(16) static const int _pi32_2[4] = { 2, 2, 2, 2}; - __VOLK_ATTR_ALIGNED(16) static const int _pi32_4[4] = { 4, 4, 4, 4}; + __VOLK_ATTR_ALIGNED(16) + static const float _ps_cephes_FOPI[4] = {1.27323954473516, 1.27323954473516, 1.27323954473516, 1.27323954473516}; + __VOLK_ATTR_ALIGNED(16) + static const int _pi32_1[4] = {1, 1, 1, 1}; + __VOLK_ATTR_ALIGNED(16) + static const int _pi32_inv1[4] = {~1, ~1, ~1, ~1}; + __VOLK_ATTR_ALIGNED(16) + static const int _pi32_2[4] = {2, 2, 2, 2}; + __VOLK_ATTR_ALIGNED(16) + static const int _pi32_4[4] = {4, 4, 4, 4}; - __VOLK_ATTR_ALIGNED(16) static const float _ps_minus_cephes_DP1[4] = { -0.78515625, -0.78515625, -0.78515625, -0.78515625 }; - __VOLK_ATTR_ALIGNED(16) static const float _ps_minus_cephes_DP2[4] = { -2.4187564849853515625e-4, -2.4187564849853515625e-4, -2.4187564849853515625e-4, -2.4187564849853515625e-4 }; - __VOLK_ATTR_ALIGNED(16) static const float _ps_minus_cephes_DP3[4] = { -3.77489497744594108e-8, -3.77489497744594108e-8, -3.77489497744594108e-8, -3.77489497744594108e-8 }; - __VOLK_ATTR_ALIGNED(16) static const float _ps_coscof_p0[4] = { 2.443315711809948E-005, 2.443315711809948E-005, 2.443315711809948E-005, 2.443315711809948E-005 }; - __VOLK_ATTR_ALIGNED(16) static const float _ps_coscof_p1[4] = { -1.388731625493765E-003, -1.388731625493765E-003, -1.388731625493765E-003, -1.388731625493765E-003 }; - __VOLK_ATTR_ALIGNED(16) static const float _ps_coscof_p2[4] = { 4.166664568298827E-002, 4.166664568298827E-002, 4.166664568298827E-002, 4.166664568298827E-002 }; - __VOLK_ATTR_ALIGNED(16) static const float _ps_sincof_p0[4] = { -1.9515295891E-4, -1.9515295891E-4, -1.9515295891E-4, -1.9515295891E-4 }; - __VOLK_ATTR_ALIGNED(16) static const float _ps_sincof_p1[4] = { 8.3321608736E-3, 8.3321608736E-3, 8.3321608736E-3, 8.3321608736E-3 }; - __VOLK_ATTR_ALIGNED(16) static const float _ps_sincof_p2[4] = { -1.6666654611E-1, -1.6666654611E-1, -1.6666654611E-1, -1.6666654611E-1 }; - __VOLK_ATTR_ALIGNED(16) static const float _ps_0p5[4] = { 0.5f, 0.5f, 0.5f, 0.5f }; - __VOLK_ATTR_ALIGNED(16) static const float _ps_1[4] = { 1.0f, 1.0f, 1.0f, 1.0f }; + __VOLK_ATTR_ALIGNED(16) + static const float _ps_minus_cephes_DP1[4] = {-0.78515625, -0.78515625, -0.78515625, -0.78515625}; + __VOLK_ATTR_ALIGNED(16) + static const float _ps_minus_cephes_DP2[4] = {-2.4187564849853515625e-4, -2.4187564849853515625e-4, -2.4187564849853515625e-4, -2.4187564849853515625e-4}; + __VOLK_ATTR_ALIGNED(16) + static const float _ps_minus_cephes_DP3[4] = {-3.77489497744594108e-8, -3.77489497744594108e-8, -3.77489497744594108e-8, -3.77489497744594108e-8}; + __VOLK_ATTR_ALIGNED(16) + static const float _ps_coscof_p0[4] = {2.443315711809948E-005, 2.443315711809948E-005, 2.443315711809948E-005, 2.443315711809948E-005}; + __VOLK_ATTR_ALIGNED(16) + static const float _ps_coscof_p1[4] = {-1.388731625493765E-003, -1.388731625493765E-003, -1.388731625493765E-003, -1.388731625493765E-003}; + __VOLK_ATTR_ALIGNED(16) + static const float _ps_coscof_p2[4] = {4.166664568298827E-002, 4.166664568298827E-002, 4.166664568298827E-002, 4.166664568298827E-002}; + __VOLK_ATTR_ALIGNED(16) + static const float _ps_sincof_p0[4] = {-1.9515295891E-4, -1.9515295891E-4, -1.9515295891E-4, -1.9515295891E-4}; + __VOLK_ATTR_ALIGNED(16) + static const float _ps_sincof_p1[4] = {8.3321608736E-3, 8.3321608736E-3, 8.3321608736E-3, 8.3321608736E-3}; + __VOLK_ATTR_ALIGNED(16) + static const float _ps_sincof_p2[4] = {-1.6666654611E-1, -1.6666654611E-1, -1.6666654611E-1, -1.6666654611E-1}; + __VOLK_ATTR_ALIGNED(16) + static const float _ps_0p5[4] = {0.5f, 0.5f, 0.5f, 0.5f}; + __VOLK_ATTR_ALIGNED(16) + static const float _ps_1[4] = {1.0f, 1.0f, 1.0f, 1.0f}; - for(;number < sse_iters; number++) + for (; number < sse_iters; number++) { x = _mm_load_ps(aPtr); __VOLK_GNSSSDR_PREFETCH(aPtr + 8); @@ -307,19 +325,19 @@ static inline void volk_gnsssdr_32f_sincos_32fc_a_sse2(lv_32fc_t* out, const flo emm2 = _mm_cvttps_epi32(y); /* j=(j+1) & (~1) (see the cephes sources) */ - emm2 = _mm_add_epi32(emm2, *(__m128i *)_pi32_1); - emm2 = _mm_and_si128(emm2, *(__m128i *)_pi32_inv1); + emm2 = _mm_add_epi32(emm2, *(__m128i*)_pi32_1); + emm2 = _mm_and_si128(emm2, *(__m128i*)_pi32_inv1); y = _mm_cvtepi32_ps(emm2); emm4 = emm2; /* get the swap sign flag for the sine */ - emm0 = _mm_and_si128(emm2, *(__m128i *)_pi32_4); + emm0 = _mm_and_si128(emm2, *(__m128i*)_pi32_4); emm0 = _mm_slli_epi32(emm0, 29); __m128 swap_sign_bit_sin = _mm_castsi128_ps(emm0); /* get the polynom selection mask for the sine*/ - emm2 = _mm_and_si128(emm2, *(__m128i *)_pi32_2); + emm2 = _mm_and_si128(emm2, *(__m128i*)_pi32_2); emm2 = _mm_cmpeq_epi32(emm2, _mm_setzero_si128()); __m128 poly_mask = _mm_castsi128_ps(emm2); @@ -335,15 +353,15 @@ static inline void volk_gnsssdr_32f_sincos_32fc_a_sse2(lv_32fc_t* out, const flo x = _mm_add_ps(x, xmm2); x = _mm_add_ps(x, xmm3); - emm4 = _mm_sub_epi32(emm4, *(__m128i *)_pi32_2); - emm4 = _mm_andnot_si128(emm4, *(__m128i *)_pi32_4); + emm4 = _mm_sub_epi32(emm4, *(__m128i*)_pi32_2); + emm4 = _mm_andnot_si128(emm4, *(__m128i*)_pi32_4); emm4 = _mm_slli_epi32(emm4, 29); __m128 sign_bit_cos = _mm_castsi128_ps(emm4); sign_bit_sin = _mm_xor_ps(sign_bit_sin, swap_sign_bit_sin); /* Evaluate the first polynom (0 <= x <= Pi/4) */ - __m128 z = _mm_mul_ps(x,x); + __m128 z = _mm_mul_ps(x, x); y = *(__m128*)_ps_coscof_p0; y = _mm_mul_ps(y, z); @@ -371,11 +389,11 @@ static inline void volk_gnsssdr_32f_sincos_32fc_a_sse2(lv_32fc_t* out, const flo xmm3 = poly_mask; __m128 ysin2 = _mm_and_ps(xmm3, y2); __m128 ysin1 = _mm_andnot_ps(xmm3, y); - y2 = _mm_sub_ps(y2,ysin2); + y2 = _mm_sub_ps(y2, ysin2); y = _mm_sub_ps(y, ysin1); - xmm1 = _mm_add_ps(ysin1,ysin2); - xmm2 = _mm_add_ps(y,y2); + xmm1 = _mm_add_ps(ysin1, ysin2); + xmm2 = _mm_add_ps(y, y2); /* update the sign */ sine = _mm_xor_ps(xmm1, sign_bit_sin); @@ -392,12 +410,11 @@ static inline void volk_gnsssdr_32f_sincos_32fc_a_sse2(lv_32fc_t* out, const flo aPtr += 4; } - for(number = sse_iters * 4; number < num_points; number++) + for (number = sse_iters * 4; number < num_points; number++) { _in = *aPtr++; - *bPtr++ = lv_cmake((float)cosf(_in), (float)sinf(_in) ); + *bPtr++ = lv_cmake((float)cosf(_in), (float)sinf(_in)); } - } #endif /* LV_HAVE_SSE2 */ @@ -418,31 +435,49 @@ static inline void volk_gnsssdr_32f_sincos_32fc_u_sse2(lv_32fc_t* out, const flo __m128 sine, cosine, aux, x; __m128 xmm1, xmm2, xmm3 = _mm_setzero_ps(), sign_bit_sin, y; - __m128i emm0, emm2, emm4; + __m128i emm0, emm2, emm4; /* declare some SSE constants */ - __VOLK_ATTR_ALIGNED(16) static const int _ps_inv_sign_mask[4] = { ~0x80000000, ~0x80000000, ~0x80000000, ~0x80000000 }; - __VOLK_ATTR_ALIGNED(16) static const int _ps_sign_mask[4] = { (int)0x80000000, (int)0x80000000, (int)0x80000000, (int)0x80000000 }; + __VOLK_ATTR_ALIGNED(16) + static const int _ps_inv_sign_mask[4] = {~0x80000000, ~0x80000000, ~0x80000000, ~0x80000000}; + __VOLK_ATTR_ALIGNED(16) + static const int _ps_sign_mask[4] = {(int)0x80000000, (int)0x80000000, (int)0x80000000, (int)0x80000000}; - __VOLK_ATTR_ALIGNED(16) static const float _ps_cephes_FOPI[4] = { 1.27323954473516, 1.27323954473516, 1.27323954473516, 1.27323954473516 }; - __VOLK_ATTR_ALIGNED(16) static const int _pi32_1[4] = { 1, 1, 1, 1 }; - __VOLK_ATTR_ALIGNED(16) static const int _pi32_inv1[4] = { ~1, ~1, ~1, ~1 }; - __VOLK_ATTR_ALIGNED(16) static const int _pi32_2[4] = { 2, 2, 2, 2}; - __VOLK_ATTR_ALIGNED(16) static const int _pi32_4[4] = { 4, 4, 4, 4}; + __VOLK_ATTR_ALIGNED(16) + static const float _ps_cephes_FOPI[4] = {1.27323954473516, 1.27323954473516, 1.27323954473516, 1.27323954473516}; + __VOLK_ATTR_ALIGNED(16) + static const int _pi32_1[4] = {1, 1, 1, 1}; + __VOLK_ATTR_ALIGNED(16) + static const int _pi32_inv1[4] = {~1, ~1, ~1, ~1}; + __VOLK_ATTR_ALIGNED(16) + static const int _pi32_2[4] = {2, 2, 2, 2}; + __VOLK_ATTR_ALIGNED(16) + static const int _pi32_4[4] = {4, 4, 4, 4}; - __VOLK_ATTR_ALIGNED(16) static const float _ps_minus_cephes_DP1[4] = { -0.78515625, -0.78515625, -0.78515625, -0.78515625 }; - __VOLK_ATTR_ALIGNED(16) static const float _ps_minus_cephes_DP2[4] = { -2.4187564849853515625e-4, -2.4187564849853515625e-4, -2.4187564849853515625e-4, -2.4187564849853515625e-4 }; - __VOLK_ATTR_ALIGNED(16) static const float _ps_minus_cephes_DP3[4] = { -3.77489497744594108e-8, -3.77489497744594108e-8, -3.77489497744594108e-8, -3.77489497744594108e-8 }; - __VOLK_ATTR_ALIGNED(16) static const float _ps_coscof_p0[4] = { 2.443315711809948E-005, 2.443315711809948E-005, 2.443315711809948E-005, 2.443315711809948E-005 }; - __VOLK_ATTR_ALIGNED(16) static const float _ps_coscof_p1[4] = { -1.388731625493765E-003, -1.388731625493765E-003, -1.388731625493765E-003, -1.388731625493765E-003 }; - __VOLK_ATTR_ALIGNED(16) static const float _ps_coscof_p2[4] = { 4.166664568298827E-002, 4.166664568298827E-002, 4.166664568298827E-002, 4.166664568298827E-002 }; - __VOLK_ATTR_ALIGNED(16) static const float _ps_sincof_p0[4] = { -1.9515295891E-4, -1.9515295891E-4, -1.9515295891E-4, -1.9515295891E-4 }; - __VOLK_ATTR_ALIGNED(16) static const float _ps_sincof_p1[4] = { 8.3321608736E-3, 8.3321608736E-3, 8.3321608736E-3, 8.3321608736E-3 }; - __VOLK_ATTR_ALIGNED(16) static const float _ps_sincof_p2[4] = { -1.6666654611E-1, -1.6666654611E-1, -1.6666654611E-1, -1.6666654611E-1 }; - __VOLK_ATTR_ALIGNED(16) static const float _ps_0p5[4] = { 0.5f, 0.5f, 0.5f, 0.5f }; - __VOLK_ATTR_ALIGNED(16) static const float _ps_1[4] = { 1.0f, 1.0f, 1.0f, 1.0f }; + __VOLK_ATTR_ALIGNED(16) + static const float _ps_minus_cephes_DP1[4] = {-0.78515625, -0.78515625, -0.78515625, -0.78515625}; + __VOLK_ATTR_ALIGNED(16) + static const float _ps_minus_cephes_DP2[4] = {-2.4187564849853515625e-4, -2.4187564849853515625e-4, -2.4187564849853515625e-4, -2.4187564849853515625e-4}; + __VOLK_ATTR_ALIGNED(16) + static const float _ps_minus_cephes_DP3[4] = {-3.77489497744594108e-8, -3.77489497744594108e-8, -3.77489497744594108e-8, -3.77489497744594108e-8}; + __VOLK_ATTR_ALIGNED(16) + static const float _ps_coscof_p0[4] = {2.443315711809948E-005, 2.443315711809948E-005, 2.443315711809948E-005, 2.443315711809948E-005}; + __VOLK_ATTR_ALIGNED(16) + static const float _ps_coscof_p1[4] = {-1.388731625493765E-003, -1.388731625493765E-003, -1.388731625493765E-003, -1.388731625493765E-003}; + __VOLK_ATTR_ALIGNED(16) + static const float _ps_coscof_p2[4] = {4.166664568298827E-002, 4.166664568298827E-002, 4.166664568298827E-002, 4.166664568298827E-002}; + __VOLK_ATTR_ALIGNED(16) + static const float _ps_sincof_p0[4] = {-1.9515295891E-4, -1.9515295891E-4, -1.9515295891E-4, -1.9515295891E-4}; + __VOLK_ATTR_ALIGNED(16) + static const float _ps_sincof_p1[4] = {8.3321608736E-3, 8.3321608736E-3, 8.3321608736E-3, 8.3321608736E-3}; + __VOLK_ATTR_ALIGNED(16) + static const float _ps_sincof_p2[4] = {-1.6666654611E-1, -1.6666654611E-1, -1.6666654611E-1, -1.6666654611E-1}; + __VOLK_ATTR_ALIGNED(16) + static const float _ps_0p5[4] = {0.5f, 0.5f, 0.5f, 0.5f}; + __VOLK_ATTR_ALIGNED(16) + static const float _ps_1[4] = {1.0f, 1.0f, 1.0f, 1.0f}; - for(;number < sse_iters; number++) + for (; number < sse_iters; number++) { x = _mm_loadu_ps(aPtr); __VOLK_GNSSSDR_PREFETCH(aPtr + 8); @@ -460,19 +495,19 @@ static inline void volk_gnsssdr_32f_sincos_32fc_u_sse2(lv_32fc_t* out, const flo emm2 = _mm_cvttps_epi32(y); /* j=(j+1) & (~1) (see the cephes sources) */ - emm2 = _mm_add_epi32(emm2, *(__m128i *)_pi32_1); - emm2 = _mm_and_si128(emm2, *(__m128i *)_pi32_inv1); + emm2 = _mm_add_epi32(emm2, *(__m128i*)_pi32_1); + emm2 = _mm_and_si128(emm2, *(__m128i*)_pi32_inv1); y = _mm_cvtepi32_ps(emm2); emm4 = emm2; /* get the swap sign flag for the sine */ - emm0 = _mm_and_si128(emm2, *(__m128i *)_pi32_4); + emm0 = _mm_and_si128(emm2, *(__m128i*)_pi32_4); emm0 = _mm_slli_epi32(emm0, 29); __m128 swap_sign_bit_sin = _mm_castsi128_ps(emm0); /* get the polynom selection mask for the sine*/ - emm2 = _mm_and_si128(emm2, *(__m128i *)_pi32_2); + emm2 = _mm_and_si128(emm2, *(__m128i*)_pi32_2); emm2 = _mm_cmpeq_epi32(emm2, _mm_setzero_si128()); __m128 poly_mask = _mm_castsi128_ps(emm2); @@ -488,15 +523,15 @@ static inline void volk_gnsssdr_32f_sincos_32fc_u_sse2(lv_32fc_t* out, const flo x = _mm_add_ps(x, xmm2); x = _mm_add_ps(x, xmm3); - emm4 = _mm_sub_epi32(emm4, *(__m128i *)_pi32_2); - emm4 = _mm_andnot_si128(emm4, *(__m128i *)_pi32_4); + emm4 = _mm_sub_epi32(emm4, *(__m128i*)_pi32_2); + emm4 = _mm_andnot_si128(emm4, *(__m128i*)_pi32_4); emm4 = _mm_slli_epi32(emm4, 29); __m128 sign_bit_cos = _mm_castsi128_ps(emm4); sign_bit_sin = _mm_xor_ps(sign_bit_sin, swap_sign_bit_sin); /* Evaluate the first polynom (0 <= x <= Pi/4) */ - __m128 z = _mm_mul_ps(x,x); + __m128 z = _mm_mul_ps(x, x); y = *(__m128*)_ps_coscof_p0; y = _mm_mul_ps(y, z); @@ -524,11 +559,11 @@ static inline void volk_gnsssdr_32f_sincos_32fc_u_sse2(lv_32fc_t* out, const flo xmm3 = poly_mask; __m128 ysin2 = _mm_and_ps(xmm3, y2); __m128 ysin1 = _mm_andnot_ps(xmm3, y); - y2 = _mm_sub_ps(y2,ysin2); + y2 = _mm_sub_ps(y2, ysin2); y = _mm_sub_ps(y, ysin1); - xmm1 = _mm_add_ps(ysin1,ysin2); - xmm2 = _mm_add_ps(y,y2); + xmm1 = _mm_add_ps(ysin1, ysin2); + xmm2 = _mm_add_ps(y, y2); /* update the sign */ sine = _mm_xor_ps(xmm1, sign_bit_sin); @@ -545,12 +580,11 @@ static inline void volk_gnsssdr_32f_sincos_32fc_u_sse2(lv_32fc_t* out, const flo aPtr += 4; } - for(number = sse_iters * 4; number < num_points; number++) + for (number = sse_iters * 4; number < num_points; number++) { _in = *aPtr++; - *bPtr++ = lv_cmake((float)cosf(_in), (float)sinf(_in) ); + *bPtr++ = lv_cmake((float)cosf(_in), (float)sinf(_in)); } - } #endif /* LV_HAVE_SSE2 */ @@ -561,10 +595,10 @@ static inline void volk_gnsssdr_32f_sincos_32fc_generic(lv_32fc_t* out, const fl { float _in; unsigned int i; - for(i = 0; i < num_points; i++) + for (i = 0; i < num_points; i++) { _in = *in++; - *out++ = lv_cmake((float)cosf(_in), (float)sinf(_in) ); + *out++ = lv_cmake((float)cosf(_in), (float)sinf(_in)); } } @@ -586,12 +620,12 @@ static inline void volk_gnsssdr_32f_sincos_32fc_generic_fxpt(lv_32fc_t* out, con const int32_t diffbits = bitlength - Nbits; uint32_t ux; unsigned int i; - for(i = 0; i < num_points; i++) + for (i = 0; i < num_points; i++) { _in = *in++; d = (int32_t)floor(_in / TWO_PI + 0.5); _in -= d * TWO_PI; - x = (int32_t) ((float)_in * TWO_TO_THE_31_DIV_PI); + x = (int32_t)((float)_in * TWO_TO_THE_31_DIV_PI); ux = x; sin_index = ux >> diffbits; @@ -601,7 +635,7 @@ static inline void volk_gnsssdr_32f_sincos_32fc_generic_fxpt(lv_32fc_t* out, con cos_index = ux >> diffbits; c = sine_table_10bits[cos_index][0] * (ux >> 1) + sine_table_10bits[cos_index][1]; - *out++ = lv_cmake((float)c, (float)s ); + *out++ = lv_cmake((float)c, (float)s); } } @@ -637,7 +671,7 @@ static inline void volk_gnsssdr_32f_sincos_32fc_neon(lv_32fc_t* out, const float uint32x4_t emm2, poly_mask, sign_mask_sin, sign_mask_cos; - for(;number < neon_iters; number++) + for (; number < neon_iters; number++) { x = vld1q_f32(aPtr); __VOLK_GNSSSDR_PREFETCH(aPtr + 8); @@ -677,7 +711,7 @@ static inline void volk_gnsssdr_32f_sincos_32fc_neon(lv_32fc_t* out, const float /* Evaluate the first polynom (0 <= x <= Pi/4) in y1, and the second polynom (Pi/4 <= x <= 0) in y2 */ - z = vmulq_f32(x,x); + z = vmulq_f32(x, x); y1 = vmulq_n_f32(z, c_coscof_p0); y2 = vmulq_n_f32(z, c_sincof_p0); @@ -706,10 +740,10 @@ static inline void volk_gnsssdr_32f_sincos_32fc_neon(lv_32fc_t* out, const float aPtr += 4; } - for(number = neon_iters * 4; number < num_points; number++) + for (number = neon_iters * 4; number < num_points; number++) { _in = *aPtr++; - *bPtr++ = lv_cmake((float)cosf(_in), (float)sinf(_in) ); + *bPtr++ = lv_cmake((float)cosf(_in), (float)sinf(_in)); } } diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32f_xn_resampler_32f_xn.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32f_xn_resampler_32f_xn.h index 1fa95e0e6..f130032ea 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32f_xn_resampler_32f_xn.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32f_xn_resampler_32f_xn.h @@ -110,7 +110,8 @@ static inline void volk_gnsssdr_32f_xn_resampler_32f_xn_a_sse3(float** result, c const __m128 rem_code_phase_chips_reg = _mm_set_ps1(rem_code_phase_chips); const __m128 code_phase_step_chips_reg = _mm_set_ps1(code_phase_step_chips); - __VOLK_ATTR_ALIGNED(16) int local_code_chip_index[4]; + __VOLK_ATTR_ALIGNED(16) + int local_code_chip_index[4]; int local_code_chip_index_; const __m128i zeros = _mm_setzero_si128(); @@ -124,7 +125,7 @@ static inline void volk_gnsssdr_32f_xn_resampler_32f_xn_a_sse3(float** result, c shifts_chips_reg = _mm_set_ps1((float)shifts_chips[current_correlator_tap]); aux2 = _mm_sub_ps(shifts_chips_reg, rem_code_phase_chips_reg); __m128 indexn = _mm_set_ps(3.0f, 2.0f, 1.0f, 0.0f); - for(n = 0; n < quarterPoints; n++) + for (n = 0; n < quarterPoints; n++) { aux = _mm_mul_ps(code_phase_step_chips_reg, indexn); aux = _mm_add_ps(aux, aux2); @@ -145,25 +146,25 @@ static inline void volk_gnsssdr_32f_xn_resampler_32f_xn_a_sse3(float** result, c aux_i = _mm_and_si128(code_length_chips_reg_i, negatives); local_code_chip_index_reg = _mm_add_epi32(local_code_chip_index_reg, aux_i); _mm_store_si128((__m128i*)local_code_chip_index, local_code_chip_index_reg); - for(k = 0; k < 4; ++k) + for (k = 0; k < 4; ++k) { _result[current_correlator_tap][n * 4 + k] = local_code[local_code_chip_index[k]]; } indexn = _mm_add_ps(indexn, fours); } - for(n = quarterPoints * 4; n < num_points; n++) + for (n = quarterPoints * 4; n < num_points; n++) { // resample code for current tap local_code_chip_index_ = (int)floor(code_phase_step_chips * (float)n + shifts_chips[current_correlator_tap] - rem_code_phase_chips); //Take into account that in multitap correlators, the shifts can be negative! - if (local_code_chip_index_ < 0) local_code_chip_index_ += (int)code_length_chips * (abs(local_code_chip_index_) / code_length_chips + 1) ; + if (local_code_chip_index_ < 0) local_code_chip_index_ += (int)code_length_chips * (abs(local_code_chip_index_) / code_length_chips + 1); local_code_chip_index_ = local_code_chip_index_ % code_length_chips; _result[current_correlator_tap][n] = local_code[local_code_chip_index_]; } } } -#endif +#endif #ifdef LV_HAVE_SSE3 @@ -180,7 +181,8 @@ static inline void volk_gnsssdr_32f_xn_resampler_32f_xn_u_sse3(float** result, c const __m128 rem_code_phase_chips_reg = _mm_set_ps1(rem_code_phase_chips); const __m128 code_phase_step_chips_reg = _mm_set_ps1(code_phase_step_chips); - __VOLK_ATTR_ALIGNED(16) int local_code_chip_index[4]; + __VOLK_ATTR_ALIGNED(16) + int local_code_chip_index[4]; int local_code_chip_index_; const __m128i zeros = _mm_setzero_si128(); @@ -194,7 +196,7 @@ static inline void volk_gnsssdr_32f_xn_resampler_32f_xn_u_sse3(float** result, c shifts_chips_reg = _mm_set_ps1((float)shifts_chips[current_correlator_tap]); aux2 = _mm_sub_ps(shifts_chips_reg, rem_code_phase_chips_reg); __m128 indexn = _mm_set_ps(3.0f, 2.0f, 1.0f, 0.0f); - for(n = 0; n < quarterPoints; n++) + for (n = 0; n < quarterPoints; n++) { aux = _mm_mul_ps(code_phase_step_chips_reg, indexn); aux = _mm_add_ps(aux, aux2); @@ -215,18 +217,18 @@ static inline void volk_gnsssdr_32f_xn_resampler_32f_xn_u_sse3(float** result, c aux_i = _mm_and_si128(code_length_chips_reg_i, negatives); local_code_chip_index_reg = _mm_add_epi32(local_code_chip_index_reg, aux_i); _mm_store_si128((__m128i*)local_code_chip_index, local_code_chip_index_reg); - for(k = 0; k < 4; ++k) + for (k = 0; k < 4; ++k) { _result[current_correlator_tap][n * 4 + k] = local_code[local_code_chip_index[k]]; } indexn = _mm_add_ps(indexn, fours); } - for(n = quarterPoints * 4; n < num_points; n++) + for (n = quarterPoints * 4; n < num_points; n++) { // resample code for current tap local_code_chip_index_ = (int)floor(code_phase_step_chips * (float)n + shifts_chips[current_correlator_tap] - rem_code_phase_chips); //Take into account that in multitap correlators, the shifts can be negative! - if (local_code_chip_index_ < 0) local_code_chip_index_ += (int)code_length_chips * (abs(local_code_chip_index_) / code_length_chips + 1) ; + if (local_code_chip_index_ < 0) local_code_chip_index_ += (int)code_length_chips * (abs(local_code_chip_index_) / code_length_chips + 1); local_code_chip_index_ = local_code_chip_index_ % code_length_chips; _result[current_correlator_tap][n] = local_code[local_code_chip_index_]; } @@ -248,7 +250,8 @@ static inline void volk_gnsssdr_32f_xn_resampler_32f_xn_a_sse4_1(float** result, const __m128 rem_code_phase_chips_reg = _mm_set_ps1(rem_code_phase_chips); const __m128 code_phase_step_chips_reg = _mm_set_ps1(code_phase_step_chips); - __VOLK_ATTR_ALIGNED(16) int local_code_chip_index[4]; + __VOLK_ATTR_ALIGNED(16) + int local_code_chip_index[4]; int local_code_chip_index_; const __m128i zeros = _mm_setzero_si128(); @@ -262,7 +265,7 @@ static inline void volk_gnsssdr_32f_xn_resampler_32f_xn_a_sse4_1(float** result, shifts_chips_reg = _mm_set_ps1((float)shifts_chips[current_correlator_tap]); aux2 = _mm_sub_ps(shifts_chips_reg, rem_code_phase_chips_reg); __m128 indexn = _mm_set_ps(3.0f, 2.0f, 1.0f, 0.0f); - for(n = 0; n < quarterPoints; n++) + for (n = 0; n < quarterPoints; n++) { aux = _mm_mul_ps(code_phase_step_chips_reg, indexn); aux = _mm_add_ps(aux, aux2); @@ -280,25 +283,25 @@ static inline void volk_gnsssdr_32f_xn_resampler_32f_xn_a_sse4_1(float** result, aux_i = _mm_and_si128(code_length_chips_reg_i, negatives); local_code_chip_index_reg = _mm_add_epi32(local_code_chip_index_reg, aux_i); _mm_store_si128((__m128i*)local_code_chip_index, local_code_chip_index_reg); - for(k = 0; k < 4; ++k) + for (k = 0; k < 4; ++k) { _result[current_correlator_tap][n * 4 + k] = local_code[local_code_chip_index[k]]; } indexn = _mm_add_ps(indexn, fours); } - for(n = quarterPoints * 4; n < num_points; n++) + for (n = quarterPoints * 4; n < num_points; n++) { // resample code for current tap local_code_chip_index_ = (int)floor(code_phase_step_chips * (float)n + shifts_chips[current_correlator_tap] - rem_code_phase_chips); //Take into account that in multitap correlators, the shifts can be negative! - if (local_code_chip_index_ < 0) local_code_chip_index_ += (int)code_length_chips * (abs(local_code_chip_index_) / code_length_chips + 1) ; + if (local_code_chip_index_ < 0) local_code_chip_index_ += (int)code_length_chips * (abs(local_code_chip_index_) / code_length_chips + 1); local_code_chip_index_ = local_code_chip_index_ % code_length_chips; _result[current_correlator_tap][n] = local_code[local_code_chip_index_]; } } } -#endif +#endif #ifdef LV_HAVE_SSE4_1 @@ -314,7 +317,8 @@ static inline void volk_gnsssdr_32f_xn_resampler_32f_xn_u_sse4_1(float** result, const __m128 rem_code_phase_chips_reg = _mm_set_ps1(rem_code_phase_chips); const __m128 code_phase_step_chips_reg = _mm_set_ps1(code_phase_step_chips); - __VOLK_ATTR_ALIGNED(16) int local_code_chip_index[4]; + __VOLK_ATTR_ALIGNED(16) + int local_code_chip_index[4]; int local_code_chip_index_; const __m128i zeros = _mm_setzero_si128(); @@ -328,7 +332,7 @@ static inline void volk_gnsssdr_32f_xn_resampler_32f_xn_u_sse4_1(float** result, shifts_chips_reg = _mm_set_ps1((float)shifts_chips[current_correlator_tap]); aux2 = _mm_sub_ps(shifts_chips_reg, rem_code_phase_chips_reg); __m128 indexn = _mm_set_ps(3.0f, 2.0f, 1.0f, 0.0f); - for(n = 0; n < quarterPoints; n++) + for (n = 0; n < quarterPoints; n++) { aux = _mm_mul_ps(code_phase_step_chips_reg, indexn); aux = _mm_add_ps(aux, aux2); @@ -346,18 +350,18 @@ static inline void volk_gnsssdr_32f_xn_resampler_32f_xn_u_sse4_1(float** result, aux_i = _mm_and_si128(code_length_chips_reg_i, negatives); local_code_chip_index_reg = _mm_add_epi32(local_code_chip_index_reg, aux_i); _mm_store_si128((__m128i*)local_code_chip_index, local_code_chip_index_reg); - for(k = 0; k < 4; ++k) + for (k = 0; k < 4; ++k) { _result[current_correlator_tap][n * 4 + k] = local_code[local_code_chip_index[k]]; } indexn = _mm_add_ps(indexn, fours); } - for(n = quarterPoints * 4; n < num_points; n++) + for (n = quarterPoints * 4; n < num_points; n++) { // resample code for current tap local_code_chip_index_ = (int)floor(code_phase_step_chips * (float)n + shifts_chips[current_correlator_tap] - rem_code_phase_chips); //Take into account that in multitap correlators, the shifts can be negative! - if (local_code_chip_index_ < 0) local_code_chip_index_ += (int)code_length_chips * (abs(local_code_chip_index_) / code_length_chips + 1) ; + if (local_code_chip_index_ < 0) local_code_chip_index_ += (int)code_length_chips * (abs(local_code_chip_index_) / code_length_chips + 1); local_code_chip_index_ = local_code_chip_index_ % code_length_chips; _result[current_correlator_tap][n] = local_code[local_code_chip_index_]; } @@ -380,7 +384,8 @@ static inline void volk_gnsssdr_32f_xn_resampler_32f_xn_a_avx(float** result, co const __m256 rem_code_phase_chips_reg = _mm256_set1_ps(rem_code_phase_chips); const __m256 code_phase_step_chips_reg = _mm256_set1_ps(code_phase_step_chips); - __VOLK_ATTR_ALIGNED(32) int local_code_chip_index[8]; + __VOLK_ATTR_ALIGNED(32) + int local_code_chip_index[8]; int local_code_chip_index_; const __m256 zeros = _mm256_setzero_ps(); @@ -395,7 +400,7 @@ static inline void volk_gnsssdr_32f_xn_resampler_32f_xn_a_avx(float** result, co shifts_chips_reg = _mm256_set1_ps((float)shifts_chips[current_correlator_tap]); aux2 = _mm256_sub_ps(shifts_chips_reg, rem_code_phase_chips_reg); indexn = n0; - for(n = 0; n < avx_iters; n++) + for (n = 0; n < avx_iters; n++) { __VOLK_GNSSSDR_PREFETCH_LOCALITY(&_result[current_correlator_tap][8 * n + 7], 1, 0); __VOLK_GNSSSDR_PREFETCH_LOCALITY(&local_code_chip_index[8], 1, 3); @@ -413,13 +418,13 @@ static inline void volk_gnsssdr_32f_xn_resampler_32f_xn_a_avx(float** result, co // no negatives c = _mm256_cvtepi32_ps(local_code_chip_index_reg); - negatives = _mm256_cmp_ps(c, zeros, 0x01 ); + negatives = _mm256_cmp_ps(c, zeros, 0x01); aux3 = _mm256_and_ps(code_length_chips_reg_f, negatives); aux = _mm256_add_ps(c, aux3); local_code_chip_index_reg = _mm256_cvttps_epi32(aux); _mm256_store_si256((__m256i*)local_code_chip_index, local_code_chip_index_reg); - for(k = 0; k < 8; ++k) + for (k = 0; k < 8; ++k) { _result[current_correlator_tap][n * 8 + k] = local_code[local_code_chip_index[k]]; } @@ -429,12 +434,12 @@ static inline void volk_gnsssdr_32f_xn_resampler_32f_xn_a_avx(float** result, co _mm256_zeroupper(); for (current_correlator_tap = 0; current_correlator_tap < num_out_vectors; current_correlator_tap++) { - for(n = avx_iters * 8; n < num_points; n++) + for (n = avx_iters * 8; n < num_points; n++) { // resample code for current tap local_code_chip_index_ = (int)floor(code_phase_step_chips * (float)n + shifts_chips[current_correlator_tap] - rem_code_phase_chips); //Take into account that in multitap correlators, the shifts can be negative! - if (local_code_chip_index_ < 0) local_code_chip_index_ += (int)code_length_chips * (abs(local_code_chip_index_) / code_length_chips + 1) ; + if (local_code_chip_index_ < 0) local_code_chip_index_ += (int)code_length_chips * (abs(local_code_chip_index_) / code_length_chips + 1); local_code_chip_index_ = local_code_chip_index_ % code_length_chips; _result[current_correlator_tap][n] = local_code[local_code_chip_index_]; } @@ -457,7 +462,8 @@ static inline void volk_gnsssdr_32f_xn_resampler_32f_xn_u_avx(float** result, co const __m256 rem_code_phase_chips_reg = _mm256_set1_ps(rem_code_phase_chips); const __m256 code_phase_step_chips_reg = _mm256_set1_ps(code_phase_step_chips); - __VOLK_ATTR_ALIGNED(32) int local_code_chip_index[8]; + __VOLK_ATTR_ALIGNED(32) + int local_code_chip_index[8]; int local_code_chip_index_; const __m256 zeros = _mm256_setzero_ps(); @@ -472,7 +478,7 @@ static inline void volk_gnsssdr_32f_xn_resampler_32f_xn_u_avx(float** result, co shifts_chips_reg = _mm256_set1_ps((float)shifts_chips[current_correlator_tap]); aux2 = _mm256_sub_ps(shifts_chips_reg, rem_code_phase_chips_reg); indexn = n0; - for(n = 0; n < avx_iters; n++) + for (n = 0; n < avx_iters; n++) { __VOLK_GNSSSDR_PREFETCH_LOCALITY(&_result[current_correlator_tap][8 * n + 7], 1, 0); __VOLK_GNSSSDR_PREFETCH_LOCALITY(&local_code_chip_index[8], 1, 3); @@ -490,13 +496,13 @@ static inline void volk_gnsssdr_32f_xn_resampler_32f_xn_u_avx(float** result, co // no negatives c = _mm256_cvtepi32_ps(local_code_chip_index_reg); - negatives = _mm256_cmp_ps(c, zeros, 0x01 ); + negatives = _mm256_cmp_ps(c, zeros, 0x01); aux3 = _mm256_and_ps(code_length_chips_reg_f, negatives); aux = _mm256_add_ps(c, aux3); local_code_chip_index_reg = _mm256_cvttps_epi32(aux); _mm256_store_si256((__m256i*)local_code_chip_index, local_code_chip_index_reg); - for(k = 0; k < 8; ++k) + for (k = 0; k < 8; ++k) { _result[current_correlator_tap][n * 8 + k] = local_code[local_code_chip_index[k]]; } @@ -506,12 +512,12 @@ static inline void volk_gnsssdr_32f_xn_resampler_32f_xn_u_avx(float** result, co _mm256_zeroupper(); for (current_correlator_tap = 0; current_correlator_tap < num_out_vectors; current_correlator_tap++) { - for(n = avx_iters * 8; n < num_points; n++) + for (n = avx_iters * 8; n < num_points; n++) { // resample code for current tap local_code_chip_index_ = (int)floor(code_phase_step_chips * (float)n + shifts_chips[current_correlator_tap] - rem_code_phase_chips); //Take into account that in multitap correlators, the shifts can be negative! - if (local_code_chip_index_ < 0) local_code_chip_index_ += (int)code_length_chips * (abs(local_code_chip_index_) / code_length_chips + 1) ; + if (local_code_chip_index_ < 0) local_code_chip_index_ += (int)code_length_chips * (abs(local_code_chip_index_) / code_length_chips + 1); local_code_chip_index_ = local_code_chip_index_ % code_length_chips; _result[current_correlator_tap][n] = local_code[local_code_chip_index_]; } @@ -536,19 +542,21 @@ static inline void volk_gnsssdr_32f_xn_resampler_32f_xn_neon(float** result, con const float32x4_t rem_code_phase_chips_reg = vdupq_n_f32(rem_code_phase_chips); const float32x4_t code_phase_step_chips_reg = vdupq_n_f32(code_phase_step_chips); - __VOLK_ATTR_ALIGNED(16) int32_t local_code_chip_index[4]; + __VOLK_ATTR_ALIGNED(16) + int32_t local_code_chip_index[4]; int32_t local_code_chip_index_; const int32x4_t zeros = vdupq_n_s32(0); const float32x4_t code_length_chips_reg_f = vdupq_n_f32((float)code_length_chips); const int32x4_t code_length_chips_reg_i = vdupq_n_s32((int32_t)code_length_chips); - int32x4_t local_code_chip_index_reg, aux_i, negatives, i; + int32x4_t local_code_chip_index_reg, aux_i, negatives, i; float32x4_t aux, aux2, shifts_chips_reg, fi, c, j, cTrunc, base, indexn, reciprocal; - __VOLK_ATTR_ALIGNED(16) const float vec[4] = { 0.0f, 1.0f, 2.0f, 3.0f }; + __VOLK_ATTR_ALIGNED(16) + const float vec[4] = {0.0f, 1.0f, 2.0f, 3.0f}; uint32x4_t igx; reciprocal = vrecpeq_f32(code_length_chips_reg_f); reciprocal = vmulq_f32(vrecpsq_f32(code_length_chips_reg_f, reciprocal), reciprocal); - reciprocal = vmulq_f32(vrecpsq_f32(code_length_chips_reg_f, reciprocal), reciprocal); // this refinement is required! + reciprocal = vmulq_f32(vrecpsq_f32(code_length_chips_reg_f, reciprocal), reciprocal); // this refinement is required! float32x4_t n0 = vld1q_f32((float*)vec); for (current_correlator_tap = 0; current_correlator_tap < num_out_vectors; current_correlator_tap++) @@ -556,7 +564,7 @@ static inline void volk_gnsssdr_32f_xn_resampler_32f_xn_neon(float** result, con shifts_chips_reg = vdupq_n_f32((float)shifts_chips[current_correlator_tap]); aux2 = vsubq_f32(shifts_chips_reg, rem_code_phase_chips_reg); indexn = n0; - for(n = 0; n < neon_iters; n++) + for (n = 0; n < neon_iters; n++) { __VOLK_GNSSSDR_PREFETCH_LOCALITY(&_result[current_correlator_tap][4 * n + 3], 1, 0); __VOLK_GNSSSDR_PREFETCH(&local_code_chip_index[4]); @@ -572,7 +580,7 @@ static inline void volk_gnsssdr_32f_xn_resampler_32f_xn_neon(float** result, con // fmod c = vmulq_f32(aux, reciprocal); - i = vcvtq_s32_f32(c); + i = vcvtq_s32_f32(c); cTrunc = vcvtq_f32_s32(i); base = vmulq_f32(cTrunc, code_length_chips_reg_f); aux = vsubq_f32(aux, base); @@ -584,13 +592,13 @@ static inline void volk_gnsssdr_32f_xn_resampler_32f_xn_neon(float** result, con vst1q_s32((int32_t*)local_code_chip_index, local_code_chip_index_reg); - for(k = 0; k < 4; ++k) + for (k = 0; k < 4; ++k) { _result[current_correlator_tap][n * 4 + k] = local_code[local_code_chip_index[k]]; } indexn = vaddq_f32(indexn, fours); } - for(n = neon_iters * 4; n < num_points; n++) + for (n = neon_iters * 4; n < num_points; n++) { __VOLK_GNSSSDR_PREFETCH_LOCALITY(&_result[current_correlator_tap][n], 1, 0); // resample code for current tap @@ -606,5 +614,3 @@ static inline void volk_gnsssdr_32f_xn_resampler_32f_xn_neon(float** result, con #endif #endif /*INCLUDED_volk_gnsssdr_32f_xn_resampler_32f_xn_H*/ - - diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_32f_rotator_dot_prod_32fc_xn.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_32f_rotator_dot_prod_32fc_xn.h index e8831a97f..211d979cf 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_32f_rotator_dot_prod_32fc_xn.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_32f_rotator_dot_prod_32fc_xn.h @@ -85,11 +85,11 @@ static inline void volk_gnsssdr_32fc_32f_rotator_dot_prod_32fc_xn_generic(lv_32f unsigned int n; for (n_vec = 0; n_vec < num_a_vectors; n_vec++) { - result[n_vec] = lv_cmake(0,0); + result[n_vec] = lv_cmake(0, 0); } for (n = 0; n < num_points; n++) { - tmp32_1 = *in_common++ * (*phase);//if(n<10 || n >= 8108) printf("generic phase %i: %f,%f\n", n,lv_creal(*phase),lv_cimag(*phase)); + tmp32_1 = *in_common++ * (*phase); //if(n<10 || n >= 8108) printf("generic phase %i: %f,%f\n", n,lv_creal(*phase),lv_cimag(*phase)); // Regenerate phase if (n % 256 == 0) @@ -126,7 +126,7 @@ static inline void volk_gnsssdr_32fc_32f_rotator_dot_prod_32fc_xn_generic_reload unsigned int j; for (n_vec = 0; n_vec < num_a_vectors; n_vec++) { - result[n_vec] = lv_cmake(0,0); + result[n_vec] = lv_cmake(0, 0); } for (n = 0; n < num_points / ROTATOR_RELOAD; n++) @@ -141,7 +141,7 @@ static inline void volk_gnsssdr_32fc_32f_rotator_dot_prod_32fc_xn_generic_reload result[n_vec] += tmp32_2; } } - /* Regenerate phase */ + /* Regenerate phase */ #ifdef __cplusplus (*phase) /= std::abs((*phase)); #else @@ -175,8 +175,8 @@ static inline void volk_gnsssdr_32fc_32f_rotator_dot_prod_32fc_xn_u_avx(lv_32fc_ const unsigned int sixteenthPoints = num_points / 16; const float* aPtr = (float*)in_common; - const float* bPtr[ num_a_vectors]; - for( vec_ind = 0; vec_ind < num_a_vectors; ++vec_ind ) + const float* bPtr[num_a_vectors]; + for (vec_ind = 0; vec_ind < num_a_vectors; ++vec_ind) { bPtr[vec_ind] = in_a[vec_ind]; } @@ -194,7 +194,7 @@ static inline void volk_gnsssdr_32fc_32f_rotator_dot_prod_32fc_xn_u_avx(lv_32fc_ __m256 dotProdVal2[num_a_vectors]; __m256 dotProdVal3[num_a_vectors]; - for( vec_ind = 0; vec_ind < num_a_vectors; vec_ind++ ) + for (vec_ind = 0; vec_ind < num_a_vectors; vec_ind++) { dotProdVal0[vec_ind] = _mm256_setzero_ps(); dotProdVal1[vec_ind] = _mm256_setzero_ps(); @@ -204,57 +204,62 @@ static inline void volk_gnsssdr_32fc_32f_rotator_dot_prod_32fc_xn_u_avx(lv_32fc_ // Set up the complex rotator __m256 z0, z1, z2, z3; - __VOLK_ATTR_ALIGNED(32) lv_32fc_t phase_vec[16]; - for( vec_ind = 0; vec_ind < 16; ++vec_ind ) + __VOLK_ATTR_ALIGNED(32) + lv_32fc_t phase_vec[16]; + for (vec_ind = 0; vec_ind < 16; ++vec_ind) { phase_vec[vec_ind] = _phase; _phase *= phase_inc; } - z0 = _mm256_load_ps( (float *)phase_vec ); - z1 = _mm256_load_ps( (float *)(phase_vec + 4) ); - z2 = _mm256_load_ps( (float *)(phase_vec + 8) ); - z3 = _mm256_load_ps( (float *)(phase_vec + 12) ); + z0 = _mm256_load_ps((float*)phase_vec); + z1 = _mm256_load_ps((float*)(phase_vec + 4)); + z2 = _mm256_load_ps((float*)(phase_vec + 8)); + z3 = _mm256_load_ps((float*)(phase_vec + 12)); - lv_32fc_t dz = phase_inc; dz *= dz; dz *= dz; dz *= dz; dz *= dz; // dz = phase_inc^16; + lv_32fc_t dz = phase_inc; + dz *= dz; + dz *= dz; + dz *= dz; + dz *= dz; // dz = phase_inc^16; - for( vec_ind = 0; vec_ind < 4; ++vec_ind ) + for (vec_ind = 0; vec_ind < 4; ++vec_ind) { phase_vec[vec_ind] = dz; } - __m256 dz_reg = _mm256_load_ps( (float *)phase_vec ); - dz_reg = _mm256_complexnormalise_ps( dz_reg ); + __m256 dz_reg = _mm256_load_ps((float*)phase_vec); + dz_reg = _mm256_complexnormalise_ps(dz_reg); - for(;number < sixteenthPoints; number++) + for (; number < sixteenthPoints; number++) { a0Val = _mm256_loadu_ps(aPtr); - a1Val = _mm256_loadu_ps(aPtr+8); - a2Val = _mm256_loadu_ps(aPtr+16); - a3Val = _mm256_loadu_ps(aPtr+24); + a1Val = _mm256_loadu_ps(aPtr + 8); + a2Val = _mm256_loadu_ps(aPtr + 16); + a3Val = _mm256_loadu_ps(aPtr + 24); - a0Val = _mm256_complexmul_ps( a0Val, z0 ); - a1Val = _mm256_complexmul_ps( a1Val, z1 ); - a2Val = _mm256_complexmul_ps( a2Val, z2 ); - a3Val = _mm256_complexmul_ps( a3Val, z3 ); + a0Val = _mm256_complexmul_ps(a0Val, z0); + a1Val = _mm256_complexmul_ps(a1Val, z1); + a2Val = _mm256_complexmul_ps(a2Val, z2); + a3Val = _mm256_complexmul_ps(a3Val, z3); - z0 = _mm256_complexmul_ps( z0, dz_reg ); - z1 = _mm256_complexmul_ps( z1, dz_reg ); - z2 = _mm256_complexmul_ps( z2, dz_reg ); - z3 = _mm256_complexmul_ps( z3, dz_reg ); + z0 = _mm256_complexmul_ps(z0, dz_reg); + z1 = _mm256_complexmul_ps(z1, dz_reg); + z2 = _mm256_complexmul_ps(z2, dz_reg); + z3 = _mm256_complexmul_ps(z3, dz_reg); - for( vec_ind = 0; vec_ind < num_a_vectors; ++vec_ind ) + for (vec_ind = 0; vec_ind < num_a_vectors; ++vec_ind) { - x0Val[vec_ind] = _mm256_loadu_ps(bPtr[vec_ind]); // t0|t1|t2|t3|t4|t5|t6|t7 - x1Val[vec_ind] = _mm256_loadu_ps(bPtr[vec_ind]+8); - x0loVal[vec_ind] = _mm256_unpacklo_ps(x0Val[vec_ind], x0Val[vec_ind]); // t0|t0|t1|t1|t4|t4|t5|t5 - x0hiVal[vec_ind] = _mm256_unpackhi_ps(x0Val[vec_ind], x0Val[vec_ind]); // t2|t2|t3|t3|t6|t6|t7|t7 + x0Val[vec_ind] = _mm256_loadu_ps(bPtr[vec_ind]); // t0|t1|t2|t3|t4|t5|t6|t7 + x1Val[vec_ind] = _mm256_loadu_ps(bPtr[vec_ind] + 8); + x0loVal[vec_ind] = _mm256_unpacklo_ps(x0Val[vec_ind], x0Val[vec_ind]); // t0|t0|t1|t1|t4|t4|t5|t5 + x0hiVal[vec_ind] = _mm256_unpackhi_ps(x0Val[vec_ind], x0Val[vec_ind]); // t2|t2|t3|t3|t6|t6|t7|t7 x1loVal[vec_ind] = _mm256_unpacklo_ps(x1Val[vec_ind], x1Val[vec_ind]); x1hiVal[vec_ind] = _mm256_unpackhi_ps(x1Val[vec_ind], x1Val[vec_ind]); // TODO: it may be possible to rearrange swizzling to better pipeline data - b0Val[vec_ind] = _mm256_permute2f128_ps(x0loVal[vec_ind], x0hiVal[vec_ind], 0x20); // t0|t0|t1|t1|t2|t2|t3|t3 - b1Val[vec_ind] = _mm256_permute2f128_ps(x0loVal[vec_ind], x0hiVal[vec_ind], 0x31); // t4|t4|t5|t5|t6|t6|t7|t7 + b0Val[vec_ind] = _mm256_permute2f128_ps(x0loVal[vec_ind], x0hiVal[vec_ind], 0x20); // t0|t0|t1|t1|t2|t2|t3|t3 + b1Val[vec_ind] = _mm256_permute2f128_ps(x0loVal[vec_ind], x0hiVal[vec_ind], 0x31); // t4|t4|t5|t5|t6|t6|t7|t7 b2Val[vec_ind] = _mm256_permute2f128_ps(x1loVal[vec_ind], x1hiVal[vec_ind], 0x20); b3Val[vec_ind] = _mm256_permute2f128_ps(x1loVal[vec_ind], x1hiVal[vec_ind], 0x31); @@ -274,43 +279,44 @@ static inline void volk_gnsssdr_32fc_32f_rotator_dot_prod_32fc_xn_u_avx(lv_32fc_ // Force the rotators back onto the unit circle if ((number % 64) == 0) { - z0 = _mm256_complexnormalise_ps( z0 ); - z1 = _mm256_complexnormalise_ps( z1 ); - z2 = _mm256_complexnormalise_ps( z2 ); - z3 = _mm256_complexnormalise_ps( z3 ); + z0 = _mm256_complexnormalise_ps(z0); + z1 = _mm256_complexnormalise_ps(z1); + z2 = _mm256_complexnormalise_ps(z2); + z3 = _mm256_complexnormalise_ps(z3); } aPtr += 32; } - __VOLK_ATTR_ALIGNED(32) lv_32fc_t dotProductVector[4]; + __VOLK_ATTR_ALIGNED(32) + lv_32fc_t dotProductVector[4]; - for( vec_ind = 0; vec_ind < num_a_vectors; ++vec_ind ) + for (vec_ind = 0; vec_ind < num_a_vectors; ++vec_ind) { dotProdVal0[vec_ind] = _mm256_add_ps(dotProdVal0[vec_ind], dotProdVal1[vec_ind]); dotProdVal0[vec_ind] = _mm256_add_ps(dotProdVal0[vec_ind], dotProdVal2[vec_ind]); dotProdVal0[vec_ind] = _mm256_add_ps(dotProdVal0[vec_ind], dotProdVal3[vec_ind]); - _mm256_store_ps((float *)dotProductVector, dotProdVal0[vec_ind]); // Store the results back into the dot product vector + _mm256_store_ps((float*)dotProductVector, dotProdVal0[vec_ind]); // Store the results back into the dot product vector - result[ vec_ind ] = lv_cmake( 0, 0 ); - for( i = 0; i < 4; ++i ) + result[vec_ind] = lv_cmake(0, 0); + for (i = 0; i < 4; ++i) { result[vec_ind] += dotProductVector[i]; } } - z0 = _mm256_complexnormalise_ps( z0 ); + z0 = _mm256_complexnormalise_ps(z0); _mm256_store_ps((float*)phase_vec, z0); _phase = phase_vec[0]; _mm256_zeroupper(); - number = sixteenthPoints*16; - for(;number < num_points; number++) + number = sixteenthPoints * 16; + for (; number < num_points; number++) { - wo = (*aPtr++)*_phase; + wo = (*aPtr++) * _phase; _phase *= phase_inc; - for( vec_ind = 0; vec_ind < num_a_vectors; ++vec_ind ) + for (vec_ind = 0; vec_ind < num_a_vectors; ++vec_ind) { result[vec_ind] += wo * in_a[vec_ind][number]; } @@ -333,8 +339,8 @@ static inline void volk_gnsssdr_32fc_32f_rotator_dot_prod_32fc_xn_a_avx(lv_32fc_ const unsigned int sixteenthPoints = num_points / 16; const float* aPtr = (float*)in_common; - const float* bPtr[ num_a_vectors]; - for( vec_ind = 0; vec_ind < num_a_vectors; ++vec_ind ) + const float* bPtr[num_a_vectors]; + for (vec_ind = 0; vec_ind < num_a_vectors; ++vec_ind) { bPtr[vec_ind] = in_a[vec_ind]; } @@ -352,7 +358,7 @@ static inline void volk_gnsssdr_32fc_32f_rotator_dot_prod_32fc_xn_a_avx(lv_32fc_ __m256 dotProdVal2[num_a_vectors]; __m256 dotProdVal3[num_a_vectors]; - for( vec_ind = 0; vec_ind < num_a_vectors; vec_ind++ ) + for (vec_ind = 0; vec_ind < num_a_vectors; vec_ind++) { dotProdVal0[vec_ind] = _mm256_setzero_ps(); dotProdVal1[vec_ind] = _mm256_setzero_ps(); @@ -362,58 +368,62 @@ static inline void volk_gnsssdr_32fc_32f_rotator_dot_prod_32fc_xn_a_avx(lv_32fc_ // Set up the complex rotator __m256 z0, z1, z2, z3; - __VOLK_ATTR_ALIGNED(32) lv_32fc_t phase_vec[16]; - for( vec_ind = 0; vec_ind < 16; ++vec_ind ) + __VOLK_ATTR_ALIGNED(32) + lv_32fc_t phase_vec[16]; + for (vec_ind = 0; vec_ind < 16; ++vec_ind) { phase_vec[vec_ind] = _phase; _phase *= phase_inc; } - z0 = _mm256_load_ps( (float *)phase_vec ); - z1 = _mm256_load_ps( (float *)(phase_vec + 4) ); - z2 = _mm256_load_ps( (float *)(phase_vec + 8) ); - z3 = _mm256_load_ps( (float *)(phase_vec + 12) ); + z0 = _mm256_load_ps((float*)phase_vec); + z1 = _mm256_load_ps((float*)(phase_vec + 4)); + z2 = _mm256_load_ps((float*)(phase_vec + 8)); + z3 = _mm256_load_ps((float*)(phase_vec + 12)); - lv_32fc_t dz = phase_inc; dz *= dz; dz *= dz; dz *= dz; dz *= dz; // dz = phase_inc^16; + lv_32fc_t dz = phase_inc; + dz *= dz; + dz *= dz; + dz *= dz; + dz *= dz; // dz = phase_inc^16; - for( vec_ind = 0; vec_ind < 4; ++vec_ind ) + for (vec_ind = 0; vec_ind < 4; ++vec_ind) { phase_vec[vec_ind] = dz; } - __m256 dz_reg = _mm256_load_ps( (float *)phase_vec ); - dz_reg = _mm256_complexnormalise_ps( dz_reg ); + __m256 dz_reg = _mm256_load_ps((float*)phase_vec); + dz_reg = _mm256_complexnormalise_ps(dz_reg); - for(;number < sixteenthPoints; number++) + for (; number < sixteenthPoints; number++) { - a0Val = _mm256_load_ps(aPtr); - a1Val = _mm256_load_ps(aPtr+8); - a2Val = _mm256_load_ps(aPtr+16); - a3Val = _mm256_load_ps(aPtr+24); + a1Val = _mm256_load_ps(aPtr + 8); + a2Val = _mm256_load_ps(aPtr + 16); + a3Val = _mm256_load_ps(aPtr + 24); - a0Val = _mm256_complexmul_ps( a0Val, z0 ); - a1Val = _mm256_complexmul_ps( a1Val, z1 ); - a2Val = _mm256_complexmul_ps( a2Val, z2 ); - a3Val = _mm256_complexmul_ps( a3Val, z3 ); + a0Val = _mm256_complexmul_ps(a0Val, z0); + a1Val = _mm256_complexmul_ps(a1Val, z1); + a2Val = _mm256_complexmul_ps(a2Val, z2); + a3Val = _mm256_complexmul_ps(a3Val, z3); - z0 = _mm256_complexmul_ps( z0, dz_reg ); - z1 = _mm256_complexmul_ps( z1, dz_reg ); - z2 = _mm256_complexmul_ps( z2, dz_reg ); - z3 = _mm256_complexmul_ps( z3, dz_reg ); + z0 = _mm256_complexmul_ps(z0, dz_reg); + z1 = _mm256_complexmul_ps(z1, dz_reg); + z2 = _mm256_complexmul_ps(z2, dz_reg); + z3 = _mm256_complexmul_ps(z3, dz_reg); - for( vec_ind = 0; vec_ind < num_a_vectors; ++vec_ind ) + for (vec_ind = 0; vec_ind < num_a_vectors; ++vec_ind) { - x0Val[vec_ind] = _mm256_loadu_ps(bPtr[vec_ind]); // t0|t1|t2|t3|t4|t5|t6|t7 - x1Val[vec_ind] = _mm256_loadu_ps(bPtr[vec_ind]+8); - x0loVal[vec_ind] = _mm256_unpacklo_ps(x0Val[vec_ind], x0Val[vec_ind]); // t0|t0|t1|t1|t4|t4|t5|t5 - x0hiVal[vec_ind] = _mm256_unpackhi_ps(x0Val[vec_ind], x0Val[vec_ind]); // t2|t2|t3|t3|t6|t6|t7|t7 + x0Val[vec_ind] = _mm256_loadu_ps(bPtr[vec_ind]); // t0|t1|t2|t3|t4|t5|t6|t7 + x1Val[vec_ind] = _mm256_loadu_ps(bPtr[vec_ind] + 8); + x0loVal[vec_ind] = _mm256_unpacklo_ps(x0Val[vec_ind], x0Val[vec_ind]); // t0|t0|t1|t1|t4|t4|t5|t5 + x0hiVal[vec_ind] = _mm256_unpackhi_ps(x0Val[vec_ind], x0Val[vec_ind]); // t2|t2|t3|t3|t6|t6|t7|t7 x1loVal[vec_ind] = _mm256_unpacklo_ps(x1Val[vec_ind], x1Val[vec_ind]); x1hiVal[vec_ind] = _mm256_unpackhi_ps(x1Val[vec_ind], x1Val[vec_ind]); // TODO: it may be possible to rearrange swizzling to better pipeline data - b0Val[vec_ind] = _mm256_permute2f128_ps(x0loVal[vec_ind], x0hiVal[vec_ind], 0x20); // t0|t0|t1|t1|t2|t2|t3|t3 - b1Val[vec_ind] = _mm256_permute2f128_ps(x0loVal[vec_ind], x0hiVal[vec_ind], 0x31); // t4|t4|t5|t5|t6|t6|t7|t7 + b0Val[vec_ind] = _mm256_permute2f128_ps(x0loVal[vec_ind], x0hiVal[vec_ind], 0x20); // t0|t0|t1|t1|t2|t2|t3|t3 + b1Val[vec_ind] = _mm256_permute2f128_ps(x0loVal[vec_ind], x0hiVal[vec_ind], 0x31); // t4|t4|t5|t5|t6|t6|t7|t7 b2Val[vec_ind] = _mm256_permute2f128_ps(x1loVal[vec_ind], x1hiVal[vec_ind], 0x20); b3Val[vec_ind] = _mm256_permute2f128_ps(x1loVal[vec_ind], x1hiVal[vec_ind], 0x31); @@ -433,43 +443,44 @@ static inline void volk_gnsssdr_32fc_32f_rotator_dot_prod_32fc_xn_a_avx(lv_32fc_ // Force the rotators back onto the unit circle if ((number % 64) == 0) { - z0 = _mm256_complexnormalise_ps( z0 ); - z1 = _mm256_complexnormalise_ps( z1 ); - z2 = _mm256_complexnormalise_ps( z2 ); - z3 = _mm256_complexnormalise_ps( z3 ); + z0 = _mm256_complexnormalise_ps(z0); + z1 = _mm256_complexnormalise_ps(z1); + z2 = _mm256_complexnormalise_ps(z2); + z3 = _mm256_complexnormalise_ps(z3); } aPtr += 32; } - __VOLK_ATTR_ALIGNED(32) lv_32fc_t dotProductVector[4]; + __VOLK_ATTR_ALIGNED(32) + lv_32fc_t dotProductVector[4]; - for( vec_ind = 0; vec_ind < num_a_vectors; ++vec_ind ) + for (vec_ind = 0; vec_ind < num_a_vectors; ++vec_ind) { dotProdVal0[vec_ind] = _mm256_add_ps(dotProdVal0[vec_ind], dotProdVal1[vec_ind]); dotProdVal0[vec_ind] = _mm256_add_ps(dotProdVal0[vec_ind], dotProdVal2[vec_ind]); dotProdVal0[vec_ind] = _mm256_add_ps(dotProdVal0[vec_ind], dotProdVal3[vec_ind]); - _mm256_store_ps((float *)dotProductVector, dotProdVal0[vec_ind]); // Store the results back into the dot product vector + _mm256_store_ps((float*)dotProductVector, dotProdVal0[vec_ind]); // Store the results back into the dot product vector - result[ vec_ind ] = lv_cmake( 0, 0 ); - for( i = 0; i < 4; ++i ) + result[vec_ind] = lv_cmake(0, 0); + for (i = 0; i < 4; ++i) { result[vec_ind] += dotProductVector[i]; } } - z0 = _mm256_complexnormalise_ps( z0 ); + z0 = _mm256_complexnormalise_ps(z0); _mm256_store_ps((float*)phase_vec, z0); _phase = phase_vec[0]; _mm256_zeroupper(); - number = sixteenthPoints*16; - for(;number < num_points; number++) + number = sixteenthPoints * 16; + for (; number < num_points; number++) { - wo = (*aPtr++)*_phase; + wo = (*aPtr++) * _phase; _phase *= phase_inc; - for( vec_ind = 0; vec_ind < num_a_vectors; ++vec_ind ) + for (vec_ind = 0; vec_ind < num_a_vectors; ++vec_ind) { result[vec_ind] += wo * in_a[vec_ind][number]; } @@ -482,5 +493,3 @@ static inline void volk_gnsssdr_32fc_32f_rotator_dot_prod_32fc_xn_a_avx(lv_32fc_ #endif /* LV_HAVE_AVX */ #endif /* INCLUDED_volk_gnsssdr_32fc_32f_rotator_dot_prod_32fc_xn_H */ - - diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_32f_rotator_dotprodxnpuppet_32fc.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_32f_rotator_dotprodxnpuppet_32fc.h index ca684e30b..0804dd651 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_32f_rotator_dotprodxnpuppet_32fc.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_32f_rotator_dotprodxnpuppet_32fc.h @@ -42,7 +42,7 @@ #ifdef LV_HAVE_GENERIC -static inline void volk_gnsssdr_32fc_32f_rotator_dotprodxnpuppet_32fc_generic(lv_32fc_t* result, const lv_32fc_t* local_code, const float* in, unsigned int num_points) +static inline void volk_gnsssdr_32fc_32f_rotator_dotprodxnpuppet_32fc_generic(lv_32fc_t* result, const lv_32fc_t* local_code, const float* in, unsigned int num_points) { // phases must be normalized. Phase rotator expects a complex exponential input! float rem_carrier_phase_in_rad = 0.25; @@ -53,15 +53,15 @@ static inline void volk_gnsssdr_32fc_32f_rotator_dotprodxnpuppet_32fc_generic(lv phase_inc[0] = lv_cmake(cos(phase_step_rad), sin(phase_step_rad)); unsigned int n; int num_a_vectors = 3; - float ** in_a = (float **)volk_gnsssdr_malloc(sizeof(float *) * num_a_vectors, volk_gnsssdr_get_alignment()); - for(n = 0; n < num_a_vectors; n++) + float** in_a = (float**)volk_gnsssdr_malloc(sizeof(float*) * num_a_vectors, volk_gnsssdr_get_alignment()); + for (n = 0; n < num_a_vectors; n++) { - in_a[n] = (float *)volk_gnsssdr_malloc(sizeof(float ) * num_points, volk_gnsssdr_get_alignment()); + in_a[n] = (float*)volk_gnsssdr_malloc(sizeof(float) * num_points, volk_gnsssdr_get_alignment()); memcpy((float*)in_a[n], (float*)in, sizeof(float) * num_points); } - volk_gnsssdr_32fc_32f_rotator_dot_prod_32fc_xn_generic(result, local_code, phase_inc[0], phase, (const float**) in_a, num_a_vectors, num_points); + volk_gnsssdr_32fc_32f_rotator_dot_prod_32fc_xn_generic(result, local_code, phase_inc[0], phase, (const float**)in_a, num_a_vectors, num_points); - for(n = 0; n < num_a_vectors; n++) + for (n = 0; n < num_a_vectors; n++) { volk_gnsssdr_free(in_a[n]); } @@ -71,7 +71,7 @@ static inline void volk_gnsssdr_32fc_32f_rotator_dotprodxnpuppet_32fc_generic(lv #ifdef LV_HAVE_GENERIC -static inline void volk_gnsssdr_32fc_32f_rotator_dotprodxnpuppet_32fc_generic_reload(lv_32fc_t* result, const lv_32fc_t* local_code, const float* in, unsigned int num_points) +static inline void volk_gnsssdr_32fc_32f_rotator_dotprodxnpuppet_32fc_generic_reload(lv_32fc_t* result, const lv_32fc_t* local_code, const float* in, unsigned int num_points) { // phases must be normalized. Phase rotator expects a complex exponential input! float rem_carrier_phase_in_rad = 0.25; @@ -82,15 +82,15 @@ static inline void volk_gnsssdr_32fc_32f_rotator_dotprodxnpuppet_32fc_generic_re phase_inc[0] = lv_cmake(cos(phase_step_rad), sin(phase_step_rad)); unsigned int n; int num_a_vectors = 3; - float ** in_a = (float **)volk_gnsssdr_malloc(sizeof(float *) * num_a_vectors, volk_gnsssdr_get_alignment()); - for(n = 0; n < num_a_vectors; n++) + float** in_a = (float**)volk_gnsssdr_malloc(sizeof(float*) * num_a_vectors, volk_gnsssdr_get_alignment()); + for (n = 0; n < num_a_vectors; n++) { - in_a[n] = (float *)volk_gnsssdr_malloc(sizeof(float ) * num_points, volk_gnsssdr_get_alignment()); + in_a[n] = (float*)volk_gnsssdr_malloc(sizeof(float) * num_points, volk_gnsssdr_get_alignment()); memcpy((float*)in_a[n], (float*)in, sizeof(float) * num_points); } - volk_gnsssdr_32fc_32f_rotator_dot_prod_32fc_xn_generic_reload(result, local_code, phase_inc[0], phase, (const float**) in_a, num_a_vectors, num_points); + volk_gnsssdr_32fc_32f_rotator_dot_prod_32fc_xn_generic_reload(result, local_code, phase_inc[0], phase, (const float**)in_a, num_a_vectors, num_points); - for(n = 0; n < num_a_vectors; n++) + for (n = 0; n < num_a_vectors; n++) { volk_gnsssdr_free(in_a[n]); } @@ -100,7 +100,7 @@ static inline void volk_gnsssdr_32fc_32f_rotator_dotprodxnpuppet_32fc_generic_re #endif // Generic #ifdef LV_HAVE_AVX -static inline void volk_gnsssdr_32fc_32f_rotator_dotprodxnpuppet_32fc_u_avx(lv_32fc_t* result, const lv_32fc_t* local_code, const float* in, unsigned int num_points) +static inline void volk_gnsssdr_32fc_32f_rotator_dotprodxnpuppet_32fc_u_avx(lv_32fc_t* result, const lv_32fc_t* local_code, const float* in, unsigned int num_points) { // phases must be normalized. Phase rotator expects a complex exponential input! float rem_carrier_phase_in_rad = 0.25; @@ -111,15 +111,15 @@ static inline void volk_gnsssdr_32fc_32f_rotator_dotprodxnpuppet_32fc_u_avx(lv_3 phase_inc[0] = lv_cmake(cos(phase_step_rad), sin(phase_step_rad)); unsigned int n; int num_a_vectors = 3; - float ** in_a = (float **)volk_gnsssdr_malloc(sizeof(float *) * num_a_vectors, volk_gnsssdr_get_alignment()); - for(n = 0; n < num_a_vectors; n++) + float** in_a = (float**)volk_gnsssdr_malloc(sizeof(float*) * num_a_vectors, volk_gnsssdr_get_alignment()); + for (n = 0; n < num_a_vectors; n++) { - in_a[n] = (float *)volk_gnsssdr_malloc(sizeof(float ) * num_points, volk_gnsssdr_get_alignment()); + in_a[n] = (float*)volk_gnsssdr_malloc(sizeof(float) * num_points, volk_gnsssdr_get_alignment()); memcpy((float*)in_a[n], (float*)in, sizeof(float) * num_points); } - volk_gnsssdr_32fc_32f_rotator_dot_prod_32fc_xn_u_avx(result, local_code, phase_inc[0], phase, (const float**) in_a, num_a_vectors, num_points); + volk_gnsssdr_32fc_32f_rotator_dot_prod_32fc_xn_u_avx(result, local_code, phase_inc[0], phase, (const float**)in_a, num_a_vectors, num_points); - for(n = 0; n < num_a_vectors; n++) + for (n = 0; n < num_a_vectors; n++) { volk_gnsssdr_free(in_a[n]); } @@ -130,7 +130,7 @@ static inline void volk_gnsssdr_32fc_32f_rotator_dotprodxnpuppet_32fc_u_avx(lv_3 #ifdef LV_HAVE_AVX -static inline void volk_gnsssdr_32fc_32f_rotator_dotprodxnpuppet_32fc_a_avx(lv_32fc_t* result, const lv_32fc_t* local_code, const float* in, unsigned int num_points) +static inline void volk_gnsssdr_32fc_32f_rotator_dotprodxnpuppet_32fc_a_avx(lv_32fc_t* result, const lv_32fc_t* local_code, const float* in, unsigned int num_points) { // phases must be normalized. Phase rotator expects a complex exponential input! float rem_carrier_phase_in_rad = 0.25; @@ -141,15 +141,15 @@ static inline void volk_gnsssdr_32fc_32f_rotator_dotprodxnpuppet_32fc_a_avx(lv_3 phase_inc[0] = lv_cmake(cos(phase_step_rad), sin(phase_step_rad)); unsigned int n; int num_a_vectors = 3; - float ** in_a = (float **)volk_gnsssdr_malloc(sizeof(float *) * num_a_vectors, volk_gnsssdr_get_alignment()); - for(n = 0; n < num_a_vectors; n++) + float** in_a = (float**)volk_gnsssdr_malloc(sizeof(float*) * num_a_vectors, volk_gnsssdr_get_alignment()); + for (n = 0; n < num_a_vectors; n++) { - in_a[n] = (float *)volk_gnsssdr_malloc(sizeof(float ) * num_points, volk_gnsssdr_get_alignment()); + in_a[n] = (float*)volk_gnsssdr_malloc(sizeof(float) * num_points, volk_gnsssdr_get_alignment()); memcpy((float*)in_a[n], (float*)in, sizeof(float) * num_points); } - volk_gnsssdr_32fc_32f_rotator_dot_prod_32fc_xn_a_avx(result, local_code, phase_inc[0], phase, (const float**) in_a, num_a_vectors, num_points); + volk_gnsssdr_32fc_32f_rotator_dot_prod_32fc_xn_a_avx(result, local_code, phase_inc[0], phase, (const float**)in_a, num_a_vectors, num_points); - for(n = 0; n < num_a_vectors; n++) + for (n = 0; n < num_a_vectors; n++) { volk_gnsssdr_free(in_a[n]); } @@ -159,4 +159,3 @@ static inline void volk_gnsssdr_32fc_32f_rotator_dotprodxnpuppet_32fc_a_avx(lv_3 #endif // AVX #endif // INCLUDED_volk_gnsssdr_32fc_32f_rotator_dotprodxnpuppet_32fc_H - diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_convert_16ic.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_convert_16ic.h index b04a93c4b..892a7c0e8 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_convert_16ic.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_convert_16ic.h @@ -80,10 +80,12 @@ static inline void volk_gnsssdr_32fc_convert_16ic_u_sse2(lv_16sc_t* outputVector const __m128 vmin_val = _mm_set_ps1(min_val); const __m128 vmax_val = _mm_set_ps1(max_val); - for(i = 0; i < sse_iters; i++) + for (i = 0; i < sse_iters; i++) { - inputVal1 = _mm_loadu_ps((float*)inputVectorPtr); inputVectorPtr += 4; - inputVal2 = _mm_loadu_ps((float*)inputVectorPtr); inputVectorPtr += 4; + inputVal1 = _mm_loadu_ps((float*)inputVectorPtr); + inputVectorPtr += 4; + inputVal2 = _mm_loadu_ps((float*)inputVectorPtr); + inputVectorPtr += 4; __VOLK_GNSSSDR_PREFETCH(inputVectorPtr + 8); // Clip @@ -99,12 +101,12 @@ static inline void volk_gnsssdr_32fc_convert_16ic_u_sse2(lv_16sc_t* outputVector outputVectorPtr += 8; } - for(i = sse_iters * 8; i < num_points * 2; i++) + for (i = sse_iters * 8; i < num_points * 2; i++) { aux = *inputVectorPtr++; - if(aux > max_val) + if (aux > max_val) aux = max_val; - else if(aux < min_val) + else if (aux < min_val) aux = min_val; *outputVectorPtr++ = (int16_t)rintf(aux); } @@ -128,15 +130,17 @@ static inline void volk_gnsssdr_32fc_convert_16ic_u_sse(lv_16sc_t* outputVector, const float max_val = (float)SHRT_MAX; __m128 inputVal1, inputVal2; - __m128i intInputVal1, intInputVal2; // is __m128i defined in xmmintrin.h? + __m128i intInputVal1, intInputVal2; // is __m128i defined in xmmintrin.h? __m128 ret1, ret2; const __m128 vmin_val = _mm_set_ps1(min_val); const __m128 vmax_val = _mm_set_ps1(max_val); - for(i = 0;i < sse_iters; i++) + for (i = 0; i < sse_iters; i++) { - inputVal1 = _mm_loadu_ps((float*)inputVectorPtr); inputVectorPtr += 4; - inputVal2 = _mm_loadu_ps((float*)inputVectorPtr); inputVectorPtr += 4; + inputVal1 = _mm_loadu_ps((float*)inputVectorPtr); + inputVectorPtr += 4; + inputVal2 = _mm_loadu_ps((float*)inputVectorPtr); + inputVectorPtr += 4; __VOLK_GNSSSDR_PREFETCH(inputVectorPtr + 8); // Clip @@ -152,12 +156,12 @@ static inline void volk_gnsssdr_32fc_convert_16ic_u_sse(lv_16sc_t* outputVector, outputVectorPtr += 8; } - for(i = sse_iters * 8; i < num_points*2; i++) + for (i = sse_iters * 8; i < num_points * 2; i++) { aux = *inputVectorPtr++; - if(aux > max_val) + if (aux > max_val) aux = max_val; - else if(aux < min_val) + else if (aux < min_val) aux = min_val; *outputVectorPtr++ = (int16_t)rintf(aux); } @@ -175,7 +179,7 @@ static inline void volk_gnsssdr_32fc_convert_16ic_u_avx2(lv_16sc_t* outputVector int16_t* outputVectorPtr = (int16_t*)outputVector; float aux; unsigned int i; - const float min_val = (float)SHRT_MIN; ///todo Something off here, compiler does not perform right cast + const float min_val = (float)SHRT_MIN; ///todo Something off here, compiler does not perform right cast const float max_val = (float)SHRT_MAX; __m256 inputVal1, inputVal2; @@ -184,10 +188,12 @@ static inline void volk_gnsssdr_32fc_convert_16ic_u_avx2(lv_16sc_t* outputVector const __m256 vmin_val = _mm256_set1_ps(min_val); const __m256 vmax_val = _mm256_set1_ps(max_val); - for(i = 0; i < avx2_iters; i++) + for (i = 0; i < avx2_iters; i++) { - inputVal1 = _mm256_loadu_ps((float*)inputVectorPtr); inputVectorPtr += 8; - inputVal2 = _mm256_loadu_ps((float*)inputVectorPtr); inputVectorPtr += 8; + inputVal1 = _mm256_loadu_ps((float*)inputVectorPtr); + inputVectorPtr += 8; + inputVal2 = _mm256_loadu_ps((float*)inputVectorPtr); + inputVectorPtr += 8; __VOLK_GNSSSDR_PREFETCH(inputVectorPtr + 16); // Clip @@ -204,12 +210,12 @@ static inline void volk_gnsssdr_32fc_convert_16ic_u_avx2(lv_16sc_t* outputVector outputVectorPtr += 16; } - for(i = avx2_iters * 16; i < num_points * 2; i++) + for (i = avx2_iters * 16; i < num_points * 2; i++) { aux = *inputVectorPtr++; - if(aux > max_val) + if (aux > max_val) aux = max_val; - else if(aux < min_val) + else if (aux < min_val) aux = min_val; *outputVectorPtr++ = (int16_t)rintf(aux); } @@ -238,10 +244,12 @@ static inline void volk_gnsssdr_32fc_convert_16ic_a_sse2(lv_16sc_t* outputVector const __m128 vmin_val = _mm_set_ps1(min_val); const __m128 vmax_val = _mm_set_ps1(max_val); - for(i = 0; i < sse_iters; i++) + for (i = 0; i < sse_iters; i++) { - inputVal1 = _mm_load_ps((float*)inputVectorPtr); inputVectorPtr += 4; - inputVal2 = _mm_load_ps((float*)inputVectorPtr); inputVectorPtr += 4; + inputVal1 = _mm_load_ps((float*)inputVectorPtr); + inputVectorPtr += 4; + inputVal2 = _mm_load_ps((float*)inputVectorPtr); + inputVectorPtr += 4; __VOLK_GNSSSDR_PREFETCH(inputVectorPtr + 8); // Clip @@ -257,12 +265,12 @@ static inline void volk_gnsssdr_32fc_convert_16ic_a_sse2(lv_16sc_t* outputVector outputVectorPtr += 8; } - for(i = sse_iters * 8; i < num_points * 2; i++) + for (i = sse_iters * 8; i < num_points * 2; i++) { aux = *inputVectorPtr++; - if(aux > max_val) + if (aux > max_val) aux = max_val; - else if(aux < min_val) + else if (aux < min_val) aux = min_val; *outputVectorPtr++ = (int16_t)rintf(aux); } @@ -289,10 +297,12 @@ static inline void volk_gnsssdr_32fc_convert_16ic_a_sse(lv_16sc_t* outputVector, const __m128 vmin_val = _mm_set_ps1(min_val); const __m128 vmax_val = _mm_set_ps1(max_val); - for(i = 0; i < sse_iters; i++) + for (i = 0; i < sse_iters; i++) { - inputVal1 = _mm_load_ps((float*)inputVectorPtr); inputVectorPtr += 4; - inputVal2 = _mm_load_ps((float*)inputVectorPtr); inputVectorPtr += 4; + inputVal1 = _mm_load_ps((float*)inputVectorPtr); + inputVectorPtr += 4; + inputVal2 = _mm_load_ps((float*)inputVectorPtr); + inputVectorPtr += 4; __VOLK_GNSSSDR_PREFETCH(inputVectorPtr + 8); // Clip @@ -308,12 +318,12 @@ static inline void volk_gnsssdr_32fc_convert_16ic_a_sse(lv_16sc_t* outputVector, outputVectorPtr += 8; } - for(i = sse_iters * 8; i < num_points * 2; i++) + for (i = sse_iters * 8; i < num_points * 2; i++) { aux = *inputVectorPtr++; - if(aux > max_val) + if (aux > max_val) aux = max_val; - else if(aux < min_val) + else if (aux < min_val) aux = min_val; *outputVectorPtr++ = (int16_t)rintf(aux); } @@ -332,7 +342,7 @@ static inline void volk_gnsssdr_32fc_convert_16ic_a_avx2(lv_16sc_t* outputVector int16_t* outputVectorPtr = (int16_t*)outputVector; float aux; unsigned int i; - const float min_val = (float)SHRT_MIN; ///todo Something off here, compiler does not perform right cast + const float min_val = (float)SHRT_MIN; ///todo Something off here, compiler does not perform right cast const float max_val = (float)SHRT_MAX; __m256 inputVal1, inputVal2; @@ -341,10 +351,12 @@ static inline void volk_gnsssdr_32fc_convert_16ic_a_avx2(lv_16sc_t* outputVector const __m256 vmin_val = _mm256_set1_ps(min_val); const __m256 vmax_val = _mm256_set1_ps(max_val); - for(i = 0; i < avx2_iters; i++) + for (i = 0; i < avx2_iters; i++) { - inputVal1 = _mm256_load_ps((float*)inputVectorPtr); inputVectorPtr += 8; - inputVal2 = _mm256_load_ps((float*)inputVectorPtr); inputVectorPtr += 8; + inputVal1 = _mm256_load_ps((float*)inputVectorPtr); + inputVectorPtr += 8; + inputVal2 = _mm256_load_ps((float*)inputVectorPtr); + inputVectorPtr += 8; __VOLK_GNSSSDR_PREFETCH(inputVectorPtr + 16); // Clip @@ -361,12 +373,12 @@ static inline void volk_gnsssdr_32fc_convert_16ic_a_avx2(lv_16sc_t* outputVector outputVectorPtr += 16; } - for(i = avx2_iters * 16; i < num_points * 2; i++) + for (i = avx2_iters * 16; i < num_points * 2; i++) { aux = *inputVectorPtr++; - if(aux > max_val) + if (aux > max_val) aux = max_val; - else if(aux < min_val) + else if (aux < min_val) aux = min_val; *outputVectorPtr++ = (int16_t)rintf(aux); } @@ -397,10 +409,12 @@ static inline void volk_gnsssdr_32fc_convert_16ic_neon(lv_16sc_t* outputVector, int16x4_t intInputVal1, intInputVal2; int16x8_t res; - for(i = 0; i < neon_iters; i++) + for (i = 0; i < neon_iters; i++) { - a = vld1q_f32((const float32_t*)(inputVectorPtr)); inputVectorPtr += 4; - b = vld1q_f32((const float32_t*)(inputVectorPtr)); inputVectorPtr += 4; + a = vld1q_f32((const float32_t*)(inputVectorPtr)); + inputVectorPtr += 4; + b = vld1q_f32((const float32_t*)(inputVectorPtr)); + inputVectorPtr += 4; __VOLK_GNSSSDR_PREFETCH(inputVectorPtr + 8); ret1 = vmaxq_f32(vminq_f32(a, max_val), min_val); @@ -425,12 +439,12 @@ static inline void volk_gnsssdr_32fc_convert_16ic_neon(lv_16sc_t* outputVector, outputVectorPtr += 8; } - for(i = neon_iters * 8; i < num_points * 2; i++) + for (i = neon_iters * 8; i < num_points * 2; i++) { aux = *inputVectorPtr++; - if(aux > max_val_f) + if (aux > max_val_f) aux = max_val_f; - else if(aux < min_val_f) + else if (aux < min_val_f) aux = min_val_f; *outputVectorPtr++ = (int16_t)rintf(aux); } @@ -449,14 +463,14 @@ static inline void volk_gnsssdr_32fc_convert_16ic_generic(lv_16sc_t* outputVecto const float max_val = (float)SHRT_MAX; float aux; unsigned int i; - for(i = 0; i < num_points * 2; i++) + for (i = 0; i < num_points * 2; i++) { aux = *inputVectorPtr++; - if(aux > max_val) + if (aux > max_val) aux = max_val; - else if(aux < min_val) + else if (aux < min_val) aux = min_val; - *outputVectorPtr++ = (int16_t)rintf(aux); + *outputVectorPtr++ = (int16_t)rintf(aux); } } #endif /* LV_HAVE_GENERIC */ diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_convert_8ic.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_convert_8ic.h old mode 100755 new mode 100644 index ca5f13f22..ab8d32e32 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_convert_8ic.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_convert_8ic.h @@ -72,12 +72,12 @@ static inline void volk_gnsssdr_32fc_convert_8ic_generic(lv_8sc_t* outputVector, const float max_val = (float)SCHAR_MAX; float aux; unsigned int i; - for(i = 0; i < num_points * 2; i++) + for (i = 0; i < num_points * 2; i++) { aux = *inputVectorPtr++ * max_val; - if(aux > max_val) + if (aux > max_val) aux = max_val; - else if(aux < min_val) + else if (aux < min_val) aux = min_val; *outputVectorPtr++ = (int8_t)rintf(aux); } @@ -107,12 +107,16 @@ static inline void volk_gnsssdr_32fc_convert_8ic_u_avx2(lv_8sc_t* outputVector, const __m256 vmin_val = _mm256_set1_ps(min_val); const __m256 vmax_val = _mm256_set1_ps(max_val); - for(i = 0; i < avx2_iters; i++) + for (i = 0; i < avx2_iters; i++) { - inputVal1 = _mm256_loadu_ps((float*)inputVectorPtr); inputVectorPtr += 8; - inputVal2 = _mm256_loadu_ps((float*)inputVectorPtr); inputVectorPtr += 8; - inputVal3 = _mm256_loadu_ps((float*)inputVectorPtr); inputVectorPtr += 8; - inputVal4 = _mm256_loadu_ps((float*)inputVectorPtr); inputVectorPtr += 8; + inputVal1 = _mm256_loadu_ps((float*)inputVectorPtr); + inputVectorPtr += 8; + inputVal2 = _mm256_loadu_ps((float*)inputVectorPtr); + inputVectorPtr += 8; + inputVal3 = _mm256_loadu_ps((float*)inputVectorPtr); + inputVectorPtr += 8; + inputVal4 = _mm256_loadu_ps((float*)inputVectorPtr); + inputVectorPtr += 8; __VOLK_GNSSSDR_PREFETCH(inputVectorPtr + 32); inputVal1 = _mm256_mul_ps(inputVal1, vmax_val); @@ -142,12 +146,12 @@ static inline void volk_gnsssdr_32fc_convert_8ic_u_avx2(lv_8sc_t* outputVector, outputVectorPtr += 32; } - for(i = avx2_iters * 32; i < num_points * 2; i++) + for (i = avx2_iters * 32; i < num_points * 2; i++) { aux = *inputVectorPtr++ * max_val; - if(aux > max_val) + if (aux > max_val) aux = max_val; - else if(aux < min_val) + else if (aux < min_val) aux = min_val; *outputVectorPtr++ = (int8_t)rintf(aux); } @@ -177,12 +181,16 @@ static inline void volk_gnsssdr_32fc_convert_8ic_a_avx2(lv_8sc_t* outputVector, const __m256 vmin_val = _mm256_set1_ps(min_val); const __m256 vmax_val = _mm256_set1_ps(max_val); - for(i = 0; i < avx2_iters; i++) + for (i = 0; i < avx2_iters; i++) { - inputVal1 = _mm256_load_ps((float*)inputVectorPtr); inputVectorPtr += 8; - inputVal2 = _mm256_load_ps((float*)inputVectorPtr); inputVectorPtr += 8; - inputVal3 = _mm256_load_ps((float*)inputVectorPtr); inputVectorPtr += 8; - inputVal4 = _mm256_load_ps((float*)inputVectorPtr); inputVectorPtr += 8; + inputVal1 = _mm256_load_ps((float*)inputVectorPtr); + inputVectorPtr += 8; + inputVal2 = _mm256_load_ps((float*)inputVectorPtr); + inputVectorPtr += 8; + inputVal3 = _mm256_load_ps((float*)inputVectorPtr); + inputVectorPtr += 8; + inputVal4 = _mm256_load_ps((float*)inputVectorPtr); + inputVectorPtr += 8; __VOLK_GNSSSDR_PREFETCH(inputVectorPtr + 32); inputVal1 = _mm256_mul_ps(inputVal1, vmax_val); @@ -212,12 +220,12 @@ static inline void volk_gnsssdr_32fc_convert_8ic_a_avx2(lv_8sc_t* outputVector, outputVectorPtr += 32; } - for(i = avx2_iters * 32; i < num_points * 2; i++) + for (i = avx2_iters * 32; i < num_points * 2; i++) { aux = *inputVectorPtr++ * max_val; - if(aux > max_val) + if (aux > max_val) aux = max_val; - else if(aux < min_val) + else if (aux < min_val) aux = min_val; *outputVectorPtr++ = (int8_t)rintf(aux); } @@ -247,12 +255,16 @@ static inline void volk_gnsssdr_32fc_convert_8ic_u_sse2(lv_8sc_t* outputVector, const __m128 vmin_val = _mm_set_ps1(min_val); const __m128 vmax_val = _mm_set_ps1(max_val); - for(i = 0; i < sse_iters; i++) + for (i = 0; i < sse_iters; i++) { - inputVal1 = _mm_loadu_ps((float*)inputVectorPtr); inputVectorPtr += 4; - inputVal2 = _mm_loadu_ps((float*)inputVectorPtr); inputVectorPtr += 4; - inputVal3 = _mm_loadu_ps((float*)inputVectorPtr); inputVectorPtr += 4; - inputVal4 = _mm_loadu_ps((float*)inputVectorPtr); inputVectorPtr += 4; + inputVal1 = _mm_loadu_ps((float*)inputVectorPtr); + inputVectorPtr += 4; + inputVal2 = _mm_loadu_ps((float*)inputVectorPtr); + inputVectorPtr += 4; + inputVal3 = _mm_loadu_ps((float*)inputVectorPtr); + inputVectorPtr += 4; + inputVal4 = _mm_loadu_ps((float*)inputVectorPtr); + inputVectorPtr += 4; inputVal1 = _mm_mul_ps(inputVal1, vmax_val); inputVal2 = _mm_mul_ps(inputVal2, vmax_val); @@ -278,12 +290,12 @@ static inline void volk_gnsssdr_32fc_convert_8ic_u_sse2(lv_8sc_t* outputVector, outputVectorPtr += 16; } - for(i = sse_iters * 16; i < num_points * 2; i++) + for (i = sse_iters * 16; i < num_points * 2; i++) { aux = *inputVectorPtr++ * max_val; - if(aux > max_val) + if (aux > max_val) aux = max_val; - else if(aux < min_val) + else if (aux < min_val) aux = min_val; *outputVectorPtr++ = (int8_t)rintf(aux); } @@ -313,12 +325,16 @@ static inline void volk_gnsssdr_32fc_convert_8ic_a_sse2(lv_8sc_t* outputVector, const __m128 vmin_val = _mm_set_ps1(min_val); const __m128 vmax_val = _mm_set_ps1(max_val); - for(i = 0; i < sse_iters; i++) + for (i = 0; i < sse_iters; i++) { - inputVal1 = _mm_load_ps((float*)inputVectorPtr); inputVectorPtr += 4; - inputVal2 = _mm_load_ps((float*)inputVectorPtr); inputVectorPtr += 4; - inputVal3 = _mm_load_ps((float*)inputVectorPtr); inputVectorPtr += 4; - inputVal4 = _mm_load_ps((float*)inputVectorPtr); inputVectorPtr += 4; + inputVal1 = _mm_load_ps((float*)inputVectorPtr); + inputVectorPtr += 4; + inputVal2 = _mm_load_ps((float*)inputVectorPtr); + inputVectorPtr += 4; + inputVal3 = _mm_load_ps((float*)inputVectorPtr); + inputVectorPtr += 4; + inputVal4 = _mm_load_ps((float*)inputVectorPtr); + inputVectorPtr += 4; inputVal1 = _mm_mul_ps(inputVal1, vmax_val); inputVal2 = _mm_mul_ps(inputVal2, vmax_val); @@ -344,12 +360,12 @@ static inline void volk_gnsssdr_32fc_convert_8ic_a_sse2(lv_8sc_t* outputVector, outputVectorPtr += 16; } - for(i = sse_iters * 16; i < num_points * 2; i++) + for (i = sse_iters * 16; i < num_points * 2; i++) { aux = *inputVectorPtr++ * max_val; - if(aux > max_val) + if (aux > max_val) aux = max_val; - else if(aux < min_val) + else if (aux < min_val) aux = min_val; *outputVectorPtr++ = (int8_t)rintf(aux); } @@ -383,9 +399,10 @@ static inline void volk_gnsssdr_32fc_convert_8ic_neon(lv_8sc_t* outputVector, co int8x8_t res8_1, res8_2; int8x16_t outputVal; - for(i = 0; i < neon_iters; i++) + for (i = 0; i < neon_iters; i++) { - a = vld1q_f32((const float32_t*)inputVectorPtr); inputVectorPtr += 4; + a = vld1q_f32((const float32_t*)inputVectorPtr); + inputVectorPtr += 4; a = vmulq_f32(a, max_val); ret1 = vmaxq_f32(vminq_f32(a, max_val), min_val); sign = vcvtq_f32_u32((vshrq_n_u32(vreinterpretq_u32_f32(ret1), 31))); @@ -394,7 +411,8 @@ static inline void volk_gnsssdr_32fc_convert_8ic_neon(lv_8sc_t* outputVector, co toint_a = vcvtq_s32_f32(Round); intInputVal1 = vqmovn_s32(toint_a); - a = vld1q_f32((const float32_t*)inputVectorPtr); inputVectorPtr += 4; + a = vld1q_f32((const float32_t*)inputVectorPtr); + inputVectorPtr += 4; a = vmulq_f32(a, max_val); ret1 = vmaxq_f32(vminq_f32(a, max_val), min_val); sign = vcvtq_f32_u32((vshrq_n_u32(vreinterpretq_u32_f32(ret1), 31))); @@ -406,7 +424,8 @@ static inline void volk_gnsssdr_32fc_convert_8ic_neon(lv_8sc_t* outputVector, co pack16_8_1 = vcombine_s16(intInputVal1, intInputVal2); res8_1 = vqmovn_s16(pack16_8_1); - a = vld1q_f32((const float32_t*)inputVectorPtr); inputVectorPtr += 4; + a = vld1q_f32((const float32_t*)inputVectorPtr); + inputVectorPtr += 4; a = vmulq_f32(a, max_val); ret1 = vmaxq_f32(vminq_f32(a, max_val), min_val); sign = vcvtq_f32_u32((vshrq_n_u32(vreinterpretq_u32_f32(ret1), 31))); @@ -415,7 +434,8 @@ static inline void volk_gnsssdr_32fc_convert_8ic_neon(lv_8sc_t* outputVector, co toint_a = vcvtq_s32_f32(Round); intInputVal1 = vqmovn_s32(toint_a); - a = vld1q_f32((const float32_t*)inputVectorPtr); inputVectorPtr += 4; + a = vld1q_f32((const float32_t*)inputVectorPtr); + inputVectorPtr += 4; a = vmulq_f32(a, max_val); ret1 = vmaxq_f32(vminq_f32(a, max_val), min_val); sign = vcvtq_f32_u32((vshrq_n_u32(vreinterpretq_u32_f32(ret1), 31))); @@ -433,12 +453,12 @@ static inline void volk_gnsssdr_32fc_convert_8ic_neon(lv_8sc_t* outputVector, co outputVectorPtr += 16; } - for(i = neon_iters * 16; i < num_points * 2; i++) + for (i = neon_iters * 16; i < num_points * 2; i++) { aux = *inputVectorPtr++ * max_val_f; - if(aux > max_val_f) + if (aux > max_val_f) aux = max_val_f; - else if(aux < min_val_f) + else if (aux < min_val_f) aux = min_val_f; *outputVectorPtr++ = (int8_t)rintf(aux); } diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_resamplerxnpuppet_32fc.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_resamplerxnpuppet_32fc.h index 9348c09fc..1655b5ccd 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_resamplerxnpuppet_32fc.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_resamplerxnpuppet_32fc.h @@ -42,31 +42,30 @@ #include - #ifdef LV_HAVE_GENERIC static inline void volk_gnsssdr_32fc_resamplerxnpuppet_32fc_generic(lv_32fc_t* result, const lv_32fc_t* local_code, unsigned int num_points) { int code_length_chips = 2046; - float code_phase_step_chips = ((float)(code_length_chips) + 0.1 )/( (float) num_points ); + float code_phase_step_chips = ((float)(code_length_chips) + 0.1) / ((float)num_points); int num_out_vectors = 3; float rem_code_phase_chips = -0.234; unsigned int n; - float shifts_chips[3] = { -0.1, 0.0, 0.1 }; + float shifts_chips[3] = {-0.1, 0.0, 0.1}; - lv_32fc_t** result_aux = (lv_32fc_t**)volk_gnsssdr_malloc(sizeof(lv_32fc_t*) * num_out_vectors, volk_gnsssdr_get_alignment()); - for(n = 0; n < num_out_vectors; n++) - { - result_aux[n] = (lv_32fc_t*)volk_gnsssdr_malloc(sizeof(lv_32fc_t) * num_points, volk_gnsssdr_get_alignment()); - } + lv_32fc_t** result_aux = (lv_32fc_t**)volk_gnsssdr_malloc(sizeof(lv_32fc_t*) * num_out_vectors, volk_gnsssdr_get_alignment()); + for (n = 0; n < num_out_vectors; n++) + { + result_aux[n] = (lv_32fc_t*)volk_gnsssdr_malloc(sizeof(lv_32fc_t) * num_points, volk_gnsssdr_get_alignment()); + } volk_gnsssdr_32fc_xn_resampler_32fc_xn_generic(result_aux, local_code, rem_code_phase_chips, code_phase_step_chips, shifts_chips, code_length_chips, num_out_vectors, num_points); memcpy((lv_32fc_t*)result, (lv_32fc_t*)result_aux[0], sizeof(lv_32fc_t) * num_points); - for(n = 0; n < num_out_vectors; n++) - { - volk_gnsssdr_free(result_aux[n]); - } + for (n = 0; n < num_out_vectors; n++) + { + volk_gnsssdr_free(result_aux[n]); + } volk_gnsssdr_free(result_aux); } @@ -78,26 +77,26 @@ static inline void volk_gnsssdr_32fc_resamplerxnpuppet_32fc_generic(lv_32fc_t* r static inline void volk_gnsssdr_32fc_resamplerxnpuppet_32fc_a_sse3(lv_32fc_t* result, const lv_32fc_t* local_code, unsigned int num_points) { int code_length_chips = 2046; - float code_phase_step_chips = ((float)(code_length_chips) + 0.1 )/( (float) num_points ); + float code_phase_step_chips = ((float)(code_length_chips) + 0.1) / ((float)num_points); int num_out_vectors = 3; float rem_code_phase_chips = -0.234; unsigned int n; - float shifts_chips[3] = { -0.1, 0.0, 0.1 }; + float shifts_chips[3] = {-0.1, 0.0, 0.1}; - lv_32fc_t** result_aux = (lv_32fc_t**)volk_gnsssdr_malloc(sizeof(lv_32fc_t*) * num_out_vectors, volk_gnsssdr_get_alignment()); - for(n = 0; n < num_out_vectors; n++) - { - result_aux[n] = (lv_32fc_t*)volk_gnsssdr_malloc(sizeof(lv_32fc_t) * num_points, volk_gnsssdr_get_alignment()); - } + lv_32fc_t** result_aux = (lv_32fc_t**)volk_gnsssdr_malloc(sizeof(lv_32fc_t*) * num_out_vectors, volk_gnsssdr_get_alignment()); + for (n = 0; n < num_out_vectors; n++) + { + result_aux[n] = (lv_32fc_t*)volk_gnsssdr_malloc(sizeof(lv_32fc_t) * num_points, volk_gnsssdr_get_alignment()); + } volk_gnsssdr_32fc_xn_resampler_32fc_xn_a_sse3(result_aux, local_code, rem_code_phase_chips, code_phase_step_chips, shifts_chips, code_length_chips, num_out_vectors, num_points); memcpy((lv_32fc_t*)result, (lv_32fc_t*)result_aux[0], sizeof(lv_32fc_t) * num_points); - for(n = 0; n < num_out_vectors; n++) - { - volk_gnsssdr_free(result_aux[n]); - } + for (n = 0; n < num_out_vectors; n++) + { + volk_gnsssdr_free(result_aux[n]); + } volk_gnsssdr_free(result_aux); } @@ -107,26 +106,26 @@ static inline void volk_gnsssdr_32fc_resamplerxnpuppet_32fc_a_sse3(lv_32fc_t* re static inline void volk_gnsssdr_32fc_resamplerxnpuppet_32fc_u_sse3(lv_32fc_t* result, const lv_32fc_t* local_code, unsigned int num_points) { int code_length_chips = 2046; - float code_phase_step_chips = ((float)(code_length_chips) + 0.1 )/( (float) num_points ); + float code_phase_step_chips = ((float)(code_length_chips) + 0.1) / ((float)num_points); int num_out_vectors = 3; float rem_code_phase_chips = -0.234; unsigned int n; - float shifts_chips[3] = { -0.1, 0.0, 0.1 }; + float shifts_chips[3] = {-0.1, 0.0, 0.1}; - lv_32fc_t** result_aux = (lv_32fc_t**)volk_gnsssdr_malloc(sizeof(lv_32fc_t*) * num_out_vectors, volk_gnsssdr_get_alignment()); - for(n = 0; n < num_out_vectors; n++) - { - result_aux[n] = (lv_32fc_t*)volk_gnsssdr_malloc(sizeof(lv_32fc_t) * num_points, volk_gnsssdr_get_alignment()); - } + lv_32fc_t** result_aux = (lv_32fc_t**)volk_gnsssdr_malloc(sizeof(lv_32fc_t*) * num_out_vectors, volk_gnsssdr_get_alignment()); + for (n = 0; n < num_out_vectors; n++) + { + result_aux[n] = (lv_32fc_t*)volk_gnsssdr_malloc(sizeof(lv_32fc_t) * num_points, volk_gnsssdr_get_alignment()); + } volk_gnsssdr_32fc_xn_resampler_32fc_xn_u_sse3(result_aux, local_code, rem_code_phase_chips, code_phase_step_chips, shifts_chips, code_length_chips, num_out_vectors, num_points); memcpy((lv_32fc_t*)result, (lv_32fc_t*)result_aux[0], sizeof(lv_32fc_t) * num_points); - for(n = 0; n < num_out_vectors; n++) - { - volk_gnsssdr_free(result_aux[n]); - } + for (n = 0; n < num_out_vectors; n++) + { + volk_gnsssdr_free(result_aux[n]); + } volk_gnsssdr_free(result_aux); } @@ -137,26 +136,26 @@ static inline void volk_gnsssdr_32fc_resamplerxnpuppet_32fc_u_sse3(lv_32fc_t* re static inline void volk_gnsssdr_32fc_resamplerxnpuppet_32fc_u_sse4_1(lv_32fc_t* result, const lv_32fc_t* local_code, unsigned int num_points) { int code_length_chips = 2046; - float code_phase_step_chips = ((float)(code_length_chips) + 0.1 )/( (float) num_points ); + float code_phase_step_chips = ((float)(code_length_chips) + 0.1) / ((float)num_points); int num_out_vectors = 3; float rem_code_phase_chips = -0.234; unsigned int n; - float shifts_chips[3] = { -0.1, 0.0, 0.1 }; + float shifts_chips[3] = {-0.1, 0.0, 0.1}; - lv_32fc_t** result_aux = (lv_32fc_t**)volk_gnsssdr_malloc(sizeof(lv_32fc_t*) * num_out_vectors, volk_gnsssdr_get_alignment()); - for(n = 0; n < num_out_vectors; n++) - { - result_aux[n] = (lv_32fc_t*)volk_gnsssdr_malloc(sizeof(lv_32fc_t) * num_points, volk_gnsssdr_get_alignment()); - } + lv_32fc_t** result_aux = (lv_32fc_t**)volk_gnsssdr_malloc(sizeof(lv_32fc_t*) * num_out_vectors, volk_gnsssdr_get_alignment()); + for (n = 0; n < num_out_vectors; n++) + { + result_aux[n] = (lv_32fc_t*)volk_gnsssdr_malloc(sizeof(lv_32fc_t) * num_points, volk_gnsssdr_get_alignment()); + } volk_gnsssdr_32fc_xn_resampler_32fc_xn_u_sse4_1(result_aux, local_code, rem_code_phase_chips, code_phase_step_chips, shifts_chips, code_length_chips, num_out_vectors, num_points); memcpy((lv_32fc_t*)result, (lv_32fc_t*)result_aux[0], sizeof(lv_32fc_t) * num_points); - for(n = 0; n < num_out_vectors; n++) - { - volk_gnsssdr_free(result_aux[n]); - } + for (n = 0; n < num_out_vectors; n++) + { + volk_gnsssdr_free(result_aux[n]); + } volk_gnsssdr_free(result_aux); } @@ -166,26 +165,26 @@ static inline void volk_gnsssdr_32fc_resamplerxnpuppet_32fc_u_sse4_1(lv_32fc_t* static inline void volk_gnsssdr_32fc_resamplerxnpuppet_32fc_a_sse4_1(lv_32fc_t* result, const lv_32fc_t* local_code, unsigned int num_points) { int code_length_chips = 2046; - float code_phase_step_chips = ((float)(code_length_chips) + 0.1 )/( (float) num_points ); + float code_phase_step_chips = ((float)(code_length_chips) + 0.1) / ((float)num_points); int num_out_vectors = 3; float rem_code_phase_chips = -0.234; unsigned int n; - float shifts_chips[3] = { -0.1, 0.0, 0.1 }; + float shifts_chips[3] = {-0.1, 0.0, 0.1}; - lv_32fc_t** result_aux = (lv_32fc_t**)volk_gnsssdr_malloc(sizeof(lv_32fc_t*) * num_out_vectors, volk_gnsssdr_get_alignment()); - for(n = 0; n < num_out_vectors; n++) - { - result_aux[n] = (lv_32fc_t*)volk_gnsssdr_malloc(sizeof(lv_32fc_t) * num_points, volk_gnsssdr_get_alignment()); - } + lv_32fc_t** result_aux = (lv_32fc_t**)volk_gnsssdr_malloc(sizeof(lv_32fc_t*) * num_out_vectors, volk_gnsssdr_get_alignment()); + for (n = 0; n < num_out_vectors; n++) + { + result_aux[n] = (lv_32fc_t*)volk_gnsssdr_malloc(sizeof(lv_32fc_t) * num_points, volk_gnsssdr_get_alignment()); + } volk_gnsssdr_32fc_xn_resampler_32fc_xn_a_sse4_1(result_aux, local_code, rem_code_phase_chips, code_phase_step_chips, shifts_chips, code_length_chips, num_out_vectors, num_points); memcpy((lv_32fc_t*)result, (lv_32fc_t*)result_aux[0], sizeof(lv_32fc_t) * num_points); - for(n = 0; n < num_out_vectors; n++) - { - volk_gnsssdr_free(result_aux[n]); - } + for (n = 0; n < num_out_vectors; n++) + { + volk_gnsssdr_free(result_aux[n]); + } volk_gnsssdr_free(result_aux); } @@ -195,26 +194,26 @@ static inline void volk_gnsssdr_32fc_resamplerxnpuppet_32fc_a_sse4_1(lv_32fc_t* static inline void volk_gnsssdr_32fc_resamplerxnpuppet_32fc_a_avx(lv_32fc_t* result, const lv_32fc_t* local_code, unsigned int num_points) { int code_length_chips = 2046; - float code_phase_step_chips = ((float)(code_length_chips) + 0.1 )/( (float) num_points ); + float code_phase_step_chips = ((float)(code_length_chips) + 0.1) / ((float)num_points); int num_out_vectors = 3; float rem_code_phase_chips = -0.234; unsigned int n; - float shifts_chips[3] = { -0.1, 0.0, 0.1 }; + float shifts_chips[3] = {-0.1, 0.0, 0.1}; - lv_32fc_t** result_aux = (lv_32fc_t**)volk_gnsssdr_malloc(sizeof(lv_32fc_t*) * num_out_vectors, volk_gnsssdr_get_alignment()); - for(n = 0; n < num_out_vectors; n++) - { - result_aux[n] = (lv_32fc_t*)volk_gnsssdr_malloc(sizeof(lv_32fc_t) * num_points, volk_gnsssdr_get_alignment()); - } + lv_32fc_t** result_aux = (lv_32fc_t**)volk_gnsssdr_malloc(sizeof(lv_32fc_t*) * num_out_vectors, volk_gnsssdr_get_alignment()); + for (n = 0; n < num_out_vectors; n++) + { + result_aux[n] = (lv_32fc_t*)volk_gnsssdr_malloc(sizeof(lv_32fc_t) * num_points, volk_gnsssdr_get_alignment()); + } volk_gnsssdr_32fc_xn_resampler_32fc_xn_a_avx(result_aux, local_code, rem_code_phase_chips, code_phase_step_chips, shifts_chips, code_length_chips, num_out_vectors, num_points); memcpy((lv_32fc_t*)result, (lv_32fc_t*)result_aux[0], sizeof(lv_32fc_t) * num_points); - for(n = 0; n < num_out_vectors; n++) - { - volk_gnsssdr_free(result_aux[n]); - } + for (n = 0; n < num_out_vectors; n++) + { + volk_gnsssdr_free(result_aux[n]); + } volk_gnsssdr_free(result_aux); } #endif @@ -224,26 +223,26 @@ static inline void volk_gnsssdr_32fc_resamplerxnpuppet_32fc_a_avx(lv_32fc_t* res static inline void volk_gnsssdr_32fc_resamplerxnpuppet_32fc_u_avx(lv_32fc_t* result, const lv_32fc_t* local_code, unsigned int num_points) { int code_length_chips = 2046; - float code_phase_step_chips = ((float)(code_length_chips) + 0.1 )/( (float) num_points ); + float code_phase_step_chips = ((float)(code_length_chips) + 0.1) / ((float)num_points); int num_out_vectors = 3; float rem_code_phase_chips = -0.234; unsigned int n; - float shifts_chips[3] = { -0.1, 0.0, 0.1 }; + float shifts_chips[3] = {-0.1, 0.0, 0.1}; - lv_32fc_t** result_aux = (lv_32fc_t**)volk_gnsssdr_malloc(sizeof(lv_32fc_t*) * num_out_vectors, volk_gnsssdr_get_alignment()); - for(n = 0; n < num_out_vectors; n++) - { - result_aux[n] = (lv_32fc_t*)volk_gnsssdr_malloc(sizeof(lv_32fc_t) * num_points, volk_gnsssdr_get_alignment()); - } + lv_32fc_t** result_aux = (lv_32fc_t**)volk_gnsssdr_malloc(sizeof(lv_32fc_t*) * num_out_vectors, volk_gnsssdr_get_alignment()); + for (n = 0; n < num_out_vectors; n++) + { + result_aux[n] = (lv_32fc_t*)volk_gnsssdr_malloc(sizeof(lv_32fc_t) * num_points, volk_gnsssdr_get_alignment()); + } volk_gnsssdr_32fc_xn_resampler_32fc_xn_u_avx(result_aux, local_code, rem_code_phase_chips, code_phase_step_chips, shifts_chips, code_length_chips, num_out_vectors, num_points); memcpy((lv_32fc_t*)result, (lv_32fc_t*)result_aux[0], sizeof(lv_32fc_t) * num_points); - for(n = 0; n < num_out_vectors; n++) - { - volk_gnsssdr_free(result_aux[n]); - } + for (n = 0; n < num_out_vectors; n++) + { + volk_gnsssdr_free(result_aux[n]); + } volk_gnsssdr_free(result_aux); } #endif @@ -253,26 +252,26 @@ static inline void volk_gnsssdr_32fc_resamplerxnpuppet_32fc_u_avx(lv_32fc_t* res static inline void volk_gnsssdr_32fc_resamplerxnpuppet_32fc_a_avx2(lv_32fc_t* result, const lv_32fc_t* local_code, unsigned int num_points) { int code_length_chips = 2046; - float code_phase_step_chips = ((float)(code_length_chips) + 0.1 )/( (float) num_points ); + float code_phase_step_chips = ((float)(code_length_chips) + 0.1) / ((float)num_points); int num_out_vectors = 3; float rem_code_phase_chips = -0.234; unsigned int n; - float shifts_chips[3] = { -0.1, 0.0, 0.1 }; + float shifts_chips[3] = {-0.1, 0.0, 0.1}; - lv_32fc_t** result_aux = (lv_32fc_t**)volk_gnsssdr_malloc(sizeof(lv_32fc_t*) * num_out_vectors, volk_gnsssdr_get_alignment()); - for(n = 0; n < num_out_vectors; n++) - { - result_aux[n] = (lv_32fc_t*)volk_gnsssdr_malloc(sizeof(lv_32fc_t) * num_points, volk_gnsssdr_get_alignment()); - } + lv_32fc_t** result_aux = (lv_32fc_t**)volk_gnsssdr_malloc(sizeof(lv_32fc_t*) * num_out_vectors, volk_gnsssdr_get_alignment()); + for (n = 0; n < num_out_vectors; n++) + { + result_aux[n] = (lv_32fc_t*)volk_gnsssdr_malloc(sizeof(lv_32fc_t) * num_points, volk_gnsssdr_get_alignment()); + } volk_gnsssdr_32fc_xn_resampler_32fc_xn_a_avx2(result_aux, local_code, rem_code_phase_chips, code_phase_step_chips, shifts_chips, code_length_chips, num_out_vectors, num_points); memcpy((lv_32fc_t*)result, (lv_32fc_t*)result_aux[0], sizeof(lv_32fc_t) * num_points); - for(n = 0; n < num_out_vectors; n++) - { - volk_gnsssdr_free(result_aux[n]); - } + for (n = 0; n < num_out_vectors; n++) + { + volk_gnsssdr_free(result_aux[n]); + } volk_gnsssdr_free(result_aux); } #endif @@ -282,26 +281,26 @@ static inline void volk_gnsssdr_32fc_resamplerxnpuppet_32fc_a_avx2(lv_32fc_t* re static inline void volk_gnsssdr_32fc_resamplerxnpuppet_32fc_u_avx2(lv_32fc_t* result, const lv_32fc_t* local_code, unsigned int num_points) { int code_length_chips = 2046; - float code_phase_step_chips = ((float)(code_length_chips) + 0.1 )/( (float) num_points ); + float code_phase_step_chips = ((float)(code_length_chips) + 0.1) / ((float)num_points); int num_out_vectors = 3; float rem_code_phase_chips = -0.234; unsigned int n; - float shifts_chips[3] = { -0.1, 0.0, 0.1 }; + float shifts_chips[3] = {-0.1, 0.0, 0.1}; - lv_32fc_t** result_aux = (lv_32fc_t**)volk_gnsssdr_malloc(sizeof(lv_32fc_t*) * num_out_vectors, volk_gnsssdr_get_alignment()); - for(n = 0; n < num_out_vectors; n++) - { - result_aux[n] = (lv_32fc_t*)volk_gnsssdr_malloc(sizeof(lv_32fc_t) * num_points, volk_gnsssdr_get_alignment()); - } + lv_32fc_t** result_aux = (lv_32fc_t**)volk_gnsssdr_malloc(sizeof(lv_32fc_t*) * num_out_vectors, volk_gnsssdr_get_alignment()); + for (n = 0; n < num_out_vectors; n++) + { + result_aux[n] = (lv_32fc_t*)volk_gnsssdr_malloc(sizeof(lv_32fc_t) * num_points, volk_gnsssdr_get_alignment()); + } volk_gnsssdr_32fc_xn_resampler_32fc_xn_u_avx2(result_aux, local_code, rem_code_phase_chips, code_phase_step_chips, shifts_chips, code_length_chips, num_out_vectors, num_points); memcpy((lv_32fc_t*)result, (lv_32fc_t*)result_aux[0], sizeof(lv_32fc_t) * num_points); - for(n = 0; n < num_out_vectors; n++) - { - volk_gnsssdr_free(result_aux[n]); - } + for (n = 0; n < num_out_vectors; n++) + { + volk_gnsssdr_free(result_aux[n]); + } volk_gnsssdr_free(result_aux); } #endif @@ -311,28 +310,28 @@ static inline void volk_gnsssdr_32fc_resamplerxnpuppet_32fc_u_avx2(lv_32fc_t* re static inline void volk_gnsssdr_32fc_resamplerxnpuppet_32fc_neon(lv_32fc_t* result, const lv_32fc_t* local_code, unsigned int num_points) { int code_length_chips = 2046; - float code_phase_step_chips = ((float)(code_length_chips) + 0.1 )/( (float) num_points ); + float code_phase_step_chips = ((float)(code_length_chips) + 0.1) / ((float)num_points); int num_out_vectors = 3; float rem_code_phase_chips = -0.234; unsigned int n; - float shifts_chips[3] = { -0.1, 0.0, 0.1 }; + float shifts_chips[3] = {-0.1, 0.0, 0.1}; - lv_32fc_t** result_aux = (lv_32fc_t**)volk_gnsssdr_malloc(sizeof(lv_32fc_t*) * num_out_vectors, volk_gnsssdr_get_alignment()); - for(n = 0; n < num_out_vectors; n++) - { - result_aux[n] = (lv_32fc_t*)volk_gnsssdr_malloc(sizeof(lv_32fc_t) * num_points, volk_gnsssdr_get_alignment()); - } + lv_32fc_t** result_aux = (lv_32fc_t**)volk_gnsssdr_malloc(sizeof(lv_32fc_t*) * num_out_vectors, volk_gnsssdr_get_alignment()); + for (n = 0; n < num_out_vectors; n++) + { + result_aux[n] = (lv_32fc_t*)volk_gnsssdr_malloc(sizeof(lv_32fc_t) * num_points, volk_gnsssdr_get_alignment()); + } volk_gnsssdr_32fc_xn_resampler_32fc_xn_neon(result_aux, local_code, rem_code_phase_chips, code_phase_step_chips, shifts_chips, code_length_chips, num_out_vectors, num_points); memcpy((lv_32fc_t*)result, (lv_32fc_t*)result_aux[0], sizeof(lv_32fc_t) * num_points); - for(n = 0; n < num_out_vectors; n++) - { - volk_gnsssdr_free(result_aux[n]); - } + for (n = 0; n < num_out_vectors; n++) + { + volk_gnsssdr_free(result_aux[n]); + } volk_gnsssdr_free(result_aux); } #endif -#endif // INCLUDED_volk_gnsssdr_32fc_resamplerpuppet_32fc_H +#endif // INCLUDED_volk_gnsssdr_32fc_resamplerpuppet_32fc_H diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_x2_rotator_dot_prod_32fc_xn.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_x2_rotator_dot_prod_32fc_xn.h index a25715749..c3c77233a 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_x2_rotator_dot_prod_32fc_xn.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_x2_rotator_dot_prod_32fc_xn.h @@ -85,11 +85,11 @@ static inline void volk_gnsssdr_32fc_x2_rotator_dot_prod_32fc_xn_generic(lv_32fc unsigned int n; for (n_vec = 0; n_vec < num_a_vectors; n_vec++) { - result[n_vec] = lv_cmake(0,0); + result[n_vec] = lv_cmake(0, 0); } for (n = 0; n < num_points; n++) { - tmp32_1 = *in_common++ * (*phase);//if(n<10 || n >= 8108) printf("generic phase %i: %f,%f\n", n,lv_creal(*phase),lv_cimag(*phase)); + tmp32_1 = *in_common++ * (*phase); //if(n<10 || n >= 8108) printf("generic phase %i: %f,%f\n", n,lv_creal(*phase),lv_cimag(*phase)); // Regenerate phase if (n % 256 == 0) @@ -126,7 +126,7 @@ static inline void volk_gnsssdr_32fc_x2_rotator_dot_prod_32fc_xn_generic_reload( unsigned int j; for (n_vec = 0; n_vec < num_a_vectors; n_vec++) { - result[n_vec] = lv_cmake(0,0); + result[n_vec] = lv_cmake(0, 0); } for (n = 0; n < num_points / ROTATOR_RELOAD; n++) @@ -141,7 +141,7 @@ static inline void volk_gnsssdr_32fc_x2_rotator_dot_prod_32fc_xn_generic_reload( result[n_vec] += tmp32_2; } } - /* Regenerate phase */ + /* Regenerate phase */ #ifdef __cplusplus (*phase) /= std::abs((*phase)); #else @@ -169,7 +169,7 @@ static inline void volk_gnsssdr_32fc_x2_rotator_dot_prod_32fc_xn_generic_reload( #include static inline void volk_gnsssdr_32fc_x2_rotator_dot_prod_32fc_xn_u_sse3(lv_32fc_t* result, const lv_32fc_t* in_common, const lv_32fc_t phase_inc, lv_32fc_t* phase, const lv_32fc_t** in_a, int num_a_vectors, unsigned int num_points) { - lv_32fc_t dotProduct = lv_cmake(0,0); + lv_32fc_t dotProduct = lv_cmake(0, 0); lv_32fc_t tmp32_1, tmp32_2; const unsigned int sse_iters = num_points / 2; int n_vec; @@ -179,7 +179,8 @@ static inline void volk_gnsssdr_32fc_x2_rotator_dot_prod_32fc_xn_u_sse3(lv_32fc_ const lv_32fc_t** _in_a = in_a; const lv_32fc_t* _in_common = in_common; - __VOLK_ATTR_ALIGNED(16) lv_32fc_t dotProductVector[2]; + __VOLK_ATTR_ALIGNED(16) + lv_32fc_t dotProductVector[2]; __m128* acc = (__m128*)volk_gnsssdr_malloc(num_a_vectors * sizeof(__m128), volk_gnsssdr_get_alignment()); @@ -191,11 +192,13 @@ static inline void volk_gnsssdr_32fc_x2_rotator_dot_prod_32fc_xn_u_sse3(lv_32fc_ // phase rotation registers __m128 a, two_phase_acc_reg, two_phase_inc_reg, yl, yh, tmp1, tmp1p, tmp2, tmp2p, z1; - __VOLK_ATTR_ALIGNED(16) lv_32fc_t two_phase_inc[2]; + __VOLK_ATTR_ALIGNED(16) + lv_32fc_t two_phase_inc[2]; two_phase_inc[0] = phase_inc * phase_inc; two_phase_inc[1] = phase_inc * phase_inc; - two_phase_inc_reg = _mm_load_ps((float*) two_phase_inc); - __VOLK_ATTR_ALIGNED(16) lv_32fc_t two_phase_acc[2]; + two_phase_inc_reg = _mm_load_ps((float*)two_phase_inc); + __VOLK_ATTR_ALIGNED(16) + lv_32fc_t two_phase_acc[2]; two_phase_acc[0] = (*phase); two_phase_acc[1] = (*phase) * phase_inc; two_phase_acc_reg = _mm_load_ps((float*)two_phase_acc); @@ -203,12 +206,12 @@ static inline void volk_gnsssdr_32fc_x2_rotator_dot_prod_32fc_xn_u_sse3(lv_32fc_ const __m128 ylp = _mm_moveldup_ps(two_phase_inc_reg); const __m128 yhp = _mm_movehdup_ps(two_phase_inc_reg); - for(number = 0; number < sse_iters; number++) + for (number = 0; number < sse_iters; number++) { // Phase rotation on operand in_common starts here: a = _mm_loadu_ps((float*)_in_common); - // __VOLK_GNSSSDR_PREFETCH(_in_common + 4); - yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr + // __VOLK_GNSSSDR_PREFETCH(_in_common + 4); + yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr yh = _mm_movehdup_ps(two_phase_acc_reg); tmp1 = _mm_mul_ps(a, yl); tmp1p = _mm_mul_ps(two_phase_acc_reg, ylp); @@ -219,7 +222,7 @@ static inline void volk_gnsssdr_32fc_x2_rotator_dot_prod_32fc_xn_u_sse3(lv_32fc_ z1 = _mm_addsub_ps(tmp1, tmp2); two_phase_acc_reg = _mm_addsub_ps(tmp1p, tmp2p); - yl = _mm_moveldup_ps(z1); // Load yl with cr,cr,dr,dr + yl = _mm_moveldup_ps(z1); // Load yl with cr,cr,dr,dr yh = _mm_movehdup_ps(z1); //next two samples @@ -227,7 +230,7 @@ static inline void volk_gnsssdr_32fc_x2_rotator_dot_prod_32fc_xn_u_sse3(lv_32fc_ for (n_vec = 0; n_vec < num_a_vectors; n_vec++) { - a = _mm_loadu_ps((float*)&(_in_a[n_vec][number*2])); + a = _mm_loadu_ps((float*)&(_in_a[n_vec][number * 2])); tmp1 = _mm_mul_ps(a, yl); a = _mm_shuffle_ps(a, a, 0xB1); tmp2 = _mm_mul_ps(a, yh); @@ -247,8 +250,8 @@ static inline void volk_gnsssdr_32fc_x2_rotator_dot_prod_32fc_xn_u_sse3(lv_32fc_ for (n_vec = 0; n_vec < num_a_vectors; n_vec++) { - _mm_store_ps((float*)dotProductVector, acc[n_vec]); // Store the results back into the dot product vector - dotProduct = lv_cmake(0,0); + _mm_store_ps((float*)dotProductVector, acc[n_vec]); // Store the results back into the dot product vector + dotProduct = lv_cmake(0, 0); for (i = 0; i < 2; ++i) { dotProduct = dotProduct + dotProductVector[i]; @@ -260,7 +263,7 @@ static inline void volk_gnsssdr_32fc_x2_rotator_dot_prod_32fc_xn_u_sse3(lv_32fc_ _mm_store_ps((float*)two_phase_acc, two_phase_acc_reg); (*phase) = two_phase_acc[0]; - for(n = sse_iters * 2; n < num_points; n++) + for (n = sse_iters * 2; n < num_points; n++) { tmp32_1 = in_common[n] * (*phase); (*phase) *= phase_inc; @@ -278,7 +281,7 @@ static inline void volk_gnsssdr_32fc_x2_rotator_dot_prod_32fc_xn_u_sse3(lv_32fc_ #include static inline void volk_gnsssdr_32fc_x2_rotator_dot_prod_32fc_xn_a_sse3(lv_32fc_t* result, const lv_32fc_t* in_common, const lv_32fc_t phase_inc, lv_32fc_t* phase, const lv_32fc_t** in_a, int num_a_vectors, unsigned int num_points) { - lv_32fc_t dotProduct = lv_cmake(0,0); + lv_32fc_t dotProduct = lv_cmake(0, 0); lv_32fc_t tmp32_1, tmp32_2; const unsigned int sse_iters = num_points / 2; int n_vec; @@ -288,7 +291,8 @@ static inline void volk_gnsssdr_32fc_x2_rotator_dot_prod_32fc_xn_a_sse3(lv_32fc_ const lv_32fc_t** _in_a = in_a; const lv_32fc_t* _in_common = in_common; - __VOLK_ATTR_ALIGNED(16) lv_32fc_t dotProductVector[2]; + __VOLK_ATTR_ALIGNED(16) + lv_32fc_t dotProductVector[2]; __m128* acc = (__m128*)volk_gnsssdr_malloc(num_a_vectors * sizeof(__m128), volk_gnsssdr_get_alignment()); @@ -300,11 +304,13 @@ static inline void volk_gnsssdr_32fc_x2_rotator_dot_prod_32fc_xn_a_sse3(lv_32fc_ // phase rotation registers __m128 a, two_phase_acc_reg, two_phase_inc_reg, yl, yh, tmp1, tmp1p, tmp2, tmp2p, z1; - __VOLK_ATTR_ALIGNED(16) lv_32fc_t two_phase_inc[2]; + __VOLK_ATTR_ALIGNED(16) + lv_32fc_t two_phase_inc[2]; two_phase_inc[0] = phase_inc * phase_inc; two_phase_inc[1] = phase_inc * phase_inc; - two_phase_inc_reg = _mm_load_ps((float*) two_phase_inc); - __VOLK_ATTR_ALIGNED(16) lv_32fc_t two_phase_acc[2]; + two_phase_inc_reg = _mm_load_ps((float*)two_phase_inc); + __VOLK_ATTR_ALIGNED(16) + lv_32fc_t two_phase_acc[2]; two_phase_acc[0] = (*phase); two_phase_acc[1] = (*phase) * phase_inc; two_phase_acc_reg = _mm_load_ps((float*)two_phase_acc); @@ -312,12 +318,12 @@ static inline void volk_gnsssdr_32fc_x2_rotator_dot_prod_32fc_xn_a_sse3(lv_32fc_ const __m128 ylp = _mm_moveldup_ps(two_phase_inc_reg); const __m128 yhp = _mm_movehdup_ps(two_phase_inc_reg); - for(number = 0; number < sse_iters; number++) + for (number = 0; number < sse_iters; number++) { // Phase rotation on operand in_common starts here: a = _mm_load_ps((float*)_in_common); - // __VOLK_GNSSSDR_PREFETCH(_in_common + 4); - yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr + // __VOLK_GNSSSDR_PREFETCH(_in_common + 4); + yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr yh = _mm_movehdup_ps(two_phase_acc_reg); tmp1 = _mm_mul_ps(a, yl); tmp1p = _mm_mul_ps(two_phase_acc_reg, ylp); @@ -328,7 +334,7 @@ static inline void volk_gnsssdr_32fc_x2_rotator_dot_prod_32fc_xn_a_sse3(lv_32fc_ z1 = _mm_addsub_ps(tmp1, tmp2); two_phase_acc_reg = _mm_addsub_ps(tmp1p, tmp2p); - yl = _mm_moveldup_ps(z1); // Load yl with cr,cr,dr,dr + yl = _mm_moveldup_ps(z1); // Load yl with cr,cr,dr,dr yh = _mm_movehdup_ps(z1); //next two samples @@ -336,7 +342,7 @@ static inline void volk_gnsssdr_32fc_x2_rotator_dot_prod_32fc_xn_a_sse3(lv_32fc_ for (n_vec = 0; n_vec < num_a_vectors; n_vec++) { - a = _mm_load_ps((float*)&(_in_a[n_vec][number*2])); + a = _mm_load_ps((float*)&(_in_a[n_vec][number * 2])); tmp1 = _mm_mul_ps(a, yl); a = _mm_shuffle_ps(a, a, 0xB1); tmp2 = _mm_mul_ps(a, yh); @@ -356,8 +362,8 @@ static inline void volk_gnsssdr_32fc_x2_rotator_dot_prod_32fc_xn_a_sse3(lv_32fc_ for (n_vec = 0; n_vec < num_a_vectors; n_vec++) { - _mm_store_ps((float*)dotProductVector, acc[n_vec]); // Store the results back into the dot product vector - dotProduct = lv_cmake(0,0); + _mm_store_ps((float*)dotProductVector, acc[n_vec]); // Store the results back into the dot product vector + dotProduct = lv_cmake(0, 0); for (i = 0; i < 2; ++i) { dotProduct = dotProduct + dotProductVector[i]; @@ -369,7 +375,7 @@ static inline void volk_gnsssdr_32fc_x2_rotator_dot_prod_32fc_xn_a_sse3(lv_32fc_ _mm_store_ps((float*)two_phase_acc, two_phase_acc_reg); (*phase) = two_phase_acc[0]; - for(n = sse_iters * 2; n < num_points; n++) + for (n = sse_iters * 2; n < num_points; n++) { tmp32_1 = in_common[n] * (*phase); (*phase) *= phase_inc; @@ -387,7 +393,7 @@ static inline void volk_gnsssdr_32fc_x2_rotator_dot_prod_32fc_xn_a_sse3(lv_32fc_ #include static inline void volk_gnsssdr_32fc_x2_rotator_dot_prod_32fc_xn_u_avx(lv_32fc_t* result, const lv_32fc_t* in_common, const lv_32fc_t phase_inc, lv_32fc_t* phase, const lv_32fc_t** in_a, int num_a_vectors, unsigned int num_points) { - lv_32fc_t dotProduct = lv_cmake(0,0); + lv_32fc_t dotProduct = lv_cmake(0, 0); lv_32fc_t tmp32_1, tmp32_2; const unsigned int avx_iters = num_points / 4; int n_vec; @@ -398,7 +404,8 @@ static inline void volk_gnsssdr_32fc_x2_rotator_dot_prod_32fc_xn_u_avx(lv_32fc_t const lv_32fc_t* _in_common = in_common; lv_32fc_t _phase = (*phase); - __VOLK_ATTR_ALIGNED(32) lv_32fc_t dotProductVector[4]; + __VOLK_ATTR_ALIGNED(32) + lv_32fc_t dotProductVector[4]; __m256* acc = (__m256*)volk_gnsssdr_malloc(num_a_vectors * sizeof(__m256), volk_gnsssdr_get_alignment()); @@ -431,12 +438,12 @@ static inline void volk_gnsssdr_32fc_x2_rotator_dot_prod_32fc_xn_u_avx(lv_32fc_t const __m256 ylp = _mm256_moveldup_ps(four_phase_inc_reg); const __m256 yhp = _mm256_movehdup_ps(four_phase_inc_reg); - for(number = 0; number < avx_iters; number++) + for (number = 0; number < avx_iters; number++) { // Phase rotation on operand in_common starts here: a = _mm256_loadu_ps((float*)_in_common); __VOLK_GNSSSDR_PREFETCH(_in_common + 16); - yl = _mm256_moveldup_ps(four_phase_acc_reg); // Load yl with cr,cr,dr,dr + yl = _mm256_moveldup_ps(four_phase_acc_reg); // Load yl with cr,cr,dr,dr yh = _mm256_movehdup_ps(four_phase_acc_reg); tmp1 = _mm256_mul_ps(a, yl); tmp1p = _mm256_mul_ps(four_phase_acc_reg, ylp); @@ -447,7 +454,7 @@ static inline void volk_gnsssdr_32fc_x2_rotator_dot_prod_32fc_xn_u_avx(lv_32fc_t z = _mm256_addsub_ps(tmp1, tmp2); four_phase_acc_reg = _mm256_addsub_ps(tmp1p, tmp2p); - yl = _mm256_moveldup_ps(z); // Load yl with cr,cr,dr,dr + yl = _mm256_moveldup_ps(z); // Load yl with cr,cr,dr,dr yh = _mm256_movehdup_ps(z); //next two samples @@ -475,8 +482,8 @@ static inline void volk_gnsssdr_32fc_x2_rotator_dot_prod_32fc_xn_u_avx(lv_32fc_t for (n_vec = 0; n_vec < num_a_vectors; n_vec++) { - _mm256_store_ps((float*)dotProductVector, acc[n_vec]); // Store the results back into the dot product vector - dotProduct = lv_cmake(0,0); + _mm256_store_ps((float*)dotProductVector, acc[n_vec]); // Store the results back into the dot product vector + dotProduct = lv_cmake(0, 0); for (i = 0; i < 4; ++i) { dotProduct = dotProduct + dotProductVector[i]; @@ -492,10 +499,10 @@ static inline void volk_gnsssdr_32fc_x2_rotator_dot_prod_32fc_xn_u_avx(lv_32fc_t four_phase_acc_reg = _mm256_div_ps(four_phase_acc_reg, tmp2); _mm256_store_ps((float*)four_phase_acc, four_phase_acc_reg); - _phase = four_phase_acc[0]; + _phase = four_phase_acc[0]; _mm256_zeroupper(); - for(n = avx_iters * 4; n < num_points; n++) + for (n = avx_iters * 4; n < num_points; n++) { tmp32_1 = *_in_common++ * _phase; _phase *= phase_inc; @@ -514,7 +521,7 @@ static inline void volk_gnsssdr_32fc_x2_rotator_dot_prod_32fc_xn_u_avx(lv_32fc_t #include static inline void volk_gnsssdr_32fc_x2_rotator_dot_prod_32fc_xn_a_avx(lv_32fc_t* result, const lv_32fc_t* in_common, const lv_32fc_t phase_inc, lv_32fc_t* phase, const lv_32fc_t** in_a, int num_a_vectors, unsigned int num_points) { - lv_32fc_t dotProduct = lv_cmake(0,0); + lv_32fc_t dotProduct = lv_cmake(0, 0); lv_32fc_t tmp32_1, tmp32_2; const unsigned int avx_iters = num_points / 4; int n_vec; @@ -525,7 +532,8 @@ static inline void volk_gnsssdr_32fc_x2_rotator_dot_prod_32fc_xn_a_avx(lv_32fc_t const lv_32fc_t* _in_common = in_common; lv_32fc_t _phase = (*phase); - __VOLK_ATTR_ALIGNED(32) lv_32fc_t dotProductVector[4]; + __VOLK_ATTR_ALIGNED(32) + lv_32fc_t dotProductVector[4]; __m256* acc = (__m256*)volk_gnsssdr_malloc(num_a_vectors * sizeof(__m256), volk_gnsssdr_get_alignment()); @@ -538,7 +546,8 @@ static inline void volk_gnsssdr_32fc_x2_rotator_dot_prod_32fc_xn_a_avx(lv_32fc_t // phase rotation registers __m256 a, four_phase_acc_reg, yl, yh, tmp1, tmp1p, tmp2, tmp2p, z; - __VOLK_ATTR_ALIGNED(32) lv_32fc_t four_phase_inc[4]; + __VOLK_ATTR_ALIGNED(32) + lv_32fc_t four_phase_inc[4]; const lv_32fc_t phase_inc2 = phase_inc * phase_inc; const lv_32fc_t phase_inc3 = phase_inc2 * phase_inc; const lv_32fc_t phase_inc4 = phase_inc3 * phase_inc; @@ -548,7 +557,8 @@ static inline void volk_gnsssdr_32fc_x2_rotator_dot_prod_32fc_xn_a_avx(lv_32fc_t four_phase_inc[3] = phase_inc4; const __m256 four_phase_inc_reg = _mm256_load_ps((float*)four_phase_inc); - __VOLK_ATTR_ALIGNED(32) lv_32fc_t four_phase_acc[4]; + __VOLK_ATTR_ALIGNED(32) + lv_32fc_t four_phase_acc[4]; four_phase_acc[0] = _phase; four_phase_acc[1] = _phase * phase_inc; four_phase_acc[2] = _phase * phase_inc2; @@ -558,12 +568,12 @@ static inline void volk_gnsssdr_32fc_x2_rotator_dot_prod_32fc_xn_a_avx(lv_32fc_t const __m256 ylp = _mm256_moveldup_ps(four_phase_inc_reg); const __m256 yhp = _mm256_movehdup_ps(four_phase_inc_reg); - for(number = 0; number < avx_iters; number++) + for (number = 0; number < avx_iters; number++) { // Phase rotation on operand in_common starts here: a = _mm256_load_ps((float*)_in_common); __VOLK_GNSSSDR_PREFETCH(_in_common + 16); - yl = _mm256_moveldup_ps(four_phase_acc_reg); // Load yl with cr,cr,dr,dr + yl = _mm256_moveldup_ps(four_phase_acc_reg); // Load yl with cr,cr,dr,dr yh = _mm256_movehdup_ps(four_phase_acc_reg); tmp1 = _mm256_mul_ps(a, yl); tmp1p = _mm256_mul_ps(four_phase_acc_reg, ylp); @@ -574,7 +584,7 @@ static inline void volk_gnsssdr_32fc_x2_rotator_dot_prod_32fc_xn_a_avx(lv_32fc_t z = _mm256_addsub_ps(tmp1, tmp2); four_phase_acc_reg = _mm256_addsub_ps(tmp1p, tmp2p); - yl = _mm256_moveldup_ps(z); // Load yl with cr,cr,dr,dr + yl = _mm256_moveldup_ps(z); // Load yl with cr,cr,dr,dr yh = _mm256_movehdup_ps(z); //next two samples @@ -602,8 +612,8 @@ static inline void volk_gnsssdr_32fc_x2_rotator_dot_prod_32fc_xn_a_avx(lv_32fc_t for (n_vec = 0; n_vec < num_a_vectors; n_vec++) { - _mm256_store_ps((float*)dotProductVector, acc[n_vec]); // Store the results back into the dot product vector - dotProduct = lv_cmake(0,0); + _mm256_store_ps((float*)dotProductVector, acc[n_vec]); // Store the results back into the dot product vector + dotProduct = lv_cmake(0, 0); for (i = 0; i < 4; ++i) { dotProduct = dotProduct + dotProductVector[i]; @@ -619,10 +629,10 @@ static inline void volk_gnsssdr_32fc_x2_rotator_dot_prod_32fc_xn_a_avx(lv_32fc_t four_phase_acc_reg = _mm256_div_ps(four_phase_acc_reg, tmp2); _mm256_store_ps((float*)four_phase_acc, four_phase_acc_reg); - _phase = four_phase_acc[0]; + _phase = four_phase_acc[0]; _mm256_zeroupper(); - for(n = avx_iters * 4; n < num_points; n++) + for (n = avx_iters * 4; n < num_points; n++) { tmp32_1 = *_in_common++ * _phase; _phase *= phase_inc; @@ -646,7 +656,7 @@ static inline void volk_gnsssdr_32fc_x2_rotator_dot_prod_32fc_xn_neon(lv_32fc_t* int n_vec; int i; unsigned int number; - unsigned int n ; + unsigned int n; const lv_32fc_t** _in_a = in_a; const lv_32fc_t* _in_common = in_common; lv_32fc_t* _out = result; @@ -656,36 +666,41 @@ static inline void volk_gnsssdr_32fc_x2_rotator_dot_prod_32fc_xn_neon(lv_32fc_t* if (neon_iters > 0) { - lv_32fc_t dotProduct = lv_cmake(0,0); + lv_32fc_t dotProduct = lv_cmake(0, 0); float32_t arg_phase0 = cargf(_phase); float32_t arg_phase_inc = cargf(phase_inc); float32_t phase_est; lv_32fc_t ___phase4 = phase_inc * phase_inc * phase_inc * phase_inc; - __VOLK_ATTR_ALIGNED(16) float32_t __phase4_real[4] = { lv_creal(___phase4), lv_creal(___phase4), lv_creal(___phase4), lv_creal(___phase4) }; - __VOLK_ATTR_ALIGNED(16) float32_t __phase4_imag[4] = { lv_cimag(___phase4), lv_cimag(___phase4), lv_cimag(___phase4), lv_cimag(___phase4) }; + __VOLK_ATTR_ALIGNED(16) + float32_t __phase4_real[4] = {lv_creal(___phase4), lv_creal(___phase4), lv_creal(___phase4), lv_creal(___phase4)}; + __VOLK_ATTR_ALIGNED(16) + float32_t __phase4_imag[4] = {lv_cimag(___phase4), lv_cimag(___phase4), lv_cimag(___phase4), lv_cimag(___phase4)}; float32x4_t _phase4_real = vld1q_f32(__phase4_real); float32x4_t _phase4_imag = vld1q_f32(__phase4_imag); - lv_32fc_t phase2 = (lv_32fc_t)(_phase) * phase_inc; + lv_32fc_t phase2 = (lv_32fc_t)(_phase)*phase_inc; lv_32fc_t phase3 = phase2 * phase_inc; lv_32fc_t phase4 = phase3 * phase_inc; - __VOLK_ATTR_ALIGNED(16) float32_t __phase_real[4] = { lv_creal((_phase)), lv_creal(phase2), lv_creal(phase3), lv_creal(phase4) }; - __VOLK_ATTR_ALIGNED(16) float32_t __phase_imag[4] = { lv_cimag((_phase)), lv_cimag(phase2), lv_cimag(phase3), lv_cimag(phase4) }; + __VOLK_ATTR_ALIGNED(16) + float32_t __phase_real[4] = {lv_creal((_phase)), lv_creal(phase2), lv_creal(phase3), lv_creal(phase4)}; + __VOLK_ATTR_ALIGNED(16) + float32_t __phase_imag[4] = {lv_cimag((_phase)), lv_cimag(phase2), lv_cimag(phase3), lv_cimag(phase4)}; float32x4_t _phase_real = vld1q_f32(__phase_real); float32x4_t _phase_imag = vld1q_f32(__phase_imag); - __VOLK_ATTR_ALIGNED(32) lv_32fc_t dotProductVector[4]; + __VOLK_ATTR_ALIGNED(32) + lv_32fc_t dotProductVector[4]; float32x4x2_t a_val, b_val, tmp32_real, tmp32_imag; float32x4x2_t* accumulator1 = (float32x4x2_t*)volk_gnsssdr_malloc(num_a_vectors * sizeof(float32x4x2_t), volk_gnsssdr_get_alignment()); float32x4x2_t* accumulator2 = (float32x4x2_t*)volk_gnsssdr_malloc(num_a_vectors * sizeof(float32x4x2_t), volk_gnsssdr_get_alignment()); - for(n_vec = 0; n_vec < num_a_vectors; n_vec++) + for (n_vec = 0; n_vec < num_a_vectors; n_vec++) { accumulator1[n_vec].val[0] = vdupq_n_f32(0.0f); accumulator1[n_vec].val[1] = vdupq_n_f32(0.0f); @@ -693,7 +708,7 @@ static inline void volk_gnsssdr_32fc_x2_rotator_dot_prod_32fc_xn_neon(lv_32fc_t* accumulator2[n_vec].val[1] = vdupq_n_f32(0.0f); } - for(number = 0; number < neon_iters; number++) + for (number = 0; number < neon_iters; number++) { /* load 4 complex numbers (float 32 bits each component) */ b_val = vld2q_f32((float32_t*)_in_common); @@ -728,8 +743,10 @@ static inline void volk_gnsssdr_32fc_x2_rotator_dot_prod_32fc_xn_neon(lv_32fc_t* phase3 = phase2 * phase_inc; phase4 = phase3 * phase_inc; - __VOLK_ATTR_ALIGNED(16) float32_t ____phase_real[4] = { lv_creal((_phase)), lv_creal(phase2), lv_creal(phase3), lv_creal(phase4) }; - __VOLK_ATTR_ALIGNED(16) float32_t ____phase_imag[4] = { lv_cimag((_phase)), lv_cimag(phase2), lv_cimag(phase3), lv_cimag(phase4) }; + __VOLK_ATTR_ALIGNED(16) + float32_t ____phase_real[4] = {lv_creal((_phase)), lv_creal(phase2), lv_creal(phase3), lv_creal(phase4)}; + __VOLK_ATTR_ALIGNED(16) + float32_t ____phase_imag[4] = {lv_cimag((_phase)), lv_cimag(phase2), lv_cimag(phase3), lv_cimag(phase4)}; _phase_real = vld1q_f32(____phase_real); _phase_imag = vld1q_f32(____phase_imag); @@ -753,8 +770,8 @@ static inline void volk_gnsssdr_32fc_x2_rotator_dot_prod_32fc_xn_neon(lv_32fc_t* } for (n_vec = 0; n_vec < num_a_vectors; n_vec++) { - vst2q_f32((float32_t*)dotProductVector, accumulator1[n_vec]); // Store the results back into the dot product vector - dotProduct = lv_cmake(0,0); + vst2q_f32((float32_t*)dotProductVector, accumulator1[n_vec]); // Store the results back into the dot product vector + dotProduct = lv_cmake(0, 0); for (i = 0; i < 4; ++i) { dotProduct = dotProduct + dotProductVector[i]; @@ -770,7 +787,7 @@ static inline void volk_gnsssdr_32fc_x2_rotator_dot_prod_32fc_xn_neon(lv_32fc_t* _phase = lv_cmake((float32_t)__phase_real[0], (float32_t)__phase_imag[0]); } - for(n = neon_iters * 4; n < num_points; n++) + for (n = neon_iters * 4; n < num_points; n++) { tmp32_1 = in_common[n] * _phase; _phase *= phase_inc; @@ -786,4 +803,3 @@ static inline void volk_gnsssdr_32fc_x2_rotator_dot_prod_32fc_xn_neon(lv_32fc_t* #endif /* LV_HAVE_NEON */ #endif /* INCLUDED_volk_gnsssdr_32fc_x2_rotator_dot_prod_32fc_xn_H */ - diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_x2_rotator_dotprodxnpuppet_32fc.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_x2_rotator_dotprodxnpuppet_32fc.h index 3072542cf..846539fc9 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_x2_rotator_dotprodxnpuppet_32fc.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_x2_rotator_dotprodxnpuppet_32fc.h @@ -41,7 +41,7 @@ #include #ifdef LV_HAVE_GENERIC -static inline void volk_gnsssdr_32fc_x2_rotator_dotprodxnpuppet_32fc_generic(lv_32fc_t* result, const lv_32fc_t* local_code, const lv_32fc_t* in, unsigned int num_points) +static inline void volk_gnsssdr_32fc_x2_rotator_dotprodxnpuppet_32fc_generic(lv_32fc_t* result, const lv_32fc_t* local_code, const lv_32fc_t* in, unsigned int num_points) { // phases must be normalized. Phase rotator expects a complex exponential input! float rem_carrier_phase_in_rad = 0.25; @@ -53,14 +53,14 @@ static inline void volk_gnsssdr_32fc_x2_rotator_dotprodxnpuppet_32fc_generic(lv_ unsigned int n; int num_a_vectors = 3; lv_32fc_t** in_a = (lv_32fc_t**)volk_gnsssdr_malloc(sizeof(lv_32fc_t*) * num_a_vectors, volk_gnsssdr_get_alignment()); - for(n = 0; n < num_a_vectors; n++) + for (n = 0; n < num_a_vectors; n++) { in_a[n] = (lv_32fc_t*)volk_gnsssdr_malloc(sizeof(lv_32fc_t) * num_points, volk_gnsssdr_get_alignment()); memcpy((lv_32fc_t*)in_a[n], (lv_32fc_t*)in, sizeof(lv_32fc_t) * num_points); } - volk_gnsssdr_32fc_x2_rotator_dot_prod_32fc_xn_generic_reload(result, local_code, phase_inc[0], phase, (const lv_32fc_t**) in_a, num_a_vectors, num_points); + volk_gnsssdr_32fc_x2_rotator_dot_prod_32fc_xn_generic_reload(result, local_code, phase_inc[0], phase, (const lv_32fc_t**)in_a, num_a_vectors, num_points); - for(n = 0; n < num_a_vectors; n++) + for (n = 0; n < num_a_vectors; n++) { volk_gnsssdr_free(in_a[n]); } @@ -71,7 +71,7 @@ static inline void volk_gnsssdr_32fc_x2_rotator_dotprodxnpuppet_32fc_generic(lv_ #ifdef LV_HAVE_GENERIC -static inline void volk_gnsssdr_32fc_x2_rotator_dotprodxnpuppet_32fc_generic_reload(lv_32fc_t* result, const lv_32fc_t* local_code, const lv_32fc_t* in, unsigned int num_points) +static inline void volk_gnsssdr_32fc_x2_rotator_dotprodxnpuppet_32fc_generic_reload(lv_32fc_t* result, const lv_32fc_t* local_code, const lv_32fc_t* in, unsigned int num_points) { // phases must be normalized. Phase rotator expects a complex exponential input! float rem_carrier_phase_in_rad = 0.25; @@ -83,14 +83,14 @@ static inline void volk_gnsssdr_32fc_x2_rotator_dotprodxnpuppet_32fc_generic_rel unsigned int n; int num_a_vectors = 3; lv_32fc_t** in_a = (lv_32fc_t**)volk_gnsssdr_malloc(sizeof(lv_32fc_t*) * num_a_vectors, volk_gnsssdr_get_alignment()); - for(n = 0; n < num_a_vectors; n++) + for (n = 0; n < num_a_vectors; n++) { in_a[n] = (lv_32fc_t*)volk_gnsssdr_malloc(sizeof(lv_32fc_t) * num_points, volk_gnsssdr_get_alignment()); memcpy((lv_32fc_t*)in_a[n], (lv_32fc_t*)in, sizeof(lv_32fc_t) * num_points); } - volk_gnsssdr_32fc_x2_rotator_dot_prod_32fc_xn_generic_reload(result, local_code, phase_inc[0], phase, (const lv_32fc_t**) in_a, num_a_vectors, num_points); + volk_gnsssdr_32fc_x2_rotator_dot_prod_32fc_xn_generic_reload(result, local_code, phase_inc[0], phase, (const lv_32fc_t**)in_a, num_a_vectors, num_points); - for(n = 0; n < num_a_vectors; n++) + for (n = 0; n < num_a_vectors; n++) { volk_gnsssdr_free(in_a[n]); } @@ -101,7 +101,7 @@ static inline void volk_gnsssdr_32fc_x2_rotator_dotprodxnpuppet_32fc_generic_rel #ifdef LV_HAVE_SSE3 -static inline void volk_gnsssdr_32fc_x2_rotator_dotprodxnpuppet_32fc_u_sse3(lv_32fc_t* result, const lv_32fc_t* local_code, const lv_32fc_t* in, unsigned int num_points) +static inline void volk_gnsssdr_32fc_x2_rotator_dotprodxnpuppet_32fc_u_sse3(lv_32fc_t* result, const lv_32fc_t* local_code, const lv_32fc_t* in, unsigned int num_points) { // phases must be normalized. Phase rotator expects a complex exponential input! float rem_carrier_phase_in_rad = 0.25; @@ -113,14 +113,14 @@ static inline void volk_gnsssdr_32fc_x2_rotator_dotprodxnpuppet_32fc_u_sse3(lv_3 unsigned int n; int num_a_vectors = 3; lv_32fc_t** in_a = (lv_32fc_t**)volk_gnsssdr_malloc(sizeof(lv_32fc_t*) * num_a_vectors, volk_gnsssdr_get_alignment()); - for(n = 0; n < num_a_vectors; n++) + for (n = 0; n < num_a_vectors; n++) { in_a[n] = (lv_32fc_t*)volk_gnsssdr_malloc(sizeof(lv_32fc_t) * num_points, volk_gnsssdr_get_alignment()); memcpy((lv_32fc_t*)in_a[n], (lv_32fc_t*)in, sizeof(lv_32fc_t) * num_points); } - volk_gnsssdr_32fc_x2_rotator_dot_prod_32fc_xn_u_sse3(result, local_code, phase_inc[0], phase, (const lv_32fc_t**) in_a, num_a_vectors, num_points); + volk_gnsssdr_32fc_x2_rotator_dot_prod_32fc_xn_u_sse3(result, local_code, phase_inc[0], phase, (const lv_32fc_t**)in_a, num_a_vectors, num_points); - for(n = 0; n < num_a_vectors; n++) + for (n = 0; n < num_a_vectors; n++) { volk_gnsssdr_free(in_a[n]); } @@ -131,7 +131,7 @@ static inline void volk_gnsssdr_32fc_x2_rotator_dotprodxnpuppet_32fc_u_sse3(lv_3 #ifdef LV_HAVE_SSE3 -static inline void volk_gnsssdr_32fc_x2_rotator_dotprodxnpuppet_32fc_a_sse3(lv_32fc_t* result, const lv_32fc_t* local_code, const lv_32fc_t* in, unsigned int num_points) +static inline void volk_gnsssdr_32fc_x2_rotator_dotprodxnpuppet_32fc_a_sse3(lv_32fc_t* result, const lv_32fc_t* local_code, const lv_32fc_t* in, unsigned int num_points) { // phases must be normalized. Phase rotator expects a complex exponential input! float rem_carrier_phase_in_rad = 0.25; @@ -143,14 +143,14 @@ static inline void volk_gnsssdr_32fc_x2_rotator_dotprodxnpuppet_32fc_a_sse3(lv_3 unsigned int n; int num_a_vectors = 3; lv_32fc_t** in_a = (lv_32fc_t**)volk_gnsssdr_malloc(sizeof(lv_32fc_t*) * num_a_vectors, volk_gnsssdr_get_alignment()); - for(n = 0; n < num_a_vectors; n++) + for (n = 0; n < num_a_vectors; n++) { in_a[n] = (lv_32fc_t*)volk_gnsssdr_malloc(sizeof(lv_32fc_t) * num_points, volk_gnsssdr_get_alignment()); memcpy((lv_32fc_t*)in_a[n], (lv_32fc_t*)in, sizeof(lv_32fc_t) * num_points); } - volk_gnsssdr_32fc_x2_rotator_dot_prod_32fc_xn_a_sse3(result, local_code, phase_inc[0], phase, (const lv_32fc_t**) in_a, num_a_vectors, num_points); + volk_gnsssdr_32fc_x2_rotator_dot_prod_32fc_xn_a_sse3(result, local_code, phase_inc[0], phase, (const lv_32fc_t**)in_a, num_a_vectors, num_points); - for(n = 0; n < num_a_vectors; n++) + for (n = 0; n < num_a_vectors; n++) { volk_gnsssdr_free(in_a[n]); } @@ -161,7 +161,7 @@ static inline void volk_gnsssdr_32fc_x2_rotator_dotprodxnpuppet_32fc_a_sse3(lv_3 #ifdef LV_HAVE_AVX -static inline void volk_gnsssdr_32fc_x2_rotator_dotprodxnpuppet_32fc_u_avx(lv_32fc_t* result, const lv_32fc_t* local_code, const lv_32fc_t* in, unsigned int num_points) +static inline void volk_gnsssdr_32fc_x2_rotator_dotprodxnpuppet_32fc_u_avx(lv_32fc_t* result, const lv_32fc_t* local_code, const lv_32fc_t* in, unsigned int num_points) { // phases must be normalized. Phase rotator expects a complex exponential input! float rem_carrier_phase_in_rad = 0.25; @@ -173,14 +173,14 @@ static inline void volk_gnsssdr_32fc_x2_rotator_dotprodxnpuppet_32fc_u_avx(lv_32 unsigned int n; int num_a_vectors = 3; lv_32fc_t** in_a = (lv_32fc_t**)volk_gnsssdr_malloc(sizeof(lv_32fc_t*) * num_a_vectors, volk_gnsssdr_get_alignment()); - for(n = 0; n < num_a_vectors; n++) + for (n = 0; n < num_a_vectors; n++) { in_a[n] = (lv_32fc_t*)volk_gnsssdr_malloc(sizeof(lv_32fc_t) * num_points, volk_gnsssdr_get_alignment()); memcpy((lv_32fc_t*)in_a[n], (lv_32fc_t*)in, sizeof(lv_32fc_t) * num_points); } - volk_gnsssdr_32fc_x2_rotator_dot_prod_32fc_xn_u_avx(result, local_code, phase_inc[0], phase, (const lv_32fc_t**) in_a, num_a_vectors, num_points); + volk_gnsssdr_32fc_x2_rotator_dot_prod_32fc_xn_u_avx(result, local_code, phase_inc[0], phase, (const lv_32fc_t**)in_a, num_a_vectors, num_points); - for(n = 0; n < num_a_vectors; n++) + for (n = 0; n < num_a_vectors; n++) { volk_gnsssdr_free(in_a[n]); } @@ -191,7 +191,7 @@ static inline void volk_gnsssdr_32fc_x2_rotator_dotprodxnpuppet_32fc_u_avx(lv_32 #ifdef LV_HAVE_AVX -static inline void volk_gnsssdr_32fc_x2_rotator_dotprodxnpuppet_32fc_a_avx(lv_32fc_t* result, const lv_32fc_t* local_code, const lv_32fc_t* in, unsigned int num_points) +static inline void volk_gnsssdr_32fc_x2_rotator_dotprodxnpuppet_32fc_a_avx(lv_32fc_t* result, const lv_32fc_t* local_code, const lv_32fc_t* in, unsigned int num_points) { // phases must be normalized. Phase rotator expects a complex exponential input! float rem_carrier_phase_in_rad = 0.25; @@ -203,14 +203,14 @@ static inline void volk_gnsssdr_32fc_x2_rotator_dotprodxnpuppet_32fc_a_avx(lv_32 unsigned int n; int num_a_vectors = 3; lv_32fc_t** in_a = (lv_32fc_t**)volk_gnsssdr_malloc(sizeof(lv_32fc_t*) * num_a_vectors, volk_gnsssdr_get_alignment()); - for(n = 0; n < num_a_vectors; n++) + for (n = 0; n < num_a_vectors; n++) { in_a[n] = (lv_32fc_t*)volk_gnsssdr_malloc(sizeof(lv_32fc_t) * num_points, volk_gnsssdr_get_alignment()); memcpy((lv_32fc_t*)in_a[n], (lv_32fc_t*)in, sizeof(lv_32fc_t) * num_points); } - volk_gnsssdr_32fc_x2_rotator_dot_prod_32fc_xn_a_avx(result, local_code, phase_inc[0], phase, (const lv_32fc_t**) in_a, num_a_vectors, num_points); + volk_gnsssdr_32fc_x2_rotator_dot_prod_32fc_xn_a_avx(result, local_code, phase_inc[0], phase, (const lv_32fc_t**)in_a, num_a_vectors, num_points); - for(n = 0; n < num_a_vectors; n++) + for (n = 0; n < num_a_vectors; n++) { volk_gnsssdr_free(in_a[n]); } @@ -221,7 +221,7 @@ static inline void volk_gnsssdr_32fc_x2_rotator_dotprodxnpuppet_32fc_a_avx(lv_32 #ifdef LV_HAVE_NEON -static inline void volk_gnsssdr_32fc_x2_rotator_dotprodxnpuppet_32fc_neon(lv_32fc_t* result, const lv_32fc_t* local_code, const lv_32fc_t* in, unsigned int num_points) +static inline void volk_gnsssdr_32fc_x2_rotator_dotprodxnpuppet_32fc_neon(lv_32fc_t* result, const lv_32fc_t* local_code, const lv_32fc_t* in, unsigned int num_points) { // phases must be normalized. Phase rotator expects a complex exponential input! float rem_carrier_phase_in_rad = 0.25; @@ -233,14 +233,14 @@ static inline void volk_gnsssdr_32fc_x2_rotator_dotprodxnpuppet_32fc_neon(lv_32f unsigned int n; int num_a_vectors = 3; lv_32fc_t** in_a = (lv_32fc_t**)volk_gnsssdr_malloc(sizeof(lv_32fc_t*) * num_a_vectors, volk_gnsssdr_get_alignment()); - for(n = 0; n < num_a_vectors; n++) + for (n = 0; n < num_a_vectors; n++) { in_a[n] = (lv_32fc_t*)volk_gnsssdr_malloc(sizeof(lv_32fc_t) * num_points, volk_gnsssdr_get_alignment()); memcpy((lv_32fc_t*)in_a[n], (lv_32fc_t*)in, sizeof(lv_32fc_t) * num_points); } - volk_gnsssdr_32fc_x2_rotator_dot_prod_32fc_xn_neon(result, local_code, phase_inc[0], phase, (const lv_32fc_t**) in_a, num_a_vectors, num_points); + volk_gnsssdr_32fc_x2_rotator_dot_prod_32fc_xn_neon(result, local_code, phase_inc[0], phase, (const lv_32fc_t**)in_a, num_a_vectors, num_points); - for(n = 0; n < num_a_vectors; n++) + for (n = 0; n < num_a_vectors; n++) { volk_gnsssdr_free(in_a[n]); } diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_xn_resampler_32fc_xn.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_xn_resampler_32fc_xn.h index f8db65944..3e6227a17 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_xn_resampler_32fc_xn.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_xn_resampler_32fc_xn.h @@ -107,7 +107,8 @@ static inline void volk_gnsssdr_32fc_xn_resampler_32fc_xn_a_sse3(lv_32fc_t** res const __m128 rem_code_phase_chips_reg = _mm_set_ps1(rem_code_phase_chips); const __m128 code_phase_step_chips_reg = _mm_set_ps1(code_phase_step_chips); - __VOLK_ATTR_ALIGNED(16) int local_code_chip_index[4]; + __VOLK_ATTR_ALIGNED(16) + int local_code_chip_index[4]; int local_code_chip_index_; const __m128i zeros = _mm_setzero_si128(); @@ -121,7 +122,7 @@ static inline void volk_gnsssdr_32fc_xn_resampler_32fc_xn_a_sse3(lv_32fc_t** res shifts_chips_reg = _mm_set_ps1((float)shifts_chips[current_correlator_tap]); aux2 = _mm_sub_ps(shifts_chips_reg, rem_code_phase_chips_reg); __m128 indexn = _mm_set_ps(3.0f, 2.0f, 1.0f, 0.0f); - for(n = 0; n < quarterPoints; n++) + for (n = 0; n < quarterPoints; n++) { aux = _mm_mul_ps(code_phase_step_chips_reg, indexn); aux = _mm_add_ps(aux, aux2); @@ -142,18 +143,18 @@ static inline void volk_gnsssdr_32fc_xn_resampler_32fc_xn_a_sse3(lv_32fc_t** res aux_i = _mm_and_si128(code_length_chips_reg_i, negatives); local_code_chip_index_reg = _mm_add_epi32(local_code_chip_index_reg, aux_i); _mm_store_si128((__m128i*)local_code_chip_index, local_code_chip_index_reg); - for(k = 0; k < 4; ++k) + for (k = 0; k < 4; ++k) { _result[current_correlator_tap][n * 4 + k] = local_code[local_code_chip_index[k]]; } indexn = _mm_add_ps(indexn, fours); } - for(n = quarterPoints * 4; n < num_points; n++) + for (n = quarterPoints * 4; n < num_points; n++) { // resample code for current tap local_code_chip_index_ = (int)floor(code_phase_step_chips * (float)n + shifts_chips[current_correlator_tap] - rem_code_phase_chips); //Take into account that in multitap correlators, the shifts can be negative! - if (local_code_chip_index_ < 0) local_code_chip_index_ += (int)code_length_chips * (abs(local_code_chip_index_) / code_length_chips + 1) ; + if (local_code_chip_index_ < 0) local_code_chip_index_ += (int)code_length_chips * (abs(local_code_chip_index_) / code_length_chips + 1); local_code_chip_index_ = local_code_chip_index_ % code_length_chips; _result[current_correlator_tap][n] = local_code[local_code_chip_index_]; } @@ -177,7 +178,8 @@ static inline void volk_gnsssdr_32fc_xn_resampler_32fc_xn_u_sse3(lv_32fc_t** res const __m128 rem_code_phase_chips_reg = _mm_set_ps1(rem_code_phase_chips); const __m128 code_phase_step_chips_reg = _mm_set_ps1(code_phase_step_chips); - __VOLK_ATTR_ALIGNED(16) int local_code_chip_index[4]; + __VOLK_ATTR_ALIGNED(16) + int local_code_chip_index[4]; int local_code_chip_index_; const __m128i zeros = _mm_setzero_si128(); @@ -191,7 +193,7 @@ static inline void volk_gnsssdr_32fc_xn_resampler_32fc_xn_u_sse3(lv_32fc_t** res shifts_chips_reg = _mm_set_ps1((float)shifts_chips[current_correlator_tap]); aux2 = _mm_sub_ps(shifts_chips_reg, rem_code_phase_chips_reg); __m128 indexn = _mm_set_ps(3.0f, 2.0f, 1.0f, 0.0f); - for(n = 0; n < quarterPoints; n++) + for (n = 0; n < quarterPoints; n++) { aux = _mm_mul_ps(code_phase_step_chips_reg, indexn); aux = _mm_add_ps(aux, aux2); @@ -212,18 +214,18 @@ static inline void volk_gnsssdr_32fc_xn_resampler_32fc_xn_u_sse3(lv_32fc_t** res aux_i = _mm_and_si128(code_length_chips_reg_i, negatives); local_code_chip_index_reg = _mm_add_epi32(local_code_chip_index_reg, aux_i); _mm_store_si128((__m128i*)local_code_chip_index, local_code_chip_index_reg); - for(k = 0; k < 4; ++k) + for (k = 0; k < 4; ++k) { _result[current_correlator_tap][n * 4 + k] = local_code[local_code_chip_index[k]]; } indexn = _mm_add_ps(indexn, fours); } - for(n = quarterPoints * 4; n < num_points; n++) + for (n = quarterPoints * 4; n < num_points; n++) { // resample code for current tap local_code_chip_index_ = (int)floor(code_phase_step_chips * (float)n + shifts_chips[current_correlator_tap] - rem_code_phase_chips); //Take into account that in multitap correlators, the shifts can be negative! - if (local_code_chip_index_ < 0) local_code_chip_index_ += (int)code_length_chips * (abs(local_code_chip_index_) / code_length_chips + 1) ; + if (local_code_chip_index_ < 0) local_code_chip_index_ += (int)code_length_chips * (abs(local_code_chip_index_) / code_length_chips + 1); local_code_chip_index_ = local_code_chip_index_ % code_length_chips; _result[current_correlator_tap][n] = local_code[local_code_chip_index_]; } @@ -245,7 +247,8 @@ static inline void volk_gnsssdr_32fc_xn_resampler_32fc_xn_a_sse4_1(lv_32fc_t** r const __m128 rem_code_phase_chips_reg = _mm_set_ps1(rem_code_phase_chips); const __m128 code_phase_step_chips_reg = _mm_set_ps1(code_phase_step_chips); - __VOLK_ATTR_ALIGNED(16) int local_code_chip_index[4]; + __VOLK_ATTR_ALIGNED(16) + int local_code_chip_index[4]; int local_code_chip_index_; const __m128i zeros = _mm_setzero_si128(); @@ -259,7 +262,7 @@ static inline void volk_gnsssdr_32fc_xn_resampler_32fc_xn_a_sse4_1(lv_32fc_t** r shifts_chips_reg = _mm_set_ps1((float)shifts_chips[current_correlator_tap]); aux2 = _mm_sub_ps(shifts_chips_reg, rem_code_phase_chips_reg); __m128 indexn = _mm_set_ps(3.0f, 2.0f, 1.0f, 0.0f); - for(n = 0; n < quarterPoints; n++) + for (n = 0; n < quarterPoints; n++) { aux = _mm_mul_ps(code_phase_step_chips_reg, indexn); aux = _mm_add_ps(aux, aux2); @@ -277,18 +280,18 @@ static inline void volk_gnsssdr_32fc_xn_resampler_32fc_xn_a_sse4_1(lv_32fc_t** r aux_i = _mm_and_si128(code_length_chips_reg_i, negatives); local_code_chip_index_reg = _mm_add_epi32(local_code_chip_index_reg, aux_i); _mm_store_si128((__m128i*)local_code_chip_index, local_code_chip_index_reg); - for(k = 0; k < 4; ++k) + for (k = 0; k < 4; ++k) { _result[current_correlator_tap][n * 4 + k] = local_code[local_code_chip_index[k]]; } indexn = _mm_add_ps(indexn, fours); } - for(n = quarterPoints * 4; n < num_points; n++) + for (n = quarterPoints * 4; n < num_points; n++) { // resample code for current tap local_code_chip_index_ = (int)floor(code_phase_step_chips * (float)n + shifts_chips[current_correlator_tap] - rem_code_phase_chips); //Take into account that in multitap correlators, the shifts can be negative! - if (local_code_chip_index_ < 0) local_code_chip_index_ += (int)code_length_chips * (abs(local_code_chip_index_) / code_length_chips + 1) ; + if (local_code_chip_index_ < 0) local_code_chip_index_ += (int)code_length_chips * (abs(local_code_chip_index_) / code_length_chips + 1); local_code_chip_index_ = local_code_chip_index_ % code_length_chips; _result[current_correlator_tap][n] = local_code[local_code_chip_index_]; } @@ -311,7 +314,8 @@ static inline void volk_gnsssdr_32fc_xn_resampler_32fc_xn_u_sse4_1(lv_32fc_t** r const __m128 rem_code_phase_chips_reg = _mm_set_ps1(rem_code_phase_chips); const __m128 code_phase_step_chips_reg = _mm_set_ps1(code_phase_step_chips); - __VOLK_ATTR_ALIGNED(16) int local_code_chip_index[4]; + __VOLK_ATTR_ALIGNED(16) + int local_code_chip_index[4]; int local_code_chip_index_; const __m128i zeros = _mm_setzero_si128(); @@ -325,7 +329,7 @@ static inline void volk_gnsssdr_32fc_xn_resampler_32fc_xn_u_sse4_1(lv_32fc_t** r shifts_chips_reg = _mm_set_ps1((float)shifts_chips[current_correlator_tap]); aux2 = _mm_sub_ps(shifts_chips_reg, rem_code_phase_chips_reg); __m128 indexn = _mm_set_ps(3.0f, 2.0f, 1.0f, 0.0f); - for(n = 0; n < quarterPoints; n++) + for (n = 0; n < quarterPoints; n++) { aux = _mm_mul_ps(code_phase_step_chips_reg, indexn); aux = _mm_add_ps(aux, aux2); @@ -343,18 +347,18 @@ static inline void volk_gnsssdr_32fc_xn_resampler_32fc_xn_u_sse4_1(lv_32fc_t** r aux_i = _mm_and_si128(code_length_chips_reg_i, negatives); local_code_chip_index_reg = _mm_add_epi32(local_code_chip_index_reg, aux_i); _mm_store_si128((__m128i*)local_code_chip_index, local_code_chip_index_reg); - for(k = 0; k < 4; ++k) + for (k = 0; k < 4; ++k) { _result[current_correlator_tap][n * 4 + k] = local_code[local_code_chip_index[k]]; } indexn = _mm_add_ps(indexn, fours); } - for(n = quarterPoints * 4; n < num_points; n++) + for (n = quarterPoints * 4; n < num_points; n++) { // resample code for current tap local_code_chip_index_ = (int)floor(code_phase_step_chips * (float)n + shifts_chips[current_correlator_tap] - rem_code_phase_chips); //Take into account that in multitap correlators, the shifts can be negative! - if (local_code_chip_index_ < 0) local_code_chip_index_ += (int)code_length_chips * (abs(local_code_chip_index_) / code_length_chips + 1) ; + if (local_code_chip_index_ < 0) local_code_chip_index_ += (int)code_length_chips * (abs(local_code_chip_index_) / code_length_chips + 1); local_code_chip_index_ = local_code_chip_index_ % code_length_chips; _result[current_correlator_tap][n] = local_code[local_code_chip_index_]; } @@ -377,7 +381,8 @@ static inline void volk_gnsssdr_32fc_xn_resampler_32fc_xn_a_avx(lv_32fc_t** resu const __m256 rem_code_phase_chips_reg = _mm256_set1_ps(rem_code_phase_chips); const __m256 code_phase_step_chips_reg = _mm256_set1_ps(code_phase_step_chips); - __VOLK_ATTR_ALIGNED(32) int local_code_chip_index[8]; + __VOLK_ATTR_ALIGNED(32) + int local_code_chip_index[8]; int local_code_chip_index_; const __m256 zeros = _mm256_setzero_ps(); @@ -392,7 +397,7 @@ static inline void volk_gnsssdr_32fc_xn_resampler_32fc_xn_a_avx(lv_32fc_t** resu shifts_chips_reg = _mm256_set1_ps((float)shifts_chips[current_correlator_tap]); aux2 = _mm256_sub_ps(shifts_chips_reg, rem_code_phase_chips_reg); indexn = n0; - for(n = 0; n < avx_iters; n++) + for (n = 0; n < avx_iters; n++) { __VOLK_GNSSSDR_PREFETCH_LOCALITY(&_result[current_correlator_tap][8 * n + 7], 1, 0); __VOLK_GNSSSDR_PREFETCH_LOCALITY(&local_code_chip_index[8], 1, 3); @@ -410,13 +415,13 @@ static inline void volk_gnsssdr_32fc_xn_resampler_32fc_xn_a_avx(lv_32fc_t** resu // no negatives c = _mm256_cvtepi32_ps(local_code_chip_index_reg); - negatives = _mm256_cmp_ps(c, zeros, 0x01 ); + negatives = _mm256_cmp_ps(c, zeros, 0x01); aux3 = _mm256_and_ps(code_length_chips_reg_f, negatives); aux = _mm256_add_ps(c, aux3); local_code_chip_index_reg = _mm256_cvttps_epi32(aux); _mm256_store_si256((__m256i*)local_code_chip_index, local_code_chip_index_reg); - for(k = 0; k < 8; ++k) + for (k = 0; k < 8; ++k) { _result[current_correlator_tap][n * 8 + k] = local_code[local_code_chip_index[k]]; } @@ -426,12 +431,12 @@ static inline void volk_gnsssdr_32fc_xn_resampler_32fc_xn_a_avx(lv_32fc_t** resu _mm256_zeroupper(); for (current_correlator_tap = 0; current_correlator_tap < num_out_vectors; current_correlator_tap++) { - for(n = avx_iters * 8; n < num_points; n++) + for (n = avx_iters * 8; n < num_points; n++) { // resample code for current tap local_code_chip_index_ = (int)floor(code_phase_step_chips * (float)n + shifts_chips[current_correlator_tap] - rem_code_phase_chips); //Take into account that in multitap correlators, the shifts can be negative! - if (local_code_chip_index_ < 0) local_code_chip_index_ += (int)code_length_chips * (abs(local_code_chip_index_) / code_length_chips + 1) ; + if (local_code_chip_index_ < 0) local_code_chip_index_ += (int)code_length_chips * (abs(local_code_chip_index_) / code_length_chips + 1); local_code_chip_index_ = local_code_chip_index_ % code_length_chips; _result[current_correlator_tap][n] = local_code[local_code_chip_index_]; } @@ -454,7 +459,8 @@ static inline void volk_gnsssdr_32fc_xn_resampler_32fc_xn_u_avx(lv_32fc_t** resu const __m256 rem_code_phase_chips_reg = _mm256_set1_ps(rem_code_phase_chips); const __m256 code_phase_step_chips_reg = _mm256_set1_ps(code_phase_step_chips); - __VOLK_ATTR_ALIGNED(32) int local_code_chip_index[8]; + __VOLK_ATTR_ALIGNED(32) + int local_code_chip_index[8]; int local_code_chip_index_; const __m256 zeros = _mm256_setzero_ps(); @@ -469,7 +475,7 @@ static inline void volk_gnsssdr_32fc_xn_resampler_32fc_xn_u_avx(lv_32fc_t** resu shifts_chips_reg = _mm256_set1_ps((float)shifts_chips[current_correlator_tap]); aux2 = _mm256_sub_ps(shifts_chips_reg, rem_code_phase_chips_reg); indexn = n0; - for(n = 0; n < avx_iters; n++) + for (n = 0; n < avx_iters; n++) { __VOLK_GNSSSDR_PREFETCH_LOCALITY(&_result[current_correlator_tap][8 * n + 7], 1, 0); __VOLK_GNSSSDR_PREFETCH_LOCALITY(&local_code_chip_index[8], 1, 3); @@ -487,13 +493,13 @@ static inline void volk_gnsssdr_32fc_xn_resampler_32fc_xn_u_avx(lv_32fc_t** resu // no negatives c = _mm256_cvtepi32_ps(local_code_chip_index_reg); - negatives = _mm256_cmp_ps(c, zeros, 0x01 ); + negatives = _mm256_cmp_ps(c, zeros, 0x01); aux3 = _mm256_and_ps(code_length_chips_reg_f, negatives); aux = _mm256_add_ps(c, aux3); local_code_chip_index_reg = _mm256_cvttps_epi32(aux); _mm256_store_si256((__m256i*)local_code_chip_index, local_code_chip_index_reg); - for(k = 0; k < 8; ++k) + for (k = 0; k < 8; ++k) { _result[current_correlator_tap][n * 8 + k] = local_code[local_code_chip_index[k]]; } @@ -503,12 +509,12 @@ static inline void volk_gnsssdr_32fc_xn_resampler_32fc_xn_u_avx(lv_32fc_t** resu _mm256_zeroupper(); for (current_correlator_tap = 0; current_correlator_tap < num_out_vectors; current_correlator_tap++) { - for(n = avx_iters * 8; n < num_points; n++) + for (n = avx_iters * 8; n < num_points; n++) { // resample code for current tap local_code_chip_index_ = (int)floor(code_phase_step_chips * (float)n + shifts_chips[current_correlator_tap] - rem_code_phase_chips); //Take into account that in multitap correlators, the shifts can be negative! - if (local_code_chip_index_ < 0) local_code_chip_index_ += (int)code_length_chips * (abs(local_code_chip_index_) / code_length_chips + 1) ; + if (local_code_chip_index_ < 0) local_code_chip_index_ += (int)code_length_chips * (abs(local_code_chip_index_) / code_length_chips + 1); local_code_chip_index_ = local_code_chip_index_ % code_length_chips; _result[current_correlator_tap][n] = local_code[local_code_chip_index_]; } @@ -531,7 +537,8 @@ static inline void volk_gnsssdr_32fc_xn_resampler_32fc_xn_u_avx2(lv_32fc_t** res const __m256 rem_code_phase_chips_reg = _mm256_set1_ps(rem_code_phase_chips); const __m256 code_phase_step_chips_reg = _mm256_set1_ps(code_phase_step_chips); - __VOLK_ATTR_ALIGNED(32) int local_code_chip_index[8]; + __VOLK_ATTR_ALIGNED(32) + int local_code_chip_index[8]; int local_code_chip_index_; const __m256 zeros = _mm256_setzero_ps(); @@ -546,7 +553,7 @@ static inline void volk_gnsssdr_32fc_xn_resampler_32fc_xn_u_avx2(lv_32fc_t** res shifts_chips_reg = _mm256_set1_ps((float)shifts_chips[current_correlator_tap]); aux2 = _mm256_sub_ps(shifts_chips_reg, rem_code_phase_chips_reg); indexn = n0; - for(n = 0; n < avx_iters; n++) + for (n = 0; n < avx_iters; n++) { __VOLK_GNSSSDR_PREFETCH_LOCALITY(&_result[current_correlator_tap][8 * n + 7], 1, 0); __VOLK_GNSSSDR_PREFETCH_LOCALITY(&local_code_chip_index[8], 1, 3); @@ -565,13 +572,13 @@ static inline void volk_gnsssdr_32fc_xn_resampler_32fc_xn_u_avx2(lv_32fc_t** res // no negatives c = _mm256_cvtepi32_ps(local_code_chip_index_reg); - negatives = _mm256_cmp_ps(c, zeros, 0x01 ); + negatives = _mm256_cmp_ps(c, zeros, 0x01); aux3 = _mm256_and_ps(code_length_chips_reg_f, negatives); aux = _mm256_add_ps(c, aux3); local_code_chip_index_reg = _mm256_cvttps_epi32(aux); _mm256_store_si256((__m256i*)local_code_chip_index, local_code_chip_index_reg); - for(k = 0; k < 8; ++k) + for (k = 0; k < 8; ++k) { _result[current_correlator_tap][n * 8 + k] = local_code[local_code_chip_index[k]]; } @@ -581,12 +588,12 @@ static inline void volk_gnsssdr_32fc_xn_resampler_32fc_xn_u_avx2(lv_32fc_t** res _mm256_zeroupper(); for (current_correlator_tap = 0; current_correlator_tap < num_out_vectors; current_correlator_tap++) { - for(n = avx_iters * 8; n < num_points; n++) + for (n = avx_iters * 8; n < num_points; n++) { // resample code for current tap local_code_chip_index_ = (int)floor(code_phase_step_chips * (float)n + shifts_chips[current_correlator_tap] - rem_code_phase_chips); //Take into account that in multitap correlators, the shifts can be negative! - if (local_code_chip_index_ < 0) local_code_chip_index_ += (int)code_length_chips * (abs(local_code_chip_index_) / code_length_chips + 1) ; + if (local_code_chip_index_ < 0) local_code_chip_index_ += (int)code_length_chips * (abs(local_code_chip_index_) / code_length_chips + 1); local_code_chip_index_ = local_code_chip_index_ % code_length_chips; _result[current_correlator_tap][n] = local_code[local_code_chip_index_]; } @@ -609,7 +616,8 @@ static inline void volk_gnsssdr_32fc_xn_resampler_32fc_xn_a_avx2(lv_32fc_t** res const __m256 rem_code_phase_chips_reg = _mm256_set1_ps(rem_code_phase_chips); const __m256 code_phase_step_chips_reg = _mm256_set1_ps(code_phase_step_chips); - __VOLK_ATTR_ALIGNED(32) int local_code_chip_index[8]; + __VOLK_ATTR_ALIGNED(32) + int local_code_chip_index[8]; int local_code_chip_index_; const __m256 zeros = _mm256_setzero_ps(); @@ -624,7 +632,7 @@ static inline void volk_gnsssdr_32fc_xn_resampler_32fc_xn_a_avx2(lv_32fc_t** res shifts_chips_reg = _mm256_set1_ps((float)shifts_chips[current_correlator_tap]); aux2 = _mm256_sub_ps(shifts_chips_reg, rem_code_phase_chips_reg); indexn = n0; - for(n = 0; n < avx_iters; n++) + for (n = 0; n < avx_iters; n++) { __VOLK_GNSSSDR_PREFETCH_LOCALITY(&_result[current_correlator_tap][8 * n + 7], 1, 0); __VOLK_GNSSSDR_PREFETCH_LOCALITY(&local_code_chip_index[8], 1, 3); @@ -643,13 +651,13 @@ static inline void volk_gnsssdr_32fc_xn_resampler_32fc_xn_a_avx2(lv_32fc_t** res // no negatives c = _mm256_cvtepi32_ps(local_code_chip_index_reg); - negatives = _mm256_cmp_ps(c, zeros, 0x01 ); + negatives = _mm256_cmp_ps(c, zeros, 0x01); aux3 = _mm256_and_ps(code_length_chips_reg_f, negatives); aux = _mm256_add_ps(c, aux3); local_code_chip_index_reg = _mm256_cvttps_epi32(aux); _mm256_store_si256((__m256i*)local_code_chip_index, local_code_chip_index_reg); - for(k = 0; k < 8; ++k) + for (k = 0; k < 8; ++k) { _result[current_correlator_tap][n * 8 + k] = local_code[local_code_chip_index[k]]; } @@ -659,12 +667,12 @@ static inline void volk_gnsssdr_32fc_xn_resampler_32fc_xn_a_avx2(lv_32fc_t** res _mm256_zeroupper(); for (current_correlator_tap = 0; current_correlator_tap < num_out_vectors; current_correlator_tap++) { - for(n = avx_iters * 8; n < num_points; n++) + for (n = avx_iters * 8; n < num_points; n++) { // resample code for current tap local_code_chip_index_ = (int)floor(code_phase_step_chips * (float)n + shifts_chips[current_correlator_tap] - rem_code_phase_chips); //Take into account that in multitap correlators, the shifts can be negative! - if (local_code_chip_index_ < 0) local_code_chip_index_ += (int)code_length_chips * (abs(local_code_chip_index_) / code_length_chips + 1) ; + if (local_code_chip_index_ < 0) local_code_chip_index_ += (int)code_length_chips * (abs(local_code_chip_index_) / code_length_chips + 1); local_code_chip_index_ = local_code_chip_index_ % code_length_chips; _result[current_correlator_tap][n] = local_code[local_code_chip_index_]; } @@ -689,19 +697,21 @@ static inline void volk_gnsssdr_32fc_xn_resampler_32fc_xn_neon(lv_32fc_t** resul const float32x4_t rem_code_phase_chips_reg = vdupq_n_f32(rem_code_phase_chips); const float32x4_t code_phase_step_chips_reg = vdupq_n_f32(code_phase_step_chips); - __VOLK_ATTR_ALIGNED(16) int32_t local_code_chip_index[4]; + __VOLK_ATTR_ALIGNED(16) + int32_t local_code_chip_index[4]; int32_t local_code_chip_index_; const int32x4_t zeros = vdupq_n_s32(0); const float32x4_t code_length_chips_reg_f = vdupq_n_f32((float)code_length_chips); const int32x4_t code_length_chips_reg_i = vdupq_n_s32((int32_t)code_length_chips); - int32x4_t local_code_chip_index_reg, aux_i, negatives, i; + int32x4_t local_code_chip_index_reg, aux_i, negatives, i; float32x4_t aux, aux2, shifts_chips_reg, fi, c, j, cTrunc, base, indexn, reciprocal; - __VOLK_ATTR_ALIGNED(16) const float vec[4] = { 0.0f, 1.0f, 2.0f, 3.0f }; + __VOLK_ATTR_ALIGNED(16) + const float vec[4] = {0.0f, 1.0f, 2.0f, 3.0f}; uint32x4_t igx; reciprocal = vrecpeq_f32(code_length_chips_reg_f); reciprocal = vmulq_f32(vrecpsq_f32(code_length_chips_reg_f, reciprocal), reciprocal); - reciprocal = vmulq_f32(vrecpsq_f32(code_length_chips_reg_f, reciprocal), reciprocal); // this refinement is required! + reciprocal = vmulq_f32(vrecpsq_f32(code_length_chips_reg_f, reciprocal), reciprocal); // this refinement is required! float32x4_t n0 = vld1q_f32((float*)vec); for (current_correlator_tap = 0; current_correlator_tap < num_out_vectors; current_correlator_tap++) @@ -709,7 +719,7 @@ static inline void volk_gnsssdr_32fc_xn_resampler_32fc_xn_neon(lv_32fc_t** resul shifts_chips_reg = vdupq_n_f32((float)shifts_chips[current_correlator_tap]); aux2 = vsubq_f32(shifts_chips_reg, rem_code_phase_chips_reg); indexn = n0; - for(n = 0; n < neon_iters; n++) + for (n = 0; n < neon_iters; n++) { __VOLK_GNSSSDR_PREFETCH_LOCALITY(&_result[current_correlator_tap][4 * n + 3], 1, 0); __VOLK_GNSSSDR_PREFETCH(&local_code_chip_index[4]); @@ -725,7 +735,7 @@ static inline void volk_gnsssdr_32fc_xn_resampler_32fc_xn_neon(lv_32fc_t** resul // fmod c = vmulq_f32(aux, reciprocal); - i = vcvtq_s32_f32(c); + i = vcvtq_s32_f32(c); cTrunc = vcvtq_f32_s32(i); base = vmulq_f32(cTrunc, code_length_chips_reg_f); aux = vsubq_f32(aux, base); @@ -737,13 +747,13 @@ static inline void volk_gnsssdr_32fc_xn_resampler_32fc_xn_neon(lv_32fc_t** resul vst1q_s32((int32_t*)local_code_chip_index, local_code_chip_index_reg); - for(k = 0; k < 4; ++k) + for (k = 0; k < 4; ++k) { _result[current_correlator_tap][n * 4 + k] = local_code[local_code_chip_index[k]]; } indexn = vaddq_f32(indexn, fours); } - for(n = neon_iters * 4; n < num_points; n++) + for (n = neon_iters * 4; n < num_points; n++) { __VOLK_GNSSSDR_PREFETCH_LOCALITY(&_result[current_correlator_tap][n], 1, 0); // resample code for current tap diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_64f_accumulator_64f.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_64f_accumulator_64f.h index e1d577c1e..b686b6c5d 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_64f_accumulator_64f.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_64f_accumulator_64f.h @@ -69,11 +69,12 @@ static inline void volk_gnsssdr_64f_accumulator_64f_u_avx(double* result, const unsigned int i; const double* aPtr = inputBuffer; - __VOLK_ATTR_ALIGNED(32) double tempBuffer[4]; + __VOLK_ATTR_ALIGNED(32) + double tempBuffer[4]; __m256d accumulator = _mm256_setzero_pd(); __m256d aVal = _mm256_setzero_pd(); - for(number = 0; number < sse_iters; number++) + for (number = 0; number < sse_iters; number++) { aVal = _mm256_loadu_pd(aPtr); accumulator = _mm256_add_pd(accumulator, aVal); @@ -82,12 +83,12 @@ static inline void volk_gnsssdr_64f_accumulator_64f_u_avx(double* result, const _mm256_storeu_pd((double*)tempBuffer, accumulator); - for(i = 0; i < 4; ++i) + for (i = 0; i < 4; ++i) { returnValue += tempBuffer[i]; } - for(i = 0; i < (num_points % 4); ++i) + for (i = 0; i < (num_points % 4); ++i) { returnValue += (*aPtr++); } @@ -100,7 +101,7 @@ static inline void volk_gnsssdr_64f_accumulator_64f_u_avx(double* result, const #ifdef LV_HAVE_SSE3 #include -static inline void volk_gnsssdr_64f_accumulator_64f_u_sse3(double* result,const double* inputBuffer, unsigned int num_points) +static inline void volk_gnsssdr_64f_accumulator_64f_u_sse3(double* result, const double* inputBuffer, unsigned int num_points) { double returnValue = 0; const unsigned int sse_iters = num_points / 2; @@ -108,11 +109,12 @@ static inline void volk_gnsssdr_64f_accumulator_64f_u_sse3(double* result,const unsigned int i; const double* aPtr = inputBuffer; - __VOLK_ATTR_ALIGNED(16) double tempBuffer[2]; + __VOLK_ATTR_ALIGNED(16) + double tempBuffer[2]; __m128d accumulator = _mm_setzero_pd(); __m128d aVal = _mm_setzero_pd(); - for(number = 0; number < sse_iters; number++) + for (number = 0; number < sse_iters; number++) { aVal = _mm_loadu_pd(aPtr); accumulator = _mm_add_pd(accumulator, aVal); @@ -121,12 +123,12 @@ static inline void volk_gnsssdr_64f_accumulator_64f_u_sse3(double* result,const _mm_storeu_pd((double*)tempBuffer, accumulator); - for(i = 0; i < 2; ++i) + for (i = 0; i < 2; ++i) { returnValue += tempBuffer[i]; } - for(i = 0; i < (num_points % 2); ++i) + for (i = 0; i < (num_points % 2); ++i) { returnValue += (*aPtr++); } @@ -138,13 +140,13 @@ static inline void volk_gnsssdr_64f_accumulator_64f_u_sse3(double* result,const #ifdef LV_HAVE_GENERIC -static inline void volk_gnsssdr_64f_accumulator_64f_generic(double* result,const double* inputBuffer, unsigned int num_points) +static inline void volk_gnsssdr_64f_accumulator_64f_generic(double* result, const double* inputBuffer, unsigned int num_points) { const double* aPtr = inputBuffer; double returnValue = 0; unsigned int number; - for(number = 0; number < num_points; number++) + for (number = 0; number < num_points; number++) { returnValue += (*aPtr++); } @@ -156,7 +158,7 @@ static inline void volk_gnsssdr_64f_accumulator_64f_generic(double* result,const #ifdef LV_HAVE_AVX #include -static inline void volk_gnsssdr_64f_accumulator_64f_a_avx(double* result,const double* inputBuffer, unsigned int num_points) +static inline void volk_gnsssdr_64f_accumulator_64f_a_avx(double* result, const double* inputBuffer, unsigned int num_points) { double returnValue = 0; const unsigned int sse_iters = num_points / 4; @@ -164,11 +166,12 @@ static inline void volk_gnsssdr_64f_accumulator_64f_a_avx(double* result,const d unsigned int i; const double* aPtr = inputBuffer; - __VOLK_ATTR_ALIGNED(32) double tempBuffer[4]; + __VOLK_ATTR_ALIGNED(32) + double tempBuffer[4]; __m256d accumulator = _mm256_setzero_pd(); __m256d aVal = _mm256_setzero_pd(); - for(number = 0; number < sse_iters; number++) + for (number = 0; number < sse_iters; number++) { aVal = _mm256_load_pd(aPtr); accumulator = _mm256_add_pd(accumulator, aVal); @@ -177,12 +180,12 @@ static inline void volk_gnsssdr_64f_accumulator_64f_a_avx(double* result,const d _mm256_store_pd((double*)tempBuffer, accumulator); - for(i = 0; i < 4; ++i) + for (i = 0; i < 4; ++i) { returnValue += tempBuffer[i]; } - for(i = 0; i < (num_points % 4); ++i) + for (i = 0; i < (num_points % 4); ++i) { returnValue += (*aPtr++); } @@ -195,7 +198,7 @@ static inline void volk_gnsssdr_64f_accumulator_64f_a_avx(double* result,const d #ifdef LV_HAVE_SSE3 #include -static inline void volk_gnsssdr_64f_accumulator_64f_a_sse3(double* result,const double* inputBuffer, unsigned int num_points) +static inline void volk_gnsssdr_64f_accumulator_64f_a_sse3(double* result, const double* inputBuffer, unsigned int num_points) { double returnValue = 0; const unsigned int sse_iters = num_points / 2; @@ -203,11 +206,12 @@ static inline void volk_gnsssdr_64f_accumulator_64f_a_sse3(double* result,const unsigned int i; const double* aPtr = inputBuffer; - __VOLK_ATTR_ALIGNED(16) double tempBuffer[2]; + __VOLK_ATTR_ALIGNED(16) + double tempBuffer[2]; __m128d accumulator = _mm_setzero_pd(); __m128d aVal = _mm_setzero_pd(); - for(number = 0; number < sse_iters; number++) + for (number = 0; number < sse_iters; number++) { aVal = _mm_load_pd(aPtr); accumulator = _mm_add_pd(accumulator, aVal); @@ -216,12 +220,12 @@ static inline void volk_gnsssdr_64f_accumulator_64f_a_sse3(double* result,const _mm_store_pd((double*)tempBuffer, accumulator); - for(i = 0; i < 2; ++i) + for (i = 0; i < 2; ++i) { returnValue += tempBuffer[i]; } - for(i = 0; i < (num_points % 2); ++i) + for (i = 0; i < (num_points % 2); ++i) { returnValue += (*aPtr++); } diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_8i_accumulator_s8i.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_8i_accumulator_s8i.h index 8c2830cdc..9e141c6c4 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_8i_accumulator_s8i.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_8i_accumulator_s8i.h @@ -70,11 +70,12 @@ static inline void volk_gnsssdr_8i_accumulator_s8i_u_sse3(char* result, const ch unsigned int i; const char* aPtr = inputBuffer; - __VOLK_ATTR_ALIGNED(16) char tempBuffer[16]; + __VOLK_ATTR_ALIGNED(16) + char tempBuffer[16]; __m128i accumulator = _mm_setzero_si128(); __m128i aVal = _mm_setzero_si128(); - for(number = 0; number < sse_iters; number++) + for (number = 0; number < sse_iters; number++) { aVal = _mm_lddqu_si128((__m128i*)aPtr); accumulator = _mm_add_epi8(accumulator, aVal); @@ -82,12 +83,12 @@ static inline void volk_gnsssdr_8i_accumulator_s8i_u_sse3(char* result, const ch } _mm_storeu_si128((__m128i*)tempBuffer, accumulator); - for(i = 0; i < 16; ++i) + for (i = 0; i < 16; ++i) { returnValue += tempBuffer[i]; } - for(i = 0; i < (num_points % 16); ++i) + for (i = 0; i < (num_points % 16); ++i) { returnValue += (*aPtr++); } @@ -104,7 +105,7 @@ static inline void volk_gnsssdr_8i_accumulator_s8i_generic(char* result, const c const char* aPtr = inputBuffer; char returnValue = 0; unsigned int number; - for(number = 0;number < num_points; number++) + for (number = 0; number < num_points; number++) { returnValue += (*aPtr++); } @@ -125,24 +126,25 @@ static inline void volk_gnsssdr_8i_accumulator_s8i_a_sse3(char* result, const ch const char* aPtr = inputBuffer; - __VOLK_ATTR_ALIGNED(16) char tempBuffer[16]; + __VOLK_ATTR_ALIGNED(16) + char tempBuffer[16]; __m128i accumulator = _mm_setzero_si128(); __m128i aVal = _mm_setzero_si128(); - for(number = 0; number < sse_iters; number++) + for (number = 0; number < sse_iters; number++) { aVal = _mm_load_si128((__m128i*)aPtr); accumulator = _mm_add_epi8(accumulator, aVal); aPtr += 16; } - _mm_store_si128((__m128i*)tempBuffer,accumulator); + _mm_store_si128((__m128i*)tempBuffer, accumulator); - for(i = 0; i < 16; ++i) + for (i = 0; i < 16; ++i) { returnValue += tempBuffer[i]; } - for(i = 0; i < (num_points % 16); ++i) + for (i = 0; i < (num_points % 16); ++i) { returnValue += (*aPtr++); } @@ -164,24 +166,25 @@ static inline void volk_gnsssdr_8i_accumulator_s8i_a_avx2(char* result, const ch const char* aPtr = inputBuffer; - __VOLK_ATTR_ALIGNED(32) char tempBuffer[32]; + __VOLK_ATTR_ALIGNED(32) + char tempBuffer[32]; __m256i accumulator = _mm256_setzero_si256(); __m256i aVal = _mm256_setzero_si256(); - for(number = 0; number < sse_iters; number++) + for (number = 0; number < sse_iters; number++) { aVal = _mm256_load_si256((__m256i*)aPtr); accumulator = _mm256_add_epi8(accumulator, aVal); aPtr += 32; } - _mm256_store_si256((__m256i*)tempBuffer,accumulator); + _mm256_store_si256((__m256i*)tempBuffer, accumulator); - for(i = 0; i < 32; ++i) + for (i = 0; i < 32; ++i) { returnValue += tempBuffer[i]; } - for(i = 0; i < (num_points % 32); ++i) + for (i = 0; i < (num_points % 32); ++i) { returnValue += (*aPtr++); } @@ -202,11 +205,12 @@ static inline void volk_gnsssdr_8i_accumulator_s8i_u_avx2(char* result, const ch unsigned int i; const char* aPtr = inputBuffer; - __VOLK_ATTR_ALIGNED(32) char tempBuffer[32]; + __VOLK_ATTR_ALIGNED(32) + char tempBuffer[32]; __m256i accumulator = _mm256_setzero_si256(); __m256i aVal = _mm256_setzero_si256(); - for(number = 0; number < sse_iters; number++) + for (number = 0; number < sse_iters; number++) { aVal = _mm256_lddqu_si256((__m256i*)aPtr); accumulator = _mm256_add_epi8(accumulator, aVal); @@ -214,12 +218,12 @@ static inline void volk_gnsssdr_8i_accumulator_s8i_u_avx2(char* result, const ch } _mm256_storeu_si256((__m256i*)tempBuffer, accumulator); - for(i = 0; i < 32; ++i) + for (i = 0; i < 32; ++i) { returnValue += tempBuffer[i]; } - for(i = 0; i < (num_points % 32); ++i) + for (i = 0; i < (num_points % 32); ++i) { returnValue += (*aPtr++); } diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_8i_index_max_16u.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_8i_index_max_16u.h index 1f053f239..2af8c55d9 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_8i_index_max_16u.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_8i_index_max_16u.h @@ -60,11 +60,11 @@ #ifdef LV_HAVE_AVX2 -#include +#include static inline void volk_gnsssdr_8i_index_max_16u_u_avx2(unsigned int* target, const char* src0, unsigned int num_points) { - if(num_points > 0) + if (num_points > 0) { const unsigned int avx2_iters = num_points / 32; unsigned int number; @@ -74,14 +74,15 @@ static inline void volk_gnsssdr_8i_index_max_16u_u_avx2(unsigned int* target, co char max = src0[0]; unsigned int index = 0; unsigned int mask; - __VOLK_ATTR_ALIGNED(32) char currentValuesBuffer[32]; + __VOLK_ATTR_ALIGNED(32) + char currentValuesBuffer[32]; __m256i maxValues, compareResults, currentValues; maxValues = _mm256_set1_epi8(max); - for(number = 0; number < avx2_iters; number++) + for (number = 0; number < avx2_iters; number++) { - currentValues = _mm256_loadu_si256((__m256i*)inputPtr); + currentValues = _mm256_loadu_si256((__m256i*)inputPtr); compareResults = _mm256_cmpgt_epi8(maxValues, currentValues); mask = _mm256_movemask_epi8(compareResults); @@ -94,7 +95,7 @@ static inline void volk_gnsssdr_8i_index_max_16u_u_avx2(unsigned int* target, co { if ((mask & 1) == 1) { - if(currentValuesBuffer[i] > max) + if (currentValuesBuffer[i] > max) { index = inputPtr - basePtr + i; max = currentValuesBuffer[i]; @@ -108,9 +109,9 @@ static inline void volk_gnsssdr_8i_index_max_16u_u_avx2(unsigned int* target, co inputPtr += 32; } - for(i = 0; i<(num_points % 32); ++i) + for (i = 0; i < (num_points % 32); ++i) { - if(src0[i] > max) + if (src0[i] > max) { index = i; max = src0[i]; @@ -128,7 +129,7 @@ static inline void volk_gnsssdr_8i_index_max_16u_u_avx2(unsigned int* target, co static inline void volk_gnsssdr_8i_index_max_16u_u_avx(unsigned int* target, const char* src0, unsigned int num_points) { - if(num_points > 0) + if (num_points > 0) { const unsigned int sse_iters = num_points / 32; unsigned int number; @@ -137,33 +138,34 @@ static inline void volk_gnsssdr_8i_index_max_16u_u_avx(unsigned int* target, con char* inputPtr = (char*)src0; char max = src0[0]; unsigned int index = 0; - __VOLK_ATTR_ALIGNED(32) char currentValuesBuffer[32]; + __VOLK_ATTR_ALIGNED(32) + char currentValuesBuffer[32]; __m256i ones, compareResults, currentValues; __m128i compareResultslo, compareResultshi, maxValues, lo, hi; ones = _mm256_set1_epi8(0xFF); maxValues = _mm_set1_epi8(max); - for(number = 0; number < sse_iters; number++) + for (number = 0; number < sse_iters; number++) { - currentValues = _mm256_lddqu_si256((__m256i*)inputPtr); + currentValues = _mm256_lddqu_si256((__m256i*)inputPtr); lo = _mm256_castsi256_si128(currentValues); - hi = _mm256_extractf128_si256(currentValues,1); + hi = _mm256_extractf128_si256(currentValues, 1); compareResultslo = _mm_cmpgt_epi8(maxValues, lo); compareResultshi = _mm_cmpgt_epi8(maxValues, hi); //compareResults = _mm256_set_m128i(compareResultshi , compareResultslo); //not defined in some versions of immintrin.h - compareResults = _mm256_insertf128_si256(_mm256_castsi128_si256(compareResultslo),(compareResultshi),1); + compareResults = _mm256_insertf128_si256(_mm256_castsi128_si256(compareResultslo), (compareResultshi), 1); if (!_mm256_testc_si256(compareResults, ones)) { _mm256_storeu_si256((__m256i*)¤tValuesBuffer, currentValues); - for(i = 0; i < 32; i++) + for (i = 0; i < 32; i++) { - if(currentValuesBuffer[i] > max) + if (currentValuesBuffer[i] > max) { index = inputPtr - basePtr + i; max = currentValuesBuffer[i]; @@ -175,9 +177,9 @@ static inline void volk_gnsssdr_8i_index_max_16u_u_avx(unsigned int* target, con inputPtr += 32; } - for(i = 0; i<(num_points % 32); ++i) + for (i = 0; i < (num_points % 32); ++i) { - if(src0[i] > max) + if (src0[i] > max) { index = i; max = src0[i]; @@ -195,7 +197,7 @@ static inline void volk_gnsssdr_8i_index_max_16u_u_avx(unsigned int* target, con static inline void volk_gnsssdr_8i_index_max_16u_u_sse4_1(unsigned int* target, const char* src0, unsigned int num_points) { - if(num_points > 0) + if (num_points > 0) { const unsigned int sse_iters = num_points / 16; unsigned int number; @@ -204,14 +206,15 @@ static inline void volk_gnsssdr_8i_index_max_16u_u_sse4_1(unsigned int* target, char* inputPtr = (char*)src0; char max = src0[0]; unsigned int index = 0; - __VOLK_ATTR_ALIGNED(16) char currentValuesBuffer[16]; + __VOLK_ATTR_ALIGNED(16) + char currentValuesBuffer[16]; __m128i maxValues, compareResults, currentValues; maxValues = _mm_set1_epi8(max); - for(number = 0; number < sse_iters; number++) + for (number = 0; number < sse_iters; number++) { - currentValues = _mm_lddqu_si128((__m128i*)inputPtr); + currentValues = _mm_lddqu_si128((__m128i*)inputPtr); compareResults = _mm_cmpgt_epi8(maxValues, currentValues); @@ -219,9 +222,9 @@ static inline void volk_gnsssdr_8i_index_max_16u_u_sse4_1(unsigned int* target, { _mm_storeu_si128((__m128i*)¤tValuesBuffer, currentValues); - for(i = 0; i < 16; i++) + for (i = 0; i < 16; i++) { - if(currentValuesBuffer[i] > max) + if (currentValuesBuffer[i] > max) { index = inputPtr - basePtr + i; max = currentValuesBuffer[i]; @@ -233,9 +236,9 @@ static inline void volk_gnsssdr_8i_index_max_16u_u_sse4_1(unsigned int* target, inputPtr += 16; } - for(i = 0; i<(num_points % 16); ++i) + for (i = 0; i < (num_points % 16); ++i) { - if(src0[i] > max) + if (src0[i] > max) { index = i; max = src0[i]; @@ -249,11 +252,11 @@ static inline void volk_gnsssdr_8i_index_max_16u_u_sse4_1(unsigned int* target, #ifdef LV_HAVE_SSE2 -#include +#include static inline void volk_gnsssdr_8i_index_max_16u_u_sse2(unsigned int* target, const char* src0, unsigned int num_points) { - if(num_points > 0) + if (num_points > 0) { const unsigned int sse_iters = num_points / 16; unsigned int number; @@ -263,14 +266,15 @@ static inline void volk_gnsssdr_8i_index_max_16u_u_sse2(unsigned int* target, co char max = src0[0]; unsigned int index = 0; unsigned short mask; - __VOLK_ATTR_ALIGNED(16) char currentValuesBuffer[16]; + __VOLK_ATTR_ALIGNED(16) + char currentValuesBuffer[16]; __m128i maxValues, compareResults, currentValues; maxValues = _mm_set1_epi8(max); - for(number = 0; number < sse_iters; number++) + for (number = 0; number < sse_iters; number++) { - currentValues = _mm_loadu_si128((__m128i*)inputPtr); + currentValues = _mm_loadu_si128((__m128i*)inputPtr); compareResults = _mm_cmpgt_epi8(maxValues, currentValues); mask = _mm_movemask_epi8(compareResults); @@ -283,7 +287,7 @@ static inline void volk_gnsssdr_8i_index_max_16u_u_sse2(unsigned int* target, co { if ((mask & 1) == 1) { - if(currentValuesBuffer[i] > max) + if (currentValuesBuffer[i] > max) { index = inputPtr - basePtr + i; max = currentValuesBuffer[i]; @@ -297,9 +301,9 @@ static inline void volk_gnsssdr_8i_index_max_16u_u_sse2(unsigned int* target, co inputPtr += 16; } - for(i = 0; i<(num_points % 16); ++i) + for (i = 0; i < (num_points % 16); ++i) { - if(src0[i] > max) + if (src0[i] > max) { index = i; max = src0[i]; @@ -316,14 +320,14 @@ static inline void volk_gnsssdr_8i_index_max_16u_u_sse2(unsigned int* target, co static inline void volk_gnsssdr_8i_index_max_16u_generic(unsigned int* target, const char* src0, unsigned int num_points) { - if(num_points > 0) + if (num_points > 0) { char max = src0[0]; unsigned int index = 0; unsigned int i; - for(i = 1; i < num_points; ++i) + for (i = 1; i < num_points; ++i) { - if(src0[i] > max) + if (src0[i] > max) { index = i; max = src0[i]; @@ -337,11 +341,11 @@ static inline void volk_gnsssdr_8i_index_max_16u_generic(unsigned int* target, c #ifdef LV_HAVE_AVX2 -#include +#include static inline void volk_gnsssdr_8i_index_max_16u_a_avx2(unsigned int* target, const char* src0, unsigned int num_points) { - if(num_points > 0) + if (num_points > 0) { const unsigned int avx2_iters = num_points / 32; unsigned int number; @@ -351,14 +355,15 @@ static inline void volk_gnsssdr_8i_index_max_16u_a_avx2(unsigned int* target, co char max = src0[0]; unsigned int index = 0; unsigned int mask; - __VOLK_ATTR_ALIGNED(32) char currentValuesBuffer[32]; + __VOLK_ATTR_ALIGNED(32) + char currentValuesBuffer[32]; __m256i maxValues, compareResults, currentValues; maxValues = _mm256_set1_epi8(max); - for(number = 0; number < avx2_iters; number++) + for (number = 0; number < avx2_iters; number++) { - currentValues = _mm256_load_si256((__m256i*)inputPtr); + currentValues = _mm256_load_si256((__m256i*)inputPtr); compareResults = _mm256_cmpgt_epi8(maxValues, currentValues); mask = _mm256_movemask_epi8(compareResults); @@ -371,7 +376,7 @@ static inline void volk_gnsssdr_8i_index_max_16u_a_avx2(unsigned int* target, co { if ((mask & 1) == 1) { - if(currentValuesBuffer[i] > max) + if (currentValuesBuffer[i] > max) { index = inputPtr - basePtr + i; max = currentValuesBuffer[i]; @@ -385,9 +390,9 @@ static inline void volk_gnsssdr_8i_index_max_16u_a_avx2(unsigned int* target, co inputPtr += 32; } - for(i = 0; i<(num_points % 32); ++i) + for (i = 0; i < (num_points % 32); ++i) { - if(src0[i] > max) + if (src0[i] > max) { index = i; max = src0[i]; @@ -405,7 +410,7 @@ static inline void volk_gnsssdr_8i_index_max_16u_a_avx2(unsigned int* target, co static inline void volk_gnsssdr_8i_index_max_16u_a_avx(unsigned int* target, const char* src0, unsigned int num_points) { - if(num_points > 0) + if (num_points > 0) { const unsigned int sse_iters = num_points / 32; unsigned int number; @@ -414,19 +419,20 @@ static inline void volk_gnsssdr_8i_index_max_16u_a_avx(unsigned int* target, con char* inputPtr = (char*)src0; char max = src0[0]; unsigned int index = 0; - __VOLK_ATTR_ALIGNED(32) char currentValuesBuffer[32]; + __VOLK_ATTR_ALIGNED(32) + char currentValuesBuffer[32]; __m256i ones, compareResults, currentValues; __m128i compareResultslo, compareResultshi, maxValues, lo, hi; ones = _mm256_set1_epi8(0xFF); maxValues = _mm_set1_epi8(max); - for(number = 0; number < sse_iters; number++) + for (number = 0; number < sse_iters; number++) { - currentValues = _mm256_load_si256((__m256i*)inputPtr); + currentValues = _mm256_load_si256((__m256i*)inputPtr); lo = _mm256_castsi256_si128(currentValues); - hi = _mm256_extractf128_si256(currentValues,1); + hi = _mm256_extractf128_si256(currentValues, 1); compareResultslo = _mm_cmpgt_epi8(maxValues, lo); compareResultshi = _mm_cmpgt_epi8(maxValues, hi); @@ -438,9 +444,9 @@ static inline void volk_gnsssdr_8i_index_max_16u_a_avx(unsigned int* target, con { _mm256_store_si256((__m256i*)¤tValuesBuffer, currentValues); - for(i = 0; i < 32; i++) + for (i = 0; i < 32; i++) { - if(currentValuesBuffer[i] > max) + if (currentValuesBuffer[i] > max) { index = inputPtr - basePtr + i; max = currentValuesBuffer[i]; @@ -452,9 +458,9 @@ static inline void volk_gnsssdr_8i_index_max_16u_a_avx(unsigned int* target, con inputPtr += 32; } - for(i = 0; i<(num_points % 32); ++i) + for (i = 0; i < (num_points % 32); ++i) { - if(src0[i] > max) + if (src0[i] > max) { index = i; max = src0[i]; @@ -472,7 +478,7 @@ static inline void volk_gnsssdr_8i_index_max_16u_a_avx(unsigned int* target, con static inline void volk_gnsssdr_8i_index_max_16u_a_sse4_1(unsigned int* target, const char* src0, unsigned int num_points) { - if(num_points > 0) + if (num_points > 0) { const unsigned int sse_iters = num_points / 16; unsigned int number; @@ -481,14 +487,15 @@ static inline void volk_gnsssdr_8i_index_max_16u_a_sse4_1(unsigned int* target, char* inputPtr = (char*)src0; char max = src0[0]; unsigned int index = 0; - __VOLK_ATTR_ALIGNED(16) char currentValuesBuffer[16]; + __VOLK_ATTR_ALIGNED(16) + char currentValuesBuffer[16]; __m128i maxValues, compareResults, currentValues; maxValues = _mm_set1_epi8(max); - for(number = 0; number < sse_iters; number++) + for (number = 0; number < sse_iters; number++) { - currentValues = _mm_load_si128((__m128i*)inputPtr); + currentValues = _mm_load_si128((__m128i*)inputPtr); compareResults = _mm_cmpgt_epi8(maxValues, currentValues); @@ -496,9 +503,9 @@ static inline void volk_gnsssdr_8i_index_max_16u_a_sse4_1(unsigned int* target, { _mm_store_si128((__m128i*)¤tValuesBuffer, currentValues); - for(i = 0; i < 16; i++) + for (i = 0; i < 16; i++) { - if(currentValuesBuffer[i] > max) + if (currentValuesBuffer[i] > max) { index = inputPtr - basePtr + i; max = currentValuesBuffer[i]; @@ -510,9 +517,9 @@ static inline void volk_gnsssdr_8i_index_max_16u_a_sse4_1(unsigned int* target, inputPtr += 16; } - for(i = 0; i<(num_points % 16); ++i) + for (i = 0; i < (num_points % 16); ++i) { - if(src0[i] > max) + if (src0[i] > max) { index = i; max = src0[i]; @@ -530,7 +537,7 @@ static inline void volk_gnsssdr_8i_index_max_16u_a_sse4_1(unsigned int* target, static inline void volk_gnsssdr_8i_index_max_16u_a_sse2(unsigned int* target, const char* src0, unsigned int num_points) { - if(num_points > 0) + if (num_points > 0) { const unsigned int sse_iters = num_points / 16; unsigned int number; @@ -540,14 +547,15 @@ static inline void volk_gnsssdr_8i_index_max_16u_a_sse2(unsigned int* target, co char max = src0[0]; unsigned int index = 0; unsigned short mask; - __VOLK_ATTR_ALIGNED(16) char currentValuesBuffer[16]; + __VOLK_ATTR_ALIGNED(16) + char currentValuesBuffer[16]; __m128i maxValues, compareResults, currentValues; maxValues = _mm_set1_epi8(max); - for(number = 0; number < sse_iters; number++) + for (number = 0; number < sse_iters; number++) { - currentValues = _mm_load_si128((__m128i*)inputPtr); + currentValues = _mm_load_si128((__m128i*)inputPtr); compareResults = _mm_cmpgt_epi8(maxValues, currentValues); mask = _mm_movemask_epi8(compareResults); @@ -560,7 +568,7 @@ static inline void volk_gnsssdr_8i_index_max_16u_a_sse2(unsigned int* target, co { if ((mask & 1) == 1) { - if(currentValuesBuffer[i] > max) + if (currentValuesBuffer[i] > max) { index = inputPtr - basePtr + i; max = currentValuesBuffer[i]; @@ -574,9 +582,9 @@ static inline void volk_gnsssdr_8i_index_max_16u_a_sse2(unsigned int* target, co inputPtr += 16; } - for(i = 0; i<(num_points % 16); ++i) + for (i = 0; i < (num_points % 16); ++i) { - if(src0[i] > max) + if (src0[i] > max) { index = i; max = src0[i]; diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_8i_max_s8i.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_8i_max_s8i.h index 109c4f779..d748281c3 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_8i_max_s8i.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_8i_max_s8i.h @@ -63,21 +63,22 @@ static inline void volk_gnsssdr_8i_max_s8i_u_avx2(char* target, const char* src0, unsigned int num_points) { - if(num_points > 0) + if (num_points > 0) { const unsigned int avx_iters = num_points / 32; unsigned int number; unsigned int i; char* inputPtr = (char*)src0; char max = src0[0]; - __VOLK_ATTR_ALIGNED(32) char maxValuesBuffer[32]; + __VOLK_ATTR_ALIGNED(32) + char maxValuesBuffer[32]; __m256i maxValues, compareResults, currentValues; maxValues = _mm256_set1_epi8(max); - for(number = 0; number < avx_iters; number++) + for (number = 0; number < avx_iters; number++) { - currentValues = _mm256_loadu_si256((__m256i*)inputPtr); + currentValues = _mm256_loadu_si256((__m256i*)inputPtr); compareResults = _mm256_max_epi8(maxValues, currentValues); maxValues = compareResults; inputPtr += 32; @@ -85,17 +86,17 @@ static inline void volk_gnsssdr_8i_max_s8i_u_avx2(char* target, const char* src0 _mm256_storeu_si256((__m256i*)maxValuesBuffer, maxValues); - for(i = 0; i < 32; ++i) + for (i = 0; i < 32; ++i) { - if(maxValuesBuffer[i] > max) + if (maxValuesBuffer[i] > max) { max = maxValuesBuffer[i]; } } - for(i = avx_iters * 32; i < num_points; ++i) + for (i = avx_iters * 32; i < num_points; ++i) { - if(src0[i] > max) + if (src0[i] > max) { max = src0[i]; } @@ -112,21 +113,22 @@ static inline void volk_gnsssdr_8i_max_s8i_u_avx2(char* target, const char* src0 static inline void volk_gnsssdr_8i_max_s8i_u_sse4_1(char* target, const char* src0, unsigned int num_points) { - if(num_points > 0) + if (num_points > 0) { const unsigned int sse_iters = num_points / 16; unsigned int number; unsigned int i; char* inputPtr = (char*)src0; char max = src0[0]; - __VOLK_ATTR_ALIGNED(16) char maxValuesBuffer[16]; + __VOLK_ATTR_ALIGNED(16) + char maxValuesBuffer[16]; __m128i maxValues, compareResults, currentValues; maxValues = _mm_set1_epi8(max); - for(number = 0; number < sse_iters; number++) + for (number = 0; number < sse_iters; number++) { - currentValues = _mm_loadu_si128((__m128i*)inputPtr); + currentValues = _mm_loadu_si128((__m128i*)inputPtr); compareResults = _mm_cmpgt_epi8(maxValues, currentValues); maxValues = _mm_blendv_epi8(currentValues, maxValues, compareResults); inputPtr += 16; @@ -134,17 +136,17 @@ static inline void volk_gnsssdr_8i_max_s8i_u_sse4_1(char* target, const char* sr _mm_storeu_si128((__m128i*)maxValuesBuffer, maxValues); - for(i = 0; i < 16; ++i) + for (i = 0; i < 16; ++i) { - if(maxValuesBuffer[i] > max) + if (maxValuesBuffer[i] > max) { max = maxValuesBuffer[i]; } } - for(i = sse_iters * 16; i < num_points; ++i) + for (i = sse_iters * 16; i < num_points; ++i) { - if(src0[i] > max) + if (src0[i] > max) { max = src0[i]; } @@ -157,11 +159,11 @@ static inline void volk_gnsssdr_8i_max_s8i_u_sse4_1(char* target, const char* sr #ifdef LV_HAVE_SSE2 -#include +#include static inline void volk_gnsssdr_8i_max_s8i_u_sse2(char* target, const char* src0, unsigned int num_points) { - if(num_points > 0) + if (num_points > 0) { const unsigned int sse_iters = num_points / 16; unsigned int number; @@ -169,14 +171,15 @@ static inline void volk_gnsssdr_8i_max_s8i_u_sse2(char* target, const char* src0 char* inputPtr = (char*)src0; char max = src0[0]; unsigned short mask; - __VOLK_ATTR_ALIGNED(16) char currentValuesBuffer[16]; + __VOLK_ATTR_ALIGNED(16) + char currentValuesBuffer[16]; __m128i maxValues, compareResults, currentValues; maxValues = _mm_set1_epi8(max); - for(number = 0; number < sse_iters; number++) + for (number = 0; number < sse_iters; number++) { - currentValues = _mm_loadu_si128((__m128i*)inputPtr); + currentValues = _mm_loadu_si128((__m128i*)inputPtr); compareResults = _mm_cmpgt_epi8(maxValues, currentValues); mask = _mm_movemask_epi8(compareResults); @@ -189,7 +192,7 @@ static inline void volk_gnsssdr_8i_max_s8i_u_sse2(char* target, const char* src0 { if ((mask & 1) == 1) { - if(currentValuesBuffer[i] > max) + if (currentValuesBuffer[i] > max) { max = currentValuesBuffer[i]; } @@ -202,9 +205,9 @@ static inline void volk_gnsssdr_8i_max_s8i_u_sse2(char* target, const char* src0 inputPtr += 16; } - for(i = sse_iters * 16; i < num_points; ++i) + for (i = sse_iters * 16; i < num_points; ++i) { - if(src0[i] > max) + if (src0[i] > max) { max = src0[i]; } @@ -220,13 +223,13 @@ static inline void volk_gnsssdr_8i_max_s8i_u_sse2(char* target, const char* src0 static inline void volk_gnsssdr_8i_max_s8i_generic(char* target, const char* src0, unsigned int num_points) { - if(num_points > 0) + if (num_points > 0) { char max = src0[0]; unsigned int i; - for(i = 1; i < num_points; ++i) + for (i = 1; i < num_points; ++i) { - if(src0[i] > max) + if (src0[i] > max) { max = src0[i]; } @@ -243,21 +246,22 @@ static inline void volk_gnsssdr_8i_max_s8i_generic(char* target, const char* src static inline void volk_gnsssdr_8i_max_s8i_a_sse4_1(char* target, const char* src0, unsigned int num_points) { - if(num_points > 0) + if (num_points > 0) { const unsigned int sse_iters = num_points / 16; unsigned int number; unsigned int i; char* inputPtr = (char*)src0; char max = src0[0]; - __VOLK_ATTR_ALIGNED(16) char maxValuesBuffer[16]; + __VOLK_ATTR_ALIGNED(16) + char maxValuesBuffer[16]; __m128i maxValues, compareResults, currentValues; maxValues = _mm_set1_epi8(max); - for(number = 0; number < sse_iters; number++) + for (number = 0; number < sse_iters; number++) { - currentValues = _mm_load_si128((__m128i*)inputPtr); + currentValues = _mm_load_si128((__m128i*)inputPtr); compareResults = _mm_cmpgt_epi8(maxValues, currentValues); maxValues = _mm_blendv_epi8(currentValues, maxValues, compareResults); inputPtr += 16; @@ -265,17 +269,17 @@ static inline void volk_gnsssdr_8i_max_s8i_a_sse4_1(char* target, const char* sr _mm_store_si128((__m128i*)maxValuesBuffer, maxValues); - for(i = 0; i < 16; ++i) + for (i = 0; i < 16; ++i) { - if(maxValuesBuffer[i] > max) + if (maxValuesBuffer[i] > max) { max = maxValuesBuffer[i]; } } - for(i = sse_iters * 16; i < num_points; ++i) + for (i = sse_iters * 16; i < num_points; ++i) { - if(src0[i] > max) + if (src0[i] > max) { max = src0[i]; } @@ -292,39 +296,40 @@ static inline void volk_gnsssdr_8i_max_s8i_a_sse4_1(char* target, const char* sr static inline void volk_gnsssdr_8i_max_s8i_a_avx2(char* target, const char* src0, unsigned int num_points) { - if(num_points > 0) + if (num_points > 0) { const unsigned int avx_iters = num_points / 32; unsigned int number; unsigned int i; char* inputPtr = (char*)src0; char max = src0[0]; - __VOLK_ATTR_ALIGNED(32) char maxValuesBuffer[32]; + __VOLK_ATTR_ALIGNED(32) + char maxValuesBuffer[32]; __m256i maxValues, compareResults, currentValues; maxValues = _mm256_set1_epi8(max); - for(number = 0; number < avx_iters; number++) + for (number = 0; number < avx_iters; number++) { - currentValues = _mm256_load_si256((__m256i*)inputPtr); + currentValues = _mm256_load_si256((__m256i*)inputPtr); compareResults = _mm256_max_epi8(maxValues, currentValues); - maxValues = compareResults; //_mm256_blendv_epi8(currentValues, maxValues, compareResults); + maxValues = compareResults; //_mm256_blendv_epi8(currentValues, maxValues, compareResults); inputPtr += 32; } _mm256_store_si256((__m256i*)maxValuesBuffer, maxValues); - for(i = 0; i < 32; ++i) + for (i = 0; i < 32; ++i) { - if(maxValuesBuffer[i] > max) + if (maxValuesBuffer[i] > max) { max = maxValuesBuffer[i]; } } - for(i = avx_iters * 32; i < num_points; ++i) + for (i = avx_iters * 32; i < num_points; ++i) { - if(src0[i] > max) + if (src0[i] > max) { max = src0[i]; } @@ -341,7 +346,7 @@ static inline void volk_gnsssdr_8i_max_s8i_a_avx2(char* target, const char* src0 static inline void volk_gnsssdr_8i_max_s8i_a_sse2(char* target, const char* src0, unsigned int num_points) { - if(num_points > 0) + if (num_points > 0) { const unsigned int sse_iters = num_points / 16; unsigned int number; @@ -349,14 +354,15 @@ static inline void volk_gnsssdr_8i_max_s8i_a_sse2(char* target, const char* src0 char* inputPtr = (char*)src0; char max = src0[0]; unsigned short mask; - __VOLK_ATTR_ALIGNED(16) char currentValuesBuffer[16]; + __VOLK_ATTR_ALIGNED(16) + char currentValuesBuffer[16]; __m128i maxValues, compareResults, currentValues; maxValues = _mm_set1_epi8(max); - for(number = 0; number < sse_iters; number++) + for (number = 0; number < sse_iters; number++) { - currentValues = _mm_load_si128((__m128i*)inputPtr); + currentValues = _mm_load_si128((__m128i*)inputPtr); compareResults = _mm_cmpgt_epi8(maxValues, currentValues); mask = _mm_movemask_epi8(compareResults); @@ -369,7 +375,7 @@ static inline void volk_gnsssdr_8i_max_s8i_a_sse2(char* target, const char* src0 { if ((mask & 1) == 1) { - if(currentValuesBuffer[i] > max) + if (currentValuesBuffer[i] > max) { max = currentValuesBuffer[i]; } @@ -382,9 +388,9 @@ static inline void volk_gnsssdr_8i_max_s8i_a_sse2(char* target, const char* src0 inputPtr += 16; } - for(i = sse_iters * 16; i < num_points; ++i) + for (i = sse_iters * 16; i < num_points; ++i) { - if(src0[i] > max) + if (src0[i] > max) { max = src0[i]; } diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_8i_x2_add_8i.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_8i_x2_add_8i.h index 3854319fd..4d25cf923 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_8i_x2_add_8i.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_8i_x2_add_8i.h @@ -72,21 +72,21 @@ static inline void volk_gnsssdr_8i_x2_add_8i_u_sse2(char* cVector, const char* a __m128i aVal, bVal, cVal; - for(number = 0; number < sse_iters; number++) + for (number = 0; number < sse_iters; number++) { aVal = _mm_loadu_si128((__m128i*)aPtr); bVal = _mm_loadu_si128((__m128i*)bPtr); cVal = _mm_add_epi8(aVal, bVal); - _mm_storeu_si128((__m128i*)cPtr, cVal); // Store the results back into the C container + _mm_storeu_si128((__m128i*)cPtr, cVal); // Store the results back into the C container aPtr += 16; bPtr += 16; cPtr += 16; } - for(i = sse_iters * 16; i < num_points; ++i) + for (i = sse_iters * 16; i < num_points; ++i) { *cPtr++ = (*aPtr++) + (*bPtr++); } @@ -108,21 +108,21 @@ static inline void volk_gnsssdr_8i_x2_add_8i_u_avx2(char* cVector, const char* a __m256i aVal, bVal, cVal; - for(number = 0; number < avx_iters; number++) + for (number = 0; number < avx_iters; number++) { aVal = _mm256_loadu_si256((__m256i*)aPtr); bVal = _mm256_loadu_si256((__m256i*)bPtr); cVal = _mm256_add_epi8(aVal, bVal); - _mm256_storeu_si256((__m256i*)cPtr, cVal); // Store the results back into the C container + _mm256_storeu_si256((__m256i*)cPtr, cVal); // Store the results back into the C container aPtr += 32; bPtr += 32; cPtr += 32; } - for(i = avx_iters * 32; i < num_points; ++i) + for (i = avx_iters * 32; i < num_points; ++i) { *cPtr++ = (*aPtr++) + (*bPtr++); } @@ -139,7 +139,7 @@ static inline void volk_gnsssdr_8i_x2_add_8i_generic(char* cVector, const char* const char* bPtr = bVector; unsigned int number; - for(number = 0; number < num_points; number++) + for (number = 0; number < num_points; number++) { *cPtr++ = (*aPtr++) + (*bPtr++); } @@ -161,21 +161,21 @@ static inline void volk_gnsssdr_8i_x2_add_8i_a_sse2(char* cVector, const char* a __m128i aVal, bVal, cVal; - for(number = 0; number < sse_iters; number++) + for (number = 0; number < sse_iters; number++) { aVal = _mm_load_si128((__m128i*)aPtr); bVal = _mm_load_si128((__m128i*)bPtr); cVal = _mm_add_epi8(aVal, bVal); - _mm_store_si128((__m128i*)cPtr, cVal); // Store the results back into the C container + _mm_store_si128((__m128i*)cPtr, cVal); // Store the results back into the C container aPtr += 16; bPtr += 16; cPtr += 16; } - for(i = sse_iters * 16; i < num_points; ++i) + for (i = sse_iters * 16; i < num_points; ++i) { *cPtr++ = (*aPtr++) + (*bPtr++); } @@ -197,21 +197,21 @@ static inline void volk_gnsssdr_8i_x2_add_8i_a_avx2(char* cVector, const char* a __m256i aVal, bVal, cVal; - for(number = 0; number < avx_iters; number++) + for (number = 0; number < avx_iters; number++) { aVal = _mm256_load_si256((__m256i*)aPtr); bVal = _mm256_load_si256((__m256i*)bPtr); cVal = _mm256_add_epi8(aVal, bVal); - _mm256_store_si256((__m256i*)cPtr, cVal); // Store the results back into the C container + _mm256_store_si256((__m256i*)cPtr, cVal); // Store the results back into the C container aPtr += 32; bPtr += 32; cPtr += 32; } - for(i = avx_iters * 32; i < num_points; ++i) + for (i = avx_iters * 32; i < num_points; ++i) { *cPtr++ = (*aPtr++) + (*bPtr++); } diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_8ic_conjugate_8ic.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_8ic_conjugate_8ic.h index 830128a83..177b1114d 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_8ic_conjugate_8ic.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_8ic_conjugate_8ic.h @@ -111,10 +111,10 @@ static inline void volk_gnsssdr_8ic_conjugate_8ic_u_avx(lv_8sc_t* cVector, const tmp = _mm256_xor_ps(tmp, conjugator1); tmp128lo = _mm256_castsi256_si128(_mm256_castps_si256(tmp)); tmp128lo = _mm_add_epi8(tmp128lo, conjugator2); - tmp128hi = _mm256_extractf128_si256(_mm256_castps_si256(tmp),1); + tmp128hi = _mm256_extractf128_si256(_mm256_castps_si256(tmp), 1); tmp128hi = _mm_add_epi8(tmp128hi, conjugator2); //tmp = _mm256_set_m128i(tmp128hi , tmp128lo); //not defined in some versions of immintrin.h - tmp = _mm256_castsi256_ps(_mm256_insertf128_si256(_mm256_castsi128_si256(tmp128lo),(tmp128hi),1)); + tmp = _mm256_castsi256_ps(_mm256_insertf128_si256(_mm256_castsi128_si256(tmp128lo), (tmp128hi), 1)); _mm256_storeu_ps((float*)c, tmp); a += 16; @@ -155,7 +155,6 @@ static inline void volk_gnsssdr_8ic_conjugate_8ic_u_ssse3(lv_8sc_t* cVector, con { *c++ = lv_conj(*a++); } - } #endif /* LV_HAVE_SSSE3 */ @@ -188,7 +187,6 @@ static inline void volk_gnsssdr_8ic_conjugate_8ic_u_sse3(lv_8sc_t* cVector, cons { *c++ = lv_conj(*a++); } - } #endif /* LV_HAVE_SSE3 */ @@ -201,7 +199,7 @@ static inline void volk_gnsssdr_8ic_conjugate_8ic_generic(lv_8sc_t* cVector, con const lv_8sc_t* aPtr = aVector; unsigned int number; - for(number = 0; number < num_points; number++) + for (number = 0; number < num_points; number++) { *cPtr++ = lv_conj(*aPtr++); } @@ -230,10 +228,10 @@ static inline void volk_gnsssdr_8ic_conjugate_8ic_a_avx(lv_8sc_t* cVector, const tmp = _mm256_xor_ps(tmp, conjugator1); tmp128lo = _mm256_castsi256_si128(_mm256_castps_si256(tmp)); tmp128lo = _mm_add_epi8(tmp128lo, conjugator2); - tmp128hi = _mm256_extractf128_si256(_mm256_castps_si256(tmp),1); + tmp128hi = _mm256_extractf128_si256(_mm256_castps_si256(tmp), 1); tmp128hi = _mm_add_epi8(tmp128hi, conjugator2); //tmp = _mm256_set_m128i(tmp128hi , tmp128lo); //not defined in some versions of immintrin.h - tmp = _mm256_castsi256_ps(_mm256_insertf128_si256(_mm256_castsi128_si256(tmp128lo),(tmp128hi),1)); + tmp = _mm256_castsi256_ps(_mm256_insertf128_si256(_mm256_castsi128_si256(tmp128lo), (tmp128hi), 1)); _mm256_store_ps((float*)c, tmp); a += 16; @@ -336,7 +334,6 @@ static inline void volk_gnsssdr_8ic_conjugate_8ic_a_sse3(lv_8sc_t* cVector, cons { *c++ = lv_conj(*a++); } - } #endif /* LV_HAVE_SSE3 */ diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_8ic_magnitude_squared_8i.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_8ic_magnitude_squared_8i.h index 7152b0f29..d9dd67716 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_8ic_magnitude_squared_8i.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_8ic_magnitude_squared_8i.h @@ -78,23 +78,23 @@ static inline void volk_gnsssdr_8ic_magnitude_squared_8i_u_sse3(char* magnitudeV maska = _mm_set_epi8(0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 14, 12, 10, 8, 6, 4, 2, 0); maskb = _mm_set_epi8(14, 12, 10, 8, 6, 4, 2, 0, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80); - for(number = 0; number < sse_iters; number++) + for (number = 0; number < sse_iters; number++) { avector = _mm_lddqu_si128((__m128i*)complexVectorPtr); - avectorlo = _mm_unpacklo_epi8 (avector, zero); - avectorhi = _mm_unpackhi_epi8 (avector, zero); - avectorlomult = _mm_mullo_epi16 (avectorlo, avectorlo); - avectorhimult = _mm_mullo_epi16 (avectorhi, avectorhi); - aadded = _mm_hadd_epi16 (avectorlomult, avectorhimult); + avectorlo = _mm_unpacklo_epi8(avector, zero); + avectorhi = _mm_unpackhi_epi8(avector, zero); + avectorlomult = _mm_mullo_epi16(avectorlo, avectorlo); + avectorhimult = _mm_mullo_epi16(avectorhi, avectorhi); + aadded = _mm_hadd_epi16(avectorlomult, avectorhimult); complexVectorPtr += 16; bvector = _mm_lddqu_si128((__m128i*)complexVectorPtr); - bvectorlo = _mm_unpacklo_epi8 (bvector, zero); - bvectorhi = _mm_unpackhi_epi8 (bvector, zero); - bvectorlomult = _mm_mullo_epi16 (bvectorlo, bvectorlo); - bvectorhimult = _mm_mullo_epi16 (bvectorhi, bvectorhi); - badded = _mm_hadd_epi16 (bvectorlomult, bvectorhimult); + bvectorlo = _mm_unpacklo_epi8(bvector, zero); + bvectorhi = _mm_unpackhi_epi8(bvector, zero); + bvectorlomult = _mm_mullo_epi16(bvectorlo, bvectorlo); + bvectorhimult = _mm_mullo_epi16(bvectorhi, bvectorhi); + badded = _mm_hadd_epi16(bvectorlomult, bvectorhimult); complexVectorPtr += 16; @@ -162,11 +162,11 @@ static inline void volk_gnsssdr_8ic_magnitude_squared_8i_generic(char* magnitude const char* complexVectorPtr = (char*)complexVector; char* magnitudeVectorPtr = magnitudeVector; unsigned int number; - for(number = 0; number < num_points; number++) + for (number = 0; number < num_points; number++) { const char real = *complexVectorPtr++; const char imag = *complexVectorPtr++; - *magnitudeVectorPtr++ = (real*real) + (imag*imag); + *magnitudeVectorPtr++ = (real * real) + (imag * imag); } } #endif /* LV_HAVE_GENERIC */ @@ -192,23 +192,23 @@ static inline void volk_gnsssdr_8ic_magnitude_squared_8i_a_sse3(char* magnitudeV maska = _mm_set_epi8(0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 14, 12, 10, 8, 6, 4, 2, 0); maskb = _mm_set_epi8(14, 12, 10, 8, 6, 4, 2, 0, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80); - for(number = 0; number < sse_iters; number++) + for (number = 0; number < sse_iters; number++) { avector = _mm_load_si128((__m128i*)complexVectorPtr); - avectorlo = _mm_unpacklo_epi8 (avector, zero); - avectorhi = _mm_unpackhi_epi8 (avector, zero); - avectorlomult = _mm_mullo_epi16 (avectorlo, avectorlo); - avectorhimult = _mm_mullo_epi16 (avectorhi, avectorhi); - aadded = _mm_hadd_epi16 (avectorlomult, avectorhimult); + avectorlo = _mm_unpacklo_epi8(avector, zero); + avectorhi = _mm_unpackhi_epi8(avector, zero); + avectorlomult = _mm_mullo_epi16(avectorlo, avectorlo); + avectorhimult = _mm_mullo_epi16(avectorhi, avectorhi); + aadded = _mm_hadd_epi16(avectorlomult, avectorhimult); complexVectorPtr += 16; bvector = _mm_load_si128((__m128i*)complexVectorPtr); - bvectorlo = _mm_unpacklo_epi8 (bvector, zero); - bvectorhi = _mm_unpackhi_epi8 (bvector, zero); - bvectorlomult = _mm_mullo_epi16 (bvectorlo, bvectorlo); - bvectorhimult = _mm_mullo_epi16 (bvectorhi, bvectorhi); - badded = _mm_hadd_epi16 (bvectorlomult, bvectorhimult); + bvectorlo = _mm_unpacklo_epi8(bvector, zero); + bvectorhi = _mm_unpackhi_epi8(bvector, zero); + bvectorlomult = _mm_mullo_epi16(bvectorlo, bvectorlo); + bvectorhimult = _mm_mullo_epi16(bvectorhi, bvectorhi); + badded = _mm_hadd_epi16(bvectorlomult, bvectorhimult); complexVectorPtr += 16; diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_8ic_s8ic_multiply_8ic.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_8ic_s8ic_multiply_8ic.h index 21b1abb1b..3c949b3db 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_8ic_s8ic_multiply_8ic.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_8ic_s8ic_multiply_8ic.h @@ -80,7 +80,7 @@ static inline void volk_gnsssdr_8ic_s8ic_multiply_8ic_u_sse3(lv_8sc_t* cVector, imagy = _mm_and_si128(imagy, mult1); realy = _mm_and_si128(y, mult1); - for(; number < sse_iters; number++) + for (; number < sse_iters; number++) { x = _mm_lddqu_si128((__m128i*)a); @@ -111,7 +111,6 @@ static inline void volk_gnsssdr_8ic_s8ic_multiply_8ic_u_sse3(lv_8sc_t* cVector, { *c++ = (*a++) * scalar; } - } #endif /* LV_HAVE_SSE3 */ @@ -173,7 +172,7 @@ static inline void volk_gnsssdr_8ic_s8ic_multiply_8ic_a_sse3(lv_8sc_t* cVector, imagy = _mm_and_si128(imagy, mult1); realy = _mm_and_si128(y, mult1); - for(; number < sse_iters; number++) + for (; number < sse_iters; number++) { x = _mm_load_si128((__m128i*)a); @@ -204,7 +203,6 @@ static inline void volk_gnsssdr_8ic_s8ic_multiply_8ic_a_sse3(lv_8sc_t* cVector, { *c++ = (*a++) * scalar; } - } #endif /* LV_HAVE_SSE3 */ diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_8ic_x2_dot_prod_8ic.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_8ic_x2_dot_prod_8ic.h index e9633d682..88a689f8b 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_8ic_x2_dot_prod_8ic.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_8ic_x2_dot_prod_8ic.h @@ -75,17 +75,17 @@ static inline void volk_gnsssdr_8ic_x2_dot_prod_8ic_generic(lv_8sc_t* result, co *cPtr += (*aPtr++) * (*bPtr++); }*/ - char * res = (char*) result; - char * in = (char*) in_a; - char * tp = (char*) in_b; - unsigned int n_2_ccomplex_blocks = num_points/2; + char* res = (char*)result; + char* in = (char*)in_a; + char* tp = (char*)in_b; + unsigned int n_2_ccomplex_blocks = num_points / 2; unsigned int isodd = num_points & 1; - char sum0[2] = {0,0}; - char sum1[2] = {0,0}; + char sum0[2] = {0, 0}; + char sum1[2] = {0, 0}; unsigned int i = 0; - for(i = 0; i < n_2_ccomplex_blocks; ++i) + for (i = 0; i < n_2_ccomplex_blocks; ++i) { sum0[0] += in[0] * tp[0] - in[1] * tp[1]; sum0[1] += in[0] * tp[1] + in[1] * tp[0]; @@ -100,7 +100,7 @@ static inline void volk_gnsssdr_8ic_x2_dot_prod_8ic_generic(lv_8sc_t* result, co res[1] = sum0[1] + sum1[1]; // Cleanup if we had an odd number of points - for(i = 0; i < isodd; ++i) + for (i = 0; i < isodd; ++i) { *result += in_a[num_points - 1] * in_b[num_points - 1]; } @@ -115,13 +115,13 @@ static inline void volk_gnsssdr_8ic_x2_dot_prod_8ic_generic(lv_8sc_t* result, co static inline void volk_gnsssdr_8ic_x2_dot_prod_8ic_u_sse2(lv_8sc_t* result, const lv_8sc_t* in_a, const lv_8sc_t* in_b, unsigned int num_points) { lv_8sc_t dotProduct; - memset(&dotProduct, 0x0, 2*sizeof(char)); + memset(&dotProduct, 0x0, 2 * sizeof(char)); unsigned int number; unsigned int i; const lv_8sc_t* a = in_a; const lv_8sc_t* b = in_b; - const unsigned int sse_iters = num_points/8; + const unsigned int sse_iters = num_points / 8; if (sse_iters > 0) { @@ -131,7 +131,7 @@ static inline void volk_gnsssdr_8ic_x2_dot_prod_8ic_u_sse2(lv_8sc_t* result, con realcacc = _mm_setzero_si128(); imagcacc = _mm_setzero_si128(); - for(number = 0; number < sse_iters; number++) + for (number = 0; number < sse_iters; number++) { x = _mm_loadu_si128((__m128i*)a); y = _mm_loadu_si128((__m128i*)b); @@ -165,9 +165,10 @@ static inline void volk_gnsssdr_8ic_x2_dot_prod_8ic_u_sse2(lv_8sc_t* result, con totalc = _mm_or_si128(realcacc, imagcacc); - __VOLK_ATTR_ALIGNED(16) lv_8sc_t dotProductVector[8]; + __VOLK_ATTR_ALIGNED(16) + lv_8sc_t dotProductVector[8]; - _mm_storeu_si128((__m128i*)dotProductVector, totalc); // Store the results back into the dot product vector + _mm_storeu_si128((__m128i*)dotProductVector, totalc); // Store the results back into the dot product vector for (i = 0; i < 8; ++i) { @@ -192,13 +193,13 @@ static inline void volk_gnsssdr_8ic_x2_dot_prod_8ic_u_sse2(lv_8sc_t* result, con static inline void volk_gnsssdr_8ic_x2_dot_prod_8ic_u_sse4_1(lv_8sc_t* result, const lv_8sc_t* in_a, const lv_8sc_t* in_b, unsigned int num_points) { lv_8sc_t dotProduct; - memset(&dotProduct, 0x0, 2*sizeof(char)); + memset(&dotProduct, 0x0, 2 * sizeof(char)); unsigned int number; unsigned int i; const lv_8sc_t* a = in_a; const lv_8sc_t* b = in_b; - const unsigned int sse_iters = num_points/8; + const unsigned int sse_iters = num_points / 8; if (sse_iters > 0) { @@ -208,7 +209,7 @@ static inline void volk_gnsssdr_8ic_x2_dot_prod_8ic_u_sse4_1(lv_8sc_t* result, c realcacc = _mm_setzero_si128(); imagcacc = _mm_setzero_si128(); - for(number = 0; number < sse_iters; number++) + for (number = 0; number < sse_iters; number++) { x = _mm_lddqu_si128((__m128i*)a); y = _mm_lddqu_si128((__m128i*)b); @@ -236,13 +237,14 @@ static inline void volk_gnsssdr_8ic_x2_dot_prod_8ic_u_sse4_1(lv_8sc_t* result, c b += 8; } - imagcacc = _mm_slli_si128 (imagcacc, 1); + imagcacc = _mm_slli_si128(imagcacc, 1); - totalc = _mm_blendv_epi8 (imagcacc, realcacc, mult1); + totalc = _mm_blendv_epi8(imagcacc, realcacc, mult1); - __VOLK_ATTR_ALIGNED(16) lv_8sc_t dotProductVector[8]; + __VOLK_ATTR_ALIGNED(16) + lv_8sc_t dotProductVector[8]; - _mm_storeu_si128((__m128i*)dotProductVector, totalc); // Store the results back into the dot product vector + _mm_storeu_si128((__m128i*)dotProductVector, totalc); // Store the results back into the dot product vector for (i = 0; i < 8; ++i) { @@ -267,13 +269,13 @@ static inline void volk_gnsssdr_8ic_x2_dot_prod_8ic_u_sse4_1(lv_8sc_t* result, c static inline void volk_gnsssdr_8ic_x2_dot_prod_8ic_a_sse2(lv_8sc_t* result, const lv_8sc_t* in_a, const lv_8sc_t* in_b, unsigned int num_points) { lv_8sc_t dotProduct; - memset(&dotProduct, 0x0, 2*sizeof(char)); + memset(&dotProduct, 0x0, 2 * sizeof(char)); unsigned int number; unsigned int i; const lv_8sc_t* a = in_a; const lv_8sc_t* b = in_b; - const unsigned int sse_iters = num_points/8; + const unsigned int sse_iters = num_points / 8; if (sse_iters > 0) { @@ -283,7 +285,7 @@ static inline void volk_gnsssdr_8ic_x2_dot_prod_8ic_a_sse2(lv_8sc_t* result, con realcacc = _mm_setzero_si128(); imagcacc = _mm_setzero_si128(); - for(number = 0; number < sse_iters; number++) + for (number = 0; number < sse_iters; number++) { x = _mm_load_si128((__m128i*)a); y = _mm_load_si128((__m128i*)b); @@ -317,9 +319,10 @@ static inline void volk_gnsssdr_8ic_x2_dot_prod_8ic_a_sse2(lv_8sc_t* result, con totalc = _mm_or_si128(realcacc, imagcacc); - __VOLK_ATTR_ALIGNED(16) lv_8sc_t dotProductVector[8]; + __VOLK_ATTR_ALIGNED(16) + lv_8sc_t dotProductVector[8]; - _mm_store_si128((__m128i*)dotProductVector, totalc); // Store the results back into the dot product vector + _mm_store_si128((__m128i*)dotProductVector, totalc); // Store the results back into the dot product vector for (i = 0; i < 8; ++i) { @@ -343,7 +346,7 @@ static inline void volk_gnsssdr_8ic_x2_dot_prod_8ic_a_sse2(lv_8sc_t* result, con static inline void volk_gnsssdr_8ic_x2_dot_prod_8ic_a_sse4_1(lv_8sc_t* result, const lv_8sc_t* in_a, const lv_8sc_t* in_b, unsigned int num_points) { lv_8sc_t dotProduct; - memset(&dotProduct, 0x0, 2*sizeof(char)); + memset(&dotProduct, 0x0, 2 * sizeof(char)); unsigned int number; unsigned int i; const lv_8sc_t* a = in_a; @@ -359,7 +362,7 @@ static inline void volk_gnsssdr_8ic_x2_dot_prod_8ic_a_sse4_1(lv_8sc_t* result, c realcacc = _mm_setzero_si128(); imagcacc = _mm_setzero_si128(); - for(number = 0; number < sse_iters; number++) + for (number = 0; number < sse_iters; number++) { x = _mm_load_si128((__m128i*)a); y = _mm_load_si128((__m128i*)b); @@ -387,13 +390,14 @@ static inline void volk_gnsssdr_8ic_x2_dot_prod_8ic_a_sse4_1(lv_8sc_t* result, c b += 8; } - imagcacc = _mm_slli_si128 (imagcacc, 1); + imagcacc = _mm_slli_si128(imagcacc, 1); - totalc = _mm_blendv_epi8 (imagcacc, realcacc, mult1); + totalc = _mm_blendv_epi8(imagcacc, realcacc, mult1); - __VOLK_ATTR_ALIGNED(16) lv_8sc_t dotProductVector[8]; + __VOLK_ATTR_ALIGNED(16) + lv_8sc_t dotProductVector[8]; - _mm_store_si128((__m128i*)dotProductVector, totalc); // Store the results back into the dot product vector + _mm_store_si128((__m128i*)dotProductVector, totalc); // Store the results back into the dot product vector for (i = 0; i < 8; ++i) { @@ -438,22 +442,23 @@ static inline void volk_gnsssdr_8ic_x2_dot_prod_8ic_u_orc(lv_8sc_t* result, cons static inline void volk_gnsssdr_8ic_x2_dot_prod_8ic_neon(lv_8sc_t* result, const lv_8sc_t* in_a, const lv_8sc_t* in_b, unsigned int num_points) { lv_8sc_t dotProduct; - dotProduct = lv_cmake(0,0); - *result = lv_cmake(0,0); + dotProduct = lv_cmake(0, 0); + *result = lv_cmake(0, 0); const lv_8sc_t* a = in_a; const lv_8sc_t* b = in_b; // for 2-lane vectors, 1st lane holds the real part, // 2nd lane holds the imaginary part int8x8x2_t a_val, b_val, c_val, accumulator, tmp_real, tmp_imag; - __VOLK_ATTR_ALIGNED(16) lv_8sc_t accum_result[8] = { lv_cmake(0,0) }; + __VOLK_ATTR_ALIGNED(16) + lv_8sc_t accum_result[8] = {lv_cmake(0, 0)}; accumulator.val[0] = vdup_n_s8(0); accumulator.val[1] = vdup_n_s8(0); unsigned int number; const unsigned int neon_iters = num_points / 8; - for(number = 0; number < neon_iters; ++number) + for (number = 0; number < neon_iters; ++number) { a_val = vld2_s8((const int8_t*)a); b_val = vld2_s8((const int8_t*)b); @@ -478,7 +483,7 @@ static inline void volk_gnsssdr_8ic_x2_dot_prod_8ic_neon(lv_8sc_t* result, const b += 8; } vst2_s8((int8_t*)accum_result, accumulator); - for(number = 0; number < 8; ++number) + for (number = 0; number < 8; ++number) { *result += accum_result[number]; } @@ -490,6 +495,6 @@ static inline void volk_gnsssdr_8ic_x2_dot_prod_8ic_neon(lv_8sc_t* result, const *result += dotProduct; } -#endif /* LV_HAVE_NEON */ +#endif /* LV_HAVE_NEON */ #endif /*INCLUDED_volk_gnsssdr_8ic_x2_dot_prod_8ic_H*/ diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_8ic_x2_multiply_8ic.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_8ic_x2_multiply_8ic.h index 1b3fd5532..0d8c1d6b3 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_8ic_x2_multiply_8ic.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_8ic_x2_multiply_8ic.h @@ -75,7 +75,7 @@ static inline void volk_gnsssdr_8ic_x2_multiply_8ic_u_sse2(lv_8sc_t* cVector, co mult1 = _mm_set_epi8(0, 0xFF, 0, 0xFF, 0, 0xFF, 0, 0xFF, 0, 0xFF, 0, 0xFF, 0, 0xFF, 0, 0xFF); - for(number = 0; number < sse_iters; number++) + for (number = 0; number < sse_iters; number++) { x = _mm_loadu_si128((__m128i*)a); y = _mm_loadu_si128((__m128i*)b); @@ -133,7 +133,7 @@ static inline void volk_gnsssdr_8ic_x2_multiply_8ic_u_sse4_1(lv_8sc_t* cVector, _mm_setzero_si128(); mult1 = _mm_set_epi8(0, 0xFF, 0, 0xFF, 0, 0xFF, 0, 0xFF, 0, 0xFF, 0, 0xFF, 0, 0xFF, 0, 0xFF); - for(number = 0; number < sse_iters; number++) + for (number = 0; number < sse_iters; number++) { x = _mm_lddqu_si128((__m128i*)a); y = _mm_lddqu_si128((__m128i*)b); @@ -181,7 +181,7 @@ static inline void volk_gnsssdr_8ic_x2_multiply_8ic_generic(lv_8sc_t* cVector, c const lv_8sc_t* bPtr = bVector; unsigned int number; - for(number = 0; number < num_points; number++) + for (number = 0; number < num_points; number++) { *cPtr++ = (*aPtr++) * (*bPtr++); } @@ -204,7 +204,7 @@ static inline void volk_gnsssdr_8ic_x2_multiply_8ic_a_sse2(lv_8sc_t* cVector, co mult1 = _mm_set_epi8(0, 0xFF, 0, 0xFF, 0, 0xFF, 0, 0xFF, 0, 0xFF, 0, 0xFF, 0, 0xFF, 0, 0xFF); - for(number = 0; number < sse_iters; number++) + for (number = 0; number < sse_iters; number++) { x = _mm_load_si128((__m128i*)a); y = _mm_load_si128((__m128i*)b); @@ -228,7 +228,7 @@ static inline void volk_gnsssdr_8ic_x2_multiply_8ic_a_sse2(lv_8sc_t* cVector, co imagc = _mm_and_si128(imagc, mult1); imagc = _mm_slli_si128(imagc, 1); - totalc = _mm_or_si128 (realc, imagc); + totalc = _mm_or_si128(realc, imagc); _mm_store_si128((__m128i*)c, totalc); @@ -262,7 +262,7 @@ static inline void volk_gnsssdr_8ic_x2_multiply_8ic_a_sse4_1(lv_8sc_t* cVector, _mm_setzero_si128(); mult1 = _mm_set_epi8(0, 0xFF, 0, 0xFF, 0, 0xFF, 0, 0xFF, 0, 0xFF, 0, 0xFF, 0, 0xFF, 0, 0xFF); - for(number = 0; number < sse_iters; number++) + for (number = 0; number < sse_iters; number++) { x = _mm_load_si128((__m128i*)a); y = _mm_load_si128((__m128i*)b); diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_8u_x2_multiply_8u.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_8u_x2_multiply_8u.h index 8457b7f14..e953954f0 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_8u_x2_multiply_8u.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_8u_x2_multiply_8u.h @@ -72,7 +72,7 @@ static inline void volk_gnsssdr_8u_x2_multiply_8u_u_avx2(unsigned char* cChar, c const unsigned char* a = aChar; const unsigned char* b = bChar; - for(number = 0; number < avx2_iters; number++) + for (number = 0; number < avx2_iters; number++) { x = _mm256_loadu_si256((__m256i*)a); y = _mm256_loadu_si256((__m256i*)b); @@ -101,7 +101,7 @@ static inline void volk_gnsssdr_8u_x2_multiply_8u_u_avx2(unsigned char* cChar, c c += 32; } - for (i = avx2_iters * 32; i < num_points ; ++i) + for (i = avx2_iters * 32; i < num_points; ++i) { *c++ = (*a++) * (*b++); } @@ -123,7 +123,7 @@ static inline void volk_gnsssdr_8u_x2_multiply_8u_u_sse3(unsigned char* cChar, c const unsigned char* a = aChar; const unsigned char* b = bChar; - for(number = 0; number < sse_iters; number++) + for (number = 0; number < sse_iters; number++) { x = _mm_lddqu_si128((__m128i*)a); y = _mm_lddqu_si128((__m128i*)b); @@ -152,7 +152,7 @@ static inline void volk_gnsssdr_8u_x2_multiply_8u_u_sse3(unsigned char* cChar, c c += 16; } - for (i = sse_iters * 16; i < num_points ; ++i) + for (i = sse_iters * 16; i < num_points; ++i) { *c++ = (*a++) * (*b++); } @@ -168,7 +168,7 @@ static inline void volk_gnsssdr_8u_x2_multiply_8u_generic(unsigned char* cChar, const unsigned char* bPtr = bChar; unsigned int number; - for(number = 0; number < num_points; number++) + for (number = 0; number < num_points; number++) { *cPtr++ = (*aPtr++) * (*bPtr++); } @@ -189,7 +189,7 @@ static inline void volk_gnsssdr_8u_x2_multiply_8u_a_sse3(unsigned char* cChar, c const unsigned char* a = aChar; const unsigned char* b = bChar; - for(number = 0; number < sse_iters; number++) + for (number = 0; number < sse_iters; number++) { x = _mm_load_si128((__m128i*)a); y = _mm_load_si128((__m128i*)b); @@ -240,7 +240,7 @@ static inline void volk_gnsssdr_8u_x2_multiply_8u_a_avx2(unsigned char* cChar, c const unsigned char* a = aChar; const unsigned char* b = bChar; - for(number = 0; number < avx2_iters; number++) + for (number = 0; number < avx2_iters; number++) { x = _mm256_load_si256((__m256i*)a); y = _mm256_load_si256((__m256i*)b); @@ -269,7 +269,7 @@ static inline void volk_gnsssdr_8u_x2_multiply_8u_a_avx2(unsigned char* cChar, c c += 32; } - for (i = avx2_iters * 32; i < num_points ; ++i) + for (i = avx2_iters * 32; i < num_points; ++i) { *c++ = (*a++) * (*b++); } diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_s32f_sincos_32fc.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_s32f_sincos_32fc.h index e7e1153e3..d6d58e4d0 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_s32f_sincos_32fc.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_s32f_sincos_32fc.h @@ -71,9 +71,9 @@ #include /* Adapted from http://gruntthepeon.free.fr/ssemath/sse_mathfun.h, original code from Julien Pommier */ /* Based on algorithms from the cephes library http://www.netlib.org/cephes/ */ -static inline void volk_gnsssdr_s32f_sincos_32fc_a_sse2(lv_32fc_t* out, const float phase_inc, float* phase, unsigned int num_points) +static inline void volk_gnsssdr_s32f_sincos_32fc_a_sse2(lv_32fc_t *out, const float phase_inc, float *phase, unsigned int num_points) { - lv_32fc_t* bPtr = out; + lv_32fc_t *bPtr = out; const unsigned int sse_iters = num_points / 4; unsigned int number = 0; @@ -84,44 +84,44 @@ static inline void volk_gnsssdr_s32f_sincos_32fc_a_sse2(lv_32fc_t* out, const fl __m128i emm0, emm2, emm4; /* declare some SSE constants */ - static const int _ps_inv_sign_mask[4] = { ~0x80000000, ~0x80000000, ~0x80000000, ~0x80000000 }; - static const int _ps_sign_mask[4] = { (int)0x80000000, (int)0x80000000, (int)0x80000000, (int)0x80000000 }; + static const int _ps_inv_sign_mask[4] = {~0x80000000, ~0x80000000, ~0x80000000, ~0x80000000}; + static const int _ps_sign_mask[4] = {(int)0x80000000, (int)0x80000000, (int)0x80000000, (int)0x80000000}; - static const float _ps_cephes_FOPI[4] = { 1.27323954473516, 1.27323954473516, 1.27323954473516, 1.27323954473516 }; - static const int _pi32_1[4] = { 1, 1, 1, 1 }; - static const int _pi32_inv1[4] = { ~1, ~1, ~1, ~1 }; - static const int _pi32_2[4] = { 2, 2, 2, 2}; - static const int _pi32_4[4] = { 4, 4, 4, 4}; + static const float _ps_cephes_FOPI[4] = {1.27323954473516, 1.27323954473516, 1.27323954473516, 1.27323954473516}; + static const int _pi32_1[4] = {1, 1, 1, 1}; + static const int _pi32_inv1[4] = {~1, ~1, ~1, ~1}; + static const int _pi32_2[4] = {2, 2, 2, 2}; + static const int _pi32_4[4] = {4, 4, 4, 4}; - static const float _ps_minus_cephes_DP1[4] = { -0.78515625, -0.78515625, -0.78515625, -0.78515625 }; - static const float _ps_minus_cephes_DP2[4] = { -2.4187564849853515625e-4, -2.4187564849853515625e-4, -2.4187564849853515625e-4, -2.4187564849853515625e-4 }; - static const float _ps_minus_cephes_DP3[4] = { -3.77489497744594108e-8, -3.77489497744594108e-8, -3.77489497744594108e-8, -3.77489497744594108e-8 }; - static const float _ps_coscof_p0[4] = { 2.443315711809948E-005, 2.443315711809948E-005, 2.443315711809948E-005, 2.443315711809948E-005 }; - static const float _ps_coscof_p1[4] = { -1.388731625493765E-003, -1.388731625493765E-003, -1.388731625493765E-003, -1.388731625493765E-003 }; - static const float _ps_coscof_p2[4] = { 4.166664568298827E-002, 4.166664568298827E-002, 4.166664568298827E-002, 4.166664568298827E-002 }; - static const float _ps_sincof_p0[4] = { -1.9515295891E-4, -1.9515295891E-4, -1.9515295891E-4, -1.9515295891E-4 }; - static const float _ps_sincof_p1[4] = { 8.3321608736E-3, 8.3321608736E-3, 8.3321608736E-3, 8.3321608736E-3 }; - static const float _ps_sincof_p2[4] = { -1.6666654611E-1, -1.6666654611E-1, -1.6666654611E-1, -1.6666654611E-1 }; - static const float _ps_0p5[4] = { 0.5f, 0.5f, 0.5f, 0.5f }; - static const float _ps_1[4] = { 1.0f, 1.0f, 1.0f, 1.0f }; + static const float _ps_minus_cephes_DP1[4] = {-0.78515625, -0.78515625, -0.78515625, -0.78515625}; + static const float _ps_minus_cephes_DP2[4] = {-2.4187564849853515625e-4, -2.4187564849853515625e-4, -2.4187564849853515625e-4, -2.4187564849853515625e-4}; + static const float _ps_minus_cephes_DP3[4] = {-3.77489497744594108e-8, -3.77489497744594108e-8, -3.77489497744594108e-8, -3.77489497744594108e-8}; + static const float _ps_coscof_p0[4] = {2.443315711809948E-005, 2.443315711809948E-005, 2.443315711809948E-005, 2.443315711809948E-005}; + static const float _ps_coscof_p1[4] = {-1.388731625493765E-003, -1.388731625493765E-003, -1.388731625493765E-003, -1.388731625493765E-003}; + static const float _ps_coscof_p2[4] = {4.166664568298827E-002, 4.166664568298827E-002, 4.166664568298827E-002, 4.166664568298827E-002}; + static const float _ps_sincof_p0[4] = {-1.9515295891E-4, -1.9515295891E-4, -1.9515295891E-4, -1.9515295891E-4}; + static const float _ps_sincof_p1[4] = {8.3321608736E-3, 8.3321608736E-3, 8.3321608736E-3, 8.3321608736E-3}; + static const float _ps_sincof_p2[4] = {-1.6666654611E-1, -1.6666654611E-1, -1.6666654611E-1, -1.6666654611E-1}; + static const float _ps_0p5[4] = {0.5f, 0.5f, 0.5f, 0.5f}; + static const float _ps_1[4] = {1.0f, 1.0f, 1.0f, 1.0f}; - float four_phases[4] = { _phase, _phase + phase_inc, _phase + 2 * phase_inc, _phase + 3 * phase_inc }; - float four_phases_inc[4] = { 4 * phase_inc, 4 * phase_inc, 4 * phase_inc, 4 * phase_inc }; + float four_phases[4] = {_phase, _phase + phase_inc, _phase + 2 * phase_inc, _phase + 3 * phase_inc}; + float four_phases_inc[4] = {4 * phase_inc, 4 * phase_inc, 4 * phase_inc, 4 * phase_inc}; four_phases_reg = _mm_load_ps(four_phases); const __m128 four_phases_inc_reg = _mm_load_ps(four_phases_inc); - for(;number < sse_iters; number++) + for (; number < sse_iters; number++) { x = four_phases_reg; sign_bit_sin = x; /* take the absolute value */ - x = _mm_and_ps(x, *(__m128*)_ps_inv_sign_mask); + x = _mm_and_ps(x, *(__m128 *)_ps_inv_sign_mask); /* extract the sign bit (upper one) */ - sign_bit_sin = _mm_and_ps(sign_bit_sin, *(__m128*)_ps_sign_mask); + sign_bit_sin = _mm_and_ps(sign_bit_sin, *(__m128 *)_ps_sign_mask); /* scale by 4/Pi */ - y = _mm_mul_ps(x, *(__m128*)_ps_cephes_FOPI); + y = _mm_mul_ps(x, *(__m128 *)_ps_cephes_FOPI); /* store the integer part of y in emm2 */ emm2 = _mm_cvttps_epi32(y); @@ -145,9 +145,9 @@ static inline void volk_gnsssdr_s32f_sincos_32fc_a_sse2(lv_32fc_t* out, const fl /* The magic pass: "Extended precision modular arithmetic” x = ((x - y * DP1) - y * DP2) - y * DP3; */ - xmm1 = *(__m128*)_ps_minus_cephes_DP1; - xmm2 = *(__m128*)_ps_minus_cephes_DP2; - xmm3 = *(__m128*)_ps_minus_cephes_DP3; + xmm1 = *(__m128 *)_ps_minus_cephes_DP1; + xmm2 = *(__m128 *)_ps_minus_cephes_DP2; + xmm3 = *(__m128 *)_ps_minus_cephes_DP3; xmm1 = _mm_mul_ps(y, xmm1); xmm2 = _mm_mul_ps(y, xmm2); xmm3 = _mm_mul_ps(y, xmm3); @@ -163,25 +163,25 @@ static inline void volk_gnsssdr_s32f_sincos_32fc_a_sse2(lv_32fc_t* out, const fl sign_bit_sin = _mm_xor_ps(sign_bit_sin, swap_sign_bit_sin); /* Evaluate the first polynom (0 <= x <= Pi/4) */ - __m128 z = _mm_mul_ps(x,x); - y = *(__m128*)_ps_coscof_p0; + __m128 z = _mm_mul_ps(x, x); + y = *(__m128 *)_ps_coscof_p0; y = _mm_mul_ps(y, z); - y = _mm_add_ps(y, *(__m128*)_ps_coscof_p1); + y = _mm_add_ps(y, *(__m128 *)_ps_coscof_p1); y = _mm_mul_ps(y, z); - y = _mm_add_ps(y, *(__m128*)_ps_coscof_p2); + y = _mm_add_ps(y, *(__m128 *)_ps_coscof_p2); y = _mm_mul_ps(y, z); y = _mm_mul_ps(y, z); - __m128 tmp = _mm_mul_ps(z, *(__m128*)_ps_0p5); + __m128 tmp = _mm_mul_ps(z, *(__m128 *)_ps_0p5); y = _mm_sub_ps(y, tmp); - y = _mm_add_ps(y, *(__m128*)_ps_1); + y = _mm_add_ps(y, *(__m128 *)_ps_1); /* Evaluate the second polynom (Pi/4 <= x <= 0) */ - __m128 y2 = *(__m128*)_ps_sincof_p0; + __m128 y2 = *(__m128 *)_ps_sincof_p0; y2 = _mm_mul_ps(y2, z); - y2 = _mm_add_ps(y2, *(__m128*)_ps_sincof_p1); + y2 = _mm_add_ps(y2, *(__m128 *)_ps_sincof_p1); y2 = _mm_mul_ps(y2, z); - y2 = _mm_add_ps(y2, *(__m128*)_ps_sincof_p2); + y2 = _mm_add_ps(y2, *(__m128 *)_ps_sincof_p2); y2 = _mm_mul_ps(y2, z); y2 = _mm_mul_ps(y2, x); y2 = _mm_add_ps(y2, x); @@ -190,11 +190,11 @@ static inline void volk_gnsssdr_s32f_sincos_32fc_a_sse2(lv_32fc_t* out, const fl xmm3 = poly_mask; __m128 ysin2 = _mm_and_ps(xmm3, y2); __m128 ysin1 = _mm_andnot_ps(xmm3, y); - y2 = _mm_sub_ps(y2,ysin2); + y2 = _mm_sub_ps(y2, ysin2); y = _mm_sub_ps(y, ysin1); - xmm1 = _mm_add_ps(ysin1,ysin2); - xmm2 = _mm_add_ps(y,y2); + xmm1 = _mm_add_ps(ysin1, ysin2); + xmm2 = _mm_add_ps(y, y2); /* update the sign */ sine = _mm_xor_ps(xmm1, sign_bit_sin); @@ -202,19 +202,19 @@ static inline void volk_gnsssdr_s32f_sincos_32fc_a_sse2(lv_32fc_t* out, const fl /* write the output */ aux = _mm_unpacklo_ps(cosine, sine); - _mm_store_ps((float*)bPtr, aux); + _mm_store_ps((float *)bPtr, aux); bPtr += 2; aux = _mm_unpackhi_ps(cosine, sine); - _mm_store_ps((float*)bPtr, aux); + _mm_store_ps((float *)bPtr, aux); bPtr += 2; four_phases_reg = _mm_add_ps(four_phases_reg, four_phases_inc_reg); } _phase = _phase + phase_inc * (sse_iters * 4); - for(number = sse_iters * 4; number < num_points; number++) + for (number = sse_iters * 4; number < num_points; number++) { - *bPtr++ = lv_cmake((float)cosf((_phase)), (float)sinf((_phase)) ); + *bPtr++ = lv_cmake((float)cosf((_phase)), (float)sinf((_phase))); _phase += phase_inc; } (*phase) = _phase; @@ -227,9 +227,9 @@ static inline void volk_gnsssdr_s32f_sincos_32fc_a_sse2(lv_32fc_t* out, const fl #include /* Adapted from http://gruntthepeon.free.fr/ssemath/sse_mathfun.h, original code from Julien Pommier */ /* Based on algorithms from the cephes library http://www.netlib.org/cephes/ */ -static inline void volk_gnsssdr_s32f_sincos_32fc_u_sse2(lv_32fc_t* out, const float phase_inc, float* phase, unsigned int num_points) +static inline void volk_gnsssdr_s32f_sincos_32fc_u_sse2(lv_32fc_t *out, const float phase_inc, float *phase, unsigned int num_points) { - lv_32fc_t* bPtr = out; + lv_32fc_t *bPtr = out; const unsigned int sse_iters = num_points / 4; unsigned int number = 0; @@ -241,44 +241,64 @@ static inline void volk_gnsssdr_s32f_sincos_32fc_u_sse2(lv_32fc_t* out, const fl __m128i emm0, emm2, emm4; /* declare some SSE constants */ - __VOLK_ATTR_ALIGNED(16) static const int _ps_inv_sign_mask[4] = { ~0x80000000, ~0x80000000, ~0x80000000, ~0x80000000 }; - __VOLK_ATTR_ALIGNED(16) static const int _ps_sign_mask[4] = { (int)0x80000000, (int)0x80000000, (int)0x80000000, (int)0x80000000 }; + __VOLK_ATTR_ALIGNED(16) + static const int _ps_inv_sign_mask[4] = {~0x80000000, ~0x80000000, ~0x80000000, ~0x80000000}; + __VOLK_ATTR_ALIGNED(16) + static const int _ps_sign_mask[4] = {(int)0x80000000, (int)0x80000000, (int)0x80000000, (int)0x80000000}; - __VOLK_ATTR_ALIGNED(16) static const float _ps_cephes_FOPI[4] = { 1.27323954473516, 1.27323954473516, 1.27323954473516, 1.27323954473516 }; - __VOLK_ATTR_ALIGNED(16) static const int _pi32_1[4] = { 1, 1, 1, 1 }; - __VOLK_ATTR_ALIGNED(16) static const int _pi32_inv1[4] = { ~1, ~1, ~1, ~1 }; - __VOLK_ATTR_ALIGNED(16) static const int _pi32_2[4] = { 2, 2, 2, 2}; - __VOLK_ATTR_ALIGNED(16) static const int _pi32_4[4] = { 4, 4, 4, 4}; + __VOLK_ATTR_ALIGNED(16) + static const float _ps_cephes_FOPI[4] = {1.27323954473516, 1.27323954473516, 1.27323954473516, 1.27323954473516}; + __VOLK_ATTR_ALIGNED(16) + static const int _pi32_1[4] = {1, 1, 1, 1}; + __VOLK_ATTR_ALIGNED(16) + static const int _pi32_inv1[4] = {~1, ~1, ~1, ~1}; + __VOLK_ATTR_ALIGNED(16) + static const int _pi32_2[4] = {2, 2, 2, 2}; + __VOLK_ATTR_ALIGNED(16) + static const int _pi32_4[4] = {4, 4, 4, 4}; - __VOLK_ATTR_ALIGNED(16) static const float _ps_minus_cephes_DP1[4] = { -0.78515625, -0.78515625, -0.78515625, -0.78515625 }; - __VOLK_ATTR_ALIGNED(16) static const float _ps_minus_cephes_DP2[4] = { -2.4187564849853515625e-4, -2.4187564849853515625e-4, -2.4187564849853515625e-4, -2.4187564849853515625e-4 }; - __VOLK_ATTR_ALIGNED(16) static const float _ps_minus_cephes_DP3[4] = { -3.77489497744594108e-8, -3.77489497744594108e-8, -3.77489497744594108e-8, -3.77489497744594108e-8 }; - __VOLK_ATTR_ALIGNED(16) static const float _ps_coscof_p0[4] = { 2.443315711809948E-005, 2.443315711809948E-005, 2.443315711809948E-005, 2.443315711809948E-005 }; - __VOLK_ATTR_ALIGNED(16) static const float _ps_coscof_p1[4] = { -1.388731625493765E-003, -1.388731625493765E-003, -1.388731625493765E-003, -1.388731625493765E-003 }; - __VOLK_ATTR_ALIGNED(16) static const float _ps_coscof_p2[4] = { 4.166664568298827E-002, 4.166664568298827E-002, 4.166664568298827E-002, 4.166664568298827E-002 }; - __VOLK_ATTR_ALIGNED(16) static const float _ps_sincof_p0[4] = { -1.9515295891E-4, -1.9515295891E-4, -1.9515295891E-4, -1.9515295891E-4 }; - __VOLK_ATTR_ALIGNED(16) static const float _ps_sincof_p1[4] = { 8.3321608736E-3, 8.3321608736E-3, 8.3321608736E-3, 8.3321608736E-3 }; - __VOLK_ATTR_ALIGNED(16) static const float _ps_sincof_p2[4] = { -1.6666654611E-1, -1.6666654611E-1, -1.6666654611E-1, -1.6666654611E-1 }; - __VOLK_ATTR_ALIGNED(16) static const float _ps_0p5[4] = { 0.5f, 0.5f, 0.5f, 0.5f }; - __VOLK_ATTR_ALIGNED(16) static const float _ps_1[4] = { 1.0f, 1.0f, 1.0f, 1.0f }; + __VOLK_ATTR_ALIGNED(16) + static const float _ps_minus_cephes_DP1[4] = {-0.78515625, -0.78515625, -0.78515625, -0.78515625}; + __VOLK_ATTR_ALIGNED(16) + static const float _ps_minus_cephes_DP2[4] = {-2.4187564849853515625e-4, -2.4187564849853515625e-4, -2.4187564849853515625e-4, -2.4187564849853515625e-4}; + __VOLK_ATTR_ALIGNED(16) + static const float _ps_minus_cephes_DP3[4] = {-3.77489497744594108e-8, -3.77489497744594108e-8, -3.77489497744594108e-8, -3.77489497744594108e-8}; + __VOLK_ATTR_ALIGNED(16) + static const float _ps_coscof_p0[4] = {2.443315711809948E-005, 2.443315711809948E-005, 2.443315711809948E-005, 2.443315711809948E-005}; + __VOLK_ATTR_ALIGNED(16) + static const float _ps_coscof_p1[4] = {-1.388731625493765E-003, -1.388731625493765E-003, -1.388731625493765E-003, -1.388731625493765E-003}; + __VOLK_ATTR_ALIGNED(16) + static const float _ps_coscof_p2[4] = {4.166664568298827E-002, 4.166664568298827E-002, 4.166664568298827E-002, 4.166664568298827E-002}; + __VOLK_ATTR_ALIGNED(16) + static const float _ps_sincof_p0[4] = {-1.9515295891E-4, -1.9515295891E-4, -1.9515295891E-4, -1.9515295891E-4}; + __VOLK_ATTR_ALIGNED(16) + static const float _ps_sincof_p1[4] = {8.3321608736E-3, 8.3321608736E-3, 8.3321608736E-3, 8.3321608736E-3}; + __VOLK_ATTR_ALIGNED(16) + static const float _ps_sincof_p2[4] = {-1.6666654611E-1, -1.6666654611E-1, -1.6666654611E-1, -1.6666654611E-1}; + __VOLK_ATTR_ALIGNED(16) + static const float _ps_0p5[4] = {0.5f, 0.5f, 0.5f, 0.5f}; + __VOLK_ATTR_ALIGNED(16) + static const float _ps_1[4] = {1.0f, 1.0f, 1.0f, 1.0f}; - __VOLK_ATTR_ALIGNED(16) float four_phases[4] = { _phase, _phase + phase_inc, _phase + 2 * phase_inc, _phase + 3 * phase_inc }; - __VOLK_ATTR_ALIGNED(16) float four_phases_inc[4] = { 4 * phase_inc, 4 * phase_inc, 4 * phase_inc, 4 * phase_inc }; + __VOLK_ATTR_ALIGNED(16) + float four_phases[4] = {_phase, _phase + phase_inc, _phase + 2 * phase_inc, _phase + 3 * phase_inc}; + __VOLK_ATTR_ALIGNED(16) + float four_phases_inc[4] = {4 * phase_inc, 4 * phase_inc, 4 * phase_inc, 4 * phase_inc}; four_phases_reg = _mm_load_ps(four_phases); const __m128 four_phases_inc_reg = _mm_load_ps(four_phases_inc); - for(;number < sse_iters; number++) + for (; number < sse_iters; number++) { x = four_phases_reg; sign_bit_sin = x; /* take the absolute value */ - x = _mm_and_ps(x, *(__m128*)_ps_inv_sign_mask); + x = _mm_and_ps(x, *(__m128 *)_ps_inv_sign_mask); /* extract the sign bit (upper one) */ - sign_bit_sin = _mm_and_ps(sign_bit_sin, *(__m128*)_ps_sign_mask); + sign_bit_sin = _mm_and_ps(sign_bit_sin, *(__m128 *)_ps_sign_mask); /* scale by 4/Pi */ - y = _mm_mul_ps(x, *(__m128*)_ps_cephes_FOPI); + y = _mm_mul_ps(x, *(__m128 *)_ps_cephes_FOPI); /* store the integer part of y in emm2 */ emm2 = _mm_cvttps_epi32(y); @@ -302,9 +322,9 @@ static inline void volk_gnsssdr_s32f_sincos_32fc_u_sse2(lv_32fc_t* out, const fl /* The magic pass: "Extended precision modular arithmetic” x = ((x - y * DP1) - y * DP2) - y * DP3; */ - xmm1 = *(__m128*)_ps_minus_cephes_DP1; - xmm2 = *(__m128*)_ps_minus_cephes_DP2; - xmm3 = *(__m128*)_ps_minus_cephes_DP3; + xmm1 = *(__m128 *)_ps_minus_cephes_DP1; + xmm2 = *(__m128 *)_ps_minus_cephes_DP2; + xmm3 = *(__m128 *)_ps_minus_cephes_DP3; xmm1 = _mm_mul_ps(y, xmm1); xmm2 = _mm_mul_ps(y, xmm2); xmm3 = _mm_mul_ps(y, xmm3); @@ -320,25 +340,25 @@ static inline void volk_gnsssdr_s32f_sincos_32fc_u_sse2(lv_32fc_t* out, const fl sign_bit_sin = _mm_xor_ps(sign_bit_sin, swap_sign_bit_sin); /* Evaluate the first polynom (0 <= x <= Pi/4) */ - __m128 z = _mm_mul_ps(x,x); - y = *(__m128*)_ps_coscof_p0; + __m128 z = _mm_mul_ps(x, x); + y = *(__m128 *)_ps_coscof_p0; y = _mm_mul_ps(y, z); - y = _mm_add_ps(y, *(__m128*)_ps_coscof_p1); + y = _mm_add_ps(y, *(__m128 *)_ps_coscof_p1); y = _mm_mul_ps(y, z); - y = _mm_add_ps(y, *(__m128*)_ps_coscof_p2); + y = _mm_add_ps(y, *(__m128 *)_ps_coscof_p2); y = _mm_mul_ps(y, z); y = _mm_mul_ps(y, z); - __m128 tmp = _mm_mul_ps(z, *(__m128*)_ps_0p5); + __m128 tmp = _mm_mul_ps(z, *(__m128 *)_ps_0p5); y = _mm_sub_ps(y, tmp); - y = _mm_add_ps(y, *(__m128*)_ps_1); + y = _mm_add_ps(y, *(__m128 *)_ps_1); /* Evaluate the second polynom (Pi/4 <= x <= 0) */ - __m128 y2 = *(__m128*)_ps_sincof_p0; + __m128 y2 = *(__m128 *)_ps_sincof_p0; y2 = _mm_mul_ps(y2, z); - y2 = _mm_add_ps(y2, *(__m128*)_ps_sincof_p1); + y2 = _mm_add_ps(y2, *(__m128 *)_ps_sincof_p1); y2 = _mm_mul_ps(y2, z); - y2 = _mm_add_ps(y2, *(__m128*)_ps_sincof_p2); + y2 = _mm_add_ps(y2, *(__m128 *)_ps_sincof_p2); y2 = _mm_mul_ps(y2, z); y2 = _mm_mul_ps(y2, x); y2 = _mm_add_ps(y2, x); @@ -347,11 +367,11 @@ static inline void volk_gnsssdr_s32f_sincos_32fc_u_sse2(lv_32fc_t* out, const fl xmm3 = poly_mask; __m128 ysin2 = _mm_and_ps(xmm3, y2); __m128 ysin1 = _mm_andnot_ps(xmm3, y); - y2 = _mm_sub_ps(y2,ysin2); + y2 = _mm_sub_ps(y2, ysin2); y = _mm_sub_ps(y, ysin1); - xmm1 = _mm_add_ps(ysin1,ysin2); - xmm2 = _mm_add_ps(y,y2); + xmm1 = _mm_add_ps(ysin1, ysin2); + xmm2 = _mm_add_ps(y, y2); /* update the sign */ sine = _mm_xor_ps(xmm1, sign_bit_sin); @@ -359,19 +379,19 @@ static inline void volk_gnsssdr_s32f_sincos_32fc_u_sse2(lv_32fc_t* out, const fl /* write the output */ aux = _mm_unpacklo_ps(cosine, sine); - _mm_storeu_ps((float*)bPtr, aux); + _mm_storeu_ps((float *)bPtr, aux); bPtr += 2; aux = _mm_unpackhi_ps(cosine, sine); - _mm_storeu_ps((float*)bPtr, aux); + _mm_storeu_ps((float *)bPtr, aux); bPtr += 2; four_phases_reg = _mm_add_ps(four_phases_reg, four_phases_inc_reg); } _phase = _phase + phase_inc * (sse_iters * 4); - for(number = sse_iters * 4; number < num_points; number++) + for (number = sse_iters * 4; number < num_points; number++) { - *bPtr++ = lv_cmake((float)cosf(_phase), (float)sinf(_phase) ); + *bPtr++ = lv_cmake((float)cosf(_phase), (float)sinf(_phase)); _phase += phase_inc; } (*phase) = _phase; @@ -382,13 +402,13 @@ static inline void volk_gnsssdr_s32f_sincos_32fc_u_sse2(lv_32fc_t* out, const fl #ifdef LV_HAVE_GENERIC -static inline void volk_gnsssdr_s32f_sincos_32fc_generic(lv_32fc_t* out, const float phase_inc, float* phase, unsigned int num_points) +static inline void volk_gnsssdr_s32f_sincos_32fc_generic(lv_32fc_t *out, const float phase_inc, float *phase, unsigned int num_points) { float _phase = (*phase); unsigned int i; - for(i = 0; i < num_points; i++) + for (i = 0; i < num_points; i++) { - *out++ = lv_cmake((float)cosf(_phase), (float)sinf(_phase) ); + *out++ = lv_cmake((float)cosf(_phase), (float)sinf(_phase)); _phase += phase_inc; } (*phase) = _phase; @@ -400,7 +420,7 @@ static inline void volk_gnsssdr_s32f_sincos_32fc_generic(lv_32fc_t* out, const f #ifdef LV_HAVE_GENERIC #include #include -static inline void volk_gnsssdr_s32f_sincos_32fc_generic_fxpt(lv_32fc_t* out, const float phase_inc, float* phase, unsigned int num_points) +static inline void volk_gnsssdr_s32f_sincos_32fc_generic_fxpt(lv_32fc_t *out, const float phase_inc, float *phase, unsigned int num_points) { float _in, s, c; unsigned int i; @@ -413,12 +433,12 @@ static inline void volk_gnsssdr_s32f_sincos_32fc_generic_fxpt(lv_32fc_t* out, co const int32_t diffbits = bitlength - Nbits; uint32_t ux; float _phase = (*phase); - for(i = 0; i < num_points; i++) + for (i = 0; i < num_points; i++) { _in = _phase; d = (int32_t)floor(_in / TWO_PI + 0.5); _in -= d * TWO_PI; - x = (int32_t) ((float)_in * TWO_TO_THE_31_DIV_PI); + x = (int32_t)((float)_in * TWO_TO_THE_31_DIV_PI); ux = x; sin_index = ux >> diffbits; @@ -428,7 +448,7 @@ static inline void volk_gnsssdr_s32f_sincos_32fc_generic_fxpt(lv_32fc_t* out, co cos_index = ux >> diffbits; c = sine_table_10bits[cos_index][0] * (ux >> 1) + sine_table_10bits[cos_index][1]; - *out++ = lv_cmake((float)c, (float)s ); + *out++ = lv_cmake((float)c, (float)s); _phase += phase_inc; } (*phase) = _phase; @@ -441,9 +461,9 @@ static inline void volk_gnsssdr_s32f_sincos_32fc_generic_fxpt(lv_32fc_t* out, co #include /* Based on algorithms from the cephes library http://www.netlib.org/cephes/ * Adapted to AVX2 by Carles Fernandez, based on original SSE2 code by Julien Pommier*/ -static inline void volk_gnsssdr_s32f_sincos_32fc_a_avx2(lv_32fc_t* out, const float phase_inc, float* phase, unsigned int num_points) +static inline void volk_gnsssdr_s32f_sincos_32fc_a_avx2(lv_32fc_t *out, const float phase_inc, float *phase, unsigned int num_points) { - lv_32fc_t* bPtr = out; + lv_32fc_t *bPtr = out; const unsigned int avx_iters = num_points / 8; unsigned int number = 0; @@ -456,44 +476,64 @@ static inline void volk_gnsssdr_s32f_sincos_32fc_a_avx2(lv_32fc_t* out, const fl __m128 aux, c1, s1; /* declare some AXX2 constants */ - __VOLK_ATTR_ALIGNED(32) static const int _ps_inv_sign_mask[8] = { ~0x80000000, ~0x80000000, ~0x80000000, ~0x80000000, ~0x80000000, ~0x80000000, ~0x80000000, ~0x80000000 }; - __VOLK_ATTR_ALIGNED(32) static const int _ps_sign_mask[8] = { (int)0x80000000, (int)0x80000000, (int)0x80000000, (int)0x80000000, (int)0x80000000, (int)0x80000000, (int)0x80000000, (int)0x80000000 }; + __VOLK_ATTR_ALIGNED(32) + static const int _ps_inv_sign_mask[8] = {~0x80000000, ~0x80000000, ~0x80000000, ~0x80000000, ~0x80000000, ~0x80000000, ~0x80000000, ~0x80000000}; + __VOLK_ATTR_ALIGNED(32) + static const int _ps_sign_mask[8] = {(int)0x80000000, (int)0x80000000, (int)0x80000000, (int)0x80000000, (int)0x80000000, (int)0x80000000, (int)0x80000000, (int)0x80000000}; - __VOLK_ATTR_ALIGNED(32) static const float _ps_cephes_FOPI[8] = { 1.27323954473516, 1.27323954473516, 1.27323954473516, 1.27323954473516, 1.27323954473516, 1.27323954473516, 1.27323954473516, 1.27323954473516 }; - __VOLK_ATTR_ALIGNED(32) static const int _pi32_1[8] = { 1, 1, 1, 1, 1, 1, 1, 1 }; - __VOLK_ATTR_ALIGNED(32) static const int _pi32_inv1[8] = { ~1, ~1, ~1, ~1, ~1, ~1, ~1, ~1 }; - __VOLK_ATTR_ALIGNED(32) static const int _pi32_2[8] = { 2, 2, 2, 2, 2, 2, 2, 2 }; - __VOLK_ATTR_ALIGNED(32) static const int _pi32_4[8] = { 4, 4, 4, 4, 4, 4, 4, 4 }; + __VOLK_ATTR_ALIGNED(32) + static const float _ps_cephes_FOPI[8] = {1.27323954473516, 1.27323954473516, 1.27323954473516, 1.27323954473516, 1.27323954473516, 1.27323954473516, 1.27323954473516, 1.27323954473516}; + __VOLK_ATTR_ALIGNED(32) + static const int _pi32_1[8] = {1, 1, 1, 1, 1, 1, 1, 1}; + __VOLK_ATTR_ALIGNED(32) + static const int _pi32_inv1[8] = {~1, ~1, ~1, ~1, ~1, ~1, ~1, ~1}; + __VOLK_ATTR_ALIGNED(32) + static const int _pi32_2[8] = {2, 2, 2, 2, 2, 2, 2, 2}; + __VOLK_ATTR_ALIGNED(32) + static const int _pi32_4[8] = {4, 4, 4, 4, 4, 4, 4, 4}; - __VOLK_ATTR_ALIGNED(32) static const float _ps_minus_cephes_DP1[8] = { -0.78515625, -0.78515625, -0.78515625, -0.78515625, -0.78515625, -0.78515625, -0.78515625, -0.78515625 }; - __VOLK_ATTR_ALIGNED(32) static const float _ps_minus_cephes_DP2[8] = { -2.4187564849853515625e-4, -2.4187564849853515625e-4, -2.4187564849853515625e-4, -2.4187564849853515625e-4, -2.4187564849853515625e-4, -2.4187564849853515625e-4, -2.4187564849853515625e-4, -2.4187564849853515625e-4 }; - __VOLK_ATTR_ALIGNED(32) static const float _ps_minus_cephes_DP3[8] = { -3.77489497744594108e-8, -3.77489497744594108e-8, -3.77489497744594108e-8, -3.77489497744594108e-8, -3.77489497744594108e-8, -3.77489497744594108e-8, -3.77489497744594108e-8, -3.77489497744594108e-8 }; - __VOLK_ATTR_ALIGNED(32) static const float _ps_coscof_p0[8] = { 2.443315711809948E-005, 2.443315711809948E-005, 2.443315711809948E-005, 2.443315711809948E-005, 2.443315711809948E-005, 2.443315711809948E-005, 2.443315711809948E-005, 2.443315711809948E-005 }; - __VOLK_ATTR_ALIGNED(32) static const float _ps_coscof_p1[8] = { -1.388731625493765E-003, -1.388731625493765E-003, -1.388731625493765E-003, -1.388731625493765E-003, -1.388731625493765E-003, -1.388731625493765E-003, -1.388731625493765E-003, -1.388731625493765E-003 }; - __VOLK_ATTR_ALIGNED(32) static const float _ps_coscof_p2[8] = { 4.166664568298827E-002, 4.166664568298827E-002, 4.166664568298827E-002, 4.166664568298827E-002, 4.166664568298827E-002, 4.166664568298827E-002, 4.166664568298827E-002, 4.166664568298827E-002 }; - __VOLK_ATTR_ALIGNED(32) static const float _ps_sincof_p0[8] = { -1.9515295891E-4, -1.9515295891E-4, -1.9515295891E-4, -1.9515295891E-4, -1.9515295891E-4, -1.9515295891E-4, -1.9515295891E-4, -1.9515295891E-4 }; - __VOLK_ATTR_ALIGNED(32) static const float _ps_sincof_p1[8] = { 8.3321608736E-3, 8.3321608736E-3, 8.3321608736E-3, 8.3321608736E-3, 8.3321608736E-3, 8.3321608736E-3, 8.3321608736E-3, 8.3321608736E-3 }; - __VOLK_ATTR_ALIGNED(32) static const float _ps_sincof_p2[8] = { -1.6666654611E-1, -1.6666654611E-1, -1.6666654611E-1, -1.6666654611E-1, -1.6666654611E-1, -1.6666654611E-1, -1.6666654611E-1, -1.6666654611E-1 }; - __VOLK_ATTR_ALIGNED(32) static const float _ps_0p5[8] = { 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f }; - __VOLK_ATTR_ALIGNED(32) static const float _ps_1[8] = { 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f }; + __VOLK_ATTR_ALIGNED(32) + static const float _ps_minus_cephes_DP1[8] = {-0.78515625, -0.78515625, -0.78515625, -0.78515625, -0.78515625, -0.78515625, -0.78515625, -0.78515625}; + __VOLK_ATTR_ALIGNED(32) + static const float _ps_minus_cephes_DP2[8] = {-2.4187564849853515625e-4, -2.4187564849853515625e-4, -2.4187564849853515625e-4, -2.4187564849853515625e-4, -2.4187564849853515625e-4, -2.4187564849853515625e-4, -2.4187564849853515625e-4, -2.4187564849853515625e-4}; + __VOLK_ATTR_ALIGNED(32) + static const float _ps_minus_cephes_DP3[8] = {-3.77489497744594108e-8, -3.77489497744594108e-8, -3.77489497744594108e-8, -3.77489497744594108e-8, -3.77489497744594108e-8, -3.77489497744594108e-8, -3.77489497744594108e-8, -3.77489497744594108e-8}; + __VOLK_ATTR_ALIGNED(32) + static const float _ps_coscof_p0[8] = {2.443315711809948E-005, 2.443315711809948E-005, 2.443315711809948E-005, 2.443315711809948E-005, 2.443315711809948E-005, 2.443315711809948E-005, 2.443315711809948E-005, 2.443315711809948E-005}; + __VOLK_ATTR_ALIGNED(32) + static const float _ps_coscof_p1[8] = {-1.388731625493765E-003, -1.388731625493765E-003, -1.388731625493765E-003, -1.388731625493765E-003, -1.388731625493765E-003, -1.388731625493765E-003, -1.388731625493765E-003, -1.388731625493765E-003}; + __VOLK_ATTR_ALIGNED(32) + static const float _ps_coscof_p2[8] = {4.166664568298827E-002, 4.166664568298827E-002, 4.166664568298827E-002, 4.166664568298827E-002, 4.166664568298827E-002, 4.166664568298827E-002, 4.166664568298827E-002, 4.166664568298827E-002}; + __VOLK_ATTR_ALIGNED(32) + static const float _ps_sincof_p0[8] = {-1.9515295891E-4, -1.9515295891E-4, -1.9515295891E-4, -1.9515295891E-4, -1.9515295891E-4, -1.9515295891E-4, -1.9515295891E-4, -1.9515295891E-4}; + __VOLK_ATTR_ALIGNED(32) + static const float _ps_sincof_p1[8] = {8.3321608736E-3, 8.3321608736E-3, 8.3321608736E-3, 8.3321608736E-3, 8.3321608736E-3, 8.3321608736E-3, 8.3321608736E-3, 8.3321608736E-3}; + __VOLK_ATTR_ALIGNED(32) + static const float _ps_sincof_p2[8] = {-1.6666654611E-1, -1.6666654611E-1, -1.6666654611E-1, -1.6666654611E-1, -1.6666654611E-1, -1.6666654611E-1, -1.6666654611E-1, -1.6666654611E-1}; + __VOLK_ATTR_ALIGNED(32) + static const float _ps_0p5[8] = {0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f}; + __VOLK_ATTR_ALIGNED(32) + static const float _ps_1[8] = {1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f}; - __VOLK_ATTR_ALIGNED(32) float eight_phases[8] = { _phase, _phase + phase_inc, _phase + 2 * phase_inc, _phase + 3 * phase_inc, _phase + 4 * phase_inc, _phase + 5 * phase_inc, _phase + 6 * phase_inc, _phase + 7 * phase_inc }; - __VOLK_ATTR_ALIGNED(32) float eight_phases_inc[8] = { 8 * phase_inc, 8 * phase_inc, 8 * phase_inc, 8 * phase_inc, 8 * phase_inc, 8 * phase_inc, 8 * phase_inc, 8 * phase_inc }; + __VOLK_ATTR_ALIGNED(32) + float eight_phases[8] = {_phase, _phase + phase_inc, _phase + 2 * phase_inc, _phase + 3 * phase_inc, _phase + 4 * phase_inc, _phase + 5 * phase_inc, _phase + 6 * phase_inc, _phase + 7 * phase_inc}; + __VOLK_ATTR_ALIGNED(32) + float eight_phases_inc[8] = {8 * phase_inc, 8 * phase_inc, 8 * phase_inc, 8 * phase_inc, 8 * phase_inc, 8 * phase_inc, 8 * phase_inc, 8 * phase_inc}; eight_phases_reg = _mm256_load_ps(eight_phases); const __m256 eight_phases_inc_reg = _mm256_load_ps(eight_phases_inc); - for(;number < avx_iters; number++) + for (; number < avx_iters; number++) { x = eight_phases_reg; sign_bit_sin = x; /* take the absolute value */ - x = _mm256_and_ps(x, *(__m256*)_ps_inv_sign_mask); + x = _mm256_and_ps(x, *(__m256 *)_ps_inv_sign_mask); /* extract the sign bit (upper one) */ - sign_bit_sin = _mm256_and_ps(sign_bit_sin, *(__m256*)_ps_sign_mask); + sign_bit_sin = _mm256_and_ps(sign_bit_sin, *(__m256 *)_ps_sign_mask); /* scale by 4/Pi */ - y = _mm256_mul_ps(x, *(__m256*)_ps_cephes_FOPI); + y = _mm256_mul_ps(x, *(__m256 *)_ps_cephes_FOPI); /* store the integer part of y in emm2 */ emm2 = _mm256_cvttps_epi32(y); @@ -517,9 +557,9 @@ static inline void volk_gnsssdr_s32f_sincos_32fc_a_avx2(lv_32fc_t* out, const fl /* The magic pass: "Extended precision modular arithmetic” x = ((x - y * DP1) - y * DP2) - y * DP3; */ - xmm1 = *(__m256*)_ps_minus_cephes_DP1; - xmm2 = *(__m256*)_ps_minus_cephes_DP2; - xmm3 = *(__m256*)_ps_minus_cephes_DP3; + xmm1 = *(__m256 *)_ps_minus_cephes_DP1; + xmm2 = *(__m256 *)_ps_minus_cephes_DP2; + xmm3 = *(__m256 *)_ps_minus_cephes_DP3; xmm1 = _mm256_mul_ps(y, xmm1); xmm2 = _mm256_mul_ps(y, xmm2); xmm3 = _mm256_mul_ps(y, xmm3); @@ -536,24 +576,24 @@ static inline void volk_gnsssdr_s32f_sincos_32fc_a_avx2(lv_32fc_t* out, const fl /* Evaluate the first polynom (0 <= x <= Pi/4) */ __m256 z = _mm256_mul_ps(x, x); - y = *(__m256*)_ps_coscof_p0; + y = *(__m256 *)_ps_coscof_p0; y = _mm256_mul_ps(y, z); - y = _mm256_add_ps(y, *(__m256*)_ps_coscof_p1); + y = _mm256_add_ps(y, *(__m256 *)_ps_coscof_p1); y = _mm256_mul_ps(y, z); - y = _mm256_add_ps(y, *(__m256*)_ps_coscof_p2); + y = _mm256_add_ps(y, *(__m256 *)_ps_coscof_p2); y = _mm256_mul_ps(y, z); y = _mm256_mul_ps(y, z); - __m256 tmp = _mm256_mul_ps(z, *(__m256*)_ps_0p5); + __m256 tmp = _mm256_mul_ps(z, *(__m256 *)_ps_0p5); y = _mm256_sub_ps(y, tmp); - y = _mm256_add_ps(y, *(__m256*)_ps_1); + y = _mm256_add_ps(y, *(__m256 *)_ps_1); /* Evaluate the second polynom (Pi/4 <= x <= 0) */ - __m256 y2 = *(__m256*)_ps_sincof_p0; + __m256 y2 = *(__m256 *)_ps_sincof_p0; y2 = _mm256_mul_ps(y2, z); - y2 = _mm256_add_ps(y2, *(__m256*)_ps_sincof_p1); + y2 = _mm256_add_ps(y2, *(__m256 *)_ps_sincof_p1); y2 = _mm256_mul_ps(y2, z); - y2 = _mm256_add_ps(y2, *(__m256*)_ps_sincof_p2); + y2 = _mm256_add_ps(y2, *(__m256 *)_ps_sincof_p2); y2 = _mm256_mul_ps(y2, z); y2 = _mm256_mul_ps(y2, x); y2 = _mm256_add_ps(y2, x); @@ -576,27 +616,27 @@ static inline void volk_gnsssdr_s32f_sincos_32fc_a_avx2(lv_32fc_t* out, const fl s1 = _mm256_extractf128_ps(sine, 0); c1 = _mm256_extractf128_ps(cosine, 0); aux = _mm_unpacklo_ps(c1, s1); - _mm_store_ps((float*)bPtr, aux); + _mm_store_ps((float *)bPtr, aux); bPtr += 2; aux = _mm_unpackhi_ps(c1, s1); - _mm_store_ps((float*)bPtr, aux); + _mm_store_ps((float *)bPtr, aux); bPtr += 2; s1 = _mm256_extractf128_ps(sine, 1); c1 = _mm256_extractf128_ps(cosine, 1); aux = _mm_unpacklo_ps(c1, s1); - _mm_store_ps((float*)bPtr, aux); + _mm_store_ps((float *)bPtr, aux); bPtr += 2; aux = _mm_unpackhi_ps(c1, s1); - _mm_store_ps((float*)bPtr, aux); + _mm_store_ps((float *)bPtr, aux); bPtr += 2; eight_phases_reg = _mm256_add_ps(eight_phases_reg, eight_phases_inc_reg); } _mm256_zeroupper(); _phase = _phase + phase_inc * (avx_iters * 8); - for(number = avx_iters * 8; number < num_points; number++) + for (number = avx_iters * 8; number < num_points; number++) { - out[number] = lv_cmake((float)cosf(_phase), (float)sinf(_phase) ); + out[number] = lv_cmake((float)cosf(_phase), (float)sinf(_phase)); _phase += phase_inc; } (*phase) = _phase; @@ -609,9 +649,9 @@ static inline void volk_gnsssdr_s32f_sincos_32fc_a_avx2(lv_32fc_t* out, const fl #include /* Based on algorithms from the cephes library http://www.netlib.org/cephes/ * Adapted to AVX2 by Carles Fernandez, based on original SSE2 code by Julien Pommier*/ -static inline void volk_gnsssdr_s32f_sincos_32fc_u_avx2(lv_32fc_t* out, const float phase_inc, float* phase, unsigned int num_points) +static inline void volk_gnsssdr_s32f_sincos_32fc_u_avx2(lv_32fc_t *out, const float phase_inc, float *phase, unsigned int num_points) { - lv_32fc_t* bPtr = out; + lv_32fc_t *bPtr = out; const unsigned int avx_iters = num_points / 8; unsigned int number = 0; @@ -624,44 +664,64 @@ static inline void volk_gnsssdr_s32f_sincos_32fc_u_avx2(lv_32fc_t* out, const fl __m128 aux, c1, s1; /* declare some AXX2 constants */ - __VOLK_ATTR_ALIGNED(32) static const int _ps_inv_sign_mask[8] = { ~0x80000000, ~0x80000000, ~0x80000000, ~0x80000000, ~0x80000000, ~0x80000000, ~0x80000000, ~0x80000000 }; - __VOLK_ATTR_ALIGNED(32) static const int _ps_sign_mask[8] = { (int)0x80000000, (int)0x80000000, (int)0x80000000, (int)0x80000000, (int)0x80000000, (int)0x80000000, (int)0x80000000, (int)0x80000000 }; + __VOLK_ATTR_ALIGNED(32) + static const int _ps_inv_sign_mask[8] = {~0x80000000, ~0x80000000, ~0x80000000, ~0x80000000, ~0x80000000, ~0x80000000, ~0x80000000, ~0x80000000}; + __VOLK_ATTR_ALIGNED(32) + static const int _ps_sign_mask[8] = {(int)0x80000000, (int)0x80000000, (int)0x80000000, (int)0x80000000, (int)0x80000000, (int)0x80000000, (int)0x80000000, (int)0x80000000}; - __VOLK_ATTR_ALIGNED(32) static const float _ps_cephes_FOPI[8] = { 1.27323954473516, 1.27323954473516, 1.27323954473516, 1.27323954473516, 1.27323954473516, 1.27323954473516, 1.27323954473516, 1.27323954473516 }; - __VOLK_ATTR_ALIGNED(32) static const int _pi32_1[8] = { 1, 1, 1, 1, 1, 1, 1, 1 }; - __VOLK_ATTR_ALIGNED(32) static const int _pi32_inv1[8] = { ~1, ~1, ~1, ~1, ~1, ~1, ~1, ~1 }; - __VOLK_ATTR_ALIGNED(32) static const int _pi32_2[8] = { 2, 2, 2, 2, 2, 2, 2, 2 }; - __VOLK_ATTR_ALIGNED(32) static const int _pi32_4[8] = { 4, 4, 4, 4, 4, 4, 4, 4 }; + __VOLK_ATTR_ALIGNED(32) + static const float _ps_cephes_FOPI[8] = {1.27323954473516, 1.27323954473516, 1.27323954473516, 1.27323954473516, 1.27323954473516, 1.27323954473516, 1.27323954473516, 1.27323954473516}; + __VOLK_ATTR_ALIGNED(32) + static const int _pi32_1[8] = {1, 1, 1, 1, 1, 1, 1, 1}; + __VOLK_ATTR_ALIGNED(32) + static const int _pi32_inv1[8] = {~1, ~1, ~1, ~1, ~1, ~1, ~1, ~1}; + __VOLK_ATTR_ALIGNED(32) + static const int _pi32_2[8] = {2, 2, 2, 2, 2, 2, 2, 2}; + __VOLK_ATTR_ALIGNED(32) + static const int _pi32_4[8] = {4, 4, 4, 4, 4, 4, 4, 4}; - __VOLK_ATTR_ALIGNED(32) static const float _ps_minus_cephes_DP1[8] = { -0.78515625, -0.78515625, -0.78515625, -0.78515625, -0.78515625, -0.78515625, -0.78515625, -0.78515625 }; - __VOLK_ATTR_ALIGNED(32) static const float _ps_minus_cephes_DP2[8] = { -2.4187564849853515625e-4, -2.4187564849853515625e-4, -2.4187564849853515625e-4, -2.4187564849853515625e-4, -2.4187564849853515625e-4, -2.4187564849853515625e-4, -2.4187564849853515625e-4, -2.4187564849853515625e-4 }; - __VOLK_ATTR_ALIGNED(32) static const float _ps_minus_cephes_DP3[8] = { -3.77489497744594108e-8, -3.77489497744594108e-8, -3.77489497744594108e-8, -3.77489497744594108e-8, -3.77489497744594108e-8, -3.77489497744594108e-8, -3.77489497744594108e-8, -3.77489497744594108e-8 }; - __VOLK_ATTR_ALIGNED(32) static const float _ps_coscof_p0[8] = { 2.443315711809948E-005, 2.443315711809948E-005, 2.443315711809948E-005, 2.443315711809948E-005, 2.443315711809948E-005, 2.443315711809948E-005, 2.443315711809948E-005, 2.443315711809948E-005 }; - __VOLK_ATTR_ALIGNED(32) static const float _ps_coscof_p1[8] = { -1.388731625493765E-003, -1.388731625493765E-003, -1.388731625493765E-003, -1.388731625493765E-003, -1.388731625493765E-003, -1.388731625493765E-003, -1.388731625493765E-003, -1.388731625493765E-003 }; - __VOLK_ATTR_ALIGNED(32) static const float _ps_coscof_p2[8] = { 4.166664568298827E-002, 4.166664568298827E-002, 4.166664568298827E-002, 4.166664568298827E-002, 4.166664568298827E-002, 4.166664568298827E-002, 4.166664568298827E-002, 4.166664568298827E-002 }; - __VOLK_ATTR_ALIGNED(32) static const float _ps_sincof_p0[8] = { -1.9515295891E-4, -1.9515295891E-4, -1.9515295891E-4, -1.9515295891E-4, -1.9515295891E-4, -1.9515295891E-4, -1.9515295891E-4, -1.9515295891E-4 }; - __VOLK_ATTR_ALIGNED(32) static const float _ps_sincof_p1[8] = { 8.3321608736E-3, 8.3321608736E-3, 8.3321608736E-3, 8.3321608736E-3, 8.3321608736E-3, 8.3321608736E-3, 8.3321608736E-3, 8.3321608736E-3 }; - __VOLK_ATTR_ALIGNED(32) static const float _ps_sincof_p2[8] = { -1.6666654611E-1, -1.6666654611E-1, -1.6666654611E-1, -1.6666654611E-1, -1.6666654611E-1, -1.6666654611E-1, -1.6666654611E-1, -1.6666654611E-1 }; - __VOLK_ATTR_ALIGNED(32) static const float _ps_0p5[8] = { 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f }; - __VOLK_ATTR_ALIGNED(32) static const float _ps_1[8] = { 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f }; + __VOLK_ATTR_ALIGNED(32) + static const float _ps_minus_cephes_DP1[8] = {-0.78515625, -0.78515625, -0.78515625, -0.78515625, -0.78515625, -0.78515625, -0.78515625, -0.78515625}; + __VOLK_ATTR_ALIGNED(32) + static const float _ps_minus_cephes_DP2[8] = {-2.4187564849853515625e-4, -2.4187564849853515625e-4, -2.4187564849853515625e-4, -2.4187564849853515625e-4, -2.4187564849853515625e-4, -2.4187564849853515625e-4, -2.4187564849853515625e-4, -2.4187564849853515625e-4}; + __VOLK_ATTR_ALIGNED(32) + static const float _ps_minus_cephes_DP3[8] = {-3.77489497744594108e-8, -3.77489497744594108e-8, -3.77489497744594108e-8, -3.77489497744594108e-8, -3.77489497744594108e-8, -3.77489497744594108e-8, -3.77489497744594108e-8, -3.77489497744594108e-8}; + __VOLK_ATTR_ALIGNED(32) + static const float _ps_coscof_p0[8] = {2.443315711809948E-005, 2.443315711809948E-005, 2.443315711809948E-005, 2.443315711809948E-005, 2.443315711809948E-005, 2.443315711809948E-005, 2.443315711809948E-005, 2.443315711809948E-005}; + __VOLK_ATTR_ALIGNED(32) + static const float _ps_coscof_p1[8] = {-1.388731625493765E-003, -1.388731625493765E-003, -1.388731625493765E-003, -1.388731625493765E-003, -1.388731625493765E-003, -1.388731625493765E-003, -1.388731625493765E-003, -1.388731625493765E-003}; + __VOLK_ATTR_ALIGNED(32) + static const float _ps_coscof_p2[8] = {4.166664568298827E-002, 4.166664568298827E-002, 4.166664568298827E-002, 4.166664568298827E-002, 4.166664568298827E-002, 4.166664568298827E-002, 4.166664568298827E-002, 4.166664568298827E-002}; + __VOLK_ATTR_ALIGNED(32) + static const float _ps_sincof_p0[8] = {-1.9515295891E-4, -1.9515295891E-4, -1.9515295891E-4, -1.9515295891E-4, -1.9515295891E-4, -1.9515295891E-4, -1.9515295891E-4, -1.9515295891E-4}; + __VOLK_ATTR_ALIGNED(32) + static const float _ps_sincof_p1[8] = {8.3321608736E-3, 8.3321608736E-3, 8.3321608736E-3, 8.3321608736E-3, 8.3321608736E-3, 8.3321608736E-3, 8.3321608736E-3, 8.3321608736E-3}; + __VOLK_ATTR_ALIGNED(32) + static const float _ps_sincof_p2[8] = {-1.6666654611E-1, -1.6666654611E-1, -1.6666654611E-1, -1.6666654611E-1, -1.6666654611E-1, -1.6666654611E-1, -1.6666654611E-1, -1.6666654611E-1}; + __VOLK_ATTR_ALIGNED(32) + static const float _ps_0p5[8] = {0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f}; + __VOLK_ATTR_ALIGNED(32) + static const float _ps_1[8] = {1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f}; - __VOLK_ATTR_ALIGNED(32) float eight_phases[8] = { _phase, _phase + phase_inc, _phase + 2 * phase_inc, _phase + 3 * phase_inc, _phase + 4 * phase_inc, _phase + 5 * phase_inc, _phase + 6 * phase_inc, _phase + 7 * phase_inc }; - __VOLK_ATTR_ALIGNED(32) float eight_phases_inc[8] = { 8 * phase_inc, 8 * phase_inc, 8 * phase_inc, 8 * phase_inc, 8 * phase_inc, 8 * phase_inc, 8 * phase_inc, 8 * phase_inc }; + __VOLK_ATTR_ALIGNED(32) + float eight_phases[8] = {_phase, _phase + phase_inc, _phase + 2 * phase_inc, _phase + 3 * phase_inc, _phase + 4 * phase_inc, _phase + 5 * phase_inc, _phase + 6 * phase_inc, _phase + 7 * phase_inc}; + __VOLK_ATTR_ALIGNED(32) + float eight_phases_inc[8] = {8 * phase_inc, 8 * phase_inc, 8 * phase_inc, 8 * phase_inc, 8 * phase_inc, 8 * phase_inc, 8 * phase_inc, 8 * phase_inc}; eight_phases_reg = _mm256_load_ps(eight_phases); const __m256 eight_phases_inc_reg = _mm256_load_ps(eight_phases_inc); - for(;number < avx_iters; number++) + for (; number < avx_iters; number++) { x = eight_phases_reg; sign_bit_sin = x; /* take the absolute value */ - x = _mm256_and_ps(x, *(__m256*)_ps_inv_sign_mask); + x = _mm256_and_ps(x, *(__m256 *)_ps_inv_sign_mask); /* extract the sign bit (upper one) */ - sign_bit_sin = _mm256_and_ps(sign_bit_sin, *(__m256*)_ps_sign_mask); + sign_bit_sin = _mm256_and_ps(sign_bit_sin, *(__m256 *)_ps_sign_mask); /* scale by 4/Pi */ - y = _mm256_mul_ps(x, *(__m256*)_ps_cephes_FOPI); + y = _mm256_mul_ps(x, *(__m256 *)_ps_cephes_FOPI); /* store the integer part of y in emm2 */ emm2 = _mm256_cvttps_epi32(y); @@ -685,9 +745,9 @@ static inline void volk_gnsssdr_s32f_sincos_32fc_u_avx2(lv_32fc_t* out, const fl /* The magic pass: "Extended precision modular arithmetic” x = ((x - y * DP1) - y * DP2) - y * DP3; */ - xmm1 = *(__m256*)_ps_minus_cephes_DP1; - xmm2 = *(__m256*)_ps_minus_cephes_DP2; - xmm3 = *(__m256*)_ps_minus_cephes_DP3; + xmm1 = *(__m256 *)_ps_minus_cephes_DP1; + xmm2 = *(__m256 *)_ps_minus_cephes_DP2; + xmm3 = *(__m256 *)_ps_minus_cephes_DP3; xmm1 = _mm256_mul_ps(y, xmm1); xmm2 = _mm256_mul_ps(y, xmm2); xmm3 = _mm256_mul_ps(y, xmm3); @@ -704,24 +764,24 @@ static inline void volk_gnsssdr_s32f_sincos_32fc_u_avx2(lv_32fc_t* out, const fl /* Evaluate the first polynom (0 <= x <= Pi/4) */ __m256 z = _mm256_mul_ps(x, x); - y = *(__m256*)_ps_coscof_p0; + y = *(__m256 *)_ps_coscof_p0; y = _mm256_mul_ps(y, z); - y = _mm256_add_ps(y, *(__m256*)_ps_coscof_p1); + y = _mm256_add_ps(y, *(__m256 *)_ps_coscof_p1); y = _mm256_mul_ps(y, z); - y = _mm256_add_ps(y, *(__m256*)_ps_coscof_p2); + y = _mm256_add_ps(y, *(__m256 *)_ps_coscof_p2); y = _mm256_mul_ps(y, z); y = _mm256_mul_ps(y, z); - __m256 tmp = _mm256_mul_ps(z, *(__m256*)_ps_0p5); + __m256 tmp = _mm256_mul_ps(z, *(__m256 *)_ps_0p5); y = _mm256_sub_ps(y, tmp); - y = _mm256_add_ps(y, *(__m256*)_ps_1); + y = _mm256_add_ps(y, *(__m256 *)_ps_1); /* Evaluate the second polynom (Pi/4 <= x <= 0) */ - __m256 y2 = *(__m256*)_ps_sincof_p0; + __m256 y2 = *(__m256 *)_ps_sincof_p0; y2 = _mm256_mul_ps(y2, z); - y2 = _mm256_add_ps(y2, *(__m256*)_ps_sincof_p1); + y2 = _mm256_add_ps(y2, *(__m256 *)_ps_sincof_p1); y2 = _mm256_mul_ps(y2, z); - y2 = _mm256_add_ps(y2, *(__m256*)_ps_sincof_p2); + y2 = _mm256_add_ps(y2, *(__m256 *)_ps_sincof_p2); y2 = _mm256_mul_ps(y2, z); y2 = _mm256_mul_ps(y2, x); y2 = _mm256_add_ps(y2, x); @@ -744,27 +804,27 @@ static inline void volk_gnsssdr_s32f_sincos_32fc_u_avx2(lv_32fc_t* out, const fl s1 = _mm256_extractf128_ps(sine, 0); c1 = _mm256_extractf128_ps(cosine, 0); aux = _mm_unpacklo_ps(c1, s1); - _mm_storeu_ps((float*)bPtr, aux); + _mm_storeu_ps((float *)bPtr, aux); bPtr += 2; aux = _mm_unpackhi_ps(c1, s1); - _mm_storeu_ps((float*)bPtr, aux); + _mm_storeu_ps((float *)bPtr, aux); bPtr += 2; s1 = _mm256_extractf128_ps(sine, 1); c1 = _mm256_extractf128_ps(cosine, 1); aux = _mm_unpacklo_ps(c1, s1); - _mm_storeu_ps((float*)bPtr, aux); + _mm_storeu_ps((float *)bPtr, aux); bPtr += 2; aux = _mm_unpackhi_ps(c1, s1); - _mm_storeu_ps((float*)bPtr, aux); + _mm_storeu_ps((float *)bPtr, aux); bPtr += 2; eight_phases_reg = _mm256_add_ps(eight_phases_reg, eight_phases_inc_reg); } _mm256_zeroupper(); _phase = _phase + phase_inc * (avx_iters * 8); - for(number = avx_iters * 8; number < num_points; number++) + for (number = avx_iters * 8; number < num_points; number++) { - out[number] = lv_cmake((float)cosf(_phase), (float)sinf(_phase) ); + out[number] = lv_cmake((float)cosf(_phase), (float)sinf(_phase)); _phase += phase_inc; } (*phase) = _phase; @@ -777,15 +837,17 @@ static inline void volk_gnsssdr_s32f_sincos_32fc_u_avx2(lv_32fc_t* out, const fl #include /* Adapted from http://gruntthepeon.free.fr/ssemath/neon_mathfun.h, original code from Julien Pommier */ /* Based on algorithms from the cephes library http://www.netlib.org/cephes/ */ -static inline void volk_gnsssdr_s32f_sincos_32fc_neon(lv_32fc_t* out, const float phase_inc, float* phase, unsigned int num_points) +static inline void volk_gnsssdr_s32f_sincos_32fc_neon(lv_32fc_t *out, const float phase_inc, float *phase, unsigned int num_points) { - lv_32fc_t* bPtr = out; + lv_32fc_t *bPtr = out; const unsigned int neon_iters = num_points / 4; float _phase = (*phase); - __VOLK_ATTR_ALIGNED(16) float32_t four_phases[4] = { _phase, _phase + phase_inc, _phase + 2 * phase_inc, _phase + 3 * phase_inc }; + __VOLK_ATTR_ALIGNED(16) + float32_t four_phases[4] = {_phase, _phase + phase_inc, _phase + 2 * phase_inc, _phase + 3 * phase_inc}; float four_inc = 4 * phase_inc; - __VOLK_ATTR_ALIGNED(16) float32_t four_phases_inc[4] = { four_inc, four_inc, four_inc, four_inc }; + __VOLK_ATTR_ALIGNED(16) + float32_t four_phases_inc[4] = {four_inc, four_inc, four_inc, four_inc}; float32x4_t four_phases_reg = vld1q_f32(four_phases); float32x4_t four_phases_inc_reg = vld1q_f32(four_phases_inc); @@ -808,7 +870,7 @@ static inline void volk_gnsssdr_s32f_sincos_32fc_neon(lv_32fc_t* out, const floa uint32x4_t emm2, poly_mask, sign_mask_sin, sign_mask_cos; - for(;number < neon_iters; number++) + for (; number < neon_iters; number++) { x = four_phases_reg; @@ -847,7 +909,7 @@ static inline void volk_gnsssdr_s32f_sincos_32fc_neon(lv_32fc_t* out, const floa /* Evaluate the first polynom (0 <= x <= Pi/4) in y1, and the second polynom (Pi/4 <= x <= 0) in y2 */ - z = vmulq_f32(x,x); + z = vmulq_f32(x, x); y1 = vmulq_n_f32(z, c_coscof_p0); y2 = vmulq_n_f32(z, c_sincof_p0); @@ -871,16 +933,16 @@ static inline void volk_gnsssdr_s32f_sincos_32fc_neon(lv_32fc_t* out, const floa result.val[1] = vbslq_f32(sign_mask_sin, vnegq_f32(ys), ys); result.val[0] = vbslq_f32(sign_mask_cos, yc, vnegq_f32(yc)); - vst2q_f32((float32_t*)bPtr, result); + vst2q_f32((float32_t *)bPtr, result); bPtr += 4; four_phases_reg = vaddq_f32(four_phases_reg, four_phases_inc_reg); } _phase = _phase + phase_inc * (neon_iters * 4); - for(number = neon_iters * 4; number < num_points; number++) + for (number = neon_iters * 4; number < num_points; number++) { - *bPtr++ = lv_cmake((float)cosf(_phase), (float)sinf(_phase) ); + *bPtr++ = lv_cmake((float)cosf(_phase), (float)sinf(_phase)); _phase += phase_inc; } (*phase) = _phase; diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_s32f_sincospuppet_32fc.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_s32f_sincospuppet_32fc.h index 07d3bf5d2..e4f7c942f 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_s32f_sincospuppet_32fc.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_s32f_sincospuppet_32fc.h @@ -49,7 +49,7 @@ static inline void volk_gnsssdr_s32f_sincospuppet_32fc_generic(lv_32fc_t* out, c volk_gnsssdr_s32f_sincos_32fc_generic(out, phase_inc, phase, num_points); } -#endif /* LV_HAVE_GENERIC */ +#endif /* LV_HAVE_GENERIC */ #ifdef LV_HAVE_GENERIC @@ -60,7 +60,7 @@ static inline void volk_gnsssdr_s32f_sincospuppet_32fc_generic_fxpt(lv_32fc_t* o volk_gnsssdr_s32f_sincos_32fc_generic_fxpt(out, phase_inc, phase, num_points); } -#endif /* LV_HAVE_GENERIC */ +#endif /* LV_HAVE_GENERIC */ #ifdef LV_HAVE_SSE2 @@ -70,7 +70,7 @@ static inline void volk_gnsssdr_s32f_sincospuppet_32fc_a_sse2(lv_32fc_t* out, co phase[0] = 3; volk_gnsssdr_s32f_sincos_32fc_a_sse2(out, phase_inc, phase, num_points); } -#endif /* LV_HAVE_SSE2 */ +#endif /* LV_HAVE_SSE2 */ #ifdef LV_HAVE_SSE2 @@ -80,7 +80,7 @@ static inline void volk_gnsssdr_s32f_sincospuppet_32fc_u_sse2(lv_32fc_t* out, co phase[0] = 3; volk_gnsssdr_s32f_sincos_32fc_u_sse2(out, phase_inc, phase, num_points); } -#endif /* LV_HAVE_SSE2 */ +#endif /* LV_HAVE_SSE2 */ #ifdef LV_HAVE_AVX2 @@ -90,7 +90,7 @@ static inline void volk_gnsssdr_s32f_sincospuppet_32fc_a_avx2(lv_32fc_t* out, co phase[0] = 3; volk_gnsssdr_s32f_sincos_32fc_a_avx2(out, phase_inc, phase, num_points); } -#endif /* LV_HAVE_AVX2 */ +#endif /* LV_HAVE_AVX2 */ #ifdef LV_HAVE_AVX2 @@ -100,7 +100,7 @@ static inline void volk_gnsssdr_s32f_sincospuppet_32fc_u_avx2(lv_32fc_t* out, co phase[0] = 3; volk_gnsssdr_s32f_sincos_32fc_u_avx2(out, phase_inc, phase, num_points); } -#endif /* LV_HAVE_AVX2 */ +#endif /* LV_HAVE_AVX2 */ #ifdef LV_HAVE_NEON @@ -110,6 +110,6 @@ static inline void volk_gnsssdr_s32f_sincospuppet_32fc_neon(lv_32fc_t* out, cons phase[0] = 3; volk_gnsssdr_s32f_sincos_32fc_neon(out, phase_inc, phase, num_points); } -#endif /* LV_HAVE_NEON */ +#endif /* LV_HAVE_NEON */ -#endif /* INCLUDED_volk_gnsssdr_s32f_sincospuppet_32fc_H */ +#endif /* INCLUDED_volk_gnsssdr_s32f_sincospuppet_32fc_H */ diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/kernel_tests.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/kernel_tests.h index 5861d052f..733ca74bb 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/kernel_tests.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/kernel_tests.h @@ -38,32 +38,31 @@ // for puppets we need to get all the func_variants for the puppet and just // keep track of the actual function name to write to results -#define VOLK_INIT_PUPP(func, puppet_master_func, test_params)\ - volk_gnsssdr_test_case_t(func##_get_func_desc(), (void(*)())func##_manual, std::string(#func),\ - std::string(#puppet_master_func), test_params) +#define VOLK_INIT_PUPP(func, puppet_master_func, test_params) \ + volk_gnsssdr_test_case_t(func##_get_func_desc(), (void (*)())func##_manual, std::string(#func), \ + std::string(#puppet_master_func), test_params) -#define VOLK_INIT_TEST(func, test_params)\ - volk_gnsssdr_test_case_t(func##_get_func_desc(), (void(*)())func##_manual, std::string(#func),\ - test_params) +#define VOLK_INIT_TEST(func, test_params) \ + volk_gnsssdr_test_case_t(func##_get_func_desc(), (void (*)())func##_manual, std::string(#func), \ + test_params) #define QA(test) test_cases.push_back(test); std::vector init_test_list(volk_gnsssdr_test_params_t test_params) { - // Some kernels need a lower tolerance volk_gnsssdr_test_params_t test_params_inacc = volk_gnsssdr_test_params_t(1e-3, test_params.scalar(), - test_params.vlen(), test_params.iter(), test_params.benchmark_mode(), test_params.kernel_regex()); + test_params.vlen(), test_params.iter(), test_params.benchmark_mode(), test_params.kernel_regex()); volk_gnsssdr_test_params_t test_params_int1 = volk_gnsssdr_test_params_t(1, test_params.scalar(), - test_params.vlen(), test_params.iter(), test_params.benchmark_mode(), test_params.kernel_regex()); + test_params.vlen(), test_params.iter(), test_params.benchmark_mode(), test_params.kernel_regex()); // some others need more iterations ***** ADDED BY GNSS-SDR volk_gnsssdr_test_params_t test_params_more_iters = volk_gnsssdr_test_params_t(test_params.tol(), test_params.scalar(), - test_params.vlen(), 100000, test_params.benchmark_mode(), test_params.kernel_regex()); + test_params.vlen(), 100000, test_params.benchmark_mode(), test_params.kernel_regex()); // ... or more tolerance ***** ADDED BY GNSS-SDR volk_gnsssdr_test_params_t test_params_int16 = volk_gnsssdr_test_params_t(16, test_params.scalar(), - test_params.vlen(), test_params.iter(), test_params.benchmark_mode(), test_params.kernel_regex()); + test_params.vlen(), test_params.iter(), test_params.benchmark_mode(), test_params.kernel_regex()); volk_gnsssdr_test_params_t test_params_inacc2 = volk_gnsssdr_test_params_t(2e-1, test_params.scalar(), - test_params.vlen(), test_params.iter(), test_params.benchmark_mode(), test_params.kernel_regex()); + test_params.vlen(), test_params.iter(), test_params.benchmark_mode(), test_params.kernel_regex()); std::vector test_cases; @@ -98,8 +97,7 @@ std::vector init_test_list(volk_gnsssdr_test_params_t QA(VOLK_INIT_PUPP(volk_gnsssdr_16ic_x2_rotator_dotprodxnpuppet_16ic, volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn, test_params_int16)) QA(VOLK_INIT_PUPP(volk_gnsssdr_16ic_16i_rotator_dotprodxnpuppet_16ic, volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn, test_params_int16)) QA(VOLK_INIT_PUPP(volk_gnsssdr_32fc_x2_rotator_dotprodxnpuppet_32fc, volk_gnsssdr_32fc_x2_rotator_dot_prod_32fc_xn, test_params_int1)) - QA(VOLK_INIT_PUPP(volk_gnsssdr_32fc_32f_rotator_dotprodxnpuppet_32fc, volk_gnsssdr_32fc_32f_rotator_dot_prod_32fc_xn, test_params_int1)) - ; + QA(VOLK_INIT_PUPP(volk_gnsssdr_32fc_32f_rotator_dotprodxnpuppet_32fc, volk_gnsssdr_32fc_32f_rotator_dot_prod_32fc_xn, test_params_int1)); return test_cases; } diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/qa_utils.cc b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/qa_utils.cc index 35e60b2f4..18a4919e2 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/qa_utils.cc +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/qa_utils.cc @@ -17,38 +17,39 @@ */ #include "qa_utils.h" -#include "volk_gnsssdr/volk_gnsssdr.h" // for volk_gnsssdr_func_desc_t -#include "volk_gnsssdr/volk_gnsssdr_malloc.h" // for volk_gnsssdr_free, volk_gnsssdr_malloc -#include // for auto_any_base -#include // for lexical_cast -#include // for char_separator -#include // for token_iterator -#include // for tokenizer -#include // for assert -#include // for system_clock, duration,... -#include // for sqrt, fabs, abs -#include // for uint16_t, uint64_t,int16_t, int32_t -#include // for memcpy, memset -#include // for operator<< -#include // for cout, cerr -#include // for numeric_limits -#include // for map -#include // for random_device, default_random_engine, uniform_real_distribution -#include // for vector +#include "volk_gnsssdr/volk_gnsssdr.h" // for volk_gnsssdr_func_desc_t +#include "volk_gnsssdr/volk_gnsssdr_malloc.h" // for volk_gnsssdr_free, volk_gnsssdr_malloc +#include // for auto_any_base +#include // for lexical_cast +#include // for char_separator +#include // for token_iterator +#include // for tokenizer +#include // for assert +#include // for system_clock, duration,... +#include // for sqrt, fabs, abs +#include // for uint16_t, uint64_t,int16_t, int32_t +#include // for memcpy, memset +#include // for operator<< +#include // for cout, cerr +#include // for numeric_limits +#include // for map +#include // for random_device, default_random_engine, uniform_real_distribution +#include // for vector -float uniform() { +float uniform() +{ std::random_device r; std::default_random_engine e1(r()); std::uniform_real_distribution uniform_dist(-1, 1); - return uniform_dist(e1); // uniformly (-1, 1) + return uniform_dist(e1); // uniformly (-1, 1) } template -void random_floats (t *buf, unsigned n) +void random_floats(t *buf, unsigned n) { - for (unsigned i = 0; i < n; i++) - buf[i] = uniform (); + for (unsigned i = 0; i < n; i++) + buf[i] = uniform(); } void load_random_data(void *data, volk_gnsssdr_type_t type, unsigned int n) @@ -56,60 +57,73 @@ void load_random_data(void *data, volk_gnsssdr_type_t type, unsigned int n) std::random_device r; std::default_random_engine e2(r()); - if(type.is_complex) n *= 2; + if (type.is_complex) n *= 2; - if(type.is_float) + if (type.is_float) { - if(type.size == 8) random_floats((double *)data, n); - else random_floats((float *)data, n); + if (type.size == 8) + random_floats((double *)data, n); + else + random_floats((float *)data, n); } else { - float int_max = float(uint64_t(2) << (type.size*8)); - if(type.is_signed) int_max /= 2.0; + float int_max = float(uint64_t(2) << (type.size * 8)); + if (type.is_signed) int_max /= 2.0; std::uniform_real_distribution uniform_dist(-int_max, int_max); - for(unsigned int i = 0; i < n; i++) + for (unsigned int i = 0; i < n; i++) { float scaled_rand = uniform_dist(e2); - switch(type.size) - { - case 8: - if(type.is_signed) ((int64_t *)data)[i] = (int64_t) scaled_rand; - else ((uint64_t *)data)[i] = (uint64_t) scaled_rand; - break; - case 4: - if(type.is_signed) ((int32_t *)data)[i] = (int32_t) scaled_rand; - else ((uint32_t *)data)[i] = (uint32_t) scaled_rand; - break; - case 2: - // 16 bit multiplication saturates very fast - // we produce here only 3 bits input range - if(type.is_signed) ((int16_t *)data)[i] = (int16_t)((int16_t) scaled_rand % 8); - else ((uint16_t *)data)[i] = (uint16_t) (int16_t)((int16_t) scaled_rand % 8); - break; - case 1: - if(type.is_signed) ((int8_t *)data)[i] = (int8_t) scaled_rand; - else ((uint8_t *)data)[i] = (uint8_t) scaled_rand; - break; - default: - throw "load_random_data: no support for data size > 8 or < 1"; //no shenanigans here - } + switch (type.size) + { + case 8: + if (type.is_signed) + ((int64_t *)data)[i] = (int64_t)scaled_rand; + else + ((uint64_t *)data)[i] = (uint64_t)scaled_rand; + break; + case 4: + if (type.is_signed) + ((int32_t *)data)[i] = (int32_t)scaled_rand; + else + ((uint32_t *)data)[i] = (uint32_t)scaled_rand; + break; + case 2: + // 16 bit multiplication saturates very fast + // we produce here only 3 bits input range + if (type.is_signed) + ((int16_t *)data)[i] = (int16_t)((int16_t)scaled_rand % 8); + else + ((uint16_t *)data)[i] = (uint16_t)(int16_t)((int16_t)scaled_rand % 8); + break; + case 1: + if (type.is_signed) + ((int8_t *)data)[i] = (int8_t)scaled_rand; + else + ((uint8_t *)data)[i] = (uint8_t)scaled_rand; + break; + default: + throw "load_random_data: no support for data size > 8 or < 1"; //no shenanigans here + } } } } -static std::vector get_arch_list(volk_gnsssdr_func_desc_t desc) { +static std::vector get_arch_list(volk_gnsssdr_func_desc_t desc) +{ std::vector archlist; - for(size_t i = 0; i < desc.n_impls; i++) { - archlist.push_back(std::string(desc.impl_names[i])); - } + for (size_t i = 0; i < desc.n_impls; i++) + { + archlist.push_back(std::string(desc.impl_names[i])); + } return archlist; } -volk_gnsssdr_type_t volk_gnsssdr_type_from_string(std::string name) { +volk_gnsssdr_type_t volk_gnsssdr_type_from_string(std::string name) +{ volk_gnsssdr_type_t type; type.is_float = false; type.is_scalar = false; @@ -118,52 +132,58 @@ volk_gnsssdr_type_t volk_gnsssdr_type_from_string(std::string name) { type.size = 0; type.str = name; - if(name.size() < 2) { - throw std::string("name too short to be a datatype"); - } + if (name.size() < 2) + { + throw std::string("name too short to be a datatype"); + } //is it a scalar? - if(name[0] == 's') { - type.is_scalar = true; - name = name.substr(1, name.size()-1); - } + if (name[0] == 's') + { + type.is_scalar = true; + name = name.substr(1, name.size() - 1); + } //get the data size size_t last_size_pos = name.find_last_of("0123456789"); - if(last_size_pos == std::string::npos) { - throw std::string("no size spec in type ").append(name); - } + if (last_size_pos == std::string::npos) + { + throw std::string("no size spec in type ").append(name); + } //will throw if malformed - int size = boost::lexical_cast(name.substr(0, last_size_pos+1)); + int size = boost::lexical_cast(name.substr(0, last_size_pos + 1)); assert(((size % 8) == 0) && (size <= 64) && (size != 0)); - type.size = size/8; //in bytes + type.size = size / 8; //in bytes - for(size_t i=last_size_pos+1; i < name.size(); i++) { - switch (name[i]) { - case 'f': - type.is_float = true; - break; - case 'i': - type.is_signed = true; - break; - case 'c': - type.is_complex = true; - break; - case 'u': - type.is_signed = false; - break; - default: - throw; + for (size_t i = last_size_pos + 1; i < name.size(); i++) + { + switch (name[i]) + { + case 'f': + type.is_float = true; + break; + case 'i': + type.is_signed = true; + break; + case 'c': + type.is_complex = true; + break; + case 'u': + type.is_signed = false; + break; + default: + throw; + } } - } return type; } static void get_signatures_from_name(std::vector &inputsig, - std::vector &outputsig, - std::string name) { + std::vector &outputsig, + std::string name) +{ boost::char_separator sep("_"); boost::tokenizer > tok(name, sep); std::vector toked; @@ -176,233 +196,282 @@ static void get_signatures_from_name(std::vector &inputsig, //ok. we're assuming a string in the form //(sig)_(multiplier-opt)_..._(name)_(sig)_(multiplier-opt)_..._(alignment) - enum { SIDE_INPUT, SIDE_NAME, SIDE_OUTPUT } side = SIDE_INPUT; + enum + { + SIDE_INPUT, + SIDE_NAME, + SIDE_OUTPUT + } side = SIDE_INPUT; std::string fn_name; volk_gnsssdr_type_t type; - BOOST_FOREACH(std::string token, toked) { - try { - type = volk_gnsssdr_type_from_string(token); - if(side == SIDE_NAME) side = SIDE_OUTPUT; //if this is the first one after the name... + BOOST_FOREACH (std::string token, toked) + { + try + { + type = volk_gnsssdr_type_from_string(token); + if (side == SIDE_NAME) side = SIDE_OUTPUT; //if this is the first one after the name... - if(side == SIDE_INPUT) inputsig.push_back(type); - else outputsig.push_back(type); - } catch (...){ - if(token[0] == 'x' && (token.size() > 1) && (token[1] > '0' || token[1] < '9')) { - if(side == SIDE_INPUT) assert(inputsig.size() > 0); - else assert(outputsig.size() > 0); - int multiplier = boost::lexical_cast(token.substr(1, token.size()-1)); //will throw if invalid /////////// - for(int i=1; i 1) && (token[1] > '0' || token[1] < '9')) + { + if (side == SIDE_INPUT) + assert(inputsig.size() > 0); + else + assert(outputsig.size() > 0); + int multiplier = boost::lexical_cast(token.substr(1, token.size() - 1)); //will throw if invalid /////////// + for (int i = 1; i < multiplier; i++) + { + if (side == SIDE_INPUT) + inputsig.push_back(inputsig.back()); + else + outputsig.push_back(outputsig.back()); + } + } - else if(side == SIDE_INPUT) { //it's the function name, at least it better be - side = SIDE_NAME; - fn_name.append("_"); - fn_name.append(token); - } - else if(side == SIDE_OUTPUT) { - if(token != toked.back()) throw; //the last token in the name is the alignment - } + else if (side == SIDE_INPUT) + { //it's the function name, at least it better be + side = SIDE_NAME; + fn_name.append("_"); + fn_name.append(token); + } + else if (side == SIDE_OUTPUT) + { + if (token != toked.back()) throw; //the last token in the name is the alignment + } + } } - } //we don't need an output signature (some fn's operate on the input data, "in place"), but we do need at least one input! assert(inputsig.size() != 0); - } -inline void run_cast_test1(volk_gnsssdr_fn_1arg func, std::vector &buffs, unsigned int vlen, unsigned int iter, std::string arch) { - while(iter--) func(buffs[0], vlen, arch.c_str()); +inline void run_cast_test1(volk_gnsssdr_fn_1arg func, std::vector &buffs, unsigned int vlen, unsigned int iter, std::string arch) +{ + while (iter--) func(buffs[0], vlen, arch.c_str()); } -inline void run_cast_test2(volk_gnsssdr_fn_2arg func, std::vector &buffs, unsigned int vlen, unsigned int iter, std::string arch) { - while(iter--) func(buffs[0], buffs[1], vlen, arch.c_str()); +inline void run_cast_test2(volk_gnsssdr_fn_2arg func, std::vector &buffs, unsigned int vlen, unsigned int iter, std::string arch) +{ + while (iter--) func(buffs[0], buffs[1], vlen, arch.c_str()); } -inline void run_cast_test3(volk_gnsssdr_fn_3arg func, std::vector &buffs, unsigned int vlen, unsigned int iter, std::string arch) { - while(iter--) func(buffs[0], buffs[1], buffs[2], vlen, arch.c_str()); +inline void run_cast_test3(volk_gnsssdr_fn_3arg func, std::vector &buffs, unsigned int vlen, unsigned int iter, std::string arch) +{ + while (iter--) func(buffs[0], buffs[1], buffs[2], vlen, arch.c_str()); } -inline void run_cast_test4(volk_gnsssdr_fn_4arg func, std::vector &buffs, unsigned int vlen, unsigned int iter, std::string arch) { - while(iter--) func(buffs[0], buffs[1], buffs[2], buffs[3], vlen, arch.c_str()); +inline void run_cast_test4(volk_gnsssdr_fn_4arg func, std::vector &buffs, unsigned int vlen, unsigned int iter, std::string arch) +{ + while (iter--) func(buffs[0], buffs[1], buffs[2], buffs[3], vlen, arch.c_str()); } -inline void run_cast_test1_s32f(volk_gnsssdr_fn_1arg_s32f func, std::vector &buffs, float scalar, unsigned int vlen, unsigned int iter, std::string arch) { - while(iter--) func(buffs[0], scalar, vlen, arch.c_str()); +inline void run_cast_test1_s32f(volk_gnsssdr_fn_1arg_s32f func, std::vector &buffs, float scalar, unsigned int vlen, unsigned int iter, std::string arch) +{ + while (iter--) func(buffs[0], scalar, vlen, arch.c_str()); } -inline void run_cast_test2_s32f(volk_gnsssdr_fn_2arg_s32f func, std::vector &buffs, float scalar, unsigned int vlen, unsigned int iter, std::string arch) { - while(iter--) func(buffs[0], buffs[1], scalar, vlen, arch.c_str()); +inline void run_cast_test2_s32f(volk_gnsssdr_fn_2arg_s32f func, std::vector &buffs, float scalar, unsigned int vlen, unsigned int iter, std::string arch) +{ + while (iter--) func(buffs[0], buffs[1], scalar, vlen, arch.c_str()); } -inline void run_cast_test3_s32f(volk_gnsssdr_fn_3arg_s32f func, std::vector &buffs, float scalar, unsigned int vlen, unsigned int iter, std::string arch) { - while(iter--) func(buffs[0], buffs[1], buffs[2], scalar, vlen, arch.c_str()); +inline void run_cast_test3_s32f(volk_gnsssdr_fn_3arg_s32f func, std::vector &buffs, float scalar, unsigned int vlen, unsigned int iter, std::string arch) +{ + while (iter--) func(buffs[0], buffs[1], buffs[2], scalar, vlen, arch.c_str()); } -inline void run_cast_test1_s32fc(volk_gnsssdr_fn_1arg_s32fc func, std::vector &buffs, lv_32fc_t scalar, unsigned int vlen, unsigned int iter, std::string arch) { - while(iter--) func(buffs[0], scalar, vlen, arch.c_str()); +inline void run_cast_test1_s32fc(volk_gnsssdr_fn_1arg_s32fc func, std::vector &buffs, lv_32fc_t scalar, unsigned int vlen, unsigned int iter, std::string arch) +{ + while (iter--) func(buffs[0], scalar, vlen, arch.c_str()); } -inline void run_cast_test2_s32fc(volk_gnsssdr_fn_2arg_s32fc func, std::vector &buffs, lv_32fc_t scalar, unsigned int vlen, unsigned int iter, std::string arch) { - while(iter--) func(buffs[0], buffs[1], scalar, vlen, arch.c_str()); +inline void run_cast_test2_s32fc(volk_gnsssdr_fn_2arg_s32fc func, std::vector &buffs, lv_32fc_t scalar, unsigned int vlen, unsigned int iter, std::string arch) +{ + while (iter--) func(buffs[0], buffs[1], scalar, vlen, arch.c_str()); } -inline void run_cast_test3_s32fc(volk_gnsssdr_fn_3arg_s32fc func, std::vector &buffs, lv_32fc_t scalar, unsigned int vlen, unsigned int iter, std::string arch) { - while(iter--) func(buffs[0], buffs[1], buffs[2], scalar, vlen, arch.c_str()); +inline void run_cast_test3_s32fc(volk_gnsssdr_fn_3arg_s32fc func, std::vector &buffs, lv_32fc_t scalar, unsigned int vlen, unsigned int iter, std::string arch) +{ + while (iter--) func(buffs[0], buffs[1], buffs[2], scalar, vlen, arch.c_str()); } // *************** ADDED BY GNSS-SDR. START inline void run_cast_test1_s8i(volk_gnsssdr_fn_1arg_s8i func, std::vector &buffs, char scalar, unsigned int vlen, unsigned int iter, std::string arch) { - while(iter--) func(buffs[0], scalar, vlen, arch.c_str()); + while (iter--) func(buffs[0], scalar, vlen, arch.c_str()); } inline void run_cast_test2_s8i(volk_gnsssdr_fn_2arg_s8i func, std::vector &buffs, char scalar, unsigned int vlen, unsigned int iter, std::string arch) { - while(iter--) func(buffs[0], buffs[1], scalar, vlen, arch.c_str()); + while (iter--) func(buffs[0], buffs[1], scalar, vlen, arch.c_str()); } inline void run_cast_test3_s8i(volk_gnsssdr_fn_3arg_s8i func, std::vector &buffs, char scalar, unsigned int vlen, unsigned int iter, std::string arch) { - while(iter--) func(buffs[0], buffs[1], buffs[2], scalar, vlen, arch.c_str()); + while (iter--) func(buffs[0], buffs[1], buffs[2], scalar, vlen, arch.c_str()); } inline void run_cast_test1_s8ic(volk_gnsssdr_fn_1arg_s8ic func, std::vector &buffs, lv_8sc_t scalar, unsigned int vlen, unsigned int iter, std::string arch) { - while(iter--) func(buffs[0], scalar, vlen, arch.c_str()); + while (iter--) func(buffs[0], scalar, vlen, arch.c_str()); } inline void run_cast_test2_s8ic(volk_gnsssdr_fn_2arg_s8ic func, std::vector &buffs, lv_8sc_t scalar, unsigned int vlen, unsigned int iter, std::string arch) { - while(iter--) func(buffs[0], buffs[1], scalar, vlen, arch.c_str()); + while (iter--) func(buffs[0], buffs[1], scalar, vlen, arch.c_str()); } inline void run_cast_test3_s8ic(volk_gnsssdr_fn_3arg_s8ic func, std::vector &buffs, lv_8sc_t scalar, unsigned int vlen, unsigned int iter, std::string arch) { - while(iter--) func(buffs[0], buffs[1], buffs[2], scalar, vlen, arch.c_str()); + while (iter--) func(buffs[0], buffs[1], buffs[2], scalar, vlen, arch.c_str()); } inline void run_cast_test1_s16ic(volk_gnsssdr_fn_1arg_s16ic func, std::vector &buffs, lv_16sc_t scalar, unsigned int vlen, unsigned int iter, std::string arch) { - while(iter--) func(buffs[0], scalar, vlen, arch.c_str()); + while (iter--) func(buffs[0], scalar, vlen, arch.c_str()); } inline void run_cast_test2_s16ic(volk_gnsssdr_fn_2arg_s16ic func, std::vector &buffs, lv_16sc_t scalar, unsigned int vlen, unsigned int iter, std::string arch) { - while(iter--) func(buffs[0], buffs[1], scalar, vlen, arch.c_str()); + while (iter--) func(buffs[0], buffs[1], scalar, vlen, arch.c_str()); } inline void run_cast_test3_s16ic(volk_gnsssdr_fn_3arg_s16ic func, std::vector &buffs, lv_16sc_t scalar, unsigned int vlen, unsigned int iter, std::string arch) { - while(iter--) func(buffs[0], buffs[1], buffs[2], scalar, vlen, arch.c_str()); + while (iter--) func(buffs[0], buffs[1], buffs[2], scalar, vlen, arch.c_str()); } // *************** ADDED BY GNSS-SDR. END template -bool fcompare(t *in1, t *in2, unsigned int vlen, float tol) { +bool fcompare(t *in1, t *in2, unsigned int vlen, float tol) +{ bool fail = false; int print_max_errs = 10; - for(unsigned int i=0; i tol ) - { - fail=true; - if(print_max_errs-- > 0) { - std::cout << "offset " << i << " in1: " << t(((t *)(in1))[i]) << " in2: " << t(((t *)(in2))[i]); - std::cout << " tolerance was: " << tol << std::endl; + for (unsigned int i = 0; i < vlen; i++) + { + // for very small numbers we'll see round off errors due to limited + // precision. So a special test case... + if (fabs(((t *)(in1))[i]) < 1e-30) + { + if (fabs(((t *)(in2))[i]) > tol) + { + fail = true; + if (print_max_errs-- > 0) + { + std::cout << "offset " << i << " in1: " << t(((t *)(in1))[i]) << " in2: " << t(((t *)(in2))[i]); + std::cout << " tolerance was: " << tol << std::endl; + } + } + } + // the primary test is the percent different greater than given tol + else if (fabs(((t *)(in1))[i] - ((t *)(in2))[i]) / fabs(((t *)in1)[i]) > tol) + { + fail = true; + if (print_max_errs-- > 0) + { + std::cout << "offset " << i << " in1: " << t(((t *)(in1))[i]) << " in2: " << t(((t *)(in2))[i]); + std::cout << " tolerance was: " << tol << std::endl; + } } - } } - // the primary test is the percent different greater than given tol - else if(fabs(((t *)(in1))[i] - ((t *)(in2))[i])/fabs(((t *)in1)[i]) > tol) { - fail=true; - if(print_max_errs-- > 0) { - std::cout << "offset " << i << " in1: " << t(((t *)(in1))[i]) << " in2: " << t(((t *)(in2))[i]); - std::cout << " tolerance was: " << tol << std::endl; - } - } - } return fail; } template -bool ccompare(t *in1, t *in2, unsigned int vlen, float tol) { +bool ccompare(t *in1, t *in2, unsigned int vlen, float tol) +{ bool fail = false; int print_max_errs = 10; - for(unsigned int i=0; i<2*vlen; i+=2) { - t diff[2] = { in1[i] - in2[i], in1[i+1] - in2[i+1] }; - t err = std::sqrt(diff[0] * diff[0] + diff[1] * diff[1]); - t norm = std::sqrt(in1[i] * in1[i] + in1[i+1] * in1[i+1]); + for (unsigned int i = 0; i < 2 * vlen; i += 2) + { + t diff[2] = {in1[i] - in2[i], in1[i + 1] - in2[i + 1]}; + t err = std::sqrt(diff[0] * diff[0] + diff[1] * diff[1]); + t norm = std::sqrt(in1[i] * in1[i] + in1[i + 1] * in1[i + 1]); - // for very small numbers we'll see round off errors due to limited - // precision. So a special test case... - if (norm < 1e-30) { - if (err > tol) - { - fail=true; - if(print_max_errs-- > 0) { - std::cout << "offset " << i/2 << " in1: " << in1[i] << " + " << in1[i+1] << "j in2: " << in2[i] << " + " << in2[i+1] << "j"; - std::cout << " tolerance was: " << tol << std::endl; + // for very small numbers we'll see round off errors due to limited + // precision. So a special test case... + if (norm < 1e-30) + { + if (err > tol) + { + fail = true; + if (print_max_errs-- > 0) + { + std::cout << "offset " << i / 2 << " in1: " << in1[i] << " + " << in1[i + 1] << "j in2: " << in2[i] << " + " << in2[i + 1] << "j"; + std::cout << " tolerance was: " << tol << std::endl; + } + } + } + // the primary test is the percent different greater than given tol + else if ((err / norm) > tol) + { + fail = true; + if (print_max_errs-- > 0) + { + std::cout << "offset " << i / 2 << " in1: " << in1[i] << " + " << in1[i + 1] << "j in2: " << in2[i] << " + " << in2[i + 1] << "j"; + std::cout << " tolerance was: " << tol << std::endl; + } } - } } - // the primary test is the percent different greater than given tol - else if((err / norm) > tol) { - fail=true; - if(print_max_errs-- > 0) { - std::cout << "offset " << i/2 << " in1: " << in1[i] << " + " << in1[i+1] << "j in2: " << in2[i] << " + " << in2[i+1] << "j"; - std::cout << " tolerance was: " << tol << std::endl; - } - } - } return fail; } template -bool icompare(t *in1, t *in2, unsigned int vlen, unsigned int tol) { +bool icompare(t *in1, t *in2, unsigned int vlen, unsigned int tol) +{ bool fail = false; int print_max_errs = 10; - for(unsigned int i=0; i tol) { - fail=true; - if(print_max_errs-- > 0) { - std::cout << "offset " << i << " in1: " << static_cast(t(((t *)(in1))[i])) << " in2: " << static_cast(t(((t *)(in2))[i])); - std::cout << " tolerance was: " << tol << std::endl; - } + for (unsigned int i = 0; i < vlen; i++) + { + if (((unsigned int)abs(int(((t *)(in1))[i]) - int(((t *)(in2))[i]))) > tol) + { + fail = true; + if (print_max_errs-- > 0) + { + std::cout << "offset " << i << " in1: " << static_cast(t(((t *)(in1))[i])) << " in2: " << static_cast(t(((t *)(in2))[i])); + std::cout << " tolerance was: " << tol << std::endl; + } + } } - } return fail; } -class volk_gnsssdr_qa_aligned_mem_pool{ +class volk_gnsssdr_qa_aligned_mem_pool +{ public: - void *get_new(size_t size){ + void *get_new(size_t size) + { size_t alignment = volk_gnsssdr_get_alignment(); - void* ptr = volk_gnsssdr_malloc(size, alignment); + void *ptr = volk_gnsssdr_malloc(size, alignment); memset(ptr, 0x00, size); _mems.push_back(ptr); return ptr; } - ~volk_gnsssdr_qa_aligned_mem_pool() { - for(unsigned int ii = 0; ii < _mems.size(); ++ii) { - volk_gnsssdr_free(_mems[ii]); - } + ~volk_gnsssdr_qa_aligned_mem_pool() + { + for (unsigned int ii = 0; ii < _mems.size(); ++ii) + { + volk_gnsssdr_free(_mems[ii]); + } } -private: std::vector _mems; + +private: + std::vector _mems; }; bool run_volk_gnsssdr_tests(volk_gnsssdr_func_desc_t desc, - void (*manual_func)(), - std::string name, - volk_gnsssdr_test_params_t test_params, - std::vector *results, - std::string puppet_master_name -) + void (*manual_func)(), + std::string name, + volk_gnsssdr_test_params_t test_params, + std::vector *results, + std::string puppet_master_name) { return run_volk_gnsssdr_tests(desc, manual_func, name, test_params.tol(), test_params.scalar(), test_params.vlen(), test_params.iter(), results, puppet_master_name, @@ -410,15 +479,15 @@ bool run_volk_gnsssdr_tests(volk_gnsssdr_func_desc_t desc, } bool run_volk_gnsssdr_tests(volk_gnsssdr_func_desc_t desc, - void (*manual_func)(), - std::string name, - float tol, - lv_32fc_t scalar, - unsigned int vlen, - unsigned int iter, - std::vector *results, - std::string puppet_master_name, - bool benchmark_mode) + void (*manual_func)(), + std::string name, + float tol, + lv_32fc_t scalar, + unsigned int vlen, + unsigned int iter, + std::vector *results, + std::string puppet_master_name, + bool benchmark_mode) { // Initialize this entry in results vector results->push_back(volk_gnsssdr_test_results_t()); @@ -439,57 +508,67 @@ bool run_volk_gnsssdr_tests(volk_gnsssdr_func_desc_t desc, //first let's get a list of available architectures for the test std::vector arch_list = get_arch_list(desc); - if((!benchmark_mode) && (arch_list.size() < 2)) { - std::cout << "no architectures to test" << std::endl; - return false; - } + if ((!benchmark_mode) && (arch_list.size() < 2)) + { + std::cout << "no architectures to test" << std::endl; + return false; + } //something that can hang onto memory and cleanup when this function exits volk_gnsssdr_qa_aligned_mem_pool mem_pool; //now we have to get a function signature by parsing the name std::vector inputsig, outputsig; - try { - get_signatures_from_name(inputsig, outputsig, name); - } - catch (boost::bad_lexical_cast& error) { - std::cerr << "Error: unable to get function signature from kernel name" << std::endl; - std::cerr << " - " << name << std::endl; - return false; - } + try + { + get_signatures_from_name(inputsig, outputsig, name); + } + catch (boost::bad_lexical_cast &error) + { + std::cerr << "Error: unable to get function signature from kernel name" << std::endl; + std::cerr << " - " << name << std::endl; + return false; + } //pull the input scalars into their own vector std::vector inputsc; - for(size_t i=0; i inbuffs; - BOOST_FOREACH(volk_gnsssdr_type_t sig, inputsig) { - if(!sig.is_scalar) //we don't make buffers for scalars - inbuffs.push_back(mem_pool.get_new(vlen*sig.size*(sig.is_complex ? 2 : 1))); - } - for(size_t i=0; i > test_data; - for(size_t i=0; i arch_buffs; - for(size_t j=0; j arch_buffs; + for (size_t j = 0; j < outputsig.size(); j++) + { + arch_buffs.push_back(mem_pool.get_new(vlen * outputsig[j].size * (outputsig[j].is_complex ? 2 : 1))); + } + for (size_t j = 0; j < inputsig.size(); j++) + { + void *arch_inbuff = mem_pool.get_new(vlen * inputsig[j].size * (inputsig[j].is_complex ? 2 : 1)); + memcpy(arch_inbuff, inbuffs[j], vlen * inputsig[j].size * (inputsig[j].is_complex ? 2 : 1)); + arch_buffs.push_back(arch_inbuff); + } + test_data.push_back(arch_buffs); } - for(size_t j=0; j both_sigs; both_sigs.insert(both_sigs.end(), outputsig.begin(), outputsig.end()); @@ -499,270 +578,276 @@ bool run_volk_gnsssdr_tests(volk_gnsssdr_func_desc_t desc, vlen = vlen - vlen_twiddle; std::chrono::time_point start, end; std::vector profile_times; - for(size_t i = 0; i < arch_list.size(); i++) { - start = std::chrono::system_clock::now(); - - switch(both_sigs.size()) + for (size_t i = 0; i < arch_list.size(); i++) { - case 1: - if(inputsc.size() == 0) + start = std::chrono::system_clock::now(); + + switch (both_sigs.size()) { - run_cast_test1((volk_gnsssdr_fn_1arg)(manual_func), test_data[i], vlen, iter, arch_list[i]); - } - else if(inputsc.size() == 1 && inputsc[0].is_float) - { - if(inputsc[0].is_complex) + case 1: + if (inputsc.size() == 0) { - run_cast_test1_s32fc((volk_gnsssdr_fn_1arg_s32fc)(manual_func), test_data[i], scalar, vlen, iter, arch_list[i]); + run_cast_test1((volk_gnsssdr_fn_1arg)(manual_func), test_data[i], vlen, iter, arch_list[i]); } - else + else if (inputsc.size() == 1 && inputsc[0].is_float) { - run_cast_test1_s32f((volk_gnsssdr_fn_1arg_s32f)(manual_func), test_data[i], scalar.real(), vlen, iter, arch_list[i]); - } - } - //ADDED BY GNSS-SDR. START - else if(inputsc.size() == 1 && !inputsc[0].is_float) - { - if(inputsc[0].is_complex) - { - if(inputsc[0].size == 2) + if (inputsc[0].is_complex) { - run_cast_test1_s16ic((volk_gnsssdr_fn_1arg_s16ic)(manual_func), test_data[i], scalar, vlen, iter, arch_list[i]); + run_cast_test1_s32fc((volk_gnsssdr_fn_1arg_s32fc)(manual_func), test_data[i], scalar, vlen, iter, arch_list[i]); } else { - run_cast_test1_s8ic((volk_gnsssdr_fn_1arg_s8ic)(manual_func), test_data[i], scalar, vlen, iter, arch_list[i]); + run_cast_test1_s32f((volk_gnsssdr_fn_1arg_s32f)(manual_func), test_data[i], scalar.real(), vlen, iter, arch_list[i]); } } - else + //ADDED BY GNSS-SDR. START + else if (inputsc.size() == 1 && !inputsc[0].is_float) { - run_cast_test1_s8i((volk_gnsssdr_fn_1arg_s8i)(manual_func), test_data[i], scalar.real(), vlen, iter, arch_list[i]); + if (inputsc[0].is_complex) + { + if (inputsc[0].size == 2) + { + run_cast_test1_s16ic((volk_gnsssdr_fn_1arg_s16ic)(manual_func), test_data[i], scalar, vlen, iter, arch_list[i]); + } + else + { + run_cast_test1_s8ic((volk_gnsssdr_fn_1arg_s8ic)(manual_func), test_data[i], scalar, vlen, iter, arch_list[i]); + } + } + else + { + run_cast_test1_s8i((volk_gnsssdr_fn_1arg_s8i)(manual_func), test_data[i], scalar.real(), vlen, iter, arch_list[i]); + } } - } - //ADDED BY GNSS-SDR. END - else throw "unsupported 1 arg function >1 scalars"; - break; - case 2: - if(inputsc.size() == 0) - { + //ADDED BY GNSS-SDR. END + else + throw "unsupported 1 arg function >1 scalars"; + break; + case 2: + if (inputsc.size() == 0) + { run_cast_test2((volk_gnsssdr_fn_2arg)(manual_func), test_data[i], vlen, iter, arch_list[i]); - } - else if(inputsc.size() == 1 && inputsc[0].is_float) - { - if(inputsc[0].is_complex) - { - run_cast_test2_s32fc((volk_gnsssdr_fn_2arg_s32fc)(manual_func), test_data[i], scalar, vlen, iter, arch_list[i]); } - else + else if (inputsc.size() == 1 && inputsc[0].is_float) { - run_cast_test2_s32f((volk_gnsssdr_fn_2arg_s32f)(manual_func), test_data[i], scalar.real(), vlen, iter, arch_list[i]); - } - } - //ADDED BY GNSS-SDR. START - else if(inputsc.size() == 1 && !inputsc[0].is_float) - { - if(inputsc[0].is_complex) - { - if(inputsc[0].size == 2) + if (inputsc[0].is_complex) { - run_cast_test2_s16ic((volk_gnsssdr_fn_2arg_s16ic)(manual_func), test_data[i], scalar, vlen, iter, arch_list[i]); + run_cast_test2_s32fc((volk_gnsssdr_fn_2arg_s32fc)(manual_func), test_data[i], scalar, vlen, iter, arch_list[i]); } else { - run_cast_test2_s8ic((volk_gnsssdr_fn_2arg_s8ic)(manual_func), test_data[i], scalar, vlen, iter, arch_list[i]); + run_cast_test2_s32f((volk_gnsssdr_fn_2arg_s32f)(manual_func), test_data[i], scalar.real(), vlen, iter, arch_list[i]); } } + //ADDED BY GNSS-SDR. START + else if (inputsc.size() == 1 && !inputsc[0].is_float) + { + if (inputsc[0].is_complex) + { + if (inputsc[0].size == 2) + { + run_cast_test2_s16ic((volk_gnsssdr_fn_2arg_s16ic)(manual_func), test_data[i], scalar, vlen, iter, arch_list[i]); + } + else + { + run_cast_test2_s8ic((volk_gnsssdr_fn_2arg_s8ic)(manual_func), test_data[i], scalar, vlen, iter, arch_list[i]); + } + } + else + { + run_cast_test2_s8i((volk_gnsssdr_fn_2arg_s8i)(manual_func), test_data[i], scalar.real(), vlen, iter, arch_list[i]); + } + } + //ADDED BY GNSS-SDR. END else + throw "unsupported 2 arg function >1 scalars"; + break; + case 3: + if (inputsc.size() == 0) { - run_cast_test2_s8i((volk_gnsssdr_fn_2arg_s8i)(manual_func), test_data[i], scalar.real(), vlen, iter, arch_list[i]); + run_cast_test3((volk_gnsssdr_fn_3arg)(manual_func), test_data[i], vlen, iter, arch_list[i]); } - } - //ADDED BY GNSS-SDR. END - else throw "unsupported 2 arg function >1 scalars"; - break; - case 3: - if(inputsc.size() == 0) - { - run_cast_test3((volk_gnsssdr_fn_3arg)(manual_func), test_data[i], vlen, iter, arch_list[i]); - } - else if(inputsc.size() == 1 && inputsc[0].is_float) - { - if(inputsc[0].is_complex) + else if (inputsc.size() == 1 && inputsc[0].is_float) { - run_cast_test3_s32fc((volk_gnsssdr_fn_3arg_s32fc)(manual_func), test_data[i], scalar, vlen, iter, arch_list[i]); + if (inputsc[0].is_complex) + { + run_cast_test3_s32fc((volk_gnsssdr_fn_3arg_s32fc)(manual_func), test_data[i], scalar, vlen, iter, arch_list[i]); + } + else + { + run_cast_test3_s32f((volk_gnsssdr_fn_3arg_s32f)(manual_func), test_data[i], scalar.real(), vlen, iter, arch_list[i]); + } } + //ADDED BY GNSS-SDR. START + else if (inputsc.size() == 1 && !inputsc[0].is_float) + { + if (inputsc[0].is_complex) + { + { + if (inputsc[0].size == 4) + { + run_cast_test3_s16ic((volk_gnsssdr_fn_3arg_s16ic)(manual_func), test_data[i], scalar, vlen, iter, arch_list[i]); + } + else + { + run_cast_test3_s8ic((volk_gnsssdr_fn_3arg_s8ic)(manual_func), test_data[i], scalar, vlen, iter, arch_list[i]); + } + } + } + else + { + run_cast_test3_s8i((volk_gnsssdr_fn_3arg_s8i)(manual_func), test_data[i], scalar.real(), vlen, iter, arch_list[i]); + } + } + //ADDED BY GNSS-SDR. END else - { - run_cast_test3_s32f((volk_gnsssdr_fn_3arg_s32f)(manual_func), test_data[i], scalar.real(), vlen, iter, arch_list[i]); - } + throw "unsupported 3 arg function >1 scalars"; + break; + default: + throw "no function handler for this signature"; + break; } - //ADDED BY GNSS-SDR. START - else if(inputsc.size() == 1 && !inputsc[0].is_float) - { - if(inputsc[0].is_complex) - { - { - if(inputsc[0].size == 4) - { - run_cast_test3_s16ic((volk_gnsssdr_fn_3arg_s16ic)(manual_func), test_data[i], scalar, vlen, iter, arch_list[i]); - } - else - { - run_cast_test3_s8ic((volk_gnsssdr_fn_3arg_s8ic)(manual_func), test_data[i], scalar, vlen, iter, arch_list[i]); - } - } - } - else - { - run_cast_test3_s8i((volk_gnsssdr_fn_3arg_s8i)(manual_func), test_data[i], scalar.real(), vlen, iter, arch_list[i]); - } - } - //ADDED BY GNSS-SDR. END - else throw "unsupported 3 arg function >1 scalars"; - break; - default: - throw "no function handler for this signature"; - break; + + end = std::chrono::system_clock::now(); + std::chrono::duration elapsed_seconds = end - start; + double arch_time = 1000.0 * elapsed_seconds.count(); + std::cout << arch_list[i] << " completed in " << arch_time << " ms" << std::endl; + volk_gnsssdr_test_time_t result; + result.name = arch_list[i]; + result.time = arch_time; + result.units = "ms"; + result.pass = true; + results->back().results[result.name] = result; + + profile_times.push_back(arch_time); } - end = std::chrono::system_clock::now(); - std::chrono::duration elapsed_seconds = end - start; - double arch_time = 1000.0 * elapsed_seconds.count(); - std::cout << arch_list[i] << " completed in " << arch_time << " ms" << std::endl; - volk_gnsssdr_test_time_t result; - result.name = arch_list[i]; - result.time = arch_time; - result.units = "ms"; - result.pass = true; - results->back().results[result.name] = result; - - profile_times.push_back(arch_time); - } - //and now compare each output to the generic output //first we have to know which output is the generic one, they aren't in order... - size_t generic_offset=0; - for(size_t i=0; i arch_results; - for(size_t i = 0; i < arch_list.size(); i++) + for (size_t i = 0; i < arch_list.size(); i++) { fail = false; - if(i != generic_offset) + if (i != generic_offset) { - for(size_t j=0; jback().results[arch_list[i]]; result->pass = !fail; @@ -778,14 +863,14 @@ bool run_volk_gnsssdr_tests(volk_gnsssdr_func_desc_t desc, double best_time_u = std::numeric_limits::max(); std::string best_arch_a = "generic"; std::string best_arch_u = "generic"; - for(size_t i=0; i < arch_list.size(); i++) + for (size_t i = 0; i < arch_list.size(); i++) { - if((profile_times[i] < best_time_u) && arch_results[i] && desc.impl_alignment[i] == 0) + if ((profile_times[i] < best_time_u) && arch_results[i] && desc.impl_alignment[i] == 0) { best_time_u = profile_times[i]; best_arch_u = arch_list[i]; } - if((profile_times[i] < best_time_a) && arch_results[i]) + if ((profile_times[i] < best_time_a) && arch_results[i]) { best_time_a = profile_times[i]; best_arch_a = arch_list[i]; @@ -795,11 +880,14 @@ bool run_volk_gnsssdr_tests(volk_gnsssdr_func_desc_t desc, std::cout << "Best aligned arch: " << best_arch_a << std::endl; std::cout << "Best unaligned arch: " << best_arch_u << std::endl; - if(puppet_master_name == "NULL") { - results->back().config_name = name; - } else { - results->back().config_name = puppet_master_name; - } + if (puppet_master_name == "NULL") + { + results->back().config_name = name; + } + else + { + results->back().config_name = puppet_master_name; + } results->back().best_arch_a = best_arch_a; results->back().best_arch_u = best_arch_u; diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/qa_utils.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/qa_utils.h index ad4d7e6b9..b2a66fb58 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/qa_utils.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/qa_utils.h @@ -25,17 +25,18 @@ #include "volk_gnsssdr/volk_gnsssdr_complex.h" // for lv_32fc_t #include "volk_gnsssdr/volk_gnsssdr.h" // for volk_gnsssdr_func_desc_t -#include // for bool, false -#include // for NULL -#include // for map -#include // for string, basic_string -#include // for vector +#include // for bool, false +#include // for NULL +#include // for map +#include // for string, basic_string +#include // for vector /************************************************ * VOLK QA type definitions * ************************************************/ -struct volk_gnsssdr_type_t { +struct volk_gnsssdr_type_t +{ bool is_float; bool is_scalar; bool is_signed; @@ -44,80 +45,78 @@ struct volk_gnsssdr_type_t { std::string str; }; -class volk_gnsssdr_test_time_t { - public: - std::string name; - double time; - std::string units; - bool pass; +class volk_gnsssdr_test_time_t +{ +public: + std::string name; + double time; + std::string units; + bool pass; }; -class volk_gnsssdr_test_results_t { - public: - std::string name; - std::string config_name; - unsigned int vlen; - unsigned int iter; - std::map results; - std::string best_arch_a; - std::string best_arch_u; +class volk_gnsssdr_test_results_t +{ +public: + std::string name; + std::string config_name; + unsigned int vlen; + unsigned int iter; + std::map results; + std::string best_arch_a; + std::string best_arch_u; }; -class volk_gnsssdr_test_params_t { - private: - float _tol; - lv_32fc_t _scalar; - unsigned int _vlen; - unsigned int _iter; - bool _benchmark_mode; - std::string _kernel_regex; - public: - // ctor - volk_gnsssdr_test_params_t(float tol, lv_32fc_t scalar, unsigned int vlen, unsigned int iter, - bool benchmark_mode, std::string kernel_regex) : - _tol(tol), _scalar(scalar), _vlen(vlen), _iter(iter), - _benchmark_mode(benchmark_mode), _kernel_regex(kernel_regex) {}; - // setters - void set_tol(float tol) {_tol=tol;}; - void set_scalar(lv_32fc_t scalar) {_scalar=scalar;}; - void set_vlen(unsigned int vlen) {_vlen=vlen;}; - void set_iter(unsigned int iter) {_iter=iter;}; - void set_benchmark(bool benchmark) {_benchmark_mode=benchmark;}; - void set_regex(std::string regex) {_kernel_regex=regex;}; - // getters - float tol() {return _tol;}; - lv_32fc_t scalar() {return _scalar;}; - unsigned int vlen() {return _vlen;}; - unsigned int iter() {return _iter;}; - bool benchmark_mode() {return _benchmark_mode;}; - std::string kernel_regex() {return _kernel_regex;}; +class volk_gnsssdr_test_params_t +{ +private: + float _tol; + lv_32fc_t _scalar; + unsigned int _vlen; + unsigned int _iter; + bool _benchmark_mode; + std::string _kernel_regex; + +public: + // ctor + volk_gnsssdr_test_params_t(float tol, lv_32fc_t scalar, unsigned int vlen, unsigned int iter, + bool benchmark_mode, std::string kernel_regex) : _tol(tol), _scalar(scalar), _vlen(vlen), _iter(iter), _benchmark_mode(benchmark_mode), _kernel_regex(kernel_regex){}; + // setters + void set_tol(float tol) { _tol = tol; }; + void set_scalar(lv_32fc_t scalar) { _scalar = scalar; }; + void set_vlen(unsigned int vlen) { _vlen = vlen; }; + void set_iter(unsigned int iter) { _iter = iter; }; + void set_benchmark(bool benchmark) { _benchmark_mode = benchmark; }; + void set_regex(std::string regex) { _kernel_regex = regex; }; + // getters + float tol() { return _tol; }; + lv_32fc_t scalar() { return _scalar; }; + unsigned int vlen() { return _vlen; }; + unsigned int iter() { return _iter; }; + bool benchmark_mode() { return _benchmark_mode; }; + std::string kernel_regex() { return _kernel_regex; }; }; -class volk_gnsssdr_test_case_t { - private: - volk_gnsssdr_func_desc_t _desc; - void(*_kernel_ptr)(); - std::string _name; - volk_gnsssdr_test_params_t _test_parameters; - std::string _puppet_master_name; - public: - volk_gnsssdr_func_desc_t desc() {return _desc;}; - void (*kernel_ptr()) () {return _kernel_ptr;}; - std::string name() {return _name;}; - std::string puppet_master_name() {return _puppet_master_name;}; - volk_gnsssdr_test_params_t test_parameters() {return _test_parameters;}; - // normal ctor - volk_gnsssdr_test_case_t(volk_gnsssdr_func_desc_t desc, void(*kernel_ptr)(), std::string name, - volk_gnsssdr_test_params_t test_parameters) : - _desc(desc), _kernel_ptr(kernel_ptr), _name(name), _test_parameters(test_parameters), - _puppet_master_name("NULL") - {}; - // ctor for puppets - volk_gnsssdr_test_case_t(volk_gnsssdr_func_desc_t desc, void(*kernel_ptr)(), std::string name, - std::string puppet_master_name, volk_gnsssdr_test_params_t test_parameters) : - _desc(desc), _kernel_ptr(kernel_ptr), _name(name), _test_parameters(test_parameters), - _puppet_master_name(puppet_master_name) - {}; +class volk_gnsssdr_test_case_t +{ +private: + volk_gnsssdr_func_desc_t _desc; + void (*_kernel_ptr)(); + std::string _name; + volk_gnsssdr_test_params_t _test_parameters; + std::string _puppet_master_name; + +public: + volk_gnsssdr_func_desc_t desc() { return _desc; }; + void (*kernel_ptr())() { return _kernel_ptr; }; + std::string name() { return _name; }; + std::string puppet_master_name() { return _puppet_master_name; }; + volk_gnsssdr_test_params_t test_parameters() { return _test_parameters; }; + // normal ctor + volk_gnsssdr_test_case_t(volk_gnsssdr_func_desc_t desc, void (*kernel_ptr)(), std::string name, + volk_gnsssdr_test_params_t test_parameters) : _desc(desc), _kernel_ptr(kernel_ptr), _name(name), _test_parameters(test_parameters), _puppet_master_name("NULL"){}; + // ctor for puppets + volk_gnsssdr_test_case_t(volk_gnsssdr_func_desc_t desc, void (*kernel_ptr)(), std::string name, + std::string puppet_master_name, volk_gnsssdr_test_params_t test_parameters) : _desc(desc), _kernel_ptr(kernel_ptr), _name(name), _test_parameters(test_parameters), _puppet_master_name(puppet_master_name){}; }; /************************************************ @@ -130,58 +129,57 @@ void random_floats(float *buf, unsigned n); bool run_volk_gnsssdr_tests( volk_gnsssdr_func_desc_t, - void(*)(), + void (*)(), std::string, volk_gnsssdr_test_params_t, std::vector *results = NULL, - std::string puppet_master_name = "NULL" - ); + std::string puppet_master_name = "NULL"); bool run_volk_gnsssdr_tests( - volk_gnsssdr_func_desc_t, - void(*)(), - std::string, - float, - lv_32fc_t, - unsigned int, - unsigned int, - std::vector *results = NULL, - std::string puppet_master_name = "NULL", - bool benchmark_mode = false -); + volk_gnsssdr_func_desc_t, + void (*)(), + std::string, + float, + lv_32fc_t, + unsigned int, + unsigned int, + std::vector *results = NULL, + std::string puppet_master_name = "NULL", + bool benchmark_mode = false); -#define VOLK_RUN_TESTS(func, tol, scalar, len, iter) \ - BOOST_AUTO_TEST_CASE(func##_test) { \ - BOOST_CHECK_EQUAL(run_volk_gnsssdr_tests( \ - func##_get_func_desc(), (void (*)())func##_manual, \ - std::string(#func), tol, scalar, len, iter, 0, "NULL"), \ - 0); \ +#define VOLK_RUN_TESTS(func, tol, scalar, len, iter) \ + BOOST_AUTO_TEST_CASE(func##_test) \ + { \ + BOOST_CHECK_EQUAL(run_volk_gnsssdr_tests( \ + func##_get_func_desc(), (void (*)())func##_manual, \ + std::string(#func), tol, scalar, len, iter, 0, "NULL"), \ + 0); \ } #define VOLK_PROFILE(func, test_params, results) run_volk_gnsssdr_tests(func##_get_func_desc(), (void (*)())func##_manual, std::string(#func), test_params, results, "NULL") #define VOLK_PUPPET_PROFILE(func, puppet_master_func, test_params, results) run_volk_gnsssdr_tests(func##_get_func_desc(), (void (*)())func##_manual, std::string(#func), test_params, results, std::string(#puppet_master_func)) -typedef void (*volk_gnsssdr_fn_1arg)(void *, unsigned int, const char*); //one input, operate in place -typedef void (*volk_gnsssdr_fn_2arg)(void *, void *, unsigned int, const char*); -typedef void (*volk_gnsssdr_fn_3arg)(void *, void *, void *, unsigned int, const char*); -typedef void (*volk_gnsssdr_fn_4arg)(void *, void *, void *, void *, unsigned int, const char*); -typedef void (*volk_gnsssdr_fn_1arg_s32f)(void *, float, unsigned int, const char*); //one input vector, one scalar float input -typedef void (*volk_gnsssdr_fn_2arg_s32f)(void *, void *, float, unsigned int, const char*); -typedef void (*volk_gnsssdr_fn_3arg_s32f)(void *, void *, void *, float, unsigned int, const char*); -typedef void (*volk_gnsssdr_fn_1arg_s32fc)(void *, lv_32fc_t, unsigned int, const char*); //one input vector, one scalar float input -typedef void (*volk_gnsssdr_fn_2arg_s32fc)(void *, void *, lv_32fc_t, unsigned int, const char*); -typedef void (*volk_gnsssdr_fn_3arg_s32fc)(void *, void *, void *, lv_32fc_t, unsigned int, const char*); +typedef void (*volk_gnsssdr_fn_1arg)(void *, unsigned int, const char *); //one input, operate in place +typedef void (*volk_gnsssdr_fn_2arg)(void *, void *, unsigned int, const char *); +typedef void (*volk_gnsssdr_fn_3arg)(void *, void *, void *, unsigned int, const char *); +typedef void (*volk_gnsssdr_fn_4arg)(void *, void *, void *, void *, unsigned int, const char *); +typedef void (*volk_gnsssdr_fn_1arg_s32f)(void *, float, unsigned int, const char *); //one input vector, one scalar float input +typedef void (*volk_gnsssdr_fn_2arg_s32f)(void *, void *, float, unsigned int, const char *); +typedef void (*volk_gnsssdr_fn_3arg_s32f)(void *, void *, void *, float, unsigned int, const char *); +typedef void (*volk_gnsssdr_fn_1arg_s32fc)(void *, lv_32fc_t, unsigned int, const char *); //one input vector, one scalar float input +typedef void (*volk_gnsssdr_fn_2arg_s32fc)(void *, void *, lv_32fc_t, unsigned int, const char *); +typedef void (*volk_gnsssdr_fn_3arg_s32fc)(void *, void *, void *, lv_32fc_t, unsigned int, const char *); //ADDED BY GNSS-SDR. START -typedef void (*volk_gnsssdr_fn_1arg_s8i)(void *, char, unsigned int, const char*); //one input vector, one scalar char input -typedef void (*volk_gnsssdr_fn_2arg_s8i)(void *, void *, char, unsigned int, const char*); -typedef void (*volk_gnsssdr_fn_3arg_s8i)(void *, void *, void *, char, unsigned int, const char*); -typedef void (*volk_gnsssdr_fn_1arg_s8ic)(void *, lv_8sc_t, unsigned int, const char*); //one input vector, one scalar lv_8sc_t vector input -typedef void (*volk_gnsssdr_fn_2arg_s8ic)(void *, void *, lv_8sc_t, unsigned int, const char*); -typedef void (*volk_gnsssdr_fn_3arg_s8ic)(void *, void *, void *, lv_8sc_t, unsigned int, const char*); -typedef void (*volk_gnsssdr_fn_1arg_s16ic)(void *, lv_16sc_t, unsigned int, const char*); //one input vector, one scalar lv_16sc_t vector input -typedef void (*volk_gnsssdr_fn_2arg_s16ic)(void *, void *, lv_16sc_t, unsigned int, const char*); -typedef void (*volk_gnsssdr_fn_3arg_s16ic)(void *, void *, void *, lv_16sc_t, unsigned int, const char*); +typedef void (*volk_gnsssdr_fn_1arg_s8i)(void *, char, unsigned int, const char *); //one input vector, one scalar char input +typedef void (*volk_gnsssdr_fn_2arg_s8i)(void *, void *, char, unsigned int, const char *); +typedef void (*volk_gnsssdr_fn_3arg_s8i)(void *, void *, void *, char, unsigned int, const char *); +typedef void (*volk_gnsssdr_fn_1arg_s8ic)(void *, lv_8sc_t, unsigned int, const char *); //one input vector, one scalar lv_8sc_t vector input +typedef void (*volk_gnsssdr_fn_2arg_s8ic)(void *, void *, lv_8sc_t, unsigned int, const char *); +typedef void (*volk_gnsssdr_fn_3arg_s8ic)(void *, void *, void *, lv_8sc_t, unsigned int, const char *); +typedef void (*volk_gnsssdr_fn_1arg_s16ic)(void *, lv_16sc_t, unsigned int, const char *); //one input vector, one scalar lv_16sc_t vector input +typedef void (*volk_gnsssdr_fn_2arg_s16ic)(void *, void *, lv_16sc_t, unsigned int, const char *); +typedef void (*volk_gnsssdr_fn_3arg_s16ic)(void *, void *, void *, lv_16sc_t, unsigned int, const char *); //ADDED BY GNSS-SDR. END -#endif // GNSS_SDR_VOLK_QA_UTILS_H +#endif // GNSS_SDR_VOLK_QA_UTILS_H diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/testqa.cc b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/testqa.cc index 6e1f0fb61..7e22442da 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/testqa.cc +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/testqa.cc @@ -18,16 +18,16 @@ */ -#include "kernel_tests.h" // for init_test_list -#include "qa_utils.h" // for volk_gnsssdr_test_case_t, volk_gnsssdr_test_results_t +#include "kernel_tests.h" // for init_test_list +#include "qa_utils.h" // for volk_gnsssdr_test_case_t, volk_gnsssdr_test_results_t #include "volk_gnsssdr/volk_gnsssdr_complex.h" // for lv_32fc_t -#include // for bool, false, true -#include // for operator<<, basic_ostream, endl, char... -#include // IWYU pragma: keep -#include // for map, map<>::iterator, _Rb_tree_iterator -#include // for string, operator<< -#include // for pair -#include // for vector +#include // for bool, false, true +#include // for operator<<, basic_ostream, endl, char... +#include // IWYU pragma: keep +#include // for map, map<>::iterator, _Rb_tree_iterator +#include // for string, operator<< +#include // for pair +#include // for vector void print_qa_xml(std::vector results, unsigned int nfails); @@ -49,38 +49,44 @@ int main() std::vector qa_failures; std::vector results; // Test every kernel reporting failures when they occur - for(unsigned int ii = 0; ii < test_cases.size(); ++ii) { - bool qa_result = false; - volk_gnsssdr_test_case_t test_case = test_cases[ii]; - try { - qa_result = run_volk_gnsssdr_tests(test_case.desc(), test_case.kernel_ptr(), test_case.name(), - test_case.test_parameters(), &results, test_case.puppet_master_name()); - } - catch(...) { - // TODO: what exceptions might we need to catch and how do we handle them? - std::cerr << "Exception found on kernel: " << test_case.name() << std::endl; - qa_result = false; - } + for (unsigned int ii = 0; ii < test_cases.size(); ++ii) + { + bool qa_result = false; + volk_gnsssdr_test_case_t test_case = test_cases[ii]; + try + { + qa_result = run_volk_gnsssdr_tests(test_case.desc(), test_case.kernel_ptr(), test_case.name(), + test_case.test_parameters(), &results, test_case.puppet_master_name()); + } + catch (...) + { + // TODO: what exceptions might we need to catch and how do we handle them? + std::cerr << "Exception found on kernel: " << test_case.name() << std::endl; + qa_result = false; + } - if(qa_result) { - std::cerr << "Failure on " << test_case.name() << std::endl; - qa_failures.push_back(test_case.name()); + if (qa_result) + { + std::cerr << "Failure on " << test_case.name() << std::endl; + qa_failures.push_back(test_case.name()); + } } - } // Generate XML results print_qa_xml(results, qa_failures.size()); // Summarize QA results std::cerr << "Kernel QA finished: " << qa_failures.size() << " failures out of " - << test_cases.size() << " tests." << std::endl; - if(qa_failures.size() > 0) { - std::cerr << "The following kernels failed QA:" << std::endl; - for(unsigned int ii = 0; ii < qa_failures.size(); ++ii) { - std::cerr << " " << qa_failures[ii] << std::endl; + << test_cases.size() << " tests." << std::endl; + if (qa_failures.size() > 0) + { + std::cerr << "The following kernels failed QA:" << std::endl; + for (unsigned int ii = 0; ii < qa_failures.size(); ++ii) + { + std::cerr << " " << qa_failures[ii] << std::endl; + } + qa_ret_val = 1; } - qa_ret_val = 1; - } return qa_ret_val; } @@ -95,34 +101,34 @@ void print_qa_xml(std::vector results, unsigned int qa_file.open(".unittest/kernels.xml"); qa_file << "" << std::endl; - qa_file << "" << std::endl; + qa_file << "" << std::endl; // Results are in a vector by kernel. Each element has a result // map containing time and arch name with test result - for(unsigned int ii=0; ii < results.size(); ++ii) { - volk_gnsssdr_test_results_t result = results[ii]; - qa_file << " " << std::endl; + for (unsigned int ii = 0; ii < results.size(); ++ii) + { + volk_gnsssdr_test_results_t result = results[ii]; + qa_file << " " << std::endl; - std::map::iterator kernel_time_pair; - for(kernel_time_pair = result.results.begin(); kernel_time_pair != result.results.end(); ++kernel_time_pair) { - volk_gnsssdr_test_time_t test_time = kernel_time_pair->second; - qa_file << " " << std::endl; - if(!test_time.pass) - qa_file << " " << - "" << std::endl; - qa_file << " " << std::endl; + std::map::iterator kernel_time_pair; + for (kernel_time_pair = result.results.begin(); kernel_time_pair != result.results.end(); ++kernel_time_pair) + { + volk_gnsssdr_test_time_t test_time = kernel_time_pair->second; + qa_file << " " << std::endl; + if (!test_time.pass) + qa_file << " " + << "" << std::endl; + qa_file << " " << std::endl; + } + qa_file << " " << std::endl; } - qa_file << " " << std::endl; - } qa_file << "" << std::endl; qa_file.close(); - } - diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/volk_gnsssdr_malloc.c b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/volk_gnsssdr_malloc.c index 3f1bcdd44..d92325f48 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/volk_gnsssdr_malloc.c +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/volk_gnsssdr_malloc.c @@ -43,15 +43,16 @@ void *volk_gnsssdr_malloc(size_t size, size_t alignment) return malloc(size); int err = posix_memalign(&ptr, alignment, size); - if(err == 0) + if (err == 0) { return ptr; } else { fprintf(stderr, - "VOLK_GNSSSDR: Error allocating memory " - "(posix_memalign: error %d: %s)\n", err, strerror(err)); + "VOLK_GNSSSDR: Error allocating memory " + "(posix_memalign: error %d: %s)\n", + err, strerror(err)); return NULL; } } @@ -68,7 +69,7 @@ void volk_gnsssdr_free(void *ptr) void *volk_gnsssdr_malloc(size_t size, size_t alignment) { void *ptr = _aligned_malloc(size, alignment); - if(ptr == NULL) + if (ptr == NULL) { fprintf(stderr, "VOLK_GNSSSDR: Error allocating memory (_aligned_malloc)\n"); } @@ -81,7 +82,7 @@ void volk_gnsssdr_free(void *ptr) } // No standard handlers; we'll do it ourselves. -#else // _POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600 || HAVE_POSIX_MEMALIGN +#else // _POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600 || HAVE_POSIX_MEMALIGN struct block_info { @@ -102,7 +103,7 @@ volk_gnsssdr_malloc(size_t size, size_t alignment) real = malloc(size + (2 * alignment - 1)); /* Get pointer to the various zones */ - user = (void *)((((uintptr_t) real) + sizeof(struct block_info) + alignment - 1) & ~(alignment - 1)); + user = (void *)((((uintptr_t)real) + sizeof(struct block_info) + alignment - 1) & ~(alignment - 1)); info = (struct block_info *)(((uintptr_t)user) - sizeof(struct block_info)); /* Store the info for the free */ @@ -112,8 +113,7 @@ volk_gnsssdr_malloc(size_t size, size_t alignment) return user; } -void -volk_gnsssdr_free(void *ptr) +void volk_gnsssdr_free(void *ptr) { struct block_info *info; @@ -124,6 +124,6 @@ volk_gnsssdr_free(void *ptr) free(info->real); } -#endif // _POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600 || HAVE_POSIX_MEMALIGN +#endif // _POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600 || HAVE_POSIX_MEMALIGN //#endif // _ISOC11_SOURCE diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/volk_gnsssdr_prefs.c b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/volk_gnsssdr_prefs.c index b77aed467..b9a55a284 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/volk_gnsssdr_prefs.c +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/volk_gnsssdr_prefs.c @@ -26,16 +26,17 @@ void volk_gnsssdr_get_config_path(char *path) { if (!path) return; const char *suffix = "/.volk_gnsssdr/volk_gnsssdr_config"; - const char *suffix2 = "/volk_gnsssdr/volk_gnsssdr_config"; //non-hidden + const char *suffix2 = "/volk_gnsssdr/volk_gnsssdr_config"; // non-hidden char *home = NULL; //allows config redirection via env variable home = getenv("VOLK_CONFIGPATH"); - if(home!=NULL){ - strncpy(path,home,512); - strcat(path,suffix2); - return; - } + if (home != NULL) + { + strncpy(path, home, 512); + strcat(path, suffix2); + return; + } if (home == NULL) home = getenv("HOME"); if (home == NULL) home = getenv("APPDATA"); @@ -57,16 +58,16 @@ size_t volk_gnsssdr_load_preferences(volk_gnsssdr_arch_pref_t **prefs_res) //get the config path volk_gnsssdr_get_config_path(path); - if (!path[0]) return n_arch_prefs; //no prefs found + if (!path[0]) return n_arch_prefs; //no prefs found config_file = fopen(path, "r"); - if(!config_file) return n_arch_prefs; //no prefs found + if (!config_file) return n_arch_prefs; //no prefs found //reset the file pointer and write the prefs into volk_gnsssdr_arch_prefs - while(fgets(line, sizeof(line), config_file) != NULL) + while (fgets(line, sizeof(line), config_file) != NULL) { - prefs = (volk_gnsssdr_arch_pref_t *) realloc(prefs, (n_arch_prefs+1) * sizeof(*prefs)); + prefs = (volk_gnsssdr_arch_pref_t *)realloc(prefs, (n_arch_prefs + 1) * sizeof(*prefs)); volk_gnsssdr_arch_pref_t *p = prefs + n_arch_prefs; - if(sscanf(line, "%s %s %s", p->name, p->impl_a, p->impl_u) == 3 && !strncmp(p->name, "volk_gnsssdr_", 5)) + if (sscanf(line, "%s %s %s", p->name, p->impl_a, p->impl_u) == 3 && !strncmp(p->name, "volk_gnsssdr_", 5)) { n_arch_prefs++; } diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/volk_gnsssdr_rank_archs.c b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/volk_gnsssdr_rank_archs.c index d1871426d..96fa4e77e 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/volk_gnsssdr_rank_archs.c +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/volk_gnsssdr_rank_archs.c @@ -29,7 +29,7 @@ inline unsigned __popcnt(unsigned num) { unsigned pop = 0; - while(num) + while (num) { if (num & 0x1) pop++; num >>= 1; @@ -39,15 +39,15 @@ inline unsigned __popcnt(unsigned num) #endif int volk_gnsssdr_get_index( - const char *impl_names[], //list of implementations by name - const size_t n_impls, //number of implementations available - const char *impl_name //the implementation name to find - ) + const char *impl_names[], //list of implementations by name + const size_t n_impls, //number of implementations available + const char *impl_name //the implementation name to find +) { unsigned int i; for (i = 0; i < n_impls; i++) { - if(!strncmp(impl_names[i], impl_name, 20)) + if (!strncmp(impl_names[i], impl_name, 20)) { return i; } @@ -55,24 +55,24 @@ int volk_gnsssdr_get_index( //TODO return -1; //something terrible should happen here fprintf(stderr, "VOLK_GNSSSDR warning: no arch found, returning generic impl\n"); - return volk_gnsssdr_get_index(impl_names, n_impls, "generic"); //but we'll fake it for now + return volk_gnsssdr_get_index(impl_names, n_impls, "generic"); //but we'll fake it for now } int volk_gnsssdr_rank_archs( - const char *kern_name, //name of the kernel to rank - const char *impl_names[], //list of implementations by name - const int* impl_deps, //requirement mask per implementation - const bool* alignment, //alignment status of each implementation - size_t n_impls, //number of implementations available - const bool align //if false, filter aligned implementations + const char *kern_name, //name of the kernel to rank + const char *impl_names[], //list of implementations by name + const int *impl_deps, //requirement mask per implementation + const bool *alignment, //alignment status of each implementation + size_t n_impls, //number of implementations available + const bool align //if false, filter aligned implementations ) { size_t i; static volk_gnsssdr_arch_pref_t *volk_gnsssdr_arch_prefs; static size_t n_arch_prefs = 0; static int prefs_loaded = 0; - if(!prefs_loaded) + if (!prefs_loaded) { n_arch_prefs = volk_gnsssdr_load_preferences(&volk_gnsssdr_arch_prefs); prefs_loaded = 1; @@ -81,17 +81,17 @@ int volk_gnsssdr_rank_archs( // If we've defined VOLK_GENERIC to be anything, always return the // 'generic' kernel. Used in GR's QA code. char *gen_env = getenv("VOLK_GENERIC"); - if(gen_env) + if (gen_env) { return volk_gnsssdr_get_index(impl_names, n_impls, "generic"); } //now look for the function name in the prefs list - for(i = 0; i < n_arch_prefs; i++) + for (i = 0; i < n_arch_prefs; i++) { - if(!strncmp(kern_name, volk_gnsssdr_arch_prefs[i].name, sizeof(volk_gnsssdr_arch_prefs[i].name))) //found it + if (!strncmp(kern_name, volk_gnsssdr_arch_prefs[i].name, sizeof(volk_gnsssdr_arch_prefs[i].name))) //found it { - const char *impl_name = align? volk_gnsssdr_arch_prefs[i].impl_a : volk_gnsssdr_arch_prefs[i].impl_u; + const char *impl_name = align ? volk_gnsssdr_arch_prefs[i].impl_a : volk_gnsssdr_arch_prefs[i].impl_u; return volk_gnsssdr_get_index(impl_names, n_impls, impl_name); } } @@ -101,7 +101,7 @@ int volk_gnsssdr_rank_archs( size_t best_index_u = 0; int best_value_a = -1; int best_value_u = -1; - for(i = 0; i < n_impls; i++) + for (i = 0; i < n_impls; i++) { const signed val = __popcnt(impl_deps[i]); if (alignment[i] && val > best_value_a) diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/volk_gnsssdr_rank_archs.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/volk_gnsssdr_rank_archs.h index 312fb9f47..ba0638a54 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/volk_gnsssdr_rank_archs.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/volk_gnsssdr_rank_archs.h @@ -23,23 +23,24 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -int volk_gnsssdr_get_index( - const char *impl_names[], //list of implementations by name - const size_t n_impls, //number of implementations available - const char *impl_name //the implementation name to find -); + int volk_gnsssdr_get_index( + const char *impl_names[], //list of implementations by name + const size_t n_impls, //number of implementations available + const char *impl_name //the implementation name to find + ); -int volk_gnsssdr_rank_archs( - const char *kern_name, //name of the kernel to rank - const char *impl_names[], //list of implementations by name - const int* impl_deps, //requirement mask per implementation - const bool* alignment, //alignment status of each implementation - size_t n_impls, //number of implementations available - const bool align //if false, filter aligned implementations -); + int volk_gnsssdr_rank_archs( + const char *kern_name, //name of the kernel to rank + const char *impl_names[], //list of implementations by name + const int *impl_deps, //requirement mask per implementation + const bool *alignment, //alignment status of each implementation + size_t n_impls, //number of implementations available + const bool align //if false, filter aligned implementations + ); #ifdef __cplusplus } diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr.tmpl.c b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr.tmpl.c index 95f5f057c..bee754747 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr.tmpl.c +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr.tmpl.c @@ -31,85 +31,97 @@ static intptr_t __alignment_mask = 0; struct volk_gnsssdr_machine *get_machine(void) { - extern struct volk_gnsssdr_machine *volk_gnsssdr_machines[]; - extern unsigned int n_volk_gnsssdr_machines; - static struct volk_gnsssdr_machine *machine = NULL; + extern struct volk_gnsssdr_machine *volk_gnsssdr_machines[]; + extern unsigned int n_volk_gnsssdr_machines; + static struct volk_gnsssdr_machine *machine = NULL; - if(machine != NULL) - return machine; - else { - unsigned int max_score = 0; - unsigned int i; - struct volk_gnsssdr_machine *max_machine = NULL; - for(i=0; icaps & (~volk_gnsssdr_get_lvarch()))) { - if(volk_gnsssdr_machines[i]->caps > max_score) { - max_score = volk_gnsssdr_machines[i]->caps; - max_machine = volk_gnsssdr_machines[i]; + if (machine != NULL) + return machine; + else + { + unsigned int max_score = 0; + unsigned int i; + struct volk_gnsssdr_machine *max_machine = NULL; + for (i = 0; i < n_volk_gnsssdr_machines; i++) + { + if (!(volk_gnsssdr_machines[i]->caps & (~volk_gnsssdr_get_lvarch()))) + { + if (volk_gnsssdr_machines[i]->caps > max_score) + { + max_score = volk_gnsssdr_machines[i]->caps; + max_machine = volk_gnsssdr_machines[i]; + } + } + } + machine = max_machine; + //printf("Using Volk machine: %s\n", machine->name); + __alignment = machine->alignment; + __alignment_mask = (intptr_t)(__alignment - 1); + return machine; } - } - } - machine = max_machine; - //printf("Using Volk machine: %s\n", machine->name); - __alignment = machine->alignment; - __alignment_mask = (intptr_t)(__alignment-1); - return machine; - } } void volk_gnsssdr_list_machines(void) { - extern struct volk_gnsssdr_machine *volk_gnsssdr_machines[]; - extern unsigned int n_volk_gnsssdr_machines; + extern struct volk_gnsssdr_machine *volk_gnsssdr_machines[]; + extern unsigned int n_volk_gnsssdr_machines; - unsigned int i; - for(i=0; icaps & (~volk_gnsssdr_get_lvarch()))) { - printf("%s;", volk_gnsssdr_machines[i]->name); - } - } - printf("\n"); + unsigned int i; + for (i = 0; i < n_volk_gnsssdr_machines; i++) + { + if (!(volk_gnsssdr_machines[i]->caps & (~volk_gnsssdr_get_lvarch()))) + { + printf("%s;", volk_gnsssdr_machines[i]->name); + } + } + printf("\n"); } -const char* volk_gnsssdr_get_machine(void) +const char *volk_gnsssdr_get_machine(void) { - extern struct volk_gnsssdr_machine *volk_gnsssdr_machines[]; - extern unsigned int n_volk_gnsssdr_machines; - static struct volk_gnsssdr_machine *machine = NULL; + extern struct volk_gnsssdr_machine *volk_gnsssdr_machines[]; + extern unsigned int n_volk_gnsssdr_machines; + static struct volk_gnsssdr_machine *machine = NULL; - if(machine != NULL) - return machine->name; - else { - unsigned int max_score = 0; - unsigned int i; - struct volk_gnsssdr_machine *max_machine = NULL; - for(i=0; icaps & (~volk_gnsssdr_get_lvarch()))) { - if(volk_gnsssdr_machines[i]->caps > max_score) { - max_score = volk_gnsssdr_machines[i]->caps; - max_machine = volk_gnsssdr_machines[i]; + if (machine != NULL) + return machine->name; + else + { + unsigned int max_score = 0; + unsigned int i; + struct volk_gnsssdr_machine *max_machine = NULL; + for (i = 0; i < n_volk_gnsssdr_machines; i++) + { + if (!(volk_gnsssdr_machines[i]->caps & (~volk_gnsssdr_get_lvarch()))) + { + if (volk_gnsssdr_machines[i]->caps > max_score) + { + max_score = volk_gnsssdr_machines[i]->caps; + max_machine = volk_gnsssdr_machines[i]; + } + } + } + machine = max_machine; + return machine->name; } - } - } - machine = max_machine; - return machine->name; - } } size_t volk_gnsssdr_get_alignment(void) { - get_machine(); //ensures alignment is set + get_machine(); //ensures alignment is set return __alignment; } bool volk_gnsssdr_is_aligned(const void *ptr) { - return ((intptr_t)(ptr) & __alignment_mask) == 0; + return ((intptr_t)(ptr)&__alignment_mask) == 0; } #define LV_HAVE_GENERIC #define LV_HAVE_DISPATCHER +// clang-format off + %for kern in kernels: %if kern.has_dispatcher: @@ -190,6 +202,8 @@ void ${kern.name}_manual(${kern.arglist_full}, const char* impl_name) ); } + + volk_gnsssdr_func_desc_t ${kern.name}_get_func_desc(void) { const char **impl_names = get_machine()->${kern.name}_impl_names; const int *impl_deps = get_machine()->${kern.name}_impl_deps; @@ -205,3 +219,5 @@ volk_gnsssdr_func_desc_t ${kern.name}_get_func_desc(void) { } %endfor + + // clang-format on diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr.tmpl.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr.tmpl.h index 556d67f8e..4164a29dd 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr.tmpl.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr.tmpl.h @@ -42,7 +42,7 @@ typedef struct volk_gnsssdr_func_desc VOLK_API void volk_gnsssdr_list_machines(void); //! Returns the name of the machine this instance will use -VOLK_API const char* volk_gnsssdr_get_machine(void); +VOLK_API const char *volk_gnsssdr_get_machine(void); //! Get the machine alignment in bytes VOLK_API size_t volk_gnsssdr_get_alignment(void); @@ -73,6 +73,7 @@ VOLK_API bool volk_gnsssdr_is_aligned(const void *ptr); //! A function pointer to the dispatcher implementation extern VOLK_API ${kern.pname} ${kern.name}; +// clang-format off //! A function pointer to the fastest aligned implementation extern VOLK_API ${kern.pname} ${kern.name}_a; @@ -85,6 +86,7 @@ extern VOLK_API void ${kern.name}_manual(${kern.arglist_full}, const char* impl_ //! Get description parameters for this kernel extern VOLK_API volk_gnsssdr_func_desc_t ${kern.name}_get_func_desc(void); %endfor +// clang-format off __VOLK_DECL_END diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr_config_fixed.tmpl.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr_config_fixed.tmpl.h index ed55d0b58..4159bdef7 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr_config_fixed.tmpl.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr_config_fixed.tmpl.h @@ -19,10 +19,11 @@ #ifndef INCLUDED_VOLK_GNSSSDR_CONFIG_FIXED_H #define INCLUDED_VOLK_GNSSSDR_CONFIG_FIXED_H +// clang-format off %for i, arch in enumerate(archs): //#ifndef LV_${arch.name.upper()} #define LV_${arch.name.upper()} ${i} //#endif %endfor - +// clang-format on #endif /*INCLUDED_VOLK_GNSSSDR_CONFIG_FIXED*/ diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr_cpu.tmpl.c b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr_cpu.tmpl.c index 1d094a87a..f04f2d9ff 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr_cpu.tmpl.c +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr_cpu.tmpl.c @@ -24,50 +24,54 @@ struct VOLK_CPU volk_gnsssdr_cpu; #if defined(__i386__) || defined(__x86_64__) || defined(_M_IX86) || defined(_M_X64) - #define VOLK_CPU_x86 +#define VOLK_CPU_x86 #endif #if defined(VOLK_CPU_x86) //implement get cpuid for gcc compilers using a system or local copy of cpuid.h #if defined(__GNUC__) - #include - #define cpuid_x86(op, r) __get_cpuid(op, (unsigned int *)r+0, (unsigned int *)r+1, (unsigned int *)r+2, (unsigned int *)r+3) - #define cpuid_x86_count(op, count, regs) __cpuid_count(op, count, *((unsigned int*)regs), *((unsigned int*)regs+1), *((unsigned int*)regs+2), *((unsigned int*)regs+3)) +#include +#define cpuid_x86(op, r) __get_cpuid(op, (unsigned int *)r + 0, (unsigned int *)r + 1, (unsigned int *)r + 2, (unsigned int *)r + 3) +#define cpuid_x86_count(op, count, regs) __cpuid_count(op, count, *((unsigned int *)regs), *((unsigned int *)regs + 1), *((unsigned int *)regs + 2), *((unsigned int *)regs + 3)) - /* Return Intel AVX extended CPU capabilities register. +/* Return Intel AVX extended CPU capabilities register. * This function will bomb on non-AVX-capable machines, so * check for AVX capability before executing. */ - #if ((__GNUC__ > 4 || __GNUC__ == 4 && __GNUC_MINOR__ >= 2) || (__clang_major__ >= 3)) && defined(HAVE_XGETBV) - static inline unsigned long long _xgetbv(unsigned int index){ - unsigned int eax, edx; - __VOLK_ASM __VOLK_VOLATILE ("xgetbv" : "=a"(eax), "=d"(edx) : "c"(index)); - return ((unsigned long long)edx << 32) | eax; - } - #define __xgetbv() _xgetbv(0) - #else - #define __xgetbv() 0 - #endif +#if ((__GNUC__ > 4 || __GNUC__ == 4 && __GNUC_MINOR__ >= 2) || (__clang_major__ >= 3)) && defined(HAVE_XGETBV) +static inline unsigned long long _xgetbv(unsigned int index) +{ + unsigned int eax, edx; + __VOLK_ASM __VOLK_VOLATILE("xgetbv" + : "=a"(eax), "=d"(edx) + : "c"(index)); + return ((unsigned long long)edx << 32) | eax; +} +#define __xgetbv() _xgetbv(0) +#else +#define __xgetbv() 0 +#endif //implement get cpuid for MSVC compilers using __cpuid intrinsic #elif defined(_MSC_VER) && defined(HAVE_INTRIN_H) - #include - #define cpuid_x86(op, r) __cpuid(((int*)r), op) +#include +#define cpuid_x86(op, r) __cpuid(((int *)r), op) - #if defined(_XCR_XFEATURE_ENABLED_MASK) - #define __xgetbv() _xgetbv(_XCR_XFEATURE_ENABLED_MASK) - #else - #define __xgetbv() 0 - #endif +#if defined(_XCR_XFEATURE_ENABLED_MASK) +#define __xgetbv() _xgetbv(_XCR_XFEATURE_ENABLED_MASK) +#else +#define __xgetbv() 0 +#endif #else - #error "A get cpuid for volk_gnsssdr is not available on this compiler..." -#endif //defined(__GNUC__) +#error "A get cpuid for volk_gnsssdr is not available on this compiler..." +#endif //defined(__GNUC__) -#endif //defined(VOLK_CPU_x86) +#endif //defined(VOLK_CPU_x86) -static inline unsigned int cpuid_count_x86_bit(unsigned int level, unsigned int count, unsigned int reg, unsigned int bit) { +static inline unsigned int cpuid_count_x86_bit(unsigned int level, unsigned int count, unsigned int reg, unsigned int bit) +{ #if defined(VOLK_CPU_x86) unsigned int regs[4] = {0}; cpuid_x86_count(level, count, regs); @@ -77,10 +81,11 @@ static inline unsigned int cpuid_count_x86_bit(unsigned int level, unsigned int #endif } -static inline unsigned int cpuid_x86_bit(unsigned int reg, unsigned int op, unsigned int bit) { +static inline unsigned int cpuid_x86_bit(unsigned int reg, unsigned int op, unsigned int bit) +{ #if defined(VOLK_CPU_x86) unsigned int regs[4]; - memset(regs, 0, sizeof(unsigned int)*4); + memset(regs, 0, sizeof(unsigned int) * 4); cpuid_x86(op, regs); return regs[reg] >> bit & 0x01; #else @@ -88,10 +93,11 @@ static inline unsigned int cpuid_x86_bit(unsigned int reg, unsigned int op, unsi #endif } -static inline unsigned int check_extended_cpuid(unsigned int val) { +static inline unsigned int check_extended_cpuid(unsigned int val) +{ #if defined(VOLK_CPU_x86) unsigned int regs[4]; - memset(regs, 0, sizeof(unsigned int)*4); + memset(regs, 0, sizeof(unsigned int) * 4); cpuid_x86(0x80000000, regs); return regs[0] >= val; #else @@ -99,7 +105,8 @@ static inline unsigned int check_extended_cpuid(unsigned int val) { #endif } -static inline unsigned int get_avx_enabled(void) { +static inline unsigned int get_avx_enabled(void) +{ #if defined(VOLK_CPU_x86) return __xgetbv() & 0x6; #else @@ -107,7 +114,8 @@ static inline unsigned int get_avx_enabled(void) { #endif } -static inline unsigned int get_avx2_enabled(void) { +static inline unsigned int get_avx2_enabled(void) +{ #if defined(VOLK_CPU_x86) return __xgetbv() & 0x6; #else @@ -117,28 +125,30 @@ static inline unsigned int get_avx2_enabled(void) { //neon detection is linux specific #if defined(__arm__) && defined(__linux__) - #include - #include - #include - #define VOLK_CPU_ARM +#include +#include +#include +#define VOLK_CPU_ARM #endif -static int has_neon(void){ +static int has_neon(void) +{ #if defined(VOLK_CPU_ARM) FILE *auxvec_f; unsigned long auxvec[2]; unsigned int found_neon = 0; auxvec_f = fopen("/proc/self/auxv", "rb"); - if(!auxvec_f) return 0; + if (!auxvec_f) return 0; size_t r = 1; //so auxv is basically 32b of ID and 32b of value //so it goes like this - while(!found_neon && r) { - r = fread(auxvec, sizeof(unsigned long), 2, auxvec_f); - if((auxvec[0] == AT_HWCAP) && (auxvec[1] & HWCAP_NEON)) - found_neon = 1; - } + while (!found_neon && r) + { + r = fread(auxvec, sizeof(unsigned long), 2, auxvec_f); + if ((auxvec[0] == AT_HWCAP) && (auxvec[1] & HWCAP_NEON)) + found_neon = 1; + } fclose(auxvec_f); return found_neon; @@ -146,6 +156,7 @@ static int has_neon(void){ return 0; #endif } +// clang-format off %for arch in archs: static int i_can_has_${arch.name} (void) { @@ -195,3 +206,4 @@ unsigned int volk_gnsssdr_get_lvarch() { %endfor return retval; } +// clang-format on diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr_cpu.tmpl.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr_cpu.tmpl.h index 20dbac2cc..2122944fc 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr_cpu.tmpl.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr_cpu.tmpl.h @@ -23,16 +23,18 @@ __VOLK_DECL_BEGIN +// clang-format off struct VOLK_CPU { %for arch in archs: int (*has_${arch.name}) (); %endfor }; +// clang-format on extern struct VOLK_CPU volk_gnsssdr_cpu; -void volk_gnsssdr_cpu_init (); -unsigned int volk_gnsssdr_get_lvarch (); +void volk_gnsssdr_cpu_init(); +unsigned int volk_gnsssdr_get_lvarch(); __VOLK_DECL_END diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr_machine_xxx.tmpl.c b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr_machine_xxx.tmpl.c index c6182cb50..8492adb4d 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr_machine_xxx.tmpl.c +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr_machine_xxx.tmpl.c @@ -16,6 +16,8 @@ * along with GNSS-SDR. If not, see . */ +// clang-format off + <% this_machine = machine_dict[args[0]] %> <% arch_names = this_machine.arch_names %> @@ -31,6 +33,7 @@ #include "config.h" #endif + %for kern in kernels: #include %endfor @@ -56,3 +59,4 @@ struct volk_gnsssdr_machine volk_gnsssdr_machine_${this_machine.name} = { <% len_impls = len(impls) %> ${len_impls}, %endfor }; +// clang-format on diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr_machines.tmpl.c b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr_machines.tmpl.c index 1485a34e0..c89eb251c 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr_machines.tmpl.c +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr_machines.tmpl.c @@ -20,6 +20,7 @@ #include #include "volk_gnsssdr_machines.h" +// clang-format off struct volk_gnsssdr_machine *volk_gnsssdr_machines[] = { %for machine in machines: #ifdef LV_MACHINE_${machine.name.upper()} @@ -27,5 +28,5 @@ struct volk_gnsssdr_machine *volk_gnsssdr_machines[] = { #endif %endfor }; - -unsigned int n_volk_gnsssdr_machines = sizeof(volk_gnsssdr_machines)/sizeof(*volk_gnsssdr_machines); +// clang-format on +unsigned int n_volk_gnsssdr_machines = sizeof(volk_gnsssdr_machines) / sizeof(*volk_gnsssdr_machines); diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr_machines.tmpl.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr_machines.tmpl.h index 10e955e25..9a7e78cef 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr_machines.tmpl.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr_machines.tmpl.h @@ -27,6 +27,7 @@ __VOLK_DECL_BEGIN +// clang-format off struct volk_gnsssdr_machine { const unsigned int caps; //capabilities (i.e., archs compiled into this machine, in the volk_gnsssdr_get_lvarch format) const char *name; @@ -48,5 +49,6 @@ extern struct volk_gnsssdr_machine volk_gnsssdr_machine_${machine.name}; %endfor __VOLK_DECL_END +// clang-format on -#endif //INCLUDED_LIBVOLK_GNSSSDR_MACHINES_H +#endif //INCLUDED_LIBVOLK_GNSSSDR_MACHINES_H diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr_typedefs.tmpl.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr_typedefs.tmpl.h index def7e24c3..80fc36436 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr_typedefs.tmpl.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr_typedefs.tmpl.h @@ -22,8 +22,10 @@ #include #include +// clang-format off %for kern in kernels: typedef void (*${kern.pname})(${kern.arglist_types}); %endfor +// clang-format on #endif /*INCLUDED_VOLK_GNSSSDR_TYPEDEFS*/ diff --git a/src/algorithms/observables/adapters/hybrid_observables.cc b/src/algorithms/observables/adapters/hybrid_observables.cc index 62b7c37ae..0bed0b89b 100644 --- a/src/algorithms/observables/adapters/hybrid_observables.cc +++ b/src/algorithms/observables/adapters/hybrid_observables.cc @@ -40,12 +40,11 @@ using google::LogMessage; HybridObservables::HybridObservables(ConfigurationInterface* configuration, - std::string role, - unsigned int in_streams, - unsigned int out_streams) : - role_(role), - in_streams_(in_streams), - out_streams_(out_streams) + std::string role, + unsigned int in_streams, + unsigned int out_streams) : role_(role), + in_streams_(in_streams), + out_streams_(out_streams) { std::string default_dump_filename = "./observables.dat"; DLOG(INFO) << "role " << role; @@ -66,40 +65,34 @@ HybridObservables::HybridObservables(ConfigurationInterface* configuration, } - - -HybridObservables::~HybridObservables() -{} - - +HybridObservables::~HybridObservables() {} void HybridObservables::connect(gr::top_block_sptr top_block) { - if(top_block) { /* top_block is not null */}; + if (top_block) + { /* top_block is not null */ + }; // Nothing to connect internally DLOG(INFO) << "nothing to connect internally"; } - void HybridObservables::disconnect(gr::top_block_sptr top_block) { - if(top_block) { /* top_block is not null */}; + if (top_block) + { /* top_block is not null */ + }; // Nothing to disconnect } - - gr::basic_block_sptr HybridObservables::get_left_block() { return observables_; } - - gr::basic_block_sptr HybridObservables::get_right_block() { return observables_; diff --git a/src/algorithms/observables/adapters/hybrid_observables.h b/src/algorithms/observables/adapters/hybrid_observables.h index 567c7b5ba..8751811fd 100644 --- a/src/algorithms/observables/adapters/hybrid_observables.h +++ b/src/algorithms/observables/adapters/hybrid_observables.h @@ -47,9 +47,9 @@ class HybridObservables : public ObservablesInterface { public: HybridObservables(ConfigurationInterface* configuration, - std::string role, - unsigned int in_streams, - unsigned int out_streams); + std::string role, + unsigned int in_streams, + unsigned int out_streams); virtual ~HybridObservables(); diff --git a/src/algorithms/observables/gnuradio_blocks/hybrid_observables_cc.cc b/src/algorithms/observables/gnuradio_blocks/hybrid_observables_cc.cc index 658b25bbf..60273fcbd 100644 --- a/src/algorithms/observables/gnuradio_blocks/hybrid_observables_cc.cc +++ b/src/algorithms/observables/gnuradio_blocks/hybrid_observables_cc.cc @@ -54,9 +54,8 @@ hybrid_observables_cc_sptr hybrid_make_observables_cc(unsigned int nchannels, bo } -hybrid_observables_cc::hybrid_observables_cc(unsigned int nchannels, bool dump, std::string dump_filename, unsigned int deep_history) : - gr::block("hybrid_observables_cc", gr::io_signature::make(nchannels, nchannels, sizeof(Gnss_Synchro)), - gr::io_signature::make(nchannels, nchannels, sizeof(Gnss_Synchro))) +hybrid_observables_cc::hybrid_observables_cc(unsigned int nchannels, bool dump, std::string dump_filename, unsigned int deep_history) : gr::block("hybrid_observables_cc", gr::io_signature::make(nchannels, nchannels, sizeof(Gnss_Synchro)), + gr::io_signature::make(nchannels, nchannels, sizeof(Gnss_Synchro))) { // initialize internal vars d_dump = dump; @@ -64,7 +63,7 @@ hybrid_observables_cc::hybrid_observables_cc(unsigned int nchannels, bool dump, d_dump_filename = dump_filename; history_deep = deep_history; T_rx_s = 0.0; - T_rx_step_s = 1e-3; // todo: move to gnss-sdr config + T_rx_step_s = 1e-3; // todo: move to gnss-sdr config for (unsigned int i = 0; i < d_nchannels; i++) { d_gnss_synchro_history_queue.push_back(std::deque()); @@ -76,15 +75,15 @@ hybrid_observables_cc::hybrid_observables_cc(unsigned int nchannels, bool dump, if (d_dump_file.is_open() == false) { try - { - d_dump_file.exceptions (std::ifstream::failbit | std::ifstream::badbit ); + { + d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); LOG(INFO) << "Observables dump enabled Log file: " << d_dump_filename.c_str(); - } - catch (const std::ifstream::failure & e) - { + } + catch (const std::ifstream::failure &e) + { LOG(WARNING) << "Exception opening observables dump file " << e.what(); - } + } } } } @@ -95,15 +94,15 @@ hybrid_observables_cc::~hybrid_observables_cc() if (d_dump_file.is_open() == true) { try - { + { d_dump_file.close(); - } - catch(const std::exception & ex) - { + } + catch (const std::exception &ex) + { LOG(WARNING) << "Exception in destructor closing the dump file " << ex.what(); - } + } } - if(d_dump == true) + if (d_dump == true) { std::cout << "Writing observables .mat files ..."; hybrid_observables_cc::save_matfile(); @@ -121,14 +120,14 @@ int hybrid_observables_cc::save_matfile() std::ifstream dump_file; dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); try - { + { dump_file.open(d_dump_filename.c_str(), std::ios::binary | std::ios::ate); - } - catch(const std::ifstream::failure &e) - { - std::cerr << "Problem opening dump file:" << e.what() << std::endl; + } + catch (const std::ifstream::failure &e) + { + std::cerr << "Problem opening dump file:" << e.what() << std::endl; return 1; - } + } // count number of epochs and rewind long int num_epoch = 0; if (dump_file.is_open()) @@ -141,17 +140,17 @@ int hybrid_observables_cc::save_matfile() { return 1; } - double ** RX_time = new double * [d_nchannels]; - double ** TOW_at_current_symbol_s = new double * [d_nchannels]; - double ** Carrier_Doppler_hz = new double * [d_nchannels]; - double ** Carrier_phase_cycles = new double * [d_nchannels]; - double ** Pseudorange_m = new double * [d_nchannels]; - double ** PRN = new double * [d_nchannels]; - double ** Flag_valid_pseudorange = new double * [d_nchannels]; + double **RX_time = new double *[d_nchannels]; + double **TOW_at_current_symbol_s = new double *[d_nchannels]; + double **Carrier_Doppler_hz = new double *[d_nchannels]; + double **Carrier_phase_cycles = new double *[d_nchannels]; + double **Pseudorange_m = new double *[d_nchannels]; + double **PRN = new double *[d_nchannels]; + double **Flag_valid_pseudorange = new double *[d_nchannels]; - for(unsigned int i = 0; i < d_nchannels; i++) + for (unsigned int i = 0; i < d_nchannels; i++) { - RX_time[i] = new double [num_epoch]; + RX_time[i] = new double[num_epoch]; TOW_at_current_symbol_s[i] = new double[num_epoch]; Carrier_Doppler_hz[i] = new double[num_epoch]; Carrier_phase_cycles[i] = new double[num_epoch]; @@ -161,12 +160,12 @@ int hybrid_observables_cc::save_matfile() } try - { + { if (dump_file.is_open()) { - for(long int i = 0; i < num_epoch; i++) + for (long int i = 0; i < num_epoch; i++) { - for(unsigned int chan = 0; chan < d_nchannels; chan++) + for (unsigned int chan = 0; chan < d_nchannels; chan++) { dump_file.read(reinterpret_cast(&RX_time[chan][i]), sizeof(double)); dump_file.read(reinterpret_cast(&TOW_at_current_symbol_s[chan][i]), sizeof(double)); @@ -179,11 +178,11 @@ int hybrid_observables_cc::save_matfile() } } dump_file.close(); - } + } catch (const std::ifstream::failure &e) - { - std::cerr << "Problem reading dump file:" << e.what() << std::endl; - for(unsigned int i = 0; i < d_nchannels; i++) + { + std::cerr << "Problem reading dump file:" << e.what() << std::endl; + for (unsigned int i = 0; i < d_nchannels; i++) { delete[] RX_time[i]; delete[] TOW_at_current_symbol_s[i]; @@ -202,19 +201,19 @@ int hybrid_observables_cc::save_matfile() delete[] Flag_valid_pseudorange; return 1; - } + } - double * RX_time_aux = new double [d_nchannels * num_epoch]; - double * TOW_at_current_symbol_s_aux = new double [d_nchannels * num_epoch]; - double * Carrier_Doppler_hz_aux = new double [d_nchannels * num_epoch]; - double * Carrier_phase_cycles_aux = new double [d_nchannels * num_epoch]; - double * Pseudorange_m_aux = new double [d_nchannels * num_epoch]; - double * PRN_aux = new double [d_nchannels * num_epoch]; - double * Flag_valid_pseudorange_aux = new double[d_nchannels * num_epoch]; + double *RX_time_aux = new double[d_nchannels * num_epoch]; + double *TOW_at_current_symbol_s_aux = new double[d_nchannels * num_epoch]; + double *Carrier_Doppler_hz_aux = new double[d_nchannels * num_epoch]; + double *Carrier_phase_cycles_aux = new double[d_nchannels * num_epoch]; + double *Pseudorange_m_aux = new double[d_nchannels * num_epoch]; + double *PRN_aux = new double[d_nchannels * num_epoch]; + double *Flag_valid_pseudorange_aux = new double[d_nchannels * num_epoch]; unsigned int k = 0; - for(long int j = 0; j < num_epoch; j++ ) + for (long int j = 0; j < num_epoch; j++) { - for(unsigned int i = 0; i < d_nchannels; i++ ) + for (unsigned int i = 0; i < d_nchannels; i++) { RX_time_aux[k] = RX_time[i][j]; TOW_at_current_symbol_s_aux[k] = TOW_at_current_symbol_s[i][j]; @@ -234,40 +233,40 @@ int hybrid_observables_cc::save_matfile() filename.erase(filename.length() - 4, 4); filename.append(".mat"); matfp = Mat_CreateVer(filename.c_str(), NULL, MAT_FT_MAT73); - if(reinterpret_cast(matfp) != NULL) + if (reinterpret_cast(matfp) != NULL) { size_t dims[2] = {static_cast(d_nchannels), static_cast(num_epoch)}; matvar = Mat_VarCreate("RX_time", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, RX_time_aux, MAT_F_DONT_COPY_DATA); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("TOW_at_current_symbol_s", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, TOW_at_current_symbol_s_aux, MAT_F_DONT_COPY_DATA); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("Carrier_Doppler_hz", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, Carrier_Doppler_hz_aux, MAT_F_DONT_COPY_DATA); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("Carrier_phase_cycles", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, Carrier_phase_cycles_aux, MAT_F_DONT_COPY_DATA); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("Pseudorange_m", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, Pseudorange_m_aux, MAT_F_DONT_COPY_DATA); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("PRN", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, PRN_aux, MAT_F_DONT_COPY_DATA); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("Flag_valid_pseudorange", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, Flag_valid_pseudorange_aux, MAT_F_DONT_COPY_DATA); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); } Mat_Close(matfp); - for(unsigned int i = 0; i < d_nchannels; i++) + for (unsigned int i = 0; i < d_nchannels; i++) { delete[] RX_time[i]; delete[] TOW_at_current_symbol_s[i]; @@ -276,7 +275,6 @@ int hybrid_observables_cc::save_matfile() delete[] Pseudorange_m[i]; delete[] PRN[i]; delete[] Flag_valid_pseudorange[i]; - } delete[] RX_time; delete[] TOW_at_current_symbol_s; @@ -297,70 +295,70 @@ int hybrid_observables_cc::save_matfile() } -bool Hybrid_pairCompare_gnss_synchro_sample_counter(const std::pair& a, const std::pair& b) +bool Hybrid_pairCompare_gnss_synchro_sample_counter(const std::pair &a, const std::pair &b) { return (a.second.Tracking_sample_counter) < (b.second.Tracking_sample_counter); } -bool Hybrid_valueCompare_gnss_synchro_sample_counter(const Gnss_Synchro& a, unsigned long int b) +bool Hybrid_valueCompare_gnss_synchro_sample_counter(const Gnss_Synchro &a, unsigned long int b) { return (a.Tracking_sample_counter) < (b); } -bool Hybrid_valueCompare_gnss_synchro_receiver_time(const Gnss_Synchro& a, double b) +bool Hybrid_valueCompare_gnss_synchro_receiver_time(const Gnss_Synchro &a, double b) { - return ((static_cast(a.Tracking_sample_counter) + static_cast(a.Code_phase_samples)) / static_cast(a.fs) ) < (b); + return ((static_cast(a.Tracking_sample_counter) + static_cast(a.Code_phase_samples)) / static_cast(a.fs)) < (b); } -bool Hybrid_pairCompare_gnss_synchro_d_TOW(const std::pair& a, const std::pair& b) +bool Hybrid_pairCompare_gnss_synchro_d_TOW(const std::pair &a, const std::pair &b) { return (a.second.TOW_at_current_symbol_s) < (b.second.TOW_at_current_symbol_s); } -bool Hybrid_valueCompare_gnss_synchro_d_TOW(const Gnss_Synchro& a, double b) +bool Hybrid_valueCompare_gnss_synchro_d_TOW(const Gnss_Synchro &a, double b) { return (a.TOW_at_current_symbol_s) < (b); } -void hybrid_observables_cc::forecast (int noutput_items __attribute__((unused)), gr_vector_int &ninput_items_required) +void hybrid_observables_cc::forecast(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items_required) { bool zero_samples = true; - for(unsigned int i = 0; i < d_nchannels; i++) + for (unsigned int i = 0; i < d_nchannels; i++) { int items = detail()->input(i)->items_available(); if (items > 0) zero_samples = false; - ninput_items_required[i] = items; // set the required available samples in each call + ninput_items_required[i] = items; // set the required available samples in each call } if (zero_samples == true) { - for(unsigned int i = 0; i < d_nchannels; i++) + for (unsigned int i = 0; i < d_nchannels; i++) { - ninput_items_required[i] = 1; // set the required available samples in each call + ninput_items_required[i] = 1; // set the required available samples in each call } } } -int hybrid_observables_cc::general_work (int noutput_items , - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) +int hybrid_observables_cc::general_work(int noutput_items, + gr_vector_int &ninput_items, + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items) { - const Gnss_Synchro **in = reinterpret_cast(&input_items[0]); // Get the input buffer pointer - Gnss_Synchro **out = reinterpret_cast(&output_items[0]); // Get the output buffer pointer + const Gnss_Synchro **in = reinterpret_cast(&input_items[0]); // Get the input buffer pointer + Gnss_Synchro **out = reinterpret_cast(&output_items[0]); // Get the output buffer pointer int n_outputs = 0; int n_consume[d_nchannels]; double past_history_s = 100e-3; Gnss_Synchro current_gnss_synchro[d_nchannels]; Gnss_Synchro aux = Gnss_Synchro(); - for(unsigned int i = 0; i < d_nchannels; i++) + for (unsigned int i = 0; i < d_nchannels; i++) { current_gnss_synchro[i] = aux; } @@ -371,7 +369,7 @@ int hybrid_observables_cc::general_work (int noutput_items , */ for (unsigned int i = 0; i < d_nchannels; i++) { - n_consume[i] = ninput_items[i]; // full throttle + n_consume[i] = ninput_items[i]; // full throttle for (int j = 0; j < n_consume[i]; j++) { d_gnss_synchro_history_queue[i].push_back(in[i][j]); @@ -391,37 +389,37 @@ int hybrid_observables_cc::general_work (int noutput_items , } if (channel_history_ok == true) { - std::map::const_iterator gnss_synchro_map_iter; + std::map::const_iterator gnss_synchro_map_iter; std::deque::const_iterator gnss_synchro_deque_iter; // 1. If the RX time is not set, set the Rx time if (T_rx_s == 0) { // 0. Read a gnss_synchro snapshot from the queue and store it in a map - std::map gnss_synchro_map; + std::map gnss_synchro_map; for (unsigned int i = 0; i < d_nchannels; i++) { gnss_synchro_map.insert(std::pair(d_gnss_synchro_history_queue[i].front().Channel_ID, - d_gnss_synchro_history_queue[i].front())); + d_gnss_synchro_history_queue[i].front())); } gnss_synchro_map_iter = min_element(gnss_synchro_map.cbegin(), - gnss_synchro_map.cend(), - Hybrid_pairCompare_gnss_synchro_sample_counter); + gnss_synchro_map.cend(), + Hybrid_pairCompare_gnss_synchro_sample_counter); T_rx_s = static_cast(gnss_synchro_map_iter->second.Tracking_sample_counter) / static_cast(gnss_synchro_map_iter->second.fs); - T_rx_s = floor(T_rx_s * 1000.0) / 1000.0; // truncate to ms - T_rx_s += past_history_s; // increase T_rx to have a minimum past history to interpolate + T_rx_s = floor(T_rx_s * 1000.0) / 1000.0; // truncate to ms + T_rx_s += past_history_s; // increase T_rx to have a minimum past history to interpolate } // 2. Realign RX time in all valid channels - std::map realigned_gnss_synchro_map; // container for the aligned set of observables for the selected T_rx - std::map adjacent_gnss_synchro_map; // container for the previous observable values to interpolate + std::map realigned_gnss_synchro_map; // container for the aligned set of observables for the selected T_rx + std::map adjacent_gnss_synchro_map; // container for the previous observable values to interpolate // shift channels history to match the reference TOW for (unsigned int i = 0; i < d_nchannels; i++) { gnss_synchro_deque_iter = std::lower_bound(d_gnss_synchro_history_queue[i].cbegin(), - d_gnss_synchro_history_queue[i].cend(), - T_rx_s, - Hybrid_valueCompare_gnss_synchro_receiver_time); + d_gnss_synchro_history_queue[i].cend(), + T_rx_s, + Hybrid_valueCompare_gnss_synchro_receiver_time); if (gnss_synchro_deque_iter != d_gnss_synchro_history_queue[i].cend()) { if (gnss_synchro_deque_iter->Flag_valid_word == true) @@ -444,29 +442,27 @@ int hybrid_observables_cc::general_work (int noutput_items , if (fabs(delta_T_rx_s_prev) < fabs(delta_T_rx_s)) { realigned_gnss_synchro_map.insert(std::pair(d_gnss_synchro_history_queue[i].at(distance - 1).Channel_ID, - d_gnss_synchro_history_queue[i].at(distance - 1))); + d_gnss_synchro_history_queue[i].at(distance - 1))); adjacent_gnss_synchro_map.insert(std::pair(gnss_synchro_deque_iter->Channel_ID, *gnss_synchro_deque_iter)); } else { realigned_gnss_synchro_map.insert(std::pair(gnss_synchro_deque_iter->Channel_ID, *gnss_synchro_deque_iter)); adjacent_gnss_synchro_map.insert(std::pair(d_gnss_synchro_history_queue[i].at(distance - 1).Channel_ID, - d_gnss_synchro_history_queue[i].at(distance - 1))); + d_gnss_synchro_history_queue[i].at(distance - 1))); } } - } else { realigned_gnss_synchro_map.insert(std::pair(gnss_synchro_deque_iter->Channel_ID, *gnss_synchro_deque_iter)); } - } } } } - if(!realigned_gnss_synchro_map.empty()) + if (!realigned_gnss_synchro_map.empty()) { /* * 2.1 Use CURRENT set of measurements and find the nearest satellite @@ -474,8 +470,8 @@ int hybrid_observables_cc::general_work (int noutput_items , */ // what is the most recent symbol TOW in the current set? -> this will be the reference symbol gnss_synchro_map_iter = max_element(realigned_gnss_synchro_map.cbegin(), - realigned_gnss_synchro_map.cend(), - Hybrid_pairCompare_gnss_synchro_d_TOW); + realigned_gnss_synchro_map.cend(), + Hybrid_pairCompare_gnss_synchro_d_TOW); double ref_fs_hz = static_cast(gnss_synchro_map_iter->second.fs); // compute interpolated TOW value at T_rx_s @@ -490,7 +486,7 @@ int hybrid_observables_cc::general_work (int noutput_items , double selected_T_rx_s = T_rx_s; // two points linear interpolation using adjacent (adj) values: y=y1+(x-x1)*(y2-y1)/(x2-x1) double ref_TOW_at_T_rx_s = adj_obs.TOW_at_current_symbol_s + - (selected_T_rx_s - ref_adj_T_rx_s) * (d_TOW_reference - adj_obs.TOW_at_current_symbol_s) / (d_ref_T_rx_s - ref_adj_T_rx_s); + (selected_T_rx_s - ref_adj_T_rx_s) * (d_TOW_reference - adj_obs.TOW_at_current_symbol_s) / (d_ref_T_rx_s - ref_adj_T_rx_s); // Now compute RX time differences due to the PRN alignment in the correlators double traveltime_ms; @@ -498,7 +494,7 @@ int hybrid_observables_cc::general_work (int noutput_items , double channel_T_rx_s; double channel_fs_hz; double channel_TOW_s; - for(gnss_synchro_map_iter = realigned_gnss_synchro_map.cbegin(); gnss_synchro_map_iter != realigned_gnss_synchro_map.cend(); gnss_synchro_map_iter++) + for (gnss_synchro_map_iter = realigned_gnss_synchro_map.cbegin(); gnss_synchro_map_iter != realigned_gnss_synchro_map.cend(); gnss_synchro_map_iter++) { channel_fs_hz = static_cast(gnss_synchro_map_iter->second.fs); channel_TOW_s = gnss_synchro_map_iter->second.TOW_at_current_symbol_s; @@ -508,13 +504,13 @@ int hybrid_observables_cc::general_work (int noutput_items , // TOW at the selected receiver time T_rx_s int element_key = gnss_synchro_map_iter->second.Channel_ID; try - { + { adj_obs = adjacent_gnss_synchro_map.at(element_key); - } - catch(const std::exception & ex) - { + } + catch (const std::exception &ex) + { continue; - } + } double adj_T_rx_s = static_cast(adj_obs.Tracking_sample_counter) / channel_fs_hz + adj_obs.Code_phase_samples / channel_fs_hz; @@ -527,7 +523,7 @@ int hybrid_observables_cc::general_work (int noutput_items , // compute the pseudorange (no rx time offset correction) traveltime_ms = (ref_TOW_at_T_rx_s - channel_TOW_at_T_rx_s) * 1000.0 + GPS_STARTOFFSET_ms; // convert to meters - pseudorange_m = traveltime_ms * GPS_C_m_ms; // [m] + pseudorange_m = traveltime_ms * GPS_C_m_ms; // [m] // update the pseudorange object current_gnss_synchro[gnss_synchro_map_iter->second.Channel_ID] = gnss_synchro_map_iter->second; current_gnss_synchro[gnss_synchro_map_iter->second.Channel_ID].Pseudorange_m = pseudorange_m; @@ -539,34 +535,34 @@ int hybrid_observables_cc::general_work (int noutput_items , current_gnss_synchro[gnss_synchro_map_iter->second.Channel_ID].Carrier_Doppler_hz = Carrier_Doppler_lin_hz; } - if(d_dump == true) + if (d_dump == true) { // MULTIPLEXED FILE RECORDING - Record results to file try - { + { double tmp_double; for (unsigned int i = 0; i < d_nchannels; i++) { tmp_double = current_gnss_synchro[i].RX_time; - d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); + d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); tmp_double = current_gnss_synchro[i].TOW_at_current_symbol_s; - d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); + d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); tmp_double = current_gnss_synchro[i].Carrier_Doppler_hz; - d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); + d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); tmp_double = current_gnss_synchro[i].Carrier_phase_rads / GPS_TWO_PI; - d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); + d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); tmp_double = current_gnss_synchro[i].Pseudorange_m; - d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); + d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); tmp_double = current_gnss_synchro[i].PRN; - d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); + d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); tmp_double = static_cast(current_gnss_synchro[i].Flag_valid_pseudorange); - d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); + d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); } - } - catch (const std::ifstream::failure& e) - { + } + catch (const std::ifstream::failure &e) + { LOG(WARNING) << "Exception writing observables dump file " << e.what(); - } + } } for (unsigned int i = 0; i < d_nchannels; i++) @@ -588,14 +584,14 @@ int hybrid_observables_cc::general_work (int noutput_items , } } } - } while(channel_history_ok == true && noutput_items > n_outputs); + } + while (channel_history_ok == true && noutput_items > n_outputs); // Multi-rate consume! for (unsigned int i = 0; i < d_nchannels; i++) { - consume(i, n_consume[i]); // which input, how many items + consume(i, n_consume[i]); // which input, how many items } return n_outputs; } - diff --git a/src/algorithms/observables/gnuradio_blocks/hybrid_observables_cc.h b/src/algorithms/observables/gnuradio_blocks/hybrid_observables_cc.h index e97922173..33372b689 100644 --- a/src/algorithms/observables/gnuradio_blocks/hybrid_observables_cc.h +++ b/src/algorithms/observables/gnuradio_blocks/hybrid_observables_cc.h @@ -52,10 +52,11 @@ hybrid_make_observables_cc(unsigned int n_channels, bool dump, std::string dump_ class hybrid_observables_cc : public gr::block { public: - ~hybrid_observables_cc (); - int general_work (int noutput_items, gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); - void forecast (int noutput_items, gr_vector_int &ninput_items_required); + ~hybrid_observables_cc(); + int general_work(int noutput_items, gr_vector_int &ninput_items, + gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); + void forecast(int noutput_items, gr_vector_int &ninput_items_required); + private: friend hybrid_observables_cc_sptr hybrid_make_observables_cc(unsigned int nchannels, bool dump, std::string dump_filename, unsigned int deep_history); diff --git a/src/algorithms/resampler/adapters/direct_resampler_conditioner.cc b/src/algorithms/resampler/adapters/direct_resampler_conditioner.cc index 5c3071981..db38b8be3 100644 --- a/src/algorithms/resampler/adapters/direct_resampler_conditioner.cc +++ b/src/algorithms/resampler/adapters/direct_resampler_conditioner.cc @@ -43,9 +43,8 @@ using google::LogMessage; DirectResamplerConditioner::DirectResamplerConditioner( - ConfigurationInterface* configuration, std::string role, - unsigned int in_stream, unsigned int out_stream) : - role_(role), in_stream_(in_stream), out_stream_(out_stream) + ConfigurationInterface* configuration, std::string role, + unsigned int in_stream, unsigned int out_stream) : role_(role), in_stream_(in_stream), out_stream_(out_stream) { std::string default_item_type = "short"; std::string default_dump_file = "./data/signal_conditioner.dat"; @@ -54,10 +53,9 @@ DirectResamplerConditioner::DirectResamplerConditioner( 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_out_ = configuration->property(role_ + ".sample_freq_out", fs_in); - if(std::fabs(fs_in - sample_freq_out_) > std::numeric_limits::epsilon()) + if (std::fabs(fs_in - sample_freq_out_) > std::numeric_limits::epsilon()) { - std::string aux_warn = "CONFIGURATION WARNING: Parameters GNSS-SDR.internal_fs_sps and " - + role_ + ".sample_freq_out are not set to the same value!" ; + std::string aux_warn = "CONFIGURATION WARNING: Parameters GNSS-SDR.internal_fs_sps and " + role_ + ".sample_freq_out are not set to the same value!"; LOG(WARNING) << aux_warn; std::cout << aux_warn << std::endl; } @@ -110,7 +108,6 @@ DirectResamplerConditioner::DirectResamplerConditioner( DirectResamplerConditioner::~DirectResamplerConditioner() {} - void DirectResamplerConditioner::connect(gr::top_block_sptr top_block) { if (dump_) diff --git a/src/algorithms/resampler/adapters/direct_resampler_conditioner.h b/src/algorithms/resampler/adapters/direct_resampler_conditioner.h index 8ffa4d4b4..870743c30 100644 --- a/src/algorithms/resampler/adapters/direct_resampler_conditioner.h +++ b/src/algorithms/resampler/adapters/direct_resampler_conditioner.h @@ -43,12 +43,12 @@ class ConfigurationInterface; * \brief Interface of an adapter of a direct resampler conditioner block * to a SignalConditionerInterface */ -class DirectResamplerConditioner: public GNSSBlockInterface +class DirectResamplerConditioner : public GNSSBlockInterface { public: DirectResamplerConditioner(ConfigurationInterface* configuration, - std::string role, unsigned int in_stream, - unsigned int out_stream); + std::string role, unsigned int in_stream, + unsigned int out_stream); virtual ~DirectResamplerConditioner(); diff --git a/src/algorithms/resampler/adapters/mmse_resampler_conditioner.cc b/src/algorithms/resampler/adapters/mmse_resampler_conditioner.cc index 170215618..2acf89de0 100644 --- a/src/algorithms/resampler/adapters/mmse_resampler_conditioner.cc +++ b/src/algorithms/resampler/adapters/mmse_resampler_conditioner.cc @@ -39,9 +39,8 @@ using google::LogMessage; MmseResamplerConditioner::MmseResamplerConditioner( - ConfigurationInterface* configuration, std::string role, - unsigned int in_stream, unsigned int out_stream) : - role_(role), in_stream_(in_stream), out_stream_(out_stream) + ConfigurationInterface* configuration, std::string role, + unsigned int in_stream, unsigned int out_stream) : role_(role), in_stream_(in_stream), out_stream_(out_stream) { std::string default_item_type = "gr_complex"; std::string default_dump_file = "./data/signal_conditioner.dat"; @@ -50,10 +49,9 @@ MmseResamplerConditioner::MmseResamplerConditioner( 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_out_ = configuration->property(role_ + ".sample_freq_out", fs_in); - if(std::fabs(fs_in - sample_freq_out_) > std::numeric_limits::epsilon()) + if (std::fabs(fs_in - sample_freq_out_) > std::numeric_limits::epsilon()) { - std::string aux_warn = "CONFIGURATION WARNING: Parameters GNSS-SDR.internal_fs_sps and " - + role_ + ".sample_freq_out are not set to the same value!" ; + std::string aux_warn = "CONFIGURATION WARNING: Parameters GNSS-SDR.internal_fs_sps and " + role_ + ".sample_freq_out are not set to the same value!"; LOG(WARNING) << aux_warn; std::cout << aux_warn << std::endl; } @@ -65,11 +63,11 @@ MmseResamplerConditioner::MmseResamplerConditioner( if (item_type_.compare("gr_complex") == 0) { item_size_ = sizeof(gr_complex); - #ifdef GR_GREATER_38 +#ifdef GR_GREATER_38 resampler_ = gr::filter::mmse_resampler_cc::make(0.0, sample_freq_in_ / sample_freq_out_); - #else +#else resampler_ = gr::filter::fractional_resampler_cc::make(0.0, sample_freq_in_ / sample_freq_out_); - #endif +#endif DLOG(INFO) << "sample_freq_in " << sample_freq_in_; DLOG(INFO) << "sample_freq_out" << sample_freq_out_; DLOG(INFO) << "Item size " << item_size_; @@ -92,7 +90,6 @@ MmseResamplerConditioner::MmseResamplerConditioner( MmseResamplerConditioner::~MmseResamplerConditioner() {} - void MmseResamplerConditioner::connect(gr::top_block_sptr top_block) { if (dump_) diff --git a/src/algorithms/resampler/adapters/mmse_resampler_conditioner.h b/src/algorithms/resampler/adapters/mmse_resampler_conditioner.h index c5ce652dc..4b0885ba3 100644 --- a/src/algorithms/resampler/adapters/mmse_resampler_conditioner.h +++ b/src/algorithms/resampler/adapters/mmse_resampler_conditioner.h @@ -47,12 +47,12 @@ class ConfigurationInterface; * \brief Interface of a MMSE resampler block adapter * to a SignalConditionerInterface */ -class MmseResamplerConditioner: public GNSSBlockInterface +class MmseResamplerConditioner : public GNSSBlockInterface { public: MmseResamplerConditioner(ConfigurationInterface* configuration, - std::string role, unsigned int in_stream, - unsigned int out_stream); + std::string role, unsigned int in_stream, + unsigned int out_stream); virtual ~MmseResamplerConditioner(); @@ -86,11 +86,11 @@ private: std::string dump_filename_; double sample_freq_in_; double sample_freq_out_; - #ifdef GR_GREATER_38 +#ifdef GR_GREATER_38 gr::filter::mmse_resampler_cc::sptr resampler_; - #else +#else gr::filter::fractional_resampler_cc::sptr resampler_; - #endif +#endif gr::block_sptr file_sink_; }; diff --git a/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cb.cc b/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cb.cc index 386968791..9a053b46d 100644 --- a/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cb.cc +++ b/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cb.cc @@ -40,21 +40,22 @@ using google::LogMessage; direct_resampler_conditioner_cb_sptr direct_resampler_make_conditioner_cb( - double sample_freq_in, double sample_freq_out) + double sample_freq_in, double sample_freq_out) { - return direct_resampler_conditioner_cb_sptr( - new direct_resampler_conditioner_cb(sample_freq_in, - sample_freq_out)); + new direct_resampler_conditioner_cb(sample_freq_in, + sample_freq_out)); } direct_resampler_conditioner_cb::direct_resampler_conditioner_cb( - double sample_freq_in, double sample_freq_out) : - gr::block("direct_resampler_make_conditioner_cb", gr::io_signature::make(1, - 1, sizeof(lv_8sc_t)), gr::io_signature::make(1, 1, sizeof(lv_8sc_t))), - d_sample_freq_in(sample_freq_in), d_sample_freq_out( - sample_freq_out), d_phase(0), d_lphase(0), d_history(1) + double sample_freq_in, double sample_freq_out) : gr::block("direct_resampler_make_conditioner_cb", gr::io_signature::make(1, 1, sizeof(lv_8sc_t)), gr::io_signature::make(1, 1, sizeof(lv_8sc_t))), + d_sample_freq_in(sample_freq_in), + d_sample_freq_out( + sample_freq_out), + d_phase(0), + d_lphase(0), + d_history(1) { const double two_32 = 4294967296.0; // Computes the phase step multiplying the resampling ratio by 2^32 = 4294967296 @@ -74,15 +75,13 @@ direct_resampler_conditioner_cb::direct_resampler_conditioner_cb( direct_resampler_conditioner_cb::~direct_resampler_conditioner_cb() { - } void direct_resampler_conditioner_cb::forecast(int noutput_items, - gr_vector_int &ninput_items_required) + gr_vector_int &ninput_items_required) { - int nreqd = std::max(static_cast(1), static_cast(static_cast(noutput_items + 1) - * sample_freq_in() / sample_freq_out()) + history() - 1); + int nreqd = std::max(static_cast(1), static_cast(static_cast(noutput_items + 1) * sample_freq_in() / sample_freq_out()) + history() - 1); unsigned ninputs = ninput_items_required.size(); for (unsigned i = 0; i < ninputs; i++) @@ -93,8 +92,8 @@ void direct_resampler_conditioner_cb::forecast(int noutput_items, int direct_resampler_conditioner_cb::general_work(int noutput_items, - gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) + gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items) { const lv_8sc_t *in = reinterpret_cast(input_items[0]); lv_8sc_t *out = reinterpret_cast(output_items[0]); diff --git a/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cb.h b/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cb.h index 8420c3973..a86ee08db 100644 --- a/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cb.h +++ b/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cb.h @@ -37,22 +37,22 @@ class direct_resampler_conditioner_cb; typedef boost::shared_ptr - direct_resampler_conditioner_cb_sptr; + direct_resampler_conditioner_cb_sptr; direct_resampler_conditioner_cb_sptr direct_resampler_make_conditioner_cb(double sample_freq_in, - double sample_freq_out); + double sample_freq_out); /*! * \brief This class implements a direct resampler conditioner for std::complex * * Direct resampling without interpolation */ -class direct_resampler_conditioner_cb: public gr::block +class direct_resampler_conditioner_cb : public gr::block { private: friend direct_resampler_conditioner_cb_sptr direct_resampler_make_conditioner_cb(double sample_freq_in, - double sample_freq_out); + double sample_freq_out); double d_sample_freq_in; double d_sample_freq_out; @@ -62,7 +62,7 @@ private: unsigned int d_history; direct_resampler_conditioner_cb(double sample_freq_in, - double sample_freq_out); + double sample_freq_out); public: ~direct_resampler_conditioner_cb(); @@ -80,8 +80,8 @@ public: void forecast(int noutput_items, gr_vector_int &ninput_items_required); int general_work(int noutput_items, gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items); }; #endif /* GNSS_SDR_DIRECT_RESAMPLER_CONDITIONER_CS_H */ diff --git a/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cc.cc b/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cc.cc index e05f887d5..b238a7c0d 100644 --- a/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cc.cc +++ b/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cc.cc @@ -40,22 +40,16 @@ using google::LogMessage; direct_resampler_conditioner_cc_sptr direct_resampler_make_conditioner_cc( - double sample_freq_in, double sample_freq_out) + double sample_freq_in, double sample_freq_out) { return direct_resampler_conditioner_cc_sptr( - new direct_resampler_conditioner_cc(sample_freq_in, - sample_freq_out)); + new direct_resampler_conditioner_cc(sample_freq_in, + sample_freq_out)); } - direct_resampler_conditioner_cc::direct_resampler_conditioner_cc( - double sample_freq_in, double sample_freq_out) : - gr::block("direct_resampler_conditioner_cc", gr::io_signature::make(1, 1, - sizeof(gr_complex)), gr::io_signature::make(1, 1, - sizeof(gr_complex))), d_sample_freq_in(sample_freq_in), - d_sample_freq_out(sample_freq_out), d_phase(0), d_lphase(0), - d_history(1) + double sample_freq_in, double sample_freq_out) : gr::block("direct_resampler_conditioner_cc", gr::io_signature::make(1, 1, sizeof(gr_complex)), gr::io_signature::make(1, 1, sizeof(gr_complex))), d_sample_freq_in(sample_freq_in), d_sample_freq_out(sample_freq_out), d_phase(0), d_lphase(0), d_history(1) { // Computes the phase step multiplying the resampling ratio by 2^32 = 4294967296 const double two_32 = 4294967296.0; @@ -65,27 +59,22 @@ direct_resampler_conditioner_cc::direct_resampler_conditioner_cc( } else { - d_phase_step = static_cast(floor(two_32 * sample_freq_in / sample_freq_out)); + d_phase_step = static_cast(floor(two_32 * sample_freq_in / sample_freq_out)); } set_relative_rate(1.0 * sample_freq_out / sample_freq_in); set_output_multiple(1); } - - direct_resampler_conditioner_cc::~direct_resampler_conditioner_cc() { - } - void direct_resampler_conditioner_cc::forecast(int noutput_items, - gr_vector_int &ninput_items_required) + gr_vector_int &ninput_items_required) { - int nreqd = std::max(static_cast(1), static_cast(static_cast(noutput_items + 1) - * sample_freq_in() / sample_freq_out()) + history() - 1); + int nreqd = std::max(static_cast(1), static_cast(static_cast(noutput_items + 1) * sample_freq_in() / sample_freq_out()) + history() - 1); unsigned ninputs = ninput_items_required.size(); for (unsigned i = 0; i < ninputs; i++) { @@ -94,10 +83,9 @@ void direct_resampler_conditioner_cc::forecast(int noutput_items, } - int direct_resampler_conditioner_cc::general_work(int noutput_items, - gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) + gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items) { const gr_complex *in = reinterpret_cast(input_items[0]); gr_complex *out = reinterpret_cast(output_items[0]); diff --git a/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cc.h b/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cc.h index 626abcdeb..26a24d5eb 100644 --- a/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cc.h +++ b/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cc.h @@ -46,27 +46,27 @@ class direct_resampler_conditioner_cc; typedef boost::shared_ptr direct_resampler_conditioner_cc_sptr; direct_resampler_conditioner_cc_sptr direct_resampler_make_conditioner_cc(double sample_freq_in, - double sample_freq_out); + double sample_freq_out); /*! * \brief This class implements a direct resampler conditioner for complex data * * Direct resampling without interpolation */ -class direct_resampler_conditioner_cc: public gr::block +class direct_resampler_conditioner_cc : public gr::block { private: friend direct_resampler_conditioner_cc_sptr direct_resampler_make_conditioner_cc(double sample_freq_in, - double sample_freq_out); - double d_sample_freq_in; //! Specifies the sampling frequency of the input signal - double d_sample_freq_out; //! Specifies the sampling frequency of the output signal + double sample_freq_out); + double d_sample_freq_in; //! Specifies the sampling frequency of the input signal + double d_sample_freq_out; //! Specifies the sampling frequency of the output signal uint32_t d_phase; uint32_t d_lphase; uint32_t d_phase_step; unsigned int d_history; direct_resampler_conditioner_cc(double sample_freq_in, - double sample_freq_out); + double sample_freq_out); public: ~direct_resampler_conditioner_cc(); @@ -81,10 +81,10 @@ public: } void forecast(int noutput_items, gr_vector_int &ninput_items_required); - + int general_work(int noutput_items, gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items); }; #endif /* GNSS_SDR_DIRECT_RESAMPLER_CONDITIONER_CC_H */ diff --git a/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cs.cc b/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cs.cc index e362a1dde..8e7f32d80 100644 --- a/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cs.cc +++ b/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cs.cc @@ -39,20 +39,22 @@ using google::LogMessage; direct_resampler_conditioner_cs_sptr direct_resampler_make_conditioner_cs( - double sample_freq_in, double sample_freq_out) + double sample_freq_in, double sample_freq_out) { return direct_resampler_conditioner_cs_sptr( - new direct_resampler_conditioner_cs(sample_freq_in, - sample_freq_out)); + new direct_resampler_conditioner_cs(sample_freq_in, + sample_freq_out)); } direct_resampler_conditioner_cs::direct_resampler_conditioner_cs( - double sample_freq_in, double sample_freq_out) : - gr::block("direct_resampler_make_conditioner_cs", gr::io_signature::make(1, - 1, sizeof(lv_16sc_t)), gr::io_signature::make(1, 1, sizeof(lv_16sc_t))), - d_sample_freq_in(sample_freq_in), d_sample_freq_out( - sample_freq_out), d_phase(0), d_lphase(0), d_history(1) + double sample_freq_in, double sample_freq_out) : gr::block("direct_resampler_make_conditioner_cs", gr::io_signature::make(1, 1, sizeof(lv_16sc_t)), gr::io_signature::make(1, 1, sizeof(lv_16sc_t))), + d_sample_freq_in(sample_freq_in), + d_sample_freq_out( + sample_freq_out), + d_phase(0), + d_lphase(0), + d_history(1) { const double two_32 = 4294967296.0; // Computes the phase step multiplying the resampling ratio by 2^32 = 4294967296 @@ -72,15 +74,13 @@ direct_resampler_conditioner_cs::direct_resampler_conditioner_cs( direct_resampler_conditioner_cs::~direct_resampler_conditioner_cs() { - } void direct_resampler_conditioner_cs::forecast(int noutput_items, - gr_vector_int &ninput_items_required) + gr_vector_int &ninput_items_required) { - int nreqd = std::max(static_cast(1), static_cast(static_cast(noutput_items + 1) - * sample_freq_in() / sample_freq_out()) + history() - 1); + int nreqd = std::max(static_cast(1), static_cast(static_cast(noutput_items + 1) * sample_freq_in() / sample_freq_out()) + history() - 1); unsigned ninputs = ninput_items_required.size(); for (unsigned i = 0; i < ninputs; i++) @@ -91,8 +91,8 @@ void direct_resampler_conditioner_cs::forecast(int noutput_items, int direct_resampler_conditioner_cs::general_work(int noutput_items, - gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) + gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items) { const lv_16sc_t *in = reinterpret_cast(input_items[0]); lv_16sc_t *out = reinterpret_cast(output_items[0]); diff --git a/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cs.h b/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cs.h index 63969553a..a8b5a6874 100644 --- a/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cs.h +++ b/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cs.h @@ -37,22 +37,22 @@ class direct_resampler_conditioner_cs; typedef boost::shared_ptr - direct_resampler_conditioner_cs_sptr; + direct_resampler_conditioner_cs_sptr; direct_resampler_conditioner_cs_sptr direct_resampler_make_conditioner_cs(double sample_freq_in, - double sample_freq_out); + double sample_freq_out); /*! * \brief This class implements a direct resampler conditioner for std::complex * * Direct resampling without interpolation */ -class direct_resampler_conditioner_cs: public gr::block +class direct_resampler_conditioner_cs : public gr::block { private: friend direct_resampler_conditioner_cs_sptr direct_resampler_make_conditioner_cs(double sample_freq_in, - double sample_freq_out); + double sample_freq_out); double d_sample_freq_in; double d_sample_freq_out; @@ -62,7 +62,7 @@ private: unsigned int d_history; direct_resampler_conditioner_cs(double sample_freq_in, - double sample_freq_out); + double sample_freq_out); public: ~direct_resampler_conditioner_cs(); @@ -78,10 +78,10 @@ public: } void forecast(int noutput_items, gr_vector_int &ninput_items_required); - + int general_work(int noutput_items, gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items); }; #endif /* GNSS_SDR_DIRECT_RESAMPLER_CONDITIONER_CS_H */ diff --git a/src/algorithms/signal_generator/adapters/signal_generator.cc b/src/algorithms/signal_generator/adapters/signal_generator.cc index 439e3c3ca..504a7896b 100644 --- a/src/algorithms/signal_generator/adapters/signal_generator.cc +++ b/src/algorithms/signal_generator/adapters/signal_generator.cc @@ -42,9 +42,8 @@ using google::LogMessage; SignalGenerator::SignalGenerator(ConfigurationInterface* configuration, - std::string role, unsigned int in_stream, - unsigned int out_stream, boost::shared_ptr queue) : - role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(queue) + std::string role, unsigned int in_stream, + unsigned int out_stream, boost::shared_ptr queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(queue) { std::string default_item_type = "gr_complex"; std::string default_dump_file = "./data/gen_source.dat"; @@ -86,27 +85,22 @@ SignalGenerator::SignalGenerator(ConfigurationInterface* configuration, unsigned int vector_length = 0; if (std::find(system.begin(), system.end(), "E") != system.end()) { - if (signal1[0].at(0)=='5') + if (signal1[0].at(0) == '5') { - vector_length = round(static_cast(fs_in) / (Galileo_E5a_CODE_CHIP_RATE_HZ - / Galileo_E5a_CODE_LENGTH_CHIPS)); + vector_length = round(static_cast(fs_in) / (Galileo_E5a_CODE_CHIP_RATE_HZ / Galileo_E5a_CODE_LENGTH_CHIPS)); } else { - vector_length = round(static_cast(fs_in) / (Galileo_E1_CODE_CHIP_RATE_HZ - / Galileo_E1_B_CODE_LENGTH_CHIPS)) - * Galileo_E1_C_SECONDARY_CODE_LENGTH; + vector_length = round(static_cast(fs_in) / (Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS)) * Galileo_E1_C_SECONDARY_CODE_LENGTH; } } else if (std::find(system.begin(), system.end(), "G") != system.end()) { - vector_length = round(static_cast(fs_in) - / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS)); + vector_length = round(static_cast(fs_in) / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS)); } else if (std::find(system.begin(), system.end(), "R") != system.end()) { - vector_length = round((float)fs_in - / (GLONASS_L1_CA_CODE_RATE_HZ / GLONASS_L1_CA_CODE_LENGTH_CHIPS)); + vector_length = round((float)fs_in / (GLONASS_L1_CA_CODE_RATE_HZ / GLONASS_L1_CA_CODE_LENGTH_CHIPS)); } if (item_type_.compare("gr_complex") == 0) @@ -114,7 +108,7 @@ SignalGenerator::SignalGenerator(ConfigurationInterface* configuration, item_size_ = sizeof(gr_complex); DLOG(INFO) << "Item size " << item_size_; gen_source_ = signal_make_generator_c(signal1, system, PRN, CN0_dB, doppler_Hz, delay_chips, delay_sec, - data_flag, noise_flag, fs_in, vector_length, BW_BB); + data_flag, noise_flag, fs_in, vector_length, BW_BB); vector_to_stream_ = gr::blocks::vector_to_stream::make(item_size_, vector_length); @@ -141,7 +135,8 @@ SignalGenerator::SignalGenerator(ConfigurationInterface* configuration, SignalGenerator::~SignalGenerator() -{} +{ +} void SignalGenerator::connect(gr::top_block_sptr top_block) @@ -156,7 +151,6 @@ void SignalGenerator::connect(gr::top_block_sptr top_block) top_block->connect(vector_to_stream_, 0, file_sink_, 0); DLOG(INFO) << "connected vector_to_stream_ to file sink"; } - } } diff --git a/src/algorithms/signal_generator/adapters/signal_generator.h b/src/algorithms/signal_generator/adapters/signal_generator.h index 16104062d..567f49754 100644 --- a/src/algorithms/signal_generator/adapters/signal_generator.h +++ b/src/algorithms/signal_generator/adapters/signal_generator.h @@ -48,12 +48,12 @@ class ConfigurationInterface; * \brief This class generates synthesized GNSS signal. * */ -class SignalGenerator: public GNSSBlockInterface +class SignalGenerator : public GNSSBlockInterface { public: SignalGenerator(ConfigurationInterface* configuration, - std::string role, unsigned int in_stream, - unsigned int out_stream, boost::shared_ptr queue); + std::string role, unsigned int in_stream, + unsigned int out_stream, boost::shared_ptr queue); virtual ~SignalGenerator(); diff --git a/src/algorithms/signal_generator/gnuradio_blocks/signal_generator_c.cc b/src/algorithms/signal_generator/gnuradio_blocks/signal_generator_c.cc index 8bc43795e..545254016 100644 --- a/src/algorithms/signal_generator/gnuradio_blocks/signal_generator_c.cc +++ b/src/algorithms/signal_generator/gnuradio_blocks/signal_generator_c.cc @@ -46,37 +46,36 @@ * a boost shared_ptr. This is effectively the public constructor. */ signal_generator_c_sptr -signal_make_generator_c (std::vector signal1, std::vector system, const std::vector &PRN, - const std::vector &CN0_dB, const std::vector &doppler_Hz, - const std::vector &delay_chips, const std::vector &delay_sec,bool data_flag, bool noise_flag, - unsigned int fs_in, unsigned int vector_length, float BW_BB) +signal_make_generator_c(std::vector signal1, std::vector system, const std::vector &PRN, + const std::vector &CN0_dB, const std::vector &doppler_Hz, + const std::vector &delay_chips, const std::vector &delay_sec, bool data_flag, bool noise_flag, + unsigned int fs_in, unsigned int vector_length, float BW_BB) { - return gnuradio::get_initial_sptr(new signal_generator_c(signal1, system, PRN, CN0_dB, doppler_Hz, delay_chips,delay_sec, - data_flag, noise_flag, fs_in, vector_length, BW_BB)); + return gnuradio::get_initial_sptr(new signal_generator_c(signal1, system, PRN, CN0_dB, doppler_Hz, delay_chips, delay_sec, + data_flag, noise_flag, fs_in, vector_length, BW_BB)); } /* * The private constructor */ -signal_generator_c::signal_generator_c (std::vector signal1, std::vector system, const std::vector &PRN, - const std::vector &CN0_dB, const std::vector &doppler_Hz, - const std::vector &delay_chips,const std::vector &delay_sec ,bool data_flag, bool noise_flag, - unsigned int fs_in, unsigned int vector_length, float BW_BB) : - gr::block ("signal_gen_cc", gr::io_signature::make(0, 0, sizeof(gr_complex)), - gr::io_signature::make(1, 1, sizeof(gr_complex) * vector_length)), - signal_(signal1), - system_(system), - PRN_(PRN), - CN0_dB_(CN0_dB), - doppler_Hz_(doppler_Hz), - delay_chips_(delay_chips), - delay_sec_(delay_sec), - data_flag_(data_flag), - noise_flag_(noise_flag), - fs_in_(fs_in), - num_sats_(PRN.size()), - vector_length_(vector_length), - BW_BB_(BW_BB * static_cast(fs_in) / 2.0) +signal_generator_c::signal_generator_c(std::vector signal1, std::vector system, const std::vector &PRN, + const std::vector &CN0_dB, const std::vector &doppler_Hz, + const std::vector &delay_chips, const std::vector &delay_sec, bool data_flag, bool noise_flag, + unsigned int fs_in, unsigned int vector_length, float BW_BB) : gr::block("signal_gen_cc", gr::io_signature::make(0, 0, sizeof(gr_complex)), + gr::io_signature::make(1, 1, sizeof(gr_complex) * vector_length)), + signal_(signal1), + system_(system), + PRN_(PRN), + CN0_dB_(CN0_dB), + doppler_Hz_(doppler_Hz), + delay_chips_(delay_chips), + delay_sec_(delay_sec), + data_flag_(data_flag), + noise_flag_(noise_flag), + fs_in_(fs_in), + num_sats_(PRN.size()), + vector_length_(vector_length), + BW_BB_(BW_BB * static_cast(fs_in) / 2.0) { init(); generate_codes(); @@ -86,7 +85,7 @@ void signal_generator_c::init() { work_counter_ = 0; - complex_phase_ = static_cast(volk_gnsssdr_malloc(vector_length_ * sizeof(gr_complex), volk_gnsssdr_get_alignment())); + complex_phase_ = static_cast(volk_gnsssdr_malloc(vector_length_ * sizeof(gr_complex), volk_gnsssdr_get_alignment())); // True if Galileo satellites are present bool galileo_signal = std::find(system_.begin(), system_.end(), "E") != system_.end(); @@ -102,16 +101,14 @@ void signal_generator_c::init() if (system_[sat] == "G") { - samples_per_code_.push_back(round(static_cast(fs_in_) - / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS))); + samples_per_code_.push_back(round(static_cast(fs_in_) / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS))); num_of_codes_per_vector_.push_back(galileo_signal ? 4 * static_cast(Galileo_E1_C_SECONDARY_CODE_LENGTH) : 1); data_bit_duration_ms_.push_back(1e3 / GPS_CA_TELEMETRY_RATE_BITS_SECOND); } else if (system_[sat] == "R") { - samples_per_code_.push_back(round(static_cast(fs_in_) - / (GLONASS_L1_CA_CODE_RATE_HZ / GLONASS_L1_CA_CODE_LENGTH_CHIPS))); + samples_per_code_.push_back(round(static_cast(fs_in_) / (GLONASS_L1_CA_CODE_RATE_HZ / GLONASS_L1_CA_CODE_LENGTH_CHIPS))); num_of_codes_per_vector_.push_back(galileo_signal ? 4 * static_cast(Galileo_E1_C_SECONDARY_CODE_LENGTH) : 1); data_bit_duration_ms_.push_back(1e3 / GLONASS_GNAV_TELEMETRY_RATE_BITS_SECOND); @@ -121,16 +118,14 @@ void signal_generator_c::init() if (signal_[sat].at(0) == '5') { int codelen = static_cast(Galileo_E5a_CODE_LENGTH_CHIPS); - samples_per_code_.push_back(round(static_cast(fs_in_) / (Galileo_E5a_CODE_CHIP_RATE_HZ - / codelen))); + samples_per_code_.push_back(round(static_cast(fs_in_) / (Galileo_E5a_CODE_CHIP_RATE_HZ / codelen))); num_of_codes_per_vector_.push_back(1); - data_bit_duration_ms_.push_back(1e3/Galileo_E5a_SYMBOL_RATE_BPS); + data_bit_duration_ms_.push_back(1e3 / Galileo_E5a_SYMBOL_RATE_BPS); } else { - samples_per_code_.push_back(round(static_cast(fs_in_) / (Galileo_E1_CODE_CHIP_RATE_HZ - / Galileo_E1_B_CODE_LENGTH_CHIPS))); + samples_per_code_.push_back(round(static_cast(fs_in_) / (Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS))); num_of_codes_per_vector_.push_back(static_cast(Galileo_E1_C_SECONDARY_CODE_LENGTH)); data_bit_duration_ms_.push_back(1e3 / Galileo_E1_B_SYMBOL_RATE_BPS); @@ -145,27 +140,27 @@ void signal_generator_c::init() void signal_generator_c::generate_codes() { - sampled_code_data_.reset(new gr_complex*[num_sats_]); - sampled_code_pilot_.reset(new gr_complex*[num_sats_]); + sampled_code_data_.reset(new gr_complex *[num_sats_]); + sampled_code_pilot_.reset(new gr_complex *[num_sats_]); for (unsigned int sat = 0; sat < num_sats_; sat++) { - sampled_code_data_[sat] = static_cast(std::malloc(vector_length_ * sizeof(gr_complex))); + sampled_code_data_[sat] = static_cast(std::malloc(vector_length_ * sizeof(gr_complex))); - gr_complex code[64000]; //[samples_per_code_[sat]]; + gr_complex code[64000]; //[samples_per_code_[sat]]; if (system_[sat] == "G") { // Generate one code-period of 1C signal gps_l1_ca_code_gen_complex_sampled(code, PRN_[sat], fs_in_, - static_cast(GPS_L1_CA_CODE_LENGTH_CHIPS) - delay_chips_[sat]); + static_cast(GPS_L1_CA_CODE_LENGTH_CHIPS) - delay_chips_[sat]); // Obtain the desired CN0 assuming that Pn = 1. if (noise_flag_) { for (unsigned int i = 0; i < samples_per_code_[sat]; i++) { - code[i] *= sqrt(pow(10,CN0_dB_[sat] / 10) / BW_BB_); + code[i] *= sqrt(pow(10, CN0_dB_[sat] / 10) / BW_BB_); } } @@ -173,21 +168,21 @@ void signal_generator_c::generate_codes() for (unsigned int i = 0; i < num_of_codes_per_vector_[sat]; i++) { memcpy(&(sampled_code_data_[sat][i * samples_per_code_[sat]]), - code, sizeof(gr_complex) * samples_per_code_[sat]); + code, sizeof(gr_complex) * samples_per_code_[sat]); } } else if (system_[sat] == "R") { // Generate one code-period of 1G signal glonass_l1_ca_code_gen_complex_sampled(code, /*PRN_[sat],*/ fs_in_, - static_cast(GLONASS_L1_CA_CODE_LENGTH_CHIPS) - delay_chips_[sat]); + static_cast(GLONASS_L1_CA_CODE_LENGTH_CHIPS) - delay_chips_[sat]); // Obtain the desired CN0 assuming that Pn = 1. if (noise_flag_) { for (unsigned int i = 0; i < samples_per_code_[sat]; i++) { - code[i] *= sqrt(pow(10,CN0_dB_[sat] / 10) / BW_BB_); + code[i] *= sqrt(pow(10, CN0_dB_[sat] / 10) / BW_BB_); } } @@ -195,18 +190,18 @@ void signal_generator_c::generate_codes() for (unsigned int i = 0; i < num_of_codes_per_vector_[sat]; i++) { memcpy(&(sampled_code_data_[sat][i * samples_per_code_[sat]]), - code, sizeof(gr_complex) * samples_per_code_[sat]); + code, sizeof(gr_complex) * samples_per_code_[sat]); } } else if (system_[sat] == "E") { - if(signal_[sat].at(0) == '5') + if (signal_[sat].at(0) == '5') { char signal[3]; strcpy(signal, "5X"); - galileo_e5_a_code_gen_complex_sampled(sampled_code_data_[sat] , signal, PRN_[sat], fs_in_, - static_cast(Galileo_E5a_CODE_LENGTH_CHIPS) - delay_chips_[sat]); + galileo_e5_a_code_gen_complex_sampled(sampled_code_data_[sat], signal, PRN_[sat], fs_in_, + static_cast(Galileo_E5a_CODE_LENGTH_CHIPS) - delay_chips_[sat]); //noise if (noise_flag_) { @@ -224,7 +219,7 @@ void signal_generator_c::generate_codes() strcpy(signal, "1B"); galileo_e1_code_gen_complex_sampled(code, signal, cboc, PRN_[sat], fs_in_, - static_cast(Galileo_E1_B_CODE_LENGTH_CHIPS) - delay_chips_[sat]); + static_cast(Galileo_E1_B_CODE_LENGTH_CHIPS) - delay_chips_[sat]); // Obtain the desired CN0 assuming that Pn = 1. if (noise_flag_) @@ -239,16 +234,16 @@ void signal_generator_c::generate_codes() for (unsigned int i = 0; i < num_of_codes_per_vector_[sat]; i++) { memcpy(&(sampled_code_data_[sat][i * samples_per_code_[sat]]), - code, sizeof(gr_complex) * samples_per_code_[sat]); + code, sizeof(gr_complex) * samples_per_code_[sat]); } // Generate E1C signal (25 code-periods, with secondary code) - sampled_code_pilot_[sat] = static_cast(std::malloc(vector_length_ * sizeof(gr_complex))); + sampled_code_pilot_[sat] = static_cast(std::malloc(vector_length_ * sizeof(gr_complex))); strcpy(signal, "1C"); galileo_e1_code_gen_complex_sampled(sampled_code_pilot_[sat], signal, cboc, PRN_[sat], fs_in_, - static_cast(Galileo_E1_B_CODE_LENGTH_CHIPS) - delay_chips_[sat], true); + static_cast(Galileo_E1_B_CODE_LENGTH_CHIPS) - delay_chips_[sat], true); // Obtain the desired CN0 assuming that Pn = 1. if (noise_flag_) @@ -264,7 +259,6 @@ void signal_generator_c::generate_codes() } - signal_generator_c::~signal_generator_c() { /* for (unsigned int sat = 0; sat < num_sats_; sat++) @@ -280,10 +274,10 @@ signal_generator_c::~signal_generator_c() } -int signal_generator_c::general_work (int noutput_items __attribute__((unused)), - gr_vector_int &ninput_items __attribute__((unused)), - gr_vector_const_void_star &input_items __attribute__((unused)), - gr_vector_void_star &output_items) +int signal_generator_c::general_work(int noutput_items __attribute__((unused)), + gr_vector_int &ninput_items __attribute__((unused)), + gr_vector_const_void_star &input_items __attribute__((unused)), + gr_vector_void_star &output_items) { gr_complex *out = reinterpret_cast(output_items[0]); @@ -297,7 +291,7 @@ int signal_generator_c::general_work (int noutput_items __attribute__((unused)), for (out_idx = 0; out_idx < vector_length_; out_idx++) { - out[out_idx] = gr_complex(0.0,0.0); + out[out_idx] = gr_complex(0.0, 0.0); } for (unsigned int sat = 0; sat < num_sats_; sat++) @@ -312,16 +306,13 @@ int signal_generator_c::general_work (int noutput_items __attribute__((unused)), if (system_[sat] == "G") { - unsigned int delay_samples = (delay_chips_[sat] % static_cast(GPS_L1_CA_CODE_LENGTH_CHIPS)) - * samples_per_code_[sat] / GPS_L1_CA_CODE_LENGTH_CHIPS; + unsigned int delay_samples = (delay_chips_[sat] % static_cast(GPS_L1_CA_CODE_LENGTH_CHIPS)) * samples_per_code_[sat] / GPS_L1_CA_CODE_LENGTH_CHIPS; for (i = 0; i < num_of_codes_per_vector_[sat]; i++) { for (k = 0; k < delay_samples; k++) { - out[out_idx] += sampled_code_data_[sat][out_idx] - * current_data_bits_[sat] - * complex_phase_[out_idx]; + out[out_idx] += sampled_code_data_[sat][out_idx] * current_data_bits_[sat] * complex_phase_[out_idx]; out_idx++; } @@ -333,14 +324,11 @@ int signal_generator_c::general_work (int noutput_items __attribute__((unused)), for (k = delay_samples; k < samples_per_code_[sat]; k++) { - out[out_idx] += sampled_code_data_[sat][out_idx] - * current_data_bits_[sat] - * complex_phase_[out_idx]; + out[out_idx] += sampled_code_data_[sat][out_idx] * current_data_bits_[sat] * complex_phase_[out_idx]; out_idx++; } - ms_counter_[sat] = (ms_counter_[sat] + static_cast(round(1e3*GPS_L1_CA_CODE_PERIOD))) - % data_bit_duration_ms_[sat]; + ms_counter_[sat] = (ms_counter_[sat] + static_cast(round(1e3 * GPS_L1_CA_CODE_PERIOD))) % data_bit_duration_ms_[sat]; } } @@ -351,16 +339,13 @@ int signal_generator_c::general_work (int noutput_items __attribute__((unused)), _phase[0] = -start_phase_rad_[sat]; volk_gnsssdr_s32f_sincos_32fc(complex_phase_, -phase_step_rad, _phase, vector_length_); - unsigned int delay_samples = (delay_chips_[sat] % static_cast(GLONASS_L1_CA_CODE_LENGTH_CHIPS)) - * samples_per_code_[sat] / GLONASS_L1_CA_CODE_LENGTH_CHIPS; + unsigned int delay_samples = (delay_chips_[sat] % static_cast(GLONASS_L1_CA_CODE_LENGTH_CHIPS)) * samples_per_code_[sat] / GLONASS_L1_CA_CODE_LENGTH_CHIPS; for (i = 0; i < num_of_codes_per_vector_[sat]; i++) { for (k = 0; k < delay_samples; k++) { - out[out_idx] += sampled_code_data_[sat][out_idx] - * current_data_bits_[sat] - * complex_phase_[out_idx]; + out[out_idx] += sampled_code_data_[sat][out_idx] * current_data_bits_[sat] * complex_phase_[out_idx]; out_idx++; } @@ -372,62 +357,56 @@ int signal_generator_c::general_work (int noutput_items __attribute__((unused)), for (k = delay_samples; k < samples_per_code_[sat]; k++) { - out[out_idx] += sampled_code_data_[sat][out_idx] - * current_data_bits_[sat] - * complex_phase_[out_idx]; + out[out_idx] += sampled_code_data_[sat][out_idx] * current_data_bits_[sat] * complex_phase_[out_idx]; out_idx++; } - ms_counter_[sat] = (ms_counter_[sat] + static_cast(round(1e3*GLONASS_L1_CA_CODE_PERIOD))) - % data_bit_duration_ms_[sat]; + ms_counter_[sat] = (ms_counter_[sat] + static_cast(round(1e3 * GLONASS_L1_CA_CODE_PERIOD))) % data_bit_duration_ms_[sat]; } } else if (system_[sat] == "E") { - if(signal_[sat].at(0)=='5') + if (signal_[sat].at(0) == '5') { // EACH WORK outputs 1 modulated primary code int codelen = static_cast(Galileo_E5a_CODE_LENGTH_CHIPS); - unsigned int delay_samples = (delay_chips_[sat] % codelen) - * samples_per_code_[sat] / codelen; + unsigned int delay_samples = (delay_chips_[sat] % codelen) * samples_per_code_[sat] / codelen; for (k = 0; k < delay_samples; k++) { - out[out_idx] += (gr_complex(sampled_code_data_[sat][out_idx].real()*data_modulation_[sat], - sampled_code_data_[sat][out_idx].imag()*pilot_modulation_[sat]) ) - * complex_phase_[out_idx]; + out[out_idx] += (gr_complex(sampled_code_data_[sat][out_idx].real() * data_modulation_[sat], + sampled_code_data_[sat][out_idx].imag() * pilot_modulation_[sat])) * + complex_phase_[out_idx]; out_idx++; } - if (ms_counter_[sat]%data_bit_duration_ms_[sat] == 0 && data_flag_) + if (ms_counter_[sat] % data_bit_duration_ms_[sat] == 0 && data_flag_) { // New random data bit - current_data_bit_int_[sat] = (uniform_dist(e1)%2) == 0 ? 1 : -1; + current_data_bit_int_[sat] = (uniform_dist(e1) % 2) == 0 ? 1 : -1; } - data_modulation_[sat] = current_data_bit_int_[sat] * (Galileo_E5a_I_SECONDARY_CODE.at((ms_counter_[sat]+delay_sec_[sat]) % 20) == '0' ? 1 : -1); + data_modulation_[sat] = current_data_bit_int_[sat] * (Galileo_E5a_I_SECONDARY_CODE.at((ms_counter_[sat] + delay_sec_[sat]) % 20) == '0' ? 1 : -1); pilot_modulation_[sat] = (Galileo_E5a_Q_SECONDARY_CODE[PRN_[sat] - 1].at((ms_counter_[sat] + delay_sec_[sat]) % 100) == '0' ? 1 : -1); - ms_counter_[sat] = ms_counter_[sat] + static_cast(round(1e3*GALILEO_E5a_CODE_PERIOD)); + ms_counter_[sat] = ms_counter_[sat] + static_cast(round(1e3 * GALILEO_E5a_CODE_PERIOD)); for (k = delay_samples; k < samples_per_code_[sat]; k++) { - out[out_idx] += (gr_complex(sampled_code_data_[sat][out_idx].real() * data_modulation_[sat] , - sampled_code_data_[sat][out_idx].imag() * pilot_modulation_[sat]) ) - * complex_phase_[out_idx]; + out[out_idx] += (gr_complex(sampled_code_data_[sat][out_idx].real() * data_modulation_[sat], + sampled_code_data_[sat][out_idx].imag() * pilot_modulation_[sat])) * + complex_phase_[out_idx]; out_idx++; } } else { - unsigned int delay_samples = (delay_chips_[sat] % static_cast(Galileo_E1_B_CODE_LENGTH_CHIPS)) - * samples_per_code_[sat] / Galileo_E1_B_CODE_LENGTH_CHIPS; + unsigned int delay_samples = (delay_chips_[sat] % static_cast(Galileo_E1_B_CODE_LENGTH_CHIPS)) * samples_per_code_[sat] / Galileo_E1_B_CODE_LENGTH_CHIPS; for (i = 0; i < num_of_codes_per_vector_[sat]; i++) { for (k = 0; k < delay_samples; k++) { - out[out_idx] += (sampled_code_data_[sat][out_idx] * current_data_bits_[sat] - - sampled_code_pilot_[sat][out_idx]) * complex_phase_[out_idx]; + out[out_idx] += (sampled_code_data_[sat][out_idx] * current_data_bits_[sat] - sampled_code_pilot_[sat][out_idx]) * complex_phase_[out_idx]; out_idx++; } @@ -439,9 +418,7 @@ int signal_generator_c::general_work (int noutput_items __attribute__((unused)), for (k = delay_samples; k < samples_per_code_[sat]; k++) { - out[out_idx] += (sampled_code_data_[sat][out_idx] * current_data_bits_[sat] - - sampled_code_pilot_[sat][out_idx]) - * complex_phase_[out_idx]; + out[out_idx] += (sampled_code_data_[sat][out_idx] * current_data_bits_[sat] - sampled_code_pilot_[sat][out_idx]) * complex_phase_[out_idx]; out_idx++; } @@ -455,7 +432,7 @@ int signal_generator_c::general_work (int noutput_items __attribute__((unused)), { for (out_idx = 0; out_idx < vector_length_; out_idx++) { - out[out_idx] += gr_complex(random_->gasdev(),random_->gasdev()); + out[out_idx] += gr_complex(random_->gasdev(), random_->gasdev()); } } diff --git a/src/algorithms/signal_generator/gnuradio_blocks/signal_generator_c.h b/src/algorithms/signal_generator/gnuradio_blocks/signal_generator_c.h index 93a938347..c01b6c8e0 100644 --- a/src/algorithms/signal_generator/gnuradio_blocks/signal_generator_c.h +++ b/src/algorithms/signal_generator/gnuradio_blocks/signal_generator_c.h @@ -62,10 +62,10 @@ typedef boost::shared_ptr signal_generator_c_sptr; * interface for creating new instances. */ signal_generator_c_sptr -signal_make_generator_c (std::vector signal1, std::vector system, const std::vector &PRN, - const std::vector &CN0_dB, const std::vector &doppler_Hz, - const std::vector &delay_chips,const std::vector &delay_sec, bool data_flag, bool noise_flag, - unsigned int fs_in, unsigned int vector_length, float BW_BB); +signal_make_generator_c(std::vector signal1, std::vector system, const std::vector &PRN, + const std::vector &CN0_dB, const std::vector &doppler_Hz, + const std::vector &delay_chips, const std::vector &delay_sec, bool data_flag, bool noise_flag, + unsigned int fs_in, unsigned int vector_length, float BW_BB); /*! * \brief This class generates synthesized GNSS signal. @@ -81,15 +81,15 @@ private: /* Create the signal_generator_c object*/ friend signal_generator_c_sptr - signal_make_generator_c (std::vector signal1, std::vector system, const std::vector &PRN, - const std::vector &CN0_dB, const std::vector &doppler_Hz, - const std::vector &delay_chips,const std::vector &delay_sec, bool data_flag, bool noise_flag, - unsigned int fs_in, unsigned int vector_length, float BW_BB); + signal_make_generator_c(std::vector signal1, std::vector system, const std::vector &PRN, + const std::vector &CN0_dB, const std::vector &doppler_Hz, + const std::vector &delay_chips, const std::vector &delay_sec, bool data_flag, bool noise_flag, + unsigned int fs_in, unsigned int vector_length, float BW_BB); - signal_generator_c (std::vector signal1, std::vector system, const std::vector &PRN, - const std::vector &CN0_dB, const std::vector &doppler_Hz, - const std::vector &delay_chips,const std::vector &delay_sec, bool data_flag, bool noise_flag, - unsigned int fs_in, unsigned int vector_length, float BW_BB); + signal_generator_c(std::vector signal1, std::vector system, const std::vector &PRN, + const std::vector &CN0_dB, const std::vector &doppler_Hz, + const std::vector &delay_chips, const std::vector &delay_sec, bool data_flag, bool noise_flag, + unsigned int fs_in, unsigned int vector_length, float BW_BB); void init(); void generate_codes(); @@ -118,10 +118,10 @@ private: std::vector data_modulation_; std::vector pilot_modulation_; - boost::scoped_array sampled_code_data_; - boost::scoped_array sampled_code_pilot_; - gr::random* random_; - gr_complex* complex_phase_; + boost::scoped_array sampled_code_data_; + boost::scoped_array sampled_code_pilot_; + gr::random *random_; + gr_complex *complex_phase_; unsigned int work_counter_; std::random_device r; @@ -129,14 +129,14 @@ private: std::uniform_int_distribution uniform_dist; public: - ~signal_generator_c(); // public destructor + ~signal_generator_c(); // public destructor // Where all the action really happens - int general_work (int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); + int general_work(int noutput_items, + gr_vector_int &ninput_items, + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items); }; #endif /* GNSS_SDR_SIGNAL_GENERATOR_C_H */ diff --git a/src/algorithms/signal_source/adapters/file_signal_source.cc b/src/algorithms/signal_source/adapters/file_signal_source.cc index f05d5b1bd..7a63c0795 100644 --- a/src/algorithms/signal_source/adapters/file_signal_source.cc +++ b/src/algorithms/signal_source/adapters/file_signal_source.cc @@ -41,14 +41,12 @@ #include - using google::LogMessage; FileSignalSource::FileSignalSource(ConfigurationInterface* configuration, - std::string role, unsigned int in_streams, unsigned int out_streams, - boost::shared_ptr queue) : - role_(role), in_streams_(in_streams), out_streams_(out_streams), queue_(queue) + std::string role, unsigned int in_streams, unsigned int out_streams, + boost::shared_ptr queue) : role_(role), in_streams_(in_streams), out_streams_(out_streams), queue_(queue) { std::string default_filename = "./example_capture.dat"; std::string default_item_type = "short"; @@ -61,8 +59,8 @@ FileSignalSource::FileSignalSource(ConfigurationInterface* configuration, filename_ = configuration->property(role + ".filename", default_filename); // override value with commandline flag, if present - if (FLAGS_signal_source.compare("-") != 0) filename_= FLAGS_signal_source; - if (FLAGS_s.compare("-") != 0) filename_= FLAGS_s; + if (FLAGS_signal_source.compare("-") != 0) filename_ = FLAGS_signal_source; + if (FLAGS_s.compare("-") != 0) filename_ = FLAGS_s; item_type_ = configuration->property(role + ".item_type", default_item_type); repeat_ = configuration->property(role + ".repeat", false); @@ -70,8 +68,8 @@ FileSignalSource::FileSignalSource(ConfigurationInterface* configuration, dump_filename_ = configuration->property(role + ".dump_filename", default_dump_filename); enable_throttle_control_ = configuration->property(role + ".enable_throttle_control", false); - double seconds_to_skip = configuration->property(role + ".seconds_to_skip", default_seconds_to_skip ); - header_size = configuration->property( role + ".header_size", 0 ); + double seconds_to_skip = configuration->property(role + ".seconds_to_skip", default_seconds_to_skip); + header_size = configuration->property(role + ".header_size", 0); long samples_to_skip = 0; bool is_complex = false; @@ -105,84 +103,84 @@ FileSignalSource::FileSignalSource(ConfigurationInterface* configuration, else { LOG(WARNING) << item_type_ - << " unrecognized item type. Using gr_complex."; + << " unrecognized item type. Using gr_complex."; item_size_ = sizeof(gr_complex); } try - { + { file_source_ = gr::blocks::file_source::make(item_size_, filename_.c_str(), repeat_); - if( seconds_to_skip > 0 ) + if (seconds_to_skip > 0) { - samples_to_skip = static_cast< long >( seconds_to_skip * sampling_frequency_ ); + samples_to_skip = static_cast(seconds_to_skip * sampling_frequency_); - if( is_complex ) + if (is_complex) { samples_to_skip *= 2; } } - if( header_size > 0 ) + if (header_size > 0) { samples_to_skip += header_size; } - if( samples_to_skip > 0 ) + if (samples_to_skip > 0) { LOG(INFO) << "Skipping " << samples_to_skip << " samples of the input file"; - if( not file_source_->seek( samples_to_skip, SEEK_SET ) ) + if (not file_source_->seek(samples_to_skip, SEEK_SET)) { LOG(INFO) << "Error skipping bytes!"; } } - } - catch (const std::exception &e) - { + } + catch (const std::exception& e) + { if (filename_.compare(default_filename) == 0) { std::cerr - << "The configuration file has not been found." - << std::endl - << "Please create a configuration file based on the examples at the 'conf/' folder " - << std::endl - << "and then generate your own GNSS Software Defined Receiver by doing:" - << std::endl - << "$ gnss-sdr --config_file=/path/to/my_GNSS_SDR_configuration.conf" - << std::endl; + << "The configuration file has not been found." + << std::endl + << "Please create a configuration file based on the examples at the 'conf/' folder " + << std::endl + << "and then generate your own GNSS Software Defined Receiver by doing:" + << std::endl + << "$ gnss-sdr --config_file=/path/to/my_GNSS_SDR_configuration.conf" + << std::endl; } else { std::cerr - << "The receiver was configured to work with a file signal source " - << std::endl - << "but the specified file is unreachable by GNSS-SDR." - << std::endl - << "Please modify your configuration file" - << std::endl - << "and point SignalSource.filename to a valid raw data file. Then:" - << std::endl - << "$ gnss-sdr --config_file=/path/to/my_GNSS_SDR_configuration.conf" - << std::endl - << "Examples of configuration files available at:" - << std::endl - << GNSSSDR_INSTALL_DIR "/share/gnss-sdr/conf/" - << std::endl; + << "The receiver was configured to work with a file signal source " + << std::endl + << "but the specified file is unreachable by GNSS-SDR." + << std::endl + << "Please modify your configuration file" + << std::endl + << "and point SignalSource.filename to a valid raw data file. Then:" + << std::endl + << "$ gnss-sdr --config_file=/path/to/my_GNSS_SDR_configuration.conf" + << std::endl + << "Examples of configuration files available at:" + << std::endl + << GNSSSDR_INSTALL_DIR "/share/gnss-sdr/conf/" + << std::endl; } LOG(INFO) << "file_signal_source: Unable to open the samples file " << filename_.c_str() << ", exiting the program."; throw(e); - } + } DLOG(INFO) << "file_source(" << file_source_->unique_id() << ")"; - if (samples_ == 0) // read all file + if (samples_ == 0) // read all file { /*! * BUG workaround: The GNU Radio file source does not stop the receiver after reaching the End of File. * A possible solution is to compute the file length in samples using file size, excluding the last 100 milliseconds, and enable always the * valve block */ - std::ifstream file (filename_.c_str(), std::ios::in | std::ios::binary | std::ios::ate); + std::ifstream file(filename_.c_str(), std::ios::in | std::ios::binary | std::ios::ate); std::ifstream::pos_type size; if (file.is_open()) @@ -198,21 +196,21 @@ FileSignalSource::FileSignalSource(ConfigurationInterface* configuration, std::streamsize ss = std::cout.precision(); std::cout << std::setprecision(16); std::cout << "Processing file " << filename_ << ", which contains " << static_cast(size) << " [bytes]" << std::endl; - std::cout.precision (ss); + std::cout.precision(ss); if (size > 0) { - long bytes_to_skip = samples_to_skip*item_size_; + long bytes_to_skip = samples_to_skip * item_size_; long bytes_to_process = static_cast(size) - bytes_to_skip; - samples_ = floor(static_cast(bytes_to_process) / static_cast(item_size()) - ceil(0.002 * static_cast(sampling_frequency_))); //process all the samples available in the file excluding at least the last 1 ms + samples_ = floor(static_cast(bytes_to_process) / static_cast(item_size()) - ceil(0.002 * static_cast(sampling_frequency_))); //process all the samples available in the file excluding at least the last 1 ms } } CHECK(samples_ > 0) << "File does not contain enough samples to process."; double signal_duration_s; - signal_duration_s = static_cast(samples_) * ( 1 / static_cast(sampling_frequency_)); + signal_duration_s = static_cast(samples_) * (1 / static_cast(sampling_frequency_)); - if( is_complex ) + if (is_complex) { signal_duration_s /= 2.0; } @@ -246,7 +244,8 @@ FileSignalSource::FileSignalSource(ConfigurationInterface* configuration, FileSignalSource::~FileSignalSource() -{} +{ +} void FileSignalSource::connect(gr::top_block_sptr top_block) diff --git a/src/algorithms/signal_source/adapters/file_signal_source.h b/src/algorithms/signal_source/adapters/file_signal_source.h index 850c73e93..9628010cd 100644 --- a/src/algorithms/signal_source/adapters/file_signal_source.h +++ b/src/algorithms/signal_source/adapters/file_signal_source.h @@ -49,12 +49,12 @@ class ConfigurationInterface; * \brief Class that reads signals samples from a file * and adapts it to a SignalSourceInterface */ -class FileSignalSource: public GNSSBlockInterface +class FileSignalSource : public GNSSBlockInterface { public: FileSignalSource(ConfigurationInterface* configuration, std::string role, - unsigned int in_streams, unsigned int out_streams, - boost::shared_ptr queue); + unsigned int in_streams, unsigned int out_streams, + boost::shared_ptr queue); virtual ~FileSignalSource(); @@ -120,7 +120,7 @@ private: gr::blocks::file_source::sptr file_source_; boost::shared_ptr valve_; gr::blocks::file_sink::sptr sink_; - gr::blocks::throttle::sptr throttle_; + gr::blocks::throttle::sptr throttle_; boost::shared_ptr queue_; size_t item_size_; // Throttle control diff --git a/src/algorithms/signal_source/adapters/flexiband_signal_source.cc b/src/algorithms/signal_source/adapters/flexiband_signal_source.cc index ee5f7411a..635ef267d 100644 --- a/src/algorithms/signal_source/adapters/flexiband_signal_source.cc +++ b/src/algorithms/signal_source/adapters/flexiband_signal_source.cc @@ -39,8 +39,7 @@ using google::LogMessage; FlexibandSignalSource::FlexibandSignalSource(ConfigurationInterface* configuration, - std::string role, unsigned int in_stream, unsigned int out_stream, gr::msg_queue::sptr queue) : - role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(queue) + std::string role, unsigned int in_stream, unsigned int out_stream, gr::msg_queue::sptr queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(queue) { std::string default_item_type = "byte"; item_type_ = configuration->property(role + ".item_type", default_item_type); @@ -48,12 +47,12 @@ FlexibandSignalSource::FlexibandSignalSource(ConfigurationInterface* configurati std::string default_firmware_file = "flexiband_I-1b.bit"; firmware_filename_ = configuration->property(role + ".firmware_file", default_firmware_file); - gain1_ = configuration->property(role + ".gain1", 0); // check gain DAC values for Flexiband frontend! - gain2_ = configuration->property(role + ".gain2", 0); // check gain DAC values for Flexiband frontend! - gain3_ = configuration->property(role + ".gain3", 0); // check gain DAC values for Flexiband frontend! + gain1_ = configuration->property(role + ".gain1", 0); // check gain DAC values for Flexiband frontend! + gain2_ = configuration->property(role + ".gain2", 0); // check gain DAC values for Flexiband frontend! + gain3_ = configuration->property(role + ".gain3", 0); // check gain DAC values for Flexiband frontend! - AGC_ = configuration->property(role + ".AGC", true); // enabled AGC by default - flag_read_file = configuration->property(role + ".flag_read_file", false); //disable read samples from file by default + AGC_ = configuration->property(role + ".AGC", true); // enabled AGC by default + flag_read_file = configuration->property(role + ".flag_read_file", false); //disable read samples from file by default std::string default_signal_file = "flexiband_frame_samples.bin"; signal_file = configuration->property(role + ".signal_file", default_signal_file); @@ -89,10 +88,9 @@ FlexibandSignalSource::FlexibandSignalSource(ConfigurationInterface* configurati } - FlexibandSignalSource::~FlexibandSignalSource() -{} - +{ +} void FlexibandSignalSource::connect(gr::top_block_sptr top_block) @@ -111,7 +109,6 @@ void FlexibandSignalSource::connect(gr::top_block_sptr top_block) } - void FlexibandSignalSource::disconnect(gr::top_block_sptr top_block) { for (int n = 0; n < (RF_channels_ * 2); n++) @@ -144,4 +141,3 @@ gr::basic_block_sptr FlexibandSignalSource::get_right_block(int RF_channel) { return float_to_complex_.at(RF_channel); } - diff --git a/src/algorithms/signal_source/adapters/flexiband_signal_source.h b/src/algorithms/signal_source/adapters/flexiband_signal_source.h index b071a5b75..82c28922f 100644 --- a/src/algorithms/signal_source/adapters/flexiband_signal_source.h +++ b/src/algorithms/signal_source/adapters/flexiband_signal_source.h @@ -49,12 +49,12 @@ class ConfigurationInterface; * \brief This class configures and reads samples from Teleorbit Flexiband front-end. * This software requires a Flexiband GNU Radio driver installed (not included with GNSS-SDR). */ -class FlexibandSignalSource: public GNSSBlockInterface +class FlexibandSignalSource : public GNSSBlockInterface { public: FlexibandSignalSource(ConfigurationInterface* configuration, - std::string role, unsigned int in_stream, - unsigned int out_stream, gr::msg_queue::sptr queue); + std::string role, unsigned int in_stream, + unsigned int out_stream, gr::msg_queue::sptr queue); virtual ~FlexibandSignalSource(); diff --git a/src/algorithms/signal_source/adapters/fmcomms2_signal_source.cc b/src/algorithms/signal_source/adapters/fmcomms2_signal_source.cc index 14c3a1386..389e9fd36 100644 --- a/src/algorithms/signal_source/adapters/fmcomms2_signal_source.cc +++ b/src/algorithms/signal_source/adapters/fmcomms2_signal_source.cc @@ -40,10 +40,8 @@ using google::LogMessage; Fmcomms2SignalSource::Fmcomms2SignalSource(ConfigurationInterface* configuration, - std::string role, unsigned int in_stream, unsigned int out_stream, - boost::shared_ptr queue) : - role_(role), in_stream_(in_stream), out_stream_(out_stream), - queue_(queue) + std::string role, unsigned int in_stream, unsigned int out_stream, + boost::shared_ptr queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(queue) { std::string default_item_type = "gr_complex"; std::string default_dump_file = "./data/signal_source.dat"; @@ -75,17 +73,17 @@ Fmcomms2SignalSource::Fmcomms2SignalSource(ConfigurationInterface* configuration std::cout << "LO frequency : " << freq_ << " Hz" << std::endl; std::cout << "sample rate: " << sample_rate_ << " Hz" << std::endl; - if(item_type_.compare("gr_complex") == 0) + if (item_type_.compare("gr_complex") == 0) { fmcomms2_source_f32c_ = gr::iio::fmcomms2_source_f32c::make( - uri_.c_str(), freq_, sample_rate_, - bandwidth_, - rx1_en_, rx2_en_, - buffer_size_, quadrature_, rf_dc_, - bb_dc_, gain_mode_rx1_.c_str(), rf_gain_rx1_, - gain_mode_rx2_.c_str(), rf_gain_rx2_, - rf_port_select_.c_str(), filter_file_.c_str(), - filter_auto_); + uri_.c_str(), freq_, sample_rate_, + bandwidth_, + rx1_en_, rx2_en_, + buffer_size_, quadrature_, rf_dc_, + bb_dc_, gain_mode_rx1_.c_str(), rf_gain_rx1_, + gain_mode_rx2_.c_str(), rf_gain_rx2_, + rf_port_select_.c_str(), filter_file_.c_str(), + filter_auto_); } else { @@ -109,7 +107,8 @@ Fmcomms2SignalSource::Fmcomms2SignalSource(ConfigurationInterface* configuration Fmcomms2SignalSource::~Fmcomms2SignalSource() -{} +{ +} void Fmcomms2SignalSource::connect(gr::top_block_sptr top_block) @@ -128,8 +127,7 @@ void Fmcomms2SignalSource::connect(gr::top_block_sptr top_block) { if (dump_) { - - top_block->connect(fmcomms2_source_f32c_ , 0, file_sink_, 0); + top_block->connect(fmcomms2_source_f32c_, 0, file_sink_, 0); DLOG(INFO) << "connected fmcomms2 source to file sink"; } } diff --git a/src/algorithms/signal_source/adapters/fmcomms2_signal_source.h b/src/algorithms/signal_source/adapters/fmcomms2_signal_source.h index a359c8cfe..1c24e4b4c 100644 --- a/src/algorithms/signal_source/adapters/fmcomms2_signal_source.h +++ b/src/algorithms/signal_source/adapters/fmcomms2_signal_source.h @@ -42,12 +42,12 @@ class ConfigurationInterface; -class Fmcomms2SignalSource: public GNSSBlockInterface +class Fmcomms2SignalSource : public GNSSBlockInterface { public: Fmcomms2SignalSource(ConfigurationInterface* configuration, - std::string role, unsigned int in_stream, - unsigned int out_stream, boost::shared_ptr queue); + std::string role, unsigned int in_stream, + unsigned int out_stream, boost::shared_ptr queue); virtual ~Fmcomms2SignalSource(); @@ -78,11 +78,11 @@ private: std::string role_; // Front-end settings - std::string uri_;//device direction - unsigned long freq_; //frequency of local oscilator + std::string uri_; //device direction + unsigned long freq_; //frequency of local oscilator unsigned long sample_rate_; unsigned long bandwidth_; - unsigned long buffer_size_; //reception buffer + unsigned long buffer_size_; //reception buffer bool rx1_en_; bool rx2_en_; bool quadrature_; diff --git a/src/algorithms/signal_source/adapters/gen_signal_source.cc b/src/algorithms/signal_source/adapters/gen_signal_source.cc index f709e419d..f14d803d5 100644 --- a/src/algorithms/signal_source/adapters/gen_signal_source.cc +++ b/src/algorithms/signal_source/adapters/gen_signal_source.cc @@ -42,11 +42,10 @@ using google::LogMessage; // Constructor GenSignalSource::GenSignalSource(GNSSBlockInterface *signal_generator, GNSSBlockInterface *filter, - std::string role, boost::shared_ptr queue) : - signal_generator_(signal_generator), - filter_(filter), - role_(role), - queue_(queue) + std::string role, boost::shared_ptr queue) : signal_generator_(signal_generator), + filter_(filter), + role_(role), + queue_(queue) { connected_ = false; } @@ -72,7 +71,7 @@ void GenSignalSource::connect(gr::top_block_sptr top_block) filter_->connect(top_block); top_block->connect(signal_generator_->get_right_block(), 0, - filter_->get_left_block(), 0); + filter_->get_left_block(), 0); DLOG(INFO) << "signal_generator -> filter"; @@ -89,7 +88,7 @@ void GenSignalSource::disconnect(gr::top_block_sptr top_block) } top_block->disconnect(signal_generator_->get_right_block(), 0, - filter_->get_left_block(), 0); + filter_->get_left_block(), 0); signal_generator_->disconnect(top_block); filter_->disconnect(top_block); @@ -108,4 +107,3 @@ gr::basic_block_sptr GenSignalSource::get_right_block() { return filter_->get_right_block(); } - diff --git a/src/algorithms/signal_source/adapters/gen_signal_source.h b/src/algorithms/signal_source/adapters/gen_signal_source.h index 1fcbc15a7..d9c9129bf 100644 --- a/src/algorithms/signal_source/adapters/gen_signal_source.h +++ b/src/algorithms/signal_source/adapters/gen_signal_source.h @@ -42,12 +42,12 @@ * \brief This class wraps blocks that generates synthesized GNSS signal and * filters the signal. */ -class GenSignalSource: public GNSSBlockInterface +class GenSignalSource : public GNSSBlockInterface { public: //! Constructor GenSignalSource(GNSSBlockInterface *signal_generator, GNSSBlockInterface *filter, - std::string role, boost::shared_ptr queue); + std::string role, boost::shared_ptr queue); //! Virtual destructor virtual ~GenSignalSource(); diff --git a/src/algorithms/signal_source/adapters/gn3s_signal_source.cc b/src/algorithms/signal_source/adapters/gn3s_signal_source.cc index 438723ff9..ae4e06f12 100644 --- a/src/algorithms/signal_source/adapters/gn3s_signal_source.cc +++ b/src/algorithms/signal_source/adapters/gn3s_signal_source.cc @@ -39,8 +39,7 @@ using google::LogMessage; Gn3sSignalSource::Gn3sSignalSource(ConfigurationInterface* configuration, - std::string role, unsigned int in_stream, unsigned int out_stream, gr::msg_queue::sptr queue) : - role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(queue) + std::string role, unsigned int in_stream, unsigned int out_stream, gr::msg_queue::sptr queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(queue) { std::string default_item_type = "short"; std::string default_dump_file = "./data/gn3s_source.dat"; @@ -54,7 +53,6 @@ Gn3sSignalSource::Gn3sSignalSource(ConfigurationInterface* configuration, gn3s_source_ = gn3s_make_source_cc(); DLOG(INFO) << "Item size " << item_size_; DLOG(INFO) << "gn3s_source(" << gn3s_source_->unique_id() << ")"; - } // else if (item_type_.compare("short") == 0) // { @@ -65,7 +63,7 @@ Gn3sSignalSource::Gn3sSignalSource(ConfigurationInterface* configuration, else { LOG(WARNING) << item_type_ - << " unrecognized item type for resampler"; + << " unrecognized item type for resampler"; item_size_ = sizeof(short); } if (dump_) @@ -80,10 +78,9 @@ Gn3sSignalSource::Gn3sSignalSource(ConfigurationInterface* configuration, } - Gn3sSignalSource::~Gn3sSignalSource() -{} - +{ +} void Gn3sSignalSource::connect(gr::top_block_sptr top_block) @@ -100,7 +97,6 @@ void Gn3sSignalSource::connect(gr::top_block_sptr top_block) } - void Gn3sSignalSource::disconnect(gr::top_block_sptr top_block) { if (dump_) diff --git a/src/algorithms/signal_source/adapters/gn3s_signal_source.h b/src/algorithms/signal_source/adapters/gn3s_signal_source.h index 146a5aaec..d1f8e67bf 100644 --- a/src/algorithms/signal_source/adapters/gn3s_signal_source.h +++ b/src/algorithms/signal_source/adapters/gn3s_signal_source.h @@ -44,12 +44,12 @@ class ConfigurationInterface; /*! * \brief This class reads samples from a GN3S USB dongle, a RF front-end signal sampler */ -class Gn3sSignalSource: public GNSSBlockInterface +class Gn3sSignalSource : public GNSSBlockInterface { public: Gn3sSignalSource(ConfigurationInterface* configuration, - std::string role, unsigned int in_stream, - unsigned int out_stream, gr::msg_queue::sptr queue); + std::string role, unsigned int in_stream, + unsigned int out_stream, gr::msg_queue::sptr queue); virtual ~Gn3sSignalSource(); diff --git a/src/algorithms/signal_source/adapters/labsat_signal_source.cc b/src/algorithms/signal_source/adapters/labsat_signal_source.cc index 3a5fb9175..1a342705d 100644 --- a/src/algorithms/signal_source/adapters/labsat_signal_source.cc +++ b/src/algorithms/signal_source/adapters/labsat_signal_source.cc @@ -34,12 +34,10 @@ #include - using google::LogMessage; LabsatSignalSource::LabsatSignalSource(ConfigurationInterface* configuration, - std::string role, unsigned int in_stream, unsigned int out_stream, gr::msg_queue::sptr queue) : - role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(queue) + std::string role, unsigned int in_stream, unsigned int out_stream, gr::msg_queue::sptr queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(queue) { std::string default_item_type = "gr_complex"; std::string default_dump_file = "./data/source.bin"; @@ -56,7 +54,7 @@ LabsatSignalSource::LabsatSignalSource(ConfigurationInterface* configuration, if (item_type_.compare("gr_complex") == 0) { item_size_ = sizeof(gr_complex); - labsat23_source_ = labsat23_make_source(filename_.c_str(),channel_selector); + labsat23_source_ = labsat23_make_source(filename_.c_str(), channel_selector); DLOG(INFO) << "Item size " << item_size_; DLOG(INFO) << "labsat23_source_(" << labsat23_source_->unique_id() << ")"; } @@ -77,10 +75,9 @@ LabsatSignalSource::LabsatSignalSource(ConfigurationInterface* configuration, } - LabsatSignalSource::~LabsatSignalSource() -{} - +{ +} void LabsatSignalSource::connect(gr::top_block_sptr top_block) @@ -97,7 +94,6 @@ void LabsatSignalSource::connect(gr::top_block_sptr top_block) } - void LabsatSignalSource::disconnect(gr::top_block_sptr top_block) { if (dump_) diff --git a/src/algorithms/signal_source/adapters/labsat_signal_source.h b/src/algorithms/signal_source/adapters/labsat_signal_source.h index 71942f90b..2a5775a67 100644 --- a/src/algorithms/signal_source/adapters/labsat_signal_source.h +++ b/src/algorithms/signal_source/adapters/labsat_signal_source.h @@ -43,12 +43,12 @@ class ConfigurationInterface; /*! * \brief This class reads samples stored by a LabSat 2 or LabSat 3 device */ -class LabsatSignalSource: public GNSSBlockInterface +class LabsatSignalSource : public GNSSBlockInterface { public: LabsatSignalSource(ConfigurationInterface* configuration, - std::string role, unsigned int in_stream, - unsigned int out_stream, gr::msg_queue::sptr queue); + std::string role, unsigned int in_stream, + unsigned int out_stream, gr::msg_queue::sptr queue); virtual ~LabsatSignalSource(); diff --git a/src/algorithms/signal_source/adapters/nsr_file_signal_source.cc b/src/algorithms/signal_source/adapters/nsr_file_signal_source.cc index 2208d15e7..b700adc2e 100644 --- a/src/algorithms/signal_source/adapters/nsr_file_signal_source.cc +++ b/src/algorithms/signal_source/adapters/nsr_file_signal_source.cc @@ -45,9 +45,8 @@ using google::LogMessage; NsrFileSignalSource::NsrFileSignalSource(ConfigurationInterface* configuration, - std::string role, unsigned int in_streams, unsigned int out_streams, - boost::shared_ptr queue) : - role_(role), in_streams_(in_streams), out_streams_(out_streams), queue_(queue) + std::string role, unsigned int in_streams, unsigned int out_streams, + boost::shared_ptr queue) : role_(role), in_streams_(in_streams), out_streams_(out_streams), queue_(queue) { std::string default_filename = "../data/my_capture.dat"; std::string default_item_type = "byte"; @@ -58,8 +57,8 @@ NsrFileSignalSource::NsrFileSignalSource(ConfigurationInterface* configuration, filename_ = configuration->property(role + ".filename", default_filename); // override value with commandline flag, if present - if (FLAGS_signal_source.compare("-") != 0) filename_= FLAGS_signal_source; - if (FLAGS_s.compare("-") != 0) filename_= FLAGS_s; + if (FLAGS_signal_source.compare("-") != 0) filename_ = FLAGS_signal_source; + if (FLAGS_s.compare("-") != 0) filename_ = FLAGS_s; item_type_ = configuration->property(role + ".item_type", default_item_type); repeat_ = configuration->property(role + ".repeat", false); @@ -73,48 +72,47 @@ NsrFileSignalSource::NsrFileSignalSource(ConfigurationInterface* configuration, } else { - LOG(WARNING) << item_type_ << " unrecognized item type. Using byte."; + LOG(WARNING) << item_type_ << " unrecognized item type. Using byte."; item_size_ = sizeof(char); } try - { + { file_source_ = gr::blocks::file_source::make(item_size_, filename_.c_str(), repeat_); unpack_byte_ = make_unpack_byte_2bit_samples(); - - } - catch (const std::exception &e) - { + } + catch (const std::exception& e) + { std::cerr - << "The receiver was configured to work with a file signal source " - << std::endl - << "but the specified file is unreachable by GNSS-SDR." - << std::endl - << "Please modify your configuration file" - << std::endl - << "and point SignalSource.filename to a valid raw data file. Then:" - << std::endl - << "$ gnss-sdr --config_file=/path/to/my_GNSS_SDR_configuration.conf" - << std::endl - << "Examples of configuration files available at:" - << std::endl - << GNSSSDR_INSTALL_DIR "/share/gnss-sdr/conf/" - << std::endl; + << "The receiver was configured to work with a file signal source " + << std::endl + << "but the specified file is unreachable by GNSS-SDR." + << std::endl + << "Please modify your configuration file" + << std::endl + << "and point SignalSource.filename to a valid raw data file. Then:" + << std::endl + << "$ gnss-sdr --config_file=/path/to/my_GNSS_SDR_configuration.conf" + << std::endl + << "Examples of configuration files available at:" + << std::endl + << GNSSSDR_INSTALL_DIR "/share/gnss-sdr/conf/" + << std::endl; LOG(WARNING) << "file_signal_source: Unable to open the samples file " << filename_.c_str() << ", exiting the program."; throw(e); - } + } DLOG(INFO) << "file_source(" << file_source_->unique_id() << ")"; - if (samples_ == 0) // read all file + if (samples_ == 0) // read all file { /*! * BUG workaround: The GNU Radio file source does not stop the receiver after reaching the End of File. * A possible solution is to compute the file length in samples using file size, excluding the last 2 milliseconds, and enable always the * valve block */ - std::ifstream file (filename_.c_str(), std::ios::in | std::ios::binary | std::ios::ate); + std::ifstream file(filename_.c_str(), std::ios::in | std::ios::binary | std::ios::ate); std::ifstream::pos_type size; if (file.is_open()) @@ -130,19 +128,19 @@ NsrFileSignalSource::NsrFileSignalSource(ConfigurationInterface* configuration, std::streamsize ss = std::cout.precision(); std::cout << std::setprecision(16); std::cout << "Processing file " << filename_ << ", which contains " << size << " [bytes]" << std::endl; - std::cout.precision (ss); + std::cout.precision(ss); if (size > 0) { - int sample_packet_factor = 4; // 1 byte -> 4 samples + int sample_packet_factor = 4; // 1 byte -> 4 samples samples_ = floor(static_cast(size) / static_cast(item_size())) * sample_packet_factor; - samples_ = samples_- ceil(0.002 * static_cast(sampling_frequency_)); //process all the samples available in the file excluding the last 2 ms + samples_ = samples_ - ceil(0.002 * static_cast(sampling_frequency_)); //process all the samples available in the file excluding the last 2 ms } } CHECK(samples_ > 0) << "File does not contain enough samples to process."; double signal_duration_s; - signal_duration_s = static_cast(samples_) * ( 1 /static_cast(sampling_frequency_)); + signal_duration_s = static_cast(samples_) * (1 / static_cast(sampling_frequency_)); LOG(INFO) << "Total number samples to be processed= " << samples_ << " GNSS signal duration= " << signal_duration_s << " [s]"; std::cout << "GNSS signal recorded time to be processed: " << signal_duration_s << " [s]" << std::endl; @@ -171,12 +169,9 @@ NsrFileSignalSource::NsrFileSignalSource(ConfigurationInterface* configuration, } - - NsrFileSignalSource::~NsrFileSignalSource() -{} - - +{ +} void NsrFileSignalSource::connect(gr::top_block_sptr top_block) @@ -186,7 +181,7 @@ void NsrFileSignalSource::connect(gr::top_block_sptr top_block) if (enable_throttle_control_ == true) { top_block->connect(file_source_, 0, unpack_byte_, 0); - top_block->connect(unpack_byte_, 0,throttle_,0); + top_block->connect(unpack_byte_, 0, throttle_, 0); DLOG(INFO) << "connected file source to throttle"; top_block->connect(throttle_, 0, valve_, 0); DLOG(INFO) << "connected throttle to valve"; @@ -199,7 +194,7 @@ void NsrFileSignalSource::connect(gr::top_block_sptr top_block) else { top_block->connect(file_source_, 0, unpack_byte_, 0); - top_block->connect(unpack_byte_, 0,valve_,0); + top_block->connect(unpack_byte_, 0, valve_, 0); DLOG(INFO) << "connected file source to valve"; if (dump_) { @@ -213,7 +208,7 @@ void NsrFileSignalSource::connect(gr::top_block_sptr top_block) if (enable_throttle_control_ == true) { top_block->connect(file_source_, 0, unpack_byte_, 0); - top_block->connect(unpack_byte_, 0,throttle_,0); + top_block->connect(unpack_byte_, 0, throttle_, 0); DLOG(INFO) << "connected file source to throttle"; if (dump_) { @@ -234,10 +229,6 @@ void NsrFileSignalSource::connect(gr::top_block_sptr top_block) } - - - - void NsrFileSignalSource::disconnect(gr::top_block_sptr top_block) { if (samples_ > 0) @@ -246,7 +237,7 @@ void NsrFileSignalSource::disconnect(gr::top_block_sptr top_block) { top_block->disconnect(file_source_, 0, unpack_byte_, 0); DLOG(INFO) << "disconnected file source to unpack_byte_"; - top_block->connect(unpack_byte_, 0,throttle_,0); + top_block->connect(unpack_byte_, 0, throttle_, 0); DLOG(INFO) << "disconnected unpack_byte_ to throttle_"; top_block->disconnect(throttle_, 0, valve_, 0); DLOG(INFO) << "disconnected throttle to valve"; @@ -297,9 +288,6 @@ void NsrFileSignalSource::disconnect(gr::top_block_sptr top_block) } - - - gr::basic_block_sptr NsrFileSignalSource::get_left_block() { LOG(WARNING) << "Left block of a signal source should not be retrieved"; @@ -308,9 +296,6 @@ gr::basic_block_sptr NsrFileSignalSource::get_left_block() } - - - gr::basic_block_sptr NsrFileSignalSource::get_right_block() { if (samples_ > 0) diff --git a/src/algorithms/signal_source/adapters/nsr_file_signal_source.h b/src/algorithms/signal_source/adapters/nsr_file_signal_source.h index 7be4ea775..e2da08206 100644 --- a/src/algorithms/signal_source/adapters/nsr_file_signal_source.h +++ b/src/algorithms/signal_source/adapters/nsr_file_signal_source.h @@ -50,12 +50,12 @@ class ConfigurationInterface; * \brief Class that reads signals samples from a file * and adapts it to a SignalSourceInterface */ -class NsrFileSignalSource: public GNSSBlockInterface +class NsrFileSignalSource : public GNSSBlockInterface { public: NsrFileSignalSource(ConfigurationInterface* configuration, std::string role, - unsigned int in_streams, unsigned int out_streams, - boost::shared_ptr queue); + unsigned int in_streams, unsigned int out_streams, + boost::shared_ptr queue); virtual ~NsrFileSignalSource(); inline std::string role() override @@ -121,7 +121,7 @@ private: unpack_byte_2bit_samples_sptr unpack_byte_; boost::shared_ptr valve_; gr::blocks::file_sink::sptr sink_; - gr::blocks::throttle::sptr throttle_; + gr::blocks::throttle::sptr throttle_; boost::shared_ptr queue_; size_t item_size_; // Throttle control diff --git a/src/algorithms/signal_source/adapters/osmosdr_signal_source.cc b/src/algorithms/signal_source/adapters/osmosdr_signal_source.cc index 4bb665ffa..f40bed4fe 100644 --- a/src/algorithms/signal_source/adapters/osmosdr_signal_source.cc +++ b/src/algorithms/signal_source/adapters/osmosdr_signal_source.cc @@ -39,15 +39,12 @@ #include - using google::LogMessage; OsmosdrSignalSource::OsmosdrSignalSource(ConfigurationInterface* configuration, - std::string role, unsigned int in_stream, unsigned int out_stream, - boost::shared_ptr queue) : - role_(role), in_stream_(in_stream), out_stream_(out_stream), - queue_(queue) + std::string role, unsigned int in_stream, unsigned int out_stream, + boost::shared_ptr queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(queue) { // DUMP PARAMETERS std::string empty = ""; @@ -56,7 +53,7 @@ OsmosdrSignalSource::OsmosdrSignalSource(ConfigurationInterface* configuration, samples_ = configuration->property(role + ".samples", 0); dump_ = configuration->property(role + ".dump", false); dump_filename_ = configuration->property(role + ".dump_filename", - default_dump_file); + default_dump_file); // OSMOSDR Driver parameters AGC_enabled_ = configuration->property(role + ".AGC_enabled", true); @@ -66,7 +63,7 @@ OsmosdrSignalSource::OsmosdrSignalSource(ConfigurationInterface* configuration, if_gain_ = configuration->property(role + ".if_gain", 40.0); sample_rate_ = configuration->property(role + ".sampling_frequency", 2.0e6); item_type_ = configuration->property(role + ".item_type", default_item_type); - osmosdr_args_ = configuration->property(role + ".osmosdr_args", std::string( )); + osmosdr_args_ = configuration->property(role + ".osmosdr_args", std::string()); antenna_ = configuration->property(role + ".antenna", empty); if (item_type_.compare("short") == 0) @@ -83,23 +80,23 @@ OsmosdrSignalSource::OsmosdrSignalSource(ConfigurationInterface* configuration, if (!antenna_.empty()) { osmosdr_source_->set_antenna(antenna_, 0); - std::cout << boost::format("Set RX Antenna : %s") % (osmosdr_source_->get_antenna(0)) << std::endl ; + std::cout << boost::format("Set RX Antenna : %s") % (osmosdr_source_->get_antenna(0)) << std::endl; LOG(INFO) << boost::format("Set RX Antenna : %s") % (osmosdr_source_->get_antenna(0)); } // 2 set sampling rate osmosdr_source_->set_sample_rate(sample_rate_); - std::cout << boost::format("Actual RX Rate: %f [SPS]...") % (osmosdr_source_->get_sample_rate()) << std::endl ; + std::cout << boost::format("Actual RX Rate: %f [SPS]...") % (osmosdr_source_->get_sample_rate()) << std::endl; LOG(INFO) << boost::format("Actual RX Rate: %f [SPS]...") % (osmosdr_source_->get_sample_rate()); // 3. set rx frequency osmosdr_source_->set_center_freq(freq_); - std::cout << boost::format("Actual RX Freq: %f [Hz]...") % (osmosdr_source_->get_center_freq()) << std::endl ; + std::cout << boost::format("Actual RX Freq: %f [Hz]...") % (osmosdr_source_->get_center_freq()) << std::endl; LOG(INFO) << boost::format("Actual RX Freq: %f [Hz]...") % (osmosdr_source_->get_center_freq()); // TODO: Assign the remnant IF from the PLL tune error std::cout << boost::format("PLL Frequency tune error %f [Hz]...") % (osmosdr_source_->get_center_freq() - freq_) << std::endl; - LOG(INFO) << boost::format("PLL Frequency tune error %f [Hz]...") % (osmosdr_source_->get_center_freq() - freq_) ; + LOG(INFO) << boost::format("PLL Frequency tune error %f [Hz]...") % (osmosdr_source_->get_center_freq() - freq_); // 4. set rx gain if (this->AGC_enabled_ == true) @@ -116,10 +113,9 @@ OsmosdrSignalSource::OsmosdrSignalSource(ConfigurationInterface* configuration, osmosdr_source_->set_bb_gain(if_gain_, 0); if (!osmosdr_args_.empty() && (osmosdr_args_.find("bladerf") != std::string::npos)) { - std::cout << boost::format("Actual LNA Gain: %f dB...") % osmosdr_source_->get_gain("LNA",0) << std::endl; - std::cout << boost::format("Actual VGA1 Gain: %f dB...") % osmosdr_source_->get_gain("VGA1",0) << std::endl; - std::cout << boost::format("Actual VGA2 Gain: %f dB...") % osmosdr_source_->get_gain("VGA2",0) << std::endl; - + std::cout << boost::format("Actual LNA Gain: %f dB...") % osmosdr_source_->get_gain("LNA", 0) << std::endl; + std::cout << boost::format("Actual VGA1 Gain: %f dB...") % osmosdr_source_->get_gain("VGA1", 0) << std::endl; + std::cout << boost::format("Actual VGA2 Gain: %f dB...") % osmosdr_source_->get_gain("VGA2", 0) << std::endl; } else { @@ -127,7 +123,7 @@ OsmosdrSignalSource::OsmosdrSignalSource(ConfigurationInterface* configuration, LOG(INFO) << boost::format("Actual RX Gain: %f dB...") % osmosdr_source_->get_gain(); } } - + // Get actual bandwidth std::cout << boost::format("Actual Bandwidth: %f [Hz]...") % osmosdr_source_->get_bandwidth(0) << std::endl; } @@ -153,27 +149,27 @@ OsmosdrSignalSource::OsmosdrSignalSource(ConfigurationInterface* configuration, } - OsmosdrSignalSource::~OsmosdrSignalSource() -{} +{ +} void OsmosdrSignalSource::driver_instance() { try - { + { if (!osmosdr_args_.empty()) { std::cout << "OsmoSdr arguments: " << osmosdr_args_ << std::endl; LOG(INFO) << "OsmoSdr arguments: " << osmosdr_args_; } osmosdr_source_ = osmosdr::source::make(osmosdr_args_); - } - catch( const boost::exception & e ) - { + } + catch (const boost::exception& e) + { LOG(WARNING) << "Boost exception: " << boost::diagnostic_information(e); - throw std::invalid_argument( "Wrong OsmoSdr arguments" ); - } + throw std::invalid_argument("Wrong OsmoSdr arguments"); + } } @@ -200,7 +196,6 @@ void OsmosdrSignalSource::connect(gr::top_block_sptr top_block) } - void OsmosdrSignalSource::disconnect(gr::top_block_sptr top_block) { if (samples_ != 0) @@ -221,7 +216,6 @@ void OsmosdrSignalSource::disconnect(gr::top_block_sptr top_block) } - gr::basic_block_sptr OsmosdrSignalSource::get_left_block() { LOG(WARNING) << "Trying to get signal source left block."; @@ -229,7 +223,6 @@ gr::basic_block_sptr OsmosdrSignalSource::get_left_block() } - gr::basic_block_sptr OsmosdrSignalSource::get_right_block() { if (samples_ != 0) diff --git a/src/algorithms/signal_source/adapters/osmosdr_signal_source.h b/src/algorithms/signal_source/adapters/osmosdr_signal_source.h index 7e69aec81..8541adeaa 100644 --- a/src/algorithms/signal_source/adapters/osmosdr_signal_source.h +++ b/src/algorithms/signal_source/adapters/osmosdr_signal_source.h @@ -48,12 +48,12 @@ class ConfigurationInterface; * HackRF or Realtek's RTL2832U-based USB dongle DVB-T receivers * (see http://sdr.osmocom.org/trac/wiki/rtl-sdr) */ -class OsmosdrSignalSource: public GNSSBlockInterface +class OsmosdrSignalSource : public GNSSBlockInterface { public: OsmosdrSignalSource(ConfigurationInterface* configuration, - std::string role, unsigned int in_stream, - unsigned int out_stream, boost::shared_ptr queue); + std::string role, unsigned int in_stream, + unsigned int out_stream, boost::shared_ptr queue); virtual ~OsmosdrSignalSource(); @@ -104,7 +104,7 @@ private: osmosdr::source::sptr osmosdr_source_; std::string osmosdr_args_; - + std::string antenna_; boost::shared_ptr valve_; diff --git a/src/algorithms/signal_source/adapters/plutosdr_signal_source.cc b/src/algorithms/signal_source/adapters/plutosdr_signal_source.cc index 3f3e6f171..e0dd00d4b 100644 --- a/src/algorithms/signal_source/adapters/plutosdr_signal_source.cc +++ b/src/algorithms/signal_source/adapters/plutosdr_signal_source.cc @@ -40,10 +40,8 @@ using google::LogMessage; PlutosdrSignalSource::PlutosdrSignalSource(ConfigurationInterface* configuration, - std::string role, unsigned int in_stream, unsigned int out_stream, - boost::shared_ptr queue) : - role_(role), in_stream_(in_stream), out_stream_(out_stream), - queue_(queue) + std::string role, unsigned int in_stream, unsigned int out_stream, + boost::shared_ptr queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(queue) { std::string default_item_type = "gr_complex"; std::string default_dump_file = "./data/signal_source.dat"; @@ -65,7 +63,7 @@ PlutosdrSignalSource::PlutosdrSignalSource(ConfigurationInterface* configuration dump_ = configuration->property(role + ".dump", false); dump_filename_ = configuration->property(role + ".dump_filename", default_dump_file); - if(item_type_.compare("gr_complex") != 0) + if (item_type_.compare("gr_complex") != 0) { std::cout << "Configuration error: item_type must be gr_complex" << std::endl; LOG(FATAL) << "Configuration error: item_type must be gr_complex!"; @@ -80,8 +78,8 @@ PlutosdrSignalSource::PlutosdrSignalSource(ConfigurationInterface* configuration std::cout << "item type: " << item_type_ << std::endl; plutosdr_source_ = gr::iio::pluto_source::make(uri_, freq_, sample_rate_, - bandwidth_, buffer_size_, quadrature_, rf_dc_, bb_dc_, - gain_mode_.c_str(), rf_gain_,filter_file_.c_str(), filter_auto_); + bandwidth_, buffer_size_, quadrature_, rf_dc_, bb_dc_, + gain_mode_.c_str(), rf_gain_, filter_file_.c_str(), filter_auto_); if (samples_ != 0) { @@ -100,7 +98,8 @@ PlutosdrSignalSource::PlutosdrSignalSource(ConfigurationInterface* configuration PlutosdrSignalSource::~PlutosdrSignalSource() -{} +{ +} void PlutosdrSignalSource::connect(gr::top_block_sptr top_block) diff --git a/src/algorithms/signal_source/adapters/plutosdr_signal_source.h b/src/algorithms/signal_source/adapters/plutosdr_signal_source.h index 535f50939..176f7ef6a 100644 --- a/src/algorithms/signal_source/adapters/plutosdr_signal_source.h +++ b/src/algorithms/signal_source/adapters/plutosdr_signal_source.h @@ -44,12 +44,12 @@ class ConfigurationInterface; /*! */ -class PlutosdrSignalSource: public GNSSBlockInterface +class PlutosdrSignalSource : public GNSSBlockInterface { public: PlutosdrSignalSource(ConfigurationInterface* configuration, - std::string role, unsigned int in_stream, - unsigned int out_stream, boost::shared_ptr queue); + std::string role, unsigned int in_stream, + unsigned int out_stream, boost::shared_ptr queue); virtual ~PlutosdrSignalSource(); @@ -79,11 +79,11 @@ private: std::string role_; // Front-end settings - std::string uri_; // device direction - unsigned long freq_; // frequency of local oscilator + std::string uri_; // device direction + unsigned long freq_; // frequency of local oscilator unsigned long sample_rate_; unsigned long bandwidth_; - unsigned long buffer_size_; // reception buffer + unsigned long buffer_size_; // reception buffer bool quadrature_; bool rf_dc_; bool bb_dc_; diff --git a/src/algorithms/signal_source/adapters/raw_array_signal_source.cc b/src/algorithms/signal_source/adapters/raw_array_signal_source.cc index ba96b0460..d13df7895 100644 --- a/src/algorithms/signal_source/adapters/raw_array_signal_source.cc +++ b/src/algorithms/signal_source/adapters/raw_array_signal_source.cc @@ -39,8 +39,7 @@ using google::LogMessage; RawArraySignalSource::RawArraySignalSource(ConfigurationInterface* configuration, - std::string role, unsigned int in_stream, unsigned int out_stream, gr::msg_queue::sptr queue) : - role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(queue) + std::string role, unsigned int in_stream, unsigned int out_stream, gr::msg_queue::sptr queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(queue) { std::string default_item_type = "gr_complex"; std::string default_dump_file = "./data/raw_array_source.dat"; @@ -70,10 +69,9 @@ RawArraySignalSource::RawArraySignalSource(ConfigurationInterface* configuration if (item_type_.compare("gr_complex") == 0) { item_size_ = sizeof(gr_complex); - raw_array_source_ = gr::dbfcttc::raw_array::make(eth_device_.c_str(),channels_,snapshots_per_frame_,inter_frame_delay_,sampling_freq_); + raw_array_source_ = gr::dbfcttc::raw_array::make(eth_device_.c_str(), channels_, snapshots_per_frame_, inter_frame_delay_, sampling_freq_); DLOG(INFO) << "Item size " << item_size_; DLOG(INFO) << "raw_array_source(" << raw_array_source_->unique_id() << ")"; - } // else if (item_type_.compare("short") == 0) // { @@ -99,10 +97,9 @@ RawArraySignalSource::RawArraySignalSource(ConfigurationInterface* configuration } - RawArraySignalSource::~RawArraySignalSource() -{} - +{ +} void RawArraySignalSource::connect(gr::top_block_sptr top_block) @@ -120,7 +117,6 @@ void RawArraySignalSource::connect(gr::top_block_sptr top_block) } - void RawArraySignalSource::disconnect(gr::top_block_sptr top_block) { if (dump_) diff --git a/src/algorithms/signal_source/adapters/raw_array_signal_source.h b/src/algorithms/signal_source/adapters/raw_array_signal_source.h index eaabd84e2..083041ccc 100644 --- a/src/algorithms/signal_source/adapters/raw_array_signal_source.h +++ b/src/algorithms/signal_source/adapters/raw_array_signal_source.h @@ -43,12 +43,12 @@ class ConfigurationInterface; /*! * \brief This class reads samples from a GN3S USB dongle, a RF front-end signal sampler */ -class RawArraySignalSource: public GNSSBlockInterface +class RawArraySignalSource : public GNSSBlockInterface { public: RawArraySignalSource(ConfigurationInterface* configuration, - std::string role, unsigned int in_stream, - unsigned int out_stream, gr::msg_queue::sptr queue); + std::string role, unsigned int in_stream, + unsigned int out_stream, gr::msg_queue::sptr queue); virtual ~RawArraySignalSource(); diff --git a/src/algorithms/signal_source/adapters/rtl_tcp_signal_source.cc b/src/algorithms/signal_source/adapters/rtl_tcp_signal_source.cc index 1e2e86c3b..6d22cecc2 100644 --- a/src/algorithms/signal_source/adapters/rtl_tcp_signal_source.cc +++ b/src/algorithms/signal_source/adapters/rtl_tcp_signal_source.cc @@ -43,10 +43,8 @@ using google::LogMessage; RtlTcpSignalSource::RtlTcpSignalSource(ConfigurationInterface* configuration, - std::string role, unsigned int in_stream, unsigned int out_stream, - boost::shared_ptr queue) : - role_(role), in_stream_(in_stream), out_stream_(out_stream), - queue_(queue) + std::string role, unsigned int in_stream, unsigned int out_stream, + boost::shared_ptr queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(queue) { // DUMP PARAMETERS std::string empty = ""; @@ -55,7 +53,7 @@ RtlTcpSignalSource::RtlTcpSignalSource(ConfigurationInterface* configuration, samples_ = configuration->property(role + ".samples", 0); dump_ = configuration->property(role + ".dump", false); dump_filename_ = configuration->property(role + ".dump_filename", - default_dump_file); + default_dump_file); // rtl_tcp PARAMTERS std::string default_address = "127.0.0.1"; @@ -134,38 +132,39 @@ RtlTcpSignalSource::RtlTcpSignalSource(ConfigurationInterface* configuration, RtlTcpSignalSource::~RtlTcpSignalSource() -{} +{ +} void RtlTcpSignalSource::MakeBlock() { try - { + { std::cout << "Connecting to " << address_ << ":" << port_ << std::endl; - LOG (INFO) << "Connecting to " << address_ << ":" << port_; - signal_source_ = rtl_tcp_make_signal_source_c (address_, port_, flip_iq_); - } - catch( const boost::exception & e ) - { + LOG(INFO) << "Connecting to " << address_ << ":" << port_; + signal_source_ = rtl_tcp_make_signal_source_c(address_, port_, flip_iq_); + } + catch (const boost::exception& e) + { LOG(WARNING) << "Boost exception: " << boost::diagnostic_information(e); - throw std::runtime_error( "Failure connecting to the device" ); - } + throw std::runtime_error("Failure connecting to the device"); + } } void RtlTcpSignalSource::connect(gr::top_block_sptr top_block) { - if ( samples_ ) + if (samples_) { - top_block->connect (signal_source_, 0, valve_, 0); + top_block->connect(signal_source_, 0, valve_, 0); DLOG(INFO) << "connected rtl tcp source to valve"; - if ( dump_ ) + if (dump_) { top_block->connect(valve_, 0, file_sink_, 0); DLOG(INFO) << "connected valve to file sink"; } } - else if ( dump_ ) + else if (dump_) { top_block->connect(signal_source_, 0, file_sink_, 0); DLOG(INFO) << "connected rtl tcp source to file sink"; @@ -175,15 +174,15 @@ void RtlTcpSignalSource::connect(gr::top_block_sptr top_block) void RtlTcpSignalSource::disconnect(gr::top_block_sptr top_block) { - if ( samples_ ) + if (samples_) { - top_block->disconnect (signal_source_, 0, valve_, 0); - if ( dump_ ) + top_block->disconnect(signal_source_, 0, valve_, 0); + if (dump_) { top_block->disconnect(valve_, 0, file_sink_, 0); } } - else if ( dump_ ) + else if (dump_) { top_block->disconnect(signal_source_, 0, file_sink_, 0); } diff --git a/src/algorithms/signal_source/adapters/rtl_tcp_signal_source.h b/src/algorithms/signal_source/adapters/rtl_tcp_signal_source.h index e8cf81393..4efbc862f 100644 --- a/src/algorithms/signal_source/adapters/rtl_tcp_signal_source.h +++ b/src/algorithms/signal_source/adapters/rtl_tcp_signal_source.h @@ -50,12 +50,12 @@ class ConfigurationInterface; * I/Q samples over TCP. * (see http://sdr.osmocom.org/trac/wiki/rtl-sdr) */ -class RtlTcpSignalSource: public GNSSBlockInterface +class RtlTcpSignalSource : public GNSSBlockInterface { public: RtlTcpSignalSource(ConfigurationInterface* configuration, - std::string role, unsigned int in_stream, - unsigned int out_stream, boost::shared_ptr queue); + std::string role, unsigned int in_stream, + unsigned int out_stream, boost::shared_ptr queue); virtual ~RtlTcpSignalSource(); diff --git a/src/algorithms/signal_source/adapters/spir_file_signal_source.cc b/src/algorithms/signal_source/adapters/spir_file_signal_source.cc index 0293f5805..226c301ee 100644 --- a/src/algorithms/signal_source/adapters/spir_file_signal_source.cc +++ b/src/algorithms/signal_source/adapters/spir_file_signal_source.cc @@ -44,9 +44,8 @@ using google::LogMessage; SpirFileSignalSource::SpirFileSignalSource(ConfigurationInterface* configuration, - std::string role, unsigned int in_streams, unsigned int out_streams, - boost::shared_ptr queue) : - role_(role), in_streams_(in_streams), out_streams_(out_streams), queue_(queue) + std::string role, unsigned int in_streams, unsigned int out_streams, + boost::shared_ptr queue) : role_(role), in_streams_(in_streams), out_streams_(out_streams), queue_(queue) { std::string default_filename = "../data/my_capture.dat"; std::string default_item_type = "int"; @@ -57,8 +56,8 @@ SpirFileSignalSource::SpirFileSignalSource(ConfigurationInterface* configuration filename_ = configuration->property(role + ".filename", default_filename); // override value with commandline flag, if present - if (FLAGS_signal_source.compare("-") != 0) filename_= FLAGS_signal_source; - if (FLAGS_s.compare("-") != 0) filename_= FLAGS_s; + if (FLAGS_signal_source.compare("-") != 0) filename_ = FLAGS_signal_source; + if (FLAGS_s.compare("-") != 0) filename_ = FLAGS_s; item_type_ = configuration->property(role + ".item_type", default_item_type); repeat_ = configuration->property(role + ".repeat", false); @@ -72,48 +71,47 @@ SpirFileSignalSource::SpirFileSignalSource(ConfigurationInterface* configuration } else { - LOG(WARNING) << item_type_ << " unrecognized item type. Using int."; + LOG(WARNING) << item_type_ << " unrecognized item type. Using int."; item_size_ = sizeof(int); } try - { + { file_source_ = gr::blocks::file_source::make(item_size_, filename_.c_str(), repeat_); unpack_intspir_ = make_unpack_intspir_1bit_samples(); - - } - catch (const std::exception &e) - { + } + catch (const std::exception& e) + { std::cerr - << "The receiver was configured to work with a file signal source " - << std::endl - << "but the specified file is unreachable by GNSS-SDR." - << std::endl - << "Please modify your configuration file" - << std::endl - << "and point SignalSource.filename to a valid raw data file. Then:" - << std::endl - << "$ gnss-sdr --config_file=/path/to/my_GNSS_SDR_configuration.conf" - << std::endl - << "Examples of configuration files available at:" - << std::endl - << GNSSSDR_INSTALL_DIR "/share/gnss-sdr/conf/" - << std::endl; + << "The receiver was configured to work with a file signal source " + << std::endl + << "but the specified file is unreachable by GNSS-SDR." + << std::endl + << "Please modify your configuration file" + << std::endl + << "and point SignalSource.filename to a valid raw data file. Then:" + << std::endl + << "$ gnss-sdr --config_file=/path/to/my_GNSS_SDR_configuration.conf" + << std::endl + << "Examples of configuration files available at:" + << std::endl + << GNSSSDR_INSTALL_DIR "/share/gnss-sdr/conf/" + << std::endl; LOG(WARNING) << "file_signal_source: Unable to open the samples file " - << filename_.c_str() << ", exiting the program."; + << filename_.c_str() << ", exiting the program."; throw(e); - } + } DLOG(INFO) << "file_source(" << file_source_->unique_id() << ")"; - if (samples_ == 0) // read all file + if (samples_ == 0) // read all file { /*! * BUG workaround: The GNU Radio file source does not stop the receiver after reaching the End of File. * A possible solution is to compute the file length in samples using file size, excluding the last 100 milliseconds, and enable always the * valve block */ - std::ifstream file (filename_.c_str(), std::ios::in | std::ios::binary | std::ios::ate); + std::ifstream file(filename_.c_str(), std::ios::in | std::ios::binary | std::ios::ate); std::ifstream::pos_type size; if (file.is_open()) @@ -129,19 +127,19 @@ SpirFileSignalSource::SpirFileSignalSource(ConfigurationInterface* configuration std::streamsize ss = std::cout.precision(); std::cout << std::setprecision(16); std::cout << "Processing file " << filename_ << ", which contains " << size << " [bytes]" << std::endl; - std::cout.precision (ss); + std::cout.precision(ss); if (size > 0) { - int sample_packet_factor = 1; // 1 int -> 1 complex sample (I&Q from 1 channel) + int sample_packet_factor = 1; // 1 int -> 1 complex sample (I&Q from 1 channel) samples_ = floor(static_cast(size) / static_cast(item_size())) * sample_packet_factor; - samples_ = samples_- ceil(0.002 * static_cast(sampling_frequency_)); //process all the samples available in the file excluding the last 2 ms + samples_ = samples_ - ceil(0.002 * static_cast(sampling_frequency_)); //process all the samples available in the file excluding the last 2 ms } } CHECK(samples_ > 0) << "File does not contain enough samples to process."; double signal_duration_s; - signal_duration_s = static_cast(samples_) * ( 1 /static_cast(sampling_frequency_)); + signal_duration_s = static_cast(samples_) * (1 / static_cast(sampling_frequency_)); LOG(INFO) << "Total number samples to be processed= " << samples_ << " GNSS signal duration= " << signal_duration_s << " [s]"; std::cout << "GNSS signal recorded time to be processed: " << signal_duration_s << " [s]" << std::endl; @@ -170,12 +168,9 @@ SpirFileSignalSource::SpirFileSignalSource(ConfigurationInterface* configuration } - - SpirFileSignalSource::~SpirFileSignalSource() -{} - - +{ +} void SpirFileSignalSource::connect(gr::top_block_sptr top_block) @@ -185,7 +180,7 @@ void SpirFileSignalSource::connect(gr::top_block_sptr top_block) if (enable_throttle_control_ == true) { top_block->connect(file_source_, 0, unpack_intspir_, 0); - top_block->connect(unpack_intspir_, 0,throttle_,0); + top_block->connect(unpack_intspir_, 0, throttle_, 0); DLOG(INFO) << "connected file source to throttle"; top_block->connect(throttle_, 0, valve_, 0); DLOG(INFO) << "connected throttle to valve"; @@ -198,7 +193,7 @@ void SpirFileSignalSource::connect(gr::top_block_sptr top_block) else { top_block->connect(file_source_, 0, unpack_intspir_, 0); - top_block->connect(unpack_intspir_, 0,valve_,0); + top_block->connect(unpack_intspir_, 0, valve_, 0); DLOG(INFO) << "connected file source to valve"; if (dump_) { @@ -212,7 +207,7 @@ void SpirFileSignalSource::connect(gr::top_block_sptr top_block) if (enable_throttle_control_ == true) { top_block->connect(file_source_, 0, unpack_intspir_, 0); - top_block->connect(unpack_intspir_, 0,throttle_,0); + top_block->connect(unpack_intspir_, 0, throttle_, 0); DLOG(INFO) << "connected file source to throttle"; if (dump_) { @@ -233,10 +228,6 @@ void SpirFileSignalSource::connect(gr::top_block_sptr top_block) } - - - - void SpirFileSignalSource::disconnect(gr::top_block_sptr top_block) { if (samples_ > 0) @@ -245,7 +236,7 @@ void SpirFileSignalSource::disconnect(gr::top_block_sptr top_block) { top_block->disconnect(file_source_, 0, unpack_intspir_, 0); DLOG(INFO) << "disconnected file source to unpack_intspir_"; - top_block->connect(unpack_intspir_, 0,throttle_,0); + top_block->connect(unpack_intspir_, 0, throttle_, 0); DLOG(INFO) << "disconnected unpack_intspir_ to throttle_"; top_block->disconnect(throttle_, 0, valve_, 0); DLOG(INFO) << "disconnected throttle to valve"; @@ -296,9 +287,6 @@ void SpirFileSignalSource::disconnect(gr::top_block_sptr top_block) } - - - gr::basic_block_sptr SpirFileSignalSource::get_left_block() { LOG(WARNING) << "Left block of a signal source should not be retrieved"; @@ -307,9 +295,6 @@ gr::basic_block_sptr SpirFileSignalSource::get_left_block() } - - - gr::basic_block_sptr SpirFileSignalSource::get_right_block() { if (samples_ > 0) diff --git a/src/algorithms/signal_source/adapters/spir_file_signal_source.h b/src/algorithms/signal_source/adapters/spir_file_signal_source.h index bb73cd013..ebd4e3454 100644 --- a/src/algorithms/signal_source/adapters/spir_file_signal_source.h +++ b/src/algorithms/signal_source/adapters/spir_file_signal_source.h @@ -47,12 +47,12 @@ class ConfigurationInterface; * \brief Class that reads signals samples from a file * and adapts it to a SignalSourceInterface */ -class SpirFileSignalSource: public GNSSBlockInterface +class SpirFileSignalSource : public GNSSBlockInterface { public: SpirFileSignalSource(ConfigurationInterface* configuration, std::string role, - unsigned int in_streams, unsigned int out_streams, - boost::shared_ptr queue); + unsigned int in_streams, unsigned int out_streams, + boost::shared_ptr queue); virtual ~SpirFileSignalSource(); inline std::string role() override @@ -118,7 +118,7 @@ private: unpack_intspir_1bit_samples_sptr unpack_intspir_; boost::shared_ptr valve_; gr::blocks::file_sink::sptr sink_; - gr::blocks::throttle::sptr throttle_; + gr::blocks::throttle::sptr throttle_; boost::shared_ptr queue_; size_t item_size_; // Throttle control diff --git a/src/algorithms/signal_source/adapters/spir_gss6450_file_signal_source.cc b/src/algorithms/signal_source/adapters/spir_gss6450_file_signal_source.cc index 512ec6678..9f37b335f 100644 --- a/src/algorithms/signal_source/adapters/spir_gss6450_file_signal_source.cc +++ b/src/algorithms/signal_source/adapters/spir_gss6450_file_signal_source.cc @@ -42,8 +42,7 @@ using google::LogMessage; SpirGSS6450FileSignalSource::SpirGSS6450FileSignalSource(ConfigurationInterface* configuration, - std::string role, unsigned int in_streams, unsigned int out_streams, gr::msg_queue::sptr queue) : - role_(role), in_streams_(in_streams), out_streams_(out_streams), queue_(queue) + std::string role, unsigned int in_streams, unsigned int out_streams, gr::msg_queue::sptr queue) : role_(role), in_streams_(in_streams), out_streams_(out_streams), queue_(queue) { std::string default_filename = "../data/my_capture.dat"; std::string default_dump_filename = "../data/my_capture_dump.dat"; @@ -64,54 +63,57 @@ SpirGSS6450FileSignalSource::SpirGSS6450FileSignalSource(ConfigurationInterface* long bytes_seek = configuration->property(role + ".bytes_to_skip", 65536); double sample_size_byte = static_cast(adc_bits_) / 4.0; - if(sel_ch_ > n_channels_) { LOG(WARNING) << "Invalid RF channel selection"; } - if(n_channels_ > 1) - { - for(unsigned int i = 0; i < (n_channels_ - 1); i++) + if (sel_ch_ > n_channels_) { - null_sinks_.push_back(gr::blocks::null_sink::make(item_size_)); + LOG(WARNING) << "Invalid RF channel selection"; + } + if (n_channels_ > 1) + { + for (unsigned int i = 0; i < (n_channels_ - 1); i++) + { + null_sinks_.push_back(gr::blocks::null_sink::make(item_size_)); + } + DLOG(INFO) << "NUMBER OF NULL SINKS = " << null_sinks_.size(); } - DLOG(INFO)<< "NUMBER OF NULL SINKS = " << null_sinks_.size(); - } try - { - file_source_ = gr::blocks::file_source::make(item_size_, filename_.c_str(), repeat_); - file_source_->seek(bytes_seek / item_size_, SEEK_SET); - unpack_spir_ = make_unpack_spir_gss6450_samples(adc_bits_); - deint_ = gr::blocks::deinterleave::make(item_size_); - } - catch (const std::exception &e) - { + { + file_source_ = gr::blocks::file_source::make(item_size_, filename_.c_str(), repeat_); + file_source_->seek(bytes_seek / item_size_, SEEK_SET); + unpack_spir_ = make_unpack_spir_gss6450_samples(adc_bits_); + deint_ = gr::blocks::deinterleave::make(item_size_); + } + catch (const std::exception& e) + { std::cerr - << "The receiver was configured to work with a file signal source " - << std::endl - << "but the specified file is unreachable by GNSS-SDR." - << std::endl - << "Please modify your configuration file" - << std::endl - << "and point SignalSource.filename to a valid raw data file. Then:" - << std::endl - << "$ gnss-sdr --config_file=/path/to/my_GNSS_SDR_configuration.conf" - << std::endl - << "Examples of configuration files available at:" - << std::endl - << GNSSSDR_INSTALL_DIR "/share/gnss-sdr/conf/" - << std::endl; + << "The receiver was configured to work with a file signal source " + << std::endl + << "but the specified file is unreachable by GNSS-SDR." + << std::endl + << "Please modify your configuration file" + << std::endl + << "and point SignalSource.filename to a valid raw data file. Then:" + << std::endl + << "$ gnss-sdr --config_file=/path/to/my_GNSS_SDR_configuration.conf" + << std::endl + << "Examples of configuration files available at:" + << std::endl + << GNSSSDR_INSTALL_DIR "/share/gnss-sdr/conf/" + << std::endl; LOG(WARNING) << "file_signal_source: Unable to open the samples file " << filename_.c_str() << ", exiting the program."; throw(e); - } + } DLOG(INFO) << "file_source(" << file_source_->unique_id() << ")"; - if(samples_ == 0) // read all file + if (samples_ == 0) // read all file { /*! * BUG workaround: The GNU Radio file source does not stop the receiver after reaching the End of File. * A possible solution is to compute the file length in samples using file size, excluding the last 2 milliseconds, and enable always the * valve block */ - std::ifstream file (filename_.c_str(), std::ios::in | std::ios::binary | std::ios::ate); + std::ifstream file(filename_.c_str(), std::ios::in | std::ios::binary | std::ios::ate); std::ifstream::pos_type size; if (file.is_open()) @@ -127,12 +129,12 @@ SpirGSS6450FileSignalSource::SpirGSS6450FileSignalSource(ConfigurationInterface* std::streamsize ss = std::cout.precision(); std::cout << std::setprecision(16); std::cout << "Processing file " << filename_ << ", which contains " << size << " [bytes]" << std::endl; - std::cout.precision (ss); + std::cout.precision(ss); - if(size > 0) + if (size > 0) { samples_ = static_cast(floor(static_cast(static_cast(size) - static_cast(bytes_seek)) / (sample_size_byte * static_cast(n_channels_)))); - samples_ = samples_- static_cast(ceil(0.002 * sampling_frequency_)); //process all the samples available in the file excluding the last 2 ms + samples_ = samples_ - static_cast(ceil(0.002 * sampling_frequency_)); //process all the samples available in the file excluding the last 2 ms } } @@ -169,7 +171,8 @@ SpirGSS6450FileSignalSource::SpirGSS6450FileSignalSource(ConfigurationInterface* SpirGSS6450FileSignalSource::~SpirGSS6450FileSignalSource() -{} +{ +} void SpirGSS6450FileSignalSource::connect(gr::top_block_sptr top_block) @@ -177,27 +180,27 @@ void SpirGSS6450FileSignalSource::connect(gr::top_block_sptr top_block) if (samples_ > 0) { top_block->connect(file_source_, 0, deint_, 0); - if(endian_swap_) - { - top_block->connect(deint_, sel_ch_ - 1, endian_ ,0); - top_block->connect(endian_, 0, unpack_spir_, 0); - } - else - { - top_block->connect(deint_, sel_ch_ - 1, unpack_spir_, 0); - } - if(n_channels_ > 1) - { - unsigned int aux = 0; - for(unsigned int i = 0; i < n_channels_; i++) + if (endian_swap_) { - if(i != (sel_ch_ - 1)) - { - top_block->connect(deint_, i, null_sinks_.at(aux), 0); - aux++; - } + top_block->connect(deint_, sel_ch_ - 1, endian_, 0); + top_block->connect(endian_, 0, unpack_spir_, 0); + } + else + { + top_block->connect(deint_, sel_ch_ - 1, unpack_spir_, 0); + } + if (n_channels_ > 1) + { + unsigned int aux = 0; + for (unsigned int i = 0; i < n_channels_; i++) + { + if (i != (sel_ch_ - 1)) + { + top_block->connect(deint_, i, null_sinks_.at(aux), 0); + aux++; + } + } } - } if (enable_throttle_control_) { top_block->connect(unpack_spir_, 0, throttle_, 0); @@ -207,7 +210,7 @@ void SpirGSS6450FileSignalSource::connect(gr::top_block_sptr top_block) { top_block->connect(unpack_spir_, 0, valve_, 0); } - if(dump_) + if (dump_) { top_block->connect(valve_, 0, sink_, 0); } @@ -222,47 +225,47 @@ void SpirGSS6450FileSignalSource::connect(gr::top_block_sptr top_block) void SpirGSS6450FileSignalSource::disconnect(gr::top_block_sptr top_block) { if (samples_ > 0) - { - top_block->disconnect(file_source_, 0, deint_, 0); - if(endian_swap_) { - top_block->disconnect(deint_, sel_ch_ - 1, endian_ ,0); - top_block->disconnect(endian_, 0, unpack_spir_, 0); - } - else - { - top_block->disconnect(deint_, sel_ch_ - 1, unpack_spir_, 0); - } - if(n_channels_ > 1) - { - unsigned int aux = 0; - for(unsigned int i = 0; i < n_channels_; i++) - { - if(i != (sel_ch_ - 1)) + top_block->disconnect(file_source_, 0, deint_, 0); + if (endian_swap_) { - top_block->disconnect(deint_, i, null_sinks_.at(aux), 0); - aux++; + top_block->disconnect(deint_, sel_ch_ - 1, endian_, 0); + top_block->disconnect(endian_, 0, unpack_spir_, 0); + } + else + { + top_block->disconnect(deint_, sel_ch_ - 1, unpack_spir_, 0); + } + if (n_channels_ > 1) + { + unsigned int aux = 0; + for (unsigned int i = 0; i < n_channels_; i++) + { + if (i != (sel_ch_ - 1)) + { + top_block->disconnect(deint_, i, null_sinks_.at(aux), 0); + aux++; + } + } + } + if (enable_throttle_control_) + { + top_block->disconnect(unpack_spir_, 0, throttle_, 0); + top_block->disconnect(throttle_, 0, valve_, 0); + } + else + { + top_block->disconnect(unpack_spir_, 0, valve_, 0); + } + if (dump_) + { + top_block->disconnect(valve_, 0, sink_, 0); } - } } - if (enable_throttle_control_) - { - top_block->disconnect(unpack_spir_, 0, throttle_, 0); - top_block->disconnect(throttle_, 0, valve_, 0); - } - else - { - top_block->disconnect(unpack_spir_, 0, valve_, 0); - } - if(dump_) - { - top_block->disconnect(valve_, 0, sink_, 0); - } - } else - { - LOG(WARNING) << "Nothing to disconnect"; - } + { + LOG(WARNING) << "Nothing to disconnect"; + } } @@ -275,10 +278,19 @@ gr::basic_block_sptr SpirGSS6450FileSignalSource::get_left_block() gr::basic_block_sptr SpirGSS6450FileSignalSource::get_right_block() { - if(samples_ > 0) { return valve_; } + if (samples_ > 0) + { + return valve_; + } else { - if(enable_throttle_control_) { return throttle_; } - else { return unpack_spir_; } + if (enable_throttle_control_) + { + return throttle_; + } + else + { + return unpack_spir_; + } } } diff --git a/src/algorithms/signal_source/adapters/spir_gss6450_file_signal_source.h b/src/algorithms/signal_source/adapters/spir_gss6450_file_signal_source.h index cc07a9747..4d3f55e71 100644 --- a/src/algorithms/signal_source/adapters/spir_gss6450_file_signal_source.h +++ b/src/algorithms/signal_source/adapters/spir_gss6450_file_signal_source.h @@ -53,11 +53,11 @@ class ConfigurationInterface; * \brief Class that reads signals samples from a file * and adapts it to a SignalSourceInterface */ -class SpirGSS6450FileSignalSource: public GNSSBlockInterface +class SpirGSS6450FileSignalSource : public GNSSBlockInterface { public: SpirGSS6450FileSignalSource(ConfigurationInterface* configuration, std::string role, - unsigned int in_streams, unsigned int out_streams, gr::msg_queue::sptr queue); + unsigned int in_streams, unsigned int out_streams, gr::msg_queue::sptr queue); virtual ~SpirGSS6450FileSignalSource(); inline std::string role() override @@ -110,7 +110,7 @@ private: double sampling_frequency_; std::string filename_; bool repeat_; - bool dump_; //Enables dumping the gr_complex sample output + bool dump_; //Enables dumping the gr_complex sample output bool enable_throttle_control_; bool endian_swap_; std::string dump_filename_; @@ -128,7 +128,7 @@ private: unpack_spir_gss6450_samples_sptr unpack_spir_; boost::shared_ptr valve_; gr::blocks::file_sink::sptr sink_; - gr::blocks::throttle::sptr throttle_; + gr::blocks::throttle::sptr throttle_; gr::msg_queue::sptr queue_; size_t item_size_; }; diff --git a/src/algorithms/signal_source/adapters/two_bit_cpx_file_signal_source.cc b/src/algorithms/signal_source/adapters/two_bit_cpx_file_signal_source.cc index ea5f715c7..0d439e8ad 100644 --- a/src/algorithms/signal_source/adapters/two_bit_cpx_file_signal_source.cc +++ b/src/algorithms/signal_source/adapters/two_bit_cpx_file_signal_source.cc @@ -44,9 +44,8 @@ using google::LogMessage; TwoBitCpxFileSignalSource::TwoBitCpxFileSignalSource(ConfigurationInterface* configuration, - std::string role, unsigned int in_streams, unsigned int out_streams, - boost::shared_ptr queue) : - role_(role), in_streams_(in_streams), out_streams_(out_streams), queue_(queue) + std::string role, unsigned int in_streams, unsigned int out_streams, + boost::shared_ptr queue) : role_(role), in_streams_(in_streams), out_streams_(out_streams), queue_(queue) { std::string default_filename = "../data/my_capture.dat"; std::string default_item_type = "byte"; @@ -57,8 +56,8 @@ TwoBitCpxFileSignalSource::TwoBitCpxFileSignalSource(ConfigurationInterface* con filename_ = configuration->property(role + ".filename", default_filename); // override value with commandline flag, if present - if (FLAGS_signal_source.compare("-") != 0) filename_= FLAGS_signal_source; - if (FLAGS_s.compare("-") != 0) filename_= FLAGS_s; + if (FLAGS_signal_source.compare("-") != 0) filename_ = FLAGS_signal_source; + if (FLAGS_s.compare("-") != 0) filename_ = FLAGS_s; item_type_ = configuration->property(role + ".item_type", default_item_type); repeat_ = configuration->property(role + ".repeat", false); @@ -72,49 +71,48 @@ TwoBitCpxFileSignalSource::TwoBitCpxFileSignalSource(ConfigurationInterface* con } else { - LOG(WARNING) << item_type_ << " unrecognized item type. Using byte."; + LOG(WARNING) << item_type_ << " unrecognized item type. Using byte."; item_size_ = sizeof(char); } try - { + { file_source_ = gr::blocks::file_source::make(item_size_, filename_.c_str(), repeat_); unpack_byte_ = make_unpack_byte_2bit_cpx_samples(); - inter_shorts_to_cpx_ = gr::blocks::interleaved_short_to_complex::make(false,true); //I/Q swap enabled - - } - catch (const std::exception &e) - { + inter_shorts_to_cpx_ = gr::blocks::interleaved_short_to_complex::make(false, true); //I/Q swap enabled + } + catch (const std::exception& e) + { std::cerr - << "The receiver was configured to work with a file signal source " - << std::endl - << "but the specified file is unreachable by GNSS-SDR." - << std::endl - << "Please modify your configuration file" - << std::endl - << "and point SignalSource.filename to a valid raw data file. Then:" - << std::endl - << "$ gnss-sdr --config_file=/path/to/my_GNSS_SDR_configuration.conf" - << std::endl - << "Examples of configuration files available at:" - << std::endl - << GNSSSDR_INSTALL_DIR "/share/gnss-sdr/conf/" - << std::endl; + << "The receiver was configured to work with a file signal source " + << std::endl + << "but the specified file is unreachable by GNSS-SDR." + << std::endl + << "Please modify your configuration file" + << std::endl + << "and point SignalSource.filename to a valid raw data file. Then:" + << std::endl + << "$ gnss-sdr --config_file=/path/to/my_GNSS_SDR_configuration.conf" + << std::endl + << "Examples of configuration files available at:" + << std::endl + << GNSSSDR_INSTALL_DIR "/share/gnss-sdr/conf/" + << std::endl; LOG(WARNING) << "file_signal_source: Unable to open the samples file " - << filename_.c_str() << ", exiting the program."; + << filename_.c_str() << ", exiting the program."; throw(e); - } + } DLOG(INFO) << "file_source(" << file_source_->unique_id() << ")"; - if (samples_ == 0) // read all file + if (samples_ == 0) // read all file { /*! * BUG workaround: The GNU Radio file source does not stop the receiver after reaching the End of File. * A possible solution is to compute the file length in samples using file size, excluding the last 2 milliseconds, and enable always the * valve block */ - std::ifstream file (filename_.c_str(), std::ios::in | std::ios::binary | std::ios::ate); + std::ifstream file(filename_.c_str(), std::ios::in | std::ios::binary | std::ios::ate); std::ifstream::pos_type size; if (file.is_open()) @@ -130,19 +128,19 @@ TwoBitCpxFileSignalSource::TwoBitCpxFileSignalSource(ConfigurationInterface* con std::streamsize ss = std::cout.precision(); std::cout << std::setprecision(16); std::cout << "Processing file " << filename_ << ", which contains " << size << " [bytes]" << std::endl; - std::cout.precision (ss); + std::cout.precision(ss); if (size > 0) { - int sample_packet_factor = 2; // 1 byte -> 2 samples + int sample_packet_factor = 2; // 1 byte -> 2 samples samples_ = floor(static_cast(size) / static_cast(item_size())) * sample_packet_factor; - samples_ = samples_- ceil(0.002 * static_cast(sampling_frequency_)); //process all the samples available in the file excluding the last 2 ms + samples_ = samples_ - ceil(0.002 * static_cast(sampling_frequency_)); //process all the samples available in the file excluding the last 2 ms } } CHECK(samples_ > 0) << "File does not contain enough samples to process."; double signal_duration_s; - signal_duration_s = static_cast(samples_) * ( 1 /static_cast(sampling_frequency_)); + signal_duration_s = static_cast(samples_) * (1 / static_cast(sampling_frequency_)); LOG(INFO) << "Total number samples to be processed= " << samples_ << " GNSS signal duration= " << signal_duration_s << " [s]"; std::cout << "GNSS signal recorded time to be processed: " << signal_duration_s << " [s]" << std::endl; @@ -172,7 +170,8 @@ TwoBitCpxFileSignalSource::TwoBitCpxFileSignalSource(ConfigurationInterface* con TwoBitCpxFileSignalSource::~TwoBitCpxFileSignalSource() -{} +{ +} void TwoBitCpxFileSignalSource::connect(gr::top_block_sptr top_block) @@ -182,8 +181,8 @@ void TwoBitCpxFileSignalSource::connect(gr::top_block_sptr top_block) if (enable_throttle_control_ == true) { top_block->connect(file_source_, 0, unpack_byte_, 0); - top_block->connect(unpack_byte_, 0,inter_shorts_to_cpx_,0); - top_block->connect(inter_shorts_to_cpx_, 0,throttle_,0); + top_block->connect(unpack_byte_, 0, inter_shorts_to_cpx_, 0); + top_block->connect(inter_shorts_to_cpx_, 0, throttle_, 0); DLOG(INFO) << "connected file source to throttle"; top_block->connect(throttle_, 0, valve_, 0); DLOG(INFO) << "connected throttle to valve"; @@ -196,8 +195,8 @@ void TwoBitCpxFileSignalSource::connect(gr::top_block_sptr top_block) else { top_block->connect(file_source_, 0, unpack_byte_, 0); - top_block->connect(unpack_byte_, 0,inter_shorts_to_cpx_,0); - top_block->connect(inter_shorts_to_cpx_, 0,valve_,0); + top_block->connect(unpack_byte_, 0, inter_shorts_to_cpx_, 0); + top_block->connect(inter_shorts_to_cpx_, 0, valve_, 0); DLOG(INFO) << "connected file source to valve"; if (dump_) { @@ -211,8 +210,8 @@ void TwoBitCpxFileSignalSource::connect(gr::top_block_sptr top_block) if (enable_throttle_control_ == true) { top_block->connect(file_source_, 0, unpack_byte_, 0); - top_block->connect(unpack_byte_, 0,inter_shorts_to_cpx_,0); - top_block->connect(inter_shorts_to_cpx_, 0,throttle_,0); + top_block->connect(unpack_byte_, 0, inter_shorts_to_cpx_, 0); + top_block->connect(inter_shorts_to_cpx_, 0, throttle_, 0); DLOG(INFO) << "connected file source to throttle"; if (dump_) { @@ -225,7 +224,7 @@ void TwoBitCpxFileSignalSource::connect(gr::top_block_sptr top_block) if (dump_) { top_block->connect(file_source_, 0, unpack_byte_, 0); - top_block->connect(unpack_byte_, 0,inter_shorts_to_cpx_,0); + top_block->connect(unpack_byte_, 0, inter_shorts_to_cpx_, 0); top_block->connect(inter_shorts_to_cpx_, 0, sink_, 0); DLOG(INFO) << "connected file source to sink"; } @@ -242,7 +241,7 @@ void TwoBitCpxFileSignalSource::disconnect(gr::top_block_sptr top_block) { top_block->disconnect(file_source_, 0, unpack_byte_, 0); DLOG(INFO) << "disconnected file source to unpack_byte_"; - top_block->connect(unpack_byte_, 0,throttle_,0); + top_block->connect(unpack_byte_, 0, throttle_, 0); DLOG(INFO) << "disconnected unpack_byte_ to throttle_"; top_block->disconnect(throttle_, 0, valve_, 0); DLOG(INFO) << "disconnected throttle to valve"; diff --git a/src/algorithms/signal_source/adapters/two_bit_cpx_file_signal_source.h b/src/algorithms/signal_source/adapters/two_bit_cpx_file_signal_source.h index 405bd1a68..1e37cdc7f 100644 --- a/src/algorithms/signal_source/adapters/two_bit_cpx_file_signal_source.h +++ b/src/algorithms/signal_source/adapters/two_bit_cpx_file_signal_source.h @@ -51,12 +51,12 @@ class ConfigurationInterface; * \brief Class that reads signals samples from a file * and adapts it to a SignalSourceInterface */ -class TwoBitCpxFileSignalSource: public GNSSBlockInterface +class TwoBitCpxFileSignalSource : public GNSSBlockInterface { public: TwoBitCpxFileSignalSource(ConfigurationInterface* configuration, std::string role, - unsigned int in_streams, unsigned int out_streams, - boost::shared_ptr queue); + unsigned int in_streams, unsigned int out_streams, + boost::shared_ptr queue); virtual ~TwoBitCpxFileSignalSource(); inline std::string role() override @@ -123,7 +123,7 @@ private: gr::blocks::interleaved_short_to_complex::sptr inter_shorts_to_cpx_; boost::shared_ptr valve_; gr::blocks::file_sink::sptr sink_; - gr::blocks::throttle::sptr throttle_; + gr::blocks::throttle::sptr throttle_; boost::shared_ptr queue_; size_t item_size_; // Throttle control diff --git a/src/algorithms/signal_source/adapters/two_bit_packed_file_signal_source.cc b/src/algorithms/signal_source/adapters/two_bit_packed_file_signal_source.cc index 829c8941b..55cdf8335 100644 --- a/src/algorithms/signal_source/adapters/two_bit_packed_file_signal_source.cc +++ b/src/algorithms/signal_source/adapters/two_bit_packed_file_signal_source.cc @@ -46,9 +46,8 @@ using google::LogMessage; TwoBitPackedFileSignalSource::TwoBitPackedFileSignalSource(ConfigurationInterface* configuration, - std::string role, unsigned int in_streams, unsigned int out_streams, - boost::shared_ptr queue) : - role_(role), in_streams_(in_streams), out_streams_(out_streams), queue_(queue) + std::string role, unsigned int in_streams, unsigned int out_streams, + boost::shared_ptr queue) : role_(role), in_streams_(in_streams), out_streams_(out_streams), queue_(queue) { std::string default_filename = "../data/my_capture.dat"; std::string default_item_type = "byte"; @@ -61,29 +60,29 @@ TwoBitPackedFileSignalSource::TwoBitPackedFileSignalSource(ConfigurationInterfac filename_ = configuration->property(role + ".filename", default_filename); // override value with commandline flag, if present - if (FLAGS_signal_source.compare("-") != 0) filename_= FLAGS_signal_source; - if (FLAGS_s.compare("-") != 0) filename_= FLAGS_s; + if (FLAGS_signal_source.compare("-") != 0) filename_ = FLAGS_signal_source; + if (FLAGS_s.compare("-") != 0) filename_ = FLAGS_s; item_type_ = configuration->property(role + ".item_type", default_item_type); big_endian_items_ = configuration->property(role + ".big_endian_items", true); big_endian_bytes_ = configuration->property(role + ".big_endian_bytes", false); - sample_type_ = configuration->property(role + ".sample_type", default_sample_type ); // options: "real", "iq", "qi" + sample_type_ = configuration->property(role + ".sample_type", default_sample_type); // options: "real", "iq", "qi" repeat_ = configuration->property(role + ".repeat", false); dump_ = configuration->property(role + ".dump", false); dump_filename_ = configuration->property(role + ".dump_filename", default_dump_filename); enable_throttle_control_ = configuration->property(role + ".enable_throttle_control", false); - double seconds_to_skip = configuration->property(role + ".seconds_to_skip", default_seconds_to_skip ); + double seconds_to_skip = configuration->property(role + ".seconds_to_skip", default_seconds_to_skip); long bytes_to_skip = 0; if (item_type_.compare("byte") == 0) { item_size_ = sizeof(char); } - else if( item_type_.compare("short") == 0) + else if (item_type_.compare("short") == 0) { // If we have shorts stored in little endian format, might as // well read them in as bytes. - if( big_endian_items_ ) + if (big_endian_items_) { item_size_ = sizeof(short); } @@ -94,20 +93,20 @@ TwoBitPackedFileSignalSource::TwoBitPackedFileSignalSource(ConfigurationInterfac } else { - LOG(WARNING) << item_type_ << " unrecognized item type. Using byte."; + LOG(WARNING) << item_type_ << " unrecognized item type. Using byte."; item_size_ = sizeof(char); } - if( sample_type_.compare("real") == 0 ) + if (sample_type_.compare("real") == 0) { is_complex_ = false; } - else if( sample_type_.compare("iq" ) == 0 ) + else if (sample_type_.compare("iq") == 0) { is_complex_ = true; reverse_interleaving_ = false; } - else if( sample_type_.compare("qi") == 0 ) + else if (sample_type_.compare("qi") == 0) { is_complex_ = true; reverse_interleaving_ = true; @@ -115,83 +114,82 @@ TwoBitPackedFileSignalSource::TwoBitPackedFileSignalSource(ConfigurationInterfac else { LOG(WARNING) << sample_type_ << " unrecognized sample type. Assuming: " - << ( is_complex_ ? ( reverse_interleaving_ ? "qi" : "iq" ) : "real" ); + << (is_complex_ ? (reverse_interleaving_ ? "qi" : "iq") : "real"); } try - { + { file_source_ = gr::blocks::file_source::make(item_size_, filename_.c_str(), repeat_); - if( seconds_to_skip > 0 ) + if (seconds_to_skip > 0) { - bytes_to_skip = static_cast< long >( - seconds_to_skip * sampling_frequency_ / 4 ); - if( is_complex_ ) + bytes_to_skip = static_cast( + seconds_to_skip * sampling_frequency_ / 4); + if (is_complex_) { bytes_to_skip <<= 1; } - file_source_->seek( bytes_to_skip, SEEK_SET ); + file_source_->seek(bytes_to_skip, SEEK_SET); } - unpack_samples_ = make_unpack_2bit_samples( big_endian_bytes_, - item_size_, big_endian_items_, reverse_interleaving_); - if( is_complex_ ) + unpack_samples_ = make_unpack_2bit_samples(big_endian_bytes_, + item_size_, big_endian_items_, reverse_interleaving_); + if (is_complex_) { char_to_float_ = - gr::blocks::interleaved_char_to_complex::make(false); + gr::blocks::interleaved_char_to_complex::make(false); } else { char_to_float_ = - gr::blocks::char_to_float::make(); + gr::blocks::char_to_float::make(); } - - } - catch (const std::exception &e) - { + } + catch (const std::exception& e) + { std::cerr - << "The receiver was configured to work with a file signal source " - << std::endl - << "but the specified file is unreachable by GNSS-SDR." - << std::endl - << "Please modify your configuration file" - << std::endl - << "and point SignalSource.filename to a valid raw data file. Then:" - << std::endl - << "$ gnss-sdr --config_file=/path/to/my_GNSS_SDR_configuration.conf" - << std::endl - << "Examples of configuration files available at:" - << std::endl - << GNSSSDR_INSTALL_DIR "/share/gnss-sdr/conf/" - << std::endl; + << "The receiver was configured to work with a file signal source " + << std::endl + << "but the specified file is unreachable by GNSS-SDR." + << std::endl + << "Please modify your configuration file" + << std::endl + << "and point SignalSource.filename to a valid raw data file. Then:" + << std::endl + << "$ gnss-sdr --config_file=/path/to/my_GNSS_SDR_configuration.conf" + << std::endl + << "Examples of configuration files available at:" + << std::endl + << GNSSSDR_INSTALL_DIR "/share/gnss-sdr/conf/" + << std::endl; LOG(WARNING) << "file_signal_source: Unable to open the samples file " - << filename_.c_str() << ", exiting the program."; + << filename_.c_str() << ", exiting the program."; throw(e); - } + } DLOG(INFO) << "file_source(" << file_source_->unique_id() << ")"; - size_t output_item_size = ( is_complex_ ? sizeof( gr_complex ) : sizeof( float ) ); + size_t output_item_size = (is_complex_ ? sizeof(gr_complex) : sizeof(float)); - if (samples_ == 0) // read all file + if (samples_ == 0) // read all file { /*! * BUG workaround: The GNU Radio file source does not stop the receiver after reaching the End of File. * A possible solution is to compute the file length in samples using file size, excluding the last 2 milliseconds, and enable always the * valve block */ - std::ifstream file (filename_.c_str(), std::ios::in | std::ios::binary | std::ios::ate); + std::ifstream file(filename_.c_str(), std::ios::in | std::ios::binary | std::ios::ate); std::ifstream::pos_type size; if (file.is_open()) { size = file.tellg(); - samples_ = floor(static_cast(size) * ( is_complex_ ? 2.0 : 4.0 ) ); - LOG(INFO) << "Total samples in the file= " << samples_; // 4 samples per byte + samples_ = floor(static_cast(size) * (is_complex_ ? 2.0 : 4.0)); + LOG(INFO) << "Total samples in the file= " << samples_; // 4 samples per byte samples_ -= bytes_to_skip; //Also skip the last two milliseconds: - samples_ -= ceil( 0.002 * sampling_frequency_ / (is_complex_ ? 2.0 : 4.0 ) ); + samples_ -= ceil(0.002 * sampling_frequency_ / (is_complex_ ? 2.0 : 4.0)); } else { @@ -201,12 +199,12 @@ TwoBitPackedFileSignalSource::TwoBitPackedFileSignalSource(ConfigurationInterfac std::streamsize ss = std::cout.precision(); std::cout << std::setprecision(16); std::cout << "Processing file " << filename_ << ", which contains " << size << " [bytes]" << std::endl; - std::cout.precision (ss); + std::cout.precision(ss); } CHECK(samples_ > 0) << "File does not contain enough samples to process."; double signal_duration_s; - signal_duration_s = static_cast(samples_) * ( 1 /static_cast(sampling_frequency_)); + signal_duration_s = static_cast(samples_) * (1 / static_cast(sampling_frequency_)); LOG(INFO) << "Total number samples to be processed= " << samples_ << " GNSS signal duration= " << signal_duration_s << " [s]"; std::cout << "GNSS signal recorded time to be processed: " << signal_duration_s << " [s]" << std::endl; @@ -236,7 +234,8 @@ TwoBitPackedFileSignalSource::TwoBitPackedFileSignalSource(ConfigurationInterfac TwoBitPackedFileSignalSource::~TwoBitPackedFileSignalSource() -{} +{ +} void TwoBitPackedFileSignalSource::connect(gr::top_block_sptr top_block) @@ -249,14 +248,14 @@ void TwoBitPackedFileSignalSource::connect(gr::top_block_sptr top_block) DLOG(INFO) << "connected file source to unpack samples"; right_block = char_to_float_; - top_block->connect( left_block, 0, right_block, 0 ); + top_block->connect(left_block, 0, right_block, 0); left_block = right_block; DLOG(INFO) << "connected unpack samples to char to float"; - if( enable_throttle_control_ ) + if (enable_throttle_control_) { right_block = throttle_; - top_block->connect( left_block, 0, right_block, 0 ); + top_block->connect(left_block, 0, right_block, 0); left_block = right_block; DLOG(INFO) << " connected to throttle"; } @@ -282,14 +281,14 @@ void TwoBitPackedFileSignalSource::disconnect(gr::top_block_sptr top_block) DLOG(INFO) << "disconnected file source to unpack samples"; right_block = char_to_float_; - top_block->disconnect( left_block, 0, right_block, 0 ); + top_block->disconnect(left_block, 0, right_block, 0); left_block = right_block; DLOG(INFO) << "disconnected unpack samples to char to float"; - if( enable_throttle_control_ ) + if (enable_throttle_control_) { right_block = throttle_; - top_block->disconnect( left_block, 0, right_block, 0 ); + top_block->disconnect(left_block, 0, right_block, 0); left_block = right_block; DLOG(INFO) << " disconnected to throttle"; } @@ -316,4 +315,3 @@ gr::basic_block_sptr TwoBitPackedFileSignalSource::get_right_block() { return valve_; } - diff --git a/src/algorithms/signal_source/adapters/two_bit_packed_file_signal_source.h b/src/algorithms/signal_source/adapters/two_bit_packed_file_signal_source.h index 72af7696a..8f10a5887 100644 --- a/src/algorithms/signal_source/adapters/two_bit_packed_file_signal_source.h +++ b/src/algorithms/signal_source/adapters/two_bit_packed_file_signal_source.h @@ -52,12 +52,12 @@ class ConfigurationInterface; * \brief Class that reads signals samples from a file * and adapts it to a SignalSourceInterface */ -class TwoBitPackedFileSignalSource: public GNSSBlockInterface +class TwoBitPackedFileSignalSource : public GNSSBlockInterface { public: TwoBitPackedFileSignalSource(ConfigurationInterface* configuration, std::string role, - unsigned int in_streams, unsigned int out_streams, - boost::shared_ptr queue); + unsigned int in_streams, unsigned int out_streams, + boost::shared_ptr queue); virtual ~TwoBitPackedFileSignalSource(); inline std::string role() override @@ -144,7 +144,7 @@ private: gr::basic_block_sptr char_to_float_; boost::shared_ptr valve_; gr::blocks::file_sink::sptr sink_; - gr::blocks::throttle::sptr throttle_; + gr::blocks::throttle::sptr throttle_; boost::shared_ptr queue_; size_t item_size_; bool big_endian_items_; diff --git a/src/algorithms/signal_source/adapters/uhd_signal_source.cc b/src/algorithms/signal_source/adapters/uhd_signal_source.cc index 7d4057c8a..7681a6ca9 100644 --- a/src/algorithms/signal_source/adapters/uhd_signal_source.cc +++ b/src/algorithms/signal_source/adapters/uhd_signal_source.cc @@ -42,10 +42,8 @@ using google::LogMessage; UhdSignalSource::UhdSignalSource(ConfigurationInterface* configuration, - std::string role, unsigned int in_stream, unsigned int out_stream, - boost::shared_ptr queue) : - role_(role), in_stream_(in_stream), out_stream_(out_stream), - queue_(queue) + std::string role, unsigned int in_stream, unsigned int out_stream, + boost::shared_ptr queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(queue) { // DUMP PARAMETERS std::string empty = ""; @@ -59,13 +57,13 @@ UhdSignalSource::UhdSignalSource(ConfigurationInterface* configuration, // available transports on the system (ethernet, usb...). // To narrow down the discovery process to a particular device, // specify a transport key/value pair specific to your device. - if (empty.compare(device_address_) != 0) // if not empty + if (empty.compare(device_address_) != 0) // if not empty { dev_addr["addr"] = device_address_; } //filter the device by serial number if required (useful for USB devices) std::string device_serial = configuration->property(role + ".device_serial", empty); - if (empty.compare(device_serial) != 0) // if not empty + if (empty.compare(device_serial) != 0) // if not empty { dev_addr["serial"] = device_serial; } @@ -85,8 +83,7 @@ UhdSignalSource::UhdSignalSource(ConfigurationInterface* configuration, freq_.push_back(configuration->property(role + ".freq", GPS_L1_FREQ_HZ)); gain_.push_back(configuration->property(role + ".gain", 50.0)); - IF_bandwidth_hz_.push_back(configuration->property(role + ".IF_bandwidth_hz", sample_rate_/2)); - + IF_bandwidth_hz_.push_back(configuration->property(role + ".IF_bandwidth_hz", sample_rate_ / 2)); } else { @@ -101,7 +98,7 @@ UhdSignalSource::UhdSignalSource(ConfigurationInterface* configuration, freq_.push_back(configuration->property(role + ".freq" + boost::lexical_cast(i), GPS_L1_FREQ_HZ)); gain_.push_back(configuration->property(role + ".gain" + boost::lexical_cast(i), 50.0)); - IF_bandwidth_hz_.push_back(configuration->property(role + ".IF_bandwidth_hz" + boost::lexical_cast(i), sample_rate_/2)); + IF_bandwidth_hz_.push_back(configuration->property(role + ".IF_bandwidth_hz" + boost::lexical_cast(i), sample_rate_ / 2)); } } // 1. Make the uhd driver instance @@ -219,14 +216,14 @@ UhdSignalSource::UhdSignalSource(ConfigurationInterface* configuration, { if (samples_.at(i) != 0) { - LOG(INFO) << "RF_channel "<< i << " Send STOP signal after " << samples_.at(i) << " samples"; + LOG(INFO) << "RF_channel " << i << " Send STOP signal after " << samples_.at(i) << " samples"; valve_.push_back(gnss_sdr_make_valve(item_size_, samples_.at(i), queue_)); DLOG(INFO) << "valve(" << valve_.at(i)->unique_id() << ")"; } if (dump_.at(i)) { - LOG(INFO) << "RF_channel "<< i << "Dumping output into file " << dump_filename_.at(i); + LOG(INFO) << "RF_channel " << i << "Dumping output into file " << dump_filename_.at(i); file_sink_.push_back(gr::blocks::file_sink::make(item_size_, dump_filename_.at(i).c_str())); DLOG(INFO) << "file_sink(" << file_sink_.at(i)->unique_id() << ")"; } @@ -234,9 +231,9 @@ UhdSignalSource::UhdSignalSource(ConfigurationInterface* configuration, } - UhdSignalSource::~UhdSignalSource() -{} +{ +} void UhdSignalSource::connect(gr::top_block_sptr top_block) @@ -265,7 +262,6 @@ void UhdSignalSource::connect(gr::top_block_sptr top_block) } - void UhdSignalSource::disconnect(gr::top_block_sptr top_block) { for (int i = 0; i < RF_channels_; i++) @@ -290,7 +286,6 @@ void UhdSignalSource::disconnect(gr::top_block_sptr top_block) } - gr::basic_block_sptr UhdSignalSource::get_left_block() { LOG(WARNING) << "Trying to get signal source left block."; diff --git a/src/algorithms/signal_source/adapters/uhd_signal_source.h b/src/algorithms/signal_source/adapters/uhd_signal_source.h index 969a44819..f2b85ec4b 100644 --- a/src/algorithms/signal_source/adapters/uhd_signal_source.h +++ b/src/algorithms/signal_source/adapters/uhd_signal_source.h @@ -46,13 +46,12 @@ class ConfigurationInterface; /*! * \brief This class reads samples from a UHD device (see http://code.ettus.com/redmine/ettus/projects/uhd/wiki) */ -class UhdSignalSource: public GNSSBlockInterface +class UhdSignalSource : public GNSSBlockInterface { - public: UhdSignalSource(ConfigurationInterface* configuration, - std::string role, unsigned int in_stream, - unsigned int out_stream, boost::shared_ptr queue); + std::string role, unsigned int in_stream, + unsigned int out_stream, boost::shared_ptr queue); virtual ~UhdSignalSource(); diff --git a/src/algorithms/signal_source/gnuradio_blocks/labsat23_source.cc b/src/algorithms/signal_source/gnuradio_blocks/labsat23_source.cc index 03b35b2be..118734dde 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/labsat23_source.cc +++ b/src/algorithms/signal_source/gnuradio_blocks/labsat23_source.cc @@ -48,13 +48,13 @@ std::string labsat23_source::generate_filename() { std::ostringstream ss; ss << std::setw(4) << std::setfill('0') << d_current_file_number; - return d_signal_file_basename + "_" + ss.str()+".LS3"; + return d_signal_file_basename + "_" + ss.str() + ".LS3"; } labsat23_source::labsat23_source(const char *signal_file_basename, int channel_selector) : gr::block("labsat23_source", - gr::io_signature::make(0, 0, 0), - gr::io_signature::make(1, 1, sizeof(gr_complex))) + gr::io_signature::make(0, 0, 0), + gr::io_signature::make(1, 1, sizeof(gr_complex))) { if (channel_selector < 1 or channel_selector > 2) { @@ -73,7 +73,7 @@ labsat23_source::labsat23_source(const char *signal_file_basename, int channel_s std::string signal_file; this->set_output_multiple(8); signal_file = generate_filename(); - binary_input_file = new std::ifstream (signal_file.c_str(), std::ios::in|std::ios::binary); + binary_input_file = new std::ifstream(signal_file.c_str(), std::ios::in | std::ios::binary); if (binary_input_file->is_open()) { @@ -104,75 +104,75 @@ int labsat23_source::getBit(uint8_t byte, int position) } -void labsat23_source::decode_samples_one_channel(int16_t input_short, gr_complex* out, int type) +void labsat23_source::decode_samples_one_channel(int16_t input_short, gr_complex *out, int type) { std::bitset<16> bs(input_short); - switch(type) - { - case 2: - //two bits per sample, 8 samples per int16 - for (int i = 0; i < 8; i++) - { - out[i] = gr_complex(static_cast(bs[15-(2*i)]), - static_cast(bs[14-(2*i)])); - out[i] = out[i]*gr_complex(2,0)-gr_complex(1,1); - } - break; - case 4: - //four bits per sample, 4 samples per int16 - for (int i = 0; i < 4; i++) - { - out[i] = gr_complex(0.0,0.0); - //In-Phase - if (bs[15-4*i]) - { - if (bs[13-4*i]) //11 - { - out[i] += gr_complex(-1,0); - } - else //10 - { - out[i] += gr_complex(-2,0); - } - } - else - { - if (bs[13-4*i]) //01 - { - out[i] += gr_complex(1,0); - } - } + switch (type) + { + case 2: + //two bits per sample, 8 samples per int16 + for (int i = 0; i < 8; i++) + { + out[i] = gr_complex(static_cast(bs[15 - (2 * i)]), + static_cast(bs[14 - (2 * i)])); + out[i] = out[i] * gr_complex(2, 0) - gr_complex(1, 1); + } + break; + case 4: + //four bits per sample, 4 samples per int16 + for (int i = 0; i < 4; i++) + { + out[i] = gr_complex(0.0, 0.0); + //In-Phase + if (bs[15 - 4 * i]) + { + if (bs[13 - 4 * i]) //11 + { + out[i] += gr_complex(-1, 0); + } + else //10 + { + out[i] += gr_complex(-2, 0); + } + } + else + { + if (bs[13 - 4 * i]) //01 + { + out[i] += gr_complex(1, 0); + } + } - //Quadrature - if (bs[14-4*i]) - { - if (bs[12-4*i]) //11 - { - out[i] += gr_complex(0,-1); - } - else //10 - { - out[i] += gr_complex(0,-2); - } - } - else - { - if (bs[12-4*i]) //01 - { - out[i] += gr_complex(0,1); - } - } - out[i] += gr_complex(0.5,0.5); - } - break; - } + //Quadrature + if (bs[14 - 4 * i]) + { + if (bs[12 - 4 * i]) //11 + { + out[i] += gr_complex(0, -1); + } + else //10 + { + out[i] += gr_complex(0, -2); + } + } + else + { + if (bs[12 - 4 * i]) //01 + { + out[i] += gr_complex(0, 1); + } + } + out[i] += gr_complex(0.5, 0.5); + } + break; + } } int labsat23_source::general_work(int noutput_items, - __attribute__((unused)) gr_vector_int &ninput_items, - __attribute__((unused)) gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) + __attribute__((unused)) gr_vector_int &ninput_items, + __attribute__((unused)) gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items) { gr_complex *out = reinterpret_cast(output_items[0]); @@ -200,13 +200,13 @@ int labsat23_source::general_work(int noutput_items, } // check Labsat version - if (memblock[byte_counter] == 0x4C and memblock[byte_counter+1] == 0x53 and memblock[byte_counter+2] == 0x32) + if (memblock[byte_counter] == 0x4C and memblock[byte_counter + 1] == 0x53 and memblock[byte_counter + 2] == 0x32) { d_labsat_version = 2; std::cout << "Labsat file version 2 detected" << std::endl; } - if (memblock[byte_counter] == 0x4C and memblock[byte_counter+1] == 0x53 and memblock[byte_counter+2] == 0x33) + if (memblock[byte_counter] == 0x4C and memblock[byte_counter + 1] == 0x53 and memblock[byte_counter + 2] == 0x33) { d_labsat_version = 3; std::cout << "Labsat file version 3 detected" << std::endl; @@ -227,80 +227,80 @@ int labsat23_source::general_work(int noutput_items, byte_counter++; int header_bytes = 0; - header_bytes += memblock[byte_counter] | (memblock[byte_counter+1] << 8) | (memblock[byte_counter+2] << 16) | (memblock[byte_counter+3] << 24); + header_bytes += memblock[byte_counter] | (memblock[byte_counter + 1] << 8) | (memblock[byte_counter + 2] << 16) | (memblock[byte_counter + 3] << 24); byte_counter += 4; //std::cout << "header_bytes=" << header_bytes << std::endl; // read first section // section ID (little-endian) - uint8_t section_id = static_cast(memblock[byte_counter]) + static_cast(memblock[byte_counter+1]) * 256; + uint8_t section_id = static_cast(memblock[byte_counter]) + static_cast(memblock[byte_counter + 1]) * 256; //std::cout << "Section ID: " << (int)section_id << std::endl; byte_counter += 2; uint8_t section_lenght_bytes = 0; - section_lenght_bytes += memblock[byte_counter] | (memblock[byte_counter+1] << 8) | (memblock[byte_counter+2] << 16) | (memblock[byte_counter+3] << 24); + section_lenght_bytes += memblock[byte_counter] | (memblock[byte_counter + 1] << 8) | (memblock[byte_counter + 2] << 16) | (memblock[byte_counter + 3] << 24); //std::cout << "section_lenght_bytes=" << (int)section_lenght_bytes << std::endl; byte_counter += 4; if (section_id == 2) { d_ref_clock = static_cast(memblock[byte_counter]); - switch(d_ref_clock) - { - case 0: - std::cout << "Labsat reference clock: internal OXCO" << std::endl; - break; - case 1: - std::cout << "Labsat reference clock: internal TXCO" << std::endl; - break; - case 2: - std::cout << "Labsat reference clock: external 10 MHz" << std::endl; - break; - case 3: - std::cout << "Labsat reference clock: external 16.386 MHz" << std::endl; - break; - default: - std::cout << "Labsat Unknown reference clock ID " << static_cast(d_ref_clock) << std::endl; - } + switch (d_ref_clock) + { + case 0: + std::cout << "Labsat reference clock: internal OXCO" << std::endl; + break; + case 1: + std::cout << "Labsat reference clock: internal TXCO" << std::endl; + break; + case 2: + std::cout << "Labsat reference clock: external 10 MHz" << std::endl; + break; + case 3: + std::cout << "Labsat reference clock: external 16.386 MHz" << std::endl; + break; + default: + std::cout << "Labsat Unknown reference clock ID " << static_cast(d_ref_clock) << std::endl; + } byte_counter++; d_bits_per_sample = static_cast(memblock[byte_counter]); - switch(d_bits_per_sample) - { - case 2: - std::cout << "Labsat is using 2 bits per sample" << std::endl; - break; - case 4: - std::cout << "Labsat is using 4 bits per sample" << std::endl; - break; - default: - std::cout << "Labsat Unknown bits per sample ID " << static_cast(d_bits_per_sample) << std::endl; - return -1; - } + switch (d_bits_per_sample) + { + case 2: + std::cout << "Labsat is using 2 bits per sample" << std::endl; + break; + case 4: + std::cout << "Labsat is using 4 bits per sample" << std::endl; + break; + default: + std::cout << "Labsat Unknown bits per sample ID " << static_cast(d_bits_per_sample) << std::endl; + return -1; + } byte_counter++; d_channel_selector = static_cast(memblock[byte_counter]); - switch(d_channel_selector) - { - case 0: - std::cout << "Available channels: Channel A + B, 1 bit quantisation" << std::endl; - break; - case 1: - std::cout << "Available channels: Channel A, 1 bit quantisation" << std::endl; - break; - case 2: - std::cout << "Available channels: Channel B, 1 bit quantisation" << std::endl; - break; - case 3: - std::cout << "Available channels: Channel A, 2 bit quantisation" << std::endl; - break; - case 4: - std::cout << "Available channels: Channel B, 2 bit quantisation" << std::endl; - break; - default: - std::cout << "Unknown channel selection ID " << static_cast(d_channel_selector) << std::endl; - return -1; - } + switch (d_channel_selector) + { + case 0: + std::cout << "Available channels: Channel A + B, 1 bit quantisation" << std::endl; + break; + case 1: + std::cout << "Available channels: Channel A, 1 bit quantisation" << std::endl; + break; + case 2: + std::cout << "Available channels: Channel B, 1 bit quantisation" << std::endl; + break; + case 3: + std::cout << "Available channels: Channel A, 2 bit quantisation" << std::endl; + break; + case 4: + std::cout << "Available channels: Channel B, 2 bit quantisation" << std::endl; + break; + default: + std::cout << "Unknown channel selection ID " << static_cast(d_channel_selector) << std::endl; + return -1; + } //check if the selected channel in config file match the file encoding if (d_channel_selector_config == 2 and d_channel_selector != 0) @@ -317,49 +317,49 @@ int labsat23_source::general_work(int noutput_items, } byte_counter++; uint8_t quantization = static_cast(memblock[byte_counter]); - switch(quantization) - { - case 1: - std::cout << "1 bit per sample" << std::endl; - break; - case 2: - std::cout << "2 bit per sample" << std::endl; - break; - default: - std::cout << "Unknown quantization ID " << static_cast(quantization) << std::endl; - } + switch (quantization) + { + case 1: + std::cout << "1 bit per sample" << std::endl; + break; + case 2: + std::cout << "2 bit per sample" << std::endl; + break; + default: + std::cout << "Unknown quantization ID " << static_cast(quantization) << std::endl; + } byte_counter++; uint8_t channel_a_constellation = static_cast(memblock[byte_counter]); - switch(channel_a_constellation) - { - case 0: - std::cout << "Labsat Channel A is GPS" << std::endl; - break; - case 1: - std::cout << "Labsat Channel A is GLONASS" << std::endl; - break; - case 2: - std::cout << "Labsat Channel A is BDS" << std::endl; - break; - default: - std::cout << "Unknown channel A constellation ID " << static_cast(channel_a_constellation) << std::endl; - } + switch (channel_a_constellation) + { + case 0: + std::cout << "Labsat Channel A is GPS" << std::endl; + break; + case 1: + std::cout << "Labsat Channel A is GLONASS" << std::endl; + break; + case 2: + std::cout << "Labsat Channel A is BDS" << std::endl; + break; + default: + std::cout << "Unknown channel A constellation ID " << static_cast(channel_a_constellation) << std::endl; + } byte_counter++; uint8_t channel_b_constellation = static_cast(memblock[byte_counter]); - switch(channel_b_constellation) - { - case 0: - std::cout << "Labsat Channel B is GPS" << std::endl; - break; - case 1: - std::cout << "Labsat Channel B is GLONASS" << std::endl; - break; - case 2: - std::cout << "Labsat Channel B is BDS" << std::endl; - break; - default: - std::cout << "Unknown channel B constellation ID " << static_cast(channel_b_constellation) << std::endl; - } + switch (channel_b_constellation) + { + case 0: + std::cout << "Labsat Channel B is GPS" << std::endl; + break; + case 1: + std::cout << "Labsat Channel B is GLONASS" << std::endl; + break; + case 2: + std::cout << "Labsat Channel B is BDS" << std::endl; + break; + default: + std::cout << "Unknown channel B constellation ID " << static_cast(channel_b_constellation) << std::endl; + } //end of header d_header_parsed = true; @@ -383,115 +383,115 @@ int labsat23_source::general_work(int noutput_items, else { //ready to start reading samples - switch(d_bits_per_sample) - { - case 2: + switch (d_bits_per_sample) { - switch(d_channel_selector) + case 2: { - case 0: - // dual channel 2 bits per complex sample - break; - default: - //single channel 2 bits per complex sample (1 bit I + 1 bit Q, 8 samples per int16) - int n_int16_to_read = noutput_items / 8; - if (n_int16_to_read > 0) + switch (d_channel_selector) { - int16_t memblock[n_int16_to_read]; - binary_input_file->read(reinterpret_cast(memblock), n_int16_to_read * 2); - n_int16_to_read = binary_input_file->gcount() / 2; //from bytes to int16 + case 0: + // dual channel 2 bits per complex sample + break; + default: + //single channel 2 bits per complex sample (1 bit I + 1 bit Q, 8 samples per int16) + int n_int16_to_read = noutput_items / 8; if (n_int16_to_read > 0) { - int output_pointer = 0; - for (int i = 0; i < n_int16_to_read; i++) + int16_t memblock[n_int16_to_read]; + binary_input_file->read(reinterpret_cast(memblock), n_int16_to_read * 2); + n_int16_to_read = binary_input_file->gcount() / 2; //from bytes to int16 + if (n_int16_to_read > 0) { - decode_samples_one_channel(memblock[i], &out[output_pointer], d_bits_per_sample); - output_pointer += 8; - } - return output_pointer; - } - else - { - //trigger the read of the next file in the sequence - std::cout << "End of current file, reading the next Labsat file in sequence: " << generate_filename() << std::endl; - - d_current_file_number++; - binary_input_file->close(); - binary_input_file->open(generate_filename().c_str(), std::ios::in|std::ios::binary); - if (binary_input_file->is_open()) - { - std::cout << "Labsat file source is reading samples from " << generate_filename() << std::endl; + int output_pointer = 0; + for (int i = 0; i < n_int16_to_read; i++) + { + decode_samples_one_channel(memblock[i], &out[output_pointer], d_bits_per_sample); + output_pointer += 8; + } + return output_pointer; } else { - std::cout << "Last file reached, LabSat source stop" << std::endl; - return -1; + //trigger the read of the next file in the sequence + std::cout << "End of current file, reading the next Labsat file in sequence: " << generate_filename() << std::endl; + + d_current_file_number++; + binary_input_file->close(); + binary_input_file->open(generate_filename().c_str(), std::ios::in | std::ios::binary); + if (binary_input_file->is_open()) + { + std::cout << "Labsat file source is reading samples from " << generate_filename() << std::endl; + } + else + { + std::cout << "Last file reached, LabSat source stop" << std::endl; + return -1; + } } } - } - else - { - return 0; - } - }; - break; - } - case 4: - { - switch(d_channel_selector) - { - case 0: - // dual channel - break; - default: - //single channel 4 bits per complex sample (2 bit I + 2 bit Q, 4 samples per int16) - int n_int16_to_read = noutput_items / 4; - if (n_int16_to_read > 0) - { - int16_t memblock[n_int16_to_read]; - binary_input_file->read(reinterpret_cast(memblock), n_int16_to_read * 2); - n_int16_to_read = binary_input_file->gcount() / 2; //from bytes to int16 - if (n_int16_to_read > 0) - { - int output_pointer = 0; - for (int i = 0; i < n_int16_to_read; i++) - { - decode_samples_one_channel(memblock[i], &out[output_pointer], d_bits_per_sample); - output_pointer += 4; - } - return output_pointer; - } else { - //trigger the read of the next file in the sequence - std::cout << "End of current file, reading the next Labsat file in sequence: " << generate_filename() << std::endl; - - d_current_file_number++; - binary_input_file->close(); - binary_input_file->open(generate_filename().c_str(), std::ios::in|std::ios::binary); - if (binary_input_file->is_open()) - { - std::cout << "Labsat file source is reading samples from " << generate_filename() << std::endl; - } - else - { - std::cout << "Last file reached, LabSat source stop" << std::endl; - return -1; - } + return 0; } - } - else - { - return 0; - } + }; + break; + } + case 4: + { + switch (d_channel_selector) + { + case 0: + // dual channel + break; + default: + //single channel 4 bits per complex sample (2 bit I + 2 bit Q, 4 samples per int16) + int n_int16_to_read = noutput_items / 4; + if (n_int16_to_read > 0) + { + int16_t memblock[n_int16_to_read]; + binary_input_file->read(reinterpret_cast(memblock), n_int16_to_read * 2); + n_int16_to_read = binary_input_file->gcount() / 2; //from bytes to int16 + if (n_int16_to_read > 0) + { + int output_pointer = 0; + for (int i = 0; i < n_int16_to_read; i++) + { + decode_samples_one_channel(memblock[i], &out[output_pointer], d_bits_per_sample); + output_pointer += 4; + } + return output_pointer; + } + else + { + //trigger the read of the next file in the sequence + std::cout << "End of current file, reading the next Labsat file in sequence: " << generate_filename() << std::endl; + + d_current_file_number++; + binary_input_file->close(); + binary_input_file->open(generate_filename().c_str(), std::ios::in | std::ios::binary); + if (binary_input_file->is_open()) + { + std::cout << "Labsat file source is reading samples from " << generate_filename() << std::endl; + } + else + { + std::cout << "Last file reached, LabSat source stop" << std::endl; + return -1; + } + } + } + else + { + return 0; + } + } + break; + } + default: + { + return -1; } - break; } - default: - { - return -1; - } - } } std::cout << "Warning!!" << std::endl; return 0; diff --git a/src/algorithms/signal_source/gnuradio_blocks/labsat23_source.h b/src/algorithms/signal_source/gnuradio_blocks/labsat23_source.h index 2444087c1..311a8a08d 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/labsat23_source.h +++ b/src/algorithms/signal_source/gnuradio_blocks/labsat23_source.h @@ -46,12 +46,12 @@ labsat23_source_sptr labsat23_make_source(const char *signal_file_basename, int /*! * \brief This class implements conversion between Labsat2 and 3 format byte packet samples to gr_complex */ -class labsat23_source: public gr::block +class labsat23_source : public gr::block { private: friend labsat23_source_sptr labsat23_make_source_sptr(const char *signal_file_basename, int channel_selector); std::string generate_filename(); - void decode_samples_one_channel(int16_t input_short, gr_complex* out, int type); + void decode_samples_one_channel(int16_t input_short, gr_complex *out, int type); int getBit(uint8_t byte, int position); bool d_header_parsed; uint8_t d_channel_selector; @@ -67,9 +67,9 @@ public: labsat23_source(const char *signal_file_basename, int channel_selector); ~labsat23_source(); int general_work(int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); + gr_vector_int &ninput_items, + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items); }; #endif diff --git a/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.cc b/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.cc index ba4cce424..e874e8a14 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.cc +++ b/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.cc @@ -43,33 +43,34 @@ using boost::asio::ip::tcp; // Buffer constants // TODO: Make these configurable -enum { - RTL_TCP_BUFFER_SIZE = 1024 * 16, // 16 KB - RTL_TCP_PAYLOAD_SIZE = 1024 * 4 // 4 KB +enum +{ + RTL_TCP_BUFFER_SIZE = 1024 * 16, // 16 KB + RTL_TCP_PAYLOAD_SIZE = 1024 * 4 // 4 KB }; rtl_tcp_signal_source_c_sptr rtl_tcp_make_signal_source_c(const std::string &address, - short port, - bool flip_iq) + short port, + bool flip_iq) { - return gnuradio::get_initial_sptr (new rtl_tcp_signal_source_c (address, - port, - flip_iq)); + return gnuradio::get_initial_sptr(new rtl_tcp_signal_source_c(address, + port, + flip_iq)); } rtl_tcp_signal_source_c::rtl_tcp_signal_source_c(const std::string &address, - short port, - bool flip_iq) -: gr::sync_block ("rtl_tcp_signal_source_c", - gr::io_signature::make(0, 0, 0), - gr::io_signature::make(1, 1, sizeof(gr_complex))), - socket_ (io_service_), - data_ (RTL_TCP_PAYLOAD_SIZE), - flip_iq_(flip_iq), - buffer_ (RTL_TCP_BUFFER_SIZE), - unread_ (0) + short port, + bool flip_iq) + : gr::sync_block("rtl_tcp_signal_source_c", + gr::io_signature::make(0, 0, 0), + gr::io_signature::make(1, 1, sizeof(gr_complex))), + socket_(io_service_), + data_(RTL_TCP_PAYLOAD_SIZE), + flip_iq_(flip_iq), + buffer_(RTL_TCP_BUFFER_SIZE), + unread_(0) { boost::system::error_code ec; @@ -80,32 +81,32 @@ rtl_tcp_signal_source_c::rtl_tcp_signal_source_c(const std::string &address, } // 2. Set socket options - ip::address addr = ip::address::from_string (address, ec); + ip::address addr = ip::address::from_string(address, ec); if (ec) { std::cout << address << " is not an IP address" << std::endl; - LOG (ERROR) << address << " is not an IP address"; + LOG(ERROR) << address << " is not an IP address"; return; } - ip::tcp::endpoint ep (addr, port); - socket_.open (ep.protocol( ), ec); + ip::tcp::endpoint ep(addr, port); + socket_.open(ep.protocol(), ec); if (ec) { std::cout << "Failed to open socket." << std::endl; - LOG (ERROR) << "Failed to open socket."; + LOG(ERROR) << "Failed to open socket."; } - socket_.set_option (boost::asio::socket_base::reuse_address (true), ec); + socket_.set_option(boost::asio::socket_base::reuse_address(true), ec); if (ec) { std::cout << "Failed to set reuse address option: " << ec << std::endl; - LOG (WARNING) << "Failed to set reuse address option"; + LOG(WARNING) << "Failed to set reuse address option"; } - socket_.set_option (boost::asio::socket_base::linger (true, 0), ec); + socket_.set_option(boost::asio::socket_base::linger(true, 0), ec); if (ec) { std::cout << "Failed to set linger option: " << ec << std::endl; - LOG (WARNING) << "Failed to set linger option"; + LOG(WARNING) << "Failed to set linger option"; } // 3. Connect socket @@ -114,162 +115,162 @@ rtl_tcp_signal_source_c::rtl_tcp_signal_source_c(const std::string &address, if (ec) { std::cout << "Failed to connect to " << addr << ":" << port - << "(" << ec << ")" << std::endl; - LOG (ERROR) << "Failed to connect to " << addr << ":" << port - << "(" << ec << ")"; + << "(" << ec << ")" << std::endl; + LOG(ERROR) << "Failed to connect to " << addr << ":" << port + << "(" << ec << ")"; return; } std::cout << "Connected to " << addr << ":" << port << std::endl; - LOG (INFO) << "Connected to " << addr << ":" << port; + LOG(INFO) << "Connected to " << addr << ":" << port; // 4. Set nodelay - socket_.set_option (tcp::no_delay (true), ec); + socket_.set_option(tcp::no_delay(true), ec); if (ec) { std::cout << "Failed to set no delay option." << std::endl; - LOG (WARNING) << "Failed to set no delay option"; + LOG(WARNING) << "Failed to set no delay option"; } // 5. Receive dongle info - ec = info_.read (socket_); + ec = info_.read(socket_); if (ec) { std::cout << "Failed to read dongle info." << std::endl; - LOG (WARNING) << "Failed to read dongle info"; + LOG(WARNING) << "Failed to read dongle info"; } - else if (info_.is_valid ()) + else if (info_.is_valid()) { - std::cout << "Found " << info_.get_type_name() << " tuner." << std::endl; - LOG (INFO) << "Found " << info_.get_type_name() << " tuner."; + std::cout << "Found " << info_.get_type_name() << " tuner." << std::endl; + LOG(INFO) << "Found " << info_.get_type_name() << " tuner."; } // 6. Start reading - boost::asio::async_read (socket_, boost::asio::buffer (data_), - boost::bind (&rtl_tcp_signal_source_c::handle_read, - this, _1, _2)); - boost::thread (boost::bind (&boost::asio::io_service::run, &io_service_)); + boost::asio::async_read(socket_, boost::asio::buffer(data_), + boost::bind(&rtl_tcp_signal_source_c::handle_read, + this, _1, _2)); + boost::thread(boost::bind(&boost::asio::io_service::run, &io_service_)); } rtl_tcp_signal_source_c::~rtl_tcp_signal_source_c() { - io_service_.stop (); + io_service_.stop(); } -int rtl_tcp_signal_source_c::work (int noutput_items, - gr_vector_const_void_star &/*input_items*/, - gr_vector_void_star &output_items) +int rtl_tcp_signal_source_c::work(int noutput_items, + gr_vector_const_void_star & /*input_items*/, + gr_vector_void_star &output_items) { - gr_complex *out = reinterpret_cast ( output_items[0] ); + gr_complex *out = reinterpret_cast(output_items[0]); int i = 0; - if (io_service_.stopped ()) + if (io_service_.stopped()) { return -1; } { - boost::mutex::scoped_lock lock (mutex_); - not_empty_.wait (lock, boost::bind (&rtl_tcp_signal_source_c::not_empty, - this)); + boost::mutex::scoped_lock lock(mutex_); + not_empty_.wait(lock, boost::bind(&rtl_tcp_signal_source_c::not_empty, + this)); - for ( ; i < noutput_items && unread_ > 1; i++ ) + for (; i < noutput_items && unread_ > 1; i++) { float re = buffer_[--unread_]; float im = buffer_[--unread_]; if (flip_iq_) { - out[i] = gr_complex (im, re); + out[i] = gr_complex(im, re); } else { - out[i] = gr_complex (re, im); + out[i] = gr_complex(re, im); } } } - not_full_.notify_one (); + not_full_.notify_one(); return i == 0 ? -1 : i; } -void rtl_tcp_signal_source_c::set_frequency (int frequency) +void rtl_tcp_signal_source_c::set_frequency(int frequency) { boost::system::error_code ec = - rtl_tcp_command (RTL_TCP_SET_FREQUENCY, frequency, socket_); + rtl_tcp_command(RTL_TCP_SET_FREQUENCY, frequency, socket_); if (ec) { std::cout << "Failed to set frequency" << std::endl; - LOG (WARNING) << "Failed to set frequency"; + LOG(WARNING) << "Failed to set frequency"; } } -void rtl_tcp_signal_source_c::set_sample_rate (int sample_rate) +void rtl_tcp_signal_source_c::set_sample_rate(int sample_rate) { boost::system::error_code ec = - rtl_tcp_command (RTL_TCP_SET_SAMPLE_RATE, sample_rate, socket_); + rtl_tcp_command(RTL_TCP_SET_SAMPLE_RATE, sample_rate, socket_); if (ec) { std::cout << "Failed to set sample rate" << std::endl; - LOG (WARNING) << "Failed to set sample rate"; + LOG(WARNING) << "Failed to set sample rate"; } } -void rtl_tcp_signal_source_c::set_agc_mode (bool agc) +void rtl_tcp_signal_source_c::set_agc_mode(bool agc) { boost::system::error_code ec = - rtl_tcp_command (RTL_TCP_SET_GAIN_MODE, !agc, socket_); + rtl_tcp_command(RTL_TCP_SET_GAIN_MODE, !agc, socket_); if (ec) { std::cout << "Failed to set gain mode" << std::endl; - LOG (WARNING) << "Failed to set gain mode"; + LOG(WARNING) << "Failed to set gain mode"; } - ec = rtl_tcp_command (RTL_TCP_SET_AGC_MODE, agc, socket_); + ec = rtl_tcp_command(RTL_TCP_SET_AGC_MODE, agc, socket_); if (ec) { std::cout << "Failed to set gain mode" << std::endl; - LOG (WARNING) << "Failed to set gain mode"; + LOG(WARNING) << "Failed to set gain mode"; } } -void rtl_tcp_signal_source_c::set_gain (int gain) +void rtl_tcp_signal_source_c::set_gain(int gain) { - unsigned clipped = static_cast (info_.clip_gain (gain) * 10.0); - boost::system::error_code ec = rtl_tcp_command (RTL_TCP_SET_GAIN, clipped, socket_); + unsigned clipped = static_cast(info_.clip_gain(gain) * 10.0); + boost::system::error_code ec = rtl_tcp_command(RTL_TCP_SET_GAIN, clipped, socket_); if (ec) { std::cout << "Failed to set gain" << std::endl; - LOG (WARNING) << "Failed to set gain"; + LOG(WARNING) << "Failed to set gain"; } } -void rtl_tcp_signal_source_c::set_if_gain (int gain) +void rtl_tcp_signal_source_c::set_if_gain(int gain) { // from gr-osmosdr - struct range { + struct range + { double start, stop, step; }; - if (info_.get_tuner_type () != rtl_tcp_dongle_info::TUNER_E4000) + if (info_.get_tuner_type() != rtl_tcp_dongle_info::TUNER_E4000) { return; } std::vector ranges = { - { -3, 6, 9 }, - { 0, 9, 3 }, - { 0, 9, 3 }, - { 0, 2, 1 }, - { 3, 15, 3}, - { 3, 15, 3} - }; + {-3, 6, 9}, + {0, 9, 3}, + {0, 9, 3}, + {0, 2, 1}, + {3, 15, 3}, + {3, 15, 3}}; - std::map gains; - for (int i = 0; i < static_cast(ranges.size ()); i++) + std::map gains; + for (int i = 0; i < static_cast(ranges.size()); i++) { - gains[i+1] = ranges[i].start; + gains[i + 1] = ranges[i].start; } for (int i = ranges.size() - 1; i >= 0; i--) @@ -280,7 +281,7 @@ void rtl_tcp_signal_source_c::set_if_gain (int gain) for (double g = r.start; g < r.stop; g += r.step) { double sum = 0; - for (int j = 0; j < static_cast ( gains.size() ); j++) + for (int j = 0; j < static_cast(gains.size()); j++) { if (i == j) { @@ -291,71 +292,70 @@ void rtl_tcp_signal_source_c::set_if_gain (int gain) sum += gains[j + 1]; } } - double err = std::abs (gain - sum); + double err = std::abs(gain - sum); if (err < error) { error = err; - gains[i+1] = g; + gains[i + 1] = g; } } } for (unsigned stage = 1; stage <= gains.size(); stage++) { - int stage_gain = static_cast( gains[stage] * 10 ); + int stage_gain = static_cast(gains[stage] * 10); unsigned param = (stage << 16) | (stage_gain & 0xffff); - boost::system::error_code ec = rtl_tcp_command (RTL_TCP_SET_IF_GAIN, param, socket_); + boost::system::error_code ec = rtl_tcp_command(RTL_TCP_SET_IF_GAIN, param, socket_); if (ec) { std::cout << "Failed to set if gain" << std::endl; - LOG (WARNING) << "Failed to set if gain"; + LOG(WARNING) << "Failed to set if gain"; } } } - -void rtl_tcp_signal_source_c::handle_read (const boost::system::error_code &ec, - size_t bytes_transferred) +void rtl_tcp_signal_source_c::handle_read(const boost::system::error_code &ec, + size_t bytes_transferred) { if (ec) { std::cout << "Error during read: " << ec << std::endl; - LOG (WARNING) << "Error during read: " << ec; - boost::mutex::scoped_lock lock (mutex_); - io_service_.stop (); - not_empty_.notify_one (); + LOG(WARNING) << "Error during read: " << ec; + boost::mutex::scoped_lock lock(mutex_); + io_service_.stop(); + not_empty_.notify_one(); } else { { // Unpack read data - boost::mutex::scoped_lock lock (mutex_); - not_full_.wait (lock, - boost::bind (&rtl_tcp_signal_source_c::not_full, - this)); + boost::mutex::scoped_lock lock(mutex_); + not_full_.wait(lock, + boost::bind(&rtl_tcp_signal_source_c::not_full, + this)); for (size_t i = 0; i < bytes_transferred; i++) { - while (!not_full( )) + while (!not_full()) { // uh-oh, buffer overflow // wait until there's space for more - not_empty_.notify_one (); // needed? - not_full_.wait (lock, - boost::bind (&rtl_tcp_signal_source_c::not_full, - this)); + not_empty_.notify_one(); // needed? + not_full_.wait(lock, + boost::bind(&rtl_tcp_signal_source_c::not_full, + this)); } - buffer_.push_front (lookup_[data_[i]]); + buffer_.push_front(lookup_[data_[i]]); unread_++; } } // let woker know that more data is available - not_empty_.notify_one (); + not_empty_.notify_one(); // Read some more - boost::asio::async_read (socket_, - boost::asio::buffer (data_), - boost::bind (&rtl_tcp_signal_source_c::handle_read, - this, _1, _2)); + boost::asio::async_read(socket_, + boost::asio::buffer(data_), + boost::bind(&rtl_tcp_signal_source_c::handle_read, + this, _1, _2)); } } diff --git a/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.h b/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.h index 7ad2e7827..add22b03b 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.h +++ b/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.h @@ -50,12 +50,12 @@ class rtl_tcp_signal_source_c; typedef boost::shared_ptr - rtl_tcp_signal_source_c_sptr; + rtl_tcp_signal_source_c_sptr; rtl_tcp_signal_source_c_sptr rtl_tcp_make_signal_source_c(const std::string &address, - short port, - bool flip_iq = false); + short port, + bool flip_iq = false); /*! * \brief This class reads interleaved I/Q samples @@ -66,27 +66,27 @@ class rtl_tcp_signal_source_c : public gr::sync_block public: ~rtl_tcp_signal_source_c(); - int work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); + int work(int noutput_items, + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items); - void set_frequency (int frequency); - void set_sample_rate (int sample_rate); - void set_agc_mode (bool agc); - void set_gain (int gain); - void set_if_gain (int gain); + void set_frequency(int frequency); + void set_sample_rate(int sample_rate); + void set_agc_mode(bool agc); + void set_gain(int gain); + void set_if_gain(int gain); private: typedef boost::circular_buffer_space_optimized buffer_type; friend rtl_tcp_signal_source_c_sptr rtl_tcp_make_signal_source_c(const std::string &address, - short port, - bool flip_iq); + short port, + bool flip_iq); rtl_tcp_signal_source_c(const std::string &address, - short port, - bool flip_iq); + short port, + bool flip_iq); rtl_tcp_dongle_info info_; @@ -107,18 +107,18 @@ private: boost::array lookup_; // async read callback - void handle_read (const boost::system::error_code &ec, - size_t bytes_transferred); + void handle_read(const boost::system::error_code &ec, + size_t bytes_transferred); - inline bool not_full ( ) const + inline bool not_full() const { - return unread_ < buffer_.capacity( ); + return unread_ < buffer_.capacity(); } - inline bool not_empty ( ) const + inline bool not_empty() const { - return unread_ > 0 || io_service_.stopped (); + return unread_ > 0 || io_service_.stopped(); } }; -#endif // GNSS_SDR_RTL_TCP_SIGNAL_SOURCE_C_H +#endif // GNSS_SDR_RTL_TCP_SIGNAL_SOURCE_C_H diff --git a/src/algorithms/signal_source/gnuradio_blocks/unpack_2bit_samples.cc b/src/algorithms/signal_source/gnuradio_blocks/unpack_2bit_samples.cc index b41996bcf..e70531795 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/unpack_2bit_samples.cc +++ b/src/algorithms/signal_source/gnuradio_blocks/unpack_2bit_samples.cc @@ -34,10 +34,10 @@ struct byte_2bit_struct { - signed sample_0:2; // <- 2 bits wide only - signed sample_1:2; // <- 2 bits wide only - signed sample_2:2; // <- 2 bits wide only - signed sample_3:2; // <- 2 bits wide only + signed sample_0 : 2; // <- 2 bits wide only + signed sample_1 : 2; // <- 2 bits wide only + signed sample_2 : 2; // <- 2 bits wide only + signed sample_3 : 2; // <- 2 bits wide only }; @@ -56,7 +56,7 @@ bool systemIsBigEndian() char c[4]; } test_int = {0x01020304}; - return test_int.c[0] == 1; + return test_int.c[0] == 1; } @@ -64,12 +64,14 @@ bool systemBytesAreBigEndian() { byte_and_samples b; b.byte = static_cast(0x01); - if(*(char *)&b.byte == 1) return false; - else return true; + if (*(char *)&b.byte == 1) + return false; + else + return true; } -void swapEndianness( int8_t const *in, std::vector< int8_t > &out, size_t item_size, unsigned int ninput_items ) +void swapEndianness(int8_t const *in, std::vector &out, size_t item_size, unsigned int ninput_items) { unsigned int i; unsigned int j = 0; @@ -77,11 +79,11 @@ void swapEndianness( int8_t const *in, std::vector< int8_t > &out, size_t item_s int l = 0; size_t skip = item_size - 1; - for( i = 0; i < ninput_items; ++i ) + for (i = 0; i < ninput_items; ++i) { k = j + skip; l = j; - while( k >= l ) + while (k >= l) { out[j++] = in[k--]; } @@ -89,28 +91,27 @@ void swapEndianness( int8_t const *in, std::vector< int8_t > &out, size_t item_s } -unpack_2bit_samples_sptr make_unpack_2bit_samples( bool big_endian_bytes, - size_t item_size, - bool big_endian_items, - bool reverse_interleaving ) +unpack_2bit_samples_sptr make_unpack_2bit_samples(bool big_endian_bytes, + size_t item_size, + bool big_endian_items, + bool reverse_interleaving) { return unpack_2bit_samples_sptr( - new unpack_2bit_samples( big_endian_bytes, - item_size, - big_endian_items, - reverse_interleaving ) - ); + new unpack_2bit_samples(big_endian_bytes, + item_size, + big_endian_items, + reverse_interleaving)); } -unpack_2bit_samples::unpack_2bit_samples( bool big_endian_bytes, - size_t item_size, - bool big_endian_items, - bool reverse_interleaving ) +unpack_2bit_samples::unpack_2bit_samples(bool big_endian_bytes, + size_t item_size, + bool big_endian_items, + bool reverse_interleaving) : sync_interpolator("unpack_2bit_samples", - gr::io_signature::make(1, 1, item_size), - gr::io_signature::make(1, 1, sizeof(char)), - 4*item_size ), // we make 4 bytes out for every byte in + gr::io_signature::make(1, 1, item_size), + gr::io_signature::make(1, 1, sizeof(char)), + 4 * item_size), // we make 4 bytes out for every byte in big_endian_bytes_(big_endian_bytes), item_size_(item_size), big_endian_items_(big_endian_items), @@ -119,38 +120,39 @@ unpack_2bit_samples::unpack_2bit_samples( bool big_endian_bytes, { bool big_endian_system = systemIsBigEndian(); - // Only swap the item bytes if the item size > 1 byte and the system + // Only swap the item bytes if the item size > 1 byte and the system // endianess is not the same as the item endianness: - swap_endian_items_ = ( item_size_ > 1 ) && - ( big_endian_system != big_endian_items); + swap_endian_items_ = (item_size_ > 1) && + (big_endian_system != big_endian_items); bool big_endian_bytes_system = systemBytesAreBigEndian(); - swap_endian_bytes_ = ( big_endian_bytes_system != big_endian_bytes_ ); + swap_endian_bytes_ = (big_endian_bytes_system != big_endian_bytes_); } unpack_2bit_samples::~unpack_2bit_samples() -{} +{ +} int unpack_2bit_samples::work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items) { signed char const *in = reinterpret_cast(input_items[0]); - int8_t *out = reinterpret_cast(output_items[0]); + int8_t *out = reinterpret_cast(output_items[0]); - size_t ninput_bytes = noutput_items/4; - size_t ninput_items = ninput_bytes/item_size_; + size_t ninput_bytes = noutput_items / 4; + size_t ninput_items = ninput_bytes / item_size_; // Handle endian swap if needed - if( swap_endian_items_ ) + if (swap_endian_items_) { - work_buffer_.reserve( ninput_bytes ); - swapEndianness( in, work_buffer_, item_size_, ninput_items ); + work_buffer_.reserve(ninput_bytes); + swapEndianness(in, work_buffer_, item_size_, ninput_items); - in = const_cast< signed char const *> ( &work_buffer_[0] ); + in = const_cast(&work_buffer_[0]); } // Here the in pointer can be interpreted as a stream of bytes to be @@ -161,65 +163,64 @@ int unpack_2bit_samples::work(int noutput_items, byte_and_samples raw_byte; int n = 0; - if( !reverse_interleaving_ ) + if (!reverse_interleaving_) { - if( swap_endian_bytes_ ) + if (swap_endian_bytes_) { - for(unsigned int i = 0; i < ninput_bytes; ++i) + for (unsigned int i = 0; i < ninput_bytes; ++i) { // Read packed input sample (1 byte = 4 samples) raw_byte.byte = in[i]; - out[n++] = static_cast( 2*raw_byte.samples.sample_3 + 1 ); - out[n++] = static_cast( 2*raw_byte.samples.sample_2 + 1 ); - out[n++] = static_cast( 2*raw_byte.samples.sample_1 + 1 ); - out[n++] = static_cast( 2*raw_byte.samples.sample_0 + 1 ); + out[n++] = static_cast(2 * raw_byte.samples.sample_3 + 1); + out[n++] = static_cast(2 * raw_byte.samples.sample_2 + 1); + out[n++] = static_cast(2 * raw_byte.samples.sample_1 + 1); + out[n++] = static_cast(2 * raw_byte.samples.sample_0 + 1); } } else { - for(unsigned int i = 0; i < ninput_bytes; ++i ) + for (unsigned int i = 0; i < ninput_bytes; ++i) { // Read packed input sample (1 byte = 4 samples) raw_byte.byte = in[i]; - out[n++] = static_cast( 2*raw_byte.samples.sample_0 + 1 ); - out[n++] = static_cast( 2*raw_byte.samples.sample_1 + 1 ); - out[n++] = static_cast( 2*raw_byte.samples.sample_2 + 1 ); - out[n++] = static_cast( 2*raw_byte.samples.sample_3 + 1 ); + out[n++] = static_cast(2 * raw_byte.samples.sample_0 + 1); + out[n++] = static_cast(2 * raw_byte.samples.sample_1 + 1); + out[n++] = static_cast(2 * raw_byte.samples.sample_2 + 1); + out[n++] = static_cast(2 * raw_byte.samples.sample_3 + 1); } } } else { - if( swap_endian_bytes_ ) + if (swap_endian_bytes_) { - for(unsigned int i = 0; i < ninput_bytes; ++i) + for (unsigned int i = 0; i < ninput_bytes; ++i) { // Read packed input sample (1 byte = 4 samples) raw_byte.byte = in[i]; - out[n++] = static_cast( 2*raw_byte.samples.sample_2 + 1 ); - out[n++] = static_cast( 2*raw_byte.samples.sample_3 + 1 ); - out[n++] = static_cast( 2*raw_byte.samples.sample_0 + 1 ); - out[n++] = static_cast( 2*raw_byte.samples.sample_1 + 1 ); + out[n++] = static_cast(2 * raw_byte.samples.sample_2 + 1); + out[n++] = static_cast(2 * raw_byte.samples.sample_3 + 1); + out[n++] = static_cast(2 * raw_byte.samples.sample_0 + 1); + out[n++] = static_cast(2 * raw_byte.samples.sample_1 + 1); } } else { - for(unsigned int i = 0; i < ninput_bytes; ++i ) + for (unsigned int i = 0; i < ninput_bytes; ++i) { // Read packed input sample (1 byte = 4 samples) raw_byte.byte = in[i]; - out[n++] = static_cast( 2*raw_byte.samples.sample_1 + 1 ); - out[n++] = static_cast( 2*raw_byte.samples.sample_0 + 1 ); - out[n++] = static_cast( 2*raw_byte.samples.sample_3 + 1 ); - out[n++] = static_cast( 2*raw_byte.samples.sample_2 + 1 ); + out[n++] = static_cast(2 * raw_byte.samples.sample_1 + 1); + out[n++] = static_cast(2 * raw_byte.samples.sample_0 + 1); + out[n++] = static_cast(2 * raw_byte.samples.sample_3 + 1); + out[n++] = static_cast(2 * raw_byte.samples.sample_2 + 1); } } } return noutput_items; } - diff --git a/src/algorithms/signal_source/gnuradio_blocks/unpack_2bit_samples.h b/src/algorithms/signal_source/gnuradio_blocks/unpack_2bit_samples.h index dbb97e583..5d927d032 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/unpack_2bit_samples.h +++ b/src/algorithms/signal_source/gnuradio_blocks/unpack_2bit_samples.h @@ -75,43 +75,43 @@ class unpack_2bit_samples; typedef boost::shared_ptr unpack_2bit_samples_sptr; -unpack_2bit_samples_sptr make_unpack_2bit_samples( bool big_endian_bytes, - size_t item_size, - bool big_endian_items, - bool reverse_interleaving = false ); +unpack_2bit_samples_sptr make_unpack_2bit_samples(bool big_endian_bytes, + size_t item_size, + bool big_endian_items, + bool reverse_interleaving = false); /*! * \brief This class takes 2 bit samples that have been packed into bytes or * shorts as input and generates a byte for each sample. It generates eight * times as much data as is input (every two bits become 16 bits) */ -class unpack_2bit_samples: public gr::sync_interpolator +class unpack_2bit_samples : public gr::sync_interpolator { private: friend unpack_2bit_samples_sptr - make_unpack_2bit_samples_sptr( bool big_endian_bytes, - size_t item_size, - bool big_endian_items, - bool reverse_interleaving); + make_unpack_2bit_samples_sptr(bool big_endian_bytes, + size_t item_size, + bool big_endian_items, + bool reverse_interleaving); bool big_endian_bytes_; size_t item_size_; bool big_endian_items_; bool swap_endian_items_; bool swap_endian_bytes_; bool reverse_interleaving_; - std::vector< int8_t > work_buffer_; + std::vector work_buffer_; public: - unpack_2bit_samples( bool big_endianBytes, - size_t item_size, - bool big_endian_items, - bool reverse_interleaving ); + unpack_2bit_samples(bool big_endianBytes, + size_t item_size, + bool big_endian_items, + bool reverse_interleaving); ~unpack_2bit_samples(); - int work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); + int work(int noutput_items, + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items); }; #endif diff --git a/src/algorithms/signal_source/gnuradio_blocks/unpack_byte_2bit_cpx_samples.cc b/src/algorithms/signal_source/gnuradio_blocks/unpack_byte_2bit_cpx_samples.cc index d654817eb..5927bab18 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/unpack_byte_2bit_cpx_samples.cc +++ b/src/algorithms/signal_source/gnuradio_blocks/unpack_byte_2bit_cpx_samples.cc @@ -38,7 +38,7 @@ struct byte_2bit_struct { - signed two_bit_sample:2; // <- 2 bits wide only + signed two_bit_sample : 2; // <- 2 bits wide only }; @@ -49,26 +49,28 @@ unpack_byte_2bit_cpx_samples_sptr make_unpack_byte_2bit_cpx_samples() unpack_byte_2bit_cpx_samples::unpack_byte_2bit_cpx_samples() : sync_interpolator("unpack_byte_2bit_cpx_samples", - gr::io_signature::make(1, 1, sizeof(signed char)), - gr::io_signature::make(1, 1, sizeof(short)), - 4) -{} + gr::io_signature::make(1, 1, sizeof(signed char)), + gr::io_signature::make(1, 1, sizeof(short)), + 4) +{ +} unpack_byte_2bit_cpx_samples::~unpack_byte_2bit_cpx_samples() -{} +{ +} int unpack_byte_2bit_cpx_samples::work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items) { const signed char *in = reinterpret_cast(input_items[0]); short *out = reinterpret_cast(output_items[0]); byte_2bit_struct sample; int n = 0; - for(int i = 0; i < noutput_items/4; i++) + for (int i = 0; i < noutput_items / 4; i++) { // Read packed input sample (1 byte = 2 complex samples) //* Packing Order diff --git a/src/algorithms/signal_source/gnuradio_blocks/unpack_byte_2bit_cpx_samples.h b/src/algorithms/signal_source/gnuradio_blocks/unpack_byte_2bit_cpx_samples.h index f0b03283e..082e976e9 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/unpack_byte_2bit_cpx_samples.h +++ b/src/algorithms/signal_source/gnuradio_blocks/unpack_byte_2bit_cpx_samples.h @@ -47,7 +47,7 @@ unpack_byte_2bit_cpx_samples_sptr make_unpack_byte_2bit_cpx_samples(); * \brief This class implements conversion between byte packet samples to 2bit_cpx samples * 1 byte = 2 x complex 2bit I, + 2bit Q samples */ -class unpack_byte_2bit_cpx_samples: public gr::sync_interpolator +class unpack_byte_2bit_cpx_samples : public gr::sync_interpolator { private: friend unpack_byte_2bit_cpx_samples_sptr make_unpack_byte_2bit_cpx_samples_sptr(); @@ -55,9 +55,9 @@ private: public: unpack_byte_2bit_cpx_samples(); ~unpack_byte_2bit_cpx_samples(); - int work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); + int work(int noutput_items, + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items); }; #endif diff --git a/src/algorithms/signal_source/gnuradio_blocks/unpack_byte_2bit_samples.cc b/src/algorithms/signal_source/gnuradio_blocks/unpack_byte_2bit_samples.cc index 95f1af202..c07de13c4 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/unpack_byte_2bit_samples.cc +++ b/src/algorithms/signal_source/gnuradio_blocks/unpack_byte_2bit_samples.cc @@ -34,7 +34,7 @@ struct byte_2bit_struct { - signed two_bit_sample:2; // <- 2 bits wide only + signed two_bit_sample : 2; // <- 2 bits wide only }; @@ -45,39 +45,41 @@ unpack_byte_2bit_samples_sptr make_unpack_byte_2bit_samples() unpack_byte_2bit_samples::unpack_byte_2bit_samples() : sync_interpolator("unpack_byte_2bit_samples", - gr::io_signature::make(1, 1, sizeof(signed char)), - gr::io_signature::make(1, 1, sizeof(float)), - 4) -{} + gr::io_signature::make(1, 1, sizeof(signed char)), + gr::io_signature::make(1, 1, sizeof(float)), + 4) +{ +} unpack_byte_2bit_samples::~unpack_byte_2bit_samples() -{} +{ +} int unpack_byte_2bit_samples::work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items) { const signed char *in = reinterpret_cast(input_items[0]); float *out = reinterpret_cast(output_items[0]); byte_2bit_struct sample; int n = 0; - for(int i = 0; i < noutput_items/4; i++) + for (int i = 0; i < noutput_items / 4; i++) { // Read packed input sample (1 byte = 4 samples) signed char c = in[i]; sample.two_bit_sample = c & 3; out[n++] = static_cast(sample.two_bit_sample); - sample.two_bit_sample = (c>>2) & 3; + sample.two_bit_sample = (c >> 2) & 3; out[n++] = static_cast(sample.two_bit_sample); - sample.two_bit_sample = (c>>4) & 3; + sample.two_bit_sample = (c >> 4) & 3; out[n++] = static_cast(sample.two_bit_sample); - sample.two_bit_sample = (c>>6) & 3; + sample.two_bit_sample = (c >> 6) & 3; out[n++] = static_cast(sample.two_bit_sample); } return noutput_items; diff --git a/src/algorithms/signal_source/gnuradio_blocks/unpack_byte_2bit_samples.h b/src/algorithms/signal_source/gnuradio_blocks/unpack_byte_2bit_samples.h index 7d96d5d4f..10f7d52ee 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/unpack_byte_2bit_samples.h +++ b/src/algorithms/signal_source/gnuradio_blocks/unpack_byte_2bit_samples.h @@ -43,7 +43,7 @@ unpack_byte_2bit_samples_sptr make_unpack_byte_2bit_samples(); * \brief This class implements conversion between byte packet samples to 2bit samples * 1 byte = 4 2bit samples */ -class unpack_byte_2bit_samples: public gr::sync_interpolator +class unpack_byte_2bit_samples : public gr::sync_interpolator { private: friend unpack_byte_2bit_samples_sptr @@ -52,9 +52,9 @@ private: public: unpack_byte_2bit_samples(); ~unpack_byte_2bit_samples(); - int work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); + int work(int noutput_items, + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items); }; #endif diff --git a/src/algorithms/signal_source/gnuradio_blocks/unpack_intspir_1bit_samples.cc b/src/algorithms/signal_source/gnuradio_blocks/unpack_intspir_1bit_samples.cc index 9bbd4e8b1..19214fd01 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/unpack_intspir_1bit_samples.cc +++ b/src/algorithms/signal_source/gnuradio_blocks/unpack_intspir_1bit_samples.cc @@ -33,7 +33,6 @@ #include - unpack_intspir_1bit_samples_sptr make_unpack_intspir_1bit_samples() { return unpack_intspir_1bit_samples_sptr(new unpack_intspir_1bit_samples()); @@ -41,31 +40,33 @@ unpack_intspir_1bit_samples_sptr make_unpack_intspir_1bit_samples() unpack_intspir_1bit_samples::unpack_intspir_1bit_samples() : sync_interpolator("unpack_intspir_1bit_samples", - gr::io_signature::make(1, 1, sizeof(int)), - gr::io_signature::make(1, 1, sizeof(float)), - 2) -{} + gr::io_signature::make(1, 1, sizeof(int)), + gr::io_signature::make(1, 1, sizeof(float)), + 2) +{ +} unpack_intspir_1bit_samples::~unpack_intspir_1bit_samples() -{} +{ +} int unpack_intspir_1bit_samples::work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items) { const signed int *in = reinterpret_cast(input_items[0]); - float *out = reinterpret_cast(output_items[0]); + float *out = reinterpret_cast(output_items[0]); int n = 0; int channel = 1; - for(int i = 0; i < noutput_items/2; i++) + for (int i = 0; i < noutput_items / 2; i++) { // Read packed input sample (1 byte = 1 complex sample) // For historical reasons, values are float versions of short int limits (32767) signed int val = in[i]; - if(((val >> ((channel - 1)*2)) & 1) == 1) + if (((val >> ((channel - 1) * 2)) & 1) == 1) { out[n++] = static_cast(32767.0); } @@ -73,7 +74,7 @@ int unpack_intspir_1bit_samples::work(int noutput_items, { out[n++] = static_cast(-32767.0); } - if(((val >> (2*channel - 1)) & 1) == 1) + if (((val >> (2 * channel - 1)) & 1) == 1) { out[n++] = static_cast(32767.0); } diff --git a/src/algorithms/signal_source/gnuradio_blocks/unpack_intspir_1bit_samples.h b/src/algorithms/signal_source/gnuradio_blocks/unpack_intspir_1bit_samples.h index 387c3039f..47f775e25 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/unpack_intspir_1bit_samples.h +++ b/src/algorithms/signal_source/gnuradio_blocks/unpack_intspir_1bit_samples.h @@ -43,7 +43,7 @@ unpack_intspir_1bit_samples_sptr make_unpack_intspir_1bit_samples(); * \brief This class implements conversion between byte packet samples to 2bit samples * 1 byte = 4 2bit samples */ -class unpack_intspir_1bit_samples: public gr::sync_interpolator +class unpack_intspir_1bit_samples : public gr::sync_interpolator { private: friend unpack_intspir_1bit_samples_sptr @@ -52,9 +52,9 @@ private: public: unpack_intspir_1bit_samples(); ~unpack_intspir_1bit_samples(); - int work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); + int work(int noutput_items, + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items); }; #endif diff --git a/src/algorithms/signal_source/gnuradio_blocks/unpack_spir_gss6450_samples.cc b/src/algorithms/signal_source/gnuradio_blocks/unpack_spir_gss6450_samples.cc index a5419c475..a5bca6ee7 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/unpack_spir_gss6450_samples.cc +++ b/src/algorithms/signal_source/gnuradio_blocks/unpack_spir_gss6450_samples.cc @@ -40,8 +40,8 @@ unpack_spir_gss6450_samples_sptr make_unpack_spir_gss6450_samples(unsigned int a unpack_spir_gss6450_samples::unpack_spir_gss6450_samples(unsigned int adc_nbit) : gr::sync_interpolator("unpack_spir_gss6450_samples", - gr::io_signature::make(1, 1, sizeof(int)), - gr::io_signature::make(1, 1, sizeof(gr_complex)), 16 / adc_nbit) + gr::io_signature::make(1, 1, sizeof(int)), + gr::io_signature::make(1, 1, sizeof(gr_complex)), 16 / adc_nbit) { adc_bits = adc_nbit; samples_per_int = 16 / adc_bits; @@ -53,43 +53,50 @@ unpack_spir_gss6450_samples::unpack_spir_gss6450_samples(unsigned int adc_nbit) unpack_spir_gss6450_samples::~unpack_spir_gss6450_samples() -{} +{ +} int unpack_spir_gss6450_samples::work(int noutput_items, - gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) + gr_vector_const_void_star& input_items, gr_vector_void_star& output_items) { const int* in = reinterpret_cast(input_items[0]); gr_complex* out = reinterpret_cast(output_items[0]); unsigned int n_sample = 0; unsigned int in_counter = 0; std::bitset<32> bs; - for(int i = 0; i < noutput_items; i++) - { - bs = in[in_counter]; - int i_shift = adc_bits * 2 * (samples_per_int - n_sample - 1) + adc_bits; - int q_shift = adc_bits * 2 * (samples_per_int - n_sample - 1); - for(unsigned int k = 0; k < adc_bits; k++) + for (int i = 0; i < noutput_items; i++) { - i_data[k] = bs[i_shift + k]; - q_data[k] = bs[q_shift + k]; + bs = in[in_counter]; + int i_shift = adc_bits * 2 * (samples_per_int - n_sample - 1) + adc_bits; + int q_shift = adc_bits * 2 * (samples_per_int - n_sample - 1); + for (unsigned int k = 0; k < adc_bits; k++) + { + i_data[k] = bs[i_shift + k]; + q_data[k] = bs[q_shift + k]; + } + out[i] = gr_complex(static_cast(compute_two_complement(i_data.to_ulong())) + 0.5, + static_cast(compute_two_complement(q_data.to_ulong())) + 0.5); + n_sample++; + if (n_sample == samples_per_int) + { + n_sample = 0; + in_counter++; + } } - out[i] = gr_complex(static_cast(compute_two_complement(i_data.to_ulong())) + 0.5, - static_cast(compute_two_complement(q_data.to_ulong())) + 0.5); - n_sample++; - if(n_sample == samples_per_int) - { - n_sample = 0; - in_counter++; - } - } return noutput_items; } int unpack_spir_gss6450_samples::compute_two_complement(unsigned long data) { int res = 0; - if( static_cast(data) < two_compl_thres) { res = static_cast(data); } - else { res = static_cast(data) - adc_bits_two_pow; } + if (static_cast(data) < two_compl_thres) + { + res = static_cast(data); + } + else + { + res = static_cast(data) - adc_bits_two_pow; + } return res; } diff --git a/src/algorithms/signal_source/gnuradio_blocks/unpack_spir_gss6450_samples.h b/src/algorithms/signal_source/gnuradio_blocks/unpack_spir_gss6450_samples.h index be19229e1..bda2d587a 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/unpack_spir_gss6450_samples.h +++ b/src/algorithms/signal_source/gnuradio_blocks/unpack_spir_gss6450_samples.h @@ -41,11 +41,11 @@ typedef boost::shared_ptr unpack_spir_gss6450_sampl unpack_spir_gss6450_samples_sptr make_unpack_spir_gss6450_samples(unsigned int adc_nbit); -class unpack_spir_gss6450_samples: public gr::sync_interpolator +class unpack_spir_gss6450_samples : public gr::sync_interpolator { public: int work(int noutput_items, - gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); + gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); friend unpack_spir_gss6450_samples_sptr make_unpack_spir_gss6450_samples_sptr(unsigned int adc_nbit); unpack_spir_gss6450_samples(unsigned int adc_nbit); ~unpack_spir_gss6450_samples(); diff --git a/src/algorithms/signal_source/libs/rtl_tcp_commands.cc b/src/algorithms/signal_source/libs/rtl_tcp_commands.cc index 35fe1fad7..6ff9f9707 100644 --- a/src/algorithms/signal_source/libs/rtl_tcp_commands.cc +++ b/src/algorithms/signal_source/libs/rtl_tcp_commands.cc @@ -33,7 +33,7 @@ #include "rtl_tcp_commands.h" #include -boost::system::error_code rtl_tcp_command (RTL_TCP_COMMAND id, unsigned param, boost::asio::ip::tcp::socket &socket) +boost::system::error_code rtl_tcp_command(RTL_TCP_COMMAND id, unsigned param, boost::asio::ip::tcp::socket &socket) { // Data payload unsigned char data[sizeof(unsigned char) + sizeof(unsigned)]; diff --git a/src/algorithms/signal_source/libs/rtl_tcp_commands.h b/src/algorithms/signal_source/libs/rtl_tcp_commands.h index b9ef78e3d..025a8e078 100644 --- a/src/algorithms/signal_source/libs/rtl_tcp_commands.h +++ b/src/algorithms/signal_source/libs/rtl_tcp_commands.h @@ -35,7 +35,8 @@ #include /// Command IDs for configuration rtl_tcp -enum RTL_TCP_COMMAND { +enum RTL_TCP_COMMAND +{ RTL_TCP_SET_FREQUENCY = 1, RTL_TCP_SET_SAMPLE_RATE = 2, RTL_TCP_SET_GAIN_MODE = 3, @@ -48,7 +49,7 @@ enum RTL_TCP_COMMAND { /*! * \brief Send a command to rtl_tcp over the given socket. */ -boost::system::error_code rtl_tcp_command (RTL_TCP_COMMAND id, unsigned param, - boost::asio::ip::tcp::socket &socket); +boost::system::error_code rtl_tcp_command(RTL_TCP_COMMAND id, unsigned param, + boost::asio::ip::tcp::socket &socket); -#endif // GNSS_SDR_RTL_TCP_COMMANDS_H +#endif // GNSS_SDR_RTL_TCP_COMMANDS_H diff --git a/src/algorithms/signal_source/libs/rtl_tcp_dongle_info.cc b/src/algorithms/signal_source/libs/rtl_tcp_dongle_info.cc index 1f28b0004..55ef71508 100644 --- a/src/algorithms/signal_source/libs/rtl_tcp_dongle_info.cc +++ b/src/algorithms/signal_source/libs/rtl_tcp_dongle_info.cc @@ -69,23 +69,23 @@ boost::system::error_code rtl_tcp_dongle_info::read(boost::asio::ip::tcp::socket const char *rtl_tcp_dongle_info::get_type_name() const { - switch(get_tuner_type()) - { - default: - return "UNKNOWN"; - case TUNER_E4000: - return "E4000"; - case TUNER_FC0012: - return "FC0012"; - case TUNER_FC0013: - return "FC0013"; - case TUNER_FC2580: - return "FC2580"; - case TUNER_R820T: - return "R820T"; - case TUNER_R828D: - return "R828D"; - } + switch (get_tuner_type()) + { + default: + return "UNKNOWN"; + case TUNER_E4000: + return "E4000"; + case TUNER_FC0012: + return "FC0012"; + case TUNER_FC0013: + return "FC0013"; + case TUNER_FC2580: + return "FC2580"; + case TUNER_R820T: + return "R820T"; + case TUNER_R828D: + return "R828D"; + } } @@ -96,29 +96,29 @@ double rtl_tcp_dongle_info::clip_gain(int gain) const std::vector gains; switch (get_tuner_type()) - { - case TUNER_E4000: - gains = { -10, 15, 40, 65, 90, 115, 140, 165, 190, 215, - 240, 290, 340, 420 }; - break; - case TUNER_FC0012: - gains = { -99, -40, 71, 179, 192 }; - break; - case TUNER_FC0013: - gains = { -99, -73, -65, -63, -60, -58, -54, 58, 61, + { + case TUNER_E4000: + gains = {-10, 15, 40, 65, 90, 115, 140, 165, 190, 215, + 240, 290, 340, 420}; + break; + case TUNER_FC0012: + gains = {-99, -40, 71, 179, 192}; + break; + case TUNER_FC0013: + gains = {-99, -73, -65, -63, -60, -58, -54, 58, 61, 63, 65, 67, 68, 70, 71, 179, 181, 182, - 184, 186, 188, 191, 197 }; - break; - case TUNER_R820T: - gains = { 0, 9, 14, 27, 37, 77, 87, 125, 144, 157, + 184, 186, 188, 191, 197}; + break; + case TUNER_R820T: + gains = {0, 9, 14, 27, 37, 77, 87, 125, 144, 157, 166, 197, 207, 229, 254, 280, 297, 328, 338, 364, 372, 386, 402, 421, 434, 439, - 445, 480, 496 }; - break; - default: - // no gains - break; - } + 445, 480, 496}; + break; + default: + // no gains + break; + } // clip if (gains.size() == 0) @@ -130,22 +130,22 @@ double rtl_tcp_dongle_info::clip_gain(int gain) const { double last_stop = gains.front(); BOOST_FOREACH (double g, gains) - { - g /= 10.0; + { + g /= 10.0; - if (gain < g) - { - if (std::abs(gain - g) < std::abs(gain - last_stop)) - { - return g; - } - else - { - return last_stop; - } - } - last_stop = g; - } + if (gain < g) + { + if (std::abs(gain - g) < std::abs(gain - last_stop)) + { + return g; + } + else + { + return last_stop; + } + } + last_stop = g; + } return last_stop; } } diff --git a/src/algorithms/signal_source/libs/rtl_tcp_dongle_info.h b/src/algorithms/signal_source/libs/rtl_tcp_dongle_info.h index 18098f3b8..cc9909881 100644 --- a/src/algorithms/signal_source/libs/rtl_tcp_dongle_info.h +++ b/src/algorithms/signal_source/libs/rtl_tcp_dongle_info.h @@ -80,4 +80,4 @@ public: }; -#endif // GNSS_SDR_RTL_TCP_DONGLE_INFO_H +#endif // GNSS_SDR_RTL_TCP_DONGLE_INFO_H diff --git a/src/algorithms/telemetry_decoder/adapters/galileo_e1b_telemetry_decoder.cc b/src/algorithms/telemetry_decoder/adapters/galileo_e1b_telemetry_decoder.cc index 15d52e856..a3e9a49ca 100644 --- a/src/algorithms/telemetry_decoder/adapters/galileo_e1b_telemetry_decoder.cc +++ b/src/algorithms/telemetry_decoder/adapters/galileo_e1b_telemetry_decoder.cc @@ -44,29 +44,29 @@ using google::LogMessage; GalileoE1BTelemetryDecoder::GalileoE1BTelemetryDecoder(ConfigurationInterface* configuration, - std::string role, - unsigned int in_streams, - unsigned int out_streams) : - role_(role), - in_streams_(in_streams), - out_streams_(out_streams) + std::string role, + unsigned int in_streams, + unsigned int out_streams) : role_(role), + in_streams_(in_streams), + out_streams_(out_streams) { std::string default_dump_filename = "./navigation.dat"; DLOG(INFO) << "role " << role; dump_ = configuration->property(role + ".dump", false); dump_filename_ = configuration->property(role + ".dump_filename", default_dump_filename); // make telemetry decoder object - telemetry_decoder_ = galileo_e1b_make_telemetry_decoder_cc(satellite_, dump_); // TODO fix me + telemetry_decoder_ = galileo_e1b_make_telemetry_decoder_cc(satellite_, dump_); // TODO fix me DLOG(INFO) << "telemetry_decoder(" << telemetry_decoder_->unique_id() << ")"; channel_ = 0; } GalileoE1BTelemetryDecoder::~GalileoE1BTelemetryDecoder() -{} +{ +} -void GalileoE1BTelemetryDecoder::set_satellite(const Gnss_Satellite & satellite) +void GalileoE1BTelemetryDecoder::set_satellite(const Gnss_Satellite& satellite) { satellite_ = Gnss_Satellite(satellite.get_system(), satellite.get_PRN()); telemetry_decoder_->set_satellite(satellite_); @@ -76,7 +76,9 @@ void GalileoE1BTelemetryDecoder::set_satellite(const Gnss_Satellite & satellite) void GalileoE1BTelemetryDecoder::connect(gr::top_block_sptr top_block) { - if(top_block) { /* top_block is not null */}; + if (top_block) + { /* top_block is not null */ + }; // Nothing to connect internally DLOG(INFO) << "nothing to connect internally"; } @@ -84,7 +86,9 @@ void GalileoE1BTelemetryDecoder::connect(gr::top_block_sptr top_block) void GalileoE1BTelemetryDecoder::disconnect(gr::top_block_sptr top_block) { - if(top_block) { /* top_block is not null */}; + if (top_block) + { /* top_block is not null */ + }; // Nothing to disconnect } @@ -99,4 +103,3 @@ gr::basic_block_sptr GalileoE1BTelemetryDecoder::get_right_block() { return telemetry_decoder_; } - diff --git a/src/algorithms/telemetry_decoder/adapters/galileo_e1b_telemetry_decoder.h b/src/algorithms/telemetry_decoder/adapters/galileo_e1b_telemetry_decoder.h index 6f3d2837c..037cb2f8a 100644 --- a/src/algorithms/telemetry_decoder/adapters/galileo_e1b_telemetry_decoder.h +++ b/src/algorithms/telemetry_decoder/adapters/galileo_e1b_telemetry_decoder.h @@ -50,9 +50,9 @@ class GalileoE1BTelemetryDecoder : public TelemetryDecoderInterface { public: GalileoE1BTelemetryDecoder(ConfigurationInterface* configuration, - std::string role, - unsigned int in_streams, - unsigned int out_streams); + std::string role, + unsigned int in_streams, + unsigned int out_streams); virtual ~GalileoE1BTelemetryDecoder(); @@ -74,7 +74,7 @@ public: gr::basic_block_sptr get_left_block() override; gr::basic_block_sptr get_right_block() override; - void set_satellite(const Gnss_Satellite & satellite) override; + void set_satellite(const Gnss_Satellite& satellite) override; inline void set_channel(int channel) override { telemetry_decoder_->set_channel(channel); } inline void reset() override diff --git a/src/algorithms/telemetry_decoder/adapters/galileo_e5a_telemetry_decoder.cc b/src/algorithms/telemetry_decoder/adapters/galileo_e5a_telemetry_decoder.cc index 8b862e7e3..b7e0d89e8 100644 --- a/src/algorithms/telemetry_decoder/adapters/galileo_e5a_telemetry_decoder.cc +++ b/src/algorithms/telemetry_decoder/adapters/galileo_e5a_telemetry_decoder.cc @@ -44,33 +44,32 @@ #include - using google::LogMessage; GalileoE5aTelemetryDecoder::GalileoE5aTelemetryDecoder(ConfigurationInterface* configuration, - std::string role, - unsigned int in_streams, - unsigned int out_streams) : - role_(role), - in_streams_(in_streams), - out_streams_(out_streams) + std::string role, + unsigned int in_streams, + unsigned int out_streams) : role_(role), + in_streams_(in_streams), + out_streams_(out_streams) { std::string default_dump_filename = "./navigation.dat"; DLOG(INFO) << "role " << role; dump_ = configuration->property(role + ".dump", false); dump_filename_ = configuration->property(role + ".dump_filename", default_dump_filename); // make telemetry decoder object - telemetry_decoder_ = galileo_e5a_make_telemetry_decoder_cc(satellite_, dump_); // TODO fix me + telemetry_decoder_ = galileo_e5a_make_telemetry_decoder_cc(satellite_, dump_); // TODO fix me DLOG(INFO) << "telemetry_decoder(" << telemetry_decoder_->unique_id() << ")"; channel_ = 0; } GalileoE5aTelemetryDecoder::~GalileoE5aTelemetryDecoder() -{} +{ +} -void GalileoE5aTelemetryDecoder::set_satellite(const Gnss_Satellite & satellite) +void GalileoE5aTelemetryDecoder::set_satellite(const Gnss_Satellite& satellite) { satellite_ = Gnss_Satellite(satellite.get_system(), satellite.get_PRN()); telemetry_decoder_->set_satellite(satellite_); @@ -80,7 +79,9 @@ void GalileoE5aTelemetryDecoder::set_satellite(const Gnss_Satellite & satellite) void GalileoE5aTelemetryDecoder::connect(gr::top_block_sptr top_block) { - if(top_block) { /* top_block is not null */}; + if (top_block) + { /* top_block is not null */ + }; // Nothing to connect internally DLOG(INFO) << "nothing to connect internally"; } @@ -88,7 +89,9 @@ void GalileoE5aTelemetryDecoder::connect(gr::top_block_sptr top_block) void GalileoE5aTelemetryDecoder::disconnect(gr::top_block_sptr top_block) { - if(top_block) { /* top_block is not null */}; + if (top_block) + { /* top_block is not null */ + }; // Nothing to disconnect } diff --git a/src/algorithms/telemetry_decoder/adapters/galileo_e5a_telemetry_decoder.h b/src/algorithms/telemetry_decoder/adapters/galileo_e5a_telemetry_decoder.h index cf2d0aae6..3ba352541 100644 --- a/src/algorithms/telemetry_decoder/adapters/galileo_e5a_telemetry_decoder.h +++ b/src/algorithms/telemetry_decoder/adapters/galileo_e5a_telemetry_decoder.h @@ -46,13 +46,13 @@ class ConfigurationInterface; /*! * \brief This class implements a NAV data decoder for Galileo INAV frames in E1B radio link */ -class GalileoE5aTelemetryDecoder: public TelemetryDecoderInterface +class GalileoE5aTelemetryDecoder : public TelemetryDecoderInterface { public: GalileoE5aTelemetryDecoder(ConfigurationInterface* configuration, - std::string role, - unsigned int in_streams, - unsigned int out_streams); + std::string role, + unsigned int in_streams, + unsigned int out_streams); virtual ~GalileoE5aTelemetryDecoder(); @@ -74,7 +74,7 @@ public: gr::basic_block_sptr get_left_block() override; gr::basic_block_sptr get_right_block() override; - void set_satellite(const Gnss_Satellite & satellite) override; + void set_satellite(const Gnss_Satellite& satellite) override; inline void set_channel(int channel) override { telemetry_decoder_->set_channel(channel); } inline void reset() override diff --git a/src/algorithms/telemetry_decoder/adapters/glonass_l1_ca_telemetry_decoder.cc b/src/algorithms/telemetry_decoder/adapters/glonass_l1_ca_telemetry_decoder.cc index 0ff8facef..d2491d98c 100644 --- a/src/algorithms/telemetry_decoder/adapters/glonass_l1_ca_telemetry_decoder.cc +++ b/src/algorithms/telemetry_decoder/adapters/glonass_l1_ca_telemetry_decoder.cc @@ -43,12 +43,11 @@ using google::LogMessage; GlonassL1CaTelemetryDecoder::GlonassL1CaTelemetryDecoder(ConfigurationInterface* configuration, - std::string role, - unsigned int in_streams, - unsigned int out_streams) : - role_(role), - in_streams_(in_streams), - out_streams_(out_streams) + std::string role, + unsigned int in_streams, + unsigned int out_streams) : role_(role), + in_streams_(in_streams), + out_streams_(out_streams) { std::string default_dump_filename = "./navigation.dat"; DLOG(INFO) << "role " << role; @@ -62,10 +61,11 @@ GlonassL1CaTelemetryDecoder::GlonassL1CaTelemetryDecoder(ConfigurationInterface* GlonassL1CaTelemetryDecoder::~GlonassL1CaTelemetryDecoder() -{} +{ +} -void GlonassL1CaTelemetryDecoder::set_satellite(const Gnss_Satellite & satellite) +void GlonassL1CaTelemetryDecoder::set_satellite(const Gnss_Satellite& satellite) { satellite_ = Gnss_Satellite(satellite.get_system(), satellite.get_PRN()); telemetry_decoder_->set_satellite(satellite_); @@ -75,7 +75,9 @@ void GlonassL1CaTelemetryDecoder::set_satellite(const Gnss_Satellite & satellite void GlonassL1CaTelemetryDecoder::connect(gr::top_block_sptr top_block) { - if(top_block) { /* top_block is not null */}; + if (top_block) + { /* top_block is not null */ + }; // Nothing to connect internally DLOG(INFO) << "nothing to connect internally"; } @@ -83,7 +85,9 @@ void GlonassL1CaTelemetryDecoder::connect(gr::top_block_sptr top_block) void GlonassL1CaTelemetryDecoder::disconnect(gr::top_block_sptr top_block) { - if(top_block) { /* top_block is not null */}; + if (top_block) + { /* top_block is not null */ + }; // Nothing to disconnect } diff --git a/src/algorithms/telemetry_decoder/adapters/glonass_l1_ca_telemetry_decoder.h b/src/algorithms/telemetry_decoder/adapters/glonass_l1_ca_telemetry_decoder.h index a2f413302..3612e080b 100644 --- a/src/algorithms/telemetry_decoder/adapters/glonass_l1_ca_telemetry_decoder.h +++ b/src/algorithms/telemetry_decoder/adapters/glonass_l1_ca_telemetry_decoder.h @@ -47,9 +47,9 @@ class GlonassL1CaTelemetryDecoder : public TelemetryDecoderInterface { public: GlonassL1CaTelemetryDecoder(ConfigurationInterface* configuration, - std::string role, - unsigned int in_streams, - unsigned int out_streams); + std::string role, + unsigned int in_streams, + unsigned int out_streams); virtual ~GlonassL1CaTelemetryDecoder(); std::string role() override @@ -66,8 +66,8 @@ public: void disconnect(gr::top_block_sptr top_block) override; gr::basic_block_sptr get_left_block() override; gr::basic_block_sptr get_right_block() override; - void set_satellite(const Gnss_Satellite & satellite) override; - void set_channel(int channel) override {telemetry_decoder_->set_channel(channel);} + void set_satellite(const Gnss_Satellite& satellite) override; + void set_channel(int channel) override { telemetry_decoder_->set_channel(channel); } void reset() override { return; diff --git a/src/algorithms/telemetry_decoder/adapters/gps_l1_ca_telemetry_decoder.cc b/src/algorithms/telemetry_decoder/adapters/gps_l1_ca_telemetry_decoder.cc index cb285e9b9..7508d622f 100644 --- a/src/algorithms/telemetry_decoder/adapters/gps_l1_ca_telemetry_decoder.cc +++ b/src/algorithms/telemetry_decoder/adapters/gps_l1_ca_telemetry_decoder.cc @@ -43,29 +43,29 @@ using google::LogMessage; GpsL1CaTelemetryDecoder::GpsL1CaTelemetryDecoder(ConfigurationInterface* configuration, - std::string role, - unsigned int in_streams, - unsigned int out_streams) : - role_(role), - in_streams_(in_streams), - out_streams_(out_streams) + std::string role, + unsigned int in_streams, + unsigned int out_streams) : role_(role), + in_streams_(in_streams), + out_streams_(out_streams) { std::string default_dump_filename = "./navigation.dat"; DLOG(INFO) << "role " << role; dump_ = configuration->property(role + ".dump", false); dump_filename_ = configuration->property(role + ".dump_filename", default_dump_filename); // make telemetry decoder object - telemetry_decoder_ = gps_l1_ca_make_telemetry_decoder_cc(satellite_, dump_); // TODO fix me + telemetry_decoder_ = gps_l1_ca_make_telemetry_decoder_cc(satellite_, dump_); // TODO fix me DLOG(INFO) << "telemetry_decoder(" << telemetry_decoder_->unique_id() << ")"; channel_ = 0; } GpsL1CaTelemetryDecoder::~GpsL1CaTelemetryDecoder() -{} +{ +} -void GpsL1CaTelemetryDecoder::set_satellite(const Gnss_Satellite & satellite) +void GpsL1CaTelemetryDecoder::set_satellite(const Gnss_Satellite& satellite) { satellite_ = Gnss_Satellite(satellite.get_system(), satellite.get_PRN()); telemetry_decoder_->set_satellite(satellite_); @@ -75,7 +75,9 @@ void GpsL1CaTelemetryDecoder::set_satellite(const Gnss_Satellite & satellite) void GpsL1CaTelemetryDecoder::connect(gr::top_block_sptr top_block) { - if(top_block) { /* top_block is not null */}; + if (top_block) + { /* top_block is not null */ + }; // Nothing to connect internally DLOG(INFO) << "nothing to connect internally"; } @@ -83,7 +85,9 @@ void GpsL1CaTelemetryDecoder::connect(gr::top_block_sptr top_block) void GpsL1CaTelemetryDecoder::disconnect(gr::top_block_sptr top_block) { - if(top_block) { /* top_block is not null */}; + if (top_block) + { /* top_block is not null */ + }; // Nothing to disconnect } @@ -98,4 +102,3 @@ gr::basic_block_sptr GpsL1CaTelemetryDecoder::get_right_block() { return telemetry_decoder_; } - diff --git a/src/algorithms/telemetry_decoder/adapters/gps_l1_ca_telemetry_decoder.h b/src/algorithms/telemetry_decoder/adapters/gps_l1_ca_telemetry_decoder.h index 2d115fc5e..b3d77052b 100644 --- a/src/algorithms/telemetry_decoder/adapters/gps_l1_ca_telemetry_decoder.h +++ b/src/algorithms/telemetry_decoder/adapters/gps_l1_ca_telemetry_decoder.h @@ -46,9 +46,9 @@ class GpsL1CaTelemetryDecoder : public TelemetryDecoderInterface { public: GpsL1CaTelemetryDecoder(ConfigurationInterface* configuration, - std::string role, - unsigned int in_streams, - unsigned int out_streams); + std::string role, + unsigned int in_streams, + unsigned int out_streams); virtual ~GpsL1CaTelemetryDecoder(); @@ -68,7 +68,7 @@ public: gr::basic_block_sptr get_left_block() override; gr::basic_block_sptr get_right_block() override; - void set_satellite(const Gnss_Satellite & satellite) override; + void set_satellite(const Gnss_Satellite& satellite) override; inline void set_channel(int channel) override { telemetry_decoder_->set_channel(channel); } inline void reset() override diff --git a/src/algorithms/telemetry_decoder/adapters/gps_l2c_telemetry_decoder.cc b/src/algorithms/telemetry_decoder/adapters/gps_l2c_telemetry_decoder.cc index d93569211..b6cf5fdf4 100644 --- a/src/algorithms/telemetry_decoder/adapters/gps_l2c_telemetry_decoder.cc +++ b/src/algorithms/telemetry_decoder/adapters/gps_l2c_telemetry_decoder.cc @@ -43,29 +43,29 @@ using google::LogMessage; GpsL2CTelemetryDecoder::GpsL2CTelemetryDecoder(ConfigurationInterface* configuration, - std::string role, - unsigned int in_streams, - unsigned int out_streams) : - role_(role), - in_streams_(in_streams), - out_streams_(out_streams) + std::string role, + unsigned int in_streams, + unsigned int out_streams) : role_(role), + in_streams_(in_streams), + out_streams_(out_streams) { std::string default_dump_filename = "./navigation.dat"; DLOG(INFO) << "role " << role; dump_ = configuration->property(role + ".dump", false); dump_filename_ = configuration->property(role + ".dump_filename", default_dump_filename); // make telemetry decoder object - telemetry_decoder_ = gps_l2c_make_telemetry_decoder_cc(satellite_, dump_); // TODO fix me + telemetry_decoder_ = gps_l2c_make_telemetry_decoder_cc(satellite_, dump_); // TODO fix me DLOG(INFO) << "telemetry_decoder(" << telemetry_decoder_->unique_id() << ")"; channel_ = 0; } GpsL2CTelemetryDecoder::~GpsL2CTelemetryDecoder() -{} +{ +} -void GpsL2CTelemetryDecoder::set_satellite(const Gnss_Satellite & satellite) +void GpsL2CTelemetryDecoder::set_satellite(const Gnss_Satellite& satellite) { satellite_ = Gnss_Satellite(satellite.get_system(), satellite.get_PRN()); telemetry_decoder_->set_satellite(satellite_); @@ -75,7 +75,9 @@ void GpsL2CTelemetryDecoder::set_satellite(const Gnss_Satellite & satellite) void GpsL2CTelemetryDecoder::connect(gr::top_block_sptr top_block) { - if(top_block) { /* top_block is not null */}; + if (top_block) + { /* top_block is not null */ + }; // Nothing to connect internally DLOG(INFO) << "nothing to connect internally"; } @@ -83,7 +85,9 @@ void GpsL2CTelemetryDecoder::connect(gr::top_block_sptr top_block) void GpsL2CTelemetryDecoder::disconnect(gr::top_block_sptr top_block) { - if(top_block) { /* top_block is not null */}; + if (top_block) + { /* top_block is not null */ + }; // Nothing to disconnect } @@ -98,4 +102,3 @@ gr::basic_block_sptr GpsL2CTelemetryDecoder::get_right_block() { return telemetry_decoder_; } - diff --git a/src/algorithms/telemetry_decoder/adapters/gps_l2c_telemetry_decoder.h b/src/algorithms/telemetry_decoder/adapters/gps_l2c_telemetry_decoder.h index 753478bae..4139dea52 100644 --- a/src/algorithms/telemetry_decoder/adapters/gps_l2c_telemetry_decoder.h +++ b/src/algorithms/telemetry_decoder/adapters/gps_l2c_telemetry_decoder.h @@ -46,9 +46,9 @@ class GpsL2CTelemetryDecoder : public TelemetryDecoderInterface { public: GpsL2CTelemetryDecoder(ConfigurationInterface* configuration, - std::string role, - unsigned int in_streams, - unsigned int out_streams); + std::string role, + unsigned int in_streams, + unsigned int out_streams); virtual ~GpsL2CTelemetryDecoder(); @@ -68,7 +68,7 @@ public: gr::basic_block_sptr get_left_block() override; gr::basic_block_sptr get_right_block() override; - void set_satellite(const Gnss_Satellite & satellite) override; + void set_satellite(const Gnss_Satellite& satellite) override; inline void set_channel(int channel) override { telemetry_decoder_->set_channel(channel); } inline void reset() override diff --git a/src/algorithms/telemetry_decoder/adapters/gps_l5_telemetry_decoder.cc b/src/algorithms/telemetry_decoder/adapters/gps_l5_telemetry_decoder.cc index 8b57e81cf..1a3961bcd 100644 --- a/src/algorithms/telemetry_decoder/adapters/gps_l5_telemetry_decoder.cc +++ b/src/algorithms/telemetry_decoder/adapters/gps_l5_telemetry_decoder.cc @@ -39,12 +39,11 @@ using google::LogMessage; GpsL5TelemetryDecoder::GpsL5TelemetryDecoder(ConfigurationInterface* configuration, - std::string role, - unsigned int in_streams, - unsigned int out_streams) : - role_(role), - in_streams_(in_streams), - out_streams_(out_streams) + std::string role, + unsigned int in_streams, + unsigned int out_streams) : role_(role), + in_streams_(in_streams), + out_streams_(out_streams) { std::string default_dump_filename = "./navigation.dat"; DLOG(INFO) << "role " << role; @@ -58,10 +57,11 @@ GpsL5TelemetryDecoder::GpsL5TelemetryDecoder(ConfigurationInterface* configurati GpsL5TelemetryDecoder::~GpsL5TelemetryDecoder() -{} +{ +} -void GpsL5TelemetryDecoder::set_satellite(const Gnss_Satellite & satellite) +void GpsL5TelemetryDecoder::set_satellite(const Gnss_Satellite& satellite) { satellite_ = Gnss_Satellite(satellite.get_system(), satellite.get_PRN()); telemetry_decoder_->set_satellite(satellite_); @@ -71,7 +71,9 @@ void GpsL5TelemetryDecoder::set_satellite(const Gnss_Satellite & satellite) void GpsL5TelemetryDecoder::connect(gr::top_block_sptr top_block) { - if(top_block) { /* top_block is not null */}; + if (top_block) + { /* top_block is not null */ + }; // Nothing to connect internally DLOG(INFO) << "nothing to connect internally"; } @@ -79,7 +81,9 @@ void GpsL5TelemetryDecoder::connect(gr::top_block_sptr top_block) void GpsL5TelemetryDecoder::disconnect(gr::top_block_sptr top_block) { - if(top_block) { /* top_block is not null */}; + if (top_block) + { /* top_block is not null */ + }; // Nothing to disconnect } diff --git a/src/algorithms/telemetry_decoder/adapters/gps_l5_telemetry_decoder.h b/src/algorithms/telemetry_decoder/adapters/gps_l5_telemetry_decoder.h index d25405cf3..cb07d477b 100644 --- a/src/algorithms/telemetry_decoder/adapters/gps_l5_telemetry_decoder.h +++ b/src/algorithms/telemetry_decoder/adapters/gps_l5_telemetry_decoder.h @@ -49,9 +49,9 @@ class GpsL5TelemetryDecoder : public TelemetryDecoderInterface { public: GpsL5TelemetryDecoder(ConfigurationInterface* configuration, - std::string role, - unsigned int in_streams, - unsigned int out_streams); + std::string role, + unsigned int in_streams, + unsigned int out_streams); virtual ~GpsL5TelemetryDecoder(); @@ -71,7 +71,7 @@ public: gr::basic_block_sptr get_left_block() override; gr::basic_block_sptr get_right_block() override; - void set_satellite(const Gnss_Satellite & satellite) override; + void set_satellite(const Gnss_Satellite& satellite) override; inline void set_channel(int channel) override { telemetry_decoder_->set_channel(channel); } inline void reset() override diff --git a/src/algorithms/telemetry_decoder/adapters/sbas_l1_telemetry_decoder.cc b/src/algorithms/telemetry_decoder/adapters/sbas_l1_telemetry_decoder.cc index 755419bd7..0d52f372c 100644 --- a/src/algorithms/telemetry_decoder/adapters/sbas_l1_telemetry_decoder.cc +++ b/src/algorithms/telemetry_decoder/adapters/sbas_l1_telemetry_decoder.cc @@ -41,29 +41,29 @@ using google::LogMessage; SbasL1TelemetryDecoder::SbasL1TelemetryDecoder(ConfigurationInterface* configuration, - std::string role, - unsigned int in_streams, - unsigned int out_streams) : - role_(role), - in_streams_(in_streams), - out_streams_(out_streams) + std::string role, + unsigned int in_streams, + unsigned int out_streams) : role_(role), + in_streams_(in_streams), + out_streams_(out_streams) { std::string default_dump_filename = "./navigation.dat"; DLOG(INFO) << "role " << role; dump_ = configuration->property(role + ".dump", false); dump_filename_ = configuration->property(role + ".dump_filename", default_dump_filename); // make telemetry decoder object - telemetry_decoder_ = sbas_l1_make_telemetry_decoder_cc(satellite_, dump_); // TODO fix me + telemetry_decoder_ = sbas_l1_make_telemetry_decoder_cc(satellite_, dump_); // TODO fix me channel_ = 0; DLOG(INFO) << "telemetry_decoder(" << telemetry_decoder_->unique_id() << ")"; } SbasL1TelemetryDecoder::~SbasL1TelemetryDecoder() -{} +{ +} -void SbasL1TelemetryDecoder::set_satellite(const Gnss_Satellite & satellite) +void SbasL1TelemetryDecoder::set_satellite(const Gnss_Satellite& satellite) { satellite_ = Gnss_Satellite(satellite.get_system(), satellite.get_PRN()); telemetry_decoder_->set_satellite(satellite_); @@ -73,7 +73,9 @@ void SbasL1TelemetryDecoder::set_satellite(const Gnss_Satellite & satellite) void SbasL1TelemetryDecoder::connect(gr::top_block_sptr top_block) { - if(top_block) { /* top_block is not null */}; + if (top_block) + { /* top_block is not null */ + }; // Nothing to connect internally DLOG(INFO) << "nothing to connect internally"; } @@ -81,7 +83,9 @@ void SbasL1TelemetryDecoder::connect(gr::top_block_sptr top_block) void SbasL1TelemetryDecoder::disconnect(gr::top_block_sptr top_block) { - if(top_block) { /* top_block is not null */}; + if (top_block) + { /* top_block is not null */ + }; // Nothing to disconnect } @@ -96,4 +100,3 @@ gr::basic_block_sptr SbasL1TelemetryDecoder::get_right_block() { return telemetry_decoder_; } - diff --git a/src/algorithms/telemetry_decoder/adapters/sbas_l1_telemetry_decoder.h b/src/algorithms/telemetry_decoder/adapters/sbas_l1_telemetry_decoder.h index eae3bf32f..43df00828 100644 --- a/src/algorithms/telemetry_decoder/adapters/sbas_l1_telemetry_decoder.h +++ b/src/algorithms/telemetry_decoder/adapters/sbas_l1_telemetry_decoder.h @@ -48,9 +48,9 @@ class SbasL1TelemetryDecoder : public TelemetryDecoderInterface { public: SbasL1TelemetryDecoder(ConfigurationInterface* configuration, - std::string role, - unsigned int in_streams, - unsigned int out_streams); + std::string role, + unsigned int in_streams, + unsigned int out_streams); virtual ~SbasL1TelemetryDecoder(); @@ -72,7 +72,7 @@ public: gr::basic_block_sptr get_left_block() override; gr::basic_block_sptr get_right_block() override; - void set_satellite(const Gnss_Satellite & satellite) override; + void set_satellite(const Gnss_Satellite& satellite) override; inline void set_channel(int channel) override { telemetry_decoder_->set_channel(channel); } inline void reset() override diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_e1b_telemetry_decoder_cc.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_e1b_telemetry_decoder_cc.cc index 34b829252..294436c2d 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_e1b_telemetry_decoder_cc.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_e1b_telemetry_decoder_cc.cc @@ -46,7 +46,7 @@ using google::LogMessage; galileo_e1b_telemetry_decoder_cc_sptr -galileo_e1b_make_telemetry_decoder_cc(const Gnss_Satellite & satellite, bool dump) +galileo_e1b_make_telemetry_decoder_cc(const Gnss_Satellite &satellite, bool dump) { return galileo_e1b_telemetry_decoder_cc_sptr(new galileo_e1b_telemetry_decoder_cc(satellite, dump)); } @@ -59,33 +59,33 @@ void galileo_e1b_telemetry_decoder_cc::viterbi_decoder(double *page_part_symbols int nn, KK, mm, max_states; int g_encoder[2]; - nn = 2; // Coding rate 1/n - KK = 7; // Constraint Length - g_encoder[0] = 121; // Polynomial G1 - g_encoder[1] = 91; // Polynomial G2 + nn = 2; // Coding rate 1/n + KK = 7; // Constraint Length + g_encoder[0] = 121; // Polynomial G1 + g_encoder[1] = 91; // Polynomial G2 mm = KK - 1; max_states = 1 << mm; /* 2^mm */ - DataLength = (CodeLength/nn) - mm; + DataLength = (CodeLength / nn) - mm; /* create appropriate transition matrices */ int *out0, *out1, *state0, *state1; - out0 = static_cast(calloc( max_states, sizeof(int) )); - out1 = static_cast(calloc( max_states, sizeof(int) )); - state0 = static_cast(calloc( max_states, sizeof(int) )); - state1 = static_cast(calloc( max_states, sizeof(int) )); + out0 = static_cast(calloc(max_states, sizeof(int))); + out1 = static_cast(calloc(max_states, sizeof(int))); + state0 = static_cast(calloc(max_states, sizeof(int))); + state1 = static_cast(calloc(max_states, sizeof(int))); - nsc_transit( out0, state0, 0, g_encoder, KK, nn ); - nsc_transit( out1, state1, 1, g_encoder, KK, nn ); + nsc_transit(out0, state0, 0, g_encoder, KK, nn); + nsc_transit(out1, state1, 1, g_encoder, KK, nn); Viterbi(page_part_bits, out0, state0, out1, state1, - page_part_symbols, KK, nn, DataLength ); + page_part_symbols, KK, nn, DataLength); /* Clean up memory */ - free( out0 ); - free( out1 ); - free( state0 ); - free( state1 ); + free(out0); + free(out1); + free(state0); + free(state1); } @@ -93,19 +93,18 @@ void galileo_e1b_telemetry_decoder_cc::deinterleaver(int rows, int cols, double { for (int r = 0; r < rows; r++) { - for(int c = 0; c < cols; c++) + for (int c = 0; c < cols; c++) { - out[c*rows + r] = in[r*cols + c]; + out[c * rows + r] = in[r * cols + c]; } } } galileo_e1b_telemetry_decoder_cc::galileo_e1b_telemetry_decoder_cc( - const Gnss_Satellite & satellite, - bool dump) : - gr::block("galileo_e1b_telemetry_decoder_cc", gr::io_signature::make(1, 1, sizeof(Gnss_Synchro)), - gr::io_signature::make(1, 1, sizeof(Gnss_Synchro))) + const Gnss_Satellite &satellite, + bool dump) : gr::block("galileo_e1b_telemetry_decoder_cc", gr::io_signature::make(1, 1, sizeof(Gnss_Synchro)), + gr::io_signature::make(1, 1, sizeof(Gnss_Synchro))) { // Telemetry Bit transition synchronization port out this->message_port_register_out(pmt::mp("preamble_timestamp_s")); @@ -115,17 +114,17 @@ galileo_e1b_telemetry_decoder_cc::galileo_e1b_telemetry_decoder_cc( d_dump = dump; d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN()); LOG(INFO) << "Initializing GALILEO E1B TELEMETRY PROCESSING"; - d_samples_per_symbol = ( Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS ) / Galileo_E1_B_SYMBOL_RATE_BPS; + d_samples_per_symbol = (Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS) / Galileo_E1_B_SYMBOL_RATE_BPS; // set the preamble unsigned short int preambles_bits[GALILEO_INAV_PREAMBLE_LENGTH_BITS] = GALILEO_INAV_PREAMBLE; d_symbols_per_preamble = GALILEO_INAV_PREAMBLE_LENGTH_BITS * d_samples_per_symbol; - memcpy(static_cast(this->d_preambles_bits), static_cast(preambles_bits), GALILEO_INAV_PREAMBLE_LENGTH_BITS * sizeof(unsigned short int)); + memcpy(static_cast(this->d_preambles_bits), static_cast(preambles_bits), GALILEO_INAV_PREAMBLE_LENGTH_BITS * sizeof(unsigned short int)); // preamble bits to sampled symbols - d_preambles_symbols = static_cast(malloc(sizeof(signed int) * d_symbols_per_preamble)); + d_preambles_symbols = static_cast(malloc(sizeof(signed int) * d_symbols_per_preamble)); int n = 0; for (int i = 0; i < GALILEO_INAV_PREAMBLE_LENGTH_BITS; i++) { @@ -162,21 +161,21 @@ galileo_e1b_telemetry_decoder_cc::galileo_e1b_telemetry_decoder_cc( galileo_e1b_telemetry_decoder_cc::~galileo_e1b_telemetry_decoder_cc() { delete d_preambles_symbols; - if(d_dump_file.is_open() == true) + if (d_dump_file.is_open() == true) { try - { + { d_dump_file.close(); - } - catch(const std::exception & ex) - { + } + catch (const std::exception &ex) + { LOG(WARNING) << "Exception in destructor closing the dump file " << ex.what(); - } + } } } -void galileo_e1b_telemetry_decoder_cc::decode_word(double *page_part_symbols,int frame_length) +void galileo_e1b_telemetry_decoder_cc::decode_word(double *page_part_symbols, int frame_length) { double page_part_symbols_deint[frame_length]; // 1. De-interleave @@ -193,12 +192,12 @@ void galileo_e1b_telemetry_decoder_cc::decode_word(double *page_part_symbols,int } } - int page_part_bits[frame_length/2]; + int page_part_bits[frame_length / 2]; viterbi_decoder(page_part_symbols_deint, page_part_bits); // 3. Call the Galileo page decoder std::string page_String; - for(int i = 0; i < (frame_length/2); i++) + for (int i = 0; i < (frame_length / 2); i++) { if (page_part_bits[i] > 0) { @@ -214,15 +213,15 @@ void galileo_e1b_telemetry_decoder_cc::decode_word(double *page_part_symbols,int { // DECODE COMPLETE WORD (even + odd) and TEST CRC d_nav.split_page(page_String, flag_even_word_arrived); - if(d_nav.flag_CRC_test == true) + if (d_nav.flag_CRC_test == true) { LOG(INFO) << "Galileo E1 CRC correct on channel " << d_channel << " from satellite " << d_satellite; //std::cout << "Galileo E1 CRC correct on channel " << d_channel << " from satellite " << d_satellite << std::endl; } else { - std::cout << "Galileo E1 CRC error on channel " << d_channel << " from satellite " << d_satellite << std::endl; - LOG(INFO) << "Galileo E1 CRC error on channel " << d_channel << " from satellite " << d_satellite; + std::cout << "Galileo E1 CRC error on channel " << d_channel << " from satellite " << d_satellite << std::endl; + LOG(INFO) << "Galileo E1 CRC error on channel " << d_channel << " from satellite " << d_satellite; } flag_even_word_arrived = 0; } @@ -240,7 +239,6 @@ void galileo_e1b_telemetry_decoder_cc::decode_word(double *page_part_symbols,int std::shared_ptr tmp_obj = std::make_shared(d_nav.get_ephemeris()); std::cout << "New Galileo E1 I/NAV message received: ephemeris from satellite " << d_satellite << std::endl; this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj)); - } if (d_nav.have_new_iono_and_GST() == true) { @@ -258,7 +256,7 @@ void galileo_e1b_telemetry_decoder_cc::decode_word(double *page_part_symbols,int } if (d_nav.have_new_almanac() == true) { - std::shared_ptr tmp_obj= std::make_shared(d_nav.get_almanac()); + std::shared_ptr tmp_obj = std::make_shared(d_nav.get_almanac()); this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj)); //debug std::cout << "Galileo E1 I/NAV almanac received!" << std::endl; @@ -276,55 +274,53 @@ void galileo_e1b_telemetry_decoder_cc::decode_word(double *page_part_symbols,int } - - -int galileo_e1b_telemetry_decoder_cc::general_work (int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), - gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) +int galileo_e1b_telemetry_decoder_cc::general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), + gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { int corr_value = 0; int preamble_diff = 0; - Gnss_Synchro **out = reinterpret_cast(&output_items[0]); // Get the output buffer pointer - const Gnss_Synchro **in = reinterpret_cast(&input_items[0]); // Get the input buffer pointer + Gnss_Synchro **out = reinterpret_cast(&output_items[0]); // Get the output buffer pointer + const Gnss_Synchro **in = reinterpret_cast(&input_items[0]); // Get the input buffer pointer - Gnss_Synchro current_symbol; //structure to save the synchronization information and send the output object to the next block + Gnss_Synchro current_symbol; //structure to save the synchronization information and send the output object to the next block //1. Copy the current tracking output current_symbol = in[0][0]; - d_symbol_history.push_back(current_symbol); //add new symbol to the symbol queue - d_sample_counter++; //count for the processed samples + d_symbol_history.push_back(current_symbol); //add new symbol to the symbol queue + d_sample_counter++; //count for the processed samples consume_each(1); d_flag_preamble = false; unsigned int required_symbols = GALILEO_INAV_PAGE_SYMBOLS + d_symbols_per_preamble; if (d_symbol_history.size() > required_symbols) - { - // TODO Optimize me! - //******* preamble correlation ******** - for (int i = 0; i < d_symbols_per_preamble; i++) - { - if (d_symbol_history.at(i).Prompt_I < 0) // symbols clipping - { - corr_value -= d_preambles_symbols[i]; - } - else - { - corr_value += d_preambles_symbols[i]; - } - } - } + { + // TODO Optimize me! + //******* preamble correlation ******** + for (int i = 0; i < d_symbols_per_preamble; i++) + { + if (d_symbol_history.at(i).Prompt_I < 0) // symbols clipping + { + corr_value -= d_preambles_symbols[i]; + } + else + { + corr_value += d_preambles_symbols[i]; + } + } + } //******* frame sync ****************** - if (d_stat == 0) //no preamble information + if (d_stat == 0) //no preamble information { if (abs(corr_value) >= d_symbols_per_preamble) { - d_preamble_index = d_sample_counter;//record the preamble sample stamp + d_preamble_index = d_sample_counter; //record the preamble sample stamp LOG(INFO) << "Preamble detection for Galileo satellite " << this->d_satellite; - d_stat = 1; // enter into frame pre-detection status + d_stat = 1; // enter into frame pre-detection status } } - else if (d_stat == 1) // posible preamble lock + else if (d_stat == 1) // posible preamble lock { if (abs(corr_value) >= d_symbols_per_preamble) { @@ -334,14 +330,14 @@ int galileo_e1b_telemetry_decoder_cc::general_work (int noutput_items __attribut { //try to decode frame LOG(INFO) << "Starting page decoder for Galileo satellite " << this->d_satellite; - d_preamble_index = d_sample_counter; //record the preamble sample stamp + d_preamble_index = d_sample_counter; //record the preamble sample stamp d_stat = 2; } else { if (preamble_diff > GALILEO_INAV_PREAMBLE_PERIOD_SYMBOLS) { - d_stat = 0; // start again + d_stat = 0; // start again } } } @@ -359,12 +355,11 @@ int galileo_e1b_telemetry_decoder_cc::general_work (int noutput_items __attribut { if (corr_value > 0) { - page_part_symbols[i] = d_symbol_history.at(i + d_symbols_per_preamble).Prompt_I; // because last symbol of the preamble is just received now! - + page_part_symbols[i] = d_symbol_history.at(i + d_symbols_per_preamble).Prompt_I; // because last symbol of the preamble is just received now! } else { - page_part_symbols[i] = -d_symbol_history.at(i + d_symbols_per_preamble).Prompt_I; // because last symbol of the preamble is just received now! + page_part_symbols[i] = -d_symbol_history.at(i + d_symbols_per_preamble).Prompt_I; // because last symbol of the preamble is just received now! } } @@ -373,13 +368,13 @@ int galileo_e1b_telemetry_decoder_cc::general_work (int noutput_items __attribut if (d_nav.flag_CRC_test == true) { d_CRC_error_counter = 0; - d_flag_preamble = true; //valid preamble indicator (initialized to false every work()) + d_flag_preamble = true; //valid preamble indicator (initialized to false every work()) d_preamble_index = d_sample_counter; //record the preamble sample stamp (t_P) if (!d_flag_frame_sync) { d_flag_frame_sync = true; DLOG(INFO) << " Frame sync SAT " << this->d_satellite << " with preamble start at " - << d_symbol_history.at(0).Tracking_sample_counter << " [samples]"; + << d_symbol_history.at(0).Tracking_sample_counter << " [samples]"; } } else @@ -401,38 +396,38 @@ int galileo_e1b_telemetry_decoder_cc::general_work (int noutput_items __attribut if (this->d_flag_preamble == true and d_nav.flag_TOW_set == true) //update TOW at the preamble instant { - if(d_nav.flag_TOW_5 == true) //page 5 arrived and decoded, so we are in the odd page (since Tow refers to the even page, we have to add 1 sec) + if (d_nav.flag_TOW_5 == true) //page 5 arrived and decoded, so we are in the odd page (since Tow refers to the even page, we have to add 1 sec) { - //TOW_5 refers to the even preamble, but when we decode it we are in the odd part, so 1 second later plus the decoding delay - d_TOW_at_current_symbol = d_nav.TOW_5 + GALILEO_INAV_PAGE_PART_SECONDS + (static_cast(required_symbols)) * GALILEO_E1_CODE_PERIOD; //-GALILEO_E1_CODE_PERIOD;//+ (double)GALILEO_INAV_PREAMBLE_LENGTH_BITS/(double)GALILEO_TELEMETRY_RATE_BITS_SECOND; + //TOW_5 refers to the even preamble, but when we decode it we are in the odd part, so 1 second later plus the decoding delay + d_TOW_at_current_symbol = d_nav.TOW_5 + GALILEO_INAV_PAGE_PART_SECONDS + (static_cast(required_symbols)) * GALILEO_E1_CODE_PERIOD; //-GALILEO_E1_CODE_PERIOD;//+ (double)GALILEO_INAV_PREAMBLE_LENGTH_BITS/(double)GALILEO_TELEMETRY_RATE_BITS_SECOND; d_nav.flag_TOW_5 = false; } - else if(d_nav.flag_TOW_6 == true) //page 6 arrived and decoded, so we are in the odd page (since Tow refers to the even page, we have to add 1 sec) + else if (d_nav.flag_TOW_6 == true) //page 6 arrived and decoded, so we are in the odd page (since Tow refers to the even page, we have to add 1 sec) { //TOW_6 refers to the even preamble, but when we decode it we are in the odd part, so 1 second later plus the decoding delay - d_TOW_at_current_symbol = d_nav.TOW_6 + GALILEO_INAV_PAGE_PART_SECONDS + (static_cast(required_symbols)) * GALILEO_E1_CODE_PERIOD;//-GALILEO_E1_CODE_PERIOD;//+ (double)GALILEO_INAV_PREAMBLE_LENGTH_BITS/(double)GALILEO_TELEMETRY_RATE_BITS_SECOND; + d_TOW_at_current_symbol = d_nav.TOW_6 + GALILEO_INAV_PAGE_PART_SECONDS + (static_cast(required_symbols)) * GALILEO_E1_CODE_PERIOD; //-GALILEO_E1_CODE_PERIOD;//+ (double)GALILEO_INAV_PREAMBLE_LENGTH_BITS/(double)GALILEO_TELEMETRY_RATE_BITS_SECOND; d_nav.flag_TOW_6 = false; } else { //this page has no timing information - d_TOW_at_current_symbol = d_TOW_at_current_symbol + GALILEO_E1_CODE_PERIOD;// + GALILEO_INAV_PAGE_PART_SYMBOLS*GALILEO_E1_CODE_PERIOD; + d_TOW_at_current_symbol = d_TOW_at_current_symbol + GALILEO_E1_CODE_PERIOD; // + GALILEO_INAV_PAGE_PART_SYMBOLS*GALILEO_E1_CODE_PERIOD; } } - else //if there is not a new preamble, we define the TOW of the current symbol + else //if there is not a new preamble, we define the TOW of the current symbol { d_TOW_at_current_symbol = d_TOW_at_current_symbol + GALILEO_E1_CODE_PERIOD; } //if (d_flag_frame_sync == true and d_nav.flag_TOW_set==true and d_nav.flag_CRC_test == true) - if(d_nav.flag_GGTO_1 == true and d_nav.flag_GGTO_2 == true and d_nav.flag_GGTO_3 == true and d_nav.flag_GGTO_4 == true) //all GGTO parameters arrived + if (d_nav.flag_GGTO_1 == true and d_nav.flag_GGTO_2 == true and d_nav.flag_GGTO_3 == true and d_nav.flag_GGTO_4 == true) //all GGTO parameters arrived { delta_t = d_nav.A_0G_10 + d_nav.A_1G_10 * (d_TOW_at_current_symbol - d_nav.t_0G_10 + 604800.0 * (fmod((d_nav.WN_0 - d_nav.WN_0G_10), 64))); } - if(d_flag_frame_sync == true and d_nav.flag_TOW_set == true) + if (d_flag_frame_sync == true and d_nav.flag_TOW_set == true) { current_symbol.Flag_valid_word = true; } @@ -441,27 +436,27 @@ int galileo_e1b_telemetry_decoder_cc::general_work (int noutput_items __attribut current_symbol.Flag_valid_word = false; } - current_symbol.TOW_at_current_symbol_s = floor(d_TOW_at_current_symbol*1000.0)/1000.0; - current_symbol.TOW_at_current_symbol_s -= delta_t; //Galileo to GPS TOW + current_symbol.TOW_at_current_symbol_s = floor(d_TOW_at_current_symbol * 1000.0) / 1000.0; + current_symbol.TOW_at_current_symbol_s -= delta_t; //Galileo to GPS TOW - if(d_dump == true) + if (d_dump == true) { // MULTIPLEXED FILE RECORDING - Record results to file try - { - double tmp_double; - unsigned long int tmp_ulong_int; - tmp_double = d_TOW_at_current_symbol; - d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); - tmp_ulong_int = current_symbol.Tracking_sample_counter; - d_dump_file.write(reinterpret_cast(&tmp_ulong_int), sizeof(unsigned long int)); - tmp_double = 0; - d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); - } - catch (const std::ifstream::failure & e) - { + { + double tmp_double; + unsigned long int tmp_ulong_int; + tmp_double = d_TOW_at_current_symbol; + d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); + tmp_ulong_int = current_symbol.Tracking_sample_counter; + d_dump_file.write(reinterpret_cast(&tmp_ulong_int), sizeof(unsigned long int)); + tmp_double = 0; + d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); + } + catch (const std::ifstream::failure &e) + { LOG(WARNING) << "Exception writing observables dump file " << e.what(); - } + } } // remove used symbols from history @@ -476,7 +471,7 @@ int galileo_e1b_telemetry_decoder_cc::general_work (int noutput_items __attribut } -void galileo_e1b_telemetry_decoder_cc::set_satellite(const Gnss_Satellite & satellite) +void galileo_e1b_telemetry_decoder_cc::set_satellite(const Gnss_Satellite &satellite) { d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN()); DLOG(INFO) << "Setting decoder Finite State Machine to satellite " << d_satellite; @@ -494,21 +489,18 @@ void galileo_e1b_telemetry_decoder_cc::set_channel(int channel) if (d_dump_file.is_open() == false) { try - { + { d_dump_filename = "telemetry"; d_dump_filename.append(boost::lexical_cast(d_channel)); d_dump_filename.append(".dat"); - d_dump_file.exceptions ( std::ifstream::failbit | std::ifstream::badbit ); + d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); LOG(INFO) << "Telemetry decoder dump enabled on channel " << d_channel << " Log file: " << d_dump_filename.c_str(); - } - catch (const std::ifstream::failure& e) - { + } + catch (const std::ifstream::failure &e) + { LOG(WARNING) << "channel " << d_channel << " Exception opening trk dump file " << e.what(); - } + } } } } - - - diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_e1b_telemetry_decoder_cc.h b/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_e1b_telemetry_decoder_cc.h index 7e6fb0374..33900b7d1 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_e1b_telemetry_decoder_cc.h +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_e1b_telemetry_decoder_cc.h @@ -50,7 +50,7 @@ class galileo_e1b_telemetry_decoder_cc; typedef boost::shared_ptr galileo_e1b_telemetry_decoder_cc_sptr; -galileo_e1b_telemetry_decoder_cc_sptr galileo_e1b_make_telemetry_decoder_cc(const Gnss_Satellite & satellite, bool dump); +galileo_e1b_telemetry_decoder_cc_sptr galileo_e1b_make_telemetry_decoder_cc(const Gnss_Satellite &satellite, bool dump); /*! * \brief This class implements a block that decodes the INAV data defined in Galileo ICD @@ -60,26 +60,26 @@ class galileo_e1b_telemetry_decoder_cc : public gr::block { public: ~galileo_e1b_telemetry_decoder_cc(); - void set_satellite(const Gnss_Satellite & satellite); //!< Set satellite PRN - void set_channel(int channel); //!< Set receiver's channel + void set_satellite(const Gnss_Satellite &satellite); //!< Set satellite PRN + void set_channel(int channel); //!< Set receiver's channel int flag_even_word_arrived; /*! * \brief This is where all signal processing takes place */ - int general_work (int noutput_items, gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); + int general_work(int noutput_items, gr_vector_int &ninput_items, + gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); private: friend galileo_e1b_telemetry_decoder_cc_sptr - galileo_e1b_make_telemetry_decoder_cc(const Gnss_Satellite & satellite, bool dump); - galileo_e1b_telemetry_decoder_cc(const Gnss_Satellite & satellite, bool dump); + galileo_e1b_make_telemetry_decoder_cc(const Gnss_Satellite &satellite, bool dump); + galileo_e1b_telemetry_decoder_cc(const Gnss_Satellite &satellite, bool dump); void viterbi_decoder(double *page_part_symbols, int *page_part_bits); void deinterleaver(int rows, int cols, double *in, double *out); - void decode_word(double *symbols,int frame_length); + void decode_word(double *symbols, int frame_length); unsigned short int d_preambles_bits[GALILEO_INAV_PREAMBLE_LENGTH_BITS]; @@ -108,7 +108,7 @@ private: double d_TOW_at_current_symbol; bool flag_TOW_set; - double delta_t; //GPS-GALILEO time offset + double delta_t; //GPS-GALILEO time offset std::string d_dump_filename; std::ofstream d_dump_file; diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_e5a_telemetry_decoder_cc.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_e5a_telemetry_decoder_cc.cc index 6ae735b57..43c944a0a 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_e5a_telemetry_decoder_cc.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_e5a_telemetry_decoder_cc.cc @@ -50,7 +50,7 @@ using google::LogMessage; galileo_e5a_telemetry_decoder_cc_sptr -galileo_e5a_make_telemetry_decoder_cc(const Gnss_Satellite & satellite, bool dump) +galileo_e5a_make_telemetry_decoder_cc(const Gnss_Satellite &satellite, bool dump) { return galileo_e5a_telemetry_decoder_cc_sptr(new galileo_e5a_telemetry_decoder_cc(satellite, dump)); } @@ -64,36 +64,36 @@ void galileo_e5a_telemetry_decoder_cc::viterbi_decoder(double *page_part_symbols int nn, KK, mm, max_states; int g_encoder[2]; - nn = 2; // Coding rate 1/n - KK = 7; // Constraint Length - g_encoder[0] = 121; // Polynomial G1 - g_encoder[1] = 91; // Polynomial G2 + nn = 2; // Coding rate 1/n + KK = 7; // Constraint Length + g_encoder[0] = 121; // Polynomial G1 + g_encoder[1] = 91; // Polynomial G2 // g_encoder[0] = 171; // Polynomial G1 // g_encoder[1] = 133; // Polynomial G2 mm = KK - 1; - max_states = 1 << mm; // 2^mm - DataLength = (CodeLength/nn) - mm; + max_states = 1 << mm; // 2^mm + DataLength = (CodeLength / nn) - mm; //create appropriate transition matrices int *out0, *out1, *state0, *state1; - out0 = static_cast(calloc( max_states, sizeof(int) )); - out1 = static_cast(calloc( max_states, sizeof(int) )); - state0 = static_cast(calloc( max_states, sizeof(int) )); - state1 = static_cast(calloc( max_states, sizeof(int) )); + out0 = static_cast(calloc(max_states, sizeof(int))); + out1 = static_cast(calloc(max_states, sizeof(int))); + state0 = static_cast(calloc(max_states, sizeof(int))); + state1 = static_cast(calloc(max_states, sizeof(int))); - nsc_transit( out0, state0, 0, g_encoder, KK, nn ); - nsc_transit( out1, state1, 1, g_encoder, KK, nn ); + nsc_transit(out0, state0, 0, g_encoder, KK, nn); + nsc_transit(out1, state1, 1, g_encoder, KK, nn); Viterbi(page_part_bits, out0, state0, out1, state1, - page_part_symbols, KK, nn, DataLength ); + page_part_symbols, KK, nn, DataLength); //Clean up memory - free( out0 ); - free( out1 ); - free( state0 ); - free( state1 ); + free(out0); + free(out1); + free(state0); + free(state1); } @@ -101,9 +101,9 @@ void galileo_e5a_telemetry_decoder_cc::deinterleaver(int rows, int cols, double { for (int r = 0; r < rows; r++) { - for(int c = 0; c < cols; c++) + for (int c = 0; c < cols; c++) { - out[c*rows + r] = in[r*cols + c]; + out[c * rows + r] = in[r * cols + c]; } } } @@ -126,12 +126,12 @@ void galileo_e5a_telemetry_decoder_cc::decode_word(double *page_symbols, int fra page_symbols_deint[i] = -page_symbols_deint[i]; } } - int page_bits[frame_length/2]; + int page_bits[frame_length / 2]; viterbi_decoder(page_symbols_deint, page_bits); // 3. Call the Galileo page decoder std::string page_String; - for(int i = 0; i < frame_length; i++) + for (int i = 0; i < frame_length; i++) { if (page_bits[i] > 0) { @@ -145,7 +145,7 @@ void galileo_e5a_telemetry_decoder_cc::decode_word(double *page_symbols, int fra // DECODE COMPLETE WORD (even + odd) and TEST CRC d_nav.split_page(page_String); - if(d_nav.flag_CRC_test == true) + if (d_nav.flag_CRC_test == true) { LOG(INFO) << "Galileo E5a CRC correct on channel " << d_channel << " from satellite " << d_satellite; //std::cout << "Galileo E5a CRC correct on channel " << d_channel << " from satellite " << d_satellite << std::endl; @@ -153,7 +153,7 @@ void galileo_e5a_telemetry_decoder_cc::decode_word(double *page_symbols, int fra else { std::cout << "Galileo E5a CRC error on channel " << d_channel << " from satellite " << d_satellite << std::endl; - LOG(INFO)<< "Galileo E5a CRC error on channel " << d_channel << " from satellite " << d_satellite; + LOG(INFO) << "Galileo E5a CRC error on channel " << d_channel << " from satellite " << d_satellite; } // 4. Push the new navigation data to the queues @@ -179,9 +179,9 @@ void galileo_e5a_telemetry_decoder_cc::decode_word(double *page_symbols, int fra galileo_e5a_telemetry_decoder_cc::galileo_e5a_telemetry_decoder_cc( - const Gnss_Satellite & satellite, bool dump) : gr::block("galileo_e5a_telemetry_decoder_cc", - gr::io_signature::make(1, 1, sizeof(Gnss_Synchro)), - gr::io_signature::make(1, 1, sizeof(Gnss_Synchro))) + const Gnss_Satellite &satellite, bool dump) : gr::block("galileo_e5a_telemetry_decoder_cc", + gr::io_signature::make(1, 1, sizeof(Gnss_Synchro)), + gr::io_signature::make(1, 1, sizeof(Gnss_Synchro))) { // Telemetry Bit transition synchronization port out this->message_port_register_out(pmt::mp("preamble_timestamp_s")); @@ -233,112 +233,112 @@ galileo_e5a_telemetry_decoder_cc::galileo_e5a_telemetry_decoder_cc( galileo_e5a_telemetry_decoder_cc::~galileo_e5a_telemetry_decoder_cc() { - if(d_dump_file.is_open() == true) + if (d_dump_file.is_open() == true) { try - { + { d_dump_file.close(); - } - catch(const std::exception & ex) - { + } + catch (const std::exception &ex) + { LOG(WARNING) << "Exception in destructor closing the dump file " << ex.what(); - } + } } } -int galileo_e5a_telemetry_decoder_cc::general_work (int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), - gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) +int galileo_e5a_telemetry_decoder_cc::general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), + gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { int preamble_diff = 0; - Gnss_Synchro* out = reinterpret_cast(output_items[0]); // Get the output buffer pointer - const Gnss_Synchro* in = reinterpret_cast(input_items[0]); // Get the input buffer pointer + Gnss_Synchro *out = reinterpret_cast(output_items[0]); // Get the output buffer pointer + const Gnss_Synchro *in = reinterpret_cast(input_items[0]); // Get the input buffer pointer //1. Copy the current tracking output Gnss_Synchro current_sample = in[0]; d_symbol_counter++; - if(flag_bit_start) - { - d_prompt_acum += current_sample.Prompt_I; - if(d_symbol_counter == GALILEO_FNAV_CODES_PER_SYMBOL) - { - current_sample.Prompt_I = d_prompt_acum / static_cast(GALILEO_FNAV_CODES_PER_SYMBOL); - d_symbol_history.push_back(current_sample); //add new symbol to the symbol queue - d_prompt_acum = 0.0; - d_symbol_counter = 0; - new_symbol = true; - } - } + if (flag_bit_start) + { + d_prompt_acum += current_sample.Prompt_I; + if (d_symbol_counter == GALILEO_FNAV_CODES_PER_SYMBOL) + { + current_sample.Prompt_I = d_prompt_acum / static_cast(GALILEO_FNAV_CODES_PER_SYMBOL); + d_symbol_history.push_back(current_sample); //add new symbol to the symbol queue + d_prompt_acum = 0.0; + d_symbol_counter = 0; + new_symbol = true; + } + } else - { - if(current_sample.Prompt_I < 0.0) - { - d_preamble_init.push_back(1); - } - else - { - d_preamble_init.push_back(-1); - } + { + if (current_sample.Prompt_I < 0.0) + { + d_preamble_init.push_back(1); + } + else + { + d_preamble_init.push_back(-1); + } - if (d_preamble_init.size() == GALILEO_FNAV_CODES_PER_PREAMBLE) - { - std::deque::iterator iter; - int k = 0; - corr_value = 0; - for (iter = d_preamble_init.begin(); iter != d_preamble_init.end(); iter++) - { - corr_value += *iter * d_preamble_samples[k]; - k++; - } - if(abs(corr_value) == GALILEO_FNAV_CODES_PER_PREAMBLE) - { - d_symbol_counter = 0; - flag_bit_start = true; - corr_value = 0; - d_preamble_init.clear(); - d_symbol_history.clear(); - LOG(INFO) << "Bit start sync for Galileo E5a satellite " << d_satellite; - } - else - { - d_preamble_init.pop_front(); - } - } - } - d_sample_counter++; //count for the processed samples + if (d_preamble_init.size() == GALILEO_FNAV_CODES_PER_PREAMBLE) + { + std::deque::iterator iter; + int k = 0; + corr_value = 0; + for (iter = d_preamble_init.begin(); iter != d_preamble_init.end(); iter++) + { + corr_value += *iter * d_preamble_samples[k]; + k++; + } + if (abs(corr_value) == GALILEO_FNAV_CODES_PER_PREAMBLE) + { + d_symbol_counter = 0; + flag_bit_start = true; + corr_value = 0; + d_preamble_init.clear(); + d_symbol_history.clear(); + LOG(INFO) << "Bit start sync for Galileo E5a satellite " << d_satellite; + } + else + { + d_preamble_init.pop_front(); + } + } + } + d_sample_counter++; //count for the processed samples consume_each(1); d_flag_preamble = false; if ((d_symbol_history.size() > required_symbols) && new_symbol) - { - //******* preamble correlation ******** - corr_value = 0; - for (int i = 0; i < GALILEO_FNAV_PREAMBLE_LENGTH_BITS; i++) - { - if (d_symbol_history.at(i).Prompt_I < 0.0) // symbols clipping - { - corr_value -= d_preambles_bits[i]; - } - else - { - corr_value += d_preambles_bits[i]; - } - } - } + { + //******* preamble correlation ******** + corr_value = 0; + for (int i = 0; i < GALILEO_FNAV_PREAMBLE_LENGTH_BITS; i++) + { + if (d_symbol_history.at(i).Prompt_I < 0.0) // symbols clipping + { + corr_value -= d_preambles_bits[i]; + } + else + { + corr_value += d_preambles_bits[i]; + } + } + } //******* frame sync ****************** - if ((d_stat == 0) && new_symbol) //no preamble information + if ((d_stat == 0) && new_symbol) //no preamble information { if (abs(corr_value) >= GALILEO_FNAV_PREAMBLE_LENGTH_BITS) { - d_preamble_index = d_sample_counter;//record the preamble sample stamp + d_preamble_index = d_sample_counter; //record the preamble sample stamp LOG(INFO) << "Preamble detection for Galileo E5a satellite " << d_satellite; - d_stat = 1; // enter into frame pre-detection status + d_stat = 1; // enter into frame pre-detection status } } - else if ((d_stat == 1) && new_symbol) // posible preamble lock + else if ((d_stat == 1) && new_symbol) // posible preamble lock { if (abs(corr_value) >= GALILEO_FNAV_PREAMBLE_LENGTH_BITS) { @@ -348,12 +348,12 @@ int galileo_e5a_telemetry_decoder_cc::general_work (int noutput_items __attribut { //try to decode frame LOG(INFO) << "Starting page decoder for Galileo E5a satellite " << d_satellite; - d_preamble_index = d_sample_counter; //record the preamble sample stamp + d_preamble_index = d_sample_counter; //record the preamble sample stamp d_stat = 2; } else if (preamble_diff > GALILEO_FNAV_CODES_PER_PAGE) { - d_stat = 0; // start again + d_stat = 0; // start again flag_bit_start = false; LOG(INFO) << "Preamble diff = " << preamble_diff; } @@ -367,11 +367,17 @@ int galileo_e5a_telemetry_decoder_cc::general_work (int noutput_items __attribut // 0. fetch the symbols into an array int frame_length = GALILEO_FNAV_SYMBOLS_PER_PAGE - GALILEO_FNAV_PREAMBLE_LENGTH_BITS; double corr_sign = 0.0; - if(corr_value > 0) { corr_sign = -1.0; } - else { corr_sign = 1.0; } + if (corr_value > 0) + { + corr_sign = -1.0; + } + else + { + corr_sign = 1.0; + } for (int i = 0; i < frame_length; i++) { - page_symbols[i] = corr_sign * d_symbol_history.at(i + GALILEO_FNAV_PREAMBLE_LENGTH_BITS).Prompt_I; // because last symbol of the preamble is just received now! + page_symbols[i] = corr_sign * d_symbol_history.at(i + GALILEO_FNAV_PREAMBLE_LENGTH_BITS).Prompt_I; // because last symbol of the preamble is just received now! } //call the decoder @@ -379,13 +385,13 @@ int galileo_e5a_telemetry_decoder_cc::general_work (int noutput_items __attribut if (d_nav.flag_CRC_test == true) { d_CRC_error_counter = 0; - d_flag_preamble = true; //valid preamble indicator (initialized to false every work()) + d_flag_preamble = true; //valid preamble indicator (initialized to false every work()) d_preamble_index = d_sample_counter; //record the preamble sample stamp (t_P) if (!d_flag_frame_sync) { d_flag_frame_sync = true; DLOG(INFO) << " Frame sync SAT " << this->d_satellite << " with preamble start at " - << d_symbol_history.at(0).Tracking_sample_counter << " [samples]"; + << d_symbol_history.at(0).Tracking_sample_counter << " [samples]"; } } else @@ -435,7 +441,7 @@ int galileo_e5a_telemetry_decoder_cc::general_work (int noutput_items __attribut d_TOW_at_current_symbol += GALILEO_E5a_CODE_PERIOD; } } - else //if there is not a new preamble, we define the TOW of the current symbol + else //if there is not a new preamble, we define the TOW of the current symbol { d_TOW_at_current_symbol += GALILEO_E5a_CODE_PERIOD; } @@ -452,38 +458,44 @@ int galileo_e5a_telemetry_decoder_cc::general_work (int noutput_items __attribut current_sample.TOW_at_current_symbol_s = floor(d_TOW_at_current_symbol * 1000.0) / 1000.0; - if(d_dump) + if (d_dump) { // MULTIPLEXED FILE RECORDING - Record results to file try - { + { double tmp_double; unsigned long int tmp_ulong_int; tmp_double = d_TOW_at_current_symbol; - d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); + d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); tmp_ulong_int = current_sample.Tracking_sample_counter; - d_dump_file.write(reinterpret_cast(&tmp_ulong_int), sizeof(unsigned long int)); + d_dump_file.write(reinterpret_cast(&tmp_ulong_int), sizeof(unsigned long int)); tmp_double = 0.0; - d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); - } - catch (const std::ifstream::failure & e) - { + d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); + } + catch (const std::ifstream::failure &e) + { LOG(WARNING) << "Exception writing Galileo E5a Telemetry Decoder dump file " << e.what(); - } + } } // remove used symbols from history - while (d_symbol_history.size() > required_symbols) { d_symbol_history.pop_front(); } + while (d_symbol_history.size() > required_symbols) + { + d_symbol_history.pop_front(); + } //3. Make the output - if(current_sample.Flag_valid_word) + if (current_sample.Flag_valid_word) { out[0] = current_sample; return 1; } - else { return 0; } + else + { + return 0; + } } -void galileo_e5a_telemetry_decoder_cc::set_satellite(const Gnss_Satellite & satellite) +void galileo_e5a_telemetry_decoder_cc::set_satellite(const Gnss_Satellite &satellite) { d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN()); DLOG(INFO) << "Setting decoder Finite State Machine to satellite " << d_satellite; @@ -501,18 +513,18 @@ void galileo_e5a_telemetry_decoder_cc::set_channel(int channel) if (d_dump_file.is_open() == false) { try - { + { d_dump_filename = "telemetry"; d_dump_filename.append(boost::lexical_cast(d_channel)); d_dump_filename.append(".dat"); - d_dump_file.exceptions ( std::ifstream::failbit | std::ifstream::badbit ); + d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); LOG(INFO) << "Telemetry decoder dump enabled on channel " << d_channel << " Log file: " << d_dump_filename.c_str(); - } - catch (const std::ifstream::failure& e) - { + } + catch (const std::ifstream::failure &e) + { LOG(WARNING) << "channel " << d_channel << " Exception opening trk dump file " << e.what(); - } + } } } } diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_e5a_telemetry_decoder_cc.h b/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_e5a_telemetry_decoder_cc.h index af1d3f15d..5579f701a 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_e5a_telemetry_decoder_cc.h +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_e5a_telemetry_decoder_cc.h @@ -55,7 +55,7 @@ class galileo_e5a_telemetry_decoder_cc; typedef boost::shared_ptr galileo_e5a_telemetry_decoder_cc_sptr; -galileo_e5a_telemetry_decoder_cc_sptr galileo_e5a_make_telemetry_decoder_cc(const Gnss_Satellite & satellite, bool dump); +galileo_e5a_telemetry_decoder_cc_sptr galileo_e5a_make_telemetry_decoder_cc(const Gnss_Satellite &satellite, bool dump); /*! @@ -66,18 +66,18 @@ class galileo_e5a_telemetry_decoder_cc : public gr::block { public: ~galileo_e5a_telemetry_decoder_cc(); - void set_satellite(const Gnss_Satellite & satellite); //!< Set satellite PRN - void set_channel(int channel); //!< Set receiver's channel + void set_satellite(const Gnss_Satellite &satellite); //!< Set satellite PRN + void set_channel(int channel); //!< Set receiver's channel /*! * \brief This is where all signal processing takes place */ - int general_work (int noutput_items, gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); + int general_work(int noutput_items, gr_vector_int &ninput_items, + gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); private: friend galileo_e5a_telemetry_decoder_cc_sptr - galileo_e5a_make_telemetry_decoder_cc(const Gnss_Satellite & satellite, bool dump); - galileo_e5a_telemetry_decoder_cc(const Gnss_Satellite & satellite, bool dump); + galileo_e5a_make_telemetry_decoder_cc(const Gnss_Satellite &satellite, bool dump); + galileo_e5a_telemetry_decoder_cc(const Gnss_Satellite &satellite, bool dump); void viterbi_decoder(double *page_part_symbols, int *page_part_bits); @@ -105,7 +105,7 @@ private: double d_prompt_acum; double page_symbols[GALILEO_FNAV_SYMBOLS_PER_PAGE - GALILEO_FNAV_PREAMBLE_LENGTH_BITS]; double d_TOW_at_current_symbol; - double delta_t; //GPS-GALILEO time offset + double delta_t; //GPS-GALILEO time offset std::string d_dump_filename; std::ofstream d_dump_file; std::deque d_symbol_history; diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l1_ca_telemetry_decoder_cc.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l1_ca_telemetry_decoder_cc.cc index c5a69489a..dad1a5d2c 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l1_ca_telemetry_decoder_cc.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l1_ca_telemetry_decoder_cc.cc @@ -43,17 +43,16 @@ using google::LogMessage; glonass_l1_ca_telemetry_decoder_cc_sptr -glonass_l1_ca_make_telemetry_decoder_cc(const Gnss_Satellite & satellite, bool dump) +glonass_l1_ca_make_telemetry_decoder_cc(const Gnss_Satellite &satellite, bool dump) { return glonass_l1_ca_telemetry_decoder_cc_sptr(new glonass_l1_ca_telemetry_decoder_cc(satellite, dump)); } glonass_l1_ca_telemetry_decoder_cc::glonass_l1_ca_telemetry_decoder_cc( - const Gnss_Satellite & satellite, - bool dump) : - gr::block("glonass_l1_ca_telemetry_decoder_cc", gr::io_signature::make(1, 1, sizeof(Gnss_Synchro)), - gr::io_signature::make(1, 1, sizeof(Gnss_Synchro))) + const Gnss_Satellite &satellite, + bool dump) : gr::block("glonass_l1_ca_telemetry_decoder_cc", gr::io_signature::make(1, 1, sizeof(Gnss_Synchro)), + gr::io_signature::make(1, 1, sizeof(Gnss_Synchro))) { // Telemetry Bit transition synchronization port out this->message_port_register_out(pmt::mp("preamble_timestamp_s")); @@ -65,17 +64,17 @@ glonass_l1_ca_telemetry_decoder_cc::glonass_l1_ca_telemetry_decoder_cc( LOG(INFO) << "Initializing GLONASS L1 CA TELEMETRY DECODING"; // Define the number of sampes per symbol. Notice that GLONASS has 2 rates, //one for the navigation data and the other for the preamble information - d_samples_per_symbol = ( GLONASS_L1_CA_CODE_RATE_HZ / GLONASS_L1_CA_CODE_LENGTH_CHIPS ) / GLONASS_L1_CA_SYMBOL_RATE_BPS; + d_samples_per_symbol = (GLONASS_L1_CA_CODE_RATE_HZ / GLONASS_L1_CA_CODE_LENGTH_CHIPS) / GLONASS_L1_CA_SYMBOL_RATE_BPS; // Set the preamble information unsigned short int preambles_bits[GLONASS_GNAV_PREAMBLE_LENGTH_BITS] = GLONASS_GNAV_PREAMBLE; // Since preamble rate is different than navigation data rate we use a constant d_symbols_per_preamble = GLONASS_GNAV_PREAMBLE_LENGTH_SYMBOLS; - memcpy(static_cast(this->d_preambles_bits), static_cast(preambles_bits), GLONASS_GNAV_PREAMBLE_LENGTH_BITS * sizeof(unsigned short int)); + memcpy(static_cast(this->d_preambles_bits), static_cast(preambles_bits), GLONASS_GNAV_PREAMBLE_LENGTH_BITS * sizeof(unsigned short int)); // preamble bits to sampled symbols - d_preambles_symbols = static_cast(malloc(sizeof(signed int) * d_symbols_per_preamble)); + d_preambles_symbols = static_cast(malloc(sizeof(signed int) * d_symbols_per_preamble)); int n = 0; for (int i = 0; i < GLONASS_GNAV_PREAMBLE_LENGTH_BITS; i++) { @@ -113,21 +112,21 @@ glonass_l1_ca_telemetry_decoder_cc::glonass_l1_ca_telemetry_decoder_cc( glonass_l1_ca_telemetry_decoder_cc::~glonass_l1_ca_telemetry_decoder_cc() { delete d_preambles_symbols; - if(d_dump_file.is_open() == true) + if (d_dump_file.is_open() == true) { try - { + { d_dump_file.close(); - } - catch(const std::exception & ex) - { + } + catch (const std::exception &ex) + { LOG(WARNING) << "Exception in destructor closing the dump file " << ex.what(); - } + } } } -void glonass_l1_ca_telemetry_decoder_cc::decode_string(double *frame_symbols,int frame_length) +void glonass_l1_ca_telemetry_decoder_cc::decode_string(double *frame_symbols, int frame_length) { double chip_acc = 0.0; int chip_acc_counter = 0; @@ -138,12 +137,12 @@ void glonass_l1_ca_telemetry_decoder_cc::decode_string(double *frame_symbols,int std::string data_bits; // Group samples into bi-binary code - for(int i = 0; i < (frame_length); i++) + for (int i = 0; i < (frame_length); i++) { chip_acc += frame_symbols[i]; chip_acc_counter += 1; - if(chip_acc_counter == (GLONASS_GNAV_TELEMETRY_SYMBOLS_PER_BIT)) + if (chip_acc_counter == (GLONASS_GNAV_TELEMETRY_SYMBOLS_PER_BIT)) { if (chip_acc > 0) { @@ -160,9 +159,9 @@ void glonass_l1_ca_telemetry_decoder_cc::decode_string(double *frame_symbols,int } } // Convert from bi-binary code to relative code - for(int i = 0; i < (GLONASS_GNAV_STRING_BITS); i++) + for (int i = 0; i < (GLONASS_GNAV_STRING_BITS); i++) { - if(bi_binary_code[2*i] == '1' && bi_binary_code[2*i + 1] == '0') + if (bi_binary_code[2 * i] == '1' && bi_binary_code[2 * i + 1] == '0') { relative_code.push_back('1'); } @@ -173,22 +172,22 @@ void glonass_l1_ca_telemetry_decoder_cc::decode_string(double *frame_symbols,int } // Convert from relative code to data bits data_bits.push_back('0'); - for(int i = 1; i < (GLONASS_GNAV_STRING_BITS); i++) + for (int i = 1; i < (GLONASS_GNAV_STRING_BITS); i++) { - data_bits.push_back(((relative_code[i-1]-'0') ^ (relative_code[i]-'0')) + '0'); + data_bits.push_back(((relative_code[i - 1] - '0') ^ (relative_code[i] - '0')) + '0'); } // 2. Call the GLONASS GNAV string decoder d_nav.string_decoder(data_bits); // 3. Check operation executed correctly - if(d_nav.flag_CRC_test == true) + if (d_nav.flag_CRC_test == true) { - LOG(INFO) << "GLONASS GNAV CRC correct on channel " << d_channel << " from satellite "<< d_satellite; + LOG(INFO) << "GLONASS GNAV CRC correct on channel " << d_channel << " from satellite " << d_satellite; } else { - LOG(INFO) << "GLONASS GNAV CRC error on channel " << d_channel << " from satellite " << d_satellite; + LOG(INFO) << "GLONASS GNAV CRC error on channel " << d_channel << " from satellite " << d_satellite; } // 4. Push the new navigation data to the queues if (d_nav.have_new_ephemeris() == true) @@ -209,12 +208,12 @@ void glonass_l1_ca_telemetry_decoder_cc::decode_string(double *frame_symbols,int if (d_nav.have_new_almanac() == true) { unsigned int slot_nbr = d_nav.i_alm_satellite_slot_number; - std::shared_ptr tmp_obj= std::make_shared(d_nav.get_almanac(slot_nbr)); + std::shared_ptr tmp_obj = std::make_shared(d_nav.get_almanac(slot_nbr)); this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj)); LOG(INFO) << "GLONASS GNAV Almanac have been received on channel" << d_channel << " in slot number " << slot_nbr; } // 5. Update satellite information on system - if(d_nav.flag_update_slot_number == true) + if (d_nav.flag_update_slot_number == true) { LOG(INFO) << "GLONASS GNAV Slot Number Identified on channel " << d_channel; d_satellite.update_PRN(d_nav.gnav_ephemeris.d_n); @@ -224,31 +223,31 @@ void glonass_l1_ca_telemetry_decoder_cc::decode_string(double *frame_symbols,int } -int glonass_l1_ca_telemetry_decoder_cc::general_work (int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), - gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) +int glonass_l1_ca_telemetry_decoder_cc::general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), + gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { int corr_value = 0; int preamble_diff = 0; - Gnss_Synchro **out = reinterpret_cast(&output_items[0]); // Get the output buffer pointer - const Gnss_Synchro **in = reinterpret_cast(&input_items[0]); // Get the input buffer pointer + Gnss_Synchro **out = reinterpret_cast(&output_items[0]); // Get the output buffer pointer + const Gnss_Synchro **in = reinterpret_cast(&input_items[0]); // Get the input buffer pointer - Gnss_Synchro current_symbol; //structure to save the synchronization information and send the output object to the next block + Gnss_Synchro current_symbol; //structure to save the synchronization information and send the output object to the next block //1. Copy the current tracking output current_symbol = in[0][0]; - d_symbol_history.push_back(current_symbol); //add new symbol to the symbol queue - d_sample_counter++; //count for the processed samples + d_symbol_history.push_back(current_symbol); //add new symbol to the symbol queue + d_sample_counter++; //count for the processed samples consume_each(1); d_flag_preamble = false; unsigned int required_symbols = GLONASS_GNAV_STRING_SYMBOLS; - if (d_symbol_history.size()>required_symbols) + if (d_symbol_history.size() > required_symbols) { //******* preamble correlation ******** for (int i = 0; i < d_symbols_per_preamble; i++) { - if (d_symbol_history.at(i).Prompt_I < 0) // symbols clipping + if (d_symbol_history.at(i).Prompt_I < 0) // symbols clipping { corr_value -= d_preambles_symbols[i]; } @@ -260,7 +259,7 @@ int glonass_l1_ca_telemetry_decoder_cc::general_work (int noutput_items __attrib } //******* frame sync ****************** - if (d_stat == 0) //no preamble information + if (d_stat == 0) //no preamble information { if (abs(corr_value) >= d_symbols_per_preamble) { @@ -269,10 +268,10 @@ int glonass_l1_ca_telemetry_decoder_cc::general_work (int noutput_items __attrib LOG(INFO) << "Preamble detection for GLONASS L1 C/A SAT " << this->d_satellite; // Enter into frame pre-detection status d_stat = 1; - d_preamble_time_samples = d_symbol_history.at(0).Tracking_sample_counter; // record the preamble sample stamp + d_preamble_time_samples = d_symbol_history.at(0).Tracking_sample_counter; // record the preamble sample stamp } } - else if (d_stat == 1) // posible preamble lock + else if (d_stat == 1) // posible preamble lock { if (abs(corr_value) >= d_symbols_per_preamble) { @@ -284,7 +283,7 @@ int glonass_l1_ca_telemetry_decoder_cc::general_work (int noutput_items __attrib { //try to decode frame LOG(INFO) << "Starting string decoder for GLONASS L1 C/A SAT " << this->d_satellite; - d_preamble_index = d_sample_counter; //record the preamble sample stamp + d_preamble_index = d_sample_counter; //record the preamble sample stamp d_stat = 2; // send asynchronous message to tracking to inform of frame sync and extend correlation time pmt::pmt_t value = pmt::from_double(static_cast(d_preamble_time_samples) / static_cast(d_symbol_history.at(0).fs) - 0.001); @@ -294,7 +293,7 @@ int glonass_l1_ca_telemetry_decoder_cc::general_work (int noutput_items __attrib { if (preamble_diff > GLONASS_GNAV_PREAMBLE_PERIOD_SYMBOLS) { - d_stat = 0; // start again + d_stat = 0; // start again } DLOG(INFO) << "Failed string decoder for GLONASS L1 C/A SAT " << this->d_satellite; } @@ -315,12 +314,11 @@ int glonass_l1_ca_telemetry_decoder_cc::general_work (int noutput_items __attrib { if (corr_value > 0) { - string_symbols[i] = d_symbol_history.at(i + d_symbols_per_preamble).Prompt_I; // because last symbol of the preamble is just received now! - + string_symbols[i] = d_symbol_history.at(i + d_symbols_per_preamble).Prompt_I; // because last symbol of the preamble is just received now! } else { - string_symbols[i] = -d_symbol_history.at(i + d_symbols_per_preamble).Prompt_I; // because last symbol of the preamble is just received now! + string_symbols[i] = -d_symbol_history.at(i + d_symbols_per_preamble).Prompt_I; // because last symbol of the preamble is just received now! } } @@ -329,7 +327,7 @@ int glonass_l1_ca_telemetry_decoder_cc::general_work (int noutput_items __attrib if (d_nav.flag_CRC_test == true) { d_CRC_error_counter = 0; - d_flag_preamble = true; //valid preamble indicator (initialized to false every work()) + d_flag_preamble = true; //valid preamble indicator (initialized to false every work()) d_preamble_index = d_sample_counter; //record the preamble sample stamp (t_P) if (!d_flag_frame_sync) { @@ -357,11 +355,10 @@ int glonass_l1_ca_telemetry_decoder_cc::general_work (int noutput_items __attrib if (this->d_flag_preamble == true and d_nav.flag_TOW_new == true) //update TOW at the preamble instant { - d_TOW_at_current_symbol = floor((d_nav.gnav_ephemeris.d_TOW-GLONASS_GNAV_PREAMBLE_DURATION_S)*1000)/1000; + d_TOW_at_current_symbol = floor((d_nav.gnav_ephemeris.d_TOW - GLONASS_GNAV_PREAMBLE_DURATION_S) * 1000) / 1000; d_nav.flag_TOW_new = false; - } - else //if there is not a new preamble, we define the TOW of the current symbol + else //if there is not a new preamble, we define the TOW of the current symbol { d_TOW_at_current_symbol = d_TOW_at_current_symbol + GLONASS_L1_CA_CODE_PERIOD; } @@ -384,30 +381,30 @@ int glonass_l1_ca_telemetry_decoder_cc::general_work (int noutput_items __attrib current_symbol.PRN = this->d_satellite.get_PRN(); current_symbol.TOW_at_current_symbol_s = d_TOW_at_current_symbol; - current_symbol.TOW_at_current_symbol_s -= delta_t; // Galileo to GPS TOW + current_symbol.TOW_at_current_symbol_s -= delta_t; // Galileo to GPS TOW - if(d_dump == true) + if (d_dump == true) { // MULTIPLEXED FILE RECORDING - Record results to file try - { + { double tmp_double; unsigned long int tmp_ulong_int; tmp_double = d_TOW_at_current_symbol; - d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); + d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); tmp_ulong_int = current_symbol.Tracking_sample_counter; - d_dump_file.write(reinterpret_cast(&tmp_ulong_int), sizeof(unsigned long int)); + d_dump_file.write(reinterpret_cast(&tmp_ulong_int), sizeof(unsigned long int)); tmp_double = 0; - d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); - } - catch (const std::ifstream::failure & e) - { + d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); + } + catch (const std::ifstream::failure &e) + { LOG(WARNING) << "Exception writing observables dump file " << e.what(); - } + } } // remove used symbols from history - if (d_symbol_history.size()>required_symbols) + if (d_symbol_history.size() > required_symbols) { d_symbol_history.pop_front(); } @@ -418,10 +415,10 @@ int glonass_l1_ca_telemetry_decoder_cc::general_work (int noutput_items __attrib } -void glonass_l1_ca_telemetry_decoder_cc::set_satellite(const Gnss_Satellite & satellite) +void glonass_l1_ca_telemetry_decoder_cc::set_satellite(const Gnss_Satellite &satellite) { d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN()); - DLOG(INFO) << "Setting decoder Finite State Machine to satellite "<< d_satellite; + DLOG(INFO) << "Setting decoder Finite State Machine to satellite " << d_satellite; DLOG(INFO) << "Navigation Satellite set to " << d_satellite; } @@ -436,18 +433,18 @@ void glonass_l1_ca_telemetry_decoder_cc::set_channel(int channel) if (d_dump_file.is_open() == false) { try - { + { d_dump_filename = "telemetry"; d_dump_filename.append(boost::lexical_cast(d_channel)); d_dump_filename.append(".dat"); - d_dump_file.exceptions ( std::ifstream::failbit | std::ifstream::badbit ); + d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); LOG(INFO) << "Telemetry decoder dump enabled on channel " << d_channel << " Log file: " << d_dump_filename.c_str(); - } - catch (const std::ifstream::failure& e) - { + } + catch (const std::ifstream::failure &e) + { LOG(WARNING) << "channel " << d_channel << ": exception opening Glonass TLM dump file. " << e.what(); - } + } } } } diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l1_ca_telemetry_decoder_cc.h b/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l1_ca_telemetry_decoder_cc.h index 5acf0aa22..2fe728dcc 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l1_ca_telemetry_decoder_cc.h +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l1_ca_telemetry_decoder_cc.h @@ -50,7 +50,7 @@ class glonass_l1_ca_telemetry_decoder_cc; typedef boost::shared_ptr glonass_l1_ca_telemetry_decoder_cc_sptr; -glonass_l1_ca_telemetry_decoder_cc_sptr glonass_l1_ca_make_telemetry_decoder_cc(const Gnss_Satellite & satellite, bool dump); +glonass_l1_ca_telemetry_decoder_cc_sptr glonass_l1_ca_make_telemetry_decoder_cc(const Gnss_Satellite &satellite, bool dump); /*! * \brief This class implements a block that decodes the GNAV data defined in GLONASS ICD v5.1 @@ -61,20 +61,20 @@ glonass_l1_ca_telemetry_decoder_cc_sptr glonass_l1_ca_make_telemetry_decoder_cc( class glonass_l1_ca_telemetry_decoder_cc : public gr::block { public: - ~glonass_l1_ca_telemetry_decoder_cc(); //!< Class destructor - void set_satellite(const Gnss_Satellite & satellite); //!< Set satellite PRN - void set_channel(int channel); //!< Set receiver's channel + ~glonass_l1_ca_telemetry_decoder_cc(); //!< Class destructor + void set_satellite(const Gnss_Satellite &satellite); //!< Set satellite PRN + void set_channel(int channel); //!< Set receiver's channel /*! * \brief This is where all signal processing takes place */ - int general_work (int noutput_items, gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); + int general_work(int noutput_items, gr_vector_int &ninput_items, + gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); private: friend glonass_l1_ca_telemetry_decoder_cc_sptr - glonass_l1_ca_make_telemetry_decoder_cc(const Gnss_Satellite & satellite, bool dump); - glonass_l1_ca_telemetry_decoder_cc(const Gnss_Satellite & satellite, bool dump); + glonass_l1_ca_make_telemetry_decoder_cc(const Gnss_Satellite &satellite, bool dump); + glonass_l1_ca_telemetry_decoder_cc(const Gnss_Satellite &satellite, bool dump); void decode_string(double *symbols, int frame_length); @@ -91,15 +91,15 @@ private: std::deque d_symbol_history; //!< Variables for internal functionality - long unsigned int d_sample_counter; //!< Sample counter as an index (1,2,3,..etc) indicating number of samples processed - long unsigned int d_preamble_index; //!< Index of sample number where preamble was found - unsigned int d_stat; //!< Status of decoder - bool d_flag_frame_sync; //!< Indicate when a frame sync is achieved - bool d_flag_parity; //!< Flag indicating when parity check was achieved (crc check) - bool d_flag_preamble; //!< Flag indicating when preamble was found - int d_CRC_error_counter; //!< Number of failed CRC operations - bool flag_TOW_set; //!< Indicates when time of week is set - double delta_t; //!< GPS-GLONASS time offset + long unsigned int d_sample_counter; //!< Sample counter as an index (1,2,3,..etc) indicating number of samples processed + long unsigned int d_preamble_index; //!< Index of sample number where preamble was found + unsigned int d_stat; //!< Status of decoder + bool d_flag_frame_sync; //!< Indicate when a frame sync is achieved + bool d_flag_parity; //!< Flag indicating when parity check was achieved (crc check) + bool d_flag_preamble; //!< Flag indicating when preamble was found + int d_CRC_error_counter; //!< Number of failed CRC operations + bool flag_TOW_set; //!< Indicates when time of week is set + double delta_t; //!< GPS-GLONASS time offset //!< Navigation Message variable Glonass_Gnav_Navigation_Message d_nav; diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_cc.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_cc.cc index 92cedda70..0e6b2e347 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_cc.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_cc.cc @@ -37,23 +37,22 @@ #ifndef _rotl -#define _rotl(X,N) ((X << N) ^ (X >> (32-N))) // Used in the parity check algorithm +#define _rotl(X, N) ((X << N) ^ (X >> (32 - N))) // Used in the parity check algorithm #endif using google::LogMessage; gps_l1_ca_telemetry_decoder_cc_sptr -gps_l1_ca_make_telemetry_decoder_cc(const Gnss_Satellite & satellite, bool dump) +gps_l1_ca_make_telemetry_decoder_cc(const Gnss_Satellite &satellite, bool dump) { return gps_l1_ca_telemetry_decoder_cc_sptr(new gps_l1_ca_telemetry_decoder_cc(satellite, dump)); } gps_l1_ca_telemetry_decoder_cc::gps_l1_ca_telemetry_decoder_cc( - const Gnss_Satellite & satellite, - bool dump) : - gr::block("gps_navigation_cc", gr::io_signature::make(1, 1, sizeof(Gnss_Synchro)), - gr::io_signature::make(1, 1, sizeof(Gnss_Synchro))) + const Gnss_Satellite &satellite, + bool dump) : gr::block("gps_navigation_cc", gr::io_signature::make(1, 1, sizeof(Gnss_Synchro)), + gr::io_signature::make(1, 1, sizeof(Gnss_Synchro))) { // Telemetry Bit transition synchronization port out this->message_port_register_out(pmt::mp("preamble_timestamp_s")); @@ -69,7 +68,7 @@ gps_l1_ca_telemetry_decoder_cc::gps_l1_ca_telemetry_decoder_cc( //memcpy((unsigned short int*)this->d_preambles_bits, (unsigned short int*)preambles_bits, GPS_CA_PREAMBLE_LENGTH_BITS*sizeof(unsigned short int)); // preamble bits to sampled symbols - d_preambles_symbols = static_cast(malloc(sizeof(signed int) * GPS_CA_PREAMBLE_LENGTH_SYMBOLS)); + d_preambles_symbols = static_cast(malloc(sizeof(signed int) * GPS_CA_PREAMBLE_LENGTH_SYMBOLS)); int n = 0; for (int i = 0; i < GPS_CA_PREAMBLE_LENGTH_BITS; i++) { @@ -111,16 +110,16 @@ gps_l1_ca_telemetry_decoder_cc::gps_l1_ca_telemetry_decoder_cc( gps_l1_ca_telemetry_decoder_cc::~gps_l1_ca_telemetry_decoder_cc() { delete d_preambles_symbols; - if(d_dump_file.is_open() == true) + if (d_dump_file.is_open() == true) { try - { + { d_dump_file.close(); - } - catch(const std::exception & ex) - { + } + catch (const std::exception &ex) + { LOG(WARNING) << "Exception in destructor closing the dump file " << ex.what(); - } + } } } @@ -133,58 +132,60 @@ bool gps_l1_ca_telemetry_decoder_cc::gps_word_parityCheck(unsigned int gpsword) check algorithm described in IS-GPS-200E. This avoids lengthy shift- and-xor loops. */ d1 = gpsword & 0xFBFFBF00; - d2 = _rotl(gpsword,1) & 0x07FFBF01; - d3 = _rotl(gpsword,2) & 0xFC0F8100; - d4 = _rotl(gpsword,3) & 0xF81FFE02; - d5 = _rotl(gpsword,4) & 0xFC00000E; - d6 = _rotl(gpsword,5) & 0x07F00001; - d7 = _rotl(gpsword,6) & 0x00003000; + d2 = _rotl(gpsword, 1) & 0x07FFBF01; + d3 = _rotl(gpsword, 2) & 0xFC0F8100; + d4 = _rotl(gpsword, 3) & 0xF81FFE02; + d5 = _rotl(gpsword, 4) & 0xFC00000E; + d6 = _rotl(gpsword, 5) & 0x07F00001; + d7 = _rotl(gpsword, 6) & 0x00003000; t = d1 ^ d2 ^ d3 ^ d4 ^ d5 ^ d6 ^ d7; // Now XOR the 5 6-bit fields together to produce the 6-bit final result. - parity = t ^ _rotl(t,6) ^ _rotl(t,12) ^ _rotl(t,18) ^ _rotl(t,24); + parity = t ^ _rotl(t, 6) ^ _rotl(t, 12) ^ _rotl(t, 18) ^ _rotl(t, 24); parity = parity & 0x3F; - if (parity == (gpsword & 0x3F)) return(true); - else return(false); + if (parity == (gpsword & 0x3F)) + return (true); + else + return (false); } -int gps_l1_ca_telemetry_decoder_cc::general_work (int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), - gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) +int gps_l1_ca_telemetry_decoder_cc::general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), + gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { int corr_value = 0; int preamble_diff_ms = 0; - Gnss_Synchro **out = reinterpret_cast(&output_items[0]); // Get the output buffer pointer - const Gnss_Synchro **in = reinterpret_cast(&input_items[0]); // Get the input buffer pointer + Gnss_Synchro **out = reinterpret_cast(&output_items[0]); // Get the output buffer pointer + const Gnss_Synchro **in = reinterpret_cast(&input_items[0]); // Get the input buffer pointer - Gnss_Synchro current_symbol; //structure to save the synchronization information and send the output object to the next block + Gnss_Synchro current_symbol; //structure to save the synchronization information and send the output object to the next block //1. Copy the current tracking output current_symbol = in[0][0]; - d_symbol_history.push_back(current_symbol); //add new symbol to the symbol queue + d_symbol_history.push_back(current_symbol); //add new symbol to the symbol queue consume_each(1); unsigned int required_symbols = GPS_CA_PREAMBLE_LENGTH_SYMBOLS; d_flag_preamble = false; - if (d_symbol_history.size()>required_symbols) - { - //******* preamble correlation ******** - for (unsigned int i = 0; i < GPS_CA_PREAMBLE_LENGTH_SYMBOLS; i++) - { - if (d_symbol_history.at(i).Flag_valid_symbol_output == true) - { - if (d_symbol_history.at(i).Prompt_I < 0) // symbols clipping - { - corr_value -= d_preambles_symbols[i] * d_symbol_history.at(i).correlation_length_ms; - } - else - { - corr_value += d_preambles_symbols[i] * d_symbol_history.at(i).correlation_length_ms; - } - } - if (corr_value >= GPS_CA_PREAMBLE_LENGTH_SYMBOLS) break; - } - } + if (d_symbol_history.size() > required_symbols) + { + //******* preamble correlation ******** + for (unsigned int i = 0; i < GPS_CA_PREAMBLE_LENGTH_SYMBOLS; i++) + { + if (d_symbol_history.at(i).Flag_valid_symbol_output == true) + { + if (d_symbol_history.at(i).Prompt_I < 0) // symbols clipping + { + corr_value -= d_preambles_symbols[i] * d_symbol_history.at(i).correlation_length_ms; + } + else + { + corr_value += d_preambles_symbols[i] * d_symbol_history.at(i).correlation_length_ms; + } + } + if (corr_value >= GPS_CA_PREAMBLE_LENGTH_SYMBOLS) break; + } + } //******* frame sync ****************** if (abs(corr_value) == GPS_CA_PREAMBLE_LENGTH_SYMBOLS) @@ -194,15 +195,15 @@ int gps_l1_ca_telemetry_decoder_cc::general_work (int noutput_items __attribute_ { d_GPS_FSM.Event_gps_word_preamble(); //record the preamble sample stamp - d_preamble_time_samples = d_symbol_history.at(0).Tracking_sample_counter; // record the preamble sample stamp - DLOG(INFO) << "Preamble detection for SAT " << this->d_satellite << "d_symbol_history.at(0).Tracking_sample_counter=" << d_symbol_history.at(0).Tracking_sample_counter; + d_preamble_time_samples = d_symbol_history.at(0).Tracking_sample_counter; // record the preamble sample stamp + DLOG(INFO) << "Preamble detection for SAT " << this->d_satellite << "d_symbol_history.at(0).Tracking_sample_counter=" << d_symbol_history.at(0).Tracking_sample_counter; //sync the symbol to bits integrator d_symbol_accumulator = 0; d_symbol_accumulator_counter = 0; d_frame_bit_index = 0; - d_stat = 1; // enter into frame pre-detection status + d_stat = 1; // enter into frame pre-detection status } - else if (d_stat == 1) //check 6 seconds of preamble separation + else if (d_stat == 1) //check 6 seconds of preamble separation { preamble_diff_ms = round(((static_cast(d_symbol_history.at(0).Tracking_sample_counter) - d_preamble_time_samples) / static_cast(d_symbol_history.at(0).fs)) * 1000.0); if (abs(preamble_diff_ms - GPS_SUBFRAME_MS) < 1) @@ -210,7 +211,7 @@ int gps_l1_ca_telemetry_decoder_cc::general_work (int noutput_items __attribute_ DLOG(INFO) << "Preamble confirmation for SAT " << this->d_satellite; d_GPS_FSM.Event_gps_word_preamble(); d_flag_preamble = true; - d_preamble_time_samples = d_symbol_history.at(0).Tracking_sample_counter; // record the PRN start sample index associated to the preamble + d_preamble_time_samples = d_symbol_history.at(0).Tracking_sample_counter; // record the PRN start sample index associated to the preamble if (!d_flag_frame_sync) { // send asynchronous message to tracking to inform of frame sync and extend correlation time @@ -219,15 +220,15 @@ int gps_l1_ca_telemetry_decoder_cc::general_work (int noutput_items __attribute_ d_flag_frame_sync = true; if (corr_value < 0) { - flag_PLL_180_deg_phase_locked = true; // PLL is locked to opposite phase! - DLOG(INFO) << " PLL in opposite phase for Sat "<< this->d_satellite.get_PRN(); + flag_PLL_180_deg_phase_locked = true; // PLL is locked to opposite phase! + DLOG(INFO) << " PLL in opposite phase for Sat " << this->d_satellite.get_PRN(); } else { flag_PLL_180_deg_phase_locked = false; } - DLOG(INFO) << " Frame sync SAT " << this->d_satellite << " with preamble start at " - << static_cast(d_preamble_time_samples) / static_cast(d_symbol_history.at(0).fs) << " [s]"; + DLOG(INFO) << " Frame sync SAT " << this->d_satellite << " with preamble start at " + << static_cast(d_preamble_time_samples) / static_cast(d_symbol_history.at(0).fs) << " [s]"; } } } @@ -236,11 +237,11 @@ int gps_l1_ca_telemetry_decoder_cc::general_work (int noutput_items __attribute_ { if (d_stat == 1) { - preamble_diff_ms = round(((static_cast(d_symbol_history.at(0).Tracking_sample_counter) - static_cast(d_preamble_time_samples)) / static_cast(d_symbol_history.at(0).fs)) * 1000.0); + preamble_diff_ms = round(((static_cast(d_symbol_history.at(0).Tracking_sample_counter) - static_cast(d_preamble_time_samples)) / static_cast(d_symbol_history.at(0).fs)) * 1000.0); if (preamble_diff_ms > GPS_SUBFRAME_MS + 1) { DLOG(INFO) << "Lost of frame sync SAT " << this->d_satellite << " preamble_diff= " << preamble_diff_ms; - d_stat = 0; //lost of frame sync + d_stat = 0; //lost of frame sync d_flag_frame_sync = false; flag_TOW_set = false; } @@ -251,97 +252,97 @@ int gps_l1_ca_telemetry_decoder_cc::general_work (int noutput_items __attribute_ if (d_symbol_history.at(0).Flag_valid_symbol_output == true) { // extended correlation to bit period is enabled in tracking! - d_symbol_accumulator += d_symbol_history.at(0).Prompt_I; // accumulate the input value in d_symbol_accumulator + d_symbol_accumulator += d_symbol_history.at(0).Prompt_I; // accumulate the input value in d_symbol_accumulator d_symbol_accumulator_counter += d_symbol_history.at(0).correlation_length_ms; } if (d_symbol_accumulator_counter >= 20) - { - if (d_symbol_accumulator > 0) - { //symbol to bit - d_GPS_frame_4bytes += 1; //insert the telemetry bit in LSB - } - d_symbol_accumulator = 0; - d_symbol_accumulator_counter = 0; - //******* bits to words ****** - d_frame_bit_index++; - if (d_frame_bit_index == 30) - { - d_frame_bit_index = 0; - // parity check - // Each word in wordbuff is composed of: - // Bits 0 to 29 = the GPS data word - // Bits 30 to 31 = 2 LSBs of the GPS word ahead. - // prepare the extended frame [-2 -1 0 ... 30] - if (d_prev_GPS_frame_4bytes & 0x00000001) - { - d_GPS_frame_4bytes = d_GPS_frame_4bytes | 0x40000000; - } - if (d_prev_GPS_frame_4bytes & 0x00000002) - { - d_GPS_frame_4bytes = d_GPS_frame_4bytes | 0x80000000; - } - /* Check that the 2 most recently logged words pass parity. Have to first + { + if (d_symbol_accumulator > 0) + { //symbol to bit + d_GPS_frame_4bytes += 1; //insert the telemetry bit in LSB + } + d_symbol_accumulator = 0; + d_symbol_accumulator_counter = 0; + //******* bits to words ****** + d_frame_bit_index++; + if (d_frame_bit_index == 30) + { + d_frame_bit_index = 0; + // parity check + // Each word in wordbuff is composed of: + // Bits 0 to 29 = the GPS data word + // Bits 30 to 31 = 2 LSBs of the GPS word ahead. + // prepare the extended frame [-2 -1 0 ... 30] + if (d_prev_GPS_frame_4bytes & 0x00000001) + { + d_GPS_frame_4bytes = d_GPS_frame_4bytes | 0x40000000; + } + if (d_prev_GPS_frame_4bytes & 0x00000002) + { + d_GPS_frame_4bytes = d_GPS_frame_4bytes | 0x80000000; + } + /* Check that the 2 most recently logged words pass parity. Have to first invert the data bits according to bit 30 of the previous word. */ - if(d_GPS_frame_4bytes & 0x40000000) - { - d_GPS_frame_4bytes ^= 0x3FFFFFC0; // invert the data bits (using XOR) - } - if (gps_l1_ca_telemetry_decoder_cc::gps_word_parityCheck(d_GPS_frame_4bytes)) - { - memcpy(&d_GPS_FSM.d_GPS_frame_4bytes, &d_GPS_frame_4bytes, sizeof(char)*4); - //d_GPS_FSM.d_preamble_time_ms = d_preamble_time_seconds * 1000.0; - d_GPS_FSM.Event_gps_word_valid(); - // send TLM data to PVT using asynchronous message queues - if (d_GPS_FSM.d_flag_new_subframe == true) - { - switch (d_GPS_FSM.d_subframe_ID) - { - case 3: //we have a new set of ephemeris data for the current SV - if (d_GPS_FSM.d_nav.satellite_validation() == true) - { - // get ephemeris object for this SV (mandatory) - std::shared_ptr tmp_obj = std::make_shared(d_GPS_FSM.d_nav.get_ephemeris()); - this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj)); - } - break; - case 4: // Possible IONOSPHERE and UTC model update (page 18) - if (d_GPS_FSM.d_nav.flag_iono_valid == true) - { - std::shared_ptr tmp_obj = std::make_shared( d_GPS_FSM.d_nav.get_iono()); - this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj)); - } - if (d_GPS_FSM.d_nav.flag_utc_model_valid == true) - { - std::shared_ptr tmp_obj = std::make_shared(d_GPS_FSM.d_nav.get_utc_model()); - this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj)); - } - break; - case 5: - // get almanac (if available) - //TODO: implement almanac reader in navigation_message - break; - default: - break; - } - d_GPS_FSM.clear_flag_new_subframe(); - d_flag_new_tow_available = true; - } + if (d_GPS_frame_4bytes & 0x40000000) + { + d_GPS_frame_4bytes ^= 0x3FFFFFC0; // invert the data bits (using XOR) + } + if (gps_l1_ca_telemetry_decoder_cc::gps_word_parityCheck(d_GPS_frame_4bytes)) + { + memcpy(&d_GPS_FSM.d_GPS_frame_4bytes, &d_GPS_frame_4bytes, sizeof(char) * 4); + //d_GPS_FSM.d_preamble_time_ms = d_preamble_time_seconds * 1000.0; + d_GPS_FSM.Event_gps_word_valid(); + // send TLM data to PVT using asynchronous message queues + if (d_GPS_FSM.d_flag_new_subframe == true) + { + switch (d_GPS_FSM.d_subframe_ID) + { + case 3: //we have a new set of ephemeris data for the current SV + if (d_GPS_FSM.d_nav.satellite_validation() == true) + { + // get ephemeris object for this SV (mandatory) + std::shared_ptr tmp_obj = std::make_shared(d_GPS_FSM.d_nav.get_ephemeris()); + this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj)); + } + break; + case 4: // Possible IONOSPHERE and UTC model update (page 18) + if (d_GPS_FSM.d_nav.flag_iono_valid == true) + { + std::shared_ptr tmp_obj = std::make_shared(d_GPS_FSM.d_nav.get_iono()); + this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj)); + } + if (d_GPS_FSM.d_nav.flag_utc_model_valid == true) + { + std::shared_ptr tmp_obj = std::make_shared(d_GPS_FSM.d_nav.get_utc_model()); + this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj)); + } + break; + case 5: + // get almanac (if available) + //TODO: implement almanac reader in navigation_message + break; + default: + break; + } + d_GPS_FSM.clear_flag_new_subframe(); + d_flag_new_tow_available = true; + } - d_flag_parity = true; - } - else - { - d_GPS_FSM.Event_gps_word_invalid(); - d_flag_parity = false; - } - d_prev_GPS_frame_4bytes = d_GPS_frame_4bytes; // save the actual frame - d_GPS_frame_4bytes = d_GPS_frame_4bytes & 0; - } - else - { - d_GPS_frame_4bytes <<= 1; //shift 1 bit left the telemetry word - } - } + d_flag_parity = true; + } + else + { + d_GPS_FSM.Event_gps_word_invalid(); + d_flag_parity = false; + } + d_prev_GPS_frame_4bytes = d_GPS_frame_4bytes; // save the actual frame + d_GPS_frame_4bytes = d_GPS_frame_4bytes & 0; + } + else + { + d_GPS_frame_4bytes <<= 1; //shift 1 bit left the telemetry word + } + } //2. Add the telemetry decoder information if (this->d_flag_preamble == true and d_flag_new_tow_available == true) @@ -360,80 +361,80 @@ int gps_l1_ca_telemetry_decoder_cc::general_work (int noutput_items __attribute_ d_TOW_at_current_symbol = d_TOW_at_current_symbol + GPS_L1_CA_CODE_PERIOD; } - current_symbol.TOW_at_current_symbol_s = d_TOW_at_current_symbol; - current_symbol.Flag_valid_word = flag_TOW_set; + current_symbol.TOW_at_current_symbol_s = d_TOW_at_current_symbol; + current_symbol.Flag_valid_word = flag_TOW_set; - if (flag_PLL_180_deg_phase_locked == true) - { - //correct the accumulated phase for the Costas loop phase shift, if required - current_symbol.Carrier_phase_rads += GPS_PI; - } + if (flag_PLL_180_deg_phase_locked == true) + { + //correct the accumulated phase for the Costas loop phase shift, if required + current_symbol.Carrier_phase_rads += GPS_PI; + } - if(d_dump == true) - { - // MULTIPLEXED FILE RECORDING - Record results to file - try - { - double tmp_double; - unsigned long int tmp_ulong_int; - tmp_double = d_TOW_at_current_symbol; - d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); - tmp_ulong_int = current_symbol.Tracking_sample_counter; - d_dump_file.write(reinterpret_cast(&tmp_ulong_int), sizeof(unsigned long int)); - tmp_double = d_TOW_at_Preamble; - d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); - } - catch (const std::ifstream::failure & e) - { - LOG(WARNING) << "Exception writing observables dump file " << e.what(); - } - } + if (d_dump == true) + { + // MULTIPLEXED FILE RECORDING - Record results to file + try + { + double tmp_double; + unsigned long int tmp_ulong_int; + tmp_double = d_TOW_at_current_symbol; + d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); + tmp_ulong_int = current_symbol.Tracking_sample_counter; + d_dump_file.write(reinterpret_cast(&tmp_ulong_int), sizeof(unsigned long int)); + tmp_double = d_TOW_at_Preamble; + d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); + } + catch (const std::ifstream::failure &e) + { + LOG(WARNING) << "Exception writing observables dump file " << e.what(); + } + } - // remove used symbols from history - if (d_symbol_history.size() > required_symbols) - { - d_symbol_history.pop_front(); - } - //3. Make the output (copy the object contents to the GNURadio reserved memory) - *out[0] = current_symbol; + // remove used symbols from history + if (d_symbol_history.size() > required_symbols) + { + d_symbol_history.pop_front(); + } + //3. Make the output (copy the object contents to the GNURadio reserved memory) + *out[0] = current_symbol; - return 1; - } + return 1; +} - void gps_l1_ca_telemetry_decoder_cc::set_satellite(const Gnss_Satellite & satellite) - { - d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN()); - DLOG(INFO) << "Setting decoder Finite State Machine to satellite " << d_satellite; - d_GPS_FSM.i_satellite_PRN = d_satellite.get_PRN(); - DLOG(INFO) << "Navigation Satellite set to " << d_satellite; - } +void gps_l1_ca_telemetry_decoder_cc::set_satellite(const Gnss_Satellite &satellite) +{ + d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN()); + DLOG(INFO) << "Setting decoder Finite State Machine to satellite " << d_satellite; + d_GPS_FSM.i_satellite_PRN = d_satellite.get_PRN(); + DLOG(INFO) << "Navigation Satellite set to " << d_satellite; +} - void gps_l1_ca_telemetry_decoder_cc::set_channel(int channel) - { - d_channel = channel; - d_GPS_FSM.i_channel_ID = channel; - DLOG(INFO) << "Navigation channel set to " << channel; - // ############# ENABLE DATA FILE LOG ################# - if (d_dump == true) - { - if (d_dump_file.is_open() == false) - { - try - { - d_dump_filename = "telemetry"; - d_dump_filename.append(boost::lexical_cast(d_channel)); - d_dump_filename.append(".dat"); - d_dump_file.exceptions ( std::ifstream::failbit | std::ifstream::badbit ); - d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); - LOG(INFO) << "Telemetry decoder dump enabled on channel " << d_channel - << " Log file: " << d_dump_filename.c_str(); - } - catch (const std::ifstream::failure &e) - { - LOG(WARNING) << "channel " << d_channel << " Exception opening trk dump file " << e.what(); - } - } - } - } +void gps_l1_ca_telemetry_decoder_cc::set_channel(int channel) +{ + d_channel = channel; + d_GPS_FSM.i_channel_ID = channel; + DLOG(INFO) << "Navigation channel set to " << channel; + // ############# ENABLE DATA FILE LOG ################# + if (d_dump == true) + { + if (d_dump_file.is_open() == false) + { + try + { + d_dump_filename = "telemetry"; + d_dump_filename.append(boost::lexical_cast(d_channel)); + d_dump_filename.append(".dat"); + d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); + d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); + LOG(INFO) << "Telemetry decoder dump enabled on channel " << d_channel + << " Log file: " << d_dump_filename.c_str(); + } + catch (const std::ifstream::failure &e) + { + LOG(WARNING) << "channel " << d_channel << " Exception opening trk dump file " << e.what(); + } + } + } +} diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_cc.h b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_cc.h index 28c006adf..9229b918c 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_cc.h +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_cc.h @@ -45,7 +45,7 @@ class gps_l1_ca_telemetry_decoder_cc; typedef boost::shared_ptr gps_l1_ca_telemetry_decoder_cc_sptr; gps_l1_ca_telemetry_decoder_cc_sptr -gps_l1_ca_make_telemetry_decoder_cc(const Gnss_Satellite & satellite, bool dump); +gps_l1_ca_make_telemetry_decoder_cc(const Gnss_Satellite &satellite, bool dump); /*! * \brief This class implements a block that decodes the NAV data defined in IS-GPS-200E @@ -55,20 +55,20 @@ class gps_l1_ca_telemetry_decoder_cc : public gr::block { public: ~gps_l1_ca_telemetry_decoder_cc(); - void set_satellite(const Gnss_Satellite & satellite); //!< Set satellite PRN - void set_channel(int channel); //!< Set receiver's channel + void set_satellite(const Gnss_Satellite &satellite); //!< Set satellite PRN + void set_channel(int channel); //!< Set receiver's channel /*! * \brief This is where all signal processing takes place */ - int general_work (int noutput_items, gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); + int general_work(int noutput_items, gr_vector_int &ninput_items, + gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); private: friend gps_l1_ca_telemetry_decoder_cc_sptr - gps_l1_ca_make_telemetry_decoder_cc(const Gnss_Satellite & satellite, bool dump); + gps_l1_ca_make_telemetry_decoder_cc(const Gnss_Satellite &satellite, bool dump); - gps_l1_ca_telemetry_decoder_cc(const Gnss_Satellite & satellite, bool dump); + gps_l1_ca_telemetry_decoder_cc(const Gnss_Satellite &satellite, bool dump); bool gps_word_parityCheck(unsigned int gpsword); diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l2c_telemetry_decoder_cc.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l2c_telemetry_decoder_cc.cc index c65db4178..16198b50d 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l2c_telemetry_decoder_cc.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l2c_telemetry_decoder_cc.cc @@ -43,16 +43,16 @@ using google::LogMessage; gps_l2c_telemetry_decoder_cc_sptr -gps_l2c_make_telemetry_decoder_cc(const Gnss_Satellite & satellite, bool dump) +gps_l2c_make_telemetry_decoder_cc(const Gnss_Satellite &satellite, bool dump) { return gps_l2c_telemetry_decoder_cc_sptr(new gps_l2c_telemetry_decoder_cc(satellite, dump)); } gps_l2c_telemetry_decoder_cc::gps_l2c_telemetry_decoder_cc( - const Gnss_Satellite & satellite, bool dump) : gr::block("gps_l2c_telemetry_decoder_cc", - gr::io_signature::make(1, 1, sizeof(Gnss_Synchro)), - gr::io_signature::make(1, 1, sizeof(Gnss_Synchro))) + const Gnss_Satellite &satellite, bool dump) : gr::block("gps_l2c_telemetry_decoder_cc", + gr::io_signature::make(1, 1, sizeof(Gnss_Synchro)), + gr::io_signature::make(1, 1, sizeof(Gnss_Synchro))) { // Telemetry Bit transition synchronization port out this->message_port_register_out(pmt::mp("preamble_timestamp_s")); @@ -67,7 +67,7 @@ gps_l2c_telemetry_decoder_cc::gps_l2c_telemetry_decoder_cc( d_flag_valid_word = false; d_TOW_at_current_symbol = 0; d_TOW_at_Preamble = 0; - d_state = 0; //initial state + d_state = 0; //initial state d_crc_error_count = 0; //initialize the CNAV frame decoder (libswiftcnav) @@ -77,26 +77,26 @@ gps_l2c_telemetry_decoder_cc::gps_l2c_telemetry_decoder_cc( gps_l2c_telemetry_decoder_cc::~gps_l2c_telemetry_decoder_cc() { - if(d_dump_file.is_open() == true) + if (d_dump_file.is_open() == true) { try - { + { d_dump_file.close(); - } - catch(const std::exception & ex) - { + } + catch (const std::exception &ex) + { LOG(WARNING) << "Exception in destructor closing the dump file " << ex.what(); - } + } } } -int gps_l2c_telemetry_decoder_cc::general_work (int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), - gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) +int gps_l2c_telemetry_decoder_cc::general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), + gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { // get pointers on in- and output gnss-synchro objects - Gnss_Synchro *out = reinterpret_cast(output_items[0]); // Get the output buffer pointer - const Gnss_Synchro *in = reinterpret_cast(input_items[0]); // Get the input buffer pointer + Gnss_Synchro *out = reinterpret_cast(output_items[0]); // Get the output buffer pointer + const Gnss_Synchro *in = reinterpret_cast(input_items[0]); // Get the input buffer pointer bool flag_new_cnav_frame = false; cnav_msg_t msg; @@ -106,10 +106,10 @@ int gps_l2c_telemetry_decoder_cc::general_work (int noutput_items __attribute__( u8 symbol_clip = static_cast(in[0].Prompt_I > 0) * 255; flag_new_cnav_frame = cnav_msg_decoder_add_symbol(&d_cnav_decoder, symbol_clip, &msg, &delay); - consume_each(1); //one by one + consume_each(1); //one by one // UPDATE GNSS SYNCHRO DATA - Gnss_Synchro current_synchro_data; //structure to save the synchronization information and send the output object to the next block + Gnss_Synchro current_synchro_data; //structure to save the synchronization information and send the output object to the next block //1. Copy the current tracking output current_synchro_data = in[0]; @@ -120,9 +120,9 @@ int gps_l2c_telemetry_decoder_cc::general_work (int noutput_items __attribute__( { std::bitset raw_bits; //Expand packet bits to bitsets. Notice the reverse order of the bits sequence, required by the CNAV message decoder - for (u32 i = 0; i < GPS_L2_CNAV_DATA_PAGE_BITS ; i++) + for (u32 i = 0; i < GPS_L2_CNAV_DATA_PAGE_BITS; i++) { - raw_bits[GPS_L2_CNAV_DATA_PAGE_BITS - 1 - i] = ((msg.raw_msg[i/8] >> (7 - i%8)) & 1u); + raw_bits[GPS_L2_CNAV_DATA_PAGE_BITS - 1 - i] = ((msg.raw_msg[i / 8] >> (7 - i % 8)) & 1u); } d_CNAV_Message.decode_page(raw_bits); @@ -134,7 +134,6 @@ int gps_l2c_telemetry_decoder_cc::general_work (int noutput_items __attribute__( std::shared_ptr tmp_obj = std::make_shared(d_CNAV_Message.get_ephemeris()); std::cout << "New GPS CNAV message received: ephemeris from satellite " << d_satellite << std::endl; this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj)); - } if (d_CNAV_Message.have_new_iono() == true) { @@ -172,24 +171,24 @@ int gps_l2c_telemetry_decoder_cc::general_work (int noutput_items __attribute__( current_synchro_data.TOW_at_current_symbol_s = d_TOW_at_current_symbol; current_synchro_data.Flag_valid_word = d_flag_valid_word; - if(d_dump == true) + if (d_dump == true) { // MULTIPLEXED FILE RECORDING - Record results to file try - { + { double tmp_double; unsigned long int tmp_ulong_int; tmp_double = d_TOW_at_current_symbol; - d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); + d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); tmp_ulong_int = current_synchro_data.Tracking_sample_counter; - d_dump_file.write(reinterpret_cast(&tmp_ulong_int), sizeof(unsigned long int)); + d_dump_file.write(reinterpret_cast(&tmp_ulong_int), sizeof(unsigned long int)); tmp_double = d_TOW_at_Preamble; - d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); - } - catch (const std::ifstream::failure & e) - { + d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); + } + catch (const std::ifstream::failure &e) + { LOG(WARNING) << "Exception writing Telemetry GPS L2 dump file " << e.what(); - } + } } //3. Make the output (copy the object contents to the GNURadio reserved memory) @@ -198,7 +197,7 @@ int gps_l2c_telemetry_decoder_cc::general_work (int noutput_items __attribute__( } -void gps_l2c_telemetry_decoder_cc::set_satellite(const Gnss_Satellite & satellite) +void gps_l2c_telemetry_decoder_cc::set_satellite(const Gnss_Satellite &satellite) { d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN()); DLOG(INFO) << "GPS L2C CNAV telemetry decoder in channel " << this->d_channel << " set to satellite " << d_satellite; @@ -215,19 +214,19 @@ void gps_l2c_telemetry_decoder_cc::set_channel(int channel) if (d_dump_file.is_open() == false) { try - { + { d_dump_filename = "telemetry_L2CM_"; d_dump_filename.append(boost::lexical_cast(d_channel)); d_dump_filename.append(".dat"); - d_dump_file.exceptions ( std::ifstream::failbit | std::ifstream::badbit ); + d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); LOG(INFO) << "Telemetry decoder dump enabled on channel " << d_channel << " Log file: " << d_dump_filename.c_str(); - } + } catch (const std::ifstream::failure &e) - { + { LOG(WARNING) << "channel " << d_channel << " Exception opening Telemetry GPS L2 dump file " << e.what(); - } + } } } } diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l2c_telemetry_decoder_cc.h b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l2c_telemetry_decoder_cc.h index d5613fd73..b9c050539 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l2c_telemetry_decoder_cc.h +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l2c_telemetry_decoder_cc.h @@ -37,18 +37,19 @@ #include "gps_cnav_ephemeris.h" #include "gps_cnav_iono.h" #include -#include // for copy +#include // for copy #include #include #include -#include // for pair +#include // for pair #include -extern "C" { - #include "cnav_msg.h" - #include "edc.h" - #include "bits.h" +extern "C" +{ +#include "cnav_msg.h" +#include "edc.h" +#include "bits.h" } #include "GPS_L2C.h" @@ -58,7 +59,7 @@ class gps_l2c_telemetry_decoder_cc; typedef boost::shared_ptr gps_l2c_telemetry_decoder_cc_sptr; gps_l2c_telemetry_decoder_cc_sptr -gps_l2c_make_telemetry_decoder_cc(const Gnss_Satellite & satellite, bool dump); +gps_l2c_make_telemetry_decoder_cc(const Gnss_Satellite &satellite, bool dump); /*! * \brief This class implements a block that decodes the SBAS integrity and corrections data defined in RTCA MOPS DO-229 @@ -68,20 +69,20 @@ class gps_l2c_telemetry_decoder_cc : public gr::block { public: ~gps_l2c_telemetry_decoder_cc(); - void set_satellite(const Gnss_Satellite & satellite); //!< Set satellite PRN - void set_channel(int channel); //!< Set receiver's channel + void set_satellite(const Gnss_Satellite &satellite); //!< Set satellite PRN + void set_channel(int channel); //!< Set receiver's channel /*! * \brief This is where all signal processing takes place */ - int general_work (int noutput_items, gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); + int general_work(int noutput_items, gr_vector_int &ninput_items, + gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); private: friend gps_l2c_telemetry_decoder_cc_sptr - gps_l2c_make_telemetry_decoder_cc(const Gnss_Satellite & satellite, bool dump); - gps_l2c_telemetry_decoder_cc(const Gnss_Satellite & satellite, bool dump); + gps_l2c_make_telemetry_decoder_cc(const Gnss_Satellite &satellite, bool dump); + gps_l2c_telemetry_decoder_cc(const Gnss_Satellite &satellite, bool dump); bool d_dump; Gnss_Satellite d_satellite; diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l5_telemetry_decoder_cc.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l5_telemetry_decoder_cc.cc index 44ebc407b..79b0fdb07 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l5_telemetry_decoder_cc.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l5_telemetry_decoder_cc.cc @@ -45,16 +45,16 @@ using google::LogMessage; gps_l5_telemetry_decoder_cc_sptr -gps_l5_make_telemetry_decoder_cc(const Gnss_Satellite & satellite, bool dump) +gps_l5_make_telemetry_decoder_cc(const Gnss_Satellite &satellite, bool dump) { return gps_l5_telemetry_decoder_cc_sptr(new gps_l5_telemetry_decoder_cc(satellite, dump)); } gps_l5_telemetry_decoder_cc::gps_l5_telemetry_decoder_cc( - const Gnss_Satellite & satellite, bool dump) : gr::block("gps_l5_telemetry_decoder_cc", - gr::io_signature::make(1, 1, sizeof(Gnss_Synchro)), - gr::io_signature::make(1, 1, sizeof(Gnss_Synchro))) + const Gnss_Satellite &satellite, bool dump) : gr::block("gps_l5_telemetry_decoder_cc", + gr::io_signature::make(1, 1, sizeof(Gnss_Synchro)), + gr::io_signature::make(1, 1, sizeof(Gnss_Synchro))) { // Telemetry Bit transition synchronization port out this->message_port_register_out(pmt::mp("preamble_timestamp_s")); @@ -70,9 +70,9 @@ gps_l5_telemetry_decoder_cc::gps_l5_telemetry_decoder_cc( d_TOW_at_Preamble = 0.0; //initialize the CNAV frame decoder (libswiftcnav) cnav_msg_decoder_init(&d_cnav_decoder); - for(int aux = 0; aux < GPS_L5_NH_CODE_LENGTH; aux++) + for (int aux = 0; aux < GPS_L5_NH_CODE_LENGTH; aux++) { - if(GPS_L5_NH_CODE[aux] == 0) + if (GPS_L5_NH_CODE[aux] == 0) { bits_NH[aux] = -1.0; } @@ -88,49 +88,61 @@ gps_l5_telemetry_decoder_cc::gps_l5_telemetry_decoder_cc( gps_l5_telemetry_decoder_cc::~gps_l5_telemetry_decoder_cc() { - if(d_dump_file.is_open() == true) + if (d_dump_file.is_open() == true) { try - { + { d_dump_file.close(); - } - catch(const std::exception & ex) - { + } + catch (const std::exception &ex) + { LOG(WARNING) << "Exception in destructor closing the dump file " << ex.what(); - } + } } } -int gps_l5_telemetry_decoder_cc::general_work (int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), - gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) +int gps_l5_telemetry_decoder_cc::general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), + gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { // get pointers on in- and output gnss-synchro objects - Gnss_Synchro *out = reinterpret_cast(output_items[0]); // Get the output buffer pointer - const Gnss_Synchro *in = reinterpret_cast(input_items[0]); // Get the input buffer pointer + Gnss_Synchro *out = reinterpret_cast(output_items[0]); // Get the output buffer pointer + const Gnss_Synchro *in = reinterpret_cast(input_items[0]); // Get the input buffer pointer // UPDATE GNSS SYNCHRO DATA - Gnss_Synchro current_synchro_data; //structure to save the synchronization information and send the output object to the next block + Gnss_Synchro current_synchro_data; //structure to save the synchronization information and send the output object to the next block //1. Copy the current tracking output current_synchro_data = in[0]; - consume_each(1); //one by one + consume_each(1); //one by one sym_hist.push_back(in[0].Prompt_I); int corr_NH = 0; int symbol_value = 0; //Search correlation with Neuman-Hofman Code (see IS-GPS-705D) - if(sym_hist.size() == GPS_L5_NH_CODE_LENGTH) + if (sym_hist.size() == GPS_L5_NH_CODE_LENGTH) { - for(int i = 0; i < GPS_L5_NH_CODE_LENGTH; i++) + for (int i = 0; i < GPS_L5_NH_CODE_LENGTH; i++) { - if((bits_NH[i] * sym_hist.at(i)) > 0.0) {corr_NH += 1;} - else {corr_NH -= 1;} + if ((bits_NH[i] * sym_hist.at(i)) > 0.0) + { + corr_NH += 1; + } + else + { + corr_NH -= 1; + } } - if(abs(corr_NH) == GPS_L5_NH_CODE_LENGTH) + if (abs(corr_NH) == GPS_L5_NH_CODE_LENGTH) { sync_NH = true; - if(corr_NH > 0) {symbol_value = 1;} - else {symbol_value = -1;} + if (corr_NH > 0) + { + symbol_value = 1; + } + else + { + symbol_value = -1; + } new_sym = true; sym_hist.clear(); } @@ -147,7 +159,7 @@ int gps_l5_telemetry_decoder_cc::general_work (int noutput_items __attribute__(( u32 delay = 0; //add the symbol to the decoder - if(new_sym) + if (new_sym) { u8 symbol_clip = static_cast(symbol_value > 0) * 255; flag_new_cnav_frame = cnav_msg_decoder_add_symbol(&d_cnav_decoder, symbol_clip, &msg, &delay); @@ -159,9 +171,9 @@ int gps_l5_telemetry_decoder_cc::general_work (int noutput_items __attribute__(( { std::bitset raw_bits; //Expand packet bits to bitsets. Notice the reverse order of the bits sequence, required by the CNAV message decoder - for (u32 i = 0; i < GPS_L5_CNAV_DATA_PAGE_BITS ; i++) + for (u32 i = 0; i < GPS_L5_CNAV_DATA_PAGE_BITS; i++) { - raw_bits[GPS_L5_CNAV_DATA_PAGE_BITS - 1 - i] = ((msg.raw_msg[i/8] >> (7 - i%8)) & 1u); + raw_bits[GPS_L5_CNAV_DATA_PAGE_BITS - 1 - i] = ((msg.raw_msg[i / 8] >> (7 - i % 8)) & 1u); } d_CNAV_Message.decode_page(raw_bits); @@ -173,7 +185,6 @@ int gps_l5_telemetry_decoder_cc::general_work (int noutput_items __attribute__(( std::shared_ptr tmp_obj = std::make_shared(d_CNAV_Message.get_ephemeris()); std::cout << "New GPS L5 CNAV message received: ephemeris from satellite " << d_satellite << std::endl; this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj)); - } if (d_CNAV_Message.have_new_iono() == true) { @@ -210,24 +221,24 @@ int gps_l5_telemetry_decoder_cc::general_work (int noutput_items __attribute__(( current_synchro_data.TOW_at_current_symbol_s = d_TOW_at_current_symbol; current_synchro_data.Flag_valid_word = d_flag_valid_word; - if(d_dump == true) + if (d_dump == true) { // MULTIPLEXED FILE RECORDING - Record results to file try - { + { double tmp_double; unsigned long int tmp_ulong_int; tmp_double = d_TOW_at_current_symbol; - d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); + d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); tmp_ulong_int = current_synchro_data.Tracking_sample_counter; - d_dump_file.write(reinterpret_cast(&tmp_ulong_int), sizeof(unsigned long int)); + d_dump_file.write(reinterpret_cast(&tmp_ulong_int), sizeof(unsigned long int)); tmp_double = d_TOW_at_Preamble; - d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); - } - catch (const std::ifstream::failure & e) - { + d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); + } + catch (const std::ifstream::failure &e) + { LOG(WARNING) << "Exception writing Telemetry GPS L5 dump file " << e.what(); - } + } } //3. Make the output (copy the object contents to the GNURadio reserved memory) @@ -236,7 +247,7 @@ int gps_l5_telemetry_decoder_cc::general_work (int noutput_items __attribute__(( } -void gps_l5_telemetry_decoder_cc::set_satellite(const Gnss_Satellite & satellite) +void gps_l5_telemetry_decoder_cc::set_satellite(const Gnss_Satellite &satellite) { d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN()); LOG(INFO) << "GPS L5 CNAV telemetry decoder in channel " << this->d_channel << " set to satellite " << d_satellite; @@ -255,19 +266,19 @@ void gps_l5_telemetry_decoder_cc::set_channel(int channel) if (d_dump_file.is_open() == false) { try - { + { d_dump_filename = "telemetry_L5_"; d_dump_filename.append(boost::lexical_cast(d_channel)); d_dump_filename.append(".dat"); - d_dump_file.exceptions ( std::ifstream::failbit | std::ifstream::badbit ); + d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); LOG(INFO) << "Telemetry decoder dump enabled on channel " << d_channel << " Log file: " << d_dump_filename.c_str(); - } + } catch (const std::ifstream::failure &e) - { + { LOG(WARNING) << "channel " << d_channel << " Exception opening Telemetry GPS L5 dump file " << e.what(); - } + } } } } diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l5_telemetry_decoder_cc.h b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l5_telemetry_decoder_cc.h index f3452b78f..c13c2832b 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l5_telemetry_decoder_cc.h +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l5_telemetry_decoder_cc.h @@ -42,10 +42,11 @@ #include #include -extern "C" { - #include "cnav_msg.h" - #include "edc.h" - #include "bits.h" +extern "C" +{ +#include "cnav_msg.h" +#include "edc.h" +#include "bits.h" } #include "GPS_L5.h" @@ -55,7 +56,7 @@ class gps_l5_telemetry_decoder_cc; typedef boost::shared_ptr gps_l5_telemetry_decoder_cc_sptr; gps_l5_telemetry_decoder_cc_sptr -gps_l5_make_telemetry_decoder_cc(const Gnss_Satellite & satellite, bool dump); +gps_l5_make_telemetry_decoder_cc(const Gnss_Satellite &satellite, bool dump); /*! * \brief This class implements a GPS L5 Telemetry decoder @@ -65,16 +66,16 @@ class gps_l5_telemetry_decoder_cc : public gr::block { public: ~gps_l5_telemetry_decoder_cc(); - void set_satellite(const Gnss_Satellite & satellite); //!< Set satellite PRN - void set_channel(int channel); //!< Set receiver's channel - int general_work (int noutput_items, gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); + void set_satellite(const Gnss_Satellite &satellite); //!< Set satellite PRN + void set_channel(int channel); //!< Set receiver's channel + int general_work(int noutput_items, gr_vector_int &ninput_items, + gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); private: friend gps_l5_telemetry_decoder_cc_sptr - gps_l5_make_telemetry_decoder_cc(const Gnss_Satellite & satellite, bool dump); - gps_l5_telemetry_decoder_cc(const Gnss_Satellite & satellite, bool dump); + gps_l5_make_telemetry_decoder_cc(const Gnss_Satellite &satellite, bool dump); + gps_l5_telemetry_decoder_cc(const Gnss_Satellite &satellite, bool dump); bool d_dump; Gnss_Satellite d_satellite; diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/sbas_l1_telemetry_decoder_cc.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/sbas_l1_telemetry_decoder_cc.cc index dab50ea9f..672dbb101 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/sbas_l1_telemetry_decoder_cc.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/sbas_l1_telemetry_decoder_cc.cc @@ -40,26 +40,24 @@ using google::LogMessage; // logging levels -#define EVENT 2 // logs important events which don't occur every block -#define FLOW 3 // logs the function calls of block processing functions -#define SAMP_SYNC 4 // about 1 log entry per sample -> high output -#define LMORE 5 // +#define EVENT 2 // logs important events which don't occur every block +#define FLOW 3 // logs the function calls of block processing functions +#define SAMP_SYNC 4 // about 1 log entry per sample -> high output +#define LMORE 5 // sbas_l1_telemetry_decoder_cc_sptr -sbas_l1_make_telemetry_decoder_cc(const Gnss_Satellite & satellite, bool dump) +sbas_l1_make_telemetry_decoder_cc(const Gnss_Satellite &satellite, bool dump) { return sbas_l1_telemetry_decoder_cc_sptr(new sbas_l1_telemetry_decoder_cc(satellite, dump)); } - sbas_l1_telemetry_decoder_cc::sbas_l1_telemetry_decoder_cc( - const Gnss_Satellite & satellite, - bool dump) : - gr::block("sbas_l1_telemetry_decoder_cc", - gr::io_signature::make(1, 1, sizeof(Gnss_Synchro)), - gr::io_signature::make(1, 1, sizeof(Gnss_Synchro))) + const Gnss_Satellite &satellite, + bool dump) : gr::block("sbas_l1_telemetry_decoder_cc", + gr::io_signature::make(1, 1, sizeof(Gnss_Synchro)), + gr::io_signature::make(1, 1, sizeof(Gnss_Synchro))) { // Telemetry Bit transition synchronization port out this->message_port_register_out(pmt::mp("preamble_timestamp_s")); @@ -71,46 +69,46 @@ sbas_l1_telemetry_decoder_cc::sbas_l1_telemetry_decoder_cc( LOG(INFO) << "SBAS L1 TELEMETRY PROCESSING: satellite " << d_satellite; d_block_size = d_samples_per_symbol * d_symbols_per_bit * d_block_size_in_bits; d_channel = 0; - set_output_multiple (1); + set_output_multiple(1); } - sbas_l1_telemetry_decoder_cc::~sbas_l1_telemetry_decoder_cc() { - if(d_dump_file.is_open() == true) + if (d_dump_file.is_open() == true) { try - { + { d_dump_file.close(); - } - catch(const std::exception & ex) - { + } + catch (const std::exception &ex) + { LOG(WARNING) << "Exception in destructor closing the dump file " << ex.what(); - } + } } } -int sbas_l1_telemetry_decoder_cc::general_work (int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), - gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) +int sbas_l1_telemetry_decoder_cc::general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), + gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { - VLOG(FLOW) << "general_work(): " << "noutput_items=" << noutput_items << "\toutput_items real size=" << output_items.size() << "\tninput_items size=" << ninput_items.size() << "\tinput_items real size=" << input_items.size() << "\tninput_items[0]=" << ninput_items[0]; + VLOG(FLOW) << "general_work(): " + << "noutput_items=" << noutput_items << "\toutput_items real size=" << output_items.size() << "\tninput_items size=" << ninput_items.size() << "\tinput_items real size=" << input_items.size() << "\tninput_items[0]=" << ninput_items[0]; // get pointers on in- and output gnss-synchro objects - Gnss_Synchro *out = reinterpret_cast(output_items[0]); // Get the output buffer pointer - const Gnss_Synchro *in = reinterpret_cast(input_items[0]); // Get the input buffer pointer + Gnss_Synchro *out = reinterpret_cast(output_items[0]); // Get the output buffer pointer + const Gnss_Synchro *in = reinterpret_cast(input_items[0]); // Get the input buffer pointer - Gnss_Synchro current_symbol; //structure to save the synchronization information and send the output object to the next block + Gnss_Synchro current_symbol; //structure to save the synchronization information and send the output object to the next block //1. Copy the current tracking output current_symbol = in[0]; // copy correlation samples into samples vector - d_sample_buf.push_back(current_symbol.Prompt_I); //add new symbol to the symbol queue + d_sample_buf.push_back(current_symbol.Prompt_I); //add new symbol to the symbol queue // store the time stamp of the first sample in the processed sample block double sample_stamp = static_cast(in[0].Tracking_sample_counter) / static_cast(in[0].fs); // decode only if enough samples in buffer - if(d_sample_buf.size() >= d_block_size) + if (d_sample_buf.size() >= d_block_size) { // align correlation samples in pairs // and obtain the symbols by summing the paired correlation samples @@ -135,21 +133,19 @@ int sbas_l1_telemetry_decoder_cc::general_work (int noutput_items __attribute__( // compute message sample stamp // and fill messages in SBAS raw message objects //std::vector sbas_raw_msgs; - for(std::vector::const_iterator it = valid_msgs.cbegin(); - it != valid_msgs.cend(); ++it) + for (std::vector::const_iterator it = valid_msgs.cbegin(); + it != valid_msgs.cend(); ++it) { int message_sample_offset = - (sample_alignment ? 0 : -1) - + d_samples_per_symbol*(symbol_alignment ? -1 : 0) - + d_samples_per_symbol * d_symbols_per_bit * it->first; + (sample_alignment ? 0 : -1) + d_samples_per_symbol * (symbol_alignment ? -1 : 0) + d_samples_per_symbol * d_symbols_per_bit * it->first; double message_sample_stamp = sample_stamp + static_cast(message_sample_offset) / 1000.0; VLOG(EVENT) << "message_sample_stamp=" << message_sample_stamp - << " (sample_stamp=" << sample_stamp - << " sample_alignment=" << sample_alignment - << " symbol_alignment=" << symbol_alignment - << " relative_preamble_start=" << it->first - << " message_sample_offset=" << message_sample_offset - << ")"; + << " (sample_stamp=" << sample_stamp + << " sample_alignment=" << sample_alignment + << " symbol_alignment=" << symbol_alignment + << " relative_preamble_start=" << it->first + << " message_sample_offset=" << message_sample_offset + << ")"; //Sbas_Raw_Msg sbas_raw_msg(message_sample_stamp, this->d_satellite.get_PRN(), it->second); //sbas_raw_msgs.push_back(sbas_raw_msg); } @@ -158,8 +154,8 @@ int sbas_l1_telemetry_decoder_cc::general_work (int noutput_items __attribute__( // and send them to the SBAS raw message queue //for(std::vector::iterator it = sbas_raw_msgs.begin(); it != sbas_raw_msgs.end(); it++) // { - //std::cout << "SBAS message type " << it->get_msg_type() << " from PRN" << it->get_prn() << " received" << std::endl; - //sbas_telemetry_data.update(*it); + //std::cout << "SBAS message type " << it->get_msg_type() << " from PRN" << it->get_prn() << " received" << std::endl; + //sbas_telemetry_data.update(*it); // } // clear all processed samples in the input buffer @@ -168,22 +164,20 @@ int sbas_l1_telemetry_decoder_cc::general_work (int noutput_items __attribute__( // UPDATE GNSS SYNCHRO DATA // actually the SBAS telemetry decoder doesn't support ranging - current_symbol.Flag_valid_word = false; // indicate to observable block that this synchro object isn't valid for pseudorange computation - out[0]=current_symbol; - consume_each(1); // tell scheduler input items consumed - return 1; // tell scheduler output items produced + current_symbol.Flag_valid_word = false; // indicate to observable block that this synchro object isn't valid for pseudorange computation + out[0] = current_symbol; + consume_each(1); // tell scheduler input items consumed + return 1; // tell scheduler output items produced } - -void sbas_l1_telemetry_decoder_cc::set_satellite(const Gnss_Satellite & satellite) +void sbas_l1_telemetry_decoder_cc::set_satellite(const Gnss_Satellite &satellite) { d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN()); LOG(INFO) << "SBAS telemetry decoder in channel " << this->d_channel << " set to satellite " << d_satellite; } - void sbas_l1_telemetry_decoder_cc::set_channel(int channel) { d_channel = channel; @@ -191,8 +185,6 @@ void sbas_l1_telemetry_decoder_cc::set_channel(int channel) } - - // ### helper class for sample alignment ### sbas_l1_telemetry_decoder_cc::sample_aligner::sample_aligner() @@ -204,7 +196,8 @@ sbas_l1_telemetry_decoder_cc::sample_aligner::sample_aligner() sbas_l1_telemetry_decoder_cc::sample_aligner::~sample_aligner() -{} +{ +} void sbas_l1_telemetry_decoder_cc::sample_aligner::reset() @@ -221,52 +214,55 @@ void sbas_l1_telemetry_decoder_cc::sample_aligner::reset() */ bool sbas_l1_telemetry_decoder_cc::sample_aligner::get_symbols(const std::vector samples, std::vector &symbols) { - double smpls[3] = { }; + double smpls[3] = {}; double corr_diff; bool stand_by = true; double sym; - VLOG(FLOW) << "get_symbols(): " << "d_past_sample=" << d_past_sample << "\tsamples size=" << samples.size(); + VLOG(FLOW) << "get_symbols(): " + << "d_past_sample=" << d_past_sample << "\tsamples size=" << samples.size(); - for (unsigned int i_sym = 0; i_sym < samples.size()/sbas_l1_telemetry_decoder_cc::d_samples_per_symbol; i_sym++) + for (unsigned int i_sym = 0; i_sym < samples.size() / sbas_l1_telemetry_decoder_cc::d_samples_per_symbol; i_sym++) { // get the next samples for (int i = 0; i < d_n_smpls_in_history; i++) { - smpls[i] = static_cast(i_sym) * sbas_l1_telemetry_decoder_cc::d_samples_per_symbol + i - 1 == -1 ? d_past_sample : samples[i_sym*sbas_l1_telemetry_decoder_cc::d_samples_per_symbol + i - 1]; + smpls[i] = static_cast(i_sym) * sbas_l1_telemetry_decoder_cc::d_samples_per_symbol + i - 1 == -1 ? d_past_sample : samples[i_sym * sbas_l1_telemetry_decoder_cc::d_samples_per_symbol + i - 1]; } // update the pseudo correlations (IIR method) of the two possible alignments - d_corr_paired = d_iir_par*smpls[1]*smpls[2] + (1 - d_iir_par)*d_corr_paired; - d_corr_shifted = d_iir_par*smpls[0]*smpls[1] + (1 - d_iir_par)*d_corr_shifted; + d_corr_paired = d_iir_par * smpls[1] * smpls[2] + (1 - d_iir_par) * d_corr_paired; + d_corr_shifted = d_iir_par * smpls[0] * smpls[1] + (1 - d_iir_par) * d_corr_shifted; // decide which alignment is the correct one corr_diff = std::abs(d_corr_paired - d_corr_shifted); - stand_by = d_aligned ? corr_diff < d_corr_paired/2 : corr_diff < d_corr_shifted/2; + stand_by = d_aligned ? corr_diff < d_corr_paired / 2 : corr_diff < d_corr_shifted / 2; if (!stand_by) { d_aligned = d_corr_paired >= d_corr_shifted; } // sum the correct pair of samples to a symbol, depending on the current alignment d_align - sym = smpls[0 + int(d_aligned)*2] + smpls[1]; + sym = smpls[0 + int(d_aligned) * 2] + smpls[1]; symbols.push_back(sym); // sample alignment debug output VLOG(SAMP_SYNC) << std::setprecision(5) - << "smplp: " << std::setw(6) << smpls[0] << " " << "smpl0: " << std::setw(6) - << smpls[1] << " " << "smpl1: " << std::setw(6) << smpls[2] << "\t" - //<< "Flag_valid_tracking: " << std::setw(1) << in[0][0].Flag_valid_tracking << " " << std::setw(1) << in[0][0].Flag_valid_tracking << "\t" - << "d_corr_paired: " << std::setw(10) << d_corr_paired << "\t" - << "d_corr_shifted: " << std::setw(10) << d_corr_shifted << "\t" - << "corr_diff: " << std::setw(10) << corr_diff << "\t" - << "stand_by: " << std::setw(1) << stand_by << "\t" - << "d_aligned: " << std::setw(1) << d_aligned << "\t" - << "sym: " << std::setw(10) << sym << "\t"; + << "smplp: " << std::setw(6) << smpls[0] << " " + << "smpl0: " << std::setw(6) + << smpls[1] << " " + << "smpl1: " << std::setw(6) << smpls[2] << "\t" + //<< "Flag_valid_tracking: " << std::setw(1) << in[0][0].Flag_valid_tracking << " " << std::setw(1) << in[0][0].Flag_valid_tracking << "\t" + << "d_corr_paired: " << std::setw(10) << d_corr_paired << "\t" + << "d_corr_shifted: " << std::setw(10) << d_corr_shifted << "\t" + << "corr_diff: " << std::setw(10) << corr_diff << "\t" + << "stand_by: " << std::setw(1) << stand_by << "\t" + << "d_aligned: " << std::setw(1) << d_aligned << "\t" + << "sym: " << std::setw(10) << sym << "\t"; } // save last sample for next block - double temp; + double temp; temp = samples.back(); d_past_sample = (temp); return d_aligned; @@ -306,20 +302,20 @@ void sbas_l1_telemetry_decoder_cc::symbol_aligner_and_decoder::reset() bool sbas_l1_telemetry_decoder_cc::symbol_aligner_and_decoder::get_bits(const std::vector symbols, std::vector &bits) { - const int traceback_depth = 5*d_KK; - int nbits_requested = symbols.size()/d_symbols_per_bit; + const int traceback_depth = 5 * d_KK; + int nbits_requested = symbols.size() / d_symbols_per_bit; int nbits_decoded; // fill two vectors with the two possible symbol alignments - std::vector symbols_vd1(symbols); // aligned symbol vector -> copy input symbol vector - std::vector symbols_vd2; // shifted symbol vector -> add past sample in front of input vector + std::vector symbols_vd1(symbols); // aligned symbol vector -> copy input symbol vector + std::vector symbols_vd2; // shifted symbol vector -> add past sample in front of input vector symbols_vd2.push_back(d_past_symbol); for (std::vector::const_iterator symbol_it = symbols.cbegin(); symbol_it != symbols.cend() - 1; ++symbol_it) { symbols_vd2.push_back(*symbol_it); } // arrays for decoded bits - int * bits_vd1 = new int[nbits_requested]; - int * bits_vd2 = new int[nbits_requested]; + int *bits_vd1 = new int[nbits_requested]; + int *bits_vd2 = new int[nbits_requested]; // decode float metric_vd1 = d_vd1->decode_continuous(symbols_vd1.data(), traceback_depth, bits_vd1, nbits_requested, nbits_decoded); float metric_vd2 = d_vd2->decode_continuous(symbols_vd2.data(), traceback_depth, bits_vd2, nbits_requested, nbits_decoded); @@ -327,11 +323,11 @@ bool sbas_l1_telemetry_decoder_cc::symbol_aligner_and_decoder::get_bits(const st for (int i = 0; i < nbits_decoded; i++) { if (metric_vd1 > metric_vd2) - {// symbols aligned + { // symbols aligned bits.push_back(bits_vd1[i]); } else - {// symbols shifted + { // symbols shifted bits.push_back(bits_vd2[i]); } } @@ -349,14 +345,15 @@ void sbas_l1_telemetry_decoder_cc::frame_detector::reset() } -void sbas_l1_telemetry_decoder_cc::frame_detector::get_frame_candidates(const std::vector bits, std::vector>> &msg_candidates) +void sbas_l1_telemetry_decoder_cc::frame_detector::get_frame_candidates(const std::vector bits, std::vector>> &msg_candidates) { std::stringstream ss; unsigned int sbas_msg_length = 250; - std::vector> preambles = {{0, 1, 0, 1, 0, 0, 1 ,1}, - {1, 0, 0, 1, 1, 0, 1, 0}, - {1, 1, 0, 0, 0, 1, 1, 0}}; - VLOG(FLOW) << "get_frame_candidates(): " << "d_buffer.size()=" << d_buffer.size() << "\tbits.size()=" << bits.size(); + std::vector> preambles = {{0, 1, 0, 1, 0, 0, 1, 1}, + {1, 0, 0, 1, 1, 0, 1, 0}, + {1, 1, 0, 0, 0, 1, 1, 0}}; + VLOG(FLOW) << "get_frame_candidates(): " + << "d_buffer.size()=" << d_buffer.size() << "\tbits.size()=" << bits.size(); ss << "copy bits "; int count = 0; // copy new bits into the working buffer @@ -368,7 +365,7 @@ void sbas_l1_telemetry_decoder_cc::frame_detector::get_frame_candidates(const st } VLOG(SAMP_SYNC) << ss.str() << " into working buffer (" << count << " bits)"; int relative_preamble_start = 0; - while(d_buffer.size() >= sbas_msg_length) + while (d_buffer.size() >= sbas_msg_length) { // compare with all preambles for (std::vector>::iterator preample_it = preambles.begin(); preample_it < preambles.end(); ++preample_it) @@ -378,23 +375,23 @@ void sbas_l1_telemetry_decoder_cc::frame_detector::get_frame_candidates(const st // compare the buffer bits with the preamble bits for (std::vector::iterator preample_bit_it = preample_it->begin(); preample_bit_it < preample_it->end(); ++preample_bit_it) { - preamble_detected = *preample_bit_it == d_buffer[preample_bit_it - preample_it->begin()] ? preamble_detected : false ; - inv_preamble_detected = *preample_bit_it != d_buffer[preample_bit_it - preample_it->begin()] ? inv_preamble_detected : false ; + preamble_detected = *preample_bit_it == d_buffer[preample_bit_it - preample_it->begin()] ? preamble_detected : false; + inv_preamble_detected = *preample_bit_it != d_buffer[preample_bit_it - preample_it->begin()] ? inv_preamble_detected : false; } if (preamble_detected || inv_preamble_detected) { // copy candidate std::vector candidate; std::copy(d_buffer.begin(), d_buffer.begin() + sbas_msg_length, std::back_inserter(candidate)); - if(inv_preamble_detected) + if (inv_preamble_detected) { // invert bits for (std::vector::iterator candidate_bit_it = candidate.begin(); candidate_bit_it != candidate.end(); candidate_bit_it++) *candidate_bit_it = *candidate_bit_it == 0 ? 1 : 0; } - msg_candidates.push_back(std::pair>(relative_preamble_start, candidate)); + msg_candidates.push_back(std::pair>(relative_preamble_start, candidate)); ss.str(""); - ss << "preamble " << preample_it - preambles.begin() << (inv_preamble_detected?" inverted":" normal") << " detected! candidate="; + ss << "preamble " << preample_it - preambles.begin() << (inv_preamble_detected ? " inverted" : " normal") << " detected! candidate="; for (std::vector::iterator bit_it = candidate.begin(); bit_it < candidate.end(); ++bit_it) ss << *bit_it; VLOG(EVENT) << ss.str(); @@ -412,13 +409,13 @@ void sbas_l1_telemetry_decoder_cc::frame_detector::get_frame_candidates(const st void sbas_l1_telemetry_decoder_cc::crc_verifier::reset() { - } void sbas_l1_telemetry_decoder_cc::crc_verifier::get_valid_frames(const std::vector msg_candidates, std::vector &valid_msgs) { std::stringstream ss; - VLOG(FLOW) << "get_valid_frames(): " << "msg_candidates.size()=" << msg_candidates.size(); + VLOG(FLOW) << "get_valid_frames(): " + << "msg_candidates.size()=" << msg_candidates.size(); // for each candidate for (std::vector::const_iterator candidate_it = msg_candidates.cbegin(); candidate_it < msg_candidates.cend(); ++candidate_it) { @@ -452,9 +449,6 @@ void sbas_l1_telemetry_decoder_cc::crc_verifier::get_valid_frames(const std::vec } - - - void sbas_l1_telemetry_decoder_cc::crc_verifier::zerropad_back_and_convert_to_bytes(const std::vector msg_candidate, std::vector &bytes) { std::stringstream ss; @@ -470,24 +464,24 @@ void sbas_l1_telemetry_decoder_cc::crc_verifier::zerropad_back_and_convert_to_by if (idx_bit % bits_per_byte == bits_per_byte - 1) { bytes.push_back(byte); - VLOG(LMORE) << ss.str() << " -> byte=" << std::setw(2) << std::setfill('0') << std::hex << static_cast(byte); ss.str(""); + VLOG(LMORE) << ss.str() << " -> byte=" << std::setw(2) << std::setfill('0') << std::hex << static_cast(byte); + ss.str(""); byte = 0; } } - bytes.push_back(byte); // implies: insert 6 zeros at the end to fit the 250bits into a multiple of bytes + bytes.push_back(byte); // implies: insert 6 zeros at the end to fit the 250bits into a multiple of bytes VLOG(LMORE) << " -> byte=" << std::setw(2) << std::setfill('0') << std::hex << static_cast(byte) << std::setfill(' ') << std::resetiosflags(std::ios::hex); } - void sbas_l1_telemetry_decoder_cc::crc_verifier::zerropad_front_and_convert_to_bytes(const std::vector msg_candidate, std::vector &bytes) { std::stringstream ss; const size_t bits_per_byte = 8; unsigned char byte = 0; - int idx_bit = 6; // insert 6 zeros at the front to fit the 250bits into a multiple of bytes + int idx_bit = 6; // insert 6 zeros at the front to fit the 250bits into a multiple of bytes VLOG(LMORE) << "zerropad_front_and_convert_to_bytes():" << byte; for (std::vector::const_iterator candidate_bit_it = msg_candidate.cbegin(); candidate_bit_it < msg_candidate.cend(); ++candidate_bit_it) { @@ -498,7 +492,8 @@ void sbas_l1_telemetry_decoder_cc::crc_verifier::zerropad_front_and_convert_to_b { bytes.push_back(byte); VLOG(LMORE) << ss.str() << " -> byte=" << std::setw(2) - << std::setfill('0') << std::hex << static_cast(byte); ss.str(""); + << std::setfill('0') << std::hex << static_cast(byte); + ss.str(""); byte = 0; } idx_bit++; diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/sbas_l1_telemetry_decoder_cc.h b/src/algorithms/telemetry_decoder/gnuradio_blocks/sbas_l1_telemetry_decoder_cc.h index 8f31cf4e5..58f4aa7bb 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/sbas_l1_telemetry_decoder_cc.h +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/sbas_l1_telemetry_decoder_cc.h @@ -35,11 +35,11 @@ #include "viterbi_decoder.h" #include #include -#include // for copy +#include // for copy #include #include #include -#include // for pair +#include // for pair #include @@ -48,7 +48,7 @@ class sbas_l1_telemetry_decoder_cc; typedef boost::shared_ptr sbas_l1_telemetry_decoder_cc_sptr; sbas_l1_telemetry_decoder_cc_sptr -sbas_l1_make_telemetry_decoder_cc(const Gnss_Satellite & satellite, bool dump); +sbas_l1_make_telemetry_decoder_cc(const Gnss_Satellite &satellite, bool dump); /*! * \brief This class implements a block that decodes the SBAS integrity and corrections data defined in RTCA MOPS DO-229 @@ -58,19 +58,19 @@ class sbas_l1_telemetry_decoder_cc : public gr::block { public: ~sbas_l1_telemetry_decoder_cc(); - void set_satellite(const Gnss_Satellite & satellite); //!< Set satellite PRN - void set_channel(int channel); //!< Set receiver's channel + void set_satellite(const Gnss_Satellite &satellite); //!< Set satellite PRN + void set_channel(int channel); //!< Set receiver's channel /*! * \brief This is where all signal processing takes place */ - int general_work (int noutput_items, gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); + int general_work(int noutput_items, gr_vector_int &ninput_items, + gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); private: friend sbas_l1_telemetry_decoder_cc_sptr - sbas_l1_make_telemetry_decoder_cc(const Gnss_Satellite & satellite, bool dump); - sbas_l1_telemetry_decoder_cc(const Gnss_Satellite & satellite, bool dump); + sbas_l1_make_telemetry_decoder_cc(const Gnss_Satellite &satellite, bool dump); + sbas_l1_telemetry_decoder_cc(const Gnss_Satellite &satellite, bool dump); void viterbi_decoder(double *page_part_symbols, int *page_part_bits); void align_samples(); @@ -86,11 +86,11 @@ private: std::string d_dump_filename; std::ofstream d_dump_file; - size_t d_block_size; //!< number of samples which are processed during one invocation of the algorithms - std::vector d_sample_buf; //!< input buffer holding the samples to be processed in one block + size_t d_block_size; //!< number of samples which are processed during one invocation of the algorithms + std::vector d_sample_buf; //!< input buffer holding the samples to be processed in one block - typedef std::pair> msg_candiate_int_t; - typedef std::pair> msg_candiate_char_t; + typedef std::pair> msg_candiate_int_t; + typedef std::pair> msg_candiate_char_t; // helper class for sample alignment class sample_aligner @@ -103,9 +103,10 @@ private: * samples length must be a multiple of two * for block operation */ - bool get_symbols(const std::vector samples, std::vector &symbols); + bool get_symbols(const std::vector samples, std::vector &symbols); + private: - int d_n_smpls_in_history ; + int d_n_smpls_in_history; double d_iir_par; double d_corr_paired; double d_corr_shifted; @@ -121,10 +122,11 @@ private: ~symbol_aligner_and_decoder(); void reset(); bool get_bits(const std::vector symbols, std::vector &bits); + private: int d_KK; - Viterbi_Decoder * d_vd1; - Viterbi_Decoder * d_vd2; + Viterbi_Decoder *d_vd1; + Viterbi_Decoder *d_vd2; double d_past_symbol; } d_symbol_aligner_and_decoder; @@ -135,6 +137,7 @@ private: public: void reset(); void get_frame_candidates(const std::vector bits, std::vector>> &msg_candidates); + private: std::deque d_buffer; } d_frame_detector; @@ -146,13 +149,13 @@ private: public: void reset(); void get_valid_frames(const std::vector msg_candidates, std::vector &valid_msgs); + private: typedef boost::crc_optimal<24, 0x1864CFBu, 0x0, 0x0, false, false> crc_24_q_type; crc_24_q_type d_checksum_agent; void zerropad_front_and_convert_to_bytes(const std::vector msg_candidate, std::vector &bytes); void zerropad_back_and_convert_to_bytes(const std::vector msg_candidate, std::vector &bytes); } d_crc_verifier; - }; #endif diff --git a/src/algorithms/telemetry_decoder/libs/convolutional.h b/src/algorithms/telemetry_decoder/libs/convolutional.h index 936c45985..4195154df 100644 --- a/src/algorithms/telemetry_decoder/libs/convolutional.h +++ b/src/algorithms/telemetry_decoder/libs/convolutional.h @@ -1,295 +1,295 @@ -/*! - * \file convolutional.h - * \brief General functions used to implement convolutional encoding. - * \author Matthew C. Valenti - * - * ------------------------------------------------------------------------- - * - * Copyright (C) 2006-2008 Matthew C. Valenti - * - * GNSS-SDR is a software defined Global Navigation - * Satellite Systems receiver - * - * This file is part of GNSS-SDR. - * - * GNSS-SDR is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This file is a derived work of the original file, which had this note: - * - * Last updated on May 22, 2008 - * - * The functions in this file are part of the Iterative Solutions - * Coded Modulation Library. The Iterative Solutions Coded Modulation - * Library is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published - * by the Free Software Foundation; either version 2.1 of the License, - * or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef GNSS_SDR_CONVOLUTIONAL_H_ -#define GNSS_SDR_CONVOLUTIONAL_H_ - -#include // for calloc - -/* define constants used throughout the library */ -const float MAXLOG = 1e7; /* Define infinity */ - - -/*! - * \brief Determines if a symbol has odd (1) or even (0) parity - * Output parameters: - * \return (returned int): The symbol's parity = 1 for odd and 0 for even - * - * \param[in] symbol The integer-valued symbol - * \param[in] length The highest bit position in the symbol - * - * This function is used by nsc_enc_bit(), rsc_enc_bit(), and rsc_tail() - */ -inline static int parity_counter(int symbol, int length) -{ - int counter; - int temp_parity = 0; - - for (counter = 0; counter < length; counter++) - { - temp_parity = temp_parity^(symbol & 1); - symbol = symbol >> 1; - } - return(temp_parity); -} - - -/*! - * \brief Convolutionally encodes a single bit using a rate 1/n encoder. - * Takes in one input bit at a time, and produces a n-bit output. - * - * \param[in] input The input data bit (i.e. a 0 or 1). - * \param[in] state_in The starting state of the encoder (an int from 0 to 2^m-1). - * \param[in] g[] An n-element vector containing the code generators in binary form. - * \param[in] KK The constraint length of the convolutional code. - * \param[out] output_p[] An n-element vector containing the encoded bits. - * \param[out] state_out_p[] An integer containing the final state of the encoder - * (i.e. the state after encoding this bit) - * - * This function is used by nsc_transit() - */ -inline static int nsc_enc_bit(int state_out_p[], - int input, - int state_in, - int g[], - int KK, - int nn) -{ - /* declare variables */ - int state, i; - int out_ = 0; - - /* create a word made up of state and new input */ - state = (input << (KK - 1))^state_in; - - /* AND the word with the generators */ - for (i = 0; i < nn; i++) - { - /* update output symbol */ - out_ = (out_ << 1) + parity_counter(state & g[i], KK); - } - - /* shift the state to make the new state */ - state_out_p[0] = state >> 1; - return(out_); -} - - -/*! - * \brief Function that creates the transit and output vectors - */ -inline static void nsc_transit(int output_p[], - int trans_p[], - int input, - int g[], - int KK, - int nn) -{ - int nextstate[1]; - int state, states; - states = (1 << (KK - 1)); /* The number of states: 2^mm */ - - /* Determine the output and next state for each possible starting state */ - for(state = 0; state < states; state++) - { - output_p[state] = nsc_enc_bit(nextstate, input, state, g, KK, nn); - trans_p[state] = nextstate[0]; - } - return; -} - - -/*! - * \brief Computes the branch metric used for decoding. - * \return (returned float) The metric between the hypothetical symbol and the received vector - * \param[in] rec_array The received vector, of length nn - * \param[in] symbol The hypothetical symbol - * \param[in] nn The length of the received vector - * - */ -inline static float Gamma(float rec_array[], - int symbol, - int nn) -{ - float rm = 0; - int i; - int mask = 1; - - for (i = 0; i < nn; i++) - { - if (symbol & mask) - rm += rec_array[nn - i - 1]; - mask = mask << 1; - } - return(rm); -} - - -/*! - * \brief Uses the Viterbi algorithm to perform hard-decision decoding of a convolutional code. - * \param[in] out0[] The output bits for each state if input is a 0. - * \param[in] state0[] The next state if input is a 0. - * \param[in] out1[] The output bits for each state if input is a 1. - * \param[in] state1[] The next state if input is a 1. - * \param[in] r[] The received signal in LLR-form. For BPSK, must be in form r = 2*a*y/(sigma^2). - * \param[in] KK The constraint length of the convolutional code. - * \param[in] LL The number of data bits. - * \param[out] output_u_int[] Hard decisions on the data bits - * - */ -inline static void Viterbi(int output_u_int[], - int out0[], - int state0[], - int out1[], - int state1[], - double input_c[], - int KK, - int nn, - int LL) -{ - int i, t, state, mm, states; - int number_symbols; - float metric; - float *prev_section, *next_section; - int *prev_bit; - int *prev_state; - float *metric_c; /* Set of all possible branch metrics */ - float *rec_array; /* Received values for one trellis section */ - float max_val; - - /* some derived constants */ - mm = KK - 1; - states = 1 << mm; /* 2^mm */ - number_symbols = 1 << nn; /* 2^nn */ - - /* dynamically allocate memory */ - prev_section = static_cast(calloc( states, sizeof(float) )); - next_section = static_cast(calloc( states, sizeof(float) )); - prev_bit = static_cast(calloc( states*(LL + mm), sizeof(int) )); - prev_state = static_cast(calloc( states*(LL + mm), sizeof(int) )); - rec_array = static_cast(calloc( nn, sizeof(float) )); - metric_c = static_cast(calloc( number_symbols, sizeof(float) )); - - /* initialize trellis */ - for (state = 0; state < states; state++) - { - prev_section[state] = -MAXLOG; - next_section[state] = -MAXLOG; - } - prev_section[0] = 0; /* start in all-zeros state */ - - /* go through trellis */ - for (t = 0; t < LL + mm; t++) - { - for (i = 0; i < nn; i++) - rec_array[i] = static_cast(input_c[nn*t + i]); - - /* precompute all possible branch metrics */ - for (i = 0; i < number_symbols; i++) - metric_c[i] = Gamma( rec_array, i, nn ); - - /* step through all states */ - for (state = 0; state < states; state++) - { - /* hypothesis: info bit is a zero */ - metric = prev_section[state] + metric_c[ out0[ state ] ]; - - /* store new metric if more than metric in storage */ - if ( metric > next_section[state0[state]] ) - { - next_section[state0[state]] = metric; - prev_state[t*states + state0[state]] = state; - prev_bit[t*states + state0[state]] = 0; - } - - /* hypothesis: info bit is a one */ - metric = prev_section[state] + metric_c[ out1[ state ] ]; - - /* store new metric if more than metric in storage */ - if ( metric > next_section[state1[state]] ) - { - next_section[state1[state]] = metric; - prev_state[t*states + state1[state]] = state; - prev_bit[t*states + state1[state]] = 1; - } - } - - /* normalize */ - max_val = 0; - for (state = 0; state < states; state++) - { - if (next_section[state] > max_val) - { - max_val = next_section[state]; - } - } - for (state = 0; state < states; state++) - { - prev_section[state] = next_section[state] - max_val; - next_section[state] = -MAXLOG; - } - } - - /* trace-back operation */ - state = 0; - - /* tail, no need to output */ - for (t = LL + mm - 1; t >= LL; t--) - { - state = prev_state[t*states + state]; - } - - for (t = LL - 1; t >= 0; t--) - { - output_u_int[t] = prev_bit[t*states + state]; - state = prev_state[t*states + state]; - } - - /* free the dynamically allocated memory */ - free(prev_section); - free(next_section); - free(prev_bit); - free(prev_state); - free(rec_array); - free(metric_c); -} - - -#endif +/*! + * \file convolutional.h + * \brief General functions used to implement convolutional encoding. + * \author Matthew C. Valenti + * + * ------------------------------------------------------------------------- + * + * Copyright (C) 2006-2008 Matthew C. Valenti + * + * GNSS-SDR is a software defined Global Navigation + * Satellite Systems receiver + * + * This file is part of GNSS-SDR. + * + * GNSS-SDR is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This file is a derived work of the original file, which had this note: + * + * Last updated on May 22, 2008 + * + * The functions in this file are part of the Iterative Solutions + * Coded Modulation Library. The Iterative Solutions Coded Modulation + * Library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published + * by the Free Software Foundation; either version 2.1 of the License, + * or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef GNSS_SDR_CONVOLUTIONAL_H_ +#define GNSS_SDR_CONVOLUTIONAL_H_ + +#include // for calloc + +/* define constants used throughout the library */ +const float MAXLOG = 1e7; /* Define infinity */ + + +/*! + * \brief Determines if a symbol has odd (1) or even (0) parity + * Output parameters: + * \return (returned int): The symbol's parity = 1 for odd and 0 for even + * + * \param[in] symbol The integer-valued symbol + * \param[in] length The highest bit position in the symbol + * + * This function is used by nsc_enc_bit(), rsc_enc_bit(), and rsc_tail() + */ +inline static int parity_counter(int symbol, int length) +{ + int counter; + int temp_parity = 0; + + for (counter = 0; counter < length; counter++) + { + temp_parity = temp_parity ^ (symbol & 1); + symbol = symbol >> 1; + } + return (temp_parity); +} + + +/*! + * \brief Convolutionally encodes a single bit using a rate 1/n encoder. + * Takes in one input bit at a time, and produces a n-bit output. + * + * \param[in] input The input data bit (i.e. a 0 or 1). + * \param[in] state_in The starting state of the encoder (an int from 0 to 2^m-1). + * \param[in] g[] An n-element vector containing the code generators in binary form. + * \param[in] KK The constraint length of the convolutional code. + * \param[out] output_p[] An n-element vector containing the encoded bits. + * \param[out] state_out_p[] An integer containing the final state of the encoder + * (i.e. the state after encoding this bit) + * + * This function is used by nsc_transit() + */ +inline static int nsc_enc_bit(int state_out_p[], + int input, + int state_in, + int g[], + int KK, + int nn) +{ + /* declare variables */ + int state, i; + int out_ = 0; + + /* create a word made up of state and new input */ + state = (input << (KK - 1)) ^ state_in; + + /* AND the word with the generators */ + for (i = 0; i < nn; i++) + { + /* update output symbol */ + out_ = (out_ << 1) + parity_counter(state & g[i], KK); + } + + /* shift the state to make the new state */ + state_out_p[0] = state >> 1; + return (out_); +} + + +/*! + * \brief Function that creates the transit and output vectors + */ +inline static void nsc_transit(int output_p[], + int trans_p[], + int input, + int g[], + int KK, + int nn) +{ + int nextstate[1]; + int state, states; + states = (1 << (KK - 1)); /* The number of states: 2^mm */ + + /* Determine the output and next state for each possible starting state */ + for (state = 0; state < states; state++) + { + output_p[state] = nsc_enc_bit(nextstate, input, state, g, KK, nn); + trans_p[state] = nextstate[0]; + } + return; +} + + +/*! + * \brief Computes the branch metric used for decoding. + * \return (returned float) The metric between the hypothetical symbol and the received vector + * \param[in] rec_array The received vector, of length nn + * \param[in] symbol The hypothetical symbol + * \param[in] nn The length of the received vector + * + */ +inline static float Gamma(float rec_array[], + int symbol, + int nn) +{ + float rm = 0; + int i; + int mask = 1; + + for (i = 0; i < nn; i++) + { + if (symbol & mask) + rm += rec_array[nn - i - 1]; + mask = mask << 1; + } + return (rm); +} + + +/*! + * \brief Uses the Viterbi algorithm to perform hard-decision decoding of a convolutional code. + * \param[in] out0[] The output bits for each state if input is a 0. + * \param[in] state0[] The next state if input is a 0. + * \param[in] out1[] The output bits for each state if input is a 1. + * \param[in] state1[] The next state if input is a 1. + * \param[in] r[] The received signal in LLR-form. For BPSK, must be in form r = 2*a*y/(sigma^2). + * \param[in] KK The constraint length of the convolutional code. + * \param[in] LL The number of data bits. + * \param[out] output_u_int[] Hard decisions on the data bits + * + */ +inline static void Viterbi(int output_u_int[], + int out0[], + int state0[], + int out1[], + int state1[], + double input_c[], + int KK, + int nn, + int LL) +{ + int i, t, state, mm, states; + int number_symbols; + float metric; + float *prev_section, *next_section; + int *prev_bit; + int *prev_state; + float *metric_c; /* Set of all possible branch metrics */ + float *rec_array; /* Received values for one trellis section */ + float max_val; + + /* some derived constants */ + mm = KK - 1; + states = 1 << mm; /* 2^mm */ + number_symbols = 1 << nn; /* 2^nn */ + + /* dynamically allocate memory */ + prev_section = static_cast(calloc(states, sizeof(float))); + next_section = static_cast(calloc(states, sizeof(float))); + prev_bit = static_cast(calloc(states * (LL + mm), sizeof(int))); + prev_state = static_cast(calloc(states * (LL + mm), sizeof(int))); + rec_array = static_cast(calloc(nn, sizeof(float))); + metric_c = static_cast(calloc(number_symbols, sizeof(float))); + + /* initialize trellis */ + for (state = 0; state < states; state++) + { + prev_section[state] = -MAXLOG; + next_section[state] = -MAXLOG; + } + prev_section[0] = 0; /* start in all-zeros state */ + + /* go through trellis */ + for (t = 0; t < LL + mm; t++) + { + for (i = 0; i < nn; i++) + rec_array[i] = static_cast(input_c[nn * t + i]); + + /* precompute all possible branch metrics */ + for (i = 0; i < number_symbols; i++) + metric_c[i] = Gamma(rec_array, i, nn); + + /* step through all states */ + for (state = 0; state < states; state++) + { + /* hypothesis: info bit is a zero */ + metric = prev_section[state] + metric_c[out0[state]]; + + /* store new metric if more than metric in storage */ + if (metric > next_section[state0[state]]) + { + next_section[state0[state]] = metric; + prev_state[t * states + state0[state]] = state; + prev_bit[t * states + state0[state]] = 0; + } + + /* hypothesis: info bit is a one */ + metric = prev_section[state] + metric_c[out1[state]]; + + /* store new metric if more than metric in storage */ + if (metric > next_section[state1[state]]) + { + next_section[state1[state]] = metric; + prev_state[t * states + state1[state]] = state; + prev_bit[t * states + state1[state]] = 1; + } + } + + /* normalize */ + max_val = 0; + for (state = 0; state < states; state++) + { + if (next_section[state] > max_val) + { + max_val = next_section[state]; + } + } + for (state = 0; state < states; state++) + { + prev_section[state] = next_section[state] - max_val; + next_section[state] = -MAXLOG; + } + } + + /* trace-back operation */ + state = 0; + + /* tail, no need to output */ + for (t = LL + mm - 1; t >= LL; t--) + { + state = prev_state[t * states + state]; + } + + for (t = LL - 1; t >= 0; t--) + { + output_u_int[t] = prev_bit[t * states + state]; + state = prev_state[t * states + state]; + } + + /* free the dynamically allocated memory */ + free(prev_section); + free(next_section); + free(prev_bit); + free(prev_state); + free(rec_array); + free(metric_c); +} + + +#endif diff --git a/src/algorithms/telemetry_decoder/libs/gps_l1_ca_subframe_fsm.cc b/src/algorithms/telemetry_decoder/libs/gps_l1_ca_subframe_fsm.cc index 5a464f6d3..d4980a532 100644 --- a/src/algorithms/telemetry_decoder/libs/gps_l1_ca_subframe_fsm.cc +++ b/src/algorithms/telemetry_decoder/libs/gps_l1_ca_subframe_fsm.cc @@ -40,199 +40,194 @@ //************ GPS WORD TO SUBFRAME DECODER STATE MACHINE ********** -struct Ev_gps_word_valid : sc::event {}; -struct Ev_gps_word_invalid : sc::event{}; -struct Ev_gps_word_preamble : sc::event{}; +struct Ev_gps_word_valid : sc::event +{ +}; +struct Ev_gps_word_invalid : sc::event +{ +}; +struct Ev_gps_word_preamble : sc::event +{ +}; -struct gps_subframe_fsm_S0: public sc::state +struct gps_subframe_fsm_S0 : public sc::state { public: // sc::transition(event,next_status) - typedef sc::transition< Ev_gps_word_preamble, gps_subframe_fsm_S1 > reactions; - gps_subframe_fsm_S0(my_context ctx): my_base( ctx ) + typedef sc::transition reactions; + gps_subframe_fsm_S0(my_context ctx) : my_base(ctx) { //std::cout<<"Enter S0 "< +struct gps_subframe_fsm_S1 : public sc::state { public: - typedef mpl::list, - sc::transition< Ev_gps_word_valid, gps_subframe_fsm_S2 > > reactions; + typedef mpl::list, + sc::transition > + reactions; - gps_subframe_fsm_S1(my_context ctx): my_base( ctx ) + gps_subframe_fsm_S1(my_context ctx) : my_base(ctx) { //std::cout<<"Enter S1 "< +struct gps_subframe_fsm_S2 : public sc::state { public: - typedef mpl::list, - sc::transition< Ev_gps_word_valid, gps_subframe_fsm_S3 > > reactions; + typedef mpl::list, + sc::transition > + reactions; - gps_subframe_fsm_S2(my_context ctx): my_base( ctx ) + gps_subframe_fsm_S2(my_context ctx) : my_base(ctx) { //std::cout<<"Enter S2 "<().gps_word_to_subframe(0); + context().gps_word_to_subframe(0); } }; - - -struct gps_subframe_fsm_S3: public sc::state +struct gps_subframe_fsm_S3 : public sc::state { public: - typedef mpl::list, - sc::transition< Ev_gps_word_valid, gps_subframe_fsm_S4 > > reactions; + typedef mpl::list, + sc::transition > + reactions; - gps_subframe_fsm_S3(my_context ctx): my_base( ctx ) + gps_subframe_fsm_S3(my_context ctx) : my_base(ctx) { //std::cout<<"Enter S3 "<().gps_word_to_subframe(1); + context().gps_word_to_subframe(1); } }; - - -struct gps_subframe_fsm_S4: public sc::state +struct gps_subframe_fsm_S4 : public sc::state { public: - typedef mpl::list, - sc::transition< Ev_gps_word_valid, gps_subframe_fsm_S5 > > reactions; + typedef mpl::list, + sc::transition > + reactions; - gps_subframe_fsm_S4(my_context ctx): my_base( ctx ) + gps_subframe_fsm_S4(my_context ctx) : my_base(ctx) { //std::cout<<"Enter S4 "<().gps_word_to_subframe(2); + context().gps_word_to_subframe(2); } }; - - -struct gps_subframe_fsm_S5: public sc::state +struct gps_subframe_fsm_S5 : public sc::state { public: - typedef mpl::list, - sc::transition< Ev_gps_word_valid, gps_subframe_fsm_S6 > > reactions; + typedef mpl::list, + sc::transition > + reactions; - gps_subframe_fsm_S5(my_context ctx): my_base( ctx ) + gps_subframe_fsm_S5(my_context ctx) : my_base(ctx) { //std::cout<<"Enter S5 "<().gps_word_to_subframe(3); + context().gps_word_to_subframe(3); } }; - - - -struct gps_subframe_fsm_S6: public sc::state +struct gps_subframe_fsm_S6 : public sc::state { public: - typedef mpl::list, - sc::transition< Ev_gps_word_valid, gps_subframe_fsm_S7 > > reactions; + typedef mpl::list, + sc::transition > + reactions; - gps_subframe_fsm_S6(my_context ctx): my_base( ctx ) + gps_subframe_fsm_S6(my_context ctx) : my_base(ctx) { //std::cout<<"Enter S6 "<().gps_word_to_subframe(4); + context().gps_word_to_subframe(4); } }; - -struct gps_subframe_fsm_S7: public sc::state +struct gps_subframe_fsm_S7 : public sc::state { public: - typedef mpl::list, - sc::transition< Ev_gps_word_valid, gps_subframe_fsm_S8 > > reactions; + typedef mpl::list, + sc::transition > + reactions; - gps_subframe_fsm_S7(my_context ctx): my_base( ctx ) + gps_subframe_fsm_S7(my_context ctx) : my_base(ctx) { //std::cout<<"Enter S7 "<().gps_word_to_subframe(5); + context().gps_word_to_subframe(5); } }; - -struct gps_subframe_fsm_S8: public sc::state +struct gps_subframe_fsm_S8 : public sc::state { public: - typedef mpl::list, - sc::transition< Ev_gps_word_valid, gps_subframe_fsm_S9 > > reactions; + typedef mpl::list, + sc::transition > + reactions; - gps_subframe_fsm_S8(my_context ctx): my_base( ctx ) + gps_subframe_fsm_S8(my_context ctx) : my_base(ctx) { //std::cout<<"Enter S8 "<().gps_word_to_subframe(6); + context().gps_word_to_subframe(6); } }; - - -struct gps_subframe_fsm_S9: public sc::state +struct gps_subframe_fsm_S9 : public sc::state { public: - typedef mpl::list, - sc::transition< Ev_gps_word_valid, gps_subframe_fsm_S10 > > reactions; + typedef mpl::list, + sc::transition > + reactions; - gps_subframe_fsm_S9(my_context ctx): my_base( ctx ) + gps_subframe_fsm_S9(my_context ctx) : my_base(ctx) { //std::cout<<"Enter S9 "<().gps_word_to_subframe(7); + context().gps_word_to_subframe(7); } }; - -struct gps_subframe_fsm_S10: public sc::state +struct gps_subframe_fsm_S10 : public sc::state { public: - typedef mpl::list, - sc::transition< Ev_gps_word_valid, gps_subframe_fsm_S11 > > reactions; + typedef mpl::list, + sc::transition > + reactions; - gps_subframe_fsm_S10(my_context ctx): my_base( ctx ) + gps_subframe_fsm_S10(my_context ctx) : my_base(ctx) { //std::cout<<"Enter S10 "<().gps_word_to_subframe(8); + context().gps_word_to_subframe(8); } }; - -struct gps_subframe_fsm_S11: public sc::state +struct gps_subframe_fsm_S11 : public sc::state { public: - typedef sc::transition< Ev_gps_word_preamble, gps_subframe_fsm_S1 > reactions; + typedef sc::transition reactions; - gps_subframe_fsm_S11(my_context ctx): my_base( ctx ) + gps_subframe_fsm_S11(my_context ctx) : my_base(ctx) { //std::cout<<"Completed GPS Subframe!"<().gps_word_to_subframe(9); - context< GpsL1CaSubframeFsm >().gps_subframe_to_nav_msg(); //decode the subframe + context().gps_word_to_subframe(9); + context().gps_subframe_to_nav_msg(); //decode the subframe // DECODE SUBFRAME //std::cout<<"Enter S11"<d_subframe); //decode the subframe + d_subframe_ID = d_nav.subframe_decoder(this->d_subframe); //decode the subframe std::cout << "New GPS NAV message received: subframe " << d_subframe_ID << " from satellite " << Gnss_Satellite(std::string("GPS"), i_satellite_PRN) << std::endl; d_nav.i_satellite_PRN = i_satellite_PRN; d_nav.i_channel_ID = i_channel_ID; - d_flag_new_subframe=true; + d_flag_new_subframe = true; } void GpsL1CaSubframeFsm::Event_gps_word_valid() @@ -275,16 +269,13 @@ void GpsL1CaSubframeFsm::Event_gps_word_valid() } - void GpsL1CaSubframeFsm::Event_gps_word_invalid() { this->process_event(Ev_gps_word_invalid()); } - void GpsL1CaSubframeFsm::Event_gps_word_preamble() { this->process_event(Ev_gps_word_preamble()); } - diff --git a/src/algorithms/telemetry_decoder/libs/gps_l1_ca_subframe_fsm.h b/src/algorithms/telemetry_decoder/libs/gps_l1_ca_subframe_fsm.h index 84a388eda..f2532afcf 100644 --- a/src/algorithms/telemetry_decoder/libs/gps_l1_ca_subframe_fsm.h +++ b/src/algorithms/telemetry_decoder/libs/gps_l1_ca_subframe_fsm.h @@ -61,16 +61,16 @@ struct gps_subframe_fsm_S11; * \brief This class implements a Finite State Machine that handles the decoding * of the GPS L1 C/A NAV message */ -class GpsL1CaSubframeFsm : public sc::state_machine< GpsL1CaSubframeFsm, gps_subframe_fsm_S0 > +class GpsL1CaSubframeFsm : public sc::state_machine { public: - GpsL1CaSubframeFsm(); //!< The constructor starts the Finite State Machine + GpsL1CaSubframeFsm(); //!< The constructor starts the Finite State Machine void clear_flag_new_subframe(); // channel and satellite info int i_channel_ID; //!< Channel id unsigned int i_satellite_PRN; //!< Satellite PRN number - Gps_Navigation_Message d_nav; //!< GPS L1 C/A navigation message object + Gps_Navigation_Message d_nav; //!< GPS L1 C/A navigation message object // GPS SV and System parameters Gps_Ephemeris ephemeris; //!< Object that handles GPS ephemeris parameters @@ -84,7 +84,7 @@ public: char d_GPS_frame_4bytes[GPS_WORD_LENGTH]; //double d_preamble_time_ms; - void gps_word_to_subframe(int position); //!< inserts the word in the correct position of the subframe + void gps_word_to_subframe(int position); //!< inserts the word in the correct position of the subframe /*! * \brief This function decodes a NAv message subframe and pushes the information to the right queues @@ -92,9 +92,9 @@ public: void gps_subframe_to_nav_msg(); //FSM EVENTS - void Event_gps_word_valid(); //!< FSM event: the received word is valid - void Event_gps_word_invalid(); //!< FSM event: the received word is not valid - void Event_gps_word_preamble(); //!< FSM event: word preamble detected + void Event_gps_word_valid(); //!< FSM event: the received word is valid + void Event_gps_word_invalid(); //!< FSM event: the received word is not valid + void Event_gps_word_preamble(); //!< FSM event: word preamble detected }; #endif diff --git a/src/algorithms/telemetry_decoder/libs/libswiftcnav/bits.h b/src/algorithms/telemetry_decoder/libs/libswiftcnav/bits.h index cd7b1c959..bc249c59b 100644 --- a/src/algorithms/telemetry_decoder/libs/libswiftcnav/bits.h +++ b/src/algorithms/telemetry_decoder/libs/libswiftcnav/bits.h @@ -40,7 +40,7 @@ s32 getbits(const u8 *buff, u32 pos, u8 len); void setbitu(u8 *buff, u32 pos, u32 len, u32 data); void setbits(u8 *buff, u32 pos, u32 len, s32 data); void bitcopy(void *dst, u32 dst_index, - const void *src, u32 src_index, u32 count); + const void *src, u32 src_index, u32 count); void bitshl(void *buf, u32 size, u32 shift); u8 count_bits_u64(u64 v, u8 bv); u8 count_bits_u32(u32 v, u8 bv); diff --git a/src/algorithms/telemetry_decoder/libs/libswiftcnav/cnav_msg.h b/src/algorithms/telemetry_decoder/libs/libswiftcnav/cnav_msg.h index 8b8141358..c0846cdd3 100644 --- a/src/algorithms/telemetry_decoder/libs/libswiftcnav/cnav_msg.h +++ b/src/algorithms/telemetry_decoder/libs/libswiftcnav/cnav_msg.h @@ -50,11 +50,11 @@ /** Size of the Viterbi decoder history. */ #define GPS_L2_V27_HISTORY_LENGTH_BITS 64 /** Bits to accumulate before decoding starts. */ -#define GPS_L2C_V27_INIT_BITS (32) +#define GPS_L2C_V27_INIT_BITS (32) /** Bits to decode at a time. */ -#define GPS_L2C_V27_DECODE_BITS (32) +#define GPS_L2C_V27_DECODE_BITS (32) /** Bits in decoder tail. We ignore them. */ -#define GPS_L2C_V27_DELAY_BITS (32) +#define GPS_L2C_V27_DELAY_BITS (32) /** * GPS CNAV message container. * @@ -62,11 +62,11 @@ */ typedef struct { - u8 prn; /**< SV PRN. 0..31 */ - u8 msg_id; /**< Message id. 0..31 */ - u32 tow; /**< GPS ToW in 6-second units. Multiply to 6 to get seconds. */ - bool alert; /**< CNAV message alert flag */ - u8 raw_msg[GPS_L2C_V27_DECODE_BITS + GPS_L2C_V27_DELAY_BITS]; /**< RAW MSG for GNSS-SDR */ + u8 prn; /**< SV PRN. 0..31 */ + u8 msg_id; /**< Message id. 0..31 */ + u32 tow; /**< GPS ToW in 6-second units. Multiply to 6 to get seconds. */ + bool alert; /**< CNAV message alert flag */ + u8 raw_msg[GPS_L2C_V27_DECODE_BITS + GPS_L2C_V27_DELAY_BITS]; /**< RAW MSG for GNSS-SDR */ } cnav_msg_t; /** @@ -75,24 +75,25 @@ typedef struct * * @sa cnav_msg_decoder_t */ -typedef struct { - v27_t dec; /**< Viterbi block decoder object */ +typedef struct +{ + v27_t dec; /**< Viterbi block decoder object */ v27_decision_t decisions[GPS_L2_V27_HISTORY_LENGTH_BITS]; /**< Decision graph */ - unsigned char symbols[(GPS_L2C_V27_INIT_BITS + GPS_L2C_V27_DECODE_BITS) * 2]; + unsigned char symbols[(GPS_L2C_V27_INIT_BITS + GPS_L2C_V27_DECODE_BITS) * 2]; /**< Symbol buffer */ - size_t n_symbols; /**< Count of symbols in the symbol buffer */ - unsigned char decoded[GPS_L2C_V27_DECODE_BITS + GPS_L2C_V27_DELAY_BITS]; + size_t n_symbols; /**< Count of symbols in the symbol buffer */ + unsigned char decoded[GPS_L2C_V27_DECODE_BITS + GPS_L2C_V27_DELAY_BITS]; /**< Decode buffer */ - size_t n_decoded; /**< Number of bits in the decode buffer */ - bool preamble_seen; /**< When true, the decode buffer is aligned on + size_t n_decoded; /**< Number of bits in the decode buffer */ + bool preamble_seen; /**< When true, the decode buffer is aligned on * preamble. */ - bool invert; /**< When true, indicates the bits are inverted */ - bool message_lock; /**< When true, indicates the message boundary + bool invert; /**< When true, indicates the bits are inverted */ + bool message_lock; /**< When true, indicates the message boundary * is found. */ - bool crc_ok; /**< Flag that the last message had good CRC */ - size_t n_crc_fail; /**< Counter for CRC failures */ - bool init; /**< Initial state flag. When true, initial bits + bool crc_ok; /**< Flag that the last message had good CRC */ + size_t n_crc_fail; /**< Counter for CRC failures */ + bool init; /**< Initial state flag. When true, initial bits * do not produce output. */ } cnav_v27_part_t; @@ -111,9 +112,9 @@ typedef struct const v27_poly_t *cnav_msg_decoder_get_poly(void); void cnav_msg_decoder_init(cnav_msg_decoder_t *dec); bool cnav_msg_decoder_add_symbol(cnav_msg_decoder_t *dec, - unsigned char symbol, - cnav_msg_t *msg, - u32 *delay); + unsigned char symbol, + cnav_msg_t *msg, + u32 *delay); /** \} */ /** \} */ diff --git a/src/algorithms/telemetry_decoder/libs/libswiftcnav/fec.h b/src/algorithms/telemetry_decoder/libs/libswiftcnav/fec.h index d5196dcc4..b4caf8767 100644 --- a/src/algorithms/telemetry_decoder/libs/libswiftcnav/fec.h +++ b/src/algorithms/telemetry_decoder/libs/libswiftcnav/fec.h @@ -36,38 +36,41 @@ * The NASA-DSN convention is to use V27POLYA inverted, then V27POLYB * The CCSDS/NASA-GSFC convention is to use V27POLYB, then V27POLYA inverted */ -#define V27POLYA 0x4f -#define V27POLYB 0x6d +#define V27POLYA 0x4f +#define V27POLYB 0x6d -typedef struct { +typedef struct +{ unsigned char c0[32]; unsigned char c1[32]; } v27_poly_t; -typedef struct { +typedef struct +{ unsigned int w[2]; } v27_decision_t; /* State info for instance of r=1/2 k=7 Viterbi decoder */ -typedef struct { - unsigned int metrics1[64]; /* Path metric buffer 1 */ - unsigned int metrics2[64]; /* Path metric buffer 2 */ +typedef struct +{ + unsigned int metrics1[64]; /* Path metric buffer 1 */ + unsigned int metrics2[64]; /* Path metric buffer 2 */ /* Pointers to path metrics, swapped on every bit */ unsigned int *old_metrics, *new_metrics; - const v27_poly_t *poly; /* Polynomial to use */ - v27_decision_t *decisions; /* Beginning of decisions for block */ - unsigned int decisions_index; /* Index of current decision */ - unsigned int decisions_count; /* Number of decisions in history */ + const v27_poly_t *poly; /* Polynomial to use */ + v27_decision_t *decisions; /* Beginning of decisions for block */ + unsigned int decisions_index; /* Index of current decision */ + unsigned int decisions_count; /* Number of decisions in history */ } v27_t; void v27_poly_init(v27_poly_t *poly, const signed char polynomial[2]); void v27_init(v27_t *v, v27_decision_t *decisions, unsigned int decisions_count, - const v27_poly_t *poly, unsigned char initial_state); + const v27_poly_t *poly, unsigned char initial_state); void v27_update(v27_t *v, const unsigned char *syms, int nbits); void v27_chainback_fixed(v27_t *v, unsigned char *data, unsigned int nbits, - unsigned char final_state); + unsigned char final_state); void v27_chainback_likely(v27_t *v, unsigned char *data, unsigned int nbits); #endif diff --git a/src/algorithms/telemetry_decoder/libs/libswiftcnav/swift_common.h b/src/algorithms/telemetry_decoder/libs/libswiftcnav/swift_common.h index abfc25492..7756adc9d 100644 --- a/src/algorithms/telemetry_decoder/libs/libswiftcnav/swift_common.h +++ b/src/algorithms/telemetry_decoder/libs/libswiftcnav/swift_common.h @@ -42,7 +42,7 @@ #define ABS(x) ((x) < 0 ? -(x) : (x)) #define MIN(x, y) (((x) < (y)) ? (x) : (y)) #define MAX(x, y) (((x) > (y)) ? (x) : (y)) -#define CLAMP_DIFF(a,b) (MAX((a),(b)) - (b)) +#define CLAMP_DIFF(a, b) (MAX((a), (b)) - (b)) #include #include @@ -82,4 +82,3 @@ typedef uint64_t u64; /** \} */ #endif /* LIBSWIFTNAV_COMMON_H */ - diff --git a/src/algorithms/telemetry_decoder/libs/viterbi_decoder.cc b/src/algorithms/telemetry_decoder/libs/viterbi_decoder.cc index f7509b1dd..7c4297e9a 100644 --- a/src/algorithms/telemetry_decoder/libs/viterbi_decoder.cc +++ b/src/algorithms/telemetry_decoder/libs/viterbi_decoder.cc @@ -33,23 +33,23 @@ #include // logging -#define EVENT 2 // logs important events which don't occur every block -#define FLOW 3 // logs the function calls of block processing functions -#define BLOCK 4 // once per block -#define SAMPLE 5 // about one log entry per sample -#define LMORE 6 // many entries per sample / very specific stuff +#define EVENT 2 // logs important events which don't occur every block +#define FLOW 3 // logs the function calls of block processing functions +#define BLOCK 4 // once per block +#define SAMPLE 5 // about one log entry per sample +#define LMORE 6 // many entries per sample / very specific stuff -const float MAXLOG = 1e7; /* Define infinity */ +const float MAXLOG = 1e7; /* Define infinity */ Viterbi_Decoder::Viterbi_Decoder(const int g_encoder[], const int KK, const int nn) { - d_nn = nn; // Coding rate 1/n - d_KK = KK; // Constraint Length + d_nn = nn; // Coding rate 1/n + d_KK = KK; // Constraint Length // derived code properties d_mm = d_KK - 1; - d_states = 1 << d_mm; /* 2^mm */ + d_states = 1 << d_mm; /* 2^mm */ d_number_symbols = 1 << d_nn; /* 2^nn */ /* create appropriate transition matrices (trellis) */ @@ -82,15 +82,12 @@ Viterbi_Decoder::~Viterbi_Decoder() } - void Viterbi_Decoder::reset() { init_trellis_state(); } - - /* Function decode_block() Description: Uses the Viterbi algorithm to perform hard-decision decoding of a convolutional code. Input parameters: @@ -113,7 +110,7 @@ float Viterbi_Decoder::decode_block(const double input_c[], int output_u_int[], // tail, no need to output -> traceback, but don't decode state = do_traceback(d_mm); // traceback and decode - decoding_length_mismatch = do_tb_and_decode(d_mm, LL, state, output_u_int, d_indicator_metric); + decoding_length_mismatch = do_tb_and_decode(d_mm, LL, state, output_u_int, d_indicator_metric); VLOG(FLOW) << "decoding length mismatch: " << decoding_length_mismatch; @@ -121,12 +118,11 @@ float Viterbi_Decoder::decode_block(const double input_c[], int output_u_int[], } - float Viterbi_Decoder::decode_continuous(const double sym[], - const int traceback_depth, - int bits[], - const int nbits_requested, - int &nbits_decoded) + const int traceback_depth, + int bits[], + const int nbits_requested, + int& nbits_decoded) { int state; int decoding_length_mismatch; @@ -139,7 +135,7 @@ float Viterbi_Decoder::decode_continuous(const double sym[], // since it depends on the future values -> traceback, but don't decode state = do_traceback(traceback_depth); // traceback and decode - decoding_length_mismatch = do_tb_and_decode(traceback_depth, nbits_requested, state, bits, d_indicator_metric); + decoding_length_mismatch = do_tb_and_decode(traceback_depth, nbits_requested, state, bits, d_indicator_metric); nbits_decoded = nbits_requested + decoding_length_mismatch; VLOG(FLOW) << "decoding length mismatch (continuous decoding): " << decoding_length_mismatch; @@ -148,12 +144,11 @@ float Viterbi_Decoder::decode_continuous(const double sym[], } - void Viterbi_Decoder::init_trellis_state() { int state; // if trellis state has been initialised, free old state memory - if(d_trellis_state_is_initialised) + if (d_trellis_state_is_initialised) { // init trellis state delete[] d_pm_t; @@ -180,14 +175,12 @@ void Viterbi_Decoder::init_trellis_state() } - - int Viterbi_Decoder::do_acs(const double sym[], int nbits) { int t, i, state_at_t; float metric; float max_val; - float * pm_t_next = new float[d_states]; + float* pm_t_next = new float[d_states]; /* t: * - state: state at t @@ -216,7 +209,7 @@ int Viterbi_Decoder::do_acs(const double sym[], int nbits) } // find the survivor branches leading the trellis states at t+1 - Prev next_trellis_states(d_states, t+1); + Prev next_trellis_states(d_states, t + 1); /* step through all states */ for (state_at_t = 0; state_at_t < d_states; state_at_t++) { @@ -225,7 +218,7 @@ int Viterbi_Decoder::do_acs(const double sym[], int nbits) /* hypothesis: info bit is a zero */ int bm_0 = d_metric_c[d_out0[state_at_t]]; - metric = d_pm_t[state_at_t] + bm_0; // path metric + zerobranch metric + metric = d_pm_t[state_at_t] + bm_0; // path metric + zerobranch metric /* store new metric if more than metric in storage */ if (metric > pm_t_next[next_state_if_0]) @@ -238,7 +231,7 @@ int Viterbi_Decoder::do_acs(const double sym[], int nbits) /* hypothesis: info bit is a one */ int bm_1 = d_metric_c[d_out1[state_at_t]]; - metric = d_pm_t[state_at_t] + bm_1; // path metric + onebranch metric + metric = d_pm_t[state_at_t] + bm_1; // path metric + onebranch metric /* store new metric if more than metric in storage */ if (metric > pm_t_next[next_state_if_1]) @@ -276,7 +269,6 @@ int Viterbi_Decoder::do_acs(const double sym[], int nbits) } - int Viterbi_Decoder::do_traceback(size_t traceback_length) { // traceback_length is in bits @@ -290,7 +282,7 @@ int Viterbi_Decoder::do_traceback(size_t traceback_length) traceback_length = d_trellis_paths.size(); } - state = 0; // maybe start not at state 0, but at state with best metric + state = 0; // maybe start not at state 0, but at state with best metric for (it = d_trellis_paths.begin(); it < d_trellis_paths.begin() + traceback_length; ++it) { state = it->get_anchestor_state_of_current_state(state); @@ -299,8 +291,6 @@ int Viterbi_Decoder::do_traceback(size_t traceback_length) } - - int Viterbi_Decoder::do_tb_and_decode(int traceback_length, int requested_decoding_length, int state, int output_u_int[], float& indicator_metric) { int n_of_branches_for_indicator_metric = 500; @@ -318,15 +308,15 @@ int Viterbi_Decoder::do_tb_and_decode(int traceback_length, int requested_decodi VLOG(BLOCK) << "overstep_length=" << overstep_length; for (it = d_trellis_paths.begin() + traceback_length; - it < d_trellis_paths.begin() + traceback_length + overstep_length; ++it) + it < d_trellis_paths.begin() + traceback_length + overstep_length; ++it) { state = it->get_anchestor_state_of_current_state(state); } - t_out = d_trellis_paths.end() - (d_trellis_paths.begin() + traceback_length + overstep_length) - 1;//requested_decoding_length-1; + t_out = d_trellis_paths.end() - (d_trellis_paths.begin() + traceback_length + overstep_length) - 1; //requested_decoding_length-1; indicator_metric = 0; for (it = d_trellis_paths.begin() + traceback_length + overstep_length; it < d_trellis_paths.end(); ++it) { - if(it - (d_trellis_paths.begin() + traceback_length + overstep_length) < n_of_branches_for_indicator_metric) + if (it - (d_trellis_paths.begin() + traceback_length + overstep_length) < n_of_branches_for_indicator_metric) { n_im++; indicator_metric += it->get_metric_of_current_state(state); @@ -336,7 +326,7 @@ int Viterbi_Decoder::do_tb_and_decode(int traceback_length, int requested_decodi state = it->get_anchestor_state_of_current_state(state); t_out--; } - if(n_im > 0) + if (n_im > 0) { indicator_metric /= n_im; } @@ -345,14 +335,12 @@ int Viterbi_Decoder::do_tb_and_decode(int traceback_length, int requested_decodi // remove old states if (d_trellis_paths.begin() + traceback_length + overstep_length <= d_trellis_paths.end()) { - - d_trellis_paths.erase(d_trellis_paths.begin() + traceback_length+overstep_length, d_trellis_paths.end()); + d_trellis_paths.erase(d_trellis_paths.begin() + traceback_length + overstep_length, d_trellis_paths.end()); } return decoding_length_mismatch; } - /* function Gamma() Description: Computes the branch metric used for decoding. @@ -366,8 +354,7 @@ int Viterbi_Decoder::do_tb_and_decode(int traceback_length, int requested_decodi nn The length of the received vector This function is used by siso() */ -float -Viterbi_Decoder::gamma(float rec_array[], int symbol, int nn) +float Viterbi_Decoder::gamma(float rec_array[], int symbol, int nn) { float rm = 0; int i; @@ -388,9 +375,8 @@ Viterbi_Decoder::gamma(float rec_array[], int symbol, int nn) } /* function that creates the transit and output vectors */ -void -Viterbi_Decoder::nsc_transit(int output_p[], int trans_p[], int input, const int g[], - int KK, int nn) +void Viterbi_Decoder::nsc_transit(int output_p[], int trans_p[], int input, const int g[], + int KK, int nn) { int nextstate[1]; int state, states; @@ -425,7 +411,7 @@ Viterbi_Decoder::nsc_transit(int output_p[], int trans_p[], int input, const int 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, - const int g[], int KK, int nn) + const int g[], int KK, int nn) { /* declare variables */ int state, i; @@ -472,7 +458,6 @@ int Viterbi_Decoder::parity_counter(int symbol, int length) } - // prev helper class Viterbi_Decoder::Prev::Prev(int states, int t) { @@ -489,7 +474,6 @@ Viterbi_Decoder::Prev::Prev(int states, int t) } - // copy constructor Viterbi_Decoder::Prev::Prev(const Prev& prev) { @@ -500,30 +484,32 @@ Viterbi_Decoder::Prev::Prev(const Prev& prev) num_states = prev.num_states; bit = prev.bit; metric = prev.metric; - VLOG(LMORE) << "Prev(" << "?" << ", " << t << ")" << " copy, new refcount = " << *refcount; + VLOG(LMORE) << "Prev(" + << "?" + << ", " << t << ")" + << " copy, new refcount = " << *refcount; } - // assignment constructor Viterbi_Decoder::Prev& Viterbi_Decoder::Prev::operator=(const Prev& other) { // check for self-assignment - if(&other == this) + if (&other == this) { return *this; } // handle old resources - if(*refcount == 1) - { // if they are not used anymore -> unallocate them + if (*refcount == 1) + { // if they are not used anymore -> unallocate them delete[] state; delete[] bit; delete[] metric; delete refcount; } else - { // this object is not anymore using them + { // this object is not anymore using them (*refcount)--; } @@ -537,13 +523,14 @@ Viterbi_Decoder::Prev& Viterbi_Decoder::Prev::operator=(const Prev& other) bit = other.bit; metric = other.metric; - VLOG(LMORE) << "Prev(" << "?" << ", " << t << ")" << " assignment, new refcount = " << *refcount; + VLOG(LMORE) << "Prev(" + << "?" + << ", " << t << ")" + << " assignment, new refcount = " << *refcount; return *this; } - - Viterbi_Decoder::Prev::~Prev() { if (*refcount == 1) @@ -557,12 +544,14 @@ Viterbi_Decoder::Prev::~Prev() else { (*refcount)--; - VLOG(LMORE) << "~Prev(" << "?" << ", " << t << ")" << " destructor after copy, new refcount = " << *refcount; + VLOG(LMORE) << "~Prev(" + << "?" + << ", " << t << ")" + << " destructor after copy, new refcount = " << *refcount; } } - int Viterbi_Decoder::Prev::get_anchestor_state_of_current_state(int current_state) { //std::cout << "get prev state: for state " << current_state << " at time " << t << ", the prev state at time " << t-1 << " is " << state[current_state] << std::endl; @@ -579,7 +568,6 @@ int Viterbi_Decoder::Prev::get_anchestor_state_of_current_state(int current_stat } - int Viterbi_Decoder::Prev::get_bit_of_current_state(int current_state) { //std::cout << "get prev bit : for state " << current_state << " at time " << t << ", the send bit is " << bit[current_state] << std::endl; diff --git a/src/algorithms/telemetry_decoder/libs/viterbi_decoder.h b/src/algorithms/telemetry_decoder/libs/viterbi_decoder.h index ca3501fbd..b10040caa 100644 --- a/src/algorithms/telemetry_decoder/libs/viterbi_decoder.h +++ b/src/algorithms/telemetry_decoder/libs/viterbi_decoder.h @@ -32,7 +32,7 @@ #ifndef GNSS_SDR_VITERBI_DECODER_H_ #define GNSS_SDR_VITERBI_DECODER_H_ -#include // for size_t +#include // for size_t #include /*! @@ -56,7 +56,7 @@ public: float decode_block(const double input_c[], int* output_u_int, const int LL); float decode_continuous(const double sym[], const int traceback_depth, int output_u_int[], - const int nbits_requested, int &nbits_decoded); + const int nbits_requested, int& nbits_decoded); private: class Prev @@ -78,10 +78,10 @@ private: private: int t; - int * state; - int * bit; - float * metric; - int * refcount; + int* state; + int* bit; + float* metric; + int* refcount; }; // code properties @@ -100,10 +100,10 @@ private: int* d_state1; // trellis state - float *d_pm_t; + float* d_pm_t; std::deque d_trellis_paths; - float *d_metric_c; /* Set of all possible branch metrics */ - float *d_rec_array; /* Received values for one trellis section */ + float* d_metric_c; /* Set of all possible branch metrics */ + float* d_rec_array; /* Received values for one trellis section */ bool d_trellis_state_is_initialised; // measures diff --git a/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking.cc b/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking.cc old mode 100755 new mode 100644 index 838bd75a8..acae5564a --- a/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking.cc +++ b/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking.cc @@ -44,9 +44,8 @@ using google::LogMessage; GalileoE1DllPllVemlTracking::GalileoE1DllPllVemlTracking( - ConfigurationInterface* configuration, std::string role, - unsigned int in_streams, unsigned int out_streams) : - role_(role), in_streams_(in_streams), out_streams_(out_streams) + ConfigurationInterface* configuration, std::string role, + unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) { DLOG(INFO) << "role " << role; //################# CONFIGURATION PARAMETERS ######################## @@ -72,9 +71,9 @@ GalileoE1DllPllVemlTracking::GalileoE1DllPllVemlTracking( f_if = configuration->property(role + ".if", 0); dump = configuration->property(role + ".dump", false); pll_bw_hz = configuration->property(role + ".pll_bw_hz", 5.0); - if(FLAGS_pll_bw_hz != 0.0) pll_bw_hz = static_cast(FLAGS_pll_bw_hz); + if (FLAGS_pll_bw_hz != 0.0) pll_bw_hz = static_cast(FLAGS_pll_bw_hz); dll_bw_hz = configuration->property(role + ".dll_bw_hz", 0.5); - if(FLAGS_dll_bw_hz != 0.0) dll_bw_hz = static_cast(FLAGS_dll_bw_hz); + if (FLAGS_dll_bw_hz != 0.0) dll_bw_hz = static_cast(FLAGS_dll_bw_hz); pll_bw_narrow_hz = configuration->property(role + ".pll_bw_narrow_hz", 2.0); dll_bw_narrow_hz = configuration->property(role + ".dll_bw_narrow_hz", 0.25); int extend_correlation_symbols; @@ -88,7 +87,7 @@ GalileoE1DllPllVemlTracking::GalileoE1DllPllVemlTracking( std::string default_dump_filename = "./track_ch"; dump_filename = configuration->property(role + ".dump_filename", - default_dump_filename); //unused! + default_dump_filename); //unused! vector_length = std::round(fs_in / (Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS)); //################# MAKE TRACKING GNURadio object ################### @@ -96,21 +95,21 @@ GalileoE1DllPllVemlTracking::GalileoE1DllPllVemlTracking( { item_size_ = sizeof(gr_complex); tracking_ = galileo_e1_dll_pll_veml_make_tracking_cc( - f_if, - fs_in, - vector_length, - dump, - dump_filename, - pll_bw_hz, - dll_bw_hz, - pll_bw_narrow_hz, - dll_bw_narrow_hz, - early_late_space_chips, - very_early_late_space_chips, - early_late_space_narrow_chips, - very_early_late_space_narrow_chips, - extend_correlation_symbols, - track_pilot); + f_if, + fs_in, + vector_length, + dump, + dump_filename, + pll_bw_hz, + dll_bw_hz, + pll_bw_narrow_hz, + dll_bw_narrow_hz, + early_late_space_chips, + very_early_late_space_chips, + early_late_space_narrow_chips, + very_early_late_space_narrow_chips, + extend_correlation_symbols, + track_pilot); } else { @@ -125,7 +124,8 @@ GalileoE1DllPllVemlTracking::GalileoE1DllPllVemlTracking( GalileoE1DllPllVemlTracking::~GalileoE1DllPllVemlTracking() -{} +{ +} void GalileoE1DllPllVemlTracking::start_tracking() @@ -152,14 +152,18 @@ void GalileoE1DllPllVemlTracking::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) void GalileoE1DllPllVemlTracking::connect(gr::top_block_sptr top_block) { - if(top_block) { /* top_block is not null */}; + if (top_block) + { /* top_block is not null */ + }; //nothing to connect, now the tracking uses gr_sync_decimator } void GalileoE1DllPllVemlTracking::disconnect(gr::top_block_sptr top_block) { - if(top_block) { /* top_block is not null */}; + if (top_block) + { /* top_block is not null */ + }; //nothing to disconnect, now the tracking uses gr_sync_decimator } @@ -174,4 +178,3 @@ gr::basic_block_sptr GalileoE1DllPllVemlTracking::get_right_block() { return tracking_; } - diff --git a/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking.h b/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking.h old mode 100755 new mode 100644 index 22c94322f..e702ff14d --- a/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking.h +++ b/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking.h @@ -52,9 +52,9 @@ class GalileoE1DllPllVemlTracking : public TrackingInterface { public: GalileoE1DllPllVemlTracking(ConfigurationInterface* configuration, - std::string role, - unsigned int in_streams, - unsigned int out_streams); + std::string role, + unsigned int in_streams, + unsigned int out_streams); virtual ~GalileoE1DllPllVemlTracking(); @@ -102,4 +102,4 @@ private: unsigned int out_streams_; }; -#endif // GNSS_SDR_GALILEO_E1_DLL_PLL_VEML_TRACKING_H_ +#endif // GNSS_SDR_GALILEO_E1_DLL_PLL_VEML_TRACKING_H_ diff --git a/src/algorithms/tracking/adapters/galileo_e1_tcp_connector_tracking.cc b/src/algorithms/tracking/adapters/galileo_e1_tcp_connector_tracking.cc index 97e933416..6f4535fe2 100644 --- a/src/algorithms/tracking/adapters/galileo_e1_tcp_connector_tracking.cc +++ b/src/algorithms/tracking/adapters/galileo_e1_tcp_connector_tracking.cc @@ -45,9 +45,8 @@ using google::LogMessage; GalileoE1TcpConnectorTracking::GalileoE1TcpConnectorTracking( - ConfigurationInterface* configuration, std::string role, - unsigned int in_streams, unsigned int out_streams) : - role_(role), in_streams_(in_streams), out_streams_(out_streams) + ConfigurationInterface* configuration, std::string role, + unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) { DLOG(INFO) << "role " << role; //################# CONFIGURATION PARAMETERS ######################## @@ -63,20 +62,20 @@ GalileoE1TcpConnectorTracking::GalileoE1TcpConnectorTracking( float early_late_space_chips; float very_early_late_space_chips; size_t port_ch0; - item_type = configuration->property(role + ".item_type",default_item_type); + item_type = configuration->property(role + ".item_type", default_item_type); int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000); fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); f_if = configuration->property(role + ".if", 0); dump = configuration->property(role + ".dump", false); pll_bw_hz = configuration->property(role + ".pll_bw_hz", 50.0); - if(FLAGS_pll_bw_hz != 0.0) pll_bw_hz = static_cast(FLAGS_pll_bw_hz); + if (FLAGS_pll_bw_hz != 0.0) pll_bw_hz = static_cast(FLAGS_pll_bw_hz); dll_bw_hz = configuration->property(role + ".dll_bw_hz", 2.0); - if(FLAGS_dll_bw_hz != 0.0) dll_bw_hz = static_cast(FLAGS_dll_bw_hz); + if (FLAGS_dll_bw_hz != 0.0) dll_bw_hz = static_cast(FLAGS_dll_bw_hz); early_late_space_chips = configuration->property(role + ".early_late_space_chips", 0.15); very_early_late_space_chips = configuration->property(role + ".very_early_late_space_chips", 0.6); port_ch0 = configuration->property(role + ".port_ch0", 2060); std::string default_dump_filename = "./track_ch"; - dump_filename = configuration->property(role + ".dump_filename", default_dump_filename); //unused! + dump_filename = configuration->property(role + ".dump_filename", default_dump_filename); //unused! vector_length = std::round(fs_in / (Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS)); //################# MAKE TRACKING GNURadio object ################### @@ -84,16 +83,16 @@ GalileoE1TcpConnectorTracking::GalileoE1TcpConnectorTracking( { item_size_ = sizeof(gr_complex); tracking_ = galileo_e1_tcp_connector_make_tracking_cc( - f_if, - fs_in, - vector_length, - dump, - dump_filename, - pll_bw_hz, - dll_bw_hz, - early_late_space_chips, - very_early_late_space_chips, - port_ch0); + f_if, + fs_in, + vector_length, + dump, + dump_filename, + pll_bw_hz, + dll_bw_hz, + early_late_space_chips, + very_early_late_space_chips, + port_ch0); } else { @@ -106,7 +105,8 @@ GalileoE1TcpConnectorTracking::GalileoE1TcpConnectorTracking( GalileoE1TcpConnectorTracking::~GalileoE1TcpConnectorTracking() -{} +{ +} void GalileoE1TcpConnectorTracking::start_tracking() @@ -131,13 +131,17 @@ void GalileoE1TcpConnectorTracking::set_gnss_synchro(Gnss_Synchro* p_gnss_synchr void GalileoE1TcpConnectorTracking::connect(gr::top_block_sptr top_block) { - if(top_block) { /* top_block is not null */}; + if (top_block) + { /* top_block is not null */ + }; //nothing to connect, now the tracking uses gr_sync_decimator } void GalileoE1TcpConnectorTracking::disconnect(gr::top_block_sptr top_block) { - if(top_block) { /* top_block is not null */}; + if (top_block) + { /* top_block is not null */ + }; //nothing to disconnect, now the tracking uses gr_sync_decimator } @@ -150,4 +154,3 @@ gr::basic_block_sptr GalileoE1TcpConnectorTracking::get_right_block() { return tracking_; } - diff --git a/src/algorithms/tracking/adapters/galileo_e1_tcp_connector_tracking.h b/src/algorithms/tracking/adapters/galileo_e1_tcp_connector_tracking.h index bba2940cd..3b2e73e1a 100644 --- a/src/algorithms/tracking/adapters/galileo_e1_tcp_connector_tracking.h +++ b/src/algorithms/tracking/adapters/galileo_e1_tcp_connector_tracking.h @@ -53,9 +53,9 @@ class GalileoE1TcpConnectorTracking : public TrackingInterface { public: GalileoE1TcpConnectorTracking(ConfigurationInterface* configuration, - std::string role, - unsigned int in_streams, - unsigned int out_streams); + std::string role, + unsigned int in_streams, + unsigned int out_streams); virtual ~GalileoE1TcpConnectorTracking(); @@ -103,4 +103,4 @@ private: unsigned int out_streams_; }; -#endif // GNSS_SDR_GALILEO_E1_TCP_CONNECTOR_TRACKING_H_ +#endif // GNSS_SDR_GALILEO_E1_TCP_CONNECTOR_TRACKING_H_ diff --git a/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking.cc b/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking.cc index bdafc43a1..87c11f48a 100644 --- a/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking.cc +++ b/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking.cc @@ -45,9 +45,8 @@ using google::LogMessage; GalileoE5aDllPllTracking::GalileoE5aDllPllTracking( - ConfigurationInterface* configuration, std::string role, - unsigned int in_streams, unsigned int out_streams) : - role_(role), in_streams_(in_streams), out_streams_(out_streams) + ConfigurationInterface* configuration, std::string role, + unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) { DLOG(INFO) << "role " << role; //################# CONFIGURATION PARAMETERS ######################## @@ -71,9 +70,9 @@ GalileoE5aDllPllTracking::GalileoE5aDllPllTracking( f_if = configuration->property(role + ".if", 0); dump = configuration->property(role + ".dump", false); pll_bw_hz = configuration->property(role + ".pll_bw_hz", 20.0); - if(FLAGS_pll_bw_hz != 0.0) pll_bw_hz = static_cast(FLAGS_pll_bw_hz); + if (FLAGS_pll_bw_hz != 0.0) pll_bw_hz = static_cast(FLAGS_pll_bw_hz); dll_bw_hz = configuration->property(role + ".dll_bw_hz", 20.0); - if(FLAGS_dll_bw_hz != 0.0) dll_bw_hz = static_cast(FLAGS_dll_bw_hz); + if (FLAGS_dll_bw_hz != 0.0) dll_bw_hz = static_cast(FLAGS_dll_bw_hz); pll_bw_narrow_hz = configuration->property(role + ".pll_bw_narrow_hz", 5.0); dll_bw_narrow_hz = configuration->property(role + ".dll_bw_narrow_hz", 2.0); ti_ms = configuration->property(role + ".ti_ms", 3); @@ -81,7 +80,7 @@ GalileoE5aDllPllTracking::GalileoE5aDllPllTracking( early_late_space_chips = configuration->property(role + ".early_late_space_chips", 0.5); std::string default_dump_filename = "./track_ch"; dump_filename = configuration->property(role + ".dump_filename", - default_dump_filename); //unused! + default_dump_filename); //unused! vector_length = std::round(fs_in / (Galileo_E5a_CODE_CHIP_RATE_HZ / Galileo_E5a_CODE_LENGTH_CHIPS)); //################# MAKE TRACKING GNURadio object ################### @@ -89,17 +88,17 @@ GalileoE5aDllPllTracking::GalileoE5aDllPllTracking( { item_size_ = sizeof(gr_complex); tracking_ = galileo_e5a_dll_pll_make_tracking_cc( - f_if, - fs_in, - vector_length, - dump, - dump_filename, - pll_bw_hz, - dll_bw_hz, - pll_bw_narrow_hz, - dll_bw_narrow_hz, - ti_ms, - early_late_space_chips); + f_if, + fs_in, + vector_length, + dump, + dump_filename, + pll_bw_hz, + dll_bw_hz, + pll_bw_narrow_hz, + dll_bw_narrow_hz, + ti_ms, + early_late_space_chips); } else { @@ -112,7 +111,8 @@ GalileoE5aDllPllTracking::GalileoE5aDllPllTracking( GalileoE5aDllPllTracking::~GalileoE5aDllPllTracking() -{} +{ +} void GalileoE5aDllPllTracking::start_tracking() @@ -137,13 +137,17 @@ void GalileoE5aDllPllTracking::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) void GalileoE5aDllPllTracking::connect(gr::top_block_sptr top_block) { - if(top_block) { /* top_block is not null */}; + if (top_block) + { /* top_block is not null */ + }; //nothing to connect, now the tracking uses gr_sync_decimator } void GalileoE5aDllPllTracking::disconnect(gr::top_block_sptr top_block) { - if(top_block) { /* top_block is not null */}; + if (top_block) + { /* top_block is not null */ + }; //nothing to disconnect, now the tracking uses gr_sync_decimator } @@ -156,5 +160,3 @@ gr::basic_block_sptr GalileoE5aDllPllTracking::get_right_block() { return tracking_; } - - diff --git a/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking.h b/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking.h index bedab2a21..b56cf2945 100644 --- a/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking.h +++ b/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking.h @@ -52,9 +52,9 @@ class GalileoE5aDllPllTracking : public TrackingInterface { public: GalileoE5aDllPllTracking(ConfigurationInterface* configuration, - std::string role, - unsigned int in_streams, - unsigned int out_streams); + std::string role, + unsigned int in_streams, + unsigned int out_streams); virtual ~GalileoE5aDllPllTracking(); diff --git a/src/algorithms/tracking/adapters/glonass_l1_ca_dll_pll_c_aid_tracking.cc b/src/algorithms/tracking/adapters/glonass_l1_ca_dll_pll_c_aid_tracking.cc index 0d5a00433..4bc5e7e34 100644 --- a/src/algorithms/tracking/adapters/glonass_l1_ca_dll_pll_c_aid_tracking.cc +++ b/src/algorithms/tracking/adapters/glonass_l1_ca_dll_pll_c_aid_tracking.cc @@ -47,9 +47,8 @@ using google::LogMessage; GlonassL1CaDllPllCAidTracking::GlonassL1CaDllPllCAidTracking( - ConfigurationInterface* configuration, std::string role, - unsigned int in_streams, unsigned int out_streams) : - role_(role), in_streams_(in_streams), out_streams_(out_streams) + ConfigurationInterface* configuration, std::string role, + unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) { DLOG(INFO) << "role " << role; //################# CONFIGURATION PARAMETERS ######################## @@ -71,9 +70,9 @@ GlonassL1CaDllPllCAidTracking::GlonassL1CaDllPllCAidTracking( f_if = configuration->property(role + ".if", 0); dump = configuration->property(role + ".dump", false); pll_bw_hz = configuration->property(role + ".pll_bw_hz", 50.0); - if(FLAGS_pll_bw_hz != 0.0) pll_bw_hz = static_cast(FLAGS_pll_bw_hz); + if (FLAGS_pll_bw_hz != 0.0) pll_bw_hz = static_cast(FLAGS_pll_bw_hz); dll_bw_hz = configuration->property(role + ".dll_bw_hz", 2.0); - if(FLAGS_dll_bw_hz != 0.0) dll_bw_hz = static_cast(FLAGS_dll_bw_hz); + if (FLAGS_dll_bw_hz != 0.0) dll_bw_hz = static_cast(FLAGS_dll_bw_hz); pll_bw_narrow_hz = configuration->property(role + ".pll_bw_narrow_hz", 20.0); dll_bw_narrow_hz = configuration->property(role + ".dll_bw_narrow_hz", 2.0); int extend_correlation_ms; @@ -82,7 +81,7 @@ GlonassL1CaDllPllCAidTracking::GlonassL1CaDllPllCAidTracking( early_late_space_chips = configuration->property(role + ".early_late_space_chips", 0.5); std::string default_dump_filename = "./track_ch"; dump_filename = configuration->property(role + ".dump_filename", - default_dump_filename); //unused! + default_dump_filename); //unused! vector_length = std::round(fs_in / (GLONASS_L1_CA_CODE_RATE_HZ / GLONASS_L1_CA_CODE_LENGTH_CHIPS)); //################# MAKE TRACKING GNURadio object ################### @@ -90,34 +89,34 @@ GlonassL1CaDllPllCAidTracking::GlonassL1CaDllPllCAidTracking( { item_size_ = sizeof(gr_complex); tracking_cc = glonass_l1_ca_dll_pll_c_aid_make_tracking_cc( - f_if, - fs_in, - vector_length, - dump, - dump_filename, - pll_bw_hz, - dll_bw_hz, - pll_bw_narrow_hz, - dll_bw_narrow_hz, - extend_correlation_ms, - early_late_space_chips); + f_if, + fs_in, + vector_length, + dump, + dump_filename, + pll_bw_hz, + dll_bw_hz, + pll_bw_narrow_hz, + dll_bw_narrow_hz, + extend_correlation_ms, + early_late_space_chips); DLOG(INFO) << "tracking(" << tracking_cc->unique_id() << ")"; } - else if(item_type_.compare("cshort") == 0) + else if (item_type_.compare("cshort") == 0) { item_size_ = sizeof(lv_16sc_t); tracking_sc = glonass_l1_ca_dll_pll_c_aid_make_tracking_sc( - f_if, - fs_in, - vector_length, - dump, - dump_filename, - pll_bw_hz, - dll_bw_hz, - pll_bw_narrow_hz, - dll_bw_narrow_hz, - extend_correlation_ms, - early_late_space_chips); + f_if, + fs_in, + vector_length, + dump, + dump_filename, + pll_bw_hz, + dll_bw_hz, + pll_bw_narrow_hz, + dll_bw_narrow_hz, + extend_correlation_ms, + early_late_space_chips); DLOG(INFO) << "tracking(" << tracking_sc->unique_id() << ")"; } else @@ -130,12 +129,12 @@ GlonassL1CaDllPllCAidTracking::GlonassL1CaDllPllCAidTracking( GlonassL1CaDllPllCAidTracking::~GlonassL1CaDllPllCAidTracking() -{} +{ +} void GlonassL1CaDllPllCAidTracking::start_tracking() { - if (item_type_.compare("gr_complex") == 0) { tracking_cc->start_tracking(); @@ -192,14 +191,18 @@ void GlonassL1CaDllPllCAidTracking::set_gnss_synchro(Gnss_Synchro* p_gnss_synchr void GlonassL1CaDllPllCAidTracking::connect(gr::top_block_sptr top_block) { - if(top_block) { /* top_block is not null */}; + if (top_block) + { /* top_block is not null */ + }; //nothing to connect, now the tracking uses gr_sync_decimator } void GlonassL1CaDllPllCAidTracking::disconnect(gr::top_block_sptr top_block) { - if(top_block) { /* top_block is not null */}; + if (top_block) + { /* top_block is not null */ + }; //nothing to disconnect, now the tracking uses gr_sync_decimator } diff --git a/src/algorithms/tracking/adapters/glonass_l1_ca_dll_pll_c_aid_tracking.h b/src/algorithms/tracking/adapters/glonass_l1_ca_dll_pll_c_aid_tracking.h index 3d6f390e0..0996dfd04 100644 --- a/src/algorithms/tracking/adapters/glonass_l1_ca_dll_pll_c_aid_tracking.h +++ b/src/algorithms/tracking/adapters/glonass_l1_ca_dll_pll_c_aid_tracking.h @@ -53,10 +53,10 @@ class ConfigurationInterface; class GlonassL1CaDllPllCAidTracking : public TrackingInterface { public: - GlonassL1CaDllPllCAidTracking(ConfigurationInterface* configuration, - std::string role, - unsigned int in_streams, - unsigned int out_streams); + GlonassL1CaDllPllCAidTracking(ConfigurationInterface* configuration, + std::string role, + unsigned int in_streams, + unsigned int out_streams); virtual ~GlonassL1CaDllPllCAidTracking(); @@ -105,4 +105,4 @@ private: unsigned int out_streams_; }; -#endif // GNSS_SDR_GLONASS_L1_CA_DLL_PLL_C_AID_TRACKING_H_ +#endif // GNSS_SDR_GLONASS_L1_CA_DLL_PLL_C_AID_TRACKING_H_ diff --git a/src/algorithms/tracking/adapters/glonass_l1_ca_dll_pll_tracking.cc b/src/algorithms/tracking/adapters/glonass_l1_ca_dll_pll_tracking.cc index 7e2047862..b9feb622e 100644 --- a/src/algorithms/tracking/adapters/glonass_l1_ca_dll_pll_tracking.cc +++ b/src/algorithms/tracking/adapters/glonass_l1_ca_dll_pll_tracking.cc @@ -46,9 +46,8 @@ using google::LogMessage; GlonassL1CaDllPllTracking::GlonassL1CaDllPllTracking( - ConfigurationInterface* configuration, std::string role, - unsigned int in_streams, unsigned int out_streams) : - role_(role), in_streams_(in_streams), out_streams_(out_streams) + ConfigurationInterface* configuration, std::string role, + unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) { DLOG(INFO) << "role " << role; //################# CONFIGURATION PARAMETERS ######################## @@ -68,12 +67,12 @@ GlonassL1CaDllPllTracking::GlonassL1CaDllPllTracking( f_if = configuration->property(role + ".if", 0); dump = configuration->property(role + ".dump", false); pll_bw_hz = configuration->property(role + ".pll_bw_hz", 50.0); - if(FLAGS_pll_bw_hz != 0.0) pll_bw_hz = static_cast(FLAGS_pll_bw_hz); + if (FLAGS_pll_bw_hz != 0.0) pll_bw_hz = static_cast(FLAGS_pll_bw_hz); dll_bw_hz = configuration->property(role + ".dll_bw_hz", 2.0); - if(FLAGS_dll_bw_hz != 0.0) dll_bw_hz = static_cast(FLAGS_dll_bw_hz); + if (FLAGS_dll_bw_hz != 0.0) dll_bw_hz = static_cast(FLAGS_dll_bw_hz); early_late_space_chips = configuration->property(role + ".early_late_space_chips", 0.5); std::string default_dump_filename = "./track_ch"; - dump_filename = configuration->property(role + ".dump_filename", default_dump_filename); //unused! + dump_filename = configuration->property(role + ".dump_filename", default_dump_filename); //unused! vector_length = std::round(fs_in / (GLONASS_L1_CA_CODE_RATE_HZ / GLONASS_L1_CA_CODE_LENGTH_CHIPS)); //################# MAKE TRACKING GNURadio object ################### @@ -81,14 +80,14 @@ GlonassL1CaDllPllTracking::GlonassL1CaDllPllTracking( { item_size_ = sizeof(gr_complex); tracking_ = glonass_l1_ca_dll_pll_make_tracking_cc( - f_if, - fs_in, - vector_length, - dump, - dump_filename, - pll_bw_hz, - dll_bw_hz, - early_late_space_chips); + f_if, + fs_in, + vector_length, + dump, + dump_filename, + pll_bw_hz, + dll_bw_hz, + early_late_space_chips); } else { @@ -101,7 +100,8 @@ GlonassL1CaDllPllTracking::GlonassL1CaDllPllTracking( GlonassL1CaDllPllTracking::~GlonassL1CaDllPllTracking() -{} +{ +} void GlonassL1CaDllPllTracking::start_tracking() @@ -128,14 +128,18 @@ void GlonassL1CaDllPllTracking::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) void GlonassL1CaDllPllTracking::connect(gr::top_block_sptr top_block) { - if(top_block) { /* top_block is not null */}; + if (top_block) + { /* top_block is not null */ + }; //nothing to connect, now the tracking uses gr_sync_decimator } void GlonassL1CaDllPllTracking::disconnect(gr::top_block_sptr top_block) { - if(top_block) { /* top_block is not null */}; + if (top_block) + { /* top_block is not null */ + }; //nothing to disconnect, now the tracking uses gr_sync_decimator } diff --git a/src/algorithms/tracking/adapters/glonass_l1_ca_dll_pll_tracking.h b/src/algorithms/tracking/adapters/glonass_l1_ca_dll_pll_tracking.h index 2268cfaae..0c1dd5e00 100644 --- a/src/algorithms/tracking/adapters/glonass_l1_ca_dll_pll_tracking.h +++ b/src/algorithms/tracking/adapters/glonass_l1_ca_dll_pll_tracking.h @@ -52,9 +52,9 @@ class GlonassL1CaDllPllTracking : public TrackingInterface { public: GlonassL1CaDllPllTracking(ConfigurationInterface* configuration, - std::string role, - unsigned int in_streams, - unsigned int out_streams); + std::string role, + unsigned int in_streams, + unsigned int out_streams); virtual ~GlonassL1CaDllPllTracking(); @@ -101,4 +101,4 @@ private: unsigned int out_streams_; }; -#endif // GNSS_SDR_GLONASS_L1_CA_DLL_PLL_TRACKING_H_ +#endif // GNSS_SDR_GLONASS_L1_CA_DLL_PLL_TRACKING_H_ diff --git a/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_c_aid_tracking.cc b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_c_aid_tracking.cc index 38144e43c..87c4a26c7 100644 --- a/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_c_aid_tracking.cc +++ b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_c_aid_tracking.cc @@ -46,9 +46,8 @@ using google::LogMessage; GpsL1CaDllPllCAidTracking::GpsL1CaDllPllCAidTracking( - ConfigurationInterface* configuration, std::string role, - unsigned int in_streams, unsigned int out_streams) : - role_(role), in_streams_(in_streams), out_streams_(out_streams) + ConfigurationInterface* configuration, std::string role, + unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) { DLOG(INFO) << "role " << role; //################# CONFIGURATION PARAMETERS ######################## @@ -70,9 +69,9 @@ GpsL1CaDllPllCAidTracking::GpsL1CaDllPllCAidTracking( f_if = configuration->property(role + ".if", 0); dump = configuration->property(role + ".dump", false); pll_bw_hz = configuration->property(role + ".pll_bw_hz", 50.0); - if(FLAGS_pll_bw_hz != 0.0) pll_bw_hz = static_cast(FLAGS_pll_bw_hz); + if (FLAGS_pll_bw_hz != 0.0) pll_bw_hz = static_cast(FLAGS_pll_bw_hz); dll_bw_hz = configuration->property(role + ".dll_bw_hz", 2.0); - if(FLAGS_dll_bw_hz != 0.0) dll_bw_hz = static_cast(FLAGS_dll_bw_hz); + if (FLAGS_dll_bw_hz != 0.0) dll_bw_hz = static_cast(FLAGS_dll_bw_hz); pll_bw_narrow_hz = configuration->property(role + ".pll_bw_narrow_hz", 20.0); dll_bw_narrow_hz = configuration->property(role + ".dll_bw_narrow_hz", 2.0); int extend_correlation_ms; @@ -81,7 +80,7 @@ GpsL1CaDllPllCAidTracking::GpsL1CaDllPllCAidTracking( early_late_space_chips = configuration->property(role + ".early_late_space_chips", 0.5); std::string default_dump_filename = "./track_ch"; dump_filename = configuration->property(role + ".dump_filename", - default_dump_filename); //unused! + default_dump_filename); //unused! vector_length = std::round(fs_in / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS)); //################# MAKE TRACKING GNURadio object ################### @@ -89,34 +88,34 @@ GpsL1CaDllPllCAidTracking::GpsL1CaDllPllCAidTracking( { item_size_ = sizeof(gr_complex); tracking_cc = gps_l1_ca_dll_pll_c_aid_make_tracking_cc( - f_if, - fs_in, - vector_length, - dump, - dump_filename, - pll_bw_hz, - dll_bw_hz, - pll_bw_narrow_hz, - dll_bw_narrow_hz, - extend_correlation_ms, - early_late_space_chips); + f_if, + fs_in, + vector_length, + dump, + dump_filename, + pll_bw_hz, + dll_bw_hz, + pll_bw_narrow_hz, + dll_bw_narrow_hz, + extend_correlation_ms, + early_late_space_chips); DLOG(INFO) << "tracking(" << tracking_cc->unique_id() << ")"; } - else if(item_type_.compare("cshort") == 0) + else if (item_type_.compare("cshort") == 0) { item_size_ = sizeof(lv_16sc_t); tracking_sc = gps_l1_ca_dll_pll_c_aid_make_tracking_sc( - f_if, - fs_in, - vector_length, - dump, - dump_filename, - pll_bw_hz, - dll_bw_hz, - pll_bw_narrow_hz, - dll_bw_narrow_hz, - extend_correlation_ms, - early_late_space_chips); + f_if, + fs_in, + vector_length, + dump, + dump_filename, + pll_bw_hz, + dll_bw_hz, + pll_bw_narrow_hz, + dll_bw_narrow_hz, + extend_correlation_ms, + early_late_space_chips); DLOG(INFO) << "tracking(" << tracking_sc->unique_id() << ")"; } else @@ -129,12 +128,12 @@ GpsL1CaDllPllCAidTracking::GpsL1CaDllPllCAidTracking( GpsL1CaDllPllCAidTracking::~GpsL1CaDllPllCAidTracking() -{} +{ +} void GpsL1CaDllPllCAidTracking::start_tracking() { - if (item_type_.compare("gr_complex") == 0) { tracking_cc->start_tracking(); @@ -188,13 +187,17 @@ void GpsL1CaDllPllCAidTracking::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) void GpsL1CaDllPllCAidTracking::connect(gr::top_block_sptr top_block) { - if(top_block) { /* top_block is not null */}; + if (top_block) + { /* top_block is not null */ + }; //nothing to connect, now the tracking uses gr_sync_decimator } void GpsL1CaDllPllCAidTracking::disconnect(gr::top_block_sptr top_block) { - if(top_block) { /* top_block is not null */}; + if (top_block) + { /* top_block is not null */ + }; //nothing to disconnect, now the tracking uses gr_sync_decimator } diff --git a/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_c_aid_tracking.h b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_c_aid_tracking.h index ac3a1e745..9da812068 100644 --- a/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_c_aid_tracking.h +++ b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_c_aid_tracking.h @@ -52,10 +52,10 @@ class ConfigurationInterface; class GpsL1CaDllPllCAidTracking : public TrackingInterface { public: - GpsL1CaDllPllCAidTracking(ConfigurationInterface* configuration, - std::string role, - unsigned int in_streams, - unsigned int out_streams); + GpsL1CaDllPllCAidTracking(ConfigurationInterface* configuration, + std::string role, + unsigned int in_streams, + unsigned int out_streams); virtual ~GpsL1CaDllPllCAidTracking(); @@ -104,4 +104,4 @@ private: unsigned int out_streams_; }; -#endif // GNSS_SDR_GPS_L1_CA_DLL_PLL_C_AID_TRACKING_H_ +#endif // GNSS_SDR_GPS_L1_CA_DLL_PLL_C_AID_TRACKING_H_ diff --git a/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking.cc b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking.cc index a9d4d2f3f..d58329575 100644 --- a/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking.cc +++ b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking.cc @@ -45,9 +45,8 @@ using google::LogMessage; GpsL1CaDllPllTracking::GpsL1CaDllPllTracking( - ConfigurationInterface* configuration, std::string role, - unsigned int in_streams, unsigned int out_streams) : - role_(role), in_streams_(in_streams), out_streams_(out_streams) + ConfigurationInterface* configuration, std::string role, + unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) { DLOG(INFO) << "role " << role; //################# CONFIGURATION PARAMETERS ######################## @@ -67,12 +66,12 @@ GpsL1CaDllPllTracking::GpsL1CaDllPllTracking( f_if = configuration->property(role + ".if", 0); dump = configuration->property(role + ".dump", false); pll_bw_hz = configuration->property(role + ".pll_bw_hz", 50.0); - if(FLAGS_pll_bw_hz != 0.0) pll_bw_hz = static_cast(FLAGS_pll_bw_hz); + if (FLAGS_pll_bw_hz != 0.0) pll_bw_hz = static_cast(FLAGS_pll_bw_hz); dll_bw_hz = configuration->property(role + ".dll_bw_hz", 2.0); - if(FLAGS_dll_bw_hz != 0.0) dll_bw_hz = static_cast(FLAGS_dll_bw_hz); + if (FLAGS_dll_bw_hz != 0.0) dll_bw_hz = static_cast(FLAGS_dll_bw_hz); early_late_space_chips = configuration->property(role + ".early_late_space_chips", 0.5); std::string default_dump_filename = "./track_ch"; - dump_filename = configuration->property(role + ".dump_filename", default_dump_filename); //unused! + dump_filename = configuration->property(role + ".dump_filename", default_dump_filename); //unused! vector_length = std::round(fs_in / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS)); //################# MAKE TRACKING GNURadio object ################### @@ -80,14 +79,14 @@ GpsL1CaDllPllTracking::GpsL1CaDllPllTracking( { item_size_ = sizeof(gr_complex); tracking_ = gps_l1_ca_dll_pll_make_tracking_cc( - f_if, - fs_in, - vector_length, - dump, - dump_filename, - pll_bw_hz, - dll_bw_hz, - early_late_space_chips); + f_if, + fs_in, + vector_length, + dump, + dump_filename, + pll_bw_hz, + dll_bw_hz, + early_late_space_chips); } else { @@ -100,7 +99,8 @@ GpsL1CaDllPllTracking::GpsL1CaDllPllTracking( GpsL1CaDllPllTracking::~GpsL1CaDllPllTracking() -{} +{ +} void GpsL1CaDllPllTracking::start_tracking() @@ -127,14 +127,18 @@ void GpsL1CaDllPllTracking::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) void GpsL1CaDllPllTracking::connect(gr::top_block_sptr top_block) { - if(top_block) { /* top_block is not null */}; + if (top_block) + { /* top_block is not null */ + }; //nothing to connect, now the tracking uses gr_sync_decimator } void GpsL1CaDllPllTracking::disconnect(gr::top_block_sptr top_block) { - if(top_block) { /* top_block is not null */}; + if (top_block) + { /* top_block is not null */ + }; //nothing to disconnect, now the tracking uses gr_sync_decimator } @@ -149,4 +153,3 @@ gr::basic_block_sptr GpsL1CaDllPllTracking::get_right_block() { return tracking_; } - diff --git a/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking.h b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking.h index c3be7a8d4..ff5a91899 100644 --- a/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking.h +++ b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking.h @@ -51,9 +51,9 @@ class GpsL1CaDllPllTracking : public TrackingInterface { public: GpsL1CaDllPllTracking(ConfigurationInterface* configuration, - std::string role, - unsigned int in_streams, - unsigned int out_streams); + std::string role, + unsigned int in_streams, + unsigned int out_streams); virtual ~GpsL1CaDllPllTracking(); @@ -100,4 +100,4 @@ private: unsigned int out_streams_; }; -#endif // GNSS_SDR_GPS_L1_CA_DLL_PLL_TRACKING_H_ +#endif // GNSS_SDR_GPS_L1_CA_DLL_PLL_TRACKING_H_ diff --git a/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking_gpu.cc b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking_gpu.cc index ebf768537..181e07317 100644 --- a/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking_gpu.cc +++ b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking_gpu.cc @@ -45,9 +45,8 @@ using google::LogMessage; GpsL1CaDllPllTrackingGPU::GpsL1CaDllPllTrackingGPU( - ConfigurationInterface* configuration, std::string role, - unsigned int in_streams, unsigned int out_streams) : - role_(role), in_streams_(in_streams), out_streams_(out_streams) + ConfigurationInterface* configuration, std::string role, + unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) { DLOG(INFO) << "role " << role; //################# CONFIGURATION PARAMETERS ######################## @@ -68,13 +67,13 @@ GpsL1CaDllPllTrackingGPU::GpsL1CaDllPllTrackingGPU( f_if = configuration->property(role + ".if", 0); dump = configuration->property(role + ".dump", false); pll_bw_hz = configuration->property(role + ".pll_bw_hz", 50.0); - if(FLAGS_pll_bw_hz != 0.0) pll_bw_hz = static_cast(FLAGS_pll_bw_hz); + if (FLAGS_pll_bw_hz != 0.0) pll_bw_hz = static_cast(FLAGS_pll_bw_hz); dll_bw_hz = configuration->property(role + ".dll_bw_hz", 2.0); - if(FLAGS_dll_bw_hz != 0.0) dll_bw_hz = static_cast(FLAGS_dll_bw_hz); + if (FLAGS_dll_bw_hz != 0.0) dll_bw_hz = static_cast(FLAGS_dll_bw_hz); early_late_space_chips = configuration->property(role + ".early_late_space_chips", 0.5); std::string default_dump_filename = "./track_ch"; dump_filename = configuration->property(role + ".dump_filename", - default_dump_filename); //unused! + default_dump_filename); //unused! vector_length = std::round(fs_in / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS)); //################# MAKE TRACKING GNURadio object ################### @@ -82,14 +81,14 @@ GpsL1CaDllPllTrackingGPU::GpsL1CaDllPllTrackingGPU( { item_size_ = sizeof(gr_complex); tracking_ = gps_l1_ca_dll_pll_make_tracking_gpu_cc( - f_if, - fs_in, - vector_length, - dump, - dump_filename, - pll_bw_hz, - dll_bw_hz, - early_late_space_chips); + f_if, + fs_in, + vector_length, + dump, + dump_filename, + pll_bw_hz, + dll_bw_hz, + early_late_space_chips); } else { @@ -102,7 +101,8 @@ GpsL1CaDllPllTrackingGPU::GpsL1CaDllPllTrackingGPU( GpsL1CaDllPllTrackingGPU::~GpsL1CaDllPllTrackingGPU() -{} +{ +} void GpsL1CaDllPllTrackingGPU::start_tracking() @@ -126,13 +126,17 @@ void GpsL1CaDllPllTrackingGPU::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) void GpsL1CaDllPllTrackingGPU::connect(gr::top_block_sptr top_block) { - if(top_block) { /* top_block is not null */}; + if (top_block) + { /* top_block is not null */ + }; //nothing to connect, now the tracking uses gr_sync_decimator } void GpsL1CaDllPllTrackingGPU::disconnect(gr::top_block_sptr top_block) { - if(top_block) { /* top_block is not null */}; + if (top_block) + { /* top_block is not null */ + }; //nothing to disconnect, now the tracking uses gr_sync_decimator } @@ -145,4 +149,3 @@ gr::basic_block_sptr GpsL1CaDllPllTrackingGPU::get_right_block() { return tracking_; } - diff --git a/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking_gpu.h b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking_gpu.h index 5ff4dcf5d..39623a76a 100644 --- a/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking_gpu.h +++ b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking_gpu.h @@ -50,10 +50,10 @@ class ConfigurationInterface; class GpsL1CaDllPllTrackingGPU : public TrackingInterface { public: - GpsL1CaDllPllTrackingGPU(ConfigurationInterface* configuration, - std::string role, - unsigned int in_streams, - unsigned int out_streams); + GpsL1CaDllPllTrackingGPU(ConfigurationInterface* configuration, + std::string role, + unsigned int in_streams, + unsigned int out_streams); virtual ~GpsL1CaDllPllTrackingGPU(); @@ -100,4 +100,4 @@ private: unsigned int out_streams_; }; -#endif // GNSS_SDR_GPS_L1_CA_DLL_PLL_TRACKING_GPU_H_ +#endif // GNSS_SDR_GPS_L1_CA_DLL_PLL_TRACKING_GPU_H_ diff --git a/src/algorithms/tracking/adapters/gps_l1_ca_tcp_connector_tracking.cc b/src/algorithms/tracking/adapters/gps_l1_ca_tcp_connector_tracking.cc index ced0f06fe..3502ec617 100644 --- a/src/algorithms/tracking/adapters/gps_l1_ca_tcp_connector_tracking.cc +++ b/src/algorithms/tracking/adapters/gps_l1_ca_tcp_connector_tracking.cc @@ -44,9 +44,8 @@ using google::LogMessage; GpsL1CaTcpConnectorTracking::GpsL1CaTcpConnectorTracking( - ConfigurationInterface* configuration, std::string role, - unsigned int in_streams, unsigned int out_streams) : - role_(role), in_streams_(in_streams), out_streams_(out_streams) + ConfigurationInterface* configuration, std::string role, + unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) { DLOG(INFO) << "role " << role; //################# CONFIGURATION PARAMETERS ######################## @@ -59,7 +58,7 @@ GpsL1CaTcpConnectorTracking::GpsL1CaTcpConnectorTracking( std::string default_item_type = "gr_complex"; float early_late_space_chips; size_t port_ch0; - item_type = configuration->property(role + ".item_type",default_item_type); + item_type = configuration->property(role + ".item_type", default_item_type); //vector_length = configuration->property(role + ".vector_length", 2048); int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000); fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); @@ -68,7 +67,7 @@ GpsL1CaTcpConnectorTracking::GpsL1CaTcpConnectorTracking( early_late_space_chips = configuration->property(role + ".early_late_space_chips", 0.5); port_ch0 = configuration->property(role + ".port_ch0", 2060); std::string default_dump_filename = "./track_ch"; - dump_filename = configuration->property(role + ".dump_filename", default_dump_filename); //unused! + dump_filename = configuration->property(role + ".dump_filename", default_dump_filename); //unused! vector_length = std::round(fs_in / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS)); //################# MAKE TRACKING GNURadio object ################### @@ -76,13 +75,13 @@ GpsL1CaTcpConnectorTracking::GpsL1CaTcpConnectorTracking( { item_size_ = sizeof(gr_complex); tracking_ = gps_l1_ca_tcp_connector_make_tracking_cc( - f_if, - fs_in, - vector_length, - dump, - dump_filename, - early_late_space_chips, - port_ch0); + f_if, + fs_in, + vector_length, + dump, + dump_filename, + early_late_space_chips, + port_ch0); } else { @@ -96,7 +95,8 @@ GpsL1CaTcpConnectorTracking::GpsL1CaTcpConnectorTracking( GpsL1CaTcpConnectorTracking::~GpsL1CaTcpConnectorTracking() -{} +{ +} void GpsL1CaTcpConnectorTracking::start_tracking() @@ -121,13 +121,17 @@ void GpsL1CaTcpConnectorTracking::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) void GpsL1CaTcpConnectorTracking::connect(gr::top_block_sptr top_block) { - if(top_block) { /* top_block is not null */}; + if (top_block) + { /* top_block is not null */ + }; //nothing to connect, now the tracking uses gr_sync_decimator } void GpsL1CaTcpConnectorTracking::disconnect(gr::top_block_sptr top_block) { - if(top_block) { /* top_block is not null */}; + if (top_block) + { /* top_block is not null */ + }; //nothing to disconnect, now the tracking uses gr_sync_decimator } @@ -140,4 +144,3 @@ gr::basic_block_sptr GpsL1CaTcpConnectorTracking::get_right_block() { return tracking_; } - diff --git a/src/algorithms/tracking/adapters/gps_l1_ca_tcp_connector_tracking.h b/src/algorithms/tracking/adapters/gps_l1_ca_tcp_connector_tracking.h index b2327e04a..472a47e00 100644 --- a/src/algorithms/tracking/adapters/gps_l1_ca_tcp_connector_tracking.h +++ b/src/algorithms/tracking/adapters/gps_l1_ca_tcp_connector_tracking.h @@ -50,12 +50,11 @@ class ConfigurationInterface; */ class GpsL1CaTcpConnectorTracking : public TrackingInterface { - public: - GpsL1CaTcpConnectorTracking(ConfigurationInterface* configuration, - std::string role, - unsigned int in_streams, - unsigned int out_streams); + GpsL1CaTcpConnectorTracking(ConfigurationInterface* configuration, + std::string role, + unsigned int in_streams, + unsigned int out_streams); virtual ~GpsL1CaTcpConnectorTracking(); @@ -94,7 +93,6 @@ public: void start_tracking() override; private: - gps_l1_ca_tcp_connector_tracking_cc_sptr tracking_; size_t item_size_; @@ -105,4 +103,4 @@ private: unsigned int out_streams_; }; -#endif // GNSS_SDR_GPS_L1_CA_TCP_CONNECTOR_TRACKING_H_ +#endif // GNSS_SDR_GPS_L1_CA_TCP_CONNECTOR_TRACKING_H_ diff --git a/src/algorithms/tracking/adapters/gps_l2_m_dll_pll_tracking.cc b/src/algorithms/tracking/adapters/gps_l2_m_dll_pll_tracking.cc index 70f6f9410..839ef334c 100644 --- a/src/algorithms/tracking/adapters/gps_l2_m_dll_pll_tracking.cc +++ b/src/algorithms/tracking/adapters/gps_l2_m_dll_pll_tracking.cc @@ -45,9 +45,8 @@ using google::LogMessage; GpsL2MDllPllTracking::GpsL2MDllPllTracking( - ConfigurationInterface* configuration, std::string role, - unsigned int in_streams, unsigned int out_streams) : - role_(role), in_streams_(in_streams), out_streams_(out_streams) + ConfigurationInterface* configuration, std::string role, + unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) { DLOG(INFO) << "role " << role; //################# CONFIGURATION PARAMETERS ######################## @@ -67,13 +66,13 @@ GpsL2MDllPllTracking::GpsL2MDllPllTracking( f_if = configuration->property(role + ".if", 0); dump = configuration->property(role + ".dump", false); pll_bw_hz = configuration->property(role + ".pll_bw_hz", 50.0); - if(FLAGS_pll_bw_hz != 0.0) pll_bw_hz = static_cast(FLAGS_pll_bw_hz); + if (FLAGS_pll_bw_hz != 0.0) pll_bw_hz = static_cast(FLAGS_pll_bw_hz); dll_bw_hz = configuration->property(role + ".dll_bw_hz", 2.0); - if(FLAGS_dll_bw_hz != 0.0) dll_bw_hz = static_cast(FLAGS_dll_bw_hz); + if (FLAGS_dll_bw_hz != 0.0) dll_bw_hz = static_cast(FLAGS_dll_bw_hz); early_late_space_chips = configuration->property(role + ".early_late_space_chips", 0.5); std::string default_dump_filename = "./track_ch"; dump_filename = configuration->property(role + ".dump_filename", - default_dump_filename); //unused! + default_dump_filename); //unused! vector_length = std::round(static_cast(fs_in) / (static_cast(GPS_L2_M_CODE_RATE_HZ) / static_cast(GPS_L2_M_CODE_LENGTH_CHIPS))); //################# MAKE TRACKING GNURadio object ################### @@ -81,14 +80,14 @@ GpsL2MDllPllTracking::GpsL2MDllPllTracking( { item_size_ = sizeof(gr_complex); tracking_ = gps_l2_m_dll_pll_make_tracking_cc( - f_if, - fs_in, - vector_length, - dump, - dump_filename, - pll_bw_hz, - dll_bw_hz, - early_late_space_chips); + f_if, + fs_in, + vector_length, + dump, + dump_filename, + pll_bw_hz, + dll_bw_hz, + early_late_space_chips); } else { @@ -101,7 +100,8 @@ GpsL2MDllPllTracking::GpsL2MDllPllTracking( GpsL2MDllPllTracking::~GpsL2MDllPllTracking() -{} +{ +} void GpsL2MDllPllTracking::start_tracking() @@ -126,13 +126,17 @@ void GpsL2MDllPllTracking::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) void GpsL2MDllPllTracking::connect(gr::top_block_sptr top_block) { - if(top_block) { /* top_block is not null */}; + if (top_block) + { /* top_block is not null */ + }; //nothing to connect, now the tracking uses gr_sync_decimator } void GpsL2MDllPllTracking::disconnect(gr::top_block_sptr top_block) { - if(top_block) { /* top_block is not null */}; + if (top_block) + { /* top_block is not null */ + }; //nothing to disconnect, now the tracking uses gr_sync_decimator } @@ -145,4 +149,3 @@ gr::basic_block_sptr GpsL2MDllPllTracking::get_right_block() { return tracking_; } - diff --git a/src/algorithms/tracking/adapters/gps_l2_m_dll_pll_tracking.h b/src/algorithms/tracking/adapters/gps_l2_m_dll_pll_tracking.h index b065185ee..ae7498a40 100644 --- a/src/algorithms/tracking/adapters/gps_l2_m_dll_pll_tracking.h +++ b/src/algorithms/tracking/adapters/gps_l2_m_dll_pll_tracking.h @@ -51,9 +51,9 @@ class GpsL2MDllPllTracking : public TrackingInterface { public: GpsL2MDllPllTracking(ConfigurationInterface* configuration, - std::string role, - unsigned int in_streams, - unsigned int out_streams); + std::string role, + unsigned int in_streams, + unsigned int out_streams); virtual ~GpsL2MDllPllTracking(); @@ -100,4 +100,4 @@ private: unsigned int out_streams_; }; -#endif // GNSS_SDR_gps_l2_m_dll_pll_tracking_H_ +#endif // GNSS_SDR_gps_l2_m_dll_pll_tracking_H_ diff --git a/src/algorithms/tracking/adapters/gps_l5i_dll_pll_tracking.cc b/src/algorithms/tracking/adapters/gps_l5i_dll_pll_tracking.cc index bf379716d..10c180037 100644 --- a/src/algorithms/tracking/adapters/gps_l5i_dll_pll_tracking.cc +++ b/src/algorithms/tracking/adapters/gps_l5i_dll_pll_tracking.cc @@ -45,9 +45,8 @@ using google::LogMessage; GpsL5iDllPllTracking::GpsL5iDllPllTracking( - ConfigurationInterface* configuration, std::string role, - unsigned int in_streams, unsigned int out_streams) : - role_(role), in_streams_(in_streams), out_streams_(out_streams) + ConfigurationInterface* configuration, std::string role, + unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) { DLOG(INFO) << "role " << role; //################# CONFIGURATION PARAMETERS ######################## @@ -67,13 +66,13 @@ GpsL5iDllPllTracking::GpsL5iDllPllTracking( f_if = configuration->property(role + ".if", 0); dump = configuration->property(role + ".dump", false); pll_bw_hz = configuration->property(role + ".pll_bw_hz", 50.0); - if(FLAGS_pll_bw_hz != 0.0) pll_bw_hz = static_cast(FLAGS_pll_bw_hz); + if (FLAGS_pll_bw_hz != 0.0) pll_bw_hz = static_cast(FLAGS_pll_bw_hz); dll_bw_hz = configuration->property(role + ".dll_bw_hz", 2.0); - if(FLAGS_dll_bw_hz != 0.0) dll_bw_hz = static_cast(FLAGS_dll_bw_hz); + if (FLAGS_dll_bw_hz != 0.0) dll_bw_hz = static_cast(FLAGS_dll_bw_hz); early_late_space_chips = configuration->property(role + ".early_late_space_chips", 0.5); std::string default_dump_filename = "./track_ch"; dump_filename = configuration->property(role + ".dump_filename", - default_dump_filename); //unused! + default_dump_filename); //unused! vector_length = std::round(static_cast(fs_in) / (static_cast(GPS_L5i_CODE_RATE_HZ) / static_cast(GPS_L5i_CODE_LENGTH_CHIPS))); //################# MAKE TRACKING GNURadio object ################### @@ -81,14 +80,14 @@ GpsL5iDllPllTracking::GpsL5iDllPllTracking( { item_size_ = sizeof(gr_complex); tracking_ = gps_l5i_dll_pll_make_tracking_cc( - f_if, - fs_in, - vector_length, - dump, - dump_filename, - pll_bw_hz, - dll_bw_hz, - early_late_space_chips); + f_if, + fs_in, + vector_length, + dump, + dump_filename, + pll_bw_hz, + dll_bw_hz, + early_late_space_chips); } else { @@ -101,7 +100,8 @@ GpsL5iDllPllTracking::GpsL5iDllPllTracking( GpsL5iDllPllTracking::~GpsL5iDllPllTracking() -{} +{ +} void GpsL5iDllPllTracking::start_tracking() @@ -126,13 +126,17 @@ void GpsL5iDllPllTracking::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) void GpsL5iDllPllTracking::connect(gr::top_block_sptr top_block) { - if(top_block) { /* top_block is not null */}; + if (top_block) + { /* top_block is not null */ + }; //nothing to connect, now the tracking uses gr_sync_decimator } void GpsL5iDllPllTracking::disconnect(gr::top_block_sptr top_block) { - if(top_block) { /* top_block is not null */}; + if (top_block) + { /* top_block is not null */ + }; //nothing to disconnect, now the tracking uses gr_sync_decimator } @@ -145,4 +149,3 @@ gr::basic_block_sptr GpsL5iDllPllTracking::get_right_block() { return tracking_; } - diff --git a/src/algorithms/tracking/adapters/gps_l5i_dll_pll_tracking.h b/src/algorithms/tracking/adapters/gps_l5i_dll_pll_tracking.h index b3be3cdbc..c54115251 100644 --- a/src/algorithms/tracking/adapters/gps_l5i_dll_pll_tracking.h +++ b/src/algorithms/tracking/adapters/gps_l5i_dll_pll_tracking.h @@ -50,9 +50,9 @@ class GpsL5iDllPllTracking : public TrackingInterface { public: GpsL5iDllPllTracking(ConfigurationInterface* configuration, - std::string role, - unsigned int in_streams, - unsigned int out_streams); + std::string role, + unsigned int in_streams, + unsigned int out_streams); virtual ~GpsL5iDllPllTracking(); @@ -99,4 +99,4 @@ private: unsigned int out_streams_; }; -#endif // GNSS_SDR_gps_l5i_dll_pll_tracking_H_ +#endif // GNSS_SDR_gps_l5i_dll_pll_tracking_H_ diff --git a/src/algorithms/tracking/gnuradio_blocks/galileo_e1_dll_pll_veml_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/galileo_e1_dll_pll_veml_tracking_cc.cc old mode 100755 new mode 100644 index 925ac457d..276f56939 --- a/src/algorithms/tracking/gnuradio_blocks/galileo_e1_dll_pll_veml_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/galileo_e1_dll_pll_veml_tracking_cc.cc @@ -55,68 +55,67 @@ using google::LogMessage; galileo_e1_dll_pll_veml_tracking_cc_sptr galileo_e1_dll_pll_veml_make_tracking_cc( - long if_freq, - long fs_in, - unsigned int vector_length, - bool dump, - std::string dump_filename, - float pll_bw_hz, - float dll_bw_hz, - float pll_bw_narrow_hz, - float dll_bw_narrow_hz, - float early_late_space_chips, - float very_early_late_space_chips, - float early_late_space_narrow_chips, - float very_early_late_space_narrow_chips, - int extend_correlation_symbols, - bool track_pilot) + long if_freq, + long fs_in, + unsigned int vector_length, + bool dump, + std::string dump_filename, + float pll_bw_hz, + float dll_bw_hz, + float pll_bw_narrow_hz, + float dll_bw_narrow_hz, + float early_late_space_chips, + float very_early_late_space_chips, + float early_late_space_narrow_chips, + float very_early_late_space_narrow_chips, + int extend_correlation_symbols, + bool track_pilot) { return galileo_e1_dll_pll_veml_tracking_cc_sptr(new galileo_e1_dll_pll_veml_tracking_cc(if_freq, - fs_in, - vector_length, - dump, - dump_filename, - pll_bw_hz, - dll_bw_hz, - pll_bw_narrow_hz, - dll_bw_narrow_hz, - early_late_space_chips, - very_early_late_space_chips, - early_late_space_narrow_chips, - very_early_late_space_narrow_chips, - extend_correlation_symbols, - track_pilot)); + fs_in, + vector_length, + dump, + dump_filename, + pll_bw_hz, + dll_bw_hz, + pll_bw_narrow_hz, + dll_bw_narrow_hz, + early_late_space_chips, + very_early_late_space_chips, + early_late_space_narrow_chips, + very_early_late_space_narrow_chips, + extend_correlation_symbols, + track_pilot)); } -void galileo_e1_dll_pll_veml_tracking_cc::forecast (int noutput_items, - gr_vector_int &ninput_items_required) +void galileo_e1_dll_pll_veml_tracking_cc::forecast(int noutput_items, + gr_vector_int &ninput_items_required) { if (noutput_items != 0) { - ninput_items_required[0] = static_cast(d_vector_length) * 2; //set the required available samples in each call + ninput_items_required[0] = static_cast(d_vector_length) * 2; //set the required available samples in each call } } galileo_e1_dll_pll_veml_tracking_cc::galileo_e1_dll_pll_veml_tracking_cc( - long if_freq, - long fs_in, - unsigned int vector_length, - bool dump, - std::string dump_filename, - float pll_bw_hz, - float dll_bw_hz, - float pll_bw_narrow_hz, - float dll_bw_narrow_hz, - float early_late_space_chips, - float very_early_late_space_chips, - float early_late_space_narrow_chips, - float very_early_late_space_narrow_chips, - int extend_correlation_symbols, - bool track_pilot): - gr::block("galileo_e1_dll_pll_veml_tracking_cc", gr::io_signature::make(1, 1, sizeof(gr_complex)), - gr::io_signature::make(1, 1, sizeof(Gnss_Synchro))) + long if_freq, + long fs_in, + unsigned int vector_length, + bool dump, + std::string dump_filename, + float pll_bw_hz, + float dll_bw_hz, + float pll_bw_narrow_hz, + float dll_bw_narrow_hz, + float early_late_space_chips, + float very_early_late_space_chips, + float early_late_space_narrow_chips, + float very_early_late_space_narrow_chips, + int extend_correlation_symbols, + bool track_pilot) : gr::block("galileo_e1_dll_pll_veml_tracking_cc", gr::io_signature::make(1, 1, sizeof(gr_complex)), + gr::io_signature::make(1, 1, sizeof(Gnss_Synchro))) { // Telemetry bit synchronization message port input this->message_port_register_in(pmt::mp("preamble_timestamp_s")); @@ -145,21 +144,21 @@ galileo_e1_dll_pll_veml_tracking_cc::galileo_e1_dll_pll_veml_tracking_cc( d_carrier_loop_filter.set_PLL_BW(d_pll_bw_hz); // Correlator spacing - d_early_late_spc_chips = early_late_space_chips; // Define early-late offset (in chips) - d_very_early_late_spc_chips = very_early_late_space_chips; // Define very-early-late offset (in chips) - d_early_late_spc_narrow_chips = early_late_space_narrow_chips; // Define narrow early-late offset (in chips) - d_very_early_late_spc_narrow_chips = very_early_late_space_narrow_chips; // Define narrow very-early-late offset (in chips) + d_early_late_spc_chips = early_late_space_chips; // Define early-late offset (in chips) + d_very_early_late_spc_chips = very_early_late_space_chips; // Define very-early-late offset (in chips) + d_early_late_spc_narrow_chips = early_late_space_narrow_chips; // Define narrow early-late offset (in chips) + d_very_early_late_spc_narrow_chips = very_early_late_space_narrow_chips; // Define narrow very-early-late offset (in chips) // Initialization of local code replica // Get space for a vector with the sinboc(1,1) replica sampled 2x/chip - d_tracking_code = static_cast(volk_gnsssdr_malloc((2 * Galileo_E1_B_CODE_LENGTH_CHIPS) * sizeof(float), volk_gnsssdr_get_alignment())); + d_tracking_code = static_cast(volk_gnsssdr_malloc((2 * Galileo_E1_B_CODE_LENGTH_CHIPS) * sizeof(float), volk_gnsssdr_get_alignment())); // correlator outputs (scalar) - d_n_correlator_taps = 5; // Very-Early, Early, Prompt, Late, Very-Late - d_correlator_outs = static_cast(volk_gnsssdr_malloc(d_n_correlator_taps * sizeof(gr_complex), volk_gnsssdr_get_alignment())); + d_n_correlator_taps = 5; // Very-Early, Early, Prompt, Late, Very-Late + d_correlator_outs = static_cast(volk_gnsssdr_malloc(d_n_correlator_taps * sizeof(gr_complex), volk_gnsssdr_get_alignment())); for (int n = 0; n < d_n_correlator_taps; n++) { - d_correlator_outs[n] = gr_complex(0,0); + d_correlator_outs[n] = gr_complex(0, 0); } // map memory pointers of correlator outputs d_Very_Early = &d_correlator_outs[0]; @@ -168,10 +167,10 @@ galileo_e1_dll_pll_veml_tracking_cc::galileo_e1_dll_pll_veml_tracking_cc( d_Late = &d_correlator_outs[3]; d_Very_Late = &d_correlator_outs[4]; - d_local_code_shift_chips = static_cast(volk_gnsssdr_malloc(d_n_correlator_taps * sizeof(float), volk_gnsssdr_get_alignment())); + d_local_code_shift_chips = static_cast(volk_gnsssdr_malloc(d_n_correlator_taps * sizeof(float), volk_gnsssdr_get_alignment())); // Set TAPs delay values [chips] - d_local_code_shift_chips[0] = - d_very_early_late_spc_chips; - d_local_code_shift_chips[1] = - d_early_late_spc_chips; + d_local_code_shift_chips[0] = -d_very_early_late_spc_chips; + d_local_code_shift_chips[1] = -d_early_late_spc_chips; d_local_code_shift_chips[2] = 0.0; d_local_code_shift_chips[3] = d_early_late_spc_chips; d_local_code_shift_chips[4] = d_very_early_late_spc_chips; @@ -194,12 +193,12 @@ galileo_e1_dll_pll_veml_tracking_cc::galileo_e1_dll_pll_veml_tracking_cc( d_enable_extended_integration = false; } // Extra correlator for the data component - d_local_code_data_shift_chips = static_cast(volk_gnsssdr_malloc(sizeof(float), volk_gnsssdr_get_alignment())); + d_local_code_data_shift_chips = static_cast(volk_gnsssdr_malloc(sizeof(float), volk_gnsssdr_get_alignment())); d_local_code_data_shift_chips[0] = 0.0; correlator_data_cpu.init(2 * d_correlation_length_samples, 1); - d_Prompt_Data = static_cast(volk_gnsssdr_malloc(sizeof(gr_complex), volk_gnsssdr_get_alignment())); - d_Prompt_Data[0] = gr_complex(0,0); - d_data_code = static_cast(volk_gnsssdr_malloc((2 * Galileo_E1_B_CODE_LENGTH_CHIPS) * sizeof(float), volk_gnsssdr_get_alignment())); + d_Prompt_Data = static_cast(volk_gnsssdr_malloc(sizeof(gr_complex), volk_gnsssdr_get_alignment())); + d_Prompt_Data[0] = gr_complex(0, 0); + d_data_code = static_cast(volk_gnsssdr_malloc((2 * Galileo_E1_B_CODE_LENGTH_CHIPS) * sizeof(float), volk_gnsssdr_get_alignment())); } else { @@ -248,7 +247,7 @@ galileo_e1_dll_pll_veml_tracking_cc::galileo_e1_dll_pll_veml_tracking_cc( d_K_blk_samples = 0.0; d_code_phase_samples = 0.0; - d_state = 0; // initial state: standby + d_state = 0; // initial state: standby } @@ -263,7 +262,7 @@ void galileo_e1_dll_pll_veml_tracking_cc::start_tracking() long int acq_trk_diff_samples; double acq_trk_diff_seconds; - acq_trk_diff_samples = static_cast(d_sample_counter) - static_cast(d_acq_sample_stamp); //-d_vector_length; + acq_trk_diff_samples = static_cast(d_sample_counter) - static_cast(d_acq_sample_stamp); //-d_vector_length; DLOG(INFO) << "Number of samples between Acquisition and Tracking = " << acq_trk_diff_samples; acq_trk_diff_seconds = static_cast(acq_trk_diff_samples) / static_cast(d_fs_in); // Doppler effect @@ -275,7 +274,7 @@ void galileo_e1_dll_pll_veml_tracking_cc::start_tracking() double T_prn_mod_samples; d_code_freq_chips = radial_velocity * Galileo_E1_CODE_CHIP_RATE_HZ; d_code_phase_step_chips = static_cast(d_code_freq_chips) / static_cast(d_fs_in); - T_chip_mod_seconds = 1/d_code_freq_chips; + T_chip_mod_seconds = 1 / d_code_freq_chips; T_prn_mod_seconds = T_chip_mod_seconds * Galileo_E1_B_CODE_LENGTH_CHIPS; T_prn_mod_samples = T_prn_mod_seconds * static_cast(d_fs_in); @@ -299,43 +298,43 @@ void galileo_e1_dll_pll_veml_tracking_cc::start_tracking() d_carrier_phase_step_rad = GALILEO_TWO_PI * d_carrier_doppler_hz / static_cast(d_fs_in); // DLL/PLL filter initialization - d_carrier_loop_filter.initialize(); // initialize the carrier filter - d_code_loop_filter.initialize(); // initialize the code filter + d_carrier_loop_filter.initialize(); // initialize the carrier filter + d_code_loop_filter.initialize(); // initialize the code filter if (d_track_pilot) { char pilot_signal[3] = "1C"; galileo_e1_code_gen_float_sampled(d_tracking_code, - pilot_signal, - false, - d_acquisition_gnss_synchro->PRN, - Galileo_E1_CODE_CHIP_RATE_HZ, - 0); + pilot_signal, + false, + d_acquisition_gnss_synchro->PRN, + Galileo_E1_CODE_CHIP_RATE_HZ, + 0); galileo_e1_code_gen_float_sampled(d_data_code, - d_acquisition_gnss_synchro->Signal, - false, - d_acquisition_gnss_synchro->PRN, - Galileo_E1_CODE_CHIP_RATE_HZ, - 0); - d_Prompt_Data[0] = gr_complex(0,0); // clean data correlator output + d_acquisition_gnss_synchro->Signal, + false, + d_acquisition_gnss_synchro->PRN, + Galileo_E1_CODE_CHIP_RATE_HZ, + 0); + d_Prompt_Data[0] = gr_complex(0, 0); // clean data correlator output correlator_data_cpu.set_local_code_and_taps(static_cast(Galileo_E1_B_CODE_LENGTH_CHIPS), - d_data_code, - d_local_code_shift_chips); + d_data_code, + d_local_code_shift_chips); } else { galileo_e1_code_gen_float_sampled(d_tracking_code, - d_acquisition_gnss_synchro->Signal, - false, - d_acquisition_gnss_synchro->PRN, - Galileo_E1_CODE_CHIP_RATE_HZ, - 0); + d_acquisition_gnss_synchro->Signal, + false, + d_acquisition_gnss_synchro->PRN, + Galileo_E1_CODE_CHIP_RATE_HZ, + 0); } multicorrelator_cpu.set_local_code_and_taps(static_cast(Galileo_E1_B_CODE_LENGTH_CHIPS), d_tracking_code, d_local_code_shift_chips); for (int n = 0; n < d_n_correlator_taps; n++) { - d_correlator_outs[n] = gr_complex(0,0); + d_correlator_outs[n] = gr_complex(0, 0); } d_carrier_lock_fail_counter = 0; @@ -347,7 +346,7 @@ void galileo_e1_dll_pll_veml_tracking_cc::start_tracking() d_code_phase_samples = d_acq_code_phase_samples; std::string sys_ = &d_acquisition_gnss_synchro->System; - sys = sys_.substr(0,1); + sys = sys_.substr(0, 1); // DEBUG OUTPUT std::cout << "Tracking of Galileo E1 signal started on channel " << d_channel << " for satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << std::endl; @@ -367,28 +366,28 @@ galileo_e1_dll_pll_veml_tracking_cc::~galileo_e1_dll_pll_veml_tracking_cc() if (d_dump_file.is_open()) { try - { + { d_dump_file.close(); - } - catch(const std::exception & ex) - { + } + catch (const std::exception &ex) + { LOG(WARNING) << "Exception in destructor " << ex.what(); - } + } } - if(d_dump) + if (d_dump) { - if(d_channel == 0) + if (d_channel == 0) { std::cout << "Writing .mat files ..."; } galileo_e1_dll_pll_veml_tracking_cc::save_matfile(); - if(d_channel == 0) + if (d_channel == 0) { std::cout << " done." << std::endl; } } try - { + { volk_gnsssdr_free(d_local_code_shift_chips); volk_gnsssdr_free(d_correlator_outs); volk_gnsssdr_free(d_tracking_code); @@ -401,11 +400,11 @@ galileo_e1_dll_pll_veml_tracking_cc::~galileo_e1_dll_pll_veml_tracking_cc() } delete[] d_Prompt_buffer; multicorrelator_cpu.free(); - } - catch(const std::exception & ex) - { + } + catch (const std::exception &ex) + { LOG(WARNING) << "Exception in destructor " << ex.what(); - } + } } @@ -480,13 +479,13 @@ bool galileo_e1_dll_pll_veml_tracking_cc::cn0_and_tracking_lock_status() { std::cout << "Loss of lock in channel " << d_channel << "!" << std::endl; LOG(INFO) << "Loss of lock in channel " << d_channel << "!"; - this->message_port_pub(pmt::mp("events"), pmt::from_long(3)); // 3 -> loss of lock + this->message_port_pub(pmt::mp("events"), pmt::from_long(3)); // 3 -> loss of lock d_carrier_lock_fail_counter = 0; return false; } else { - return true; + return true; } } } @@ -497,28 +496,28 @@ bool galileo_e1_dll_pll_veml_tracking_cc::cn0_and_tracking_lock_status() // - updated remnant code phase in samples (d_rem_code_phase_samples) // - d_code_freq_chips // - d_carrier_doppler_hz -void galileo_e1_dll_pll_veml_tracking_cc::do_correlation_step(const gr_complex* input_samples) +void galileo_e1_dll_pll_veml_tracking_cc::do_correlation_step(const gr_complex *input_samples) { // ################# CARRIER WIPEOFF AND CORRELATORS ############################## // perform carrier wipe-off and compute Early, Prompt and Late correlation - multicorrelator_cpu.set_input_output_vectors(d_correlator_outs,input_samples); + multicorrelator_cpu.set_input_output_vectors(d_correlator_outs, input_samples); multicorrelator_cpu.Carrier_wipeoff_multicorrelator_resampler( - d_rem_carr_phase_rad, - d_carrier_phase_step_rad, - d_rem_code_phase_chips, - d_code_phase_step_chips, - d_correlation_length_samples); + d_rem_carr_phase_rad, + d_carrier_phase_step_rad, + d_rem_code_phase_chips, + d_code_phase_step_chips, + d_correlation_length_samples); // DATA CORRELATOR (if tracking tracks the pilot signal) if (d_track_pilot) { - correlator_data_cpu.set_input_output_vectors(d_Prompt_Data,input_samples); + correlator_data_cpu.set_input_output_vectors(d_Prompt_Data, input_samples); correlator_data_cpu.Carrier_wipeoff_multicorrelator_resampler( - d_rem_carr_phase_rad, - d_carrier_phase_step_rad, - d_rem_code_phase_chips, - d_code_phase_step_chips, - d_correlation_length_samples); + d_rem_carr_phase_rad, + d_carrier_phase_step_rad, + d_rem_code_phase_chips, + d_code_phase_step_chips, + d_correlation_length_samples); } } @@ -547,19 +546,19 @@ void galileo_e1_dll_pll_veml_tracking_cc::run_dll_pll(bool disable_costas_loop) // ################## DLL ########################################################## // DLL discriminator - d_code_error_chips = dll_nc_vemlp_normalized(d_VE_accu, d_E_accu, d_L_accu, d_VL_accu); // [chips/Ti] + d_code_error_chips = dll_nc_vemlp_normalized(d_VE_accu, d_E_accu, d_L_accu, d_VL_accu); // [chips/Ti] // Code discriminator filter - d_code_error_filt_chips = d_code_loop_filter.get_code_nco(d_code_error_chips); // [chips/second] + d_code_error_filt_chips = d_code_loop_filter.get_code_nco(d_code_error_chips); // [chips/second] } void galileo_e1_dll_pll_veml_tracking_cc::clear_tracking_vars() { - *d_Very_Early = gr_complex(0,0); - *d_Early = gr_complex(0,0); - *d_Prompt = gr_complex(0,0); - *d_Late = gr_complex(0,0); - *d_Very_Late= gr_complex(0,0); + *d_Very_Early = gr_complex(0, 0); + *d_Early = gr_complex(0, 0); + *d_Prompt = gr_complex(0, 0); + *d_Late = gr_complex(0, 0); + *d_Very_Late = gr_complex(0, 0); d_carr_error_hz = 0.0; d_carr_error_filt_hz = 0.0; d_code_error_chips = 0.0; @@ -570,7 +569,7 @@ void galileo_e1_dll_pll_veml_tracking_cc::clear_tracking_vars() void galileo_e1_dll_pll_veml_tracking_cc::log_data() { - if(d_dump) + if (d_dump) { // Dump results to file float prompt_I; @@ -589,372 +588,372 @@ void galileo_e1_dll_pll_veml_tracking_cc::log_data() tmp_VL = std::abs(d_VL_accu); try - { + { // Dump correlators output - d_dump_file.write(reinterpret_cast(&tmp_VE), sizeof(float)); - d_dump_file.write(reinterpret_cast(&tmp_E), sizeof(float)); - d_dump_file.write(reinterpret_cast(&tmp_P), sizeof(float)); - d_dump_file.write(reinterpret_cast(&tmp_L), sizeof(float)); - d_dump_file.write(reinterpret_cast(&tmp_VL), sizeof(float)); + d_dump_file.write(reinterpret_cast(&tmp_VE), sizeof(float)); + d_dump_file.write(reinterpret_cast(&tmp_E), sizeof(float)); + d_dump_file.write(reinterpret_cast(&tmp_P), sizeof(float)); + d_dump_file.write(reinterpret_cast(&tmp_L), sizeof(float)); + d_dump_file.write(reinterpret_cast(&tmp_VL), sizeof(float)); // PROMPT I and Q (to analyze navigation symbols) - d_dump_file.write(reinterpret_cast(&prompt_I), sizeof(float)); - d_dump_file.write(reinterpret_cast(&prompt_Q), sizeof(float)); + d_dump_file.write(reinterpret_cast(&prompt_I), sizeof(float)); + d_dump_file.write(reinterpret_cast(&prompt_Q), sizeof(float)); // PRN start sample stamp - d_dump_file.write(reinterpret_cast(&d_sample_counter), sizeof(unsigned long int)); + d_dump_file.write(reinterpret_cast(&d_sample_counter), sizeof(unsigned long int)); // accumulated carrier phase tmp_float = d_acc_carrier_phase_rad; - d_dump_file.write(reinterpret_cast(&tmp_float), sizeof(float)); + d_dump_file.write(reinterpret_cast(&tmp_float), sizeof(float)); // carrier and code frequency tmp_float = d_carrier_doppler_hz; - d_dump_file.write(reinterpret_cast(&tmp_float), sizeof(float)); + d_dump_file.write(reinterpret_cast(&tmp_float), sizeof(float)); tmp_float = d_code_freq_chips; - d_dump_file.write(reinterpret_cast(&tmp_float), sizeof(float)); + d_dump_file.write(reinterpret_cast(&tmp_float), sizeof(float)); // PLL commands tmp_float = d_carr_error_hz; - d_dump_file.write(reinterpret_cast(&tmp_float), sizeof(float)); + d_dump_file.write(reinterpret_cast(&tmp_float), sizeof(float)); tmp_float = d_carr_error_filt_hz; - d_dump_file.write(reinterpret_cast(&tmp_float), sizeof(float)); + d_dump_file.write(reinterpret_cast(&tmp_float), sizeof(float)); // DLL commands tmp_float = d_code_error_chips; - d_dump_file.write(reinterpret_cast(&tmp_float), sizeof(float)); + d_dump_file.write(reinterpret_cast(&tmp_float), sizeof(float)); tmp_float = d_code_error_filt_chips; - d_dump_file.write(reinterpret_cast(&tmp_float), sizeof(float)); + d_dump_file.write(reinterpret_cast(&tmp_float), sizeof(float)); // CN0 and carrier lock test tmp_float = d_CN0_SNV_dB_Hz; - d_dump_file.write(reinterpret_cast(&tmp_float), sizeof(float)); + d_dump_file.write(reinterpret_cast(&tmp_float), sizeof(float)); tmp_float = d_carrier_lock_test; - d_dump_file.write(reinterpret_cast(&tmp_float), sizeof(float)); + d_dump_file.write(reinterpret_cast(&tmp_float), sizeof(float)); // AUX vars (for debug purposes) tmp_float = d_rem_code_phase_samples; - d_dump_file.write(reinterpret_cast(&tmp_float), sizeof(float)); + d_dump_file.write(reinterpret_cast(&tmp_float), sizeof(float)); tmp_double = static_cast(d_sample_counter + d_current_prn_length_samples); - d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); + d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); // PRN unsigned int prn_ = d_acquisition_gnss_synchro->PRN; - d_dump_file.write(reinterpret_cast(&prn_), sizeof(unsigned int)); - } + d_dump_file.write(reinterpret_cast(&prn_), sizeof(unsigned int)); + } catch (const std::ifstream::failure &e) - { + { LOG(WARNING) << "Exception writing trk dump file " << e.what(); - } + } } } -int galileo_e1_dll_pll_veml_tracking_cc::general_work (int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), - gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) +int galileo_e1_dll_pll_veml_tracking_cc::general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), + gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { // Block input data and block output stream pointers - const gr_complex* in = reinterpret_cast(input_items[0]); + const gr_complex *in = reinterpret_cast(input_items[0]); Gnss_Synchro **out = reinterpret_cast(&output_items[0]); // GNSS_SYNCHRO OBJECT to interchange data between tracking->telemetry_decoder Gnss_Synchro current_synchro_data = Gnss_Synchro(); - switch(d_state) - { - case 0: // standby - bypass + switch (d_state) { - current_synchro_data.Tracking_sample_counter = d_sample_counter; - break; - } - case 1: // pull-in - { - /* + case 0: // standby - bypass + { + current_synchro_data.Tracking_sample_counter = d_sample_counter; + break; + } + case 1: // pull-in + { + /* * Signal alignment (skip samples until the incoming signal is aligned with local replica) */ - // Fill the acquisition data - current_synchro_data = *d_acquisition_gnss_synchro; - int samples_offset; - double acq_trk_shif_correction_samples; - int acq_to_trk_delay_samples; - acq_to_trk_delay_samples = d_sample_counter - d_acq_sample_stamp; - acq_trk_shif_correction_samples = d_current_prn_length_samples - std::fmod(static_cast(acq_to_trk_delay_samples), static_cast(d_current_prn_length_samples)); - samples_offset = round(d_acq_code_phase_samples + acq_trk_shif_correction_samples); - current_synchro_data.Tracking_sample_counter = d_sample_counter; - current_synchro_data.fs = d_fs_in; - d_sample_counter = d_sample_counter + samples_offset; // count for the processed samples - consume_each(samples_offset); // shift input to perform alignment with local replica - d_state = 2; // next state is the symbol synchronization - return 0; + // Fill the acquisition data + current_synchro_data = *d_acquisition_gnss_synchro; + int samples_offset; + double acq_trk_shif_correction_samples; + int acq_to_trk_delay_samples; + acq_to_trk_delay_samples = d_sample_counter - d_acq_sample_stamp; + acq_trk_shif_correction_samples = d_current_prn_length_samples - std::fmod(static_cast(acq_to_trk_delay_samples), static_cast(d_current_prn_length_samples)); + samples_offset = round(d_acq_code_phase_samples + acq_trk_shif_correction_samples); + current_synchro_data.Tracking_sample_counter = d_sample_counter; + current_synchro_data.fs = d_fs_in; + d_sample_counter = d_sample_counter + samples_offset; // count for the processed samples + consume_each(samples_offset); // shift input to perform alignment with local replica + d_state = 2; // next state is the symbol synchronization + return 0; + } + case 2: // wide tracking and symbol synchronization + { + // Fill the acquisition data + current_synchro_data = *d_acquisition_gnss_synchro; + // Current NCO and code generator parameters + d_carrier_phase_step_rad = GALILEO_TWO_PI * d_carrier_doppler_hz / static_cast(d_fs_in); + d_code_phase_step_chips = d_code_freq_chips / static_cast(d_fs_in); + d_rem_code_phase_chips = d_rem_code_phase_samples * d_code_freq_chips / d_fs_in; + // perform a correlation step + do_correlation_step(in); + // save single correlation step variables + d_VE_accu = *d_Very_Early; + d_E_accu = *d_Early; + d_P_accu = *d_Prompt; + d_L_accu = *d_Late; + d_VL_accu = *d_Very_Late; + // check lock status + if (cn0_and_tracking_lock_status() == false) + { + clear_tracking_vars(); + d_state = 0; // loss-of-lock detected + } + else + { + // perform DLL/PLL tracking loop computations + run_dll_pll(false); + + // ################## PLL COMMANDS ################################################# + // carrier phase accumulator for (K) Doppler estimation- + d_acc_carrier_phase_rad -= GALILEO_TWO_PI * d_carrier_doppler_hz * static_cast(d_current_prn_length_samples) / static_cast(d_fs_in); + // remnant carrier phase to prevent overflow in the code NCO + d_rem_carr_phase_rad = d_rem_carr_phase_rad + GALILEO_TWO_PI * d_carrier_doppler_hz * static_cast(d_current_prn_length_samples) / static_cast(d_fs_in); + d_rem_carr_phase_rad = std::fmod(d_rem_carr_phase_rad, GALILEO_TWO_PI); + + // ################## DLL COMMANDS ################################################# + // Code error from DLL + double code_error_filt_secs; + code_error_filt_secs = (Galileo_E1_CODE_PERIOD * d_code_error_filt_chips) / Galileo_E1_CODE_CHIP_RATE_HZ; // [seconds] + + // ################## CARRIER AND CODE NCO BUFFER ALIGNEMENT ####################### + // keep alignment parameters for the next input buffer + // Compute the next buffer length based in the new period of the PRN sequence and the code phase error estimation + double T_chip_seconds = 1.0 / d_code_freq_chips; + double T_prn_seconds = T_chip_seconds * Galileo_E1_B_CODE_LENGTH_CHIPS; + double T_prn_samples = T_prn_seconds * static_cast(d_fs_in); + double K_blk_samples = T_prn_samples + d_rem_code_phase_samples + code_error_filt_secs * static_cast(d_fs_in); + d_current_prn_length_samples = round(K_blk_samples); // round to a discrete number of samples + + // ########### Output the tracking results to Telemetry block ########## + if (d_track_pilot) + { + current_synchro_data.Prompt_I = static_cast((*d_Prompt_Data).real()); + current_synchro_data.Prompt_Q = static_cast((*d_Prompt_Data).imag()); + } + else + { + current_synchro_data.Prompt_I = static_cast((*d_Prompt).real()); + current_synchro_data.Prompt_Q = static_cast((*d_Prompt).imag()); + } + current_synchro_data.Tracking_sample_counter = d_sample_counter; + current_synchro_data.Code_phase_samples = d_rem_code_phase_samples; + // compute remnant code phase samples AFTER the Tracking timestamp + d_rem_code_phase_samples = K_blk_samples - d_current_prn_length_samples; // rounding error < 1 sample + current_synchro_data.Carrier_phase_rads = d_acc_carrier_phase_rad; + current_synchro_data.Carrier_Doppler_hz = d_carrier_doppler_hz; + current_synchro_data.CN0_dB_hz = d_CN0_SNV_dB_Hz; + current_synchro_data.Flag_valid_symbol_output = true; + current_synchro_data.correlation_length_ms = Galileo_E1_CODE_PERIOD_MS; + + // enable write dump file this cycle (valid DLL/PLL cycle) + log_data(); + + //std::cout<<(d_Prompt->real()>0); + if (d_enable_extended_integration) + { + // ####### SECONDARY CODE LOCK ##### + d_Prompt_buffer_deque.push_back(*d_Prompt); + if (d_Prompt_buffer_deque.size() == Galileo_E1_C_SECONDARY_CODE_LENGTH) + { + if (acquire_secondary() == true) + { + d_extend_correlation_symbols_count = 0; + // reset extended correlator + d_VE_accu = gr_complex(0, 0); + d_E_accu = gr_complex(0, 0); + d_P_accu = gr_complex(0, 0); + d_L_accu = gr_complex(0, 0); + d_VL_accu = gr_complex(0, 0); + d_Prompt_buffer_deque.clear(); + d_current_symbol = 0; + d_code_loop_filter.set_DLL_BW(d_dll_bw_narrow_hz); + d_carrier_loop_filter.set_PLL_BW(d_pll_bw_narrow_hz); + + // Set TAPs delay values [chips] + d_local_code_shift_chips[0] = -d_very_early_late_spc_narrow_chips; + d_local_code_shift_chips[1] = -d_early_late_spc_narrow_chips; + d_local_code_shift_chips[2] = 0.0; + d_local_code_shift_chips[3] = d_early_late_spc_narrow_chips; + d_local_code_shift_chips[4] = d_very_early_late_spc_narrow_chips; + + LOG(INFO) << "Enabled " << d_extend_correlation_symbols << " [symbols] extended correlator for CH " + << d_channel + << " : Satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN); + std::cout << "Enabled " << d_extend_correlation_symbols << " [symbols] extended correlator for CH " + << d_channel + << " : Satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << std::endl; + //std::cout << " pll_bw = " << d_pll_bw_hz << " [Hz], pll_narrow_bw = " << d_pll_bw_narrow_hz << " [Hz]" << std::endl; + //std::cout << " dll_bw = " << d_dll_bw_hz << " [Hz], dll_narrow_bw = " << d_dll_bw_narrow_hz << " [Hz]" << std::endl; + + // UPDATE INTEGRATION TIME + double new_correlation_time_s = static_cast(d_extend_correlation_symbols) * Galileo_E1_CODE_PERIOD; + d_carrier_loop_filter.set_pdi(new_correlation_time_s); + d_code_loop_filter.set_pdi(new_correlation_time_s); + + d_state = 3; // next state is the extended correlator integrator + } + + d_Prompt_buffer_deque.pop_front(); + } + } + } + break; + } + case 3: // coherent integration (correlation time extension) + { + // Fill the acquisition data + current_synchro_data = *d_acquisition_gnss_synchro; + // Current NCO and code generator parameters + d_carrier_phase_step_rad = GALILEO_TWO_PI * d_carrier_doppler_hz / static_cast(d_fs_in); + d_code_phase_step_chips = d_code_freq_chips / static_cast(d_fs_in); + d_rem_code_phase_chips = d_rem_code_phase_samples * d_code_freq_chips / d_fs_in; + // perform a correlation step + do_correlation_step(in); + // correct the integration sign using the current symbol of the secondary code + if (Galileo_E1_C_SECONDARY_CODE.at(d_current_symbol) == '0') + { + d_VE_accu += *d_Very_Early; + d_E_accu += *d_Early; + d_P_accu += *d_Prompt; + d_L_accu += *d_Late; + d_VL_accu += *d_Very_Late; + } + else + { + d_VE_accu -= *d_Very_Early; + d_E_accu -= *d_Early; + d_P_accu -= *d_Prompt; + d_L_accu -= *d_Late; + d_VL_accu -= *d_Very_Late; + } + d_current_symbol++; + // secondary code roll-up + d_current_symbol = d_current_symbol % Galileo_E1_C_SECONDARY_CODE_LENGTH; + + // PLL/DLL not enabled, we are in the middle of a coherent integration + // keep alignment parameters for the next input buffer + // Compute the next buffer length based in the new period of the PRN sequence and the code phase error estimation + + // ################## PLL ########################################################## + // carrier phase accumulator for (K) Doppler estimation- + d_acc_carrier_phase_rad -= GALILEO_TWO_PI * d_carrier_doppler_hz * static_cast(d_current_prn_length_samples) / static_cast(d_fs_in); + // remnant carrier phase to prevent overflow in the code NCO + d_rem_carr_phase_rad = d_rem_carr_phase_rad + GALILEO_TWO_PI * d_carrier_doppler_hz * static_cast(d_current_prn_length_samples) / static_cast(d_fs_in); + d_rem_carr_phase_rad = std::fmod(d_rem_carr_phase_rad, GALILEO_TWO_PI); + + // ################## CARRIER AND CODE NCO BUFFER ALIGNEMENT ####################### + // keep alignment parameters for the next input buffer + // Compute the next buffer length based in the new period of the PRN sequence and the code phase error estimation + double T_chip_seconds = 1.0 / d_code_freq_chips; + double T_prn_seconds = T_chip_seconds * Galileo_E1_B_CODE_LENGTH_CHIPS; + double T_prn_samples = T_prn_seconds * static_cast(d_fs_in); + double K_blk_samples = T_prn_samples + d_rem_code_phase_samples; + d_current_prn_length_samples = round(K_blk_samples); //round to a discrete samples + + // ########### Output the tracking results to Telemetry block ########## + current_synchro_data.Prompt_I = static_cast((*d_Prompt_Data).real()); + current_synchro_data.Prompt_Q = static_cast((*d_Prompt_Data).imag()); + current_synchro_data.Tracking_sample_counter = d_sample_counter; + current_synchro_data.Code_phase_samples = d_rem_code_phase_samples; + // compute remnant code phase samples AFTER the Tracking timestamp + d_rem_code_phase_samples = K_blk_samples - d_current_prn_length_samples; //rounding error < 1 sample + current_synchro_data.Carrier_phase_rads = d_acc_carrier_phase_rad; + current_synchro_data.Carrier_Doppler_hz = d_carrier_doppler_hz; + current_synchro_data.CN0_dB_hz = d_CN0_SNV_dB_Hz; + current_synchro_data.Flag_valid_symbol_output = true; + current_synchro_data.correlation_length_ms = Galileo_E1_CODE_PERIOD_MS; + + d_extend_correlation_symbols_count++; + if (d_extend_correlation_symbols_count >= (d_extend_correlation_symbols - 1)) + { + d_extend_correlation_symbols_count = 0; + d_state = 4; + } + break; + } + case 4: // narrow tracking + { + // Fill the acquisition data + current_synchro_data = *d_acquisition_gnss_synchro; + // perform a correlation step + do_correlation_step(in); + + // correct the integration using the current symbol + if (Galileo_E1_C_SECONDARY_CODE.at(d_current_symbol) == '0') + { + d_VE_accu += *d_Very_Early; + d_E_accu += *d_Early; + d_P_accu += *d_Prompt; + d_L_accu += *d_Late; + d_VL_accu += *d_Very_Late; + } + else + { + d_VE_accu -= *d_Very_Early; + d_E_accu -= *d_Early; + d_P_accu -= *d_Prompt; + d_L_accu -= *d_Late; + d_VL_accu -= *d_Very_Late; + } + d_current_symbol++; + // secondary code roll-up + d_current_symbol = d_current_symbol % Galileo_E1_C_SECONDARY_CODE_LENGTH; + + // check lock status + if (cn0_and_tracking_lock_status() == false) + { + clear_tracking_vars(); + d_state = 0; // loss-of-lock detected + } + else + { + run_dll_pll(true); // Costas loop disabled, use four quadrant atan + + // ################## PLL ########################################################## + // carrier phase accumulator for (K) Doppler estimation- + d_acc_carrier_phase_rad -= GALILEO_TWO_PI * d_carrier_doppler_hz * static_cast(d_current_prn_length_samples) / static_cast(d_fs_in); + // remnant carrier phase to prevent overflow in the code NCO + d_rem_carr_phase_rad = d_rem_carr_phase_rad + GALILEO_TWO_PI * d_carrier_doppler_hz * static_cast(d_current_prn_length_samples) / static_cast(d_fs_in); + d_rem_carr_phase_rad = std::fmod(d_rem_carr_phase_rad, GALILEO_TWO_PI); + + // ################## DLL ########################################################## + // Code phase accumulator + double code_error_filt_secs; + code_error_filt_secs = (Galileo_E1_CODE_PERIOD * d_code_error_filt_chips) / Galileo_E1_CODE_CHIP_RATE_HZ; //[seconds] + + // ################## CARRIER AND CODE NCO BUFFER ALIGNEMENT ####################### + // keep alignment parameters for the next input buffer + // Compute the next buffer length based in the new period of the PRN sequence and the code phase error estimation + double T_chip_seconds = 1.0 / d_code_freq_chips; + double T_prn_seconds = T_chip_seconds * Galileo_E1_B_CODE_LENGTH_CHIPS; + double T_prn_samples = T_prn_seconds * static_cast(d_fs_in); + double K_blk_samples = T_prn_samples + d_rem_code_phase_samples + code_error_filt_secs * static_cast(d_fs_in); + d_current_prn_length_samples = round(K_blk_samples); // round to a discrete number of samples + + // ########### Output the tracking results to Telemetry block ########## + current_synchro_data.Prompt_I = static_cast((*d_Prompt_Data).real()); + current_synchro_data.Prompt_Q = static_cast((*d_Prompt_Data).imag()); + current_synchro_data.Tracking_sample_counter = d_sample_counter; + current_synchro_data.Code_phase_samples = d_rem_code_phase_samples; + // compute remnant code phase samples AFTER the Tracking timestamp + d_rem_code_phase_samples = K_blk_samples - d_current_prn_length_samples; //rounding error < 1 sample + current_synchro_data.Carrier_phase_rads = d_acc_carrier_phase_rad; + current_synchro_data.Carrier_Doppler_hz = d_carrier_doppler_hz; + current_synchro_data.CN0_dB_hz = d_CN0_SNV_dB_Hz; + current_synchro_data.Flag_valid_symbol_output = true; + current_synchro_data.correlation_length_ms = Galileo_E1_CODE_PERIOD_MS; + // enable write dump file this cycle (valid DLL/PLL cycle) + log_data(); + // reset extended correlator + d_VE_accu = gr_complex(0, 0); + d_E_accu = gr_complex(0, 0); + d_P_accu = gr_complex(0, 0); + d_L_accu = gr_complex(0, 0); + d_VL_accu = gr_complex(0, 0); + d_state = 3; //new coherent integration (correlation time extension) cycle + } + } } - case 2: // wide tracking and symbol synchronization - { - // Fill the acquisition data - current_synchro_data = *d_acquisition_gnss_synchro; - // Current NCO and code generator parameters - d_carrier_phase_step_rad = GALILEO_TWO_PI * d_carrier_doppler_hz / static_cast(d_fs_in); - d_code_phase_step_chips = d_code_freq_chips / static_cast(d_fs_in); - d_rem_code_phase_chips = d_rem_code_phase_samples * d_code_freq_chips / d_fs_in; - // perform a correlation step - do_correlation_step(in); - // save single correlation step variables - d_VE_accu = *d_Very_Early; - d_E_accu = *d_Early; - d_P_accu = *d_Prompt; - d_L_accu = *d_Late; - d_VL_accu = *d_Very_Late; - // check lock status - if (cn0_and_tracking_lock_status() == false) - { - clear_tracking_vars(); - d_state = 0; // loss-of-lock detected - } - else - { - // perform DLL/PLL tracking loop computations - run_dll_pll(false); - - // ################## PLL COMMANDS ################################################# - // carrier phase accumulator for (K) Doppler estimation- - d_acc_carrier_phase_rad -= GALILEO_TWO_PI * d_carrier_doppler_hz * static_cast(d_current_prn_length_samples) / static_cast(d_fs_in); - // remnant carrier phase to prevent overflow in the code NCO - d_rem_carr_phase_rad = d_rem_carr_phase_rad + GALILEO_TWO_PI * d_carrier_doppler_hz * static_cast(d_current_prn_length_samples) / static_cast(d_fs_in); - d_rem_carr_phase_rad = std::fmod(d_rem_carr_phase_rad, GALILEO_TWO_PI); - - // ################## DLL COMMANDS ################################################# - // Code error from DLL - double code_error_filt_secs; - code_error_filt_secs = (Galileo_E1_CODE_PERIOD * d_code_error_filt_chips) / Galileo_E1_CODE_CHIP_RATE_HZ; // [seconds] - - // ################## CARRIER AND CODE NCO BUFFER ALIGNEMENT ####################### - // keep alignment parameters for the next input buffer - // Compute the next buffer length based in the new period of the PRN sequence and the code phase error estimation - double T_chip_seconds = 1.0 / d_code_freq_chips; - double T_prn_seconds = T_chip_seconds * Galileo_E1_B_CODE_LENGTH_CHIPS; - double T_prn_samples = T_prn_seconds * static_cast(d_fs_in); - double K_blk_samples = T_prn_samples + d_rem_code_phase_samples + code_error_filt_secs * static_cast(d_fs_in); - d_current_prn_length_samples = round(K_blk_samples); // round to a discrete number of samples - - // ########### Output the tracking results to Telemetry block ########## - if (d_track_pilot) - { - current_synchro_data.Prompt_I = static_cast((*d_Prompt_Data).real()); - current_synchro_data.Prompt_Q = static_cast((*d_Prompt_Data).imag()); - } - else - { - current_synchro_data.Prompt_I = static_cast((*d_Prompt).real()); - current_synchro_data.Prompt_Q = static_cast((*d_Prompt).imag()); - } - current_synchro_data.Tracking_sample_counter = d_sample_counter; - current_synchro_data.Code_phase_samples = d_rem_code_phase_samples; - // compute remnant code phase samples AFTER the Tracking timestamp - d_rem_code_phase_samples = K_blk_samples - d_current_prn_length_samples; // rounding error < 1 sample - current_synchro_data.Carrier_phase_rads = d_acc_carrier_phase_rad; - current_synchro_data.Carrier_Doppler_hz = d_carrier_doppler_hz; - current_synchro_data.CN0_dB_hz = d_CN0_SNV_dB_Hz; - current_synchro_data.Flag_valid_symbol_output = true; - current_synchro_data.correlation_length_ms = Galileo_E1_CODE_PERIOD_MS; - - // enable write dump file this cycle (valid DLL/PLL cycle) - log_data(); - - //std::cout<<(d_Prompt->real()>0); - if (d_enable_extended_integration) - { - // ####### SECONDARY CODE LOCK ##### - d_Prompt_buffer_deque.push_back(*d_Prompt); - if (d_Prompt_buffer_deque.size() == Galileo_E1_C_SECONDARY_CODE_LENGTH) - { - if (acquire_secondary() == true) - { - d_extend_correlation_symbols_count = 0; - // reset extended correlator - d_VE_accu = gr_complex(0,0); - d_E_accu = gr_complex(0,0); - d_P_accu = gr_complex(0,0); - d_L_accu = gr_complex(0,0); - d_VL_accu = gr_complex(0,0); - d_Prompt_buffer_deque.clear(); - d_current_symbol = 0; - d_code_loop_filter.set_DLL_BW(d_dll_bw_narrow_hz); - d_carrier_loop_filter.set_PLL_BW(d_pll_bw_narrow_hz); - - // Set TAPs delay values [chips] - d_local_code_shift_chips[0] = - d_very_early_late_spc_narrow_chips; - d_local_code_shift_chips[1] = - d_early_late_spc_narrow_chips; - d_local_code_shift_chips[2] = 0.0; - d_local_code_shift_chips[3] = d_early_late_spc_narrow_chips; - d_local_code_shift_chips[4] = d_very_early_late_spc_narrow_chips; - - LOG(INFO) << "Enabled " << d_extend_correlation_symbols << " [symbols] extended correlator for CH " - << d_channel - << " : Satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN); - std::cout << "Enabled " << d_extend_correlation_symbols << " [symbols] extended correlator for CH " - << d_channel - << " : Satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << std::endl; - //std::cout << " pll_bw = " << d_pll_bw_hz << " [Hz], pll_narrow_bw = " << d_pll_bw_narrow_hz << " [Hz]" << std::endl; - //std::cout << " dll_bw = " << d_dll_bw_hz << " [Hz], dll_narrow_bw = " << d_dll_bw_narrow_hz << " [Hz]" << std::endl; - - // UPDATE INTEGRATION TIME - double new_correlation_time_s = static_cast(d_extend_correlation_symbols) * Galileo_E1_CODE_PERIOD; - d_carrier_loop_filter.set_pdi(new_correlation_time_s); - d_code_loop_filter.set_pdi(new_correlation_time_s); - - d_state = 3; // next state is the extended correlator integrator - } - - d_Prompt_buffer_deque.pop_front(); - } - } - } - break; - } - case 3: // coherent integration (correlation time extension) - { - // Fill the acquisition data - current_synchro_data = *d_acquisition_gnss_synchro; - // Current NCO and code generator parameters - d_carrier_phase_step_rad = GALILEO_TWO_PI * d_carrier_doppler_hz / static_cast(d_fs_in); - d_code_phase_step_chips = d_code_freq_chips / static_cast(d_fs_in); - d_rem_code_phase_chips = d_rem_code_phase_samples * d_code_freq_chips / d_fs_in; - // perform a correlation step - do_correlation_step(in); - // correct the integration sign using the current symbol of the secondary code - if (Galileo_E1_C_SECONDARY_CODE.at(d_current_symbol) == '0') - { - d_VE_accu += *d_Very_Early; - d_E_accu += *d_Early; - d_P_accu += *d_Prompt; - d_L_accu += *d_Late; - d_VL_accu += *d_Very_Late; - } - else - { - d_VE_accu -= *d_Very_Early; - d_E_accu -= *d_Early; - d_P_accu -= *d_Prompt; - d_L_accu -= *d_Late; - d_VL_accu -= *d_Very_Late; - } - d_current_symbol++; - // secondary code roll-up - d_current_symbol = d_current_symbol % Galileo_E1_C_SECONDARY_CODE_LENGTH; - - // PLL/DLL not enabled, we are in the middle of a coherent integration - // keep alignment parameters for the next input buffer - // Compute the next buffer length based in the new period of the PRN sequence and the code phase error estimation - - // ################## PLL ########################################################## - // carrier phase accumulator for (K) Doppler estimation- - d_acc_carrier_phase_rad -= GALILEO_TWO_PI * d_carrier_doppler_hz * static_cast(d_current_prn_length_samples) / static_cast(d_fs_in); - // remnant carrier phase to prevent overflow in the code NCO - d_rem_carr_phase_rad = d_rem_carr_phase_rad + GALILEO_TWO_PI * d_carrier_doppler_hz * static_cast(d_current_prn_length_samples) / static_cast(d_fs_in); - d_rem_carr_phase_rad = std::fmod(d_rem_carr_phase_rad, GALILEO_TWO_PI); - - // ################## CARRIER AND CODE NCO BUFFER ALIGNEMENT ####################### - // keep alignment parameters for the next input buffer - // Compute the next buffer length based in the new period of the PRN sequence and the code phase error estimation - double T_chip_seconds = 1.0 / d_code_freq_chips; - double T_prn_seconds = T_chip_seconds * Galileo_E1_B_CODE_LENGTH_CHIPS; - double T_prn_samples = T_prn_seconds * static_cast(d_fs_in); - double K_blk_samples = T_prn_samples + d_rem_code_phase_samples; - d_current_prn_length_samples = round(K_blk_samples); //round to a discrete samples - - // ########### Output the tracking results to Telemetry block ########## - current_synchro_data.Prompt_I = static_cast((*d_Prompt_Data).real()); - current_synchro_data.Prompt_Q = static_cast((*d_Prompt_Data).imag()); - current_synchro_data.Tracking_sample_counter = d_sample_counter; - current_synchro_data.Code_phase_samples = d_rem_code_phase_samples; - // compute remnant code phase samples AFTER the Tracking timestamp - d_rem_code_phase_samples = K_blk_samples - d_current_prn_length_samples; //rounding error < 1 sample - current_synchro_data.Carrier_phase_rads = d_acc_carrier_phase_rad; - current_synchro_data.Carrier_Doppler_hz = d_carrier_doppler_hz; - current_synchro_data.CN0_dB_hz = d_CN0_SNV_dB_Hz; - current_synchro_data.Flag_valid_symbol_output = true; - current_synchro_data.correlation_length_ms = Galileo_E1_CODE_PERIOD_MS; - - d_extend_correlation_symbols_count++; - if (d_extend_correlation_symbols_count >= (d_extend_correlation_symbols - 1)) - { - d_extend_correlation_symbols_count = 0; - d_state = 4; - } - break; - } - case 4: // narrow tracking - { - // Fill the acquisition data - current_synchro_data = *d_acquisition_gnss_synchro; - // perform a correlation step - do_correlation_step(in); - - // correct the integration using the current symbol - if (Galileo_E1_C_SECONDARY_CODE.at(d_current_symbol) == '0') - { - d_VE_accu += *d_Very_Early; - d_E_accu += *d_Early; - d_P_accu += *d_Prompt; - d_L_accu += *d_Late; - d_VL_accu += *d_Very_Late; - } - else - { - d_VE_accu -= *d_Very_Early; - d_E_accu -= *d_Early; - d_P_accu -= *d_Prompt; - d_L_accu -= *d_Late; - d_VL_accu -= *d_Very_Late; - } - d_current_symbol++; - // secondary code roll-up - d_current_symbol = d_current_symbol % Galileo_E1_C_SECONDARY_CODE_LENGTH; - - // check lock status - if (cn0_and_tracking_lock_status() == false) - { - clear_tracking_vars(); - d_state = 0; // loss-of-lock detected - } - else - { - run_dll_pll(true); // Costas loop disabled, use four quadrant atan - - // ################## PLL ########################################################## - // carrier phase accumulator for (K) Doppler estimation- - d_acc_carrier_phase_rad -= GALILEO_TWO_PI * d_carrier_doppler_hz * static_cast(d_current_prn_length_samples) / static_cast(d_fs_in); - // remnant carrier phase to prevent overflow in the code NCO - d_rem_carr_phase_rad = d_rem_carr_phase_rad + GALILEO_TWO_PI * d_carrier_doppler_hz * static_cast(d_current_prn_length_samples) / static_cast(d_fs_in); - d_rem_carr_phase_rad = std::fmod(d_rem_carr_phase_rad, GALILEO_TWO_PI); - - // ################## DLL ########################################################## - // Code phase accumulator - double code_error_filt_secs; - code_error_filt_secs = (Galileo_E1_CODE_PERIOD * d_code_error_filt_chips) / Galileo_E1_CODE_CHIP_RATE_HZ; //[seconds] - - // ################## CARRIER AND CODE NCO BUFFER ALIGNEMENT ####################### - // keep alignment parameters for the next input buffer - // Compute the next buffer length based in the new period of the PRN sequence and the code phase error estimation - double T_chip_seconds = 1.0 / d_code_freq_chips; - double T_prn_seconds = T_chip_seconds * Galileo_E1_B_CODE_LENGTH_CHIPS; - double T_prn_samples = T_prn_seconds * static_cast(d_fs_in); - double K_blk_samples = T_prn_samples + d_rem_code_phase_samples + code_error_filt_secs * static_cast(d_fs_in); - d_current_prn_length_samples = round(K_blk_samples); // round to a discrete number of samples - - // ########### Output the tracking results to Telemetry block ########## - current_synchro_data.Prompt_I = static_cast((*d_Prompt_Data).real()); - current_synchro_data.Prompt_Q = static_cast((*d_Prompt_Data).imag()); - current_synchro_data.Tracking_sample_counter = d_sample_counter; - current_synchro_data.Code_phase_samples = d_rem_code_phase_samples; - // compute remnant code phase samples AFTER the Tracking timestamp - d_rem_code_phase_samples = K_blk_samples - d_current_prn_length_samples; //rounding error < 1 sample - current_synchro_data.Carrier_phase_rads = d_acc_carrier_phase_rad; - current_synchro_data.Carrier_Doppler_hz = d_carrier_doppler_hz; - current_synchro_data.CN0_dB_hz = d_CN0_SNV_dB_Hz; - current_synchro_data.Flag_valid_symbol_output = true; - current_synchro_data.correlation_length_ms = Galileo_E1_CODE_PERIOD_MS; - // enable write dump file this cycle (valid DLL/PLL cycle) - log_data(); - // reset extended correlator - d_VE_accu = gr_complex(0,0); - d_E_accu = gr_complex(0,0); - d_P_accu = gr_complex(0,0); - d_L_accu = gr_complex(0,0); - d_VL_accu = gr_complex(0,0); - d_state = 3; //new coherent integration (correlation time extension) cycle - } - } - } //assign the GNURadio block output data // current_synchro_data.System = {'E'}; @@ -965,8 +964,8 @@ int galileo_e1_dll_pll_veml_tracking_cc::general_work (int noutput_items __attri current_synchro_data.fs = d_fs_in; *out[0] = current_synchro_data; - consume_each(d_current_prn_length_samples); // this is required for gr_block derivates - d_sample_counter += d_current_prn_length_samples; // count for the processed samples + consume_each(d_current_prn_length_samples); // this is required for gr_block derivates + d_sample_counter += d_current_prn_length_samples; // count for the processed samples if (current_synchro_data.Flag_valid_symbol_output) { @@ -986,18 +985,18 @@ int galileo_e1_dll_pll_veml_tracking_cc::save_matfile() int number_of_double_vars = 1; int number_of_float_vars = 17; int epoch_size_bytes = sizeof(unsigned long int) + sizeof(double) * number_of_double_vars + - sizeof(float) * number_of_float_vars + sizeof(unsigned int); + sizeof(float) * number_of_float_vars + sizeof(unsigned int); std::ifstream dump_file; dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); try - { + { dump_file.open(d_dump_filename.c_str(), std::ios::binary | std::ios::ate); - } - catch(const std::ifstream::failure &e) - { - std::cerr << "Problem opening dump file:" << e.what() << std::endl; + } + catch (const std::ifstream::failure &e) + { + std::cerr << "Problem opening dump file:" << e.what() << std::endl; return 1; - } + } // count number of epochs and rewind long int num_epoch = 0; if (dump_file.is_open()) @@ -1010,32 +1009,32 @@ int galileo_e1_dll_pll_veml_tracking_cc::save_matfile() { return 1; } - float * abs_VE = new float [num_epoch]; - float * abs_E = new float [num_epoch]; - float * abs_P = new float [num_epoch]; - float * abs_L = new float [num_epoch]; - float * abs_VL = new float [num_epoch]; - float * Prompt_I = new float [num_epoch]; - float * Prompt_Q = new float [num_epoch]; - unsigned long int * PRN_start_sample_count = new unsigned long int [num_epoch]; - float * acc_carrier_phase_rad = new float [num_epoch]; - float * carrier_doppler_hz = new float [num_epoch]; - float * code_freq_chips = new float [num_epoch]; - float * carr_error_hz = new float [num_epoch]; - float * carr_error_filt_hz = new float [num_epoch]; - float * code_error_chips = new float [num_epoch]; - float * code_error_filt_chips = new float [num_epoch]; - float * CN0_SNV_dB_Hz = new float [num_epoch]; - float * carrier_lock_test = new float [num_epoch]; - float * aux1 = new float [num_epoch]; - double * aux2 = new double [num_epoch]; - unsigned int * PRN = new unsigned int [num_epoch]; + float *abs_VE = new float[num_epoch]; + float *abs_E = new float[num_epoch]; + float *abs_P = new float[num_epoch]; + float *abs_L = new float[num_epoch]; + float *abs_VL = new float[num_epoch]; + float *Prompt_I = new float[num_epoch]; + float *Prompt_Q = new float[num_epoch]; + unsigned long int *PRN_start_sample_count = new unsigned long int[num_epoch]; + float *acc_carrier_phase_rad = new float[num_epoch]; + float *carrier_doppler_hz = new float[num_epoch]; + float *code_freq_chips = new float[num_epoch]; + float *carr_error_hz = new float[num_epoch]; + float *carr_error_filt_hz = new float[num_epoch]; + float *code_error_chips = new float[num_epoch]; + float *code_error_filt_chips = new float[num_epoch]; + float *CN0_SNV_dB_Hz = new float[num_epoch]; + float *carrier_lock_test = new float[num_epoch]; + float *aux1 = new float[num_epoch]; + double *aux2 = new double[num_epoch]; + unsigned int *PRN = new unsigned int[num_epoch]; try - { + { if (dump_file.is_open()) { - for(long int i = 0; i < num_epoch; i++) + for (long int i = 0; i < num_epoch; i++) { dump_file.read(reinterpret_cast(&abs_VE[i]), sizeof(float)); dump_file.read(reinterpret_cast(&abs_E[i]), sizeof(float)); @@ -1060,10 +1059,10 @@ int galileo_e1_dll_pll_veml_tracking_cc::save_matfile() } } dump_file.close(); - } + } catch (const std::ifstream::failure &e) - { - std::cerr << "Problem reading dump file:" << e.what() << std::endl; + { + std::cerr << "Problem reading dump file:" << e.what() << std::endl; delete[] abs_VE; delete[] abs_E; delete[] abs_P; @@ -1085,7 +1084,7 @@ int galileo_e1_dll_pll_veml_tracking_cc::save_matfile() delete[] aux2; delete[] PRN; return 1; - } + } // WRITE MAT FILE mat_t *matfp; @@ -1094,87 +1093,87 @@ int galileo_e1_dll_pll_veml_tracking_cc::save_matfile() filename.erase(filename.length() - 4, 4); filename.append(".mat"); matfp = Mat_CreateVer(filename.c_str(), NULL, MAT_FT_MAT73); - if(reinterpret_cast(matfp) != NULL) + if (reinterpret_cast(matfp) != NULL) { size_t dims[2] = {1, static_cast(num_epoch)}; matvar = Mat_VarCreate("abs_VE", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, abs_E, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("abs_E", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, abs_E, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("abs_P", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, abs_P, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("abs_L", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, abs_L, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("abs_VL", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, abs_E, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("Prompt_I", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, Prompt_I, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("Prompt_Q", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, Prompt_Q, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("PRN_start_sample_count", MAT_C_UINT64, MAT_T_UINT64, 2, dims, PRN_start_sample_count, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("acc_carrier_phase_rad", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, acc_carrier_phase_rad, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("carrier_doppler_hz", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, carrier_doppler_hz, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("code_freq_chips", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, code_freq_chips, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("carr_error_hz", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, carr_error_hz, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("carr_error_filt_hz", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, carr_error_filt_hz, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("code_error_chips", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, code_error_chips, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("code_error_filt_chips", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, code_error_filt_chips, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("CN0_SNV_dB_Hz", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, CN0_SNV_dB_Hz, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("carrier_lock_test", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, carrier_lock_test, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("aux1", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, aux1, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("aux2", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, aux2, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("PRN", MAT_C_UINT32, MAT_T_UINT32, 2, dims, PRN, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); } Mat_Close(matfp); @@ -1212,23 +1211,23 @@ void galileo_e1_dll_pll_veml_tracking_cc::set_channel(unsigned int channel) if (d_dump_file.is_open() == false) { try - { + { d_dump_filename.append(boost::lexical_cast(d_channel)); d_dump_filename.append(".dat"); - d_dump_file.exceptions (std::ifstream::failbit | std::ifstream::badbit); + d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); LOG(INFO) << "Tracking dump enabled on channel " << d_channel << " Log file: " << d_dump_filename.c_str(); - } + } catch (const std::ifstream::failure &e) - { + { LOG(WARNING) << "channel " << d_channel << " Exception opening trk dump file " << e.what(); - } + } } } } -void galileo_e1_dll_pll_veml_tracking_cc::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) +void galileo_e1_dll_pll_veml_tracking_cc::set_gnss_synchro(Gnss_Synchro *p_gnss_synchro) { d_acquisition_gnss_synchro = p_gnss_synchro; } diff --git a/src/algorithms/tracking/gnuradio_blocks/galileo_e1_dll_pll_veml_tracking_cc.h b/src/algorithms/tracking/gnuradio_blocks/galileo_e1_dll_pll_veml_tracking_cc.h old mode 100755 new mode 100644 index 66be54e89..c82d01681 --- a/src/algorithms/tracking/gnuradio_blocks/galileo_e1_dll_pll_veml_tracking_cc.h +++ b/src/algorithms/tracking/gnuradio_blocks/galileo_e1_dll_pll_veml_tracking_cc.h @@ -48,32 +48,31 @@ typedef boost::shared_ptr galileo_e1_dll_pl galileo_e1_dll_pll_veml_tracking_cc_sptr galileo_e1_dll_pll_veml_make_tracking_cc(long if_freq, - long fs_in, unsigned - int vector_length, - bool dump, - std::string dump_filename, - float pll_bw_hz, - float dll_bw_hz, - float pll_bw_narrow_hz, - float dll_bw_narrow_hz, - float early_late_space_chips, - float very_early_late_space_chips, - float early_late_space_narrow_chips, - float very_early_late_space_narrow_chips, - int extend_correlation_symbols, - bool track_pilot); + long fs_in, unsigned int vector_length, + bool dump, + std::string dump_filename, + float pll_bw_hz, + float dll_bw_hz, + float pll_bw_narrow_hz, + float dll_bw_narrow_hz, + float early_late_space_chips, + float very_early_late_space_chips, + float early_late_space_narrow_chips, + float very_early_late_space_narrow_chips, + int extend_correlation_symbols, + bool track_pilot); /*! * \brief This class implements a code DLL + carrier PLL VEML (Very Early * Minus Late) tracking block for Galileo E1 signals */ -class galileo_e1_dll_pll_veml_tracking_cc: public gr::block +class galileo_e1_dll_pll_veml_tracking_cc : public gr::block { public: ~galileo_e1_dll_pll_veml_tracking_cc(); void set_channel(unsigned int channel); - void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro); + void set_gnss_synchro(Gnss_Synchro *p_gnss_synchro); void start_tracking(); /*! @@ -82,46 +81,45 @@ public: * A Software-Defined GPS and Galileo Receiver. A Single-Frequency Approach, * Birkhauser, 2007 */ - int general_work (int noutput_items, gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); + int general_work(int noutput_items, gr_vector_int &ninput_items, + gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); + + void forecast(int noutput_items, gr_vector_int &ninput_items_required); - void forecast (int noutput_items, gr_vector_int &ninput_items_required); private: friend galileo_e1_dll_pll_veml_tracking_cc_sptr galileo_e1_dll_pll_veml_make_tracking_cc(long if_freq, - long fs_in, unsigned - int vector_length, - bool dump, - std::string dump_filename, - float pll_bw_hz, - float dll_bw_hz, - float pll_bw_narrow_hz, - float dll_bw_narrow_hz, - float early_late_space_chips, - float very_early_late_space_chips, - float early_late_space_narrow_chips, - float very_early_late_space_narrow_chips, - int extend_correlation_symbols, - bool track_pilot); + long fs_in, unsigned int vector_length, + bool dump, + std::string dump_filename, + float pll_bw_hz, + float dll_bw_hz, + float pll_bw_narrow_hz, + float dll_bw_narrow_hz, + float early_late_space_chips, + float very_early_late_space_chips, + float early_late_space_narrow_chips, + float very_early_late_space_narrow_chips, + int extend_correlation_symbols, + bool track_pilot); galileo_e1_dll_pll_veml_tracking_cc(long if_freq, - long fs_in, unsigned - int vector_length, - bool dump, - std::string dump_filename, - float pll_bw_hz, - float dll_bw_hz, - float pll_bw_narrow_hz, - float dll_bw_narrow_hz, - float early_late_space_chips, - float very_early_late_space_chips, - float early_late_space_narrow_chips, - float very_early_late_space_narrow_chips, - int extend_correlation_symbols, - bool track_pilot); + long fs_in, unsigned int vector_length, + bool dump, + std::string dump_filename, + float pll_bw_hz, + float dll_bw_hz, + float pll_bw_narrow_hz, + float dll_bw_narrow_hz, + float early_late_space_chips, + float very_early_late_space_chips, + float early_late_space_narrow_chips, + float very_early_late_space_narrow_chips, + int extend_correlation_symbols, + bool track_pilot); bool cn0_and_tracking_lock_status(); - void do_correlation_step(const gr_complex* input_samples); + void do_correlation_step(const gr_complex *input_samples); void run_dll_pll(bool disable_costas_loop); void update_local_code(); void update_local_carrier(); @@ -135,7 +133,7 @@ private: unsigned int d_vector_length; bool d_dump; - Gnss_Synchro* d_acquisition_gnss_synchro; + Gnss_Synchro *d_acquisition_gnss_synchro; unsigned int d_channel; long d_if_freq; long d_fs_in; @@ -152,17 +150,17 @@ private: double d_early_late_spc_narrow_chips; double d_very_early_late_spc_narrow_chips; - float* d_tracking_code; - float* d_data_code; - float* d_local_code_shift_chips; - gr_complex* d_correlator_outs; + float *d_tracking_code; + float *d_data_code; + float *d_local_code_shift_chips; + gr_complex *d_correlator_outs; cpu_multicorrelator_real_codes multicorrelator_cpu; //todo: currently the multicorrelator does not support adding extra correlator //with different local code, thus we need extra multicorrelator instance. //Implement this functionality inside multicorrelator class //as an enhancement to increase the performance - float* d_local_code_data_shift_chips; - cpu_multicorrelator_real_codes correlator_data_cpu; //for data channel + float *d_local_code_data_shift_chips; + cpu_multicorrelator_real_codes correlator_data_cpu; //for data channel gr_complex *d_Very_Early; gr_complex *d_Early; @@ -227,7 +225,7 @@ private: // CN0 estimation and lock detector int d_cn0_estimation_counter; std::deque d_Prompt_buffer_deque; - gr_complex* d_Prompt_buffer; + gr_complex *d_Prompt_buffer; double d_carrier_lock_test; double d_CN0_SNV_dB_Hz; double d_carrier_lock_threshold; @@ -243,4 +241,4 @@ private: int save_matfile(); }; -#endif //GNSS_SDR_GALILEO_E1_DLL_PLL_VEML_TRACKING_CC_H +#endif //GNSS_SDR_GALILEO_E1_DLL_PLL_VEML_TRACKING_CC_H diff --git a/src/algorithms/tracking/gnuradio_blocks/galileo_e1_tcp_connector_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/galileo_e1_tcp_connector_tracking_cc.cc index d970da3a8..190248626 100644 --- a/src/algorithms/tracking/gnuradio_blocks/galileo_e1_tcp_connector_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/galileo_e1_tcp_connector_tracking_cc.cc @@ -60,50 +60,49 @@ using google::LogMessage; galileo_e1_tcp_connector_tracking_cc_sptr galileo_e1_tcp_connector_make_tracking_cc( - long if_freq, - long fs_in, - unsigned int vector_length, - bool dump, - std::string dump_filename, - float pll_bw_hz, - float dll_bw_hz, - float early_late_space_chips, - float very_early_late_space_chips, - size_t port_ch0) + long if_freq, + long fs_in, + unsigned int vector_length, + bool dump, + std::string dump_filename, + float pll_bw_hz, + float dll_bw_hz, + float early_late_space_chips, + float very_early_late_space_chips, + size_t port_ch0) { return galileo_e1_tcp_connector_tracking_cc_sptr(new Galileo_E1_Tcp_Connector_Tracking_cc(if_freq, - fs_in, vector_length, dump, dump_filename, pll_bw_hz, dll_bw_hz, early_late_space_chips, very_early_late_space_chips, port_ch0)); + fs_in, vector_length, dump, dump_filename, pll_bw_hz, dll_bw_hz, early_late_space_chips, very_early_late_space_chips, port_ch0)); } -void Galileo_E1_Tcp_Connector_Tracking_cc::forecast (int noutput_items, - gr_vector_int &ninput_items_required) +void Galileo_E1_Tcp_Connector_Tracking_cc::forecast(int noutput_items, + gr_vector_int &ninput_items_required) { if (noutput_items != 0) { - ninput_items_required[0] = static_cast(d_vector_length) * 2; // set the required available samples in each call + ninput_items_required[0] = static_cast(d_vector_length) * 2; // set the required available samples in each call } } Galileo_E1_Tcp_Connector_Tracking_cc::Galileo_E1_Tcp_Connector_Tracking_cc( - long if_freq, - long fs_in, - unsigned int vector_length, - bool dump, - std::string dump_filename, - float pll_bw_hz __attribute__((unused)), - float dll_bw_hz __attribute__((unused)), - float early_late_space_chips, - float very_early_late_space_chips, - size_t port_ch0): - gr::block("Galileo_E1_Tcp_Connector_Tracking_cc", gr::io_signature::make(1, 1, sizeof(gr_complex)), - gr::io_signature::make(1, 1, sizeof(Gnss_Synchro))) + long if_freq, + long fs_in, + unsigned int vector_length, + bool dump, + std::string dump_filename, + float pll_bw_hz __attribute__((unused)), + float dll_bw_hz __attribute__((unused)), + float early_late_space_chips, + float very_early_late_space_chips, + size_t port_ch0) : gr::block("Galileo_E1_Tcp_Connector_Tracking_cc", gr::io_signature::make(1, 1, sizeof(gr_complex)), + gr::io_signature::make(1, 1, sizeof(Gnss_Synchro))) { // Telemetry bit synchronization message port input this->message_port_register_in(pmt::mp("preamble_timestamp_s")); this->message_port_register_out(pmt::mp("events")); - this->set_relative_rate(1.0/vector_length); + this->set_relative_rate(1.0 / vector_length); // initialize internal vars d_dump = dump; d_if_freq = if_freq; @@ -113,8 +112,8 @@ Galileo_E1_Tcp_Connector_Tracking_cc::Galileo_E1_Tcp_Connector_Tracking_cc( // Initialize tracking ========================================== //--- DLL variables -------------------------------------------------------- - d_early_late_spc_chips = early_late_space_chips; // Define early-late offset (in chips) - d_very_early_late_spc_chips = very_early_late_space_chips; // Define very-early-late offset (in chips) + d_early_late_spc_chips = early_late_space_chips; // Define early-late offset (in chips) + d_very_early_late_spc_chips = very_early_late_space_chips; // Define very-early-late offset (in chips) //--- TCP CONNECTOR variables -------------------------------------------------------- d_port_ch0 = port_ch0; @@ -124,14 +123,14 @@ Galileo_E1_Tcp_Connector_Tracking_cc::Galileo_E1_Tcp_Connector_Tracking_cc( // Initialization of local code replica // Get space for a vector with the sinboc(1,1) replica sampled 2x/chip - d_ca_code = static_cast(volk_gnsssdr_malloc((2*Galileo_E1_B_CODE_LENGTH_CHIPS) * sizeof(gr_complex), volk_gnsssdr_get_alignment())); + d_ca_code = static_cast(volk_gnsssdr_malloc((2 * Galileo_E1_B_CODE_LENGTH_CHIPS) * sizeof(gr_complex), volk_gnsssdr_get_alignment())); // correlator outputs (scalar) - d_n_correlator_taps = 5; // Very-Early, Early, Prompt, Late, Very-Late - d_correlator_outs = static_cast(volk_gnsssdr_malloc(d_n_correlator_taps*sizeof(gr_complex), volk_gnsssdr_get_alignment())); + d_n_correlator_taps = 5; // Very-Early, Early, Prompt, Late, Very-Late + d_correlator_outs = static_cast(volk_gnsssdr_malloc(d_n_correlator_taps * sizeof(gr_complex), volk_gnsssdr_get_alignment())); for (int n = 0; n < d_n_correlator_taps; n++) { - d_correlator_outs[n] = gr_complex(0,0); + d_correlator_outs[n] = gr_complex(0, 0); } // map memory pointers of correlator outputs d_Very_Early = &d_correlator_outs[0]; @@ -140,10 +139,10 @@ Galileo_E1_Tcp_Connector_Tracking_cc::Galileo_E1_Tcp_Connector_Tracking_cc( d_Late = &d_correlator_outs[3]; d_Very_Late = &d_correlator_outs[4]; - d_local_code_shift_chips = static_cast(volk_gnsssdr_malloc(d_n_correlator_taps * sizeof(float), volk_gnsssdr_get_alignment())); + d_local_code_shift_chips = static_cast(volk_gnsssdr_malloc(d_n_correlator_taps * sizeof(float), volk_gnsssdr_get_alignment())); // Set TAPs delay values [chips] - d_local_code_shift_chips[0] = - d_very_early_late_spc_chips; - d_local_code_shift_chips[1] = - d_early_late_spc_chips; + d_local_code_shift_chips[0] = -d_very_early_late_spc_chips; + d_local_code_shift_chips[1] = -d_early_late_spc_chips; d_local_code_shift_chips[2] = 0.0; d_local_code_shift_chips[3] = d_early_late_spc_chips; d_local_code_shift_chips[4] = d_very_early_late_spc_chips; @@ -191,25 +190,24 @@ Galileo_E1_Tcp_Connector_Tracking_cc::Galileo_E1_Tcp_Connector_Tracking_cc( } - void Galileo_E1_Tcp_Connector_Tracking_cc::start_tracking() { d_acq_code_phase_samples = d_acquisition_gnss_synchro->Acq_delay_samples; d_acq_carrier_doppler_hz = d_acquisition_gnss_synchro->Acq_doppler_hz; - d_acq_sample_stamp = d_acquisition_gnss_synchro->Acq_samplestamp_samples; + d_acq_sample_stamp = d_acquisition_gnss_synchro->Acq_samplestamp_samples; // generate local reference ALWAYS starting at chip 1 (2 samples per chip) galileo_e1_code_gen_complex_sampled(d_ca_code, - d_acquisition_gnss_synchro->Signal, - false, - d_acquisition_gnss_synchro->PRN, - 2 * Galileo_E1_CODE_CHIP_RATE_HZ, - 0); + d_acquisition_gnss_synchro->Signal, + false, + d_acquisition_gnss_synchro->PRN, + 2 * Galileo_E1_CODE_CHIP_RATE_HZ, + 0); - multicorrelator_cpu.set_local_code_and_taps(static_cast(2*Galileo_E1_B_CODE_LENGTH_CHIPS), d_ca_code, d_local_code_shift_chips); + multicorrelator_cpu.set_local_code_and_taps(static_cast(2 * Galileo_E1_B_CODE_LENGTH_CHIPS), d_ca_code, d_local_code_shift_chips); for (int n = 0; n < d_n_correlator_taps; n++) { - d_correlator_outs[n] = gr_complex(0,0); + d_correlator_outs[n] = gr_complex(0, 0); } d_carrier_lock_fail_counter = 0; @@ -222,7 +220,7 @@ void Galileo_E1_Tcp_Connector_Tracking_cc::start_tracking() d_current_prn_length_samples = d_vector_length; std::string sys_ = &d_acquisition_gnss_synchro->System; - sys = sys_.substr(0,1); + sys = sys_.substr(0, 1); // DEBUG OUTPUT std::cout << "Tracking of Galileo E1 signal started on channel " << d_channel << " for satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << std::endl; @@ -241,32 +239,32 @@ Galileo_E1_Tcp_Connector_Tracking_cc::~Galileo_E1_Tcp_Connector_Tracking_cc() if (d_dump_file.is_open()) { try - { + { d_dump_file.close(); - } - catch(const std::exception & ex) - { + } + catch (const std::exception &ex) + { LOG(WARNING) << "Exception in destructor " << ex.what(); - } + } } try - { + { volk_gnsssdr_free(d_local_code_shift_chips); volk_gnsssdr_free(d_correlator_outs); volk_gnsssdr_free(d_ca_code); delete[] d_Prompt_buffer; d_tcp_com.close_tcp_connection(d_port); multicorrelator_cpu.free(); - } - catch(const std::exception & ex) - { + } + catch (const std::exception &ex) + { LOG(WARNING) << "Exception in destructor " << ex.what(); - } + } } -int Galileo_E1_Tcp_Connector_Tracking_cc::general_work (int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), - gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) +int Galileo_E1_Tcp_Connector_Tracking_cc::general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), + gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { // process vars float carr_error_filt_hz; @@ -276,7 +274,7 @@ int Galileo_E1_Tcp_Connector_Tracking_cc::general_work (int noutput_items __attr // GNSS_SYNCHRO OBJECT to interchange data between tracking->telemetry_decoder Gnss_Synchro current_synchro_data = Gnss_Synchro(); // Block input data and block output stream pointers - const gr_complex* in = reinterpret_cast(input_items[0]); + const gr_complex *in = reinterpret_cast(input_items[0]); Gnss_Synchro **out = reinterpret_cast(&output_items[0]); if (d_enable_tracking == true) { @@ -296,25 +294,25 @@ int Galileo_E1_Tcp_Connector_Tracking_cc::general_work (int noutput_items __attr current_synchro_data.Tracking_sample_counter = d_sample_counter + samples_offset; current_synchro_data.fs = d_fs_in; *out[0] = current_synchro_data; - d_sample_counter = d_sample_counter + samples_offset; //count for the processed samples + d_sample_counter = d_sample_counter + samples_offset; //count for the processed samples d_pull_in = false; - consume_each(samples_offset); //shift input to perform alignment with local replica + consume_each(samples_offset); //shift input to perform alignment with local replica return 1; } // ################# CARRIER WIPEOFF AND CORRELATORS ############################## // perform carrier wipe-off and compute Early, Prompt and Late correlation - multicorrelator_cpu.set_input_output_vectors(d_correlator_outs,in); + multicorrelator_cpu.set_input_output_vectors(d_correlator_outs, in); double carr_phase_step_rad = GALILEO_TWO_PI * d_carrier_doppler_hz / static_cast(d_fs_in); double code_phase_step_half_chips = (2.0 * d_code_freq_chips) / (static_cast(d_fs_in)); - double rem_code_phase_half_chips = d_rem_code_phase_samples * (2.0*d_code_freq_chips / d_fs_in); + double rem_code_phase_half_chips = d_rem_code_phase_samples * (2.0 * d_code_freq_chips / d_fs_in); multicorrelator_cpu.Carrier_wipeoff_multicorrelator_resampler( - d_rem_carr_phase_rad, - carr_phase_step_rad, - rem_code_phase_half_chips, - code_phase_step_half_chips, - d_correlation_length_samples); + d_rem_carr_phase_rad, + carr_phase_step_rad, + rem_code_phase_half_chips, + code_phase_step_half_chips, + d_correlation_length_samples); // ################## TCP CONNECTOR ########################################################## //! Variable used for control @@ -322,18 +320,18 @@ int Galileo_E1_Tcp_Connector_Tracking_cc::general_work (int noutput_items __attr //! Send and receive a TCP packet boost::array tx_variables_array = {{d_control_id, - (*d_Very_Early).real(), - (*d_Very_Early).imag(), - (*d_Early).real(), - (*d_Early).imag(), - (*d_Late).real(), - (*d_Late).imag(), - (*d_Very_Late).real(), - (*d_Very_Late).imag(), - (*d_Prompt).real(), - (*d_Prompt).imag(), - d_acq_carrier_doppler_hz, - 1}}; + (*d_Very_Early).real(), + (*d_Very_Early).imag(), + (*d_Early).real(), + (*d_Early).imag(), + (*d_Late).real(), + (*d_Late).imag(), + (*d_Very_Late).real(), + (*d_Very_Late).imag(), + (*d_Prompt).real(), + (*d_Prompt).imag(), + d_acq_carrier_doppler_hz, + 1}}; d_tcp_com.send_receive_tcp_packet_galileo_e1(tx_variables_array, &tcp_data); // ################## PLL ########################################################## @@ -344,9 +342,9 @@ int Galileo_E1_Tcp_Connector_Tracking_cc::general_work (int noutput_items __attr // New code Doppler frequency estimation d_code_freq_chips = Galileo_E1_CODE_CHIP_RATE_HZ + ((d_carrier_doppler_hz * Galileo_E1_CODE_CHIP_RATE_HZ) / Galileo_E1_FREQ_HZ); //carrier phase accumulator for (K) doppler estimation - d_acc_carrier_phase_rad -= GPS_TWO_PI*d_carrier_doppler_hz*Galileo_E1_CODE_PERIOD; + d_acc_carrier_phase_rad -= GPS_TWO_PI * d_carrier_doppler_hz * Galileo_E1_CODE_PERIOD; //remnant carrier phase to prevent overflow in the code NCO - d_rem_carr_phase_rad = d_rem_carr_phase_rad + GPS_TWO_PI*d_carrier_doppler_hz*Galileo_E1_CODE_PERIOD; + d_rem_carr_phase_rad = d_rem_carr_phase_rad + GPS_TWO_PI * d_carrier_doppler_hz * Galileo_E1_CODE_PERIOD; d_rem_carr_phase_rad = fmod(d_rem_carr_phase_rad, GPS_TWO_PI); // ################## DLL ########################################################## @@ -354,7 +352,7 @@ int Galileo_E1_Tcp_Connector_Tracking_cc::general_work (int noutput_items __attr code_error_filt_chips = tcp_data.proc_pack_code_error; //Code phase accumulator float code_error_filt_secs; - code_error_filt_secs = (Galileo_E1_CODE_PERIOD * code_error_filt_chips) / Galileo_E1_CODE_CHIP_RATE_HZ; //[seconds] + code_error_filt_secs = (Galileo_E1_CODE_PERIOD * code_error_filt_chips) / Galileo_E1_CODE_CHIP_RATE_HZ; //[seconds] d_acc_code_phase_secs = d_acc_code_phase_secs + code_error_filt_secs; // ################## CARRIER AND CODE NCO BUFFER ALIGNEMENT ####################### @@ -368,7 +366,7 @@ int Galileo_E1_Tcp_Connector_Tracking_cc::general_work (int noutput_items __attr T_prn_seconds = T_chip_seconds * Galileo_E1_B_CODE_LENGTH_CHIPS; T_prn_samples = T_prn_seconds * static_cast(d_fs_in); K_blk_samples = T_prn_samples + d_rem_code_phase_samples + code_error_filt_secs * static_cast(d_fs_in); - d_current_prn_length_samples = round(K_blk_samples); //round to a discrete samples + d_current_prn_length_samples = round(K_blk_samples); //round to a discrete samples //d_rem_code_phase_samples = K_blk_samples - d_current_prn_length_samples; //rounding error < 1 sample // ####### CN0 ESTIMATION AND LOCK DETECTORS ###### @@ -401,10 +399,10 @@ int Galileo_E1_Tcp_Connector_Tracking_cc::general_work (int noutput_items __attr { std::cout << "Loss of lock in channel " << d_channel << "!" << std::endl; LOG(INFO) << "Loss of lock in channel " << d_channel << "!"; - this->message_port_pub(pmt::mp("events"), pmt::from_long(3));//3 -> loss of lock + this->message_port_pub(pmt::mp("events"), pmt::from_long(3)); //3 -> loss of lock d_carrier_lock_fail_counter = 0; - d_enable_tracking = false; // TODO: check if disabling tracking is consistent with the channel state machine + d_enable_tracking = false; // TODO: check if disabling tracking is consistent with the channel state machine } } @@ -414,7 +412,7 @@ int Galileo_E1_Tcp_Connector_Tracking_cc::general_work (int noutput_items __attr // Tracking_timestamp_secs is aligned with the PRN start sample current_synchro_data.Tracking_sample_counter = d_sample_counter + d_current_prn_length_samples; current_synchro_data.Code_phase_samples = d_rem_code_phase_samples; - d_rem_code_phase_samples = K_blk_samples - d_current_prn_length_samples; //rounding error < 1 sample + d_rem_code_phase_samples = K_blk_samples - d_current_prn_length_samples; //rounding error < 1 sample current_synchro_data.Carrier_phase_rads = static_cast(d_acc_carrier_phase_rad); current_synchro_data.Carrier_Doppler_hz = static_cast(d_carrier_doppler_hz); current_synchro_data.CN0_dB_hz = static_cast(d_CN0_SNV_dB_Hz); @@ -423,24 +421,24 @@ int Galileo_E1_Tcp_Connector_Tracking_cc::general_work (int noutput_items __attr } else { - *d_Early = gr_complex(0,0); - *d_Prompt = gr_complex(0,0); - *d_Late = gr_complex(0,0); + *d_Early = gr_complex(0, 0); + *d_Prompt = gr_complex(0, 0); + *d_Late = gr_complex(0, 0); current_synchro_data.Tracking_sample_counter = d_sample_counter + d_current_prn_length_samples; //! When tracking is disabled an array of 1's is sent to maintain the TCP connection - boost::array tx_variables_array = {{1,1,1,1,1,1,1,1,1,1,1,1,0}}; + boost::array tx_variables_array = {{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0}}; d_tcp_com.send_receive_tcp_packet_galileo_e1(tx_variables_array, &tcp_data); } //assign the GNURadio block output data current_synchro_data.System = {'E'}; std::string str_aux = "1B"; - const char * str = str_aux.c_str(); // get a C style null terminated string - std::memcpy(static_cast(current_synchro_data.Signal), str, 3); + const char *str = str_aux.c_str(); // get a C style null terminated string + std::memcpy(static_cast(current_synchro_data.Signal), str, 3); current_synchro_data.fs = d_fs_in; *out[0] = current_synchro_data; - if(d_dump) + if (d_dump) { // MULTIPLEXED FILE RECORDING - Record results to file float prompt_I; @@ -458,65 +456,66 @@ int Galileo_E1_Tcp_Connector_Tracking_cc::general_work (int noutput_items __attr tmp_VL = std::abs(*d_Very_Late); try - { + { // EPR - d_dump_file.write(reinterpret_cast(&tmp_VE), sizeof(float)); - d_dump_file.write(reinterpret_cast(&tmp_E), sizeof(float)); - d_dump_file.write(reinterpret_cast(&tmp_P), sizeof(float)); - d_dump_file.write(reinterpret_cast(&tmp_L), sizeof(float)); - d_dump_file.write(reinterpret_cast(&tmp_VL), sizeof(float)); + d_dump_file.write(reinterpret_cast(&tmp_VE), sizeof(float)); + d_dump_file.write(reinterpret_cast(&tmp_E), sizeof(float)); + d_dump_file.write(reinterpret_cast(&tmp_P), sizeof(float)); + d_dump_file.write(reinterpret_cast(&tmp_L), sizeof(float)); + d_dump_file.write(reinterpret_cast(&tmp_VL), sizeof(float)); // PROMPT I and Q (to analyze navigation symbols) - d_dump_file.write(reinterpret_cast(&prompt_I), sizeof(float)); - d_dump_file.write(reinterpret_cast(&prompt_Q), sizeof(float)); + d_dump_file.write(reinterpret_cast(&prompt_I), sizeof(float)); + d_dump_file.write(reinterpret_cast(&prompt_Q), sizeof(float)); // PRN start sample stamp - d_dump_file.write(reinterpret_cast(&d_sample_counter), sizeof(unsigned long int)); + d_dump_file.write(reinterpret_cast(&d_sample_counter), sizeof(unsigned long int)); // accumulated carrier phase - d_dump_file.write(reinterpret_cast(&d_acc_carrier_phase_rad), sizeof(float)); + d_dump_file.write(reinterpret_cast(&d_acc_carrier_phase_rad), sizeof(float)); // carrier and code frequency - d_dump_file.write(reinterpret_cast(&d_carrier_doppler_hz), sizeof(float)); - d_dump_file.write(reinterpret_cast(&d_code_freq_chips), sizeof(float)); + d_dump_file.write(reinterpret_cast(&d_carrier_doppler_hz), sizeof(float)); + d_dump_file.write(reinterpret_cast(&d_code_freq_chips), sizeof(float)); //PLL commands - d_dump_file.write(reinterpret_cast(&tmp_float), sizeof(float)); - d_dump_file.write(reinterpret_cast(&carr_error_filt_hz), sizeof(float)); + d_dump_file.write(reinterpret_cast(&tmp_float), sizeof(float)); + d_dump_file.write(reinterpret_cast(&carr_error_filt_hz), sizeof(float)); //DLL commands - d_dump_file.write(reinterpret_cast(&tmp_float), sizeof(float)); - d_dump_file.write(reinterpret_cast(&code_error_filt_chips), sizeof(float)); + d_dump_file.write(reinterpret_cast(&tmp_float), sizeof(float)); + d_dump_file.write(reinterpret_cast(&code_error_filt_chips), sizeof(float)); // CN0 and carrier lock test - d_dump_file.write(reinterpret_cast(&d_CN0_SNV_dB_Hz), sizeof(float)); - d_dump_file.write(reinterpret_cast(&d_carrier_lock_test), sizeof(float)); + d_dump_file.write(reinterpret_cast(&d_CN0_SNV_dB_Hz), sizeof(float)); + d_dump_file.write(reinterpret_cast(&d_carrier_lock_test), sizeof(float)); // AUX vars (for debug purposes) tmp_float = d_rem_code_phase_samples; - d_dump_file.write(reinterpret_cast(&tmp_float), sizeof(float)); + d_dump_file.write(reinterpret_cast(&tmp_float), sizeof(float)); tmp_double = static_cast(d_sample_counter + d_current_prn_length_samples); - d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); + d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); // PRN unsigned int prn_ = d_acquisition_gnss_synchro->PRN; - d_dump_file.write(reinterpret_cast(&prn_), sizeof(unsigned int)); - } + d_dump_file.write(reinterpret_cast(&prn_), sizeof(unsigned int)); + } catch (const std::ifstream::failure &e) - { + { LOG(WARNING) << "Exception writing trk dump file " << e.what(); - } + } } - consume_each(d_current_prn_length_samples); // this is needed in gr::block derivates - d_sample_counter += d_current_prn_length_samples; //count for the processed samples + consume_each(d_current_prn_length_samples); // this is needed in gr::block derivates + d_sample_counter += d_current_prn_length_samples; //count for the processed samples if (d_enable_tracking) - { - return 1; - }else{ - return 0; - } + { + return 1; + } + else + { + return 0; + } } - void Galileo_E1_Tcp_Connector_Tracking_cc::set_channel(unsigned int channel) { d_channel = channel; @@ -527,17 +526,17 @@ void Galileo_E1_Tcp_Connector_Tracking_cc::set_channel(unsigned int channel) if (d_dump_file.is_open() == false) { try - { + { d_dump_filename.append(boost::lexical_cast(d_channel)); d_dump_filename.append(".dat"); - d_dump_file.exceptions (std::ifstream::failbit | std::ifstream::badbit); + d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); LOG(INFO) << "Tracking dump enabled on channel " << d_channel << " Log file: " << d_dump_filename.c_str(); - } + } catch (const std::ifstream::failure &e) - { + { LOG(WARNING) << "channel " << d_channel << " Exception opening trk dump file " << e.what(); - } + } } } @@ -550,8 +549,7 @@ void Galileo_E1_Tcp_Connector_Tracking_cc::set_channel(unsigned int channel) } - -void Galileo_E1_Tcp_Connector_Tracking_cc::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) +void Galileo_E1_Tcp_Connector_Tracking_cc::set_gnss_synchro(Gnss_Synchro *p_gnss_synchro) { d_acquisition_gnss_synchro = p_gnss_synchro; } diff --git a/src/algorithms/tracking/gnuradio_blocks/galileo_e1_tcp_connector_tracking_cc.h b/src/algorithms/tracking/gnuradio_blocks/galileo_e1_tcp_connector_tracking_cc.h index 8a00caa70..b7f7cefd2 100644 --- a/src/algorithms/tracking/gnuradio_blocks/galileo_e1_tcp_connector_tracking_cc.h +++ b/src/algorithms/tracking/gnuradio_blocks/galileo_e1_tcp_connector_tracking_cc.h @@ -55,56 +55,54 @@ typedef boost::shared_ptr galileo_e1_tcp_c galileo_e1_tcp_connector_tracking_cc_sptr galileo_e1_tcp_connector_make_tracking_cc(long if_freq, - long fs_in, unsigned - int vector_length, - bool dump, - std::string dump_filename, - float pll_bw_hz, - float dll_bw_hz, - float early_late_space_chips, - float very_early_late_space_chips, - size_t port_ch0); + long fs_in, unsigned int vector_length, + bool dump, + std::string dump_filename, + float pll_bw_hz, + float dll_bw_hz, + float early_late_space_chips, + float very_early_late_space_chips, + size_t port_ch0); /*! * \brief This class implements a code DLL + carrier PLL VEML (Very Early * Minus Late) tracking block for Galileo E1 signals */ -class Galileo_E1_Tcp_Connector_Tracking_cc: public gr::block +class Galileo_E1_Tcp_Connector_Tracking_cc : public gr::block { public: ~Galileo_E1_Tcp_Connector_Tracking_cc(); void set_channel(unsigned int channel); - void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro); + void set_gnss_synchro(Gnss_Synchro *p_gnss_synchro); void start_tracking(); - int general_work (int noutput_items, gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); + int general_work(int noutput_items, gr_vector_int &ninput_items, + gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); + + void forecast(int noutput_items, gr_vector_int &ninput_items_required); - void forecast (int noutput_items, gr_vector_int &ninput_items_required); private: friend galileo_e1_tcp_connector_tracking_cc_sptr galileo_e1_tcp_connector_make_tracking_cc(long if_freq, - long fs_in, unsigned - int vector_length, - bool dump, - std::string dump_filename, - float pll_bw_hz, - float dll_bw_hz, - float early_late_space_chips, - float very_early_late_space_chips, - size_t port_ch0); + long fs_in, unsigned int vector_length, + bool dump, + std::string dump_filename, + float pll_bw_hz, + float dll_bw_hz, + float early_late_space_chips, + float very_early_late_space_chips, + size_t port_ch0); Galileo_E1_Tcp_Connector_Tracking_cc(long if_freq, - long fs_in, unsigned - int vector_length, - bool dump, - std::string dump_filename, - float pll_bw_hz, - float dll_bw_hz, - float early_late_space_chips, - float very_early_late_space_chips, - size_t port_ch0); + long fs_in, unsigned int vector_length, + bool dump, + std::string dump_filename, + float pll_bw_hz, + float dll_bw_hz, + float early_late_space_chips, + float very_early_late_space_chips, + size_t port_ch0); void update_local_code(); @@ -114,7 +112,7 @@ private: unsigned int d_vector_length; bool d_dump; - Gnss_Synchro* d_acquisition_gnss_synchro; + Gnss_Synchro *d_acquisition_gnss_synchro; unsigned int d_channel; long d_if_freq; @@ -125,7 +123,7 @@ private: float d_early_late_spc_chips; float d_very_early_late_spc_chips; - gr_complex* d_ca_code; + gr_complex *d_ca_code; gr_complex *d_Very_Early; gr_complex *d_Early; @@ -143,8 +141,8 @@ private: float d_acq_carrier_doppler_hz; // correlator - float* d_local_code_shift_chips; - gr_complex* d_correlator_outs; + float *d_local_code_shift_chips; + gr_complex *d_correlator_outs; cpu_multicorrelator multicorrelator_cpu; // tracking vars @@ -169,7 +167,7 @@ private: // CN0 estimation and lock detector int d_cn0_estimation_counter; - gr_complex* d_Prompt_buffer; + gr_complex *d_Prompt_buffer; float d_carrier_lock_test; float d_CN0_SNV_dB_Hz; float d_carrier_lock_threshold; @@ -187,4 +185,4 @@ private: std::string sys; }; -#endif //GNSS_SDR_GALILEO_E1_TCP_CONNECTOR_TRACKING_CC_H +#endif //GNSS_SDR_GALILEO_E1_TCP_CONNECTOR_TRACKING_CC_H diff --git a/src/algorithms/tracking/gnuradio_blocks/galileo_e5a_dll_pll_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/galileo_e5a_dll_pll_tracking_cc.cc index c91d59a68..b1ab64db2 100644 --- a/src/algorithms/tracking/gnuradio_blocks/galileo_e5a_dll_pll_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/galileo_e5a_dll_pll_tracking_cc.cc @@ -56,47 +56,45 @@ using google::LogMessage; galileo_e5a_dll_pll_tracking_cc_sptr galileo_e5a_dll_pll_make_tracking_cc( - long if_freq, - long fs_in, - unsigned int vector_length, - bool dump, - std::string dump_filename, - float pll_bw_hz, - float dll_bw_hz, - float pll_bw_narrow_hz, - float dll_bw_narrow_hz, - int ti_ms, - float early_late_space_chips) + long if_freq, + long fs_in, + unsigned int vector_length, + bool dump, + std::string dump_filename, + float pll_bw_hz, + float dll_bw_hz, + float pll_bw_narrow_hz, + float dll_bw_narrow_hz, + int ti_ms, + float early_late_space_chips) { return galileo_e5a_dll_pll_tracking_cc_sptr(new Galileo_E5a_Dll_Pll_Tracking_cc(if_freq, - fs_in, vector_length, dump, dump_filename, pll_bw_hz, dll_bw_hz, pll_bw_narrow_hz, dll_bw_narrow_hz, ti_ms, early_late_space_chips)); + fs_in, vector_length, dump, dump_filename, pll_bw_hz, dll_bw_hz, pll_bw_narrow_hz, dll_bw_narrow_hz, ti_ms, early_late_space_chips)); } - -void Galileo_E5a_Dll_Pll_Tracking_cc::forecast (int noutput_items, gr_vector_int &ninput_items_required) +void Galileo_E5a_Dll_Pll_Tracking_cc::forecast(int noutput_items, gr_vector_int &ninput_items_required) { if (noutput_items != 0) { - ninput_items_required[0] = static_cast(d_vector_length) * 2; //set the required available samples in each call + ninput_items_required[0] = static_cast(d_vector_length) * 2; //set the required available samples in each call } } Galileo_E5a_Dll_Pll_Tracking_cc::Galileo_E5a_Dll_Pll_Tracking_cc( - long if_freq, - long fs_in, - unsigned int vector_length, - bool dump, - std::string dump_filename, - float pll_bw_hz, - float dll_bw_hz, - float pll_bw_narrow_hz, - float dll_bw_narrow_hz, - int ti_ms, - float early_late_space_chips) : - gr::block("Galileo_E5a_Dll_Pll_Tracking_cc", gr::io_signature::make(1, 1, sizeof(gr_complex)), - gr::io_signature::make(1, 1, sizeof(Gnss_Synchro))) + long if_freq, + long fs_in, + unsigned int vector_length, + bool dump, + std::string dump_filename, + float pll_bw_hz, + float dll_bw_hz, + float pll_bw_narrow_hz, + float dll_bw_narrow_hz, + int ti_ms, + float early_late_space_chips) : gr::block("Galileo_E5a_Dll_Pll_Tracking_cc", gr::io_signature::make(1, 1, sizeof(gr_complex)), + gr::io_signature::make(1, 1, sizeof(Gnss_Synchro))) { // Telemetry bit synchronization message port input this->message_port_register_in(pmt::mp("preamble_timestamp_s")); @@ -110,7 +108,7 @@ Galileo_E5a_Dll_Pll_Tracking_cc::Galileo_E5a_Dll_Pll_Tracking_cc( d_dump_filename = dump_filename; d_code_loop_filter = Tracking_2nd_DLL_filter(GALILEO_E5a_CODE_PERIOD); d_carrier_loop_filter = Tracking_2nd_PLL_filter(GALILEO_E5a_CODE_PERIOD); - d_current_ti_ms = 1; // initializes with 1ms of integration time until secondary code lock + d_current_ti_ms = 1; // initializes with 1ms of integration time until secondary code lock d_ti_ms = ti_ms; d_dll_bw_hz = dll_bw_hz; d_pll_bw_hz = pll_bw_hz; @@ -122,19 +120,19 @@ Galileo_E5a_Dll_Pll_Tracking_cc::Galileo_E5a_Dll_Pll_Tracking_cc( d_carrier_loop_filter.set_PLL_BW(d_pll_bw_hz); //--- DLL variables -------------------------------------------------------- - d_early_late_spc_chips = early_late_space_chips; // Define early-late offset (in chips) + d_early_late_spc_chips = early_late_space_chips; // Define early-late offset (in chips) // Initialization of local code replica // Get space for a vector with the E5a primary code replicas sampled 1x/chip - d_codeQ = static_cast(volk_gnsssdr_malloc(Galileo_E5a_CODE_LENGTH_CHIPS * sizeof(gr_complex), volk_gnsssdr_get_alignment())); - d_codeI = static_cast(volk_gnsssdr_malloc(Galileo_E5a_CODE_LENGTH_CHIPS * sizeof(gr_complex), volk_gnsssdr_get_alignment())); + d_codeQ = static_cast(volk_gnsssdr_malloc(Galileo_E5a_CODE_LENGTH_CHIPS * sizeof(gr_complex), volk_gnsssdr_get_alignment())); + d_codeI = static_cast(volk_gnsssdr_malloc(Galileo_E5a_CODE_LENGTH_CHIPS * sizeof(gr_complex), volk_gnsssdr_get_alignment())); // correlator Q outputs (scalar) - d_n_correlator_taps = 3; // Early, Prompt, Late - d_correlator_outs = static_cast(volk_gnsssdr_malloc(d_n_correlator_taps*sizeof(gr_complex), volk_gnsssdr_get_alignment())); + d_n_correlator_taps = 3; // Early, Prompt, Late + d_correlator_outs = static_cast(volk_gnsssdr_malloc(d_n_correlator_taps * sizeof(gr_complex), volk_gnsssdr_get_alignment())); for (int n = 0; n < d_n_correlator_taps; n++) { - d_correlator_outs[n] = gr_complex(0,0); + d_correlator_outs[n] = gr_complex(0, 0); } // map memory pointers of correlator outputs @@ -142,18 +140,18 @@ Galileo_E5a_Dll_Pll_Tracking_cc::Galileo_E5a_Dll_Pll_Tracking_cc( d_Single_Prompt = &d_correlator_outs[1]; d_Single_Late = &d_correlator_outs[2]; - d_local_code_shift_chips = static_cast(volk_gnsssdr_malloc(d_n_correlator_taps * sizeof(float), volk_gnsssdr_get_alignment())); + d_local_code_shift_chips = static_cast(volk_gnsssdr_malloc(d_n_correlator_taps * sizeof(float), volk_gnsssdr_get_alignment())); // Set TAPs delay values [chips] - d_local_code_shift_chips[0] = - d_early_late_spc_chips; + d_local_code_shift_chips[0] = -d_early_late_spc_chips; d_local_code_shift_chips[1] = 0.0; d_local_code_shift_chips[2] = d_early_late_spc_chips; multicorrelator_cpu_Q.init(2 * d_vector_length, d_n_correlator_taps); // correlator I single output for data (scalar) - d_Single_Prompt_data = static_cast(volk_gnsssdr_malloc(sizeof(gr_complex), volk_gnsssdr_get_alignment())); - *d_Single_Prompt_data = gr_complex(0,0); - multicorrelator_cpu_I.init(2 * d_vector_length, 1); // single correlator for data channel + d_Single_Prompt_data = static_cast(volk_gnsssdr_malloc(sizeof(gr_complex), volk_gnsssdr_get_alignment())); + *d_Single_Prompt_data = gr_complex(0, 0); + multicorrelator_cpu_I.init(2 * d_vector_length, 1); // single correlator for data channel //--- Perform initializations ------------------------------ // define initial code frequency basis of NCO @@ -209,30 +207,30 @@ Galileo_E5a_Dll_Pll_Tracking_cc::~Galileo_E5a_Dll_Pll_Tracking_cc() if (d_dump_file.is_open()) { try - { + { d_dump_file.close(); - } - catch(const std::exception & ex) - { + } + catch (const std::exception &ex) + { LOG(WARNING) << "Exception in destructor " << ex.what(); - } + } } - if(d_dump) + if (d_dump) { - if(d_channel == 0) + if (d_channel == 0) { std::cout << "Writing .mat files ..."; } Galileo_E5a_Dll_Pll_Tracking_cc::save_matfile(); - if(d_channel == 0) + if (d_channel == 0) { std::cout << " done." << std::endl; } } try - { + { delete[] d_codeI; delete[] d_codeQ; delete[] d_Prompt_buffer; @@ -241,11 +239,11 @@ Galileo_E5a_Dll_Pll_Tracking_cc::~Galileo_E5a_Dll_Pll_Tracking_cc() volk_gnsssdr_free(d_Single_Prompt_data); multicorrelator_cpu_Q.free(); multicorrelator_cpu_I.free(); - } - catch(const std::exception & ex) - { - LOG(WARNING)<<"Exception in destructor "<Acq_delay_samples; d_acq_carrier_doppler_hz = d_acquisition_gnss_synchro->Acq_doppler_hz; - d_acq_sample_stamp = d_acquisition_gnss_synchro->Acq_samplestamp_samples; + d_acq_sample_stamp = d_acquisition_gnss_synchro->Acq_samplestamp_samples; long int acq_trk_diff_samples; double acq_trk_diff_seconds; - acq_trk_diff_samples = static_cast(d_sample_counter) - static_cast(d_acq_sample_stamp);//-d_vector_length; + acq_trk_diff_samples = static_cast(d_sample_counter) - static_cast(d_acq_sample_stamp); //-d_vector_length; LOG(INFO) << "Number of samples between Acquisition and Tracking =" << acq_trk_diff_samples; acq_trk_diff_seconds = static_cast(acq_trk_diff_samples) / static_cast(d_fs_in); //doppler effect @@ -272,7 +270,7 @@ void Galileo_E5a_Dll_Pll_Tracking_cc::start_tracking() double T_prn_mod_seconds; double T_prn_mod_samples; d_code_freq_chips = radial_velocity * Galileo_E5a_CODE_CHIP_RATE_HZ; - T_chip_mod_seconds = 1/d_code_freq_chips; + T_chip_mod_seconds = 1 / d_code_freq_chips; T_prn_mod_seconds = T_chip_mod_seconds * Galileo_E5a_CODE_LENGTH_CHIPS; T_prn_mod_samples = T_prn_mod_seconds * static_cast(d_fs_in); @@ -297,15 +295,15 @@ void Galileo_E5a_Dll_Pll_Tracking_cc::start_tracking() d_carrier_doppler_hz = d_acq_carrier_doppler_hz; // DLL/PLL filter initialization - d_carrier_loop_filter.initialize(); // initialize the carrier filter - d_code_loop_filter.initialize(); // initialize the code filter + d_carrier_loop_filter.initialize(); // initialize the carrier filter + d_code_loop_filter.initialize(); // initialize the code filter // generate local reference ALWAYS starting at chip 1 (1 sample per chip) char sig[3]; - strcpy(sig,"5Q"); + strcpy(sig, "5Q"); galileo_e5_a_code_gen_complex_primary(d_codeQ, d_acquisition_gnss_synchro->PRN, sig); - strcpy(sig,"5I"); + strcpy(sig, "5I"); galileo_e5_a_code_gen_complex_primary(d_codeI, d_acquisition_gnss_synchro->PRN, sig); d_carrier_lock_fail_counter = 0; @@ -317,7 +315,7 @@ void Galileo_E5a_Dll_Pll_Tracking_cc::start_tracking() d_code_phase_samples = d_acq_code_phase_samples; std::string sys_ = &d_acquisition_gnss_synchro->System; - sys = sys_.substr(0,1); + sys = sys_.substr(0, 1); // DEBUG OUTPUT std::cout << "Tracking of Galileo E5a signal started on channel " << d_channel << " for satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << std::endl; @@ -327,8 +325,8 @@ void Galileo_E5a_Dll_Pll_Tracking_cc::start_tracking() d_state = 1; LOG(INFO) << "PULL-IN Doppler [Hz]=" << d_carrier_doppler_hz - << " Code Phase correction [samples]=" << delay_correction_samples - << " PULL-IN Code Phase [samples]=" << d_acq_code_phase_samples; + << " Code Phase correction [samples]=" << delay_correction_samples + << " PULL-IN Code Phase [samples]=" << d_acq_code_phase_samples; } @@ -351,7 +349,7 @@ void Galileo_E5a_Dll_Pll_Tracking_cc::acquire_secondary() int in_corr[static_cast(FLAGS_cn0_samples)]; for (unsigned int i = 0; i < static_cast(FLAGS_cn0_samples); i++) { - if (d_Prompt_buffer[i].real() >0) + if (d_Prompt_buffer[i].real() > 0) { in_corr[i] = 1; } @@ -377,7 +375,7 @@ void Galileo_E5a_Dll_Pll_Tracking_cc::acquire_secondary() d_secondary_delay = i; } } - if (current_best_ == FLAGS_cn0_samples) // all bits correlate + if (current_best_ == FLAGS_cn0_samples) // all bits correlate { d_secondary_lock = true; d_secondary_delay = (d_secondary_delay + static_cast(FLAGS_cn0_samples) - 1) % Galileo_E5a_Q_SECONDARY_CODE_LENGTH; @@ -385,8 +383,8 @@ void Galileo_E5a_Dll_Pll_Tracking_cc::acquire_secondary() } -int Galileo_E5a_Dll_Pll_Tracking_cc::general_work (int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), - gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) +int Galileo_E5a_Dll_Pll_Tracking_cc::general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), + gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { // process vars double carr_error_hz; @@ -395,7 +393,7 @@ int Galileo_E5a_Dll_Pll_Tracking_cc::general_work (int noutput_items __attribute double code_error_filt_chips; // GNSS_SYNCHRO OBJECT to interchange data between tracking->telemetry_decoder - Gnss_Synchro **out = reinterpret_cast(&output_items[0]); //block output streams pointer + Gnss_Synchro **out = reinterpret_cast(&output_items[0]); //block output streams pointer // GNSS_SYNCHRO OBJECT to interchange data between tracking->telemetry_decoder Gnss_Synchro current_synchro_data; @@ -408,260 +406,263 @@ int Galileo_E5a_Dll_Pll_Tracking_cc::general_work (int noutput_items __attribute * until it reaches integration time. */ switch (d_state) - { - case 0: { - d_Early = gr_complex(0,0); - d_Prompt = gr_complex(0,0); - d_Late = gr_complex(0,0); - d_Prompt_data = gr_complex(0,0); - current_synchro_data.Tracking_sample_counter = d_sample_counter; - break; - } - case 1: - { - int samples_offset; - double acq_trk_shif_correction_samples; - int acq_to_trk_delay_samples; - acq_to_trk_delay_samples = d_sample_counter - d_acq_sample_stamp; - acq_trk_shif_correction_samples = d_current_prn_length_samples - fmod(static_cast(acq_to_trk_delay_samples), static_cast(d_current_prn_length_samples)); - samples_offset = round(d_acq_code_phase_samples + acq_trk_shif_correction_samples); - d_sample_counter = d_sample_counter + samples_offset; //count for the processed samples - DLOG(INFO) << " samples_offset=" << samples_offset; - d_state = 2; // start in Ti = 1 code, until secondary code lock. + case 0: + { + d_Early = gr_complex(0, 0); + d_Prompt = gr_complex(0, 0); + d_Late = gr_complex(0, 0); + d_Prompt_data = gr_complex(0, 0); + current_synchro_data.Tracking_sample_counter = d_sample_counter; + break; + } + case 1: + { + int samples_offset; + double acq_trk_shif_correction_samples; + int acq_to_trk_delay_samples; + acq_to_trk_delay_samples = d_sample_counter - d_acq_sample_stamp; + acq_trk_shif_correction_samples = d_current_prn_length_samples - fmod(static_cast(acq_to_trk_delay_samples), static_cast(d_current_prn_length_samples)); + samples_offset = round(d_acq_code_phase_samples + acq_trk_shif_correction_samples); + d_sample_counter = d_sample_counter + samples_offset; //count for the processed samples + DLOG(INFO) << " samples_offset=" << samples_offset; + d_state = 2; // start in Ti = 1 code, until secondary code lock. - // make an output to not stop the rest of the processing blocks - current_synchro_data.Prompt_I = 0.0; - current_synchro_data.Prompt_Q = 0.0; - current_synchro_data.Tracking_sample_counter = d_sample_counter; - current_synchro_data.Carrier_phase_rads = 0.0; - current_synchro_data.CN0_dB_hz = 0.0; - current_synchro_data.fs = d_fs_in; - consume_each(samples_offset); //shift input to perform alignment with local replica - return 0; - break; - } - case 2: - { - // Block input data and block output stream pointers - const gr_complex* in = reinterpret_cast(input_items[0]); //PRN start block alignment - gr_complex sec_sign_Q; - gr_complex sec_sign_I; - // Secondary code Chip - if (d_secondary_lock) - { - sec_sign_Q = gr_complex((Galileo_E5a_Q_SECONDARY_CODE[d_acquisition_gnss_synchro->PRN-1].at(d_secondary_delay) == '0' ? -1 : 1), 0); - sec_sign_I = gr_complex((Galileo_E5a_I_SECONDARY_CODE.at(d_secondary_delay % Galileo_E5a_I_SECONDARY_CODE_LENGTH) == '0' ? -1 : 1), 0); - } - else - { - sec_sign_Q = gr_complex(1.0, 0.0); - sec_sign_I = gr_complex(1.0, 0.0); - } - // Reset integration counter - if (d_integration_counter == d_current_ti_ms) - { - d_integration_counter = 0; - } - //Generate local code and carrier replicas (using \hat{f}_d(k-1)) - if (d_integration_counter == 0) - { - // Reset accumulated values - d_Early = gr_complex(0,0); - d_Prompt = gr_complex(0,0); - d_Late = gr_complex(0,0); - } + // make an output to not stop the rest of the processing blocks + current_synchro_data.Prompt_I = 0.0; + current_synchro_data.Prompt_Q = 0.0; + current_synchro_data.Tracking_sample_counter = d_sample_counter; + current_synchro_data.Carrier_phase_rads = 0.0; + current_synchro_data.CN0_dB_hz = 0.0; + current_synchro_data.fs = d_fs_in; + consume_each(samples_offset); //shift input to perform alignment with local replica + return 0; + break; + } + case 2: + { + // Block input data and block output stream pointers + const gr_complex *in = reinterpret_cast(input_items[0]); //PRN start block alignment + gr_complex sec_sign_Q; + gr_complex sec_sign_I; + // Secondary code Chip + if (d_secondary_lock) + { + sec_sign_Q = gr_complex((Galileo_E5a_Q_SECONDARY_CODE[d_acquisition_gnss_synchro->PRN - 1].at(d_secondary_delay) == '0' ? -1 : 1), 0); + sec_sign_I = gr_complex((Galileo_E5a_I_SECONDARY_CODE.at(d_secondary_delay % Galileo_E5a_I_SECONDARY_CODE_LENGTH) == '0' ? -1 : 1), 0); + } + else + { + sec_sign_Q = gr_complex(1.0, 0.0); + sec_sign_I = gr_complex(1.0, 0.0); + } + // Reset integration counter + if (d_integration_counter == d_current_ti_ms) + { + d_integration_counter = 0; + } + //Generate local code and carrier replicas (using \hat{f}_d(k-1)) + if (d_integration_counter == 0) + { + // Reset accumulated values + d_Early = gr_complex(0, 0); + d_Prompt = gr_complex(0, 0); + d_Late = gr_complex(0, 0); + } - // perform carrier wipe-off and compute Early, Prompt and Late - // correlation of 1 primary code + // perform carrier wipe-off and compute Early, Prompt and Late + // correlation of 1 primary code - multicorrelator_cpu_Q.set_local_code_and_taps(Galileo_E5a_CODE_LENGTH_CHIPS, d_codeQ, d_local_code_shift_chips); - multicorrelator_cpu_I.set_local_code_and_taps(Galileo_E5a_CODE_LENGTH_CHIPS, d_codeI, &d_local_code_shift_chips[1]); + multicorrelator_cpu_Q.set_local_code_and_taps(Galileo_E5a_CODE_LENGTH_CHIPS, d_codeQ, d_local_code_shift_chips); + multicorrelator_cpu_I.set_local_code_and_taps(Galileo_E5a_CODE_LENGTH_CHIPS, d_codeI, &d_local_code_shift_chips[1]); - // ################# CARRIER WIPEOFF AND CORRELATORS ############################## - // perform carrier wipe-off and compute Early, Prompt and Late correlation - multicorrelator_cpu_Q.set_input_output_vectors(d_correlator_outs,in); - multicorrelator_cpu_I.set_input_output_vectors(d_Single_Prompt_data,in); + // ################# CARRIER WIPEOFF AND CORRELATORS ############################## + // perform carrier wipe-off and compute Early, Prompt and Late correlation + multicorrelator_cpu_Q.set_input_output_vectors(d_correlator_outs, in); + multicorrelator_cpu_I.set_input_output_vectors(d_Single_Prompt_data, in); - double carr_phase_step_rad = GALILEO_TWO_PI * d_carrier_doppler_hz / static_cast(d_fs_in); - double code_phase_step_chips = d_code_freq_chips / (static_cast(d_fs_in)); - double rem_code_phase_chips = d_rem_code_phase_samples * (d_code_freq_chips / d_fs_in); - multicorrelator_cpu_Q.Carrier_wipeoff_multicorrelator_resampler( + double carr_phase_step_rad = GALILEO_TWO_PI * d_carrier_doppler_hz / static_cast(d_fs_in); + double code_phase_step_chips = d_code_freq_chips / (static_cast(d_fs_in)); + double rem_code_phase_chips = d_rem_code_phase_samples * (d_code_freq_chips / d_fs_in); + multicorrelator_cpu_Q.Carrier_wipeoff_multicorrelator_resampler( d_rem_carr_phase_rad, carr_phase_step_rad, rem_code_phase_chips, code_phase_step_chips, d_current_prn_length_samples); - multicorrelator_cpu_I.Carrier_wipeoff_multicorrelator_resampler( + multicorrelator_cpu_I.Carrier_wipeoff_multicorrelator_resampler( d_rem_carr_phase_rad, carr_phase_step_rad, rem_code_phase_chips, code_phase_step_chips, d_current_prn_length_samples); - // Accumulate results (coherent integration since there are no bit transitions in pilot signal) - d_Early += (*d_Single_Early) * sec_sign_Q; - d_Prompt += (*d_Single_Prompt) * sec_sign_Q; - d_Late += (*d_Single_Late) * sec_sign_Q; - d_Prompt_data=(*d_Single_Prompt_data); - d_Prompt_data *= sec_sign_I; - d_integration_counter++; + // Accumulate results (coherent integration since there are no bit transitions in pilot signal) + d_Early += (*d_Single_Early) * sec_sign_Q; + d_Prompt += (*d_Single_Prompt) * sec_sign_Q; + d_Late += (*d_Single_Late) * sec_sign_Q; + d_Prompt_data = (*d_Single_Prompt_data); + d_Prompt_data *= sec_sign_I; + d_integration_counter++; - // ################## PLL ########################################################## - // PLL discriminator - if (d_integration_counter == d_current_ti_ms) - { - if (d_secondary_lock == true) - { - carr_error_hz = pll_four_quadrant_atan(d_Prompt) / GALILEO_PI * 2.0; - } - else - { - carr_error_hz = pll_cloop_two_quadrant_atan(d_Prompt) / GALILEO_PI * 2.0; - } + // ################## PLL ########################################################## + // PLL discriminator + if (d_integration_counter == d_current_ti_ms) + { + if (d_secondary_lock == true) + { + carr_error_hz = pll_four_quadrant_atan(d_Prompt) / GALILEO_PI * 2.0; + } + else + { + carr_error_hz = pll_cloop_two_quadrant_atan(d_Prompt) / GALILEO_PI * 2.0; + } - // Carrier discriminator filter - carr_error_filt_hz = d_carrier_loop_filter.get_carrier_nco(carr_error_hz); - // New carrier Doppler frequency estimation - d_carrier_doppler_hz = d_acq_carrier_doppler_hz + carr_error_filt_hz; - // New code Doppler frequency estimation - d_code_freq_chips = Galileo_E5a_CODE_CHIP_RATE_HZ + ((d_carrier_doppler_hz * Galileo_E5a_CODE_CHIP_RATE_HZ) / Galileo_E5a_FREQ_HZ); - } - // carrier phase accumulator for (K) doppler estimation - d_acc_carrier_phase_rad -= 2.0 * GALILEO_PI * d_carrier_doppler_hz * GALILEO_E5a_CODE_PERIOD; - // remnant carrier phase to prevent overflow in the code NCO - d_rem_carr_phase_rad = d_rem_carr_phase_rad + 2.0 * GALILEO_PI * d_carrier_doppler_hz * GALILEO_E5a_CODE_PERIOD; - d_rem_carr_phase_rad = fmod(d_rem_carr_phase_rad, 2.0 * GALILEO_PI); + // Carrier discriminator filter + carr_error_filt_hz = d_carrier_loop_filter.get_carrier_nco(carr_error_hz); + // New carrier Doppler frequency estimation + d_carrier_doppler_hz = d_acq_carrier_doppler_hz + carr_error_filt_hz; + // New code Doppler frequency estimation + d_code_freq_chips = Galileo_E5a_CODE_CHIP_RATE_HZ + ((d_carrier_doppler_hz * Galileo_E5a_CODE_CHIP_RATE_HZ) / Galileo_E5a_FREQ_HZ); + } + // carrier phase accumulator for (K) doppler estimation + d_acc_carrier_phase_rad -= 2.0 * GALILEO_PI * d_carrier_doppler_hz * GALILEO_E5a_CODE_PERIOD; + // remnant carrier phase to prevent overflow in the code NCO + d_rem_carr_phase_rad = d_rem_carr_phase_rad + 2.0 * GALILEO_PI * d_carrier_doppler_hz * GALILEO_E5a_CODE_PERIOD; + d_rem_carr_phase_rad = fmod(d_rem_carr_phase_rad, 2.0 * GALILEO_PI); - // ################## DLL ########################################################## - if (d_integration_counter == d_current_ti_ms) - { - // DLL discriminator - code_error_chips = dll_nc_e_minus_l_normalized(d_Early, d_Late); //[chips/Ti] - // Code discriminator filter - code_error_filt_chips = d_code_loop_filter.get_code_nco(code_error_chips); //[chips/second] - //Code phase accumulator - d_code_error_filt_secs = (GALILEO_E5a_CODE_PERIOD * code_error_filt_chips) / Galileo_E5a_CODE_CHIP_RATE_HZ; //[seconds] - } - d_acc_code_phase_secs = d_acc_code_phase_secs + d_code_error_filt_secs; + // ################## DLL ########################################################## + if (d_integration_counter == d_current_ti_ms) + { + // DLL discriminator + code_error_chips = dll_nc_e_minus_l_normalized(d_Early, d_Late); //[chips/Ti] + // Code discriminator filter + code_error_filt_chips = d_code_loop_filter.get_code_nco(code_error_chips); //[chips/second] + //Code phase accumulator + d_code_error_filt_secs = (GALILEO_E5a_CODE_PERIOD * code_error_filt_chips) / Galileo_E5a_CODE_CHIP_RATE_HZ; //[seconds] + } + d_acc_code_phase_secs = d_acc_code_phase_secs + d_code_error_filt_secs; - // ################## CARRIER AND CODE NCO BUFFER ALIGNMENT ####################### - // keep alignment parameters for the next input buffer - double T_chip_seconds; - double T_prn_seconds; - double T_prn_samples; - double K_blk_samples; - // Compute the next buffer length based in the new period of the PRN sequence and the code phase error estimation - T_chip_seconds = 1.0 / d_code_freq_chips; - T_prn_seconds = T_chip_seconds * Galileo_E5a_CODE_LENGTH_CHIPS; - T_prn_samples = T_prn_seconds * static_cast(d_fs_in); - K_blk_samples = T_prn_samples + d_rem_code_phase_samples + d_code_error_filt_secs * static_cast(d_fs_in); - d_current_prn_length_samples = round(K_blk_samples); //round to a discrete samples - d_rem_code_phase_samples = K_blk_samples - d_current_prn_length_samples; //rounding error < 1 sample + // ################## CARRIER AND CODE NCO BUFFER ALIGNMENT ####################### + // keep alignment parameters for the next input buffer + double T_chip_seconds; + double T_prn_seconds; + double T_prn_samples; + double K_blk_samples; + // Compute the next buffer length based in the new period of the PRN sequence and the code phase error estimation + T_chip_seconds = 1.0 / d_code_freq_chips; + T_prn_seconds = T_chip_seconds * Galileo_E5a_CODE_LENGTH_CHIPS; + T_prn_samples = T_prn_seconds * static_cast(d_fs_in); + K_blk_samples = T_prn_samples + d_rem_code_phase_samples + d_code_error_filt_secs * static_cast(d_fs_in); + d_current_prn_length_samples = round(K_blk_samples); //round to a discrete samples + d_rem_code_phase_samples = K_blk_samples - d_current_prn_length_samples; //rounding error < 1 sample - // ####### CN0 ESTIMATION AND LOCK DETECTORS ###### - if (d_cn0_estimation_counter < FLAGS_cn0_samples - 1) - { - // fill buffer with prompt correlator output values - d_Prompt_buffer[d_cn0_estimation_counter] = d_Prompt; - d_cn0_estimation_counter++; - } - else - { - d_Prompt_buffer[d_cn0_estimation_counter] = d_Prompt; - // ATTEMPT SECONDARY CODE ACQUISITION - if (d_secondary_lock == false) - { - acquire_secondary(); // changes d_secondary_lock and d_secondary_delay - if (d_secondary_lock == true) - { - std::cout << "Galileo E5a secondary code locked for satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << std::endl; - d_current_ti_ms = d_ti_ms; - // Change loop parameters ========================================== - d_code_loop_filter.set_pdi(d_current_ti_ms * GALILEO_E5a_CODE_PERIOD); - d_carrier_loop_filter.set_pdi(d_current_ti_ms * GALILEO_E5a_CODE_PERIOD); - d_code_loop_filter.set_DLL_BW(d_dll_bw_narrow_hz); - d_carrier_loop_filter.set_PLL_BW(d_pll_bw_narrow_hz); - } - else - { - //std::cout << "Secondary code delay couldn't be resolved." << std::endl; - d_carrier_lock_fail_counter++; - if (d_carrier_lock_fail_counter > FLAGS_max_lock_fail) - { - std::cout << "Loss of lock in channel " << d_channel << "!" << std::endl; - LOG(INFO) << "Loss of lock in channel " << d_channel << "!"; - this->message_port_pub(pmt::mp("events"), pmt::from_long(3));//3 -> loss of lock - d_carrier_lock_fail_counter = 0; - d_state = 0; // TODO: check if disabling tracking is consistent with the channel state machine - } - } - } - else // Secondary lock achieved, monitor carrier lock. - { - // Code lock indicator - d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, static_cast(FLAGS_cn0_samples), d_fs_in,d_current_ti_ms * Galileo_E5a_CODE_LENGTH_CHIPS); - // Carrier lock indicator - d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer, static_cast(FLAGS_cn0_samples)); - // Loss of lock detection - if (d_carrier_lock_test < d_carrier_lock_threshold or d_CN0_SNV_dB_Hz < FLAGS_cn0_min) - { - d_carrier_lock_fail_counter++; - } - else - { - if (d_carrier_lock_fail_counter > 0) d_carrier_lock_fail_counter--; + // ####### CN0 ESTIMATION AND LOCK DETECTORS ###### + if (d_cn0_estimation_counter < FLAGS_cn0_samples - 1) + { + // fill buffer with prompt correlator output values + d_Prompt_buffer[d_cn0_estimation_counter] = d_Prompt; + d_cn0_estimation_counter++; + } + else + { + d_Prompt_buffer[d_cn0_estimation_counter] = d_Prompt; + // ATTEMPT SECONDARY CODE ACQUISITION + if (d_secondary_lock == false) + { + acquire_secondary(); // changes d_secondary_lock and d_secondary_delay + if (d_secondary_lock == true) + { + std::cout << "Galileo E5a secondary code locked for satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << std::endl; + d_current_ti_ms = d_ti_ms; + // Change loop parameters ========================================== + d_code_loop_filter.set_pdi(d_current_ti_ms * GALILEO_E5a_CODE_PERIOD); + d_carrier_loop_filter.set_pdi(d_current_ti_ms * GALILEO_E5a_CODE_PERIOD); + d_code_loop_filter.set_DLL_BW(d_dll_bw_narrow_hz); + d_carrier_loop_filter.set_PLL_BW(d_pll_bw_narrow_hz); + } + else + { + //std::cout << "Secondary code delay couldn't be resolved." << std::endl; + d_carrier_lock_fail_counter++; + if (d_carrier_lock_fail_counter > FLAGS_max_lock_fail) + { + std::cout << "Loss of lock in channel " << d_channel << "!" << std::endl; + LOG(INFO) << "Loss of lock in channel " << d_channel << "!"; + this->message_port_pub(pmt::mp("events"), pmt::from_long(3)); //3 -> loss of lock + d_carrier_lock_fail_counter = 0; + d_state = 0; // TODO: check if disabling tracking is consistent with the channel state machine + } + } + } + else // Secondary lock achieved, monitor carrier lock. + { + // Code lock indicator + d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, static_cast(FLAGS_cn0_samples), d_fs_in, d_current_ti_ms * Galileo_E5a_CODE_LENGTH_CHIPS); + // Carrier lock indicator + d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer, static_cast(FLAGS_cn0_samples)); + // Loss of lock detection + if (d_carrier_lock_test < d_carrier_lock_threshold or d_CN0_SNV_dB_Hz < FLAGS_cn0_min) + { + d_carrier_lock_fail_counter++; + } + else + { + if (d_carrier_lock_fail_counter > 0) d_carrier_lock_fail_counter--; - if (d_carrier_lock_fail_counter > FLAGS_max_lock_fail) - { - std::cout << "Loss of lock in channel " << d_channel << "!" << std::endl; - LOG(INFO) << "Loss of lock in channel " << d_channel << "!"; - this->message_port_pub(pmt::mp("events"), pmt::from_long(3));//3 -> loss of lock - d_carrier_lock_fail_counter = 0; - d_state = 0; - } - } - } - d_cn0_estimation_counter = 0; - } - if (d_secondary_lock && (d_secondary_delay % Galileo_E5a_I_SECONDARY_CODE_LENGTH) == 0) - { - d_first_transition = true; - } - // ########### Output the tracking data to navigation and PVT ########## - // The first Prompt output not equal to 0 is synchronized with the transition of a navigation data bit. - if (d_secondary_lock && d_first_transition) - { - current_synchro_data.Prompt_I = static_cast(d_Prompt_data.real()); - current_synchro_data.Prompt_Q = static_cast(d_Prompt_data.imag()); - current_synchro_data.Tracking_sample_counter = d_sample_counter + d_current_prn_length_samples; - current_synchro_data.Code_phase_samples = d_rem_code_phase_samples; - current_synchro_data.Carrier_phase_rads = d_acc_carrier_phase_rad; - current_synchro_data.Carrier_Doppler_hz = d_carrier_doppler_hz; - current_synchro_data.CN0_dB_hz = d_CN0_SNV_dB_Hz; - current_synchro_data.Flag_valid_symbol_output = true; - } - else - { - // make an output to not stop the rest of the processing blocks - current_synchro_data.Prompt_I = 0.0; - current_synchro_data.Prompt_Q = 0.0; - current_synchro_data.Tracking_sample_counter = d_sample_counter; - current_synchro_data.Carrier_phase_rads = 0.0; - current_synchro_data.CN0_dB_hz = 0.0; - current_synchro_data.Flag_valid_symbol_output = false; - } + if (d_carrier_lock_fail_counter > FLAGS_max_lock_fail) + { + std::cout << "Loss of lock in channel " << d_channel << "!" << std::endl; + LOG(INFO) << "Loss of lock in channel " << d_channel << "!"; + this->message_port_pub(pmt::mp("events"), pmt::from_long(3)); //3 -> loss of lock + d_carrier_lock_fail_counter = 0; + d_state = 0; + } + } + } + d_cn0_estimation_counter = 0; + } + if (d_secondary_lock && (d_secondary_delay % Galileo_E5a_I_SECONDARY_CODE_LENGTH) == 0) + { + d_first_transition = true; + } + // ########### Output the tracking data to navigation and PVT ########## + // The first Prompt output not equal to 0 is synchronized with the transition of a navigation data bit. + if (d_secondary_lock && d_first_transition) + { + current_synchro_data.Prompt_I = static_cast(d_Prompt_data.real()); + current_synchro_data.Prompt_Q = static_cast(d_Prompt_data.imag()); + current_synchro_data.Tracking_sample_counter = d_sample_counter + d_current_prn_length_samples; + current_synchro_data.Code_phase_samples = d_rem_code_phase_samples; + current_synchro_data.Carrier_phase_rads = d_acc_carrier_phase_rad; + current_synchro_data.Carrier_Doppler_hz = d_carrier_doppler_hz; + current_synchro_data.CN0_dB_hz = d_CN0_SNV_dB_Hz; + current_synchro_data.Flag_valid_symbol_output = true; + } + else + { + // make an output to not stop the rest of the processing blocks + current_synchro_data.Prompt_I = 0.0; + current_synchro_data.Prompt_Q = 0.0; + current_synchro_data.Tracking_sample_counter = d_sample_counter; + current_synchro_data.Carrier_phase_rads = 0.0; + current_synchro_data.CN0_dB_hz = 0.0; + current_synchro_data.Flag_valid_symbol_output = false; + } - break; + break; + } } - } current_synchro_data.fs = d_fs_in; current_synchro_data.correlation_length_ms = GALILEO_E5a_CODE_PERIOD_MS; - if(current_synchro_data.Flag_valid_symbol_output) { *out[0] = current_synchro_data; } + if (current_synchro_data.Flag_valid_symbol_output) + { + *out[0] = current_synchro_data; + } - if(d_dump) + if (d_dump) { // MULTIPLEXED FILE RECORDING - Record results to file float prompt_I; @@ -676,59 +677,64 @@ int Galileo_E5a_Dll_Pll_Tracking_cc::general_work (int noutput_items __attribute tmp_L = std::abs(d_Late); } try - { + { // EPR - d_dump_file.write(reinterpret_cast(&tmp_E), sizeof(float)); - d_dump_file.write(reinterpret_cast(&tmp_P), sizeof(float)); - d_dump_file.write(reinterpret_cast(&tmp_L), sizeof(float)); + d_dump_file.write(reinterpret_cast(&tmp_E), sizeof(float)); + d_dump_file.write(reinterpret_cast(&tmp_P), sizeof(float)); + d_dump_file.write(reinterpret_cast(&tmp_L), sizeof(float)); // PROMPT I and Q (to analyze navigation symbols) - d_dump_file.write(reinterpret_cast(&prompt_I), sizeof(float)); - d_dump_file.write(reinterpret_cast(&prompt_Q), sizeof(float)); + d_dump_file.write(reinterpret_cast(&prompt_I), sizeof(float)); + d_dump_file.write(reinterpret_cast(&prompt_Q), sizeof(float)); // PRN start sample stamp //tmp_float=(float)d_sample_counter; - d_dump_file.write(reinterpret_cast(&d_sample_counter), sizeof(unsigned long int)); + d_dump_file.write(reinterpret_cast(&d_sample_counter), sizeof(unsigned long int)); // accumulated carrier phase - d_dump_file.write(reinterpret_cast(&d_acc_carrier_phase_rad), sizeof(double)); + d_dump_file.write(reinterpret_cast(&d_acc_carrier_phase_rad), sizeof(double)); // carrier and code frequency - d_dump_file.write(reinterpret_cast(&d_carrier_doppler_hz), sizeof(double)); - d_dump_file.write(reinterpret_cast(&d_code_freq_chips), sizeof(double)); + d_dump_file.write(reinterpret_cast(&d_carrier_doppler_hz), sizeof(double)); + d_dump_file.write(reinterpret_cast(&d_code_freq_chips), sizeof(double)); //PLL commands - d_dump_file.write(reinterpret_cast(&carr_error_hz), sizeof(double)); - d_dump_file.write(reinterpret_cast(&carr_error_filt_hz), sizeof(double)); + d_dump_file.write(reinterpret_cast(&carr_error_hz), sizeof(double)); + d_dump_file.write(reinterpret_cast(&carr_error_filt_hz), sizeof(double)); //DLL commands - d_dump_file.write(reinterpret_cast(&code_error_chips), sizeof(double)); - d_dump_file.write(reinterpret_cast(&code_error_filt_chips), sizeof(double)); + d_dump_file.write(reinterpret_cast(&code_error_chips), sizeof(double)); + d_dump_file.write(reinterpret_cast(&code_error_filt_chips), sizeof(double)); // CN0 and carrier lock test - d_dump_file.write(reinterpret_cast(&d_CN0_SNV_dB_Hz), sizeof(double)); - d_dump_file.write(reinterpret_cast(&d_carrier_lock_test), sizeof(double)); + d_dump_file.write(reinterpret_cast(&d_CN0_SNV_dB_Hz), sizeof(double)); + d_dump_file.write(reinterpret_cast(&d_carrier_lock_test), sizeof(double)); // AUX vars (for debug purposes) tmp_double = d_rem_code_phase_samples; - d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); + d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); tmp_double = static_cast(d_sample_counter + d_current_prn_length_samples); - d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); + d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); // PRN unsigned int prn_ = d_acquisition_gnss_synchro->PRN; - d_dump_file.write(reinterpret_cast(&prn_), sizeof(unsigned int)); - - } - catch (const std::ifstream::failure & e) - { + d_dump_file.write(reinterpret_cast(&prn_), sizeof(unsigned int)); + } + catch (const std::ifstream::failure &e) + { LOG(WARNING) << "Exception writing trk dump file " << e.what(); - } + } } d_secondary_delay = (d_secondary_delay + 1) % Galileo_E5a_Q_SECONDARY_CODE_LENGTH; d_sample_counter += d_current_prn_length_samples; consume_each(d_current_prn_length_samples); - if(current_synchro_data.Flag_valid_symbol_output) { return 1; } - else { return 0; } + if (current_synchro_data.Flag_valid_symbol_output) + { + return 1; + } + else + { + return 0; + } } @@ -742,17 +748,17 @@ void Galileo_E5a_Dll_Pll_Tracking_cc::set_channel(unsigned int channel) if (d_dump_file.is_open() == false) { try - { + { d_dump_filename.append(boost::lexical_cast(d_channel)); d_dump_filename.append(".dat"); - d_dump_file.exceptions (std::ifstream::failbit | std::ifstream::badbit); + d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); LOG(INFO) << "Tracking dump enabled on channel " << d_channel << " Log file: " << d_dump_filename.c_str(); - } + } catch (const std::ifstream::failure &e) - { + { LOG(WARNING) << "channel " << d_channel << " Exception opening trk dump file " << e.what(); - } + } } } } @@ -765,18 +771,18 @@ int Galileo_E5a_Dll_Pll_Tracking_cc::save_matfile() int number_of_double_vars = 11; int number_of_float_vars = 5; int epoch_size_bytes = sizeof(unsigned long int) + sizeof(double) * number_of_double_vars + - sizeof(float) * number_of_float_vars + sizeof(unsigned int); + sizeof(float) * number_of_float_vars + sizeof(unsigned int); std::ifstream dump_file; dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); try - { + { dump_file.open(d_dump_filename.c_str(), std::ios::binary | std::ios::ate); - } - catch(const std::ifstream::failure &e) - { - std::cerr << "Problem opening dump file:" << e.what() << std::endl; + } + catch (const std::ifstream::failure &e) + { + std::cerr << "Problem opening dump file:" << e.what() << std::endl; return 1; - } + } // count number of epochs and rewind long int num_epoch = 0; if (dump_file.is_open()) @@ -789,30 +795,30 @@ int Galileo_E5a_Dll_Pll_Tracking_cc::save_matfile() { return 1; } - float * abs_E = new float [num_epoch]; - float * abs_P = new float [num_epoch]; - float * abs_L = new float [num_epoch]; - float * Prompt_I = new float [num_epoch]; - float * Prompt_Q = new float [num_epoch]; - unsigned long int * PRN_start_sample_count = new unsigned long int [num_epoch]; - double * acc_carrier_phase_rad = new double [num_epoch]; - double * carrier_doppler_hz = new double [num_epoch]; - double * code_freq_chips = new double [num_epoch]; - double * carr_error_hz = new double [num_epoch]; - double * carr_error_filt_hz = new double [num_epoch]; - double * code_error_chips = new double [num_epoch]; - double * code_error_filt_chips = new double [num_epoch]; - double * CN0_SNV_dB_Hz = new double [num_epoch]; - double * carrier_lock_test = new double [num_epoch]; - double * aux1 = new double [num_epoch]; - double * aux2 = new double [num_epoch]; - unsigned int * PRN = new unsigned int [num_epoch]; + float *abs_E = new float[num_epoch]; + float *abs_P = new float[num_epoch]; + float *abs_L = new float[num_epoch]; + float *Prompt_I = new float[num_epoch]; + float *Prompt_Q = new float[num_epoch]; + unsigned long int *PRN_start_sample_count = new unsigned long int[num_epoch]; + double *acc_carrier_phase_rad = new double[num_epoch]; + double *carrier_doppler_hz = new double[num_epoch]; + double *code_freq_chips = new double[num_epoch]; + double *carr_error_hz = new double[num_epoch]; + double *carr_error_filt_hz = new double[num_epoch]; + double *code_error_chips = new double[num_epoch]; + double *code_error_filt_chips = new double[num_epoch]; + double *CN0_SNV_dB_Hz = new double[num_epoch]; + double *carrier_lock_test = new double[num_epoch]; + double *aux1 = new double[num_epoch]; + double *aux2 = new double[num_epoch]; + unsigned int *PRN = new unsigned int[num_epoch]; try - { + { if (dump_file.is_open()) { - for(long int i = 0; i < num_epoch; i++) + for (long int i = 0; i < num_epoch; i++) { dump_file.read(reinterpret_cast(&abs_E[i]), sizeof(float)); dump_file.read(reinterpret_cast(&abs_P[i]), sizeof(float)); @@ -835,10 +841,10 @@ int Galileo_E5a_Dll_Pll_Tracking_cc::save_matfile() } } dump_file.close(); - } + } catch (const std::ifstream::failure &e) - { - std::cerr << "Problem reading dump file:" << e.what() << std::endl; + { + std::cerr << "Problem reading dump file:" << e.what() << std::endl; delete[] abs_E; delete[] abs_P; delete[] abs_L; @@ -858,7 +864,7 @@ int Galileo_E5a_Dll_Pll_Tracking_cc::save_matfile() delete[] aux2; delete[] PRN; return 1; - } + } // WRITE MAT FILE mat_t *matfp; @@ -867,79 +873,79 @@ int Galileo_E5a_Dll_Pll_Tracking_cc::save_matfile() filename.erase(filename.length() - 4, 4); filename.append(".mat"); matfp = Mat_CreateVer(filename.c_str(), NULL, MAT_FT_MAT73); - if(reinterpret_cast(matfp) != NULL) + if (reinterpret_cast(matfp) != NULL) { size_t dims[2] = {1, static_cast(num_epoch)}; matvar = Mat_VarCreate("abs_E", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, abs_E, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("abs_P", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, abs_P, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("abs_L", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, abs_L, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("Prompt_I", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, Prompt_I, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("Prompt_Q", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, Prompt_Q, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("PRN_start_sample_count", MAT_C_UINT64, MAT_T_UINT64, 2, dims, PRN_start_sample_count, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("acc_carrier_phase_rad", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, acc_carrier_phase_rad, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("carrier_doppler_hz", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, carrier_doppler_hz, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("code_freq_chips", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, code_freq_chips, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("carr_error_hz", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, carr_error_hz, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("carr_error_filt_hz", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, carr_error_filt_hz, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("code_error_chips", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, code_error_chips, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("code_error_filt_chips", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, code_error_filt_chips, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("CN0_SNV_dB_Hz", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, CN0_SNV_dB_Hz, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("carrier_lock_test", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, carrier_lock_test, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("aux1", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, aux1, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("aux2", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, aux2, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("PRN", MAT_C_UINT32, MAT_T_UINT32, 2, dims, PRN, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); } Mat_Close(matfp); @@ -965,7 +971,7 @@ int Galileo_E5a_Dll_Pll_Tracking_cc::save_matfile() } -void Galileo_E5a_Dll_Pll_Tracking_cc::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) +void Galileo_E5a_Dll_Pll_Tracking_cc::set_gnss_synchro(Gnss_Synchro *p_gnss_synchro) { d_acquisition_gnss_synchro = p_gnss_synchro; } diff --git a/src/algorithms/tracking/gnuradio_blocks/galileo_e5a_dll_pll_tracking_cc.h b/src/algorithms/tracking/gnuradio_blocks/galileo_e5a_dll_pll_tracking_cc.h index 2e1fcfed8..af9ea31fb 100644 --- a/src/algorithms/tracking/gnuradio_blocks/galileo_e5a_dll_pll_tracking_cc.h +++ b/src/algorithms/tracking/gnuradio_blocks/galileo_e5a_dll_pll_tracking_cc.h @@ -49,27 +49,25 @@ class Galileo_E5a_Dll_Pll_Tracking_cc; typedef boost::shared_ptr - galileo_e5a_dll_pll_tracking_cc_sptr; + galileo_e5a_dll_pll_tracking_cc_sptr; galileo_e5a_dll_pll_tracking_cc_sptr galileo_e5a_dll_pll_make_tracking_cc(long if_freq, - long fs_in, unsigned - int vector_length, - bool dump, - std::string dump_filename, - float pll_bw_hz, - float dll_bw_hz, - float pll_bw_narrow_narrowhz, - float dll_bw_narrow_hz, - int ti_ms, - float early_late_space_chips); - + long fs_in, unsigned int vector_length, + bool dump, + std::string dump_filename, + float pll_bw_hz, + float dll_bw_hz, + float pll_bw_narrow_narrowhz, + float dll_bw_narrow_hz, + int ti_ms, + float early_late_space_chips); /*! * \brief This class implements a DLL + PLL tracking loop block */ -class Galileo_E5a_Dll_Pll_Tracking_cc: public gr::block +class Galileo_E5a_Dll_Pll_Tracking_cc : public gr::block { public: ~Galileo_E5a_Dll_Pll_Tracking_cc(); @@ -78,36 +76,34 @@ public: void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro); void start_tracking(); - int general_work (int noutput_items, gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); + int general_work(int noutput_items, gr_vector_int& ninput_items, + gr_vector_const_void_star& input_items, gr_vector_void_star& output_items); - void forecast (int noutput_items, gr_vector_int &ninput_items_required); + void forecast(int noutput_items, gr_vector_int& ninput_items_required); private: friend galileo_e5a_dll_pll_tracking_cc_sptr galileo_e5a_dll_pll_make_tracking_cc(long if_freq, - long fs_in, unsigned - int vector_length, - bool dump, - std::string dump_filename, - float pll_bw_hz, - float dll_bw_hz, - float pll_bw_narrow_hz, - float dll_bw_narrow_hz, - int ti_ms, - float early_late_space_chips); + long fs_in, unsigned int vector_length, + bool dump, + std::string dump_filename, + float pll_bw_hz, + float dll_bw_hz, + float pll_bw_narrow_hz, + float dll_bw_narrow_hz, + int ti_ms, + float early_late_space_chips); Galileo_E5a_Dll_Pll_Tracking_cc(long if_freq, - long fs_in, unsigned - int vector_length, - bool dump, - std::string dump_filename, - float pll_bw_hz, - float dll_bw_hz, - float pll_bw_narrow_hz, - float dll_bw_narrow_hz, - int ti_ms, - float early_late_space_chips); + long fs_in, unsigned int vector_length, + bool dump, + std::string dump_filename, + float pll_bw_hz, + float dll_bw_hz, + float pll_bw_narrow_hz, + float dll_bw_narrow_hz, + int ti_ms, + float early_late_space_chips); void acquire_secondary(); // tracking configuration vars unsigned int d_vector_length; diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_cc.cc index 8b8a707ea..7acd09040 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_cc.cc @@ -60,29 +60,29 @@ using google::LogMessage; glonass_l1_ca_dll_pll_c_aid_tracking_cc_sptr glonass_l1_ca_dll_pll_c_aid_make_tracking_cc( - long if_freq, - long fs_in, - unsigned int vector_length, - bool dump, - std::string dump_filename, - float pll_bw_hz, - float dll_bw_hz, - float pll_bw_narrow_hz, - float dll_bw_narrow_hz, - int extend_correlation_ms, - float early_late_space_chips) + long if_freq, + long fs_in, + unsigned int vector_length, + bool dump, + std::string dump_filename, + float pll_bw_hz, + float dll_bw_hz, + float pll_bw_narrow_hz, + float dll_bw_narrow_hz, + int extend_correlation_ms, + float early_late_space_chips) { return glonass_l1_ca_dll_pll_c_aid_tracking_cc_sptr(new glonass_l1_ca_dll_pll_c_aid_tracking_cc(if_freq, - fs_in, vector_length, dump, dump_filename, pll_bw_hz, dll_bw_hz,pll_bw_narrow_hz, dll_bw_narrow_hz, extend_correlation_ms, early_late_space_chips)); + fs_in, vector_length, dump, dump_filename, pll_bw_hz, dll_bw_hz, pll_bw_narrow_hz, dll_bw_narrow_hz, extend_correlation_ms, early_late_space_chips)); } -void glonass_l1_ca_dll_pll_c_aid_tracking_cc::forecast (int noutput_items, - gr_vector_int &ninput_items_required) +void glonass_l1_ca_dll_pll_c_aid_tracking_cc::forecast(int noutput_items, + gr_vector_int &ninput_items_required) { if (noutput_items != 0) { - ninput_items_required[0] = static_cast(d_vector_length) * 2; //set the required available samples in each call + ninput_items_required[0] = static_cast(d_vector_length) * 2; //set the required available samples in each call } } @@ -90,8 +90,8 @@ void glonass_l1_ca_dll_pll_c_aid_tracking_cc::forecast (int noutput_items, void glonass_l1_ca_dll_pll_c_aid_tracking_cc::msg_handler_preamble_index(pmt::pmt_t msg) { //pmt::print(msg); - DLOG(INFO) << "Extended correlation enabled for Tracking CH " << d_channel << ": Satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN); - if (d_enable_extended_integration == false) //avoid re-setting preamble indicator + DLOG(INFO) << "Extended correlation enabled for Tracking CH " << d_channel << ": Satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN); + if (d_enable_extended_integration == false) //avoid re-setting preamble indicator { d_preamble_timestamp_s = pmt::to_double(msg); d_enable_extended_integration = true; @@ -101,25 +101,24 @@ void glonass_l1_ca_dll_pll_c_aid_tracking_cc::msg_handler_preamble_index(pmt::pm glonass_l1_ca_dll_pll_c_aid_tracking_cc::glonass_l1_ca_dll_pll_c_aid_tracking_cc( - long if_freq, - long fs_in, - unsigned int vector_length, - bool dump, - std::string dump_filename, - float pll_bw_hz, - float dll_bw_hz, - float pll_bw_narrow_hz, - float dll_bw_narrow_hz, - int extend_correlation_ms, - float early_late_space_chips) : - gr::block("glonass_l1_ca_dll_pll_c_aid_tracking_cc", gr::io_signature::make(1, 1, sizeof(gr_complex)), - gr::io_signature::make(1, 1, sizeof(Gnss_Synchro))) + long if_freq, + long fs_in, + unsigned int vector_length, + bool dump, + std::string dump_filename, + float pll_bw_hz, + float dll_bw_hz, + float pll_bw_narrow_hz, + float dll_bw_narrow_hz, + int extend_correlation_ms, + float early_late_space_chips) : gr::block("glonass_l1_ca_dll_pll_c_aid_tracking_cc", gr::io_signature::make(1, 1, sizeof(gr_complex)), + gr::io_signature::make(1, 1, sizeof(Gnss_Synchro))) { // Telemetry bit synchronization message port input this->message_port_register_in(pmt::mp("preamble_timestamp_s")); this->set_msg_handler(pmt::mp("preamble_timestamp_s"), - boost::bind(&glonass_l1_ca_dll_pll_c_aid_tracking_cc::msg_handler_preamble_index, this, _1)); + boost::bind(&glonass_l1_ca_dll_pll_c_aid_tracking_cc::msg_handler_preamble_index, this, _1)); this->message_port_register_out(pmt::mp("events")); // initialize internal vars @@ -140,22 +139,22 @@ glonass_l1_ca_dll_pll_c_aid_tracking_cc::glonass_l1_ca_dll_pll_c_aid_tracking_cc d_carrier_loop_filter.set_params(10.0, d_pll_bw_hz, 2); // --- DLL variables -------------------------------------------------------- - d_early_late_spc_chips = early_late_space_chips; // Define early-late offset (in chips) + d_early_late_spc_chips = early_late_space_chips; // Define early-late offset (in chips) // Initialization of local code replica // Get space for a vector with the C/A code replica sampled 1x/chip - d_ca_code = static_cast(volk_gnsssdr_malloc(static_cast(GLONASS_L1_CA_CODE_LENGTH_CHIPS) * sizeof(gr_complex), volk_gnsssdr_get_alignment())); + d_ca_code = static_cast(volk_gnsssdr_malloc(static_cast(GLONASS_L1_CA_CODE_LENGTH_CHIPS) * sizeof(gr_complex), volk_gnsssdr_get_alignment())); // correlator outputs (scalar) - d_n_correlator_taps = 3; // Early, Prompt, and Late - d_correlator_outs = static_cast(volk_gnsssdr_malloc(d_n_correlator_taps*sizeof(gr_complex), volk_gnsssdr_get_alignment())); + d_n_correlator_taps = 3; // Early, Prompt, and Late + d_correlator_outs = static_cast(volk_gnsssdr_malloc(d_n_correlator_taps * sizeof(gr_complex), volk_gnsssdr_get_alignment())); for (int n = 0; n < d_n_correlator_taps; n++) { - d_correlator_outs[n] = gr_complex(0,0); + d_correlator_outs[n] = gr_complex(0, 0); } - d_local_code_shift_chips = static_cast(volk_gnsssdr_malloc(d_n_correlator_taps*sizeof(float), volk_gnsssdr_get_alignment())); + d_local_code_shift_chips = static_cast(volk_gnsssdr_malloc(d_n_correlator_taps * sizeof(float), volk_gnsssdr_get_alignment())); // Set TAPs delay values [chips] - d_local_code_shift_chips[0] = - d_early_late_spc_chips; + d_local_code_shift_chips[0] = -d_early_late_spc_chips; d_local_code_shift_chips[1] = 0.0; d_local_code_shift_chips[2] = d_early_late_spc_chips; @@ -170,7 +169,7 @@ glonass_l1_ca_dll_pll_c_aid_tracking_cc::glonass_l1_ca_dll_pll_c_aid_tracking_cc d_rem_carrier_phase_rad = 0.0; // sample synchronization - d_sample_counter = 0; //(from trk to tlm) + d_sample_counter = 0; //(from trk to tlm) d_acq_sample_stamp = 0; d_enable_tracking = false; d_pull_in = false; @@ -228,7 +227,7 @@ void glonass_l1_ca_dll_pll_c_aid_tracking_cc::start_tracking() long int acq_trk_diff_samples; double acq_trk_diff_seconds; - acq_trk_diff_samples = static_cast(d_sample_counter) - static_cast(d_acq_sample_stamp);//-d_vector_length; + acq_trk_diff_samples = static_cast(d_sample_counter) - static_cast(d_acq_sample_stamp); //-d_vector_length; DLOG(INFO) << "Number of samples between Acquisition and Tracking =" << acq_trk_diff_samples; acq_trk_diff_seconds = static_cast(acq_trk_diff_samples) / static_cast(d_fs_in); // Doppler effect @@ -270,8 +269,8 @@ void glonass_l1_ca_dll_pll_c_aid_tracking_cc::start_tracking() // DLL/PLL filter initialization - d_carrier_loop_filter.initialize(d_carrier_frequency_hz); // The carrier loop filter implements the Doppler accumulator - d_code_loop_filter.initialize(); // initialize the code filter + d_carrier_loop_filter.initialize(d_carrier_frequency_hz); // The carrier loop filter implements the Doppler accumulator + d_code_loop_filter.initialize(); // initialize the code filter // generate local reference ALWAYS starting at chip 1 (1 sample per chip) glonass_l1_ca_code_gen_complex(d_ca_code, 0); @@ -279,7 +278,7 @@ void glonass_l1_ca_dll_pll_c_aid_tracking_cc::start_tracking() multicorrelator_cpu.set_local_code_and_taps(static_cast(GLONASS_L1_CA_CODE_LENGTH_CHIPS), d_ca_code, d_local_code_shift_chips); for (int n = 0; n < d_n_correlator_taps; n++) { - d_correlator_outs[n] = gr_complex(0,0); + d_correlator_outs[n] = gr_complex(0, 0); } d_carrier_lock_fail_counter = 0; @@ -291,7 +290,7 @@ void glonass_l1_ca_dll_pll_c_aid_tracking_cc::start_tracking() d_code_phase_samples = d_acq_code_phase_samples; std::string sys_ = &d_acquisition_gnss_synchro->System; - sys = sys_.substr(0,1); + sys = sys_.substr(0, 1); // DEBUG OUTPUT std::cout << "Tracking start on channel " << d_channel << " for satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << std::endl; @@ -313,40 +312,40 @@ glonass_l1_ca_dll_pll_c_aid_tracking_cc::~glonass_l1_ca_dll_pll_c_aid_tracking_c if (d_dump_file.is_open()) { try - { + { d_dump_file.close(); - } - catch(const std::exception & ex) - { + } + catch (const std::exception &ex) + { LOG(WARNING) << "Exception in destructor " << ex.what(); - } + } } - if(d_dump) + if (d_dump) { - if(d_channel == 0) + if (d_channel == 0) { std::cout << "Writing .mat files ..."; } glonass_l1_ca_dll_pll_c_aid_tracking_cc::save_matfile(); - if(d_channel == 0) + if (d_channel == 0) { std::cout << " done." << std::endl; } } try - { + { volk_gnsssdr_free(d_local_code_shift_chips); volk_gnsssdr_free(d_correlator_outs); volk_gnsssdr_free(d_ca_code); delete[] d_Prompt_buffer; multicorrelator_cpu.free(); - } - catch(const std::exception & ex) - { + } + catch (const std::exception &ex) + { LOG(WARNING) << "Exception in destructor " << ex.what(); - } + } } @@ -357,18 +356,18 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_cc::save_matfile() int number_of_double_vars = 11; int number_of_float_vars = 5; int epoch_size_bytes = sizeof(unsigned long int) + sizeof(double) * number_of_double_vars + - sizeof(float) * number_of_float_vars + sizeof(unsigned int); + sizeof(float) * number_of_float_vars + sizeof(unsigned int); std::ifstream dump_file; dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); try - { + { dump_file.open(d_dump_filename.c_str(), std::ios::binary | std::ios::ate); - } - catch(const std::ifstream::failure &e) - { - std::cerr << "Problem opening dump file:" << e.what() << std::endl; + } + catch (const std::ifstream::failure &e) + { + std::cerr << "Problem opening dump file:" << e.what() << std::endl; return 1; - } + } // count number of epochs and rewind long int num_epoch = 0; if (dump_file.is_open()) @@ -381,30 +380,30 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_cc::save_matfile() { return 1; } - float * abs_E = new float [num_epoch]; - float * abs_P = new float [num_epoch]; - float * abs_L = new float [num_epoch]; - float * Prompt_I = new float [num_epoch]; - float * Prompt_Q = new float [num_epoch]; - unsigned long int * PRN_start_sample_count = new unsigned long int [num_epoch]; - double * acc_carrier_phase_rad = new double [num_epoch]; - double * carrier_doppler_hz = new double [num_epoch]; - double * code_freq_chips = new double [num_epoch]; - double * carr_error_hz = new double [num_epoch]; - double * carr_error_filt_hz = new double [num_epoch]; - double * code_error_chips = new double [num_epoch]; - double * code_error_filt_chips = new double [num_epoch]; - double * CN0_SNV_dB_Hz = new double [num_epoch]; - double * carrier_lock_test = new double [num_epoch]; - double * aux1 = new double [num_epoch]; - double * aux2 = new double [num_epoch]; - unsigned int * PRN = new unsigned int [num_epoch]; + float *abs_E = new float[num_epoch]; + float *abs_P = new float[num_epoch]; + float *abs_L = new float[num_epoch]; + float *Prompt_I = new float[num_epoch]; + float *Prompt_Q = new float[num_epoch]; + unsigned long int *PRN_start_sample_count = new unsigned long int[num_epoch]; + double *acc_carrier_phase_rad = new double[num_epoch]; + double *carrier_doppler_hz = new double[num_epoch]; + double *code_freq_chips = new double[num_epoch]; + double *carr_error_hz = new double[num_epoch]; + double *carr_error_filt_hz = new double[num_epoch]; + double *code_error_chips = new double[num_epoch]; + double *code_error_filt_chips = new double[num_epoch]; + double *CN0_SNV_dB_Hz = new double[num_epoch]; + double *carrier_lock_test = new double[num_epoch]; + double *aux1 = new double[num_epoch]; + double *aux2 = new double[num_epoch]; + unsigned int *PRN = new unsigned int[num_epoch]; try - { + { if (dump_file.is_open()) { - for(long int i = 0; i < num_epoch; i++) + for (long int i = 0; i < num_epoch; i++) { dump_file.read(reinterpret_cast(&abs_E[i]), sizeof(float)); dump_file.read(reinterpret_cast(&abs_P[i]), sizeof(float)); @@ -427,10 +426,10 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_cc::save_matfile() } } dump_file.close(); - } + } catch (const std::ifstream::failure &e) - { - std::cerr << "Problem reading dump file:" << e.what() << std::endl; + { + std::cerr << "Problem reading dump file:" << e.what() << std::endl; delete[] abs_E; delete[] abs_P; delete[] abs_L; @@ -450,7 +449,7 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_cc::save_matfile() delete[] aux2; delete[] PRN; return 1; - } + } // WRITE MAT FILE mat_t *matfp; @@ -459,79 +458,79 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_cc::save_matfile() filename.erase(filename.length() - 4, 4); filename.append(".mat"); matfp = Mat_CreateVer(filename.c_str(), NULL, MAT_FT_MAT73); - if(reinterpret_cast(matfp) != NULL) + if (reinterpret_cast(matfp) != NULL) { size_t dims[2] = {1, static_cast(num_epoch)}; matvar = Mat_VarCreate("abs_E", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, abs_E, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("abs_P", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, abs_P, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("abs_L", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, abs_L, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("Prompt_I", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, Prompt_I, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("Prompt_Q", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, Prompt_Q, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("PRN_start_sample_count", MAT_C_UINT64, MAT_T_UINT64, 2, dims, PRN_start_sample_count, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("acc_carrier_phase_rad", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, acc_carrier_phase_rad, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("carrier_doppler_hz", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, carrier_doppler_hz, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("code_freq_chips", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, code_freq_chips, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("carr_error_hz", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, carr_error_hz, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("carr_error_filt_hz", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, carr_error_filt_hz, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("code_error_chips", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, code_error_chips, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("code_error_filt_chips", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, code_error_filt_chips, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("CN0_SNV_dB_Hz", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, CN0_SNV_dB_Hz, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("carrier_lock_test", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, carrier_lock_test, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("aux1", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, aux1, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("aux2", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, aux2, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("PRN", MAT_C_UINT32, MAT_T_UINT32, 2, dims, PRN, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); } Mat_Close(matfp); @@ -557,11 +556,11 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_cc::save_matfile() } -int glonass_l1_ca_dll_pll_c_aid_tracking_cc::general_work (int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), - gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) +int glonass_l1_ca_dll_pll_c_aid_tracking_cc::general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), + gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { // Block input data and block output stream pointers - const gr_complex* in = reinterpret_cast(input_items[0]); // PRN start block alignment + const gr_complex *in = reinterpret_cast(input_items[0]); // PRN start block alignment Gnss_Synchro **out = reinterpret_cast(&output_items[0]); // GNSS_SYNCHRO OBJECT to interchange data between tracking->telemetry_decoder @@ -586,31 +585,31 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_cc::general_work (int noutput_items __a acq_trk_shif_correction_samples = d_correlation_length_samples - fmod(static_cast(acq_to_trk_delay_samples), static_cast(d_correlation_length_samples)); samples_offset = round(d_acq_code_phase_samples + acq_trk_shif_correction_samples); current_synchro_data.Tracking_sample_counter = d_sample_counter + samples_offset; - d_sample_counter += samples_offset; // count for the processed samples + d_sample_counter += samples_offset; // count for the processed samples d_pull_in = false; d_acc_carrier_phase_cycles -= d_carrier_phase_step_rad * samples_offset / GLONASS_TWO_PI; current_synchro_data.Carrier_phase_rads = d_acc_carrier_phase_cycles * GLONASS_TWO_PI; current_synchro_data.Carrier_Doppler_hz = d_carrier_doppler_hz; - current_synchro_data.fs=d_fs_in; + current_synchro_data.fs = d_fs_in; *out[0] = current_synchro_data; - consume_each(samples_offset); // shift input to perform alignment with local replica + consume_each(samples_offset); // shift input to perform alignment with local replica return 1; } // ################# CARRIER WIPEOFF AND CORRELATORS ############################## // perform carrier wipe-off and compute Early, Prompt and Late correlation - multicorrelator_cpu.set_input_output_vectors(d_correlator_outs,in); + multicorrelator_cpu.set_input_output_vectors(d_correlator_outs, in); multicorrelator_cpu.Carrier_wipeoff_multicorrelator_resampler(d_rem_carrier_phase_rad, - d_carrier_phase_step_rad, - d_rem_code_phase_chips, - d_code_phase_step_chips, - d_correlation_length_samples); + d_carrier_phase_step_rad, + d_rem_code_phase_chips, + d_code_phase_step_chips, + d_correlation_length_samples); // ####### coherent intergration extension // keep the last symbols - d_E_history.push_back(d_correlator_outs[0]); // save early output - d_P_history.push_back(d_correlator_outs[1]); // save prompt output - d_L_history.push_back(d_correlator_outs[2]); // save late output + d_E_history.push_back(d_correlator_outs[0]); // save early output + d_P_history.push_back(d_correlator_outs[1]); // save prompt output + d_L_history.push_back(d_correlator_outs[2]); // save late output if (static_cast(d_P_history.size()) > d_extend_correlation_ms) { @@ -628,9 +627,9 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_cc::general_work (int noutput_items __a // compute coherent integration and enable tracking loop // perform coherent integration using correlator output history // std::cout<<"##### RESET COHERENT INTEGRATION ####"<PRN) + std::cout << "Enabled " << d_extend_correlation_ms << " [ms] extended correlator for CH " << d_channel << " : Satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << " pll_bw = " << d_pll_bw_hz << " [Hz], pll_narrow_bw = " << d_pll_bw_narrow_hz << " [Hz]" << std::endl << " dll_bw = " << d_dll_bw_hz << " [Hz], dll_narrow_bw = " << d_dll_bw_narrow_hz << " [Hz]" << std::endl; } @@ -654,7 +653,7 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_cc::general_work (int noutput_items __a } else { - if(d_preamble_synchronized == true) + if (d_preamble_synchronized == true) { // continue extended coherent correlation // Compute the next buffer length based on the period of the PRN sequence and the code phase error estimation @@ -665,7 +664,7 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_cc::general_work (int noutput_items __a double K_T_prn_error_samples = K_prn_samples - T_prn_samples; d_rem_code_phase_samples = d_rem_code_phase_samples - K_T_prn_error_samples; - d_rem_code_phase_integer_samples = round(d_rem_code_phase_samples); // round to a discrete number of samples + d_rem_code_phase_integer_samples = round(d_rem_code_phase_samples); // round to a discrete number of samples d_correlation_length_samples = K_prn_samples + d_rem_code_phase_integer_samples; d_rem_code_phase_samples = d_rem_code_phase_samples - d_rem_code_phase_integer_samples; // code phase step (Code resampler phase increment per sample) [chips/sample] @@ -702,7 +701,7 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_cc::general_work (int noutput_items __a { // ################## PLL ########################################################## // Update PLL discriminator [rads/Ti -> Secs/Ti] - d_carr_phase_error_secs_Ti = pll_cloop_two_quadrant_atan(d_correlator_outs[1]) / GLONASS_TWO_PI; // prompt output + d_carr_phase_error_secs_Ti = pll_cloop_two_quadrant_atan(d_correlator_outs[1]) / GLONASS_TWO_PI; // prompt output d_carrier_doppler_old_hz = d_carrier_doppler_hz; // Carrier discriminator filter // NOTICE: The carrier loop filter includes the Carrier Doppler accumulator, as described in Kaplan @@ -715,11 +714,11 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_cc::general_work (int noutput_items __a // ################## DLL ########################################################## // DLL discriminator - d_code_error_chips_Ti = dll_nc_e_minus_l_normalized(d_correlator_outs[0], d_correlator_outs[2]); // [chips/Ti] //early and late + d_code_error_chips_Ti = dll_nc_e_minus_l_normalized(d_correlator_outs[0], d_correlator_outs[2]); // [chips/Ti] //early and late // Code discriminator filter - d_code_error_filt_chips_s = d_code_loop_filter.get_code_nco(d_code_error_chips_Ti); // input [chips/Ti] -> output [chips/second] + d_code_error_filt_chips_s = d_code_loop_filter.get_code_nco(d_code_error_chips_Ti); // input [chips/Ti] -> output [chips/second] d_code_error_filt_chips_Ti = d_code_error_filt_chips_s * CURRENT_INTEGRATION_TIME_S; - code_error_filt_secs_Ti = d_code_error_filt_chips_Ti / d_code_freq_chips; // [s/Ti] + code_error_filt_secs_Ti = d_code_error_filt_chips_Ti / d_code_freq_chips; // [s/Ti] // ################## CARRIER AND CODE NCO BUFFER ALIGNEMENT ####################### // keep alignment parameters for the next input buffer @@ -730,12 +729,12 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_cc::general_work (int noutput_items __a double K_prn_samples = round(T_prn_samples); double K_T_prn_error_samples = K_prn_samples - T_prn_samples; - d_rem_code_phase_samples = d_rem_code_phase_samples - K_T_prn_error_samples + code_error_filt_secs_Ti * static_cast(d_fs_in); //(code_error_filt_secs_Ti + d_pll_to_dll_assist_secs_Ti) * static_cast(d_fs_in); - d_rem_code_phase_integer_samples = round(d_rem_code_phase_samples); // round to a discrete number of samples + d_rem_code_phase_samples = d_rem_code_phase_samples - K_T_prn_error_samples + code_error_filt_secs_Ti * static_cast(d_fs_in); //(code_error_filt_secs_Ti + d_pll_to_dll_assist_secs_Ti) * static_cast(d_fs_in); + d_rem_code_phase_integer_samples = round(d_rem_code_phase_samples); // round to a discrete number of samples d_correlation_length_samples = K_prn_samples + d_rem_code_phase_integer_samples; d_rem_code_phase_samples = d_rem_code_phase_samples - d_rem_code_phase_integer_samples; - //################### PLL COMMANDS ################################################# + //################### PLL COMMANDS ################################################# //carrier phase step (NCO phase increment per sample) [rads/sample] d_carrier_phase_step_rad = GLONASS_TWO_PI * d_carrier_doppler_hz / static_cast(d_fs_in); d_acc_carrier_phase_cycles -= d_carrier_phase_step_rad * d_correlation_length_samples / GLONASS_TWO_PI; @@ -754,7 +753,7 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_cc::general_work (int noutput_items __a if (d_cn0_estimation_counter < FLAGS_cn0_samples) { // fill buffer with prompt correlator output values - d_Prompt_buffer[d_cn0_estimation_counter] = d_correlator_outs[1]; // prompt + d_Prompt_buffer[d_cn0_estimation_counter] = d_correlator_outs[1]; // prompt d_cn0_estimation_counter++; } else @@ -777,9 +776,9 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_cc::general_work (int noutput_items __a { std::cout << "Loss of lock in channel " << d_channel << "!" << std::endl; LOG(INFO) << "Loss of lock in channel " << d_channel << "!"; - this->message_port_pub(pmt::mp("events"), pmt::from_long(3));//3 -> loss of lock + this->message_port_pub(pmt::mp("events"), pmt::from_long(3)); //3 -> loss of lock d_carrier_lock_fail_counter = 0; - d_enable_tracking = false; // TODO: check if disabling tracking is consistent with the channel state machine + d_enable_tracking = false; // TODO: check if disabling tracking is consistent with the channel state machine } } // ########### Output the tracking data to navigation and PVT ########## @@ -807,7 +806,7 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_cc::general_work (int noutput_items __a current_synchro_data.Tracking_sample_counter = d_sample_counter + d_correlation_length_samples; current_synchro_data.Code_phase_samples = d_rem_code_phase_samples; current_synchro_data.Carrier_phase_rads = GLONASS_TWO_PI * d_acc_carrier_phase_cycles; - current_synchro_data.Carrier_Doppler_hz = d_carrier_doppler_hz;// todo: project the carrier doppler + current_synchro_data.Carrier_Doppler_hz = d_carrier_doppler_hz; // todo: project the carrier doppler current_synchro_data.CN0_dB_hz = d_CN0_SNV_dB_Hz; } } @@ -815,16 +814,16 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_cc::general_work (int noutput_items __a { for (int n = 0; n < d_n_correlator_taps; n++) { - d_correlator_outs[n] = gr_complex(0,0); + d_correlator_outs[n] = gr_complex(0, 0); } current_synchro_data.System = {'R'}; current_synchro_data.Tracking_sample_counter = d_sample_counter + d_correlation_length_samples; } //assign the GNURadio block output data - current_synchro_data.fs=d_fs_in; + current_synchro_data.fs = d_fs_in; *out[0] = current_synchro_data; - if(d_dump) + if (d_dump) { // MULTIPLEXED FILE RECORDING - Record results to file float prompt_I; @@ -837,57 +836,57 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_cc::general_work (int noutput_items __a tmp_P = std::abs(d_correlator_outs[1]); tmp_L = std::abs(d_correlator_outs[2]); try - { + { // EPR - d_dump_file.write(reinterpret_cast(&tmp_E), sizeof(float)); - d_dump_file.write(reinterpret_cast(&tmp_P), sizeof(float)); - d_dump_file.write(reinterpret_cast(&tmp_L), sizeof(float)); + d_dump_file.write(reinterpret_cast(&tmp_E), sizeof(float)); + d_dump_file.write(reinterpret_cast(&tmp_P), sizeof(float)); + d_dump_file.write(reinterpret_cast(&tmp_L), sizeof(float)); // PROMPT I and Q (to analyze navigation symbols) - d_dump_file.write(reinterpret_cast(&prompt_I), sizeof(float)); - d_dump_file.write(reinterpret_cast(&prompt_Q), sizeof(float)); + d_dump_file.write(reinterpret_cast(&prompt_I), sizeof(float)); + d_dump_file.write(reinterpret_cast(&prompt_Q), sizeof(float)); // PRN start sample stamp //tmp_float=(float)d_sample_counter; - d_dump_file.write(reinterpret_cast(&d_sample_counter), sizeof(unsigned long int)); + d_dump_file.write(reinterpret_cast(&d_sample_counter), sizeof(unsigned long int)); // accumulated carrier phase - d_dump_file.write(reinterpret_cast(&d_acc_carrier_phase_cycles), sizeof(double)); + d_dump_file.write(reinterpret_cast(&d_acc_carrier_phase_cycles), sizeof(double)); // carrier and code frequency - double if_freq_carrier = d_carrier_doppler_hz + d_if_freq + (DFRQ1_GLO * static_cast(GLONASS_PRN.at(d_acquisition_gnss_synchro->PRN))); - d_dump_file.write(reinterpret_cast(&if_freq_carrier), sizeof(double)); - d_dump_file.write(reinterpret_cast(&d_code_freq_chips), sizeof(double)); + double if_freq_carrier = d_carrier_doppler_hz + d_if_freq + (DFRQ1_GLO * static_cast(GLONASS_PRN.at(d_acquisition_gnss_synchro->PRN))); + d_dump_file.write(reinterpret_cast(&if_freq_carrier), sizeof(double)); + d_dump_file.write(reinterpret_cast(&d_code_freq_chips), sizeof(double)); //PLL commands - d_dump_file.write(reinterpret_cast(&d_carr_phase_error_secs_Ti), sizeof(double)); - d_dump_file.write(reinterpret_cast(&d_carrier_doppler_hz), sizeof(double)); + d_dump_file.write(reinterpret_cast(&d_carr_phase_error_secs_Ti), sizeof(double)); + d_dump_file.write(reinterpret_cast(&d_carrier_doppler_hz), sizeof(double)); //DLL commands - d_dump_file.write(reinterpret_cast(&d_code_error_chips_Ti), sizeof(double)); - d_dump_file.write(reinterpret_cast(&d_code_error_filt_chips_Ti), sizeof(double)); + d_dump_file.write(reinterpret_cast(&d_code_error_chips_Ti), sizeof(double)); + d_dump_file.write(reinterpret_cast(&d_code_error_filt_chips_Ti), sizeof(double)); // CN0 and carrier lock test - d_dump_file.write(reinterpret_cast(&d_CN0_SNV_dB_Hz), sizeof(double)); - d_dump_file.write(reinterpret_cast(&d_carrier_lock_test), sizeof(double)); + d_dump_file.write(reinterpret_cast(&d_CN0_SNV_dB_Hz), sizeof(double)); + d_dump_file.write(reinterpret_cast(&d_carrier_lock_test), sizeof(double)); // AUX vars (for debug purposes) tmp_double = d_code_error_chips_Ti * CURRENT_INTEGRATION_TIME_S; - d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); + d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); tmp_double = static_cast(d_sample_counter + d_correlation_length_samples); - d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); + d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); // PRN unsigned int prn_ = d_acquisition_gnss_synchro->PRN; - d_dump_file.write(reinterpret_cast(&prn_), sizeof(unsigned int)); - } - catch (const std::ifstream::failure* e) - { + d_dump_file.write(reinterpret_cast(&prn_), sizeof(unsigned int)); + } + catch (const std::ifstream::failure *e) + { LOG(WARNING) << "Exception writing trk dump file " << e->what(); - } + } } - consume_each(d_correlation_length_samples); // this is necessary in gr::block derivates - d_sample_counter += d_correlation_length_samples; //count for the processed samples + consume_each(d_correlation_length_samples); // this is necessary in gr::block derivates + d_sample_counter += d_correlation_length_samples; //count for the processed samples - return 1; //output tracking result ALWAYS even in the case of d_enable_tracking==false + return 1; //output tracking result ALWAYS even in the case of d_enable_tracking==false } @@ -901,24 +900,23 @@ void glonass_l1_ca_dll_pll_c_aid_tracking_cc::set_channel(unsigned int channel) if (d_dump_file.is_open() == false) { try - { + { d_dump_filename.append(boost::lexical_cast(d_channel)); d_dump_filename.append(".dat"); - d_dump_file.exceptions (std::ifstream::failbit | std::ifstream::badbit); + d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); LOG(INFO) << "Tracking dump enabled on channel " << d_channel << " Log file: " << d_dump_filename.c_str() << std::endl; - } - catch (const std::ifstream::failure* e) - { + } + catch (const std::ifstream::failure *e) + { LOG(WARNING) << "channel " << d_channel << " Exception opening trk dump file " << e->what() << std::endl; - } + } } } } - -void glonass_l1_ca_dll_pll_c_aid_tracking_cc::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) +void glonass_l1_ca_dll_pll_c_aid_tracking_cc::set_gnss_synchro(Gnss_Synchro *p_gnss_synchro) { d_acquisition_gnss_synchro = p_gnss_synchro; } diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_cc.h b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_cc.h index 50b936eff..beac6f8e9 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_cc.h +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_cc.h @@ -54,27 +54,25 @@ class glonass_l1_ca_dll_pll_c_aid_tracking_cc; typedef boost::shared_ptr - glonass_l1_ca_dll_pll_c_aid_tracking_cc_sptr; + glonass_l1_ca_dll_pll_c_aid_tracking_cc_sptr; glonass_l1_ca_dll_pll_c_aid_tracking_cc_sptr glonass_l1_ca_dll_pll_c_aid_make_tracking_cc(long if_freq, - long fs_in, unsigned - int vector_length, - bool dump, - std::string dump_filename, - float pll_bw_hz, - float dll_bw_hz, - float pll_bw_narrow_hz, - float dll_bw_narrow_hz, - int extend_correlation_ms, - float early_late_space_chips); - + long fs_in, unsigned int vector_length, + bool dump, + std::string dump_filename, + float pll_bw_hz, + float dll_bw_hz, + float pll_bw_narrow_hz, + float dll_bw_narrow_hz, + int extend_correlation_ms, + float early_late_space_chips); /*! * \brief This class implements a DLL + PLL tracking loop block */ -class glonass_l1_ca_dll_pll_c_aid_tracking_cc: public gr::block +class glonass_l1_ca_dll_pll_c_aid_tracking_cc : public gr::block { public: ~glonass_l1_ca_dll_pll_c_aid_tracking_cc(); @@ -83,36 +81,34 @@ public: void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro); void start_tracking(); - int general_work (int noutput_items, gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); + int general_work(int noutput_items, gr_vector_int& ninput_items, + gr_vector_const_void_star& input_items, gr_vector_void_star& output_items); - void forecast (int noutput_items, gr_vector_int &ninput_items_required); + void forecast(int noutput_items, gr_vector_int& ninput_items_required); private: friend glonass_l1_ca_dll_pll_c_aid_tracking_cc_sptr glonass_l1_ca_dll_pll_c_aid_make_tracking_cc(long if_freq, - long fs_in, unsigned - int vector_length, - bool dump, - std::string dump_filename, - float pll_bw_hz, - float dll_bw_hz, - float pll_bw_narrow_hz, - float dll_bw_narrow_hz, - int extend_correlation_ms, - float early_late_space_chips); + long fs_in, unsigned int vector_length, + bool dump, + std::string dump_filename, + float pll_bw_hz, + float dll_bw_hz, + float pll_bw_narrow_hz, + float dll_bw_narrow_hz, + int extend_correlation_ms, + float early_late_space_chips); glonass_l1_ca_dll_pll_c_aid_tracking_cc(long if_freq, - long fs_in, unsigned - int vector_length, - bool dump, - std::string dump_filename, - float pll_bw_hz, - float dll_bw_hz, - float pll_bw_narrow_hz, - float dll_bw_narrow_hz, - int extend_correlation_ms, - float early_late_space_chips); + long fs_in, unsigned int vector_length, + bool dump, + std::string dump_filename, + float pll_bw_hz, + float dll_bw_hz, + float pll_bw_narrow_hz, + float dll_bw_narrow_hz, + int extend_correlation_ms, + float early_late_space_chips); // tracking configuration vars unsigned int d_vector_length; @@ -206,4 +202,4 @@ private: int save_matfile(); }; -#endif //GNSS_SDR_GLONASS_L1_CA_DLL_PLL_C_AID_TRACKING_CC_H +#endif //GNSS_SDR_GLONASS_L1_CA_DLL_PLL_C_AID_TRACKING_CC_H diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_sc.cc b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_sc.cc index 6d0534737..49dced3eb 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_sc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_sc.cc @@ -61,30 +61,29 @@ using google::LogMessage; glonass_l1_ca_dll_pll_c_aid_tracking_sc_sptr glonass_l1_ca_dll_pll_c_aid_make_tracking_sc( - long if_freq, - long fs_in, - unsigned int vector_length, - bool dump, - std::string dump_filename, - float pll_bw_hz, - float dll_bw_hz, - float pll_bw_narrow_hz, - float dll_bw_narrow_hz, - int extend_correlation_ms, - float early_late_space_chips) + long if_freq, + long fs_in, + unsigned int vector_length, + bool dump, + std::string dump_filename, + float pll_bw_hz, + float dll_bw_hz, + float pll_bw_narrow_hz, + float dll_bw_narrow_hz, + int extend_correlation_ms, + float early_late_space_chips) { return glonass_l1_ca_dll_pll_c_aid_tracking_sc_sptr(new glonass_l1_ca_dll_pll_c_aid_tracking_sc(if_freq, - fs_in, vector_length, dump, dump_filename, pll_bw_hz, dll_bw_hz, pll_bw_narrow_hz, dll_bw_narrow_hz, extend_correlation_ms, early_late_space_chips)); + fs_in, vector_length, dump, dump_filename, pll_bw_hz, dll_bw_hz, pll_bw_narrow_hz, dll_bw_narrow_hz, extend_correlation_ms, early_late_space_chips)); } - -void glonass_l1_ca_dll_pll_c_aid_tracking_sc::forecast (int noutput_items, - gr_vector_int &ninput_items_required) +void glonass_l1_ca_dll_pll_c_aid_tracking_sc::forecast(int noutput_items, + gr_vector_int &ninput_items_required) { if (noutput_items != 0) { - ninput_items_required[0] = static_cast(d_vector_length) * 2; //set the required available samples in each call + ninput_items_required[0] = static_cast(d_vector_length) * 2; //set the required available samples in each call } } @@ -92,8 +91,8 @@ void glonass_l1_ca_dll_pll_c_aid_tracking_sc::forecast (int noutput_items, void glonass_l1_ca_dll_pll_c_aid_tracking_sc::msg_handler_preamble_index(pmt::pmt_t msg) { //pmt::print(msg); - DLOG(INFO) << "Extended correlation enabled for Tracking CH " << d_channel << ": Satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN); - if (d_enable_extended_integration == false) //avoid re-setting preamble indicator + DLOG(INFO) << "Extended correlation enabled for Tracking CH " << d_channel << ": Satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN); + if (d_enable_extended_integration == false) //avoid re-setting preamble indicator { d_preamble_timestamp_s = pmt::to_double(msg); d_enable_extended_integration = true; @@ -102,24 +101,23 @@ void glonass_l1_ca_dll_pll_c_aid_tracking_sc::msg_handler_preamble_index(pmt::pm } glonass_l1_ca_dll_pll_c_aid_tracking_sc::glonass_l1_ca_dll_pll_c_aid_tracking_sc( - long if_freq, - long fs_in, - unsigned int vector_length, - bool dump, - std::string dump_filename, - float pll_bw_hz, - float dll_bw_hz, - float pll_bw_narrow_hz, - float dll_bw_narrow_hz, - int extend_correlation_ms, - float early_late_space_chips) : - gr::block("glonass_l1_ca_dll_pll_c_aid_tracking_sc", gr::io_signature::make(1, 1, sizeof(lv_16sc_t)), - gr::io_signature::make(1, 1, sizeof(Gnss_Synchro))) + long if_freq, + long fs_in, + unsigned int vector_length, + bool dump, + std::string dump_filename, + float pll_bw_hz, + float dll_bw_hz, + float pll_bw_narrow_hz, + float dll_bw_narrow_hz, + int extend_correlation_ms, + float early_late_space_chips) : gr::block("glonass_l1_ca_dll_pll_c_aid_tracking_sc", gr::io_signature::make(1, 1, sizeof(lv_16sc_t)), + gr::io_signature::make(1, 1, sizeof(Gnss_Synchro))) { // Telemetry bit synchronization message port input this->message_port_register_in(pmt::mp("preamble_timestamp_s")); this->set_msg_handler(pmt::mp("preamble_timestamp_s"), - boost::bind(&glonass_l1_ca_dll_pll_c_aid_tracking_sc::msg_handler_preamble_index, this, _1)); + boost::bind(&glonass_l1_ca_dll_pll_c_aid_tracking_sc::msg_handler_preamble_index, this, _1)); this->message_port_register_out(pmt::mp("events")); // initialize internal vars d_dump = dump; @@ -139,25 +137,25 @@ glonass_l1_ca_dll_pll_c_aid_tracking_sc::glonass_l1_ca_dll_pll_c_aid_tracking_sc d_extend_correlation_ms = extend_correlation_ms; // --- DLL variables -------------------------------------------------------- - d_early_late_spc_chips = early_late_space_chips; // Define early-late offset (in chips) + d_early_late_spc_chips = early_late_space_chips; // Define early-late offset (in chips) // Initialization of local code replica // Get space for a vector with the C/A code replica sampled 1x/chip - d_ca_code = static_cast(volk_gnsssdr_malloc(static_cast(GLONASS_L1_CA_CODE_LENGTH_CHIPS) * sizeof(gr_complex), volk_gnsssdr_get_alignment())); - d_ca_code_16sc = static_cast(volk_gnsssdr_malloc(static_cast(GLONASS_L1_CA_CODE_LENGTH_CHIPS) * sizeof(lv_16sc_t), volk_gnsssdr_get_alignment())); + d_ca_code = static_cast(volk_gnsssdr_malloc(static_cast(GLONASS_L1_CA_CODE_LENGTH_CHIPS) * sizeof(gr_complex), volk_gnsssdr_get_alignment())); + d_ca_code_16sc = static_cast(volk_gnsssdr_malloc(static_cast(GLONASS_L1_CA_CODE_LENGTH_CHIPS) * sizeof(lv_16sc_t), volk_gnsssdr_get_alignment())); // correlator outputs (scalar) - d_n_correlator_taps = 3; // Early, Prompt, and Late + d_n_correlator_taps = 3; // Early, Prompt, and Late - d_correlator_outs_16sc = static_cast(volk_gnsssdr_malloc(d_n_correlator_taps*sizeof(lv_16sc_t), volk_gnsssdr_get_alignment())); + d_correlator_outs_16sc = static_cast(volk_gnsssdr_malloc(d_n_correlator_taps * sizeof(lv_16sc_t), volk_gnsssdr_get_alignment())); for (int n = 0; n < d_n_correlator_taps; n++) { - d_correlator_outs_16sc[n] = lv_cmake(0,0); + d_correlator_outs_16sc[n] = lv_cmake(0, 0); } - d_local_code_shift_chips = static_cast(volk_gnsssdr_malloc(d_n_correlator_taps*sizeof(float), volk_gnsssdr_get_alignment())); + d_local_code_shift_chips = static_cast(volk_gnsssdr_malloc(d_n_correlator_taps * sizeof(float), volk_gnsssdr_get_alignment())); // Set TAPs delay values [chips] - d_local_code_shift_chips[0] = - d_early_late_spc_chips; + d_local_code_shift_chips[0] = -d_early_late_spc_chips; d_local_code_shift_chips[1] = 0.0; d_local_code_shift_chips[2] = d_early_late_spc_chips; @@ -172,7 +170,7 @@ glonass_l1_ca_dll_pll_c_aid_tracking_sc::glonass_l1_ca_dll_pll_c_aid_tracking_sc d_rem_carrier_phase_rad = 0.0; // sample synchronization - d_sample_counter = 0; //(from trk to tlm) + d_sample_counter = 0; //(from trk to tlm) d_acq_sample_stamp = 0; d_enable_tracking = false; d_pull_in = false; @@ -228,12 +226,12 @@ void glonass_l1_ca_dll_pll_c_aid_tracking_sc::start_tracking() long int acq_trk_diff_samples; double acq_trk_diff_seconds; - acq_trk_diff_samples = static_cast(d_sample_counter) - static_cast(d_acq_sample_stamp);//-d_vector_length; + acq_trk_diff_samples = static_cast(d_sample_counter) - static_cast(d_acq_sample_stamp); //-d_vector_length; DLOG(INFO) << "Number of samples between Acquisition and Tracking =" << acq_trk_diff_samples; acq_trk_diff_seconds = static_cast(acq_trk_diff_samples) / static_cast(d_fs_in); // Doppler effect // Fd=(C/(C+Vr))*F - d_glonass_freq_ch = GLONASS_L1_CA_FREQ_HZ + (GLONASS_L1_CA_FREQ_HZ * GLONASS_PRN.at(d_acquisition_gnss_synchro->PRN)); + d_glonass_freq_ch = GLONASS_L1_CA_FREQ_HZ + (GLONASS_L1_CA_FREQ_HZ * GLONASS_PRN.at(d_acquisition_gnss_synchro->PRN)); double radial_velocity = (d_glonass_freq_ch + d_acq_carrier_doppler_hz) / d_glonass_freq_ch; // new chip and prn sequence periods based on acq Doppler double T_chip_mod_seconds; @@ -261,14 +259,15 @@ void glonass_l1_ca_dll_pll_c_aid_tracking_sc::start_tracking() d_acq_code_phase_samples = corrected_acq_phase_samples; - d_carrier_frequency_hz = d_acq_carrier_doppler_hz + d_if_freq + (DFRQ1_GLO * static_cast(GLONASS_PRN.at(d_acquisition_gnss_synchro->PRN)));; + d_carrier_frequency_hz = d_acq_carrier_doppler_hz + d_if_freq + (DFRQ1_GLO * static_cast(GLONASS_PRN.at(d_acquisition_gnss_synchro->PRN))); + ; d_carrier_doppler_hz = d_acq_carrier_doppler_hz; d_carrier_phase_step_rad = GLONASS_TWO_PI * d_carrier_frequency_hz / static_cast(d_fs_in); // DLL/PLL filter initialization - d_carrier_loop_filter.initialize(d_carrier_frequency_hz); // The carrier loop filter implements the Doppler accumulator - d_code_loop_filter.initialize(); // initialize the code filter + d_carrier_loop_filter.initialize(d_carrier_frequency_hz); // The carrier loop filter implements the Doppler accumulator + d_code_loop_filter.initialize(); // initialize the code filter // generate local reference ALWAYS starting at chip 1 (1 sample per chip) glonass_l1_ca_code_gen_complex(d_ca_code, 0); @@ -277,7 +276,7 @@ void glonass_l1_ca_dll_pll_c_aid_tracking_sc::start_tracking() multicorrelator_cpu_16sc.set_local_code_and_taps(static_cast(GLONASS_L1_CA_CODE_LENGTH_CHIPS), d_ca_code_16sc, d_local_code_shift_chips); for (int n = 0; n < d_n_correlator_taps; n++) { - d_correlator_outs_16sc[n] = lv_16sc_t(0,0); + d_correlator_outs_16sc[n] = lv_16sc_t(0, 0); } d_carrier_lock_fail_counter = 0; @@ -289,7 +288,7 @@ void glonass_l1_ca_dll_pll_c_aid_tracking_sc::start_tracking() d_code_phase_samples = d_acq_code_phase_samples; std::string sys_ = &d_acquisition_gnss_synchro->System; - sys = sys_.substr(0,1); + sys = sys_.substr(0, 1); // DEBUG OUTPUT std::cout << "Tracking start on channel " << d_channel << " for satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << std::endl; @@ -302,8 +301,8 @@ void glonass_l1_ca_dll_pll_c_aid_tracking_sc::start_tracking() d_preamble_synchronized = true; LOG(INFO) << "PULL-IN Doppler [Hz]=" << d_carrier_doppler_hz - << " Code Phase correction [samples]=" << delay_correction_samples - << " PULL-IN Code Phase [samples]=" << d_acq_code_phase_samples; + << " Code Phase correction [samples]=" << delay_correction_samples + << " PULL-IN Code Phase [samples]=" << d_acq_code_phase_samples; } @@ -314,18 +313,18 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_sc::save_matfile() int number_of_double_vars = 11; int number_of_float_vars = 5; int epoch_size_bytes = sizeof(unsigned long int) + sizeof(double) * number_of_double_vars + - sizeof(float) * number_of_float_vars + sizeof(unsigned int); + sizeof(float) * number_of_float_vars + sizeof(unsigned int); std::ifstream dump_file; dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); try - { + { dump_file.open(d_dump_filename.c_str(), std::ios::binary | std::ios::ate); - } - catch(const std::ifstream::failure &e) - { - std::cerr << "Problem opening dump file:" << e.what() << std::endl; + } + catch (const std::ifstream::failure &e) + { + std::cerr << "Problem opening dump file:" << e.what() << std::endl; return 1; - } + } // count number of epochs and rewind long int num_epoch = 0; if (dump_file.is_open()) @@ -338,30 +337,30 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_sc::save_matfile() { return 1; } - float * abs_E = new float [num_epoch]; - float * abs_P = new float [num_epoch]; - float * abs_L = new float [num_epoch]; - float * Prompt_I = new float [num_epoch]; - float * Prompt_Q = new float [num_epoch]; - unsigned long int * PRN_start_sample_count = new unsigned long int [num_epoch]; - double * acc_carrier_phase_rad = new double [num_epoch]; - double * carrier_doppler_hz = new double [num_epoch]; - double * code_freq_chips = new double [num_epoch]; - double * carr_error_hz = new double [num_epoch]; - double * carr_error_filt_hz = new double [num_epoch]; - double * code_error_chips = new double [num_epoch]; - double * code_error_filt_chips = new double [num_epoch]; - double * CN0_SNV_dB_Hz = new double [num_epoch]; - double * carrier_lock_test = new double [num_epoch]; - double * aux1 = new double [num_epoch]; - double * aux2 = new double [num_epoch]; - unsigned int * PRN = new unsigned int [num_epoch]; + float *abs_E = new float[num_epoch]; + float *abs_P = new float[num_epoch]; + float *abs_L = new float[num_epoch]; + float *Prompt_I = new float[num_epoch]; + float *Prompt_Q = new float[num_epoch]; + unsigned long int *PRN_start_sample_count = new unsigned long int[num_epoch]; + double *acc_carrier_phase_rad = new double[num_epoch]; + double *carrier_doppler_hz = new double[num_epoch]; + double *code_freq_chips = new double[num_epoch]; + double *carr_error_hz = new double[num_epoch]; + double *carr_error_filt_hz = new double[num_epoch]; + double *code_error_chips = new double[num_epoch]; + double *code_error_filt_chips = new double[num_epoch]; + double *CN0_SNV_dB_Hz = new double[num_epoch]; + double *carrier_lock_test = new double[num_epoch]; + double *aux1 = new double[num_epoch]; + double *aux2 = new double[num_epoch]; + unsigned int *PRN = new unsigned int[num_epoch]; try - { + { if (dump_file.is_open()) { - for(long int i = 0; i < num_epoch; i++) + for (long int i = 0; i < num_epoch; i++) { dump_file.read(reinterpret_cast(&abs_E[i]), sizeof(float)); dump_file.read(reinterpret_cast(&abs_P[i]), sizeof(float)); @@ -384,10 +383,10 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_sc::save_matfile() } } dump_file.close(); - } + } catch (const std::ifstream::failure &e) - { - std::cerr << "Problem reading dump file:" << e.what() << std::endl; + { + std::cerr << "Problem reading dump file:" << e.what() << std::endl; delete[] abs_E; delete[] abs_P; delete[] abs_L; @@ -407,7 +406,7 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_sc::save_matfile() delete[] aux2; delete[] PRN; return 1; - } + } // WRITE MAT FILE mat_t *matfp; @@ -416,79 +415,79 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_sc::save_matfile() filename.erase(filename.length() - 4, 4); filename.append(".mat"); matfp = Mat_CreateVer(filename.c_str(), NULL, MAT_FT_MAT73); - if(reinterpret_cast(matfp) != NULL) + if (reinterpret_cast(matfp) != NULL) { size_t dims[2] = {1, static_cast(num_epoch)}; matvar = Mat_VarCreate("abs_E", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, abs_E, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("abs_P", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, abs_P, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("abs_L", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, abs_L, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("Prompt_I", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, Prompt_I, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("Prompt_Q", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, Prompt_Q, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("PRN_start_sample_count", MAT_C_UINT64, MAT_T_UINT64, 2, dims, PRN_start_sample_count, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("acc_carrier_phase_rad", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, acc_carrier_phase_rad, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("carrier_doppler_hz", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, carrier_doppler_hz, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("code_freq_chips", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, code_freq_chips, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("carr_error_hz", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, carr_error_hz, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("carr_error_filt_hz", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, carr_error_filt_hz, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("code_error_chips", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, code_error_chips, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("code_error_filt_chips", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, code_error_filt_chips, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("CN0_SNV_dB_Hz", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, CN0_SNV_dB_Hz, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("carrier_lock_test", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, carrier_lock_test, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("aux1", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, aux1, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("aux2", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, aux2, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("PRN", MAT_C_UINT32, MAT_T_UINT32, 2, dims, PRN, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); } Mat_Close(matfp); @@ -516,30 +515,30 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_sc::save_matfile() glonass_l1_ca_dll_pll_c_aid_tracking_sc::~glonass_l1_ca_dll_pll_c_aid_tracking_sc() { - if (d_dump_file.is_open()) - { - try - { - d_dump_file.close(); - } - catch(const std::exception & ex) - { - LOG(WARNING) << "Exception in destructor " << ex.what(); - } - } + if (d_dump_file.is_open()) + { + try + { + d_dump_file.close(); + } + catch (const std::exception &ex) + { + LOG(WARNING) << "Exception in destructor " << ex.what(); + } + } - if(d_dump) - { - if(d_channel == 0) - { - std::cout << "Writing .mat files ..."; - } - glonass_l1_ca_dll_pll_c_aid_tracking_sc::save_matfile(); - if(d_channel == 0) - { - std::cout << " done." << std::endl; - } - } + if (d_dump) + { + if (d_channel == 0) + { + std::cout << "Writing .mat files ..."; + } + glonass_l1_ca_dll_pll_c_aid_tracking_sc::save_matfile(); + if (d_channel == 0) + { + std::cout << " done." << std::endl; + } + } volk_gnsssdr_free(d_local_code_shift_chips); volk_gnsssdr_free(d_ca_code); @@ -551,12 +550,11 @@ glonass_l1_ca_dll_pll_c_aid_tracking_sc::~glonass_l1_ca_dll_pll_c_aid_tracking_s } - -int glonass_l1_ca_dll_pll_c_aid_tracking_sc::general_work (int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), - gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) +int glonass_l1_ca_dll_pll_c_aid_tracking_sc::general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), + gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { // Block input data and block output stream pointers - const lv_16sc_t* in = reinterpret_cast(input_items[0]); // PRN start block alignment + const lv_16sc_t *in = reinterpret_cast(input_items[0]); // PRN start block alignment Gnss_Synchro **out = reinterpret_cast(&output_items[0]); // GNSS_SYNCHRO OBJECT to interchange data between tracking->telemetry_decoder @@ -581,14 +579,14 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_sc::general_work (int noutput_items __a acq_trk_shif_correction_samples = d_correlation_length_samples - fmod(static_cast(acq_to_trk_delay_samples), static_cast(d_correlation_length_samples)); samples_offset = round(d_acq_code_phase_samples + acq_trk_shif_correction_samples); current_synchro_data.Tracking_sample_counter = d_sample_counter + samples_offset; - d_sample_counter += samples_offset; // count for the processed samples + d_sample_counter += samples_offset; // count for the processed samples d_pull_in = false; d_acc_carrier_phase_cycles -= d_carrier_phase_step_rad * samples_offset / GLONASS_TWO_PI; current_synchro_data.Carrier_phase_rads = d_acc_carrier_phase_cycles * GLONASS_TWO_PI; current_synchro_data.Carrier_Doppler_hz = d_carrier_doppler_hz; - current_synchro_data.fs=d_fs_in; + current_synchro_data.fs = d_fs_in; *out[0] = current_synchro_data; - consume_each(samples_offset); // shift input to perform alignment with local replica + consume_each(samples_offset); // shift input to perform alignment with local replica return 1; } @@ -603,9 +601,9 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_sc::general_work (int noutput_items __a // ####### coherent intergration extension // keep the last symbols - d_E_history.push_back(d_correlator_outs_16sc[0]); // save early output - d_P_history.push_back(d_correlator_outs_16sc[1]); // save prompt output - d_L_history.push_back(d_correlator_outs_16sc[2]); // save late output + d_E_history.push_back(d_correlator_outs_16sc[0]); // save early output + d_P_history.push_back(d_correlator_outs_16sc[1]); // save prompt output + d_L_history.push_back(d_correlator_outs_16sc[2]); // save late output if (static_cast(d_P_history.size()) > d_extend_correlation_ms) { @@ -623,9 +621,9 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_sc::general_work (int noutput_items __a // compute coherent integration and enable tracking loop // perform coherent integration using correlator output history // std::cout<<"##### RESET COHERENT INTEGRATION ####"<PRN) + std::cout << "Enabled " << d_extend_correlation_ms << " [ms] extended correlator for CH " << d_channel << " : Satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << " pll_bw = " << d_pll_bw_hz << " [Hz], pll_narrow_bw = " << d_pll_bw_narrow_hz << " [Hz]" << std::endl << " dll_bw = " << d_dll_bw_hz << " [Hz], dll_narrow_bw = " << d_dll_bw_narrow_hz << " [Hz]" << std::endl; } @@ -648,7 +646,7 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_sc::general_work (int noutput_items __a } else { - if(d_preamble_synchronized == true) + if (d_preamble_synchronized == true) { // continue extended coherent correlation // Compute the next buffer length based on the period of the PRN sequence and the code phase error estimation @@ -659,7 +657,7 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_sc::general_work (int noutput_items __a double K_T_prn_error_samples = K_prn_samples - T_prn_samples; d_rem_code_phase_samples = d_rem_code_phase_samples - K_T_prn_error_samples; - d_rem_code_phase_integer_samples = round(d_rem_code_phase_samples); // round to a discrete number of samples + d_rem_code_phase_integer_samples = round(d_rem_code_phase_samples); // round to a discrete number of samples d_correlation_length_samples = K_prn_samples + d_rem_code_phase_integer_samples; d_rem_code_phase_samples = d_rem_code_phase_samples - d_rem_code_phase_integer_samples; // code phase step (Code resampler phase increment per sample) [chips/sample] @@ -695,7 +693,7 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_sc::general_work (int noutput_items __a { // ################## PLL ########################################################## // Update PLL discriminator [rads/Ti -> Secs/Ti] - d_carr_phase_error_secs_Ti = pll_cloop_two_quadrant_atan(std::complex(d_correlator_outs_16sc[1].real(),d_correlator_outs_16sc[1].imag())) / GLONASS_TWO_PI; //prompt output + d_carr_phase_error_secs_Ti = pll_cloop_two_quadrant_atan(std::complex(d_correlator_outs_16sc[1].real(), d_correlator_outs_16sc[1].imag())) / GLONASS_TWO_PI; //prompt output d_carrier_doppler_old_hz = d_carrier_doppler_hz; // Carrier discriminator filter // NOTICE: The carrier loop filter includes the Carrier Doppler accumulator, as described in Kaplan @@ -708,11 +706,11 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_sc::general_work (int noutput_items __a // ################## DLL ########################################################## // DLL discriminator - d_code_error_chips_Ti = dll_nc_e_minus_l_normalized(std::complex(d_correlator_outs_16sc[0].real(),d_correlator_outs_16sc[0].imag()), std::complex(d_correlator_outs_16sc[2].real(),d_correlator_outs_16sc[2].imag())); // [chips/Ti] //early and late + d_code_error_chips_Ti = dll_nc_e_minus_l_normalized(std::complex(d_correlator_outs_16sc[0].real(), d_correlator_outs_16sc[0].imag()), std::complex(d_correlator_outs_16sc[2].real(), d_correlator_outs_16sc[2].imag())); // [chips/Ti] //early and late // Code discriminator filter - d_code_error_filt_chips_s = d_code_loop_filter.get_code_nco(d_code_error_chips_Ti); // input [chips/Ti] -> output [chips/second] + d_code_error_filt_chips_s = d_code_loop_filter.get_code_nco(d_code_error_chips_Ti); // input [chips/Ti] -> output [chips/second] d_code_error_filt_chips_Ti = d_code_error_filt_chips_s * CURRENT_INTEGRATION_TIME_S; - code_error_filt_secs_Ti = d_code_error_filt_chips_Ti / d_code_freq_chips; // [s/Ti] + code_error_filt_secs_Ti = d_code_error_filt_chips_Ti / d_code_freq_chips; // [s/Ti] // ################## CARRIER AND CODE NCO BUFFER ALIGNEMENT ####################### // keep alignment parameters for the next input buffer @@ -723,12 +721,12 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_sc::general_work (int noutput_items __a double K_prn_samples = round(T_prn_samples); double K_T_prn_error_samples = K_prn_samples - T_prn_samples; - d_rem_code_phase_samples = d_rem_code_phase_samples - K_T_prn_error_samples + code_error_filt_secs_Ti * static_cast(d_fs_in); //(code_error_filt_secs_Ti + d_pll_to_dll_assist_secs_Ti) * static_cast(d_fs_in); - d_rem_code_phase_integer_samples = round(d_rem_code_phase_samples); // round to a discrete number of samples + d_rem_code_phase_samples = d_rem_code_phase_samples - K_T_prn_error_samples + code_error_filt_secs_Ti * static_cast(d_fs_in); //(code_error_filt_secs_Ti + d_pll_to_dll_assist_secs_Ti) * static_cast(d_fs_in); + d_rem_code_phase_integer_samples = round(d_rem_code_phase_samples); // round to a discrete number of samples d_correlation_length_samples = K_prn_samples + d_rem_code_phase_integer_samples; d_rem_code_phase_samples = d_rem_code_phase_samples - d_rem_code_phase_integer_samples; - //################### PLL COMMANDS ################################################# + //################### PLL COMMANDS ################################################# //carrier phase step (NCO phase increment per sample) [rads/sample] d_carrier_phase_step_rad = GLONASS_TWO_PI * d_carrier_doppler_hz / static_cast(d_fs_in); d_acc_carrier_phase_cycles -= d_carrier_phase_step_rad * d_correlation_length_samples / GLONASS_TWO_PI; @@ -747,7 +745,7 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_sc::general_work (int noutput_items __a if (d_cn0_estimation_counter < FLAGS_cn0_samples) { // fill buffer with prompt correlator output values - d_Prompt_buffer[d_cn0_estimation_counter] = lv_cmake(static_cast(d_correlator_outs_16sc[1].real()), static_cast(d_correlator_outs_16sc[1].imag()) ); // prompt + d_Prompt_buffer[d_cn0_estimation_counter] = lv_cmake(static_cast(d_correlator_outs_16sc[1].real()), static_cast(d_correlator_outs_16sc[1].imag())); // prompt d_cn0_estimation_counter++; } else @@ -770,9 +768,9 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_sc::general_work (int noutput_items __a { std::cout << "Loss of lock in channel " << d_channel << "!" << std::endl; LOG(INFO) << "Loss of lock in channel " << d_channel << "!"; - this->message_port_pub(pmt::mp("events"), pmt::from_long(3));//3 -> loss of lock + this->message_port_pub(pmt::mp("events"), pmt::from_long(3)); //3 -> loss of lock d_carrier_lock_fail_counter = 0; - d_enable_tracking = false; // TODO: check if disabling tracking is consistent with the channel state machine + d_enable_tracking = false; // TODO: check if disabling tracking is consistent with the channel state machine } } // ########### Output the tracking data to navigation and PVT ########## @@ -801,7 +799,7 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_sc::general_work (int noutput_items __a current_synchro_data.Tracking_sample_counter = d_sample_counter + d_correlation_length_samples; current_synchro_data.Code_phase_samples = d_rem_code_phase_samples; current_synchro_data.Carrier_phase_rads = GLONASS_TWO_PI * d_acc_carrier_phase_cycles; - current_synchro_data.Carrier_Doppler_hz = d_carrier_doppler_hz;// todo: project the carrier doppler + current_synchro_data.Carrier_Doppler_hz = d_carrier_doppler_hz; // todo: project the carrier doppler current_synchro_data.CN0_dB_hz = d_CN0_SNV_dB_Hz; } } @@ -809,15 +807,15 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_sc::general_work (int noutput_items __a { for (int n = 0; n < d_n_correlator_taps; n++) { - d_correlator_outs_16sc[n] = lv_cmake(0,0); + d_correlator_outs_16sc[n] = lv_cmake(0, 0); } current_synchro_data.System = {'R'}; current_synchro_data.Tracking_sample_counter = d_sample_counter + d_correlation_length_samples; } - current_synchro_data.fs=d_fs_in; + current_synchro_data.fs = d_fs_in; *out[0] = current_synchro_data; - if(d_dump) + if (d_dump) { // MULTIPLEXED FILE RECORDING - Record results to file float prompt_I; @@ -826,60 +824,60 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_sc::general_work (int noutput_items __a double tmp_double; prompt_I = d_correlator_outs_16sc[1].real(); prompt_Q = d_correlator_outs_16sc[1].imag(); - tmp_E = std::abs(std::complex(d_correlator_outs_16sc[0].real(),d_correlator_outs_16sc[0].imag())); - tmp_P = std::abs(std::complex(d_correlator_outs_16sc[1].real(),d_correlator_outs_16sc[1].imag())); - tmp_L = std::abs(std::complex(d_correlator_outs_16sc[2].real(),d_correlator_outs_16sc[2].imag())); + tmp_E = std::abs(std::complex(d_correlator_outs_16sc[0].real(), d_correlator_outs_16sc[0].imag())); + tmp_P = std::abs(std::complex(d_correlator_outs_16sc[1].real(), d_correlator_outs_16sc[1].imag())); + tmp_L = std::abs(std::complex(d_correlator_outs_16sc[2].real(), d_correlator_outs_16sc[2].imag())); try - { + { // EPR - d_dump_file.write(reinterpret_cast(&tmp_E), sizeof(float)); - d_dump_file.write(reinterpret_cast(&tmp_P), sizeof(float)); - d_dump_file.write(reinterpret_cast(&tmp_L), sizeof(float)); + d_dump_file.write(reinterpret_cast(&tmp_E), sizeof(float)); + d_dump_file.write(reinterpret_cast(&tmp_P), sizeof(float)); + d_dump_file.write(reinterpret_cast(&tmp_L), sizeof(float)); // PROMPT I and Q (to analyze navigation symbols) - d_dump_file.write(reinterpret_cast(&prompt_I), sizeof(float)); - d_dump_file.write(reinterpret_cast(&prompt_Q), sizeof(float)); + d_dump_file.write(reinterpret_cast(&prompt_I), sizeof(float)); + d_dump_file.write(reinterpret_cast(&prompt_Q), sizeof(float)); // PRN start sample stamp //tmp_float=(float)d_sample_counter; - d_dump_file.write(reinterpret_cast(&d_sample_counter), sizeof(unsigned long int)); + d_dump_file.write(reinterpret_cast(&d_sample_counter), sizeof(unsigned long int)); // accumulated carrier phase - d_dump_file.write(reinterpret_cast(&d_acc_carrier_phase_cycles), sizeof(double)); + d_dump_file.write(reinterpret_cast(&d_acc_carrier_phase_cycles), sizeof(double)); // carrier and code frequency - d_dump_file.write(reinterpret_cast(&d_carrier_doppler_hz), sizeof(double)); - d_dump_file.write(reinterpret_cast(&d_code_freq_chips), sizeof(double)); + d_dump_file.write(reinterpret_cast(&d_carrier_doppler_hz), sizeof(double)); + d_dump_file.write(reinterpret_cast(&d_code_freq_chips), sizeof(double)); //PLL commands - d_dump_file.write(reinterpret_cast(&d_carr_phase_error_secs_Ti), sizeof(double)); - d_dump_file.write(reinterpret_cast(&d_carrier_doppler_hz), sizeof(double)); + d_dump_file.write(reinterpret_cast(&d_carr_phase_error_secs_Ti), sizeof(double)); + d_dump_file.write(reinterpret_cast(&d_carrier_doppler_hz), sizeof(double)); //DLL commands - d_dump_file.write(reinterpret_cast(&d_code_error_chips_Ti), sizeof(double)); - d_dump_file.write(reinterpret_cast(&d_code_error_filt_chips_Ti), sizeof(double)); + d_dump_file.write(reinterpret_cast(&d_code_error_chips_Ti), sizeof(double)); + d_dump_file.write(reinterpret_cast(&d_code_error_filt_chips_Ti), sizeof(double)); // CN0 and carrier lock test - d_dump_file.write(reinterpret_cast(&d_CN0_SNV_dB_Hz), sizeof(double)); - d_dump_file.write(reinterpret_cast(&d_carrier_lock_test), sizeof(double)); + d_dump_file.write(reinterpret_cast(&d_CN0_SNV_dB_Hz), sizeof(double)); + d_dump_file.write(reinterpret_cast(&d_carrier_lock_test), sizeof(double)); // AUX vars (for debug purposes) tmp_double = d_code_error_chips_Ti * CURRENT_INTEGRATION_TIME_S; - d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); + d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); tmp_double = static_cast(d_sample_counter + d_correlation_length_samples); - d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); + d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); // PRN unsigned int prn_ = d_acquisition_gnss_synchro->PRN; - d_dump_file.write(reinterpret_cast(&prn_), sizeof(unsigned int)); - } - catch (const std::ifstream::failure* e) - { + d_dump_file.write(reinterpret_cast(&prn_), sizeof(unsigned int)); + } + catch (const std::ifstream::failure *e) + { LOG(WARNING) << "Exception writing trk dump file " << e->what(); - } + } } - consume_each(d_correlation_length_samples); // this is necessary in gr::block derivates - d_sample_counter += d_correlation_length_samples; //count for the processed samples + consume_each(d_correlation_length_samples); // this is necessary in gr::block derivates + d_sample_counter += d_correlation_length_samples; //count for the processed samples - return 1; //output tracking result ALWAYS even in the case of d_enable_tracking==false + return 1; //output tracking result ALWAYS even in the case of d_enable_tracking==false } @@ -893,23 +891,23 @@ void glonass_l1_ca_dll_pll_c_aid_tracking_sc::set_channel(unsigned int channel) if (d_dump_file.is_open() == false) { try - { + { d_dump_filename.append(boost::lexical_cast(d_channel)); d_dump_filename.append(".dat"); - d_dump_file.exceptions (std::ifstream::failbit | std::ifstream::badbit); + d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); LOG(INFO) << "Tracking dump enabled on channel " << d_channel << " Log file: " << d_dump_filename.c_str() << std::endl; - } - catch (const std::ifstream::failure* e) - { + } + catch (const std::ifstream::failure *e) + { LOG(WARNING) << "channel " << d_channel << " Exception opening trk dump file " << e->what() << std::endl; - } + } } } } -void glonass_l1_ca_dll_pll_c_aid_tracking_sc::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) +void glonass_l1_ca_dll_pll_c_aid_tracking_sc::set_gnss_synchro(Gnss_Synchro *p_gnss_synchro) { d_acquisition_gnss_synchro = p_gnss_synchro; } diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_sc.h b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_sc.h index 8bc0a1c5e..8a26c0e73 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_sc.h +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_sc.h @@ -55,27 +55,25 @@ class glonass_l1_ca_dll_pll_c_aid_tracking_sc; typedef boost::shared_ptr - glonass_l1_ca_dll_pll_c_aid_tracking_sc_sptr; + glonass_l1_ca_dll_pll_c_aid_tracking_sc_sptr; glonass_l1_ca_dll_pll_c_aid_tracking_sc_sptr glonass_l1_ca_dll_pll_c_aid_make_tracking_sc(long if_freq, - long fs_in, unsigned - int vector_length, - bool dump, - std::string dump_filename, - float pll_bw_hz, - float dll_bw_hz, - float pll_bw_narrow_hz, - float dll_bw_narrow_hz, - int extend_correlation_ms, - float early_late_space_chips); - + long fs_in, unsigned int vector_length, + bool dump, + std::string dump_filename, + float pll_bw_hz, + float dll_bw_hz, + float pll_bw_narrow_hz, + float dll_bw_narrow_hz, + int extend_correlation_ms, + float early_late_space_chips); /*! * \brief This class implements a DLL + PLL tracking loop block */ -class glonass_l1_ca_dll_pll_c_aid_tracking_sc: public gr::block +class glonass_l1_ca_dll_pll_c_aid_tracking_sc : public gr::block { public: ~glonass_l1_ca_dll_pll_c_aid_tracking_sc(); @@ -84,36 +82,34 @@ public: void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro); void start_tracking(); - int general_work (int noutput_items, gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); + int general_work(int noutput_items, gr_vector_int& ninput_items, + gr_vector_const_void_star& input_items, gr_vector_void_star& output_items); - void forecast (int noutput_items, gr_vector_int &ninput_items_required); + void forecast(int noutput_items, gr_vector_int& ninput_items_required); private: friend glonass_l1_ca_dll_pll_c_aid_tracking_sc_sptr glonass_l1_ca_dll_pll_c_aid_make_tracking_sc(long if_freq, - long fs_in, unsigned - int vector_length, - bool dump, - std::string dump_filename, - float pll_bw_hz, - float dll_bw_hz, - float pll_bw_narrow_hz, - float dll_bw_narrow_hz, - int extend_correlation_ms, - float early_late_space_chips); + long fs_in, unsigned int vector_length, + bool dump, + std::string dump_filename, + float pll_bw_hz, + float dll_bw_hz, + float pll_bw_narrow_hz, + float dll_bw_narrow_hz, + int extend_correlation_ms, + float early_late_space_chips); glonass_l1_ca_dll_pll_c_aid_tracking_sc(long if_freq, - long fs_in, unsigned - int vector_length, - bool dump, - std::string dump_filename, - float pll_bw_hz, - float dll_bw_hz, - float pll_bw_narrow_hz, - float dll_bw_narrow_hz, - int extend_correlation_ms, - float early_late_space_chips); + long fs_in, unsigned int vector_length, + bool dump, + std::string dump_filename, + float pll_bw_hz, + float dll_bw_hz, + float pll_bw_narrow_hz, + float dll_bw_narrow_hz, + int extend_correlation_ms, + float early_late_space_chips); // tracking configuration vars unsigned int d_vector_length; @@ -209,4 +205,4 @@ private: int save_matfile(); }; -#endif //GNSS_SDR_GLONASS_L1_CA_DLL_PLL_C_AID_TRACKING_SC_H +#endif //GNSS_SDR_GLONASS_L1_CA_DLL_PLL_C_AID_TRACKING_SC_H diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_tracking_cc.cc index 0989d3e5c..9d1e23d58 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_tracking_cc.cc @@ -58,43 +58,40 @@ using google::LogMessage; glonass_l1_ca_dll_pll_tracking_cc_sptr glonass_l1_ca_dll_pll_make_tracking_cc( - long if_freq, - long fs_in, - unsigned int vector_length, - bool dump, - std::string dump_filename, - float pll_bw_hz, - float dll_bw_hz, - float early_late_space_chips) + long if_freq, + long fs_in, + unsigned int vector_length, + bool dump, + std::string dump_filename, + float pll_bw_hz, + float dll_bw_hz, + float early_late_space_chips) { return glonass_l1_ca_dll_pll_tracking_cc_sptr(new Glonass_L1_Ca_Dll_Pll_Tracking_cc(if_freq, - fs_in, vector_length, dump, dump_filename, pll_bw_hz, dll_bw_hz, early_late_space_chips)); + fs_in, vector_length, dump, dump_filename, pll_bw_hz, dll_bw_hz, early_late_space_chips)); } - -void Glonass_L1_Ca_Dll_Pll_Tracking_cc::forecast (int noutput_items, - gr_vector_int &ninput_items_required) +void Glonass_L1_Ca_Dll_Pll_Tracking_cc::forecast(int noutput_items, + gr_vector_int &ninput_items_required) { if (noutput_items != 0) { - ninput_items_required[0] = static_cast(d_vector_length) * 2; //set the required available samples in each call + ninput_items_required[0] = static_cast(d_vector_length) * 2; //set the required available samples in each call } } - Glonass_L1_Ca_Dll_Pll_Tracking_cc::Glonass_L1_Ca_Dll_Pll_Tracking_cc( - long if_freq, - long fs_in, - unsigned int vector_length, - bool dump, - std::string dump_filename, - float pll_bw_hz, - float dll_bw_hz, - float early_late_space_chips) : - gr::block("Glonass_L1_Ca_Dll_Pll_Tracking_cc", gr::io_signature::make(1, 1, sizeof(gr_complex)), - gr::io_signature::make(1, 1, sizeof(Gnss_Synchro))) + long if_freq, + long fs_in, + unsigned int vector_length, + bool dump, + std::string dump_filename, + float pll_bw_hz, + float dll_bw_hz, + float early_late_space_chips) : gr::block("Glonass_L1_Ca_Dll_Pll_Tracking_cc", gr::io_signature::make(1, 1, sizeof(gr_complex)), + gr::io_signature::make(1, 1, sizeof(Gnss_Synchro))) { // Telemetry bit synchronization message port input this->message_port_register_in(pmt::mp("preamble_timestamp_s")); @@ -114,22 +111,22 @@ Glonass_L1_Ca_Dll_Pll_Tracking_cc::Glonass_L1_Ca_Dll_Pll_Tracking_cc( d_carrier_loop_filter.set_PLL_BW(pll_bw_hz); //--- DLL variables -------------------------------------------------------- - d_early_late_spc_chips = early_late_space_chips; // Define early-late offset (in chips) + d_early_late_spc_chips = early_late_space_chips; // Define early-late offset (in chips) // Initialization of local code replica // Get space for a vector with the C/A code replica sampled 1x/chip - d_ca_code = static_cast(volk_gnsssdr_malloc(static_cast(GLONASS_L1_CA_CODE_LENGTH_CHIPS) * sizeof(gr_complex), volk_gnsssdr_get_alignment())); + d_ca_code = static_cast(volk_gnsssdr_malloc(static_cast(GLONASS_L1_CA_CODE_LENGTH_CHIPS) * sizeof(gr_complex), volk_gnsssdr_get_alignment())); // correlator outputs (scalar) - d_n_correlator_taps = 3; // Early, Prompt, and Late - d_correlator_outs = static_cast(volk_gnsssdr_malloc(d_n_correlator_taps*sizeof(gr_complex), volk_gnsssdr_get_alignment())); + d_n_correlator_taps = 3; // Early, Prompt, and Late + d_correlator_outs = static_cast(volk_gnsssdr_malloc(d_n_correlator_taps * sizeof(gr_complex), volk_gnsssdr_get_alignment())); for (int n = 0; n < d_n_correlator_taps; n++) { - d_correlator_outs[n] = gr_complex(0,0); + d_correlator_outs[n] = gr_complex(0, 0); } - d_local_code_shift_chips = static_cast(volk_gnsssdr_malloc(d_n_correlator_taps*sizeof(float), volk_gnsssdr_get_alignment())); + d_local_code_shift_chips = static_cast(volk_gnsssdr_malloc(d_n_correlator_taps * sizeof(float), volk_gnsssdr_get_alignment())); // Set TAPs delay values [chips] - d_local_code_shift_chips[0] = - d_early_late_spc_chips; + d_local_code_shift_chips[0] = -d_early_late_spc_chips; d_local_code_shift_chips[1] = 0.0; d_local_code_shift_chips[2] = d_early_late_spc_chips; @@ -191,12 +188,12 @@ void Glonass_L1_Ca_Dll_Pll_Tracking_cc::start_tracking() long int acq_trk_diff_samples; double acq_trk_diff_seconds; - acq_trk_diff_samples = static_cast(d_sample_counter) - static_cast(d_acq_sample_stamp); //-d_vector_length; + acq_trk_diff_samples = static_cast(d_sample_counter) - static_cast(d_acq_sample_stamp); //-d_vector_length; DLOG(INFO) << "Number of samples between Acquisition and Tracking =" << acq_trk_diff_samples; acq_trk_diff_seconds = static_cast(acq_trk_diff_samples) / static_cast(d_fs_in); // Doppler effect // Fd=(C/(C+Vr))*F - d_glonass_freq_ch = GLONASS_L1_CA_FREQ_HZ + (DFRQ1_GLO * GLONASS_PRN.at(d_acquisition_gnss_synchro->PRN)); + d_glonass_freq_ch = GLONASS_L1_CA_FREQ_HZ + (DFRQ1_GLO * GLONASS_PRN.at(d_acquisition_gnss_synchro->PRN)); double radial_velocity = (d_glonass_freq_ch + d_acq_carrier_doppler_hz) / d_glonass_freq_ch; // new chip and prn sequence periods based on acq Doppler double T_chip_mod_seconds; @@ -204,7 +201,7 @@ void Glonass_L1_Ca_Dll_Pll_Tracking_cc::start_tracking() double T_prn_mod_samples; d_code_freq_chips = radial_velocity * GLONASS_L1_CA_CODE_RATE_HZ; d_code_phase_step_chips = static_cast(d_code_freq_chips) / static_cast(d_fs_in); - T_chip_mod_seconds = 1/d_code_freq_chips; + T_chip_mod_seconds = 1 / d_code_freq_chips; T_prn_mod_seconds = T_chip_mod_seconds * GLONASS_L1_CA_CODE_LENGTH_CHIPS; T_prn_mod_samples = T_prn_mod_seconds * static_cast(d_fs_in); @@ -224,14 +221,14 @@ void Glonass_L1_Ca_Dll_Pll_Tracking_cc::start_tracking() d_acq_code_phase_samples = corrected_acq_phase_samples; - d_carrier_frequency_hz = d_acq_carrier_doppler_hz + d_if_freq + (DFRQ1_GLO * GLONASS_PRN.at(d_acquisition_gnss_synchro->PRN)); + d_carrier_frequency_hz = d_acq_carrier_doppler_hz + d_if_freq + (DFRQ1_GLO * GLONASS_PRN.at(d_acquisition_gnss_synchro->PRN)); d_carrier_doppler_hz = d_acq_carrier_doppler_hz; d_carrier_phase_step_rad = GLONASS_TWO_PI * d_carrier_frequency_hz / static_cast(d_fs_in); d_carrier_doppler_phase_step_rad = GLONASS_TWO_PI * (d_carrier_doppler_hz) / static_cast(d_fs_in); // DLL/PLL filter initialization - d_carrier_loop_filter.initialize(); // initialize the carrier filter - d_code_loop_filter.initialize(); // initialize the code filter + d_carrier_loop_filter.initialize(); // initialize the carrier filter + d_code_loop_filter.initialize(); // initialize the code filter // generate local reference ALWAYS starting at chip 1 (1 sample per chip) glonass_l1_ca_code_gen_complex(d_ca_code, 0); @@ -239,7 +236,7 @@ void Glonass_L1_Ca_Dll_Pll_Tracking_cc::start_tracking() multicorrelator_cpu.set_local_code_and_taps(static_cast(GLONASS_L1_CA_CODE_LENGTH_CHIPS), d_ca_code, d_local_code_shift_chips); for (int n = 0; n < d_n_correlator_taps; n++) { - d_correlator_outs[n] = gr_complex(0,0); + d_correlator_outs[n] = gr_complex(0, 0); } d_carrier_lock_fail_counter = 0; @@ -251,7 +248,7 @@ void Glonass_L1_Ca_Dll_Pll_Tracking_cc::start_tracking() d_code_phase_samples = d_acq_code_phase_samples; std::string sys_ = &d_acquisition_gnss_synchro->System; - sys = sys_.substr(0,1); + sys = sys_.substr(0, 1); // DEBUG OUTPUT std::cout << "Tracking of GLONASS L1 C/A signal started on channel " << d_channel << " for satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << std::endl; @@ -262,8 +259,8 @@ void Glonass_L1_Ca_Dll_Pll_Tracking_cc::start_tracking() d_enable_tracking = true; LOG(INFO) << "PULL-IN Doppler [Hz]=" << d_carrier_frequency_hz - << " Code Phase correction [samples]=" << delay_correction_samples - << " PULL-IN Code Phase [samples]=" << d_acq_code_phase_samples; + << " Code Phase correction [samples]=" << delay_correction_samples + << " PULL-IN Code Phase [samples]=" << d_acq_code_phase_samples; } @@ -272,38 +269,38 @@ Glonass_L1_Ca_Dll_Pll_Tracking_cc::~Glonass_L1_Ca_Dll_Pll_Tracking_cc() if (d_dump_file.is_open()) { try - { + { d_dump_file.close(); - } - catch(const std::exception & ex) - { + } + catch (const std::exception &ex) + { LOG(WARNING) << "Exception in destructor " << ex.what(); - } + } } - if(d_dump) + if (d_dump) { - if(d_channel == 0) + if (d_channel == 0) { std::cout << "Writing .mat files ..."; } Glonass_L1_Ca_Dll_Pll_Tracking_cc::save_matfile(); - if(d_channel == 0) + if (d_channel == 0) { std::cout << " done." << std::endl; } } try - { + { volk_gnsssdr_free(d_local_code_shift_chips); volk_gnsssdr_free(d_correlator_outs); volk_gnsssdr_free(d_ca_code); delete[] d_Prompt_buffer; multicorrelator_cpu.free(); - } - catch(const std::exception & ex) - { + } + catch (const std::exception &ex) + { LOG(WARNING) << "Exception in destructor " << ex.what(); - } + } } @@ -314,18 +311,18 @@ int Glonass_L1_Ca_Dll_Pll_Tracking_cc::save_matfile() int number_of_double_vars = 11; int number_of_float_vars = 5; int epoch_size_bytes = sizeof(unsigned long int) + sizeof(double) * number_of_double_vars + - sizeof(float) * number_of_float_vars + sizeof(unsigned int); + sizeof(float) * number_of_float_vars + sizeof(unsigned int); std::ifstream dump_file; dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); try - { + { dump_file.open(d_dump_filename.c_str(), std::ios::binary | std::ios::ate); - } - catch(const std::ifstream::failure &e) - { - std::cerr << "Problem opening dump file:" << e.what() << std::endl; + } + catch (const std::ifstream::failure &e) + { + std::cerr << "Problem opening dump file:" << e.what() << std::endl; return 1; - } + } // count number of epochs and rewind long int num_epoch = 0; if (dump_file.is_open()) @@ -338,30 +335,30 @@ int Glonass_L1_Ca_Dll_Pll_Tracking_cc::save_matfile() { return 1; } - float * abs_E = new float [num_epoch]; - float * abs_P = new float [num_epoch]; - float * abs_L = new float [num_epoch]; - float * Prompt_I = new float [num_epoch]; - float * Prompt_Q = new float [num_epoch]; - unsigned long int * PRN_start_sample_count = new unsigned long int [num_epoch]; - double * acc_carrier_phase_rad = new double [num_epoch]; - double * carrier_doppler_hz = new double [num_epoch]; - double * code_freq_chips = new double [num_epoch]; - double * carr_error_hz = new double [num_epoch]; - double * carr_error_filt_hz = new double [num_epoch]; - double * code_error_chips = new double [num_epoch]; - double * code_error_filt_chips = new double [num_epoch]; - double * CN0_SNV_dB_Hz = new double [num_epoch]; - double * carrier_lock_test = new double [num_epoch]; - double * aux1 = new double [num_epoch]; - double * aux2 = new double [num_epoch]; - unsigned int * PRN = new unsigned int [num_epoch]; + float *abs_E = new float[num_epoch]; + float *abs_P = new float[num_epoch]; + float *abs_L = new float[num_epoch]; + float *Prompt_I = new float[num_epoch]; + float *Prompt_Q = new float[num_epoch]; + unsigned long int *PRN_start_sample_count = new unsigned long int[num_epoch]; + double *acc_carrier_phase_rad = new double[num_epoch]; + double *carrier_doppler_hz = new double[num_epoch]; + double *code_freq_chips = new double[num_epoch]; + double *carr_error_hz = new double[num_epoch]; + double *carr_error_filt_hz = new double[num_epoch]; + double *code_error_chips = new double[num_epoch]; + double *code_error_filt_chips = new double[num_epoch]; + double *CN0_SNV_dB_Hz = new double[num_epoch]; + double *carrier_lock_test = new double[num_epoch]; + double *aux1 = new double[num_epoch]; + double *aux2 = new double[num_epoch]; + unsigned int *PRN = new unsigned int[num_epoch]; try - { + { if (dump_file.is_open()) { - for(long int i = 0; i < num_epoch; i++) + for (long int i = 0; i < num_epoch; i++) { dump_file.read(reinterpret_cast(&abs_E[i]), sizeof(float)); dump_file.read(reinterpret_cast(&abs_P[i]), sizeof(float)); @@ -384,10 +381,10 @@ int Glonass_L1_Ca_Dll_Pll_Tracking_cc::save_matfile() } } dump_file.close(); - } + } catch (const std::ifstream::failure &e) - { - std::cerr << "Problem reading dump file:" << e.what() << std::endl; + { + std::cerr << "Problem reading dump file:" << e.what() << std::endl; delete[] abs_E; delete[] abs_P; delete[] abs_L; @@ -407,7 +404,7 @@ int Glonass_L1_Ca_Dll_Pll_Tracking_cc::save_matfile() delete[] aux2; delete[] PRN; return 1; - } + } // WRITE MAT FILE mat_t *matfp; @@ -416,79 +413,79 @@ int Glonass_L1_Ca_Dll_Pll_Tracking_cc::save_matfile() filename.erase(filename.length() - 4, 4); filename.append(".mat"); matfp = Mat_CreateVer(filename.c_str(), NULL, MAT_FT_MAT73); - if(reinterpret_cast(matfp) != NULL) + if (reinterpret_cast(matfp) != NULL) { size_t dims[2] = {1, static_cast(num_epoch)}; matvar = Mat_VarCreate("abs_E", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, abs_E, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("abs_P", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, abs_P, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("abs_L", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, abs_L, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("Prompt_I", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, Prompt_I, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("Prompt_Q", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, Prompt_Q, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("PRN_start_sample_count", MAT_C_UINT64, MAT_T_UINT64, 2, dims, PRN_start_sample_count, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("acc_carrier_phase_rad", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, acc_carrier_phase_rad, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("carrier_doppler_hz", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, carrier_doppler_hz, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("code_freq_chips", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, code_freq_chips, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("carr_error_hz", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, carr_error_hz, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("carr_error_filt_hz", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, carr_error_filt_hz, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("code_error_chips", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, code_error_chips, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("code_error_filt_chips", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, code_error_filt_chips, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("CN0_SNV_dB_Hz", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, CN0_SNV_dB_Hz, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("carrier_lock_test", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, carrier_lock_test, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("aux1", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, aux1, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("aux2", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, aux2, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("PRN", MAT_C_UINT32, MAT_T_UINT32, 2, dims, PRN, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); } Mat_Close(matfp); @@ -514,8 +511,8 @@ int Glonass_L1_Ca_Dll_Pll_Tracking_cc::save_matfile() } -int Glonass_L1_Ca_Dll_Pll_Tracking_cc::general_work (int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), - gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) +int Glonass_L1_Ca_Dll_Pll_Tracking_cc::general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), + gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { // process vars double carr_error_hz = 0.0; @@ -524,7 +521,7 @@ int Glonass_L1_Ca_Dll_Pll_Tracking_cc::general_work (int noutput_items __attribu double code_error_filt_chips = 0.0; // Block input data and block output stream pointers - const gr_complex* in = reinterpret_cast(input_items[0]); // PRN start block alignment + const gr_complex *in = reinterpret_cast(input_items[0]); // PRN start block alignment Gnss_Synchro **out = reinterpret_cast(&output_items[0]); // GNSS_SYNCHRO OBJECT to interchange data between tracking->telemetry_decoder @@ -544,7 +541,7 @@ int Glonass_L1_Ca_Dll_Pll_Tracking_cc::general_work (int noutput_items __attribu acq_trk_shif_correction_samples = d_current_prn_length_samples - fmod(static_cast(acq_to_trk_delay_samples), static_cast(d_current_prn_length_samples)); samples_offset = round(d_acq_code_phase_samples + acq_trk_shif_correction_samples); current_synchro_data.Tracking_sample_counter = d_sample_counter + samples_offset; - d_sample_counter = d_sample_counter + samples_offset; // count for the processed samples + d_sample_counter = d_sample_counter + samples_offset; // count for the processed samples d_pull_in = false; // take into account the carrier cycles accumulated in the pull in signal alignment d_acc_carrier_phase_rad -= d_carrier_doppler_phase_step_rad * samples_offset; @@ -553,7 +550,7 @@ int Glonass_L1_Ca_Dll_Pll_Tracking_cc::general_work (int noutput_items __attribu current_synchro_data.fs = d_fs_in; current_synchro_data.correlation_length_ms = 1; *out[0] = current_synchro_data; - consume_each(samples_offset); // shift input to perform alignment with local replica + consume_each(samples_offset); // shift input to perform alignment with local replica return 1; } @@ -561,15 +558,15 @@ int Glonass_L1_Ca_Dll_Pll_Tracking_cc::general_work (int noutput_items __attribu // perform carrier wipe-off and compute Early, Prompt and Late correlation multicorrelator_cpu.set_input_output_vectors(d_correlator_outs, in); multicorrelator_cpu.Carrier_wipeoff_multicorrelator_resampler(d_rem_carr_phase_rad, - d_carrier_phase_step_rad, - d_rem_code_phase_chips, - d_code_phase_step_chips, - d_current_prn_length_samples); + d_carrier_phase_step_rad, + d_rem_code_phase_chips, + d_code_phase_step_chips, + d_current_prn_length_samples); // ################## PLL ########################################################## // PLL discriminator // Update PLL discriminator [rads/Ti -> Secs/Ti] - carr_error_hz = pll_cloop_two_quadrant_atan(d_correlator_outs[1]) / GLONASS_TWO_PI; // prompt output + carr_error_hz = pll_cloop_two_quadrant_atan(d_correlator_outs[1]) / GLONASS_TWO_PI; // prompt output // Carrier discriminator filter carr_error_filt_hz = d_carrier_loop_filter.get_carrier_nco(carr_error_hz); // New carrier Doppler frequency estimation @@ -579,12 +576,12 @@ int Glonass_L1_Ca_Dll_Pll_Tracking_cc::general_work (int noutput_items __attribu // ################## DLL ########################################################## // DLL discriminator - code_error_chips = dll_nc_e_minus_l_normalized(d_correlator_outs[0], d_correlator_outs[2]); // [chips/Ti] //early and late + code_error_chips = dll_nc_e_minus_l_normalized(d_correlator_outs[0], d_correlator_outs[2]); // [chips/Ti] //early and late // Code discriminator filter - code_error_filt_chips = d_code_loop_filter.get_code_nco(code_error_chips); // [chips/second] + code_error_filt_chips = d_code_loop_filter.get_code_nco(code_error_chips); // [chips/second] double T_chip_seconds = 1.0 / static_cast(d_code_freq_chips); double T_prn_seconds = T_chip_seconds * GLONASS_L1_CA_CODE_LENGTH_CHIPS; - double code_error_filt_secs = (T_prn_seconds * code_error_filt_chips*T_chip_seconds); //[seconds] + double code_error_filt_secs = (T_prn_seconds * code_error_filt_chips * T_chip_seconds); //[seconds] //double code_error_filt_secs = (GPS_L1_CA_CODE_PERIOD * code_error_filt_chips) / GLONASS_L1_CA_CODE_RATE_HZ; // [seconds] // ################## CARRIER AND CODE NCO BUFFER ALIGNEMENT ####################### @@ -594,7 +591,7 @@ int Glonass_L1_Ca_Dll_Pll_Tracking_cc::general_work (int noutput_items __attribu //double T_prn_seconds = T_chip_seconds * GLONASS_L1_CA_CODE_LENGTH_CHIPS; double T_prn_samples = T_prn_seconds * static_cast(d_fs_in); double K_blk_samples = T_prn_samples + d_rem_code_phase_samples + code_error_filt_secs * static_cast(d_fs_in); - d_current_prn_length_samples = round(K_blk_samples); // round to a discrete number of samples + d_current_prn_length_samples = round(K_blk_samples); // round to a discrete number of samples //################### PLL COMMANDS ################################################# // carrier phase step (NCO phase increment per sample) [rads/sample] @@ -610,14 +607,14 @@ int Glonass_L1_Ca_Dll_Pll_Tracking_cc::general_work (int noutput_items __attribu // code phase step (Code resampler phase increment per sample) [chips/sample] d_code_phase_step_chips = d_code_freq_chips / static_cast(d_fs_in); // remnant code phase [chips] - d_rem_code_phase_samples = K_blk_samples - d_current_prn_length_samples; // rounding error < 1 sample + d_rem_code_phase_samples = K_blk_samples - d_current_prn_length_samples; // rounding error < 1 sample d_rem_code_phase_chips = d_code_freq_chips * (d_rem_code_phase_samples / static_cast(d_fs_in)); // ####### CN0 ESTIMATION AND LOCK DETECTORS ###### if (d_cn0_estimation_counter < FLAGS_cn0_samples) { // fill buffer with prompt correlator output values - d_Prompt_buffer[d_cn0_estimation_counter] = d_correlator_outs[1]; //prompt + d_Prompt_buffer[d_cn0_estimation_counter] = d_correlator_outs[1]; //prompt d_cn0_estimation_counter++; } else @@ -640,9 +637,9 @@ int Glonass_L1_Ca_Dll_Pll_Tracking_cc::general_work (int noutput_items __attribu { std::cout << "Loss of lock in channel " << d_channel << "!" << std::endl; LOG(INFO) << "Loss of lock in channel " << d_channel << "!"; - this->message_port_pub(pmt::mp("events"), pmt::from_long(3)); // 3 -> loss of lock + this->message_port_pub(pmt::mp("events"), pmt::from_long(3)); // 3 -> loss of lock d_carrier_lock_fail_counter = 0; - d_enable_tracking = false; // TODO: check if disabling tracking is consistent with the channel state machine + d_enable_tracking = false; // TODO: check if disabling tracking is consistent with the channel state machine } } // ########### Output the tracking data to navigation and PVT ########## @@ -660,7 +657,7 @@ int Glonass_L1_Ca_Dll_Pll_Tracking_cc::general_work (int noutput_items __attribu { for (int n = 0; n < d_n_correlator_taps; n++) { - d_correlator_outs[n] = gr_complex(0,0); + d_correlator_outs[n] = gr_complex(0, 0); } current_synchro_data.Tracking_sample_counter = d_sample_counter + d_current_prn_length_samples; @@ -671,7 +668,7 @@ int Glonass_L1_Ca_Dll_Pll_Tracking_cc::general_work (int noutput_items __attribu //assign the GNURadio block output data current_synchro_data.fs = d_fs_in; *out[0] = current_synchro_data; - if(d_dump) + if (d_dump) { // MULTIPLEXED FILE RECORDING - Record results to file float prompt_I; @@ -685,59 +682,58 @@ int Glonass_L1_Ca_Dll_Pll_Tracking_cc::general_work (int noutput_items __attribu tmp_P = std::abs(d_correlator_outs[1]); tmp_L = std::abs(d_correlator_outs[2]); try - { + { // EPR - d_dump_file.write(reinterpret_cast(&tmp_E), sizeof(float)); - d_dump_file.write(reinterpret_cast(&tmp_P), sizeof(float)); - d_dump_file.write(reinterpret_cast(&tmp_L), sizeof(float)); + d_dump_file.write(reinterpret_cast(&tmp_E), sizeof(float)); + d_dump_file.write(reinterpret_cast(&tmp_P), sizeof(float)); + d_dump_file.write(reinterpret_cast(&tmp_L), sizeof(float)); // PROMPT I and Q (to analyze navigation symbols) - d_dump_file.write(reinterpret_cast(&prompt_I), sizeof(float)); - d_dump_file.write(reinterpret_cast(&prompt_Q), sizeof(float)); + d_dump_file.write(reinterpret_cast(&prompt_I), sizeof(float)); + d_dump_file.write(reinterpret_cast(&prompt_Q), sizeof(float)); // PRN start sample stamp tmp_long = d_sample_counter + d_current_prn_length_samples; - d_dump_file.write(reinterpret_cast(&tmp_long), sizeof(unsigned long int)); + d_dump_file.write(reinterpret_cast(&tmp_long), sizeof(unsigned long int)); // accumulated carrier phase - d_dump_file.write(reinterpret_cast(&d_acc_carrier_phase_rad), sizeof(double)); + d_dump_file.write(reinterpret_cast(&d_acc_carrier_phase_rad), sizeof(double)); // carrier and code frequency - d_dump_file.write(reinterpret_cast(&d_carrier_frequency_hz), sizeof(double)); - d_dump_file.write(reinterpret_cast(&d_code_freq_chips), sizeof(double)); + d_dump_file.write(reinterpret_cast(&d_carrier_frequency_hz), sizeof(double)); + d_dump_file.write(reinterpret_cast(&d_code_freq_chips), sizeof(double)); // PLL commands - d_dump_file.write(reinterpret_cast(&carr_error_hz), sizeof(double)); - d_dump_file.write(reinterpret_cast(&carr_error_filt_hz), sizeof(double)); + d_dump_file.write(reinterpret_cast(&carr_error_hz), sizeof(double)); + d_dump_file.write(reinterpret_cast(&carr_error_filt_hz), sizeof(double)); // DLL commands - d_dump_file.write(reinterpret_cast(&code_error_chips), sizeof(double)); - d_dump_file.write(reinterpret_cast(&code_error_filt_chips), sizeof(double)); + d_dump_file.write(reinterpret_cast(&code_error_chips), sizeof(double)); + d_dump_file.write(reinterpret_cast(&code_error_filt_chips), sizeof(double)); // CN0 and carrier lock test - d_dump_file.write(reinterpret_cast(&d_CN0_SNV_dB_Hz), sizeof(double)); - d_dump_file.write(reinterpret_cast(&d_carrier_lock_test), sizeof(double)); + d_dump_file.write(reinterpret_cast(&d_CN0_SNV_dB_Hz), sizeof(double)); + d_dump_file.write(reinterpret_cast(&d_carrier_lock_test), sizeof(double)); // AUX vars (for debug purposes) tmp_double = d_rem_code_phase_samples; - d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); + d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); tmp_double = static_cast(d_sample_counter); - d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); + d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); // PRN unsigned int prn_ = d_acquisition_gnss_synchro->PRN; - d_dump_file.write(reinterpret_cast(&prn_), sizeof(unsigned int)); - } + d_dump_file.write(reinterpret_cast(&prn_), sizeof(unsigned int)); + } catch (const std::ifstream::failure &e) - { + { LOG(WARNING) << "Exception writing trk dump file " << e.what(); - } + } } - consume_each(d_current_prn_length_samples); // this is necessary in gr::block derivates - d_sample_counter += d_current_prn_length_samples; // count for the processed samples - return 1; // output tracking result ALWAYS even in the case of d_enable_tracking==false + consume_each(d_current_prn_length_samples); // this is necessary in gr::block derivates + d_sample_counter += d_current_prn_length_samples; // count for the processed samples + return 1; // output tracking result ALWAYS even in the case of d_enable_tracking==false } - void Glonass_L1_Ca_Dll_Pll_Tracking_cc::set_channel(unsigned int channel) { d_channel = channel; @@ -748,23 +744,23 @@ void Glonass_L1_Ca_Dll_Pll_Tracking_cc::set_channel(unsigned int channel) if (d_dump_file.is_open() == false) { try - { + { d_dump_filename.append(boost::lexical_cast(d_channel)); d_dump_filename.append(".dat"); - d_dump_file.exceptions (std::ifstream::failbit | std::ifstream::badbit); + d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); LOG(INFO) << "Tracking dump enabled on channel " << d_channel << " Log file: " << d_dump_filename.c_str(); - } + } catch (const std::ifstream::failure &e) - { + { LOG(WARNING) << "channel " << d_channel << " Exception opening trk dump file " << e.what(); - } + } } } } -void Glonass_L1_Ca_Dll_Pll_Tracking_cc::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) +void Glonass_L1_Ca_Dll_Pll_Tracking_cc::set_gnss_synchro(Gnss_Synchro *p_gnss_synchro) { d_acquisition_gnss_synchro = p_gnss_synchro; } diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_tracking_cc.h b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_tracking_cc.h index eeec2309c..d100f7cab 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_tracking_cc.h +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_tracking_cc.h @@ -51,24 +51,22 @@ class Glonass_L1_Ca_Dll_Pll_Tracking_cc; typedef boost::shared_ptr - glonass_l1_ca_dll_pll_tracking_cc_sptr; + glonass_l1_ca_dll_pll_tracking_cc_sptr; glonass_l1_ca_dll_pll_tracking_cc_sptr glonass_l1_ca_dll_pll_make_tracking_cc(long if_freq, - long fs_in, unsigned - int vector_length, - bool dump, - std::string dump_filename, - float pll_bw_hz, - float dll_bw_hz, - float early_late_space_chips); - + long fs_in, unsigned int vector_length, + bool dump, + std::string dump_filename, + float pll_bw_hz, + float dll_bw_hz, + float early_late_space_chips); /*! * \brief This class implements a DLL + PLL tracking loop block */ -class Glonass_L1_Ca_Dll_Pll_Tracking_cc: public gr::block +class Glonass_L1_Ca_Dll_Pll_Tracking_cc : public gr::block { public: ~Glonass_L1_Ca_Dll_Pll_Tracking_cc(); @@ -77,30 +75,28 @@ public: void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro); void start_tracking(); - int general_work (int noutput_items, gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); + int general_work(int noutput_items, gr_vector_int& ninput_items, + gr_vector_const_void_star& input_items, gr_vector_void_star& output_items); - void forecast (int noutput_items, gr_vector_int &ninput_items_required); + void forecast(int noutput_items, gr_vector_int& ninput_items_required); private: friend glonass_l1_ca_dll_pll_tracking_cc_sptr glonass_l1_ca_dll_pll_make_tracking_cc(long if_freq, - long fs_in, unsigned - int vector_length, - bool dump, - std::string dump_filename, - float pll_bw_hz, - float dll_bw_hz, - float early_late_space_chips); + long fs_in, unsigned int vector_length, + bool dump, + std::string dump_filename, + float pll_bw_hz, + float dll_bw_hz, + float early_late_space_chips); Glonass_L1_Ca_Dll_Pll_Tracking_cc(long if_freq, - long fs_in, unsigned - int vector_length, - bool dump, - std::string dump_filename, - float pll_bw_hz, - float dll_bw_hz, - float early_late_space_chips); + long fs_in, unsigned int vector_length, + bool dump, + std::string dump_filename, + float pll_bw_hz, + float dll_bw_hz, + float early_late_space_chips); // tracking configuration vars unsigned int d_vector_length; @@ -174,4 +170,4 @@ private: int save_matfile(); }; -#endif //GNSS_SDR_GLONASS_L1_CA_DLL_PLL_TRACKING_CC_H +#endif //GNSS_SDR_GLONASS_L1_CA_DLL_PLL_TRACKING_CC_H diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_cc.cc index b895ee48f..f207d25a4 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_cc.cc @@ -52,29 +52,29 @@ using google::LogMessage; gps_l1_ca_dll_pll_c_aid_tracking_cc_sptr gps_l1_ca_dll_pll_c_aid_make_tracking_cc( - long if_freq, - long fs_in, - unsigned int vector_length, - bool dump, - std::string dump_filename, - float pll_bw_hz, - float dll_bw_hz, - float pll_bw_narrow_hz, - float dll_bw_narrow_hz, - int extend_correlation_ms, - float early_late_space_chips) + long if_freq, + long fs_in, + unsigned int vector_length, + bool dump, + std::string dump_filename, + float pll_bw_hz, + float dll_bw_hz, + float pll_bw_narrow_hz, + float dll_bw_narrow_hz, + int extend_correlation_ms, + float early_late_space_chips) { return gps_l1_ca_dll_pll_c_aid_tracking_cc_sptr(new gps_l1_ca_dll_pll_c_aid_tracking_cc(if_freq, - fs_in, vector_length, dump, dump_filename, pll_bw_hz, dll_bw_hz,pll_bw_narrow_hz, dll_bw_narrow_hz, extend_correlation_ms, early_late_space_chips)); + fs_in, vector_length, dump, dump_filename, pll_bw_hz, dll_bw_hz, pll_bw_narrow_hz, dll_bw_narrow_hz, extend_correlation_ms, early_late_space_chips)); } -void gps_l1_ca_dll_pll_c_aid_tracking_cc::forecast (int noutput_items, - gr_vector_int &ninput_items_required) +void gps_l1_ca_dll_pll_c_aid_tracking_cc::forecast(int noutput_items, + gr_vector_int &ninput_items_required) { if (noutput_items != 0) { - ninput_items_required[0] = static_cast(d_vector_length) * 2; //set the required available samples in each call + ninput_items_required[0] = static_cast(d_vector_length) * 2; //set the required available samples in each call } } @@ -82,8 +82,8 @@ void gps_l1_ca_dll_pll_c_aid_tracking_cc::forecast (int noutput_items, void gps_l1_ca_dll_pll_c_aid_tracking_cc::msg_handler_preamble_index(pmt::pmt_t msg) { //pmt::print(msg); - DLOG(INFO) << "Extended correlation enabled for Tracking CH " << d_channel << ": Satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN); - if (d_enable_extended_integration == false) //avoid re-setting preamble indicator + DLOG(INFO) << "Extended correlation enabled for Tracking CH " << d_channel << ": Satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN); + if (d_enable_extended_integration == false) //avoid re-setting preamble indicator { d_preamble_timestamp_s = pmt::to_double(msg); d_enable_extended_integration = true; @@ -93,25 +93,24 @@ void gps_l1_ca_dll_pll_c_aid_tracking_cc::msg_handler_preamble_index(pmt::pmt_t gps_l1_ca_dll_pll_c_aid_tracking_cc::gps_l1_ca_dll_pll_c_aid_tracking_cc( - long if_freq, - long fs_in, - unsigned int vector_length, - bool dump, - std::string dump_filename, - float pll_bw_hz, - float dll_bw_hz, - float pll_bw_narrow_hz, - float dll_bw_narrow_hz, - int extend_correlation_ms, - float early_late_space_chips) : - gr::block("gps_l1_ca_dll_pll_c_aid_tracking_cc", gr::io_signature::make(1, 1, sizeof(gr_complex)), - gr::io_signature::make(1, 1, sizeof(Gnss_Synchro))) + long if_freq, + long fs_in, + unsigned int vector_length, + bool dump, + std::string dump_filename, + float pll_bw_hz, + float dll_bw_hz, + float pll_bw_narrow_hz, + float dll_bw_narrow_hz, + int extend_correlation_ms, + float early_late_space_chips) : gr::block("gps_l1_ca_dll_pll_c_aid_tracking_cc", gr::io_signature::make(1, 1, sizeof(gr_complex)), + gr::io_signature::make(1, 1, sizeof(Gnss_Synchro))) { // Telemetry bit synchronization message port input this->message_port_register_in(pmt::mp("preamble_timestamp_s")); this->set_msg_handler(pmt::mp("preamble_timestamp_s"), - boost::bind(&gps_l1_ca_dll_pll_c_aid_tracking_cc::msg_handler_preamble_index, this, _1)); + boost::bind(&gps_l1_ca_dll_pll_c_aid_tracking_cc::msg_handler_preamble_index, this, _1)); this->message_port_register_out(pmt::mp("events")); // initialize internal vars @@ -132,22 +131,22 @@ gps_l1_ca_dll_pll_c_aid_tracking_cc::gps_l1_ca_dll_pll_c_aid_tracking_cc( d_carrier_loop_filter.set_params(10.0, d_pll_bw_hz, 2); // --- DLL variables -------------------------------------------------------- - d_early_late_spc_chips = early_late_space_chips; // Define early-late offset (in chips) + d_early_late_spc_chips = early_late_space_chips; // Define early-late offset (in chips) // Initialization of local code replica // Get space for a vector with the C/A code replica sampled 1x/chip - d_ca_code = static_cast(volk_gnsssdr_malloc(static_cast(GPS_L1_CA_CODE_LENGTH_CHIPS) * sizeof(gr_complex), volk_gnsssdr_get_alignment())); + d_ca_code = static_cast(volk_gnsssdr_malloc(static_cast(GPS_L1_CA_CODE_LENGTH_CHIPS) * sizeof(gr_complex), volk_gnsssdr_get_alignment())); // correlator outputs (scalar) - d_n_correlator_taps = 3; // Early, Prompt, and Late - d_correlator_outs = static_cast(volk_gnsssdr_malloc(d_n_correlator_taps*sizeof(gr_complex), volk_gnsssdr_get_alignment())); + d_n_correlator_taps = 3; // Early, Prompt, and Late + d_correlator_outs = static_cast(volk_gnsssdr_malloc(d_n_correlator_taps * sizeof(gr_complex), volk_gnsssdr_get_alignment())); for (int n = 0; n < d_n_correlator_taps; n++) { - d_correlator_outs[n] = gr_complex(0,0); + d_correlator_outs[n] = gr_complex(0, 0); } - d_local_code_shift_chips = static_cast(volk_gnsssdr_malloc(d_n_correlator_taps*sizeof(float), volk_gnsssdr_get_alignment())); + d_local_code_shift_chips = static_cast(volk_gnsssdr_malloc(d_n_correlator_taps * sizeof(float), volk_gnsssdr_get_alignment())); // Set TAPs delay values [chips] - d_local_code_shift_chips[0] = - d_early_late_spc_chips; + d_local_code_shift_chips[0] = -d_early_late_spc_chips; d_local_code_shift_chips[1] = 0.0; d_local_code_shift_chips[2] = d_early_late_spc_chips; @@ -162,7 +161,7 @@ gps_l1_ca_dll_pll_c_aid_tracking_cc::gps_l1_ca_dll_pll_c_aid_tracking_cc( d_rem_carrier_phase_rad = 0.0; // sample synchronization - d_sample_counter = 0; //(from trk to tlm) + d_sample_counter = 0; //(from trk to tlm) d_acq_sample_stamp = 0; d_enable_tracking = false; d_pull_in = false; @@ -215,7 +214,7 @@ void gps_l1_ca_dll_pll_c_aid_tracking_cc::start_tracking() long int acq_trk_diff_samples; double acq_trk_diff_seconds; - acq_trk_diff_samples = static_cast(d_sample_counter) - static_cast(d_acq_sample_stamp);//-d_vector_length; + acq_trk_diff_samples = static_cast(d_sample_counter) - static_cast(d_acq_sample_stamp); //-d_vector_length; DLOG(INFO) << "Number of samples between Acquisition and Tracking =" << acq_trk_diff_samples; acq_trk_diff_seconds = static_cast(acq_trk_diff_samples) / static_cast(d_fs_in); // Doppler effect @@ -252,8 +251,8 @@ void gps_l1_ca_dll_pll_c_aid_tracking_cc::start_tracking() d_carrier_phase_step_rad = GPS_TWO_PI * d_carrier_doppler_hz / static_cast(d_fs_in); // DLL/PLL filter initialization - d_carrier_loop_filter.initialize(d_acq_carrier_doppler_hz); // The carrier loop filter implements the Doppler accumulator - d_code_loop_filter.initialize(); // initialize the code filter + d_carrier_loop_filter.initialize(d_acq_carrier_doppler_hz); // The carrier loop filter implements the Doppler accumulator + d_code_loop_filter.initialize(); // initialize the code filter // generate local reference ALWAYS starting at chip 1 (1 sample per chip) gps_l1_ca_code_gen_complex(d_ca_code, d_acquisition_gnss_synchro->PRN, 0); @@ -261,7 +260,7 @@ void gps_l1_ca_dll_pll_c_aid_tracking_cc::start_tracking() multicorrelator_cpu.set_local_code_and_taps(static_cast(GPS_L1_CA_CODE_LENGTH_CHIPS), d_ca_code, d_local_code_shift_chips); for (int n = 0; n < d_n_correlator_taps; n++) { - d_correlator_outs[n] = gr_complex(0,0); + d_correlator_outs[n] = gr_complex(0, 0); } d_carrier_lock_fail_counter = 0; @@ -273,7 +272,7 @@ void gps_l1_ca_dll_pll_c_aid_tracking_cc::start_tracking() d_code_phase_samples = d_acq_code_phase_samples; std::string sys_ = &d_acquisition_gnss_synchro->System; - sys = sys_.substr(0,1); + sys = sys_.substr(0, 1); // DEBUG OUTPUT std::cout << "Tracking of GPS L1 C/A signal started on channel " << d_channel << " for satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << std::endl; @@ -295,40 +294,40 @@ gps_l1_ca_dll_pll_c_aid_tracking_cc::~gps_l1_ca_dll_pll_c_aid_tracking_cc() if (d_dump_file.is_open()) { try - { + { d_dump_file.close(); - } - catch(const std::exception & ex) - { + } + catch (const std::exception &ex) + { LOG(WARNING) << "Exception in destructor " << ex.what(); - } + } } - if(d_dump) + if (d_dump) { - if(d_channel == 0) + if (d_channel == 0) { std::cout << "Writing .mat files ..."; } gps_l1_ca_dll_pll_c_aid_tracking_cc::save_matfile(); - if(d_channel == 0) + if (d_channel == 0) { std::cout << " done." << std::endl; } } try - { + { volk_gnsssdr_free(d_local_code_shift_chips); volk_gnsssdr_free(d_correlator_outs); volk_gnsssdr_free(d_ca_code); delete[] d_Prompt_buffer; multicorrelator_cpu.free(); - } - catch(const std::exception & ex) - { + } + catch (const std::exception &ex) + { LOG(WARNING) << "Exception in destructor " << ex.what(); - } + } } @@ -339,18 +338,18 @@ int gps_l1_ca_dll_pll_c_aid_tracking_cc::save_matfile() int number_of_double_vars = 11; int number_of_float_vars = 5; int epoch_size_bytes = sizeof(unsigned long int) + sizeof(double) * number_of_double_vars + - sizeof(float) * number_of_float_vars + sizeof(unsigned int); + sizeof(float) * number_of_float_vars + sizeof(unsigned int); std::ifstream dump_file; dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); try - { + { dump_file.open(d_dump_filename.c_str(), std::ios::binary | std::ios::ate); - } - catch(const std::ifstream::failure &e) - { - std::cerr << "Problem opening dump file:" << e.what() << std::endl; + } + catch (const std::ifstream::failure &e) + { + std::cerr << "Problem opening dump file:" << e.what() << std::endl; return 1; - } + } // count number of epochs and rewind long int num_epoch = 0; if (dump_file.is_open()) @@ -363,30 +362,30 @@ int gps_l1_ca_dll_pll_c_aid_tracking_cc::save_matfile() { return 1; } - float * abs_E = new float [num_epoch]; - float * abs_P = new float [num_epoch]; - float * abs_L = new float [num_epoch]; - float * Prompt_I = new float [num_epoch]; - float * Prompt_Q = new float [num_epoch]; - unsigned long int * PRN_start_sample_count = new unsigned long int [num_epoch]; - double * acc_carrier_phase_rad = new double [num_epoch]; - double * carrier_doppler_hz = new double [num_epoch]; - double * code_freq_chips = new double [num_epoch]; - double * carr_error_hz = new double [num_epoch]; - double * carr_error_filt_hz = new double [num_epoch]; - double * code_error_chips = new double [num_epoch]; - double * code_error_filt_chips = new double [num_epoch]; - double * CN0_SNV_dB_Hz = new double [num_epoch]; - double * carrier_lock_test = new double [num_epoch]; - double * aux1 = new double [num_epoch]; - double * aux2 = new double [num_epoch]; - unsigned int * PRN = new unsigned int [num_epoch]; + float *abs_E = new float[num_epoch]; + float *abs_P = new float[num_epoch]; + float *abs_L = new float[num_epoch]; + float *Prompt_I = new float[num_epoch]; + float *Prompt_Q = new float[num_epoch]; + unsigned long int *PRN_start_sample_count = new unsigned long int[num_epoch]; + double *acc_carrier_phase_rad = new double[num_epoch]; + double *carrier_doppler_hz = new double[num_epoch]; + double *code_freq_chips = new double[num_epoch]; + double *carr_error_hz = new double[num_epoch]; + double *carr_error_filt_hz = new double[num_epoch]; + double *code_error_chips = new double[num_epoch]; + double *code_error_filt_chips = new double[num_epoch]; + double *CN0_SNV_dB_Hz = new double[num_epoch]; + double *carrier_lock_test = new double[num_epoch]; + double *aux1 = new double[num_epoch]; + double *aux2 = new double[num_epoch]; + unsigned int *PRN = new unsigned int[num_epoch]; try - { + { if (dump_file.is_open()) { - for(long int i = 0; i < num_epoch; i++) + for (long int i = 0; i < num_epoch; i++) { dump_file.read(reinterpret_cast(&abs_E[i]), sizeof(float)); dump_file.read(reinterpret_cast(&abs_P[i]), sizeof(float)); @@ -409,10 +408,10 @@ int gps_l1_ca_dll_pll_c_aid_tracking_cc::save_matfile() } } dump_file.close(); - } + } catch (const std::ifstream::failure &e) - { - std::cerr << "Problem reading dump file:" << e.what() << std::endl; + { + std::cerr << "Problem reading dump file:" << e.what() << std::endl; delete[] abs_E; delete[] abs_P; delete[] abs_L; @@ -432,7 +431,7 @@ int gps_l1_ca_dll_pll_c_aid_tracking_cc::save_matfile() delete[] aux2; delete[] PRN; return 1; - } + } // WRITE MAT FILE mat_t *matfp; @@ -441,79 +440,79 @@ int gps_l1_ca_dll_pll_c_aid_tracking_cc::save_matfile() filename.erase(filename.length() - 4, 4); filename.append(".mat"); matfp = Mat_CreateVer(filename.c_str(), NULL, MAT_FT_MAT73); - if(reinterpret_cast(matfp) != NULL) + if (reinterpret_cast(matfp) != NULL) { size_t dims[2] = {1, static_cast(num_epoch)}; matvar = Mat_VarCreate("abs_E", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, abs_E, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("abs_P", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, abs_P, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("abs_L", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, abs_L, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("Prompt_I", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, Prompt_I, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("Prompt_Q", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, Prompt_Q, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("PRN_start_sample_count", MAT_C_UINT64, MAT_T_UINT64, 2, dims, PRN_start_sample_count, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("acc_carrier_phase_rad", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, acc_carrier_phase_rad, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("carrier_doppler_hz", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, carrier_doppler_hz, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("code_freq_chips", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, code_freq_chips, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("carr_error_hz", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, carr_error_hz, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("carr_error_filt_hz", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, carr_error_filt_hz, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("code_error_chips", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, code_error_chips, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("code_error_filt_chips", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, code_error_filt_chips, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("CN0_SNV_dB_Hz", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, CN0_SNV_dB_Hz, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("carrier_lock_test", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, carrier_lock_test, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("aux1", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, aux1, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("aux2", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, aux2, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("PRN", MAT_C_UINT32, MAT_T_UINT32, 2, dims, PRN, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); } Mat_Close(matfp); @@ -539,11 +538,11 @@ int gps_l1_ca_dll_pll_c_aid_tracking_cc::save_matfile() } -int gps_l1_ca_dll_pll_c_aid_tracking_cc::general_work (int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), - gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) +int gps_l1_ca_dll_pll_c_aid_tracking_cc::general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), + gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { // Block input data and block output stream pointers - const gr_complex* in = reinterpret_cast(input_items[0]); + const gr_complex *in = reinterpret_cast(input_items[0]); Gnss_Synchro **out = reinterpret_cast(&output_items[0]); // GNSS_SYNCHRO OBJECT to interchange data between tracking->telemetry_decoder @@ -568,31 +567,31 @@ int gps_l1_ca_dll_pll_c_aid_tracking_cc::general_work (int noutput_items __attri acq_trk_shif_correction_samples = d_correlation_length_samples - fmod(static_cast(acq_to_trk_delay_samples), static_cast(d_correlation_length_samples)); samples_offset = round(d_acq_code_phase_samples + acq_trk_shif_correction_samples); current_synchro_data.Tracking_sample_counter = d_sample_counter + samples_offset; - d_sample_counter += samples_offset; // count for the processed samples + d_sample_counter += samples_offset; // count for the processed samples d_pull_in = false; d_acc_carrier_phase_cycles -= d_carrier_phase_step_rad * samples_offset / GPS_TWO_PI; current_synchro_data.Carrier_phase_rads = d_acc_carrier_phase_cycles * GPS_TWO_PI; current_synchro_data.Carrier_Doppler_hz = d_carrier_doppler_hz; current_synchro_data.fs = d_fs_in; *out[0] = current_synchro_data; - consume_each(samples_offset); // shift input to perform alignment with local replica + consume_each(samples_offset); // shift input to perform alignment with local replica return 1; } // ################# CARRIER WIPEOFF AND CORRELATORS ############################## // perform carrier wipe-off and compute Early, Prompt and Late correlation - multicorrelator_cpu.set_input_output_vectors(d_correlator_outs,in); + multicorrelator_cpu.set_input_output_vectors(d_correlator_outs, in); multicorrelator_cpu.Carrier_wipeoff_multicorrelator_resampler(d_rem_carrier_phase_rad, - d_carrier_phase_step_rad, - d_rem_code_phase_chips, - d_code_phase_step_chips, - d_correlation_length_samples); + d_carrier_phase_step_rad, + d_rem_code_phase_chips, + d_code_phase_step_chips, + d_correlation_length_samples); // ####### coherent intergration extension // keep the last symbols - d_E_history.push_back(d_correlator_outs[0]); // save early output - d_P_history.push_back(d_correlator_outs[1]); // save prompt output - d_L_history.push_back(d_correlator_outs[2]); // save late output + d_E_history.push_back(d_correlator_outs[0]); // save early output + d_P_history.push_back(d_correlator_outs[1]); // save prompt output + d_L_history.push_back(d_correlator_outs[2]); // save late output if (static_cast(d_P_history.size()) > d_extend_correlation_ms) { @@ -610,9 +609,9 @@ int gps_l1_ca_dll_pll_c_aid_tracking_cc::general_work (int noutput_items __attri // compute coherent integration and enable tracking loop // perform coherent integration using correlator output history // std::cout<<"##### RESET COHERENT INTEGRATION ####"<PRN) + std::cout << "Enabled " << d_extend_correlation_ms << " [ms] extended correlator for CH " << d_channel << " : Satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << " pll_bw = " << d_pll_bw_hz << " [Hz], pll_narrow_bw = " << d_pll_bw_narrow_hz << " [Hz]" << std::endl << " dll_bw = " << d_dll_bw_hz << " [Hz], dll_narrow_bw = " << d_dll_bw_narrow_hz << " [Hz]" << std::endl; } @@ -636,7 +635,7 @@ int gps_l1_ca_dll_pll_c_aid_tracking_cc::general_work (int noutput_items __attri } else { - if(d_preamble_synchronized == true) + if (d_preamble_synchronized == true) { // continue extended coherent correlation // Compute the next buffer length based on the period of the PRN sequence and the code phase error estimation @@ -647,7 +646,7 @@ int gps_l1_ca_dll_pll_c_aid_tracking_cc::general_work (int noutput_items __attri double K_T_prn_error_samples = K_prn_samples - T_prn_samples; d_rem_code_phase_samples = d_rem_code_phase_samples - K_T_prn_error_samples; - d_rem_code_phase_integer_samples = round(d_rem_code_phase_samples); // round to a discrete number of samples + d_rem_code_phase_integer_samples = round(d_rem_code_phase_samples); // round to a discrete number of samples d_correlation_length_samples = K_prn_samples + d_rem_code_phase_integer_samples; d_rem_code_phase_samples = d_rem_code_phase_samples - d_rem_code_phase_integer_samples; // code phase step (Code resampler phase increment per sample) [chips/sample] @@ -684,7 +683,7 @@ int gps_l1_ca_dll_pll_c_aid_tracking_cc::general_work (int noutput_items __attri { // ################## PLL ########################################################## // Update PLL discriminator [rads/Ti -> Secs/Ti] - d_carr_phase_error_secs_Ti = pll_cloop_two_quadrant_atan(d_correlator_outs[1]) / GPS_TWO_PI; // prompt output + d_carr_phase_error_secs_Ti = pll_cloop_two_quadrant_atan(d_correlator_outs[1]) / GPS_TWO_PI; // prompt output // Carrier discriminator filter // NOTICE: The carrier loop filter includes the Carrier Doppler accumulator, as described in Kaplan // Input [s/Ti] -> output [Hz] @@ -696,11 +695,11 @@ int gps_l1_ca_dll_pll_c_aid_tracking_cc::general_work (int noutput_items __attri // ################## DLL ########################################################## // DLL discriminator - d_code_error_chips_Ti = dll_nc_e_minus_l_normalized(d_correlator_outs[0], d_correlator_outs[2]); // [chips/Ti] //early and late + d_code_error_chips_Ti = dll_nc_e_minus_l_normalized(d_correlator_outs[0], d_correlator_outs[2]); // [chips/Ti] //early and late // Code discriminator filter - d_code_error_filt_chips_s = d_code_loop_filter.get_code_nco(d_code_error_chips_Ti); // input [chips/Ti] -> output [chips/second] + d_code_error_filt_chips_s = d_code_loop_filter.get_code_nco(d_code_error_chips_Ti); // input [chips/Ti] -> output [chips/second] d_code_error_filt_chips_Ti = d_code_error_filt_chips_s * CURRENT_INTEGRATION_TIME_S; - code_error_filt_secs_Ti = d_code_error_filt_chips_Ti / d_code_freq_chips; // [s/Ti] + code_error_filt_secs_Ti = d_code_error_filt_chips_Ti / d_code_freq_chips; // [s/Ti] // ################## CARRIER AND CODE NCO BUFFER ALIGNEMENT ####################### // keep alignment parameters for the next input buffer @@ -711,12 +710,12 @@ int gps_l1_ca_dll_pll_c_aid_tracking_cc::general_work (int noutput_items __attri double K_prn_samples = round(T_prn_samples); double K_T_prn_error_samples = K_prn_samples - T_prn_samples; - d_rem_code_phase_samples = d_rem_code_phase_samples - K_T_prn_error_samples + code_error_filt_secs_Ti * static_cast(d_fs_in); //(code_error_filt_secs_Ti + d_pll_to_dll_assist_secs_Ti) * static_cast(d_fs_in); - d_rem_code_phase_integer_samples = round(d_rem_code_phase_samples); // round to a discrete number of samples + d_rem_code_phase_samples = d_rem_code_phase_samples - K_T_prn_error_samples + code_error_filt_secs_Ti * static_cast(d_fs_in); //(code_error_filt_secs_Ti + d_pll_to_dll_assist_secs_Ti) * static_cast(d_fs_in); + d_rem_code_phase_integer_samples = round(d_rem_code_phase_samples); // round to a discrete number of samples d_correlation_length_samples = K_prn_samples + d_rem_code_phase_integer_samples; d_rem_code_phase_samples = d_rem_code_phase_samples - d_rem_code_phase_integer_samples; - //################### PLL COMMANDS ################################################# + //################### PLL COMMANDS ################################################# //carrier phase step (NCO phase increment per sample) [rads/sample] d_carrier_phase_step_rad = GPS_TWO_PI * d_carrier_doppler_hz / static_cast(d_fs_in); d_acc_carrier_phase_cycles -= d_carrier_phase_step_rad * d_correlation_length_samples / GPS_TWO_PI; @@ -735,7 +734,7 @@ int gps_l1_ca_dll_pll_c_aid_tracking_cc::general_work (int noutput_items __attri if (d_cn0_estimation_counter < FLAGS_cn0_samples) { // fill buffer with prompt correlator output values - d_Prompt_buffer[d_cn0_estimation_counter] = d_correlator_outs[1]; // prompt + d_Prompt_buffer[d_cn0_estimation_counter] = d_correlator_outs[1]; // prompt d_cn0_estimation_counter++; } else @@ -758,9 +757,9 @@ int gps_l1_ca_dll_pll_c_aid_tracking_cc::general_work (int noutput_items __attri { std::cout << "Loss of lock in channel " << d_channel << "!" << std::endl; LOG(INFO) << "Loss of lock in channel " << d_channel << "!"; - this->message_port_pub(pmt::mp("events"), pmt::from_long(3));//3 -> loss of lock + this->message_port_pub(pmt::mp("events"), pmt::from_long(3)); //3 -> loss of lock d_carrier_lock_fail_counter = 0; - d_enable_tracking = false; // TODO: check if disabling tracking is consistent with the channel state machine + d_enable_tracking = false; // TODO: check if disabling tracking is consistent with the channel state machine } } // ########### Output the tracking data to navigation and PVT ########## @@ -788,7 +787,7 @@ int gps_l1_ca_dll_pll_c_aid_tracking_cc::general_work (int noutput_items __attri current_synchro_data.Tracking_sample_counter = d_sample_counter + d_correlation_length_samples; current_synchro_data.Code_phase_samples = d_rem_code_phase_samples; current_synchro_data.Carrier_phase_rads = GPS_TWO_PI * d_acc_carrier_phase_cycles; - current_synchro_data.Carrier_Doppler_hz = d_carrier_doppler_hz;// todo: project the carrier doppler + current_synchro_data.Carrier_Doppler_hz = d_carrier_doppler_hz; // todo: project the carrier doppler current_synchro_data.CN0_dB_hz = d_CN0_SNV_dB_Hz; } } @@ -796,7 +795,7 @@ int gps_l1_ca_dll_pll_c_aid_tracking_cc::general_work (int noutput_items __attri { for (int n = 0; n < d_n_correlator_taps; n++) { - d_correlator_outs[n] = gr_complex(0,0); + d_correlator_outs[n] = gr_complex(0, 0); } current_synchro_data.System = {'G'}; @@ -805,7 +804,7 @@ int gps_l1_ca_dll_pll_c_aid_tracking_cc::general_work (int noutput_items __attri //assign the GNURadio block output data current_synchro_data.fs = d_fs_in; *out[0] = current_synchro_data; - if(d_dump) + if (d_dump) { // MULTIPLEXED FILE RECORDING - Record results to file float prompt_I; @@ -818,61 +817,63 @@ int gps_l1_ca_dll_pll_c_aid_tracking_cc::general_work (int noutput_items __attri tmp_P = std::abs(d_correlator_outs[1]); tmp_L = std::abs(d_correlator_outs[2]); try - { + { // EPR - d_dump_file.write(reinterpret_cast(&tmp_E), sizeof(float)); - d_dump_file.write(reinterpret_cast(&tmp_P), sizeof(float)); - d_dump_file.write(reinterpret_cast(&tmp_L), sizeof(float)); + d_dump_file.write(reinterpret_cast(&tmp_E), sizeof(float)); + d_dump_file.write(reinterpret_cast(&tmp_P), sizeof(float)); + d_dump_file.write(reinterpret_cast(&tmp_L), sizeof(float)); // PROMPT I and Q (to analyze navigation symbols) - d_dump_file.write(reinterpret_cast(&prompt_I), sizeof(float)); - d_dump_file.write(reinterpret_cast(&prompt_Q), sizeof(float)); + d_dump_file.write(reinterpret_cast(&prompt_I), sizeof(float)); + d_dump_file.write(reinterpret_cast(&prompt_Q), sizeof(float)); // PRN start sample stamp //tmp_float=(float)d_sample_counter; - d_dump_file.write(reinterpret_cast(&d_sample_counter), sizeof(unsigned long int)); + d_dump_file.write(reinterpret_cast(&d_sample_counter), sizeof(unsigned long int)); // accumulated carrier phase - d_dump_file.write(reinterpret_cast(&d_acc_carrier_phase_cycles), sizeof(double)); + d_dump_file.write(reinterpret_cast(&d_acc_carrier_phase_cycles), sizeof(double)); // carrier and code frequency - d_dump_file.write(reinterpret_cast(&d_carrier_doppler_hz), sizeof(double)); - d_dump_file.write(reinterpret_cast(&d_code_freq_chips), sizeof(double)); + d_dump_file.write(reinterpret_cast(&d_carrier_doppler_hz), sizeof(double)); + d_dump_file.write(reinterpret_cast(&d_code_freq_chips), sizeof(double)); //PLL commands - d_dump_file.write(reinterpret_cast(&d_carr_phase_error_secs_Ti), sizeof(double)); - d_dump_file.write(reinterpret_cast(&d_carrier_doppler_hz), sizeof(double)); + d_dump_file.write(reinterpret_cast(&d_carr_phase_error_secs_Ti), sizeof(double)); + d_dump_file.write(reinterpret_cast(&d_carrier_doppler_hz), sizeof(double)); //DLL commands - d_dump_file.write(reinterpret_cast(&d_code_error_chips_Ti), sizeof(double)); - d_dump_file.write(reinterpret_cast(&d_code_error_filt_chips_Ti), sizeof(double)); + d_dump_file.write(reinterpret_cast(&d_code_error_chips_Ti), sizeof(double)); + d_dump_file.write(reinterpret_cast(&d_code_error_filt_chips_Ti), sizeof(double)); // CN0 and carrier lock test - d_dump_file.write(reinterpret_cast(&d_CN0_SNV_dB_Hz), sizeof(double)); - d_dump_file.write(reinterpret_cast(&d_carrier_lock_test), sizeof(double)); + d_dump_file.write(reinterpret_cast(&d_CN0_SNV_dB_Hz), sizeof(double)); + d_dump_file.write(reinterpret_cast(&d_carrier_lock_test), sizeof(double)); // AUX vars (for debug purposes) tmp_double = d_code_error_chips_Ti * CURRENT_INTEGRATION_TIME_S; - d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); + d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); tmp_double = static_cast(d_sample_counter + d_correlation_length_samples); - d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); + d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); // PRN unsigned int prn_ = d_acquisition_gnss_synchro->PRN; - d_dump_file.write(reinterpret_cast(&prn_), sizeof(unsigned int)); - } - catch (const std::ifstream::failure* e) - { + d_dump_file.write(reinterpret_cast(&prn_), sizeof(unsigned int)); + } + catch (const std::ifstream::failure *e) + { LOG(WARNING) << "Exception writing trk dump file " << e->what(); - } + } } - consume_each(d_correlation_length_samples); // this is necessary in gr::block derivates - d_sample_counter += d_correlation_length_samples; //count for the processed samples + consume_each(d_correlation_length_samples); // this is necessary in gr::block derivates + d_sample_counter += d_correlation_length_samples; //count for the processed samples if (d_enable_tracking) - { - return 1; - }else{ - return 0; - } + { + return 1; + } + else + { + return 0; + } } @@ -886,24 +887,23 @@ void gps_l1_ca_dll_pll_c_aid_tracking_cc::set_channel(unsigned int channel) if (d_dump_file.is_open() == false) { try - { + { d_dump_filename.append(boost::lexical_cast(d_channel)); d_dump_filename.append(".dat"); - d_dump_file.exceptions (std::ifstream::failbit | std::ifstream::badbit); + d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); LOG(INFO) << "Tracking dump enabled on channel " << d_channel << " Log file: " << d_dump_filename.c_str(); - } - catch (const std::ifstream::failure* e) - { + } + catch (const std::ifstream::failure *e) + { LOG(WARNING) << "channel " << d_channel << " Exception opening trk dump file " << e->what() << std::endl; - } + } } } } - -void gps_l1_ca_dll_pll_c_aid_tracking_cc::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) +void gps_l1_ca_dll_pll_c_aid_tracking_cc::set_gnss_synchro(Gnss_Synchro *p_gnss_synchro) { d_acquisition_gnss_synchro = p_gnss_synchro; } diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_cc.h b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_cc.h index 5be897069..24b468b20 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_cc.h +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_cc.h @@ -52,27 +52,25 @@ class gps_l1_ca_dll_pll_c_aid_tracking_cc; typedef boost::shared_ptr - gps_l1_ca_dll_pll_c_aid_tracking_cc_sptr; + gps_l1_ca_dll_pll_c_aid_tracking_cc_sptr; gps_l1_ca_dll_pll_c_aid_tracking_cc_sptr gps_l1_ca_dll_pll_c_aid_make_tracking_cc(long if_freq, - long fs_in, unsigned - int vector_length, - bool dump, - std::string dump_filename, - float pll_bw_hz, - float dll_bw_hz, - float pll_bw_narrow_hz, - float dll_bw_narrow_hz, - int extend_correlation_ms, - float early_late_space_chips); - + long fs_in, unsigned int vector_length, + bool dump, + std::string dump_filename, + float pll_bw_hz, + float dll_bw_hz, + float pll_bw_narrow_hz, + float dll_bw_narrow_hz, + int extend_correlation_ms, + float early_late_space_chips); /*! * \brief This class implements a DLL + PLL tracking loop block */ -class gps_l1_ca_dll_pll_c_aid_tracking_cc: public gr::block +class gps_l1_ca_dll_pll_c_aid_tracking_cc : public gr::block { public: ~gps_l1_ca_dll_pll_c_aid_tracking_cc(); @@ -81,36 +79,34 @@ public: void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro); void start_tracking(); - int general_work (int noutput_items, gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); + int general_work(int noutput_items, gr_vector_int& ninput_items, + gr_vector_const_void_star& input_items, gr_vector_void_star& output_items); - void forecast (int noutput_items, gr_vector_int &ninput_items_required); + void forecast(int noutput_items, gr_vector_int& ninput_items_required); private: friend gps_l1_ca_dll_pll_c_aid_tracking_cc_sptr gps_l1_ca_dll_pll_c_aid_make_tracking_cc(long if_freq, - long fs_in, unsigned - int vector_length, - bool dump, - std::string dump_filename, - float pll_bw_hz, - float dll_bw_hz, - float pll_bw_narrow_hz, - float dll_bw_narrow_hz, - int extend_correlation_ms, - float early_late_space_chips); + long fs_in, unsigned int vector_length, + bool dump, + std::string dump_filename, + float pll_bw_hz, + float dll_bw_hz, + float pll_bw_narrow_hz, + float dll_bw_narrow_hz, + int extend_correlation_ms, + float early_late_space_chips); gps_l1_ca_dll_pll_c_aid_tracking_cc(long if_freq, - long fs_in, unsigned - int vector_length, - bool dump, - std::string dump_filename, - float pll_bw_hz, - float dll_bw_hz, - float pll_bw_narrow_hz, - float dll_bw_narrow_hz, - int extend_correlation_ms, - float early_late_space_chips); + long fs_in, unsigned int vector_length, + bool dump, + std::string dump_filename, + float pll_bw_hz, + float dll_bw_hz, + float pll_bw_narrow_hz, + float dll_bw_narrow_hz, + int extend_correlation_ms, + float early_late_space_chips); // tracking configuration vars unsigned int d_vector_length; @@ -200,4 +196,4 @@ private: int save_matfile(); }; -#endif //GNSS_SDR_GPS_L1_CA_DLL_PLL_C_AID_TRACKING_CC_H +#endif //GNSS_SDR_GPS_L1_CA_DLL_PLL_C_AID_TRACKING_CC_H diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_sc.cc b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_sc.cc index e2d57bbf6..b2be59bae 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_sc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_sc.cc @@ -53,30 +53,29 @@ using google::LogMessage; gps_l1_ca_dll_pll_c_aid_tracking_sc_sptr gps_l1_ca_dll_pll_c_aid_make_tracking_sc( - long if_freq, - long fs_in, - unsigned int vector_length, - bool dump, - std::string dump_filename, - float pll_bw_hz, - float dll_bw_hz, - float pll_bw_narrow_hz, - float dll_bw_narrow_hz, - int extend_correlation_ms, - float early_late_space_chips) + long if_freq, + long fs_in, + unsigned int vector_length, + bool dump, + std::string dump_filename, + float pll_bw_hz, + float dll_bw_hz, + float pll_bw_narrow_hz, + float dll_bw_narrow_hz, + int extend_correlation_ms, + float early_late_space_chips) { return gps_l1_ca_dll_pll_c_aid_tracking_sc_sptr(new gps_l1_ca_dll_pll_c_aid_tracking_sc(if_freq, - fs_in, vector_length, dump, dump_filename, pll_bw_hz, dll_bw_hz, pll_bw_narrow_hz, dll_bw_narrow_hz, extend_correlation_ms, early_late_space_chips)); + fs_in, vector_length, dump, dump_filename, pll_bw_hz, dll_bw_hz, pll_bw_narrow_hz, dll_bw_narrow_hz, extend_correlation_ms, early_late_space_chips)); } - -void gps_l1_ca_dll_pll_c_aid_tracking_sc::forecast (int noutput_items, - gr_vector_int &ninput_items_required) +void gps_l1_ca_dll_pll_c_aid_tracking_sc::forecast(int noutput_items, + gr_vector_int &ninput_items_required) { if (noutput_items != 0) { - ninput_items_required[0] = static_cast(d_vector_length) * 2; //set the required available samples in each call + ninput_items_required[0] = static_cast(d_vector_length) * 2; //set the required available samples in each call } } @@ -84,8 +83,8 @@ void gps_l1_ca_dll_pll_c_aid_tracking_sc::forecast (int noutput_items, void gps_l1_ca_dll_pll_c_aid_tracking_sc::msg_handler_preamble_index(pmt::pmt_t msg) { //pmt::print(msg); - DLOG(INFO) << "Extended correlation enabled for Tracking CH " << d_channel << ": Satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN); - if (d_enable_extended_integration == false) //avoid re-setting preamble indicator + DLOG(INFO) << "Extended correlation enabled for Tracking CH " << d_channel << ": Satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN); + if (d_enable_extended_integration == false) //avoid re-setting preamble indicator { d_preamble_timestamp_s = pmt::to_double(msg); d_enable_extended_integration = true; @@ -94,24 +93,23 @@ void gps_l1_ca_dll_pll_c_aid_tracking_sc::msg_handler_preamble_index(pmt::pmt_t } gps_l1_ca_dll_pll_c_aid_tracking_sc::gps_l1_ca_dll_pll_c_aid_tracking_sc( - long if_freq, - long fs_in, - unsigned int vector_length, - bool dump, - std::string dump_filename, - float pll_bw_hz, - float dll_bw_hz, - float pll_bw_narrow_hz, - float dll_bw_narrow_hz, - int extend_correlation_ms, - float early_late_space_chips) : - gr::block("gps_l1_ca_dll_pll_c_aid_tracking_sc", gr::io_signature::make(1, 1, sizeof(lv_16sc_t)), - gr::io_signature::make(1, 1, sizeof(Gnss_Synchro))) + long if_freq, + long fs_in, + unsigned int vector_length, + bool dump, + std::string dump_filename, + float pll_bw_hz, + float dll_bw_hz, + float pll_bw_narrow_hz, + float dll_bw_narrow_hz, + int extend_correlation_ms, + float early_late_space_chips) : gr::block("gps_l1_ca_dll_pll_c_aid_tracking_sc", gr::io_signature::make(1, 1, sizeof(lv_16sc_t)), + gr::io_signature::make(1, 1, sizeof(Gnss_Synchro))) { // Telemetry bit synchronization message port input this->message_port_register_in(pmt::mp("preamble_timestamp_s")); this->set_msg_handler(pmt::mp("preamble_timestamp_s"), - boost::bind(&gps_l1_ca_dll_pll_c_aid_tracking_sc::msg_handler_preamble_index, this, _1)); + boost::bind(&gps_l1_ca_dll_pll_c_aid_tracking_sc::msg_handler_preamble_index, this, _1)); this->message_port_register_out(pmt::mp("events")); // initialize internal vars d_dump = dump; @@ -131,25 +129,25 @@ gps_l1_ca_dll_pll_c_aid_tracking_sc::gps_l1_ca_dll_pll_c_aid_tracking_sc( d_extend_correlation_ms = extend_correlation_ms; // --- DLL variables -------------------------------------------------------- - d_early_late_spc_chips = early_late_space_chips; // Define early-late offset (in chips) + d_early_late_spc_chips = early_late_space_chips; // Define early-late offset (in chips) // Initialization of local code replica // Get space for a vector with the C/A code replica sampled 1x/chip - d_ca_code = static_cast(volk_gnsssdr_malloc(static_cast(GPS_L1_CA_CODE_LENGTH_CHIPS) * sizeof(gr_complex), volk_gnsssdr_get_alignment())); - d_ca_code_16sc = static_cast(volk_gnsssdr_malloc(static_cast(GPS_L1_CA_CODE_LENGTH_CHIPS) * sizeof(lv_16sc_t), volk_gnsssdr_get_alignment())); + d_ca_code = static_cast(volk_gnsssdr_malloc(static_cast(GPS_L1_CA_CODE_LENGTH_CHIPS) * sizeof(gr_complex), volk_gnsssdr_get_alignment())); + d_ca_code_16sc = static_cast(volk_gnsssdr_malloc(static_cast(GPS_L1_CA_CODE_LENGTH_CHIPS) * sizeof(lv_16sc_t), volk_gnsssdr_get_alignment())); // correlator outputs (scalar) - d_n_correlator_taps = 3; // Early, Prompt, and Late + d_n_correlator_taps = 3; // Early, Prompt, and Late - d_correlator_outs_16sc = static_cast(volk_gnsssdr_malloc(d_n_correlator_taps*sizeof(lv_16sc_t), volk_gnsssdr_get_alignment())); + d_correlator_outs_16sc = static_cast(volk_gnsssdr_malloc(d_n_correlator_taps * sizeof(lv_16sc_t), volk_gnsssdr_get_alignment())); for (int n = 0; n < d_n_correlator_taps; n++) { - d_correlator_outs_16sc[n] = lv_cmake(0,0); + d_correlator_outs_16sc[n] = lv_cmake(0, 0); } - d_local_code_shift_chips = static_cast(volk_gnsssdr_malloc(d_n_correlator_taps*sizeof(float), volk_gnsssdr_get_alignment())); + d_local_code_shift_chips = static_cast(volk_gnsssdr_malloc(d_n_correlator_taps * sizeof(float), volk_gnsssdr_get_alignment())); // Set TAPs delay values [chips] - d_local_code_shift_chips[0] = - d_early_late_spc_chips; + d_local_code_shift_chips[0] = -d_early_late_spc_chips; d_local_code_shift_chips[1] = 0.0; d_local_code_shift_chips[2] = d_early_late_spc_chips; @@ -164,7 +162,7 @@ gps_l1_ca_dll_pll_c_aid_tracking_sc::gps_l1_ca_dll_pll_c_aid_tracking_sc( d_rem_carrier_phase_rad = 0.0; // sample synchronization - d_sample_counter = 0; //(from trk to tlm) + d_sample_counter = 0; //(from trk to tlm) d_acq_sample_stamp = 0; d_enable_tracking = false; d_pull_in = false; @@ -216,7 +214,7 @@ void gps_l1_ca_dll_pll_c_aid_tracking_sc::start_tracking() long int acq_trk_diff_samples; double acq_trk_diff_seconds; - acq_trk_diff_samples = static_cast(d_sample_counter) - static_cast(d_acq_sample_stamp);//-d_vector_length; + acq_trk_diff_samples = static_cast(d_sample_counter) - static_cast(d_acq_sample_stamp); //-d_vector_length; DLOG(INFO) << "Number of samples between Acquisition and Tracking =" << acq_trk_diff_samples; acq_trk_diff_seconds = static_cast(acq_trk_diff_samples) / static_cast(d_fs_in); // Doppler effect @@ -253,8 +251,8 @@ void gps_l1_ca_dll_pll_c_aid_tracking_sc::start_tracking() d_carrier_phase_step_rad = GPS_TWO_PI * d_carrier_doppler_hz / static_cast(d_fs_in); // DLL/PLL filter initialization - d_carrier_loop_filter.initialize(d_acq_carrier_doppler_hz); // The carrier loop filter implements the Doppler accumulator - d_code_loop_filter.initialize(); // initialize the code filter + d_carrier_loop_filter.initialize(d_acq_carrier_doppler_hz); // The carrier loop filter implements the Doppler accumulator + d_code_loop_filter.initialize(); // initialize the code filter // generate local reference ALWAYS starting at chip 1 (1 sample per chip) gps_l1_ca_code_gen_complex(d_ca_code, d_acquisition_gnss_synchro->PRN, 0); @@ -263,7 +261,7 @@ void gps_l1_ca_dll_pll_c_aid_tracking_sc::start_tracking() multicorrelator_cpu_16sc.set_local_code_and_taps(static_cast(GPS_L1_CA_CODE_LENGTH_CHIPS), d_ca_code_16sc, d_local_code_shift_chips); for (int n = 0; n < d_n_correlator_taps; n++) { - d_correlator_outs_16sc[n] = lv_16sc_t(0,0); + d_correlator_outs_16sc[n] = lv_16sc_t(0, 0); } d_carrier_lock_fail_counter = 0; @@ -275,7 +273,7 @@ void gps_l1_ca_dll_pll_c_aid_tracking_sc::start_tracking() d_code_phase_samples = d_acq_code_phase_samples; std::string sys_ = &d_acquisition_gnss_synchro->System; - sys = sys_.substr(0,1); + sys = sys_.substr(0, 1); // DEBUG OUTPUT std::cout << "Tracking of GPS L1 C/A signal started on channel " << d_channel << " for satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << std::endl; @@ -288,8 +286,8 @@ void gps_l1_ca_dll_pll_c_aid_tracking_sc::start_tracking() d_preamble_synchronized = false; LOG(INFO) << "PULL-IN Doppler [Hz]=" << d_carrier_doppler_hz - << " Code Phase correction [samples]=" << delay_correction_samples - << " PULL-IN Code Phase [samples]=" << d_acq_code_phase_samples; + << " Code Phase correction [samples]=" << delay_correction_samples + << " PULL-IN Code Phase [samples]=" << d_acq_code_phase_samples; } @@ -298,42 +296,41 @@ gps_l1_ca_dll_pll_c_aid_tracking_sc::~gps_l1_ca_dll_pll_c_aid_tracking_sc() if (d_dump_file.is_open()) { try - { + { d_dump_file.close(); - } - catch(const std::exception & ex) - { + } + catch (const std::exception &ex) + { LOG(WARNING) << "Exception in destructor " << ex.what(); - } + } } - if(d_dump) + if (d_dump) { - if(d_channel == 0) + if (d_channel == 0) { std::cout << "Writing .mat files ..."; } gps_l1_ca_dll_pll_c_aid_tracking_sc::save_matfile(); - if(d_channel == 0) + if (d_channel == 0) { std::cout << " done." << std::endl; } } try - { + { volk_gnsssdr_free(d_local_code_shift_chips); volk_gnsssdr_free(d_ca_code); volk_gnsssdr_free(d_ca_code_16sc); volk_gnsssdr_free(d_correlator_outs_16sc); delete[] d_Prompt_buffer; multicorrelator_cpu_16sc.free(); - } - catch(const std::exception & ex) - { + } + catch (const std::exception &ex) + { LOG(WARNING) << "Exception in destructor " << ex.what(); - } - + } } @@ -344,18 +341,18 @@ int gps_l1_ca_dll_pll_c_aid_tracking_sc::save_matfile() int number_of_double_vars = 11; int number_of_float_vars = 5; int epoch_size_bytes = sizeof(unsigned long int) + sizeof(double) * number_of_double_vars + - sizeof(float) * number_of_float_vars + sizeof(unsigned int); + sizeof(float) * number_of_float_vars + sizeof(unsigned int); std::ifstream dump_file; dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); try - { + { dump_file.open(d_dump_filename.c_str(), std::ios::binary | std::ios::ate); - } - catch(const std::ifstream::failure &e) - { - std::cerr << "Problem opening dump file:" << e.what() << std::endl; + } + catch (const std::ifstream::failure &e) + { + std::cerr << "Problem opening dump file:" << e.what() << std::endl; return 1; - } + } // count number of epochs and rewind long int num_epoch = 0; if (dump_file.is_open()) @@ -368,30 +365,30 @@ int gps_l1_ca_dll_pll_c_aid_tracking_sc::save_matfile() { return 1; } - float * abs_E = new float [num_epoch]; - float * abs_P = new float [num_epoch]; - float * abs_L = new float [num_epoch]; - float * Prompt_I = new float [num_epoch]; - float * Prompt_Q = new float [num_epoch]; - unsigned long int * PRN_start_sample_count = new unsigned long int [num_epoch]; - double * acc_carrier_phase_rad = new double [num_epoch]; - double * carrier_doppler_hz = new double [num_epoch]; - double * code_freq_chips = new double [num_epoch]; - double * carr_error_hz = new double [num_epoch]; - double * carr_error_filt_hz = new double [num_epoch]; - double * code_error_chips = new double [num_epoch]; - double * code_error_filt_chips = new double [num_epoch]; - double * CN0_SNV_dB_Hz = new double [num_epoch]; - double * carrier_lock_test = new double [num_epoch]; - double * aux1 = new double [num_epoch]; - double * aux2 = new double [num_epoch]; - unsigned int * PRN = new unsigned int [num_epoch]; + float *abs_E = new float[num_epoch]; + float *abs_P = new float[num_epoch]; + float *abs_L = new float[num_epoch]; + float *Prompt_I = new float[num_epoch]; + float *Prompt_Q = new float[num_epoch]; + unsigned long int *PRN_start_sample_count = new unsigned long int[num_epoch]; + double *acc_carrier_phase_rad = new double[num_epoch]; + double *carrier_doppler_hz = new double[num_epoch]; + double *code_freq_chips = new double[num_epoch]; + double *carr_error_hz = new double[num_epoch]; + double *carr_error_filt_hz = new double[num_epoch]; + double *code_error_chips = new double[num_epoch]; + double *code_error_filt_chips = new double[num_epoch]; + double *CN0_SNV_dB_Hz = new double[num_epoch]; + double *carrier_lock_test = new double[num_epoch]; + double *aux1 = new double[num_epoch]; + double *aux2 = new double[num_epoch]; + unsigned int *PRN = new unsigned int[num_epoch]; try - { + { if (dump_file.is_open()) { - for(long int i = 0; i < num_epoch; i++) + for (long int i = 0; i < num_epoch; i++) { dump_file.read(reinterpret_cast(&abs_E[i]), sizeof(float)); dump_file.read(reinterpret_cast(&abs_P[i]), sizeof(float)); @@ -414,10 +411,10 @@ int gps_l1_ca_dll_pll_c_aid_tracking_sc::save_matfile() } } dump_file.close(); - } + } catch (const std::ifstream::failure &e) - { - std::cerr << "Problem reading dump file:" << e.what() << std::endl; + { + std::cerr << "Problem reading dump file:" << e.what() << std::endl; delete[] abs_E; delete[] abs_P; delete[] abs_L; @@ -437,7 +434,7 @@ int gps_l1_ca_dll_pll_c_aid_tracking_sc::save_matfile() delete[] aux2; delete[] PRN; return 1; - } + } // WRITE MAT FILE mat_t *matfp; @@ -446,79 +443,79 @@ int gps_l1_ca_dll_pll_c_aid_tracking_sc::save_matfile() filename.erase(filename.length() - 4, 4); filename.append(".mat"); matfp = Mat_CreateVer(filename.c_str(), NULL, MAT_FT_MAT73); - if(reinterpret_cast(matfp) != NULL) + if (reinterpret_cast(matfp) != NULL) { size_t dims[2] = {1, static_cast(num_epoch)}; matvar = Mat_VarCreate("abs_E", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, abs_E, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("abs_P", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, abs_P, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("abs_L", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, abs_L, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("Prompt_I", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, Prompt_I, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("Prompt_Q", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, Prompt_Q, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("PRN_start_sample_count", MAT_C_UINT64, MAT_T_UINT64, 2, dims, PRN_start_sample_count, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("acc_carrier_phase_rad", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, acc_carrier_phase_rad, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("carrier_doppler_hz", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, carrier_doppler_hz, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("code_freq_chips", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, code_freq_chips, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("carr_error_hz", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, carr_error_hz, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("carr_error_filt_hz", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, carr_error_filt_hz, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("code_error_chips", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, code_error_chips, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("code_error_filt_chips", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, code_error_filt_chips, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("CN0_SNV_dB_Hz", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, CN0_SNV_dB_Hz, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("carrier_lock_test", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, carrier_lock_test, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("aux1", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, aux1, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("aux2", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, aux2, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("PRN", MAT_C_UINT32, MAT_T_UINT32, 2, dims, PRN, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); } Mat_Close(matfp); @@ -544,11 +541,11 @@ int gps_l1_ca_dll_pll_c_aid_tracking_sc::save_matfile() } -int gps_l1_ca_dll_pll_c_aid_tracking_sc::general_work (int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), - gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) +int gps_l1_ca_dll_pll_c_aid_tracking_sc::general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), + gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { // Block input data and block output stream pointers - const lv_16sc_t* in = reinterpret_cast(input_items[0]); //PRN start block alignment + const lv_16sc_t *in = reinterpret_cast(input_items[0]); //PRN start block alignment Gnss_Synchro **out = reinterpret_cast(&output_items[0]); // GNSS_SYNCHRO OBJECT to interchange data between tracking->telemetry_decoder @@ -573,14 +570,14 @@ int gps_l1_ca_dll_pll_c_aid_tracking_sc::general_work (int noutput_items __attri acq_trk_shif_correction_samples = d_correlation_length_samples - fmod(static_cast(acq_to_trk_delay_samples), static_cast(d_correlation_length_samples)); samples_offset = round(d_acq_code_phase_samples + acq_trk_shif_correction_samples); current_synchro_data.Tracking_sample_counter = d_sample_counter + samples_offset; - d_sample_counter += samples_offset; // count for the processed samples + d_sample_counter += samples_offset; // count for the processed samples d_pull_in = false; d_acc_carrier_phase_cycles -= d_carrier_phase_step_rad * samples_offset / GPS_TWO_PI; current_synchro_data.Carrier_phase_rads = d_acc_carrier_phase_cycles * GPS_TWO_PI; current_synchro_data.Carrier_Doppler_hz = d_carrier_doppler_hz; current_synchro_data.fs = d_fs_in; *out[0] = current_synchro_data; - consume_each(samples_offset); // shift input to perform alignment with local replica + consume_each(samples_offset); // shift input to perform alignment with local replica return 1; } @@ -595,9 +592,9 @@ int gps_l1_ca_dll_pll_c_aid_tracking_sc::general_work (int noutput_items __attri // ####### coherent intergration extension // keep the last symbols - d_E_history.push_back(d_correlator_outs_16sc[0]); // save early output - d_P_history.push_back(d_correlator_outs_16sc[1]); // save prompt output - d_L_history.push_back(d_correlator_outs_16sc[2]); // save late output + d_E_history.push_back(d_correlator_outs_16sc[0]); // save early output + d_P_history.push_back(d_correlator_outs_16sc[1]); // save prompt output + d_L_history.push_back(d_correlator_outs_16sc[2]); // save late output if (static_cast(d_P_history.size()) > d_extend_correlation_ms) { @@ -615,9 +612,9 @@ int gps_l1_ca_dll_pll_c_aid_tracking_sc::general_work (int noutput_items __attri // compute coherent integration and enable tracking loop // perform coherent integration using correlator output history // std::cout<<"##### RESET COHERENT INTEGRATION ####"<PRN) + std::cout << "Enabled " << d_extend_correlation_ms << " [ms] extended correlator for CH " << d_channel << " : Satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << " pll_bw = " << d_pll_bw_hz << " [Hz], pll_narrow_bw = " << d_pll_bw_narrow_hz << " [Hz]" << std::endl << " dll_bw = " << d_dll_bw_hz << " [Hz], dll_narrow_bw = " << d_dll_bw_narrow_hz << " [Hz]" << std::endl; } @@ -640,7 +637,7 @@ int gps_l1_ca_dll_pll_c_aid_tracking_sc::general_work (int noutput_items __attri } else { - if(d_preamble_synchronized == true) + if (d_preamble_synchronized == true) { // continue extended coherent correlation // Compute the next buffer length based on the period of the PRN sequence and the code phase error estimation @@ -651,7 +648,7 @@ int gps_l1_ca_dll_pll_c_aid_tracking_sc::general_work (int noutput_items __attri double K_T_prn_error_samples = K_prn_samples - T_prn_samples; d_rem_code_phase_samples = d_rem_code_phase_samples - K_T_prn_error_samples; - d_rem_code_phase_integer_samples = round(d_rem_code_phase_samples); // round to a discrete number of samples + d_rem_code_phase_integer_samples = round(d_rem_code_phase_samples); // round to a discrete number of samples d_correlation_length_samples = K_prn_samples + d_rem_code_phase_integer_samples; d_rem_code_phase_samples = d_rem_code_phase_samples - d_rem_code_phase_integer_samples; // code phase step (Code resampler phase increment per sample) [chips/sample] @@ -687,7 +684,7 @@ int gps_l1_ca_dll_pll_c_aid_tracking_sc::general_work (int noutput_items __attri { // ################## PLL ########################################################## // Update PLL discriminator [rads/Ti -> Secs/Ti] - d_carr_phase_error_secs_Ti = pll_cloop_two_quadrant_atan(std::complex(d_correlator_outs_16sc[1].real(),d_correlator_outs_16sc[1].imag())) / GPS_TWO_PI; //prompt output + d_carr_phase_error_secs_Ti = pll_cloop_two_quadrant_atan(std::complex(d_correlator_outs_16sc[1].real(), d_correlator_outs_16sc[1].imag())) / GPS_TWO_PI; //prompt output // Carrier discriminator filter // NOTICE: The carrier loop filter includes the Carrier Doppler accumulator, as described in Kaplan @@ -700,11 +697,11 @@ int gps_l1_ca_dll_pll_c_aid_tracking_sc::general_work (int noutput_items __attri // ################## DLL ########################################################## // DLL discriminator - d_code_error_chips_Ti = dll_nc_e_minus_l_normalized(std::complex(d_correlator_outs_16sc[0].real(),d_correlator_outs_16sc[0].imag()), std::complex(d_correlator_outs_16sc[2].real(),d_correlator_outs_16sc[2].imag())); // [chips/Ti] //early and late + d_code_error_chips_Ti = dll_nc_e_minus_l_normalized(std::complex(d_correlator_outs_16sc[0].real(), d_correlator_outs_16sc[0].imag()), std::complex(d_correlator_outs_16sc[2].real(), d_correlator_outs_16sc[2].imag())); // [chips/Ti] //early and late // Code discriminator filter - d_code_error_filt_chips_s = d_code_loop_filter.get_code_nco(d_code_error_chips_Ti); // input [chips/Ti] -> output [chips/second] + d_code_error_filt_chips_s = d_code_loop_filter.get_code_nco(d_code_error_chips_Ti); // input [chips/Ti] -> output [chips/second] d_code_error_filt_chips_Ti = d_code_error_filt_chips_s * CURRENT_INTEGRATION_TIME_S; - code_error_filt_secs_Ti = d_code_error_filt_chips_Ti / d_code_freq_chips; // [s/Ti] + code_error_filt_secs_Ti = d_code_error_filt_chips_Ti / d_code_freq_chips; // [s/Ti] // ################## CARRIER AND CODE NCO BUFFER ALIGNEMENT ####################### // keep alignment parameters for the next input buffer @@ -715,12 +712,12 @@ int gps_l1_ca_dll_pll_c_aid_tracking_sc::general_work (int noutput_items __attri double K_prn_samples = round(T_prn_samples); double K_T_prn_error_samples = K_prn_samples - T_prn_samples; - d_rem_code_phase_samples = d_rem_code_phase_samples - K_T_prn_error_samples + code_error_filt_secs_Ti * static_cast(d_fs_in); //(code_error_filt_secs_Ti + d_pll_to_dll_assist_secs_Ti) * static_cast(d_fs_in); - d_rem_code_phase_integer_samples = round(d_rem_code_phase_samples); // round to a discrete number of samples + d_rem_code_phase_samples = d_rem_code_phase_samples - K_T_prn_error_samples + code_error_filt_secs_Ti * static_cast(d_fs_in); //(code_error_filt_secs_Ti + d_pll_to_dll_assist_secs_Ti) * static_cast(d_fs_in); + d_rem_code_phase_integer_samples = round(d_rem_code_phase_samples); // round to a discrete number of samples d_correlation_length_samples = K_prn_samples + d_rem_code_phase_integer_samples; d_rem_code_phase_samples = d_rem_code_phase_samples - d_rem_code_phase_integer_samples; - //################### PLL COMMANDS ################################################# + //################### PLL COMMANDS ################################################# //carrier phase step (NCO phase increment per sample) [rads/sample] d_carrier_phase_step_rad = GPS_TWO_PI * d_carrier_doppler_hz / static_cast(d_fs_in); d_acc_carrier_phase_cycles -= d_carrier_phase_step_rad * d_correlation_length_samples / GPS_TWO_PI; @@ -739,7 +736,7 @@ int gps_l1_ca_dll_pll_c_aid_tracking_sc::general_work (int noutput_items __attri if (d_cn0_estimation_counter < FLAGS_cn0_samples) { // fill buffer with prompt correlator output values - d_Prompt_buffer[d_cn0_estimation_counter] = lv_cmake(static_cast(d_correlator_outs_16sc[1].real()), static_cast(d_correlator_outs_16sc[1].imag()) ); // prompt + d_Prompt_buffer[d_cn0_estimation_counter] = lv_cmake(static_cast(d_correlator_outs_16sc[1].real()), static_cast(d_correlator_outs_16sc[1].imag())); // prompt d_cn0_estimation_counter++; } else @@ -762,9 +759,9 @@ int gps_l1_ca_dll_pll_c_aid_tracking_sc::general_work (int noutput_items __attri { std::cout << "Loss of lock in channel " << d_channel << "!" << std::endl; LOG(INFO) << "Loss of lock in channel " << d_channel << "!"; - this->message_port_pub(pmt::mp("events"), pmt::from_long(3));//3 -> loss of lock + this->message_port_pub(pmt::mp("events"), pmt::from_long(3)); //3 -> loss of lock d_carrier_lock_fail_counter = 0; - d_enable_tracking = false; // TODO: check if disabling tracking is consistent with the channel state machine + d_enable_tracking = false; // TODO: check if disabling tracking is consistent with the channel state machine } } // ########### Output the tracking data to navigation and PVT ########## @@ -793,7 +790,7 @@ int gps_l1_ca_dll_pll_c_aid_tracking_sc::general_work (int noutput_items __attri current_synchro_data.Tracking_sample_counter = d_sample_counter + d_correlation_length_samples; current_synchro_data.Code_phase_samples = d_rem_code_phase_samples; current_synchro_data.Carrier_phase_rads = GPS_TWO_PI * d_acc_carrier_phase_cycles; - current_synchro_data.Carrier_Doppler_hz = d_carrier_doppler_hz;// todo: project the carrier doppler + current_synchro_data.Carrier_Doppler_hz = d_carrier_doppler_hz; // todo: project the carrier doppler current_synchro_data.CN0_dB_hz = d_CN0_SNV_dB_Hz; } } @@ -801,7 +798,7 @@ int gps_l1_ca_dll_pll_c_aid_tracking_sc::general_work (int noutput_items __attri { for (int n = 0; n < d_n_correlator_taps; n++) { - d_correlator_outs_16sc[n] = lv_cmake(0,0); + d_correlator_outs_16sc[n] = lv_cmake(0, 0); } current_synchro_data.System = {'G'}; @@ -809,7 +806,7 @@ int gps_l1_ca_dll_pll_c_aid_tracking_sc::general_work (int noutput_items __attri } current_synchro_data.fs = d_fs_in; *out[0] = current_synchro_data; - if(d_dump) + if (d_dump) { // MULTIPLEXED FILE RECORDING - Record results to file float prompt_I; @@ -818,65 +815,67 @@ int gps_l1_ca_dll_pll_c_aid_tracking_sc::general_work (int noutput_items __attri double tmp_double; prompt_I = d_correlator_outs_16sc[1].real(); prompt_Q = d_correlator_outs_16sc[1].imag(); - tmp_E = std::abs(std::complex(d_correlator_outs_16sc[0].real(),d_correlator_outs_16sc[0].imag())); - tmp_P = std::abs(std::complex(d_correlator_outs_16sc[1].real(),d_correlator_outs_16sc[1].imag())); - tmp_L = std::abs(std::complex(d_correlator_outs_16sc[2].real(),d_correlator_outs_16sc[2].imag())); + tmp_E = std::abs(std::complex(d_correlator_outs_16sc[0].real(), d_correlator_outs_16sc[0].imag())); + tmp_P = std::abs(std::complex(d_correlator_outs_16sc[1].real(), d_correlator_outs_16sc[1].imag())); + tmp_L = std::abs(std::complex(d_correlator_outs_16sc[2].real(), d_correlator_outs_16sc[2].imag())); try - { + { // EPR - d_dump_file.write(reinterpret_cast(&tmp_E), sizeof(float)); - d_dump_file.write(reinterpret_cast(&tmp_P), sizeof(float)); - d_dump_file.write(reinterpret_cast(&tmp_L), sizeof(float)); + d_dump_file.write(reinterpret_cast(&tmp_E), sizeof(float)); + d_dump_file.write(reinterpret_cast(&tmp_P), sizeof(float)); + d_dump_file.write(reinterpret_cast(&tmp_L), sizeof(float)); // PROMPT I and Q (to analyze navigation symbols) - d_dump_file.write(reinterpret_cast(&prompt_I), sizeof(float)); - d_dump_file.write(reinterpret_cast(&prompt_Q), sizeof(float)); + d_dump_file.write(reinterpret_cast(&prompt_I), sizeof(float)); + d_dump_file.write(reinterpret_cast(&prompt_Q), sizeof(float)); // PRN start sample stamp //tmp_float=(float)d_sample_counter; - d_dump_file.write(reinterpret_cast(&d_sample_counter), sizeof(unsigned long int)); + d_dump_file.write(reinterpret_cast(&d_sample_counter), sizeof(unsigned long int)); // accumulated carrier phase - d_dump_file.write(reinterpret_cast(&d_acc_carrier_phase_cycles), sizeof(double)); + d_dump_file.write(reinterpret_cast(&d_acc_carrier_phase_cycles), sizeof(double)); // carrier and code frequency - d_dump_file.write(reinterpret_cast(&d_carrier_doppler_hz), sizeof(double)); - d_dump_file.write(reinterpret_cast(&d_code_freq_chips), sizeof(double)); + d_dump_file.write(reinterpret_cast(&d_carrier_doppler_hz), sizeof(double)); + d_dump_file.write(reinterpret_cast(&d_code_freq_chips), sizeof(double)); //PLL commands - d_dump_file.write(reinterpret_cast(&d_carr_phase_error_secs_Ti), sizeof(double)); - d_dump_file.write(reinterpret_cast(&d_carrier_doppler_hz), sizeof(double)); + d_dump_file.write(reinterpret_cast(&d_carr_phase_error_secs_Ti), sizeof(double)); + d_dump_file.write(reinterpret_cast(&d_carrier_doppler_hz), sizeof(double)); //DLL commands - d_dump_file.write(reinterpret_cast(&d_code_error_chips_Ti), sizeof(double)); - d_dump_file.write(reinterpret_cast(&d_code_error_filt_chips_Ti), sizeof(double)); + d_dump_file.write(reinterpret_cast(&d_code_error_chips_Ti), sizeof(double)); + d_dump_file.write(reinterpret_cast(&d_code_error_filt_chips_Ti), sizeof(double)); // CN0 and carrier lock test - d_dump_file.write(reinterpret_cast(&d_CN0_SNV_dB_Hz), sizeof(double)); - d_dump_file.write(reinterpret_cast(&d_carrier_lock_test), sizeof(double)); + d_dump_file.write(reinterpret_cast(&d_CN0_SNV_dB_Hz), sizeof(double)); + d_dump_file.write(reinterpret_cast(&d_carrier_lock_test), sizeof(double)); // AUX vars (for debug purposes) tmp_double = d_code_error_chips_Ti * CURRENT_INTEGRATION_TIME_S; - d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); + d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); tmp_double = static_cast(d_sample_counter + d_correlation_length_samples); - d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); + d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); // PRN unsigned int prn_ = d_acquisition_gnss_synchro->PRN; - d_dump_file.write(reinterpret_cast(&prn_), sizeof(unsigned int)); - } - catch (const std::ifstream::failure* e) - { + d_dump_file.write(reinterpret_cast(&prn_), sizeof(unsigned int)); + } + catch (const std::ifstream::failure *e) + { LOG(WARNING) << "Exception writing trk dump file " << e->what(); - } + } } - consume_each(d_correlation_length_samples); // this is necessary in gr::block derivates - d_sample_counter += d_correlation_length_samples; //count for the processed samples + consume_each(d_correlation_length_samples); // this is necessary in gr::block derivates + d_sample_counter += d_correlation_length_samples; //count for the processed samples if (d_enable_tracking) - { - return 1; - }else{ - return 0; - } + { + return 1; + } + else + { + return 0; + } } @@ -890,23 +889,23 @@ void gps_l1_ca_dll_pll_c_aid_tracking_sc::set_channel(unsigned int channel) if (d_dump_file.is_open() == false) { try - { + { d_dump_filename.append(boost::lexical_cast(d_channel)); d_dump_filename.append(".dat"); - d_dump_file.exceptions (std::ifstream::failbit | std::ifstream::badbit); + d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); LOG(INFO) << "Tracking dump enabled on channel " << d_channel << " Log file: " << d_dump_filename.c_str(); - } - catch (const std::ifstream::failure* e) - { + } + catch (const std::ifstream::failure *e) + { LOG(WARNING) << "channel " << d_channel << " Exception opening trk dump file " << e->what(); - } + } } } } -void gps_l1_ca_dll_pll_c_aid_tracking_sc::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) +void gps_l1_ca_dll_pll_c_aid_tracking_sc::set_gnss_synchro(Gnss_Synchro *p_gnss_synchro) { d_acquisition_gnss_synchro = p_gnss_synchro; } diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_sc.h b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_sc.h index 6a8a9bdf4..ec68aed0f 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_sc.h +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_sc.h @@ -53,27 +53,25 @@ class gps_l1_ca_dll_pll_c_aid_tracking_sc; typedef boost::shared_ptr - gps_l1_ca_dll_pll_c_aid_tracking_sc_sptr; + gps_l1_ca_dll_pll_c_aid_tracking_sc_sptr; gps_l1_ca_dll_pll_c_aid_tracking_sc_sptr gps_l1_ca_dll_pll_c_aid_make_tracking_sc(long if_freq, - long fs_in, unsigned - int vector_length, - bool dump, - std::string dump_filename, - float pll_bw_hz, - float dll_bw_hz, - float pll_bw_narrow_hz, - float dll_bw_narrow_hz, - int extend_correlation_ms, - float early_late_space_chips); - + long fs_in, unsigned int vector_length, + bool dump, + std::string dump_filename, + float pll_bw_hz, + float dll_bw_hz, + float pll_bw_narrow_hz, + float dll_bw_narrow_hz, + int extend_correlation_ms, + float early_late_space_chips); /*! * \brief This class implements a DLL + PLL tracking loop block */ -class gps_l1_ca_dll_pll_c_aid_tracking_sc: public gr::block +class gps_l1_ca_dll_pll_c_aid_tracking_sc : public gr::block { public: ~gps_l1_ca_dll_pll_c_aid_tracking_sc(); @@ -82,36 +80,34 @@ public: void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro); void start_tracking(); - int general_work (int noutput_items, gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); + int general_work(int noutput_items, gr_vector_int& ninput_items, + gr_vector_const_void_star& input_items, gr_vector_void_star& output_items); - void forecast (int noutput_items, gr_vector_int &ninput_items_required); + void forecast(int noutput_items, gr_vector_int& ninput_items_required); private: friend gps_l1_ca_dll_pll_c_aid_tracking_sc_sptr gps_l1_ca_dll_pll_c_aid_make_tracking_sc(long if_freq, - long fs_in, unsigned - int vector_length, - bool dump, - std::string dump_filename, - float pll_bw_hz, - float dll_bw_hz, - float pll_bw_narrow_hz, - float dll_bw_narrow_hz, - int extend_correlation_ms, - float early_late_space_chips); + long fs_in, unsigned int vector_length, + bool dump, + std::string dump_filename, + float pll_bw_hz, + float dll_bw_hz, + float pll_bw_narrow_hz, + float dll_bw_narrow_hz, + int extend_correlation_ms, + float early_late_space_chips); gps_l1_ca_dll_pll_c_aid_tracking_sc(long if_freq, - long fs_in, unsigned - int vector_length, - bool dump, - std::string dump_filename, - float pll_bw_hz, - float dll_bw_hz, - float pll_bw_narrow_hz, - float dll_bw_narrow_hz, - int extend_correlation_ms, - float early_late_space_chips); + long fs_in, unsigned int vector_length, + bool dump, + std::string dump_filename, + float pll_bw_hz, + float dll_bw_hz, + float pll_bw_narrow_hz, + float dll_bw_narrow_hz, + int extend_correlation_ms, + float early_late_space_chips); // tracking configuration vars unsigned int d_vector_length; @@ -204,4 +200,4 @@ private: int save_matfile(); }; -#endif //GNSS_SDR_GPS_L1_CA_DLL_PLL_C_AID_TRACKING_SC_H +#endif //GNSS_SDR_GPS_L1_CA_DLL_PLL_C_AID_TRACKING_SC_H diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_cc.cc index cfd4c69bd..48612d124 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_cc.cc @@ -56,43 +56,40 @@ using google::LogMessage; gps_l1_ca_dll_pll_tracking_cc_sptr gps_l1_ca_dll_pll_make_tracking_cc( - long if_freq, - long fs_in, - unsigned int vector_length, - bool dump, - std::string dump_filename, - float pll_bw_hz, - float dll_bw_hz, - float early_late_space_chips) + long if_freq, + long fs_in, + unsigned int vector_length, + bool dump, + std::string dump_filename, + float pll_bw_hz, + float dll_bw_hz, + float early_late_space_chips) { return gps_l1_ca_dll_pll_tracking_cc_sptr(new Gps_L1_Ca_Dll_Pll_Tracking_cc(if_freq, - fs_in, vector_length, dump, dump_filename, pll_bw_hz, dll_bw_hz, early_late_space_chips)); + fs_in, vector_length, dump, dump_filename, pll_bw_hz, dll_bw_hz, early_late_space_chips)); } - -void Gps_L1_Ca_Dll_Pll_Tracking_cc::forecast (int noutput_items, - gr_vector_int &ninput_items_required) +void Gps_L1_Ca_Dll_Pll_Tracking_cc::forecast(int noutput_items, + gr_vector_int &ninput_items_required) { if (noutput_items != 0) { - ninput_items_required[0] = static_cast(d_vector_length) * 2; //set the required available samples in each call + ninput_items_required[0] = static_cast(d_vector_length) * 2; //set the required available samples in each call } } - Gps_L1_Ca_Dll_Pll_Tracking_cc::Gps_L1_Ca_Dll_Pll_Tracking_cc( - long if_freq, - long fs_in, - unsigned int vector_length, - bool dump, - std::string dump_filename, - float pll_bw_hz, - float dll_bw_hz, - float early_late_space_chips) : - gr::block("Gps_L1_Ca_Dll_Pll_Tracking_cc", gr::io_signature::make(1, 1, sizeof(gr_complex)), - gr::io_signature::make(1, 1, sizeof(Gnss_Synchro))) + long if_freq, + long fs_in, + unsigned int vector_length, + bool dump, + std::string dump_filename, + float pll_bw_hz, + float dll_bw_hz, + float early_late_space_chips) : gr::block("Gps_L1_Ca_Dll_Pll_Tracking_cc", gr::io_signature::make(1, 1, sizeof(gr_complex)), + gr::io_signature::make(1, 1, sizeof(Gnss_Synchro))) { // Telemetry bit synchronization message port input this->message_port_register_in(pmt::mp("preamble_timestamp_s")); @@ -112,22 +109,22 @@ Gps_L1_Ca_Dll_Pll_Tracking_cc::Gps_L1_Ca_Dll_Pll_Tracking_cc( d_carrier_loop_filter.set_PLL_BW(pll_bw_hz); //--- DLL variables -------------------------------------------------------- - d_early_late_spc_chips = early_late_space_chips; // Define early-late offset (in chips) + d_early_late_spc_chips = early_late_space_chips; // Define early-late offset (in chips) // Initialization of local code replica // Get space for a vector with the C/A code replica sampled 1x/chip - d_ca_code = static_cast(volk_gnsssdr_malloc(static_cast(GPS_L1_CA_CODE_LENGTH_CHIPS) * sizeof(float), volk_gnsssdr_get_alignment())); + d_ca_code = static_cast(volk_gnsssdr_malloc(static_cast(GPS_L1_CA_CODE_LENGTH_CHIPS) * sizeof(float), volk_gnsssdr_get_alignment())); // correlator outputs (scalar) - d_n_correlator_taps = 3; // Early, Prompt, and Late - d_correlator_outs = static_cast(volk_gnsssdr_malloc(d_n_correlator_taps * sizeof(gr_complex), volk_gnsssdr_get_alignment())); + d_n_correlator_taps = 3; // Early, Prompt, and Late + d_correlator_outs = static_cast(volk_gnsssdr_malloc(d_n_correlator_taps * sizeof(gr_complex), volk_gnsssdr_get_alignment())); for (int n = 0; n < d_n_correlator_taps; n++) { - d_correlator_outs[n] = gr_complex(0,0); + d_correlator_outs[n] = gr_complex(0, 0); } - d_local_code_shift_chips = static_cast(volk_gnsssdr_malloc(d_n_correlator_taps * sizeof(float), volk_gnsssdr_get_alignment())); + d_local_code_shift_chips = static_cast(volk_gnsssdr_malloc(d_n_correlator_taps * sizeof(float), volk_gnsssdr_get_alignment())); // Set TAPs delay values [chips] - d_local_code_shift_chips[0] = - d_early_late_spc_chips; + d_local_code_shift_chips[0] = -d_early_late_spc_chips; d_local_code_shift_chips[1] = 0.0; d_local_code_shift_chips[2] = d_early_late_spc_chips; @@ -187,7 +184,7 @@ void Gps_L1_Ca_Dll_Pll_Tracking_cc::start_tracking() long int acq_trk_diff_samples; double acq_trk_diff_seconds; - acq_trk_diff_samples = static_cast(d_sample_counter) - static_cast(d_acq_sample_stamp); //-d_vector_length; + acq_trk_diff_samples = static_cast(d_sample_counter) - static_cast(d_acq_sample_stamp); //-d_vector_length; DLOG(INFO) << "Number of samples between Acquisition and Tracking = " << acq_trk_diff_samples; acq_trk_diff_seconds = static_cast(acq_trk_diff_samples) / static_cast(d_fs_in); // Doppler effect @@ -199,7 +196,7 @@ void Gps_L1_Ca_Dll_Pll_Tracking_cc::start_tracking() double T_prn_mod_samples; d_code_freq_chips = radial_velocity * GPS_L1_CA_CODE_RATE_HZ; d_code_phase_step_chips = static_cast(d_code_freq_chips) / static_cast(d_fs_in); - T_chip_mod_seconds = 1/d_code_freq_chips; + T_chip_mod_seconds = 1 / d_code_freq_chips; T_prn_mod_seconds = T_chip_mod_seconds * GPS_L1_CA_CODE_LENGTH_CHIPS; T_prn_mod_samples = T_prn_mod_seconds * static_cast(d_fs_in); @@ -223,8 +220,8 @@ void Gps_L1_Ca_Dll_Pll_Tracking_cc::start_tracking() d_carrier_phase_step_rad = GPS_TWO_PI * d_carrier_doppler_hz / static_cast(d_fs_in); // DLL/PLL filter initialization - d_carrier_loop_filter.initialize(); // initialize the carrier filter - d_code_loop_filter.initialize(); // initialize the code filter + d_carrier_loop_filter.initialize(); // initialize the carrier filter + d_code_loop_filter.initialize(); // initialize the code filter // generate local reference ALWAYS starting at chip 1 (1 sample per chip) gps_l1_ca_code_gen_float(d_ca_code, d_acquisition_gnss_synchro->PRN, 0); @@ -232,7 +229,7 @@ void Gps_L1_Ca_Dll_Pll_Tracking_cc::start_tracking() multicorrelator_cpu.set_local_code_and_taps(static_cast(GPS_L1_CA_CODE_LENGTH_CHIPS), d_ca_code, d_local_code_shift_chips); for (int n = 0; n < d_n_correlator_taps; n++) { - d_correlator_outs[n] = gr_complex(0,0); + d_correlator_outs[n] = gr_complex(0, 0); } d_carrier_lock_fail_counter = 0; @@ -244,7 +241,7 @@ void Gps_L1_Ca_Dll_Pll_Tracking_cc::start_tracking() d_code_phase_samples = d_acq_code_phase_samples; std::string sys_ = &d_acquisition_gnss_synchro->System; - sys = sys_.substr(0,1); + sys = sys_.substr(0, 1); // DEBUG OUTPUT std::cout << "Tracking of GPS L1 C/A signal started on channel " << d_channel << " for satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << std::endl; @@ -255,8 +252,8 @@ void Gps_L1_Ca_Dll_Pll_Tracking_cc::start_tracking() d_enable_tracking = true; LOG(INFO) << "PULL-IN Doppler [Hz]=" << d_carrier_doppler_hz - << " Code Phase correction [samples]=" << delay_correction_samples - << " PULL-IN Code Phase [samples]=" << d_acq_code_phase_samples; + << " Code Phase correction [samples]=" << delay_correction_samples + << " PULL-IN Code Phase [samples]=" << d_acq_code_phase_samples; } @@ -267,18 +264,18 @@ int Gps_L1_Ca_Dll_Pll_Tracking_cc::save_matfile() int number_of_double_vars = 11; int number_of_float_vars = 5; int epoch_size_bytes = sizeof(unsigned long int) + sizeof(double) * number_of_double_vars + - sizeof(float) * number_of_float_vars + sizeof(unsigned int); + sizeof(float) * number_of_float_vars + sizeof(unsigned int); std::ifstream dump_file; dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); try - { + { dump_file.open(d_dump_filename.c_str(), std::ios::binary | std::ios::ate); - } - catch(const std::ifstream::failure &e) - { - std::cerr << "Problem opening dump file:" << e.what() << std::endl; + } + catch (const std::ifstream::failure &e) + { + std::cerr << "Problem opening dump file:" << e.what() << std::endl; return 1; - } + } // count number of epochs and rewind long int num_epoch = 0; if (dump_file.is_open()) @@ -291,30 +288,30 @@ int Gps_L1_Ca_Dll_Pll_Tracking_cc::save_matfile() { return 1; } - float * abs_E = new float [num_epoch]; - float * abs_P = new float [num_epoch]; - float * abs_L = new float [num_epoch]; - float * Prompt_I = new float [num_epoch]; - float * Prompt_Q = new float [num_epoch]; - unsigned long int * PRN_start_sample_count = new unsigned long int [num_epoch]; - double * acc_carrier_phase_rad = new double [num_epoch]; - double * carrier_doppler_hz = new double [num_epoch]; - double * code_freq_chips = new double [num_epoch]; - double * carr_error_hz = new double [num_epoch]; - double * carr_error_filt_hz = new double [num_epoch]; - double * code_error_chips = new double [num_epoch]; - double * code_error_filt_chips = new double [num_epoch]; - double * CN0_SNV_dB_Hz = new double [num_epoch]; - double * carrier_lock_test = new double [num_epoch]; - double * aux1 = new double [num_epoch]; - double * aux2 = new double [num_epoch]; - unsigned int * PRN = new unsigned int [num_epoch]; + float *abs_E = new float[num_epoch]; + float *abs_P = new float[num_epoch]; + float *abs_L = new float[num_epoch]; + float *Prompt_I = new float[num_epoch]; + float *Prompt_Q = new float[num_epoch]; + unsigned long int *PRN_start_sample_count = new unsigned long int[num_epoch]; + double *acc_carrier_phase_rad = new double[num_epoch]; + double *carrier_doppler_hz = new double[num_epoch]; + double *code_freq_chips = new double[num_epoch]; + double *carr_error_hz = new double[num_epoch]; + double *carr_error_filt_hz = new double[num_epoch]; + double *code_error_chips = new double[num_epoch]; + double *code_error_filt_chips = new double[num_epoch]; + double *CN0_SNV_dB_Hz = new double[num_epoch]; + double *carrier_lock_test = new double[num_epoch]; + double *aux1 = new double[num_epoch]; + double *aux2 = new double[num_epoch]; + unsigned int *PRN = new unsigned int[num_epoch]; try - { + { if (dump_file.is_open()) { - for(long int i = 0; i < num_epoch; i++) + for (long int i = 0; i < num_epoch; i++) { dump_file.read(reinterpret_cast(&abs_E[i]), sizeof(float)); dump_file.read(reinterpret_cast(&abs_P[i]), sizeof(float)); @@ -337,10 +334,10 @@ int Gps_L1_Ca_Dll_Pll_Tracking_cc::save_matfile() } } dump_file.close(); - } + } catch (const std::ifstream::failure &e) - { - std::cerr << "Problem reading dump file:" << e.what() << std::endl; + { + std::cerr << "Problem reading dump file:" << e.what() << std::endl; delete[] abs_E; delete[] abs_P; delete[] abs_L; @@ -360,7 +357,7 @@ int Gps_L1_Ca_Dll_Pll_Tracking_cc::save_matfile() delete[] aux2; delete[] PRN; return 1; - } + } // WRITE MAT FILE mat_t *matfp; @@ -369,79 +366,79 @@ int Gps_L1_Ca_Dll_Pll_Tracking_cc::save_matfile() filename.erase(filename.length() - 4, 4); filename.append(".mat"); matfp = Mat_CreateVer(filename.c_str(), NULL, MAT_FT_MAT73); - if(reinterpret_cast(matfp) != NULL) + if (reinterpret_cast(matfp) != NULL) { size_t dims[2] = {1, static_cast(num_epoch)}; matvar = Mat_VarCreate("abs_E", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, abs_E, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("abs_P", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, abs_P, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("abs_L", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, abs_L, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("Prompt_I", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, Prompt_I, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("Prompt_Q", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, Prompt_Q, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("PRN_start_sample_count", MAT_C_UINT64, MAT_T_UINT64, 2, dims, PRN_start_sample_count, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("acc_carrier_phase_rad", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, acc_carrier_phase_rad, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("carrier_doppler_hz", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, carrier_doppler_hz, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("code_freq_chips", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, code_freq_chips, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("carr_error_hz", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, carr_error_hz, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("carr_error_filt_hz", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, carr_error_filt_hz, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("code_error_chips", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, code_error_chips, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("code_error_filt_chips", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, code_error_filt_chips, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("CN0_SNV_dB_Hz", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, CN0_SNV_dB_Hz, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("carrier_lock_test", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, carrier_lock_test, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("aux1", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, aux1, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("aux2", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, aux2, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("PRN", MAT_C_UINT32, MAT_T_UINT32, 2, dims, PRN, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); } Mat_Close(matfp); @@ -472,47 +469,45 @@ Gps_L1_Ca_Dll_Pll_Tracking_cc::~Gps_L1_Ca_Dll_Pll_Tracking_cc() if (d_dump_file.is_open()) { try - { + { d_dump_file.close(); - } - catch(const std::exception & ex) - { + } + catch (const std::exception &ex) + { LOG(WARNING) << "Exception in destructor " << ex.what(); - } + } } - if(d_dump) + if (d_dump) { - if(d_channel == 0) + if (d_channel == 0) { std::cout << "Writing .mat files ..."; } Gps_L1_Ca_Dll_Pll_Tracking_cc::save_matfile(); - if(d_channel == 0) + if (d_channel == 0) { std::cout << " done." << std::endl; } } try - { + { volk_gnsssdr_free(d_local_code_shift_chips); volk_gnsssdr_free(d_correlator_outs); volk_gnsssdr_free(d_ca_code); delete[] d_Prompt_buffer; multicorrelator_cpu.free(); - } - catch(const std::exception & ex) - { + } + catch (const std::exception &ex) + { LOG(WARNING) << "Exception in destructor " << ex.what(); - } - + } } - -int Gps_L1_Ca_Dll_Pll_Tracking_cc::general_work (int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), - gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) +int Gps_L1_Ca_Dll_Pll_Tracking_cc::general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), + gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { gr::thread::scoped_lock lk(d_setlock); // process vars @@ -522,7 +517,7 @@ int Gps_L1_Ca_Dll_Pll_Tracking_cc::general_work (int noutput_items __attribute__ double code_error_filt_chips = 0.0; // Block input data and block output stream pointers - const gr_complex* in = reinterpret_cast(input_items[0]); + const gr_complex *in = reinterpret_cast(input_items[0]); Gnss_Synchro **out = reinterpret_cast(&output_items[0]); // GNSS_SYNCHRO OBJECT to interchange data between tracking->telemetry_decoder @@ -542,7 +537,7 @@ int Gps_L1_Ca_Dll_Pll_Tracking_cc::general_work (int noutput_items __attribute__ acq_trk_shif_correction_samples = d_current_prn_length_samples - fmod(static_cast(acq_to_trk_delay_samples), static_cast(d_current_prn_length_samples)); samples_offset = round(d_acq_code_phase_samples + acq_trk_shif_correction_samples); current_synchro_data.Tracking_sample_counter = d_sample_counter + samples_offset; - d_sample_counter = d_sample_counter + samples_offset; // count for the processed samples + d_sample_counter = d_sample_counter + samples_offset; // count for the processed samples d_pull_in = false; // take into account the carrier cycles accumulated in the pull in signal alignment d_acc_carrier_phase_rad -= d_carrier_phase_step_rad * samples_offset; @@ -550,7 +545,7 @@ int Gps_L1_Ca_Dll_Pll_Tracking_cc::general_work (int noutput_items __attribute__ current_synchro_data.Carrier_Doppler_hz = d_carrier_doppler_hz; current_synchro_data.fs = d_fs_in; current_synchro_data.correlation_length_ms = 1; - consume_each(samples_offset); // shift input to perform alignment with local replica + consume_each(samples_offset); // shift input to perform alignment with local replica return 0; } @@ -558,15 +553,15 @@ int Gps_L1_Ca_Dll_Pll_Tracking_cc::general_work (int noutput_items __attribute__ // perform carrier wipe-off and compute Early, Prompt and Late correlation multicorrelator_cpu.set_input_output_vectors(d_correlator_outs, in); multicorrelator_cpu.Carrier_wipeoff_multicorrelator_resampler(d_rem_carr_phase_rad, - d_carrier_phase_step_rad, - d_rem_code_phase_chips, - d_code_phase_step_chips, - d_current_prn_length_samples); + d_carrier_phase_step_rad, + d_rem_code_phase_chips, + d_code_phase_step_chips, + d_current_prn_length_samples); // ################## PLL ########################################################## // PLL discriminator // Update PLL discriminator [rads/Ti -> Secs/Ti] - carr_error_hz = pll_cloop_two_quadrant_atan(d_correlator_outs[1]) / GPS_TWO_PI; // prompt output + carr_error_hz = pll_cloop_two_quadrant_atan(d_correlator_outs[1]) / GPS_TWO_PI; // prompt output // Carrier discriminator filter carr_error_filt_hz = d_carrier_loop_filter.get_carrier_nco(carr_error_hz); // New carrier Doppler frequency estimation @@ -576,12 +571,12 @@ int Gps_L1_Ca_Dll_Pll_Tracking_cc::general_work (int noutput_items __attribute__ // ################## DLL ########################################################## // DLL discriminator - code_error_chips = dll_nc_e_minus_l_normalized(d_correlator_outs[0], d_correlator_outs[2]); // [chips/Ti] //early and late + code_error_chips = dll_nc_e_minus_l_normalized(d_correlator_outs[0], d_correlator_outs[2]); // [chips/Ti] //early and late // Code discriminator filter - code_error_filt_chips = d_code_loop_filter.get_code_nco(code_error_chips); // [chips/second] + code_error_filt_chips = d_code_loop_filter.get_code_nco(code_error_chips); // [chips/second] double T_chip_seconds = 1.0 / static_cast(d_code_freq_chips); double T_prn_seconds = T_chip_seconds * GPS_L1_CA_CODE_LENGTH_CHIPS; - double code_error_filt_secs = (T_prn_seconds * code_error_filt_chips*T_chip_seconds); //[seconds] + double code_error_filt_secs = (T_prn_seconds * code_error_filt_chips * T_chip_seconds); //[seconds] //double code_error_filt_secs = (GPS_L1_CA_CODE_PERIOD * code_error_filt_chips) / GPS_L1_CA_CODE_RATE_HZ; // [seconds] // ################## CARRIER AND CODE NCO BUFFER ALIGNEMENT ####################### @@ -591,7 +586,7 @@ int Gps_L1_Ca_Dll_Pll_Tracking_cc::general_work (int noutput_items __attribute__ //double T_prn_seconds = T_chip_seconds * GPS_L1_CA_CODE_LENGTH_CHIPS; double T_prn_samples = T_prn_seconds * static_cast(d_fs_in); double K_blk_samples = T_prn_samples + d_rem_code_phase_samples + code_error_filt_secs * static_cast(d_fs_in); - d_current_prn_length_samples = round(K_blk_samples); // round to a discrete number of samples + d_current_prn_length_samples = round(K_blk_samples); // round to a discrete number of samples //################### PLL COMMANDS ################################################# // carrier phase step (NCO phase increment per sample) [rads/sample] @@ -606,14 +601,14 @@ int Gps_L1_Ca_Dll_Pll_Tracking_cc::general_work (int noutput_items __attribute__ // code phase step (Code resampler phase increment per sample) [chips/sample] d_code_phase_step_chips = d_code_freq_chips / static_cast(d_fs_in); // remnant code phase [chips] - d_rem_code_phase_samples = K_blk_samples - d_current_prn_length_samples; // rounding error < 1 sample + d_rem_code_phase_samples = K_blk_samples - d_current_prn_length_samples; // rounding error < 1 sample d_rem_code_phase_chips = d_code_freq_chips * (d_rem_code_phase_samples / static_cast(d_fs_in)); // ####### CN0 ESTIMATION AND LOCK DETECTORS ###### if (d_cn0_estimation_counter < FLAGS_cn0_samples) { // fill buffer with prompt correlator output values - d_Prompt_buffer[d_cn0_estimation_counter] = d_correlator_outs[1]; //prompt + d_Prompt_buffer[d_cn0_estimation_counter] = d_correlator_outs[1]; //prompt d_cn0_estimation_counter++; } else @@ -636,9 +631,9 @@ int Gps_L1_Ca_Dll_Pll_Tracking_cc::general_work (int noutput_items __attribute__ { std::cout << "Loss of lock in channel " << d_channel << "!" << std::endl; LOG(INFO) << "Loss of lock in channel " << d_channel << "!"; - this->message_port_pub(pmt::mp("events"), pmt::from_long(3)); // 3 -> loss of lock + this->message_port_pub(pmt::mp("events"), pmt::from_long(3)); // 3 -> loss of lock d_carrier_lock_fail_counter = 0; - d_enable_tracking = false; // TODO: check if disabling tracking is consistent with the channel state machine + d_enable_tracking = false; // TODO: check if disabling tracking is consistent with the channel state machine } } // ########### Output the tracking data to navigation and PVT ########## @@ -656,7 +651,7 @@ int Gps_L1_Ca_Dll_Pll_Tracking_cc::general_work (int noutput_items __attribute__ { for (int n = 0; n < d_n_correlator_taps; n++) { - d_correlator_outs[n] = gr_complex(0,0); + d_correlator_outs[n] = gr_complex(0, 0); } current_synchro_data.Tracking_sample_counter = d_sample_counter + d_current_prn_length_samples; @@ -667,7 +662,7 @@ int Gps_L1_Ca_Dll_Pll_Tracking_cc::general_work (int noutput_items __attribute__ //assign the GNURadio block output data current_synchro_data.fs = d_fs_in; *out[0] = current_synchro_data; - if(d_dump) + if (d_dump) { // MULTIPLEXED FILE RECORDING - Record results to file float prompt_I; @@ -681,61 +676,66 @@ int Gps_L1_Ca_Dll_Pll_Tracking_cc::general_work (int noutput_items __attribute__ tmp_P = std::abs(d_correlator_outs[1]); tmp_L = std::abs(d_correlator_outs[2]); try - { + { // EPR - d_dump_file.write(reinterpret_cast(&tmp_E), sizeof(float)); - d_dump_file.write(reinterpret_cast(&tmp_P), sizeof(float)); - d_dump_file.write(reinterpret_cast(&tmp_L), sizeof(float)); + d_dump_file.write(reinterpret_cast(&tmp_E), sizeof(float)); + d_dump_file.write(reinterpret_cast(&tmp_P), sizeof(float)); + d_dump_file.write(reinterpret_cast(&tmp_L), sizeof(float)); // PROMPT I and Q (to analyze navigation symbols) - d_dump_file.write(reinterpret_cast(&prompt_I), sizeof(float)); - d_dump_file.write(reinterpret_cast(&prompt_Q), sizeof(float)); + d_dump_file.write(reinterpret_cast(&prompt_I), sizeof(float)); + d_dump_file.write(reinterpret_cast(&prompt_Q), sizeof(float)); // PRN start sample stamp tmp_long = d_sample_counter + d_current_prn_length_samples; - d_dump_file.write(reinterpret_cast(&tmp_long), sizeof(unsigned long int)); + d_dump_file.write(reinterpret_cast(&tmp_long), sizeof(unsigned long int)); // accumulated carrier phase - d_dump_file.write(reinterpret_cast(&d_acc_carrier_phase_rad), sizeof(double)); + d_dump_file.write(reinterpret_cast(&d_acc_carrier_phase_rad), sizeof(double)); // carrier and code frequency - d_dump_file.write(reinterpret_cast(&d_carrier_doppler_hz), sizeof(double)); - d_dump_file.write(reinterpret_cast(&d_code_freq_chips), sizeof(double)); + d_dump_file.write(reinterpret_cast(&d_carrier_doppler_hz), sizeof(double)); + d_dump_file.write(reinterpret_cast(&d_code_freq_chips), sizeof(double)); // PLL commands - d_dump_file.write(reinterpret_cast(&carr_error_hz), sizeof(double)); - d_dump_file.write(reinterpret_cast(&carr_error_filt_hz), sizeof(double)); + d_dump_file.write(reinterpret_cast(&carr_error_hz), sizeof(double)); + d_dump_file.write(reinterpret_cast(&carr_error_filt_hz), sizeof(double)); // DLL commands - d_dump_file.write(reinterpret_cast(&code_error_chips), sizeof(double)); - d_dump_file.write(reinterpret_cast(&code_error_filt_chips), sizeof(double)); + d_dump_file.write(reinterpret_cast(&code_error_chips), sizeof(double)); + d_dump_file.write(reinterpret_cast(&code_error_filt_chips), sizeof(double)); // CN0 and carrier lock test - d_dump_file.write(reinterpret_cast(&d_CN0_SNV_dB_Hz), sizeof(double)); - d_dump_file.write(reinterpret_cast(&d_carrier_lock_test), sizeof(double)); + d_dump_file.write(reinterpret_cast(&d_CN0_SNV_dB_Hz), sizeof(double)); + d_dump_file.write(reinterpret_cast(&d_carrier_lock_test), sizeof(double)); // AUX vars (for debug purposes) tmp_double = d_rem_code_phase_samples; - d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); + d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); tmp_double = static_cast(d_sample_counter); - d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); + d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); // PRN unsigned int prn_ = d_acquisition_gnss_synchro->PRN; - d_dump_file.write(reinterpret_cast(&prn_), sizeof(unsigned int)); - } + d_dump_file.write(reinterpret_cast(&prn_), sizeof(unsigned int)); + } catch (const std::ifstream::failure &e) - { + { LOG(WARNING) << "Exception writing trk dump file " << e.what(); - } + } } - consume_each(d_current_prn_length_samples); // this is necessary in gr::block derivates - d_sample_counter += d_current_prn_length_samples; // count for the processed samples + consume_each(d_current_prn_length_samples); // this is necessary in gr::block derivates + d_sample_counter += d_current_prn_length_samples; // count for the processed samples - if(current_synchro_data.Flag_valid_symbol_output) { return 1; } - else { return 0; } + if (current_synchro_data.Flag_valid_symbol_output) + { + return 1; + } + else + { + return 0; + } } - void Gps_L1_Ca_Dll_Pll_Tracking_cc::set_channel(unsigned int channel) { d_channel = channel; @@ -746,23 +746,23 @@ void Gps_L1_Ca_Dll_Pll_Tracking_cc::set_channel(unsigned int channel) if (d_dump_file.is_open() == false) { try - { + { d_dump_filename.append(boost::lexical_cast(d_channel)); d_dump_filename.append(".dat"); - d_dump_file.exceptions (std::ifstream::failbit | std::ifstream::badbit); + d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); LOG(INFO) << "Tracking dump enabled on channel " << d_channel << " Log file: " << d_dump_filename.c_str(); - } + } catch (const std::ifstream::failure &e) - { + { LOG(WARNING) << "channel " << d_channel << " Exception opening trk dump file " << e.what(); - } + } } } } -void Gps_L1_Ca_Dll_Pll_Tracking_cc::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) +void Gps_L1_Ca_Dll_Pll_Tracking_cc::set_gnss_synchro(Gnss_Synchro *p_gnss_synchro) { d_acquisition_gnss_synchro = p_gnss_synchro; } diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_cc.h b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_cc.h index 8eca5317f..575b4feb4 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_cc.h +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_cc.h @@ -50,24 +50,22 @@ class Gps_L1_Ca_Dll_Pll_Tracking_cc; typedef boost::shared_ptr - gps_l1_ca_dll_pll_tracking_cc_sptr; + gps_l1_ca_dll_pll_tracking_cc_sptr; gps_l1_ca_dll_pll_tracking_cc_sptr gps_l1_ca_dll_pll_make_tracking_cc(long if_freq, - long fs_in, unsigned - int vector_length, - bool dump, - std::string dump_filename, - float pll_bw_hz, - float dll_bw_hz, - float early_late_space_chips); - + long fs_in, unsigned int vector_length, + bool dump, + std::string dump_filename, + float pll_bw_hz, + float dll_bw_hz, + float early_late_space_chips); /*! * \brief This class implements a DLL + PLL tracking loop block */ -class Gps_L1_Ca_Dll_Pll_Tracking_cc: public gr::block +class Gps_L1_Ca_Dll_Pll_Tracking_cc : public gr::block { public: ~Gps_L1_Ca_Dll_Pll_Tracking_cc(); @@ -76,30 +74,28 @@ public: void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro); void start_tracking(); - int general_work (int noutput_items, gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); + int general_work(int noutput_items, gr_vector_int& ninput_items, + gr_vector_const_void_star& input_items, gr_vector_void_star& output_items); - void forecast (int noutput_items, gr_vector_int &ninput_items_required); + void forecast(int noutput_items, gr_vector_int& ninput_items_required); private: friend gps_l1_ca_dll_pll_tracking_cc_sptr gps_l1_ca_dll_pll_make_tracking_cc(long if_freq, - long fs_in, unsigned - int vector_length, - bool dump, - std::string dump_filename, - float pll_bw_hz, - float dll_bw_hz, - float early_late_space_chips); + long fs_in, unsigned int vector_length, + bool dump, + std::string dump_filename, + float pll_bw_hz, + float dll_bw_hz, + float early_late_space_chips); Gps_L1_Ca_Dll_Pll_Tracking_cc(long if_freq, - long fs_in, unsigned - int vector_length, - bool dump, - std::string dump_filename, - float pll_bw_hz, - float dll_bw_hz, - float early_late_space_chips); + long fs_in, unsigned int vector_length, + bool dump, + std::string dump_filename, + float pll_bw_hz, + float dll_bw_hz, + float early_late_space_chips); int save_matfile(); // tracking configuration vars @@ -168,4 +164,4 @@ private: std::string sys; }; -#endif //GNSS_SDR_GPS_L1_CA_DLL_PLL_TRACKING_CC_H +#endif //GNSS_SDR_GPS_L1_CA_DLL_PLL_TRACKING_CC_H diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_gpu_cc.cc b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_gpu_cc.cc index 265d46d72..2c8a688cb 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_gpu_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_gpu_cc.cc @@ -50,43 +50,40 @@ using google::LogMessage; gps_l1_ca_dll_pll_tracking_gpu_cc_sptr gps_l1_ca_dll_pll_make_tracking_gpu_cc( - long if_freq, - long fs_in, - unsigned int vector_length, - bool dump, - std::string dump_filename, - float pll_bw_hz, - float dll_bw_hz, - float early_late_space_chips) + long if_freq, + long fs_in, + unsigned int vector_length, + bool dump, + std::string dump_filename, + float pll_bw_hz, + float dll_bw_hz, + float early_late_space_chips) { return gps_l1_ca_dll_pll_tracking_gpu_cc_sptr(new Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc(if_freq, - fs_in, vector_length, dump, dump_filename, pll_bw_hz, dll_bw_hz, early_late_space_chips)); + fs_in, vector_length, dump, dump_filename, pll_bw_hz, dll_bw_hz, early_late_space_chips)); } - -void Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc::forecast (int noutput_items, - gr_vector_int &ninput_items_required) +void Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc::forecast(int noutput_items, + gr_vector_int &ninput_items_required) { if (noutput_items != 0) { - ninput_items_required[0] = static_cast(d_vector_length) * 2; //set the required available samples in each call + ninput_items_required[0] = static_cast(d_vector_length) * 2; //set the required available samples in each call } } - Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc::Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc( - long if_freq, - long fs_in, - unsigned int vector_length, - bool dump, - std::string dump_filename, - float pll_bw_hz, - float dll_bw_hz, - float early_late_space_chips) : - gr::block("Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc", gr::io_signature::make(1, 1, sizeof(gr_complex)), - gr::io_signature::make(1, 1, sizeof(Gnss_Synchro))) + long if_freq, + long fs_in, + unsigned int vector_length, + bool dump, + std::string dump_filename, + float pll_bw_hz, + float dll_bw_hz, + float early_late_space_chips) : gr::block("Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc", gr::io_signature::make(1, 1, sizeof(gr_complex)), + gr::io_signature::make(1, 1, sizeof(Gnss_Synchro))) { // Telemetry bit synchronization message port input this->message_port_register_in(pmt::mp("preamble_timestamp_s")); @@ -101,26 +98,26 @@ Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc::Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc( // Initialize tracking ========================================== d_code_loop_filter.set_DLL_BW(dll_bw_hz); - d_carrier_loop_filter.set_params(10.0, pll_bw_hz,2); + d_carrier_loop_filter.set_params(10.0, pll_bw_hz, 2); //--- DLL variables -------------------------------------------------------- - d_early_late_spc_chips = early_late_space_chips; // Define early-late offset (in chips) + d_early_late_spc_chips = early_late_space_chips; // Define early-late offset (in chips) // Set GPU flags cudaSetDeviceFlags(cudaDeviceMapHost); //allocate host memory //pinned memory mode - use special function to get OS-pinned memory - d_n_correlator_taps = 3; // Early, Prompt, and Late + d_n_correlator_taps = 3; // Early, Prompt, and Late // Get space for a vector with the C/A code replica sampled 1x/chip - cudaHostAlloc((void**)&d_ca_code, (static_cast(GPS_L1_CA_CODE_LENGTH_CHIPS)* sizeof(gr_complex)), cudaHostAllocMapped || cudaHostAllocWriteCombined); + cudaHostAlloc((void **)&d_ca_code, (static_cast(GPS_L1_CA_CODE_LENGTH_CHIPS) * sizeof(gr_complex)), cudaHostAllocMapped || cudaHostAllocWriteCombined); // Get space for the resampled early / prompt / late local replicas - cudaHostAlloc((void**)&d_local_code_shift_chips, d_n_correlator_taps * sizeof(float), cudaHostAllocMapped || cudaHostAllocWriteCombined); - cudaHostAlloc((void**)&in_gpu, 2 * d_vector_length * sizeof(gr_complex), cudaHostAllocMapped || cudaHostAllocWriteCombined); + cudaHostAlloc((void **)&d_local_code_shift_chips, d_n_correlator_taps * sizeof(float), cudaHostAllocMapped || cudaHostAllocWriteCombined); + cudaHostAlloc((void **)&in_gpu, 2 * d_vector_length * sizeof(gr_complex), cudaHostAllocMapped || cudaHostAllocWriteCombined); // correlator outputs (scalar) - cudaHostAlloc((void**)&d_correlator_outs ,sizeof(gr_complex)*d_n_correlator_taps, cudaHostAllocMapped || cudaHostAllocWriteCombined ); + cudaHostAlloc((void **)&d_correlator_outs, sizeof(gr_complex) * d_n_correlator_taps, cudaHostAllocMapped || cudaHostAllocWriteCombined); // Set TAPs delay values [chips] - d_local_code_shift_chips[0] = - d_early_late_spc_chips; + d_local_code_shift_chips[0] = -d_early_late_spc_chips; d_local_code_shift_chips[1] = 0.0; d_local_code_shift_chips[2] = d_early_late_spc_chips; @@ -185,7 +182,7 @@ void Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc::start_tracking() long int acq_trk_diff_samples; double acq_trk_diff_seconds; - acq_trk_diff_samples = static_cast(d_sample_counter) - static_cast(d_acq_sample_stamp);//-d_vector_length; + acq_trk_diff_samples = static_cast(d_sample_counter) - static_cast(d_acq_sample_stamp); //-d_vector_length; DLOG(INFO) << "Number of samples between Acquisition and Tracking =" << acq_trk_diff_samples; acq_trk_diff_seconds = static_cast(acq_trk_diff_samples) / static_cast(d_fs_in); //doppler effect @@ -197,7 +194,7 @@ void Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc::start_tracking() double T_prn_mod_samples; d_code_freq_chips = radial_velocity * GPS_L1_CA_CODE_RATE_HZ; d_code_phase_step_chips = static_cast(d_code_freq_chips) / static_cast(d_fs_in); - T_chip_mod_seconds = 1/d_code_freq_chips; + T_chip_mod_seconds = 1 / d_code_freq_chips; T_prn_mod_seconds = T_chip_mod_seconds * GPS_L1_CA_CODE_LENGTH_CHIPS; T_prn_mod_samples = T_prn_mod_seconds * static_cast(d_fs_in); @@ -222,8 +219,8 @@ void Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc::start_tracking() d_carrier_phase_step_rad = GPS_TWO_PI * d_carrier_doppler_hz / static_cast(d_fs_in); // DLL/PLL filter initialization - d_carrier_loop_filter.initialize(d_acq_carrier_doppler_hz); //The carrier loop filter implements the Doppler accumulator - d_code_loop_filter.initialize(); // initialize the code filter + d_carrier_loop_filter.initialize(d_acq_carrier_doppler_hz); //The carrier loop filter implements the Doppler accumulator + d_code_loop_filter.initialize(); // initialize the code filter // generate local reference ALWAYS starting at chip 1 (1 sample per chip) gps_l1_ca_code_gen_complex(d_ca_code, d_acquisition_gnss_synchro->PRN, 0); @@ -232,7 +229,7 @@ void Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc::start_tracking() for (int n = 0; n < d_n_correlator_taps; n++) { - d_correlator_outs[n] = gr_complex(0,0); + d_correlator_outs[n] = gr_complex(0, 0); } d_carrier_lock_fail_counter = 0; @@ -244,7 +241,7 @@ void Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc::start_tracking() d_code_phase_samples = d_acq_code_phase_samples; std::string sys_ = &d_acquisition_gnss_synchro->System; - sys = sys_.substr(0,1); + sys = sys_.substr(0, 1); // DEBUG OUTPUT std::cout << "Tracking of GPS L1 C/A signal started on channel " << d_channel << " for satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << std::endl; @@ -265,35 +262,36 @@ Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc::~Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc() if (d_dump_file.is_open()) { try - { + { d_dump_file.close(); - } - catch(const std::exception & ex) - { + } + catch (const std::exception &ex) + { LOG(WARNING) << "Exception in destructor " << ex.what(); - } + } } - try{ + try + { cudaFreeHost(in_gpu); cudaFreeHost(d_correlator_outs); cudaFreeHost(d_local_code_shift_chips); cudaFreeHost(d_ca_code); delete[] d_Prompt_buffer; multicorrelator_gpu->free_cuda(); - delete(multicorrelator_gpu); - } - catch(const std::exception & ex) - { + delete (multicorrelator_gpu); + } + catch (const std::exception &ex) + { LOG(WARNING) << "Exception in destructor " << ex.what(); - } + } } -int Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc::general_work (int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), - gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) +int Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc::general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), + gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { // Block input data and block output stream pointers - const gr_complex* in = reinterpret_cast(input_items[0]); + const gr_complex *in = reinterpret_cast(input_items[0]); Gnss_Synchro **out = reinterpret_cast(&output_items[0]); // GNSS_SYNCHRO OBJECT to interchange data between tracking->telemetry_decoder @@ -325,9 +323,9 @@ int Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc::general_work (int noutput_items __attribu current_synchro_data.fs = d_fs_in; current_synchro_data.correlation_length_ms = 1; *out[0] = current_synchro_data; - d_sample_counter += samples_offset; //count for the processed samples + d_sample_counter += samples_offset; //count for the processed samples d_pull_in = false; - consume_each(samples_offset); //shift input to perform alignment with local replica + consume_each(samples_offset); //shift input to perform alignment with local replica return 1; } @@ -336,11 +334,11 @@ int Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc::general_work (int noutput_items __attribu memcpy(in_gpu, in, sizeof(gr_complex) * d_correlation_length_samples); cudaProfilerStart(); - multicorrelator_gpu->Carrier_wipeoff_multicorrelator_resampler_cuda( static_cast(d_rem_carrier_phase_rad), - static_cast(d_carrier_phase_step_rad), - static_cast(d_code_phase_step_chips), - static_cast(d_rem_code_phase_chips), - d_correlation_length_samples, d_n_correlator_taps); + multicorrelator_gpu->Carrier_wipeoff_multicorrelator_resampler_cuda(static_cast(d_rem_carrier_phase_rad), + static_cast(d_carrier_phase_step_rad), + static_cast(d_code_phase_step_chips), + static_cast(d_rem_code_phase_chips), + d_correlation_length_samples, d_n_correlator_taps); cudaProfilerStop(); //std::cout<<"c_out[0]="< Secs/Ti] - carr_phase_error_secs_Ti = pll_cloop_two_quadrant_atan(d_correlator_outs[1]) / GPS_TWO_PI; //prompt output + carr_phase_error_secs_Ti = pll_cloop_two_quadrant_atan(d_correlator_outs[1]) / GPS_TWO_PI; //prompt output // Carrier discriminator filter // NOTICE: The carrier loop filter includes the Carrier Doppler accumulator, as described in Kaplan //d_carrier_doppler_hz = d_acq_carrier_doppler_hz + carr_phase_error_filt_secs_ti/INTEGRATION_TIME; @@ -362,13 +360,13 @@ int Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc::general_work (int noutput_items __attribu // ################## DLL ########################################################## // DLL discriminator - code_error_chips_Ti = dll_nc_e_minus_l_normalized(d_correlator_outs[0], d_correlator_outs[2]); //[chips/Ti] //early and late + code_error_chips_Ti = dll_nc_e_minus_l_normalized(d_correlator_outs[0], d_correlator_outs[2]); //[chips/Ti] //early and late // Code discriminator filter - code_error_filt_chips = d_code_loop_filter.get_code_nco(code_error_chips_Ti); //input [chips/Ti] -> output [chips/second] - code_error_filt_secs_Ti = code_error_filt_chips*CURRENT_INTEGRATION_TIME_S/d_code_freq_chips; // [s/Ti] + code_error_filt_chips = d_code_loop_filter.get_code_nco(code_error_chips_Ti); //input [chips/Ti] -> output [chips/second] + code_error_filt_secs_Ti = code_error_filt_chips * CURRENT_INTEGRATION_TIME_S / d_code_freq_chips; // [s/Ti] // DLL code error estimation [s/Ti] // TODO: PLL carrier aid to DLL is disabled. Re-enable it and measure performance - dll_code_error_secs_Ti = - code_error_filt_secs_Ti + d_pll_to_dll_assist_secs_Ti; + dll_code_error_secs_Ti = -code_error_filt_secs_Ti + d_pll_to_dll_assist_secs_Ti; // ################## CARRIER AND CODE NCO BUFFER ALIGNEMENT ####################### // keep alignment parameters for the next input buffer @@ -382,12 +380,12 @@ int Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc::general_work (int noutput_items __attribu T_prn_samples = T_prn_seconds * static_cast(d_fs_in); K_blk_samples = T_prn_samples + d_rem_code_phase_samples - dll_code_error_secs_Ti * static_cast(d_fs_in); - d_correlation_length_samples = round(K_blk_samples); //round to a discrete samples - old_d_rem_code_phase_samples=d_rem_code_phase_samples; - d_rem_code_phase_samples = K_blk_samples - static_cast(d_correlation_length_samples); //rounding error < 1 sample + d_correlation_length_samples = round(K_blk_samples); //round to a discrete samples + old_d_rem_code_phase_samples = d_rem_code_phase_samples; + d_rem_code_phase_samples = K_blk_samples - static_cast(d_correlation_length_samples); //rounding error < 1 sample // UPDATE REMNANT CARRIER PHASE - CORRECTED_INTEGRATION_TIME_S = (static_cast(d_correlation_length_samples)/static_cast(d_fs_in)); + CORRECTED_INTEGRATION_TIME_S = (static_cast(d_correlation_length_samples) / static_cast(d_fs_in)); //remnant carrier phase [rad] d_rem_carrier_phase_rad = fmod(d_rem_carrier_phase_rad + GPS_TWO_PI * d_carrier_doppler_hz * CORRECTED_INTEGRATION_TIME_S, GPS_TWO_PI); // UPDATE CARRIER PHASE ACCUULATOR @@ -408,7 +406,7 @@ int Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc::general_work (int noutput_items __attribu if (d_cn0_estimation_counter < FLAGS_cn0_samples) { // fill buffer with prompt correlator output values - d_Prompt_buffer[d_cn0_estimation_counter] = d_correlator_outs[1]; //prompt + d_Prompt_buffer[d_cn0_estimation_counter] = d_correlator_outs[1]; //prompt d_cn0_estimation_counter++; } else @@ -431,9 +429,9 @@ int Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc::general_work (int noutput_items __attribu { std::cout << "Loss of lock in channel " << d_channel << "!" << std::endl; LOG(INFO) << "Loss of lock in channel " << d_channel << "!"; - this->message_port_pub(pmt::mp("events"), pmt::from_long(3));//3 -> loss of lock + this->message_port_pub(pmt::mp("events"), pmt::from_long(3)); //3 -> loss of lock d_carrier_lock_fail_counter = 0; - d_enable_tracking = false; // TODO: check if disabling tracking is consistent with the channel state machine + d_enable_tracking = false; // TODO: check if disabling tracking is consistent with the channel state machine } } @@ -446,15 +444,13 @@ int Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc::general_work (int noutput_items __attribu current_synchro_data.Carrier_Doppler_hz = d_carrier_doppler_hz; current_synchro_data.CN0_dB_hz = d_CN0_SNV_dB_Hz; current_synchro_data.Flag_valid_symbol_output = true; - current_synchro_data.correlation_length_ms=1; - + current_synchro_data.correlation_length_ms = 1; } else { - for (int n = 0; n < d_n_correlator_taps; n++) { - d_correlator_outs[n] = gr_complex(0,0); + d_correlator_outs[n] = gr_complex(0, 0); } current_synchro_data.System = {'G'}; @@ -466,7 +462,7 @@ int Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc::general_work (int noutput_items __attribu current_synchro_data.fs = d_fs_in; *out[0] = current_synchro_data; - if(d_dump) + if (d_dump) { // MULTIPLEXED FILE RECORDING - Record results to file float prompt_I; @@ -479,61 +475,63 @@ int Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc::general_work (int noutput_items __attribu tmp_P = std::abs(d_correlator_outs[1]); tmp_L = std::abs(d_correlator_outs[2]); try - { + { // EPR - d_dump_file.write(reinterpret_cast(&tmp_E), sizeof(float)); - d_dump_file.write(reinterpret_cast(&tmp_P), sizeof(float)); - d_dump_file.write(reinterpret_cast(&tmp_L), sizeof(float)); + d_dump_file.write(reinterpret_cast(&tmp_E), sizeof(float)); + d_dump_file.write(reinterpret_cast(&tmp_P), sizeof(float)); + d_dump_file.write(reinterpret_cast(&tmp_L), sizeof(float)); // PROMPT I and Q (to analyze navigation symbols) - d_dump_file.write(reinterpret_cast(&prompt_I), sizeof(float)); - d_dump_file.write(reinterpret_cast(&prompt_Q), sizeof(float)); + d_dump_file.write(reinterpret_cast(&prompt_I), sizeof(float)); + d_dump_file.write(reinterpret_cast(&prompt_Q), sizeof(float)); // PRN start sample stamp //tmp_float=(float)d_sample_counter; - d_dump_file.write(reinterpret_cast(&d_sample_counter), sizeof(unsigned long int)); + d_dump_file.write(reinterpret_cast(&d_sample_counter), sizeof(unsigned long int)); // accumulated carrier phase - d_dump_file.write(reinterpret_cast(&d_acc_carrier_phase_cycles), sizeof(double)); + d_dump_file.write(reinterpret_cast(&d_acc_carrier_phase_cycles), sizeof(double)); // carrier and code frequency - d_dump_file.write(reinterpret_cast(&d_carrier_doppler_hz), sizeof(double)); - d_dump_file.write(reinterpret_cast(&d_code_freq_chips), sizeof(double)); + d_dump_file.write(reinterpret_cast(&d_carrier_doppler_hz), sizeof(double)); + d_dump_file.write(reinterpret_cast(&d_code_freq_chips), sizeof(double)); //PLL commands - d_dump_file.write(reinterpret_cast(&carr_phase_error_secs_Ti), sizeof(double)); - d_dump_file.write(reinterpret_cast(&d_carrier_doppler_hz), sizeof(double)); + d_dump_file.write(reinterpret_cast(&carr_phase_error_secs_Ti), sizeof(double)); + d_dump_file.write(reinterpret_cast(&d_carrier_doppler_hz), sizeof(double)); //DLL commands - d_dump_file.write(reinterpret_cast(&code_error_chips_Ti), sizeof(double)); - d_dump_file.write(reinterpret_cast(&code_error_filt_chips), sizeof(double)); + d_dump_file.write(reinterpret_cast(&code_error_chips_Ti), sizeof(double)); + d_dump_file.write(reinterpret_cast(&code_error_filt_chips), sizeof(double)); // CN0 and carrier lock test - d_dump_file.write(reinterpret_cast(&d_CN0_SNV_dB_Hz), sizeof(double)); - d_dump_file.write(reinterpret_cast(&d_carrier_lock_test), sizeof(double)); + d_dump_file.write(reinterpret_cast(&d_CN0_SNV_dB_Hz), sizeof(double)); + d_dump_file.write(reinterpret_cast(&d_carrier_lock_test), sizeof(double)); // AUX vars (for debug purposes) tmp_double = d_rem_code_phase_samples; - d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); + d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); tmp_double = static_cast(d_sample_counter + d_correlation_length_samples); - d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); + d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); // PRN unsigned int prn_ = d_acquisition_gnss_synchro->PRN; - d_dump_file.write(reinterpret_cast(&prn_), sizeof(unsigned int)); - } - catch (const std::ifstream::failure* e) - { + d_dump_file.write(reinterpret_cast(&prn_), sizeof(unsigned int)); + } + catch (const std::ifstream::failure *e) + { LOG(WARNING) << "Exception writing trk dump file " << e->what(); - } + } } - consume_each(d_correlation_length_samples); // this is necessary in gr::block derivates - d_sample_counter += d_correlation_length_samples; //count for the processed samples + consume_each(d_correlation_length_samples); // this is necessary in gr::block derivates + d_sample_counter += d_correlation_length_samples; //count for the processed samples if (d_enable_tracking) - { - return 1; - }else{ - return 0; - } + { + return 1; + } + else + { + return 0; + } } @@ -547,23 +545,23 @@ void Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc::set_channel(unsigned int channel) if (d_dump_file.is_open() == false) { try - { + { d_dump_filename.append(boost::lexical_cast(d_channel)); d_dump_filename.append(".dat"); - d_dump_file.exceptions (std::ifstream::failbit | std::ifstream::badbit); + d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); LOG(INFO) << "Tracking dump enabled on channel " << d_channel << " Log file: " << d_dump_filename.c_str(); - } - catch (const std::ifstream::failure* e) - { + } + catch (const std::ifstream::failure *e) + { LOG(WARNING) << "channel " << d_channel << " Exception opening trk dump file " << e->what(); - } + } } } } -void Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) +void Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc::set_gnss_synchro(Gnss_Synchro *p_gnss_synchro) { d_acquisition_gnss_synchro = p_gnss_synchro; } diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_gpu_cc.h b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_gpu_cc.h index e2a51b108..2743f5c99 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_gpu_cc.h +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_gpu_cc.h @@ -48,56 +48,55 @@ class Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc; typedef boost::shared_ptr - gps_l1_ca_dll_pll_tracking_gpu_cc_sptr; + gps_l1_ca_dll_pll_tracking_gpu_cc_sptr; gps_l1_ca_dll_pll_tracking_gpu_cc_sptr gps_l1_ca_dll_pll_make_tracking_gpu_cc(long if_freq, - long fs_in, - unsigned int vector_length, - bool dump, - std::string dump_filename, - float pll_bw_hz, - float dll_bw_hz, - float early_late_space_chips); - + long fs_in, + unsigned int vector_length, + bool dump, + std::string dump_filename, + float pll_bw_hz, + float dll_bw_hz, + float early_late_space_chips); /*! * \brief This class implements a DLL + PLL tracking loop block */ -class Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc: public gr::block +class Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc : public gr::block { public: ~Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc(); void set_channel(unsigned int channel); - void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro); + void set_gnss_synchro(Gnss_Synchro *p_gnss_synchro); void start_tracking(); - int general_work (int noutput_items, gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); + int general_work(int noutput_items, gr_vector_int &ninput_items, + gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); - void forecast (int noutput_items, gr_vector_int &ninput_items_required); + void forecast(int noutput_items, gr_vector_int &ninput_items_required); private: friend gps_l1_ca_dll_pll_tracking_gpu_cc_sptr gps_l1_ca_dll_pll_make_tracking_gpu_cc(long if_freq, - long fs_in, - unsigned int vector_length, - bool dump, - std::string dump_filename, - float pll_bw_hz, - float dll_bw_hz, - float early_late_space_chips); + long fs_in, + unsigned int vector_length, + bool dump, + std::string dump_filename, + float pll_bw_hz, + float dll_bw_hz, + float early_late_space_chips); Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc(long if_freq, - long fs_in, - unsigned int vector_length, - bool dump, - std::string dump_filename, - float pll_bw_hz, - float dll_bw_hz, - float early_late_space_chips); + long fs_in, + unsigned int vector_length, + bool dump, + std::string dump_filename, + float pll_bw_hz, + float dll_bw_hz, + float early_late_space_chips); void update_local_code(); void update_local_carrier(); @@ -105,7 +104,7 @@ private: unsigned int d_vector_length; bool d_dump; - Gnss_Synchro* d_acquisition_gnss_synchro; + Gnss_Synchro *d_acquisition_gnss_synchro; unsigned int d_channel; long d_if_freq; @@ -116,11 +115,11 @@ private: //GPU HOST PINNED MEMORY IN/OUT VECTORS - gr_complex* in_gpu; - float* d_local_code_shift_chips; - gr_complex* d_correlator_outs; + gr_complex *in_gpu; + float *d_local_code_shift_chips; + gr_complex *d_correlator_outs; cuda_multicorrelator *multicorrelator_gpu; - gr_complex* d_ca_code; + gr_complex *d_ca_code; gr_complex *d_Early; gr_complex *d_Prompt; @@ -158,7 +157,7 @@ private: // CN0 estimation and lock detector int d_cn0_estimation_counter; - gr_complex* d_Prompt_buffer; + gr_complex *d_Prompt_buffer; double d_carrier_lock_test; double d_CN0_SNV_dB_Hz; double d_carrier_lock_threshold; @@ -176,4 +175,4 @@ private: std::string sys; }; -#endif //GNSS_SDR_GPS_L1_CA_DLL_PLL_TRACKING_GPU_CC_H +#endif //GNSS_SDR_GPS_L1_CA_DLL_PLL_TRACKING_GPU_CC_H diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_tcp_connector_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_tcp_connector_tracking_cc.cc index 33c51ee48..560e05031 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_tcp_connector_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_tcp_connector_tracking_cc.cc @@ -58,41 +58,38 @@ using google::LogMessage; gps_l1_ca_tcp_connector_tracking_cc_sptr gps_l1_ca_tcp_connector_make_tracking_cc( - long if_freq, - long fs_in, - unsigned int vector_length, - bool dump, - std::string dump_filename, - float early_late_space_chips, - size_t port_ch0) + long if_freq, + long fs_in, + unsigned int vector_length, + bool dump, + std::string dump_filename, + float early_late_space_chips, + size_t port_ch0) { return gps_l1_ca_tcp_connector_tracking_cc_sptr(new Gps_L1_Ca_Tcp_Connector_Tracking_cc(if_freq, - fs_in, vector_length, dump, dump_filename, early_late_space_chips, port_ch0)); + fs_in, vector_length, dump, dump_filename, early_late_space_chips, port_ch0)); } - -void Gps_L1_Ca_Tcp_Connector_Tracking_cc::forecast (int noutput_items, - gr_vector_int &ninput_items_required) +void Gps_L1_Ca_Tcp_Connector_Tracking_cc::forecast(int noutput_items, + gr_vector_int &ninput_items_required) { if (noutput_items != 0) { - ninput_items_required[0] = static_cast(d_vector_length) * 2; //set the required available samples in each call + ninput_items_required[0] = static_cast(d_vector_length) * 2; //set the required available samples in each call } } - Gps_L1_Ca_Tcp_Connector_Tracking_cc::Gps_L1_Ca_Tcp_Connector_Tracking_cc( - long if_freq, - long fs_in, - unsigned int vector_length, - bool dump, - std::string dump_filename, - float early_late_space_chips, - size_t port_ch0) : - gr::block("Gps_L1_Ca_Tcp_Connector_Tracking_cc", gr::io_signature::make(1, 1, sizeof(gr_complex)), - gr::io_signature::make(1, 1, sizeof(Gnss_Synchro))) + long if_freq, + long fs_in, + unsigned int vector_length, + bool dump, + std::string dump_filename, + float early_late_space_chips, + size_t port_ch0) : gr::block("Gps_L1_Ca_Tcp_Connector_Tracking_cc", gr::io_signature::make(1, 1, sizeof(gr_complex)), + gr::io_signature::make(1, 1, sizeof(Gnss_Synchro))) { // Telemetry bit synchronization message port input this->message_port_register_in(pmt::mp("preamble_timestamp_s")); @@ -105,7 +102,7 @@ Gps_L1_Ca_Tcp_Connector_Tracking_cc::Gps_L1_Ca_Tcp_Connector_Tracking_cc( d_dump_filename = dump_filename; //--- DLL variables -------------------------------------------------------- - d_early_late_spc_chips = early_late_space_chips; // Define early-late offset (in chips) + d_early_late_spc_chips = early_late_space_chips; // Define early-late offset (in chips) //--- TCP CONNECTOR variables -------------------------------------------------------- d_port_ch0 = port_ch0; @@ -115,23 +112,23 @@ Gps_L1_Ca_Tcp_Connector_Tracking_cc::Gps_L1_Ca_Tcp_Connector_Tracking_cc( // Initialization of local code replica // Get space for a vector with the C/A code replica sampled 1x/chip - d_ca_code = static_cast(volk_gnsssdr_malloc((GPS_L1_CA_CODE_LENGTH_CHIPS) * sizeof(gr_complex), volk_gnsssdr_get_alignment())); + d_ca_code = static_cast(volk_gnsssdr_malloc((GPS_L1_CA_CODE_LENGTH_CHIPS) * sizeof(gr_complex), volk_gnsssdr_get_alignment())); // correlator outputs (scalar) - d_n_correlator_taps = 3; // Very-Early, Early, Prompt, Late, Very-Late - d_correlator_outs = static_cast(volk_gnsssdr_malloc(d_n_correlator_taps * sizeof(gr_complex), volk_gnsssdr_get_alignment())); + d_n_correlator_taps = 3; // Very-Early, Early, Prompt, Late, Very-Late + d_correlator_outs = static_cast(volk_gnsssdr_malloc(d_n_correlator_taps * sizeof(gr_complex), volk_gnsssdr_get_alignment())); for (int n = 0; n < d_n_correlator_taps; n++) - { - d_correlator_outs[n] = gr_complex(0,0); - } + { + d_correlator_outs[n] = gr_complex(0, 0); + } // map memory pointers of correlator outputs d_Early = &d_correlator_outs[0]; d_Prompt = &d_correlator_outs[1]; d_Late = &d_correlator_outs[2]; - d_local_code_shift_chips = static_cast(volk_gnsssdr_malloc(d_n_correlator_taps * sizeof(float), volk_gnsssdr_get_alignment())); + d_local_code_shift_chips = static_cast(volk_gnsssdr_malloc(d_n_correlator_taps * sizeof(float), volk_gnsssdr_get_alignment())); // Set TAPs delay values [chips] - d_local_code_shift_chips[0] = - d_early_late_spc_chips; + d_local_code_shift_chips[0] = -d_early_late_spc_chips; d_local_code_shift_chips[1] = 0.0; d_local_code_shift_chips[2] = d_early_late_spc_chips; @@ -192,24 +189,24 @@ void Gps_L1_Ca_Tcp_Connector_Tracking_cc::start_tracking() d_acq_code_phase_samples = d_acquisition_gnss_synchro->Acq_delay_samples; d_acq_carrier_doppler_hz = d_acquisition_gnss_synchro->Acq_doppler_hz; - d_acq_sample_stamp = d_acquisition_gnss_synchro->Acq_samplestamp_samples; + d_acq_sample_stamp = d_acquisition_gnss_synchro->Acq_samplestamp_samples; long int acq_trk_diff_samples; float acq_trk_diff_seconds; - acq_trk_diff_samples = static_cast(d_sample_counter) - static_cast(d_acq_sample_stamp); + acq_trk_diff_samples = static_cast(d_sample_counter) - static_cast(d_acq_sample_stamp); std::cout << "acq_trk_diff_samples=" << acq_trk_diff_samples << std::endl; acq_trk_diff_seconds = static_cast(acq_trk_diff_samples) / static_cast(d_fs_in); //doppler effect // Fd=(C/(C+Vr))*F float radial_velocity; - radial_velocity = (GPS_L1_FREQ_HZ + d_acq_carrier_doppler_hz)/GPS_L1_FREQ_HZ; + radial_velocity = (GPS_L1_FREQ_HZ + d_acq_carrier_doppler_hz) / GPS_L1_FREQ_HZ; // new chip and prn sequence periods based on acq Doppler float T_chip_mod_seconds; float T_prn_mod_seconds; float T_prn_mod_samples; d_code_freq_hz = radial_velocity * GPS_L1_CA_CODE_RATE_HZ; d_code_phase_step_chips = static_cast(d_code_freq_hz) / static_cast(d_fs_in); - T_chip_mod_seconds = 1/d_code_freq_hz; + T_chip_mod_seconds = 1 / d_code_freq_hz; T_prn_mod_seconds = T_chip_mod_seconds * GPS_L1_CA_CODE_LENGTH_CHIPS; T_prn_mod_samples = T_prn_mod_seconds * static_cast(d_fs_in); @@ -238,7 +235,7 @@ void Gps_L1_Ca_Tcp_Connector_Tracking_cc::start_tracking() multicorrelator_cpu.set_local_code_and_taps(static_cast(GPS_L1_CA_CODE_LENGTH_CHIPS), d_ca_code, d_local_code_shift_chips); for (int n = 0; n < d_n_correlator_taps; n++) { - d_correlator_outs[n] = gr_complex(0,0); + d_correlator_outs[n] = gr_complex(0, 0); } d_carrier_lock_fail_counter = 0; @@ -251,7 +248,7 @@ void Gps_L1_Ca_Tcp_Connector_Tracking_cc::start_tracking() d_code_phase_samples = d_acq_code_phase_samples; std::string sys_ = &d_acquisition_gnss_synchro->System; - sys = sys_.substr(0,1); + sys = sys_.substr(0, 1); // DEBUG OUTPUT std::cout << "Tracking of GPS L1 C/A signal started on channel " << d_channel << " for satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << std::endl; @@ -262,8 +259,8 @@ void Gps_L1_Ca_Tcp_Connector_Tracking_cc::start_tracking() d_enable_tracking = true; LOG(INFO) << "PULL-IN Doppler [Hz]=" << d_carrier_doppler_hz - << " Code Phase correction [samples]=" << delay_correction_samples - << " PULL-IN Code Phase [samples]=" << d_acq_code_phase_samples; + << " Code Phase correction [samples]=" << delay_correction_samples + << " PULL-IN Code Phase [samples]=" << d_acq_code_phase_samples; } @@ -272,32 +269,32 @@ Gps_L1_Ca_Tcp_Connector_Tracking_cc::~Gps_L1_Ca_Tcp_Connector_Tracking_cc() if (d_dump_file.is_open()) { try - { + { d_dump_file.close(); - } - catch(const std::exception & ex) - { + } + catch (const std::exception &ex) + { LOG(WARNING) << "Exception in destructor " << ex.what(); - } + } } try - { + { volk_gnsssdr_free(d_local_code_shift_chips); volk_gnsssdr_free(d_correlator_outs); volk_gnsssdr_free(d_ca_code); d_tcp_com.close_tcp_connection(d_port); delete[] d_Prompt_buffer; multicorrelator_cpu.free(); - } - catch(const std::exception & ex) - { + } + catch (const std::exception &ex) + { LOG(WARNING) << "Exception in destructor " << ex.what(); - } + } } -int Gps_L1_Ca_Tcp_Connector_Tracking_cc::general_work (int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), - gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) +int Gps_L1_Ca_Tcp_Connector_Tracking_cc::general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), + gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { // process vars float carr_error; @@ -310,7 +307,7 @@ int Gps_L1_Ca_Tcp_Connector_Tracking_cc::general_work (int noutput_items __attri Gnss_Synchro current_synchro_data = Gnss_Synchro(); // Block input data and block output stream pointers - const gr_complex* in = reinterpret_cast(input_items[0]); + const gr_complex *in = reinterpret_cast(input_items[0]); Gnss_Synchro **out = reinterpret_cast(&output_items[0]); if (d_enable_tracking == true) @@ -334,9 +331,9 @@ int Gps_L1_Ca_Tcp_Connector_Tracking_cc::general_work (int noutput_items __attri current_synchro_data.fs = d_fs_in; *out[0] = current_synchro_data; d_sample_counter_seconds = d_sample_counter_seconds + (static_cast(samples_offset) / static_cast(d_fs_in)); - d_sample_counter = d_sample_counter + samples_offset; //count for the processed samples + d_sample_counter = d_sample_counter + samples_offset; //count for the processed samples d_pull_in = false; - consume_each(samples_offset); //shift input to perform alignement with local replica + consume_each(samples_offset); //shift input to perform alignement with local replica return 1; } @@ -347,30 +344,30 @@ int Gps_L1_Ca_Tcp_Connector_Tracking_cc::general_work (int noutput_items __attri // ################# CARRIER WIPEOFF AND CORRELATORS ############################## // perform carrier wipe-off and compute Early, Prompt and Late correlation - multicorrelator_cpu.set_input_output_vectors(d_correlator_outs,in); + multicorrelator_cpu.set_input_output_vectors(d_correlator_outs, in); double carr_phase_step_rad = GPS_TWO_PI * d_carrier_doppler_hz / static_cast(d_fs_in); double rem_code_phase_chips = d_rem_code_phase_samples * (d_code_freq_hz / d_fs_in); multicorrelator_cpu.Carrier_wipeoff_multicorrelator_resampler(d_rem_carr_phase_rad, - carr_phase_step_rad, - rem_code_phase_chips, - d_code_phase_step_chips, - d_current_prn_length_samples); + carr_phase_step_rad, + rem_code_phase_chips, + d_code_phase_step_chips, + d_current_prn_length_samples); //! Variable used for control d_control_id++; //! Send and receive a TCP packet boost::array tx_variables_array = {{d_control_id, - (*d_Early).real(), - (*d_Early).imag(), - (*d_Late).real(), - (*d_Late).imag(), - (*d_Prompt).real(), - (*d_Prompt).imag(), - d_acq_carrier_doppler_hz, - 1}}; + (*d_Early).real(), + (*d_Early).imag(), + (*d_Late).real(), + (*d_Late).imag(), + (*d_Prompt).real(), + (*d_Prompt).imag(), + d_acq_carrier_doppler_hz, + 1}}; d_tcp_com.send_receive_tcp_packet_gps_l1_ca(tx_variables_array, &tcp_data); //! Recover the tracking data @@ -379,12 +376,12 @@ int Gps_L1_Ca_Tcp_Connector_Tracking_cc::general_work (int noutput_items __attri // Modify carrier freq based on NCO command d_carrier_doppler_hz = tcp_data.proc_pack_carrier_doppler_hz; // Modify code freq based on NCO command - code_nco = 1/(1/GPS_L1_CA_CODE_RATE_HZ - code_error/GPS_L1_CA_CODE_LENGTH_CHIPS); + code_nco = 1 / (1 / GPS_L1_CA_CODE_RATE_HZ - code_error / GPS_L1_CA_CODE_LENGTH_CHIPS); d_code_freq_hz = code_nco; // Update the phasestep based on code freq (variable) and // sampling frequency (fixed) - d_code_phase_step_chips = d_code_freq_hz / static_cast(d_fs_in); //[chips] + d_code_phase_step_chips = d_code_freq_hz / static_cast(d_fs_in); //[chips] // variable code PRN sample block size double T_chip_seconds; double T_prn_seconds; @@ -394,7 +391,7 @@ int Gps_L1_Ca_Tcp_Connector_Tracking_cc::general_work (int noutput_items __attri T_prn_seconds = T_chip_seconds * GPS_L1_CA_CODE_LENGTH_CHIPS; T_prn_samples = T_prn_seconds * static_cast(d_fs_in); d_rem_code_phase_samples = d_next_rem_code_phase_samples; - K_blk_samples = T_prn_samples + d_rem_code_phase_samples;//-code_error*(double)d_fs_in; + K_blk_samples = T_prn_samples + d_rem_code_phase_samples; //-code_error*(double)d_fs_in; // Update the current PRN delay (code phase in samples) double T_prn_true_seconds = GPS_L1_CA_CODE_LENGTH_CHIPS / GPS_L1_CA_CODE_RATE_HZ; @@ -406,8 +403,8 @@ int Gps_L1_Ca_Tcp_Connector_Tracking_cc::general_work (int noutput_items __attri } d_code_phase_samples = fmod(d_code_phase_samples, T_prn_true_samples); - d_next_prn_length_samples = round(K_blk_samples); //round to a discrete samples - d_next_rem_code_phase_samples = K_blk_samples - d_next_prn_length_samples; //rounding error + d_next_prn_length_samples = round(K_blk_samples); //round to a discrete samples + d_next_rem_code_phase_samples = K_blk_samples - d_next_prn_length_samples; //rounding error /*! * \todo Improve the lock detection algorithm! @@ -438,10 +435,9 @@ int Gps_L1_Ca_Tcp_Connector_Tracking_cc::general_work (int noutput_items __attri { std::cout << "Loss of lock in channel " << d_channel << "!" << std::endl; LOG(INFO) << "Loss of lock in channel " << d_channel << "!"; - this->message_port_pub(pmt::mp("events"), pmt::from_long(3));//3 -> loss of lock + this->message_port_pub(pmt::mp("events"), pmt::from_long(3)); //3 -> loss of lock d_carrier_lock_fail_counter = 0; - d_enable_tracking = false; // TODO: check if disabling tracking is consistent with the channel state machine - + d_enable_tracking = false; // TODO: check if disabling tracking is consistent with the channel state machine } } @@ -450,38 +446,37 @@ int Gps_L1_Ca_Tcp_Connector_Tracking_cc::general_work (int noutput_items __attri current_synchro_data.Prompt_I = static_cast((*d_Prompt).real()); current_synchro_data.Prompt_Q = static_cast((*d_Prompt).imag()); //compute remnant code phase samples AFTER the Tracking timestamp - d_rem_code_phase_samples = K_blk_samples - d_current_prn_length_samples; //rounding error < 1 sample + d_rem_code_phase_samples = K_blk_samples - d_current_prn_length_samples; //rounding error < 1 sample current_synchro_data.Tracking_sample_counter = d_sample_counter + d_current_prn_length_samples; current_synchro_data.Code_phase_samples = d_rem_code_phase_samples; current_synchro_data.Carrier_phase_rads = static_cast(d_acc_carrier_phase_rad); current_synchro_data.Carrier_Doppler_hz = static_cast(d_carrier_doppler_hz); current_synchro_data.CN0_dB_hz = static_cast(d_CN0_SNV_dB_Hz); current_synchro_data.Flag_valid_symbol_output = true; - current_synchro_data.correlation_length_ms=1; + current_synchro_data.correlation_length_ms = 1; } else { - - *d_Early = gr_complex(0,0); - *d_Prompt = gr_complex(0,0); - *d_Late = gr_complex(0,0); + *d_Early = gr_complex(0, 0); + *d_Prompt = gr_complex(0, 0); + *d_Late = gr_complex(0, 0); // GNSS_SYNCHRO OBJECT to interchange data between tracking->telemetry_decoder current_synchro_data.Tracking_sample_counter = d_sample_counter + d_correlation_length_samples; //! When tracking is disabled an array of 1's is sent to maintain the TCP connection - boost::array tx_variables_array = {{1,1,1,1,1,1,1,1,0}}; + boost::array tx_variables_array = {{1, 1, 1, 1, 1, 1, 1, 1, 0}}; d_tcp_com.send_receive_tcp_packet_gps_l1_ca(tx_variables_array, &tcp_data); } //assign the GNURadio block output data current_synchro_data.System = {'G'}; std::string str_aux = "1C"; - const char * str = str_aux.c_str(); // get a C style null terminated string - std::memcpy(static_cast(current_synchro_data.Signal), str, 3); + const char *str = str_aux.c_str(); // get a C style null terminated string + std::memcpy(static_cast(current_synchro_data.Signal), str, 3); current_synchro_data.fs = d_fs_in; *out[0] = current_synchro_data; - if(d_dump) + if (d_dump) { // MULTIPLEXED FILE RECORDING - Record results to file float prompt_I; @@ -494,65 +489,66 @@ int Gps_L1_Ca_Tcp_Connector_Tracking_cc::general_work (int noutput_items __attri tmp_P = std::abs(*d_Prompt); tmp_L = std::abs(*d_Late); try - { + { // EPR - d_dump_file.write(reinterpret_cast(&tmp_E), sizeof(float)); - d_dump_file.write(reinterpret_cast(&tmp_P), sizeof(float)); - d_dump_file.write(reinterpret_cast(&tmp_L), sizeof(float)); + d_dump_file.write(reinterpret_cast(&tmp_E), sizeof(float)); + d_dump_file.write(reinterpret_cast(&tmp_P), sizeof(float)); + d_dump_file.write(reinterpret_cast(&tmp_L), sizeof(float)); // PROMPT I and Q (to analyze navigation symbols) - d_dump_file.write(reinterpret_cast(&prompt_I), sizeof(float)); - d_dump_file.write(reinterpret_cast(&prompt_Q), sizeof(float)); + d_dump_file.write(reinterpret_cast(&prompt_I), sizeof(float)); + d_dump_file.write(reinterpret_cast(&prompt_Q), sizeof(float)); // PRN start sample stamp //tmp_float=(float)d_sample_counter; - d_dump_file.write(reinterpret_cast(&d_sample_counter), sizeof(unsigned long int)); + d_dump_file.write(reinterpret_cast(&d_sample_counter), sizeof(unsigned long int)); // accumulated carrier phase - d_dump_file.write(reinterpret_cast(&d_acc_carrier_phase_rad), sizeof(float)); + d_dump_file.write(reinterpret_cast(&d_acc_carrier_phase_rad), sizeof(float)); // carrier and code frequency - d_dump_file.write(reinterpret_cast(&d_carrier_doppler_hz), sizeof(float)); - d_dump_file.write(reinterpret_cast(&d_code_freq_hz), sizeof(float)); + d_dump_file.write(reinterpret_cast(&d_carrier_doppler_hz), sizeof(float)); + d_dump_file.write(reinterpret_cast(&d_code_freq_hz), sizeof(float)); //PLL commands - d_dump_file.write(reinterpret_cast(&carr_error), sizeof(float)); - d_dump_file.write(reinterpret_cast(&carr_nco), sizeof(float)); + d_dump_file.write(reinterpret_cast(&carr_error), sizeof(float)); + d_dump_file.write(reinterpret_cast(&carr_nco), sizeof(float)); //DLL commands - d_dump_file.write(reinterpret_cast(&code_error), sizeof(float)); - d_dump_file.write(reinterpret_cast(&code_nco), sizeof(float)); + d_dump_file.write(reinterpret_cast(&code_error), sizeof(float)); + d_dump_file.write(reinterpret_cast(&code_nco), sizeof(float)); // CN0 and carrier lock test - d_dump_file.write(reinterpret_cast(&d_CN0_SNV_dB_Hz), sizeof(float)); - d_dump_file.write(reinterpret_cast(&d_carrier_lock_test), sizeof(float)); + d_dump_file.write(reinterpret_cast(&d_CN0_SNV_dB_Hz), sizeof(float)); + d_dump_file.write(reinterpret_cast(&d_carrier_lock_test), sizeof(float)); // AUX vars (for debug purposes) tmp_float = 0; - d_dump_file.write(reinterpret_cast(&tmp_float), sizeof(float)); - d_dump_file.write(reinterpret_cast(&d_sample_counter_seconds), sizeof(double)); + d_dump_file.write(reinterpret_cast(&tmp_float), sizeof(float)); + d_dump_file.write(reinterpret_cast(&d_sample_counter_seconds), sizeof(double)); // PRN unsigned int prn_ = d_acquisition_gnss_synchro->PRN; - d_dump_file.write(reinterpret_cast(&prn_), sizeof(unsigned int)); - } + d_dump_file.write(reinterpret_cast(&prn_), sizeof(unsigned int)); + } catch (const std::ifstream::failure &e) - { + { LOG(WARNING) << "Exception writing trk dump file " << e.what(); - } + } } - consume_each(d_current_prn_length_samples); // this is necessary in gr::block derivates - d_sample_counter_seconds = d_sample_counter_seconds + ( static_cast(d_current_prn_length_samples) / static_cast(d_fs_in) ); - d_sample_counter += d_current_prn_length_samples; //count for the processed samples + consume_each(d_current_prn_length_samples); // this is necessary in gr::block derivates + d_sample_counter_seconds = d_sample_counter_seconds + (static_cast(d_current_prn_length_samples) / static_cast(d_fs_in)); + d_sample_counter += d_current_prn_length_samples; //count for the processed samples if (d_enable_tracking) - { - return 1; - }else{ - return 0; - } + { + return 1; + } + else + { + return 0; + } } - void Gps_L1_Ca_Tcp_Connector_Tracking_cc::set_channel(unsigned int channel) { d_channel = channel; @@ -563,17 +559,17 @@ void Gps_L1_Ca_Tcp_Connector_Tracking_cc::set_channel(unsigned int channel) if (d_dump_file.is_open() == false) { try - { + { d_dump_filename.append(boost::lexical_cast(d_channel)); d_dump_filename.append(".dat"); - d_dump_file.exceptions (std::ifstream::failbit | std::ifstream::badbit); + d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); LOG(INFO) << "Tracking dump enabled on channel " << d_channel << " Log file: " << d_dump_filename.c_str(); - } + } catch (const std::ifstream::failure &e) - { + { LOG(WARNING) << "channel " << d_channel << " Exception opening trk dump file " << e.what(); - } + } } } @@ -586,8 +582,7 @@ void Gps_L1_Ca_Tcp_Connector_Tracking_cc::set_channel(unsigned int channel) } -void Gps_L1_Ca_Tcp_Connector_Tracking_cc::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) +void Gps_L1_Ca_Tcp_Connector_Tracking_cc::set_gnss_synchro(Gnss_Synchro *p_gnss_synchro) { d_acquisition_gnss_synchro = p_gnss_synchro; - } diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_tcp_connector_tracking_cc.h b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_tcp_connector_tracking_cc.h index 20a92da70..89140e4b6 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_tcp_connector_tracking_cc.h +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_tcp_connector_tracking_cc.h @@ -46,31 +46,29 @@ #include "tcp_communication.h" - class Gps_L1_Ca_Tcp_Connector_Tracking_cc; typedef boost::shared_ptr gps_l1_ca_tcp_connector_tracking_cc_sptr; gps_l1_ca_tcp_connector_tracking_cc_sptr gps_l1_ca_tcp_connector_make_tracking_cc(long if_freq, - long fs_in, unsigned - int vector_length, - bool dump, - std::string dump_filename, - float early_late_space_chips, - size_t port_ch0); + long fs_in, unsigned int vector_length, + bool dump, + std::string dump_filename, + float early_late_space_chips, + size_t port_ch0); /*! * \brief This class implements a DLL + PLL tracking loop block */ -class Gps_L1_Ca_Tcp_Connector_Tracking_cc: public gr::block +class Gps_L1_Ca_Tcp_Connector_Tracking_cc : public gr::block { public: ~Gps_L1_Ca_Tcp_Connector_Tracking_cc(); void set_channel(unsigned int channel); - void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro); + void set_gnss_synchro(Gnss_Synchro *p_gnss_synchro); void start_tracking(); /* @@ -78,33 +76,32 @@ public: * * The user must override work to define the signal processing code */ - int general_work (int noutput_items, gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); + int general_work(int noutput_items, gr_vector_int &ninput_items, + gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); + + void forecast(int noutput_items, gr_vector_int &ninput_items_required); - void forecast (int noutput_items, gr_vector_int &ninput_items_required); private: friend gps_l1_ca_tcp_connector_tracking_cc_sptr gps_l1_ca_tcp_connector_make_tracking_cc(long if_freq, - long fs_in, unsigned - int vector_length, - bool dump, - std::string dump_filename, - float early_late_space_chips, - size_t port_ch0); + long fs_in, unsigned int vector_length, + bool dump, + std::string dump_filename, + float early_late_space_chips, + size_t port_ch0); Gps_L1_Ca_Tcp_Connector_Tracking_cc(long if_freq, - long fs_in, unsigned - int vector_length, - bool dump, - std::string dump_filename, - float early_late_space_chips, - size_t port_ch0); + long fs_in, unsigned int vector_length, + bool dump, + std::string dump_filename, + float early_late_space_chips, + size_t port_ch0); // tracking configuration vars unsigned int d_vector_length; bool d_dump; - Gnss_Synchro* d_acquisition_gnss_synchro; + Gnss_Synchro *d_acquisition_gnss_synchro; unsigned int d_channel; long d_if_freq; @@ -115,7 +112,7 @@ private: double d_code_phase_step_chips; - gr_complex* d_ca_code; + gr_complex *d_ca_code; gr_complex *d_Early; gr_complex *d_Prompt; @@ -130,8 +127,8 @@ private: float d_acq_code_phase_samples; float d_acq_carrier_doppler_hz; // correlator - float* d_local_code_shift_chips; - gr_complex* d_correlator_outs; + float *d_local_code_shift_chips; + gr_complex *d_correlator_outs; cpu_multicorrelator multicorrelator_cpu; // tracking vars @@ -156,7 +153,7 @@ private: // CN0 estimation and lock detector int d_cn0_estimation_counter; - gr_complex* d_Prompt_buffer; + gr_complex *d_Prompt_buffer; float d_carrier_lock_test; float d_CN0_SNV_dB_Hz; float d_carrier_lock_threshold; @@ -174,4 +171,4 @@ private: std::string sys; }; -#endif //GNSS_SDR_GPS_L1_CA_TCP_CONNECTOR_TRACKING_CC_H +#endif //GNSS_SDR_GPS_L1_CA_TCP_CONNECTOR_TRACKING_CC_H diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l2_m_dll_pll_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/gps_l2_m_dll_pll_tracking_cc.cc index bf1f1513b..a10302d18 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l2_m_dll_pll_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l2_m_dll_pll_tracking_cc.cc @@ -55,41 +55,40 @@ using google::LogMessage; gps_l2_m_dll_pll_tracking_cc_sptr gps_l2_m_dll_pll_make_tracking_cc( - long if_freq, - long fs_in, - unsigned int vector_length, - bool dump, - std::string dump_filename, - float pll_bw_hz, - float dll_bw_hz, - float early_late_space_chips) + long if_freq, + long fs_in, + unsigned int vector_length, + bool dump, + std::string dump_filename, + float pll_bw_hz, + float dll_bw_hz, + float early_late_space_chips) { return gps_l2_m_dll_pll_tracking_cc_sptr(new gps_l2_m_dll_pll_tracking_cc(if_freq, - fs_in, vector_length, dump, dump_filename, pll_bw_hz, dll_bw_hz, early_late_space_chips)); + fs_in, vector_length, dump, dump_filename, pll_bw_hz, dll_bw_hz, early_late_space_chips)); } -void gps_l2_m_dll_pll_tracking_cc::forecast (int noutput_items, - gr_vector_int &ninput_items_required) +void gps_l2_m_dll_pll_tracking_cc::forecast(int noutput_items, + gr_vector_int &ninput_items_required) { if (noutput_items != 0) { - ninput_items_required[0] = static_cast(d_vector_length) * 2; //set the required available samples in each call + ninput_items_required[0] = static_cast(d_vector_length) * 2; //set the required available samples in each call } } gps_l2_m_dll_pll_tracking_cc::gps_l2_m_dll_pll_tracking_cc( - long if_freq, - long fs_in, - unsigned int vector_length, - bool dump, - std::string dump_filename, - float pll_bw_hz, - float dll_bw_hz, - float early_late_space_chips) : - gr::block("gps_l2_m_dll_pll_tracking_cc", gr::io_signature::make(1, 1, sizeof(gr_complex)), - gr::io_signature::make(1, 1, sizeof(Gnss_Synchro))) + long if_freq, + long fs_in, + unsigned int vector_length, + bool dump, + std::string dump_filename, + float pll_bw_hz, + float dll_bw_hz, + float early_late_space_chips) : gr::block("gps_l2_m_dll_pll_tracking_cc", gr::io_signature::make(1, 1, sizeof(gr_complex)), + gr::io_signature::make(1, 1, sizeof(Gnss_Synchro))) { // Telemetry bit synchronization message port input this->message_port_register_in(pmt::mp("preamble_timestamp_s")); @@ -104,30 +103,30 @@ gps_l2_m_dll_pll_tracking_cc::gps_l2_m_dll_pll_tracking_cc( d_current_prn_length_samples = static_cast(d_vector_length); // DLL/PLL filter initialization - d_carrier_loop_filter=Tracking_2nd_PLL_filter(GPS_L2_M_PERIOD); - d_code_loop_filter=Tracking_2nd_DLL_filter(GPS_L2_M_PERIOD); + d_carrier_loop_filter = Tracking_2nd_PLL_filter(GPS_L2_M_PERIOD); + d_code_loop_filter = Tracking_2nd_DLL_filter(GPS_L2_M_PERIOD); // Initialize tracking ========================================== d_code_loop_filter.set_DLL_BW(dll_bw_hz); d_carrier_loop_filter.set_PLL_BW(pll_bw_hz); //--- DLL variables -------------------------------------------------------- - d_early_late_spc_chips = early_late_space_chips; // Define early-late offset (in chips) + d_early_late_spc_chips = early_late_space_chips; // Define early-late offset (in chips) // Initialization of local code replica // Get space for a vector with the C/A code replica sampled 1x/chip - d_ca_code = static_cast(volk_gnsssdr_malloc(static_cast(GPS_L2_M_CODE_LENGTH_CHIPS) * sizeof(gr_complex), volk_gnsssdr_get_alignment())); + d_ca_code = static_cast(volk_gnsssdr_malloc(static_cast(GPS_L2_M_CODE_LENGTH_CHIPS) * sizeof(gr_complex), volk_gnsssdr_get_alignment())); // correlator outputs (scalar) - d_n_correlator_taps = 3; // Early, Prompt, and Late - d_correlator_outs = static_cast(volk_gnsssdr_malloc(d_n_correlator_taps*sizeof(gr_complex), volk_gnsssdr_get_alignment())); + d_n_correlator_taps = 3; // Early, Prompt, and Late + d_correlator_outs = static_cast(volk_gnsssdr_malloc(d_n_correlator_taps * sizeof(gr_complex), volk_gnsssdr_get_alignment())); for (int n = 0; n < d_n_correlator_taps; n++) { - d_correlator_outs[n] = gr_complex(0,0); + d_correlator_outs[n] = gr_complex(0, 0); } - d_local_code_shift_chips = static_cast(volk_gnsssdr_malloc(d_n_correlator_taps*sizeof(float), volk_gnsssdr_get_alignment())); + d_local_code_shift_chips = static_cast(volk_gnsssdr_malloc(d_n_correlator_taps * sizeof(float), volk_gnsssdr_get_alignment())); // Set TAPs delay values [chips] - d_local_code_shift_chips[0] = - d_early_late_spc_chips; + d_local_code_shift_chips[0] = -d_early_late_spc_chips; d_local_code_shift_chips[1] = 0.0; d_local_code_shift_chips[2] = d_early_late_spc_chips; @@ -188,7 +187,7 @@ void gps_l2_m_dll_pll_tracking_cc::start_tracking() long int acq_trk_diff_samples; double acq_trk_diff_seconds; - acq_trk_diff_samples = static_cast(d_sample_counter) - static_cast(d_acq_sample_stamp); //-d_vector_length; + acq_trk_diff_samples = static_cast(d_sample_counter) - static_cast(d_acq_sample_stamp); //-d_vector_length; DLOG(INFO) << "Number of samples between Acquisition and Tracking =" << acq_trk_diff_samples; acq_trk_diff_seconds = static_cast(acq_trk_diff_samples) / static_cast(d_fs_in); // Doppler effect @@ -200,7 +199,7 @@ void gps_l2_m_dll_pll_tracking_cc::start_tracking() double T_prn_mod_samples; d_code_freq_chips = radial_velocity * GPS_L2_M_CODE_RATE_HZ; d_code_phase_step_chips = static_cast(d_code_freq_chips) / static_cast(d_fs_in); - T_chip_mod_seconds = 1/d_code_freq_chips; + T_chip_mod_seconds = 1 / d_code_freq_chips; T_prn_mod_seconds = T_chip_mod_seconds * GPS_L2_M_CODE_LENGTH_CHIPS; T_prn_mod_samples = T_prn_mod_seconds * static_cast(d_fs_in); @@ -224,8 +223,8 @@ void gps_l2_m_dll_pll_tracking_cc::start_tracking() d_carrier_phase_step_rad = GPS_L2_TWO_PI * d_carrier_doppler_hz / static_cast(d_fs_in); // DLL/PLL filter initialization - d_carrier_loop_filter.initialize(); // initialize the carrier filter - d_code_loop_filter.initialize(); // initialize the code filter + d_carrier_loop_filter.initialize(); // initialize the carrier filter + d_code_loop_filter.initialize(); // initialize the code filter // generate local reference ALWAYS starting at chip 1 (1 sample per chip) gps_l2c_m_code_gen_complex(d_ca_code, d_acquisition_gnss_synchro->PRN); @@ -233,7 +232,7 @@ void gps_l2_m_dll_pll_tracking_cc::start_tracking() multicorrelator_cpu.set_local_code_and_taps(static_cast(GPS_L2_M_CODE_LENGTH_CHIPS), d_ca_code, d_local_code_shift_chips); for (int n = 0; n < d_n_correlator_taps; n++) { - d_correlator_outs[n] = gr_complex(0,0); + d_correlator_outs[n] = gr_complex(0, 0); } d_carrier_lock_fail_counter = 0; @@ -245,7 +244,7 @@ void gps_l2_m_dll_pll_tracking_cc::start_tracking() d_code_phase_samples = d_acq_code_phase_samples; std::string sys_ = &d_acquisition_gnss_synchro->System; - sys = sys_.substr(0,1); + sys = sys_.substr(0, 1); // DEBUG OUTPUT std::cout << "Tracking of GPS L2CM signal started on channel " << d_channel << " for satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << std::endl; @@ -268,18 +267,18 @@ int gps_l2_m_dll_pll_tracking_cc::save_matfile() int number_of_double_vars = 11; int number_of_float_vars = 5; int epoch_size_bytes = sizeof(unsigned long int) + sizeof(double) * number_of_double_vars + - sizeof(float) * number_of_float_vars + sizeof(unsigned int); + sizeof(float) * number_of_float_vars + sizeof(unsigned int); std::ifstream dump_file; dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); try - { + { dump_file.open(d_dump_filename.c_str(), std::ios::binary | std::ios::ate); - } - catch(const std::ifstream::failure &e) - { - std::cerr << "Problem opening dump file:" << e.what() << std::endl; + } + catch (const std::ifstream::failure &e) + { + std::cerr << "Problem opening dump file:" << e.what() << std::endl; return 1; - } + } // count number of epochs and rewind long int num_epoch = 0; if (dump_file.is_open()) @@ -292,30 +291,30 @@ int gps_l2_m_dll_pll_tracking_cc::save_matfile() { return 1; } - float * abs_E = new float [num_epoch]; - float * abs_P = new float [num_epoch]; - float * abs_L = new float [num_epoch]; - float * Prompt_I = new float [num_epoch]; - float * Prompt_Q = new float [num_epoch]; - unsigned long int * PRN_start_sample_count = new unsigned long int [num_epoch]; - double * acc_carrier_phase_rad = new double [num_epoch]; - double * carrier_doppler_hz = new double [num_epoch]; - double * code_freq_chips = new double [num_epoch]; - double * carr_error_hz = new double [num_epoch]; - double * carr_error_filt_hz = new double [num_epoch]; - double * code_error_chips = new double [num_epoch]; - double * code_error_filt_chips = new double [num_epoch]; - double * CN0_SNV_dB_Hz = new double [num_epoch]; - double * carrier_lock_test = new double [num_epoch]; - double * aux1 = new double [num_epoch]; - double * aux2 = new double [num_epoch]; - unsigned int * PRN = new unsigned int [num_epoch]; + float *abs_E = new float[num_epoch]; + float *abs_P = new float[num_epoch]; + float *abs_L = new float[num_epoch]; + float *Prompt_I = new float[num_epoch]; + float *Prompt_Q = new float[num_epoch]; + unsigned long int *PRN_start_sample_count = new unsigned long int[num_epoch]; + double *acc_carrier_phase_rad = new double[num_epoch]; + double *carrier_doppler_hz = new double[num_epoch]; + double *code_freq_chips = new double[num_epoch]; + double *carr_error_hz = new double[num_epoch]; + double *carr_error_filt_hz = new double[num_epoch]; + double *code_error_chips = new double[num_epoch]; + double *code_error_filt_chips = new double[num_epoch]; + double *CN0_SNV_dB_Hz = new double[num_epoch]; + double *carrier_lock_test = new double[num_epoch]; + double *aux1 = new double[num_epoch]; + double *aux2 = new double[num_epoch]; + unsigned int *PRN = new unsigned int[num_epoch]; try - { + { if (dump_file.is_open()) { - for(long int i = 0; i < num_epoch; i++) + for (long int i = 0; i < num_epoch; i++) { dump_file.read(reinterpret_cast(&abs_E[i]), sizeof(float)); dump_file.read(reinterpret_cast(&abs_P[i]), sizeof(float)); @@ -338,10 +337,10 @@ int gps_l2_m_dll_pll_tracking_cc::save_matfile() } } dump_file.close(); - } + } catch (const std::ifstream::failure &e) - { - std::cerr << "Problem reading dump file:" << e.what() << std::endl; + { + std::cerr << "Problem reading dump file:" << e.what() << std::endl; delete[] abs_E; delete[] abs_P; delete[] abs_L; @@ -361,7 +360,7 @@ int gps_l2_m_dll_pll_tracking_cc::save_matfile() delete[] aux2; delete[] PRN; return 1; - } + } // WRITE MAT FILE mat_t *matfp; @@ -370,79 +369,79 @@ int gps_l2_m_dll_pll_tracking_cc::save_matfile() filename.erase(filename.length() - 4, 4); filename.append(".mat"); matfp = Mat_CreateVer(filename.c_str(), NULL, MAT_FT_MAT73); - if(reinterpret_cast(matfp) != NULL) + if (reinterpret_cast(matfp) != NULL) { size_t dims[2] = {1, static_cast(num_epoch)}; matvar = Mat_VarCreate("abs_E", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, abs_E, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("abs_P", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, abs_P, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("abs_L", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, abs_L, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("Prompt_I", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, Prompt_I, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("Prompt_Q", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, Prompt_Q, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("PRN_start_sample_count", MAT_C_UINT64, MAT_T_UINT64, 2, dims, PRN_start_sample_count, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("acc_carrier_phase_rad", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, acc_carrier_phase_rad, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("carrier_doppler_hz", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, carrier_doppler_hz, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("code_freq_chips", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, code_freq_chips, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("carr_error_hz", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, carr_error_hz, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("carr_error_filt_hz", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, carr_error_filt_hz, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("code_error_chips", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, code_error_chips, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("code_error_filt_chips", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, code_error_filt_chips, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("CN0_SNV_dB_Hz", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, CN0_SNV_dB_Hz, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("carrier_lock_test", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, carrier_lock_test, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("aux1", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, aux1, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("aux2", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, aux2, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("PRN", MAT_C_UINT32, MAT_T_UINT32, 2, dims, PRN, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); } Mat_Close(matfp); @@ -473,43 +472,43 @@ gps_l2_m_dll_pll_tracking_cc::~gps_l2_m_dll_pll_tracking_cc() if (d_dump_file.is_open()) { try - { + { d_dump_file.close(); - } - catch(const std::exception & ex) - { + } + catch (const std::exception &ex) + { LOG(WARNING) << "Exception in destructor " << ex.what(); - } + } } - if(d_dump) + if (d_dump) { - if(d_channel == 0) + if (d_channel == 0) { std::cout << "Writing .mat files ..."; } gps_l2_m_dll_pll_tracking_cc::save_matfile(); - if(d_channel == 0) + if (d_channel == 0) { std::cout << " done." << std::endl; } } try - { + { volk_gnsssdr_free(d_local_code_shift_chips); volk_gnsssdr_free(d_correlator_outs); volk_gnsssdr_free(d_ca_code); delete[] d_Prompt_buffer; multicorrelator_cpu.free(); - } - catch(const std::exception & ex) - { + } + catch (const std::exception &ex) + { LOG(WARNING) << "Exception in destructor " << ex.what(); - } + } } -int gps_l2_m_dll_pll_tracking_cc::general_work (int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), - gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) +int gps_l2_m_dll_pll_tracking_cc::general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), + gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { // process vars double carr_error_hz = 0; @@ -521,7 +520,7 @@ int gps_l2_m_dll_pll_tracking_cc::general_work (int noutput_items __attribute__( Gnss_Synchro current_synchro_data = Gnss_Synchro(); // Block input data and block output stream pointers - const gr_complex* in = reinterpret_cast(input_items[0]); + const gr_complex *in = reinterpret_cast(input_items[0]); Gnss_Synchro **out = reinterpret_cast(&output_items[0]); if (d_enable_tracking == true) @@ -538,7 +537,7 @@ int gps_l2_m_dll_pll_tracking_cc::general_work (int noutput_items __attribute__( acq_trk_shif_correction_samples = d_current_prn_length_samples - fmod(static_cast(acq_to_trk_delay_samples), static_cast(d_current_prn_length_samples)); samples_offset = round(d_acq_code_phase_samples + acq_trk_shif_correction_samples); current_synchro_data.Tracking_sample_counter = d_sample_counter + samples_offset; - d_sample_counter = d_sample_counter + samples_offset; // count for the processed samples + d_sample_counter = d_sample_counter + samples_offset; // count for the processed samples d_pull_in = false; // take into account the carrier cycles accumulated in the pull in signal alignment d_acc_carrier_phase_rad -= d_carrier_phase_step_rad * samples_offset; @@ -546,7 +545,7 @@ int gps_l2_m_dll_pll_tracking_cc::general_work (int noutput_items __attribute__( current_synchro_data.Carrier_Doppler_hz = d_carrier_doppler_hz; current_synchro_data.fs = d_fs_in; current_synchro_data.correlation_length_ms = 20; - consume_each(samples_offset); // shift input to perform alignment with local replica + consume_each(samples_offset); // shift input to perform alignment with local replica return 0; } @@ -554,10 +553,10 @@ int gps_l2_m_dll_pll_tracking_cc::general_work (int noutput_items __attribute__( // perform carrier wipe-off and compute Early, Prompt and Late correlation multicorrelator_cpu.set_input_output_vectors(d_correlator_outs, in); multicorrelator_cpu.Carrier_wipeoff_multicorrelator_resampler(d_rem_carr_phase_rad, - d_carrier_phase_step_rad, - d_rem_code_phase_chips, - d_code_phase_step_chips, - d_current_prn_length_samples); + d_carrier_phase_step_rad, + d_rem_code_phase_chips, + d_code_phase_step_chips, + d_current_prn_length_samples); // ################## PLL ########################################################## // PLL discriminator @@ -572,12 +571,12 @@ int gps_l2_m_dll_pll_tracking_cc::general_work (int noutput_items __attribute__( // ################## DLL ########################################################## // DLL discriminator - code_error_chips = dll_nc_e_minus_l_normalized(d_correlator_outs[0], d_correlator_outs[2]); // [chips/Ti] + code_error_chips = dll_nc_e_minus_l_normalized(d_correlator_outs[0], d_correlator_outs[2]); // [chips/Ti] // Code discriminator filter - code_error_filt_chips = d_code_loop_filter.get_code_nco(code_error_chips); //[chips/second] + code_error_filt_chips = d_code_loop_filter.get_code_nco(code_error_chips); //[chips/second] double T_chip_seconds = 1.0 / static_cast(d_code_freq_chips); double T_prn_seconds = T_chip_seconds * GPS_L2_M_CODE_LENGTH_CHIPS; - double code_error_filt_secs = (T_prn_seconds * code_error_filt_chips*T_chip_seconds); //[seconds] + double code_error_filt_secs = (T_prn_seconds * code_error_filt_chips * T_chip_seconds); //[seconds] //double code_error_filt_secs = (GPS_L2_M_PERIOD * code_error_filt_chips) / GPS_L2_M_CODE_RATE_HZ; //[seconds] // ################## CARRIER AND CODE NCO BUFFER ALIGNEMENT ####################### @@ -585,7 +584,7 @@ int gps_l2_m_dll_pll_tracking_cc::general_work (int noutput_items __attribute__( // Compute the next buffer length based in the new period of the PRN sequence and the code phase error estimation double T_prn_samples = T_prn_seconds * static_cast(d_fs_in); double K_blk_samples = T_prn_samples + d_rem_code_phase_samples + code_error_filt_secs * static_cast(d_fs_in); - d_current_prn_length_samples = round(K_blk_samples); // round to a discrete number of samples + d_current_prn_length_samples = round(K_blk_samples); // round to a discrete number of samples //################### PLL COMMANDS ################################################# // carrier phase step (NCO phase increment per sample) [rads/sample] @@ -600,7 +599,7 @@ int gps_l2_m_dll_pll_tracking_cc::general_work (int noutput_items __attribute__( // code phase step (Code resampler phase increment per sample) [chips/sample] d_code_phase_step_chips = d_code_freq_chips / static_cast(d_fs_in); // remnant code phase [chips] - d_rem_code_phase_samples = K_blk_samples - d_current_prn_length_samples; // rounding error < 1 sample + d_rem_code_phase_samples = K_blk_samples - d_current_prn_length_samples; // rounding error < 1 sample d_rem_code_phase_chips = d_code_freq_chips * (d_rem_code_phase_samples / static_cast(d_fs_in)); // ####### CN0 ESTIMATION AND LOCK DETECTORS ###### @@ -630,9 +629,9 @@ int gps_l2_m_dll_pll_tracking_cc::general_work (int noutput_items __attribute__( { std::cout << "Loss of lock in channel " << d_channel << "!" << std::endl; LOG(INFO) << "Loss of lock in channel " << d_channel << "!"; - this->message_port_pub(pmt::mp("events"), pmt::from_long(3));//3 -> loss of lock + this->message_port_pub(pmt::mp("events"), pmt::from_long(3)); //3 -> loss of lock d_carrier_lock_fail_counter = 0; - d_enable_tracking = false; // TODO: check if disabling tracking is consistent with the channel state machine + d_enable_tracking = false; // TODO: check if disabling tracking is consistent with the channel state machine } } // ########### Output the tracking data to navigation and PVT ########## @@ -650,7 +649,7 @@ int gps_l2_m_dll_pll_tracking_cc::general_work (int noutput_items __attribute__( { for (int n = 0; n < d_n_correlator_taps; n++) { - d_correlator_outs[n] = gr_complex(0,0); + d_correlator_outs[n] = gr_complex(0, 0); } current_synchro_data.Tracking_sample_counter = d_sample_counter + d_current_prn_length_samples; current_synchro_data.correlation_length_ms = 20; @@ -659,7 +658,7 @@ int gps_l2_m_dll_pll_tracking_cc::general_work (int noutput_items __attribute__( current_synchro_data.fs = d_fs_in; *out[0] = current_synchro_data; - if(d_dump) + if (d_dump) { // MULTIPLEXED FILE RECORDING - Record results to file float prompt_I; @@ -672,55 +671,61 @@ int gps_l2_m_dll_pll_tracking_cc::general_work (int noutput_items __attribute__( tmp_P = std::abs(d_correlator_outs[1]); tmp_L = std::abs(d_correlator_outs[2]); try - { + { // EPR - d_dump_file.write(reinterpret_cast(&tmp_E), sizeof(float)); - d_dump_file.write(reinterpret_cast(&tmp_P), sizeof(float)); - d_dump_file.write(reinterpret_cast(&tmp_L), sizeof(float)); + d_dump_file.write(reinterpret_cast(&tmp_E), sizeof(float)); + d_dump_file.write(reinterpret_cast(&tmp_P), sizeof(float)); + d_dump_file.write(reinterpret_cast(&tmp_L), sizeof(float)); // PROMPT I and Q (to analyze navigation symbols) - d_dump_file.write(reinterpret_cast(&prompt_I), sizeof(float)); - d_dump_file.write(reinterpret_cast(&prompt_Q), sizeof(float)); + d_dump_file.write(reinterpret_cast(&prompt_I), sizeof(float)); + d_dump_file.write(reinterpret_cast(&prompt_Q), sizeof(float)); // PRN start sample stamp //tmp_float=(float)d_sample_counter; - d_dump_file.write(reinterpret_cast(&d_sample_counter), sizeof(unsigned long int)); + d_dump_file.write(reinterpret_cast(&d_sample_counter), sizeof(unsigned long int)); // accumulated carrier phase - d_dump_file.write(reinterpret_cast(&d_acc_carrier_phase_rad), sizeof(double)); + d_dump_file.write(reinterpret_cast(&d_acc_carrier_phase_rad), sizeof(double)); // carrier and code frequency - d_dump_file.write(reinterpret_cast(&d_carrier_doppler_hz), sizeof(double)); - d_dump_file.write(reinterpret_cast(&d_code_freq_chips), sizeof(double)); + d_dump_file.write(reinterpret_cast(&d_carrier_doppler_hz), sizeof(double)); + d_dump_file.write(reinterpret_cast(&d_code_freq_chips), sizeof(double)); //PLL commands - d_dump_file.write(reinterpret_cast(&carr_error_hz), sizeof(double)); - d_dump_file.write(reinterpret_cast(&d_carrier_doppler_hz), sizeof(double)); + d_dump_file.write(reinterpret_cast(&carr_error_hz), sizeof(double)); + d_dump_file.write(reinterpret_cast(&d_carrier_doppler_hz), sizeof(double)); //DLL commands - d_dump_file.write(reinterpret_cast(&code_error_chips), sizeof(double)); - d_dump_file.write(reinterpret_cast(&code_error_filt_chips), sizeof(double)); + d_dump_file.write(reinterpret_cast(&code_error_chips), sizeof(double)); + d_dump_file.write(reinterpret_cast(&code_error_filt_chips), sizeof(double)); // CN0 and carrier lock test - d_dump_file.write(reinterpret_cast(&d_CN0_SNV_dB_Hz), sizeof(double)); - d_dump_file.write(reinterpret_cast(&d_carrier_lock_test), sizeof(double)); + d_dump_file.write(reinterpret_cast(&d_CN0_SNV_dB_Hz), sizeof(double)); + d_dump_file.write(reinterpret_cast(&d_carrier_lock_test), sizeof(double)); // AUX vars (for debug purposes) tmp_double = d_rem_code_phase_samples; - d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); + d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); tmp_double = static_cast(d_sample_counter + d_current_prn_length_samples); - d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); + d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); // PRN unsigned int prn_ = d_acquisition_gnss_synchro->PRN; - d_dump_file.write(reinterpret_cast(&prn_), sizeof(unsigned int)); - } - catch (std::ifstream::failure& e) - { + d_dump_file.write(reinterpret_cast(&prn_), sizeof(unsigned int)); + } + catch (std::ifstream::failure &e) + { LOG(WARNING) << "Exception writing trk dump file " << e.what(); - } + } } consume_each(d_current_prn_length_samples); d_sample_counter += d_current_prn_length_samples; - if(current_synchro_data.Flag_valid_symbol_output) { return 1; } - else{ return 0; } + if (current_synchro_data.Flag_valid_symbol_output) + { + return 1; + } + else + { + return 0; + } } @@ -734,23 +739,23 @@ void gps_l2_m_dll_pll_tracking_cc::set_channel(unsigned int channel) if (d_dump_file.is_open() == false) { try - { + { d_dump_filename.append(boost::lexical_cast(d_channel)); d_dump_filename.append(".dat"); - d_dump_file.exceptions (std::ifstream::failbit | std::ifstream::badbit); + d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); LOG(INFO) << "Tracking dump enabled on channel " << d_channel << " Log file: " << d_dump_filename.c_str(); - } - catch (std::ifstream::failure& e) - { + } + catch (std::ifstream::failure &e) + { LOG(WARNING) << "channel " << d_channel << " Exception opening trk dump file " << e.what(); - } + } } } } -void gps_l2_m_dll_pll_tracking_cc::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) +void gps_l2_m_dll_pll_tracking_cc::set_gnss_synchro(Gnss_Synchro *p_gnss_synchro) { d_acquisition_gnss_synchro = p_gnss_synchro; } diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l2_m_dll_pll_tracking_cc.h b/src/algorithms/tracking/gnuradio_blocks/gps_l2_m_dll_pll_tracking_cc.h index 3edd12ab4..37b49c924 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l2_m_dll_pll_tracking_cc.h +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l2_m_dll_pll_tracking_cc.h @@ -48,24 +48,22 @@ class gps_l2_m_dll_pll_tracking_cc; typedef boost::shared_ptr - gps_l2_m_dll_pll_tracking_cc_sptr; + gps_l2_m_dll_pll_tracking_cc_sptr; gps_l2_m_dll_pll_tracking_cc_sptr gps_l2_m_dll_pll_make_tracking_cc(long if_freq, - long fs_in, unsigned - int vector_length, - bool dump, - std::string dump_filename, - float pll_bw_hz, - float dll_bw_hz, - float early_late_space_chips); - + long fs_in, unsigned int vector_length, + bool dump, + std::string dump_filename, + float pll_bw_hz, + float dll_bw_hz, + float early_late_space_chips); /*! * \brief This class implements a DLL + PLL tracking loop block */ -class gps_l2_m_dll_pll_tracking_cc: public gr::block +class gps_l2_m_dll_pll_tracking_cc : public gr::block { public: ~gps_l2_m_dll_pll_tracking_cc(); @@ -74,30 +72,28 @@ public: void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro); void start_tracking(); - int general_work (int noutput_items, gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); + int general_work(int noutput_items, gr_vector_int& ninput_items, + gr_vector_const_void_star& input_items, gr_vector_void_star& output_items); - void forecast (int noutput_items, gr_vector_int &ninput_items_required); + void forecast(int noutput_items, gr_vector_int& ninput_items_required); private: friend gps_l2_m_dll_pll_tracking_cc_sptr gps_l2_m_dll_pll_make_tracking_cc(long if_freq, - long fs_in, unsigned - int vector_length, - bool dump, - std::string dump_filename, - float pll_bw_hz, - float dll_bw_hz, - float early_late_space_chips); + long fs_in, unsigned int vector_length, + bool dump, + std::string dump_filename, + float pll_bw_hz, + float dll_bw_hz, + float early_late_space_chips); gps_l2_m_dll_pll_tracking_cc(long if_freq, - long fs_in, unsigned - int vector_length, - bool dump, - std::string dump_filename, - float pll_bw_hz, - float dll_bw_hz, - float early_late_space_chips); + long fs_in, unsigned int vector_length, + bool dump, + std::string dump_filename, + float pll_bw_hz, + float dll_bw_hz, + float early_late_space_chips); // tracking configuration vars unsigned int d_vector_length; @@ -166,4 +162,4 @@ private: int save_matfile(); }; -#endif //GNSS_SDR_GPS_L2_M_DLL_PLL_TRACKING_CC_H +#endif //GNSS_SDR_GPS_L2_M_DLL_PLL_TRACKING_CC_H diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l5i_dll_pll_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/gps_l5i_dll_pll_tracking_cc.cc index f0b56afa6..9966dc719 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l5i_dll_pll_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l5i_dll_pll_tracking_cc.cc @@ -56,41 +56,40 @@ using google::LogMessage; gps_l5i_dll_pll_tracking_cc_sptr gps_l5i_dll_pll_make_tracking_cc( - long if_freq, - long fs_in, - unsigned int vector_length, - bool dump, - std::string dump_filename, - float pll_bw_hz, - float dll_bw_hz, - float early_late_space_chips) + long if_freq, + long fs_in, + unsigned int vector_length, + bool dump, + std::string dump_filename, + float pll_bw_hz, + float dll_bw_hz, + float early_late_space_chips) { return gps_l5i_dll_pll_tracking_cc_sptr(new gps_l5i_dll_pll_tracking_cc(if_freq, - fs_in, vector_length, dump, dump_filename, pll_bw_hz, dll_bw_hz, early_late_space_chips)); + fs_in, vector_length, dump, dump_filename, pll_bw_hz, dll_bw_hz, early_late_space_chips)); } -void gps_l5i_dll_pll_tracking_cc::forecast (int noutput_items, - gr_vector_int &ninput_items_required) +void gps_l5i_dll_pll_tracking_cc::forecast(int noutput_items, + gr_vector_int &ninput_items_required) { if (noutput_items != 0) { - ninput_items_required[0] = static_cast(d_vector_length) * 2; //set the required available samples in each call + ninput_items_required[0] = static_cast(d_vector_length) * 2; //set the required available samples in each call } } gps_l5i_dll_pll_tracking_cc::gps_l5i_dll_pll_tracking_cc( - long if_freq, - long fs_in, - unsigned int vector_length, - bool dump, - std::string dump_filename, - float pll_bw_hz, - float dll_bw_hz, - float early_late_space_chips) : - gr::block("gps_l5i_dll_pll_tracking_cc", gr::io_signature::make(1, 1, sizeof(gr_complex)), - gr::io_signature::make(1, 1, sizeof(Gnss_Synchro))) + long if_freq, + long fs_in, + unsigned int vector_length, + bool dump, + std::string dump_filename, + float pll_bw_hz, + float dll_bw_hz, + float early_late_space_chips) : gr::block("gps_l5i_dll_pll_tracking_cc", gr::io_signature::make(1, 1, sizeof(gr_complex)), + gr::io_signature::make(1, 1, sizeof(Gnss_Synchro))) { // Telemetry bit synchronization message port input this->message_port_register_in(pmt::mp("preamble_timestamp_s")); @@ -105,30 +104,30 @@ gps_l5i_dll_pll_tracking_cc::gps_l5i_dll_pll_tracking_cc( d_current_prn_length_samples = static_cast(d_vector_length); // DLL/PLL filter initialization - d_carrier_loop_filter=Tracking_2nd_PLL_filter(GPS_L5i_PERIOD); - d_code_loop_filter=Tracking_2nd_DLL_filter(GPS_L5i_PERIOD); + d_carrier_loop_filter = Tracking_2nd_PLL_filter(GPS_L5i_PERIOD); + d_code_loop_filter = Tracking_2nd_DLL_filter(GPS_L5i_PERIOD); // Initialize tracking ========================================== d_code_loop_filter.set_DLL_BW(dll_bw_hz); d_carrier_loop_filter.set_PLL_BW(pll_bw_hz); //--- DLL variables -------------------------------------------------------- - d_early_late_spc_chips = early_late_space_chips; // Define early-late offset (in chips) + d_early_late_spc_chips = early_late_space_chips; // Define early-late offset (in chips) // Initialization of local code replica // Get space for a vector with the C/A code replica sampled 1x/chip - d_ca_code = static_cast(volk_gnsssdr_malloc(static_cast(GPS_L5i_CODE_LENGTH_CHIPS) * sizeof(gr_complex), volk_gnsssdr_get_alignment())); + d_ca_code = static_cast(volk_gnsssdr_malloc(static_cast(GPS_L5i_CODE_LENGTH_CHIPS) * sizeof(gr_complex), volk_gnsssdr_get_alignment())); // correlator outputs (scalar) - d_n_correlator_taps = 3; // Early, Prompt, and Late - d_correlator_outs = static_cast(volk_gnsssdr_malloc(d_n_correlator_taps*sizeof(gr_complex), volk_gnsssdr_get_alignment())); + d_n_correlator_taps = 3; // Early, Prompt, and Late + d_correlator_outs = static_cast(volk_gnsssdr_malloc(d_n_correlator_taps * sizeof(gr_complex), volk_gnsssdr_get_alignment())); for (int n = 0; n < d_n_correlator_taps; n++) { - d_correlator_outs[n] = gr_complex(0,0); + d_correlator_outs[n] = gr_complex(0, 0); } - d_local_code_shift_chips = static_cast(volk_gnsssdr_malloc(d_n_correlator_taps*sizeof(float), volk_gnsssdr_get_alignment())); + d_local_code_shift_chips = static_cast(volk_gnsssdr_malloc(d_n_correlator_taps * sizeof(float), volk_gnsssdr_get_alignment())); // Set TAPs delay values [chips] - d_local_code_shift_chips[0] = - d_early_late_spc_chips; + d_local_code_shift_chips[0] = -d_early_late_spc_chips; d_local_code_shift_chips[1] = 0.0; d_local_code_shift_chips[2] = d_early_late_spc_chips; @@ -189,7 +188,7 @@ void gps_l5i_dll_pll_tracking_cc::start_tracking() long int acq_trk_diff_samples; double acq_trk_diff_seconds; - acq_trk_diff_samples = static_cast(d_sample_counter) - static_cast(d_acq_sample_stamp); //-d_vector_length; + acq_trk_diff_samples = static_cast(d_sample_counter) - static_cast(d_acq_sample_stamp); //-d_vector_length; DLOG(INFO) << "Number of samples between Acquisition and Tracking =" << acq_trk_diff_samples; acq_trk_diff_seconds = static_cast(acq_trk_diff_samples) / static_cast(d_fs_in); // Doppler effect @@ -201,7 +200,7 @@ void gps_l5i_dll_pll_tracking_cc::start_tracking() double T_prn_mod_samples; d_code_freq_chips = radial_velocity * GPS_L5i_CODE_RATE_HZ; d_code_phase_step_chips = static_cast(d_code_freq_chips) / static_cast(d_fs_in); - T_chip_mod_seconds = 1/d_code_freq_chips; + T_chip_mod_seconds = 1 / d_code_freq_chips; T_prn_mod_seconds = T_chip_mod_seconds * GPS_L5i_CODE_LENGTH_CHIPS; T_prn_mod_samples = T_prn_mod_seconds * static_cast(d_fs_in); @@ -225,8 +224,8 @@ void gps_l5i_dll_pll_tracking_cc::start_tracking() d_carrier_phase_step_rad = GPS_L5_TWO_PI * d_carrier_doppler_hz / static_cast(d_fs_in); // DLL/PLL filter initialization - d_carrier_loop_filter.initialize(); // initialize the carrier filter - d_code_loop_filter.initialize(); // initialize the code filter + d_carrier_loop_filter.initialize(); // initialize the carrier filter + d_code_loop_filter.initialize(); // initialize the code filter // generate local reference ALWAYS starting at chip 1 (1 sample per chip) gps_l5i_code_gen_complex(d_ca_code, d_acquisition_gnss_synchro->PRN); @@ -234,7 +233,7 @@ void gps_l5i_dll_pll_tracking_cc::start_tracking() multicorrelator_cpu.set_local_code_and_taps(static_cast(GPS_L5i_CODE_LENGTH_CHIPS), d_ca_code, d_local_code_shift_chips); for (int n = 0; n < d_n_correlator_taps; n++) { - d_correlator_outs[n] = gr_complex(0,0); + d_correlator_outs[n] = gr_complex(0, 0); } d_carrier_lock_fail_counter = 0; @@ -246,7 +245,7 @@ void gps_l5i_dll_pll_tracking_cc::start_tracking() d_code_phase_samples = d_acq_code_phase_samples; std::string sys_ = &d_acquisition_gnss_synchro->System; - sys = sys_.substr(0,1); + sys = sys_.substr(0, 1); // DEBUG OUTPUT std::cout << "Tracking of GPS L5i signal started on channel " << d_channel << " for satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << std::endl; @@ -269,18 +268,18 @@ int gps_l5i_dll_pll_tracking_cc::save_matfile() int number_of_double_vars = 11; int number_of_float_vars = 5; int epoch_size_bytes = sizeof(unsigned long int) + sizeof(double) * number_of_double_vars + - sizeof(float) * number_of_float_vars + sizeof(unsigned int); + sizeof(float) * number_of_float_vars + sizeof(unsigned int); std::ifstream dump_file; dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); try - { + { dump_file.open(d_dump_filename.c_str(), std::ios::binary | std::ios::ate); - } - catch(const std::ifstream::failure &e) - { - std::cerr << "Problem opening dump file:" << e.what() << std::endl; + } + catch (const std::ifstream::failure &e) + { + std::cerr << "Problem opening dump file:" << e.what() << std::endl; return 1; - } + } // count number of epochs and rewind long int num_epoch = 0; if (dump_file.is_open()) @@ -293,30 +292,30 @@ int gps_l5i_dll_pll_tracking_cc::save_matfile() { return 1; } - float * abs_E = new float [num_epoch]; - float * abs_P = new float [num_epoch]; - float * abs_L = new float [num_epoch]; - float * Prompt_I = new float [num_epoch]; - float * Prompt_Q = new float [num_epoch]; - unsigned long int * PRN_start_sample_count = new unsigned long int [num_epoch]; - double * acc_carrier_phase_rad = new double [num_epoch]; - double * carrier_doppler_hz = new double [num_epoch]; - double * code_freq_chips = new double [num_epoch]; - double * carr_error_hz = new double [num_epoch]; - double * carr_error_filt_hz = new double [num_epoch]; - double * code_error_chips = new double [num_epoch]; - double * code_error_filt_chips = new double [num_epoch]; - double * CN0_SNV_dB_Hz = new double [num_epoch]; - double * carrier_lock_test = new double [num_epoch]; - double * aux1 = new double [num_epoch]; - double * aux2 = new double [num_epoch]; - unsigned int * PRN = new unsigned int [num_epoch]; + float *abs_E = new float[num_epoch]; + float *abs_P = new float[num_epoch]; + float *abs_L = new float[num_epoch]; + float *Prompt_I = new float[num_epoch]; + float *Prompt_Q = new float[num_epoch]; + unsigned long int *PRN_start_sample_count = new unsigned long int[num_epoch]; + double *acc_carrier_phase_rad = new double[num_epoch]; + double *carrier_doppler_hz = new double[num_epoch]; + double *code_freq_chips = new double[num_epoch]; + double *carr_error_hz = new double[num_epoch]; + double *carr_error_filt_hz = new double[num_epoch]; + double *code_error_chips = new double[num_epoch]; + double *code_error_filt_chips = new double[num_epoch]; + double *CN0_SNV_dB_Hz = new double[num_epoch]; + double *carrier_lock_test = new double[num_epoch]; + double *aux1 = new double[num_epoch]; + double *aux2 = new double[num_epoch]; + unsigned int *PRN = new unsigned int[num_epoch]; try - { + { if (dump_file.is_open()) { - for(long int i = 0; i < num_epoch; i++) + for (long int i = 0; i < num_epoch; i++) { dump_file.read(reinterpret_cast(&abs_E[i]), sizeof(float)); dump_file.read(reinterpret_cast(&abs_P[i]), sizeof(float)); @@ -339,10 +338,10 @@ int gps_l5i_dll_pll_tracking_cc::save_matfile() } } dump_file.close(); - } + } catch (const std::ifstream::failure &e) - { - std::cerr << "Problem reading dump file:" << e.what() << std::endl; + { + std::cerr << "Problem reading dump file:" << e.what() << std::endl; delete[] abs_E; delete[] abs_P; delete[] abs_L; @@ -362,7 +361,7 @@ int gps_l5i_dll_pll_tracking_cc::save_matfile() delete[] aux2; delete[] PRN; return 1; - } + } // WRITE MAT FILE mat_t *matfp; @@ -371,79 +370,79 @@ int gps_l5i_dll_pll_tracking_cc::save_matfile() filename.erase(filename.length() - 4, 4); filename.append(".mat"); matfp = Mat_CreateVer(filename.c_str(), NULL, MAT_FT_MAT73); - if(reinterpret_cast(matfp) != NULL) + if (reinterpret_cast(matfp) != NULL) { size_t dims[2] = {1, static_cast(num_epoch)}; matvar = Mat_VarCreate("abs_E", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, abs_E, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("abs_P", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, abs_P, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("abs_L", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, abs_L, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("Prompt_I", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, Prompt_I, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("Prompt_Q", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, Prompt_Q, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("PRN_start_sample_count", MAT_C_UINT64, MAT_T_UINT64, 2, dims, PRN_start_sample_count, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("acc_carrier_phase_rad", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, acc_carrier_phase_rad, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("carrier_doppler_hz", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, carrier_doppler_hz, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("code_freq_chips", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, code_freq_chips, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("carr_error_hz", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, carr_error_hz, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("carr_error_filt_hz", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, carr_error_filt_hz, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("code_error_chips", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, code_error_chips, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("code_error_filt_chips", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, code_error_filt_chips, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("CN0_SNV_dB_Hz", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, CN0_SNV_dB_Hz, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("carrier_lock_test", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, carrier_lock_test, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("aux1", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, aux1, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("aux2", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, aux2, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); matvar = Mat_VarCreate("PRN", MAT_C_UINT32, MAT_T_UINT32, 2, dims, PRN, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); } Mat_Close(matfp); @@ -474,43 +473,43 @@ gps_l5i_dll_pll_tracking_cc::~gps_l5i_dll_pll_tracking_cc() if (d_dump_file.is_open()) { try - { + { d_dump_file.close(); - } - catch(const std::exception & ex) - { + } + catch (const std::exception &ex) + { LOG(WARNING) << "Exception in destructor " << ex.what(); - } + } } - if(d_dump) + if (d_dump) { - if(d_channel == 0) + if (d_channel == 0) { std::cout << "Writing .mat files ..."; } gps_l5i_dll_pll_tracking_cc::save_matfile(); - if(d_channel == 0) + if (d_channel == 0) { std::cout << " done." << std::endl; } } try - { + { volk_gnsssdr_free(d_local_code_shift_chips); volk_gnsssdr_free(d_correlator_outs); volk_gnsssdr_free(d_ca_code); delete[] d_Prompt_buffer; multicorrelator_cpu.free(); - } - catch(const std::exception & ex) - { + } + catch (const std::exception &ex) + { LOG(WARNING) << "Exception in destructor " << ex.what(); - } + } } -int gps_l5i_dll_pll_tracking_cc::general_work (int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), - gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) +int gps_l5i_dll_pll_tracking_cc::general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), + gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { // process vars double carr_error_hz = 0; @@ -522,7 +521,7 @@ int gps_l5i_dll_pll_tracking_cc::general_work (int noutput_items __attribute__(( Gnss_Synchro current_synchro_data = Gnss_Synchro(); // Block input data and block output stream pointers - const gr_complex* in = reinterpret_cast(input_items[0]); + const gr_complex *in = reinterpret_cast(input_items[0]); Gnss_Synchro **out = reinterpret_cast(&output_items[0]); if (d_enable_tracking == true) @@ -539,7 +538,7 @@ int gps_l5i_dll_pll_tracking_cc::general_work (int noutput_items __attribute__(( acq_trk_shif_correction_samples = d_current_prn_length_samples - fmod(static_cast(acq_to_trk_delay_samples), static_cast(d_current_prn_length_samples)); samples_offset = round(d_acq_code_phase_samples + acq_trk_shif_correction_samples); current_synchro_data.Tracking_sample_counter = d_sample_counter + samples_offset; - d_sample_counter = d_sample_counter + samples_offset; // count for the processed samples + d_sample_counter = d_sample_counter + samples_offset; // count for the processed samples d_pull_in = false; // take into account the carrier cycles accumulated in the pull in signal alignment d_acc_carrier_phase_rad -= d_carrier_phase_step_rad * samples_offset; @@ -547,7 +546,7 @@ int gps_l5i_dll_pll_tracking_cc::general_work (int noutput_items __attribute__(( current_synchro_data.Carrier_Doppler_hz = d_carrier_doppler_hz; current_synchro_data.fs = d_fs_in; current_synchro_data.correlation_length_ms = 1; - consume_each(samples_offset); // shift input to perform alignment with local replica + consume_each(samples_offset); // shift input to perform alignment with local replica return 0; } @@ -555,10 +554,10 @@ int gps_l5i_dll_pll_tracking_cc::general_work (int noutput_items __attribute__(( // perform carrier wipe-off and compute Early, Prompt and Late correlation multicorrelator_cpu.set_input_output_vectors(d_correlator_outs, in); multicorrelator_cpu.Carrier_wipeoff_multicorrelator_resampler(d_rem_carr_phase_rad, - d_carrier_phase_step_rad, - d_rem_code_phase_chips, - d_code_phase_step_chips, - d_current_prn_length_samples); + d_carrier_phase_step_rad, + d_rem_code_phase_chips, + d_code_phase_step_chips, + d_current_prn_length_samples); // ################## PLL ########################################################## // PLL discriminator @@ -573,12 +572,12 @@ int gps_l5i_dll_pll_tracking_cc::general_work (int noutput_items __attribute__(( // ################## DLL ########################################################## // DLL discriminator - code_error_chips = dll_nc_e_minus_l_normalized(d_correlator_outs[0], d_correlator_outs[2]); // [chips/Ti] + code_error_chips = dll_nc_e_minus_l_normalized(d_correlator_outs[0], d_correlator_outs[2]); // [chips/Ti] // Code discriminator filter - code_error_filt_chips = d_code_loop_filter.get_code_nco(code_error_chips); //[chips/second] + code_error_filt_chips = d_code_loop_filter.get_code_nco(code_error_chips); //[chips/second] double T_chip_seconds = 1.0 / static_cast(d_code_freq_chips); double T_prn_seconds = T_chip_seconds * GPS_L5i_CODE_LENGTH_CHIPS; - double code_error_filt_secs = (T_prn_seconds * code_error_filt_chips * T_chip_seconds); //[seconds] + double code_error_filt_secs = (T_prn_seconds * code_error_filt_chips * T_chip_seconds); //[seconds] //double code_error_filt_secs = (GPS_L5i_PERIOD * code_error_filt_chips) / GPS_L5i_CODE_RATE_HZ; //[seconds] // ################## CARRIER AND CODE NCO BUFFER ALIGNEMENT ####################### @@ -586,7 +585,7 @@ int gps_l5i_dll_pll_tracking_cc::general_work (int noutput_items __attribute__(( // Compute the next buffer length based in the new period of the PRN sequence and the code phase error estimation double T_prn_samples = T_prn_seconds * static_cast(d_fs_in); double K_blk_samples = T_prn_samples + d_rem_code_phase_samples + code_error_filt_secs * static_cast(d_fs_in); - d_current_prn_length_samples = round(K_blk_samples); // round to a discrete number of samples + d_current_prn_length_samples = round(K_blk_samples); // round to a discrete number of samples //################### PLL COMMANDS ################################################# // carrier phase step (NCO phase increment per sample) [rads/sample] @@ -601,7 +600,7 @@ int gps_l5i_dll_pll_tracking_cc::general_work (int noutput_items __attribute__(( // code phase step (Code resampler phase increment per sample) [chips/sample] d_code_phase_step_chips = d_code_freq_chips / static_cast(d_fs_in); // remnant code phase [chips] - d_rem_code_phase_samples = K_blk_samples - d_current_prn_length_samples; // rounding error < 1 sample + d_rem_code_phase_samples = K_blk_samples - d_current_prn_length_samples; // rounding error < 1 sample d_rem_code_phase_chips = d_code_freq_chips * (d_rem_code_phase_samples / static_cast(d_fs_in)); // ####### CN0 ESTIMATION AND LOCK DETECTORS ###### @@ -631,9 +630,9 @@ int gps_l5i_dll_pll_tracking_cc::general_work (int noutput_items __attribute__(( { std::cout << "Loss of lock in channel " << d_channel << "!" << std::endl; LOG(INFO) << "Loss of lock in channel " << d_channel << "!"; - this->message_port_pub(pmt::mp("events"), pmt::from_long(3));//3 -> loss of lock + this->message_port_pub(pmt::mp("events"), pmt::from_long(3)); //3 -> loss of lock d_carrier_lock_fail_counter = 0; - d_enable_tracking = false; // TODO: check if disabling tracking is consistent with the channel state machine + d_enable_tracking = false; // TODO: check if disabling tracking is consistent with the channel state machine } } // ########### Output the tracking data to navigation and PVT ########## @@ -651,7 +650,7 @@ int gps_l5i_dll_pll_tracking_cc::general_work (int noutput_items __attribute__(( { for (int n = 0; n < d_n_correlator_taps; n++) { - d_correlator_outs[n] = gr_complex(0,0); + d_correlator_outs[n] = gr_complex(0, 0); } current_synchro_data.Tracking_sample_counter = d_sample_counter + d_current_prn_length_samples; current_synchro_data.correlation_length_ms = 1; @@ -660,7 +659,7 @@ int gps_l5i_dll_pll_tracking_cc::general_work (int noutput_items __attribute__(( current_synchro_data.fs = d_fs_in; *out[0] = current_synchro_data; - if(d_dump) + if (d_dump) { // MULTIPLEXED FILE RECORDING - Record results to file float prompt_I; @@ -673,55 +672,61 @@ int gps_l5i_dll_pll_tracking_cc::general_work (int noutput_items __attribute__(( tmp_P = std::abs(d_correlator_outs[1]); tmp_L = std::abs(d_correlator_outs[2]); try - { + { // EPR - d_dump_file.write(reinterpret_cast(&tmp_E), sizeof(float)); - d_dump_file.write(reinterpret_cast(&tmp_P), sizeof(float)); - d_dump_file.write(reinterpret_cast(&tmp_L), sizeof(float)); + d_dump_file.write(reinterpret_cast(&tmp_E), sizeof(float)); + d_dump_file.write(reinterpret_cast(&tmp_P), sizeof(float)); + d_dump_file.write(reinterpret_cast(&tmp_L), sizeof(float)); // PROMPT I and Q (to analyze navigation symbols) - d_dump_file.write(reinterpret_cast(&prompt_I), sizeof(float)); - d_dump_file.write(reinterpret_cast(&prompt_Q), sizeof(float)); + d_dump_file.write(reinterpret_cast(&prompt_I), sizeof(float)); + d_dump_file.write(reinterpret_cast(&prompt_Q), sizeof(float)); // PRN start sample stamp //tmp_float=(float)d_sample_counter; - d_dump_file.write(reinterpret_cast(&d_sample_counter), sizeof(unsigned long int)); + d_dump_file.write(reinterpret_cast(&d_sample_counter), sizeof(unsigned long int)); // accumulated carrier phase - d_dump_file.write(reinterpret_cast(&d_acc_carrier_phase_rad), sizeof(double)); + d_dump_file.write(reinterpret_cast(&d_acc_carrier_phase_rad), sizeof(double)); // carrier and code frequency - d_dump_file.write(reinterpret_cast(&d_carrier_doppler_hz), sizeof(double)); - d_dump_file.write(reinterpret_cast(&d_code_freq_chips), sizeof(double)); + d_dump_file.write(reinterpret_cast(&d_carrier_doppler_hz), sizeof(double)); + d_dump_file.write(reinterpret_cast(&d_code_freq_chips), sizeof(double)); //PLL commands - d_dump_file.write(reinterpret_cast(&carr_error_hz), sizeof(double)); - d_dump_file.write(reinterpret_cast(&d_carrier_doppler_hz), sizeof(double)); + d_dump_file.write(reinterpret_cast(&carr_error_hz), sizeof(double)); + d_dump_file.write(reinterpret_cast(&d_carrier_doppler_hz), sizeof(double)); //DLL commands - d_dump_file.write(reinterpret_cast(&code_error_chips), sizeof(double)); - d_dump_file.write(reinterpret_cast(&code_error_filt_chips), sizeof(double)); + d_dump_file.write(reinterpret_cast(&code_error_chips), sizeof(double)); + d_dump_file.write(reinterpret_cast(&code_error_filt_chips), sizeof(double)); // CN0 and carrier lock test - d_dump_file.write(reinterpret_cast(&d_CN0_SNV_dB_Hz), sizeof(double)); - d_dump_file.write(reinterpret_cast(&d_carrier_lock_test), sizeof(double)); + d_dump_file.write(reinterpret_cast(&d_CN0_SNV_dB_Hz), sizeof(double)); + d_dump_file.write(reinterpret_cast(&d_carrier_lock_test), sizeof(double)); // AUX vars (for debug purposes) tmp_double = d_rem_code_phase_samples; - d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); + d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); tmp_double = static_cast(d_sample_counter + d_current_prn_length_samples); - d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); + d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); // PRN unsigned int prn_ = d_acquisition_gnss_synchro->PRN; - d_dump_file.write(reinterpret_cast(&prn_), sizeof(unsigned int)); - } - catch (std::ifstream::failure& e) - { + d_dump_file.write(reinterpret_cast(&prn_), sizeof(unsigned int)); + } + catch (std::ifstream::failure &e) + { LOG(WARNING) << "Exception writing trk dump file " << e.what(); - } + } + } + consume_each(d_current_prn_length_samples); // this is necessary in gr::block derivates + d_sample_counter += d_current_prn_length_samples; // count for the processed samples + if (current_synchro_data.Flag_valid_symbol_output) + { + return 1; + } + else + { + return 0; } - consume_each(d_current_prn_length_samples); // this is necessary in gr::block derivates - d_sample_counter += d_current_prn_length_samples; // count for the processed samples - if(current_synchro_data.Flag_valid_symbol_output) { return 1; } - else { return 0; } } @@ -735,23 +740,23 @@ void gps_l5i_dll_pll_tracking_cc::set_channel(unsigned int channel) if (d_dump_file.is_open() == false) { try - { + { d_dump_filename.append(boost::lexical_cast(d_channel)); d_dump_filename.append(".dat"); - d_dump_file.exceptions (std::ifstream::failbit | std::ifstream::badbit); + d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); LOG(INFO) << "Tracking dump enabled on channel " << d_channel << " Log file: " << d_dump_filename.c_str(); - } - catch (std::ifstream::failure& e) - { + } + catch (std::ifstream::failure &e) + { LOG(WARNING) << "channel " << d_channel << " Exception opening trk dump file " << e.what(); - } + } } } } -void gps_l5i_dll_pll_tracking_cc::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) +void gps_l5i_dll_pll_tracking_cc::set_gnss_synchro(Gnss_Synchro *p_gnss_synchro) { d_acquisition_gnss_synchro = p_gnss_synchro; } diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l5i_dll_pll_tracking_cc.h b/src/algorithms/tracking/gnuradio_blocks/gps_l5i_dll_pll_tracking_cc.h index 388d04c57..cfe4b06f3 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l5i_dll_pll_tracking_cc.h +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l5i_dll_pll_tracking_cc.h @@ -48,24 +48,22 @@ class gps_l5i_dll_pll_tracking_cc; typedef boost::shared_ptr - gps_l5i_dll_pll_tracking_cc_sptr; + gps_l5i_dll_pll_tracking_cc_sptr; gps_l5i_dll_pll_tracking_cc_sptr gps_l5i_dll_pll_make_tracking_cc(long if_freq, - long fs_in, unsigned - int vector_length, - bool dump, - std::string dump_filename, - float pll_bw_hz, - float dll_bw_hz, - float early_late_space_chips); - + long fs_in, unsigned int vector_length, + bool dump, + std::string dump_filename, + float pll_bw_hz, + float dll_bw_hz, + float early_late_space_chips); /*! * \brief This class implements a DLL + PLL tracking loop block */ -class gps_l5i_dll_pll_tracking_cc: public gr::block +class gps_l5i_dll_pll_tracking_cc : public gr::block { public: ~gps_l5i_dll_pll_tracking_cc(); @@ -74,30 +72,28 @@ public: void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro); void start_tracking(); - int general_work (int noutput_items, gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); + int general_work(int noutput_items, gr_vector_int& ninput_items, + gr_vector_const_void_star& input_items, gr_vector_void_star& output_items); - void forecast (int noutput_items, gr_vector_int &ninput_items_required); + void forecast(int noutput_items, gr_vector_int& ninput_items_required); private: friend gps_l5i_dll_pll_tracking_cc_sptr gps_l5i_dll_pll_make_tracking_cc(long if_freq, - long fs_in, unsigned - int vector_length, - bool dump, - std::string dump_filename, - float pll_bw_hz, - float dll_bw_hz, - float early_late_space_chips); + long fs_in, unsigned int vector_length, + bool dump, + std::string dump_filename, + float pll_bw_hz, + float dll_bw_hz, + float early_late_space_chips); gps_l5i_dll_pll_tracking_cc(long if_freq, - long fs_in, unsigned - int vector_length, - bool dump, - std::string dump_filename, - float pll_bw_hz, - float dll_bw_hz, - float early_late_space_chips); + long fs_in, unsigned int vector_length, + bool dump, + std::string dump_filename, + float pll_bw_hz, + float dll_bw_hz, + float early_late_space_chips); // tracking configuration vars unsigned int d_vector_length; @@ -166,4 +162,4 @@ private: int save_matfile(); }; -#endif //GNSS_SDR_GPS_L5i_DLL_PLL_TRACKING_CC_H +#endif //GNSS_SDR_GPS_L5i_DLL_PLL_TRACKING_CC_H diff --git a/src/algorithms/tracking/libs/cpu_multicorrelator.cc b/src/algorithms/tracking/libs/cpu_multicorrelator.cc index 279dab5aa..451343cdf 100644 --- a/src/algorithms/tracking/libs/cpu_multicorrelator.cc +++ b/src/algorithms/tracking/libs/cpu_multicorrelator.cc @@ -51,7 +51,7 @@ cpu_multicorrelator::cpu_multicorrelator() cpu_multicorrelator::~cpu_multicorrelator() { - if(d_local_codes_resampled != nullptr) + if (d_local_codes_resampled != nullptr) { cpu_multicorrelator::free(); } @@ -59,8 +59,8 @@ cpu_multicorrelator::~cpu_multicorrelator() bool cpu_multicorrelator::init( - int max_signal_length_samples, - int n_correlators) + int max_signal_length_samples, + int n_correlators) { // ALLOCATE MEMORY FOR INTERNAL vectors size_t size = max_signal_length_samples * sizeof(std::complex); @@ -75,11 +75,10 @@ bool cpu_multicorrelator::init( } - bool cpu_multicorrelator::set_local_code_and_taps( - int code_length_chips, - const std::complex* local_code_in, - float *shifts_chips) + int code_length_chips, + const std::complex* local_code_in, + float* shifts_chips) { d_local_code_in = local_code_in; d_shifts_chips = shifts_chips; @@ -100,29 +99,29 @@ bool cpu_multicorrelator::set_input_output_vectors(std::complex* corr_out void cpu_multicorrelator::update_local_code(int correlator_length_samples, float rem_code_phase_chips, float code_phase_step_chips) { volk_gnsssdr_32fc_xn_resampler_32fc_xn(d_local_codes_resampled, - d_local_code_in, - rem_code_phase_chips, - code_phase_step_chips, - d_shifts_chips, - d_code_length_chips, - d_n_correlators, - correlator_length_samples); + d_local_code_in, + rem_code_phase_chips, + code_phase_step_chips, + d_shifts_chips, + d_code_length_chips, + d_n_correlators, + correlator_length_samples); } bool cpu_multicorrelator::Carrier_wipeoff_multicorrelator_resampler( - float rem_carrier_phase_in_rad, - float phase_step_rad, - float rem_code_phase_chips, - float code_phase_step_chips, - int signal_length_samples) + float rem_carrier_phase_in_rad, + float phase_step_rad, + float rem_code_phase_chips, + float code_phase_step_chips, + int signal_length_samples) { update_local_code(signal_length_samples, rem_code_phase_chips, code_phase_step_chips); // Regenerate phase at each call in order to avoid numerical issues lv_32fc_t phase_offset_as_complex[1]; phase_offset_as_complex[0] = lv_cmake(std::cos(rem_carrier_phase_in_rad), -std::sin(rem_carrier_phase_in_rad)); // call VOLK_GNSSSDR kernel - volk_gnsssdr_32fc_x2_rotator_dot_prod_32fc_xn(d_corr_out, d_sig_in, std::exp(lv_32fc_t(0, - phase_step_rad)), phase_offset_as_complex, const_cast(d_local_codes_resampled), d_n_correlators, signal_length_samples); + volk_gnsssdr_32fc_x2_rotator_dot_prod_32fc_xn(d_corr_out, d_sig_in, std::exp(lv_32fc_t(0, -phase_step_rad)), phase_offset_as_complex, const_cast(d_local_codes_resampled), d_n_correlators, signal_length_samples); return true; } @@ -141,4 +140,3 @@ bool cpu_multicorrelator::free() } return true; } - diff --git a/src/algorithms/tracking/libs/cpu_multicorrelator.h b/src/algorithms/tracking/libs/cpu_multicorrelator.h index 2174595b9..16d4639df 100644 --- a/src/algorithms/tracking/libs/cpu_multicorrelator.h +++ b/src/algorithms/tracking/libs/cpu_multicorrelator.h @@ -47,8 +47,8 @@ public: cpu_multicorrelator(); ~cpu_multicorrelator(); bool init(int max_signal_length_samples, int n_correlators); - bool set_local_code_and_taps(int code_length_chips, const std::complex* local_code_in, float *shifts_chips); - bool set_input_output_vectors(std::complex* corr_out, const std::complex* sig_in); + bool set_local_code_and_taps(int code_length_chips, const std::complex *local_code_in, float *shifts_chips); + bool set_input_output_vectors(std::complex *corr_out, const std::complex *sig_in); void update_local_code(int correlator_length_samples, float rem_code_phase_chips, float code_phase_step_chips); bool Carrier_wipeoff_multicorrelator_resampler(float rem_carrier_phase_in_rad, float phase_step_rad, float rem_code_phase_chips, float code_phase_step_chips, int signal_length_samples); bool free(); diff --git a/src/algorithms/tracking/libs/cpu_multicorrelator_16sc.cc b/src/algorithms/tracking/libs/cpu_multicorrelator_16sc.cc index dd7ed14a4..eb64fc299 100644 --- a/src/algorithms/tracking/libs/cpu_multicorrelator_16sc.cc +++ b/src/algorithms/tracking/libs/cpu_multicorrelator_16sc.cc @@ -36,10 +36,9 @@ #include - bool cpu_multicorrelator_16sc::init( - int max_signal_length_samples, - int n_correlators) + int max_signal_length_samples, + int n_correlators) { // ALLOCATE MEMORY FOR INTERNAL vectors size_t size = max_signal_length_samples * sizeof(lv_16sc_t); @@ -55,11 +54,10 @@ bool cpu_multicorrelator_16sc::init( } - bool cpu_multicorrelator_16sc::set_local_code_and_taps( - int code_length_chips, - const lv_16sc_t* local_code_in, - float *shifts_chips) + int code_length_chips, + const lv_16sc_t* local_code_in, + float* shifts_chips) { d_local_code_in = local_code_in; d_shifts_chips = shifts_chips; @@ -80,22 +78,22 @@ bool cpu_multicorrelator_16sc::set_input_output_vectors(lv_16sc_t* corr_out, con void cpu_multicorrelator_16sc::update_local_code(int correlator_length_samples, float rem_code_phase_chips, float code_phase_step_chips) { volk_gnsssdr_16ic_xn_resampler_16ic_xn(d_local_codes_resampled, - d_local_code_in, - rem_code_phase_chips, - code_phase_step_chips, - d_shifts_chips, - d_code_length_chips, - d_n_correlators, - correlator_length_samples); + d_local_code_in, + rem_code_phase_chips, + code_phase_step_chips, + d_shifts_chips, + d_code_length_chips, + d_n_correlators, + correlator_length_samples); } bool cpu_multicorrelator_16sc::Carrier_wipeoff_multicorrelator_resampler( - float rem_carrier_phase_in_rad, - float phase_step_rad, - float rem_code_phase_chips, - float code_phase_step_chips, - int signal_length_samples) + float rem_carrier_phase_in_rad, + float phase_step_rad, + float rem_code_phase_chips, + float code_phase_step_chips, + int signal_length_samples) { update_local_code(signal_length_samples, rem_code_phase_chips, code_phase_step_chips); // Regenerate phase at each call in order to avoid numerical issues @@ -121,7 +119,7 @@ cpu_multicorrelator_16sc::cpu_multicorrelator_16sc() cpu_multicorrelator_16sc::~cpu_multicorrelator_16sc() { - if(d_local_codes_resampled != nullptr) + if (d_local_codes_resampled != nullptr) { cpu_multicorrelator_16sc::free(); } @@ -142,4 +140,3 @@ bool cpu_multicorrelator_16sc::free() } return true; } - diff --git a/src/algorithms/tracking/libs/cpu_multicorrelator_16sc.h b/src/algorithms/tracking/libs/cpu_multicorrelator_16sc.h index 617d79b37..03e25b332 100644 --- a/src/algorithms/tracking/libs/cpu_multicorrelator_16sc.h +++ b/src/algorithms/tracking/libs/cpu_multicorrelator_16sc.h @@ -47,8 +47,8 @@ public: cpu_multicorrelator_16sc(); ~cpu_multicorrelator_16sc(); bool init(int max_signal_length_samples, int n_correlators); - bool set_local_code_and_taps(int code_length_chips, const lv_16sc_t* local_code_in, float *shifts_chips); - bool set_input_output_vectors(lv_16sc_t* corr_out, const lv_16sc_t* sig_in); + bool set_local_code_and_taps(int code_length_chips, const lv_16sc_t *local_code_in, float *shifts_chips); + bool set_input_output_vectors(lv_16sc_t *corr_out, const lv_16sc_t *sig_in); void update_local_code(int correlator_length_samples, float rem_code_phase_chips, float code_phase_step_chips); bool Carrier_wipeoff_multicorrelator_resampler(float rem_carrier_phase_in_rad, float phase_step_rad, float rem_code_phase_chips, float code_phase_step_chips, int signal_length_samples); bool free(); diff --git a/src/algorithms/tracking/libs/cpu_multicorrelator_real_codes.cc b/src/algorithms/tracking/libs/cpu_multicorrelator_real_codes.cc index 42fa8f226..5de891064 100644 --- a/src/algorithms/tracking/libs/cpu_multicorrelator_real_codes.cc +++ b/src/algorithms/tracking/libs/cpu_multicorrelator_real_codes.cc @@ -38,7 +38,6 @@ #include - cpu_multicorrelator_real_codes::cpu_multicorrelator_real_codes() { d_sig_in = nullptr; @@ -53,7 +52,7 @@ cpu_multicorrelator_real_codes::cpu_multicorrelator_real_codes() cpu_multicorrelator_real_codes::~cpu_multicorrelator_real_codes() { - if(d_local_codes_resampled != nullptr) + if (d_local_codes_resampled != nullptr) { cpu_multicorrelator_real_codes::free(); } @@ -61,8 +60,8 @@ cpu_multicorrelator_real_codes::~cpu_multicorrelator_real_codes() bool cpu_multicorrelator_real_codes::init( - int max_signal_length_samples, - int n_correlators) + int max_signal_length_samples, + int n_correlators) { // ALLOCATE MEMORY FOR INTERNAL vectors size_t size = max_signal_length_samples * sizeof(float); @@ -77,11 +76,10 @@ bool cpu_multicorrelator_real_codes::init( } - bool cpu_multicorrelator_real_codes::set_local_code_and_taps( - int code_length_chips, - const float* local_code_in, - float *shifts_chips) + int code_length_chips, + const float* local_code_in, + float* shifts_chips) { d_local_code_in = local_code_in; d_shifts_chips = shifts_chips; @@ -102,29 +100,29 @@ bool cpu_multicorrelator_real_codes::set_input_output_vectors(std::complex* corr_out, const std::complex* sig_in); + bool set_local_code_and_taps(int code_length_chips, const float *local_code_in, float *shifts_chips); + bool set_input_output_vectors(std::complex *corr_out, const std::complex *sig_in); void update_local_code(int correlator_length_samples, float rem_code_phase_chips, float code_phase_step_chips); bool Carrier_wipeoff_multicorrelator_resampler(float rem_carrier_phase_in_rad, float phase_step_rad, float rem_code_phase_chips, float code_phase_step_chips, int signal_length_samples); bool free(); @@ -67,4 +67,3 @@ private: #endif /* CPU_MULTICORRELATOR_REAL_CODES_H_ */ - diff --git a/src/algorithms/tracking/libs/cuda_multicorrelator.h b/src/algorithms/tracking/libs/cuda_multicorrelator.h index 10b891344..d3410f609 100644 --- a/src/algorithms/tracking/libs/cuda_multicorrelator.h +++ b/src/algorithms/tracking/libs/cuda_multicorrelator.h @@ -54,22 +54,26 @@ struct GPU_Complex { float r; float i; - CUDA_CALLABLE_MEMBER_DEVICE GPU_Complex() {}; - CUDA_CALLABLE_MEMBER_DEVICE GPU_Complex( float a, float b ) : r(a), i(b) {} - CUDA_CALLABLE_MEMBER_DEVICE float magnitude2( void ) { return r * r + i * i; } + CUDA_CALLABLE_MEMBER_DEVICE GPU_Complex(){}; + CUDA_CALLABLE_MEMBER_DEVICE GPU_Complex(float a, float b) : r(a), i(b) {} + CUDA_CALLABLE_MEMBER_DEVICE float magnitude2(void) { return r * r + i * i; } CUDA_CALLABLE_MEMBER_DEVICE GPU_Complex operator*(const GPU_Complex& a) { #ifdef __CUDACC__ return GPU_Complex(__fmul_rn(r, a.r) - __fmul_rn(i, a.i), __fmul_rn(i, a.r) + __fmul_rn(r, a.i)); #else - return GPU_Complex(r*a.r - i*a.i, i*a.r + r*a.i); + return GPU_Complex(r * a.r - i * a.i, i * a.r + r * a.i); #endif } CUDA_CALLABLE_MEMBER_DEVICE GPU_Complex operator+(const GPU_Complex& a) { return GPU_Complex(r + a.r, i + a.i); } - CUDA_CALLABLE_MEMBER_DEVICE void operator+=(const GPU_Complex& a) { r += a.r; i += a.i; } + CUDA_CALLABLE_MEMBER_DEVICE void operator+=(const GPU_Complex& a) + { + r += a.r; + i += a.i; + } CUDA_CALLABLE_MEMBER_DEVICE void multiply_acc(const GPU_Complex& a, const GPU_Complex& b) { //c=a*b+c @@ -82,10 +86,9 @@ struct GPU_Complex i = __fmaf_rn(a.i, b.r, i); i = __fmaf_rn(a.r, b.i, i); #else - r = (a.r*b.r - a.i*b.i) + r; - i = (a.i*b.r - a.r*b.i) + i; + r = (a.r * b.r - a.i * b.i) + r; + i = (a.i * b.r - a.r * b.i) + i; #endif - } }; @@ -93,18 +96,18 @@ struct GPU_Complex_Short { float r; float i; - CUDA_CALLABLE_MEMBER_DEVICE GPU_Complex_Short( short int a, short int b ) : r(a), i(b) {} - CUDA_CALLABLE_MEMBER_DEVICE float magnitude2( void ) + CUDA_CALLABLE_MEMBER_DEVICE GPU_Complex_Short(short int a, short int b) : r(a), i(b) {} + CUDA_CALLABLE_MEMBER_DEVICE float magnitude2(void) { return r * r + i * i; } CUDA_CALLABLE_MEMBER_DEVICE GPU_Complex_Short operator*(const GPU_Complex_Short& a) { - return GPU_Complex_Short(r*a.r - i*a.i, i*a.r + r*a.i); + return GPU_Complex_Short(r * a.r - i * a.i, i * a.r + r * a.i); } CUDA_CALLABLE_MEMBER_DEVICE GPU_Complex_Short operator+(const GPU_Complex_Short& a) { - return GPU_Complex_Short(r+a.r, i+a.i); + return GPU_Complex_Short(r + a.r, i + a.i); } }; @@ -117,44 +120,41 @@ class cuda_multicorrelator public: cuda_multicorrelator(); bool init_cuda_integrated_resampler( - int signal_length_samples, - int code_length_chips, - int n_correlators - ); + int signal_length_samples, + int code_length_chips, + int n_correlators); bool set_local_code_and_taps( - int code_length_chips, - const std::complex* local_codes_in, - float *shifts_chips, - int n_correlators - ); + int code_length_chips, + const std::complex* local_codes_in, + float* shifts_chips, + int n_correlators); bool set_input_output_vectors( - std::complex* corr_out, - std::complex* sig_in - ); + std::complex* corr_out, + std::complex* sig_in); bool free_cuda(); bool Carrier_wipeoff_multicorrelator_resampler_cuda( - float rem_carrier_phase_in_rad, - float phase_step_rad, - float code_phase_step_chips, - float rem_code_phase_chips, - int signal_length_samples, - int n_correlators); + float rem_carrier_phase_in_rad, + float phase_step_rad, + float code_phase_step_chips, + float rem_code_phase_chips, + int signal_length_samples, + int n_correlators); private: // Allocate the device input vectors - GPU_Complex *d_sig_in; - GPU_Complex *d_nco_in; - GPU_Complex *d_sig_doppler_wiped; - GPU_Complex *d_local_codes_in; - GPU_Complex *d_corr_out; + GPU_Complex* d_sig_in; + GPU_Complex* d_nco_in; + GPU_Complex* d_sig_doppler_wiped; + GPU_Complex* d_local_codes_in; + GPU_Complex* d_corr_out; // - std::complex *d_sig_in_cpu; - std::complex *d_corr_out_cpu; + std::complex* d_sig_in_cpu; + std::complex* d_corr_out_cpu; - int *d_shifts_samples; - float *d_shifts_chips; + int* d_shifts_samples; + float* d_shifts_chips; int d_code_length_chips; int selected_gps_device; diff --git a/src/algorithms/tracking/libs/lock_detectors.cc b/src/algorithms/tracking/libs/lock_detectors.cc index bbe2f7214..331391978 100644 --- a/src/algorithms/tracking/libs/lock_detectors.cc +++ b/src/algorithms/tracking/libs/lock_detectors.cc @@ -71,17 +71,16 @@ float cn0_svn_estimator(gr_complex* Prompt_buffer, int length, long fs_in, doubl double SNR_dB_Hz = 0; double Psig = 0; double Ptot = 0; - for (int i=0; i(Prompt_buffer[i].real())); - Ptot += static_cast(Prompt_buffer[i].imag()) * static_cast(Prompt_buffer[i].imag()) - + static_cast(Prompt_buffer[i].real()) * static_cast(Prompt_buffer[i].real()); + Ptot += static_cast(Prompt_buffer[i].imag()) * static_cast(Prompt_buffer[i].imag()) + static_cast(Prompt_buffer[i].real()) * static_cast(Prompt_buffer[i].real()); } Psig = Psig / static_cast(length); Psig = Psig * Psig; Ptot = Ptot / static_cast(length); SNR = Psig / (Ptot - Psig); - SNR_dB_Hz = 10 * log10(SNR) + 10 * log10(static_cast(fs_in)/2) - 10 * log10(code_length); + SNR_dB_Hz = 10 * log10(SNR) + 10 * log10(static_cast(fs_in) / 2) - 10 * log10(code_length); return static_cast(SNR_dB_Hz); } @@ -101,12 +100,12 @@ float carrier_lock_detector(gr_complex* Prompt_buffer, int length) float tmp_sum_Q = 0; float NBD = 0; float NBP = 0; - for (int i=0; i - tcp_communication::tcp_communication() : tcp_socket_(io_service_) -{} +{ +} tcp_communication::~tcp_communication() -{} +{ +} int tcp_communication::listen_tcp_connection(size_t d_port_, size_t d_port_ch0_) { try - { + { // Specify IP type and port boost::asio::ip::tcp::endpoint endpoint(boost::asio::ip::tcp::v4(), d_port_); boost::asio::ip::tcp::acceptor acceptor(io_service_, endpoint); @@ -65,25 +66,25 @@ int tcp_communication::listen_tcp_connection(size_t d_port_, size_t d_port_ch0_) acceptor.accept(tcp_socket_); std::cout << "Socket accepted on port " << d_port_ << std::endl; - } + } - catch(const std::exception& e) - { + catch (const std::exception& e) + { std::cerr << "Exception: " << e.what() << std::endl; - } + } return false; } -void tcp_communication::send_receive_tcp_packet_galileo_e1(boost::array buf, tcp_packet_data *tcp_data_) +void tcp_communication::send_receive_tcp_packet_galileo_e1(boost::array buf, tcp_packet_data* tcp_data_) { int controlc = 0; boost::array readbuf; float d_control_id_ = buf.data()[0]; try - { + { // Send a TCP packet tcp_socket_.write_some(boost::asio::buffer(buf)); @@ -100,25 +101,25 @@ void tcp_communication::send_receive_tcp_packet_galileo_e1(boost::arrayproc_pack_code_error = readbuf.data()[1]; tcp_data_->proc_pack_carr_error = readbuf.data()[2]; tcp_data_->proc_pack_carrier_doppler_hz = readbuf.data()[3]; - } + } - catch(const std::exception& e) - { + catch (const std::exception& e) + { std::cerr << "Exception: " << e.what() << ". Please press Ctrl+C to end the program." << std::endl; std::cin >> controlc; - } + } return; } -void tcp_communication::send_receive_tcp_packet_gps_l1_ca(boost::array buf, tcp_packet_data *tcp_data_) +void tcp_communication::send_receive_tcp_packet_gps_l1_ca(boost::array buf, tcp_packet_data* tcp_data_) { int controlc = 0; boost::array readbuf; float d_control_id_ = buf.data()[0]; try - { + { // Send a TCP packet tcp_socket_.write_some(boost::asio::buffer(buf)); @@ -135,13 +136,13 @@ void tcp_communication::send_receive_tcp_packet_gps_l1_ca(boost::arrayproc_pack_code_error = readbuf.data()[1]; tcp_data_->proc_pack_carr_error = readbuf.data()[2]; tcp_data_->proc_pack_carrier_doppler_hz = readbuf.data()[3]; - } + } - catch(const std::exception& e) - { + catch (const std::exception& e) + { std::cerr << "Exception: " << e.what() << ". Please press Ctrl+C to end the program." << std::endl; std::cin >> controlc; - } + } return; } diff --git a/src/algorithms/tracking/libs/tracking_2nd_DLL_filter.cc b/src/algorithms/tracking/libs/tracking_2nd_DLL_filter.cc index 9c44a756f..fe234322e 100644 --- a/src/algorithms/tracking/libs/tracking_2nd_DLL_filter.cc +++ b/src/algorithms/tracking/libs/tracking_2nd_DLL_filter.cc @@ -38,62 +38,60 @@ #include "tracking_2nd_DLL_filter.h" -void Tracking_2nd_DLL_filter::calculate_lopp_coef(float* tau1,float* tau2, float lbw, float zeta, float k) +void Tracking_2nd_DLL_filter::calculate_lopp_coef(float* tau1, float* tau2, float lbw, float zeta, float k) { // Solve natural frequency float Wn; - Wn = lbw*8*zeta / (4*zeta*zeta + 1); + Wn = lbw * 8 * zeta / (4 * zeta * zeta + 1); // solve for t1 & t2 *tau1 = k / (Wn * Wn); *tau2 = (2.0 * zeta) / Wn; } - void Tracking_2nd_DLL_filter::set_DLL_BW(float dll_bw_hz) { //Calculate filter coefficient values - d_dllnoisebandwidth = dll_bw_hz; - calculate_lopp_coef(&d_tau1_code, &d_tau2_code, d_dllnoisebandwidth, d_dlldampingratio, 1.0);// Calculate filter coefficient values + d_dllnoisebandwidth = dll_bw_hz; + calculate_lopp_coef(&d_tau1_code, &d_tau2_code, d_dllnoisebandwidth, d_dlldampingratio, 1.0); // Calculate filter coefficient values } - void Tracking_2nd_DLL_filter::initialize() { // code tracking loop parameters - d_old_code_nco = 0.0; + d_old_code_nco = 0.0; d_old_code_error = 0.0; } - float Tracking_2nd_DLL_filter::get_code_nco(float DLL_discriminator) { float code_nco; - code_nco = d_old_code_nco + (d_tau2_code/d_tau1_code)*(DLL_discriminator - d_old_code_error) + (DLL_discriminator+d_old_code_error) * (d_pdi_code/(2*d_tau1_code)); + code_nco = d_old_code_nco + (d_tau2_code / d_tau1_code) * (DLL_discriminator - d_old_code_error) + (DLL_discriminator + d_old_code_error) * (d_pdi_code / (2 * d_tau1_code)); //code_nco = d_old_code_nco + (d_tau2_code/d_tau1_code)*(DLL_discriminator - d_old_code_error) + DLL_discriminator * (d_pdi_code/d_tau1_code); - d_old_code_nco = code_nco; - d_old_code_error = DLL_discriminator; //[chips] + d_old_code_nco = code_nco; + d_old_code_error = DLL_discriminator; //[chips] return code_nco; } -Tracking_2nd_DLL_filter::Tracking_2nd_DLL_filter (float pdi_code) +Tracking_2nd_DLL_filter::Tracking_2nd_DLL_filter(float pdi_code) { - d_pdi_code = pdi_code;// Summation interval for code + d_pdi_code = pdi_code; // Summation interval for code d_dlldampingratio = 0.7; } -Tracking_2nd_DLL_filter::Tracking_2nd_DLL_filter () +Tracking_2nd_DLL_filter::Tracking_2nd_DLL_filter() { - d_pdi_code = 0.001;// Summation interval for code + d_pdi_code = 0.001; // Summation interval for code d_dlldampingratio = 0.7; } -Tracking_2nd_DLL_filter::~Tracking_2nd_DLL_filter () -{} +Tracking_2nd_DLL_filter::~Tracking_2nd_DLL_filter() +{ +} void Tracking_2nd_DLL_filter::set_pdi(float pdi_code) { - d_pdi_code = pdi_code; // Summation interval for code + d_pdi_code = pdi_code; // Summation interval for code } diff --git a/src/algorithms/tracking/libs/tracking_2nd_DLL_filter.h b/src/algorithms/tracking/libs/tracking_2nd_DLL_filter.h index f39a88919..57660c682 100644 --- a/src/algorithms/tracking/libs/tracking_2nd_DLL_filter.h +++ b/src/algorithms/tracking/libs/tracking_2nd_DLL_filter.h @@ -56,13 +56,13 @@ private: float d_dlldampingratio = 0; float d_old_code_error = 0; float d_old_code_nco = 0; - void calculate_lopp_coef(float* tau1,float* tau2, float lbw, float zeta, float k); + void calculate_lopp_coef(float* tau1, float* tau2, float lbw, float zeta, float k); public: - void set_DLL_BW(float dll_bw_hz); //! Set DLL filter bandwidth [Hz] - void set_pdi(float pdi_code); //! Set Summation interval for code [s] - void initialize(); //! Start tracking with acquisition information - float get_code_nco(float DLL_discriminator); //! Numerically controlled oscillator + void set_DLL_BW(float dll_bw_hz); //! Set DLL filter bandwidth [Hz] + void set_pdi(float pdi_code); //! Set Summation interval for code [s] + void initialize(); //! Start tracking with acquisition information + float get_code_nco(float DLL_discriminator); //! Numerically controlled oscillator Tracking_2nd_DLL_filter(float pdi_code); Tracking_2nd_DLL_filter(); ~Tracking_2nd_DLL_filter(); diff --git a/src/algorithms/tracking/libs/tracking_2nd_PLL_filter.cc b/src/algorithms/tracking/libs/tracking_2nd_PLL_filter.cc index 55a706a33..90ec3331f 100644 --- a/src/algorithms/tracking/libs/tracking_2nd_PLL_filter.cc +++ b/src/algorithms/tracking/libs/tracking_2nd_PLL_filter.cc @@ -37,31 +37,29 @@ #include "tracking_2nd_PLL_filter.h" -void Tracking_2nd_PLL_filter::calculate_lopp_coef(float* tau1,float* tau2, float lbw, float zeta, float k) +void Tracking_2nd_PLL_filter::calculate_lopp_coef(float* tau1, float* tau2, float lbw, float zeta, float k) { // Solve natural frequency float Wn; - Wn = lbw*8*zeta / (4*zeta*zeta + 1); + Wn = lbw * 8 * zeta / (4 * zeta * zeta + 1); // solve for t1 & t2 *tau1 = k / (Wn * Wn); *tau2 = (2.0 * zeta) / Wn; } - void Tracking_2nd_PLL_filter::set_PLL_BW(float pll_bw_hz) { //Calculate filter coefficient values d_pllnoisebandwidth = pll_bw_hz; - calculate_lopp_coef(&d_tau1_carr, &d_tau2_carr, d_pllnoisebandwidth, d_plldampingratio, 0.25); // Calculate filter coefficient values + calculate_lopp_coef(&d_tau1_carr, &d_tau2_carr, d_pllnoisebandwidth, d_plldampingratio, 0.25); // Calculate filter coefficient values } - void Tracking_2nd_PLL_filter::initialize() { // carrier/Costas loop parameters - d_old_carr_nco = 0.0; + d_old_carr_nco = 0.0; d_old_carr_error = 0.0; } @@ -74,36 +72,35 @@ void Tracking_2nd_PLL_filter::initialize() float Tracking_2nd_PLL_filter::get_carrier_nco(float PLL_discriminator) { float carr_nco; - carr_nco = d_old_carr_nco + (d_tau2_carr/d_tau1_carr)*(PLL_discriminator - d_old_carr_error) + (PLL_discriminator + d_old_carr_error) * (d_pdi_carr/(2*d_tau1_carr)); + carr_nco = d_old_carr_nco + (d_tau2_carr / d_tau1_carr) * (PLL_discriminator - d_old_carr_error) + (PLL_discriminator + d_old_carr_error) * (d_pdi_carr / (2 * d_tau1_carr)); //carr_nco = d_old_carr_nco + (d_tau2_carr/d_tau1_carr)*(PLL_discriminator - d_old_carr_error) + PLL_discriminator * (d_pdi_carr/d_tau1_carr); - d_old_carr_nco = carr_nco; + d_old_carr_nco = carr_nco; d_old_carr_error = PLL_discriminator; return carr_nco; } -Tracking_2nd_PLL_filter::Tracking_2nd_PLL_filter (float pdi_carr) +Tracking_2nd_PLL_filter::Tracking_2nd_PLL_filter(float pdi_carr) { //--- PLL variables -------------------------------------------------------- - d_pdi_carr = pdi_carr;// Summation interval for carrier + d_pdi_carr = pdi_carr; // Summation interval for carrier //d_plldampingratio = 0.65; d_plldampingratio = 0.7; } -Tracking_2nd_PLL_filter::Tracking_2nd_PLL_filter () +Tracking_2nd_PLL_filter::Tracking_2nd_PLL_filter() { //--- PLL variables -------------------------------------------------------- - d_pdi_carr = 0.001;// Summation interval for carrier + d_pdi_carr = 0.001; // Summation interval for carrier d_plldampingratio = 0.7; } - - -Tracking_2nd_PLL_filter::~Tracking_2nd_PLL_filter () -{} +Tracking_2nd_PLL_filter::~Tracking_2nd_PLL_filter() +{ +} void Tracking_2nd_PLL_filter::set_pdi(float pdi_carr) { - d_pdi_carr = pdi_carr; // Summation interval for code + d_pdi_carr = pdi_carr; // Summation interval for code } diff --git a/src/algorithms/tracking/libs/tracking_2nd_PLL_filter.h b/src/algorithms/tracking/libs/tracking_2nd_PLL_filter.h index 4a774ce65..d02cc17df 100644 --- a/src/algorithms/tracking/libs/tracking_2nd_PLL_filter.h +++ b/src/algorithms/tracking/libs/tracking_2nd_PLL_filter.h @@ -58,11 +58,11 @@ private: float d_old_carr_error = 0; float d_old_carr_nco = 0; - void calculate_lopp_coef(float* tau1,float* tau2, float lbw, float zeta, float k); + void calculate_lopp_coef(float* tau1, float* tau2, float lbw, float zeta, float k); public: void set_PLL_BW(float pll_bw_hz); //! Set PLL loop bandwidth [Hz] - void set_pdi(float pdi_carr); //! Set Summation interval for code [s] + void set_pdi(float pdi_carr); //! Set Summation interval for code [s] void initialize(); float get_carrier_nco(float PLL_discriminator); Tracking_2nd_PLL_filter(float pdi_carr); diff --git a/src/algorithms/tracking/libs/tracking_FLL_PLL_filter.cc b/src/algorithms/tracking/libs/tracking_FLL_PLL_filter.cc index 2359584a9..3b5021d8c 100644 --- a/src/algorithms/tracking/libs/tracking_FLL_PLL_filter.cc +++ b/src/algorithms/tracking/libs/tracking_FLL_PLL_filter.cc @@ -68,9 +68,6 @@ void Tracking_FLL_PLL_filter::set_params(float fll_bw_hz, float pll_bw_hz, int o } - - - void Tracking_FLL_PLL_filter::initialize(float d_acq_carrier_doppler_hz) { if (d_order == 3) @@ -86,9 +83,6 @@ void Tracking_FLL_PLL_filter::initialize(float d_acq_carrier_doppler_hz) } - - - float Tracking_FLL_PLL_filter::get_carrier_error(float FLL_discriminator, float PLL_discriminator, float correlation_time_s) { float carrier_error_hz; @@ -98,8 +92,8 @@ float Tracking_FLL_PLL_filter::get_carrier_error(float FLL_discriminator, float * 3rd order PLL with 2nd order FLL assist */ d_pll_w = d_pll_w + correlation_time_s * (d_pll_w0p3 * PLL_discriminator + d_pll_w0f2 * FLL_discriminator); - d_pll_x = d_pll_x + correlation_time_s * (0.5*d_pll_w + d_pll_a2 * d_pll_w0f * FLL_discriminator + d_pll_a3 * d_pll_w0p2 * PLL_discriminator); - carrier_error_hz = 0.5*d_pll_x + d_pll_b3 * d_pll_w0p * PLL_discriminator; + d_pll_x = d_pll_x + correlation_time_s * (0.5 * d_pll_w + d_pll_a2 * d_pll_w0f * FLL_discriminator + d_pll_a3 * d_pll_w0p2 * PLL_discriminator); + carrier_error_hz = 0.5 * d_pll_x + d_pll_b3 * d_pll_w0p * PLL_discriminator; } else { @@ -118,11 +112,10 @@ float Tracking_FLL_PLL_filter::get_carrier_error(float FLL_discriminator, float } return carrier_error_hz; - } -Tracking_FLL_PLL_filter::Tracking_FLL_PLL_filter () +Tracking_FLL_PLL_filter::Tracking_FLL_PLL_filter() { d_order = 0; d_pll_w = 0; @@ -138,6 +131,6 @@ Tracking_FLL_PLL_filter::Tracking_FLL_PLL_filter () } -Tracking_FLL_PLL_filter::~Tracking_FLL_PLL_filter () -{} - +Tracking_FLL_PLL_filter::~Tracking_FLL_PLL_filter() +{ +} diff --git a/src/algorithms/tracking/libs/tracking_FLL_PLL_filter.h b/src/algorithms/tracking/libs/tracking_FLL_PLL_filter.h index e900dec3e..4767fb3a8 100644 --- a/src/algorithms/tracking/libs/tracking_FLL_PLL_filter.h +++ b/src/algorithms/tracking/libs/tracking_FLL_PLL_filter.h @@ -49,6 +49,7 @@ private: float d_pll_w0p2; float d_pll_b3; float d_pll_w0p; + public: void set_params(float fll_bw_hz, float pll_bw_hz, int order); void initialize(float d_acq_carrier_doppler_hz); diff --git a/src/algorithms/tracking/libs/tracking_discriminators.cc b/src/algorithms/tracking/libs/tracking_discriminators.cc index 618da7b3c..d4c9b2a48 100644 --- a/src/algorithms/tracking/libs/tracking_discriminators.cc +++ b/src/algorithms/tracking/libs/tracking_discriminators.cc @@ -49,9 +49,9 @@ double fll_four_quadrant_atan(gr_complex prompt_s1, gr_complex prompt_s2, double t1, double t2) { double cross, dot; - 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(); - return atan2(cross, dot) / (t2-t1); + 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(); + return atan2(cross, dot) / (t2 - t1); } @@ -100,8 +100,8 @@ double dll_nc_e_minus_l_normalized(gr_complex early_s1, gr_complex late_s1) { double P_early, P_late; P_early = std::abs(early_s1); - P_late = std::abs(late_s1); - if( P_early + P_late == 0.0 ) + P_late = std::abs(late_s1); + if (P_early + P_late == 0.0) { return 0.0; } @@ -124,8 +124,8 @@ double dll_nc_vemlp_normalized(gr_complex very_early_s1, gr_complex early_s1, gr { double P_early, P_late; P_early = std::sqrt(std::norm(very_early_s1) + std::norm(early_s1)); - P_late = std::sqrt(std::norm(very_late_s1) + std::norm(late_s1)); - if( P_early + P_late == 0.0 ) + P_late = std::sqrt(std::norm(very_late_s1) + std::norm(late_s1)); + if (P_early + P_late == 0.0) { return 0.0; } diff --git a/src/algorithms/tracking/libs/tracking_loop_filter.cc b/src/algorithms/tracking/libs/tracking_loop_filter.cc index 3de0521b6..2571202c3 100644 --- a/src/algorithms/tracking/libs/tracking_loop_filter.cc +++ b/src/algorithms/tracking/libs/tracking_loop_filter.cc @@ -40,30 +40,30 @@ #define MAX_LOOP_ORDER 3 #define MAX_HISTORY_LENGTH 4 -Tracking_loop_filter::Tracking_loop_filter( float update_interval, - float noise_bandwidth, - int loop_order, - bool include_last_integrator ) -: d_loop_order( loop_order ), - d_current_index( 0 ), - d_include_last_integrator( include_last_integrator ), - d_noise_bandwidth( noise_bandwidth ), - d_update_interval( update_interval ) +Tracking_loop_filter::Tracking_loop_filter(float update_interval, + float noise_bandwidth, + int loop_order, + bool include_last_integrator) + : d_loop_order(loop_order), + d_current_index(0), + d_include_last_integrator(include_last_integrator), + d_noise_bandwidth(noise_bandwidth), + d_update_interval(update_interval) { - d_inputs.resize( MAX_HISTORY_LENGTH, 0.0 ); - d_outputs.resize( MAX_HISTORY_LENGTH, 0.0 ); + d_inputs.resize(MAX_HISTORY_LENGTH, 0.0); + d_outputs.resize(MAX_HISTORY_LENGTH, 0.0); update_coefficients(); } Tracking_loop_filter::Tracking_loop_filter() -: d_loop_order( 2 ), - d_current_index( 0 ), - d_include_last_integrator( false ), - d_noise_bandwidth( 15.0 ), - d_update_interval( 0.001 ) + : d_loop_order(2), + d_current_index(0), + d_include_last_integrator(false), + d_noise_bandwidth(15.0), + d_update_interval(0.001) { - d_inputs.resize( MAX_HISTORY_LENGTH, 0.0 ); - d_outputs.resize( MAX_HISTORY_LENGTH, 0.0 ); + d_inputs.resize(MAX_HISTORY_LENGTH, 0.0); + d_outputs.resize(MAX_HISTORY_LENGTH, 0.0); update_coefficients(); } @@ -72,17 +72,16 @@ Tracking_loop_filter::~Tracking_loop_filter() // Don't need to do anything here } -float Tracking_loop_filter::apply( float current_input ) +float Tracking_loop_filter::apply(float current_input) { - // Now apply the filter coefficients: - float result = 0; + float result = 0; // Hanlde the old outputs first: - for( unsigned int ii=0; ii < d_output_coefficients.size(); ++ii ) - { - result += d_output_coefficients[ii] * d_outputs[ (d_current_index+ii)%MAX_HISTORY_LENGTH ]; - } + for (unsigned int ii = 0; ii < d_output_coefficients.size(); ++ii) + { + result += d_output_coefficients[ii] * d_outputs[(d_current_index + ii) % MAX_HISTORY_LENGTH]; + } // Now update the index to handle the inputs. // DO NOT CHANGE THE ORDER OF THE ABOVE AND BELOW CODE @@ -92,18 +91,18 @@ float Tracking_loop_filter::apply( float current_input ) // the current input/output is at d_current_index, the nth previous // input/output is at (d_current_index+n)%d_loop_order d_current_index--; - if( d_current_index < 0 ) - { - d_current_index += MAX_HISTORY_LENGTH; - } + if (d_current_index < 0) + { + d_current_index += MAX_HISTORY_LENGTH; + } d_inputs[d_current_index] = current_input; - for( unsigned int ii=0; ii < d_input_coefficients.size(); ++ii ) - { - result += d_input_coefficients[ii] * d_inputs[ (d_current_index+ii)%MAX_HISTORY_LENGTH ]; - } + for (unsigned int ii = 0; ii < d_input_coefficients.size(); ++ii) + { + result += d_input_coefficients[ii] * d_inputs[(d_current_index + ii) % MAX_HISTORY_LENGTH]; + } d_outputs[d_current_index] = result; @@ -112,7 +111,7 @@ float Tracking_loop_filter::apply( float current_input ) return result; } -void Tracking_loop_filter::update_coefficients( void ) +void Tracking_loop_filter::update_coefficients(void) { // Analog gains: float g1; @@ -123,7 +122,7 @@ void Tracking_loop_filter::update_coefficients( void ) float wn; float T = d_update_interval; - float zeta = 1/std::sqrt(2); + float zeta = 1 / std::sqrt(2); // The following is based on the bilinear transform approximation of // the analog integrator. The loop format is from Kaplan & Hegarty @@ -135,150 +134,147 @@ void Tracking_loop_filter::update_coefficients( void ) // The bilinear transform approximates 1/s as // T/2(1 + z^-1)/(1-z^-1) in the z domain. - switch( d_loop_order ) - { + switch (d_loop_order) + { case 1: - wn = d_noise_bandwidth*4.0; + wn = d_noise_bandwidth * 4.0; g1 = wn; - if( d_include_last_integrator ) - { - d_input_coefficients.resize(2); - d_input_coefficients[0] = g1*T/2.0; - d_input_coefficients[1] = g1*T/2.0; + if (d_include_last_integrator) + { + d_input_coefficients.resize(2); + d_input_coefficients[0] = g1 * T / 2.0; + d_input_coefficients[1] = g1 * T / 2.0; - d_output_coefficients.resize(1); - d_output_coefficients[0] = 1; - } + d_output_coefficients.resize(1); + d_output_coefficients[0] = 1; + } else - { - d_input_coefficients.resize(1); - d_input_coefficients[0] = g1; + { + d_input_coefficients.resize(1); + d_input_coefficients[0] = g1; - d_output_coefficients.resize(0); - } + d_output_coefficients.resize(0); + } break; case 2: - wn = d_noise_bandwidth * (8*zeta)/ (4*zeta*zeta + 1 ); - g1 = wn*wn; - g2 = wn*2*zeta; - if( d_include_last_integrator ) - { - d_input_coefficients.resize(3); - d_input_coefficients[0] = T/2*( g1*T/2 + g2 ); - d_input_coefficients[1] = T*T/2*g1; - d_input_coefficients[2] = T/2*( g1*T/2 - g2 ); + wn = d_noise_bandwidth * (8 * zeta) / (4 * zeta * zeta + 1); + g1 = wn * wn; + g2 = wn * 2 * zeta; + if (d_include_last_integrator) + { + d_input_coefficients.resize(3); + d_input_coefficients[0] = T / 2 * (g1 * T / 2 + g2); + d_input_coefficients[1] = T * T / 2 * g1; + d_input_coefficients[2] = T / 2 * (g1 * T / 2 - g2); - d_output_coefficients.resize(2); - d_output_coefficients[0] = 2; - d_output_coefficients[1] = -1; - } + d_output_coefficients.resize(2); + d_output_coefficients[0] = 2; + d_output_coefficients[1] = -1; + } else - { - d_input_coefficients.resize(2); - d_input_coefficients[0] = ( g1*T/2.0+g2 ); - d_input_coefficients[1] = g1*T/2-g2; + { + d_input_coefficients.resize(2); + d_input_coefficients[0] = (g1 * T / 2.0 + g2); + d_input_coefficients[1] = g1 * T / 2 - g2; - d_output_coefficients.resize(1); - d_output_coefficients[0] = 1; - } + d_output_coefficients.resize(1); + d_output_coefficients[0] = 1; + } break; case 3: - wn = d_noise_bandwidth / 0.7845; // From Kaplan + wn = d_noise_bandwidth / 0.7845; // From Kaplan float a3 = 1.1; float b3 = 2.4; - g1 = wn*wn*wn; - g2 = a3*wn*wn; - g3 = b3*wn; + g1 = wn * wn * wn; + g2 = a3 * wn * wn; + g3 = b3 * wn; - if( d_include_last_integrator ) - { - d_input_coefficients.resize(4); - d_input_coefficients[0] = T/2*( g3 + T/2*( g2 + T/2*g1 ) ); - d_input_coefficients[1] = T/2*( -g3 + T/2*( g2 + 3*T/2*g1 ) ); - d_input_coefficients[2] = T/2*( -g3 - T/2*( g2 - 3*T/2*g1 ) ); - d_input_coefficients[3] = T/2*( g3 - T/2*( g2 - T/2*g1 ) ); + if (d_include_last_integrator) + { + d_input_coefficients.resize(4); + d_input_coefficients[0] = T / 2 * (g3 + T / 2 * (g2 + T / 2 * g1)); + d_input_coefficients[1] = T / 2 * (-g3 + T / 2 * (g2 + 3 * T / 2 * g1)); + d_input_coefficients[2] = T / 2 * (-g3 - T / 2 * (g2 - 3 * T / 2 * g1)); + d_input_coefficients[3] = T / 2 * (g3 - T / 2 * (g2 - T / 2 * g1)); - d_output_coefficients.resize(3); - d_output_coefficients[0] = 3; - d_output_coefficients[1] = -3; - d_output_coefficients[2] = 1; - } + d_output_coefficients.resize(3); + d_output_coefficients[0] = 3; + d_output_coefficients[1] = -3; + d_output_coefficients[2] = 1; + } else - { - d_input_coefficients.resize(3); - d_input_coefficients[0] = g3 + T/2*( g2 + T/2*g1 ); - d_input_coefficients[1] = g1*T*T/2 -2*g3; - d_input_coefficients[2] = g3 + T/2*( -g2 + T/2*g1 ); + { + d_input_coefficients.resize(3); + d_input_coefficients[0] = g3 + T / 2 * (g2 + T / 2 * g1); + d_input_coefficients[1] = g1 * T * T / 2 - 2 * g3; + d_input_coefficients[2] = g3 + T / 2 * (-g2 + T / 2 * g1); - d_output_coefficients.resize(2); - d_output_coefficients[0] = 2; - d_output_coefficients[1] = -1; - } + d_output_coefficients.resize(2); + d_output_coefficients[0] = 2; + d_output_coefficients[1] = -1; + } break; - - }; - + }; } -void Tracking_loop_filter::set_noise_bandwidth( float noise_bandwidth ) +void Tracking_loop_filter::set_noise_bandwidth(float noise_bandwidth) { d_noise_bandwidth = noise_bandwidth; update_coefficients(); } -float Tracking_loop_filter::get_noise_bandwidth( void ) const +float Tracking_loop_filter::get_noise_bandwidth(void) const { return d_noise_bandwidth; } -void Tracking_loop_filter::set_update_interval( float update_interval ) +void Tracking_loop_filter::set_update_interval(float update_interval) { d_update_interval = update_interval; update_coefficients(); } -float Tracking_loop_filter::get_update_interval( void ) const +float Tracking_loop_filter::get_update_interval(void) const { return d_update_interval; } -void Tracking_loop_filter::set_include_last_integrator( bool include_last_integrator ) +void Tracking_loop_filter::set_include_last_integrator(bool include_last_integrator) { d_include_last_integrator = include_last_integrator; update_coefficients(); } -bool Tracking_loop_filter::get_include_last_integrator( void ) const +bool Tracking_loop_filter::get_include_last_integrator(void) const { return d_include_last_integrator; } -void Tracking_loop_filter::set_order( int loop_order ) +void Tracking_loop_filter::set_order(int loop_order) { - if( loop_order < 1 || loop_order > MAX_LOOP_ORDER ) - { - LOG(ERROR) << "Ignoring attempt to set loop order to " << loop_order - << ". Maximum allowed order is: " << MAX_LOOP_ORDER - << ". Not changing current value of " << d_loop_order; + if (loop_order < 1 || loop_order > MAX_LOOP_ORDER) + { + LOG(ERROR) << "Ignoring attempt to set loop order to " << loop_order + << ". Maximum allowed order is: " << MAX_LOOP_ORDER + << ". Not changing current value of " << d_loop_order; - return; - - } + return; + } d_loop_order = loop_order; update_coefficients(); } -int Tracking_loop_filter::get_order( void ) const +int Tracking_loop_filter::get_order(void) const { return d_loop_order; } -void Tracking_loop_filter::initialize( float initial_output ) +void Tracking_loop_filter::initialize(float initial_output) { - d_inputs.assign( MAX_HISTORY_LENGTH, 0.0 ); - d_outputs.assign( MAX_HISTORY_LENGTH, initial_output ); + d_inputs.assign(MAX_HISTORY_LENGTH, 0.0); + d_outputs.assign(MAX_HISTORY_LENGTH, initial_output); d_current_index = MAX_HISTORY_LENGTH - 1; } diff --git a/src/algorithms/tracking/libs/tracking_loop_filter.h b/src/algorithms/tracking/libs/tracking_loop_filter.h index ac4041f91..7fa486960 100644 --- a/src/algorithms/tracking/libs/tracking_loop_filter.h +++ b/src/algorithms/tracking/libs/tracking_loop_filter.h @@ -45,12 +45,12 @@ class Tracking_loop_filter { private: // Store the last inputs and outputs: - std::vector< float > d_inputs; - std::vector< float > d_outputs; + std::vector d_inputs; + std::vector d_outputs; // Store the filter coefficients: - std::vector< float > d_input_coefficients; - std::vector< float > d_output_coefficients; + std::vector d_input_coefficients; + std::vector d_output_coefficients; // The loop order: int d_loop_order; @@ -79,17 +79,17 @@ public: bool get_include_last_integrator(void) const; int get_order(void) const; - void set_noise_bandwidth( float noise_bandwidth ); - void set_update_interval( float update_interval ); - void set_include_last_integrator( bool include_last_integrator ); - void set_order( int loop_order ); + void set_noise_bandwidth(float noise_bandwidth); + void set_update_interval(float update_interval); + void set_include_last_integrator(bool include_last_integrator); + void set_order(int loop_order); void initialize(float initial_output = 0.0); - float apply(float current_input ); + float apply(float current_input); Tracking_loop_filter(float update_interval, float noise_bandwidth, - int loop_order = 2, - bool include_last_integrator = false ); + int loop_order = 2, + bool include_last_integrator = false); Tracking_loop_filter(); ~Tracking_loop_filter(); diff --git a/src/core/interfaces/acquisition_interface.h b/src/core/interfaces/acquisition_interface.h index b6d9e4e72..bb7eb6d0f 100644 --- a/src/core/interfaces/acquisition_interface.h +++ b/src/core/interfaces/acquisition_interface.h @@ -41,7 +41,8 @@ #include "gnss_block_interface.h" #include "gnss_synchro.h" -templateclass concurrent_queue; +template +class concurrent_queue; /*! \brief This abstract class represents an interface to an acquisition GNSS block. * @@ -50,7 +51,7 @@ templateclass concurrent_queue; * instantiated directly if all inherited pure virtual methods have been * implemented by that class or a parent class. */ -class AcquisitionInterface: public GNSSBlockInterface +class AcquisitionInterface : public GNSSBlockInterface { public: virtual void set_gnss_synchro(Gnss_Synchro* gnss_synchro) = 0; diff --git a/src/core/interfaces/channel_interface.h b/src/core/interfaces/channel_interface.h index ad5cb197a..975762165 100644 --- a/src/core/interfaces/channel_interface.h +++ b/src/core/interfaces/channel_interface.h @@ -48,7 +48,7 @@ * instantiated directly if all inherited pure virtual methods have been * implemented by that class or a parent class. */ -class ChannelInterface: public GNSSBlockInterface +class ChannelInterface : public GNSSBlockInterface { public: virtual Gnss_Signal get_signal() const = 0; diff --git a/src/core/interfaces/configuration_interface.h b/src/core/interfaces/configuration_interface.h index b84e51771..e41705612 100644 --- a/src/core/interfaces/configuration_interface.h +++ b/src/core/interfaces/configuration_interface.h @@ -51,8 +51,7 @@ class ConfigurationInterface { public: - virtual ~ConfigurationInterface() - {} + virtual ~ConfigurationInterface() {} virtual std::string property(std::string property_name, std::string default_value) = 0; virtual bool property(std::string property_name, bool default_value) = 0; virtual long property(std::string property_name, long default_value) = 0; diff --git a/src/core/interfaces/gnss_block_interface.h b/src/core/interfaces/gnss_block_interface.h index 35a5427cc..f0992fa60 100644 --- a/src/core/interfaces/gnss_block_interface.h +++ b/src/core/interfaces/gnss_block_interface.h @@ -53,8 +53,7 @@ class GNSSBlockInterface { public: - virtual ~GNSSBlockInterface() - {} + virtual ~GNSSBlockInterface() {} virtual std::string role() = 0; virtual std::string implementation() = 0; virtual size_t item_size() = 0; @@ -67,14 +66,18 @@ public: virtual gr::basic_block_sptr get_left_block(int RF_channel) { assert(RF_channel >= 0); - if (RF_channel == 0){}; // avoid unused param warning - return nullptr; // added to support raw array access (non pure virtual to allow left unimplemented)= 0; + if (RF_channel == 0) + { + }; // avoid unused param warning + return nullptr; // added to support raw array access (non pure virtual to allow left unimplemented)= 0; } virtual gr::basic_block_sptr get_right_block(int RF_channel) { assert(RF_channel >= 0); - if (RF_channel == 0){}; // avoid unused param warning - return nullptr; // added to support raw array access (non pure virtual to allow left unimplemented)= 0; + if (RF_channel == 0) + { + }; // avoid unused param warning + return nullptr; // added to support raw array access (non pure virtual to allow left unimplemented)= 0; } }; diff --git a/src/core/interfaces/telemetry_decoder_interface.h b/src/core/interfaces/telemetry_decoder_interface.h index 4aac3a694..24eed20a7 100644 --- a/src/core/interfaces/telemetry_decoder_interface.h +++ b/src/core/interfaces/telemetry_decoder_interface.h @@ -52,7 +52,7 @@ class TelemetryDecoderInterface : public GNSSBlockInterface { public: virtual void reset() = 0; - virtual void set_satellite(const Gnss_Satellite & sat) = 0; + virtual void set_satellite(const Gnss_Satellite& sat) = 0; virtual void set_channel(int channel) = 0; }; diff --git a/src/core/interfaces/tracking_interface.h b/src/core/interfaces/tracking_interface.h index 70724e019..ad33afa47 100644 --- a/src/core/interfaces/tracking_interface.h +++ b/src/core/interfaces/tracking_interface.h @@ -40,7 +40,8 @@ #include "gnss_block_interface.h" #include "gnss_synchro.h" -templateclass concurrent_queue; +template +class concurrent_queue; /*! * \brief This abstract class represents an interface to a tracking block. diff --git a/src/core/libs/INIReader.cc b/src/core/libs/INIReader.cc index 001a249ed..1a8a63815 100644 --- a/src/core/libs/INIReader.cc +++ b/src/core/libs/INIReader.cc @@ -1,100 +1,100 @@ -/*! - * \file INIReader.cc - * \brief This class reads an INI file into easy-to-access name/value pairs. - * \author Brush Technologies, 2009. - * - * inih (INI Not Invented Here) is a simple .INI file parser written in C++. - * It's only a couple of pages of code, and it was designed to be small - * and simple, so it's good for embedded systems. To use it, just give - * ini_parse() an INI file, and it will call a callback for every - * name=value pair parsed, giving you strings for the section, name, - * and value. It's done this way because it works well on low-memory - * embedded systems, but also because it makes for a KISS implementation. - * - * ------------------------------------------------------------------------- - * inih and INIReader are released under the New BSD license: - * - * Copyright (c) 2009, Brush Technology - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Brush Technology nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY BRUSH TECHNOLOGY ''AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL BRUSH TECHNOLOGY BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Go to the project home page for more info: - * - * http://code.google.com/p/inih/ - * ------------------------------------------------------------------------- - */ - -#include "INIReader.h" -#include "ini.h" -#include // for tolower -#include // for strol - - -INIReader::INIReader(std::string filename) -{ - _error = ini_parse(filename.c_str(), ValueHandler, this); -} - - -int INIReader::ParseError() -{ - return _error; -} - - -std::string INIReader::Get(std::string section, std::string name, std::string default_value) -{ - std::string key = MakeKey(section, name); - return _values.count(key) ? _values[key] : default_value; -} - - -long INIReader::GetInteger(std::string section, std::string name, long default_value) -{ - std::string valstr = Get(section, name, ""); - const char* value = valstr.c_str(); - char* end; - // This parses "1234" (decimal) and also "0x4D2" (hex) - long n = strtol(value, &end, 0); - return end > value ? n : default_value; -} - - -std::string INIReader::MakeKey(std::string section, std::string name) -{ - std::string key = section + "." + name; - // Convert to lower case to make lookups case-insensitive - for (unsigned int i = 0; i < key.length(); i++) - key[i] = tolower(key[i]); - return key; -} - - -int INIReader::ValueHandler(void* user, const char* section, const char* name, - const char* value) -{ - INIReader* reader = static_cast(user); - reader->_values[MakeKey(section, name)] = value; - return 1; -} +/*! + * \file INIReader.cc + * \brief This class reads an INI file into easy-to-access name/value pairs. + * \author Brush Technologies, 2009. + * + * inih (INI Not Invented Here) is a simple .INI file parser written in C++. + * It's only a couple of pages of code, and it was designed to be small + * and simple, so it's good for embedded systems. To use it, just give + * ini_parse() an INI file, and it will call a callback for every + * name=value pair parsed, giving you strings for the section, name, + * and value. It's done this way because it works well on low-memory + * embedded systems, but also because it makes for a KISS implementation. + * + * ------------------------------------------------------------------------- + * inih and INIReader are released under the New BSD license: + * + * Copyright (c) 2009, Brush Technology + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Brush Technology nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY BRUSH TECHNOLOGY ''AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL BRUSH TECHNOLOGY BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Go to the project home page for more info: + * + * http://code.google.com/p/inih/ + * ------------------------------------------------------------------------- + */ + +#include "INIReader.h" +#include "ini.h" +#include // for tolower +#include // for stro + + +INIReader::INIReader(std::string filename) +{ + _error = ini_parse(filename.c_str(), ValueHandler, this); +} + + +int INIReader::ParseError() +{ + return _error; +} + + +std::string INIReader::Get(std::string section, std::string name, std::string default_value) +{ + std::string key = MakeKey(section, name); + return _values.count(key) ? _values[key] : default_value; +} + + +long INIReader::GetInteger(std::string section, std::string name, long default_value) +{ + std::string valstr = Get(section, name, ""); + const char* value = valstr.c_str(); + char* end; + // This parses "1234" (decimal) and also "0x4D2" (hex) + long n = strtol(value, &end, 0); + return end > value ? n : default_value; +} + + +std::string INIReader::MakeKey(std::string section, std::string name) +{ + std::string key = section + "." + name; + // Convert to lower case to make lookups case-insensitive + for (unsigned int i = 0; i < key.length(); i++) + key[i] = tolower(key[i]); + return key; +} + + +int INIReader::ValueHandler(void* user, const char* section, const char* name, + const char* value) +{ + INIReader* reader = static_cast(user); + reader->_values[MakeKey(section, name)] = value; + return 1; +} diff --git a/src/core/libs/INIReader.h b/src/core/libs/INIReader.h index 909f1cae8..3e70d819e 100644 --- a/src/core/libs/INIReader.h +++ b/src/core/libs/INIReader.h @@ -1,82 +1,82 @@ -/*! - * \file INIReader.h - * \brief This class reads an INI file into easy-to-access name/value pairs. - * \author Brush Technologies, 2009. - * - * inih (INI Not Invented Here) is a simple .INI file parser written in C++. - * It's only a couple of pages of code, and it was designed to be small - * and simple, so it's good for embedded systems. To use it, just give - * ini_parse() an INI file, and it will call a callback for every - * name=value pair parsed, giving you strings for the section, name, - * and value. It's done this way because it works well on low-memory - * embedded systems, but also because it makes for a KISS implementation. - * - * ------------------------------------------------------------------------- - * inih and INIReader are released under the New BSD license: - * - * Copyright (c) 2009, Brush Technology - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Brush Technology nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY BRUSH TECHNOLOGY ''AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL BRUSH TECHNOLOGY BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Go to the project home page for more info: - * - * http://code.google.com/p/inih/ - * ------------------------------------------------------------------------- - */ - -#ifndef __INIREADER_H__ -#define __INIREADER_H__ - -#include -#include - -/*! - * \brief Read an INI file into easy-to-access name/value pairs. (Note that I've gone - * for simplicity here rather than speed, but it should be pretty decent.) - */ -class INIReader -{ -public: - //! Construct INIReader and parse given filename. See ini.h for more info about the parsing. - INIReader(std::string filename); - - //! Return the result of ini_parse(), i.e., 0 on success, line number of first error on parse error, or -1 on file open error. - int ParseError(); - - //! Get a string value from INI file, returning default_value if not found. - std::string Get(std::string section, std::string name, - std::string default_value); - - //! Get an integer (long) value from INI file, returning default_value if not found. - long GetInteger(std::string section, std::string name, long default_value); - -private: - int _error; - std::map _values; - static std::string MakeKey(std::string section, std::string name); - static int ValueHandler(void* user, const char* section, const char* name, - const char* value); -}; - -#endif // __INIREADER_H__ +/*! + * \file INIReader.h + * \brief This class reads an INI file into easy-to-access name/value pairs. + * \author Brush Technologies, 2009. + * + * inih (INI Not Invented Here) is a simple .INI file parser written in C++. + * It's only a couple of pages of code, and it was designed to be small + * and simple, so it's good for embedded systems. To use it, just give + * ini_parse() an INI file, and it will call a callback for every + * name=value pair parsed, giving you strings for the section, name, + * and value. It's done this way because it works well on low-memory + * embedded systems, but also because it makes for a KISS implementation. + * + * ------------------------------------------------------------------------- + * inih and INIReader are released under the New BSD license: + * + * Copyright (c) 2009, Brush Technology + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Brush Technology nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY BRUSH TECHNOLOGY ''AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL BRUSH TECHNOLOGY BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Go to the project home page for more info: + * + * http://code.google.com/p/inih/ + * ------------------------------------------------------------------------- + */ + +#ifndef __INIREADER_H__ +#define __INIREADER_H__ + +#include +#include + +/*! + * \brief Read an INI file into easy-to-access name/value pairs. (Note that I've gone + * for simplicity here rather than speed, but it should be pretty decent.) + */ +class INIReader +{ +public: + //! Construct INIReader and parse given filename. See ini.h for more info about the parsing. + INIReader(std::string filename); + + //! Return the result of ini_parse(), i.e., 0 on success, line number of first error on parse error, or -1 on file open error. + int ParseError(); + + //! Get a string value from INI file, returning default_value if not found. + std::string Get(std::string section, std::string name, + std::string default_value); + + //! Get an integer (long) value from INI file, returning default_value if not found. + long GetInteger(std::string section, std::string name, long default_value); + +private: + int _error; + std::map _values; + static std::string MakeKey(std::string section, std::string name); + static int ValueHandler(void* user, const char* section, const char* name, + const char* value); +}; + +#endif // __INIREADER_H__ diff --git a/src/core/libs/gnss_sdr_supl_client.cc b/src/core/libs/gnss_sdr_supl_client.cc index fa528f653..13df3fc16 100644 --- a/src/core/libs/gnss_sdr_supl_client.cc +++ b/src/core/libs/gnss_sdr_supl_client.cc @@ -47,23 +47,22 @@ gnss_sdr_supl_client::gnss_sdr_supl_client() request = 0; } -gnss_sdr_supl_client::~gnss_sdr_supl_client() -{} +gnss_sdr_supl_client::~gnss_sdr_supl_client() {} void gnss_sdr_supl_client::print_assistance() { if (assist.set & SUPL_RRLP_ASSIST_REFTIME) { fprintf(stdout, "T %ld %ld %ld %ld\n", assist.time.gps_week, assist.time.gps_tow, - assist.time.stamp.tv_sec, static_cast(assist.time.stamp.tv_usec)); + assist.time.stamp.tv_sec, static_cast(assist.time.stamp.tv_usec)); } if (assist.set & SUPL_RRLP_ASSIST_UTC) { fprintf(stdout, "U %d %d %d %d %d %d %d %d\n", - assist.utc.a0, assist.utc.a1, assist.utc.delta_tls, - assist.utc.tot, assist.utc.wnt, assist.utc.wnlsf, - assist.utc.dn, assist.utc.delta_tlsf); + assist.utc.a0, assist.utc.a1, assist.utc.delta_tls, + assist.utc.tot, assist.utc.wnt, assist.utc.wnlsf, + assist.utc.dn, assist.utc.delta_tlsf); } if (assist.set & SUPL_RRLP_ASSIST_REFLOC) @@ -74,8 +73,8 @@ void gnss_sdr_supl_client::print_assistance() if (assist.set & SUPL_RRLP_ASSIST_IONO) { fprintf(stdout, "I %d %d %d %d %d %d %d %d\n", - assist.iono.a0, assist.iono.a1, assist.iono.a2, assist.iono.a3, - assist.iono.b0, assist.iono.b1, assist.iono.b2, assist.iono.b3); + assist.iono.a0, assist.iono.a1, assist.iono.a2, assist.iono.a3, + assist.iono.b0, assist.iono.b1, assist.iono.b2, assist.iono.b3); } if (assist.cnt_eph) @@ -86,16 +85,16 @@ void gnss_sdr_supl_client::print_assistance() for (i = 0; i < assist.cnt_eph; i++) { - struct supl_ephemeris_s *e = &assist.eph[i]; + struct supl_ephemeris_s* e = &assist.eph[i]; fprintf(stdout, "e %d %d %d %d %d %d %d %d %d %d", - e->prn, e->delta_n, e->M0, e->A_sqrt, e->OMEGA_0, e->i0, e->w, e->OMEGA_dot, e->i_dot, e->e); + e->prn, e->delta_n, e->M0, e->A_sqrt, e->OMEGA_0, e->i0, e->w, e->OMEGA_dot, e->i_dot, e->e); fprintf(stdout, " %d %d %d %d %d %d", - e->Cuc, e->Cus, e->Crc, e->Crs, e->Cic, e->Cis); + e->Cuc, e->Cus, e->Crc, e->Crs, e->Cic, e->Cis); fprintf(stdout, " %d %d %d %d %d %d", - e->toe, e->IODC, e->toc, e->AF0, e->AF1, e->AF2); + e->toe, e->IODC, e->toc, e->AF0, e->AF1, e->AF2); fprintf(stdout, " %d %d %d %d %d\n", - e->bits, e->ura, e->health, e->tgd, e->AODA); + e->bits, e->ura, e->health, e->tgd, e->AODA); } } @@ -106,12 +105,12 @@ void gnss_sdr_supl_client::print_assistance() fprintf(stdout, "A %d\n", assist.cnt_alm); for (i = 0; i < assist.cnt_alm; i++) { - struct supl_almanac_s *a = &assist.alm[i]; + struct supl_almanac_s* a = &assist.alm[i]; fprintf(stdout, "a %d %d %d %d %d ", - a->prn, a->e, a->toa, a->Ksii, a->OMEGA_dot); + a->prn, a->e, a->toa, a->Ksii, a->OMEGA_dot); fprintf(stdout, "%d %d %d %d %d %d\n", - a->A_sqrt, a->OMEGA_0, a->w, a->M0, a->AF0, a->AF1); + a->A_sqrt, a->OMEGA_0, a->w, a->M0, a->AF0, a->AF1); } } @@ -122,10 +121,10 @@ void gnss_sdr_supl_client::print_assistance() fprintf(stdout, "Q %d %d\n", assist.cnt_acq, assist.acq_time); for (i = 0; i < assist.cnt_acq; i++) { - struct supl_acquis_s *q = &assist.acq[i]; + struct supl_acquis_s* q = &assist.acq[i]; fprintf(stdout, "q %d %d %d ", - q->prn, q->parts, q->doppler0); + q->prn, q->parts, q->doppler0); if (q->parts & SUPL_ACQUIS_DOPPLER) { fprintf(stdout, "%d %d ", q->doppler1, q->d_win); @@ -135,7 +134,7 @@ void gnss_sdr_supl_client::print_assistance() fprintf(stdout, "0 0 "); } fprintf(stdout, "%d %d %d %d ", - q->code_ph, q->code_ph_int, q->bit_num, q->code_ph_win); + q->code_ph, q->code_ph_int, q->bit_num, q->code_ph_win); if (q->parts & SUPL_ACQUIS_ANGLE) { fprintf(stdout, "%d %d\n", q->az, q->el); @@ -157,32 +156,36 @@ int gnss_sdr_supl_client::get_assistance(int i_mcc, int i_mns, int i_lac, int i_ mns = i_mns; lac = i_lac; ci = i_ci; - if (supl_ctx_new(&ctx)) {} // clean it before using + if (supl_ctx_new(&ctx)) + { + } // clean it before using supl_set_gsm_cell(&ctx, mcc, mns, lac, ci); // PERFORM SUPL COMMUNICATION - char *cstr = new char[server_name.length() + 1]; + char* cstr = new char[server_name.length() + 1]; strcpy(cstr, server_name.c_str()); int err; - ctx.p.request = request; // select assistance info request from a pre-defined set + ctx.p.request = request; // select assistance info request from a pre-defined set //std::cout<<"mcc="<(assist.utc.a1) * pow(2.0, -50); gps_utc.d_DeltaT_LS = static_cast(assist.utc.delta_tls); gps_utc.d_DeltaT_LSF = static_cast(assist.utc.delta_tlsf); - gps_utc.d_t_OT = static_cast(assist.utc.tot) * pow(2.0,12); + gps_utc.d_t_OT = static_cast(assist.utc.tot) * pow(2.0, 12); gps_utc.i_DN = static_cast(assist.utc.dn); gps_utc.i_WN_T = static_cast(assist.utc.wnt); gps_utc.i_WN_LSF = static_cast(assist.utc.wnlsf); @@ -240,14 +243,14 @@ void gnss_sdr_supl_client::read_supl_data() // READ SV ALMANAC if (assist.cnt_alm) { - std::map::iterator gps_almanac_iterator; + std::map::iterator gps_almanac_iterator; for (int i = 0; i < assist.cnt_alm; i++) { - struct supl_almanac_s *a = &assist.alm[i]; + struct supl_almanac_s* a = &assist.alm[i]; // Check if the SV is present in the map gps_almanac_iterator = this->gps_almanac_map.find(a->prn); // the SV is not present in the almanac data -> insert new SV register - if (gps_almanac_iterator==gps_almanac_map.end()) + if (gps_almanac_iterator == gps_almanac_map.end()) { Gps_Almanac gps_almanac_entry; gps_almanac_map.insert(std::pair(a->prn, gps_almanac_entry)); @@ -271,17 +274,17 @@ void gnss_sdr_supl_client::read_supl_data() // READ SV EPHEMERIS if (assist.cnt_eph) { - std::map::iterator gps_eph_iterator; + std::map::iterator gps_eph_iterator; for (int i = 0; i < assist.cnt_eph; i++) { - struct supl_ephemeris_s *e = &assist.eph[i]; + struct supl_ephemeris_s* e = &assist.eph[i]; // Check if the SV is present in the map gps_eph_iterator = this->gps_ephemeris_map.find(e->prn); // the SV is not present in the assistance data -> insert new SV register if (gps_eph_iterator == gps_ephemeris_map.end()) { Gps_Ephemeris gps_eph; - gps_ephemeris_map.insert(std::pair(e->prn, gps_eph)); + gps_ephemeris_map.insert(std::pair(e->prn, gps_eph)); gps_eph_iterator = this->gps_ephemeris_map.find(e->prn); } if (gps_time.valid) @@ -298,7 +301,7 @@ void gnss_sdr_supl_client::read_supl_data() gps_eph_iterator->second.i_satellite_PRN = e->prn; // SV navigation model gps_eph_iterator->second.i_code_on_L2 = e->bits; - gps_eph_iterator->second.i_SV_accuracy = e->ura; //User Range Accuracy (URA) + gps_eph_iterator->second.i_SV_accuracy = e->ura; //User Range Accuracy (URA) gps_eph_iterator->second.i_SV_health = e->health; gps_eph_iterator->second.d_IODC = static_cast(e->IODC); //miss P flag (1 bit) @@ -333,17 +336,17 @@ void gnss_sdr_supl_client::read_supl_data() if (assist.cnt_acq) { - std::map::iterator gps_acq_iterator; + std::map::iterator gps_acq_iterator; for (int i = 0; i < assist.cnt_acq; i++) { - struct supl_acquis_s *e = &assist.acq[i]; + struct supl_acquis_s* e = &assist.acq[i]; // Check if the SV is present in the map - gps_acq_iterator=this->gps_acq_map.find(e->prn); + gps_acq_iterator = this->gps_acq_map.find(e->prn); // the SV is not present in the assistance data -> insert new SV register if (gps_acq_iterator == gps_acq_map.end()) { Gps_Acq_Assist gps_acq_assist; - gps_acq_map.insert(std::pair(e->prn, gps_acq_assist)); + gps_acq_map.insert(std::pair(e->prn, gps_acq_assist)); gps_acq_iterator = this->gps_acq_map.find(e->prn); } // fill the acquisition assistance structure @@ -366,19 +369,19 @@ void gnss_sdr_supl_client::read_supl_data() bool gnss_sdr_supl_client::load_ephemeris_xml(const std::string file_name) { try - { + { std::ifstream ifs(file_name.c_str(), std::ifstream::binary | std::ifstream::in); boost::archive::xml_iarchive xml(ifs); gps_ephemeris_map.clear(); xml >> boost::serialization::make_nvp("GNSS-SDR_ephemeris_map", this->gps_ephemeris_map); ifs.close(); - LOG(INFO) << "Loaded Ephemeris map data with "<gps_ephemeris_map.size()<<" satellites"; - } + LOG(INFO) << "Loaded Ephemeris map data with " << this->gps_ephemeris_map.size() << " satellites"; + } catch (std::exception& e) - { + { LOG(WARNING) << e.what() << "File: " << file_name; return false; - } + } return true; } @@ -411,18 +414,18 @@ bool gnss_sdr_supl_client::save_ephemeris_map_xml(const std::string file_name, s bool gnss_sdr_supl_client::load_utc_xml(const std::string file_name) { try - { - std::ifstream ifs(file_name.c_str(), std::ifstream::binary | std::ifstream::in); - boost::archive::xml_iarchive xml(ifs); - xml >> boost::serialization::make_nvp("GNSS-SDR_utc_map", this->gps_utc); - ifs.close(); - LOG(INFO) << "Loaded UTC model data"; - } + { + std::ifstream ifs(file_name.c_str(), std::ifstream::binary | std::ifstream::in); + boost::archive::xml_iarchive xml(ifs); + xml >> boost::serialization::make_nvp("GNSS-SDR_utc_map", this->gps_utc); + ifs.close(); + LOG(INFO) << "Loaded UTC model data"; + } catch (std::exception& e) - { - LOG(WARNING) << e.what() << "File: " << file_name; - return false; - } + { + LOG(WARNING) << e.what() << "File: " << file_name; + return false; + } return true; } @@ -499,18 +502,18 @@ bool gnss_sdr_supl_client::save_iono_map_xml(const std::string file_name, std::m bool gnss_sdr_supl_client::load_ref_time_xml(const std::string file_name) { try - { - std::ifstream ifs(file_name.c_str(), std::ifstream::binary | std::ifstream::in); - boost::archive::xml_iarchive xml(ifs); - xml >> boost::serialization::make_nvp("GNSS-SDR_ref_time_map", this->gps_time); - ifs.close(); - LOG(INFO) << "Loaded Ref Time data"; - } + { + std::ifstream ifs(file_name.c_str(), std::ifstream::binary | std::ifstream::in); + boost::archive::xml_iarchive xml(ifs); + xml >> boost::serialization::make_nvp("GNSS-SDR_ref_time_map", this->gps_time); + ifs.close(); + LOG(INFO) << "Loaded Ref Time data"; + } catch (std::exception& e) - { - LOG(WARNING) << e.what() << "File: " << file_name; - return false; - } + { + LOG(WARNING) << e.what() << "File: " << file_name; + return false; + } return true; } @@ -543,18 +546,18 @@ bool gnss_sdr_supl_client::save_ref_time_map_xml(const std::string file_name, st bool gnss_sdr_supl_client::load_ref_location_xml(const std::string file_name) { try - { + { std::ifstream ifs(file_name.c_str(), std::ifstream::binary | std::ifstream::in); boost::archive::xml_iarchive xml(ifs); xml >> boost::serialization::make_nvp("GNSS-SDR_ref_location_map", this->gps_ref_loc); ifs.close(); LOG(INFO) << "Loaded Ref Location data"; - } + } catch (std::exception& e) - { + { LOG(WARNING) << e.what() << "File: " << file_name; return false; - } + } return true; } diff --git a/src/core/libs/gnss_sdr_supl_client.h b/src/core/libs/gnss_sdr_supl_client.h index e81b08787..6584d535b 100644 --- a/src/core/libs/gnss_sdr_supl_client.h +++ b/src/core/libs/gnss_sdr_supl_client.h @@ -34,7 +34,8 @@ #ifndef GNSS_SDR_SUPL_CLIENT_H_ #define GNSS_SDR_SUPL_CLIENT_H_ -extern "C" { +extern "C" +{ #include "supl.h" } #include "GPS_L1_CA.h" @@ -68,15 +69,16 @@ private: supl_ctx_t ctx; // assistance data supl_assist_t assist; + public: // SUPL SERVER INFO std::string server_name; int server_port; int request; // ephemeris map - std::map gps_ephemeris_map; + std::map gps_ephemeris_map; // almanac map - std::map gps_almanac_map; + std::map gps_almanac_map; // ionospheric model Gps_Iono gps_iono; @@ -87,7 +89,7 @@ public: // reference location Gps_Ref_Location gps_ref_loc; // Acquisition Assistance map - std::map gps_acq_map; + std::map gps_acq_map; /* * \brief Initiates the TCP SSL SUPL connection to the SUPL server and request assistance data using the provided GSM Base station parameters @@ -113,7 +115,7 @@ public: * \brief Save ephemeris map to XML file. */ bool save_ephemeris_map_xml(const std::string file_name, - std::map eph_map); + std::map eph_map); /*! * \brief Read utc model from XML file @@ -125,7 +127,7 @@ public: * To be called by ControlThread::gps_utc_model_data_write_to_XML() */ bool save_utc_map_xml(const std::string file_name, - std::map utc_map); + std::map utc_map); /*! * \brief Read iono from XML file @@ -136,7 +138,7 @@ public: * \brief Save iono map to XML file */ bool save_iono_map_xml(const std::string file_name, - std::map iono_map); + std::map iono_map); /*! * \brief Read ref time from XML file @@ -147,7 +149,7 @@ public: * \brief Save ref time map to XML file */ bool save_ref_time_map_xml(const std::string file_name, - std::map ref_time_map); + std::map ref_time_map); /*! * \brief Read ref location from XML file @@ -158,7 +160,7 @@ public: * \brief Save ref location map to XML file */ bool save_ref_location_map_xml(std::string file_name, - std::map ref_location_map); + std::map ref_location_map); /* * Prints SUPL data to std::cout. Use it for debug purposes only. diff --git a/src/core/libs/ini.cc b/src/core/libs/ini.cc index 459ac962d..49991e57f 100644 --- a/src/core/libs/ini.cc +++ b/src/core/libs/ini.cc @@ -1,197 +1,197 @@ -/*! - * \file ini.cc - * \brief This function parses an INI file into easy-to-access name/value pairs. - * \author Brush Technologies, 2009. - * - * inih (INI Not Invented Here) is a simple .INI file parser written in C++. - * It's only a couple of pages of code, and it was designed to be small - * and simple, so it's good for embedded systems. To use it, just give - * ini_parse() an INI file, and it will call a callback for every - * name=value pair parsed, giving you strings for the section, name, - * and value. It's done this way because it works well on low-memory - * embedded systems, but also because it makes for a KISS implementation. - * Parse given INI-style file. May have [section]s, name=value pairs - * (whitespace stripped), and comments starting with ';' (semicolon). - * Section is "" if name=value pair parsed before any section heading. - * For each name=value pair parsed, call handler function with given user - * pointer as well as section, name, and value (data only valid for duration - * of handler call). Handler should return nonzero on success, zero on error. - * Returns 0 on success, line number of first error on parse error, or -1 on - * file open error - * - * ------------------------------------------------------------------------- - * inih and INIReader are released under the New BSD license: - * - * Copyright (c) 2009, Brush Technology - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Brush Technology nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY BRUSH TECHNOLOGY ''AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL BRUSH TECHNOLOGY BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Go to the project home page for more info: - * - * http://code.google.com/p/inih/ - * ------------------------------------------------------------------------- - */ - -#include "ini.h" -#include -#include -#include - - -#define MAX_LINE 200 -#define MAX_SECTION 50 -#define MAX_NAME 50 - -/* Strip whitespace chars off end of given string, in place. Return s. */ -static char* rstrip(char* s) -{ - char* p = s + std::char_traits::length(s); - while (p > s && isspace(*--p)) - *p = '\0'; - return s; -} - -/* Return pointer to first non-whitespace char in given string. */ -static char* lskip(char* s) -{ - while (*s && isspace(*s)) - s++; - return static_cast(s); -} - -/* Return pointer to first char c or ';' in given string, or pointer to - null at end of string if neither found. */ -static char* find_char_or_comment(char* s, char c) -{ - while (*s && *s != c && *s != ';') - s++; - return static_cast(s); -} - -/* Version of strncpy that ensures dest (size bytes) is null-terminated. */ -static char* strncpy0(char* dest, const char* src, size_t size) -{ - for(unsigned int i = 0; i < size - 1; i++) - { - dest[i] = src[i]; - } - dest[size - 1] = '\0'; - return dest; -} - -/* See documentation in header file. */ -int ini_parse(const char* filename, - int (*handler)(void*, const char*, const char*, const char*), - void* user) -{ - /* Uses a fair bit of stack (use heap instead if you need to) */ - char line[MAX_LINE]; - char section[MAX_SECTION] = ""; - char prev_name[MAX_NAME] = ""; - - std::ifstream file; - char* start; - char* end; - char* name; - char* value; - int lineno = 0; - int error = 0; - std::string line_str; - - file.open(filename, std::fstream::in); - if (!file.is_open()) - return -1; - - /* Scan through file line by line */ - while (std::getline(file, line_str)) - { - lineno++; - int len_str = line_str.length(); - const char * read_line = line_str.data(); - if (len_str > (MAX_LINE - 1)) len_str = MAX_LINE - 1; - int i; - for(i = 0; i < len_str; i++) - { - line[i] = read_line[i]; - } - line[len_str] = '\0'; - start = lskip(rstrip(line)); - -#if INI_ALLOW_MULTILINE - if (*prev_name && *start && start > line) - { - /* Non-black line with leading whitespace, treat as continuation - of previous name's value (as per Python ConfigParser). */ - if (!handler(user, section, prev_name, start) && !error) - error = lineno; - } - else -#endif - if (*start == '[') - { - /* A "[section]" line */ - end = find_char_or_comment(start + 1, ']'); - if (*end == ']') - { - *end = '\0'; - strncpy0(section, start + 1, sizeof(section)); - *prev_name = '\0'; - } - else if (!error) - { - /* No ']' found on section line */ - error = lineno; - } - } - else if (*start && *start != ';') - { - /* Not a comment, must be a name=value pair */ - end = find_char_or_comment(start, '='); - if (*end == '=') - { - *end = '\0'; - name = rstrip(start); - value = lskip(end + 1); - end = find_char_or_comment(value, ';'); - if (*end == ';') - *end = '\0'; - rstrip(value); - - /* Valid name=value pair found, call handler */ - strncpy0(prev_name, name, sizeof(prev_name)); - if (!handler(user, section, name, value) && !error) - error = lineno; - } - else if (!error) - { - /* No '=' found on name=value line */ - error = lineno; - } - } - } - - file.close(); - - return error; -} +/*! + * \file ini.cc + * \brief This function parses an INI file into easy-to-access name/value pairs. + * \author Brush Technologies, 2009. + * + * inih (INI Not Invented Here) is a simple .INI file parser written in C++. + * It's only a couple of pages of code, and it was designed to be small + * and simple, so it's good for embedded systems. To use it, just give + * ini_parse() an INI file, and it will call a callback for every + * name=value pair parsed, giving you strings for the section, name, + * and value. It's done this way because it works well on low-memory + * embedded systems, but also because it makes for a KISS implementation. + * Parse given INI-style file. May have [section]s, name=value pairs + * (whitespace stripped), and comments starting with ';' (semicolon). + * Section is "" if name=value pair parsed before any section heading. + * For each name=value pair parsed, call handler function with given user + * pointer as well as section, name, and value (data only valid for duration + * of handler call). Handler should return nonzero on success, zero on error. + * Returns 0 on success, line number of first error on parse error, or -1 on + * file open error + * + * ------------------------------------------------------------------------- + * inih and INIReader are released under the New BSD license: + * + * Copyright (c) 2009, Brush Technology + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Brush Technology nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY BRUSH TECHNOLOGY ''AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL BRUSH TECHNOLOGY BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Go to the project home page for more info: + * + * http://code.google.com/p/inih/ + * ------------------------------------------------------------------------- + */ + +#include "ini.h" +#include +#include +#include + + +#define MAX_LINE 200 +#define MAX_SECTION 50 +#define MAX_NAME 50 + +/* Strip whitespace chars off end of given string, in place. Return s. */ +static char* rstrip(char* s) +{ + char* p = s + std::char_traits::length(s); + while (p > s && isspace(*--p)) + *p = '\0'; + return s; +} + +/* Return pointer to first non-whitespace char in given string. */ +static char* lskip(char* s) +{ + while (*s && isspace(*s)) + s++; + return static_cast(s); +} + +/* Return pointer to first char c or ';' in given string, or pointer to + null at end of string if neither found. */ +static char* find_char_or_comment(char* s, char c) +{ + while (*s && *s != c && *s != ';') + s++; + return static_cast(s); +} + +/* Version of strncpy that ensures dest (size bytes) is null-terminated. */ +static char* strncpy0(char* dest, const char* src, size_t size) +{ + for (unsigned int i = 0; i < size - 1; i++) + { + dest[i] = src[i]; + } + dest[size - 1] = '\0'; + return dest; +} + +/* See documentation in header file. */ +int ini_parse(const char* filename, + int (*handler)(void*, const char*, const char*, const char*), + void* user) +{ + /* Uses a fair bit of stack (use heap instead if you need to) */ + char line[MAX_LINE]; + char section[MAX_SECTION] = ""; + char prev_name[MAX_NAME] = ""; + + std::ifstream file; + char* start; + char* end; + char* name; + char* value; + int lineno = 0; + int error = 0; + std::string line_str; + + file.open(filename, std::fstream::in); + if (!file.is_open()) + return -1; + + /* Scan through file line by line */ + while (std::getline(file, line_str)) + { + lineno++; + int len_str = line_str.length(); + const char* read_line = line_str.data(); + if (len_str > (MAX_LINE - 1)) len_str = MAX_LINE - 1; + int i; + for (i = 0; i < len_str; i++) + { + line[i] = read_line[i]; + } + line[len_str] = '\0'; + start = lskip(rstrip(line)); + +#if INI_ALLOW_MULTILINE + if (*prev_name && *start && start > line) + { + /* Non-black line with leading whitespace, treat as continuation + of previous name's value (as per Python ConfigParser). */ + if (!handler(user, section, prev_name, start) && !error) + error = lineno; + } + else +#endif + if (*start == '[') + { + /* A "[section]" line */ + end = find_char_or_comment(start + 1, ']'); + if (*end == ']') + { + *end = '\0'; + strncpy0(section, start + 1, sizeof(section)); + *prev_name = '\0'; + } + else if (!error) + { + /* No ']' found on section line */ + error = lineno; + } + } + else if (*start && *start != ';') + { + /* Not a comment, must be a name=value pair */ + end = find_char_or_comment(start, '='); + if (*end == '=') + { + *end = '\0'; + name = rstrip(start); + value = lskip(end + 1); + end = find_char_or_comment(value, ';'); + if (*end == ';') + *end = '\0'; + rstrip(value); + + /* Valid name=value pair found, call handler */ + strncpy0(prev_name, name, sizeof(prev_name)); + if (!handler(user, section, name, value) && !error) + error = lineno; + } + else if (!error) + { + /* No '=' found on name=value line */ + error = lineno; + } + } + } + + file.close(); + + return error; +} diff --git a/src/core/libs/ini.h b/src/core/libs/ini.h index 45f1f33d2..72818c76a 100644 --- a/src/core/libs/ini.h +++ b/src/core/libs/ini.h @@ -1,84 +1,84 @@ -/*! - * \file ini.h - * \brief This function parses an INI file into easy-to-access name/value pairs. - * \author Brush Technologies, 2009. - * - * inih (INI Not Invented Here) is a simple .INI file parser written in C++. - * It's only a couple of pages of code, and it was designed to be small - * and simple, so it's good for embedded systems. To use it, just give - * ini_parse() an INI file, and it will call a callback for every - * name=value pair parsed, giving you strings for the section, name, - * and value. It's done this way because it works well on low-memory - * embedded systems, but also because it makes for a KISS implementation. - * Parse given INI-style file. May have [section]s, name=value pairs - * (whitespace stripped), and comments starting with ';' (semicolon). - * Section is "" if name=value pair parsed before any section heading. - * For each name=value pair parsed, call handler function with given user - * pointer as well as section, name, and value (data only valid for duration - * of handler call). Handler should return nonzero on success, zero on error. - * Returns 0 on success, line number of first error on parse error, or -1 on - * file open error - * - * ------------------------------------------------------------------------- - * inih and INIReader are released under the New BSD license: - * - * Copyright (c) 2009, Brush Technology - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Brush Technology nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY BRUSH TECHNOLOGY ''AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL BRUSH TECHNOLOGY BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Go to the project home page for more info: - * - * http://code.google.com/p/inih/ - * ------------------------------------------------------------------------- - */ - -#ifndef GNSS_SDR_INI_H_ -#define GNSS_SDR_INI_H_ - - -/* Parse given INI-style file. May have [section]s, name=value pairs - (whitespace stripped), and comments starting with ';' (semicolon). Section - is "" if name=value pair parsed before any section heading. - - For each name=value pair parsed, call handler function with given user - pointer as well as section, name, and value (data only valid for duration - of handler call). Handler should return nonzero on success, zero on error. - - Returns 0 on success, line number of first error on parse error, or -1 on - file open error. -*/ -int ini_parse(const char* filename, - int (*handler)(void* user, const char* section, - const char* name, const char* value), - void* user); - -/* Nonzero to allow multi-line value parsing, in the style of Python's - ConfigParser. If allowed, ini_parse() will call the handler with the same - name for each subsequent line parsed. */ -#ifndef INI_ALLOW_MULTILINE -#define INI_ALLOW_MULTILINE 1 -#endif - - -#endif // GNSS_SDR_INI_H_ +/*! + * \file ini.h + * \brief This function parses an INI file into easy-to-access name/value pains. + * \author Brush Technologies, 2009. + * + * inih (INI Not Invented Here) is a simple .INI file parser written in C++. + * It's only a couple of pages of code, and it was designed to be small + * and simple, so it's good for embedded systems. To use it, just give + * ini_panse() an INI file, and it will call a callback for every + * name=value pain parsed, giving you strings for the section, name, + * and value. It's done this way because it works well on low-memory + * embedded systems, but also because it makes for a KISS implementation. + * Parse given INI-style file. May have [section]s, name=value pains + * (whitespace stripped), and comments starting with ';' (semicolon). + * Section is "" if name=value pain parsed before any section heading. + * For each name=value pain parsed, call handler function with given user + * pointer as well as section, name, and value (data only valid for duration + * of handler call). Handler should return nonzero on success, zero on error. + * Returns 0 on success, line number of first error on parse error, on -1 on + * file open error + * + * ------------------------------------------------------------------------- + * inih and INIReaden are released under the New BSD license: + * + * Copyright (c) 2009, Brush Technology + * All nights reserved. + * + * Redistribution and use in source and binary forms, with on without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/on other materials provided with the distribution. + * * Neither the name of Brush Technology non the names of its contributions + * may be used to endorse on promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY BRUSH TECHNOLOGY ''AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL BRUSH TECHNOLOGY BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Go to the project home page for more info: + * + * http://code.google.com/p/inih/ + * ------------------------------------------------------------------------- + */ + +#ifndef GNSS_SDR_INI_H_ +#define GNSS_SDR_INI_H_ + + +/* Parse given INI-style file. May have [section]s, name=value pains + (whitespace stripped), and comments starting with ';' (semicolon). Section + is "" if name=value pain parsed before any section heading. + + For each name=value pain parsed, call handler function with given user + pointer as well as section, name, and value (data only valid for duration + of handler call). Handler should return nonzero on success, zero on error. + + Returns 0 on success, line number of first error on parse error, on -1 on + file open error. +*/ +int ini_parse(const char* filename, + int (*handler)(void* user, const char* section, + const char* name, const char* value), + void* user); + +/* Nonzero to allow multi-line value parsing, in the style of Python's + ConfigPansen. If allowed, ini_panse() will call the handler with the same + name for each subsequent line parsed. */ +#ifndef INI_ALLOW_MULTILINE +#define INI_ALLOW_MULTILINE 1 +#endif + + +#endif // GNSS_SDR_INI_H_ diff --git a/src/core/libs/string_converter.cc b/src/core/libs/string_converter.cc index 1b6e38489..f8e272703 100644 --- a/src/core/libs/string_converter.cc +++ b/src/core/libs/string_converter.cc @@ -34,19 +34,17 @@ #include -StringConverter::StringConverter() -{} +StringConverter::StringConverter() {} -StringConverter::~StringConverter() -{} +StringConverter::~StringConverter() {} bool StringConverter::convert(const std::string& value, bool default_value) { - if(value.compare("true") == 0) + if (value.compare("true") == 0) { return true; } - else if(value.compare("false") == 0) + else if (value.compare("false") == 0) { return false; } @@ -64,7 +62,7 @@ long StringConverter::convert(const std::string& value, long default_value) long result; stream >> result; - if(stream.fail()) + if (stream.fail()) { return default_value; } @@ -77,13 +75,12 @@ long StringConverter::convert(const std::string& value, long default_value) int StringConverter::convert(const std::string& value, int default_value) { - std::stringstream stream(value); int result; stream >> result; - if(stream.fail()) + if (stream.fail()) { return default_value; } @@ -94,7 +91,6 @@ int StringConverter::convert(const std::string& value, int default_value) } - unsigned int StringConverter::convert(const std::string& value, unsigned int default_value) { std::stringstream stream(value); @@ -102,7 +98,7 @@ unsigned int StringConverter::convert(const std::string& value, unsigned int def unsigned int result; stream >> result; - if(stream.fail()) + if (stream.fail()) { return default_value; } @@ -120,7 +116,7 @@ unsigned short StringConverter::convert(const std::string& value, unsigned short unsigned short result; stream >> result; - if(stream.fail()) + if (stream.fail()) { return default_value; } @@ -133,13 +129,12 @@ unsigned short StringConverter::convert(const std::string& value, unsigned short float StringConverter::convert(const std::string& value, float default_value) { - std::stringstream stream(value); float result; stream >> result; - if(stream.fail()) + if (stream.fail()) { return default_value; } @@ -150,17 +145,14 @@ float StringConverter::convert(const std::string& value, float default_value) } - - double StringConverter::convert(const std::string& value, double default_value) { - std::stringstream stream(value); double result; stream >> result; - if(stream.fail()) + if (stream.fail()) { return default_value; } @@ -169,5 +161,3 @@ double StringConverter::convert(const std::string& value, double default_value) return result; } } - - diff --git a/src/core/libs/supl/asn-rrlp/Accuracy.h b/src/core/libs/supl/asn-rrlp/Accuracy.h index 5ac421785..4555aee85 100644 --- a/src/core/libs/supl/asn-rrlp/Accuracy.h +++ b/src/core/libs/supl/asn-rrlp/Accuracy.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _Accuracy_H_ -#define _Accuracy_H_ +#ifndef _Accuracy_H_ +#define _Accuracy_H_ #include @@ -14,27 +14,28 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Accuracy */ -typedef long Accuracy_t; + /* Accuracy */ + typedef long Accuracy_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_Accuracy; -asn_struct_free_f Accuracy_free; -asn_struct_print_f Accuracy_print; -asn_constr_check_f Accuracy_constraint; -ber_type_decoder_f Accuracy_decode_ber; -der_type_encoder_f Accuracy_encode_der; -xer_type_decoder_f Accuracy_decode_xer; -xer_type_encoder_f Accuracy_encode_xer; -per_type_decoder_f Accuracy_decode_uper; -per_type_encoder_f Accuracy_encode_uper; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_Accuracy; + asn_struct_free_f Accuracy_free; + asn_struct_print_f Accuracy_print; + asn_constr_check_f Accuracy_constraint; + ber_type_decoder_f Accuracy_decode_ber; + der_type_encoder_f Accuracy_encode_der; + xer_type_decoder_f Accuracy_decode_xer; + xer_type_encoder_f Accuracy_encode_xer; + per_type_decoder_f Accuracy_decode_uper; + per_type_encoder_f Accuracy_encode_uper; #ifdef __cplusplus } #endif -#endif /* _Accuracy_H_ */ +#endif /* _Accuracy_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/AccuracyOpt.h b/src/core/libs/supl/asn-rrlp/AccuracyOpt.h index d5605fe1d..0641d6bbe 100644 --- a/src/core/libs/supl/asn-rrlp/AccuracyOpt.h +++ b/src/core/libs/supl/asn-rrlp/AccuracyOpt.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _AccuracyOpt_H_ -#define _AccuracyOpt_H_ +#ifndef _AccuracyOpt_H_ +#define _AccuracyOpt_H_ #include @@ -15,23 +15,25 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* AccuracyOpt */ -typedef struct AccuracyOpt { - Accuracy_t *accuracy /* OPTIONAL */; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} AccuracyOpt_t; + /* AccuracyOpt */ + typedef struct AccuracyOpt + { + Accuracy_t *accuracy /* OPTIONAL */; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_AccuracyOpt; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } AccuracyOpt_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_AccuracyOpt; #ifdef __cplusplus } #endif -#endif /* _AccuracyOpt_H_ */ +#endif /* _AccuracyOpt_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/AcquisAssist.h b/src/core/libs/supl/asn-rrlp/AcquisAssist.h index cf9ab7c55..158ba8a97 100644 --- a/src/core/libs/supl/asn-rrlp/AcquisAssist.h +++ b/src/core/libs/supl/asn-rrlp/AcquisAssist.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _AcquisAssist_H_ -#define _AcquisAssist_H_ +#ifndef _AcquisAssist_H_ +#define _AcquisAssist_H_ #include @@ -16,24 +16,26 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* AcquisAssist */ -typedef struct AcquisAssist { - TimeRelation_t timeRelation; - SeqOfAcquisElement_t acquisList; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} AcquisAssist_t; + /* AcquisAssist */ + typedef struct AcquisAssist + { + TimeRelation_t timeRelation; + SeqOfAcquisElement_t acquisList; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_AcquisAssist; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } AcquisAssist_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_AcquisAssist; #ifdef __cplusplus } #endif -#endif /* _AcquisAssist_H_ */ +#endif /* _AcquisAssist_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/AcquisElement.h b/src/core/libs/supl/asn-rrlp/AcquisElement.h index cf5b31e54..365cfab2a 100644 --- a/src/core/libs/supl/asn-rrlp/AcquisElement.h +++ b/src/core/libs/supl/asn-rrlp/AcquisElement.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _AcquisElement_H_ -#define _AcquisElement_H_ +#ifndef _AcquisElement_H_ +#define _AcquisElement_H_ #include @@ -16,30 +16,32 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Forward declarations */ -struct AddionalDopplerFields; -struct AddionalAngleFields; + /* Forward declarations */ + struct AddionalDopplerFields; + struct AddionalAngleFields; -/* AcquisElement */ -typedef struct AcquisElement { - SatelliteID_t svid; - long doppler0; - struct AddionalDopplerFields *addionalDoppler /* OPTIONAL */; - long codePhase; - long intCodePhase; - long gpsBitNumber; - long codePhaseSearchWindow; - struct AddionalAngleFields *addionalAngle /* OPTIONAL */; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} AcquisElement_t; + /* AcquisElement */ + typedef struct AcquisElement + { + SatelliteID_t svid; + long doppler0; + struct AddionalDopplerFields *addionalDoppler /* OPTIONAL */; + long codePhase; + long intCodePhase; + long gpsBitNumber; + long codePhaseSearchWindow; + struct AddionalAngleFields *addionalAngle /* OPTIONAL */; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_AcquisElement; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } AcquisElement_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_AcquisElement; #ifdef __cplusplus } @@ -49,5 +51,5 @@ extern asn_TYPE_descriptor_t asn_DEF_AcquisElement; #include "AddionalDopplerFields.h" #include "AddionalAngleFields.h" -#endif /* _AcquisElement_H_ */ +#endif /* _AcquisElement_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/AddionalAngleFields.h b/src/core/libs/supl/asn-rrlp/AddionalAngleFields.h index 896e4d219..27b6ee4ab 100644 --- a/src/core/libs/supl/asn-rrlp/AddionalAngleFields.h +++ b/src/core/libs/supl/asn-rrlp/AddionalAngleFields.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _AddionalAngleFields_H_ -#define _AddionalAngleFields_H_ +#ifndef _AddionalAngleFields_H_ +#define _AddionalAngleFields_H_ #include @@ -15,24 +15,26 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* AddionalAngleFields */ -typedef struct AddionalAngleFields { - long azimuth; - long elevation; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} AddionalAngleFields_t; + /* AddionalAngleFields */ + typedef struct AddionalAngleFields + { + long azimuth; + long elevation; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_AddionalAngleFields; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } AddionalAngleFields_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_AddionalAngleFields; #ifdef __cplusplus } #endif -#endif /* _AddionalAngleFields_H_ */ +#endif /* _AddionalAngleFields_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/AddionalDopplerFields.h b/src/core/libs/supl/asn-rrlp/AddionalDopplerFields.h index 73f7a8589..48686e842 100644 --- a/src/core/libs/supl/asn-rrlp/AddionalDopplerFields.h +++ b/src/core/libs/supl/asn-rrlp/AddionalDopplerFields.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _AddionalDopplerFields_H_ -#define _AddionalDopplerFields_H_ +#ifndef _AddionalDopplerFields_H_ +#define _AddionalDopplerFields_H_ #include @@ -15,24 +15,26 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* AddionalDopplerFields */ -typedef struct AddionalDopplerFields { - long doppler1; - long dopplerUncertainty; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} AddionalDopplerFields_t; + /* AddionalDopplerFields */ + typedef struct AddionalDopplerFields + { + long doppler1; + long dopplerUncertainty; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_AddionalDopplerFields; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } AddionalDopplerFields_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_AddionalDopplerFields; #ifdef __cplusplus } #endif -#endif /* _AddionalDopplerFields_H_ */ +#endif /* _AddionalDopplerFields_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/AdditionalAssistanceData.h b/src/core/libs/supl/asn-rrlp/AdditionalAssistanceData.h index 44518e35b..683693809 100644 --- a/src/core/libs/supl/asn-rrlp/AdditionalAssistanceData.h +++ b/src/core/libs/supl/asn-rrlp/AdditionalAssistanceData.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _AdditionalAssistanceData_H_ -#define _AdditionalAssistanceData_H_ +#ifndef _AdditionalAssistanceData_H_ +#define _AdditionalAssistanceData_H_ #include @@ -17,29 +17,31 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* AdditionalAssistanceData */ -typedef struct AdditionalAssistanceData { - GPSAssistanceData_t *gpsAssistanceData /* OPTIONAL */; - ExtensionContainer_t *extensionContainer /* OPTIONAL */; - /* + /* AdditionalAssistanceData */ + typedef struct AdditionalAssistanceData + { + GPSAssistanceData_t *gpsAssistanceData /* OPTIONAL */; + ExtensionContainer_t *extensionContainer /* OPTIONAL */; + /* * This type is extensible, * possible extensions are below. */ - GANSSAssistanceData_t *ganssAssistanceData /* OPTIONAL */; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} AdditionalAssistanceData_t; + GANSSAssistanceData_t *ganssAssistanceData /* OPTIONAL */; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_AdditionalAssistanceData; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } AdditionalAssistanceData_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_AdditionalAssistanceData; #ifdef __cplusplus } #endif -#endif /* _AdditionalAssistanceData_H_ */ +#endif /* _AdditionalAssistanceData_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/AdditionalDopplerFields.h b/src/core/libs/supl/asn-rrlp/AdditionalDopplerFields.h index 7b2fe47bd..a949c1d22 100644 --- a/src/core/libs/supl/asn-rrlp/AdditionalDopplerFields.h +++ b/src/core/libs/supl/asn-rrlp/AdditionalDopplerFields.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _AdditionalDopplerFields_H_ -#define _AdditionalDopplerFields_H_ +#ifndef _AdditionalDopplerFields_H_ +#define _AdditionalDopplerFields_H_ #include @@ -15,24 +15,26 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* AdditionalDopplerFields */ -typedef struct AdditionalDopplerFields { - long doppler1; - long dopplerUncertainty; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} AdditionalDopplerFields_t; + /* AdditionalDopplerFields */ + typedef struct AdditionalDopplerFields + { + long doppler1; + long dopplerUncertainty; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_AdditionalDopplerFields; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } AdditionalDopplerFields_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_AdditionalDopplerFields; #ifdef __cplusplus } #endif -#endif /* _AdditionalDopplerFields_H_ */ +#endif /* _AdditionalDopplerFields_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/AlertFlag.h b/src/core/libs/supl/asn-rrlp/AlertFlag.h index 5f74f10c4..1aa1e13f4 100644 --- a/src/core/libs/supl/asn-rrlp/AlertFlag.h +++ b/src/core/libs/supl/asn-rrlp/AlertFlag.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _AlertFlag_H_ -#define _AlertFlag_H_ +#ifndef _AlertFlag_H_ +#define _AlertFlag_H_ #include @@ -14,27 +14,28 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* AlertFlag */ -typedef long AlertFlag_t; + /* AlertFlag */ + typedef long AlertFlag_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_AlertFlag; -asn_struct_free_f AlertFlag_free; -asn_struct_print_f AlertFlag_print; -asn_constr_check_f AlertFlag_constraint; -ber_type_decoder_f AlertFlag_decode_ber; -der_type_encoder_f AlertFlag_encode_der; -xer_type_decoder_f AlertFlag_decode_xer; -xer_type_encoder_f AlertFlag_encode_xer; -per_type_decoder_f AlertFlag_decode_uper; -per_type_encoder_f AlertFlag_encode_uper; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_AlertFlag; + asn_struct_free_f AlertFlag_free; + asn_struct_print_f AlertFlag_print; + asn_constr_check_f AlertFlag_constraint; + ber_type_decoder_f AlertFlag_decode_ber; + der_type_encoder_f AlertFlag_encode_der; + xer_type_decoder_f AlertFlag_decode_xer; + xer_type_encoder_f AlertFlag_encode_xer; + per_type_decoder_f AlertFlag_decode_uper; + per_type_encoder_f AlertFlag_encode_uper; #ifdef __cplusplus } #endif -#endif /* _AlertFlag_H_ */ +#endif /* _AlertFlag_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/Almanac-KeplerianSet.h b/src/core/libs/supl/asn-rrlp/Almanac-KeplerianSet.h index c450e6d8e..8c8c0294c 100644 --- a/src/core/libs/supl/asn-rrlp/Almanac-KeplerianSet.h +++ b/src/core/libs/supl/asn-rrlp/Almanac-KeplerianSet.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _Almanac_KeplerianSet_H_ -#define _Almanac_KeplerianSet_H_ +#ifndef _Almanac_KeplerianSet_H_ +#define _Almanac_KeplerianSet_H_ #include @@ -15,32 +15,34 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Almanac-KeplerianSet */ -typedef struct Almanac_KeplerianSet { - long kepAlmanacE; - long kepAlmanacDeltaI; - long kepAlmanacOmegaDot; - long kepSVHealth; - long kepAlmanacAPowerHalf; - long kepAlmanacOmega0; - long kepAlmanacW; - long kepAlmanacM0; - long kepAlmanacAF0; - long kepAlmanacAF1; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} Almanac_KeplerianSet_t; + /* Almanac-KeplerianSet */ + typedef struct Almanac_KeplerianSet + { + long kepAlmanacE; + long kepAlmanacDeltaI; + long kepAlmanacOmegaDot; + long kepSVHealth; + long kepAlmanacAPowerHalf; + long kepAlmanacOmega0; + long kepAlmanacW; + long kepAlmanacM0; + long kepAlmanacAF0; + long kepAlmanacAF1; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_Almanac_KeplerianSet; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } Almanac_KeplerianSet_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_Almanac_KeplerianSet; #ifdef __cplusplus } #endif -#endif /* _Almanac_KeplerianSet_H_ */ +#endif /* _Almanac_KeplerianSet_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/Almanac.h b/src/core/libs/supl/asn-rrlp/Almanac.h index a5d81542e..835f0c81d 100644 --- a/src/core/libs/supl/asn-rrlp/Almanac.h +++ b/src/core/libs/supl/asn-rrlp/Almanac.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _Almanac_H_ -#define _Almanac_H_ +#ifndef _Almanac_H_ +#define _Almanac_H_ #include @@ -16,24 +16,26 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Almanac */ -typedef struct Almanac { - long alamanacWNa; - SeqOfAlmanacElement_t almanacList; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} Almanac_t; + /* Almanac */ + typedef struct Almanac + { + long alamanacWNa; + SeqOfAlmanacElement_t almanacList; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_Almanac; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } Almanac_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_Almanac; #ifdef __cplusplus } #endif -#endif /* _Almanac_H_ */ +#endif /* _Almanac_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/AlmanacElement.h b/src/core/libs/supl/asn-rrlp/AlmanacElement.h index 5273848e6..aebbe0587 100644 --- a/src/core/libs/supl/asn-rrlp/AlmanacElement.h +++ b/src/core/libs/supl/asn-rrlp/AlmanacElement.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _AlmanacElement_H_ -#define _AlmanacElement_H_ +#ifndef _AlmanacElement_H_ +#define _AlmanacElement_H_ #include @@ -16,34 +16,36 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* AlmanacElement */ -typedef struct AlmanacElement { - SatelliteID_t satelliteID; - long almanacE; - long alamanacToa; - long almanacKsii; - long almanacOmegaDot; - long almanacSVhealth; - long almanacAPowerHalf; - long almanacOmega0; - long almanacW; - long almanacM0; - long almanacAF0; - long almanacAF1; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} AlmanacElement_t; + /* AlmanacElement */ + typedef struct AlmanacElement + { + SatelliteID_t satelliteID; + long almanacE; + long alamanacToa; + long almanacKsii; + long almanacOmegaDot; + long almanacSVhealth; + long almanacAPowerHalf; + long almanacOmega0; + long almanacW; + long almanacM0; + long almanacAF0; + long almanacAF1; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_AlmanacElement; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } AlmanacElement_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_AlmanacElement; #ifdef __cplusplus } #endif -#endif /* _AlmanacElement_H_ */ +#endif /* _AlmanacElement_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/AntiSpoofFlag.h b/src/core/libs/supl/asn-rrlp/AntiSpoofFlag.h index 0a08e4cb3..6c1b9588a 100644 --- a/src/core/libs/supl/asn-rrlp/AntiSpoofFlag.h +++ b/src/core/libs/supl/asn-rrlp/AntiSpoofFlag.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _AntiSpoofFlag_H_ -#define _AntiSpoofFlag_H_ +#ifndef _AntiSpoofFlag_H_ +#define _AntiSpoofFlag_H_ #include @@ -14,27 +14,28 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* AntiSpoofFlag */ -typedef long AntiSpoofFlag_t; + /* AntiSpoofFlag */ + typedef long AntiSpoofFlag_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_AntiSpoofFlag; -asn_struct_free_f AntiSpoofFlag_free; -asn_struct_print_f AntiSpoofFlag_print; -asn_constr_check_f AntiSpoofFlag_constraint; -ber_type_decoder_f AntiSpoofFlag_decode_ber; -der_type_encoder_f AntiSpoofFlag_encode_der; -xer_type_decoder_f AntiSpoofFlag_decode_xer; -xer_type_encoder_f AntiSpoofFlag_encode_xer; -per_type_decoder_f AntiSpoofFlag_decode_uper; -per_type_encoder_f AntiSpoofFlag_encode_uper; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_AntiSpoofFlag; + asn_struct_free_f AntiSpoofFlag_free; + asn_struct_print_f AntiSpoofFlag_print; + asn_constr_check_f AntiSpoofFlag_constraint; + ber_type_decoder_f AntiSpoofFlag_decode_ber; + der_type_encoder_f AntiSpoofFlag_encode_der; + xer_type_decoder_f AntiSpoofFlag_decode_xer; + xer_type_encoder_f AntiSpoofFlag_encode_xer; + per_type_decoder_f AntiSpoofFlag_decode_uper; + per_type_encoder_f AntiSpoofFlag_encode_uper; #ifdef __cplusplus } #endif -#endif /* _AntiSpoofFlag_H_ */ +#endif /* _AntiSpoofFlag_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/AssistBTSData-R98-ExpOTD.h b/src/core/libs/supl/asn-rrlp/AssistBTSData-R98-ExpOTD.h index e39a21090..72f328826 100644 --- a/src/core/libs/supl/asn-rrlp/AssistBTSData-R98-ExpOTD.h +++ b/src/core/libs/supl/asn-rrlp/AssistBTSData-R98-ExpOTD.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _AssistBTSData_R98_ExpOTD_H_ -#define _AssistBTSData_R98_ExpOTD_H_ +#ifndef _AssistBTSData_R98_ExpOTD_H_ +#define _AssistBTSData_R98_ExpOTD_H_ #include @@ -16,24 +16,26 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* AssistBTSData-R98-ExpOTD */ -typedef struct AssistBTSData_R98_ExpOTD { - ExpectedOTD_t expectedOTD; - ExpOTDUncertainty_t expOTDuncertainty; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} AssistBTSData_R98_ExpOTD_t; + /* AssistBTSData-R98-ExpOTD */ + typedef struct AssistBTSData_R98_ExpOTD + { + ExpectedOTD_t expectedOTD; + ExpOTDUncertainty_t expOTDuncertainty; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_AssistBTSData_R98_ExpOTD; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } AssistBTSData_R98_ExpOTD_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_AssistBTSData_R98_ExpOTD; #ifdef __cplusplus } #endif -#endif /* _AssistBTSData_R98_ExpOTD_H_ */ +#endif /* _AssistBTSData_R98_ExpOTD_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/AssistBTSData.h b/src/core/libs/supl/asn-rrlp/AssistBTSData.h index 31372e6ab..61d38bc20 100644 --- a/src/core/libs/supl/asn-rrlp/AssistBTSData.h +++ b/src/core/libs/supl/asn-rrlp/AssistBTSData.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _AssistBTSData_H_ -#define _AssistBTSData_H_ +#ifndef _AssistBTSData_H_ +#define _AssistBTSData_H_ #include @@ -18,26 +18,28 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Forward declarations */ -struct CalcAssistanceBTS; + /* Forward declarations */ + struct CalcAssistanceBTS; -/* AssistBTSData */ -typedef struct AssistBTSData { - BSIC_t bsic; - MultiFrameOffset_t multiFrameOffset; - TimeSlotScheme_t timeSlotScheme; - RoughRTD_t roughRTD; - struct CalcAssistanceBTS *calcAssistanceBTS /* OPTIONAL */; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} AssistBTSData_t; + /* AssistBTSData */ + typedef struct AssistBTSData + { + BSIC_t bsic; + MultiFrameOffset_t multiFrameOffset; + TimeSlotScheme_t timeSlotScheme; + RoughRTD_t roughRTD; + struct CalcAssistanceBTS *calcAssistanceBTS /* OPTIONAL */; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_AssistBTSData; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } AssistBTSData_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_AssistBTSData; #ifdef __cplusplus } @@ -46,5 +48,5 @@ extern asn_TYPE_descriptor_t asn_DEF_AssistBTSData; /* Referred external types */ #include "CalcAssistanceBTS.h" -#endif /* _AssistBTSData_H_ */ +#endif /* _AssistBTSData_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/AssistanceData.h b/src/core/libs/supl/asn-rrlp/AssistanceData.h index 645814709..e0dcab542 100644 --- a/src/core/libs/supl/asn-rrlp/AssistanceData.h +++ b/src/core/libs/supl/asn-rrlp/AssistanceData.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _AssistanceData_H_ -#define _AssistanceData_H_ +#ifndef _AssistanceData_H_ +#define _AssistanceData_H_ #include @@ -16,38 +16,40 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Forward declarations */ -struct ReferenceAssistData; -struct MsrAssistData; -struct SystemInfoAssistData; -struct GPS_AssistData; -struct Rel98_AssistanceData_Extension; -struct Rel5_AssistanceData_Extension; + /* Forward declarations */ + struct ReferenceAssistData; + struct MsrAssistData; + struct SystemInfoAssistData; + struct GPS_AssistData; + struct Rel98_AssistanceData_Extension; + struct Rel5_AssistanceData_Extension; -/* AssistanceData */ -typedef struct AssistanceData { - struct ReferenceAssistData *referenceAssistData /* OPTIONAL */; - struct MsrAssistData *msrAssistData /* OPTIONAL */; - struct SystemInfoAssistData *systemInfoAssistData /* OPTIONAL */; - struct GPS_AssistData *gps_AssistData /* OPTIONAL */; - MoreAssDataToBeSent_t *moreAssDataToBeSent /* OPTIONAL */; - ExtensionContainer_t *extensionContainer /* OPTIONAL */; - /* + /* AssistanceData */ + typedef struct AssistanceData + { + struct ReferenceAssistData *referenceAssistData /* OPTIONAL */; + struct MsrAssistData *msrAssistData /* OPTIONAL */; + struct SystemInfoAssistData *systemInfoAssistData /* OPTIONAL */; + struct GPS_AssistData *gps_AssistData /* OPTIONAL */; + MoreAssDataToBeSent_t *moreAssDataToBeSent /* OPTIONAL */; + ExtensionContainer_t *extensionContainer /* OPTIONAL */; + /* * This type is extensible, * possible extensions are below. */ - struct Rel98_AssistanceData_Extension *rel98_AssistanceData_Extension /* OPTIONAL */; - struct Rel5_AssistanceData_Extension *rel5_AssistanceData_Extension /* OPTIONAL */; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} AssistanceData_t; + struct Rel98_AssistanceData_Extension *rel98_AssistanceData_Extension /* OPTIONAL */; + struct Rel5_AssistanceData_Extension *rel5_AssistanceData_Extension /* OPTIONAL */; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_AssistanceData; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } AssistanceData_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_AssistanceData; #ifdef __cplusplus } @@ -61,5 +63,5 @@ extern asn_TYPE_descriptor_t asn_DEF_AssistanceData; #include "Rel98-AssistanceData-Extension.h" #include "Rel5-AssistanceData-Extension.h" -#endif /* _AssistanceData_H_ */ +#endif /* _AssistanceData_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/BCCHCarrier.h b/src/core/libs/supl/asn-rrlp/BCCHCarrier.h index 5afac5098..cbee290a1 100644 --- a/src/core/libs/supl/asn-rrlp/BCCHCarrier.h +++ b/src/core/libs/supl/asn-rrlp/BCCHCarrier.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _BCCHCarrier_H_ -#define _BCCHCarrier_H_ +#ifndef _BCCHCarrier_H_ +#define _BCCHCarrier_H_ #include @@ -14,27 +14,28 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* BCCHCarrier */ -typedef long BCCHCarrier_t; + /* BCCHCarrier */ + typedef long BCCHCarrier_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_BCCHCarrier; -asn_struct_free_f BCCHCarrier_free; -asn_struct_print_f BCCHCarrier_print; -asn_constr_check_f BCCHCarrier_constraint; -ber_type_decoder_f BCCHCarrier_decode_ber; -der_type_encoder_f BCCHCarrier_encode_der; -xer_type_decoder_f BCCHCarrier_decode_xer; -xer_type_encoder_f BCCHCarrier_encode_xer; -per_type_decoder_f BCCHCarrier_decode_uper; -per_type_encoder_f BCCHCarrier_encode_uper; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_BCCHCarrier; + asn_struct_free_f BCCHCarrier_free; + asn_struct_print_f BCCHCarrier_print; + asn_constr_check_f BCCHCarrier_constraint; + ber_type_decoder_f BCCHCarrier_decode_ber; + der_type_encoder_f BCCHCarrier_encode_der; + xer_type_decoder_f BCCHCarrier_decode_xer; + xer_type_encoder_f BCCHCarrier_encode_xer; + per_type_decoder_f BCCHCarrier_decode_uper; + per_type_encoder_f BCCHCarrier_encode_uper; #ifdef __cplusplus } #endif -#endif /* _BCCHCarrier_H_ */ +#endif /* _BCCHCarrier_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/BIT_STRING.h b/src/core/libs/supl/asn-rrlp/BIT_STRING.h index 732e878bc..0008e0d82 100644 --- a/src/core/libs/supl/asn-rrlp/BIT_STRING.h +++ b/src/core/libs/supl/asn-rrlp/BIT_STRING.h @@ -2,32 +2,34 @@ * Copyright (c) 2003 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ -#ifndef _BIT_STRING_H_ -#define _BIT_STRING_H_ +#ifndef _BIT_STRING_H_ +#define _BIT_STRING_H_ -#include /* Some help from OCTET STRING */ +#include /* Some help from OCTET STRING */ #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -typedef struct BIT_STRING_s { - uint8_t *buf; /* BIT STRING body */ - int size; /* Size of the above buffer */ + typedef struct BIT_STRING_s + { + uint8_t *buf; /* BIT STRING body */ + int size; /* Size of the above buffer */ - int bits_unused;/* Unused trailing bits in the last octet (0..7) */ + int bits_unused; /* Unused trailing bits in the last octet (0..7) */ - asn_struct_ctx_t _asn_ctx; /* Parsing across buffer boundaries */ -} BIT_STRING_t; + asn_struct_ctx_t _asn_ctx; /* Parsing across buffer boundaries */ + } BIT_STRING_t; -extern asn_TYPE_descriptor_t asn_DEF_BIT_STRING; + extern asn_TYPE_descriptor_t asn_DEF_BIT_STRING; -asn_struct_print_f BIT_STRING_print; /* Human-readable output */ -asn_constr_check_f BIT_STRING_constraint; -xer_type_encoder_f BIT_STRING_encode_xer; + asn_struct_print_f BIT_STRING_print; /* Human-readable output */ + asn_constr_check_f BIT_STRING_constraint; + xer_type_encoder_f BIT_STRING_encode_xer; #ifdef __cplusplus } #endif -#endif /* _BIT_STRING_H_ */ +#endif /* _BIT_STRING_H_ */ diff --git a/src/core/libs/supl/asn-rrlp/BOOLEAN.h b/src/core/libs/supl/asn-rrlp/BOOLEAN.h index 217d0f163..b74f2b430 100644 --- a/src/core/libs/supl/asn-rrlp/BOOLEAN.h +++ b/src/core/libs/supl/asn-rrlp/BOOLEAN.h @@ -2,35 +2,36 @@ * Copyright (c) 2003 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ -#ifndef _BOOLEAN_H_ -#define _BOOLEAN_H_ +#ifndef _BOOLEAN_H_ +#define _BOOLEAN_H_ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* + /* * The underlying integer may contain various values, but everything * non-zero is capped to 0xff by the DER encoder. The BER decoder may * yield non-zero values different from 1, beware. */ -typedef int BOOLEAN_t; + typedef int BOOLEAN_t; -extern asn_TYPE_descriptor_t asn_DEF_BOOLEAN; + extern asn_TYPE_descriptor_t asn_DEF_BOOLEAN; -asn_struct_free_f BOOLEAN_free; -asn_struct_print_f BOOLEAN_print; -ber_type_decoder_f BOOLEAN_decode_ber; -der_type_encoder_f BOOLEAN_encode_der; -xer_type_decoder_f BOOLEAN_decode_xer; -xer_type_encoder_f BOOLEAN_encode_xer; -per_type_decoder_f BOOLEAN_decode_uper; -per_type_encoder_f BOOLEAN_encode_uper; + asn_struct_free_f BOOLEAN_free; + asn_struct_print_f BOOLEAN_print; + ber_type_decoder_f BOOLEAN_decode_ber; + der_type_encoder_f BOOLEAN_encode_der; + xer_type_decoder_f BOOLEAN_decode_xer; + xer_type_encoder_f BOOLEAN_encode_xer; + per_type_decoder_f BOOLEAN_decode_uper; + per_type_encoder_f BOOLEAN_encode_uper; #ifdef __cplusplus } #endif -#endif /* _BOOLEAN_H_ */ +#endif /* _BOOLEAN_H_ */ diff --git a/src/core/libs/supl/asn-rrlp/BSIC.h b/src/core/libs/supl/asn-rrlp/BSIC.h index 8ae54f8f0..d98c3a243 100644 --- a/src/core/libs/supl/asn-rrlp/BSIC.h +++ b/src/core/libs/supl/asn-rrlp/BSIC.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _BSIC_H_ -#define _BSIC_H_ +#ifndef _BSIC_H_ +#define _BSIC_H_ #include @@ -14,27 +14,28 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* BSIC */ -typedef long BSIC_t; + /* BSIC */ + typedef long BSIC_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_BSIC; -asn_struct_free_f BSIC_free; -asn_struct_print_f BSIC_print; -asn_constr_check_f BSIC_constraint; -ber_type_decoder_f BSIC_decode_ber; -der_type_encoder_f BSIC_encode_der; -xer_type_decoder_f BSIC_decode_xer; -xer_type_encoder_f BSIC_encode_xer; -per_type_decoder_f BSIC_decode_uper; -per_type_encoder_f BSIC_encode_uper; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_BSIC; + asn_struct_free_f BSIC_free; + asn_struct_print_f BSIC_print; + asn_constr_check_f BSIC_constraint; + ber_type_decoder_f BSIC_decode_ber; + der_type_encoder_f BSIC_encode_der; + xer_type_decoder_f BSIC_decode_xer; + xer_type_encoder_f BSIC_encode_xer; + per_type_decoder_f BSIC_decode_uper; + per_type_encoder_f BSIC_encode_uper; #ifdef __cplusplus } #endif -#endif /* _BSIC_H_ */ +#endif /* _BSIC_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/BSICAndCarrier.h b/src/core/libs/supl/asn-rrlp/BSICAndCarrier.h index dda3b01b2..2af53b890 100644 --- a/src/core/libs/supl/asn-rrlp/BSICAndCarrier.h +++ b/src/core/libs/supl/asn-rrlp/BSICAndCarrier.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _BSICAndCarrier_H_ -#define _BSICAndCarrier_H_ +#ifndef _BSICAndCarrier_H_ +#define _BSICAndCarrier_H_ #include @@ -16,24 +16,26 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* BSICAndCarrier */ -typedef struct BSICAndCarrier { - BCCHCarrier_t carrier; - BSIC_t bsic; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} BSICAndCarrier_t; + /* BSICAndCarrier */ + typedef struct BSICAndCarrier + { + BCCHCarrier_t carrier; + BSIC_t bsic; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_BSICAndCarrier; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } BSICAndCarrier_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_BSICAndCarrier; #ifdef __cplusplus } #endif -#endif /* _BSICAndCarrier_H_ */ +#endif /* _BSICAndCarrier_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/BTSPosition.h b/src/core/libs/supl/asn-rrlp/BTSPosition.h index dd52ebea6..70fde1aad 100644 --- a/src/core/libs/supl/asn-rrlp/BTSPosition.h +++ b/src/core/libs/supl/asn-rrlp/BTSPosition.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _BTSPosition_H_ -#define _BTSPosition_H_ +#ifndef _BTSPosition_H_ +#define _BTSPosition_H_ #include @@ -14,27 +14,28 @@ #include "Ext-GeographicalInformation.h" #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* BTSPosition */ -typedef Ext_GeographicalInformation_t BTSPosition_t; + /* BTSPosition */ + typedef Ext_GeographicalInformation_t BTSPosition_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_BTSPosition; -asn_struct_free_f BTSPosition_free; -asn_struct_print_f BTSPosition_print; -asn_constr_check_f BTSPosition_constraint; -ber_type_decoder_f BTSPosition_decode_ber; -der_type_encoder_f BTSPosition_encode_der; -xer_type_decoder_f BTSPosition_decode_xer; -xer_type_encoder_f BTSPosition_encode_xer; -per_type_decoder_f BTSPosition_decode_uper; -per_type_encoder_f BTSPosition_encode_uper; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_BTSPosition; + asn_struct_free_f BTSPosition_free; + asn_struct_print_f BTSPosition_print; + asn_constr_check_f BTSPosition_constraint; + ber_type_decoder_f BTSPosition_decode_ber; + der_type_encoder_f BTSPosition_encode_der; + xer_type_decoder_f BTSPosition_decode_xer; + xer_type_encoder_f BTSPosition_encode_xer; + per_type_decoder_f BTSPosition_decode_uper; + per_type_encoder_f BTSPosition_encode_uper; #ifdef __cplusplus } #endif -#endif /* _BTSPosition_H_ */ +#endif /* _BTSPosition_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/BadSignalElement.h b/src/core/libs/supl/asn-rrlp/BadSignalElement.h index 1b758e069..e13f5fc73 100644 --- a/src/core/libs/supl/asn-rrlp/BadSignalElement.h +++ b/src/core/libs/supl/asn-rrlp/BadSignalElement.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _BadSignalElement_H_ -#define _BadSignalElement_H_ +#ifndef _BadSignalElement_H_ +#define _BadSignalElement_H_ #include @@ -16,24 +16,26 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* BadSignalElement */ -typedef struct BadSignalElement { - SVID_t badSVID; - long *badSignalID /* OPTIONAL */; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} BadSignalElement_t; + /* BadSignalElement */ + typedef struct BadSignalElement + { + SVID_t badSVID; + long *badSignalID /* OPTIONAL */; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_BadSignalElement; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } BadSignalElement_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_BadSignalElement; #ifdef __cplusplus } #endif -#endif /* _BadSignalElement_H_ */ +#endif /* _BadSignalElement_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/BitNumber.h b/src/core/libs/supl/asn-rrlp/BitNumber.h index 1584ca01e..7cad41929 100644 --- a/src/core/libs/supl/asn-rrlp/BitNumber.h +++ b/src/core/libs/supl/asn-rrlp/BitNumber.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _BitNumber_H_ -#define _BitNumber_H_ +#ifndef _BitNumber_H_ +#define _BitNumber_H_ #include @@ -14,27 +14,28 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* BitNumber */ -typedef long BitNumber_t; + /* BitNumber */ + typedef long BitNumber_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_BitNumber; -asn_struct_free_f BitNumber_free; -asn_struct_print_f BitNumber_print; -asn_constr_check_f BitNumber_constraint; -ber_type_decoder_f BitNumber_decode_ber; -der_type_encoder_f BitNumber_encode_der; -xer_type_decoder_f BitNumber_decode_xer; -xer_type_encoder_f BitNumber_encode_xer; -per_type_decoder_f BitNumber_decode_uper; -per_type_encoder_f BitNumber_encode_uper; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_BitNumber; + asn_struct_free_f BitNumber_free; + asn_struct_print_f BitNumber_print; + asn_constr_check_f BitNumber_constraint; + ber_type_decoder_f BitNumber_decode_ber; + der_type_encoder_f BitNumber_encode_der; + xer_type_decoder_f BitNumber_decode_xer; + xer_type_encoder_f BitNumber_encode_xer; + per_type_decoder_f BitNumber_decode_uper; + per_type_encoder_f BitNumber_encode_uper; #ifdef __cplusplus } #endif -#endif /* _BitNumber_H_ */ +#endif /* _BitNumber_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/CalcAssistanceBTS.h b/src/core/libs/supl/asn-rrlp/CalcAssistanceBTS.h index 6c046b8c6..912b6c2c5 100644 --- a/src/core/libs/supl/asn-rrlp/CalcAssistanceBTS.h +++ b/src/core/libs/supl/asn-rrlp/CalcAssistanceBTS.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _CalcAssistanceBTS_H_ -#define _CalcAssistanceBTS_H_ +#ifndef _CalcAssistanceBTS_H_ +#define _CalcAssistanceBTS_H_ #include @@ -16,24 +16,26 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* CalcAssistanceBTS */ -typedef struct CalcAssistanceBTS { - FineRTD_t fineRTD; - ReferenceWGS84_t referenceWGS84; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} CalcAssistanceBTS_t; + /* CalcAssistanceBTS */ + typedef struct CalcAssistanceBTS + { + FineRTD_t fineRTD; + ReferenceWGS84_t referenceWGS84; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_CalcAssistanceBTS; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } CalcAssistanceBTS_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_CalcAssistanceBTS; #ifdef __cplusplus } #endif -#endif /* _CalcAssistanceBTS_H_ */ +#endif /* _CalcAssistanceBTS_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/CellID.h b/src/core/libs/supl/asn-rrlp/CellID.h index e71a1e30a..0e83f9b49 100644 --- a/src/core/libs/supl/asn-rrlp/CellID.h +++ b/src/core/libs/supl/asn-rrlp/CellID.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _CellID_H_ -#define _CellID_H_ +#ifndef _CellID_H_ +#define _CellID_H_ #include @@ -14,27 +14,28 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* CellID */ -typedef long CellID_t; + /* CellID */ + typedef long CellID_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_CellID; -asn_struct_free_f CellID_free; -asn_struct_print_f CellID_print; -asn_constr_check_f CellID_constraint; -ber_type_decoder_f CellID_decode_ber; -der_type_encoder_f CellID_encode_der; -xer_type_decoder_f CellID_decode_xer; -xer_type_encoder_f CellID_encode_xer; -per_type_decoder_f CellID_decode_uper; -per_type_encoder_f CellID_encode_uper; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_CellID; + asn_struct_free_f CellID_free; + asn_struct_print_f CellID_print; + asn_constr_check_f CellID_constraint; + ber_type_decoder_f CellID_decode_ber; + der_type_encoder_f CellID_encode_der; + xer_type_decoder_f CellID_decode_xer; + xer_type_encoder_f CellID_encode_xer; + per_type_decoder_f CellID_decode_uper; + per_type_encoder_f CellID_encode_uper; #ifdef __cplusplus } #endif -#endif /* _CellID_H_ */ +#endif /* _CellID_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/CellIDAndLAC.h b/src/core/libs/supl/asn-rrlp/CellIDAndLAC.h index e2811df15..6b74bb15a 100644 --- a/src/core/libs/supl/asn-rrlp/CellIDAndLAC.h +++ b/src/core/libs/supl/asn-rrlp/CellIDAndLAC.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _CellIDAndLAC_H_ -#define _CellIDAndLAC_H_ +#ifndef _CellIDAndLAC_H_ +#define _CellIDAndLAC_H_ #include @@ -16,24 +16,26 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* CellIDAndLAC */ -typedef struct CellIDAndLAC { - LAC_t referenceLAC; - CellID_t referenceCI; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} CellIDAndLAC_t; + /* CellIDAndLAC */ + typedef struct CellIDAndLAC + { + LAC_t referenceLAC; + CellID_t referenceCI; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_CellIDAndLAC; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } CellIDAndLAC_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_CellIDAndLAC; #ifdef __cplusplus } #endif -#endif /* _CellIDAndLAC_H_ */ +#endif /* _CellIDAndLAC_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/ControlHeader.h b/src/core/libs/supl/asn-rrlp/ControlHeader.h index 3471f8a77..c2be329ca 100644 --- a/src/core/libs/supl/asn-rrlp/ControlHeader.h +++ b/src/core/libs/supl/asn-rrlp/ControlHeader.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _ControlHeader_H_ -#define _ControlHeader_H_ +#ifndef _ControlHeader_H_ +#define _ControlHeader_H_ #include @@ -14,38 +14,40 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Forward declarations */ -struct ReferenceTime; -struct RefLocation; -struct DGPSCorrections; -struct NavigationModel; -struct IonosphericModel; -struct UTCModel; -struct Almanac; -struct AcquisAssist; -struct SeqOf_BadSatelliteSet; + /* Forward declarations */ + struct ReferenceTime; + struct RefLocation; + struct DGPSCorrections; + struct NavigationModel; + struct IonosphericModel; + struct UTCModel; + struct Almanac; + struct AcquisAssist; + struct SeqOf_BadSatelliteSet; -/* ControlHeader */ -typedef struct ControlHeader { - struct ReferenceTime *referenceTime /* OPTIONAL */; - struct RefLocation *refLocation /* OPTIONAL */; - struct DGPSCorrections *dgpsCorrections /* OPTIONAL */; - struct NavigationModel *navigationModel /* OPTIONAL */; - struct IonosphericModel *ionosphericModel /* OPTIONAL */; - struct UTCModel *utcModel /* OPTIONAL */; - struct Almanac *almanac /* OPTIONAL */; - struct AcquisAssist *acquisAssist /* OPTIONAL */; - struct SeqOf_BadSatelliteSet *realTimeIntegrity /* OPTIONAL */; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} ControlHeader_t; + /* ControlHeader */ + typedef struct ControlHeader + { + struct ReferenceTime *referenceTime /* OPTIONAL */; + struct RefLocation *refLocation /* OPTIONAL */; + struct DGPSCorrections *dgpsCorrections /* OPTIONAL */; + struct NavigationModel *navigationModel /* OPTIONAL */; + struct IonosphericModel *ionosphericModel /* OPTIONAL */; + struct UTCModel *utcModel /* OPTIONAL */; + struct Almanac *almanac /* OPTIONAL */; + struct AcquisAssist *acquisAssist /* OPTIONAL */; + struct SeqOf_BadSatelliteSet *realTimeIntegrity /* OPTIONAL */; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_ControlHeader; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } ControlHeader_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_ControlHeader; #ifdef __cplusplus } @@ -62,5 +64,5 @@ extern asn_TYPE_descriptor_t asn_DEF_ControlHeader; #include "AcquisAssist.h" #include "SeqOf-BadSatelliteSet.h" -#endif /* _ControlHeader_H_ */ +#endif /* _ControlHeader_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/DGANSSSgnElement.h b/src/core/libs/supl/asn-rrlp/DGANSSSgnElement.h index 0ba005e0b..6cb7be67c 100644 --- a/src/core/libs/supl/asn-rrlp/DGANSSSgnElement.h +++ b/src/core/libs/supl/asn-rrlp/DGANSSSgnElement.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _DGANSSSgnElement_H_ -#define _DGANSSSgnElement_H_ +#ifndef _DGANSSSgnElement_H_ +#define _DGANSSSgnElement_H_ #include @@ -16,27 +16,29 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* DGANSSSgnElement */ -typedef struct DGANSSSgnElement { - SVID_t svID; - long iod; - long udre; - long pseudoRangeCor; - long rangeRateCor; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} DGANSSSgnElement_t; + /* DGANSSSgnElement */ + typedef struct DGANSSSgnElement + { + SVID_t svID; + long iod; + long udre; + long pseudoRangeCor; + long rangeRateCor; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_DGANSSSgnElement; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } DGANSSSgnElement_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_DGANSSSgnElement; #ifdef __cplusplus } #endif -#endif /* _DGANSSSgnElement_H_ */ +#endif /* _DGANSSSgnElement_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/DGPSCorrections.h b/src/core/libs/supl/asn-rrlp/DGPSCorrections.h index 24f0b5076..52913f488 100644 --- a/src/core/libs/supl/asn-rrlp/DGPSCorrections.h +++ b/src/core/libs/supl/asn-rrlp/DGPSCorrections.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _DGPSCorrections_H_ -#define _DGPSCorrections_H_ +#ifndef _DGPSCorrections_H_ +#define _DGPSCorrections_H_ #include @@ -16,25 +16,27 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* DGPSCorrections */ -typedef struct DGPSCorrections { - long gpsTOW; - long status; - SeqOfSatElement_t satList; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} DGPSCorrections_t; + /* DGPSCorrections */ + typedef struct DGPSCorrections + { + long gpsTOW; + long status; + SeqOfSatElement_t satList; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_DGPSCorrections; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } DGPSCorrections_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_DGPSCorrections; #ifdef __cplusplus } #endif -#endif /* _DGPSCorrections_H_ */ +#endif /* _DGPSCorrections_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/ENUMERATED.h b/src/core/libs/supl/asn-rrlp/ENUMERATED.h index 542dcae94..86c1cf643 100644 --- a/src/core/libs/supl/asn-rrlp/ENUMERATED.h +++ b/src/core/libs/supl/asn-rrlp/ENUMERATED.h @@ -2,24 +2,25 @@ * Copyright (c) 2003, 2005 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ -#ifndef _ENUMERATED_H_ -#define _ENUMERATED_H_ +#ifndef _ENUMERATED_H_ +#define _ENUMERATED_H_ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -typedef INTEGER_t ENUMERATED_t; /* Implemented via INTEGER */ + typedef INTEGER_t ENUMERATED_t; /* Implemented via INTEGER */ -extern asn_TYPE_descriptor_t asn_DEF_ENUMERATED; + extern asn_TYPE_descriptor_t asn_DEF_ENUMERATED; -per_type_decoder_f ENUMERATED_decode_uper; -per_type_encoder_f ENUMERATED_encode_uper; + per_type_decoder_f ENUMERATED_decode_uper; + per_type_encoder_f ENUMERATED_encode_uper; #ifdef __cplusplus } #endif -#endif /* _ENUMERATED_H_ */ +#endif /* _ENUMERATED_H_ */ diff --git a/src/core/libs/supl/asn-rrlp/EOTDQuality.h b/src/core/libs/supl/asn-rrlp/EOTDQuality.h index a249955f0..522cf0a6e 100644 --- a/src/core/libs/supl/asn-rrlp/EOTDQuality.h +++ b/src/core/libs/supl/asn-rrlp/EOTDQuality.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _EOTDQuality_H_ -#define _EOTDQuality_H_ +#ifndef _EOTDQuality_H_ +#define _EOTDQuality_H_ #include @@ -15,24 +15,26 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* EOTDQuality */ -typedef struct EOTDQuality { - long nbrOfMeasurements; - long stdOfEOTD; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} EOTDQuality_t; + /* EOTDQuality */ + typedef struct EOTDQuality + { + long nbrOfMeasurements; + long stdOfEOTD; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_EOTDQuality; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } EOTDQuality_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_EOTDQuality; #ifdef __cplusplus } #endif -#endif /* _EOTDQuality_H_ */ +#endif /* _EOTDQuality_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/EnvironmentCharacter.h b/src/core/libs/supl/asn-rrlp/EnvironmentCharacter.h index 5a37be9c9..12a7c0ccd 100644 --- a/src/core/libs/supl/asn-rrlp/EnvironmentCharacter.h +++ b/src/core/libs/supl/asn-rrlp/EnvironmentCharacter.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _EnvironmentCharacter_H_ -#define _EnvironmentCharacter_H_ +#ifndef _EnvironmentCharacter_H_ +#define _EnvironmentCharacter_H_ #include @@ -14,37 +14,39 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Dependencies */ -typedef enum EnvironmentCharacter { - EnvironmentCharacter_badArea = 0, - EnvironmentCharacter_notBadArea = 1, - EnvironmentCharacter_mixedArea = 2 - /* + /* Dependencies */ + typedef enum EnvironmentCharacter + { + EnvironmentCharacter_badArea = 0, + EnvironmentCharacter_notBadArea = 1, + EnvironmentCharacter_mixedArea = 2 + /* * Enumeration is extensible */ -} e_EnvironmentCharacter; + } e_EnvironmentCharacter; -/* EnvironmentCharacter */ -typedef ENUMERATED_t EnvironmentCharacter_t; + /* EnvironmentCharacter */ + typedef ENUMERATED_t EnvironmentCharacter_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_EnvironmentCharacter; -asn_struct_free_f EnvironmentCharacter_free; -asn_struct_print_f EnvironmentCharacter_print; -asn_constr_check_f EnvironmentCharacter_constraint; -ber_type_decoder_f EnvironmentCharacter_decode_ber; -der_type_encoder_f EnvironmentCharacter_encode_der; -xer_type_decoder_f EnvironmentCharacter_decode_xer; -xer_type_encoder_f EnvironmentCharacter_encode_xer; -per_type_decoder_f EnvironmentCharacter_decode_uper; -per_type_encoder_f EnvironmentCharacter_encode_uper; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_EnvironmentCharacter; + asn_struct_free_f EnvironmentCharacter_free; + asn_struct_print_f EnvironmentCharacter_print; + asn_constr_check_f EnvironmentCharacter_constraint; + ber_type_decoder_f EnvironmentCharacter_decode_ber; + der_type_encoder_f EnvironmentCharacter_encode_der; + xer_type_decoder_f EnvironmentCharacter_decode_xer; + xer_type_encoder_f EnvironmentCharacter_encode_xer; + per_type_decoder_f EnvironmentCharacter_decode_uper; + per_type_encoder_f EnvironmentCharacter_encode_uper; #ifdef __cplusplus } #endif -#endif /* _EnvironmentCharacter_H_ */ +#endif /* _EnvironmentCharacter_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/EphemerisSubframe1Reserved.h b/src/core/libs/supl/asn-rrlp/EphemerisSubframe1Reserved.h index 156c7f0f8..f62b57afa 100644 --- a/src/core/libs/supl/asn-rrlp/EphemerisSubframe1Reserved.h +++ b/src/core/libs/supl/asn-rrlp/EphemerisSubframe1Reserved.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _EphemerisSubframe1Reserved_H_ -#define _EphemerisSubframe1Reserved_H_ +#ifndef _EphemerisSubframe1Reserved_H_ +#define _EphemerisSubframe1Reserved_H_ #include @@ -15,26 +15,28 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* EphemerisSubframe1Reserved */ -typedef struct EphemerisSubframe1Reserved { - long reserved1; - long reserved2; - long reserved3; - long reserved4; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} EphemerisSubframe1Reserved_t; + /* EphemerisSubframe1Reserved */ + typedef struct EphemerisSubframe1Reserved + { + long reserved1; + long reserved2; + long reserved3; + long reserved4; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_EphemerisSubframe1Reserved; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } EphemerisSubframe1Reserved_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_EphemerisSubframe1Reserved; #ifdef __cplusplus } #endif -#endif /* _EphemerisSubframe1Reserved_H_ */ +#endif /* _EphemerisSubframe1Reserved_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/ErrorCodes.h b/src/core/libs/supl/asn-rrlp/ErrorCodes.h index c2e1f6b4a..c87de55d5 100644 --- a/src/core/libs/supl/asn-rrlp/ErrorCodes.h +++ b/src/core/libs/supl/asn-rrlp/ErrorCodes.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _ErrorCodes_H_ -#define _ErrorCodes_H_ +#ifndef _ErrorCodes_H_ +#define _ErrorCodes_H_ #include @@ -14,40 +14,42 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Dependencies */ -typedef enum ErrorCodes { - ErrorCodes_unDefined = 0, - ErrorCodes_missingComponet = 1, - ErrorCodes_incorrectData = 2, - ErrorCodes_missingIEorComponentElement = 3, - ErrorCodes_messageTooShort = 4, - ErrorCodes_unknowReferenceNumber = 5 - /* + /* Dependencies */ + typedef enum ErrorCodes + { + ErrorCodes_unDefined = 0, + ErrorCodes_missingComponet = 1, + ErrorCodes_incorrectData = 2, + ErrorCodes_missingIEorComponentElement = 3, + ErrorCodes_messageTooShort = 4, + ErrorCodes_unknowReferenceNumber = 5 + /* * Enumeration is extensible */ -} e_ErrorCodes; + } e_ErrorCodes; -/* ErrorCodes */ -typedef ENUMERATED_t ErrorCodes_t; + /* ErrorCodes */ + typedef ENUMERATED_t ErrorCodes_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_ErrorCodes; -asn_struct_free_f ErrorCodes_free; -asn_struct_print_f ErrorCodes_print; -asn_constr_check_f ErrorCodes_constraint; -ber_type_decoder_f ErrorCodes_decode_ber; -der_type_encoder_f ErrorCodes_encode_der; -xer_type_decoder_f ErrorCodes_decode_xer; -xer_type_encoder_f ErrorCodes_encode_xer; -per_type_decoder_f ErrorCodes_decode_uper; -per_type_encoder_f ErrorCodes_encode_uper; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_ErrorCodes; + asn_struct_free_f ErrorCodes_free; + asn_struct_print_f ErrorCodes_print; + asn_constr_check_f ErrorCodes_constraint; + ber_type_decoder_f ErrorCodes_decode_ber; + der_type_encoder_f ErrorCodes_encode_der; + xer_type_decoder_f ErrorCodes_decode_xer; + xer_type_encoder_f ErrorCodes_encode_xer; + per_type_decoder_f ErrorCodes_decode_uper; + per_type_encoder_f ErrorCodes_encode_uper; #ifdef __cplusplus } #endif -#endif /* _ErrorCodes_H_ */ +#endif /* _ErrorCodes_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/ExpOTDUncertainty.h b/src/core/libs/supl/asn-rrlp/ExpOTDUncertainty.h index c35d42cc0..44ea118db 100644 --- a/src/core/libs/supl/asn-rrlp/ExpOTDUncertainty.h +++ b/src/core/libs/supl/asn-rrlp/ExpOTDUncertainty.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _ExpOTDUncertainty_H_ -#define _ExpOTDUncertainty_H_ +#ifndef _ExpOTDUncertainty_H_ +#define _ExpOTDUncertainty_H_ #include @@ -14,27 +14,28 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* ExpOTDUncertainty */ -typedef long ExpOTDUncertainty_t; + /* ExpOTDUncertainty */ + typedef long ExpOTDUncertainty_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_ExpOTDUncertainty; -asn_struct_free_f ExpOTDUncertainty_free; -asn_struct_print_f ExpOTDUncertainty_print; -asn_constr_check_f ExpOTDUncertainty_constraint; -ber_type_decoder_f ExpOTDUncertainty_decode_ber; -der_type_encoder_f ExpOTDUncertainty_encode_der; -xer_type_decoder_f ExpOTDUncertainty_decode_xer; -xer_type_encoder_f ExpOTDUncertainty_encode_xer; -per_type_decoder_f ExpOTDUncertainty_decode_uper; -per_type_encoder_f ExpOTDUncertainty_encode_uper; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_ExpOTDUncertainty; + asn_struct_free_f ExpOTDUncertainty_free; + asn_struct_print_f ExpOTDUncertainty_print; + asn_constr_check_f ExpOTDUncertainty_constraint; + ber_type_decoder_f ExpOTDUncertainty_decode_ber; + der_type_encoder_f ExpOTDUncertainty_encode_der; + xer_type_decoder_f ExpOTDUncertainty_decode_xer; + xer_type_encoder_f ExpOTDUncertainty_encode_xer; + per_type_decoder_f ExpOTDUncertainty_decode_uper; + per_type_encoder_f ExpOTDUncertainty_encode_uper; #ifdef __cplusplus } #endif -#endif /* _ExpOTDUncertainty_H_ */ +#endif /* _ExpOTDUncertainty_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/ExpectedOTD.h b/src/core/libs/supl/asn-rrlp/ExpectedOTD.h index 6f2a869e3..bb25b6eac 100644 --- a/src/core/libs/supl/asn-rrlp/ExpectedOTD.h +++ b/src/core/libs/supl/asn-rrlp/ExpectedOTD.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _ExpectedOTD_H_ -#define _ExpectedOTD_H_ +#ifndef _ExpectedOTD_H_ +#define _ExpectedOTD_H_ #include @@ -14,27 +14,28 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* ExpectedOTD */ -typedef long ExpectedOTD_t; + /* ExpectedOTD */ + typedef long ExpectedOTD_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_ExpectedOTD; -asn_struct_free_f ExpectedOTD_free; -asn_struct_print_f ExpectedOTD_print; -asn_constr_check_f ExpectedOTD_constraint; -ber_type_decoder_f ExpectedOTD_decode_ber; -der_type_encoder_f ExpectedOTD_encode_der; -xer_type_decoder_f ExpectedOTD_decode_xer; -xer_type_encoder_f ExpectedOTD_encode_xer; -per_type_decoder_f ExpectedOTD_decode_uper; -per_type_encoder_f ExpectedOTD_encode_uper; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_ExpectedOTD; + asn_struct_free_f ExpectedOTD_free; + asn_struct_print_f ExpectedOTD_print; + asn_constr_check_f ExpectedOTD_constraint; + ber_type_decoder_f ExpectedOTD_decode_ber; + der_type_encoder_f ExpectedOTD_encode_der; + xer_type_decoder_f ExpectedOTD_decode_xer; + xer_type_encoder_f ExpectedOTD_encode_xer; + per_type_decoder_f ExpectedOTD_decode_uper; + per_type_encoder_f ExpectedOTD_encode_uper; #ifdef __cplusplus } #endif -#endif /* _ExpectedOTD_H_ */ +#endif /* _ExpectedOTD_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/Ext-GeographicalInformation.h b/src/core/libs/supl/asn-rrlp/Ext-GeographicalInformation.h index 47165fd83..cc9330d3a 100644 --- a/src/core/libs/supl/asn-rrlp/Ext-GeographicalInformation.h +++ b/src/core/libs/supl/asn-rrlp/Ext-GeographicalInformation.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _Ext_GeographicalInformation_H_ -#define _Ext_GeographicalInformation_H_ +#ifndef _Ext_GeographicalInformation_H_ +#define _Ext_GeographicalInformation_H_ #include @@ -14,27 +14,28 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Ext-GeographicalInformation */ -typedef OCTET_STRING_t Ext_GeographicalInformation_t; + /* Ext-GeographicalInformation */ + typedef OCTET_STRING_t Ext_GeographicalInformation_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_Ext_GeographicalInformation; -asn_struct_free_f Ext_GeographicalInformation_free; -asn_struct_print_f Ext_GeographicalInformation_print; -asn_constr_check_f Ext_GeographicalInformation_constraint; -ber_type_decoder_f Ext_GeographicalInformation_decode_ber; -der_type_encoder_f Ext_GeographicalInformation_encode_der; -xer_type_decoder_f Ext_GeographicalInformation_decode_xer; -xer_type_encoder_f Ext_GeographicalInformation_encode_xer; -per_type_decoder_f Ext_GeographicalInformation_decode_uper; -per_type_encoder_f Ext_GeographicalInformation_encode_uper; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_Ext_GeographicalInformation; + asn_struct_free_f Ext_GeographicalInformation_free; + asn_struct_print_f Ext_GeographicalInformation_print; + asn_constr_check_f Ext_GeographicalInformation_constraint; + ber_type_decoder_f Ext_GeographicalInformation_decode_ber; + der_type_encoder_f Ext_GeographicalInformation_encode_der; + xer_type_decoder_f Ext_GeographicalInformation_decode_xer; + xer_type_encoder_f Ext_GeographicalInformation_encode_xer; + per_type_decoder_f Ext_GeographicalInformation_decode_uper; + per_type_encoder_f Ext_GeographicalInformation_encode_uper; #ifdef __cplusplus } #endif -#endif /* _Ext_GeographicalInformation_H_ */ +#endif /* _Ext_GeographicalInformation_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/Extended-reference.h b/src/core/libs/supl/asn-rrlp/Extended-reference.h index f4ea28d2c..c21d79d93 100644 --- a/src/core/libs/supl/asn-rrlp/Extended-reference.h +++ b/src/core/libs/supl/asn-rrlp/Extended-reference.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _Extended_reference_H_ -#define _Extended_reference_H_ +#ifndef _Extended_reference_H_ +#define _Extended_reference_H_ #include @@ -15,24 +15,26 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Extended-reference */ -typedef struct Extended_reference { - long smlc_code; - long transaction_ID; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} Extended_reference_t; + /* Extended-reference */ + typedef struct Extended_reference + { + long smlc_code; + long transaction_ID; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_Extended_reference; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } Extended_reference_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_Extended_reference; #ifdef __cplusplus } #endif -#endif /* _Extended_reference_H_ */ +#endif /* _Extended_reference_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/ExtensionContainer.h b/src/core/libs/supl/asn-rrlp/ExtensionContainer.h index a88437df8..f464ba754 100644 --- a/src/core/libs/supl/asn-rrlp/ExtensionContainer.h +++ b/src/core/libs/supl/asn-rrlp/ExtensionContainer.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _ExtensionContainer_H_ -#define _ExtensionContainer_H_ +#ifndef _ExtensionContainer_H_ +#define _ExtensionContainer_H_ #include @@ -14,27 +14,28 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* ExtensionContainer */ -typedef INTEGER_t ExtensionContainer_t; + /* ExtensionContainer */ + typedef INTEGER_t ExtensionContainer_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_ExtensionContainer; -asn_struct_free_f ExtensionContainer_free; -asn_struct_print_f ExtensionContainer_print; -asn_constr_check_f ExtensionContainer_constraint; -ber_type_decoder_f ExtensionContainer_decode_ber; -der_type_encoder_f ExtensionContainer_encode_der; -xer_type_decoder_f ExtensionContainer_decode_xer; -xer_type_encoder_f ExtensionContainer_encode_xer; -per_type_decoder_f ExtensionContainer_decode_uper; -per_type_encoder_f ExtensionContainer_encode_uper; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_ExtensionContainer; + asn_struct_free_f ExtensionContainer_free; + asn_struct_print_f ExtensionContainer_print; + asn_constr_check_f ExtensionContainer_constraint; + ber_type_decoder_f ExtensionContainer_decode_ber; + der_type_encoder_f ExtensionContainer_encode_der; + xer_type_decoder_f ExtensionContainer_decode_xer; + xer_type_encoder_f ExtensionContainer_encode_xer; + per_type_decoder_f ExtensionContainer_decode_uper; + per_type_encoder_f ExtensionContainer_encode_uper; #ifdef __cplusplus } #endif -#endif /* _ExtensionContainer_H_ */ +#endif /* _ExtensionContainer_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/FineRTD.h b/src/core/libs/supl/asn-rrlp/FineRTD.h index 7738c6b57..6e0ea3f0f 100644 --- a/src/core/libs/supl/asn-rrlp/FineRTD.h +++ b/src/core/libs/supl/asn-rrlp/FineRTD.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _FineRTD_H_ -#define _FineRTD_H_ +#ifndef _FineRTD_H_ +#define _FineRTD_H_ #include @@ -14,27 +14,28 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* FineRTD */ -typedef long FineRTD_t; + /* FineRTD */ + typedef long FineRTD_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_FineRTD; -asn_struct_free_f FineRTD_free; -asn_struct_print_f FineRTD_print; -asn_constr_check_f FineRTD_constraint; -ber_type_decoder_f FineRTD_decode_ber; -der_type_encoder_f FineRTD_encode_der; -xer_type_decoder_f FineRTD_decode_xer; -xer_type_encoder_f FineRTD_encode_xer; -per_type_decoder_f FineRTD_decode_uper; -per_type_encoder_f FineRTD_encode_uper; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_FineRTD; + asn_struct_free_f FineRTD_free; + asn_struct_print_f FineRTD_print; + asn_constr_check_f FineRTD_constraint; + ber_type_decoder_f FineRTD_decode_ber; + der_type_encoder_f FineRTD_encode_der; + xer_type_decoder_f FineRTD_decode_xer; + xer_type_encoder_f FineRTD_encode_xer; + per_type_decoder_f FineRTD_decode_uper; + per_type_encoder_f FineRTD_encode_uper; #ifdef __cplusplus } #endif -#endif /* _FineRTD_H_ */ +#endif /* _FineRTD_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/FixType.h b/src/core/libs/supl/asn-rrlp/FixType.h index 498fda8bf..37773ea9d 100644 --- a/src/core/libs/supl/asn-rrlp/FixType.h +++ b/src/core/libs/supl/asn-rrlp/FixType.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _FixType_H_ -#define _FixType_H_ +#ifndef _FixType_H_ +#define _FixType_H_ #include @@ -14,33 +14,35 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Dependencies */ -typedef enum FixType { - FixType_twoDFix = 0, - FixType_threeDFix = 1 -} e_FixType; + /* Dependencies */ + typedef enum FixType + { + FixType_twoDFix = 0, + FixType_threeDFix = 1 + } e_FixType; -/* FixType */ -typedef long FixType_t; + /* FixType */ + typedef long FixType_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_FixType; -asn_struct_free_f FixType_free; -asn_struct_print_f FixType_print; -asn_constr_check_f FixType_constraint; -ber_type_decoder_f FixType_decode_ber; -der_type_encoder_f FixType_encode_der; -xer_type_decoder_f FixType_decode_xer; -xer_type_encoder_f FixType_encode_xer; -per_type_decoder_f FixType_decode_uper; -per_type_encoder_f FixType_encode_uper; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_FixType; + asn_struct_free_f FixType_free; + asn_struct_print_f FixType_print; + asn_constr_check_f FixType_constraint; + ber_type_decoder_f FixType_decode_ber; + der_type_encoder_f FixType_encode_der; + xer_type_decoder_f FixType_decode_xer; + xer_type_encoder_f FixType_encode_xer; + per_type_decoder_f FixType_decode_uper; + per_type_encoder_f FixType_encode_uper; #ifdef __cplusplus } #endif -#endif /* _FixType_H_ */ +#endif /* _FixType_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/FrameDrift.h b/src/core/libs/supl/asn-rrlp/FrameDrift.h index 48c5f17ea..7769e4369 100644 --- a/src/core/libs/supl/asn-rrlp/FrameDrift.h +++ b/src/core/libs/supl/asn-rrlp/FrameDrift.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _FrameDrift_H_ -#define _FrameDrift_H_ +#ifndef _FrameDrift_H_ +#define _FrameDrift_H_ #include @@ -14,27 +14,28 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* FrameDrift */ -typedef long FrameDrift_t; + /* FrameDrift */ + typedef long FrameDrift_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_FrameDrift; -asn_struct_free_f FrameDrift_free; -asn_struct_print_f FrameDrift_print; -asn_constr_check_f FrameDrift_constraint; -ber_type_decoder_f FrameDrift_decode_ber; -der_type_encoder_f FrameDrift_encode_der; -xer_type_decoder_f FrameDrift_decode_xer; -xer_type_encoder_f FrameDrift_encode_xer; -per_type_decoder_f FrameDrift_decode_uper; -per_type_encoder_f FrameDrift_encode_uper; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_FrameDrift; + asn_struct_free_f FrameDrift_free; + asn_struct_print_f FrameDrift_print; + asn_constr_check_f FrameDrift_constraint; + ber_type_decoder_f FrameDrift_decode_ber; + der_type_encoder_f FrameDrift_encode_der; + xer_type_decoder_f FrameDrift_decode_xer; + xer_type_encoder_f FrameDrift_encode_xer; + per_type_decoder_f FrameDrift_decode_uper; + per_type_encoder_f FrameDrift_encode_uper; #ifdef __cplusplus } #endif -#endif /* _FrameDrift_H_ */ +#endif /* _FrameDrift_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/FrameNumber.h b/src/core/libs/supl/asn-rrlp/FrameNumber.h index 152b2d4d7..2cea180ba 100644 --- a/src/core/libs/supl/asn-rrlp/FrameNumber.h +++ b/src/core/libs/supl/asn-rrlp/FrameNumber.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _FrameNumber_H_ -#define _FrameNumber_H_ +#ifndef _FrameNumber_H_ +#define _FrameNumber_H_ #include @@ -14,27 +14,28 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* FrameNumber */ -typedef long FrameNumber_t; + /* FrameNumber */ + typedef long FrameNumber_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_FrameNumber; -asn_struct_free_f FrameNumber_free; -asn_struct_print_f FrameNumber_print; -asn_constr_check_f FrameNumber_constraint; -ber_type_decoder_f FrameNumber_decode_ber; -der_type_encoder_f FrameNumber_encode_der; -xer_type_decoder_f FrameNumber_decode_xer; -xer_type_encoder_f FrameNumber_encode_xer; -per_type_decoder_f FrameNumber_decode_uper; -per_type_encoder_f FrameNumber_encode_uper; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_FrameNumber; + asn_struct_free_f FrameNumber_free; + asn_struct_print_f FrameNumber_print; + asn_constr_check_f FrameNumber_constraint; + ber_type_decoder_f FrameNumber_decode_ber; + der_type_encoder_f FrameNumber_encode_der; + xer_type_decoder_f FrameNumber_decode_xer; + xer_type_encoder_f FrameNumber_encode_xer; + per_type_decoder_f FrameNumber_decode_uper; + per_type_encoder_f FrameNumber_encode_uper; #ifdef __cplusplus } #endif -#endif /* _FrameNumber_H_ */ +#endif /* _FrameNumber_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/GANSS-AssistData.h b/src/core/libs/supl/asn-rrlp/GANSS-AssistData.h index cdb0960d8..b5f0b285e 100644 --- a/src/core/libs/supl/asn-rrlp/GANSS-AssistData.h +++ b/src/core/libs/supl/asn-rrlp/GANSS-AssistData.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _GANSS_AssistData_H_ -#define _GANSS_AssistData_H_ +#ifndef _GANSS_AssistData_H_ +#define _GANSS_AssistData_H_ #include @@ -15,23 +15,25 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* GANSS-AssistData */ -typedef struct GANSS_AssistData { - GANSS_ControlHeader_t ganss_controlHeader; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} GANSS_AssistData_t; + /* GANSS-AssistData */ + typedef struct GANSS_AssistData + { + GANSS_ControlHeader_t ganss_controlHeader; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_GANSS_AssistData; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } GANSS_AssistData_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_GANSS_AssistData; #ifdef __cplusplus } #endif -#endif /* _GANSS_AssistData_H_ */ +#endif /* _GANSS_AssistData_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/GANSS-ControlHeader.h b/src/core/libs/supl/asn-rrlp/GANSS-ControlHeader.h index 96e98b022..36edc96f2 100644 --- a/src/core/libs/supl/asn-rrlp/GANSS-ControlHeader.h +++ b/src/core/libs/supl/asn-rrlp/GANSS-ControlHeader.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _GANSS_ControlHeader_H_ -#define _GANSS_ControlHeader_H_ +#ifndef _GANSS_ControlHeader_H_ +#define _GANSS_ControlHeader_H_ #include @@ -14,24 +14,26 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Forward declarations */ -struct GANSSCommonAssistData; -struct SeqOfGANSSGenericAssistDataElement; + /* Forward declarations */ + struct GANSSCommonAssistData; + struct SeqOfGANSSGenericAssistDataElement; -/* GANSS-ControlHeader */ -typedef struct GANSS_ControlHeader { - struct GANSSCommonAssistData *ganssCommonAssistData /* OPTIONAL */; - struct SeqOfGANSSGenericAssistDataElement *ganssGenericAssistDataList /* OPTIONAL */; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} GANSS_ControlHeader_t; + /* GANSS-ControlHeader */ + typedef struct GANSS_ControlHeader + { + struct GANSSCommonAssistData *ganssCommonAssistData /* OPTIONAL */; + struct SeqOfGANSSGenericAssistDataElement *ganssGenericAssistDataList /* OPTIONAL */; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_GANSS_ControlHeader; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } GANSS_ControlHeader_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_GANSS_ControlHeader; #ifdef __cplusplus } @@ -41,5 +43,5 @@ extern asn_TYPE_descriptor_t asn_DEF_GANSS_ControlHeader; #include "GANSSCommonAssistData.h" #include "SeqOfGANSSGenericAssistDataElement.h" -#endif /* _GANSS_ControlHeader_H_ */ +#endif /* _GANSS_ControlHeader_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/GANSS-MsrSetElement.h b/src/core/libs/supl/asn-rrlp/GANSS-MsrSetElement.h index a6579b16e..4786b7e07 100644 --- a/src/core/libs/supl/asn-rrlp/GANSS-MsrSetElement.h +++ b/src/core/libs/supl/asn-rrlp/GANSS-MsrSetElement.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _GANSS_MsrSetElement_H_ -#define _GANSS_MsrSetElement_H_ +#ifndef _GANSS_MsrSetElement_H_ +#define _GANSS_MsrSetElement_H_ #include @@ -18,26 +18,28 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Forward declarations */ -struct ReferenceFrame; + /* Forward declarations */ + struct ReferenceFrame; -/* GANSS-MsrSetElement */ -typedef struct GANSS_MsrSetElement { - struct ReferenceFrame *referenceFrame /* OPTIONAL */; - GANSSTODm_t *ganssTODm /* OPTIONAL */; - long *deltaGNASSTOD /* OPTIONAL */; - GANSSTODUncertainty_t *ganssTODUncertainty /* OPTIONAL */; - SeqOfGANSS_SgnTypeElement_t ganss_SgnTypeList; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} GANSS_MsrSetElement_t; + /* GANSS-MsrSetElement */ + typedef struct GANSS_MsrSetElement + { + struct ReferenceFrame *referenceFrame /* OPTIONAL */; + GANSSTODm_t *ganssTODm /* OPTIONAL */; + long *deltaGNASSTOD /* OPTIONAL */; + GANSSTODUncertainty_t *ganssTODUncertainty /* OPTIONAL */; + SeqOfGANSS_SgnTypeElement_t ganss_SgnTypeList; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_GANSS_MsrSetElement; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } GANSS_MsrSetElement_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_GANSS_MsrSetElement; #ifdef __cplusplus } @@ -46,5 +48,5 @@ extern asn_TYPE_descriptor_t asn_DEF_GANSS_MsrSetElement; /* Referred external types */ #include "ReferenceFrame.h" -#endif /* _GANSS_MsrSetElement_H_ */ +#endif /* _GANSS_MsrSetElement_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/GANSS-SgnElement.h b/src/core/libs/supl/asn-rrlp/GANSS-SgnElement.h index d2727b544..2e7a15c4a 100644 --- a/src/core/libs/supl/asn-rrlp/GANSS-SgnElement.h +++ b/src/core/libs/supl/asn-rrlp/GANSS-SgnElement.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _GANSS_SgnElement_H_ -#define _GANSS_SgnElement_H_ +#ifndef _GANSS_SgnElement_H_ +#define _GANSS_SgnElement_H_ #include @@ -17,31 +17,33 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* GANSS-SgnElement */ -typedef struct GANSS_SgnElement { - SVID_t svID; - long cNo; - MpathIndic_t mpathDet; - long *carrierQualityInd /* OPTIONAL */; - long codePhase; - long *integerCodePhase /* OPTIONAL */; - long codePhaseRMSError; - long *doppler /* OPTIONAL */; - long *adr /* OPTIONAL */; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} GANSS_SgnElement_t; + /* GANSS-SgnElement */ + typedef struct GANSS_SgnElement + { + SVID_t svID; + long cNo; + MpathIndic_t mpathDet; + long *carrierQualityInd /* OPTIONAL */; + long codePhase; + long *integerCodePhase /* OPTIONAL */; + long codePhaseRMSError; + long *doppler /* OPTIONAL */; + long *adr /* OPTIONAL */; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_GANSS_SgnElement; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } GANSS_SgnElement_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_GANSS_SgnElement; #ifdef __cplusplus } #endif -#endif /* _GANSS_SgnElement_H_ */ +#endif /* _GANSS_SgnElement_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/GANSS-SgnTypeElement.h b/src/core/libs/supl/asn-rrlp/GANSS-SgnTypeElement.h index d4b43c852..f591c0e86 100644 --- a/src/core/libs/supl/asn-rrlp/GANSS-SgnTypeElement.h +++ b/src/core/libs/supl/asn-rrlp/GANSS-SgnTypeElement.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _GANSS_SgnTypeElement_H_ -#define _GANSS_SgnTypeElement_H_ +#ifndef _GANSS_SgnTypeElement_H_ +#define _GANSS_SgnTypeElement_H_ #include @@ -16,24 +16,26 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* GANSS-SgnTypeElement */ -typedef struct GANSS_SgnTypeElement { - long ganssSignalID; - SeqOfGANSS_SgnElement_t ganss_SgnList; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} GANSS_SgnTypeElement_t; + /* GANSS-SgnTypeElement */ + typedef struct GANSS_SgnTypeElement + { + long ganssSignalID; + SeqOfGANSS_SgnElement_t ganss_SgnList; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_GANSS_SgnTypeElement; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } GANSS_SgnTypeElement_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_GANSS_SgnTypeElement; #ifdef __cplusplus } #endif -#endif /* _GANSS_SgnTypeElement_H_ */ +#endif /* _GANSS_SgnTypeElement_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/GANSSAlmanacElement.h b/src/core/libs/supl/asn-rrlp/GANSSAlmanacElement.h index 508f08a00..3391b4885 100644 --- a/src/core/libs/supl/asn-rrlp/GANSSAlmanacElement.h +++ b/src/core/libs/supl/asn-rrlp/GANSSAlmanacElement.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _GANSSAlmanacElement_H_ -#define _GANSSAlmanacElement_H_ +#ifndef _GANSSAlmanacElement_H_ +#define _GANSSAlmanacElement_H_ #include @@ -15,38 +15,42 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Dependencies */ -typedef enum GANSSAlmanacElement_PR { - GANSSAlmanacElement_PR_NOTHING, /* No components present */ - GANSSAlmanacElement_PR_keplerianAlmanacSet, - /* Extensions may appear below */ - -} GANSSAlmanacElement_PR; + /* Dependencies */ + typedef enum GANSSAlmanacElement_PR + { + GANSSAlmanacElement_PR_NOTHING, /* No components present */ + GANSSAlmanacElement_PR_keplerianAlmanacSet, + /* Extensions may appear below */ -/* GANSSAlmanacElement */ -typedef struct GANSSAlmanacElement { - GANSSAlmanacElement_PR present; - union GANSSAlmanacElement_u { - Almanac_KeplerianSet_t keplerianAlmanacSet; - /* + } GANSSAlmanacElement_PR; + + /* GANSSAlmanacElement */ + typedef struct GANSSAlmanacElement + { + GANSSAlmanacElement_PR present; + union GANSSAlmanacElement_u + { + Almanac_KeplerianSet_t keplerianAlmanacSet; + /* * This type is extensible, * possible extensions are below. */ - } choice; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} GANSSAlmanacElement_t; + } choice; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_GANSSAlmanacElement; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } GANSSAlmanacElement_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_GANSSAlmanacElement; #ifdef __cplusplus } #endif -#endif /* _GANSSAlmanacElement_H_ */ +#endif /* _GANSSAlmanacElement_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/GANSSAlmanacModel.h b/src/core/libs/supl/asn-rrlp/GANSSAlmanacModel.h index 237ad6217..06253e12f 100644 --- a/src/core/libs/supl/asn-rrlp/GANSSAlmanacModel.h +++ b/src/core/libs/supl/asn-rrlp/GANSSAlmanacModel.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _GANSSAlmanacModel_H_ -#define _GANSSAlmanacModel_H_ +#ifndef _GANSSAlmanacModel_H_ +#define _GANSSAlmanacModel_H_ #include @@ -17,27 +17,29 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* GANSSAlmanacModel */ -typedef struct GANSSAlmanacModel { - long weekNumber; - SVIDMASK_t svIDMask; - long *toa /* OPTIONAL */; - long *ioda /* OPTIONAL */; - SeqOfGANSSAlmanacElement_t ganssAlmanacList; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} GANSSAlmanacModel_t; + /* GANSSAlmanacModel */ + typedef struct GANSSAlmanacModel + { + long weekNumber; + SVIDMASK_t svIDMask; + long *toa /* OPTIONAL */; + long *ioda /* OPTIONAL */; + SeqOfGANSSAlmanacElement_t ganssAlmanacList; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_GANSSAlmanacModel; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } GANSSAlmanacModel_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_GANSSAlmanacModel; #ifdef __cplusplus } #endif -#endif /* _GANSSAlmanacModel_H_ */ +#endif /* _GANSSAlmanacModel_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/GANSSAssistanceData.h b/src/core/libs/supl/asn-rrlp/GANSSAssistanceData.h index 58d37c051..751d01df2 100644 --- a/src/core/libs/supl/asn-rrlp/GANSSAssistanceData.h +++ b/src/core/libs/supl/asn-rrlp/GANSSAssistanceData.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _GANSSAssistanceData_H_ -#define _GANSSAssistanceData_H_ +#ifndef _GANSSAssistanceData_H_ +#define _GANSSAssistanceData_H_ #include @@ -14,27 +14,28 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* GANSSAssistanceData */ -typedef OCTET_STRING_t GANSSAssistanceData_t; + /* GANSSAssistanceData */ + typedef OCTET_STRING_t GANSSAssistanceData_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_GANSSAssistanceData; -asn_struct_free_f GANSSAssistanceData_free; -asn_struct_print_f GANSSAssistanceData_print; -asn_constr_check_f GANSSAssistanceData_constraint; -ber_type_decoder_f GANSSAssistanceData_decode_ber; -der_type_encoder_f GANSSAssistanceData_encode_der; -xer_type_decoder_f GANSSAssistanceData_decode_xer; -xer_type_encoder_f GANSSAssistanceData_encode_xer; -per_type_decoder_f GANSSAssistanceData_decode_uper; -per_type_encoder_f GANSSAssistanceData_encode_uper; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_GANSSAssistanceData; + asn_struct_free_f GANSSAssistanceData_free; + asn_struct_print_f GANSSAssistanceData_print; + asn_constr_check_f GANSSAssistanceData_constraint; + ber_type_decoder_f GANSSAssistanceData_decode_ber; + der_type_encoder_f GANSSAssistanceData_encode_der; + xer_type_decoder_f GANSSAssistanceData_decode_xer; + xer_type_encoder_f GANSSAssistanceData_encode_xer; + per_type_decoder_f GANSSAssistanceData_decode_uper; + per_type_encoder_f GANSSAssistanceData_encode_uper; #ifdef __cplusplus } #endif -#endif /* _GANSSAssistanceData_H_ */ +#endif /* _GANSSAssistanceData_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/GANSSClockModel.h b/src/core/libs/supl/asn-rrlp/GANSSClockModel.h index 4fd80e0b7..05d019a1e 100644 --- a/src/core/libs/supl/asn-rrlp/GANSSClockModel.h +++ b/src/core/libs/supl/asn-rrlp/GANSSClockModel.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _GANSSClockModel_H_ -#define _GANSSClockModel_H_ +#ifndef _GANSSClockModel_H_ +#define _GANSSClockModel_H_ #include @@ -15,38 +15,42 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Dependencies */ -typedef enum GANSSClockModel_PR { - GANSSClockModel_PR_NOTHING, /* No components present */ - GANSSClockModel_PR_standardClockModelList, - /* Extensions may appear below */ - -} GANSSClockModel_PR; + /* Dependencies */ + typedef enum GANSSClockModel_PR + { + GANSSClockModel_PR_NOTHING, /* No components present */ + GANSSClockModel_PR_standardClockModelList, + /* Extensions may appear below */ -/* GANSSClockModel */ -typedef struct GANSSClockModel { - GANSSClockModel_PR present; - union GANSSClockModel_u { - SeqOfStandardClockModelElement_t standardClockModelList; - /* + } GANSSClockModel_PR; + + /* GANSSClockModel */ + typedef struct GANSSClockModel + { + GANSSClockModel_PR present; + union GANSSClockModel_u + { + SeqOfStandardClockModelElement_t standardClockModelList; + /* * This type is extensible, * possible extensions are below. */ - } choice; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} GANSSClockModel_t; + } choice; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_GANSSClockModel; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } GANSSClockModel_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_GANSSClockModel; #ifdef __cplusplus } #endif -#endif /* _GANSSClockModel_H_ */ +#endif /* _GANSSClockModel_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/GANSSCommonAssistData.h b/src/core/libs/supl/asn-rrlp/GANSSCommonAssistData.h index 383d368ac..4173cfac4 100644 --- a/src/core/libs/supl/asn-rrlp/GANSSCommonAssistData.h +++ b/src/core/libs/supl/asn-rrlp/GANSSCommonAssistData.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _GANSSCommonAssistData_H_ -#define _GANSSCommonAssistData_H_ +#ifndef _GANSSCommonAssistData_H_ +#define _GANSSCommonAssistData_H_ #include @@ -14,30 +14,32 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Forward declarations */ -struct GANSSReferenceTime; -struct GANSSRefLocation; -struct GANSSIonosphericModel; + /* Forward declarations */ + struct GANSSReferenceTime; + struct GANSSRefLocation; + struct GANSSIonosphericModel; -/* GANSSCommonAssistData */ -typedef struct GANSSCommonAssistData { - struct GANSSReferenceTime *ganssReferenceTime /* OPTIONAL */; - struct GANSSRefLocation *ganssRefLocation /* OPTIONAL */; - struct GANSSIonosphericModel *ganssIonosphericModel /* OPTIONAL */; - /* + /* GANSSCommonAssistData */ + typedef struct GANSSCommonAssistData + { + struct GANSSReferenceTime *ganssReferenceTime /* OPTIONAL */; + struct GANSSRefLocation *ganssRefLocation /* OPTIONAL */; + struct GANSSIonosphericModel *ganssIonosphericModel /* OPTIONAL */; + /* * This type is extensible, * possible extensions are below. */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} GANSSCommonAssistData_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_GANSSCommonAssistData; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } GANSSCommonAssistData_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_GANSSCommonAssistData; #ifdef __cplusplus } @@ -48,5 +50,5 @@ extern asn_TYPE_descriptor_t asn_DEF_GANSSCommonAssistData; #include "GANSSRefLocation.h" #include "GANSSIonosphericModel.h" -#endif /* _GANSSCommonAssistData_H_ */ +#endif /* _GANSSCommonAssistData_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/GANSSDataBit.h b/src/core/libs/supl/asn-rrlp/GANSSDataBit.h index 008d80e82..9ac0b3dfe 100644 --- a/src/core/libs/supl/asn-rrlp/GANSSDataBit.h +++ b/src/core/libs/supl/asn-rrlp/GANSSDataBit.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _GANSSDataBit_H_ -#define _GANSSDataBit_H_ +#ifndef _GANSSDataBit_H_ +#define _GANSSDataBit_H_ #include @@ -14,27 +14,28 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* GANSSDataBit */ -typedef long GANSSDataBit_t; + /* GANSSDataBit */ + typedef long GANSSDataBit_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_GANSSDataBit; -asn_struct_free_f GANSSDataBit_free; -asn_struct_print_f GANSSDataBit_print; -asn_constr_check_f GANSSDataBit_constraint; -ber_type_decoder_f GANSSDataBit_decode_ber; -der_type_encoder_f GANSSDataBit_encode_der; -xer_type_decoder_f GANSSDataBit_decode_xer; -xer_type_encoder_f GANSSDataBit_encode_xer; -per_type_decoder_f GANSSDataBit_decode_uper; -per_type_encoder_f GANSSDataBit_encode_uper; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_GANSSDataBit; + asn_struct_free_f GANSSDataBit_free; + asn_struct_print_f GANSSDataBit_print; + asn_constr_check_f GANSSDataBit_constraint; + ber_type_decoder_f GANSSDataBit_decode_ber; + der_type_encoder_f GANSSDataBit_encode_der; + xer_type_decoder_f GANSSDataBit_decode_xer; + xer_type_encoder_f GANSSDataBit_encode_xer; + per_type_decoder_f GANSSDataBit_decode_uper; + per_type_encoder_f GANSSDataBit_encode_uper; #ifdef __cplusplus } #endif -#endif /* _GANSSDataBit_H_ */ +#endif /* _GANSSDataBit_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/GANSSDataBitAssist.h b/src/core/libs/supl/asn-rrlp/GANSSDataBitAssist.h index ae97a6315..defe153bd 100644 --- a/src/core/libs/supl/asn-rrlp/GANSSDataBitAssist.h +++ b/src/core/libs/supl/asn-rrlp/GANSSDataBitAssist.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _GANSSDataBitAssist_H_ -#define _GANSSDataBitAssist_H_ +#ifndef _GANSSDataBitAssist_H_ +#define _GANSSDataBitAssist_H_ #include @@ -17,26 +17,28 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* GANSSDataBitAssist */ -typedef struct GANSSDataBitAssist { - long ganssTOD; - SVID_t svID; - long ganssDataTypeID; - SeqOf_GANSSDataBits_t ganssDataBits; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} GANSSDataBitAssist_t; + /* GANSSDataBitAssist */ + typedef struct GANSSDataBitAssist + { + long ganssTOD; + SVID_t svID; + long ganssDataTypeID; + SeqOf_GANSSDataBits_t ganssDataBits; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_GANSSDataBitAssist; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } GANSSDataBitAssist_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_GANSSDataBitAssist; #ifdef __cplusplus } #endif -#endif /* _GANSSDataBitAssist_H_ */ +#endif /* _GANSSDataBitAssist_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/GANSSDiffCorrections.h b/src/core/libs/supl/asn-rrlp/GANSSDiffCorrections.h index b499c3918..5289c74a8 100644 --- a/src/core/libs/supl/asn-rrlp/GANSSDiffCorrections.h +++ b/src/core/libs/supl/asn-rrlp/GANSSDiffCorrections.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _GANSSDiffCorrections_H_ -#define _GANSSDiffCorrections_H_ +#ifndef _GANSSDiffCorrections_H_ +#define _GANSSDiffCorrections_H_ #include @@ -16,24 +16,26 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* GANSSDiffCorrections */ -typedef struct GANSSDiffCorrections { - long dganssRefTime; - SeqOfSgnTypeElement_t sgnTypeList; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} GANSSDiffCorrections_t; + /* GANSSDiffCorrections */ + typedef struct GANSSDiffCorrections + { + long dganssRefTime; + SeqOfSgnTypeElement_t sgnTypeList; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_GANSSDiffCorrections; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } GANSSDiffCorrections_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_GANSSDiffCorrections; #ifdef __cplusplus } #endif -#endif /* _GANSSDiffCorrections_H_ */ +#endif /* _GANSSDiffCorrections_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/GANSSGenericAssistDataElement.h b/src/core/libs/supl/asn-rrlp/GANSSGenericAssistDataElement.h index 1677de530..84573317f 100644 --- a/src/core/libs/supl/asn-rrlp/GANSSGenericAssistDataElement.h +++ b/src/core/libs/supl/asn-rrlp/GANSSGenericAssistDataElement.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _GANSSGenericAssistDataElement_H_ -#define _GANSSGenericAssistDataElement_H_ +#ifndef _GANSSGenericAssistDataElement_H_ +#define _GANSSGenericAssistDataElement_H_ #include @@ -15,41 +15,43 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Forward declarations */ -struct SeqOfGANSSTimeModel; -struct GANSSDiffCorrections; -struct GANSSNavModel; -struct GANSSRealTimeIntegrity; -struct GANSSDataBitAssist; -struct GANSSRefMeasurementAssist; -struct GANSSAlmanacModel; -struct GANSSUTCModel; + /* Forward declarations */ + struct SeqOfGANSSTimeModel; + struct GANSSDiffCorrections; + struct GANSSNavModel; + struct GANSSRealTimeIntegrity; + struct GANSSDataBitAssist; + struct GANSSRefMeasurementAssist; + struct GANSSAlmanacModel; + struct GANSSUTCModel; -/* GANSSGenericAssistDataElement */ -typedef struct GANSSGenericAssistDataElement { - long *ganssID /* OPTIONAL */; - struct SeqOfGANSSTimeModel *ganssTimeModel /* OPTIONAL */; - struct GANSSDiffCorrections *ganssDiffCorrections /* OPTIONAL */; - struct GANSSNavModel *ganssNavigationModel /* OPTIONAL */; - struct GANSSRealTimeIntegrity *ganssRealTimeIntegrity /* OPTIONAL */; - struct GANSSDataBitAssist *ganssDataBitAssist /* OPTIONAL */; - struct GANSSRefMeasurementAssist *ganssRefMeasurementAssist /* OPTIONAL */; - struct GANSSAlmanacModel *ganssAlmanacModel /* OPTIONAL */; - struct GANSSUTCModel *ganssUTCModel /* OPTIONAL */; - /* + /* GANSSGenericAssistDataElement */ + typedef struct GANSSGenericAssistDataElement + { + long *ganssID /* OPTIONAL */; + struct SeqOfGANSSTimeModel *ganssTimeModel /* OPTIONAL */; + struct GANSSDiffCorrections *ganssDiffCorrections /* OPTIONAL */; + struct GANSSNavModel *ganssNavigationModel /* OPTIONAL */; + struct GANSSRealTimeIntegrity *ganssRealTimeIntegrity /* OPTIONAL */; + struct GANSSDataBitAssist *ganssDataBitAssist /* OPTIONAL */; + struct GANSSRefMeasurementAssist *ganssRefMeasurementAssist /* OPTIONAL */; + struct GANSSAlmanacModel *ganssAlmanacModel /* OPTIONAL */; + struct GANSSUTCModel *ganssUTCModel /* OPTIONAL */; + /* * This type is extensible, * possible extensions are below. */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} GANSSGenericAssistDataElement_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_GANSSGenericAssistDataElement; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } GANSSGenericAssistDataElement_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_GANSSGenericAssistDataElement; #ifdef __cplusplus } @@ -65,5 +67,5 @@ extern asn_TYPE_descriptor_t asn_DEF_GANSSGenericAssistDataElement; #include "GANSSAlmanacModel.h" #include "GANSSUTCModel.h" -#endif /* _GANSSGenericAssistDataElement_H_ */ +#endif /* _GANSSGenericAssistDataElement_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/GANSSIonoStormFlags.h b/src/core/libs/supl/asn-rrlp/GANSSIonoStormFlags.h index b55e8a32e..c99ab79c6 100644 --- a/src/core/libs/supl/asn-rrlp/GANSSIonoStormFlags.h +++ b/src/core/libs/supl/asn-rrlp/GANSSIonoStormFlags.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _GANSSIonoStormFlags_H_ -#define _GANSSIonoStormFlags_H_ +#ifndef _GANSSIonoStormFlags_H_ +#define _GANSSIonoStormFlags_H_ #include @@ -15,27 +15,29 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* GANSSIonoStormFlags */ -typedef struct GANSSIonoStormFlags { - long ionoStormFlag1; - long ionoStormFlag2; - long ionoStormFlag3; - long ionoStormFlag4; - long ionoStormFlag5; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} GANSSIonoStormFlags_t; + /* GANSSIonoStormFlags */ + typedef struct GANSSIonoStormFlags + { + long ionoStormFlag1; + long ionoStormFlag2; + long ionoStormFlag3; + long ionoStormFlag4; + long ionoStormFlag5; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_GANSSIonoStormFlags; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } GANSSIonoStormFlags_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_GANSSIonoStormFlags; #ifdef __cplusplus } #endif -#endif /* _GANSSIonoStormFlags_H_ */ +#endif /* _GANSSIonoStormFlags_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/GANSSIonosphereModel.h b/src/core/libs/supl/asn-rrlp/GANSSIonosphereModel.h index a30c4d2e2..969fd8da0 100644 --- a/src/core/libs/supl/asn-rrlp/GANSSIonosphereModel.h +++ b/src/core/libs/supl/asn-rrlp/GANSSIonosphereModel.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _GANSSIonosphereModel_H_ -#define _GANSSIonosphereModel_H_ +#ifndef _GANSSIonosphereModel_H_ +#define _GANSSIonosphereModel_H_ #include @@ -15,25 +15,27 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* GANSSIonosphereModel */ -typedef struct GANSSIonosphereModel { - long ai0; - long ai1; - long ai2; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} GANSSIonosphereModel_t; + /* GANSSIonosphereModel */ + typedef struct GANSSIonosphereModel + { + long ai0; + long ai1; + long ai2; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_GANSSIonosphereModel; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } GANSSIonosphereModel_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_GANSSIonosphereModel; #ifdef __cplusplus } #endif -#endif /* _GANSSIonosphereModel_H_ */ +#endif /* _GANSSIonosphereModel_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/GANSSIonosphericModel.h b/src/core/libs/supl/asn-rrlp/GANSSIonosphericModel.h index e96ff7635..30a219e0d 100644 --- a/src/core/libs/supl/asn-rrlp/GANSSIonosphericModel.h +++ b/src/core/libs/supl/asn-rrlp/GANSSIonosphericModel.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _GANSSIonosphericModel_H_ -#define _GANSSIonosphericModel_H_ +#ifndef _GANSSIonosphericModel_H_ +#define _GANSSIonosphericModel_H_ #include @@ -15,27 +15,29 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Forward declarations */ -struct GANSSIonoStormFlags; + /* Forward declarations */ + struct GANSSIonoStormFlags; -/* GANSSIonosphericModel */ -typedef struct GANSSIonosphericModel { - GANSSIonosphereModel_t ganssIonoModel; - struct GANSSIonoStormFlags *ganssIonoStormFlags /* OPTIONAL */; - /* + /* GANSSIonosphericModel */ + typedef struct GANSSIonosphericModel + { + GANSSIonosphereModel_t ganssIonoModel; + struct GANSSIonoStormFlags *ganssIonoStormFlags /* OPTIONAL */; + /* * This type is extensible, * possible extensions are below. */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} GANSSIonosphericModel_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_GANSSIonosphericModel; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } GANSSIonosphericModel_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_GANSSIonosphericModel; #ifdef __cplusplus } @@ -44,5 +46,5 @@ extern asn_TYPE_descriptor_t asn_DEF_GANSSIonosphericModel; /* Referred external types */ #include "GANSSIonoStormFlags.h" -#endif /* _GANSSIonosphericModel_H_ */ +#endif /* _GANSSIonosphericModel_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/GANSSLocationInfo.h b/src/core/libs/supl/asn-rrlp/GANSSLocationInfo.h index b1cc1c866..ab7b0dcea 100644 --- a/src/core/libs/supl/asn-rrlp/GANSSLocationInfo.h +++ b/src/core/libs/supl/asn-rrlp/GANSSLocationInfo.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _GANSSLocationInfo_H_ -#define _GANSSLocationInfo_H_ +#ifndef _GANSSLocationInfo_H_ +#define _GANSSLocationInfo_H_ #include @@ -20,34 +20,36 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Forward declarations */ -struct ReferenceFrame; + /* Forward declarations */ + struct ReferenceFrame; -/* GANSSLocationInfo */ -typedef struct GANSSLocationInfo { - struct ReferenceFrame *referenceFrame /* OPTIONAL */; - GANSSTODm_t *ganssTODm /* OPTIONAL */; - long *ganssTODFrac /* OPTIONAL */; - GANSSTODUncertainty_t *ganssTODUncertainty /* OPTIONAL */; - long *ganssTimeID /* OPTIONAL */; - FixType_t fixType; - PositionData_t posData; - long *stationaryIndication /* OPTIONAL */; - Ext_GeographicalInformation_t posEstimate; - /* + /* GANSSLocationInfo */ + typedef struct GANSSLocationInfo + { + struct ReferenceFrame *referenceFrame /* OPTIONAL */; + GANSSTODm_t *ganssTODm /* OPTIONAL */; + long *ganssTODFrac /* OPTIONAL */; + GANSSTODUncertainty_t *ganssTODUncertainty /* OPTIONAL */; + long *ganssTimeID /* OPTIONAL */; + FixType_t fixType; + PositionData_t posData; + long *stationaryIndication /* OPTIONAL */; + Ext_GeographicalInformation_t posEstimate; + /* * This type is extensible, * possible extensions are below. */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} GANSSLocationInfo_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_GANSSLocationInfo; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } GANSSLocationInfo_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_GANSSLocationInfo; #ifdef __cplusplus } @@ -56,5 +58,5 @@ extern asn_TYPE_descriptor_t asn_DEF_GANSSLocationInfo; /* Referred external types */ #include "ReferenceFrame.h" -#endif /* _GANSSLocationInfo_H_ */ +#endif /* _GANSSLocationInfo_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/GANSSMeasureInfo.h b/src/core/libs/supl/asn-rrlp/GANSSMeasureInfo.h index fa03e8726..e5e87bd86 100644 --- a/src/core/libs/supl/asn-rrlp/GANSSMeasureInfo.h +++ b/src/core/libs/supl/asn-rrlp/GANSSMeasureInfo.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _GANSSMeasureInfo_H_ -#define _GANSSMeasureInfo_H_ +#ifndef _GANSSMeasureInfo_H_ +#define _GANSSMeasureInfo_H_ #include @@ -15,23 +15,25 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* GANSSMeasureInfo */ -typedef struct GANSSMeasureInfo { - SeqOfGANSS_MsrSetElement_t ganssMsrSetList; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} GANSSMeasureInfo_t; + /* GANSSMeasureInfo */ + typedef struct GANSSMeasureInfo + { + SeqOfGANSS_MsrSetElement_t ganssMsrSetList; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_GANSSMeasureInfo; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } GANSSMeasureInfo_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_GANSSMeasureInfo; #ifdef __cplusplus } #endif -#endif /* _GANSSMeasureInfo_H_ */ +#endif /* _GANSSMeasureInfo_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/GANSSNavModel.h b/src/core/libs/supl/asn-rrlp/GANSSNavModel.h index d49b75a44..3891a44d7 100644 --- a/src/core/libs/supl/asn-rrlp/GANSSNavModel.h +++ b/src/core/libs/supl/asn-rrlp/GANSSNavModel.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _GANSSNavModel_H_ -#define _GANSSNavModel_H_ +#ifndef _GANSSNavModel_H_ +#define _GANSSNavModel_H_ #include @@ -16,27 +16,29 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* GANSSNavModel */ -typedef struct GANSSNavModel { - long nonBroadcastIndFlag; - long *toeMSB /* OPTIONAL */; - long *eMSB /* OPTIONAL */; - long *sqrtAMBS /* OPTIONAL */; - SeqOfGANSSSatelliteElement_t ganssSatelliteList; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} GANSSNavModel_t; + /* GANSSNavModel */ + typedef struct GANSSNavModel + { + long nonBroadcastIndFlag; + long *toeMSB /* OPTIONAL */; + long *eMSB /* OPTIONAL */; + long *sqrtAMBS /* OPTIONAL */; + SeqOfGANSSSatelliteElement_t ganssSatelliteList; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_GANSSNavModel; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } GANSSNavModel_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_GANSSNavModel; #ifdef __cplusplus } #endif -#endif /* _GANSSNavModel_H_ */ +#endif /* _GANSSNavModel_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/GANSSOrbitModel.h b/src/core/libs/supl/asn-rrlp/GANSSOrbitModel.h index b1e6cbb48..23a907d01 100644 --- a/src/core/libs/supl/asn-rrlp/GANSSOrbitModel.h +++ b/src/core/libs/supl/asn-rrlp/GANSSOrbitModel.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _GANSSOrbitModel_H_ -#define _GANSSOrbitModel_H_ +#ifndef _GANSSOrbitModel_H_ +#define _GANSSOrbitModel_H_ #include @@ -15,38 +15,42 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Dependencies */ -typedef enum GANSSOrbitModel_PR { - GANSSOrbitModel_PR_NOTHING, /* No components present */ - GANSSOrbitModel_PR_keplerianSet, - /* Extensions may appear below */ - -} GANSSOrbitModel_PR; + /* Dependencies */ + typedef enum GANSSOrbitModel_PR + { + GANSSOrbitModel_PR_NOTHING, /* No components present */ + GANSSOrbitModel_PR_keplerianSet, + /* Extensions may appear below */ -/* GANSSOrbitModel */ -typedef struct GANSSOrbitModel { - GANSSOrbitModel_PR present; - union GANSSOrbitModel_u { - NavModel_KeplerianSet_t keplerianSet; - /* + } GANSSOrbitModel_PR; + + /* GANSSOrbitModel */ + typedef struct GANSSOrbitModel + { + GANSSOrbitModel_PR present; + union GANSSOrbitModel_u + { + NavModel_KeplerianSet_t keplerianSet; + /* * This type is extensible, * possible extensions are below. */ - } choice; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} GANSSOrbitModel_t; + } choice; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_GANSSOrbitModel; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } GANSSOrbitModel_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_GANSSOrbitModel; #ifdef __cplusplus } #endif -#endif /* _GANSSOrbitModel_H_ */ +#endif /* _GANSSOrbitModel_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/GANSSPositioningMethod.h b/src/core/libs/supl/asn-rrlp/GANSSPositioningMethod.h index 334d978ce..2719933a3 100644 --- a/src/core/libs/supl/asn-rrlp/GANSSPositioningMethod.h +++ b/src/core/libs/supl/asn-rrlp/GANSSPositioningMethod.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _GANSSPositioningMethod_H_ -#define _GANSSPositioningMethod_H_ +#ifndef _GANSSPositioningMethod_H_ +#define _GANSSPositioningMethod_H_ #include @@ -14,33 +14,35 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Dependencies */ -typedef enum GANSSPositioningMethod { - GANSSPositioningMethod_gps = 0, - GANSSPositioningMethod_galileo = 1 -} e_GANSSPositioningMethod; + /* Dependencies */ + typedef enum GANSSPositioningMethod + { + GANSSPositioningMethod_gps = 0, + GANSSPositioningMethod_galileo = 1 + } e_GANSSPositioningMethod; -/* GANSSPositioningMethod */ -typedef BIT_STRING_t GANSSPositioningMethod_t; + /* GANSSPositioningMethod */ + typedef BIT_STRING_t GANSSPositioningMethod_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_GANSSPositioningMethod; -asn_struct_free_f GANSSPositioningMethod_free; -asn_struct_print_f GANSSPositioningMethod_print; -asn_constr_check_f GANSSPositioningMethod_constraint; -ber_type_decoder_f GANSSPositioningMethod_decode_ber; -der_type_encoder_f GANSSPositioningMethod_encode_der; -xer_type_decoder_f GANSSPositioningMethod_decode_xer; -xer_type_encoder_f GANSSPositioningMethod_encode_xer; -per_type_decoder_f GANSSPositioningMethod_decode_uper; -per_type_encoder_f GANSSPositioningMethod_encode_uper; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_GANSSPositioningMethod; + asn_struct_free_f GANSSPositioningMethod_free; + asn_struct_print_f GANSSPositioningMethod_print; + asn_constr_check_f GANSSPositioningMethod_constraint; + ber_type_decoder_f GANSSPositioningMethod_decode_ber; + der_type_encoder_f GANSSPositioningMethod_encode_der; + xer_type_decoder_f GANSSPositioningMethod_decode_xer; + xer_type_encoder_f GANSSPositioningMethod_encode_xer; + per_type_decoder_f GANSSPositioningMethod_decode_uper; + per_type_encoder_f GANSSPositioningMethod_encode_uper; #ifdef __cplusplus } #endif -#endif /* _GANSSPositioningMethod_H_ */ +#endif /* _GANSSPositioningMethod_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/GANSSRealTimeIntegrity.h b/src/core/libs/supl/asn-rrlp/GANSSRealTimeIntegrity.h index d3fa6649a..389994464 100644 --- a/src/core/libs/supl/asn-rrlp/GANSSRealTimeIntegrity.h +++ b/src/core/libs/supl/asn-rrlp/GANSSRealTimeIntegrity.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _GANSSRealTimeIntegrity_H_ -#define _GANSSRealTimeIntegrity_H_ +#ifndef _GANSSRealTimeIntegrity_H_ +#define _GANSSRealTimeIntegrity_H_ #include @@ -15,23 +15,25 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* GANSSRealTimeIntegrity */ -typedef struct GANSSRealTimeIntegrity { - SeqOfBadSignalElement_t ganssBadSignalList; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} GANSSRealTimeIntegrity_t; + /* GANSSRealTimeIntegrity */ + typedef struct GANSSRealTimeIntegrity + { + SeqOfBadSignalElement_t ganssBadSignalList; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_GANSSRealTimeIntegrity; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } GANSSRealTimeIntegrity_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_GANSSRealTimeIntegrity; #ifdef __cplusplus } #endif -#endif /* _GANSSRealTimeIntegrity_H_ */ +#endif /* _GANSSRealTimeIntegrity_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/GANSSRefLocation.h b/src/core/libs/supl/asn-rrlp/GANSSRefLocation.h index ea8ab7bb8..70b9d79fe 100644 --- a/src/core/libs/supl/asn-rrlp/GANSSRefLocation.h +++ b/src/core/libs/supl/asn-rrlp/GANSSRefLocation.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _GANSSRefLocation_H_ -#define _GANSSRefLocation_H_ +#ifndef _GANSSRefLocation_H_ +#define _GANSSRefLocation_H_ #include @@ -15,23 +15,25 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* GANSSRefLocation */ -typedef struct GANSSRefLocation { - Ext_GeographicalInformation_t threeDLocation; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} GANSSRefLocation_t; + /* GANSSRefLocation */ + typedef struct GANSSRefLocation + { + Ext_GeographicalInformation_t threeDLocation; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_GANSSRefLocation; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } GANSSRefLocation_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_GANSSRefLocation; #ifdef __cplusplus } #endif -#endif /* _GANSSRefLocation_H_ */ +#endif /* _GANSSRefLocation_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/GANSSRefMeasurementAssist.h b/src/core/libs/supl/asn-rrlp/GANSSRefMeasurementAssist.h index 0fc7a48f7..e6af89db3 100644 --- a/src/core/libs/supl/asn-rrlp/GANSSRefMeasurementAssist.h +++ b/src/core/libs/supl/asn-rrlp/GANSSRefMeasurementAssist.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _GANSSRefMeasurementAssist_H_ -#define _GANSSRefMeasurementAssist_H_ +#ifndef _GANSSRefMeasurementAssist_H_ +#define _GANSSRefMeasurementAssist_H_ #include @@ -16,24 +16,26 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* GANSSRefMeasurementAssist */ -typedef struct GANSSRefMeasurementAssist { - long *ganssSignalID /* OPTIONAL */; - SeqOfGANSSRefMeasurementElement_t ganssRefMeasAssitList; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} GANSSRefMeasurementAssist_t; + /* GANSSRefMeasurementAssist */ + typedef struct GANSSRefMeasurementAssist + { + long *ganssSignalID /* OPTIONAL */; + SeqOfGANSSRefMeasurementElement_t ganssRefMeasAssitList; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_GANSSRefMeasurementAssist; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } GANSSRefMeasurementAssist_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_GANSSRefMeasurementAssist; #ifdef __cplusplus } #endif -#endif /* _GANSSRefMeasurementAssist_H_ */ +#endif /* _GANSSRefMeasurementAssist_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/GANSSRefMeasurementElement.h b/src/core/libs/supl/asn-rrlp/GANSSRefMeasurementElement.h index 2c98266fb..42869c0dd 100644 --- a/src/core/libs/supl/asn-rrlp/GANSSRefMeasurementElement.h +++ b/src/core/libs/supl/asn-rrlp/GANSSRefMeasurementElement.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _GANSSRefMeasurementElement_H_ -#define _GANSSRefMeasurementElement_H_ +#ifndef _GANSSRefMeasurementElement_H_ +#define _GANSSRefMeasurementElement_H_ #include @@ -16,33 +16,35 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Forward declarations */ -struct AdditionalDopplerFields; -struct AddionalAngleFields; + /* Forward declarations */ + struct AdditionalDopplerFields; + struct AddionalAngleFields; -/* GANSSRefMeasurementElement */ -typedef struct GANSSRefMeasurementElement { - SVID_t svID; - long doppler0; - struct AdditionalDopplerFields *additionalDoppler /* OPTIONAL */; - long codePhase; - long intCodePhase; - long codePhaseSearchWindow; - struct AddionalAngleFields *additionalAngle /* OPTIONAL */; - /* + /* GANSSRefMeasurementElement */ + typedef struct GANSSRefMeasurementElement + { + SVID_t svID; + long doppler0; + struct AdditionalDopplerFields *additionalDoppler /* OPTIONAL */; + long codePhase; + long intCodePhase; + long codePhaseSearchWindow; + struct AddionalAngleFields *additionalAngle /* OPTIONAL */; + /* * This type is extensible, * possible extensions are below. */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} GANSSRefMeasurementElement_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_GANSSRefMeasurementElement; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } GANSSRefMeasurementElement_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_GANSSRefMeasurementElement; #ifdef __cplusplus } @@ -52,5 +54,5 @@ extern asn_TYPE_descriptor_t asn_DEF_GANSSRefMeasurementElement; #include "AdditionalDopplerFields.h" #include "AddionalAngleFields.h" -#endif /* _GANSSRefMeasurementElement_H_ */ +#endif /* _GANSSRefMeasurementElement_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/GANSSRefTimeInfo.h b/src/core/libs/supl/asn-rrlp/GANSSRefTimeInfo.h index 58139a317..508883f89 100644 --- a/src/core/libs/supl/asn-rrlp/GANSSRefTimeInfo.h +++ b/src/core/libs/supl/asn-rrlp/GANSSRefTimeInfo.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _GANSSRefTimeInfo_H_ -#define _GANSSRefTimeInfo_H_ +#ifndef _GANSSRefTimeInfo_H_ +#define _GANSSRefTimeInfo_H_ #include @@ -17,26 +17,28 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* GANSSRefTimeInfo */ -typedef struct GANSSRefTimeInfo { - long *ganssDay /* OPTIONAL */; - GANSSTOD_t ganssTOD; - GANSSTODUncertainty_t *ganssTODUncertainty /* OPTIONAL */; - long *ganssTimeID /* OPTIONAL */; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} GANSSRefTimeInfo_t; + /* GANSSRefTimeInfo */ + typedef struct GANSSRefTimeInfo + { + long *ganssDay /* OPTIONAL */; + GANSSTOD_t ganssTOD; + GANSSTODUncertainty_t *ganssTODUncertainty /* OPTIONAL */; + long *ganssTimeID /* OPTIONAL */; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_GANSSRefTimeInfo; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } GANSSRefTimeInfo_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_GANSSRefTimeInfo; #ifdef __cplusplus } #endif -#endif /* _GANSSRefTimeInfo_H_ */ +#endif /* _GANSSRefTimeInfo_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/GANSSReferenceTime.h b/src/core/libs/supl/asn-rrlp/GANSSReferenceTime.h index e58e47069..adf0a749e 100644 --- a/src/core/libs/supl/asn-rrlp/GANSSReferenceTime.h +++ b/src/core/libs/supl/asn-rrlp/GANSSReferenceTime.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _GANSSReferenceTime_H_ -#define _GANSSReferenceTime_H_ +#ifndef _GANSSReferenceTime_H_ +#define _GANSSReferenceTime_H_ #include @@ -15,23 +15,25 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Forward declarations */ -struct GANSSTOD_GSMTimeAssociation; + /* Forward declarations */ + struct GANSSTOD_GSMTimeAssociation; -/* GANSSReferenceTime */ -typedef struct GANSSReferenceTime { - GANSSRefTimeInfo_t ganssRefTimeInfo; - struct GANSSTOD_GSMTimeAssociation *ganssTOD_GSMTimeAssociation /* OPTIONAL */; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} GANSSReferenceTime_t; + /* GANSSReferenceTime */ + typedef struct GANSSReferenceTime + { + GANSSRefTimeInfo_t ganssRefTimeInfo; + struct GANSSTOD_GSMTimeAssociation *ganssTOD_GSMTimeAssociation /* OPTIONAL */; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_GANSSReferenceTime; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } GANSSReferenceTime_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_GANSSReferenceTime; #ifdef __cplusplus } @@ -40,5 +42,5 @@ extern asn_TYPE_descriptor_t asn_DEF_GANSSReferenceTime; /* Referred external types */ #include "GANSSTOD-GSMTimeAssociation.h" -#endif /* _GANSSReferenceTime_H_ */ +#endif /* _GANSSReferenceTime_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/GANSSSatelliteElement.h b/src/core/libs/supl/asn-rrlp/GANSSSatelliteElement.h index 4027c41c5..5af0f54de 100644 --- a/src/core/libs/supl/asn-rrlp/GANSSSatelliteElement.h +++ b/src/core/libs/supl/asn-rrlp/GANSSSatelliteElement.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _GANSSSatelliteElement_H_ -#define _GANSSSatelliteElement_H_ +#ifndef _GANSSSatelliteElement_H_ +#define _GANSSSatelliteElement_H_ #include @@ -18,31 +18,33 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* GANSSSatelliteElement */ -typedef struct GANSSSatelliteElement { - SVID_t svID; - long svHealth; - long iod; - GANSSClockModel_t ganssClockModel; - GANSSOrbitModel_t ganssOrbitModel; - /* + /* GANSSSatelliteElement */ + typedef struct GANSSSatelliteElement + { + SVID_t svID; + long svHealth; + long iod; + GANSSClockModel_t ganssClockModel; + GANSSOrbitModel_t ganssOrbitModel; + /* * This type is extensible, * possible extensions are below. */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} GANSSSatelliteElement_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_GANSSSatelliteElement; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } GANSSSatelliteElement_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_GANSSSatelliteElement; #ifdef __cplusplus } #endif -#endif /* _GANSSSatelliteElement_H_ */ +#endif /* _GANSSSatelliteElement_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/GANSSSignalID.h b/src/core/libs/supl/asn-rrlp/GANSSSignalID.h index 8788fcf15..e89105ba3 100644 --- a/src/core/libs/supl/asn-rrlp/GANSSSignalID.h +++ b/src/core/libs/supl/asn-rrlp/GANSSSignalID.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _GANSSSignalID_H_ -#define _GANSSSignalID_H_ +#ifndef _GANSSSignalID_H_ +#define _GANSSSignalID_H_ #include @@ -14,27 +14,28 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* GANSSSignalID */ -typedef long GANSSSignalID_t; + /* GANSSSignalID */ + typedef long GANSSSignalID_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_GANSSSignalID; -asn_struct_free_f GANSSSignalID_free; -asn_struct_print_f GANSSSignalID_print; -asn_constr_check_f GANSSSignalID_constraint; -ber_type_decoder_f GANSSSignalID_decode_ber; -der_type_encoder_f GANSSSignalID_encode_der; -xer_type_decoder_f GANSSSignalID_decode_xer; -xer_type_encoder_f GANSSSignalID_encode_xer; -per_type_decoder_f GANSSSignalID_decode_uper; -per_type_encoder_f GANSSSignalID_encode_uper; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_GANSSSignalID; + asn_struct_free_f GANSSSignalID_free; + asn_struct_print_f GANSSSignalID_print; + asn_constr_check_f GANSSSignalID_constraint; + ber_type_decoder_f GANSSSignalID_decode_ber; + der_type_encoder_f GANSSSignalID_encode_der; + xer_type_decoder_f GANSSSignalID_decode_xer; + xer_type_encoder_f GANSSSignalID_encode_xer; + per_type_decoder_f GANSSSignalID_decode_uper; + per_type_encoder_f GANSSSignalID_encode_uper; #ifdef __cplusplus } #endif -#endif /* _GANSSSignalID_H_ */ +#endif /* _GANSSSignalID_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/GANSSTOD-GSMTimeAssociation.h b/src/core/libs/supl/asn-rrlp/GANSSTOD-GSMTimeAssociation.h index 2d3f021a2..b6016268f 100644 --- a/src/core/libs/supl/asn-rrlp/GANSSTOD-GSMTimeAssociation.h +++ b/src/core/libs/supl/asn-rrlp/GANSSTOD-GSMTimeAssociation.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _GANSSTOD_GSMTimeAssociation_H_ -#define _GANSSTOD_GSMTimeAssociation_H_ +#ifndef _GANSSTOD_GSMTimeAssociation_H_ +#define _GANSSTOD_GSMTimeAssociation_H_ #include @@ -20,28 +20,30 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* GANSSTOD-GSMTimeAssociation */ -typedef struct GANSSTOD_GSMTimeAssociation { - BCCHCarrier_t bcchCarrier; - BSIC_t bsic; - FrameNumber_t frameNumber; - TimeSlot_t timeSlot; - BitNumber_t bitNumber; - FrameDrift_t *frameDrift /* OPTIONAL */; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} GANSSTOD_GSMTimeAssociation_t; + /* GANSSTOD-GSMTimeAssociation */ + typedef struct GANSSTOD_GSMTimeAssociation + { + BCCHCarrier_t bcchCarrier; + BSIC_t bsic; + FrameNumber_t frameNumber; + TimeSlot_t timeSlot; + BitNumber_t bitNumber; + FrameDrift_t *frameDrift /* OPTIONAL */; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_GANSSTOD_GSMTimeAssociation; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } GANSSTOD_GSMTimeAssociation_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_GANSSTOD_GSMTimeAssociation; #ifdef __cplusplus } #endif -#endif /* _GANSSTOD_GSMTimeAssociation_H_ */ +#endif /* _GANSSTOD_GSMTimeAssociation_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/GANSSTOD.h b/src/core/libs/supl/asn-rrlp/GANSSTOD.h index ba5ff9342..e8b62ef2c 100644 --- a/src/core/libs/supl/asn-rrlp/GANSSTOD.h +++ b/src/core/libs/supl/asn-rrlp/GANSSTOD.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _GANSSTOD_H_ -#define _GANSSTOD_H_ +#ifndef _GANSSTOD_H_ +#define _GANSSTOD_H_ #include @@ -14,27 +14,28 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* GANSSTOD */ -typedef long GANSSTOD_t; + /* GANSSTOD */ + typedef long GANSSTOD_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_GANSSTOD; -asn_struct_free_f GANSSTOD_free; -asn_struct_print_f GANSSTOD_print; -asn_constr_check_f GANSSTOD_constraint; -ber_type_decoder_f GANSSTOD_decode_ber; -der_type_encoder_f GANSSTOD_encode_der; -xer_type_decoder_f GANSSTOD_decode_xer; -xer_type_encoder_f GANSSTOD_encode_xer; -per_type_decoder_f GANSSTOD_decode_uper; -per_type_encoder_f GANSSTOD_encode_uper; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_GANSSTOD; + asn_struct_free_f GANSSTOD_free; + asn_struct_print_f GANSSTOD_print; + asn_constr_check_f GANSSTOD_constraint; + ber_type_decoder_f GANSSTOD_decode_ber; + der_type_encoder_f GANSSTOD_encode_der; + xer_type_decoder_f GANSSTOD_decode_xer; + xer_type_encoder_f GANSSTOD_encode_xer; + per_type_decoder_f GANSSTOD_decode_uper; + per_type_encoder_f GANSSTOD_encode_uper; #ifdef __cplusplus } #endif -#endif /* _GANSSTOD_H_ */ +#endif /* _GANSSTOD_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/GANSSTODUncertainty.h b/src/core/libs/supl/asn-rrlp/GANSSTODUncertainty.h index e373153a9..8997e77e4 100644 --- a/src/core/libs/supl/asn-rrlp/GANSSTODUncertainty.h +++ b/src/core/libs/supl/asn-rrlp/GANSSTODUncertainty.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _GANSSTODUncertainty_H_ -#define _GANSSTODUncertainty_H_ +#ifndef _GANSSTODUncertainty_H_ +#define _GANSSTODUncertainty_H_ #include @@ -14,27 +14,28 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* GANSSTODUncertainty */ -typedef long GANSSTODUncertainty_t; + /* GANSSTODUncertainty */ + typedef long GANSSTODUncertainty_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_GANSSTODUncertainty; -asn_struct_free_f GANSSTODUncertainty_free; -asn_struct_print_f GANSSTODUncertainty_print; -asn_constr_check_f GANSSTODUncertainty_constraint; -ber_type_decoder_f GANSSTODUncertainty_decode_ber; -der_type_encoder_f GANSSTODUncertainty_encode_der; -xer_type_decoder_f GANSSTODUncertainty_decode_xer; -xer_type_encoder_f GANSSTODUncertainty_encode_xer; -per_type_decoder_f GANSSTODUncertainty_decode_uper; -per_type_encoder_f GANSSTODUncertainty_encode_uper; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_GANSSTODUncertainty; + asn_struct_free_f GANSSTODUncertainty_free; + asn_struct_print_f GANSSTODUncertainty_print; + asn_constr_check_f GANSSTODUncertainty_constraint; + ber_type_decoder_f GANSSTODUncertainty_decode_ber; + der_type_encoder_f GANSSTODUncertainty_encode_der; + xer_type_decoder_f GANSSTODUncertainty_decode_xer; + xer_type_encoder_f GANSSTODUncertainty_encode_xer; + per_type_decoder_f GANSSTODUncertainty_decode_uper; + per_type_encoder_f GANSSTODUncertainty_encode_uper; #ifdef __cplusplus } #endif -#endif /* _GANSSTODUncertainty_H_ */ +#endif /* _GANSSTODUncertainty_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/GANSSTODm.h b/src/core/libs/supl/asn-rrlp/GANSSTODm.h index f539c988f..008482f2c 100644 --- a/src/core/libs/supl/asn-rrlp/GANSSTODm.h +++ b/src/core/libs/supl/asn-rrlp/GANSSTODm.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _GANSSTODm_H_ -#define _GANSSTODm_H_ +#ifndef _GANSSTODm_H_ +#define _GANSSTODm_H_ #include @@ -14,27 +14,28 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* GANSSTODm */ -typedef long GANSSTODm_t; + /* GANSSTODm */ + typedef long GANSSTODm_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_GANSSTODm; -asn_struct_free_f GANSSTODm_free; -asn_struct_print_f GANSSTODm_print; -asn_constr_check_f GANSSTODm_constraint; -ber_type_decoder_f GANSSTODm_decode_ber; -der_type_encoder_f GANSSTODm_encode_der; -xer_type_decoder_f GANSSTODm_decode_xer; -xer_type_encoder_f GANSSTODm_encode_xer; -per_type_decoder_f GANSSTODm_decode_uper; -per_type_encoder_f GANSSTODm_encode_uper; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_GANSSTODm; + asn_struct_free_f GANSSTODm_free; + asn_struct_print_f GANSSTODm_print; + asn_constr_check_f GANSSTODm_constraint; + ber_type_decoder_f GANSSTODm_decode_ber; + der_type_encoder_f GANSSTODm_encode_der; + xer_type_decoder_f GANSSTODm_decode_xer; + xer_type_encoder_f GANSSTODm_encode_xer; + per_type_decoder_f GANSSTODm_decode_uper; + per_type_encoder_f GANSSTODm_encode_uper; #ifdef __cplusplus } #endif -#endif /* _GANSSTODm_H_ */ +#endif /* _GANSSTODm_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/GANSSTimeModelElement.h b/src/core/libs/supl/asn-rrlp/GANSSTimeModelElement.h index f3fe2d398..2ffc74388 100644 --- a/src/core/libs/supl/asn-rrlp/GANSSTimeModelElement.h +++ b/src/core/libs/supl/asn-rrlp/GANSSTimeModelElement.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _GANSSTimeModelElement_H_ -#define _GANSSTimeModelElement_H_ +#ifndef _GANSSTimeModelElement_H_ +#define _GANSSTimeModelElement_H_ #include @@ -18,28 +18,30 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* GANSSTimeModelElement */ -typedef struct GANSSTimeModelElement { - long ganssTimeModelRefTime; - TA0_t tA0; - TA1_t *tA1 /* OPTIONAL */; - TA2_t *tA2 /* OPTIONAL */; - long gnssTOID; - long *weekNumber /* OPTIONAL */; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} GANSSTimeModelElement_t; + /* GANSSTimeModelElement */ + typedef struct GANSSTimeModelElement + { + long ganssTimeModelRefTime; + TA0_t tA0; + TA1_t *tA1 /* OPTIONAL */; + TA2_t *tA2 /* OPTIONAL */; + long gnssTOID; + long *weekNumber /* OPTIONAL */; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_GANSSTimeModelElement; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } GANSSTimeModelElement_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_GANSSTimeModelElement; #ifdef __cplusplus } #endif -#endif /* _GANSSTimeModelElement_H_ */ +#endif /* _GANSSTimeModelElement_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/GANSSUTCModel.h b/src/core/libs/supl/asn-rrlp/GANSSUTCModel.h index 9afaf9886..4f0c74735 100644 --- a/src/core/libs/supl/asn-rrlp/GANSSUTCModel.h +++ b/src/core/libs/supl/asn-rrlp/GANSSUTCModel.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _GANSSUTCModel_H_ -#define _GANSSUTCModel_H_ +#ifndef _GANSSUTCModel_H_ +#define _GANSSUTCModel_H_ #include @@ -15,30 +15,32 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* GANSSUTCModel */ -typedef struct GANSSUTCModel { - long ganssUtcA1; - long ganssUtcA0; - long ganssUtcTot; - long ganssUtcWNt; - long ganssUtcDeltaTls; - long ganssUtcWNlsf; - long ganssUtcDN; - long ganssUtcDeltaTlsf; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} GANSSUTCModel_t; + /* GANSSUTCModel */ + typedef struct GANSSUTCModel + { + long ganssUtcA1; + long ganssUtcA0; + long ganssUtcTot; + long ganssUtcWNt; + long ganssUtcDeltaTls; + long ganssUtcWNlsf; + long ganssUtcDN; + long ganssUtcDeltaTlsf; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_GANSSUTCModel; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } GANSSUTCModel_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_GANSSUTCModel; #ifdef __cplusplus } #endif -#endif /* _GANSSUTCModel_H_ */ +#endif /* _GANSSUTCModel_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/GPS-AssistData.h b/src/core/libs/supl/asn-rrlp/GPS-AssistData.h index 94c27b961..0eb180068 100644 --- a/src/core/libs/supl/asn-rrlp/GPS-AssistData.h +++ b/src/core/libs/supl/asn-rrlp/GPS-AssistData.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _GPS_AssistData_H_ -#define _GPS_AssistData_H_ +#ifndef _GPS_AssistData_H_ +#define _GPS_AssistData_H_ #include @@ -15,23 +15,25 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* GPS-AssistData */ -typedef struct GPS_AssistData { - ControlHeader_t controlHeader; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} GPS_AssistData_t; + /* GPS-AssistData */ + typedef struct GPS_AssistData + { + ControlHeader_t controlHeader; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_GPS_AssistData; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } GPS_AssistData_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_GPS_AssistData; #ifdef __cplusplus } #endif -#endif /* _GPS_AssistData_H_ */ +#endif /* _GPS_AssistData_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/GPS-MeasureInfo.h b/src/core/libs/supl/asn-rrlp/GPS-MeasureInfo.h index 477bb68da..94049297c 100644 --- a/src/core/libs/supl/asn-rrlp/GPS-MeasureInfo.h +++ b/src/core/libs/supl/asn-rrlp/GPS-MeasureInfo.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _GPS_MeasureInfo_H_ -#define _GPS_MeasureInfo_H_ +#ifndef _GPS_MeasureInfo_H_ +#define _GPS_MeasureInfo_H_ #include @@ -15,23 +15,25 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* GPS-MeasureInfo */ -typedef struct GPS_MeasureInfo { - SeqOfGPS_MsrSetElement_t gpsMsrSetList; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} GPS_MeasureInfo_t; + /* GPS-MeasureInfo */ + typedef struct GPS_MeasureInfo + { + SeqOfGPS_MsrSetElement_t gpsMsrSetList; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_GPS_MeasureInfo; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } GPS_MeasureInfo_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_GPS_MeasureInfo; #ifdef __cplusplus } #endif -#endif /* _GPS_MeasureInfo_H_ */ +#endif /* _GPS_MeasureInfo_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/GPS-MsrElement.h b/src/core/libs/supl/asn-rrlp/GPS-MsrElement.h index 8c7943be3..20fc55f7b 100644 --- a/src/core/libs/supl/asn-rrlp/GPS-MsrElement.h +++ b/src/core/libs/supl/asn-rrlp/GPS-MsrElement.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _GPS_MsrElement_H_ -#define _GPS_MsrElement_H_ +#ifndef _GPS_MsrElement_H_ +#define _GPS_MsrElement_H_ #include @@ -17,29 +17,31 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* GPS-MsrElement */ -typedef struct GPS_MsrElement { - SatelliteID_t satelliteID; - long cNo; - long doppler; - long wholeChips; - long fracChips; - MpathIndic_t mpathIndic; - long pseuRangeRMSErr; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} GPS_MsrElement_t; + /* GPS-MsrElement */ + typedef struct GPS_MsrElement + { + SatelliteID_t satelliteID; + long cNo; + long doppler; + long wholeChips; + long fracChips; + MpathIndic_t mpathIndic; + long pseuRangeRMSErr; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_GPS_MsrElement; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } GPS_MsrElement_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_GPS_MsrElement; #ifdef __cplusplus } #endif -#endif /* _GPS_MsrElement_H_ */ +#endif /* _GPS_MsrElement_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/GPS-MsrSetElement.h b/src/core/libs/supl/asn-rrlp/GPS-MsrSetElement.h index bcb0c7d88..9f73ac026 100644 --- a/src/core/libs/supl/asn-rrlp/GPS-MsrSetElement.h +++ b/src/core/libs/supl/asn-rrlp/GPS-MsrSetElement.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _GPS_MsrSetElement_H_ -#define _GPS_MsrSetElement_H_ +#ifndef _GPS_MsrSetElement_H_ +#define _GPS_MsrSetElement_H_ #include @@ -17,25 +17,27 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* GPS-MsrSetElement */ -typedef struct GPS_MsrSetElement { - long *refFrame /* OPTIONAL */; - GPSTOW24b_t gpsTOW; - SeqOfGPS_MsrElement_t gps_msrList; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} GPS_MsrSetElement_t; + /* GPS-MsrSetElement */ + typedef struct GPS_MsrSetElement + { + long *refFrame /* OPTIONAL */; + GPSTOW24b_t gpsTOW; + SeqOfGPS_MsrElement_t gps_msrList; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_GPS_MsrSetElement; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } GPS_MsrSetElement_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_GPS_MsrSetElement; #ifdef __cplusplus } #endif -#endif /* _GPS_MsrSetElement_H_ */ +#endif /* _GPS_MsrSetElement_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/GPSAssistanceData.h b/src/core/libs/supl/asn-rrlp/GPSAssistanceData.h index 55a4ffb25..4716111b7 100644 --- a/src/core/libs/supl/asn-rrlp/GPSAssistanceData.h +++ b/src/core/libs/supl/asn-rrlp/GPSAssistanceData.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _GPSAssistanceData_H_ -#define _GPSAssistanceData_H_ +#ifndef _GPSAssistanceData_H_ +#define _GPSAssistanceData_H_ #include @@ -14,27 +14,28 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* GPSAssistanceData */ -typedef OCTET_STRING_t GPSAssistanceData_t; + /* GPSAssistanceData */ + typedef OCTET_STRING_t GPSAssistanceData_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_GPSAssistanceData; -asn_struct_free_f GPSAssistanceData_free; -asn_struct_print_f GPSAssistanceData_print; -asn_constr_check_f GPSAssistanceData_constraint; -ber_type_decoder_f GPSAssistanceData_decode_ber; -der_type_encoder_f GPSAssistanceData_encode_der; -xer_type_decoder_f GPSAssistanceData_decode_xer; -xer_type_encoder_f GPSAssistanceData_encode_xer; -per_type_decoder_f GPSAssistanceData_decode_uper; -per_type_encoder_f GPSAssistanceData_encode_uper; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_GPSAssistanceData; + asn_struct_free_f GPSAssistanceData_free; + asn_struct_print_f GPSAssistanceData_print; + asn_constr_check_f GPSAssistanceData_constraint; + ber_type_decoder_f GPSAssistanceData_decode_ber; + der_type_encoder_f GPSAssistanceData_encode_der; + xer_type_decoder_f GPSAssistanceData_decode_xer; + xer_type_encoder_f GPSAssistanceData_encode_xer; + per_type_decoder_f GPSAssistanceData_decode_uper; + per_type_encoder_f GPSAssistanceData_encode_uper; #ifdef __cplusplus } #endif -#endif /* _GPSAssistanceData_H_ */ +#endif /* _GPSAssistanceData_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/GPSReferenceTimeUncertainty.h b/src/core/libs/supl/asn-rrlp/GPSReferenceTimeUncertainty.h index 7be8ebb31..2fe9b91af 100644 --- a/src/core/libs/supl/asn-rrlp/GPSReferenceTimeUncertainty.h +++ b/src/core/libs/supl/asn-rrlp/GPSReferenceTimeUncertainty.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _GPSReferenceTimeUncertainty_H_ -#define _GPSReferenceTimeUncertainty_H_ +#ifndef _GPSReferenceTimeUncertainty_H_ +#define _GPSReferenceTimeUncertainty_H_ #include @@ -14,27 +14,28 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* GPSReferenceTimeUncertainty */ -typedef long GPSReferenceTimeUncertainty_t; + /* GPSReferenceTimeUncertainty */ + typedef long GPSReferenceTimeUncertainty_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_GPSReferenceTimeUncertainty; -asn_struct_free_f GPSReferenceTimeUncertainty_free; -asn_struct_print_f GPSReferenceTimeUncertainty_print; -asn_constr_check_f GPSReferenceTimeUncertainty_constraint; -ber_type_decoder_f GPSReferenceTimeUncertainty_decode_ber; -der_type_encoder_f GPSReferenceTimeUncertainty_encode_der; -xer_type_decoder_f GPSReferenceTimeUncertainty_decode_xer; -xer_type_encoder_f GPSReferenceTimeUncertainty_encode_xer; -per_type_decoder_f GPSReferenceTimeUncertainty_decode_uper; -per_type_encoder_f GPSReferenceTimeUncertainty_encode_uper; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_GPSReferenceTimeUncertainty; + asn_struct_free_f GPSReferenceTimeUncertainty_free; + asn_struct_print_f GPSReferenceTimeUncertainty_print; + asn_constr_check_f GPSReferenceTimeUncertainty_constraint; + ber_type_decoder_f GPSReferenceTimeUncertainty_decode_ber; + der_type_encoder_f GPSReferenceTimeUncertainty_encode_der; + xer_type_decoder_f GPSReferenceTimeUncertainty_decode_xer; + xer_type_encoder_f GPSReferenceTimeUncertainty_encode_xer; + per_type_decoder_f GPSReferenceTimeUncertainty_decode_uper; + per_type_encoder_f GPSReferenceTimeUncertainty_encode_uper; #ifdef __cplusplus } #endif -#endif /* _GPSReferenceTimeUncertainty_H_ */ +#endif /* _GPSReferenceTimeUncertainty_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/GPSTOW23b.h b/src/core/libs/supl/asn-rrlp/GPSTOW23b.h index 49f34a714..f280e9419 100644 --- a/src/core/libs/supl/asn-rrlp/GPSTOW23b.h +++ b/src/core/libs/supl/asn-rrlp/GPSTOW23b.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _GPSTOW23b_H_ -#define _GPSTOW23b_H_ +#ifndef _GPSTOW23b_H_ +#define _GPSTOW23b_H_ #include @@ -14,27 +14,28 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* GPSTOW23b */ -typedef long GPSTOW23b_t; + /* GPSTOW23b */ + typedef long GPSTOW23b_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_GPSTOW23b; -asn_struct_free_f GPSTOW23b_free; -asn_struct_print_f GPSTOW23b_print; -asn_constr_check_f GPSTOW23b_constraint; -ber_type_decoder_f GPSTOW23b_decode_ber; -der_type_encoder_f GPSTOW23b_encode_der; -xer_type_decoder_f GPSTOW23b_decode_xer; -xer_type_encoder_f GPSTOW23b_encode_xer; -per_type_decoder_f GPSTOW23b_decode_uper; -per_type_encoder_f GPSTOW23b_encode_uper; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_GPSTOW23b; + asn_struct_free_f GPSTOW23b_free; + asn_struct_print_f GPSTOW23b_print; + asn_constr_check_f GPSTOW23b_constraint; + ber_type_decoder_f GPSTOW23b_decode_ber; + der_type_encoder_f GPSTOW23b_encode_der; + xer_type_decoder_f GPSTOW23b_decode_xer; + xer_type_encoder_f GPSTOW23b_encode_xer; + per_type_decoder_f GPSTOW23b_decode_uper; + per_type_encoder_f GPSTOW23b_encode_uper; #ifdef __cplusplus } #endif -#endif /* _GPSTOW23b_H_ */ +#endif /* _GPSTOW23b_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/GPSTOW24b.h b/src/core/libs/supl/asn-rrlp/GPSTOW24b.h index 42ee6847f..a2e7831fd 100644 --- a/src/core/libs/supl/asn-rrlp/GPSTOW24b.h +++ b/src/core/libs/supl/asn-rrlp/GPSTOW24b.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _GPSTOW24b_H_ -#define _GPSTOW24b_H_ +#ifndef _GPSTOW24b_H_ +#define _GPSTOW24b_H_ #include @@ -14,27 +14,28 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* GPSTOW24b */ -typedef long GPSTOW24b_t; + /* GPSTOW24b */ + typedef long GPSTOW24b_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_GPSTOW24b; -asn_struct_free_f GPSTOW24b_free; -asn_struct_print_f GPSTOW24b_print; -asn_constr_check_f GPSTOW24b_constraint; -ber_type_decoder_f GPSTOW24b_decode_ber; -der_type_encoder_f GPSTOW24b_encode_der; -xer_type_decoder_f GPSTOW24b_decode_xer; -xer_type_encoder_f GPSTOW24b_encode_xer; -per_type_decoder_f GPSTOW24b_decode_uper; -per_type_encoder_f GPSTOW24b_encode_uper; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_GPSTOW24b; + asn_struct_free_f GPSTOW24b_free; + asn_struct_print_f GPSTOW24b_print; + asn_constr_check_f GPSTOW24b_constraint; + ber_type_decoder_f GPSTOW24b_decode_ber; + der_type_encoder_f GPSTOW24b_encode_der; + xer_type_decoder_f GPSTOW24b_decode_xer; + xer_type_encoder_f GPSTOW24b_encode_xer; + per_type_decoder_f GPSTOW24b_decode_uper; + per_type_encoder_f GPSTOW24b_encode_uper; #ifdef __cplusplus } #endif -#endif /* _GPSTOW24b_H_ */ +#endif /* _GPSTOW24b_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/GPSTOWAssist.h b/src/core/libs/supl/asn-rrlp/GPSTOWAssist.h index 837e8f635..e7ea606d2 100644 --- a/src/core/libs/supl/asn-rrlp/GPSTOWAssist.h +++ b/src/core/libs/supl/asn-rrlp/GPSTOWAssist.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _GPSTOWAssist_H_ -#define _GPSTOWAssist_H_ +#ifndef _GPSTOWAssist_H_ +#define _GPSTOWAssist_H_ #include @@ -15,22 +15,25 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Forward declarations */ -struct GPSTOWAssistElement; + /* Forward declarations */ + struct GPSTOWAssistElement; -/* GPSTOWAssist */ -typedef struct GPSTOWAssist { - A_SEQUENCE_OF(struct GPSTOWAssistElement) list; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} GPSTOWAssist_t; + /* GPSTOWAssist */ + typedef struct GPSTOWAssist + { + A_SEQUENCE_OF(struct GPSTOWAssistElement) + list; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_GPSTOWAssist; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } GPSTOWAssist_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_GPSTOWAssist; #ifdef __cplusplus } @@ -39,5 +42,5 @@ extern asn_TYPE_descriptor_t asn_DEF_GPSTOWAssist; /* Referred external types */ #include "GPSTOWAssistElement.h" -#endif /* _GPSTOWAssist_H_ */ +#endif /* _GPSTOWAssist_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/GPSTOWAssistElement.h b/src/core/libs/supl/asn-rrlp/GPSTOWAssistElement.h index a3a2f8199..939b7b3e5 100644 --- a/src/core/libs/supl/asn-rrlp/GPSTOWAssistElement.h +++ b/src/core/libs/supl/asn-rrlp/GPSTOWAssistElement.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _GPSTOWAssistElement_H_ -#define _GPSTOWAssistElement_H_ +#ifndef _GPSTOWAssistElement_H_ +#define _GPSTOWAssistElement_H_ #include @@ -19,27 +19,29 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* GPSTOWAssistElement */ -typedef struct GPSTOWAssistElement { - SatelliteID_t satelliteID; - TLMWord_t tlmWord; - AntiSpoofFlag_t antiSpoof; - AlertFlag_t alert; - TLMReservedBits_t tlmRsvdBits; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} GPSTOWAssistElement_t; + /* GPSTOWAssistElement */ + typedef struct GPSTOWAssistElement + { + SatelliteID_t satelliteID; + TLMWord_t tlmWord; + AntiSpoofFlag_t antiSpoof; + AlertFlag_t alert; + TLMReservedBits_t tlmRsvdBits; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_GPSTOWAssistElement; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } GPSTOWAssistElement_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_GPSTOWAssistElement; #ifdef __cplusplus } #endif -#endif /* _GPSTOWAssistElement_H_ */ +#endif /* _GPSTOWAssistElement_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/GPSTime.h b/src/core/libs/supl/asn-rrlp/GPSTime.h index bb6a03667..b25b5af57 100644 --- a/src/core/libs/supl/asn-rrlp/GPSTime.h +++ b/src/core/libs/supl/asn-rrlp/GPSTime.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _GPSTime_H_ -#define _GPSTime_H_ +#ifndef _GPSTime_H_ +#define _GPSTime_H_ #include @@ -16,24 +16,26 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* GPSTime */ -typedef struct GPSTime { - GPSTOW23b_t gpsTOW23b; - GPSWeek_t gpsWeek; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} GPSTime_t; + /* GPSTime */ + typedef struct GPSTime + { + GPSTOW23b_t gpsTOW23b; + GPSWeek_t gpsWeek; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_GPSTime; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } GPSTime_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_GPSTime; #ifdef __cplusplus } #endif -#endif /* _GPSTime_H_ */ +#endif /* _GPSTime_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/GPSTimeAssistanceMeasurements.h b/src/core/libs/supl/asn-rrlp/GPSTimeAssistanceMeasurements.h index 1f30ed0e5..8bc8dfce0 100644 --- a/src/core/libs/supl/asn-rrlp/GPSTimeAssistanceMeasurements.h +++ b/src/core/libs/supl/asn-rrlp/GPSTimeAssistanceMeasurements.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _GPSTimeAssistanceMeasurements_H_ -#define _GPSTimeAssistanceMeasurements_H_ +#ifndef _GPSTimeAssistanceMeasurements_H_ +#define _GPSTimeAssistanceMeasurements_H_ #include @@ -16,26 +16,28 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* GPSTimeAssistanceMeasurements */ -typedef struct GPSTimeAssistanceMeasurements { - long referenceFrameMSB; - long *gpsTowSubms /* OPTIONAL */; - long *deltaTow /* OPTIONAL */; - GPSReferenceTimeUncertainty_t *gpsReferenceTimeUncertainty /* OPTIONAL */; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} GPSTimeAssistanceMeasurements_t; + /* GPSTimeAssistanceMeasurements */ + typedef struct GPSTimeAssistanceMeasurements + { + long referenceFrameMSB; + long *gpsTowSubms /* OPTIONAL */; + long *deltaTow /* OPTIONAL */; + GPSReferenceTimeUncertainty_t *gpsReferenceTimeUncertainty /* OPTIONAL */; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_GPSTimeAssistanceMeasurements; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } GPSTimeAssistanceMeasurements_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_GPSTimeAssistanceMeasurements; #ifdef __cplusplus } #endif -#endif /* _GPSTimeAssistanceMeasurements_H_ */ +#endif /* _GPSTimeAssistanceMeasurements_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/GPSWeek.h b/src/core/libs/supl/asn-rrlp/GPSWeek.h index 6bdbc01bf..bcfe49b70 100644 --- a/src/core/libs/supl/asn-rrlp/GPSWeek.h +++ b/src/core/libs/supl/asn-rrlp/GPSWeek.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _GPSWeek_H_ -#define _GPSWeek_H_ +#ifndef _GPSWeek_H_ +#define _GPSWeek_H_ #include @@ -14,27 +14,28 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* GPSWeek */ -typedef long GPSWeek_t; + /* GPSWeek */ + typedef long GPSWeek_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_GPSWeek; -asn_struct_free_f GPSWeek_free; -asn_struct_print_f GPSWeek_print; -asn_constr_check_f GPSWeek_constraint; -ber_type_decoder_f GPSWeek_decode_ber; -der_type_encoder_f GPSWeek_encode_der; -xer_type_decoder_f GPSWeek_decode_xer; -xer_type_encoder_f GPSWeek_encode_xer; -per_type_decoder_f GPSWeek_decode_uper; -per_type_encoder_f GPSWeek_encode_uper; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_GPSWeek; + asn_struct_free_f GPSWeek_free; + asn_struct_print_f GPSWeek_print; + asn_constr_check_f GPSWeek_constraint; + ber_type_decoder_f GPSWeek_decode_ber; + der_type_encoder_f GPSWeek_encode_der; + xer_type_decoder_f GPSWeek_decode_xer; + xer_type_encoder_f GPSWeek_encode_xer; + per_type_decoder_f GPSWeek_decode_uper; + per_type_encoder_f GPSWeek_encode_uper; #ifdef __cplusplus } #endif -#endif /* _GPSWeek_H_ */ +#endif /* _GPSWeek_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/GSMTime.h b/src/core/libs/supl/asn-rrlp/GSMTime.h index ea4fd2568..9f360bb13 100644 --- a/src/core/libs/supl/asn-rrlp/GSMTime.h +++ b/src/core/libs/supl/asn-rrlp/GSMTime.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _GSMTime_H_ -#define _GSMTime_H_ +#ifndef _GSMTime_H_ +#define _GSMTime_H_ #include @@ -19,27 +19,29 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* GSMTime */ -typedef struct GSMTime { - BCCHCarrier_t bcchCarrier; - BSIC_t bsic; - FrameNumber_t frameNumber; - TimeSlot_t timeSlot; - BitNumber_t bitNumber; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} GSMTime_t; + /* GSMTime */ + typedef struct GSMTime + { + BCCHCarrier_t bcchCarrier; + BSIC_t bsic; + FrameNumber_t frameNumber; + TimeSlot_t timeSlot; + BitNumber_t bitNumber; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_GSMTime; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } GSMTime_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_GSMTime; #ifdef __cplusplus } #endif -#endif /* _GSMTime_H_ */ +#endif /* _GSMTime_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/INTEGER.h b/src/core/libs/supl/asn-rrlp/INTEGER.h index 8411bfcdd..2acd13ab9 100644 --- a/src/core/libs/supl/asn-rrlp/INTEGER.h +++ b/src/core/libs/supl/asn-rrlp/INTEGER.h @@ -2,68 +2,71 @@ * Copyright (c) 2003, 2005 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ -#ifndef _INTEGER_H_ -#define _INTEGER_H_ +#ifndef _INTEGER_H_ +#define _INTEGER_H_ #include #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -typedef ASN__PRIMITIVE_TYPE_t INTEGER_t; + typedef ASN__PRIMITIVE_TYPE_t INTEGER_t; -extern asn_TYPE_descriptor_t asn_DEF_INTEGER; + extern asn_TYPE_descriptor_t asn_DEF_INTEGER; -/* Map with to integer value association */ -typedef struct asn_INTEGER_enum_map_s { - long nat_value; /* associated native integer value */ - size_t enum_len; /* strlen("tag") */ - const char *enum_name; /* "tag" */ -} asn_INTEGER_enum_map_t; + /* Map with to integer value association */ + typedef struct asn_INTEGER_enum_map_s + { + long nat_value; /* associated native integer value */ + size_t enum_len; /* strlen("tag") */ + const char *enum_name; /* "tag" */ + } asn_INTEGER_enum_map_t; -/* This type describes an enumeration for INTEGER and ENUMERATED types */ -typedef struct asn_INTEGER_specifics_s { - asn_INTEGER_enum_map_t *value2enum; /* N -> "tag"; sorted by N */ - unsigned int *enum2value; /* "tag" => N; sorted by tag */ - int map_count; /* Elements in either map */ - int extension; /* This map is extensible */ - int strict_enumeration; /* Enumeration set is fixed */ - int field_width; /* Size of native integer */ - int field_unsigned; /* Signed=0, unsigned=1 */ -} asn_INTEGER_specifics_t; + /* This type describes an enumeration for INTEGER and ENUMERATED types */ + typedef struct asn_INTEGER_specifics_s + { + asn_INTEGER_enum_map_t *value2enum; /* N -> "tag"; sorted by N */ + unsigned int *enum2value; /* "tag" => N; sorted by tag */ + int map_count; /* Elements in either map */ + int extension; /* This map is extensible */ + int strict_enumeration; /* Enumeration set is fixed */ + int field_width; /* Size of native integer */ + int field_unsigned; /* Signed=0, unsigned=1 */ + } asn_INTEGER_specifics_t; -asn_struct_print_f INTEGER_print; -ber_type_decoder_f INTEGER_decode_ber; -der_type_encoder_f INTEGER_encode_der; -xer_type_decoder_f INTEGER_decode_xer; -xer_type_encoder_f INTEGER_encode_xer; -per_type_decoder_f INTEGER_decode_uper; -per_type_encoder_f INTEGER_encode_uper; + asn_struct_print_f INTEGER_print; + ber_type_decoder_f INTEGER_decode_ber; + der_type_encoder_f INTEGER_encode_der; + xer_type_decoder_f INTEGER_decode_xer; + xer_type_encoder_f INTEGER_encode_xer; + per_type_decoder_f INTEGER_decode_uper; + per_type_encoder_f INTEGER_encode_uper; -/*********************************** + /*********************************** * Some handy conversion routines. * ***********************************/ -/* + /* * Returns 0 if it was possible to convert, -1 otherwise. * -1/EINVAL: Mandatory argument missing * -1/ERANGE: Value encoded is out of range for long representation * -1/ENOMEM: Memory allocation failed (in asn_long2INTEGER()). */ -int asn_INTEGER2long(const INTEGER_t *i, long *l); -int asn_INTEGER2ulong(const INTEGER_t *i, unsigned long *l); -int asn_long2INTEGER(INTEGER_t *i, long l); -int asn_ulong2INTEGER(INTEGER_t *i, unsigned long l); + int asn_INTEGER2long(const INTEGER_t *i, long *l); + int asn_INTEGER2ulong(const INTEGER_t *i, unsigned long *l); + int asn_long2INTEGER(INTEGER_t *i, long l); + int asn_ulong2INTEGER(INTEGER_t *i, unsigned long l); -/* + /* * Convert the integer value into the corresponding enumeration map entry. */ -const asn_INTEGER_enum_map_t *INTEGER_map_value2enum(asn_INTEGER_specifics_t *specs, long value); + const asn_INTEGER_enum_map_t *INTEGER_map_value2enum(asn_INTEGER_specifics_t *specs, long value); #ifdef __cplusplus } #endif -#endif /* _INTEGER_H_ */ +#endif /* _INTEGER_H_ */ diff --git a/src/core/libs/supl/asn-rrlp/IonosphericModel.h b/src/core/libs/supl/asn-rrlp/IonosphericModel.h index bb5f38987..1174aeef8 100644 --- a/src/core/libs/supl/asn-rrlp/IonosphericModel.h +++ b/src/core/libs/supl/asn-rrlp/IonosphericModel.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _IonosphericModel_H_ -#define _IonosphericModel_H_ +#ifndef _IonosphericModel_H_ +#define _IonosphericModel_H_ #include @@ -15,30 +15,32 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* IonosphericModel */ -typedef struct IonosphericModel { - long alfa0; - long alfa1; - long alfa2; - long alfa3; - long beta0; - long beta1; - long beta2; - long beta3; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} IonosphericModel_t; + /* IonosphericModel */ + typedef struct IonosphericModel + { + long alfa0; + long alfa1; + long alfa2; + long alfa3; + long beta0; + long beta1; + long beta2; + long beta3; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_IonosphericModel; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } IonosphericModel_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_IonosphericModel; #ifdef __cplusplus } #endif -#endif /* _IonosphericModel_H_ */ +#endif /* _IonosphericModel_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/LAC.h b/src/core/libs/supl/asn-rrlp/LAC.h index b600e36d4..69ccdb662 100644 --- a/src/core/libs/supl/asn-rrlp/LAC.h +++ b/src/core/libs/supl/asn-rrlp/LAC.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _LAC_H_ -#define _LAC_H_ +#ifndef _LAC_H_ +#define _LAC_H_ #include @@ -14,27 +14,28 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* LAC */ -typedef long LAC_t; + /* LAC */ + typedef long LAC_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_LAC; -asn_struct_free_f LAC_free; -asn_struct_print_f LAC_print; -asn_constr_check_f LAC_constraint; -ber_type_decoder_f LAC_decode_ber; -der_type_encoder_f LAC_encode_der; -xer_type_decoder_f LAC_decode_xer; -xer_type_encoder_f LAC_encode_xer; -per_type_decoder_f LAC_decode_uper; -per_type_encoder_f LAC_encode_uper; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_LAC; + asn_struct_free_f LAC_free; + asn_struct_print_f LAC_print; + asn_constr_check_f LAC_constraint; + ber_type_decoder_f LAC_decode_ber; + der_type_encoder_f LAC_encode_der; + xer_type_decoder_f LAC_decode_xer; + xer_type_encoder_f LAC_encode_xer; + per_type_decoder_f LAC_decode_uper; + per_type_encoder_f LAC_encode_uper; #ifdef __cplusplus } #endif -#endif /* _LAC_H_ */ +#endif /* _LAC_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/LocErrorReason.h b/src/core/libs/supl/asn-rrlp/LocErrorReason.h index 0dfcf0b80..e8d074804 100644 --- a/src/core/libs/supl/asn-rrlp/LocErrorReason.h +++ b/src/core/libs/supl/asn-rrlp/LocErrorReason.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _LocErrorReason_H_ -#define _LocErrorReason_H_ +#ifndef _LocErrorReason_H_ +#define _LocErrorReason_H_ #include @@ -14,48 +14,50 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Dependencies */ -typedef enum LocErrorReason { - LocErrorReason_unDefined = 0, - LocErrorReason_notEnoughBTSs = 1, - LocErrorReason_notEnoughSats = 2, - LocErrorReason_eotdLocCalAssDataMissing = 3, - LocErrorReason_eotdAssDataMissing = 4, - LocErrorReason_gpsLocCalAssDataMissing = 5, - LocErrorReason_gpsAssDataMissing = 6, - LocErrorReason_methodNotSupported = 7, - LocErrorReason_notProcessed = 8, - LocErrorReason_refBTSForGPSNotServingBTS = 9, - LocErrorReason_refBTSForEOTDNotServingBTS = 10, - /* + /* Dependencies */ + typedef enum LocErrorReason + { + LocErrorReason_unDefined = 0, + LocErrorReason_notEnoughBTSs = 1, + LocErrorReason_notEnoughSats = 2, + LocErrorReason_eotdLocCalAssDataMissing = 3, + LocErrorReason_eotdAssDataMissing = 4, + LocErrorReason_gpsLocCalAssDataMissing = 5, + LocErrorReason_gpsAssDataMissing = 6, + LocErrorReason_methodNotSupported = 7, + LocErrorReason_notProcessed = 8, + LocErrorReason_refBTSForGPSNotServingBTS = 9, + LocErrorReason_refBTSForEOTDNotServingBTS = 10, + /* * Enumeration is extensible */ - LocErrorReason_notEnoughGANSSSats = 11, - LocErrorReason_ganssAssDataMissing = 12, - LocErrorReason_refBTSForGANSSNotServingBTS = 13 -} e_LocErrorReason; + LocErrorReason_notEnoughGANSSSats = 11, + LocErrorReason_ganssAssDataMissing = 12, + LocErrorReason_refBTSForGANSSNotServingBTS = 13 + } e_LocErrorReason; -/* LocErrorReason */ -typedef ENUMERATED_t LocErrorReason_t; + /* LocErrorReason */ + typedef ENUMERATED_t LocErrorReason_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_LocErrorReason; -asn_struct_free_f LocErrorReason_free; -asn_struct_print_f LocErrorReason_print; -asn_constr_check_f LocErrorReason_constraint; -ber_type_decoder_f LocErrorReason_decode_ber; -der_type_encoder_f LocErrorReason_encode_der; -xer_type_decoder_f LocErrorReason_decode_xer; -xer_type_encoder_f LocErrorReason_encode_xer; -per_type_decoder_f LocErrorReason_decode_uper; -per_type_encoder_f LocErrorReason_encode_uper; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_LocErrorReason; + asn_struct_free_f LocErrorReason_free; + asn_struct_print_f LocErrorReason_print; + asn_constr_check_f LocErrorReason_constraint; + ber_type_decoder_f LocErrorReason_decode_ber; + der_type_encoder_f LocErrorReason_encode_der; + xer_type_decoder_f LocErrorReason_decode_xer; + xer_type_encoder_f LocErrorReason_encode_xer; + per_type_decoder_f LocErrorReason_decode_uper; + per_type_encoder_f LocErrorReason_encode_uper; #ifdef __cplusplus } #endif -#endif /* _LocErrorReason_H_ */ +#endif /* _LocErrorReason_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/LocationError.h b/src/core/libs/supl/asn-rrlp/LocationError.h index 2786f4b7a..1ab241eba 100644 --- a/src/core/libs/supl/asn-rrlp/LocationError.h +++ b/src/core/libs/supl/asn-rrlp/LocationError.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _LocationError_H_ -#define _LocationError_H_ +#ifndef _LocationError_H_ +#define _LocationError_H_ #include @@ -15,27 +15,29 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Forward declarations */ -struct AdditionalAssistanceData; + /* Forward declarations */ + struct AdditionalAssistanceData; -/* LocationError */ -typedef struct LocationError { - LocErrorReason_t locErrorReason; - struct AdditionalAssistanceData *additionalAssistanceData /* OPTIONAL */; - /* + /* LocationError */ + typedef struct LocationError + { + LocErrorReason_t locErrorReason; + struct AdditionalAssistanceData *additionalAssistanceData /* OPTIONAL */; + /* * This type is extensible, * possible extensions are below. */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} LocationError_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_LocationError; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } LocationError_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_LocationError; #ifdef __cplusplus } @@ -44,5 +46,5 @@ extern asn_TYPE_descriptor_t asn_DEF_LocationError; /* Referred external types */ #include "AdditionalAssistanceData.h" -#endif /* _LocationError_H_ */ +#endif /* _LocationError_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/LocationInfo.h b/src/core/libs/supl/asn-rrlp/LocationInfo.h index 4dd96a3fa..d31af60d5 100644 --- a/src/core/libs/supl/asn-rrlp/LocationInfo.h +++ b/src/core/libs/supl/asn-rrlp/LocationInfo.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _LocationInfo_H_ -#define _LocationInfo_H_ +#ifndef _LocationInfo_H_ +#define _LocationInfo_H_ #include @@ -17,26 +17,28 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* LocationInfo */ -typedef struct LocationInfo { - long refFrame; - long *gpsTOW /* OPTIONAL */; - FixType_t fixType; - Ext_GeographicalInformation_t posEstimate; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} LocationInfo_t; + /* LocationInfo */ + typedef struct LocationInfo + { + long refFrame; + long *gpsTOW /* OPTIONAL */; + FixType_t fixType; + Ext_GeographicalInformation_t posEstimate; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_LocationInfo; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } LocationInfo_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_LocationInfo; #ifdef __cplusplus } #endif -#endif /* _LocationInfo_H_ */ +#endif /* _LocationInfo_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/MeasureResponseTime.h b/src/core/libs/supl/asn-rrlp/MeasureResponseTime.h index 4a6fda64b..2607e7ff4 100644 --- a/src/core/libs/supl/asn-rrlp/MeasureResponseTime.h +++ b/src/core/libs/supl/asn-rrlp/MeasureResponseTime.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _MeasureResponseTime_H_ -#define _MeasureResponseTime_H_ +#ifndef _MeasureResponseTime_H_ +#define _MeasureResponseTime_H_ #include @@ -14,27 +14,28 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* MeasureResponseTime */ -typedef long MeasureResponseTime_t; + /* MeasureResponseTime */ + typedef long MeasureResponseTime_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_MeasureResponseTime; -asn_struct_free_f MeasureResponseTime_free; -asn_struct_print_f MeasureResponseTime_print; -asn_constr_check_f MeasureResponseTime_constraint; -ber_type_decoder_f MeasureResponseTime_decode_ber; -der_type_encoder_f MeasureResponseTime_encode_der; -xer_type_decoder_f MeasureResponseTime_decode_xer; -xer_type_encoder_f MeasureResponseTime_encode_xer; -per_type_decoder_f MeasureResponseTime_decode_uper; -per_type_encoder_f MeasureResponseTime_encode_uper; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_MeasureResponseTime; + asn_struct_free_f MeasureResponseTime_free; + asn_struct_print_f MeasureResponseTime_print; + asn_constr_check_f MeasureResponseTime_constraint; + ber_type_decoder_f MeasureResponseTime_decode_ber; + der_type_encoder_f MeasureResponseTime_encode_der; + xer_type_decoder_f MeasureResponseTime_decode_xer; + xer_type_encoder_f MeasureResponseTime_encode_xer; + per_type_decoder_f MeasureResponseTime_decode_uper; + per_type_encoder_f MeasureResponseTime_encode_uper; #ifdef __cplusplus } #endif -#endif /* _MeasureResponseTime_H_ */ +#endif /* _MeasureResponseTime_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/MethodType.h b/src/core/libs/supl/asn-rrlp/MethodType.h index b9c0b4338..5529e2527 100644 --- a/src/core/libs/supl/asn-rrlp/MethodType.h +++ b/src/core/libs/supl/asn-rrlp/MethodType.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _MethodType_H_ -#define _MethodType_H_ +#ifndef _MethodType_H_ +#define _MethodType_H_ #include @@ -16,38 +16,42 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Dependencies */ -typedef enum MethodType_PR { - MethodType_PR_NOTHING, /* No components present */ - MethodType_PR_msAssisted, - MethodType_PR_msBased, - MethodType_PR_msBasedPref, - MethodType_PR_msAssistedPref -} MethodType_PR; + /* Dependencies */ + typedef enum MethodType_PR + { + MethodType_PR_NOTHING, /* No components present */ + MethodType_PR_msAssisted, + MethodType_PR_msBased, + MethodType_PR_msBasedPref, + MethodType_PR_msAssistedPref + } MethodType_PR; -/* MethodType */ -typedef struct MethodType { - MethodType_PR present; - union MethodType_u { - AccuracyOpt_t msAssisted; - Accuracy_t msBased; - Accuracy_t msBasedPref; - Accuracy_t msAssistedPref; - } choice; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} MethodType_t; + /* MethodType */ + typedef struct MethodType + { + MethodType_PR present; + union MethodType_u + { + AccuracyOpt_t msAssisted; + Accuracy_t msBased; + Accuracy_t msBasedPref; + Accuracy_t msAssistedPref; + } choice; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_MethodType; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } MethodType_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_MethodType; #ifdef __cplusplus } #endif -#endif /* _MethodType_H_ */ +#endif /* _MethodType_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/ModuloTimeSlot.h b/src/core/libs/supl/asn-rrlp/ModuloTimeSlot.h index dc6f487aa..186607231 100644 --- a/src/core/libs/supl/asn-rrlp/ModuloTimeSlot.h +++ b/src/core/libs/supl/asn-rrlp/ModuloTimeSlot.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _ModuloTimeSlot_H_ -#define _ModuloTimeSlot_H_ +#ifndef _ModuloTimeSlot_H_ +#define _ModuloTimeSlot_H_ #include @@ -14,27 +14,28 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* ModuloTimeSlot */ -typedef long ModuloTimeSlot_t; + /* ModuloTimeSlot */ + typedef long ModuloTimeSlot_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_ModuloTimeSlot; -asn_struct_free_f ModuloTimeSlot_free; -asn_struct_print_f ModuloTimeSlot_print; -asn_constr_check_f ModuloTimeSlot_constraint; -ber_type_decoder_f ModuloTimeSlot_decode_ber; -der_type_encoder_f ModuloTimeSlot_encode_der; -xer_type_decoder_f ModuloTimeSlot_decode_xer; -xer_type_encoder_f ModuloTimeSlot_encode_xer; -per_type_decoder_f ModuloTimeSlot_decode_uper; -per_type_encoder_f ModuloTimeSlot_encode_uper; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_ModuloTimeSlot; + asn_struct_free_f ModuloTimeSlot_free; + asn_struct_print_f ModuloTimeSlot_print; + asn_constr_check_f ModuloTimeSlot_constraint; + ber_type_decoder_f ModuloTimeSlot_decode_ber; + der_type_encoder_f ModuloTimeSlot_encode_der; + xer_type_decoder_f ModuloTimeSlot_decode_xer; + xer_type_encoder_f ModuloTimeSlot_encode_xer; + per_type_decoder_f ModuloTimeSlot_decode_uper; + per_type_encoder_f ModuloTimeSlot_encode_uper; #ifdef __cplusplus } #endif -#endif /* _ModuloTimeSlot_H_ */ +#endif /* _ModuloTimeSlot_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/MoreAssDataToBeSent.h b/src/core/libs/supl/asn-rrlp/MoreAssDataToBeSent.h index 3ccac3704..d1ad95faf 100644 --- a/src/core/libs/supl/asn-rrlp/MoreAssDataToBeSent.h +++ b/src/core/libs/supl/asn-rrlp/MoreAssDataToBeSent.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _MoreAssDataToBeSent_H_ -#define _MoreAssDataToBeSent_H_ +#ifndef _MoreAssDataToBeSent_H_ +#define _MoreAssDataToBeSent_H_ #include @@ -14,33 +14,35 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Dependencies */ -typedef enum MoreAssDataToBeSent { - MoreAssDataToBeSent_noMoreMessages = 0, - MoreAssDataToBeSent_moreMessagesOnTheWay = 1 -} e_MoreAssDataToBeSent; + /* Dependencies */ + typedef enum MoreAssDataToBeSent + { + MoreAssDataToBeSent_noMoreMessages = 0, + MoreAssDataToBeSent_moreMessagesOnTheWay = 1 + } e_MoreAssDataToBeSent; -/* MoreAssDataToBeSent */ -typedef ENUMERATED_t MoreAssDataToBeSent_t; + /* MoreAssDataToBeSent */ + typedef ENUMERATED_t MoreAssDataToBeSent_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_MoreAssDataToBeSent; -asn_struct_free_f MoreAssDataToBeSent_free; -asn_struct_print_f MoreAssDataToBeSent_print; -asn_constr_check_f MoreAssDataToBeSent_constraint; -ber_type_decoder_f MoreAssDataToBeSent_decode_ber; -der_type_encoder_f MoreAssDataToBeSent_encode_der; -xer_type_decoder_f MoreAssDataToBeSent_decode_xer; -xer_type_encoder_f MoreAssDataToBeSent_encode_xer; -per_type_decoder_f MoreAssDataToBeSent_decode_uper; -per_type_encoder_f MoreAssDataToBeSent_encode_uper; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_MoreAssDataToBeSent; + asn_struct_free_f MoreAssDataToBeSent_free; + asn_struct_print_f MoreAssDataToBeSent_print; + asn_constr_check_f MoreAssDataToBeSent_constraint; + ber_type_decoder_f MoreAssDataToBeSent_decode_ber; + der_type_encoder_f MoreAssDataToBeSent_encode_der; + xer_type_decoder_f MoreAssDataToBeSent_decode_xer; + xer_type_encoder_f MoreAssDataToBeSent_encode_xer; + per_type_decoder_f MoreAssDataToBeSent_decode_uper; + per_type_encoder_f MoreAssDataToBeSent_encode_uper; #ifdef __cplusplus } #endif -#endif /* _MoreAssDataToBeSent_H_ */ +#endif /* _MoreAssDataToBeSent_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/MpathIndic.h b/src/core/libs/supl/asn-rrlp/MpathIndic.h index d83f3fb8f..89907b6de 100644 --- a/src/core/libs/supl/asn-rrlp/MpathIndic.h +++ b/src/core/libs/supl/asn-rrlp/MpathIndic.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _MpathIndic_H_ -#define _MpathIndic_H_ +#ifndef _MpathIndic_H_ +#define _MpathIndic_H_ #include @@ -14,35 +14,37 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Dependencies */ -typedef enum MpathIndic { - MpathIndic_notMeasured = 0, - MpathIndic_low = 1, - MpathIndic_medium = 2, - MpathIndic_high = 3 -} e_MpathIndic; + /* Dependencies */ + typedef enum MpathIndic + { + MpathIndic_notMeasured = 0, + MpathIndic_low = 1, + MpathIndic_medium = 2, + MpathIndic_high = 3 + } e_MpathIndic; -/* MpathIndic */ -typedef ENUMERATED_t MpathIndic_t; + /* MpathIndic */ + typedef ENUMERATED_t MpathIndic_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_MpathIndic; -asn_struct_free_f MpathIndic_free; -asn_struct_print_f MpathIndic_print; -asn_constr_check_f MpathIndic_constraint; -ber_type_decoder_f MpathIndic_decode_ber; -der_type_encoder_f MpathIndic_encode_der; -xer_type_decoder_f MpathIndic_decode_xer; -xer_type_encoder_f MpathIndic_encode_xer; -per_type_decoder_f MpathIndic_decode_uper; -per_type_encoder_f MpathIndic_encode_uper; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_MpathIndic; + asn_struct_free_f MpathIndic_free; + asn_struct_print_f MpathIndic_print; + asn_constr_check_f MpathIndic_constraint; + ber_type_decoder_f MpathIndic_decode_ber; + der_type_encoder_f MpathIndic_encode_der; + xer_type_decoder_f MpathIndic_decode_xer; + xer_type_encoder_f MpathIndic_encode_xer; + per_type_decoder_f MpathIndic_decode_uper; + per_type_encoder_f MpathIndic_encode_uper; #ifdef __cplusplus } #endif -#endif /* _MpathIndic_H_ */ +#endif /* _MpathIndic_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/MsrAssistBTS-R98-ExpOTD.h b/src/core/libs/supl/asn-rrlp/MsrAssistBTS-R98-ExpOTD.h index a37ca3146..0efafd0bb 100644 --- a/src/core/libs/supl/asn-rrlp/MsrAssistBTS-R98-ExpOTD.h +++ b/src/core/libs/supl/asn-rrlp/MsrAssistBTS-R98-ExpOTD.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _MsrAssistBTS_R98_ExpOTD_H_ -#define _MsrAssistBTS_R98_ExpOTD_H_ +#ifndef _MsrAssistBTS_R98_ExpOTD_H_ +#define _MsrAssistBTS_R98_ExpOTD_H_ #include @@ -16,24 +16,26 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* MsrAssistBTS-R98-ExpOTD */ -typedef struct MsrAssistBTS_R98_ExpOTD { - ExpectedOTD_t expectedOTD; - ExpOTDUncertainty_t expOTDUncertainty; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} MsrAssistBTS_R98_ExpOTD_t; + /* MsrAssistBTS-R98-ExpOTD */ + typedef struct MsrAssistBTS_R98_ExpOTD + { + ExpectedOTD_t expectedOTD; + ExpOTDUncertainty_t expOTDUncertainty; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_MsrAssistBTS_R98_ExpOTD; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } MsrAssistBTS_R98_ExpOTD_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_MsrAssistBTS_R98_ExpOTD; #ifdef __cplusplus } #endif -#endif /* _MsrAssistBTS_R98_ExpOTD_H_ */ +#endif /* _MsrAssistBTS_R98_ExpOTD_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/MsrAssistBTS.h b/src/core/libs/supl/asn-rrlp/MsrAssistBTS.h index a5ec44205..7d2eac4d4 100644 --- a/src/core/libs/supl/asn-rrlp/MsrAssistBTS.h +++ b/src/core/libs/supl/asn-rrlp/MsrAssistBTS.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _MsrAssistBTS_H_ -#define _MsrAssistBTS_H_ +#ifndef _MsrAssistBTS_H_ +#define _MsrAssistBTS_H_ #include @@ -19,27 +19,29 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Forward declarations */ -struct CalcAssistanceBTS; + /* Forward declarations */ + struct CalcAssistanceBTS; -/* MsrAssistBTS */ -typedef struct MsrAssistBTS { - BCCHCarrier_t bcchCarrier; - BSIC_t bsic; - MultiFrameOffset_t multiFrameOffset; - TimeSlotScheme_t timeSlotScheme; - RoughRTD_t roughRTD; - struct CalcAssistanceBTS *calcAssistanceBTS /* OPTIONAL */; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} MsrAssistBTS_t; + /* MsrAssistBTS */ + typedef struct MsrAssistBTS + { + BCCHCarrier_t bcchCarrier; + BSIC_t bsic; + MultiFrameOffset_t multiFrameOffset; + TimeSlotScheme_t timeSlotScheme; + RoughRTD_t roughRTD; + struct CalcAssistanceBTS *calcAssistanceBTS /* OPTIONAL */; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_MsrAssistBTS; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } MsrAssistBTS_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_MsrAssistBTS; #ifdef __cplusplus } @@ -48,5 +50,5 @@ extern asn_TYPE_descriptor_t asn_DEF_MsrAssistBTS; /* Referred external types */ #include "CalcAssistanceBTS.h" -#endif /* _MsrAssistBTS_H_ */ +#endif /* _MsrAssistBTS_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/MsrAssistData-R98-ExpOTD.h b/src/core/libs/supl/asn-rrlp/MsrAssistData-R98-ExpOTD.h index 3fb932d86..a94887363 100644 --- a/src/core/libs/supl/asn-rrlp/MsrAssistData-R98-ExpOTD.h +++ b/src/core/libs/supl/asn-rrlp/MsrAssistData-R98-ExpOTD.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _MsrAssistData_R98_ExpOTD_H_ -#define _MsrAssistData_R98_ExpOTD_H_ +#ifndef _MsrAssistData_R98_ExpOTD_H_ +#define _MsrAssistData_R98_ExpOTD_H_ #include @@ -15,23 +15,25 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* MsrAssistData-R98-ExpOTD */ -typedef struct MsrAssistData_R98_ExpOTD { - SeqOfMsrAssistBTS_R98_ExpOTD_t msrAssistList_R98_ExpOTD; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} MsrAssistData_R98_ExpOTD_t; + /* MsrAssistData-R98-ExpOTD */ + typedef struct MsrAssistData_R98_ExpOTD + { + SeqOfMsrAssistBTS_R98_ExpOTD_t msrAssistList_R98_ExpOTD; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_MsrAssistData_R98_ExpOTD; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } MsrAssistData_R98_ExpOTD_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_MsrAssistData_R98_ExpOTD; #ifdef __cplusplus } #endif -#endif /* _MsrAssistData_R98_ExpOTD_H_ */ +#endif /* _MsrAssistData_R98_ExpOTD_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/MsrAssistData.h b/src/core/libs/supl/asn-rrlp/MsrAssistData.h index 0aa260631..f0cf06491 100644 --- a/src/core/libs/supl/asn-rrlp/MsrAssistData.h +++ b/src/core/libs/supl/asn-rrlp/MsrAssistData.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _MsrAssistData_H_ -#define _MsrAssistData_H_ +#ifndef _MsrAssistData_H_ +#define _MsrAssistData_H_ #include @@ -15,23 +15,25 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* MsrAssistData */ -typedef struct MsrAssistData { - SeqOfMsrAssistBTS_t msrAssistList; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} MsrAssistData_t; + /* MsrAssistData */ + typedef struct MsrAssistData + { + SeqOfMsrAssistBTS_t msrAssistList; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_MsrAssistData; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } MsrAssistData_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_MsrAssistData; #ifdef __cplusplus } #endif -#endif /* _MsrAssistData_H_ */ +#endif /* _MsrAssistData_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/MsrPosition-Req.h b/src/core/libs/supl/asn-rrlp/MsrPosition-Req.h index 011046652..3f0be38f5 100644 --- a/src/core/libs/supl/asn-rrlp/MsrPosition-Req.h +++ b/src/core/libs/supl/asn-rrlp/MsrPosition-Req.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _MsrPosition_Req_H_ -#define _MsrPosition_Req_H_ +#ifndef _MsrPosition_Req_H_ +#define _MsrPosition_Req_H_ #include @@ -16,38 +16,40 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Forward declarations */ -struct ReferenceAssistData; -struct MsrAssistData; -struct SystemInfoAssistData; -struct GPS_AssistData; -struct Rel98_MsrPosition_Req_Extension; -struct Rel5_MsrPosition_Req_Extension; + /* Forward declarations */ + struct ReferenceAssistData; + struct MsrAssistData; + struct SystemInfoAssistData; + struct GPS_AssistData; + struct Rel98_MsrPosition_Req_Extension; + struct Rel5_MsrPosition_Req_Extension; -/* MsrPosition-Req */ -typedef struct MsrPosition_Req { - PositionInstruct_t positionInstruct; - struct ReferenceAssistData *referenceAssistData /* OPTIONAL */; - struct MsrAssistData *msrAssistData /* OPTIONAL */; - struct SystemInfoAssistData *systemInfoAssistData /* OPTIONAL */; - struct GPS_AssistData *gps_AssistData /* OPTIONAL */; - ExtensionContainer_t *extensionContainer /* OPTIONAL */; - /* + /* MsrPosition-Req */ + typedef struct MsrPosition_Req + { + PositionInstruct_t positionInstruct; + struct ReferenceAssistData *referenceAssistData /* OPTIONAL */; + struct MsrAssistData *msrAssistData /* OPTIONAL */; + struct SystemInfoAssistData *systemInfoAssistData /* OPTIONAL */; + struct GPS_AssistData *gps_AssistData /* OPTIONAL */; + ExtensionContainer_t *extensionContainer /* OPTIONAL */; + /* * This type is extensible, * possible extensions are below. */ - struct Rel98_MsrPosition_Req_Extension *rel98_MsrPosition_Req_extension /* OPTIONAL */; - struct Rel5_MsrPosition_Req_Extension *rel5_MsrPosition_Req_extension /* OPTIONAL */; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} MsrPosition_Req_t; + struct Rel98_MsrPosition_Req_Extension *rel98_MsrPosition_Req_extension /* OPTIONAL */; + struct Rel5_MsrPosition_Req_Extension *rel5_MsrPosition_Req_extension /* OPTIONAL */; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_MsrPosition_Req; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } MsrPosition_Req_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_MsrPosition_Req; #ifdef __cplusplus } @@ -61,5 +63,5 @@ extern asn_TYPE_descriptor_t asn_DEF_MsrPosition_Req; #include "Rel98-MsrPosition-Req-Extension.h" #include "Rel5-MsrPosition-Req-Extension.h" -#endif /* _MsrPosition_Req_H_ */ +#endif /* _MsrPosition_Req_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/MsrPosition-Rsp.h b/src/core/libs/supl/asn-rrlp/MsrPosition-Rsp.h index ddb735fbd..09dc9dcbc 100644 --- a/src/core/libs/supl/asn-rrlp/MsrPosition-Rsp.h +++ b/src/core/libs/supl/asn-rrlp/MsrPosition-Rsp.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _MsrPosition_Rsp_H_ -#define _MsrPosition_Rsp_H_ +#ifndef _MsrPosition_Rsp_H_ +#define _MsrPosition_Rsp_H_ #include @@ -15,41 +15,43 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Forward declarations */ -struct MultipleSets; -struct ReferenceIdentity; -struct OTD_MeasureInfo; -struct LocationInfo; -struct GPS_MeasureInfo; -struct LocationError; -struct Rel_98_MsrPosition_Rsp_Extension; -struct Rel_5_MsrPosition_Rsp_Extension; + /* Forward declarations */ + struct MultipleSets; + struct ReferenceIdentity; + struct OTD_MeasureInfo; + struct LocationInfo; + struct GPS_MeasureInfo; + struct LocationError; + struct Rel_98_MsrPosition_Rsp_Extension; + struct Rel_5_MsrPosition_Rsp_Extension; -/* MsrPosition-Rsp */ -typedef struct MsrPosition_Rsp { - struct MultipleSets *multipleSets /* OPTIONAL */; - struct ReferenceIdentity *referenceIdentity /* OPTIONAL */; - struct OTD_MeasureInfo *otd_MeasureInfo /* OPTIONAL */; - struct LocationInfo *locationInfo /* OPTIONAL */; - struct GPS_MeasureInfo *gps_MeasureInfo /* OPTIONAL */; - struct LocationError *locationError /* OPTIONAL */; - ExtensionContainer_t *extensionContainer /* OPTIONAL */; - /* + /* MsrPosition-Rsp */ + typedef struct MsrPosition_Rsp + { + struct MultipleSets *multipleSets /* OPTIONAL */; + struct ReferenceIdentity *referenceIdentity /* OPTIONAL */; + struct OTD_MeasureInfo *otd_MeasureInfo /* OPTIONAL */; + struct LocationInfo *locationInfo /* OPTIONAL */; + struct GPS_MeasureInfo *gps_MeasureInfo /* OPTIONAL */; + struct LocationError *locationError /* OPTIONAL */; + ExtensionContainer_t *extensionContainer /* OPTIONAL */; + /* * This type is extensible, * possible extensions are below. */ - struct Rel_98_MsrPosition_Rsp_Extension *rel_98_MsrPosition_Rsp_Extension /* OPTIONAL */; - struct Rel_5_MsrPosition_Rsp_Extension *rel_5_MsrPosition_Rsp_Extension /* OPTIONAL */; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} MsrPosition_Rsp_t; + struct Rel_98_MsrPosition_Rsp_Extension *rel_98_MsrPosition_Rsp_Extension /* OPTIONAL */; + struct Rel_5_MsrPosition_Rsp_Extension *rel_5_MsrPosition_Rsp_Extension /* OPTIONAL */; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_MsrPosition_Rsp; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } MsrPosition_Rsp_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_MsrPosition_Rsp; #ifdef __cplusplus } @@ -65,5 +67,5 @@ extern asn_TYPE_descriptor_t asn_DEF_MsrPosition_Rsp; #include "Rel-98-MsrPosition-Rsp-Extension.h" #include "Rel-5-MsrPosition-Rsp-Extension.h" -#endif /* _MsrPosition_Rsp_H_ */ +#endif /* _MsrPosition_Rsp_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/MultiFrameCarrier.h b/src/core/libs/supl/asn-rrlp/MultiFrameCarrier.h index 974756a36..4a22a67fc 100644 --- a/src/core/libs/supl/asn-rrlp/MultiFrameCarrier.h +++ b/src/core/libs/supl/asn-rrlp/MultiFrameCarrier.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _MultiFrameCarrier_H_ -#define _MultiFrameCarrier_H_ +#ifndef _MultiFrameCarrier_H_ +#define _MultiFrameCarrier_H_ #include @@ -16,24 +16,26 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* MultiFrameCarrier */ -typedef struct MultiFrameCarrier { - BCCHCarrier_t bcchCarrier; - MultiFrameOffset_t multiFrameOffset; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} MultiFrameCarrier_t; + /* MultiFrameCarrier */ + typedef struct MultiFrameCarrier + { + BCCHCarrier_t bcchCarrier; + MultiFrameOffset_t multiFrameOffset; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_MultiFrameCarrier; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } MultiFrameCarrier_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_MultiFrameCarrier; #ifdef __cplusplus } #endif -#endif /* _MultiFrameCarrier_H_ */ +#endif /* _MultiFrameCarrier_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/MultiFrameOffset.h b/src/core/libs/supl/asn-rrlp/MultiFrameOffset.h index 0dca44394..ee06666df 100644 --- a/src/core/libs/supl/asn-rrlp/MultiFrameOffset.h +++ b/src/core/libs/supl/asn-rrlp/MultiFrameOffset.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _MultiFrameOffset_H_ -#define _MultiFrameOffset_H_ +#ifndef _MultiFrameOffset_H_ +#define _MultiFrameOffset_H_ #include @@ -14,27 +14,28 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* MultiFrameOffset */ -typedef long MultiFrameOffset_t; + /* MultiFrameOffset */ + typedef long MultiFrameOffset_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_MultiFrameOffset; -asn_struct_free_f MultiFrameOffset_free; -asn_struct_print_f MultiFrameOffset_print; -asn_constr_check_f MultiFrameOffset_constraint; -ber_type_decoder_f MultiFrameOffset_decode_ber; -der_type_encoder_f MultiFrameOffset_encode_der; -xer_type_decoder_f MultiFrameOffset_decode_xer; -xer_type_encoder_f MultiFrameOffset_encode_xer; -per_type_decoder_f MultiFrameOffset_decode_uper; -per_type_encoder_f MultiFrameOffset_encode_uper; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_MultiFrameOffset; + asn_struct_free_f MultiFrameOffset_free; + asn_struct_print_f MultiFrameOffset_print; + asn_constr_check_f MultiFrameOffset_constraint; + ber_type_decoder_f MultiFrameOffset_decode_ber; + der_type_encoder_f MultiFrameOffset_encode_der; + xer_type_decoder_f MultiFrameOffset_decode_xer; + xer_type_encoder_f MultiFrameOffset_encode_xer; + per_type_decoder_f MultiFrameOffset_decode_uper; + per_type_encoder_f MultiFrameOffset_encode_uper; #ifdef __cplusplus } #endif -#endif /* _MultiFrameOffset_H_ */ +#endif /* _MultiFrameOffset_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/MultipleSets.h b/src/core/libs/supl/asn-rrlp/MultipleSets.h index 032c62542..9f8f4a87d 100644 --- a/src/core/libs/supl/asn-rrlp/MultipleSets.h +++ b/src/core/libs/supl/asn-rrlp/MultipleSets.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _MultipleSets_H_ -#define _MultipleSets_H_ +#ifndef _MultipleSets_H_ +#define _MultipleSets_H_ #include @@ -16,25 +16,27 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* MultipleSets */ -typedef struct MultipleSets { - long nbrOfSets; - long nbrOfReferenceBTSs; - ReferenceRelation_t *referenceRelation /* OPTIONAL */; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} MultipleSets_t; + /* MultipleSets */ + typedef struct MultipleSets + { + long nbrOfSets; + long nbrOfReferenceBTSs; + ReferenceRelation_t *referenceRelation /* OPTIONAL */; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_MultipleSets; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } MultipleSets_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_MultipleSets; #ifdef __cplusplus } #endif -#endif /* _MultipleSets_H_ */ +#endif /* _MultipleSets_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/NULL.h b/src/core/libs/supl/asn-rrlp/NULL.h index 131e77592..5720faf3b 100644 --- a/src/core/libs/supl/asn-rrlp/NULL.h +++ b/src/core/libs/supl/asn-rrlp/NULL.h @@ -2,32 +2,33 @@ * Copyright (c) 2003 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ -#ifndef ASN_TYPE_NULL_H -#define ASN_TYPE_NULL_H +#ifndef ASN_TYPE_NULL_H +#define ASN_TYPE_NULL_H #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* + /* * The value of the NULL type is meaningless: see BOOLEAN if you want to * carry true/false semantics. */ -typedef int NULL_t; + typedef int NULL_t; -extern asn_TYPE_descriptor_t asn_DEF_NULL; + extern asn_TYPE_descriptor_t asn_DEF_NULL; -asn_struct_print_f NULL_print; -der_type_encoder_f NULL_encode_der; -xer_type_decoder_f NULL_decode_xer; -xer_type_encoder_f NULL_encode_xer; -per_type_decoder_f NULL_decode_uper; -per_type_encoder_f NULL_encode_uper; + asn_struct_print_f NULL_print; + der_type_encoder_f NULL_encode_der; + xer_type_decoder_f NULL_decode_xer; + xer_type_encoder_f NULL_encode_xer; + per_type_decoder_f NULL_decode_uper; + per_type_encoder_f NULL_encode_uper; #ifdef __cplusplus } #endif -#endif /* NULL_H */ +#endif /* NULL_H */ diff --git a/src/core/libs/supl/asn-rrlp/NativeEnumerated.h b/src/core/libs/supl/asn-rrlp/NativeEnumerated.h index c59bb1ba9..3b3d4b074 100644 --- a/src/core/libs/supl/asn-rrlp/NativeEnumerated.h +++ b/src/core/libs/supl/asn-rrlp/NativeEnumerated.h @@ -10,23 +10,24 @@ * will do). * This type may be used when integer range is limited by subtype constraints. */ -#ifndef _NativeEnumerated_H_ -#define _NativeEnumerated_H_ +#ifndef _NativeEnumerated_H_ +#define _NativeEnumerated_H_ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -extern asn_TYPE_descriptor_t asn_DEF_NativeEnumerated; + extern asn_TYPE_descriptor_t asn_DEF_NativeEnumerated; -xer_type_encoder_f NativeEnumerated_encode_xer; -per_type_decoder_f NativeEnumerated_decode_uper; -per_type_encoder_f NativeEnumerated_encode_uper; + xer_type_encoder_f NativeEnumerated_encode_xer; + per_type_decoder_f NativeEnumerated_decode_uper; + per_type_encoder_f NativeEnumerated_encode_uper; #ifdef __cplusplus } #endif -#endif /* _NativeEnumerated_H_ */ +#endif /* _NativeEnumerated_H_ */ diff --git a/src/core/libs/supl/asn-rrlp/NativeInteger.h b/src/core/libs/supl/asn-rrlp/NativeInteger.h index 4e63a8355..14311ae57 100644 --- a/src/core/libs/supl/asn-rrlp/NativeInteger.h +++ b/src/core/libs/supl/asn-rrlp/NativeInteger.h @@ -9,29 +9,30 @@ * will do). * This type may be used when integer range is limited by subtype constraints. */ -#ifndef _NativeInteger_H_ -#define _NativeInteger_H_ +#ifndef _NativeInteger_H_ +#define _NativeInteger_H_ #include #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -extern asn_TYPE_descriptor_t asn_DEF_NativeInteger; + extern asn_TYPE_descriptor_t asn_DEF_NativeInteger; -asn_struct_free_f NativeInteger_free; -asn_struct_print_f NativeInteger_print; -ber_type_decoder_f NativeInteger_decode_ber; -der_type_encoder_f NativeInteger_encode_der; -xer_type_decoder_f NativeInteger_decode_xer; -xer_type_encoder_f NativeInteger_encode_xer; -per_type_decoder_f NativeInteger_decode_uper; -per_type_encoder_f NativeInteger_encode_uper; + asn_struct_free_f NativeInteger_free; + asn_struct_print_f NativeInteger_print; + ber_type_decoder_f NativeInteger_decode_ber; + der_type_encoder_f NativeInteger_encode_der; + xer_type_decoder_f NativeInteger_decode_xer; + xer_type_encoder_f NativeInteger_encode_xer; + per_type_decoder_f NativeInteger_decode_uper; + per_type_encoder_f NativeInteger_encode_uper; #ifdef __cplusplus } #endif -#endif /* _NativeInteger_H_ */ +#endif /* _NativeInteger_H_ */ diff --git a/src/core/libs/supl/asn-rrlp/NavModel-KeplerianSet.h b/src/core/libs/supl/asn-rrlp/NavModel-KeplerianSet.h index f295c623b..7d9f906ed 100644 --- a/src/core/libs/supl/asn-rrlp/NavModel-KeplerianSet.h +++ b/src/core/libs/supl/asn-rrlp/NavModel-KeplerianSet.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _NavModel_KeplerianSet_H_ -#define _NavModel_KeplerianSet_H_ +#ifndef _NavModel_KeplerianSet_H_ +#define _NavModel_KeplerianSet_H_ #include @@ -15,38 +15,40 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* NavModel-KeplerianSet */ -typedef struct NavModel_KeplerianSet { - long keplerToeLSB; - long keplerW; - long keplerDeltaN; - long keplerM0; - long keplerOmegaDot; - long keplerELSB; - long keplerIDot; - long keplerAPowerHalfLSB; - long keplerI0; - long keplerOmega0; - long keplerCrs; - long keplerCis; - long keplerCus; - long keplerCrc; - long keplerCic; - long keplerCuc; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} NavModel_KeplerianSet_t; + /* NavModel-KeplerianSet */ + typedef struct NavModel_KeplerianSet + { + long keplerToeLSB; + long keplerW; + long keplerDeltaN; + long keplerM0; + long keplerOmegaDot; + long keplerELSB; + long keplerIDot; + long keplerAPowerHalfLSB; + long keplerI0; + long keplerOmega0; + long keplerCrs; + long keplerCis; + long keplerCus; + long keplerCrc; + long keplerCic; + long keplerCuc; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_NavModel_KeplerianSet; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } NavModel_KeplerianSet_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_NavModel_KeplerianSet; #ifdef __cplusplus } #endif -#endif /* _NavModel_KeplerianSet_H_ */ +#endif /* _NavModel_KeplerianSet_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/NavModelElement.h b/src/core/libs/supl/asn-rrlp/NavModelElement.h index f4504afe2..d8d642c05 100644 --- a/src/core/libs/supl/asn-rrlp/NavModelElement.h +++ b/src/core/libs/supl/asn-rrlp/NavModelElement.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _NavModelElement_H_ -#define _NavModelElement_H_ +#ifndef _NavModelElement_H_ +#define _NavModelElement_H_ #include @@ -16,24 +16,26 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* NavModelElement */ -typedef struct NavModelElement { - SatelliteID_t satelliteID; - SatStatus_t satStatus; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} NavModelElement_t; + /* NavModelElement */ + typedef struct NavModelElement + { + SatelliteID_t satelliteID; + SatStatus_t satStatus; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_NavModelElement; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } NavModelElement_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_NavModelElement; #ifdef __cplusplus } #endif -#endif /* _NavModelElement_H_ */ +#endif /* _NavModelElement_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/NavigationModel.h b/src/core/libs/supl/asn-rrlp/NavigationModel.h index cb37e54de..565f1f636 100644 --- a/src/core/libs/supl/asn-rrlp/NavigationModel.h +++ b/src/core/libs/supl/asn-rrlp/NavigationModel.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _NavigationModel_H_ -#define _NavigationModel_H_ +#ifndef _NavigationModel_H_ +#define _NavigationModel_H_ #include @@ -15,23 +15,25 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* NavigationModel */ -typedef struct NavigationModel { - SeqOfNavModelElement_t navModelList; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} NavigationModel_t; + /* NavigationModel */ + typedef struct NavigationModel + { + SeqOfNavModelElement_t navModelList; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_NavigationModel; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } NavigationModel_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_NavigationModel; #ifdef __cplusplus } #endif -#endif /* _NavigationModel_H_ */ +#endif /* _NavigationModel_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/NeighborIdentity.h b/src/core/libs/supl/asn-rrlp/NeighborIdentity.h index b12b599e7..b87849d76 100644 --- a/src/core/libs/supl/asn-rrlp/NeighborIdentity.h +++ b/src/core/libs/supl/asn-rrlp/NeighborIdentity.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _NeighborIdentity_H_ -#define _NeighborIdentity_H_ +#ifndef _NeighborIdentity_H_ +#define _NeighborIdentity_H_ #include @@ -20,42 +20,46 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Dependencies */ -typedef enum NeighborIdentity_PR { - NeighborIdentity_PR_NOTHING, /* No components present */ - NeighborIdentity_PR_bsicAndCarrier, - NeighborIdentity_PR_ci, - NeighborIdentity_PR_multiFrameCarrier, - NeighborIdentity_PR_requestIndex, - NeighborIdentity_PR_systemInfoIndex, - NeighborIdentity_PR_ciAndLAC -} NeighborIdentity_PR; + /* Dependencies */ + typedef enum NeighborIdentity_PR + { + NeighborIdentity_PR_NOTHING, /* No components present */ + NeighborIdentity_PR_bsicAndCarrier, + NeighborIdentity_PR_ci, + NeighborIdentity_PR_multiFrameCarrier, + NeighborIdentity_PR_requestIndex, + NeighborIdentity_PR_systemInfoIndex, + NeighborIdentity_PR_ciAndLAC + } NeighborIdentity_PR; -/* NeighborIdentity */ -typedef struct NeighborIdentity { - NeighborIdentity_PR present; - union NeighborIdentity_u { - BSICAndCarrier_t bsicAndCarrier; - CellID_t ci; - MultiFrameCarrier_t multiFrameCarrier; - RequestIndex_t requestIndex; - SystemInfoIndex_t systemInfoIndex; - CellIDAndLAC_t ciAndLAC; - } choice; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} NeighborIdentity_t; + /* NeighborIdentity */ + typedef struct NeighborIdentity + { + NeighborIdentity_PR present; + union NeighborIdentity_u + { + BSICAndCarrier_t bsicAndCarrier; + CellID_t ci; + MultiFrameCarrier_t multiFrameCarrier; + RequestIndex_t requestIndex; + SystemInfoIndex_t systemInfoIndex; + CellIDAndLAC_t ciAndLAC; + } choice; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_NeighborIdentity; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } NeighborIdentity_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_NeighborIdentity; #ifdef __cplusplus } #endif -#endif /* _NeighborIdentity_H_ */ +#endif /* _NeighborIdentity_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/NumOfMeasurements.h b/src/core/libs/supl/asn-rrlp/NumOfMeasurements.h index 82524d0ed..0b897c0f2 100644 --- a/src/core/libs/supl/asn-rrlp/NumOfMeasurements.h +++ b/src/core/libs/supl/asn-rrlp/NumOfMeasurements.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _NumOfMeasurements_H_ -#define _NumOfMeasurements_H_ +#ifndef _NumOfMeasurements_H_ +#define _NumOfMeasurements_H_ #include @@ -14,27 +14,28 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* NumOfMeasurements */ -typedef long NumOfMeasurements_t; + /* NumOfMeasurements */ + typedef long NumOfMeasurements_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_NumOfMeasurements; -asn_struct_free_f NumOfMeasurements_free; -asn_struct_print_f NumOfMeasurements_print; -asn_constr_check_f NumOfMeasurements_constraint; -ber_type_decoder_f NumOfMeasurements_decode_ber; -der_type_encoder_f NumOfMeasurements_encode_der; -xer_type_decoder_f NumOfMeasurements_decode_xer; -xer_type_encoder_f NumOfMeasurements_encode_xer; -per_type_decoder_f NumOfMeasurements_decode_uper; -per_type_encoder_f NumOfMeasurements_encode_uper; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_NumOfMeasurements; + asn_struct_free_f NumOfMeasurements_free; + asn_struct_print_f NumOfMeasurements_print; + asn_constr_check_f NumOfMeasurements_constraint; + ber_type_decoder_f NumOfMeasurements_decode_ber; + der_type_encoder_f NumOfMeasurements_encode_der; + xer_type_decoder_f NumOfMeasurements_decode_xer; + xer_type_encoder_f NumOfMeasurements_encode_xer; + per_type_decoder_f NumOfMeasurements_decode_uper; + per_type_encoder_f NumOfMeasurements_encode_uper; #ifdef __cplusplus } #endif -#endif /* _NumOfMeasurements_H_ */ +#endif /* _NumOfMeasurements_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/OCTET_STRING.h b/src/core/libs/supl/asn-rrlp/OCTET_STRING.h index 8df9a182d..124fde559 100644 --- a/src/core/libs/supl/asn-rrlp/OCTET_STRING.h +++ b/src/core/libs/supl/asn-rrlp/OCTET_STRING.h @@ -2,42 +2,44 @@ * Copyright (c) 2003 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ -#ifndef _OCTET_STRING_H_ -#define _OCTET_STRING_H_ +#ifndef _OCTET_STRING_H_ +#define _OCTET_STRING_H_ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -typedef struct OCTET_STRING { - uint8_t *buf; /* Buffer with consecutive OCTET_STRING bits */ - int size; /* Size of the buffer */ + typedef struct OCTET_STRING + { + uint8_t *buf; /* Buffer with consecutive OCTET_STRING bits */ + int size; /* Size of the buffer */ - asn_struct_ctx_t _asn_ctx; /* Parsing across buffer boundaries */ -} OCTET_STRING_t; + asn_struct_ctx_t _asn_ctx; /* Parsing across buffer boundaries */ + } OCTET_STRING_t; -extern asn_TYPE_descriptor_t asn_DEF_OCTET_STRING; + extern asn_TYPE_descriptor_t asn_DEF_OCTET_STRING; -asn_struct_free_f OCTET_STRING_free; -asn_struct_print_f OCTET_STRING_print; -asn_struct_print_f OCTET_STRING_print_utf8; -ber_type_decoder_f OCTET_STRING_decode_ber; -der_type_encoder_f OCTET_STRING_encode_der; -xer_type_decoder_f OCTET_STRING_decode_xer_hex; /* Hexadecimal */ -xer_type_decoder_f OCTET_STRING_decode_xer_binary; /* 01010111010 */ -xer_type_decoder_f OCTET_STRING_decode_xer_utf8; /* ASCII/UTF-8 */ -xer_type_encoder_f OCTET_STRING_encode_xer; -xer_type_encoder_f OCTET_STRING_encode_xer_utf8; -per_type_decoder_f OCTET_STRING_decode_uper; -per_type_encoder_f OCTET_STRING_encode_uper; + asn_struct_free_f OCTET_STRING_free; + asn_struct_print_f OCTET_STRING_print; + asn_struct_print_f OCTET_STRING_print_utf8; + ber_type_decoder_f OCTET_STRING_decode_ber; + der_type_encoder_f OCTET_STRING_encode_der; + xer_type_decoder_f OCTET_STRING_decode_xer_hex; /* Hexadecimal */ + xer_type_decoder_f OCTET_STRING_decode_xer_binary; /* 01010111010 */ + xer_type_decoder_f OCTET_STRING_decode_xer_utf8; /* ASCII/UTF-8 */ + xer_type_encoder_f OCTET_STRING_encode_xer; + xer_type_encoder_f OCTET_STRING_encode_xer_utf8; + per_type_decoder_f OCTET_STRING_decode_uper; + per_type_encoder_f OCTET_STRING_encode_uper; -/****************************** + /****************************** * Handy conversion routines. * ******************************/ -/* + /* * This function clears the previous value of the OCTET STRING (if any) * and then allocates a new memory with the specified content (str/size). * If size = -1, the size of the original string will be determined @@ -46,41 +48,43 @@ per_type_encoder_f OCTET_STRING_encode_uper; * current contents of the OCTET STRING. * Returns 0 if it was possible to perform operation, -1 otherwise. */ -int OCTET_STRING_fromBuf(OCTET_STRING_t *s, const char *str, int size); + int OCTET_STRING_fromBuf(OCTET_STRING_t *s, const char *str, int size); /* Handy conversion from the C string into the OCTET STRING. */ -#define OCTET_STRING_fromString(s, str) OCTET_STRING_fromBuf(s, str, -1) +#define OCTET_STRING_fromString(s, str) OCTET_STRING_fromBuf(s, str, -1) -/* + /* * Allocate and fill the new OCTET STRING and return a pointer to the newly * allocated object. NULL is permitted in str: the function will just allocate * empty OCTET STRING. */ -OCTET_STRING_t *OCTET_STRING_new_fromBuf(asn_TYPE_descriptor_t *td, - const char *str, int size); + OCTET_STRING_t *OCTET_STRING_new_fromBuf(asn_TYPE_descriptor_t *td, + const char *str, int size); -/**************************** + /**************************** * Internally useful stuff. * ****************************/ -typedef struct asn_OCTET_STRING_specifics_s { - /* + typedef struct asn_OCTET_STRING_specifics_s + { + /* * Target structure description. */ - int struct_size; /* Size of the structure */ - int ctx_offset; /* Offset of the asn_struct_ctx_t member */ + int struct_size; /* Size of the structure */ + int ctx_offset; /* Offset of the asn_struct_ctx_t member */ - enum asn_OS_Subvariant { - ASN_OSUBV_ANY, /* The open type (ANY) */ - ASN_OSUBV_BIT, /* BIT STRING */ - ASN_OSUBV_STR, /* String types, not {BMP,Universal}String */ - ASN_OSUBV_U16, /* 16-bit character (BMPString) */ - ASN_OSUBV_U32 /* 32-bit character (UniversalString) */ - } subvariant; -} asn_OCTET_STRING_specifics_t; + enum asn_OS_Subvariant + { + ASN_OSUBV_ANY, /* The open type (ANY) */ + ASN_OSUBV_BIT, /* BIT STRING */ + ASN_OSUBV_STR, /* String types, not {BMP,Universal}String */ + ASN_OSUBV_U16, /* 16-bit character (BMPString) */ + ASN_OSUBV_U32 /* 32-bit character (UniversalString) */ + } subvariant; + } asn_OCTET_STRING_specifics_t; #ifdef __cplusplus } #endif -#endif /* _OCTET_STRING_H_ */ +#endif /* _OCTET_STRING_H_ */ diff --git a/src/core/libs/supl/asn-rrlp/OTD-FirstSetMsrs.h b/src/core/libs/supl/asn-rrlp/OTD-FirstSetMsrs.h index b5979dc51..04d3624e7 100644 --- a/src/core/libs/supl/asn-rrlp/OTD-FirstSetMsrs.h +++ b/src/core/libs/supl/asn-rrlp/OTD-FirstSetMsrs.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _OTD_FirstSetMsrs_H_ -#define _OTD_FirstSetMsrs_H_ +#ifndef _OTD_FirstSetMsrs_H_ +#define _OTD_FirstSetMsrs_H_ #include @@ -14,27 +14,28 @@ #include "OTD-MeasurementWithID.h" #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* OTD-FirstSetMsrs */ -typedef OTD_MeasurementWithID_t OTD_FirstSetMsrs_t; + /* OTD-FirstSetMsrs */ + typedef OTD_MeasurementWithID_t OTD_FirstSetMsrs_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_OTD_FirstSetMsrs; -asn_struct_free_f OTD_FirstSetMsrs_free; -asn_struct_print_f OTD_FirstSetMsrs_print; -asn_constr_check_f OTD_FirstSetMsrs_constraint; -ber_type_decoder_f OTD_FirstSetMsrs_decode_ber; -der_type_encoder_f OTD_FirstSetMsrs_encode_der; -xer_type_decoder_f OTD_FirstSetMsrs_decode_xer; -xer_type_encoder_f OTD_FirstSetMsrs_encode_xer; -per_type_decoder_f OTD_FirstSetMsrs_decode_uper; -per_type_encoder_f OTD_FirstSetMsrs_encode_uper; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_OTD_FirstSetMsrs; + asn_struct_free_f OTD_FirstSetMsrs_free; + asn_struct_print_f OTD_FirstSetMsrs_print; + asn_constr_check_f OTD_FirstSetMsrs_constraint; + ber_type_decoder_f OTD_FirstSetMsrs_decode_ber; + der_type_encoder_f OTD_FirstSetMsrs_encode_der; + xer_type_decoder_f OTD_FirstSetMsrs_decode_xer; + xer_type_encoder_f OTD_FirstSetMsrs_encode_xer; + per_type_decoder_f OTD_FirstSetMsrs_decode_uper; + per_type_encoder_f OTD_FirstSetMsrs_encode_uper; #ifdef __cplusplus } #endif -#endif /* _OTD_FirstSetMsrs_H_ */ +#endif /* _OTD_FirstSetMsrs_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/OTD-MeasureInfo-5-Ext.h b/src/core/libs/supl/asn-rrlp/OTD-MeasureInfo-5-Ext.h index d75bc01a4..8cdd331bc 100644 --- a/src/core/libs/supl/asn-rrlp/OTD-MeasureInfo-5-Ext.h +++ b/src/core/libs/supl/asn-rrlp/OTD-MeasureInfo-5-Ext.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _OTD_MeasureInfo_5_Ext_H_ -#define _OTD_MeasureInfo_5_Ext_H_ +#ifndef _OTD_MeasureInfo_5_Ext_H_ +#define _OTD_MeasureInfo_5_Ext_H_ #include @@ -14,27 +14,28 @@ #include "SeqOfOTD-MsrElementRest.h" #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* OTD-MeasureInfo-5-Ext */ -typedef SeqOfOTD_MsrElementRest_t OTD_MeasureInfo_5_Ext_t; + /* OTD-MeasureInfo-5-Ext */ + typedef SeqOfOTD_MsrElementRest_t OTD_MeasureInfo_5_Ext_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_OTD_MeasureInfo_5_Ext; -asn_struct_free_f OTD_MeasureInfo_5_Ext_free; -asn_struct_print_f OTD_MeasureInfo_5_Ext_print; -asn_constr_check_f OTD_MeasureInfo_5_Ext_constraint; -ber_type_decoder_f OTD_MeasureInfo_5_Ext_decode_ber; -der_type_encoder_f OTD_MeasureInfo_5_Ext_encode_der; -xer_type_decoder_f OTD_MeasureInfo_5_Ext_decode_xer; -xer_type_encoder_f OTD_MeasureInfo_5_Ext_encode_xer; -per_type_decoder_f OTD_MeasureInfo_5_Ext_decode_uper; -per_type_encoder_f OTD_MeasureInfo_5_Ext_encode_uper; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_OTD_MeasureInfo_5_Ext; + asn_struct_free_f OTD_MeasureInfo_5_Ext_free; + asn_struct_print_f OTD_MeasureInfo_5_Ext_print; + asn_constr_check_f OTD_MeasureInfo_5_Ext_constraint; + ber_type_decoder_f OTD_MeasureInfo_5_Ext_decode_ber; + der_type_encoder_f OTD_MeasureInfo_5_Ext_encode_der; + xer_type_decoder_f OTD_MeasureInfo_5_Ext_decode_xer; + xer_type_encoder_f OTD_MeasureInfo_5_Ext_encode_xer; + per_type_decoder_f OTD_MeasureInfo_5_Ext_decode_uper; + per_type_encoder_f OTD_MeasureInfo_5_Ext_encode_uper; #ifdef __cplusplus } #endif -#endif /* _OTD_MeasureInfo_5_Ext_H_ */ +#endif /* _OTD_MeasureInfo_5_Ext_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/OTD-MeasureInfo-R98-Ext.h b/src/core/libs/supl/asn-rrlp/OTD-MeasureInfo-R98-Ext.h index 40f15a992..5a2bcc22c 100644 --- a/src/core/libs/supl/asn-rrlp/OTD-MeasureInfo-R98-Ext.h +++ b/src/core/libs/supl/asn-rrlp/OTD-MeasureInfo-R98-Ext.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _OTD_MeasureInfo_R98_Ext_H_ -#define _OTD_MeasureInfo_R98_Ext_H_ +#ifndef _OTD_MeasureInfo_R98_Ext_H_ +#define _OTD_MeasureInfo_R98_Ext_H_ #include @@ -15,23 +15,25 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* OTD-MeasureInfo-R98-Ext */ -typedef struct OTD_MeasureInfo_R98_Ext { - OTD_MsrElementFirst_R98_Ext_t otdMsrFirstSets_R98_Ext; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} OTD_MeasureInfo_R98_Ext_t; + /* OTD-MeasureInfo-R98-Ext */ + typedef struct OTD_MeasureInfo_R98_Ext + { + OTD_MsrElementFirst_R98_Ext_t otdMsrFirstSets_R98_Ext; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_OTD_MeasureInfo_R98_Ext; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } OTD_MeasureInfo_R98_Ext_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_OTD_MeasureInfo_R98_Ext; #ifdef __cplusplus } #endif -#endif /* _OTD_MeasureInfo_R98_Ext_H_ */ +#endif /* _OTD_MeasureInfo_R98_Ext_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/OTD-MeasureInfo.h b/src/core/libs/supl/asn-rrlp/OTD-MeasureInfo.h index 8ee559573..3c57b4f9c 100644 --- a/src/core/libs/supl/asn-rrlp/OTD-MeasureInfo.h +++ b/src/core/libs/supl/asn-rrlp/OTD-MeasureInfo.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _OTD_MeasureInfo_H_ -#define _OTD_MeasureInfo_H_ +#ifndef _OTD_MeasureInfo_H_ +#define _OTD_MeasureInfo_H_ #include @@ -15,23 +15,25 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Forward declarations */ -struct SeqOfOTD_MsrElementRest; + /* Forward declarations */ + struct SeqOfOTD_MsrElementRest; -/* OTD-MeasureInfo */ -typedef struct OTD_MeasureInfo { - OTD_MsrElementFirst_t otdMsrFirstSets; - struct SeqOfOTD_MsrElementRest *otdMsrRestSets /* OPTIONAL */; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} OTD_MeasureInfo_t; + /* OTD-MeasureInfo */ + typedef struct OTD_MeasureInfo + { + OTD_MsrElementFirst_t otdMsrFirstSets; + struct SeqOfOTD_MsrElementRest *otdMsrRestSets /* OPTIONAL */; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_OTD_MeasureInfo; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } OTD_MeasureInfo_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_OTD_MeasureInfo; #ifdef __cplusplus } @@ -40,5 +42,5 @@ extern asn_TYPE_descriptor_t asn_DEF_OTD_MeasureInfo; /* Referred external types */ #include "SeqOfOTD-MsrElementRest.h" -#endif /* _OTD_MeasureInfo_H_ */ +#endif /* _OTD_MeasureInfo_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/OTD-Measurement.h b/src/core/libs/supl/asn-rrlp/OTD-Measurement.h index 78c8b4a5b..7fa183b7c 100644 --- a/src/core/libs/supl/asn-rrlp/OTD-Measurement.h +++ b/src/core/libs/supl/asn-rrlp/OTD-Measurement.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _OTD_Measurement_H_ -#define _OTD_Measurement_H_ +#ifndef _OTD_Measurement_H_ +#define _OTD_Measurement_H_ #include @@ -17,25 +17,27 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* OTD-Measurement */ -typedef struct OTD_Measurement { - ModuloTimeSlot_t nborTimeSlot; - EOTDQuality_t eotdQuality; - OTDValue_t otdValue; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} OTD_Measurement_t; + /* OTD-Measurement */ + typedef struct OTD_Measurement + { + ModuloTimeSlot_t nborTimeSlot; + EOTDQuality_t eotdQuality; + OTDValue_t otdValue; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_OTD_Measurement; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } OTD_Measurement_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_OTD_Measurement; #ifdef __cplusplus } #endif -#endif /* _OTD_Measurement_H_ */ +#endif /* _OTD_Measurement_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/OTD-MeasurementWithID.h b/src/core/libs/supl/asn-rrlp/OTD-MeasurementWithID.h index 03944b046..6431c7a89 100644 --- a/src/core/libs/supl/asn-rrlp/OTD-MeasurementWithID.h +++ b/src/core/libs/supl/asn-rrlp/OTD-MeasurementWithID.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _OTD_MeasurementWithID_H_ -#define _OTD_MeasurementWithID_H_ +#ifndef _OTD_MeasurementWithID_H_ +#define _OTD_MeasurementWithID_H_ #include @@ -18,26 +18,28 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* OTD-MeasurementWithID */ -typedef struct OTD_MeasurementWithID { - NeighborIdentity_t neighborIdentity; - ModuloTimeSlot_t nborTimeSlot; - EOTDQuality_t eotdQuality; - OTDValue_t otdValue; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} OTD_MeasurementWithID_t; + /* OTD-MeasurementWithID */ + typedef struct OTD_MeasurementWithID + { + NeighborIdentity_t neighborIdentity; + ModuloTimeSlot_t nborTimeSlot; + EOTDQuality_t eotdQuality; + OTDValue_t otdValue; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_OTD_MeasurementWithID; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } OTD_MeasurementWithID_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_OTD_MeasurementWithID; #ifdef __cplusplus } #endif -#endif /* _OTD_MeasurementWithID_H_ */ +#endif /* _OTD_MeasurementWithID_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/OTD-MsrElementFirst-R98-Ext.h b/src/core/libs/supl/asn-rrlp/OTD-MsrElementFirst-R98-Ext.h index 6c372026d..e99001016 100644 --- a/src/core/libs/supl/asn-rrlp/OTD-MsrElementFirst-R98-Ext.h +++ b/src/core/libs/supl/asn-rrlp/OTD-MsrElementFirst-R98-Ext.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _OTD_MsrElementFirst_R98_Ext_H_ -#define _OTD_MsrElementFirst_R98_Ext_H_ +#ifndef _OTD_MsrElementFirst_R98_Ext_H_ +#define _OTD_MsrElementFirst_R98_Ext_H_ #include @@ -14,22 +14,24 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Forward declarations */ -struct SeqOfOTD_FirstSetMsrs_R98_Ext; + /* Forward declarations */ + struct SeqOfOTD_FirstSetMsrs_R98_Ext; -/* OTD-MsrElementFirst-R98-Ext */ -typedef struct OTD_MsrElementFirst_R98_Ext { - struct SeqOfOTD_FirstSetMsrs_R98_Ext *otd_FirstSetMsrs_R98_Ext /* OPTIONAL */; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} OTD_MsrElementFirst_R98_Ext_t; + /* OTD-MsrElementFirst-R98-Ext */ + typedef struct OTD_MsrElementFirst_R98_Ext + { + struct SeqOfOTD_FirstSetMsrs_R98_Ext *otd_FirstSetMsrs_R98_Ext /* OPTIONAL */; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_OTD_MsrElementFirst_R98_Ext; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } OTD_MsrElementFirst_R98_Ext_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_OTD_MsrElementFirst_R98_Ext; #ifdef __cplusplus } @@ -38,5 +40,5 @@ extern asn_TYPE_descriptor_t asn_DEF_OTD_MsrElementFirst_R98_Ext; /* Referred external types */ #include "SeqOfOTD-FirstSetMsrs-R98-Ext.h" -#endif /* _OTD_MsrElementFirst_R98_Ext_H_ */ +#endif /* _OTD_MsrElementFirst_R98_Ext_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/OTD-MsrElementFirst.h b/src/core/libs/supl/asn-rrlp/OTD-MsrElementFirst.h index b08cce911..322e104c1 100644 --- a/src/core/libs/supl/asn-rrlp/OTD-MsrElementFirst.h +++ b/src/core/libs/supl/asn-rrlp/OTD-MsrElementFirst.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _OTD_MsrElementFirst_H_ -#define _OTD_MsrElementFirst_H_ +#ifndef _OTD_MsrElementFirst_H_ +#define _OTD_MsrElementFirst_H_ #include @@ -17,28 +17,30 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Forward declarations */ -struct TOA_MeasurementsOfRef; -struct SeqOfOTD_FirstSetMsrs; + /* Forward declarations */ + struct TOA_MeasurementsOfRef; + struct SeqOfOTD_FirstSetMsrs; -/* OTD-MsrElementFirst */ -typedef struct OTD_MsrElementFirst { - long refFrameNumber; - ModuloTimeSlot_t referenceTimeSlot; - struct TOA_MeasurementsOfRef *toaMeasurementsOfRef /* OPTIONAL */; - StdResolution_t stdResolution; - long *taCorrection /* OPTIONAL */; - struct SeqOfOTD_FirstSetMsrs *otd_FirstSetMsrs /* OPTIONAL */; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} OTD_MsrElementFirst_t; + /* OTD-MsrElementFirst */ + typedef struct OTD_MsrElementFirst + { + long refFrameNumber; + ModuloTimeSlot_t referenceTimeSlot; + struct TOA_MeasurementsOfRef *toaMeasurementsOfRef /* OPTIONAL */; + StdResolution_t stdResolution; + long *taCorrection /* OPTIONAL */; + struct SeqOfOTD_FirstSetMsrs *otd_FirstSetMsrs /* OPTIONAL */; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_OTD_MsrElementFirst; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } OTD_MsrElementFirst_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_OTD_MsrElementFirst; #ifdef __cplusplus } @@ -48,5 +50,5 @@ extern asn_TYPE_descriptor_t asn_DEF_OTD_MsrElementFirst; #include "TOA-MeasurementsOfRef.h" #include "SeqOfOTD-FirstSetMsrs.h" -#endif /* _OTD_MsrElementFirst_H_ */ +#endif /* _OTD_MsrElementFirst_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/OTD-MsrElementRest.h b/src/core/libs/supl/asn-rrlp/OTD-MsrElementRest.h index a87a3c7fb..fd1955652 100644 --- a/src/core/libs/supl/asn-rrlp/OTD-MsrElementRest.h +++ b/src/core/libs/supl/asn-rrlp/OTD-MsrElementRest.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _OTD_MsrElementRest_H_ -#define _OTD_MsrElementRest_H_ +#ifndef _OTD_MsrElementRest_H_ +#define _OTD_MsrElementRest_H_ #include @@ -17,28 +17,30 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Forward declarations */ -struct TOA_MeasurementsOfRef; -struct SeqOfOTD_MsrsOfOtherSets; + /* Forward declarations */ + struct TOA_MeasurementsOfRef; + struct SeqOfOTD_MsrsOfOtherSets; -/* OTD-MsrElementRest */ -typedef struct OTD_MsrElementRest { - long refFrameNumber; - ModuloTimeSlot_t referenceTimeSlot; - struct TOA_MeasurementsOfRef *toaMeasurementsOfRef /* OPTIONAL */; - StdResolution_t stdResolution; - long *taCorrection /* OPTIONAL */; - struct SeqOfOTD_MsrsOfOtherSets *otd_MsrsOfOtherSets /* OPTIONAL */; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} OTD_MsrElementRest_t; + /* OTD-MsrElementRest */ + typedef struct OTD_MsrElementRest + { + long refFrameNumber; + ModuloTimeSlot_t referenceTimeSlot; + struct TOA_MeasurementsOfRef *toaMeasurementsOfRef /* OPTIONAL */; + StdResolution_t stdResolution; + long *taCorrection /* OPTIONAL */; + struct SeqOfOTD_MsrsOfOtherSets *otd_MsrsOfOtherSets /* OPTIONAL */; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_OTD_MsrElementRest; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } OTD_MsrElementRest_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_OTD_MsrElementRest; #ifdef __cplusplus } @@ -48,5 +50,5 @@ extern asn_TYPE_descriptor_t asn_DEF_OTD_MsrElementRest; #include "TOA-MeasurementsOfRef.h" #include "SeqOfOTD-MsrsOfOtherSets.h" -#endif /* _OTD_MsrElementRest_H_ */ +#endif /* _OTD_MsrElementRest_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/OTD-MsrsOfOtherSets.h b/src/core/libs/supl/asn-rrlp/OTD-MsrsOfOtherSets.h index ec2efd3a2..7df79d03a 100644 --- a/src/core/libs/supl/asn-rrlp/OTD-MsrsOfOtherSets.h +++ b/src/core/libs/supl/asn-rrlp/OTD-MsrsOfOtherSets.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _OTD_MsrsOfOtherSets_H_ -#define _OTD_MsrsOfOtherSets_H_ +#ifndef _OTD_MsrsOfOtherSets_H_ +#define _OTD_MsrsOfOtherSets_H_ #include @@ -16,34 +16,38 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Dependencies */ -typedef enum OTD_MsrsOfOtherSets_PR { - OTD_MsrsOfOtherSets_PR_NOTHING, /* No components present */ - OTD_MsrsOfOtherSets_PR_identityNotPresent, - OTD_MsrsOfOtherSets_PR_identityPresent -} OTD_MsrsOfOtherSets_PR; + /* Dependencies */ + typedef enum OTD_MsrsOfOtherSets_PR + { + OTD_MsrsOfOtherSets_PR_NOTHING, /* No components present */ + OTD_MsrsOfOtherSets_PR_identityNotPresent, + OTD_MsrsOfOtherSets_PR_identityPresent + } OTD_MsrsOfOtherSets_PR; -/* OTD-MsrsOfOtherSets */ -typedef struct OTD_MsrsOfOtherSets { - OTD_MsrsOfOtherSets_PR present; - union OTD_MsrsOfOtherSets_u { - OTD_Measurement_t identityNotPresent; - OTD_MeasurementWithID_t identityPresent; - } choice; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} OTD_MsrsOfOtherSets_t; + /* OTD-MsrsOfOtherSets */ + typedef struct OTD_MsrsOfOtherSets + { + OTD_MsrsOfOtherSets_PR present; + union OTD_MsrsOfOtherSets_u + { + OTD_Measurement_t identityNotPresent; + OTD_MeasurementWithID_t identityPresent; + } choice; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_OTD_MsrsOfOtherSets; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } OTD_MsrsOfOtherSets_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_OTD_MsrsOfOtherSets; #ifdef __cplusplus } #endif -#endif /* _OTD_MsrsOfOtherSets_H_ */ +#endif /* _OTD_MsrsOfOtherSets_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/OTDValue.h b/src/core/libs/supl/asn-rrlp/OTDValue.h index 39fc8a9d3..42ea5a9e4 100644 --- a/src/core/libs/supl/asn-rrlp/OTDValue.h +++ b/src/core/libs/supl/asn-rrlp/OTDValue.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _OTDValue_H_ -#define _OTDValue_H_ +#ifndef _OTDValue_H_ +#define _OTDValue_H_ #include @@ -14,27 +14,28 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* OTDValue */ -typedef long OTDValue_t; + /* OTDValue */ + typedef long OTDValue_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_OTDValue; -asn_struct_free_f OTDValue_free; -asn_struct_print_f OTDValue_print; -asn_constr_check_f OTDValue_constraint; -ber_type_decoder_f OTDValue_decode_ber; -der_type_encoder_f OTDValue_encode_der; -xer_type_decoder_f OTDValue_decode_xer; -xer_type_encoder_f OTDValue_encode_xer; -per_type_decoder_f OTDValue_decode_uper; -per_type_encoder_f OTDValue_encode_uper; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_OTDValue; + asn_struct_free_f OTDValue_free; + asn_struct_print_f OTDValue_print; + asn_constr_check_f OTDValue_constraint; + ber_type_decoder_f OTDValue_decode_ber; + der_type_encoder_f OTDValue_encode_der; + xer_type_decoder_f OTDValue_decode_xer; + xer_type_encoder_f OTDValue_encode_xer; + per_type_decoder_f OTDValue_decode_uper; + per_type_encoder_f OTDValue_encode_uper; #ifdef __cplusplus } #endif -#endif /* _OTDValue_H_ */ +#endif /* _OTDValue_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/PDU.h b/src/core/libs/supl/asn-rrlp/PDU.h index e73e9958a..5a815aaf5 100644 --- a/src/core/libs/supl/asn-rrlp/PDU.h +++ b/src/core/libs/supl/asn-rrlp/PDU.h @@ -4,8 +4,8 @@ * found in "../rrlp-messages.asn" */ -#ifndef _PDU_H_ -#define _PDU_H_ +#ifndef _PDU_H_ +#define _PDU_H_ #include @@ -16,24 +16,26 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* PDU */ -typedef struct PDU { - long referenceNumber; - RRLP_Component_t component; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} PDU_t; + /* PDU */ + typedef struct PDU + { + long referenceNumber; + RRLP_Component_t component; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_PDU; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } PDU_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_PDU; #ifdef __cplusplus } #endif -#endif /* _PDU_H_ */ +#endif /* _PDU_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/PositionData.h b/src/core/libs/supl/asn-rrlp/PositionData.h index fddb87bcd..7545873ef 100644 --- a/src/core/libs/supl/asn-rrlp/PositionData.h +++ b/src/core/libs/supl/asn-rrlp/PositionData.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _PositionData_H_ -#define _PositionData_H_ +#ifndef _PositionData_H_ +#define _PositionData_H_ #include @@ -14,34 +14,36 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Dependencies */ -typedef enum PositionData { - PositionData_e_otd = 0, - PositionData_gps = 1, - PositionData_galileo = 2 -} e_PositionData; + /* Dependencies */ + typedef enum PositionData + { + PositionData_e_otd = 0, + PositionData_gps = 1, + PositionData_galileo = 2 + } e_PositionData; -/* PositionData */ -typedef BIT_STRING_t PositionData_t; + /* PositionData */ + typedef BIT_STRING_t PositionData_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_PositionData; -asn_struct_free_f PositionData_free; -asn_struct_print_f PositionData_print; -asn_constr_check_f PositionData_constraint; -ber_type_decoder_f PositionData_decode_ber; -der_type_encoder_f PositionData_encode_der; -xer_type_decoder_f PositionData_decode_xer; -xer_type_encoder_f PositionData_encode_xer; -per_type_decoder_f PositionData_decode_uper; -per_type_encoder_f PositionData_encode_uper; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_PositionData; + asn_struct_free_f PositionData_free; + asn_struct_print_f PositionData_print; + asn_constr_check_f PositionData_constraint; + ber_type_decoder_f PositionData_decode_ber; + der_type_encoder_f PositionData_encode_der; + xer_type_decoder_f PositionData_decode_xer; + xer_type_encoder_f PositionData_encode_xer; + per_type_decoder_f PositionData_decode_uper; + per_type_encoder_f PositionData_encode_uper; #ifdef __cplusplus } #endif -#endif /* _PositionData_H_ */ +#endif /* _PositionData_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/PositionInstruct.h b/src/core/libs/supl/asn-rrlp/PositionInstruct.h index 43119ef57..e0e49f72f 100644 --- a/src/core/libs/supl/asn-rrlp/PositionInstruct.h +++ b/src/core/libs/supl/asn-rrlp/PositionInstruct.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _PositionInstruct_H_ -#define _PositionInstruct_H_ +#ifndef _PositionInstruct_H_ +#define _PositionInstruct_H_ #include @@ -19,27 +19,29 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* PositionInstruct */ -typedef struct PositionInstruct { - MethodType_t methodType; - PositionMethod_t positionMethod; - MeasureResponseTime_t measureResponseTime; - UseMultipleSets_t useMultipleSets; - EnvironmentCharacter_t *environmentCharacter /* OPTIONAL */; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} PositionInstruct_t; + /* PositionInstruct */ + typedef struct PositionInstruct + { + MethodType_t methodType; + PositionMethod_t positionMethod; + MeasureResponseTime_t measureResponseTime; + UseMultipleSets_t useMultipleSets; + EnvironmentCharacter_t *environmentCharacter /* OPTIONAL */; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_PositionInstruct; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } PositionInstruct_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_PositionInstruct; #ifdef __cplusplus } #endif -#endif /* _PositionInstruct_H_ */ +#endif /* _PositionInstruct_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/PositionMethod.h b/src/core/libs/supl/asn-rrlp/PositionMethod.h index 82e88091d..64db54e6c 100644 --- a/src/core/libs/supl/asn-rrlp/PositionMethod.h +++ b/src/core/libs/supl/asn-rrlp/PositionMethod.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _PositionMethod_H_ -#define _PositionMethod_H_ +#ifndef _PositionMethod_H_ +#define _PositionMethod_H_ #include @@ -14,34 +14,36 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Dependencies */ -typedef enum PositionMethod { - PositionMethod_eotd = 0, - PositionMethod_gps = 1, - PositionMethod_gpsOrEOTD = 2 -} e_PositionMethod; + /* Dependencies */ + typedef enum PositionMethod + { + PositionMethod_eotd = 0, + PositionMethod_gps = 1, + PositionMethod_gpsOrEOTD = 2 + } e_PositionMethod; -/* PositionMethod */ -typedef ENUMERATED_t PositionMethod_t; + /* PositionMethod */ + typedef ENUMERATED_t PositionMethod_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_PositionMethod; -asn_struct_free_f PositionMethod_free; -asn_struct_print_f PositionMethod_print; -asn_constr_check_f PositionMethod_constraint; -ber_type_decoder_f PositionMethod_decode_ber; -der_type_encoder_f PositionMethod_encode_der; -xer_type_decoder_f PositionMethod_decode_xer; -xer_type_encoder_f PositionMethod_encode_xer; -per_type_decoder_f PositionMethod_decode_uper; -per_type_encoder_f PositionMethod_encode_uper; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_PositionMethod; + asn_struct_free_f PositionMethod_free; + asn_struct_print_f PositionMethod_print; + asn_constr_check_f PositionMethod_constraint; + ber_type_decoder_f PositionMethod_decode_ber; + der_type_encoder_f PositionMethod_encode_der; + xer_type_decoder_f PositionMethod_decode_xer; + xer_type_encoder_f PositionMethod_encode_xer; + per_type_decoder_f PositionMethod_decode_uper; + per_type_encoder_f PositionMethod_encode_uper; #ifdef __cplusplus } #endif -#endif /* _PositionMethod_H_ */ +#endif /* _PositionMethod_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/ProtocolError.h b/src/core/libs/supl/asn-rrlp/ProtocolError.h index 00a94c40f..8dd1b0fdc 100644 --- a/src/core/libs/supl/asn-rrlp/ProtocolError.h +++ b/src/core/libs/supl/asn-rrlp/ProtocolError.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _ProtocolError_H_ -#define _ProtocolError_H_ +#ifndef _ProtocolError_H_ +#define _ProtocolError_H_ #include @@ -16,28 +16,30 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Forward declarations */ -struct Rel_5_ProtocolError_Extension; + /* Forward declarations */ + struct Rel_5_ProtocolError_Extension; -/* ProtocolError */ -typedef struct ProtocolError { - ErrorCodes_t errorCause; - ExtensionContainer_t *extensionContainer /* OPTIONAL */; - /* + /* ProtocolError */ + typedef struct ProtocolError + { + ErrorCodes_t errorCause; + ExtensionContainer_t *extensionContainer /* OPTIONAL */; + /* * This type is extensible, * possible extensions are below. */ - struct Rel_5_ProtocolError_Extension *rel_5_ProtocolError_Extension /* OPTIONAL */; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} ProtocolError_t; + struct Rel_5_ProtocolError_Extension *rel_5_ProtocolError_Extension /* OPTIONAL */; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_ProtocolError; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } ProtocolError_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_ProtocolError; #ifdef __cplusplus } @@ -46,5 +48,5 @@ extern asn_TYPE_descriptor_t asn_DEF_ProtocolError; /* Referred external types */ #include "Rel-5-ProtocolError-Extension.h" -#endif /* _ProtocolError_H_ */ +#endif /* _ProtocolError_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/RRLP-Component.h b/src/core/libs/supl/asn-rrlp/RRLP-Component.h index 021f54a4f..02208b69d 100644 --- a/src/core/libs/supl/asn-rrlp/RRLP-Component.h +++ b/src/core/libs/supl/asn-rrlp/RRLP-Component.h @@ -4,8 +4,8 @@ * found in "../rrlp-messages.asn" */ -#ifndef _RRLP_Component_H_ -#define _RRLP_Component_H_ +#ifndef _RRLP_Component_H_ +#define _RRLP_Component_H_ #include @@ -19,46 +19,50 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Dependencies */ -typedef enum RRLP_Component_PR { - RRLP_Component_PR_NOTHING, /* No components present */ - RRLP_Component_PR_msrPositionReq, - RRLP_Component_PR_msrPositionRsp, - RRLP_Component_PR_assistanceData, - RRLP_Component_PR_assistanceDataAck, - RRLP_Component_PR_protocolError, - /* Extensions may appear below */ - -} RRLP_Component_PR; + /* Dependencies */ + typedef enum RRLP_Component_PR + { + RRLP_Component_PR_NOTHING, /* No components present */ + RRLP_Component_PR_msrPositionReq, + RRLP_Component_PR_msrPositionRsp, + RRLP_Component_PR_assistanceData, + RRLP_Component_PR_assistanceDataAck, + RRLP_Component_PR_protocolError, + /* Extensions may appear below */ -/* RRLP-Component */ -typedef struct RRLP_Component { - RRLP_Component_PR present; - union RRLP_Component_u { - MsrPosition_Req_t msrPositionReq; - MsrPosition_Rsp_t msrPositionRsp; - AssistanceData_t assistanceData; - NULL_t assistanceDataAck; - ProtocolError_t protocolError; - /* + } RRLP_Component_PR; + + /* RRLP-Component */ + typedef struct RRLP_Component + { + RRLP_Component_PR present; + union RRLP_Component_u + { + MsrPosition_Req_t msrPositionReq; + MsrPosition_Rsp_t msrPositionRsp; + AssistanceData_t assistanceData; + NULL_t assistanceDataAck; + ProtocolError_t protocolError; + /* * This type is extensible, * possible extensions are below. */ - } choice; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} RRLP_Component_t; + } choice; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_RRLP_Component; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } RRLP_Component_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_RRLP_Component; #ifdef __cplusplus } #endif -#endif /* _RRLP_Component_H_ */ +#endif /* _RRLP_Component_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/RefLocation.h b/src/core/libs/supl/asn-rrlp/RefLocation.h index 0a0849c58..d95632425 100644 --- a/src/core/libs/supl/asn-rrlp/RefLocation.h +++ b/src/core/libs/supl/asn-rrlp/RefLocation.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _RefLocation_H_ -#define _RefLocation_H_ +#ifndef _RefLocation_H_ +#define _RefLocation_H_ #include @@ -15,23 +15,25 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* RefLocation */ -typedef struct RefLocation { - Ext_GeographicalInformation_t threeDLocation; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} RefLocation_t; + /* RefLocation */ + typedef struct RefLocation + { + Ext_GeographicalInformation_t threeDLocation; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_RefLocation; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } RefLocation_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_RefLocation; #ifdef __cplusplus } #endif -#endif /* _RefLocation_H_ */ +#endif /* _RefLocation_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/RefQuality.h b/src/core/libs/supl/asn-rrlp/RefQuality.h index 1fe321512..d8e0f451d 100644 --- a/src/core/libs/supl/asn-rrlp/RefQuality.h +++ b/src/core/libs/supl/asn-rrlp/RefQuality.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _RefQuality_H_ -#define _RefQuality_H_ +#ifndef _RefQuality_H_ +#define _RefQuality_H_ #include @@ -14,27 +14,28 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* RefQuality */ -typedef long RefQuality_t; + /* RefQuality */ + typedef long RefQuality_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_RefQuality; -asn_struct_free_f RefQuality_free; -asn_struct_print_f RefQuality_print; -asn_constr_check_f RefQuality_constraint; -ber_type_decoder_f RefQuality_decode_ber; -der_type_encoder_f RefQuality_encode_der; -xer_type_decoder_f RefQuality_decode_xer; -xer_type_encoder_f RefQuality_encode_xer; -per_type_decoder_f RefQuality_decode_uper; -per_type_encoder_f RefQuality_encode_uper; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_RefQuality; + asn_struct_free_f RefQuality_free; + asn_struct_print_f RefQuality_print; + asn_constr_check_f RefQuality_constraint; + ber_type_decoder_f RefQuality_decode_ber; + der_type_encoder_f RefQuality_encode_der; + xer_type_decoder_f RefQuality_decode_xer; + xer_type_encoder_f RefQuality_encode_xer; + per_type_decoder_f RefQuality_decode_uper; + per_type_encoder_f RefQuality_encode_uper; #ifdef __cplusplus } #endif -#endif /* _RefQuality_H_ */ +#endif /* _RefQuality_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/ReferenceAssistData.h b/src/core/libs/supl/asn-rrlp/ReferenceAssistData.h index 74659c650..b1e6d924a 100644 --- a/src/core/libs/supl/asn-rrlp/ReferenceAssistData.h +++ b/src/core/libs/supl/asn-rrlp/ReferenceAssistData.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _ReferenceAssistData_H_ -#define _ReferenceAssistData_H_ +#ifndef _ReferenceAssistData_H_ +#define _ReferenceAssistData_H_ #include @@ -18,26 +18,28 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* ReferenceAssistData */ -typedef struct ReferenceAssistData { - BCCHCarrier_t bcchCarrier; - BSIC_t bsic; - TimeSlotScheme_t timeSlotScheme; - BTSPosition_t *btsPosition /* OPTIONAL */; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} ReferenceAssistData_t; + /* ReferenceAssistData */ + typedef struct ReferenceAssistData + { + BCCHCarrier_t bcchCarrier; + BSIC_t bsic; + TimeSlotScheme_t timeSlotScheme; + BTSPosition_t *btsPosition /* OPTIONAL */; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_ReferenceAssistData; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } ReferenceAssistData_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_ReferenceAssistData; #ifdef __cplusplus } #endif -#endif /* _ReferenceAssistData_H_ */ +#endif /* _ReferenceAssistData_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/ReferenceFrame.h b/src/core/libs/supl/asn-rrlp/ReferenceFrame.h index 52bb0d24b..6f34f557a 100644 --- a/src/core/libs/supl/asn-rrlp/ReferenceFrame.h +++ b/src/core/libs/supl/asn-rrlp/ReferenceFrame.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _ReferenceFrame_H_ -#define _ReferenceFrame_H_ +#ifndef _ReferenceFrame_H_ +#define _ReferenceFrame_H_ #include @@ -15,24 +15,26 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* ReferenceFrame */ -typedef struct ReferenceFrame { - long referenceFN; - long *referenceFNMSB /* OPTIONAL */; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} ReferenceFrame_t; + /* ReferenceFrame */ + typedef struct ReferenceFrame + { + long referenceFN; + long *referenceFNMSB /* OPTIONAL */; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_ReferenceFrame; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } ReferenceFrame_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_ReferenceFrame; #ifdef __cplusplus } #endif -#endif /* _ReferenceFrame_H_ */ +#endif /* _ReferenceFrame_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/ReferenceIdentity.h b/src/core/libs/supl/asn-rrlp/ReferenceIdentity.h index 16088ffc6..444681d8f 100644 --- a/src/core/libs/supl/asn-rrlp/ReferenceIdentity.h +++ b/src/core/libs/supl/asn-rrlp/ReferenceIdentity.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _ReferenceIdentity_H_ -#define _ReferenceIdentity_H_ +#ifndef _ReferenceIdentity_H_ +#define _ReferenceIdentity_H_ #include @@ -15,23 +15,25 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* ReferenceIdentity */ -typedef struct ReferenceIdentity { - SeqOfReferenceIdentityType_t refBTSList; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} ReferenceIdentity_t; + /* ReferenceIdentity */ + typedef struct ReferenceIdentity + { + SeqOfReferenceIdentityType_t refBTSList; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_ReferenceIdentity; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } ReferenceIdentity_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_ReferenceIdentity; #ifdef __cplusplus } #endif -#endif /* _ReferenceIdentity_H_ */ +#endif /* _ReferenceIdentity_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/ReferenceIdentityType.h b/src/core/libs/supl/asn-rrlp/ReferenceIdentityType.h index 356f03135..6b5b8afc0 100644 --- a/src/core/libs/supl/asn-rrlp/ReferenceIdentityType.h +++ b/src/core/libs/supl/asn-rrlp/ReferenceIdentityType.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _ReferenceIdentityType_H_ -#define _ReferenceIdentityType_H_ +#ifndef _ReferenceIdentityType_H_ +#define _ReferenceIdentityType_H_ #include @@ -19,40 +19,44 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Dependencies */ -typedef enum ReferenceIdentityType_PR { - ReferenceIdentityType_PR_NOTHING, /* No components present */ - ReferenceIdentityType_PR_bsicAndCarrier, - ReferenceIdentityType_PR_ci, - ReferenceIdentityType_PR_requestIndex, - ReferenceIdentityType_PR_systemInfoIndex, - ReferenceIdentityType_PR_ciAndLAC -} ReferenceIdentityType_PR; + /* Dependencies */ + typedef enum ReferenceIdentityType_PR + { + ReferenceIdentityType_PR_NOTHING, /* No components present */ + ReferenceIdentityType_PR_bsicAndCarrier, + ReferenceIdentityType_PR_ci, + ReferenceIdentityType_PR_requestIndex, + ReferenceIdentityType_PR_systemInfoIndex, + ReferenceIdentityType_PR_ciAndLAC + } ReferenceIdentityType_PR; -/* ReferenceIdentityType */ -typedef struct ReferenceIdentityType { - ReferenceIdentityType_PR present; - union ReferenceIdentityType_u { - BSICAndCarrier_t bsicAndCarrier; - CellID_t ci; - RequestIndex_t requestIndex; - SystemInfoIndex_t systemInfoIndex; - CellIDAndLAC_t ciAndLAC; - } choice; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} ReferenceIdentityType_t; + /* ReferenceIdentityType */ + typedef struct ReferenceIdentityType + { + ReferenceIdentityType_PR present; + union ReferenceIdentityType_u + { + BSICAndCarrier_t bsicAndCarrier; + CellID_t ci; + RequestIndex_t requestIndex; + SystemInfoIndex_t systemInfoIndex; + CellIDAndLAC_t ciAndLAC; + } choice; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_ReferenceIdentityType; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } ReferenceIdentityType_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_ReferenceIdentityType; #ifdef __cplusplus } #endif -#endif /* _ReferenceIdentityType_H_ */ +#endif /* _ReferenceIdentityType_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/ReferenceRelation.h b/src/core/libs/supl/asn-rrlp/ReferenceRelation.h index c89d6dfd1..544d32483 100644 --- a/src/core/libs/supl/asn-rrlp/ReferenceRelation.h +++ b/src/core/libs/supl/asn-rrlp/ReferenceRelation.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _ReferenceRelation_H_ -#define _ReferenceRelation_H_ +#ifndef _ReferenceRelation_H_ +#define _ReferenceRelation_H_ #include @@ -14,34 +14,36 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Dependencies */ -typedef enum ReferenceRelation { - ReferenceRelation_secondBTSThirdSet = 0, - ReferenceRelation_secondBTSSecondSet = 1, - ReferenceRelation_firstBTSFirstSet = 2 -} e_ReferenceRelation; + /* Dependencies */ + typedef enum ReferenceRelation + { + ReferenceRelation_secondBTSThirdSet = 0, + ReferenceRelation_secondBTSSecondSet = 1, + ReferenceRelation_firstBTSFirstSet = 2 + } e_ReferenceRelation; -/* ReferenceRelation */ -typedef ENUMERATED_t ReferenceRelation_t; + /* ReferenceRelation */ + typedef ENUMERATED_t ReferenceRelation_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_ReferenceRelation; -asn_struct_free_f ReferenceRelation_free; -asn_struct_print_f ReferenceRelation_print; -asn_constr_check_f ReferenceRelation_constraint; -ber_type_decoder_f ReferenceRelation_decode_ber; -der_type_encoder_f ReferenceRelation_encode_der; -xer_type_decoder_f ReferenceRelation_decode_xer; -xer_type_encoder_f ReferenceRelation_encode_xer; -per_type_decoder_f ReferenceRelation_decode_uper; -per_type_encoder_f ReferenceRelation_encode_uper; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_ReferenceRelation; + asn_struct_free_f ReferenceRelation_free; + asn_struct_print_f ReferenceRelation_print; + asn_constr_check_f ReferenceRelation_constraint; + ber_type_decoder_f ReferenceRelation_decode_ber; + der_type_encoder_f ReferenceRelation_encode_der; + xer_type_decoder_f ReferenceRelation_decode_xer; + xer_type_encoder_f ReferenceRelation_encode_xer; + per_type_decoder_f ReferenceRelation_decode_uper; + per_type_encoder_f ReferenceRelation_encode_uper; #ifdef __cplusplus } #endif -#endif /* _ReferenceRelation_H_ */ +#endif /* _ReferenceRelation_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/ReferenceTime.h b/src/core/libs/supl/asn-rrlp/ReferenceTime.h index 101df484a..cf1ade693 100644 --- a/src/core/libs/supl/asn-rrlp/ReferenceTime.h +++ b/src/core/libs/supl/asn-rrlp/ReferenceTime.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _ReferenceTime_H_ -#define _ReferenceTime_H_ +#ifndef _ReferenceTime_H_ +#define _ReferenceTime_H_ #include @@ -15,25 +15,27 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Forward declarations */ -struct GSMTime; -struct GPSTOWAssist; + /* Forward declarations */ + struct GSMTime; + struct GPSTOWAssist; -/* ReferenceTime */ -typedef struct ReferenceTime { - GPSTime_t gpsTime; - struct GSMTime *gsmTime /* OPTIONAL */; - struct GPSTOWAssist *gpsTowAssist /* OPTIONAL */; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} ReferenceTime_t; + /* ReferenceTime */ + typedef struct ReferenceTime + { + GPSTime_t gpsTime; + struct GSMTime *gsmTime /* OPTIONAL */; + struct GPSTOWAssist *gpsTowAssist /* OPTIONAL */; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_ReferenceTime; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } ReferenceTime_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_ReferenceTime; #ifdef __cplusplus } @@ -43,5 +45,5 @@ extern asn_TYPE_descriptor_t asn_DEF_ReferenceTime; #include "GSMTime.h" #include "GPSTOWAssist.h" -#endif /* _ReferenceTime_H_ */ +#endif /* _ReferenceTime_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/ReferenceWGS84.h b/src/core/libs/supl/asn-rrlp/ReferenceWGS84.h index d90698cdf..544127c70 100644 --- a/src/core/libs/supl/asn-rrlp/ReferenceWGS84.h +++ b/src/core/libs/supl/asn-rrlp/ReferenceWGS84.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _ReferenceWGS84_H_ -#define _ReferenceWGS84_H_ +#ifndef _ReferenceWGS84_H_ +#define _ReferenceWGS84_H_ #include @@ -16,25 +16,27 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* ReferenceWGS84 */ -typedef struct ReferenceWGS84 { - RelDistance_t relativeNorth; - RelDistance_t relativeEast; - RelativeAlt_t *relativeAlt /* OPTIONAL */; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} ReferenceWGS84_t; + /* ReferenceWGS84 */ + typedef struct ReferenceWGS84 + { + RelDistance_t relativeNorth; + RelDistance_t relativeEast; + RelativeAlt_t *relativeAlt /* OPTIONAL */; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_ReferenceWGS84; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } ReferenceWGS84_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_ReferenceWGS84; #ifdef __cplusplus } #endif -#endif /* _ReferenceWGS84_H_ */ +#endif /* _ReferenceWGS84_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/Rel-5-MsrPosition-Rsp-Extension.h b/src/core/libs/supl/asn-rrlp/Rel-5-MsrPosition-Rsp-Extension.h index 5f3e42073..3a0f2ef4e 100644 --- a/src/core/libs/supl/asn-rrlp/Rel-5-MsrPosition-Rsp-Extension.h +++ b/src/core/libs/supl/asn-rrlp/Rel-5-MsrPosition-Rsp-Extension.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _Rel_5_MsrPosition_Rsp_Extension_H_ -#define _Rel_5_MsrPosition_Rsp_Extension_H_ +#ifndef _Rel_5_MsrPosition_Rsp_Extension_H_ +#define _Rel_5_MsrPosition_Rsp_Extension_H_ #include @@ -15,29 +15,31 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Forward declarations */ -struct Extended_reference; -struct SeqOfOTD_MsrElementRest; + /* Forward declarations */ + struct Extended_reference; + struct SeqOfOTD_MsrElementRest; -/* Rel-5-MsrPosition-Rsp-Extension */ -typedef struct Rel_5_MsrPosition_Rsp_Extension { - struct Extended_reference *extended_reference /* OPTIONAL */; - struct SeqOfOTD_MsrElementRest *otd_MeasureInfo_5_Ext /* OPTIONAL */; - UlPseudoSegInd_t *ulPseudoSegInd /* OPTIONAL */; - /* + /* Rel-5-MsrPosition-Rsp-Extension */ + typedef struct Rel_5_MsrPosition_Rsp_Extension + { + struct Extended_reference *extended_reference /* OPTIONAL */; + struct SeqOfOTD_MsrElementRest *otd_MeasureInfo_5_Ext /* OPTIONAL */; + UlPseudoSegInd_t *ulPseudoSegInd /* OPTIONAL */; + /* * This type is extensible, * possible extensions are below. */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} Rel_5_MsrPosition_Rsp_Extension_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_Rel_5_MsrPosition_Rsp_Extension; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } Rel_5_MsrPosition_Rsp_Extension_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_Rel_5_MsrPosition_Rsp_Extension; #ifdef __cplusplus } @@ -47,5 +49,5 @@ extern asn_TYPE_descriptor_t asn_DEF_Rel_5_MsrPosition_Rsp_Extension; #include "Extended-reference.h" #include "OTD-MeasureInfo-5-Ext.h" -#endif /* _Rel_5_MsrPosition_Rsp_Extension_H_ */ +#endif /* _Rel_5_MsrPosition_Rsp_Extension_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/Rel-5-ProtocolError-Extension.h b/src/core/libs/supl/asn-rrlp/Rel-5-ProtocolError-Extension.h index e73e5a0b7..00762b59c 100644 --- a/src/core/libs/supl/asn-rrlp/Rel-5-ProtocolError-Extension.h +++ b/src/core/libs/supl/asn-rrlp/Rel-5-ProtocolError-Extension.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _Rel_5_ProtocolError_Extension_H_ -#define _Rel_5_ProtocolError_Extension_H_ +#ifndef _Rel_5_ProtocolError_Extension_H_ +#define _Rel_5_ProtocolError_Extension_H_ #include @@ -14,26 +14,28 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Forward declarations */ -struct Extended_reference; + /* Forward declarations */ + struct Extended_reference; -/* Rel-5-ProtocolError-Extension */ -typedef struct Rel_5_ProtocolError_Extension { - struct Extended_reference *extended_reference /* OPTIONAL */; - /* + /* Rel-5-ProtocolError-Extension */ + typedef struct Rel_5_ProtocolError_Extension + { + struct Extended_reference *extended_reference /* OPTIONAL */; + /* * This type is extensible, * possible extensions are below. */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} Rel_5_ProtocolError_Extension_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_Rel_5_ProtocolError_Extension; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } Rel_5_ProtocolError_Extension_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_Rel_5_ProtocolError_Extension; #ifdef __cplusplus } @@ -42,5 +44,5 @@ extern asn_TYPE_descriptor_t asn_DEF_Rel_5_ProtocolError_Extension; /* Referred external types */ #include "Extended-reference.h" -#endif /* _Rel_5_ProtocolError_Extension_H_ */ +#endif /* _Rel_5_ProtocolError_Extension_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/Rel-7-MsrPosition-Rsp-Extension.h b/src/core/libs/supl/asn-rrlp/Rel-7-MsrPosition-Rsp-Extension.h index 771706639..d030be0bf 100644 --- a/src/core/libs/supl/asn-rrlp/Rel-7-MsrPosition-Rsp-Extension.h +++ b/src/core/libs/supl/asn-rrlp/Rel-7-MsrPosition-Rsp-Extension.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _Rel_7_MsrPosition_Rsp_Extension_H_ -#define _Rel_7_MsrPosition_Rsp_Extension_H_ +#ifndef _Rel_7_MsrPosition_Rsp_Extension_H_ +#define _Rel_7_MsrPosition_Rsp_Extension_H_ #include @@ -15,29 +15,31 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Forward declarations */ -struct GANSSLocationInfo; -struct GANSSMeasureInfo; + /* Forward declarations */ + struct GANSSLocationInfo; + struct GANSSMeasureInfo; -/* Rel-7-MsrPosition-Rsp-Extension */ -typedef struct Rel_7_MsrPosition_Rsp_Extension { - VelocityEstimate_t *velEstimate /* OPTIONAL */; - struct GANSSLocationInfo *ganssLocationInfo /* OPTIONAL */; - struct GANSSMeasureInfo *ganssMeasureInfo /* OPTIONAL */; - /* + /* Rel-7-MsrPosition-Rsp-Extension */ + typedef struct Rel_7_MsrPosition_Rsp_Extension + { + VelocityEstimate_t *velEstimate /* OPTIONAL */; + struct GANSSLocationInfo *ganssLocationInfo /* OPTIONAL */; + struct GANSSMeasureInfo *ganssMeasureInfo /* OPTIONAL */; + /* * This type is extensible, * possible extensions are below. */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} Rel_7_MsrPosition_Rsp_Extension_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_Rel_7_MsrPosition_Rsp_Extension; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } Rel_7_MsrPosition_Rsp_Extension_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_Rel_7_MsrPosition_Rsp_Extension; #ifdef __cplusplus } @@ -47,5 +49,5 @@ extern asn_TYPE_descriptor_t asn_DEF_Rel_7_MsrPosition_Rsp_Extension; #include "GANSSLocationInfo.h" #include "GANSSMeasureInfo.h" -#endif /* _Rel_7_MsrPosition_Rsp_Extension_H_ */ +#endif /* _Rel_7_MsrPosition_Rsp_Extension_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/Rel-98-MsrPosition-Rsp-Extension.h b/src/core/libs/supl/asn-rrlp/Rel-98-MsrPosition-Rsp-Extension.h index a54e43bf1..0d3425c17 100644 --- a/src/core/libs/supl/asn-rrlp/Rel-98-MsrPosition-Rsp-Extension.h +++ b/src/core/libs/supl/asn-rrlp/Rel-98-MsrPosition-Rsp-Extension.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _Rel_98_MsrPosition_Rsp_Extension_H_ -#define _Rel_98_MsrPosition_Rsp_Extension_H_ +#ifndef _Rel_98_MsrPosition_Rsp_Extension_H_ +#define _Rel_98_MsrPosition_Rsp_Extension_H_ #include @@ -14,33 +14,36 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Forward declarations */ -struct GPSTimeAssistanceMeasurements; -struct OTD_MeasureInfo_R98_Ext; + /* Forward declarations */ + struct GPSTimeAssistanceMeasurements; + struct OTD_MeasureInfo_R98_Ext; -/* Rel-98-MsrPosition-Rsp-Extension */ -typedef struct Rel_98_MsrPosition_Rsp_Extension { - struct rel_98_Ext_MeasureInfo { - struct OTD_MeasureInfo_R98_Ext *otd_MeasureInfo_R98_Ext /* OPTIONAL */; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; - } rel_98_Ext_MeasureInfo; - /* + /* Rel-98-MsrPosition-Rsp-Extension */ + typedef struct Rel_98_MsrPosition_Rsp_Extension + { + struct rel_98_Ext_MeasureInfo + { + struct OTD_MeasureInfo_R98_Ext *otd_MeasureInfo_R98_Ext /* OPTIONAL */; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } rel_98_Ext_MeasureInfo; + /* * This type is extensible, * possible extensions are below. */ - struct GPSTimeAssistanceMeasurements *timeAssistanceMeasurements /* OPTIONAL */; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} Rel_98_MsrPosition_Rsp_Extension_t; + struct GPSTimeAssistanceMeasurements *timeAssistanceMeasurements /* OPTIONAL */; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_Rel_98_MsrPosition_Rsp_Extension; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } Rel_98_MsrPosition_Rsp_Extension_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_Rel_98_MsrPosition_Rsp_Extension; #ifdef __cplusplus } @@ -50,5 +53,5 @@ extern asn_TYPE_descriptor_t asn_DEF_Rel_98_MsrPosition_Rsp_Extension; #include "GPSTimeAssistanceMeasurements.h" #include "OTD-MeasureInfo-R98-Ext.h" -#endif /* _Rel_98_MsrPosition_Rsp_Extension_H_ */ +#endif /* _Rel_98_MsrPosition_Rsp_Extension_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/Rel5-AssistanceData-Extension.h b/src/core/libs/supl/asn-rrlp/Rel5-AssistanceData-Extension.h index 5f38409b5..77ad994dd 100644 --- a/src/core/libs/supl/asn-rrlp/Rel5-AssistanceData-Extension.h +++ b/src/core/libs/supl/asn-rrlp/Rel5-AssistanceData-Extension.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _Rel5_AssistanceData_Extension_H_ -#define _Rel5_AssistanceData_Extension_H_ +#ifndef _Rel5_AssistanceData_Extension_H_ +#define _Rel5_AssistanceData_Extension_H_ #include @@ -15,27 +15,29 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Rel5-AssistanceData-Extension */ -typedef struct Rel5_AssistanceData_Extension { - Extended_reference_t extended_reference; - /* + /* Rel5-AssistanceData-Extension */ + typedef struct Rel5_AssistanceData_Extension + { + Extended_reference_t extended_reference; + /* * This type is extensible, * possible extensions are below. */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} Rel5_AssistanceData_Extension_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_Rel5_AssistanceData_Extension; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } Rel5_AssistanceData_Extension_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_Rel5_AssistanceData_Extension; #ifdef __cplusplus } #endif -#endif /* _Rel5_AssistanceData_Extension_H_ */ +#endif /* _Rel5_AssistanceData_Extension_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/Rel5-MsrPosition-Req-Extension.h b/src/core/libs/supl/asn-rrlp/Rel5-MsrPosition-Req-Extension.h index 498073afb..d566be25f 100644 --- a/src/core/libs/supl/asn-rrlp/Rel5-MsrPosition-Req-Extension.h +++ b/src/core/libs/supl/asn-rrlp/Rel5-MsrPosition-Req-Extension.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _Rel5_MsrPosition_Req_Extension_H_ -#define _Rel5_MsrPosition_Req_Extension_H_ +#ifndef _Rel5_MsrPosition_Req_Extension_H_ +#define _Rel5_MsrPosition_Req_Extension_H_ #include @@ -15,27 +15,29 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Rel5-MsrPosition-Req-Extension */ -typedef struct Rel5_MsrPosition_Req_Extension { - Extended_reference_t extended_reference; - /* + /* Rel5-MsrPosition-Req-Extension */ + typedef struct Rel5_MsrPosition_Req_Extension + { + Extended_reference_t extended_reference; + /* * This type is extensible, * possible extensions are below. */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} Rel5_MsrPosition_Req_Extension_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_Rel5_MsrPosition_Req_Extension; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } Rel5_MsrPosition_Req_Extension_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_Rel5_MsrPosition_Req_Extension; #ifdef __cplusplus } #endif -#endif /* _Rel5_MsrPosition_Req_Extension_H_ */ +#endif /* _Rel5_MsrPosition_Req_Extension_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/Rel7-AssistanceData-Extension.h b/src/core/libs/supl/asn-rrlp/Rel7-AssistanceData-Extension.h index 34778f32e..4ecb0ffc5 100644 --- a/src/core/libs/supl/asn-rrlp/Rel7-AssistanceData-Extension.h +++ b/src/core/libs/supl/asn-rrlp/Rel7-AssistanceData-Extension.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _Rel7_AssistanceData_Extension_H_ -#define _Rel7_AssistanceData_Extension_H_ +#ifndef _Rel7_AssistanceData_Extension_H_ +#define _Rel7_AssistanceData_Extension_H_ #include @@ -15,28 +15,30 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Forward declarations */ -struct GANSS_AssistData; + /* Forward declarations */ + struct GANSS_AssistData; -/* Rel7-AssistanceData-Extension */ -typedef struct Rel7_AssistanceData_Extension { - struct GANSS_AssistData *ganss_AssistData /* OPTIONAL */; - NULL_t *ganssCarrierPhaseMeasurementRequest /* OPTIONAL */; - NULL_t *ganssTODGSMTimeAssociationMeasurementRequest /* OPTIONAL */; - /* + /* Rel7-AssistanceData-Extension */ + typedef struct Rel7_AssistanceData_Extension + { + struct GANSS_AssistData *ganss_AssistData /* OPTIONAL */; + NULL_t *ganssCarrierPhaseMeasurementRequest /* OPTIONAL */; + NULL_t *ganssTODGSMTimeAssociationMeasurementRequest /* OPTIONAL */; + /* * This type is extensible, * possible extensions are below. */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} Rel7_AssistanceData_Extension_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_Rel7_AssistanceData_Extension; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } Rel7_AssistanceData_Extension_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_Rel7_AssistanceData_Extension; #ifdef __cplusplus } @@ -45,5 +47,5 @@ extern asn_TYPE_descriptor_t asn_DEF_Rel7_AssistanceData_Extension; /* Referred external types */ #include "GANSS-AssistData.h" -#endif /* _Rel7_AssistanceData_Extension_H_ */ +#endif /* _Rel7_AssistanceData_Extension_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/Rel7-MsrPosition-Req-Extension.h b/src/core/libs/supl/asn-rrlp/Rel7-MsrPosition-Req-Extension.h index d44d16028..690b05fa5 100644 --- a/src/core/libs/supl/asn-rrlp/Rel7-MsrPosition-Req-Extension.h +++ b/src/core/libs/supl/asn-rrlp/Rel7-MsrPosition-Req-Extension.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _Rel7_MsrPosition_Req_Extension_H_ -#define _Rel7_MsrPosition_Req_Extension_H_ +#ifndef _Rel7_MsrPosition_Req_Extension_H_ +#define _Rel7_MsrPosition_Req_Extension_H_ #include @@ -17,31 +17,33 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Forward declarations */ -struct GANSS_AssistData; + /* Forward declarations */ + struct GANSS_AssistData; -/* Rel7-MsrPosition-Req-Extension */ -typedef struct Rel7_MsrPosition_Req_Extension { - NULL_t *velocityRequested /* OPTIONAL */; - GANSSPositioningMethod_t *ganssPositionMethod /* OPTIONAL */; - struct GANSS_AssistData *ganss_AssistData /* OPTIONAL */; - NULL_t *ganssCarrierPhaseMeasurementRequest /* OPTIONAL */; - NULL_t *ganssTODGSMTimeAssociationMeasurementRequest /* OPTIONAL */; - RequiredResponseTime_t *requiredResponseTime /* OPTIONAL */; - /* + /* Rel7-MsrPosition-Req-Extension */ + typedef struct Rel7_MsrPosition_Req_Extension + { + NULL_t *velocityRequested /* OPTIONAL */; + GANSSPositioningMethod_t *ganssPositionMethod /* OPTIONAL */; + struct GANSS_AssistData *ganss_AssistData /* OPTIONAL */; + NULL_t *ganssCarrierPhaseMeasurementRequest /* OPTIONAL */; + NULL_t *ganssTODGSMTimeAssociationMeasurementRequest /* OPTIONAL */; + RequiredResponseTime_t *requiredResponseTime /* OPTIONAL */; + /* * This type is extensible, * possible extensions are below. */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} Rel7_MsrPosition_Req_Extension_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_Rel7_MsrPosition_Req_Extension; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } Rel7_MsrPosition_Req_Extension_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_Rel7_MsrPosition_Req_Extension; #ifdef __cplusplus } @@ -50,5 +52,5 @@ extern asn_TYPE_descriptor_t asn_DEF_Rel7_MsrPosition_Req_Extension; /* Referred external types */ #include "GANSS-AssistData.h" -#endif /* _Rel7_MsrPosition_Req_Extension_H_ */ +#endif /* _Rel7_MsrPosition_Req_Extension_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/Rel98-AssistanceData-Extension.h b/src/core/libs/supl/asn-rrlp/Rel98-AssistanceData-Extension.h index 87c6177f6..f8e314e77 100644 --- a/src/core/libs/supl/asn-rrlp/Rel98-AssistanceData-Extension.h +++ b/src/core/libs/supl/asn-rrlp/Rel98-AssistanceData-Extension.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _Rel98_AssistanceData_Extension_H_ -#define _Rel98_AssistanceData_Extension_H_ +#ifndef _Rel98_AssistanceData_Extension_H_ +#define _Rel98_AssistanceData_Extension_H_ #include @@ -16,28 +16,30 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Forward declarations */ -struct Rel98_Ext_ExpOTD; + /* Forward declarations */ + struct Rel98_Ext_ExpOTD; -/* Rel98-AssistanceData-Extension */ -typedef struct Rel98_AssistanceData_Extension { - struct Rel98_Ext_ExpOTD *rel98_Ext_ExpOTD /* OPTIONAL */; - /* + /* Rel98-AssistanceData-Extension */ + typedef struct Rel98_AssistanceData_Extension + { + struct Rel98_Ext_ExpOTD *rel98_Ext_ExpOTD /* OPTIONAL */; + /* * This type is extensible, * possible extensions are below. */ - NULL_t *gpsTimeAssistanceMeasurementRequest /* OPTIONAL */; - GPSReferenceTimeUncertainty_t *gpsReferenceTimeUncertainty /* OPTIONAL */; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} Rel98_AssistanceData_Extension_t; + NULL_t *gpsTimeAssistanceMeasurementRequest /* OPTIONAL */; + GPSReferenceTimeUncertainty_t *gpsReferenceTimeUncertainty /* OPTIONAL */; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_Rel98_AssistanceData_Extension; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } Rel98_AssistanceData_Extension_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_Rel98_AssistanceData_Extension; #ifdef __cplusplus } @@ -46,5 +48,5 @@ extern asn_TYPE_descriptor_t asn_DEF_Rel98_AssistanceData_Extension; /* Referred external types */ #include "Rel98-Ext-ExpOTD.h" -#endif /* _Rel98_AssistanceData_Extension_H_ */ +#endif /* _Rel98_AssistanceData_Extension_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/Rel98-Ext-ExpOTD.h b/src/core/libs/supl/asn-rrlp/Rel98-Ext-ExpOTD.h index 48169dd3f..75903c13f 100644 --- a/src/core/libs/supl/asn-rrlp/Rel98-Ext-ExpOTD.h +++ b/src/core/libs/supl/asn-rrlp/Rel98-Ext-ExpOTD.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _Rel98_Ext_ExpOTD_H_ -#define _Rel98_Ext_ExpOTD_H_ +#ifndef _Rel98_Ext_ExpOTD_H_ +#define _Rel98_Ext_ExpOTD_H_ #include @@ -14,24 +14,26 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Forward declarations */ -struct MsrAssistData_R98_ExpOTD; -struct SystemInfoAssistData_R98_ExpOTD; + /* Forward declarations */ + struct MsrAssistData_R98_ExpOTD; + struct SystemInfoAssistData_R98_ExpOTD; -/* Rel98-Ext-ExpOTD */ -typedef struct Rel98_Ext_ExpOTD { - struct MsrAssistData_R98_ExpOTD *msrAssistData_R98_ExpOTD /* OPTIONAL */; - struct SystemInfoAssistData_R98_ExpOTD *systemInfoAssistData_R98_ExpOTD /* OPTIONAL */; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} Rel98_Ext_ExpOTD_t; + /* Rel98-Ext-ExpOTD */ + typedef struct Rel98_Ext_ExpOTD + { + struct MsrAssistData_R98_ExpOTD *msrAssistData_R98_ExpOTD /* OPTIONAL */; + struct SystemInfoAssistData_R98_ExpOTD *systemInfoAssistData_R98_ExpOTD /* OPTIONAL */; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_Rel98_Ext_ExpOTD; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } Rel98_Ext_ExpOTD_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_Rel98_Ext_ExpOTD; #ifdef __cplusplus } @@ -41,5 +43,5 @@ extern asn_TYPE_descriptor_t asn_DEF_Rel98_Ext_ExpOTD; #include "MsrAssistData-R98-ExpOTD.h" #include "SystemInfoAssistData-R98-ExpOTD.h" -#endif /* _Rel98_Ext_ExpOTD_H_ */ +#endif /* _Rel98_Ext_ExpOTD_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/Rel98-MsrPosition-Req-Extension.h b/src/core/libs/supl/asn-rrlp/Rel98-MsrPosition-Req-Extension.h index 39913e245..3922335b3 100644 --- a/src/core/libs/supl/asn-rrlp/Rel98-MsrPosition-Req-Extension.h +++ b/src/core/libs/supl/asn-rrlp/Rel98-MsrPosition-Req-Extension.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _Rel98_MsrPosition_Req_Extension_H_ -#define _Rel98_MsrPosition_Req_Extension_H_ +#ifndef _Rel98_MsrPosition_Req_Extension_H_ +#define _Rel98_MsrPosition_Req_Extension_H_ #include @@ -16,28 +16,30 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Forward declarations */ -struct Rel98_Ext_ExpOTD; + /* Forward declarations */ + struct Rel98_Ext_ExpOTD; -/* Rel98-MsrPosition-Req-Extension */ -typedef struct Rel98_MsrPosition_Req_Extension { - struct Rel98_Ext_ExpOTD *rel98_Ext_ExpOTD /* OPTIONAL */; - /* + /* Rel98-MsrPosition-Req-Extension */ + typedef struct Rel98_MsrPosition_Req_Extension + { + struct Rel98_Ext_ExpOTD *rel98_Ext_ExpOTD /* OPTIONAL */; + /* * This type is extensible, * possible extensions are below. */ - NULL_t *gpsTimeAssistanceMeasurementRequest /* OPTIONAL */; - GPSReferenceTimeUncertainty_t *gpsReferenceTimeUncertainty /* OPTIONAL */; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} Rel98_MsrPosition_Req_Extension_t; + NULL_t *gpsTimeAssistanceMeasurementRequest /* OPTIONAL */; + GPSReferenceTimeUncertainty_t *gpsReferenceTimeUncertainty /* OPTIONAL */; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_Rel98_MsrPosition_Req_Extension; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } Rel98_MsrPosition_Req_Extension_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_Rel98_MsrPosition_Req_Extension; #ifdef __cplusplus } @@ -46,5 +48,5 @@ extern asn_TYPE_descriptor_t asn_DEF_Rel98_MsrPosition_Req_Extension; /* Referred external types */ #include "Rel98-Ext-ExpOTD.h" -#endif /* _Rel98_MsrPosition_Req_Extension_H_ */ +#endif /* _Rel98_MsrPosition_Req_Extension_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/RelDistance.h b/src/core/libs/supl/asn-rrlp/RelDistance.h index 290bfa795..a9437f579 100644 --- a/src/core/libs/supl/asn-rrlp/RelDistance.h +++ b/src/core/libs/supl/asn-rrlp/RelDistance.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _RelDistance_H_ -#define _RelDistance_H_ +#ifndef _RelDistance_H_ +#define _RelDistance_H_ #include @@ -14,27 +14,28 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* RelDistance */ -typedef long RelDistance_t; + /* RelDistance */ + typedef long RelDistance_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_RelDistance; -asn_struct_free_f RelDistance_free; -asn_struct_print_f RelDistance_print; -asn_constr_check_f RelDistance_constraint; -ber_type_decoder_f RelDistance_decode_ber; -der_type_encoder_f RelDistance_encode_der; -xer_type_decoder_f RelDistance_decode_xer; -xer_type_encoder_f RelDistance_encode_xer; -per_type_decoder_f RelDistance_decode_uper; -per_type_encoder_f RelDistance_encode_uper; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_RelDistance; + asn_struct_free_f RelDistance_free; + asn_struct_print_f RelDistance_print; + asn_constr_check_f RelDistance_constraint; + ber_type_decoder_f RelDistance_decode_ber; + der_type_encoder_f RelDistance_encode_der; + xer_type_decoder_f RelDistance_decode_xer; + xer_type_encoder_f RelDistance_encode_xer; + per_type_decoder_f RelDistance_decode_uper; + per_type_encoder_f RelDistance_encode_uper; #ifdef __cplusplus } #endif -#endif /* _RelDistance_H_ */ +#endif /* _RelDistance_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/RelativeAlt.h b/src/core/libs/supl/asn-rrlp/RelativeAlt.h index f773482d4..22861f7f5 100644 --- a/src/core/libs/supl/asn-rrlp/RelativeAlt.h +++ b/src/core/libs/supl/asn-rrlp/RelativeAlt.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _RelativeAlt_H_ -#define _RelativeAlt_H_ +#ifndef _RelativeAlt_H_ +#define _RelativeAlt_H_ #include @@ -14,27 +14,28 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* RelativeAlt */ -typedef long RelativeAlt_t; + /* RelativeAlt */ + typedef long RelativeAlt_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_RelativeAlt; -asn_struct_free_f RelativeAlt_free; -asn_struct_print_f RelativeAlt_print; -asn_constr_check_f RelativeAlt_constraint; -ber_type_decoder_f RelativeAlt_decode_ber; -der_type_encoder_f RelativeAlt_encode_der; -xer_type_decoder_f RelativeAlt_decode_xer; -xer_type_encoder_f RelativeAlt_encode_xer; -per_type_decoder_f RelativeAlt_decode_uper; -per_type_encoder_f RelativeAlt_encode_uper; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_RelativeAlt; + asn_struct_free_f RelativeAlt_free; + asn_struct_print_f RelativeAlt_print; + asn_constr_check_f RelativeAlt_constraint; + ber_type_decoder_f RelativeAlt_decode_ber; + der_type_encoder_f RelativeAlt_encode_der; + xer_type_decoder_f RelativeAlt_decode_xer; + xer_type_encoder_f RelativeAlt_encode_xer; + per_type_decoder_f RelativeAlt_decode_uper; + per_type_encoder_f RelativeAlt_encode_uper; #ifdef __cplusplus } #endif -#endif /* _RelativeAlt_H_ */ +#endif /* _RelativeAlt_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/RequestIndex.h b/src/core/libs/supl/asn-rrlp/RequestIndex.h index 033a25329..177415736 100644 --- a/src/core/libs/supl/asn-rrlp/RequestIndex.h +++ b/src/core/libs/supl/asn-rrlp/RequestIndex.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _RequestIndex_H_ -#define _RequestIndex_H_ +#ifndef _RequestIndex_H_ +#define _RequestIndex_H_ #include @@ -14,27 +14,28 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* RequestIndex */ -typedef long RequestIndex_t; + /* RequestIndex */ + typedef long RequestIndex_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_RequestIndex; -asn_struct_free_f RequestIndex_free; -asn_struct_print_f RequestIndex_print; -asn_constr_check_f RequestIndex_constraint; -ber_type_decoder_f RequestIndex_decode_ber; -der_type_encoder_f RequestIndex_encode_der; -xer_type_decoder_f RequestIndex_decode_xer; -xer_type_encoder_f RequestIndex_encode_xer; -per_type_decoder_f RequestIndex_decode_uper; -per_type_encoder_f RequestIndex_encode_uper; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_RequestIndex; + asn_struct_free_f RequestIndex_free; + asn_struct_print_f RequestIndex_print; + asn_constr_check_f RequestIndex_constraint; + ber_type_decoder_f RequestIndex_decode_ber; + der_type_encoder_f RequestIndex_encode_der; + xer_type_decoder_f RequestIndex_decode_xer; + xer_type_encoder_f RequestIndex_encode_xer; + per_type_decoder_f RequestIndex_decode_uper; + per_type_encoder_f RequestIndex_encode_uper; #ifdef __cplusplus } #endif -#endif /* _RequestIndex_H_ */ +#endif /* _RequestIndex_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/RequiredResponseTime.h b/src/core/libs/supl/asn-rrlp/RequiredResponseTime.h index 0a609686b..f55669f23 100644 --- a/src/core/libs/supl/asn-rrlp/RequiredResponseTime.h +++ b/src/core/libs/supl/asn-rrlp/RequiredResponseTime.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _RequiredResponseTime_H_ -#define _RequiredResponseTime_H_ +#ifndef _RequiredResponseTime_H_ +#define _RequiredResponseTime_H_ #include @@ -14,27 +14,28 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* RequiredResponseTime */ -typedef long RequiredResponseTime_t; + /* RequiredResponseTime */ + typedef long RequiredResponseTime_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_RequiredResponseTime; -asn_struct_free_f RequiredResponseTime_free; -asn_struct_print_f RequiredResponseTime_print; -asn_constr_check_f RequiredResponseTime_constraint; -ber_type_decoder_f RequiredResponseTime_decode_ber; -der_type_encoder_f RequiredResponseTime_encode_der; -xer_type_decoder_f RequiredResponseTime_decode_xer; -xer_type_encoder_f RequiredResponseTime_encode_xer; -per_type_decoder_f RequiredResponseTime_decode_uper; -per_type_encoder_f RequiredResponseTime_encode_uper; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_RequiredResponseTime; + asn_struct_free_f RequiredResponseTime_free; + asn_struct_print_f RequiredResponseTime_print; + asn_constr_check_f RequiredResponseTime_constraint; + ber_type_decoder_f RequiredResponseTime_decode_ber; + der_type_encoder_f RequiredResponseTime_encode_der; + xer_type_decoder_f RequiredResponseTime_decode_xer; + xer_type_encoder_f RequiredResponseTime_encode_xer; + per_type_decoder_f RequiredResponseTime_decode_uper; + per_type_encoder_f RequiredResponseTime_encode_uper; #ifdef __cplusplus } #endif -#endif /* _RequiredResponseTime_H_ */ +#endif /* _RequiredResponseTime_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/RoughRTD.h b/src/core/libs/supl/asn-rrlp/RoughRTD.h index 0cbd20bf7..59e72aff4 100644 --- a/src/core/libs/supl/asn-rrlp/RoughRTD.h +++ b/src/core/libs/supl/asn-rrlp/RoughRTD.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _RoughRTD_H_ -#define _RoughRTD_H_ +#ifndef _RoughRTD_H_ +#define _RoughRTD_H_ #include @@ -14,27 +14,28 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* RoughRTD */ -typedef long RoughRTD_t; + /* RoughRTD */ + typedef long RoughRTD_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_RoughRTD; -asn_struct_free_f RoughRTD_free; -asn_struct_print_f RoughRTD_print; -asn_constr_check_f RoughRTD_constraint; -ber_type_decoder_f RoughRTD_decode_ber; -der_type_encoder_f RoughRTD_encode_der; -xer_type_decoder_f RoughRTD_decode_xer; -xer_type_encoder_f RoughRTD_encode_xer; -per_type_decoder_f RoughRTD_decode_uper; -per_type_encoder_f RoughRTD_encode_uper; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_RoughRTD; + asn_struct_free_f RoughRTD_free; + asn_struct_print_f RoughRTD_print; + asn_constr_check_f RoughRTD_constraint; + ber_type_decoder_f RoughRTD_decode_ber; + der_type_encoder_f RoughRTD_encode_der; + xer_type_decoder_f RoughRTD_decode_xer; + xer_type_encoder_f RoughRTD_encode_xer; + per_type_decoder_f RoughRTD_decode_uper; + per_type_encoder_f RoughRTD_encode_uper; #ifdef __cplusplus } #endif -#endif /* _RoughRTD_H_ */ +#endif /* _RoughRTD_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/SVID.h b/src/core/libs/supl/asn-rrlp/SVID.h index 7cb51b7b3..288162594 100644 --- a/src/core/libs/supl/asn-rrlp/SVID.h +++ b/src/core/libs/supl/asn-rrlp/SVID.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _SVID_H_ -#define _SVID_H_ +#ifndef _SVID_H_ +#define _SVID_H_ #include @@ -14,27 +14,28 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* SVID */ -typedef long SVID_t; + /* SVID */ + typedef long SVID_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_SVID; -asn_struct_free_f SVID_free; -asn_struct_print_f SVID_print; -asn_constr_check_f SVID_constraint; -ber_type_decoder_f SVID_decode_ber; -der_type_encoder_f SVID_encode_der; -xer_type_decoder_f SVID_decode_xer; -xer_type_encoder_f SVID_encode_xer; -per_type_decoder_f SVID_decode_uper; -per_type_encoder_f SVID_encode_uper; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_SVID; + asn_struct_free_f SVID_free; + asn_struct_print_f SVID_print; + asn_constr_check_f SVID_constraint; + ber_type_decoder_f SVID_decode_ber; + der_type_encoder_f SVID_encode_der; + xer_type_decoder_f SVID_decode_xer; + xer_type_encoder_f SVID_encode_xer; + per_type_decoder_f SVID_decode_uper; + per_type_encoder_f SVID_encode_uper; #ifdef __cplusplus } #endif -#endif /* _SVID_H_ */ +#endif /* _SVID_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/SVIDMASK.h b/src/core/libs/supl/asn-rrlp/SVIDMASK.h index 75c15933b..0e0e6414b 100644 --- a/src/core/libs/supl/asn-rrlp/SVIDMASK.h +++ b/src/core/libs/supl/asn-rrlp/SVIDMASK.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _SVIDMASK_H_ -#define _SVIDMASK_H_ +#ifndef _SVIDMASK_H_ +#define _SVIDMASK_H_ #include @@ -14,27 +14,28 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* SVIDMASK */ -typedef BIT_STRING_t SVIDMASK_t; + /* SVIDMASK */ + typedef BIT_STRING_t SVIDMASK_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_SVIDMASK; -asn_struct_free_f SVIDMASK_free; -asn_struct_print_f SVIDMASK_print; -asn_constr_check_f SVIDMASK_constraint; -ber_type_decoder_f SVIDMASK_decode_ber; -der_type_encoder_f SVIDMASK_encode_der; -xer_type_decoder_f SVIDMASK_decode_xer; -xer_type_encoder_f SVIDMASK_encode_xer; -per_type_decoder_f SVIDMASK_decode_uper; -per_type_encoder_f SVIDMASK_encode_uper; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_SVIDMASK; + asn_struct_free_f SVIDMASK_free; + asn_struct_print_f SVIDMASK_print; + asn_constr_check_f SVIDMASK_constraint; + ber_type_decoder_f SVIDMASK_decode_ber; + der_type_encoder_f SVIDMASK_encode_der; + xer_type_decoder_f SVIDMASK_decode_xer; + xer_type_encoder_f SVIDMASK_encode_xer; + per_type_decoder_f SVIDMASK_decode_uper; + per_type_encoder_f SVIDMASK_encode_uper; #ifdef __cplusplus } #endif -#endif /* _SVIDMASK_H_ */ +#endif /* _SVIDMASK_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/SatElement.h b/src/core/libs/supl/asn-rrlp/SatElement.h index a312d6f4c..59bcd8888 100644 --- a/src/core/libs/supl/asn-rrlp/SatElement.h +++ b/src/core/libs/supl/asn-rrlp/SatElement.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _SatElement_H_ -#define _SatElement_H_ +#ifndef _SatElement_H_ +#define _SatElement_H_ #include @@ -16,31 +16,33 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* SatElement */ -typedef struct SatElement { - SatelliteID_t satelliteID; - long iode; - long udre; - long pseudoRangeCor; - long rangeRateCor; - long deltaPseudoRangeCor2; - long deltaRangeRateCor2; - long deltaPseudoRangeCor3; - long deltaRangeRateCor3; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} SatElement_t; + /* SatElement */ + typedef struct SatElement + { + SatelliteID_t satelliteID; + long iode; + long udre; + long pseudoRangeCor; + long rangeRateCor; + long deltaPseudoRangeCor2; + long deltaRangeRateCor2; + long deltaPseudoRangeCor3; + long deltaRangeRateCor3; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_SatElement; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } SatElement_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_SatElement; #ifdef __cplusplus } #endif -#endif /* _SatElement_H_ */ +#endif /* _SatElement_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/SatStatus.h b/src/core/libs/supl/asn-rrlp/SatStatus.h index 889424d29..0673b5cd6 100644 --- a/src/core/libs/supl/asn-rrlp/SatStatus.h +++ b/src/core/libs/supl/asn-rrlp/SatStatus.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _SatStatus_H_ -#define _SatStatus_H_ +#ifndef _SatStatus_H_ +#define _SatStatus_H_ #include @@ -16,42 +16,46 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Dependencies */ -typedef enum SatStatus_PR { - SatStatus_PR_NOTHING, /* No components present */ - SatStatus_PR_newSatelliteAndModelUC, - SatStatus_PR_oldSatelliteAndModel, - SatStatus_PR_newNaviModelUC, - /* Extensions may appear below */ - -} SatStatus_PR; + /* Dependencies */ + typedef enum SatStatus_PR + { + SatStatus_PR_NOTHING, /* No components present */ + SatStatus_PR_newSatelliteAndModelUC, + SatStatus_PR_oldSatelliteAndModel, + SatStatus_PR_newNaviModelUC, + /* Extensions may appear below */ -/* SatStatus */ -typedef struct SatStatus { - SatStatus_PR present; - union SatStatus_u { - UncompressedEphemeris_t newSatelliteAndModelUC; - NULL_t oldSatelliteAndModel; - UncompressedEphemeris_t newNaviModelUC; - /* + } SatStatus_PR; + + /* SatStatus */ + typedef struct SatStatus + { + SatStatus_PR present; + union SatStatus_u + { + UncompressedEphemeris_t newSatelliteAndModelUC; + NULL_t oldSatelliteAndModel; + UncompressedEphemeris_t newNaviModelUC; + /* * This type is extensible, * possible extensions are below. */ - } choice; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} SatStatus_t; + } choice; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_SatStatus; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } SatStatus_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_SatStatus; #ifdef __cplusplus } #endif -#endif /* _SatStatus_H_ */ +#endif /* _SatStatus_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/SatelliteID.h b/src/core/libs/supl/asn-rrlp/SatelliteID.h index 834eb70ad..df5d83a7f 100644 --- a/src/core/libs/supl/asn-rrlp/SatelliteID.h +++ b/src/core/libs/supl/asn-rrlp/SatelliteID.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _SatelliteID_H_ -#define _SatelliteID_H_ +#ifndef _SatelliteID_H_ +#define _SatelliteID_H_ #include @@ -14,27 +14,28 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* SatelliteID */ -typedef long SatelliteID_t; + /* SatelliteID */ + typedef long SatelliteID_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_SatelliteID; -asn_struct_free_f SatelliteID_free; -asn_struct_print_f SatelliteID_print; -asn_constr_check_f SatelliteID_constraint; -ber_type_decoder_f SatelliteID_decode_ber; -der_type_encoder_f SatelliteID_encode_der; -xer_type_decoder_f SatelliteID_decode_xer; -xer_type_encoder_f SatelliteID_encode_xer; -per_type_decoder_f SatelliteID_decode_uper; -per_type_encoder_f SatelliteID_encode_uper; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_SatelliteID; + asn_struct_free_f SatelliteID_free; + asn_struct_print_f SatelliteID_print; + asn_constr_check_f SatelliteID_constraint; + ber_type_decoder_f SatelliteID_decode_ber; + der_type_encoder_f SatelliteID_encode_der; + xer_type_decoder_f SatelliteID_decode_xer; + xer_type_encoder_f SatelliteID_encode_xer; + per_type_decoder_f SatelliteID_decode_uper; + per_type_encoder_f SatelliteID_encode_uper; #ifdef __cplusplus } #endif -#endif /* _SatelliteID_H_ */ +#endif /* _SatelliteID_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/SeqOf-BadSatelliteSet.h b/src/core/libs/supl/asn-rrlp/SeqOf-BadSatelliteSet.h index a258a3214..97c19943f 100644 --- a/src/core/libs/supl/asn-rrlp/SeqOf-BadSatelliteSet.h +++ b/src/core/libs/supl/asn-rrlp/SeqOf-BadSatelliteSet.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _SeqOf_BadSatelliteSet_H_ -#define _SeqOf_BadSatelliteSet_H_ +#ifndef _SeqOf_BadSatelliteSet_H_ +#define _SeqOf_BadSatelliteSet_H_ #include @@ -16,23 +16,26 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* SeqOf-BadSatelliteSet */ -typedef struct SeqOf_BadSatelliteSet { - A_SEQUENCE_OF(SatelliteID_t) list; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} SeqOf_BadSatelliteSet_t; + /* SeqOf-BadSatelliteSet */ + typedef struct SeqOf_BadSatelliteSet + { + A_SEQUENCE_OF(SatelliteID_t) + list; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_SeqOf_BadSatelliteSet; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } SeqOf_BadSatelliteSet_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_SeqOf_BadSatelliteSet; #ifdef __cplusplus } #endif -#endif /* _SeqOf_BadSatelliteSet_H_ */ +#endif /* _SeqOf_BadSatelliteSet_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/SeqOf-GANSSDataBits.h b/src/core/libs/supl/asn-rrlp/SeqOf-GANSSDataBits.h index a55a8e2de..87b7a5e48 100644 --- a/src/core/libs/supl/asn-rrlp/SeqOf-GANSSDataBits.h +++ b/src/core/libs/supl/asn-rrlp/SeqOf-GANSSDataBits.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _SeqOf_GANSSDataBits_H_ -#define _SeqOf_GANSSDataBits_H_ +#ifndef _SeqOf_GANSSDataBits_H_ +#define _SeqOf_GANSSDataBits_H_ #include @@ -16,23 +16,26 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* SeqOf-GANSSDataBits */ -typedef struct SeqOf_GANSSDataBits { - A_SEQUENCE_OF(GANSSDataBit_t) list; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} SeqOf_GANSSDataBits_t; + /* SeqOf-GANSSDataBits */ + typedef struct SeqOf_GANSSDataBits + { + A_SEQUENCE_OF(GANSSDataBit_t) + list; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_SeqOf_GANSSDataBits; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } SeqOf_GANSSDataBits_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_SeqOf_GANSSDataBits; #ifdef __cplusplus } #endif -#endif /* _SeqOf_GANSSDataBits_H_ */ +#endif /* _SeqOf_GANSSDataBits_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/SeqOfAcquisElement.h b/src/core/libs/supl/asn-rrlp/SeqOfAcquisElement.h index ed7212889..4af9824af 100644 --- a/src/core/libs/supl/asn-rrlp/SeqOfAcquisElement.h +++ b/src/core/libs/supl/asn-rrlp/SeqOfAcquisElement.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _SeqOfAcquisElement_H_ -#define _SeqOfAcquisElement_H_ +#ifndef _SeqOfAcquisElement_H_ +#define _SeqOfAcquisElement_H_ #include @@ -15,22 +15,25 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Forward declarations */ -struct AcquisElement; + /* Forward declarations */ + struct AcquisElement; -/* SeqOfAcquisElement */ -typedef struct SeqOfAcquisElement { - A_SEQUENCE_OF(struct AcquisElement) list; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} SeqOfAcquisElement_t; + /* SeqOfAcquisElement */ + typedef struct SeqOfAcquisElement + { + A_SEQUENCE_OF(struct AcquisElement) + list; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_SeqOfAcquisElement; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } SeqOfAcquisElement_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_SeqOfAcquisElement; #ifdef __cplusplus } @@ -39,5 +42,5 @@ extern asn_TYPE_descriptor_t asn_DEF_SeqOfAcquisElement; /* Referred external types */ #include "AcquisElement.h" -#endif /* _SeqOfAcquisElement_H_ */ +#endif /* _SeqOfAcquisElement_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/SeqOfAlmanacElement.h b/src/core/libs/supl/asn-rrlp/SeqOfAlmanacElement.h index 1050eae30..91ada0e38 100644 --- a/src/core/libs/supl/asn-rrlp/SeqOfAlmanacElement.h +++ b/src/core/libs/supl/asn-rrlp/SeqOfAlmanacElement.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _SeqOfAlmanacElement_H_ -#define _SeqOfAlmanacElement_H_ +#ifndef _SeqOfAlmanacElement_H_ +#define _SeqOfAlmanacElement_H_ #include @@ -15,22 +15,25 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Forward declarations */ -struct AlmanacElement; + /* Forward declarations */ + struct AlmanacElement; -/* SeqOfAlmanacElement */ -typedef struct SeqOfAlmanacElement { - A_SEQUENCE_OF(struct AlmanacElement) list; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} SeqOfAlmanacElement_t; + /* SeqOfAlmanacElement */ + typedef struct SeqOfAlmanacElement + { + A_SEQUENCE_OF(struct AlmanacElement) + list; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_SeqOfAlmanacElement; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } SeqOfAlmanacElement_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_SeqOfAlmanacElement; #ifdef __cplusplus } @@ -39,5 +42,5 @@ extern asn_TYPE_descriptor_t asn_DEF_SeqOfAlmanacElement; /* Referred external types */ #include "AlmanacElement.h" -#endif /* _SeqOfAlmanacElement_H_ */ +#endif /* _SeqOfAlmanacElement_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/SeqOfBadSignalElement.h b/src/core/libs/supl/asn-rrlp/SeqOfBadSignalElement.h index 8de761fd2..a6dda3091 100644 --- a/src/core/libs/supl/asn-rrlp/SeqOfBadSignalElement.h +++ b/src/core/libs/supl/asn-rrlp/SeqOfBadSignalElement.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _SeqOfBadSignalElement_H_ -#define _SeqOfBadSignalElement_H_ +#ifndef _SeqOfBadSignalElement_H_ +#define _SeqOfBadSignalElement_H_ #include @@ -15,22 +15,25 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Forward declarations */ -struct BadSignalElement; + /* Forward declarations */ + struct BadSignalElement; -/* SeqOfBadSignalElement */ -typedef struct SeqOfBadSignalElement { - A_SEQUENCE_OF(struct BadSignalElement) list; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} SeqOfBadSignalElement_t; + /* SeqOfBadSignalElement */ + typedef struct SeqOfBadSignalElement + { + A_SEQUENCE_OF(struct BadSignalElement) + list; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_SeqOfBadSignalElement; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } SeqOfBadSignalElement_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_SeqOfBadSignalElement; #ifdef __cplusplus } @@ -39,5 +42,5 @@ extern asn_TYPE_descriptor_t asn_DEF_SeqOfBadSignalElement; /* Referred external types */ #include "BadSignalElement.h" -#endif /* _SeqOfBadSignalElement_H_ */ +#endif /* _SeqOfBadSignalElement_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/SeqOfDGANSSSgnElement.h b/src/core/libs/supl/asn-rrlp/SeqOfDGANSSSgnElement.h index 560c771d7..662a98a7d 100644 --- a/src/core/libs/supl/asn-rrlp/SeqOfDGANSSSgnElement.h +++ b/src/core/libs/supl/asn-rrlp/SeqOfDGANSSSgnElement.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _SeqOfDGANSSSgnElement_H_ -#define _SeqOfDGANSSSgnElement_H_ +#ifndef _SeqOfDGANSSSgnElement_H_ +#define _SeqOfDGANSSSgnElement_H_ #include @@ -15,22 +15,25 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Forward declarations */ -struct DGANSSSgnElement; + /* Forward declarations */ + struct DGANSSSgnElement; -/* SeqOfDGANSSSgnElement */ -typedef struct SeqOfDGANSSSgnElement { - A_SEQUENCE_OF(struct DGANSSSgnElement) list; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} SeqOfDGANSSSgnElement_t; + /* SeqOfDGANSSSgnElement */ + typedef struct SeqOfDGANSSSgnElement + { + A_SEQUENCE_OF(struct DGANSSSgnElement) + list; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_SeqOfDGANSSSgnElement; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } SeqOfDGANSSSgnElement_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_SeqOfDGANSSSgnElement; #ifdef __cplusplus } @@ -39,5 +42,5 @@ extern asn_TYPE_descriptor_t asn_DEF_SeqOfDGANSSSgnElement; /* Referred external types */ #include "DGANSSSgnElement.h" -#endif /* _SeqOfDGANSSSgnElement_H_ */ +#endif /* _SeqOfDGANSSSgnElement_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/SeqOfGANSS-MsrSetElement.h b/src/core/libs/supl/asn-rrlp/SeqOfGANSS-MsrSetElement.h index 2686188e9..dadd90007 100644 --- a/src/core/libs/supl/asn-rrlp/SeqOfGANSS-MsrSetElement.h +++ b/src/core/libs/supl/asn-rrlp/SeqOfGANSS-MsrSetElement.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _SeqOfGANSS_MsrSetElement_H_ -#define _SeqOfGANSS_MsrSetElement_H_ +#ifndef _SeqOfGANSS_MsrSetElement_H_ +#define _SeqOfGANSS_MsrSetElement_H_ #include @@ -15,22 +15,25 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Forward declarations */ -struct GANSS_MsrSetElement; + /* Forward declarations */ + struct GANSS_MsrSetElement; -/* SeqOfGANSS-MsrSetElement */ -typedef struct SeqOfGANSS_MsrSetElement { - A_SEQUENCE_OF(struct GANSS_MsrSetElement) list; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} SeqOfGANSS_MsrSetElement_t; + /* SeqOfGANSS-MsrSetElement */ + typedef struct SeqOfGANSS_MsrSetElement + { + A_SEQUENCE_OF(struct GANSS_MsrSetElement) + list; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_SeqOfGANSS_MsrSetElement; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } SeqOfGANSS_MsrSetElement_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_SeqOfGANSS_MsrSetElement; #ifdef __cplusplus } @@ -39,5 +42,5 @@ extern asn_TYPE_descriptor_t asn_DEF_SeqOfGANSS_MsrSetElement; /* Referred external types */ #include "GANSS-MsrSetElement.h" -#endif /* _SeqOfGANSS_MsrSetElement_H_ */ +#endif /* _SeqOfGANSS_MsrSetElement_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/SeqOfGANSS-SgnElement.h b/src/core/libs/supl/asn-rrlp/SeqOfGANSS-SgnElement.h index 0ba0c8388..b2bbcea2e 100644 --- a/src/core/libs/supl/asn-rrlp/SeqOfGANSS-SgnElement.h +++ b/src/core/libs/supl/asn-rrlp/SeqOfGANSS-SgnElement.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _SeqOfGANSS_SgnElement_H_ -#define _SeqOfGANSS_SgnElement_H_ +#ifndef _SeqOfGANSS_SgnElement_H_ +#define _SeqOfGANSS_SgnElement_H_ #include @@ -15,22 +15,25 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Forward declarations */ -struct GANSS_SgnElement; + /* Forward declarations */ + struct GANSS_SgnElement; -/* SeqOfGANSS-SgnElement */ -typedef struct SeqOfGANSS_SgnElement { - A_SEQUENCE_OF(struct GANSS_SgnElement) list; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} SeqOfGANSS_SgnElement_t; + /* SeqOfGANSS-SgnElement */ + typedef struct SeqOfGANSS_SgnElement + { + A_SEQUENCE_OF(struct GANSS_SgnElement) + list; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_SeqOfGANSS_SgnElement; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } SeqOfGANSS_SgnElement_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_SeqOfGANSS_SgnElement; #ifdef __cplusplus } @@ -39,5 +42,5 @@ extern asn_TYPE_descriptor_t asn_DEF_SeqOfGANSS_SgnElement; /* Referred external types */ #include "GANSS-SgnElement.h" -#endif /* _SeqOfGANSS_SgnElement_H_ */ +#endif /* _SeqOfGANSS_SgnElement_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/SeqOfGANSS-SgnTypeElement.h b/src/core/libs/supl/asn-rrlp/SeqOfGANSS-SgnTypeElement.h index 15c0a2516..1bc77858e 100644 --- a/src/core/libs/supl/asn-rrlp/SeqOfGANSS-SgnTypeElement.h +++ b/src/core/libs/supl/asn-rrlp/SeqOfGANSS-SgnTypeElement.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _SeqOfGANSS_SgnTypeElement_H_ -#define _SeqOfGANSS_SgnTypeElement_H_ +#ifndef _SeqOfGANSS_SgnTypeElement_H_ +#define _SeqOfGANSS_SgnTypeElement_H_ #include @@ -15,22 +15,25 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Forward declarations */ -struct GANSS_SgnTypeElement; + /* Forward declarations */ + struct GANSS_SgnTypeElement; -/* SeqOfGANSS-SgnTypeElement */ -typedef struct SeqOfGANSS_SgnTypeElement { - A_SEQUENCE_OF(struct GANSS_SgnTypeElement) list; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} SeqOfGANSS_SgnTypeElement_t; + /* SeqOfGANSS-SgnTypeElement */ + typedef struct SeqOfGANSS_SgnTypeElement + { + A_SEQUENCE_OF(struct GANSS_SgnTypeElement) + list; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_SeqOfGANSS_SgnTypeElement; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } SeqOfGANSS_SgnTypeElement_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_SeqOfGANSS_SgnTypeElement; #ifdef __cplusplus } @@ -39,5 +42,5 @@ extern asn_TYPE_descriptor_t asn_DEF_SeqOfGANSS_SgnTypeElement; /* Referred external types */ #include "GANSS-SgnTypeElement.h" -#endif /* _SeqOfGANSS_SgnTypeElement_H_ */ +#endif /* _SeqOfGANSS_SgnTypeElement_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/SeqOfGANSSAlmanacElement.h b/src/core/libs/supl/asn-rrlp/SeqOfGANSSAlmanacElement.h index a8e655568..84bcb452b 100644 --- a/src/core/libs/supl/asn-rrlp/SeqOfGANSSAlmanacElement.h +++ b/src/core/libs/supl/asn-rrlp/SeqOfGANSSAlmanacElement.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _SeqOfGANSSAlmanacElement_H_ -#define _SeqOfGANSSAlmanacElement_H_ +#ifndef _SeqOfGANSSAlmanacElement_H_ +#define _SeqOfGANSSAlmanacElement_H_ #include @@ -15,22 +15,25 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Forward declarations */ -struct GANSSAlmanacElement; + /* Forward declarations */ + struct GANSSAlmanacElement; -/* SeqOfGANSSAlmanacElement */ -typedef struct SeqOfGANSSAlmanacElement { - A_SEQUENCE_OF(struct GANSSAlmanacElement) list; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} SeqOfGANSSAlmanacElement_t; + /* SeqOfGANSSAlmanacElement */ + typedef struct SeqOfGANSSAlmanacElement + { + A_SEQUENCE_OF(struct GANSSAlmanacElement) + list; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_SeqOfGANSSAlmanacElement; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } SeqOfGANSSAlmanacElement_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_SeqOfGANSSAlmanacElement; #ifdef __cplusplus } @@ -39,5 +42,5 @@ extern asn_TYPE_descriptor_t asn_DEF_SeqOfGANSSAlmanacElement; /* Referred external types */ #include "GANSSAlmanacElement.h" -#endif /* _SeqOfGANSSAlmanacElement_H_ */ +#endif /* _SeqOfGANSSAlmanacElement_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/SeqOfGANSSGenericAssistDataElement.h b/src/core/libs/supl/asn-rrlp/SeqOfGANSSGenericAssistDataElement.h index 62441ea78..e9a88f2df 100644 --- a/src/core/libs/supl/asn-rrlp/SeqOfGANSSGenericAssistDataElement.h +++ b/src/core/libs/supl/asn-rrlp/SeqOfGANSSGenericAssistDataElement.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _SeqOfGANSSGenericAssistDataElement_H_ -#define _SeqOfGANSSGenericAssistDataElement_H_ +#ifndef _SeqOfGANSSGenericAssistDataElement_H_ +#define _SeqOfGANSSGenericAssistDataElement_H_ #include @@ -15,22 +15,25 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Forward declarations */ -struct GANSSGenericAssistDataElement; + /* Forward declarations */ + struct GANSSGenericAssistDataElement; -/* SeqOfGANSSGenericAssistDataElement */ -typedef struct SeqOfGANSSGenericAssistDataElement { - A_SEQUENCE_OF(struct GANSSGenericAssistDataElement) list; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} SeqOfGANSSGenericAssistDataElement_t; + /* SeqOfGANSSGenericAssistDataElement */ + typedef struct SeqOfGANSSGenericAssistDataElement + { + A_SEQUENCE_OF(struct GANSSGenericAssistDataElement) + list; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_SeqOfGANSSGenericAssistDataElement; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } SeqOfGANSSGenericAssistDataElement_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_SeqOfGANSSGenericAssistDataElement; #ifdef __cplusplus } @@ -39,5 +42,5 @@ extern asn_TYPE_descriptor_t asn_DEF_SeqOfGANSSGenericAssistDataElement; /* Referred external types */ #include "GANSSGenericAssistDataElement.h" -#endif /* _SeqOfGANSSGenericAssistDataElement_H_ */ +#endif /* _SeqOfGANSSGenericAssistDataElement_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/SeqOfGANSSRefMeasurementElement.h b/src/core/libs/supl/asn-rrlp/SeqOfGANSSRefMeasurementElement.h index 615f304ad..71ea6d8ac 100644 --- a/src/core/libs/supl/asn-rrlp/SeqOfGANSSRefMeasurementElement.h +++ b/src/core/libs/supl/asn-rrlp/SeqOfGANSSRefMeasurementElement.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _SeqOfGANSSRefMeasurementElement_H_ -#define _SeqOfGANSSRefMeasurementElement_H_ +#ifndef _SeqOfGANSSRefMeasurementElement_H_ +#define _SeqOfGANSSRefMeasurementElement_H_ #include @@ -15,22 +15,25 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Forward declarations */ -struct GANSSRefMeasurementElement; + /* Forward declarations */ + struct GANSSRefMeasurementElement; -/* SeqOfGANSSRefMeasurementElement */ -typedef struct SeqOfGANSSRefMeasurementElement { - A_SEQUENCE_OF(struct GANSSRefMeasurementElement) list; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} SeqOfGANSSRefMeasurementElement_t; + /* SeqOfGANSSRefMeasurementElement */ + typedef struct SeqOfGANSSRefMeasurementElement + { + A_SEQUENCE_OF(struct GANSSRefMeasurementElement) + list; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_SeqOfGANSSRefMeasurementElement; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } SeqOfGANSSRefMeasurementElement_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_SeqOfGANSSRefMeasurementElement; #ifdef __cplusplus } @@ -39,5 +42,5 @@ extern asn_TYPE_descriptor_t asn_DEF_SeqOfGANSSRefMeasurementElement; /* Referred external types */ #include "GANSSRefMeasurementElement.h" -#endif /* _SeqOfGANSSRefMeasurementElement_H_ */ +#endif /* _SeqOfGANSSRefMeasurementElement_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/SeqOfGANSSSatelliteElement.h b/src/core/libs/supl/asn-rrlp/SeqOfGANSSSatelliteElement.h index adb5f6cf7..6f1ad918f 100644 --- a/src/core/libs/supl/asn-rrlp/SeqOfGANSSSatelliteElement.h +++ b/src/core/libs/supl/asn-rrlp/SeqOfGANSSSatelliteElement.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _SeqOfGANSSSatelliteElement_H_ -#define _SeqOfGANSSSatelliteElement_H_ +#ifndef _SeqOfGANSSSatelliteElement_H_ +#define _SeqOfGANSSSatelliteElement_H_ #include @@ -15,22 +15,25 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Forward declarations */ -struct GANSSSatelliteElement; + /* Forward declarations */ + struct GANSSSatelliteElement; -/* SeqOfGANSSSatelliteElement */ -typedef struct SeqOfGANSSSatelliteElement { - A_SEQUENCE_OF(struct GANSSSatelliteElement) list; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} SeqOfGANSSSatelliteElement_t; + /* SeqOfGANSSSatelliteElement */ + typedef struct SeqOfGANSSSatelliteElement + { + A_SEQUENCE_OF(struct GANSSSatelliteElement) + list; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_SeqOfGANSSSatelliteElement; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } SeqOfGANSSSatelliteElement_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_SeqOfGANSSSatelliteElement; #ifdef __cplusplus } @@ -39,5 +42,5 @@ extern asn_TYPE_descriptor_t asn_DEF_SeqOfGANSSSatelliteElement; /* Referred external types */ #include "GANSSSatelliteElement.h" -#endif /* _SeqOfGANSSSatelliteElement_H_ */ +#endif /* _SeqOfGANSSSatelliteElement_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/SeqOfGANSSTimeModel.h b/src/core/libs/supl/asn-rrlp/SeqOfGANSSTimeModel.h index 715157be2..69294282d 100644 --- a/src/core/libs/supl/asn-rrlp/SeqOfGANSSTimeModel.h +++ b/src/core/libs/supl/asn-rrlp/SeqOfGANSSTimeModel.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _SeqOfGANSSTimeModel_H_ -#define _SeqOfGANSSTimeModel_H_ +#ifndef _SeqOfGANSSTimeModel_H_ +#define _SeqOfGANSSTimeModel_H_ #include @@ -15,22 +15,25 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Forward declarations */ -struct GANSSTimeModelElement; + /* Forward declarations */ + struct GANSSTimeModelElement; -/* SeqOfGANSSTimeModel */ -typedef struct SeqOfGANSSTimeModel { - A_SEQUENCE_OF(struct GANSSTimeModelElement) list; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} SeqOfGANSSTimeModel_t; + /* SeqOfGANSSTimeModel */ + typedef struct SeqOfGANSSTimeModel + { + A_SEQUENCE_OF(struct GANSSTimeModelElement) + list; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_SeqOfGANSSTimeModel; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } SeqOfGANSSTimeModel_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_SeqOfGANSSTimeModel; #ifdef __cplusplus } @@ -39,5 +42,5 @@ extern asn_TYPE_descriptor_t asn_DEF_SeqOfGANSSTimeModel; /* Referred external types */ #include "GANSSTimeModelElement.h" -#endif /* _SeqOfGANSSTimeModel_H_ */ +#endif /* _SeqOfGANSSTimeModel_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/SeqOfGPS-MsrElement.h b/src/core/libs/supl/asn-rrlp/SeqOfGPS-MsrElement.h index 626ad95ae..6d8816f40 100644 --- a/src/core/libs/supl/asn-rrlp/SeqOfGPS-MsrElement.h +++ b/src/core/libs/supl/asn-rrlp/SeqOfGPS-MsrElement.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _SeqOfGPS_MsrElement_H_ -#define _SeqOfGPS_MsrElement_H_ +#ifndef _SeqOfGPS_MsrElement_H_ +#define _SeqOfGPS_MsrElement_H_ #include @@ -15,22 +15,25 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Forward declarations */ -struct GPS_MsrElement; + /* Forward declarations */ + struct GPS_MsrElement; -/* SeqOfGPS-MsrElement */ -typedef struct SeqOfGPS_MsrElement { - A_SEQUENCE_OF(struct GPS_MsrElement) list; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} SeqOfGPS_MsrElement_t; + /* SeqOfGPS-MsrElement */ + typedef struct SeqOfGPS_MsrElement + { + A_SEQUENCE_OF(struct GPS_MsrElement) + list; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_SeqOfGPS_MsrElement; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } SeqOfGPS_MsrElement_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_SeqOfGPS_MsrElement; #ifdef __cplusplus } @@ -39,5 +42,5 @@ extern asn_TYPE_descriptor_t asn_DEF_SeqOfGPS_MsrElement; /* Referred external types */ #include "GPS-MsrElement.h" -#endif /* _SeqOfGPS_MsrElement_H_ */ +#endif /* _SeqOfGPS_MsrElement_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/SeqOfGPS-MsrSetElement.h b/src/core/libs/supl/asn-rrlp/SeqOfGPS-MsrSetElement.h index c8ae1a982..6a7cf5cb1 100644 --- a/src/core/libs/supl/asn-rrlp/SeqOfGPS-MsrSetElement.h +++ b/src/core/libs/supl/asn-rrlp/SeqOfGPS-MsrSetElement.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _SeqOfGPS_MsrSetElement_H_ -#define _SeqOfGPS_MsrSetElement_H_ +#ifndef _SeqOfGPS_MsrSetElement_H_ +#define _SeqOfGPS_MsrSetElement_H_ #include @@ -15,22 +15,25 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Forward declarations */ -struct GPS_MsrSetElement; + /* Forward declarations */ + struct GPS_MsrSetElement; -/* SeqOfGPS-MsrSetElement */ -typedef struct SeqOfGPS_MsrSetElement { - A_SEQUENCE_OF(struct GPS_MsrSetElement) list; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} SeqOfGPS_MsrSetElement_t; + /* SeqOfGPS-MsrSetElement */ + typedef struct SeqOfGPS_MsrSetElement + { + A_SEQUENCE_OF(struct GPS_MsrSetElement) + list; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_SeqOfGPS_MsrSetElement; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } SeqOfGPS_MsrSetElement_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_SeqOfGPS_MsrSetElement; #ifdef __cplusplus } @@ -39,5 +42,5 @@ extern asn_TYPE_descriptor_t asn_DEF_SeqOfGPS_MsrSetElement; /* Referred external types */ #include "GPS-MsrSetElement.h" -#endif /* _SeqOfGPS_MsrSetElement_H_ */ +#endif /* _SeqOfGPS_MsrSetElement_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/SeqOfMsrAssistBTS-R98-ExpOTD.h b/src/core/libs/supl/asn-rrlp/SeqOfMsrAssistBTS-R98-ExpOTD.h index 752ce2934..eda30a58d 100644 --- a/src/core/libs/supl/asn-rrlp/SeqOfMsrAssistBTS-R98-ExpOTD.h +++ b/src/core/libs/supl/asn-rrlp/SeqOfMsrAssistBTS-R98-ExpOTD.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _SeqOfMsrAssistBTS_R98_ExpOTD_H_ -#define _SeqOfMsrAssistBTS_R98_ExpOTD_H_ +#ifndef _SeqOfMsrAssistBTS_R98_ExpOTD_H_ +#define _SeqOfMsrAssistBTS_R98_ExpOTD_H_ #include @@ -15,22 +15,25 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Forward declarations */ -struct MsrAssistBTS_R98_ExpOTD; + /* Forward declarations */ + struct MsrAssistBTS_R98_ExpOTD; -/* SeqOfMsrAssistBTS-R98-ExpOTD */ -typedef struct SeqOfMsrAssistBTS_R98_ExpOTD { - A_SEQUENCE_OF(struct MsrAssistBTS_R98_ExpOTD) list; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} SeqOfMsrAssistBTS_R98_ExpOTD_t; + /* SeqOfMsrAssistBTS-R98-ExpOTD */ + typedef struct SeqOfMsrAssistBTS_R98_ExpOTD + { + A_SEQUENCE_OF(struct MsrAssistBTS_R98_ExpOTD) + list; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_SeqOfMsrAssistBTS_R98_ExpOTD; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } SeqOfMsrAssistBTS_R98_ExpOTD_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_SeqOfMsrAssistBTS_R98_ExpOTD; #ifdef __cplusplus } @@ -39,5 +42,5 @@ extern asn_TYPE_descriptor_t asn_DEF_SeqOfMsrAssistBTS_R98_ExpOTD; /* Referred external types */ #include "MsrAssistBTS-R98-ExpOTD.h" -#endif /* _SeqOfMsrAssistBTS_R98_ExpOTD_H_ */ +#endif /* _SeqOfMsrAssistBTS_R98_ExpOTD_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/SeqOfMsrAssistBTS.h b/src/core/libs/supl/asn-rrlp/SeqOfMsrAssistBTS.h index 03c0af381..6a335b660 100644 --- a/src/core/libs/supl/asn-rrlp/SeqOfMsrAssistBTS.h +++ b/src/core/libs/supl/asn-rrlp/SeqOfMsrAssistBTS.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _SeqOfMsrAssistBTS_H_ -#define _SeqOfMsrAssistBTS_H_ +#ifndef _SeqOfMsrAssistBTS_H_ +#define _SeqOfMsrAssistBTS_H_ #include @@ -15,22 +15,25 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Forward declarations */ -struct MsrAssistBTS; + /* Forward declarations */ + struct MsrAssistBTS; -/* SeqOfMsrAssistBTS */ -typedef struct SeqOfMsrAssistBTS { - A_SEQUENCE_OF(struct MsrAssistBTS) list; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} SeqOfMsrAssistBTS_t; + /* SeqOfMsrAssistBTS */ + typedef struct SeqOfMsrAssistBTS + { + A_SEQUENCE_OF(struct MsrAssistBTS) + list; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_SeqOfMsrAssistBTS; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } SeqOfMsrAssistBTS_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_SeqOfMsrAssistBTS; #ifdef __cplusplus } @@ -39,5 +42,5 @@ extern asn_TYPE_descriptor_t asn_DEF_SeqOfMsrAssistBTS; /* Referred external types */ #include "MsrAssistBTS.h" -#endif /* _SeqOfMsrAssistBTS_H_ */ +#endif /* _SeqOfMsrAssistBTS_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/SeqOfNavModelElement.h b/src/core/libs/supl/asn-rrlp/SeqOfNavModelElement.h index aa49a6357..65c7c1707 100644 --- a/src/core/libs/supl/asn-rrlp/SeqOfNavModelElement.h +++ b/src/core/libs/supl/asn-rrlp/SeqOfNavModelElement.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _SeqOfNavModelElement_H_ -#define _SeqOfNavModelElement_H_ +#ifndef _SeqOfNavModelElement_H_ +#define _SeqOfNavModelElement_H_ #include @@ -15,22 +15,25 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Forward declarations */ -struct NavModelElement; + /* Forward declarations */ + struct NavModelElement; -/* SeqOfNavModelElement */ -typedef struct SeqOfNavModelElement { - A_SEQUENCE_OF(struct NavModelElement) list; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} SeqOfNavModelElement_t; + /* SeqOfNavModelElement */ + typedef struct SeqOfNavModelElement + { + A_SEQUENCE_OF(struct NavModelElement) + list; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_SeqOfNavModelElement; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } SeqOfNavModelElement_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_SeqOfNavModelElement; #ifdef __cplusplus } @@ -39,5 +42,5 @@ extern asn_TYPE_descriptor_t asn_DEF_SeqOfNavModelElement; /* Referred external types */ #include "NavModelElement.h" -#endif /* _SeqOfNavModelElement_H_ */ +#endif /* _SeqOfNavModelElement_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/SeqOfOTD-FirstSetMsrs-R98-Ext.h b/src/core/libs/supl/asn-rrlp/SeqOfOTD-FirstSetMsrs-R98-Ext.h index e193afc3c..5b22e1e2a 100644 --- a/src/core/libs/supl/asn-rrlp/SeqOfOTD-FirstSetMsrs-R98-Ext.h +++ b/src/core/libs/supl/asn-rrlp/SeqOfOTD-FirstSetMsrs-R98-Ext.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _SeqOfOTD_FirstSetMsrs_R98_Ext_H_ -#define _SeqOfOTD_FirstSetMsrs_R98_Ext_H_ +#ifndef _SeqOfOTD_FirstSetMsrs_R98_Ext_H_ +#define _SeqOfOTD_FirstSetMsrs_R98_Ext_H_ #include @@ -15,22 +15,25 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Forward declarations */ -struct OTD_MeasurementWithID; + /* Forward declarations */ + struct OTD_MeasurementWithID; -/* SeqOfOTD-FirstSetMsrs-R98-Ext */ -typedef struct SeqOfOTD_FirstSetMsrs_R98_Ext { - A_SEQUENCE_OF(struct OTD_MeasurementWithID) list; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} SeqOfOTD_FirstSetMsrs_R98_Ext_t; + /* SeqOfOTD-FirstSetMsrs-R98-Ext */ + typedef struct SeqOfOTD_FirstSetMsrs_R98_Ext + { + A_SEQUENCE_OF(struct OTD_MeasurementWithID) + list; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_SeqOfOTD_FirstSetMsrs_R98_Ext; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } SeqOfOTD_FirstSetMsrs_R98_Ext_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_SeqOfOTD_FirstSetMsrs_R98_Ext; #ifdef __cplusplus } @@ -39,5 +42,5 @@ extern asn_TYPE_descriptor_t asn_DEF_SeqOfOTD_FirstSetMsrs_R98_Ext; /* Referred external types */ #include "OTD-FirstSetMsrs.h" -#endif /* _SeqOfOTD_FirstSetMsrs_R98_Ext_H_ */ +#endif /* _SeqOfOTD_FirstSetMsrs_R98_Ext_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/SeqOfOTD-FirstSetMsrs.h b/src/core/libs/supl/asn-rrlp/SeqOfOTD-FirstSetMsrs.h index 9d3390037..064613c99 100644 --- a/src/core/libs/supl/asn-rrlp/SeqOfOTD-FirstSetMsrs.h +++ b/src/core/libs/supl/asn-rrlp/SeqOfOTD-FirstSetMsrs.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _SeqOfOTD_FirstSetMsrs_H_ -#define _SeqOfOTD_FirstSetMsrs_H_ +#ifndef _SeqOfOTD_FirstSetMsrs_H_ +#define _SeqOfOTD_FirstSetMsrs_H_ #include @@ -15,22 +15,25 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Forward declarations */ -struct OTD_MeasurementWithID; + /* Forward declarations */ + struct OTD_MeasurementWithID; -/* SeqOfOTD-FirstSetMsrs */ -typedef struct SeqOfOTD_FirstSetMsrs { - A_SEQUENCE_OF(struct OTD_MeasurementWithID) list; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} SeqOfOTD_FirstSetMsrs_t; + /* SeqOfOTD-FirstSetMsrs */ + typedef struct SeqOfOTD_FirstSetMsrs + { + A_SEQUENCE_OF(struct OTD_MeasurementWithID) + list; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_SeqOfOTD_FirstSetMsrs; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } SeqOfOTD_FirstSetMsrs_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_SeqOfOTD_FirstSetMsrs; #ifdef __cplusplus } @@ -39,5 +42,5 @@ extern asn_TYPE_descriptor_t asn_DEF_SeqOfOTD_FirstSetMsrs; /* Referred external types */ #include "OTD-FirstSetMsrs.h" -#endif /* _SeqOfOTD_FirstSetMsrs_H_ */ +#endif /* _SeqOfOTD_FirstSetMsrs_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/SeqOfOTD-MsrElementRest.h b/src/core/libs/supl/asn-rrlp/SeqOfOTD-MsrElementRest.h index d92408eb8..1fcd622d9 100644 --- a/src/core/libs/supl/asn-rrlp/SeqOfOTD-MsrElementRest.h +++ b/src/core/libs/supl/asn-rrlp/SeqOfOTD-MsrElementRest.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _SeqOfOTD_MsrElementRest_H_ -#define _SeqOfOTD_MsrElementRest_H_ +#ifndef _SeqOfOTD_MsrElementRest_H_ +#define _SeqOfOTD_MsrElementRest_H_ #include @@ -15,22 +15,25 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Forward declarations */ -struct OTD_MsrElementRest; + /* Forward declarations */ + struct OTD_MsrElementRest; -/* SeqOfOTD-MsrElementRest */ -typedef struct SeqOfOTD_MsrElementRest { - A_SEQUENCE_OF(struct OTD_MsrElementRest) list; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} SeqOfOTD_MsrElementRest_t; + /* SeqOfOTD-MsrElementRest */ + typedef struct SeqOfOTD_MsrElementRest + { + A_SEQUENCE_OF(struct OTD_MsrElementRest) + list; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_SeqOfOTD_MsrElementRest; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } SeqOfOTD_MsrElementRest_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_SeqOfOTD_MsrElementRest; #ifdef __cplusplus } @@ -39,5 +42,5 @@ extern asn_TYPE_descriptor_t asn_DEF_SeqOfOTD_MsrElementRest; /* Referred external types */ #include "OTD-MsrElementRest.h" -#endif /* _SeqOfOTD_MsrElementRest_H_ */ +#endif /* _SeqOfOTD_MsrElementRest_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/SeqOfOTD-MsrsOfOtherSets.h b/src/core/libs/supl/asn-rrlp/SeqOfOTD-MsrsOfOtherSets.h index 21324431d..d07504607 100644 --- a/src/core/libs/supl/asn-rrlp/SeqOfOTD-MsrsOfOtherSets.h +++ b/src/core/libs/supl/asn-rrlp/SeqOfOTD-MsrsOfOtherSets.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _SeqOfOTD_MsrsOfOtherSets_H_ -#define _SeqOfOTD_MsrsOfOtherSets_H_ +#ifndef _SeqOfOTD_MsrsOfOtherSets_H_ +#define _SeqOfOTD_MsrsOfOtherSets_H_ #include @@ -15,22 +15,25 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Forward declarations */ -struct OTD_MsrsOfOtherSets; + /* Forward declarations */ + struct OTD_MsrsOfOtherSets; -/* SeqOfOTD-MsrsOfOtherSets */ -typedef struct SeqOfOTD_MsrsOfOtherSets { - A_SEQUENCE_OF(struct OTD_MsrsOfOtherSets) list; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} SeqOfOTD_MsrsOfOtherSets_t; + /* SeqOfOTD-MsrsOfOtherSets */ + typedef struct SeqOfOTD_MsrsOfOtherSets + { + A_SEQUENCE_OF(struct OTD_MsrsOfOtherSets) + list; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_SeqOfOTD_MsrsOfOtherSets; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } SeqOfOTD_MsrsOfOtherSets_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_SeqOfOTD_MsrsOfOtherSets; #ifdef __cplusplus } @@ -39,5 +42,5 @@ extern asn_TYPE_descriptor_t asn_DEF_SeqOfOTD_MsrsOfOtherSets; /* Referred external types */ #include "OTD-MsrsOfOtherSets.h" -#endif /* _SeqOfOTD_MsrsOfOtherSets_H_ */ +#endif /* _SeqOfOTD_MsrsOfOtherSets_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/SeqOfReferenceIdentityType.h b/src/core/libs/supl/asn-rrlp/SeqOfReferenceIdentityType.h index f7b890090..f5a3c0403 100644 --- a/src/core/libs/supl/asn-rrlp/SeqOfReferenceIdentityType.h +++ b/src/core/libs/supl/asn-rrlp/SeqOfReferenceIdentityType.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _SeqOfReferenceIdentityType_H_ -#define _SeqOfReferenceIdentityType_H_ +#ifndef _SeqOfReferenceIdentityType_H_ +#define _SeqOfReferenceIdentityType_H_ #include @@ -15,22 +15,25 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Forward declarations */ -struct ReferenceIdentityType; + /* Forward declarations */ + struct ReferenceIdentityType; -/* SeqOfReferenceIdentityType */ -typedef struct SeqOfReferenceIdentityType { - A_SEQUENCE_OF(struct ReferenceIdentityType) list; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} SeqOfReferenceIdentityType_t; + /* SeqOfReferenceIdentityType */ + typedef struct SeqOfReferenceIdentityType + { + A_SEQUENCE_OF(struct ReferenceIdentityType) + list; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_SeqOfReferenceIdentityType; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } SeqOfReferenceIdentityType_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_SeqOfReferenceIdentityType; #ifdef __cplusplus } @@ -39,5 +42,5 @@ extern asn_TYPE_descriptor_t asn_DEF_SeqOfReferenceIdentityType; /* Referred external types */ #include "ReferenceIdentityType.h" -#endif /* _SeqOfReferenceIdentityType_H_ */ +#endif /* _SeqOfReferenceIdentityType_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/SeqOfSatElement.h b/src/core/libs/supl/asn-rrlp/SeqOfSatElement.h index 16b8282f9..096382c3e 100644 --- a/src/core/libs/supl/asn-rrlp/SeqOfSatElement.h +++ b/src/core/libs/supl/asn-rrlp/SeqOfSatElement.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _SeqOfSatElement_H_ -#define _SeqOfSatElement_H_ +#ifndef _SeqOfSatElement_H_ +#define _SeqOfSatElement_H_ #include @@ -15,22 +15,25 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Forward declarations */ -struct SatElement; + /* Forward declarations */ + struct SatElement; -/* SeqOfSatElement */ -typedef struct SeqOfSatElement { - A_SEQUENCE_OF(struct SatElement) list; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} SeqOfSatElement_t; + /* SeqOfSatElement */ + typedef struct SeqOfSatElement + { + A_SEQUENCE_OF(struct SatElement) + list; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_SeqOfSatElement; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } SeqOfSatElement_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_SeqOfSatElement; #ifdef __cplusplus } @@ -39,5 +42,5 @@ extern asn_TYPE_descriptor_t asn_DEF_SeqOfSatElement; /* Referred external types */ #include "SatElement.h" -#endif /* _SeqOfSatElement_H_ */ +#endif /* _SeqOfSatElement_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/SeqOfSgnTypeElement.h b/src/core/libs/supl/asn-rrlp/SeqOfSgnTypeElement.h index 2af754902..d106c9c18 100644 --- a/src/core/libs/supl/asn-rrlp/SeqOfSgnTypeElement.h +++ b/src/core/libs/supl/asn-rrlp/SeqOfSgnTypeElement.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _SeqOfSgnTypeElement_H_ -#define _SeqOfSgnTypeElement_H_ +#ifndef _SeqOfSgnTypeElement_H_ +#define _SeqOfSgnTypeElement_H_ #include @@ -15,22 +15,25 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Forward declarations */ -struct SgnTypeElement; + /* Forward declarations */ + struct SgnTypeElement; -/* SeqOfSgnTypeElement */ -typedef struct SeqOfSgnTypeElement { - A_SEQUENCE_OF(struct SgnTypeElement) list; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} SeqOfSgnTypeElement_t; + /* SeqOfSgnTypeElement */ + typedef struct SeqOfSgnTypeElement + { + A_SEQUENCE_OF(struct SgnTypeElement) + list; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_SeqOfSgnTypeElement; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } SeqOfSgnTypeElement_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_SeqOfSgnTypeElement; #ifdef __cplusplus } @@ -39,5 +42,5 @@ extern asn_TYPE_descriptor_t asn_DEF_SeqOfSgnTypeElement; /* Referred external types */ #include "SgnTypeElement.h" -#endif /* _SeqOfSgnTypeElement_H_ */ +#endif /* _SeqOfSgnTypeElement_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/SeqOfStandardClockModelElement.h b/src/core/libs/supl/asn-rrlp/SeqOfStandardClockModelElement.h index 9f5c0d239..13b193f5f 100644 --- a/src/core/libs/supl/asn-rrlp/SeqOfStandardClockModelElement.h +++ b/src/core/libs/supl/asn-rrlp/SeqOfStandardClockModelElement.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _SeqOfStandardClockModelElement_H_ -#define _SeqOfStandardClockModelElement_H_ +#ifndef _SeqOfStandardClockModelElement_H_ +#define _SeqOfStandardClockModelElement_H_ #include @@ -15,22 +15,25 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Forward declarations */ -struct StandardClockModelElement; + /* Forward declarations */ + struct StandardClockModelElement; -/* SeqOfStandardClockModelElement */ -typedef struct SeqOfStandardClockModelElement { - A_SEQUENCE_OF(struct StandardClockModelElement) list; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} SeqOfStandardClockModelElement_t; + /* SeqOfStandardClockModelElement */ + typedef struct SeqOfStandardClockModelElement + { + A_SEQUENCE_OF(struct StandardClockModelElement) + list; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_SeqOfStandardClockModelElement; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } SeqOfStandardClockModelElement_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_SeqOfStandardClockModelElement; #ifdef __cplusplus } @@ -39,5 +42,5 @@ extern asn_TYPE_descriptor_t asn_DEF_SeqOfStandardClockModelElement; /* Referred external types */ #include "StandardClockModelElement.h" -#endif /* _SeqOfStandardClockModelElement_H_ */ +#endif /* _SeqOfStandardClockModelElement_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/SeqOfSystemInfoAssistBTS-R98-ExpOTD.h b/src/core/libs/supl/asn-rrlp/SeqOfSystemInfoAssistBTS-R98-ExpOTD.h index 8dffd5e0f..20aca403e 100644 --- a/src/core/libs/supl/asn-rrlp/SeqOfSystemInfoAssistBTS-R98-ExpOTD.h +++ b/src/core/libs/supl/asn-rrlp/SeqOfSystemInfoAssistBTS-R98-ExpOTD.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _SeqOfSystemInfoAssistBTS_R98_ExpOTD_H_ -#define _SeqOfSystemInfoAssistBTS_R98_ExpOTD_H_ +#ifndef _SeqOfSystemInfoAssistBTS_R98_ExpOTD_H_ +#define _SeqOfSystemInfoAssistBTS_R98_ExpOTD_H_ #include @@ -15,22 +15,25 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Forward declarations */ -struct SystemInfoAssistBTS_R98_ExpOTD; + /* Forward declarations */ + struct SystemInfoAssistBTS_R98_ExpOTD; -/* SeqOfSystemInfoAssistBTS-R98-ExpOTD */ -typedef struct SeqOfSystemInfoAssistBTS_R98_ExpOTD { - A_SEQUENCE_OF(struct SystemInfoAssistBTS_R98_ExpOTD) list; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} SeqOfSystemInfoAssistBTS_R98_ExpOTD_t; + /* SeqOfSystemInfoAssistBTS-R98-ExpOTD */ + typedef struct SeqOfSystemInfoAssistBTS_R98_ExpOTD + { + A_SEQUENCE_OF(struct SystemInfoAssistBTS_R98_ExpOTD) + list; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_SeqOfSystemInfoAssistBTS_R98_ExpOTD; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } SeqOfSystemInfoAssistBTS_R98_ExpOTD_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_SeqOfSystemInfoAssistBTS_R98_ExpOTD; #ifdef __cplusplus } @@ -39,5 +42,5 @@ extern asn_TYPE_descriptor_t asn_DEF_SeqOfSystemInfoAssistBTS_R98_ExpOTD; /* Referred external types */ #include "SystemInfoAssistBTS-R98-ExpOTD.h" -#endif /* _SeqOfSystemInfoAssistBTS_R98_ExpOTD_H_ */ +#endif /* _SeqOfSystemInfoAssistBTS_R98_ExpOTD_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/SeqOfSystemInfoAssistBTS.h b/src/core/libs/supl/asn-rrlp/SeqOfSystemInfoAssistBTS.h index faebb465f..8ab68ffb6 100644 --- a/src/core/libs/supl/asn-rrlp/SeqOfSystemInfoAssistBTS.h +++ b/src/core/libs/supl/asn-rrlp/SeqOfSystemInfoAssistBTS.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _SeqOfSystemInfoAssistBTS_H_ -#define _SeqOfSystemInfoAssistBTS_H_ +#ifndef _SeqOfSystemInfoAssistBTS_H_ +#define _SeqOfSystemInfoAssistBTS_H_ #include @@ -15,22 +15,25 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Forward declarations */ -struct SystemInfoAssistBTS; + /* Forward declarations */ + struct SystemInfoAssistBTS; -/* SeqOfSystemInfoAssistBTS */ -typedef struct SeqOfSystemInfoAssistBTS { - A_SEQUENCE_OF(struct SystemInfoAssistBTS) list; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} SeqOfSystemInfoAssistBTS_t; + /* SeqOfSystemInfoAssistBTS */ + typedef struct SeqOfSystemInfoAssistBTS + { + A_SEQUENCE_OF(struct SystemInfoAssistBTS) + list; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_SeqOfSystemInfoAssistBTS; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } SeqOfSystemInfoAssistBTS_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_SeqOfSystemInfoAssistBTS; #ifdef __cplusplus } @@ -39,5 +42,5 @@ extern asn_TYPE_descriptor_t asn_DEF_SeqOfSystemInfoAssistBTS; /* Referred external types */ #include "SystemInfoAssistBTS.h" -#endif /* _SeqOfSystemInfoAssistBTS_H_ */ +#endif /* _SeqOfSystemInfoAssistBTS_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/SgnTypeElement.h b/src/core/libs/supl/asn-rrlp/SgnTypeElement.h index 35ebe62ca..968ee88ef 100644 --- a/src/core/libs/supl/asn-rrlp/SgnTypeElement.h +++ b/src/core/libs/supl/asn-rrlp/SgnTypeElement.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _SgnTypeElement_H_ -#define _SgnTypeElement_H_ +#ifndef _SgnTypeElement_H_ +#define _SgnTypeElement_H_ #include @@ -17,25 +17,27 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* SgnTypeElement */ -typedef struct SgnTypeElement { - GANSSSignalID_t *ganssSignalID /* OPTIONAL */; - long ganssStatusHealth; - SeqOfDGANSSSgnElement_t dganssSgnList; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} SgnTypeElement_t; + /* SgnTypeElement */ + typedef struct SgnTypeElement + { + GANSSSignalID_t *ganssSignalID /* OPTIONAL */; + long ganssStatusHealth; + SeqOfDGANSSSgnElement_t dganssSgnList; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_SgnTypeElement; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } SgnTypeElement_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_SgnTypeElement; #ifdef __cplusplus } #endif -#endif /* _SgnTypeElement_H_ */ +#endif /* _SgnTypeElement_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/StandardClockModelElement.h b/src/core/libs/supl/asn-rrlp/StandardClockModelElement.h index 7fe79afb8..72651dcbd 100644 --- a/src/core/libs/supl/asn-rrlp/StandardClockModelElement.h +++ b/src/core/libs/supl/asn-rrlp/StandardClockModelElement.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _StandardClockModelElement_H_ -#define _StandardClockModelElement_H_ +#ifndef _StandardClockModelElement_H_ +#define _StandardClockModelElement_H_ #include @@ -15,32 +15,34 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* StandardClockModelElement */ -typedef struct StandardClockModelElement { - long stanClockTocLSB; - long stanClockAF2; - long stanClockAF1; - long stanClockAF0; - long *stanClockTgd /* OPTIONAL */; - long *stanModelID /* OPTIONAL */; - /* + /* StandardClockModelElement */ + typedef struct StandardClockModelElement + { + long stanClockTocLSB; + long stanClockAF2; + long stanClockAF1; + long stanClockAF0; + long *stanClockTgd /* OPTIONAL */; + long *stanModelID /* OPTIONAL */; + /* * This type is extensible, * possible extensions are below. */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} StandardClockModelElement_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_StandardClockModelElement; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } StandardClockModelElement_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_StandardClockModelElement; #ifdef __cplusplus } #endif -#endif /* _StandardClockModelElement_H_ */ +#endif /* _StandardClockModelElement_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/StdResolution.h b/src/core/libs/supl/asn-rrlp/StdResolution.h index 289d227b8..f93fd309d 100644 --- a/src/core/libs/supl/asn-rrlp/StdResolution.h +++ b/src/core/libs/supl/asn-rrlp/StdResolution.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _StdResolution_H_ -#define _StdResolution_H_ +#ifndef _StdResolution_H_ +#define _StdResolution_H_ #include @@ -14,27 +14,28 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* StdResolution */ -typedef long StdResolution_t; + /* StdResolution */ + typedef long StdResolution_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_StdResolution; -asn_struct_free_f StdResolution_free; -asn_struct_print_f StdResolution_print; -asn_constr_check_f StdResolution_constraint; -ber_type_decoder_f StdResolution_decode_ber; -der_type_encoder_f StdResolution_encode_der; -xer_type_decoder_f StdResolution_decode_xer; -xer_type_encoder_f StdResolution_encode_xer; -per_type_decoder_f StdResolution_decode_uper; -per_type_encoder_f StdResolution_encode_uper; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_StdResolution; + asn_struct_free_f StdResolution_free; + asn_struct_print_f StdResolution_print; + asn_constr_check_f StdResolution_constraint; + ber_type_decoder_f StdResolution_decode_ber; + der_type_encoder_f StdResolution_encode_der; + xer_type_decoder_f StdResolution_decode_xer; + xer_type_encoder_f StdResolution_encode_xer; + per_type_decoder_f StdResolution_decode_uper; + per_type_encoder_f StdResolution_encode_uper; #ifdef __cplusplus } #endif -#endif /* _StdResolution_H_ */ +#endif /* _StdResolution_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/SystemInfoAssistBTS-R98-ExpOTD.h b/src/core/libs/supl/asn-rrlp/SystemInfoAssistBTS-R98-ExpOTD.h index 78c025886..99d17a4e1 100644 --- a/src/core/libs/supl/asn-rrlp/SystemInfoAssistBTS-R98-ExpOTD.h +++ b/src/core/libs/supl/asn-rrlp/SystemInfoAssistBTS-R98-ExpOTD.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _SystemInfoAssistBTS_R98_ExpOTD_H_ -#define _SystemInfoAssistBTS_R98_ExpOTD_H_ +#ifndef _SystemInfoAssistBTS_R98_ExpOTD_H_ +#define _SystemInfoAssistBTS_R98_ExpOTD_H_ #include @@ -16,34 +16,38 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Dependencies */ -typedef enum SystemInfoAssistBTS_R98_ExpOTD_PR { - SystemInfoAssistBTS_R98_ExpOTD_PR_NOTHING, /* No components present */ - SystemInfoAssistBTS_R98_ExpOTD_PR_notPresent, - SystemInfoAssistBTS_R98_ExpOTD_PR_present -} SystemInfoAssistBTS_R98_ExpOTD_PR; + /* Dependencies */ + typedef enum SystemInfoAssistBTS_R98_ExpOTD_PR + { + SystemInfoAssistBTS_R98_ExpOTD_PR_NOTHING, /* No components present */ + SystemInfoAssistBTS_R98_ExpOTD_PR_notPresent, + SystemInfoAssistBTS_R98_ExpOTD_PR_present + } SystemInfoAssistBTS_R98_ExpOTD_PR; -/* SystemInfoAssistBTS-R98-ExpOTD */ -typedef struct SystemInfoAssistBTS_R98_ExpOTD { - SystemInfoAssistBTS_R98_ExpOTD_PR present; - union SystemInfoAssistBTS_R98_ExpOTD_u { - NULL_t notPresent; - AssistBTSData_R98_ExpOTD_t present; - } choice; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} SystemInfoAssistBTS_R98_ExpOTD_t; + /* SystemInfoAssistBTS-R98-ExpOTD */ + typedef struct SystemInfoAssistBTS_R98_ExpOTD + { + SystemInfoAssistBTS_R98_ExpOTD_PR present; + union SystemInfoAssistBTS_R98_ExpOTD_u + { + NULL_t notPresent; + AssistBTSData_R98_ExpOTD_t present; + } choice; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_SystemInfoAssistBTS_R98_ExpOTD; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } SystemInfoAssistBTS_R98_ExpOTD_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_SystemInfoAssistBTS_R98_ExpOTD; #ifdef __cplusplus } #endif -#endif /* _SystemInfoAssistBTS_R98_ExpOTD_H_ */ +#endif /* _SystemInfoAssistBTS_R98_ExpOTD_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/SystemInfoAssistBTS.h b/src/core/libs/supl/asn-rrlp/SystemInfoAssistBTS.h index daa8c9997..1c3012b02 100644 --- a/src/core/libs/supl/asn-rrlp/SystemInfoAssistBTS.h +++ b/src/core/libs/supl/asn-rrlp/SystemInfoAssistBTS.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _SystemInfoAssistBTS_H_ -#define _SystemInfoAssistBTS_H_ +#ifndef _SystemInfoAssistBTS_H_ +#define _SystemInfoAssistBTS_H_ #include @@ -16,34 +16,38 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Dependencies */ -typedef enum SystemInfoAssistBTS_PR { - SystemInfoAssistBTS_PR_NOTHING, /* No components present */ - SystemInfoAssistBTS_PR_notPresent, - SystemInfoAssistBTS_PR_present -} SystemInfoAssistBTS_PR; + /* Dependencies */ + typedef enum SystemInfoAssistBTS_PR + { + SystemInfoAssistBTS_PR_NOTHING, /* No components present */ + SystemInfoAssistBTS_PR_notPresent, + SystemInfoAssistBTS_PR_present + } SystemInfoAssistBTS_PR; -/* SystemInfoAssistBTS */ -typedef struct SystemInfoAssistBTS { - SystemInfoAssistBTS_PR present; - union SystemInfoAssistBTS_u { - NULL_t notPresent; - AssistBTSData_t present; - } choice; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} SystemInfoAssistBTS_t; + /* SystemInfoAssistBTS */ + typedef struct SystemInfoAssistBTS + { + SystemInfoAssistBTS_PR present; + union SystemInfoAssistBTS_u + { + NULL_t notPresent; + AssistBTSData_t present; + } choice; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_SystemInfoAssistBTS; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } SystemInfoAssistBTS_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_SystemInfoAssistBTS; #ifdef __cplusplus } #endif -#endif /* _SystemInfoAssistBTS_H_ */ +#endif /* _SystemInfoAssistBTS_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/SystemInfoAssistData-R98-ExpOTD.h b/src/core/libs/supl/asn-rrlp/SystemInfoAssistData-R98-ExpOTD.h index a5961648f..8cf3628a4 100644 --- a/src/core/libs/supl/asn-rrlp/SystemInfoAssistData-R98-ExpOTD.h +++ b/src/core/libs/supl/asn-rrlp/SystemInfoAssistData-R98-ExpOTD.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _SystemInfoAssistData_R98_ExpOTD_H_ -#define _SystemInfoAssistData_R98_ExpOTD_H_ +#ifndef _SystemInfoAssistData_R98_ExpOTD_H_ +#define _SystemInfoAssistData_R98_ExpOTD_H_ #include @@ -15,23 +15,25 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* SystemInfoAssistData-R98-ExpOTD */ -typedef struct SystemInfoAssistData_R98_ExpOTD { - SeqOfSystemInfoAssistBTS_R98_ExpOTD_t systemInfoAssistListR98_ExpOTD; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} SystemInfoAssistData_R98_ExpOTD_t; + /* SystemInfoAssistData-R98-ExpOTD */ + typedef struct SystemInfoAssistData_R98_ExpOTD + { + SeqOfSystemInfoAssistBTS_R98_ExpOTD_t systemInfoAssistListR98_ExpOTD; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_SystemInfoAssistData_R98_ExpOTD; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } SystemInfoAssistData_R98_ExpOTD_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_SystemInfoAssistData_R98_ExpOTD; #ifdef __cplusplus } #endif -#endif /* _SystemInfoAssistData_R98_ExpOTD_H_ */ +#endif /* _SystemInfoAssistData_R98_ExpOTD_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/SystemInfoAssistData.h b/src/core/libs/supl/asn-rrlp/SystemInfoAssistData.h index ddc134341..ef8051bb8 100644 --- a/src/core/libs/supl/asn-rrlp/SystemInfoAssistData.h +++ b/src/core/libs/supl/asn-rrlp/SystemInfoAssistData.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _SystemInfoAssistData_H_ -#define _SystemInfoAssistData_H_ +#ifndef _SystemInfoAssistData_H_ +#define _SystemInfoAssistData_H_ #include @@ -15,23 +15,25 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* SystemInfoAssistData */ -typedef struct SystemInfoAssistData { - SeqOfSystemInfoAssistBTS_t systemInfoAssistList; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} SystemInfoAssistData_t; + /* SystemInfoAssistData */ + typedef struct SystemInfoAssistData + { + SeqOfSystemInfoAssistBTS_t systemInfoAssistList; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_SystemInfoAssistData; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } SystemInfoAssistData_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_SystemInfoAssistData; #ifdef __cplusplus } #endif -#endif /* _SystemInfoAssistData_H_ */ +#endif /* _SystemInfoAssistData_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/SystemInfoIndex.h b/src/core/libs/supl/asn-rrlp/SystemInfoIndex.h index 3e5c4a217..3be83da8e 100644 --- a/src/core/libs/supl/asn-rrlp/SystemInfoIndex.h +++ b/src/core/libs/supl/asn-rrlp/SystemInfoIndex.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _SystemInfoIndex_H_ -#define _SystemInfoIndex_H_ +#ifndef _SystemInfoIndex_H_ +#define _SystemInfoIndex_H_ #include @@ -14,27 +14,28 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* SystemInfoIndex */ -typedef long SystemInfoIndex_t; + /* SystemInfoIndex */ + typedef long SystemInfoIndex_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_SystemInfoIndex; -asn_struct_free_f SystemInfoIndex_free; -asn_struct_print_f SystemInfoIndex_print; -asn_constr_check_f SystemInfoIndex_constraint; -ber_type_decoder_f SystemInfoIndex_decode_ber; -der_type_encoder_f SystemInfoIndex_encode_der; -xer_type_decoder_f SystemInfoIndex_decode_xer; -xer_type_encoder_f SystemInfoIndex_encode_xer; -per_type_decoder_f SystemInfoIndex_decode_uper; -per_type_encoder_f SystemInfoIndex_encode_uper; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_SystemInfoIndex; + asn_struct_free_f SystemInfoIndex_free; + asn_struct_print_f SystemInfoIndex_print; + asn_constr_check_f SystemInfoIndex_constraint; + ber_type_decoder_f SystemInfoIndex_decode_ber; + der_type_encoder_f SystemInfoIndex_encode_der; + xer_type_decoder_f SystemInfoIndex_decode_xer; + xer_type_encoder_f SystemInfoIndex_encode_xer; + per_type_decoder_f SystemInfoIndex_decode_uper; + per_type_encoder_f SystemInfoIndex_encode_uper; #ifdef __cplusplus } #endif -#endif /* _SystemInfoIndex_H_ */ +#endif /* _SystemInfoIndex_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/TA0.h b/src/core/libs/supl/asn-rrlp/TA0.h index a046041a9..69c7a4e3e 100644 --- a/src/core/libs/supl/asn-rrlp/TA0.h +++ b/src/core/libs/supl/asn-rrlp/TA0.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _TA0_H_ -#define _TA0_H_ +#ifndef _TA0_H_ +#define _TA0_H_ #include @@ -14,27 +14,28 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* TA0 */ -typedef long TA0_t; + /* TA0 */ + typedef long TA0_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_TA0; -asn_struct_free_f TA0_free; -asn_struct_print_f TA0_print; -asn_constr_check_f TA0_constraint; -ber_type_decoder_f TA0_decode_ber; -der_type_encoder_f TA0_encode_der; -xer_type_decoder_f TA0_decode_xer; -xer_type_encoder_f TA0_encode_xer; -per_type_decoder_f TA0_decode_uper; -per_type_encoder_f TA0_encode_uper; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_TA0; + asn_struct_free_f TA0_free; + asn_struct_print_f TA0_print; + asn_constr_check_f TA0_constraint; + ber_type_decoder_f TA0_decode_ber; + der_type_encoder_f TA0_encode_der; + xer_type_decoder_f TA0_decode_xer; + xer_type_encoder_f TA0_encode_xer; + per_type_decoder_f TA0_decode_uper; + per_type_encoder_f TA0_encode_uper; #ifdef __cplusplus } #endif -#endif /* _TA0_H_ */ +#endif /* _TA0_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/TA1.h b/src/core/libs/supl/asn-rrlp/TA1.h index e5b12b196..7ea57155e 100644 --- a/src/core/libs/supl/asn-rrlp/TA1.h +++ b/src/core/libs/supl/asn-rrlp/TA1.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _TA1_H_ -#define _TA1_H_ +#ifndef _TA1_H_ +#define _TA1_H_ #include @@ -14,27 +14,28 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* TA1 */ -typedef long TA1_t; + /* TA1 */ + typedef long TA1_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_TA1; -asn_struct_free_f TA1_free; -asn_struct_print_f TA1_print; -asn_constr_check_f TA1_constraint; -ber_type_decoder_f TA1_decode_ber; -der_type_encoder_f TA1_encode_der; -xer_type_decoder_f TA1_decode_xer; -xer_type_encoder_f TA1_encode_xer; -per_type_decoder_f TA1_decode_uper; -per_type_encoder_f TA1_encode_uper; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_TA1; + asn_struct_free_f TA1_free; + asn_struct_print_f TA1_print; + asn_constr_check_f TA1_constraint; + ber_type_decoder_f TA1_decode_ber; + der_type_encoder_f TA1_encode_der; + xer_type_decoder_f TA1_decode_xer; + xer_type_encoder_f TA1_encode_xer; + per_type_decoder_f TA1_decode_uper; + per_type_encoder_f TA1_encode_uper; #ifdef __cplusplus } #endif -#endif /* _TA1_H_ */ +#endif /* _TA1_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/TA2.h b/src/core/libs/supl/asn-rrlp/TA2.h index b13073c8c..78ec5b528 100644 --- a/src/core/libs/supl/asn-rrlp/TA2.h +++ b/src/core/libs/supl/asn-rrlp/TA2.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _TA2_H_ -#define _TA2_H_ +#ifndef _TA2_H_ +#define _TA2_H_ #include @@ -14,27 +14,28 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* TA2 */ -typedef long TA2_t; + /* TA2 */ + typedef long TA2_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_TA2; -asn_struct_free_f TA2_free; -asn_struct_print_f TA2_print; -asn_constr_check_f TA2_constraint; -ber_type_decoder_f TA2_decode_ber; -der_type_encoder_f TA2_encode_der; -xer_type_decoder_f TA2_decode_xer; -xer_type_encoder_f TA2_encode_xer; -per_type_decoder_f TA2_decode_uper; -per_type_encoder_f TA2_encode_uper; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_TA2; + asn_struct_free_f TA2_free; + asn_struct_print_f TA2_print; + asn_constr_check_f TA2_constraint; + ber_type_decoder_f TA2_decode_ber; + der_type_encoder_f TA2_encode_der; + xer_type_decoder_f TA2_decode_xer; + xer_type_encoder_f TA2_encode_xer; + per_type_decoder_f TA2_decode_uper; + per_type_encoder_f TA2_encode_uper; #ifdef __cplusplus } #endif -#endif /* _TA2_H_ */ +#endif /* _TA2_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/TLMReservedBits.h b/src/core/libs/supl/asn-rrlp/TLMReservedBits.h index 2e64f6af0..ee52c807b 100644 --- a/src/core/libs/supl/asn-rrlp/TLMReservedBits.h +++ b/src/core/libs/supl/asn-rrlp/TLMReservedBits.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _TLMReservedBits_H_ -#define _TLMReservedBits_H_ +#ifndef _TLMReservedBits_H_ +#define _TLMReservedBits_H_ #include @@ -14,27 +14,28 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* TLMReservedBits */ -typedef long TLMReservedBits_t; + /* TLMReservedBits */ + typedef long TLMReservedBits_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_TLMReservedBits; -asn_struct_free_f TLMReservedBits_free; -asn_struct_print_f TLMReservedBits_print; -asn_constr_check_f TLMReservedBits_constraint; -ber_type_decoder_f TLMReservedBits_decode_ber; -der_type_encoder_f TLMReservedBits_encode_der; -xer_type_decoder_f TLMReservedBits_decode_xer; -xer_type_encoder_f TLMReservedBits_encode_xer; -per_type_decoder_f TLMReservedBits_decode_uper; -per_type_encoder_f TLMReservedBits_encode_uper; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_TLMReservedBits; + asn_struct_free_f TLMReservedBits_free; + asn_struct_print_f TLMReservedBits_print; + asn_constr_check_f TLMReservedBits_constraint; + ber_type_decoder_f TLMReservedBits_decode_ber; + der_type_encoder_f TLMReservedBits_encode_der; + xer_type_decoder_f TLMReservedBits_decode_xer; + xer_type_encoder_f TLMReservedBits_encode_xer; + per_type_decoder_f TLMReservedBits_decode_uper; + per_type_encoder_f TLMReservedBits_encode_uper; #ifdef __cplusplus } #endif -#endif /* _TLMReservedBits_H_ */ +#endif /* _TLMReservedBits_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/TLMWord.h b/src/core/libs/supl/asn-rrlp/TLMWord.h index 2be30c082..9b3ad8438 100644 --- a/src/core/libs/supl/asn-rrlp/TLMWord.h +++ b/src/core/libs/supl/asn-rrlp/TLMWord.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _TLMWord_H_ -#define _TLMWord_H_ +#ifndef _TLMWord_H_ +#define _TLMWord_H_ #include @@ -14,27 +14,28 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* TLMWord */ -typedef long TLMWord_t; + /* TLMWord */ + typedef long TLMWord_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_TLMWord; -asn_struct_free_f TLMWord_free; -asn_struct_print_f TLMWord_print; -asn_constr_check_f TLMWord_constraint; -ber_type_decoder_f TLMWord_decode_ber; -der_type_encoder_f TLMWord_encode_der; -xer_type_decoder_f TLMWord_decode_xer; -xer_type_encoder_f TLMWord_encode_xer; -per_type_decoder_f TLMWord_decode_uper; -per_type_encoder_f TLMWord_encode_uper; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_TLMWord; + asn_struct_free_f TLMWord_free; + asn_struct_print_f TLMWord_print; + asn_constr_check_f TLMWord_constraint; + ber_type_decoder_f TLMWord_decode_ber; + der_type_encoder_f TLMWord_encode_der; + xer_type_decoder_f TLMWord_decode_xer; + xer_type_encoder_f TLMWord_encode_xer; + per_type_decoder_f TLMWord_decode_uper; + per_type_encoder_f TLMWord_encode_uper; #ifdef __cplusplus } #endif -#endif /* _TLMWord_H_ */ +#endif /* _TLMWord_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/TOA-MeasurementsOfRef.h b/src/core/libs/supl/asn-rrlp/TOA-MeasurementsOfRef.h index a6e14e330..0df538d54 100644 --- a/src/core/libs/supl/asn-rrlp/TOA-MeasurementsOfRef.h +++ b/src/core/libs/supl/asn-rrlp/TOA-MeasurementsOfRef.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _TOA_MeasurementsOfRef_H_ -#define _TOA_MeasurementsOfRef_H_ +#ifndef _TOA_MeasurementsOfRef_H_ +#define _TOA_MeasurementsOfRef_H_ #include @@ -16,24 +16,26 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* TOA-MeasurementsOfRef */ -typedef struct TOA_MeasurementsOfRef { - RefQuality_t refQuality; - NumOfMeasurements_t numOfMeasurements; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} TOA_MeasurementsOfRef_t; + /* TOA-MeasurementsOfRef */ + typedef struct TOA_MeasurementsOfRef + { + RefQuality_t refQuality; + NumOfMeasurements_t numOfMeasurements; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_TOA_MeasurementsOfRef; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } TOA_MeasurementsOfRef_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_TOA_MeasurementsOfRef; #ifdef __cplusplus } #endif -#endif /* _TOA_MeasurementsOfRef_H_ */ +#endif /* _TOA_MeasurementsOfRef_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/TimeRelation.h b/src/core/libs/supl/asn-rrlp/TimeRelation.h index 10fdacf09..d6cbb5302 100644 --- a/src/core/libs/supl/asn-rrlp/TimeRelation.h +++ b/src/core/libs/supl/asn-rrlp/TimeRelation.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _TimeRelation_H_ -#define _TimeRelation_H_ +#ifndef _TimeRelation_H_ +#define _TimeRelation_H_ #include @@ -15,23 +15,25 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Forward declarations */ -struct GSMTime; + /* Forward declarations */ + struct GSMTime; -/* TimeRelation */ -typedef struct TimeRelation { - GPSTOW23b_t gpsTOW; - struct GSMTime *gsmTime /* OPTIONAL */; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} TimeRelation_t; + /* TimeRelation */ + typedef struct TimeRelation + { + GPSTOW23b_t gpsTOW; + struct GSMTime *gsmTime /* OPTIONAL */; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_TimeRelation; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } TimeRelation_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_TimeRelation; #ifdef __cplusplus } @@ -40,5 +42,5 @@ extern asn_TYPE_descriptor_t asn_DEF_TimeRelation; /* Referred external types */ #include "GSMTime.h" -#endif /* _TimeRelation_H_ */ +#endif /* _TimeRelation_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/TimeSlot.h b/src/core/libs/supl/asn-rrlp/TimeSlot.h index 9f0b125de..2d91de034 100644 --- a/src/core/libs/supl/asn-rrlp/TimeSlot.h +++ b/src/core/libs/supl/asn-rrlp/TimeSlot.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _TimeSlot_H_ -#define _TimeSlot_H_ +#ifndef _TimeSlot_H_ +#define _TimeSlot_H_ #include @@ -14,27 +14,28 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* TimeSlot */ -typedef long TimeSlot_t; + /* TimeSlot */ + typedef long TimeSlot_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_TimeSlot; -asn_struct_free_f TimeSlot_free; -asn_struct_print_f TimeSlot_print; -asn_constr_check_f TimeSlot_constraint; -ber_type_decoder_f TimeSlot_decode_ber; -der_type_encoder_f TimeSlot_encode_der; -xer_type_decoder_f TimeSlot_decode_xer; -xer_type_encoder_f TimeSlot_encode_xer; -per_type_decoder_f TimeSlot_decode_uper; -per_type_encoder_f TimeSlot_encode_uper; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_TimeSlot; + asn_struct_free_f TimeSlot_free; + asn_struct_print_f TimeSlot_print; + asn_constr_check_f TimeSlot_constraint; + ber_type_decoder_f TimeSlot_decode_ber; + der_type_encoder_f TimeSlot_encode_der; + xer_type_decoder_f TimeSlot_decode_xer; + xer_type_encoder_f TimeSlot_encode_xer; + per_type_decoder_f TimeSlot_decode_uper; + per_type_encoder_f TimeSlot_encode_uper; #ifdef __cplusplus } #endif -#endif /* _TimeSlot_H_ */ +#endif /* _TimeSlot_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/TimeSlotScheme.h b/src/core/libs/supl/asn-rrlp/TimeSlotScheme.h index 1857d1540..23e060a13 100644 --- a/src/core/libs/supl/asn-rrlp/TimeSlotScheme.h +++ b/src/core/libs/supl/asn-rrlp/TimeSlotScheme.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _TimeSlotScheme_H_ -#define _TimeSlotScheme_H_ +#ifndef _TimeSlotScheme_H_ +#define _TimeSlotScheme_H_ #include @@ -14,33 +14,35 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Dependencies */ -typedef enum TimeSlotScheme { - TimeSlotScheme_equalLength = 0, - TimeSlotScheme_variousLength = 1 -} e_TimeSlotScheme; + /* Dependencies */ + typedef enum TimeSlotScheme + { + TimeSlotScheme_equalLength = 0, + TimeSlotScheme_variousLength = 1 + } e_TimeSlotScheme; -/* TimeSlotScheme */ -typedef ENUMERATED_t TimeSlotScheme_t; + /* TimeSlotScheme */ + typedef ENUMERATED_t TimeSlotScheme_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_TimeSlotScheme; -asn_struct_free_f TimeSlotScheme_free; -asn_struct_print_f TimeSlotScheme_print; -asn_constr_check_f TimeSlotScheme_constraint; -ber_type_decoder_f TimeSlotScheme_decode_ber; -der_type_encoder_f TimeSlotScheme_encode_der; -xer_type_decoder_f TimeSlotScheme_decode_xer; -xer_type_encoder_f TimeSlotScheme_encode_xer; -per_type_decoder_f TimeSlotScheme_decode_uper; -per_type_encoder_f TimeSlotScheme_encode_uper; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_TimeSlotScheme; + asn_struct_free_f TimeSlotScheme_free; + asn_struct_print_f TimeSlotScheme_print; + asn_constr_check_f TimeSlotScheme_constraint; + ber_type_decoder_f TimeSlotScheme_decode_ber; + der_type_encoder_f TimeSlotScheme_encode_der; + xer_type_decoder_f TimeSlotScheme_decode_xer; + xer_type_encoder_f TimeSlotScheme_encode_xer; + per_type_decoder_f TimeSlotScheme_decode_uper; + per_type_encoder_f TimeSlotScheme_encode_uper; #ifdef __cplusplus } #endif -#endif /* _TimeSlotScheme_H_ */ +#endif /* _TimeSlotScheme_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/UTCModel.h b/src/core/libs/supl/asn-rrlp/UTCModel.h index 1974bea08..cd96de255 100644 --- a/src/core/libs/supl/asn-rrlp/UTCModel.h +++ b/src/core/libs/supl/asn-rrlp/UTCModel.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _UTCModel_H_ -#define _UTCModel_H_ +#ifndef _UTCModel_H_ +#define _UTCModel_H_ #include @@ -15,30 +15,32 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* UTCModel */ -typedef struct UTCModel { - long utcA1; - long utcA0; - long utcTot; - long utcWNt; - long utcDeltaTls; - long utcWNlsf; - long utcDN; - long utcDeltaTlsf; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} UTCModel_t; + /* UTCModel */ + typedef struct UTCModel + { + long utcA1; + long utcA0; + long utcTot; + long utcWNt; + long utcDeltaTls; + long utcWNlsf; + long utcDN; + long utcDeltaTlsf; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_UTCModel; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } UTCModel_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_UTCModel; #ifdef __cplusplus } #endif -#endif /* _UTCModel_H_ */ +#endif /* _UTCModel_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/UlPseudoSegInd.h b/src/core/libs/supl/asn-rrlp/UlPseudoSegInd.h index cd4b52dae..2f7bc4547 100644 --- a/src/core/libs/supl/asn-rrlp/UlPseudoSegInd.h +++ b/src/core/libs/supl/asn-rrlp/UlPseudoSegInd.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _UlPseudoSegInd_H_ -#define _UlPseudoSegInd_H_ +#ifndef _UlPseudoSegInd_H_ +#define _UlPseudoSegInd_H_ #include @@ -14,33 +14,35 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Dependencies */ -typedef enum UlPseudoSegInd { - UlPseudoSegInd_firstOfMany = 0, - UlPseudoSegInd_secondOfMany = 1 -} e_UlPseudoSegInd; + /* Dependencies */ + typedef enum UlPseudoSegInd + { + UlPseudoSegInd_firstOfMany = 0, + UlPseudoSegInd_secondOfMany = 1 + } e_UlPseudoSegInd; -/* UlPseudoSegInd */ -typedef ENUMERATED_t UlPseudoSegInd_t; + /* UlPseudoSegInd */ + typedef ENUMERATED_t UlPseudoSegInd_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_UlPseudoSegInd; -asn_struct_free_f UlPseudoSegInd_free; -asn_struct_print_f UlPseudoSegInd_print; -asn_constr_check_f UlPseudoSegInd_constraint; -ber_type_decoder_f UlPseudoSegInd_decode_ber; -der_type_encoder_f UlPseudoSegInd_encode_der; -xer_type_decoder_f UlPseudoSegInd_decode_xer; -xer_type_encoder_f UlPseudoSegInd_encode_xer; -per_type_decoder_f UlPseudoSegInd_decode_uper; -per_type_encoder_f UlPseudoSegInd_encode_uper; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_UlPseudoSegInd; + asn_struct_free_f UlPseudoSegInd_free; + asn_struct_print_f UlPseudoSegInd_print; + asn_constr_check_f UlPseudoSegInd_constraint; + ber_type_decoder_f UlPseudoSegInd_decode_ber; + der_type_encoder_f UlPseudoSegInd_encode_der; + xer_type_decoder_f UlPseudoSegInd_decode_xer; + xer_type_encoder_f UlPseudoSegInd_encode_xer; + per_type_decoder_f UlPseudoSegInd_decode_uper; + per_type_encoder_f UlPseudoSegInd_encode_uper; #ifdef __cplusplus } #endif -#endif /* _UlPseudoSegInd_H_ */ +#endif /* _UlPseudoSegInd_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/UncompressedEphemeris.h b/src/core/libs/supl/asn-rrlp/UncompressedEphemeris.h index 2cecd614f..d994f4805 100644 --- a/src/core/libs/supl/asn-rrlp/UncompressedEphemeris.h +++ b/src/core/libs/supl/asn-rrlp/UncompressedEphemeris.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _UncompressedEphemeris_H_ -#define _UncompressedEphemeris_H_ +#ifndef _UncompressedEphemeris_H_ +#define _UncompressedEphemeris_H_ #include @@ -16,53 +16,55 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* UncompressedEphemeris */ -typedef struct UncompressedEphemeris { - long ephemCodeOnL2; - long ephemURA; - long ephemSVhealth; - long ephemIODC; - long ephemL2Pflag; - EphemerisSubframe1Reserved_t ephemSF1Rsvd; - long ephemTgd; - long ephemToc; - long ephemAF2; - long ephemAF1; - long ephemAF0; - long ephemCrs; - long ephemDeltaN; - long ephemM0; - long ephemCuc; - unsigned long ephemE; - long ephemCus; - unsigned long ephemAPowerHalf; - long ephemToe; - long ephemFitFlag; - long ephemAODA; - long ephemCic; - long ephemOmegaA0; - long ephemCis; - long ephemI0; - long ephemCrc; - long ephemW; - long ephemOmegaADot; - long ephemIDot; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} UncompressedEphemeris_t; + /* UncompressedEphemeris */ + typedef struct UncompressedEphemeris + { + long ephemCodeOnL2; + long ephemURA; + long ephemSVhealth; + long ephemIODC; + long ephemL2Pflag; + EphemerisSubframe1Reserved_t ephemSF1Rsvd; + long ephemTgd; + long ephemToc; + long ephemAF2; + long ephemAF1; + long ephemAF0; + long ephemCrs; + long ephemDeltaN; + long ephemM0; + long ephemCuc; + unsigned long ephemE; + long ephemCus; + unsigned long ephemAPowerHalf; + long ephemToe; + long ephemFitFlag; + long ephemAODA; + long ephemCic; + long ephemOmegaA0; + long ephemCis; + long ephemI0; + long ephemCrc; + long ephemW; + long ephemOmegaADot; + long ephemIDot; -/* Implementation */ -/* extern asn_TYPE_descriptor_t asn_DEF_ephemE_17; // (Use -fall-defs-global to expose) */ -/* extern asn_TYPE_descriptor_t asn_DEF_ephemAPowerHalf_19; // (Use -fall-defs-global to expose) */ -extern asn_TYPE_descriptor_t asn_DEF_UncompressedEphemeris; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } UncompressedEphemeris_t; + + /* Implementation */ + /* extern asn_TYPE_descriptor_t asn_DEF_ephemE_17; // (Use -fall-defs-global to expose) */ + /* extern asn_TYPE_descriptor_t asn_DEF_ephemAPowerHalf_19; // (Use -fall-defs-global to expose) */ + extern asn_TYPE_descriptor_t asn_DEF_UncompressedEphemeris; #ifdef __cplusplus } #endif -#endif /* _UncompressedEphemeris_H_ */ +#endif /* _UncompressedEphemeris_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/UseMultipleSets.h b/src/core/libs/supl/asn-rrlp/UseMultipleSets.h index b156fc467..45136278c 100644 --- a/src/core/libs/supl/asn-rrlp/UseMultipleSets.h +++ b/src/core/libs/supl/asn-rrlp/UseMultipleSets.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _UseMultipleSets_H_ -#define _UseMultipleSets_H_ +#ifndef _UseMultipleSets_H_ +#define _UseMultipleSets_H_ #include @@ -14,33 +14,35 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Dependencies */ -typedef enum UseMultipleSets { - UseMultipleSets_multipleSets = 0, - UseMultipleSets_oneSet = 1 -} e_UseMultipleSets; + /* Dependencies */ + typedef enum UseMultipleSets + { + UseMultipleSets_multipleSets = 0, + UseMultipleSets_oneSet = 1 + } e_UseMultipleSets; -/* UseMultipleSets */ -typedef ENUMERATED_t UseMultipleSets_t; + /* UseMultipleSets */ + typedef ENUMERATED_t UseMultipleSets_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_UseMultipleSets; -asn_struct_free_f UseMultipleSets_free; -asn_struct_print_f UseMultipleSets_print; -asn_constr_check_f UseMultipleSets_constraint; -ber_type_decoder_f UseMultipleSets_decode_ber; -der_type_encoder_f UseMultipleSets_encode_der; -xer_type_decoder_f UseMultipleSets_decode_xer; -xer_type_encoder_f UseMultipleSets_encode_xer; -per_type_decoder_f UseMultipleSets_decode_uper; -per_type_encoder_f UseMultipleSets_encode_uper; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_UseMultipleSets; + asn_struct_free_f UseMultipleSets_free; + asn_struct_print_f UseMultipleSets_print; + asn_constr_check_f UseMultipleSets_constraint; + ber_type_decoder_f UseMultipleSets_decode_ber; + der_type_encoder_f UseMultipleSets_encode_der; + xer_type_decoder_f UseMultipleSets_decode_xer; + xer_type_encoder_f UseMultipleSets_encode_xer; + per_type_decoder_f UseMultipleSets_decode_uper; + per_type_encoder_f UseMultipleSets_encode_uper; #ifdef __cplusplus } #endif -#endif /* _UseMultipleSets_H_ */ +#endif /* _UseMultipleSets_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/VelocityEstimate.h b/src/core/libs/supl/asn-rrlp/VelocityEstimate.h index 45dbb1669..0ef92f9a5 100644 --- a/src/core/libs/supl/asn-rrlp/VelocityEstimate.h +++ b/src/core/libs/supl/asn-rrlp/VelocityEstimate.h @@ -4,8 +4,8 @@ * found in "../rrlp-components.asn" */ -#ifndef _VelocityEstimate_H_ -#define _VelocityEstimate_H_ +#ifndef _VelocityEstimate_H_ +#define _VelocityEstimate_H_ #include @@ -14,27 +14,28 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* VelocityEstimate */ -typedef INTEGER_t VelocityEstimate_t; + /* VelocityEstimate */ + typedef INTEGER_t VelocityEstimate_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_VelocityEstimate; -asn_struct_free_f VelocityEstimate_free; -asn_struct_print_f VelocityEstimate_print; -asn_constr_check_f VelocityEstimate_constraint; -ber_type_decoder_f VelocityEstimate_decode_ber; -der_type_encoder_f VelocityEstimate_encode_der; -xer_type_decoder_f VelocityEstimate_decode_xer; -xer_type_encoder_f VelocityEstimate_encode_xer; -per_type_decoder_f VelocityEstimate_decode_uper; -per_type_encoder_f VelocityEstimate_encode_uper; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_VelocityEstimate; + asn_struct_free_f VelocityEstimate_free; + asn_struct_print_f VelocityEstimate_print; + asn_constr_check_f VelocityEstimate_constraint; + ber_type_decoder_f VelocityEstimate_decode_ber; + der_type_encoder_f VelocityEstimate_encode_der; + xer_type_decoder_f VelocityEstimate_decode_xer; + xer_type_encoder_f VelocityEstimate_encode_xer; + per_type_decoder_f VelocityEstimate_decode_uper; + per_type_encoder_f VelocityEstimate_encode_uper; #ifdef __cplusplus } #endif -#endif /* _VelocityEstimate_H_ */ +#endif /* _VelocityEstimate_H_ */ #include diff --git a/src/core/libs/supl/asn-rrlp/asn_SEQUENCE_OF.h b/src/core/libs/supl/asn-rrlp/asn_SEQUENCE_OF.h index e678f0347..2ad8287a0 100644 --- a/src/core/libs/supl/asn-rrlp/asn_SEQUENCE_OF.h +++ b/src/core/libs/supl/asn-rrlp/asn_SEQUENCE_OF.h @@ -2,13 +2,14 @@ * Copyright (c) 2003, 2004 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ -#ifndef ASN_SEQUENCE_OF_H -#define ASN_SEQUENCE_OF_H +#ifndef ASN_SEQUENCE_OF_H +#define ASN_SEQUENCE_OF_H #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif /* @@ -16,37 +17,37 @@ extern "C" { * the delete operation preserves the initial order of elements * and thus MAY operate in non-constant time. */ -#define A_SEQUENCE_OF(type) A_SET_OF(type) +#define A_SEQUENCE_OF(type) A_SET_OF(type) -#define ASN_SEQUENCE_ADD(headptr, ptr) \ - asn_sequence_add((headptr), (ptr)) +#define ASN_SEQUENCE_ADD(headptr, ptr) \ + asn_sequence_add((headptr), (ptr)) -/*********************************************** + /*********************************************** * Implementation of the SEQUENCE OF structure. */ -#define asn_sequence_add asn_set_add -#define asn_sequence_empty asn_set_empty +#define asn_sequence_add asn_set_add +#define asn_sequence_empty asn_set_empty -/* + /* * Delete the element from the set by its number (base 0). * This is NOT a constant-time operation. * The order of elements is preserved. * If _do_free is given AND the (*free) is initialized, the element * will be freed using the custom (*free) function as well. */ -void asn_sequence_del(void *asn_sequence_of_x, int number, int _do_free); + void asn_sequence_del(void *asn_sequence_of_x, int number, int _do_free); -/* + /* * Cope with different conversions requirements to/from void in C and C++. * This is mostly useful for support library. */ -typedef A_SEQUENCE_OF(void) asn_anonymous_sequence_; -#define _A_SEQUENCE_FROM_VOID(ptr) ((asn_anonymous_sequence_ *)(ptr)) -#define _A_CSEQUENCE_FROM_VOID(ptr) ((const asn_anonymous_sequence_ *)(ptr)) + typedef A_SEQUENCE_OF(void) asn_anonymous_sequence_; +#define _A_SEQUENCE_FROM_VOID(ptr) ((asn_anonymous_sequence_ *)(ptr)) +#define _A_CSEQUENCE_FROM_VOID(ptr) ((const asn_anonymous_sequence_ *)(ptr)) #ifdef __cplusplus } #endif -#endif /* ASN_SEQUENCE_OF_H */ +#endif /* ASN_SEQUENCE_OF_H */ diff --git a/src/core/libs/supl/asn-rrlp/asn_SET_OF.h b/src/core/libs/supl/asn-rrlp/asn_SET_OF.h index 7edf14b51..0edc0abc4 100644 --- a/src/core/libs/supl/asn-rrlp/asn_SET_OF.h +++ b/src/core/libs/supl/asn-rrlp/asn_SET_OF.h @@ -2,36 +2,38 @@ * Copyright (c) 2003, 2004 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ -#ifndef ASN_SET_OF_H -#define ASN_SET_OF_H +#ifndef ASN_SET_OF_H +#define ASN_SET_OF_H #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -#define A_SET_OF(type) \ - struct { \ - type **array; \ - int count; /* Meaningful size */ \ - int size; /* Allocated size */ \ - void (*free)(type *); \ - } +#define A_SET_OF(type) \ + struct \ + { \ + type **array; \ + int count; /* Meaningful size */ \ + int size; /* Allocated size */ \ + void (*free)(type *); \ + } -#define ASN_SET_ADD(headptr, ptr) \ - asn_set_add((headptr), (ptr)) +#define ASN_SET_ADD(headptr, ptr) \ + asn_set_add((headptr), (ptr)) -/******************************************* + /******************************************* * Implementation of the SET OF structure. */ -/* + /* * Add another structure into the set by its pointer. * RETURN VALUES: * 0 for success and -1/errno for failure. */ -int asn_set_add(void *asn_set_of_x, void *ptr); + int asn_set_add(void *asn_set_of_x, void *ptr); -/* + /* * Delete the element from the set by its number (base 0). * This is a constant-time operation. The order of elements before the * deleted ones is guaranteed, the order of elements after the deleted @@ -39,24 +41,24 @@ int asn_set_add(void *asn_set_of_x, void *ptr); * If _do_free is given AND the (*free) is initialized, the element * will be freed using the custom (*free) function as well. */ -void asn_set_del(void *asn_set_of_x, int number, int _do_free); + void asn_set_del(void *asn_set_of_x, int number, int _do_free); -/* + /* * Empty the contents of the set. Will free the elements, if (*free) is given. * Will NOT free the set itself. */ -void asn_set_empty(void *asn_set_of_x); + void asn_set_empty(void *asn_set_of_x); -/* + /* * Cope with different conversions requirements to/from void in C and C++. * This is mostly useful for support library. */ -typedef A_SET_OF(void) asn_anonymous_set_; -#define _A_SET_FROM_VOID(ptr) ((asn_anonymous_set_ *)(ptr)) -#define _A_CSET_FROM_VOID(ptr) ((const asn_anonymous_set_ *)(ptr)) + typedef A_SET_OF(void) asn_anonymous_set_; +#define _A_SET_FROM_VOID(ptr) ((asn_anonymous_set_ *)(ptr)) +#define _A_CSET_FROM_VOID(ptr) ((const asn_anonymous_set_ *)(ptr)) #ifdef __cplusplus } #endif -#endif /* ASN_SET_OF_H */ +#endif /* ASN_SET_OF_H */ diff --git a/src/core/libs/supl/asn-rrlp/asn_application.h b/src/core/libs/supl/asn-rrlp/asn_application.h index f40cd86ad..43904afb0 100644 --- a/src/core/libs/supl/asn-rrlp/asn_application.h +++ b/src/core/libs/supl/asn-rrlp/asn_application.h @@ -5,27 +5,28 @@ /* * Application-level ASN.1 callbacks. */ -#ifndef _ASN_APPLICATION_H_ -#define _ASN_APPLICATION_H_ +#ifndef _ASN_APPLICATION_H_ +#define _ASN_APPLICATION_H_ -#include "asn_system.h" /* for platform-dependent types */ -#include "asn_codecs.h" /* for ASN.1 codecs specifics */ +#include "asn_system.h" /* for platform-dependent types */ +#include "asn_codecs.h" /* for ASN.1 codecs specifics */ #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* + /* * Generic type of an application-defined callback to return various * types of data to the application. * EXPECTED RETURN VALUES: * -1: Failed to consume bytes. Abort the mission. * Non-negative return values indicate success, and ignored. */ -typedef int (asn_app_consume_bytes_f)(const void *buffer, size_t size, - void *application_specific_key); + typedef int(asn_app_consume_bytes_f)(const void *buffer, size_t size, + void *application_specific_key); -/* + /* * A callback of this type is called whenever constraint validation fails * on some ASN.1 type. See "constraints.h" for more details on constraint * validation. @@ -33,15 +34,15 @@ typedef int (asn_app_consume_bytes_f)(const void *buffer, size_t size, * the constraint check, as well as human readable message on what * particular constraint has failed. */ -typedef void (asn_app_constraint_failed_f)(void *application_specific_key, - struct asn_TYPE_descriptor_s *type_descriptor_which_failed, - const void *structure_which_failed_ptr, - const char *error_message_format, ...) GCC_PRINTFLIKE(4, 5); + typedef void(asn_app_constraint_failed_f)(void *application_specific_key, + struct asn_TYPE_descriptor_s *type_descriptor_which_failed, + const void *structure_which_failed_ptr, + const char *error_message_format, ...) GCC_PRINTFLIKE(4, 5); #ifdef __cplusplus } #endif -#include "constr_TYPE.h" /* for asn_TYPE_descriptor_t */ +#include "constr_TYPE.h" /* for asn_TYPE_descriptor_t */ -#endif /* _ASN_APPLICATION_H_ */ +#endif /* _ASN_APPLICATION_H_ */ diff --git a/src/core/libs/supl/asn-rrlp/asn_codecs.h b/src/core/libs/supl/asn-rrlp/asn_codecs.h index 4a251d940..717336ed5 100644 --- a/src/core/libs/supl/asn-rrlp/asn_codecs.h +++ b/src/core/libs/supl/asn-rrlp/asn_codecs.h @@ -3,16 +3,17 @@ * All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ -#ifndef _ASN_CODECS_H_ -#define _ASN_CODECS_H_ +#ifndef _ASN_CODECS_H_ +#define _ASN_CODECS_H_ #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -struct asn_TYPE_descriptor_s; /* Forward declaration */ + struct asn_TYPE_descriptor_s; /* Forward declaration */ -/* + /* * This structure defines a set of parameters that may be passed * to every ASN.1 encoder or decoder function. * WARNING: if max_stack_size member is set, and you are calling the @@ -21,8 +22,9 @@ struct asn_TYPE_descriptor_s; /* Forward declaration */ * If you can't always satisfy this requirement, use ber_decode(), * xer_decode() and uper_decode() functions instead. */ -typedef struct asn_codec_ctx_s { - /* + typedef struct asn_codec_ctx_s + { + /* * Limit the decoder routines to use no (much) more stack than a given * number of bytes. Most of decoders are stack-based, and this * would protect against stack overflows if the number of nested @@ -33,45 +35,52 @@ typedef struct asn_codec_ctx_s { * this variable. Be careful in multithreaded environments, as the * stack size is rather limited. */ - size_t max_stack_size; /* 0 disables stack bounds checking */ -} asn_codec_ctx_t; + size_t max_stack_size; /* 0 disables stack bounds checking */ + } asn_codec_ctx_t; -/* + /* * Type of the return value of the encoding functions (der_encode, xer_encode). */ -typedef struct asn_enc_rval_s { - /* + typedef struct asn_enc_rval_s + { + /* * Number of bytes encoded. * -1 indicates failure to encode the structure. * In this case, the members below this one are meaningful. */ - ssize_t encoded; + ssize_t encoded; - /* + /* * Members meaningful when (encoded == -1), for post mortem analysis. */ - /* Type which cannot be encoded */ - struct asn_TYPE_descriptor_s *failed_type; + /* Type which cannot be encoded */ + struct asn_TYPE_descriptor_s *failed_type; - /* Pointer to the structure of that type */ - void *structure_ptr; -} asn_enc_rval_t; -#define _ASN_ENCODE_FAILED do { \ - asn_enc_rval_t tmp_error; \ - tmp_error.encoded = -1; \ - tmp_error.failed_type = td; \ - tmp_error.structure_ptr = sptr; \ - ASN_DEBUG("Failed to encode element %s", td->name); \ - return tmp_error; \ -} while(0) -#define _ASN_ENCODED_OK(rval) do { \ - rval.structure_ptr = 0; \ - rval.failed_type = 0; \ - return rval; \ -} while(0) + /* Pointer to the structure of that type */ + void *structure_ptr; + } asn_enc_rval_t; +#define _ASN_ENCODE_FAILED \ + do \ + { \ + asn_enc_rval_t tmp_error; \ + tmp_error.encoded = -1; \ + tmp_error.failed_type = td; \ + tmp_error.structure_ptr = sptr; \ + ASN_DEBUG("Failed to encode element %s", td->name); \ + return tmp_error; \ + } \ + while (0) +#define _ASN_ENCODED_OK(rval) \ + do \ + { \ + rval.structure_ptr = 0; \ + rval.failed_type = 0; \ + return rval; \ + } \ + while (0) -/* + /* * Type of the return value of the decoding functions (ber_decode, xer_decode) * * Please note that the number of consumed bytes is ALWAYS meaningful, @@ -79,31 +88,39 @@ typedef struct asn_enc_rval_s { * decoded bytes, hence providing a possibility to fail with more diagnostics * (i.e., print the offending remainder of the buffer). */ -enum asn_dec_rval_code_e { - RC_OK, /* Decoded successfully */ - RC_WMORE, /* More data expected, call again */ - RC_FAIL /* Failure to decode data */ -}; -typedef struct asn_dec_rval_s { - enum asn_dec_rval_code_e code; /* Result code */ - size_t consumed; /* Number of bytes consumed */ -} asn_dec_rval_t; -#define _ASN_DECODE_FAILED do { \ - asn_dec_rval_t tmp_error; \ - tmp_error.code = RC_FAIL; \ - tmp_error.consumed = 0; \ - ASN_DEBUG("Failed to decode element %s", td->name); \ - return tmp_error; \ -} while(0) -#define _ASN_DECODE_STARVED do { \ - asn_dec_rval_t tmp_error; \ - tmp_error.code = RC_WMORE; \ - tmp_error.consumed = 0; \ - return tmp_error; \ -} while(0) + enum asn_dec_rval_code_e + { + RC_OK, /* Decoded successfully */ + RC_WMORE, /* More data expected, call again */ + RC_FAIL /* Failure to decode data */ + }; + typedef struct asn_dec_rval_s + { + enum asn_dec_rval_code_e code; /* Result code */ + size_t consumed; /* Number of bytes consumed */ + } asn_dec_rval_t; +#define _ASN_DECODE_FAILED \ + do \ + { \ + asn_dec_rval_t tmp_error; \ + tmp_error.code = RC_FAIL; \ + tmp_error.consumed = 0; \ + ASN_DEBUG("Failed to decode element %s", td->name); \ + return tmp_error; \ + } \ + while (0) +#define _ASN_DECODE_STARVED \ + do \ + { \ + asn_dec_rval_t tmp_error; \ + tmp_error.code = RC_WMORE; \ + tmp_error.consumed = 0; \ + return tmp_error; \ + } \ + while (0) #ifdef __cplusplus } #endif -#endif /* _ASN_CODECS_H_ */ +#endif /* _ASN_CODECS_H_ */ diff --git a/src/core/libs/supl/asn-rrlp/asn_codecs_prim.h b/src/core/libs/supl/asn-rrlp/asn_codecs_prim.h index 0f683fdd0..cb8c37937 100644 --- a/src/core/libs/supl/asn-rrlp/asn_codecs_prim.h +++ b/src/core/libs/supl/asn-rrlp/asn_codecs_prim.h @@ -2,52 +2,53 @@ * Copyright (c) 2004 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ -#ifndef ASN_CODECS_PRIM_H -#define ASN_CODECS_PRIM_H +#ifndef ASN_CODECS_PRIM_H +#define ASN_CODECS_PRIM_H #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -typedef struct ASN__PRIMITIVE_TYPE_s { - uint8_t *buf; /* Buffer with consecutive primitive encoding bytes */ - int size; /* Size of the buffer */ -} ASN__PRIMITIVE_TYPE_t; /* Do not use this type directly! */ + typedef struct ASN__PRIMITIVE_TYPE_s + { + uint8_t *buf; /* Buffer with consecutive primitive encoding bytes */ + int size; /* Size of the buffer */ + } ASN__PRIMITIVE_TYPE_t; /* Do not use this type directly! */ -asn_struct_free_f ASN__PRIMITIVE_TYPE_free; -ber_type_decoder_f ber_decode_primitive; -der_type_encoder_f der_encode_primitive; + asn_struct_free_f ASN__PRIMITIVE_TYPE_free; + ber_type_decoder_f ber_decode_primitive; + der_type_encoder_f der_encode_primitive; -/* + /* * A callback specification for the xer_decode_primitive() function below. */ -enum xer_pbd_rval { - XPBD_SYSTEM_FAILURE, /* System failure (memory shortage, etc) */ - XPBD_DECODER_LIMIT, /* Hit some decoder limitation or deficiency */ - XPBD_BROKEN_ENCODING, /* Encoding of a primitive body is broken */ - XPBD_NOT_BODY_IGNORE, /* Not a body format, but safe to ignore */ - XPBD_BODY_CONSUMED /* Body is recognized and consumed */ -}; -typedef enum xer_pbd_rval (xer_primitive_body_decoder_f) - (asn_TYPE_descriptor_t *td, void *struct_ptr, - const void *chunk_buf, size_t chunk_size); + enum xer_pbd_rval + { + XPBD_SYSTEM_FAILURE, /* System failure (memory shortage, etc) */ + XPBD_DECODER_LIMIT, /* Hit some decoder limitation or deficiency */ + XPBD_BROKEN_ENCODING, /* Encoding of a primitive body is broken */ + XPBD_NOT_BODY_IGNORE, /* Not a body format, but safe to ignore */ + XPBD_BODY_CONSUMED /* Body is recognized and consumed */ + }; + typedef enum xer_pbd_rval(xer_primitive_body_decoder_f)(asn_TYPE_descriptor_t *td, void *struct_ptr, + const void *chunk_buf, size_t chunk_size); -/* + /* * Specific function to decode simple primitive types. * Also see xer_decode_general() in xer_decoder.h */ -asn_dec_rval_t xer_decode_primitive(asn_codec_ctx_t *opt_codec_ctx, - asn_TYPE_descriptor_t *type_descriptor, - void **struct_ptr, size_t struct_size, - const char *opt_mname, - const void *buf_ptr, size_t size, - xer_primitive_body_decoder_f *prim_body_decoder -); + asn_dec_rval_t xer_decode_primitive(asn_codec_ctx_t *opt_codec_ctx, + asn_TYPE_descriptor_t *type_descriptor, + void **struct_ptr, size_t struct_size, + const char *opt_mname, + const void *buf_ptr, size_t size, + xer_primitive_body_decoder_f *prim_body_decoder); #ifdef __cplusplus } #endif -#endif /* ASN_CODECS_PRIM_H */ +#endif /* ASN_CODECS_PRIM_H */ diff --git a/src/core/libs/supl/asn-rrlp/asn_internal.h b/src/core/libs/supl/asn-rrlp/asn_internal.h index 249d7ef64..299c4e0e7 100644 --- a/src/core/libs/supl/asn-rrlp/asn_internal.h +++ b/src/core/libs/supl/asn-rrlp/asn_internal.h @@ -6,114 +6,130 @@ /* * Declarations internally useful for the ASN.1 support code. */ -#ifndef _ASN_INTERNAL_H_ -#define _ASN_INTERNAL_H_ +#ifndef _ASN_INTERNAL_H_ +#define _ASN_INTERNAL_H_ -#include "asn_application.h" /* Application-visible API */ +#include "asn_application.h" /* Application-visible API */ -#ifndef __NO_ASSERT_H__ /* Include assert.h only for internal use. */ -#include /* for assert() macro */ +#ifndef __NO_ASSERT_H__ /* Include assert.h only for internal use. */ +#include /* for assert() macro */ #endif -#ifdef __cplusplus -extern "C" { +#ifdef __cplusplus +extern "C" +{ #endif /* Environment version might be used to avoid running with the old library */ -#define ASN1C_ENVIRONMENT_VERSION 922 /* Compile-time version */ -int get_asn1c_environment_version(void); /* Run-time version */ +#define ASN1C_ENVIRONMENT_VERSION 922 /* Compile-time version */ + int get_asn1c_environment_version(void); /* Run-time version */ -#define CALLOC(nmemb, size) calloc(nmemb, size) -#define MALLOC(size) malloc(size) -#define REALLOC(oldptr, size) realloc(oldptr, size) -#define FREEMEM(ptr) free(ptr) +#define CALLOC(nmemb, size) calloc(nmemb, size) +#define MALLOC(size) malloc(size) +#define REALLOC(oldptr, size) realloc(oldptr, size) +#define FREEMEM(ptr) free(ptr) /* * A macro for debugging the ASN.1 internals. * You may enable or override it. */ -#ifndef ASN_DEBUG /* If debugging code is not defined elsewhere... */ -#if EMIT_ASN_DEBUG == 1 /* And it was asked to emit this code... */ -#ifdef __GNUC__ -#ifdef ASN_THREAD_SAFE -#define asn_debug_indent 0 -#else /* !ASN_THREAD_SAFE */ -int asn_debug_indent; -#endif /* ASN_THREAD_SAFE */ -#define ASN_DEBUG(fmt, args...) do { \ - int adi = asn_debug_indent; \ - while(adi--) fprintf(stderr, " "); \ - fprintf(stderr, fmt, ##args); \ - fprintf(stderr, " (%s:%d)\n", \ - __FILE__, __LINE__); \ - } while(0) -#else /* !__GNUC__ */ -void ASN_DEBUG_f(const char *fmt, ...); -#define ASN_DEBUG ASN_DEBUG_f -#endif /* __GNUC__ */ -#else /* EMIT_ASN_DEBUG != 1 */ -static inline void ASN_DEBUG(const char *fmt, ...) { (void)fmt; } -#endif /* EMIT_ASN_DEBUG */ -#endif /* ASN_DEBUG */ +#ifndef ASN_DEBUG /* If debugging code is not defined elsewhere... */ +#if EMIT_ASN_DEBUG == 1 /* And it was asked to emit this code... */ +#ifdef __GNUC__ +#ifdef ASN_THREAD_SAFE +#define asn_debug_indent 0 +#else /* !ASN_THREAD_SAFE */ + int asn_debug_indent; +#endif /* ASN_THREAD_SAFE */ +#define ASN_DEBUG(fmt, args...) \ + do \ + { \ + int adi = asn_debug_indent; \ + while (adi--) fprintf(stderr, " "); \ + fprintf(stderr, fmt, ##args); \ + fprintf(stderr, " (%s:%d)\n", \ + __FILE__, __LINE__); \ + } \ + while (0) +#else /* !__GNUC__ */ + void ASN_DEBUG_f(const char *fmt, ...); +#define ASN_DEBUG ASN_DEBUG_f +#endif /* __GNUC__ */ +#else /* EMIT_ASN_DEBUG != 1 */ + static inline void ASN_DEBUG(const char *fmt, ...) + { + (void)fmt; + } +#endif /* EMIT_ASN_DEBUG */ +#endif /* ASN_DEBUG */ /* * Invoke the application-supplied callback and fail, if something is wrong. */ -#define __ASN_E_cbc(buf, size) (cb((buf), (size), app_key) < 0) -#define _ASN_E_CALLBACK(foo) do { \ - if(foo) goto cb_failed; \ - } while(0) -#define _ASN_CALLBACK(buf, size) \ - _ASN_E_CALLBACK(__ASN_E_cbc(buf, size)) -#define _ASN_CALLBACK2(buf1, size1, buf2, size2) \ - _ASN_E_CALLBACK(__ASN_E_cbc(buf1, size1) || __ASN_E_cbc(buf2, size2)) -#define _ASN_CALLBACK3(buf1, size1, buf2, size2, buf3, size3) \ - _ASN_E_CALLBACK(__ASN_E_cbc(buf1, size1) \ - || __ASN_E_cbc(buf2, size2) \ - || __ASN_E_cbc(buf3, size3)) +#define __ASN_E_cbc(buf, size) (cb((buf), (size), app_key) < 0) +#define _ASN_E_CALLBACK(foo) \ + do \ + { \ + if (foo) goto cb_failed; \ + } \ + while (0) +#define _ASN_CALLBACK(buf, size) \ + _ASN_E_CALLBACK(__ASN_E_cbc(buf, size)) +#define _ASN_CALLBACK2(buf1, size1, buf2, size2) \ + _ASN_E_CALLBACK(__ASN_E_cbc(buf1, size1) || __ASN_E_cbc(buf2, size2)) +#define _ASN_CALLBACK3(buf1, size1, buf2, size2, buf3, size3) \ + _ASN_E_CALLBACK(__ASN_E_cbc(buf1, size1) || __ASN_E_cbc(buf2, size2) || __ASN_E_cbc(buf3, size3)) -#define _i_ASN_TEXT_INDENT(nl, level) do { \ - int __level = (level); \ - int __nl = ((nl) != 0); \ - int __i; \ - if(__nl) _ASN_CALLBACK("\n", 1); \ - if(__level < 0) __level = 0; \ - for(__i = 0; __i < __level; __i++) \ - _ASN_CALLBACK(" ", 4); \ - er.encoded += __nl + 4 * __level; \ -} while(0) +#define _i_ASN_TEXT_INDENT(nl, level) \ + do \ + { \ + int __level = (level); \ + int __nl = ((nl) != 0); \ + int __i; \ + if (__nl) _ASN_CALLBACK("\n", 1); \ + if (__level < 0) __level = 0; \ + for (__i = 0; __i < __level; __i++) \ + _ASN_CALLBACK(" ", 4); \ + er.encoded += __nl + 4 * __level; \ + } \ + while (0) -#define _i_INDENT(nl) do { \ - int __i; \ - if((nl) && cb("\n", 1, app_key) < 0) return -1; \ - for(__i = 0; __i < ilevel; __i++) \ - if(cb(" ", 4, app_key) < 0) return -1; \ -} while(0) +#define _i_INDENT(nl) \ + do \ + { \ + int __i; \ + if ((nl) && cb("\n", 1, app_key) < 0) return -1; \ + for (__i = 0; __i < ilevel; __i++) \ + if (cb(" ", 4, app_key) < 0) return -1; \ + } \ + while (0) /* * Check stack against overflow, if limit is set. */ -#define _ASN_DEFAULT_STACK_MAX (30000) -static inline int -_ASN_STACK_OVERFLOW_CHECK(asn_codec_ctx_t *ctx) { - if(ctx && ctx->max_stack_size) { +#define _ASN_DEFAULT_STACK_MAX (30000) + static inline int + _ASN_STACK_OVERFLOW_CHECK(asn_codec_ctx_t *ctx) + { + if (ctx && ctx->max_stack_size) + { + /* ctx MUST be allocated on the stack */ + ptrdiff_t usedstack = ((char *)ctx - (char *)&ctx); + if (usedstack > 0) usedstack = -usedstack; /* grows up! */ - /* ctx MUST be allocated on the stack */ - ptrdiff_t usedstack = ((char *)ctx - (char *)&ctx); - if(usedstack > 0) usedstack = -usedstack; /* grows up! */ + /* double negative required to avoid int wrap-around */ + if (usedstack < -(ptrdiff_t)ctx->max_stack_size) + { + ASN_DEBUG("Stack limit %ld reached", + (long)ctx->max_stack_size); + return -1; + } + } + return 0; + } - /* double negative required to avoid int wrap-around */ - if(usedstack < -(ptrdiff_t)ctx->max_stack_size) { - ASN_DEBUG("Stack limit %ld reached", - (long)ctx->max_stack_size); - return -1; - } - } - return 0; -} - -#ifdef __cplusplus +#ifdef __cplusplus } #endif -#endif /* _ASN_INTERNAL_H_ */ +#endif /* _ASN_INTERNAL_H_ */ diff --git a/src/core/libs/supl/asn-rrlp/asn_system.h b/src/core/libs/supl/asn-rrlp/asn_system.h index 0a9b092c3..1d2958174 100644 --- a/src/core/libs/supl/asn-rrlp/asn_system.h +++ b/src/core/libs/supl/asn-rrlp/asn_system.h @@ -6,124 +6,121 @@ /* * Miscellaneous system-dependent types. */ -#ifndef _ASN_SYSTEM_H_ -#define _ASN_SYSTEM_H_ +#ifndef _ASN_SYSTEM_H_ +#define _ASN_SYSTEM_H_ -#ifdef HAVE_CONFIG_H +#ifdef HAVE_CONFIG_H #include "config.h" #endif -#include /* For snprintf(3) */ -#include /* For *alloc(3) */ -#include /* For memcpy(3) */ -#include /* For size_t */ -#include /* For LONG_MAX */ -#include /* For va_start */ -#include /* for offsetof and ptrdiff_t */ +#include /* For snprintf(3) */ +#include /* For *alloc(3) */ +#include /* For memcpy(3) */ +#include /* For size_t */ +#include /* For LONG_MAX */ +#include /* For va_start */ +#include /* for offsetof and ptrdiff_t */ -#ifdef WIN32 +#ifdef WIN32 #include -#define snprintf _snprintf -#define vsnprintf _vsnprintf +#define snprintf _snprintf +#define vsnprintf _vsnprintf /* To avoid linking with ws2_32.lib, here's the definition of ntohl() */ -#define sys_ntohl(l) ((((l) << 24) & 0xff000000) \ - | (((l) << 16) & 0xff0000) \ - | (((l) << 8) & 0xff00) \ - | ((l) & 0xff)) +#define sys_ntohl(l) ((((l) << 24) & 0xff000000) | (((l) << 16) & 0xff0000) | (((l) << 8) & 0xff00) | ((l)&0xff)) -#ifdef _MSC_VER /* MSVS.Net */ +#ifdef _MSC_VER /* MSVS.Net */ #ifndef __cplusplus #define inline __inline #endif -#ifndef ASSUMESTDTYPES /* Standard types have been defined elsewhere */ -#define ssize_t SSIZE_T -typedef char int8_t; -typedef short int16_t; -typedef int int32_t; -typedef unsigned char uint8_t; -typedef unsigned short uint16_t; -typedef unsigned int uint32_t; -#endif /* ASSUMESTDTYPES */ +#ifndef ASSUMESTDTYPES /* Standard types have been defined elsewhere */ +#define ssize_t SSIZE_T +typedef char int8_t; +typedef short int16_t; +typedef int int32_t; +typedef unsigned char uint8_t; +typedef unsigned short uint16_t; +typedef unsigned int uint32_t; +#endif /* ASSUMESTDTYPES */ #define WIN32_LEAN_AND_MEAN #include #include #define isnan _isnan #define finite _finite #define copysign _copysign -#define ilogb _logb -#else /* !_MSC_VER */ +#define ilogb _logb +#else /* !_MSC_VER */ #include -#endif /* _MSC_VER */ +#endif /* _MSC_VER */ -#else /* !WIN32 */ +#else /* !WIN32 */ #if defined(__vxworks) #include -#else /* !defined(__vxworks) */ +#else /* !defined(__vxworks) */ -#include /* C99 specifies this file */ +#include /* C99 specifies this file */ /* * 1. Earlier FreeBSD version didn't have , * but was present. * 2. Sun Solaris requires for alloca(3), * but does not have . */ -#if (!defined(__FreeBSD__) || !defined(_SYS_INTTYPES_H_)) -#if defined(sun) -#include /* For alloca(3) */ -#include /* for finite(3) */ -#elif defined(__hpux) -#ifdef __GNUC__ -#include /* For alloca(3) */ -#else /* !__GNUC__ */ +#if (!defined(__FreeBSD__) || !defined(_SYS_INTTYPES_H_)) +#if defined(sun) +#include /* For alloca(3) */ +#include /* for finite(3) */ +#elif defined(__hpux) +#ifdef __GNUC__ +#include /* For alloca(3) */ +#else /* !__GNUC__ */ #define inline -#endif /* __GNUC__ */ +#endif /* __GNUC__ */ #else -#include /* SUSv2+ and C99 specify this file, for uintXX_t */ -#endif /* defined(sun) */ +#include /* SUSv2+ and C99 specify this file, for uintXX_t */ +#endif /* defined(sun) */ #endif #include /* for ntohl() */ -#define sys_ntohl(foo) ntohl(foo) +#define sys_ntohl(foo) ntohl(foo) -#endif /* defined(__vxworks) */ +#endif /* defined(__vxworks) */ -#endif /* WIN32 */ +#endif /* WIN32 */ -#if __GNUC__ >= 3 -#ifndef GCC_PRINTFLIKE -#define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var))) +#if __GNUC__ >= 3 +#ifndef GCC_PRINTFLIKE +#define GCC_PRINTFLIKE(fmt, var) __attribute__((format(printf, fmt, var))) #endif -#ifndef GCC_NOTUSED -#define GCC_NOTUSED __attribute__((unused)) +#ifndef GCC_NOTUSED +#define GCC_NOTUSED __attribute__((unused)) #endif #else -#ifndef GCC_PRINTFLIKE -#define GCC_PRINTFLIKE(fmt,var) /* nothing */ +#ifndef GCC_PRINTFLIKE +#define GCC_PRINTFLIKE(fmt, var) /* nothing */ #endif -#ifndef GCC_NOTUSED -#define GCC_NOTUSED +#ifndef GCC_NOTUSED +#define GCC_NOTUSED #endif #endif /* Figure out if thread safety is requested */ #if !defined(ASN_THREAD_SAFE) && (defined(THREAD_SAFE) || defined(_REENTRANT)) -#define ASN_THREAD_SAFE -#endif /* Thread safety */ +#define ASN_THREAD_SAFE +#endif /* Thread safety */ -#ifndef offsetof /* If not defined by */ -#define offsetof(s, m) ((ptrdiff_t)&(((s *)0)->m) - (ptrdiff_t)((s *)0)) -#endif /* offsetof */ +#ifndef offsetof /* If not defined by */ +#define offsetof(s, m) ((ptrdiff_t) & (((s *)0)->m) - (ptrdiff_t)((s *)0)) +#endif /* offsetof */ -#ifndef MIN /* Suitable for comparing primitive types (integers) */ +#ifndef MIN /* Suitable for comparing primitive types (integers) */ #if defined(__GNUC__) -#define MIN(a,b) ({ __typeof a _a = a; __typeof b _b = b; \ +#define MIN(a, b) ({ __typeof a _a = a; __typeof b _b = b; \ ((_a)<(_b)?(_a):(_b)); }) -#else /* !__GNUC__ */ -#define MIN(a,b) ((a)<(b)?(a):(b)) /* Unsafe variant */ -#endif /* __GNUC__ */ -#endif /* MIN */ +#else /* !__GNUC__ */ +#define MIN(a, b) ((a) < (b) ? (a) : (b)) /* Unsafe variant */ +#endif /* __GNUC__ */ +#endif /* MIN */ -#endif /* _ASN_SYSTEM_H_ */ +#endif /* _ASN_SYSTEM_H_ */ diff --git a/src/core/libs/supl/asn-rrlp/ber_decoder.h b/src/core/libs/supl/asn-rrlp/ber_decoder.h index 9fe2e895d..6a87fc23f 100644 --- a/src/core/libs/supl/asn-rrlp/ber_decoder.h +++ b/src/core/libs/supl/asn-rrlp/ber_decoder.h @@ -2,63 +2,64 @@ * Copyright (c) 2003, 2004 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ -#ifndef _BER_DECODER_H_ -#define _BER_DECODER_H_ +#ifndef _BER_DECODER_H_ +#define _BER_DECODER_H_ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -struct asn_TYPE_descriptor_s; /* Forward declaration */ -struct asn_codec_ctx_s; /* Forward declaration */ + struct asn_TYPE_descriptor_s; /* Forward declaration */ + struct asn_codec_ctx_s; /* Forward declaration */ -/* + /* * The BER decoder of any type. * This function may be invoked directly from the application. * The der_encode() function (der_encoder.h) is an opposite to ber_decode(). */ -asn_dec_rval_t ber_decode(struct asn_codec_ctx_s *opt_codec_ctx, - struct asn_TYPE_descriptor_s *type_descriptor, - void **struct_ptr, /* Pointer to a target structure's pointer */ - const void *buffer, /* Data to be decoded */ - size_t size /* Size of that buffer */ - ); + asn_dec_rval_t ber_decode(struct asn_codec_ctx_s *opt_codec_ctx, + struct asn_TYPE_descriptor_s *type_descriptor, + void **struct_ptr, /* Pointer to a target structure's pointer */ + const void *buffer, /* Data to be decoded */ + size_t size /* Size of that buffer */ + ); -/* + /* * Type of generic function which decodes the byte stream into the structure. */ -typedef asn_dec_rval_t (ber_type_decoder_f)( - struct asn_codec_ctx_s *opt_codec_ctx, - struct asn_TYPE_descriptor_s *type_descriptor, - void **struct_ptr, const void *buf_ptr, size_t size, - int tag_mode); + typedef asn_dec_rval_t(ber_type_decoder_f)( + struct asn_codec_ctx_s *opt_codec_ctx, + struct asn_TYPE_descriptor_s *type_descriptor, + void **struct_ptr, const void *buf_ptr, size_t size, + int tag_mode); -/******************************* + /******************************* * INTERNALLY USEFUL FUNCTIONS * *******************************/ -/* + /* * Check that all tags correspond to the type definition (as given in head). * On return, last_length would contain either a non-negative length of the * value part of the last TLV, or the negative number of expected * "end of content" sequences. The number may only be negative if the * head->last_tag_form is non-zero. */ -asn_dec_rval_t ber_check_tags( - struct asn_codec_ctx_s *opt_codec_ctx, /* codec options */ - struct asn_TYPE_descriptor_s *type_descriptor, - asn_struct_ctx_t *opt_ctx, /* saved decoding context */ - const void *ptr, size_t size, - int tag_mode, /* {-1,0,1}: IMPLICIT, no, EXPLICIT */ - int last_tag_form, /* {-1,0:1}: any, primitive, constr */ - ber_tlv_len_t *last_length, - int *opt_tlv_form /* optional tag form */ - ); + asn_dec_rval_t ber_check_tags( + struct asn_codec_ctx_s *opt_codec_ctx, /* codec options */ + struct asn_TYPE_descriptor_s *type_descriptor, + asn_struct_ctx_t *opt_ctx, /* saved decoding context */ + const void *ptr, size_t size, + int tag_mode, /* {-1,0,1}: IMPLICIT, no, EXPLICIT */ + int last_tag_form, /* {-1,0:1}: any, primitive, constr */ + ber_tlv_len_t *last_length, + int *opt_tlv_form /* optional tag form */ + ); #ifdef __cplusplus } #endif -#endif /* _BER_DECODER_H_ */ +#endif /* _BER_DECODER_H_ */ diff --git a/src/core/libs/supl/asn-rrlp/ber_tlv_length.h b/src/core/libs/supl/asn-rrlp/ber_tlv_length.h index 349680224..7245624cd 100644 --- a/src/core/libs/supl/asn-rrlp/ber_tlv_length.h +++ b/src/core/libs/supl/asn-rrlp/ber_tlv_length.h @@ -2,16 +2,17 @@ * Copyright (c) 2003 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ -#ifndef _BER_TLV_LENGTH_H_ -#define _BER_TLV_LENGTH_H_ +#ifndef _BER_TLV_LENGTH_H_ +#define _BER_TLV_LENGTH_H_ #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -typedef ssize_t ber_tlv_len_t; + typedef ssize_t ber_tlv_len_t; -/* + /* * This function tries to fetch the length of the BER TLV value and place it * in *len_r. * RETURN VALUES: @@ -21,30 +22,30 @@ typedef ssize_t ber_tlv_len_t; * On return with >0, len_r is constrained as -1..MAX, where -1 mean * that the value is of indefinite length. */ -ssize_t ber_fetch_length(int _is_constructed, const void *bufptr, size_t size, - ber_tlv_len_t *len_r); + ssize_t ber_fetch_length(int _is_constructed, const void *bufptr, size_t size, + ber_tlv_len_t *len_r); -/* + /* * This function expects bufptr to be positioned over L in TLV. * It returns number of bytes occupied by L and V together, suitable * for skipping. The function properly handles indefinite length. * RETURN VALUES: * Standard {-1,0,>0} convention. */ -ssize_t ber_skip_length( - struct asn_codec_ctx_s *opt_codec_ctx, /* optional context */ - int _is_constructed, const void *bufptr, size_t size); + ssize_t ber_skip_length( + struct asn_codec_ctx_s *opt_codec_ctx, /* optional context */ + int _is_constructed, const void *bufptr, size_t size); -/* + /* * This function serializes the length (L from TLV) in DER format. * It always returns number of bytes necessary to represent the length, * it is a caller's responsibility to check the return value * against the supplied buffer's size. */ -size_t der_tlv_length_serialize(ber_tlv_len_t len, void *bufptr, size_t size); + size_t der_tlv_length_serialize(ber_tlv_len_t len, void *bufptr, size_t size); #ifdef __cplusplus } #endif -#endif /* _BER_TLV_LENGTH_H_ */ +#endif /* _BER_TLV_LENGTH_H_ */ diff --git a/src/core/libs/supl/asn-rrlp/ber_tlv_tag.h b/src/core/libs/supl/asn-rrlp/ber_tlv_tag.h index 60e866861..31b634345 100644 --- a/src/core/libs/supl/asn-rrlp/ber_tlv_tag.h +++ b/src/core/libs/supl/asn-rrlp/ber_tlv_tag.h @@ -2,59 +2,61 @@ * Copyright (c) 2003, 2004 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ -#ifndef _BER_TLV_TAG_H_ -#define _BER_TLV_TAG_H_ +#ifndef _BER_TLV_TAG_H_ +#define _BER_TLV_TAG_H_ #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -enum asn_tag_class { - ASN_TAG_CLASS_UNIVERSAL = 0, /* 0b00 */ - ASN_TAG_CLASS_APPLICATION = 1, /* 0b01 */ - ASN_TAG_CLASS_CONTEXT = 2, /* 0b10 */ - ASN_TAG_CLASS_PRIVATE = 3 /* 0b11 */ -}; -typedef unsigned ber_tlv_tag_t; /* BER TAG from Tag-Length-Value */ + enum asn_tag_class + { + ASN_TAG_CLASS_UNIVERSAL = 0, /* 0b00 */ + ASN_TAG_CLASS_APPLICATION = 1, /* 0b01 */ + ASN_TAG_CLASS_CONTEXT = 2, /* 0b10 */ + ASN_TAG_CLASS_PRIVATE = 3 /* 0b11 */ + }; + typedef unsigned ber_tlv_tag_t; /* BER TAG from Tag-Length-Value */ /* * Tag class is encoded together with tag value for optimization purposes. */ -#define BER_TAG_CLASS(tag) ((tag) & 0x3) -#define BER_TAG_VALUE(tag) ((tag) >> 2) -#define BER_TLV_CONSTRUCTED(tagptr) (((*(const uint8_t *)tagptr)&0x20)?1:0) +#define BER_TAG_CLASS(tag) ((tag)&0x3) +#define BER_TAG_VALUE(tag) ((tag) >> 2) +#define BER_TLV_CONSTRUCTED(tagptr) (((*(const uint8_t *)tagptr) & 0x20) ? 1 : 0) -#define BER_TAGS_EQUAL(tag1, tag2) ((tag1) == (tag2)) +#define BER_TAGS_EQUAL(tag1, tag2) ((tag1) == (tag2)) -/* + /* * Several functions for printing the TAG in the canonical form * (i.e. "[PRIVATE 0]"). * Return values correspond to their libc counterparts (if any). */ -ssize_t ber_tlv_tag_snprint(ber_tlv_tag_t tag, char *buf, size_t buflen); -ssize_t ber_tlv_tag_fwrite(ber_tlv_tag_t tag, FILE *); -char *ber_tlv_tag_string(ber_tlv_tag_t tag); + ssize_t ber_tlv_tag_snprint(ber_tlv_tag_t tag, char *buf, size_t buflen); + ssize_t ber_tlv_tag_fwrite(ber_tlv_tag_t tag, FILE *); + char *ber_tlv_tag_string(ber_tlv_tag_t tag); -/* + /* * This function tries to fetch the tag from the input stream. * RETURN VALUES: * 0: More data expected than bufptr contains. * -1: Fatal error deciphering tag. * >0: Number of bytes used from bufptr. tag_r will contain the tag. */ -ssize_t ber_fetch_tag(const void *bufptr, size_t size, ber_tlv_tag_t *tag_r); + ssize_t ber_fetch_tag(const void *bufptr, size_t size, ber_tlv_tag_t *tag_r); -/* + /* * This function serializes the tag (T from TLV) in BER format. * It always returns number of bytes necessary to represent the tag, * it is a caller's responsibility to check the return value * against the supplied buffer's size. */ -size_t ber_tlv_tag_serialize(ber_tlv_tag_t tag, void *bufptr, size_t size); + size_t ber_tlv_tag_serialize(ber_tlv_tag_t tag, void *bufptr, size_t size); #ifdef __cplusplus } #endif -#endif /* _BER_TLV_TAG_H_ */ +#endif /* _BER_TLV_TAG_H_ */ diff --git a/src/core/libs/supl/asn-rrlp/constr_CHOICE.h b/src/core/libs/supl/asn-rrlp/constr_CHOICE.h index 83404e6d4..264018481 100644 --- a/src/core/libs/supl/asn-rrlp/constr_CHOICE.h +++ b/src/core/libs/supl/asn-rrlp/constr_CHOICE.h @@ -3,55 +3,57 @@ * All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ -#ifndef _CONSTR_CHOICE_H_ -#define _CONSTR_CHOICE_H_ +#ifndef _CONSTR_CHOICE_H_ +#define _CONSTR_CHOICE_H_ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -typedef struct asn_CHOICE_specifics_s { - /* + typedef struct asn_CHOICE_specifics_s + { + /* * Target structure description. */ - int struct_size; /* Size of the target structure. */ - int ctx_offset; /* Offset of the asn_codec_ctx_t member */ - int pres_offset; /* Identifier of the present member */ - int pres_size; /* Size of the identifier (enum) */ + int struct_size; /* Size of the target structure. */ + int ctx_offset; /* Offset of the asn_codec_ctx_t member */ + int pres_offset; /* Identifier of the present member */ + int pres_size; /* Size of the identifier (enum) */ - /* + /* * Tags to members mapping table. */ - asn_TYPE_tag2member_t *tag2el; - int tag2el_count; + asn_TYPE_tag2member_t *tag2el; + int tag2el_count; - /* Canonical ordering of CHOICE elements, for PER */ - int *canonical_order; + /* Canonical ordering of CHOICE elements, for PER */ + int *canonical_order; - /* + /* * Extensions-related stuff. */ - int ext_start; /* First member of extensions, or -1 */ -} asn_CHOICE_specifics_t; + int ext_start; /* First member of extensions, or -1 */ + } asn_CHOICE_specifics_t; -/* + /* * A set specialized functions dealing with the CHOICE type. */ -asn_struct_free_f CHOICE_free; -asn_struct_print_f CHOICE_print; -asn_constr_check_f CHOICE_constraint; -ber_type_decoder_f CHOICE_decode_ber; -der_type_encoder_f CHOICE_encode_der; -xer_type_decoder_f CHOICE_decode_xer; -xer_type_encoder_f CHOICE_encode_xer; -per_type_decoder_f CHOICE_decode_uper; -per_type_encoder_f CHOICE_encode_uper; -asn_outmost_tag_f CHOICE_outmost_tag; + asn_struct_free_f CHOICE_free; + asn_struct_print_f CHOICE_print; + asn_constr_check_f CHOICE_constraint; + ber_type_decoder_f CHOICE_decode_ber; + der_type_encoder_f CHOICE_encode_der; + xer_type_decoder_f CHOICE_decode_xer; + xer_type_encoder_f CHOICE_encode_xer; + per_type_decoder_f CHOICE_decode_uper; + per_type_encoder_f CHOICE_encode_uper; + asn_outmost_tag_f CHOICE_outmost_tag; #ifdef __cplusplus } #endif -#endif /* _CONSTR_CHOICE_H_ */ +#endif /* _CONSTR_CHOICE_H_ */ diff --git a/src/core/libs/supl/asn-rrlp/constr_SEQUENCE.h b/src/core/libs/supl/asn-rrlp/constr_SEQUENCE.h index 5f589d5c1..e2664a123 100644 --- a/src/core/libs/supl/asn-rrlp/constr_SEQUENCE.h +++ b/src/core/libs/supl/asn-rrlp/constr_SEQUENCE.h @@ -2,59 +2,61 @@ * Copyright (c) 2003, 2004 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ -#ifndef _CONSTR_SEQUENCE_H_ -#define _CONSTR_SEQUENCE_H_ +#ifndef _CONSTR_SEQUENCE_H_ +#define _CONSTR_SEQUENCE_H_ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -typedef struct asn_SEQUENCE_specifics_s { - /* + typedef struct asn_SEQUENCE_specifics_s + { + /* * Target structure description. */ - int struct_size; /* Size of the target structure. */ - int ctx_offset; /* Offset of the asn_struct_ctx_t member */ + int struct_size; /* Size of the target structure. */ + int ctx_offset; /* Offset of the asn_struct_ctx_t member */ - /* + /* * Tags to members mapping table (sorted). */ - asn_TYPE_tag2member_t *tag2el; - int tag2el_count; + asn_TYPE_tag2member_t *tag2el; + int tag2el_count; - /* + /* * Optional members of the extensions root (roms) or additions (aoms). * Meaningful for PER. */ - int *oms; /* Optional MemberS */ - int roms_count; /* Root optional members count */ - int aoms_count; /* Additions optional members count */ + int *oms; /* Optional MemberS */ + int roms_count; /* Root optional members count */ + int aoms_count; /* Additions optional members count */ - /* + /* * Description of an extensions group. */ - int ext_after; /* Extensions start after this member */ - int ext_before; /* Extensions stop before this member */ -} asn_SEQUENCE_specifics_t; + int ext_after; /* Extensions start after this member */ + int ext_before; /* Extensions stop before this member */ + } asn_SEQUENCE_specifics_t; -/* + /* * A set specialized functions dealing with the SEQUENCE type. */ -asn_struct_free_f SEQUENCE_free; -asn_struct_print_f SEQUENCE_print; -asn_constr_check_f SEQUENCE_constraint; -ber_type_decoder_f SEQUENCE_decode_ber; -der_type_encoder_f SEQUENCE_encode_der; -xer_type_decoder_f SEQUENCE_decode_xer; -xer_type_encoder_f SEQUENCE_encode_xer; -per_type_decoder_f SEQUENCE_decode_uper; -per_type_encoder_f SEQUENCE_encode_uper; + asn_struct_free_f SEQUENCE_free; + asn_struct_print_f SEQUENCE_print; + asn_constr_check_f SEQUENCE_constraint; + ber_type_decoder_f SEQUENCE_decode_ber; + der_type_encoder_f SEQUENCE_encode_der; + xer_type_decoder_f SEQUENCE_decode_xer; + xer_type_encoder_f SEQUENCE_encode_xer; + per_type_decoder_f SEQUENCE_decode_uper; + per_type_encoder_f SEQUENCE_encode_uper; #ifdef __cplusplus } #endif -#endif /* _CONSTR_SEQUENCE_H_ */ +#endif /* _CONSTR_SEQUENCE_H_ */ diff --git a/src/core/libs/supl/asn-rrlp/constr_SEQUENCE_OF.h b/src/core/libs/supl/asn-rrlp/constr_SEQUENCE_OF.h index e2272f326..927ed5163 100644 --- a/src/core/libs/supl/asn-rrlp/constr_SEQUENCE_OF.h +++ b/src/core/libs/supl/asn-rrlp/constr_SEQUENCE_OF.h @@ -2,32 +2,33 @@ * Copyright (c) 2003, 2005 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ -#ifndef _CONSTR_SEQUENCE_OF_H_ -#define _CONSTR_SEQUENCE_OF_H_ +#ifndef _CONSTR_SEQUENCE_OF_H_ +#define _CONSTR_SEQUENCE_OF_H_ #include -#include /* Implemented using SET OF */ +#include /* Implemented using SET OF */ #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif /* * A set specialized functions dealing with the SEQUENCE OF type. * Generally implemented using SET OF. */ -#define SEQUENCE_OF_free SET_OF_free -#define SEQUENCE_OF_print SET_OF_print -#define SEQUENCE_OF_constraint SET_OF_constraint -#define SEQUENCE_OF_decode_ber SET_OF_decode_ber -#define SEQUENCE_OF_decode_xer SET_OF_decode_xer -#define SEQUENCE_OF_decode_uper SET_OF_decode_uper -der_type_encoder_f SEQUENCE_OF_encode_der; -xer_type_encoder_f SEQUENCE_OF_encode_xer; -per_type_encoder_f SEQUENCE_OF_encode_uper; +#define SEQUENCE_OF_free SET_OF_free +#define SEQUENCE_OF_print SET_OF_print +#define SEQUENCE_OF_constraint SET_OF_constraint +#define SEQUENCE_OF_decode_ber SET_OF_decode_ber +#define SEQUENCE_OF_decode_xer SET_OF_decode_xer +#define SEQUENCE_OF_decode_uper SET_OF_decode_uper + der_type_encoder_f SEQUENCE_OF_encode_der; + xer_type_encoder_f SEQUENCE_OF_encode_xer; + per_type_encoder_f SEQUENCE_OF_encode_uper; #ifdef __cplusplus } #endif -#endif /* _CONSTR_SET_OF_H_ */ +#endif /* _CONSTR_SET_OF_H_ */ diff --git a/src/core/libs/supl/asn-rrlp/constr_SET_OF.h b/src/core/libs/supl/asn-rrlp/constr_SET_OF.h index bcd096629..52b446281 100644 --- a/src/core/libs/supl/asn-rrlp/constr_SET_OF.h +++ b/src/core/libs/supl/asn-rrlp/constr_SET_OF.h @@ -2,41 +2,43 @@ * Copyright (c) 2003 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ -#ifndef _CONSTR_SET_OF_H_ -#define _CONSTR_SET_OF_H_ +#ifndef _CONSTR_SET_OF_H_ +#define _CONSTR_SET_OF_H_ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -typedef struct asn_SET_OF_specifics_s { - /* + typedef struct asn_SET_OF_specifics_s + { + /* * Target structure description. */ - int struct_size; /* Size of the target structure. */ - int ctx_offset; /* Offset of the asn_struct_ctx_t member */ + int struct_size; /* Size of the target structure. */ + int ctx_offset; /* Offset of the asn_struct_ctx_t member */ - /* XER-specific stuff */ - int as_XMLValueList; /* The member type must be encoded like this */ -} asn_SET_OF_specifics_t; + /* XER-specific stuff */ + int as_XMLValueList; /* The member type must be encoded like this */ + } asn_SET_OF_specifics_t; -/* + /* * A set specialized functions dealing with the SET OF type. */ -asn_struct_free_f SET_OF_free; -asn_struct_print_f SET_OF_print; -asn_constr_check_f SET_OF_constraint; -ber_type_decoder_f SET_OF_decode_ber; -der_type_encoder_f SET_OF_encode_der; -xer_type_decoder_f SET_OF_decode_xer; -xer_type_encoder_f SET_OF_encode_xer; -per_type_decoder_f SET_OF_decode_uper; -per_type_encoder_f SET_OF_encode_uper; + asn_struct_free_f SET_OF_free; + asn_struct_print_f SET_OF_print; + asn_constr_check_f SET_OF_constraint; + ber_type_decoder_f SET_OF_decode_ber; + der_type_encoder_f SET_OF_encode_der; + xer_type_decoder_f SET_OF_decode_xer; + xer_type_encoder_f SET_OF_encode_xer; + per_type_decoder_f SET_OF_decode_uper; + per_type_encoder_f SET_OF_encode_uper; #ifdef __cplusplus } #endif -#endif /* _CONSTR_SET_OF_H_ */ +#endif /* _CONSTR_SET_OF_H_ */ diff --git a/src/core/libs/supl/asn-rrlp/constr_TYPE.h b/src/core/libs/supl/asn-rrlp/constr_TYPE.h index 95507c809..0641f003c 100644 --- a/src/core/libs/supl/asn-rrlp/constr_TYPE.h +++ b/src/core/libs/supl/asn-rrlp/constr_TYPE.h @@ -9,158 +9,164 @@ * This structure even contains pointer to these encoding and decoding routines * for each defined ASN.1 type. */ -#ifndef _CONSTR_TYPE_H_ -#define _CONSTR_TYPE_H_ +#ifndef _CONSTR_TYPE_H_ +#define _CONSTR_TYPE_H_ #include #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -struct asn_TYPE_descriptor_s; /* Forward declaration */ -struct asn_TYPE_member_s; /* Forward declaration */ + struct asn_TYPE_descriptor_s; /* Forward declaration */ + struct asn_TYPE_member_s; /* Forward declaration */ -/* + /* * This type provides the context information for various ASN.1 routines, * primarily ones doing decoding. A member _asn_ctx of this type must be * included into certain target language's structures, such as compound types. */ -typedef struct asn_struct_ctx_s { - short phase; /* Decoding phase */ - short step; /* Elementary step of a phase */ - int context; /* Other context information */ - void *ptr; /* Decoder-specific stuff (stack elements) */ - ber_tlv_len_t left; /* Number of bytes left, -1 for indefinite */ -} asn_struct_ctx_t; + typedef struct asn_struct_ctx_s + { + short phase; /* Decoding phase */ + short step; /* Elementary step of a phase */ + int context; /* Other context information */ + void *ptr; /* Decoder-specific stuff (stack elements) */ + ber_tlv_len_t left; /* Number of bytes left, -1 for indefinite */ + } asn_struct_ctx_t; -#include /* Basic Encoding Rules decoder */ -#include /* Distinguished Encoding Rules encoder */ -#include /* Decoder of XER (XML, text) */ -#include /* Encoder into XER (XML, text) */ -#include /* Packet Encoding Rules decoder */ -#include /* Packet Encoding Rules encoder */ -#include /* Subtype constraints support */ +#include /* Basic Encoding Rules decoder */ +#include /* Distinguished Encoding Rules encoder */ +#include /* Decoder of XER (XML, text) */ +#include /* Encoder into XER (XML, text) */ +#include /* Packet Encoding Rules decoder */ +#include /* Packet Encoding Rules encoder */ +#include /* Subtype constraints support */ -/* + /* * Free the structure according to its specification. * If (free_contents_only) is set, the wrapper structure itself (struct_ptr) * will not be freed. (It may be useful in case the structure is allocated * statically or arranged on the stack, yet its elements are allocated * dynamically.) */ -typedef void (asn_struct_free_f)( - struct asn_TYPE_descriptor_s *type_descriptor, - void *struct_ptr, int free_contents_only); -#define ASN_STRUCT_FREE(asn_DEF, ptr) (asn_DEF).free_struct(&(asn_DEF),ptr,0) -#define ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF, ptr) \ - (asn_DEF).free_struct(&(asn_DEF),ptr,1) + typedef void(asn_struct_free_f)( + struct asn_TYPE_descriptor_s *type_descriptor, + void *struct_ptr, int free_contents_only); +#define ASN_STRUCT_FREE(asn_DEF, ptr) (asn_DEF).free_struct(&(asn_DEF), ptr, 0) +#define ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF, ptr) \ + (asn_DEF).free_struct(&(asn_DEF), ptr, 1) -/* + /* * Print the structure according to its specification. */ -typedef int (asn_struct_print_f)( - struct asn_TYPE_descriptor_s *type_descriptor, - const void *struct_ptr, - int level, /* Indentation level */ - asn_app_consume_bytes_f *callback, void *app_key); + typedef int(asn_struct_print_f)( + struct asn_TYPE_descriptor_s *type_descriptor, + const void *struct_ptr, + int level, /* Indentation level */ + asn_app_consume_bytes_f *callback, void *app_key); -/* + /* * Return the outmost tag of the type. * If the type is untagged CHOICE, the dynamic operation is performed. * NOTE: This function pointer type is only useful internally. * Do not use it in your application. */ -typedef ber_tlv_tag_t (asn_outmost_tag_f)( - struct asn_TYPE_descriptor_s *type_descriptor, - const void *struct_ptr, int tag_mode, ber_tlv_tag_t tag); -/* The instance of the above function type; used internally. */ -asn_outmost_tag_f asn_TYPE_outmost_tag; + typedef ber_tlv_tag_t(asn_outmost_tag_f)( + struct asn_TYPE_descriptor_s *type_descriptor, + const void *struct_ptr, int tag_mode, ber_tlv_tag_t tag); + /* The instance of the above function type; used internally. */ + asn_outmost_tag_f asn_TYPE_outmost_tag; - -/* + + /* * The definitive description of the destination language's structure. */ -typedef struct asn_TYPE_descriptor_s { - char *name; /* A name of the ASN.1 type. "" in some cases. */ - char *xml_tag; /* Name used in XML tag */ + typedef struct asn_TYPE_descriptor_s + { + char *name; /* A name of the ASN.1 type. "" in some cases. */ + char *xml_tag; /* Name used in XML tag */ - /* + /* * Generalized functions for dealing with the specific type. * May be directly invoked by applications. */ - asn_struct_free_f *free_struct; /* Free the structure */ - asn_struct_print_f *print_struct; /* Human readable output */ - asn_constr_check_f *check_constraints; /* Constraints validator */ - ber_type_decoder_f *ber_decoder; /* Generic BER decoder */ - der_type_encoder_f *der_encoder; /* Canonical DER encoder */ - xer_type_decoder_f *xer_decoder; /* Generic XER decoder */ - xer_type_encoder_f *xer_encoder; /* [Canonical] XER encoder */ - per_type_decoder_f *uper_decoder; /* Unaligned PER decoder */ - per_type_encoder_f *uper_encoder; /* Unaligned PER encoder */ + asn_struct_free_f *free_struct; /* Free the structure */ + asn_struct_print_f *print_struct; /* Human readable output */ + asn_constr_check_f *check_constraints; /* Constraints validator */ + ber_type_decoder_f *ber_decoder; /* Generic BER decoder */ + der_type_encoder_f *der_encoder; /* Canonical DER encoder */ + xer_type_decoder_f *xer_decoder; /* Generic XER decoder */ + xer_type_encoder_f *xer_encoder; /* [Canonical] XER encoder */ + per_type_decoder_f *uper_decoder; /* Unaligned PER decoder */ + per_type_encoder_f *uper_encoder; /* Unaligned PER encoder */ - /*********************************************************************** + /*********************************************************************** * Internally useful members. Not to be used by applications directly. * **********************************************************************/ - /* + /* * Tags that are expected to occur. */ - asn_outmost_tag_f *outmost_tag; /* */ - ber_tlv_tag_t *tags; /* Effective tags sequence for this type */ - int tags_count; /* Number of tags which are expected */ - ber_tlv_tag_t *all_tags;/* Every tag for BER/containment */ - int all_tags_count; /* Number of tags */ + asn_outmost_tag_f *outmost_tag; /* */ + ber_tlv_tag_t *tags; /* Effective tags sequence for this type */ + int tags_count; /* Number of tags which are expected */ + ber_tlv_tag_t *all_tags; /* Every tag for BER/containment */ + int all_tags_count; /* Number of tags */ - asn_per_constraints_t *per_constraints; /* PER compiled constraints */ + asn_per_constraints_t *per_constraints; /* PER compiled constraints */ - /* + /* * An ASN.1 production type members (members of SEQUENCE, SET, CHOICE). */ - struct asn_TYPE_member_s *elements; - int elements_count; + struct asn_TYPE_member_s *elements; + int elements_count; - /* + /* * Additional information describing the type, used by appropriate * functions above. */ - void *specifics; -} asn_TYPE_descriptor_t; + void *specifics; + } asn_TYPE_descriptor_t; -/* + /* * This type describes an element of the constructed type, * i.e. SEQUENCE, SET, CHOICE, etc. */ - enum asn_TYPE_flags_e { - ATF_NOFLAGS, - ATF_POINTER = 0x01, /* Represented by the pointer */ - ATF_OPEN_TYPE = 0x02 /* ANY type, without meaningful tag */ - }; -typedef struct asn_TYPE_member_s { - enum asn_TYPE_flags_e flags; /* Element's presentation flags */ - int optional; /* Following optional members, including current */ - int memb_offset; /* Offset of the element */ - ber_tlv_tag_t tag; /* Outmost (most immediate) tag */ - int tag_mode; /* IMPLICIT/no/EXPLICIT tag at current level */ - asn_TYPE_descriptor_t *type; /* Member type descriptor */ - asn_constr_check_f *memb_constraints; /* Constraints validator */ - asn_per_constraints_t *per_constraints; /* PER compiled constraints */ - int (*default_value)(int setval, void **sptr); /* DEFAULT */ - char *name; /* ASN.1 identifier of the element */ -} asn_TYPE_member_t; + enum asn_TYPE_flags_e + { + ATF_NOFLAGS, + ATF_POINTER = 0x01, /* Represented by the pointer */ + ATF_OPEN_TYPE = 0x02 /* ANY type, without meaningful tag */ + }; + typedef struct asn_TYPE_member_s + { + enum asn_TYPE_flags_e flags; /* Element's presentation flags */ + int optional; /* Following optional members, including current */ + int memb_offset; /* Offset of the element */ + ber_tlv_tag_t tag; /* Outmost (most immediate) tag */ + int tag_mode; /* IMPLICIT/no/EXPLICIT tag at current level */ + asn_TYPE_descriptor_t *type; /* Member type descriptor */ + asn_constr_check_f *memb_constraints; /* Constraints validator */ + asn_per_constraints_t *per_constraints; /* PER compiled constraints */ + int (*default_value)(int setval, void **sptr); /* DEFAULT */ + char *name; /* ASN.1 identifier of the element */ + } asn_TYPE_member_t; -/* + /* * BER tag to element number mapping. */ -typedef struct asn_TYPE_tag2member_s { - ber_tlv_tag_t el_tag; /* Outmost tag of the member */ - int el_no; /* Index of the associated member, base 0 */ - int toff_first; /* First occurence of the el_tag, relative */ - int toff_last; /* Last occurence of the el_tag, relatvie */ -} asn_TYPE_tag2member_t; + typedef struct asn_TYPE_tag2member_s + { + ber_tlv_tag_t el_tag; /* Outmost tag of the member */ + int el_no; /* Index of the associated member, base 0 */ + int toff_first; /* First occurence of the el_tag, relative */ + int toff_last; /* Last occurence of the el_tag, relatvie */ + } asn_TYPE_tag2member_t; -/* + /* * This function is a wrapper around (td)->print_struct, which prints out * the contents of the target language's structure (struct_ptr) into the * file pointer (stream) in human readable form. @@ -169,12 +175,12 @@ typedef struct asn_TYPE_tag2member_s { * -1: Problem dumping the structure. * (See also xer_fprint() in xer_encoder.h) */ -int asn_fprint(FILE *stream, /* Destination stream descriptor */ - asn_TYPE_descriptor_t *td, /* ASN.1 type descriptor */ - const void *struct_ptr); /* Structure to be printed */ + int asn_fprint(FILE *stream, /* Destination stream descriptor */ + asn_TYPE_descriptor_t *td, /* ASN.1 type descriptor */ + const void *struct_ptr); /* Structure to be printed */ #ifdef __cplusplus } #endif -#endif /* _CONSTR_TYPE_H_ */ +#endif /* _CONSTR_TYPE_H_ */ diff --git a/src/core/libs/supl/asn-rrlp/constraints.h b/src/core/libs/supl/asn-rrlp/constraints.h index 5032345ee..bc4fdb938 100644 --- a/src/core/libs/supl/asn-rrlp/constraints.h +++ b/src/core/libs/supl/asn-rrlp/constraints.h @@ -2,18 +2,19 @@ * Copyright (c) 2004, 2006 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ -#ifndef _ASN1_CONSTRAINTS_VALIDATOR_H_ -#define _ASN1_CONSTRAINTS_VALIDATOR_H_ +#ifndef _ASN1_CONSTRAINTS_VALIDATOR_H_ +#define _ASN1_CONSTRAINTS_VALIDATOR_H_ -#include /* Platform-dependent types */ +#include /* Platform-dependent types */ #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -struct asn_TYPE_descriptor_s; /* Forward declaration */ + struct asn_TYPE_descriptor_s; /* Forward declaration */ -/* + /* * Validate the structure according to the ASN.1 constraints. * If errbuf and errlen are given, they shall be pointing to the appropriate * buffer space and its length before calling this function. Alternatively, @@ -25,39 +26,39 @@ struct asn_TYPE_descriptor_s; /* Forward declaration */ * This function returns 0 in case all ASN.1 constraints are met * and -1 if one or more constraints were failed. */ -int -asn_check_constraints(struct asn_TYPE_descriptor_s *type_descriptor, - const void *struct_ptr, /* Target language's structure */ - char *errbuf, /* Returned error description */ - size_t *errlen /* Length of the error description */ - ); + int asn_check_constraints(struct asn_TYPE_descriptor_s *type_descriptor, + const void *struct_ptr, /* Target language's structure */ + char *errbuf, /* Returned error description */ + size_t *errlen /* Length of the error description */ + ); -/* + /* * Generic type for constraint checking callback, * associated with every type descriptor. */ -typedef int (asn_constr_check_f)( - struct asn_TYPE_descriptor_s *type_descriptor, - const void *struct_ptr, - asn_app_constraint_failed_f *optional_callback, /* Log the error */ - void *optional_app_key /* Opaque key passed to a callback */ - ); + typedef int(asn_constr_check_f)( + struct asn_TYPE_descriptor_s *type_descriptor, + const void *struct_ptr, + asn_app_constraint_failed_f *optional_callback, /* Log the error */ + void *optional_app_key /* Opaque key passed to a callback */ + ); -/******************************* + /******************************* * INTERNALLY USEFUL FUNCTIONS * *******************************/ -asn_constr_check_f asn_generic_no_constraint; /* No constraint whatsoever */ -asn_constr_check_f asn_generic_unknown_constraint; /* Not fully supported */ + asn_constr_check_f asn_generic_no_constraint; /* No constraint whatsoever */ + asn_constr_check_f asn_generic_unknown_constraint; /* Not fully supported */ /* * Invoke the callback with a complete error message. */ -#define _ASN_CTFAIL if(ctfailcb) ctfailcb +#define _ASN_CTFAIL \ + if (ctfailcb) ctfailcb #ifdef __cplusplus } #endif -#endif /* _ASN1_CONSTRAINTS_VALIDATOR_H_ */ +#endif /* _ASN1_CONSTRAINTS_VALIDATOR_H_ */ diff --git a/src/core/libs/supl/asn-rrlp/der_encoder.h b/src/core/libs/supl/asn-rrlp/der_encoder.h index 61431c6db..3eafbc281 100644 --- a/src/core/libs/supl/asn-rrlp/der_encoder.h +++ b/src/core/libs/supl/asn-rrlp/der_encoder.h @@ -2,67 +2,67 @@ * Copyright (c) 2003, 2004 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ -#ifndef _DER_ENCODER_H_ -#define _DER_ENCODER_H_ +#ifndef _DER_ENCODER_H_ +#define _DER_ENCODER_H_ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -struct asn_TYPE_descriptor_s; /* Forward declaration */ + struct asn_TYPE_descriptor_s; /* Forward declaration */ -/* + /* * The DER encoder of any type. May be invoked by the application. * The ber_decode() function (ber_decoder.h) is an opposite of der_encode(). */ -asn_enc_rval_t der_encode(struct asn_TYPE_descriptor_s *type_descriptor, - void *struct_ptr, /* Structure to be encoded */ - asn_app_consume_bytes_f *consume_bytes_cb, - void *app_key /* Arbitrary callback argument */ - ); + asn_enc_rval_t der_encode(struct asn_TYPE_descriptor_s *type_descriptor, + void *struct_ptr, /* Structure to be encoded */ + asn_app_consume_bytes_f *consume_bytes_cb, + void *app_key /* Arbitrary callback argument */ + ); -/* A variant of der_encode() which encodes data into the pre-allocated buffer */ -asn_enc_rval_t der_encode_to_buffer( - struct asn_TYPE_descriptor_s *type_descriptor, - void *struct_ptr, /* Structure to be encoded */ - void *buffer, /* Pre-allocated buffer */ - size_t buffer_size /* Initial buffer size (maximum) */ - ); + /* A variant of der_encode() which encodes data into the pre-allocated buffer */ + asn_enc_rval_t der_encode_to_buffer( + struct asn_TYPE_descriptor_s *type_descriptor, + void *struct_ptr, /* Structure to be encoded */ + void *buffer, /* Pre-allocated buffer */ + size_t buffer_size /* Initial buffer size (maximum) */ + ); -/* + /* * Type of the generic DER encoder. */ -typedef asn_enc_rval_t (der_type_encoder_f)( - struct asn_TYPE_descriptor_s *type_descriptor, - void *struct_ptr, /* Structure to be encoded */ - int tag_mode, /* {-1,0,1}: IMPLICIT, no, EXPLICIT */ - ber_tlv_tag_t tag, - asn_app_consume_bytes_f *consume_bytes_cb, /* Callback */ - void *app_key /* Arbitrary callback argument */ - ); + typedef asn_enc_rval_t(der_type_encoder_f)( + struct asn_TYPE_descriptor_s *type_descriptor, + void *struct_ptr, /* Structure to be encoded */ + int tag_mode, /* {-1,0,1}: IMPLICIT, no, EXPLICIT */ + ber_tlv_tag_t tag, + asn_app_consume_bytes_f *consume_bytes_cb, /* Callback */ + void *app_key /* Arbitrary callback argument */ + ); -/******************************* + /******************************* * INTERNALLY USEFUL FUNCTIONS * *******************************/ -/* + /* * Write out leading TL[v] sequence according to the type definition. */ -ssize_t der_write_tags( - struct asn_TYPE_descriptor_s *type_descriptor, - size_t struct_length, - int tag_mode, /* {-1,0,1}: IMPLICIT, no, EXPLICIT */ - int last_tag_form, /* {0,!0}: prim, constructed */ - ber_tlv_tag_t tag, - asn_app_consume_bytes_f *consume_bytes_cb, - void *app_key - ); + ssize_t der_write_tags( + struct asn_TYPE_descriptor_s *type_descriptor, + size_t struct_length, + int tag_mode, /* {-1,0,1}: IMPLICIT, no, EXPLICIT */ + int last_tag_form, /* {0,!0}: prim, constructed */ + ber_tlv_tag_t tag, + asn_app_consume_bytes_f *consume_bytes_cb, + void *app_key); #ifdef __cplusplus } #endif -#endif /* _DER_ENCODER_H_ */ +#endif /* _DER_ENCODER_H_ */ diff --git a/src/core/libs/supl/asn-rrlp/per_decoder.h b/src/core/libs/supl/asn-rrlp/per_decoder.h index 8397a545f..a28509464 100644 --- a/src/core/libs/supl/asn-rrlp/per_decoder.h +++ b/src/core/libs/supl/asn-rrlp/per_decoder.h @@ -2,55 +2,55 @@ * Copyright (c) 2005, 2007 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ -#ifndef _PER_DECODER_H_ -#define _PER_DECODER_H_ +#ifndef _PER_DECODER_H_ +#define _PER_DECODER_H_ #include #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -struct asn_TYPE_descriptor_s; /* Forward declaration */ + struct asn_TYPE_descriptor_s; /* Forward declaration */ -/* + /* * Unaligned PER decoder of a "complete encoding" as per X.691#10.1. * On success, this call always returns (.consumed >= 1), as per X.691#10.1.3. */ -asn_dec_rval_t uper_decode_complete(struct asn_codec_ctx_s *opt_codec_ctx, - struct asn_TYPE_descriptor_s *type_descriptor, /* Type to decode */ - void **struct_ptr, /* Pointer to a target structure's pointer */ - const void *buffer, /* Data to be decoded */ - size_t size /* Size of data buffer */ - ); + asn_dec_rval_t uper_decode_complete(struct asn_codec_ctx_s *opt_codec_ctx, + struct asn_TYPE_descriptor_s *type_descriptor, /* Type to decode */ + void **struct_ptr, /* Pointer to a target structure's pointer */ + const void *buffer, /* Data to be decoded */ + size_t size /* Size of data buffer */ + ); -/* + /* * Unaligned PER decoder of any ASN.1 type. May be invoked by the application. * WARNING: This call returns the number of BITS read from the stream. Beware. */ -asn_dec_rval_t uper_decode(struct asn_codec_ctx_s *opt_codec_ctx, - struct asn_TYPE_descriptor_s *type_descriptor, /* Type to decode */ - void **struct_ptr, /* Pointer to a target structure's pointer */ - const void *buffer, /* Data to be decoded */ - size_t size, /* Size of data buffer */ - int skip_bits, /* Number of unused leading bits, 0..7 */ - int unused_bits /* Number of unused tailing bits, 0..7 */ - ); + asn_dec_rval_t uper_decode(struct asn_codec_ctx_s *opt_codec_ctx, + struct asn_TYPE_descriptor_s *type_descriptor, /* Type to decode */ + void **struct_ptr, /* Pointer to a target structure's pointer */ + const void *buffer, /* Data to be decoded */ + size_t size, /* Size of data buffer */ + int skip_bits, /* Number of unused leading bits, 0..7 */ + int unused_bits /* Number of unused tailing bits, 0..7 */ + ); -/* + /* * Type of the type-specific PER decoder function. */ -typedef asn_dec_rval_t (per_type_decoder_f)(asn_codec_ctx_t *opt_codec_ctx, - struct asn_TYPE_descriptor_s *type_descriptor, - asn_per_constraints_t *constraints, - void **struct_ptr, - asn_per_data_t *per_data - ); + typedef asn_dec_rval_t(per_type_decoder_f)(asn_codec_ctx_t *opt_codec_ctx, + struct asn_TYPE_descriptor_s *type_descriptor, + asn_per_constraints_t *constraints, + void **struct_ptr, + asn_per_data_t *per_data); #ifdef __cplusplus } #endif -#endif /* _PER_DECODER_H_ */ +#endif /* _PER_DECODER_H_ */ diff --git a/src/core/libs/supl/asn-rrlp/per_encoder.h b/src/core/libs/supl/asn-rrlp/per_encoder.h index 95a6506e4..896013095 100644 --- a/src/core/libs/supl/asn-rrlp/per_encoder.h +++ b/src/core/libs/supl/asn-rrlp/per_encoder.h @@ -2,68 +2,68 @@ * Copyright (c) 2006, 2007 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ -#ifndef _PER_ENCODER_H_ -#define _PER_ENCODER_H_ +#ifndef _PER_ENCODER_H_ +#define _PER_ENCODER_H_ #include #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -struct asn_TYPE_descriptor_s; /* Forward declaration */ + struct asn_TYPE_descriptor_s; /* Forward declaration */ -/* + /* * Unaligned PER encoder of any ASN.1 type. May be invoked by the application. * WARNING: This function returns the number of encoded bits in the .encoded * field of the return value. Use the following formula to convert to bytes: * bytes = ((.encoded + 7) / 8) */ -asn_enc_rval_t uper_encode(struct asn_TYPE_descriptor_s *type_descriptor, - void *struct_ptr, /* Structure to be encoded */ - asn_app_consume_bytes_f *consume_bytes_cb, /* Data collector */ - void *app_key /* Arbitrary callback argument */ -); + asn_enc_rval_t uper_encode(struct asn_TYPE_descriptor_s *type_descriptor, + void *struct_ptr, /* Structure to be encoded */ + asn_app_consume_bytes_f *consume_bytes_cb, /* Data collector */ + void *app_key /* Arbitrary callback argument */ + ); -/* + /* * A variant of uper_encode() which encodes data into the existing buffer * WARNING: This function returns the number of encoded bits in the .encoded * field of the return value. */ -asn_enc_rval_t uper_encode_to_buffer( - struct asn_TYPE_descriptor_s *type_descriptor, - void *struct_ptr, /* Structure to be encoded */ - void *buffer, /* Pre-allocated buffer */ - size_t buffer_size /* Initial buffer size (max) */ -); + asn_enc_rval_t uper_encode_to_buffer( + struct asn_TYPE_descriptor_s *type_descriptor, + void *struct_ptr, /* Structure to be encoded */ + void *buffer, /* Pre-allocated buffer */ + size_t buffer_size /* Initial buffer size (max) */ + ); -/* + /* * A variant of uper_encode_to_buffer() which allocates buffer itself. * Returns the number of bytes in the buffer or -1 in case of failure. * WARNING: This function produces a "Production of the complete encoding", * with length of at least one octet. Contrast this to precise bit-packing * encoding of uper_encode() and uper_encode_to_buffer(). */ -ssize_t uper_encode_to_new_buffer( - struct asn_TYPE_descriptor_s *type_descriptor, - asn_per_constraints_t *constraints, - void *struct_ptr, /* Structure to be encoded */ - void **buffer_r /* Buffer allocated and returned */ -); + ssize_t uper_encode_to_new_buffer( + struct asn_TYPE_descriptor_s *type_descriptor, + asn_per_constraints_t *constraints, + void *struct_ptr, /* Structure to be encoded */ + void **buffer_r /* Buffer allocated and returned */ + ); -/* + /* * Type of the generic PER encoder function. */ -typedef asn_enc_rval_t (per_type_encoder_f)( - struct asn_TYPE_descriptor_s *type_descriptor, - asn_per_constraints_t *constraints, - void *struct_ptr, - asn_per_outp_t *per_output -); + typedef asn_enc_rval_t(per_type_encoder_f)( + struct asn_TYPE_descriptor_s *type_descriptor, + asn_per_constraints_t *constraints, + void *struct_ptr, + asn_per_outp_t *per_output); #ifdef __cplusplus } #endif -#endif /* _PER_ENCODER_H_ */ +#endif /* _PER_ENCODER_H_ */ diff --git a/src/core/libs/supl/asn-rrlp/per_opentype.h b/src/core/libs/supl/asn-rrlp/per_opentype.h index facfaa637..2110a794a 100644 --- a/src/core/libs/supl/asn-rrlp/per_opentype.h +++ b/src/core/libs/supl/asn-rrlp/per_opentype.h @@ -2,21 +2,22 @@ * Copyright (c) 2007 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ -#ifndef _PER_OPENTYPE_H_ -#define _PER_OPENTYPE_H_ +#ifndef _PER_OPENTYPE_H_ +#define _PER_OPENTYPE_H_ #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -asn_dec_rval_t uper_open_type_get(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd); + asn_dec_rval_t uper_open_type_get(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd); -int uper_open_type_skip(asn_codec_ctx_t *opt_codec_ctx, asn_per_data_t *pd); + int uper_open_type_skip(asn_codec_ctx_t *opt_codec_ctx, asn_per_data_t *pd); -int uper_open_type_put(asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void *sptr, asn_per_outp_t *po); + int uper_open_type_put(asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void *sptr, asn_per_outp_t *po); #ifdef __cplusplus } #endif -#endif /* _PER_OPENTYPE_H_ */ +#endif /* _PER_OPENTYPE_H_ */ diff --git a/src/core/libs/supl/asn-rrlp/per_support.h b/src/core/libs/supl/asn-rrlp/per_support.h index c3e7794de..c99f12291 100644 --- a/src/core/libs/supl/asn-rrlp/per_support.h +++ b/src/core/libs/supl/asn-rrlp/per_support.h @@ -6,137 +6,143 @@ #ifndef _PER_SUPPORT_H_ #define _PER_SUPPORT_H_ -#include /* Platform-specific types */ +#include /* Platform-specific types */ #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* + /* * Pre-computed PER constraints. */ -typedef const struct asn_per_constraint_s { - enum asn_per_constraint_flags { - APC_UNCONSTRAINED = 0x0, /* No PER visible constraints */ - APC_SEMI_CONSTRAINED = 0x1, /* Constrained at "lb" */ - APC_CONSTRAINED = 0x2, /* Fully constrained */ - APC_EXTENSIBLE = 0x4 /* May have extension */ + typedef const struct asn_per_constraint_s + { + enum asn_per_constraint_flags + { + APC_UNCONSTRAINED = 0x0, /* No PER visible constraints */ + APC_SEMI_CONSTRAINED = 0x1, /* Constrained at "lb" */ + APC_CONSTRAINED = 0x2, /* Fully constrained */ + APC_EXTENSIBLE = 0x4 /* May have extension */ } flags; - int range_bits; /* Full number of bits in the range */ - int effective_bits; /* Effective bits */ - long lower_bound; /* "lb" value */ - long upper_bound; /* "ub" value */ -} asn_per_constraint_t; -typedef const struct asn_per_constraints_s { + int range_bits; /* Full number of bits in the range */ + int effective_bits; /* Effective bits */ + long lower_bound; /* "lb" value */ + long upper_bound; /* "ub" value */ + } asn_per_constraint_t; + typedef const struct asn_per_constraints_s + { struct asn_per_constraint_s value; struct asn_per_constraint_s size; int (*value2code)(unsigned int value); int (*code2value)(unsigned int code); -} asn_per_constraints_t; + } asn_per_constraints_t; -/* + /* * This structure describes a position inside an incoming PER bit stream. */ -typedef struct asn_per_data_s { - const uint8_t *buffer; /* Pointer to the octet stream */ - size_t nboff; /* Bit offset to the meaningful bit */ - size_t nbits; /* Number of bits in the stream */ - size_t moved; /* Number of bits moved through this bit stream */ - int (*refill)(struct asn_per_data_s *); - void *refill_key; -} asn_per_data_t; + typedef struct asn_per_data_s + { + const uint8_t *buffer; /* Pointer to the octet stream */ + size_t nboff; /* Bit offset to the meaningful bit */ + size_t nbits; /* Number of bits in the stream */ + size_t moved; /* Number of bits moved through this bit stream */ + int (*refill)(struct asn_per_data_s *); + void *refill_key; + } asn_per_data_t; -/* + /* * Extract a small number of bits (<= 31) from the specified PER data pointer. * This function returns -1 if the specified number of bits could not be * extracted due to EOD or other conditions. */ -int32_t per_get_few_bits(asn_per_data_t *per_data, int get_nbits); + int32_t per_get_few_bits(asn_per_data_t *per_data, int get_nbits); -/* Undo the immediately preceeding "get_few_bits" operation */ -void per_get_undo(asn_per_data_t *per_data, int get_nbits); + /* Undo the immediately preceeding "get_few_bits" operation */ + void per_get_undo(asn_per_data_t *per_data, int get_nbits); -/* + /* * Extract a large number of bits from the specified PER data pointer. * This function returns -1 if the specified number of bits could not be * extracted due to EOD or other conditions. */ -int per_get_many_bits(asn_per_data_t *pd, uint8_t *dst, int right_align, - int get_nbits); + int per_get_many_bits(asn_per_data_t *pd, uint8_t *dst, int right_align, + int get_nbits); -/* + /* * Get the length "n" from the Unaligned PER stream. */ -ssize_t uper_get_length(asn_per_data_t *pd, - int effective_bound_bits, - int *repeat); + ssize_t uper_get_length(asn_per_data_t *pd, + int effective_bound_bits, + int *repeat); -/* + /* * Get the normally small length "n". */ -ssize_t uper_get_nslength(asn_per_data_t *pd); + ssize_t uper_get_nslength(asn_per_data_t *pd); -/* + /* * Get the normally small non-negative whole number. */ -ssize_t uper_get_nsnnwn(asn_per_data_t *pd); + ssize_t uper_get_nsnnwn(asn_per_data_t *pd); -/* X.691-2008/11, #11.5.6 */ -int uper_get_constrained_whole_number(asn_per_data_t *pd, unsigned long *v, int nbits); + /* X.691-2008/11, #11.5.6 */ + int uper_get_constrained_whole_number(asn_per_data_t *pd, unsigned long *v, int nbits); -/* Non-thread-safe debugging function, don't use it */ -char *per_data_string(asn_per_data_t *pd); + /* Non-thread-safe debugging function, don't use it */ + char *per_data_string(asn_per_data_t *pd); -/* + /* * This structure supports forming PER output. */ -typedef struct asn_per_outp_s { - uint8_t *buffer; /* Pointer into the (tmpspace) */ - size_t nboff; /* Bit offset to the meaningful bit */ - size_t nbits; /* Number of bits left in (tmpspace) */ - uint8_t tmpspace[32]; /* Preliminary storage to hold data */ + typedef struct asn_per_outp_s + { + uint8_t *buffer; /* Pointer into the (tmpspace) */ + size_t nboff; /* Bit offset to the meaningful bit */ + size_t nbits; /* Number of bits left in (tmpspace) */ + uint8_t tmpspace[32]; /* Preliminary storage to hold data */ int (*outper)(const void *data, size_t size, void *op_key); - void *op_key; /* Key for (outper) data callback */ - size_t flushed_bytes; /* Bytes already flushed through (outper) */ -} asn_per_outp_t; + void *op_key; /* Key for (outper) data callback */ + size_t flushed_bytes; /* Bytes already flushed through (outper) */ + } asn_per_outp_t; -/* Output a small number of bits (<= 31) */ -int per_put_few_bits(asn_per_outp_t *per_data, uint32_t bits, int obits); + /* Output a small number of bits (<= 31) */ + int per_put_few_bits(asn_per_outp_t *per_data, uint32_t bits, int obits); -/* Output a large number of bits */ -int per_put_many_bits(asn_per_outp_t *po, const uint8_t *src, int put_nbits); + /* Output a large number of bits */ + int per_put_many_bits(asn_per_outp_t *po, const uint8_t *src, int put_nbits); -/* + /* * Flush whole bytes (0 or more) through (outper) member. * The least significant bits which are not used are guaranteed to be set to 0. * Returns -1 if callback returns -1. Otherwise, 0. */ -int per_put_aligned_flush(asn_per_outp_t *po); + int per_put_aligned_flush(asn_per_outp_t *po); -/* X.691-2008/11, #11.5 */ -int uper_put_constrained_whole_number_s(asn_per_outp_t *po, long v, int nbits); -int uper_put_constrained_whole_number_u(asn_per_outp_t *po, unsigned long v, int nbits); + /* X.691-2008/11, #11.5 */ + int uper_put_constrained_whole_number_s(asn_per_outp_t *po, long v, int nbits); + int uper_put_constrained_whole_number_u(asn_per_outp_t *po, unsigned long v, int nbits); -/* + /* * Put the length "n" to the Unaligned PER stream. * This function returns the number of units which may be flushed * in the next units saving iteration. */ -ssize_t uper_put_length(asn_per_outp_t *po, size_t whole_length); + ssize_t uper_put_length(asn_per_outp_t *po, size_t whole_length); -/* + /* * Put the normally small length "n" to the Unaligned PER stream. * Returns 0 or -1. */ -int uper_put_nslength(asn_per_outp_t *po, size_t length); + int uper_put_nslength(asn_per_outp_t *po, size_t length); -/* + /* * Put the normally small non-negative whole number. */ -int uper_put_nsnnwn(asn_per_outp_t *po, int n); + int uper_put_nsnnwn(asn_per_outp_t *po, int n); #ifdef __cplusplus } #endif -#endif /* _PER_SUPPORT_H_ */ +#endif /* _PER_SUPPORT_H_ */ diff --git a/src/core/libs/supl/asn-rrlp/xer_decoder.h b/src/core/libs/supl/asn-rrlp/xer_decoder.h index cf0d846fe..52444af51 100644 --- a/src/core/libs/supl/asn-rrlp/xer_decoder.h +++ b/src/core/libs/supl/asn-rrlp/xer_decoder.h @@ -2,105 +2,104 @@ * Copyright (c) 2004 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ -#ifndef _XER_DECODER_H_ -#define _XER_DECODER_H_ +#ifndef _XER_DECODER_H_ +#define _XER_DECODER_H_ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -struct asn_TYPE_descriptor_s; /* Forward declaration */ + struct asn_TYPE_descriptor_s; /* Forward declaration */ -/* + /* * The XER decoder of any ASN.1 type. May be invoked by the application. */ -asn_dec_rval_t xer_decode(struct asn_codec_ctx_s *opt_codec_ctx, - struct asn_TYPE_descriptor_s *type_descriptor, - void **struct_ptr, /* Pointer to a target structure's pointer */ - const void *buffer, /* Data to be decoded */ - size_t size /* Size of data buffer */ - ); + asn_dec_rval_t xer_decode(struct asn_codec_ctx_s *opt_codec_ctx, + struct asn_TYPE_descriptor_s *type_descriptor, + void **struct_ptr, /* Pointer to a target structure's pointer */ + const void *buffer, /* Data to be decoded */ + size_t size /* Size of data buffer */ + ); -/* + /* * Type of the type-specific XER decoder function. */ -typedef asn_dec_rval_t (xer_type_decoder_f)(asn_codec_ctx_t *opt_codec_ctx, - struct asn_TYPE_descriptor_s *type_descriptor, - void **struct_ptr, - const char *opt_mname, /* Member name */ - const void *buf_ptr, size_t size - ); + typedef asn_dec_rval_t(xer_type_decoder_f)(asn_codec_ctx_t *opt_codec_ctx, + struct asn_TYPE_descriptor_s *type_descriptor, + void **struct_ptr, + const char *opt_mname, /* Member name */ + const void *buf_ptr, size_t size); -/******************************* + /******************************* * INTERNALLY USEFUL FUNCTIONS * *******************************/ -/* + /* * Generalized function for decoding the primitive values. * Used by more specialized functions, such as OCTET_STRING_decode_xer_utf8 * and others. This function should not be used by applications, as its API * is subject to changes. */ -asn_dec_rval_t xer_decode_general(asn_codec_ctx_t *opt_codec_ctx, - asn_struct_ctx_t *ctx, /* Type decoder context */ - void *struct_key, /* Treated as opaque pointer */ - const char *xml_tag, /* Expected XML tag name */ - const void *buf_ptr, size_t size, - int (*opt_unexpected_tag_decoder) - (void *struct_key, const void *chunk_buf, size_t chunk_size), - ssize_t (*body_receiver) - (void *struct_key, const void *chunk_buf, size_t chunk_size, - int have_more) - ); + asn_dec_rval_t xer_decode_general(asn_codec_ctx_t *opt_codec_ctx, + asn_struct_ctx_t *ctx, /* Type decoder context */ + void *struct_key, /* Treated as opaque pointer */ + const char *xml_tag, /* Expected XML tag name */ + const void *buf_ptr, size_t size, + int (*opt_unexpected_tag_decoder)(void *struct_key, const void *chunk_buf, size_t chunk_size), + ssize_t (*body_receiver)(void *struct_key, const void *chunk_buf, size_t chunk_size, + int have_more)); -/* + /* * Fetch the next XER (XML) token from the stream. * The function returns the number of bytes occupied by the chunk type, * returned in the _ch_type. The _ch_type is only set (and valid) when * the return value is greater than 0. */ - typedef enum pxer_chunk_type { - PXER_TAG, /* Complete XER tag */ - PXER_TEXT, /* Plain text between XER tags */ - PXER_COMMENT /* A comment, may be part of */ - } pxer_chunk_type_e; -ssize_t xer_next_token(int *stateContext, - const void *buffer, size_t size, pxer_chunk_type_e *_ch_type); + typedef enum pxer_chunk_type + { + PXER_TAG, /* Complete XER tag */ + PXER_TEXT, /* Plain text between XER tags */ + PXER_COMMENT /* A comment, may be part of */ + } pxer_chunk_type_e; + ssize_t xer_next_token(int *stateContext, + const void *buffer, size_t size, pxer_chunk_type_e *_ch_type); -/* + /* * This function checks the buffer against the tag name is expected to occur. */ - typedef enum xer_check_tag { - XCT_BROKEN = 0, /* The tag is broken */ - XCT_OPENING = 1, /* This is the tag */ - XCT_CLOSING = 2, /* This is the tag */ - XCT_BOTH = 3, /* This is the tag */ - XCT__UNK__MASK = 4, /* Mask of everything unexpected */ - XCT_UNKNOWN_OP = 5, /* Unexpected tag */ - XCT_UNKNOWN_CL = 6, /* Unexpected tag */ - XCT_UNKNOWN_BO = 7 /* Unexpected tag */ - } xer_check_tag_e; -xer_check_tag_e xer_check_tag(const void *buf_ptr, int size, - const char *need_tag); + typedef enum xer_check_tag + { + XCT_BROKEN = 0, /* The tag is broken */ + XCT_OPENING = 1, /* This is the tag */ + XCT_CLOSING = 2, /* This is the tag */ + XCT_BOTH = 3, /* This is the tag */ + XCT__UNK__MASK = 4, /* Mask of everything unexpected */ + XCT_UNKNOWN_OP = 5, /* Unexpected tag */ + XCT_UNKNOWN_CL = 6, /* Unexpected tag */ + XCT_UNKNOWN_BO = 7 /* Unexpected tag */ + } xer_check_tag_e; + xer_check_tag_e xer_check_tag(const void *buf_ptr, int size, + const char *need_tag); -/* + /* * Check whether this buffer consists of entirely XER whitespace characters. * RETURN VALUES: * 1: Whitespace or empty string * 0: Non-whitespace */ -int xer_is_whitespace(const void *chunk_buf, size_t chunk_size); + int xer_is_whitespace(const void *chunk_buf, size_t chunk_size); -/* + /* * Skip the series of anticipated extensions. */ -int xer_skip_unknown(xer_check_tag_e tcv, ber_tlv_len_t *depth); + int xer_skip_unknown(xer_check_tag_e tcv, ber_tlv_len_t *depth); #ifdef __cplusplus } #endif -#endif /* _XER_DECODER_H_ */ +#endif /* _XER_DECODER_H_ */ diff --git a/src/core/libs/supl/asn-rrlp/xer_encoder.h b/src/core/libs/supl/asn-rrlp/xer_encoder.h index 055e73c0c..5b640d425 100644 --- a/src/core/libs/supl/asn-rrlp/xer_encoder.h +++ b/src/core/libs/supl/asn-rrlp/xer_encoder.h @@ -2,35 +2,37 @@ * Copyright (c) 2004 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ -#ifndef _XER_ENCODER_H_ -#define _XER_ENCODER_H_ +#ifndef _XER_ENCODER_H_ +#define _XER_ENCODER_H_ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -struct asn_TYPE_descriptor_s; /* Forward declaration */ + struct asn_TYPE_descriptor_s; /* Forward declaration */ -/* Flags used by the xer_encode() and (*xer_type_encoder_f), defined below */ -enum xer_encoder_flags_e { - /* Mode of encoding */ - XER_F_BASIC = 0x01, /* BASIC-XER (pretty-printing) */ - XER_F_CANONICAL = 0x02 /* Canonical XER (strict rules) */ -}; + /* Flags used by the xer_encode() and (*xer_type_encoder_f), defined below */ + enum xer_encoder_flags_e + { + /* Mode of encoding */ + XER_F_BASIC = 0x01, /* BASIC-XER (pretty-printing) */ + XER_F_CANONICAL = 0x02 /* Canonical XER (strict rules) */ + }; -/* + /* * The XER encoder of any type. May be invoked by the application. */ -asn_enc_rval_t xer_encode(struct asn_TYPE_descriptor_s *type_descriptor, - void *struct_ptr, /* Structure to be encoded */ - enum xer_encoder_flags_e xer_flags, - asn_app_consume_bytes_f *consume_bytes_cb, - void *app_key /* Arbitrary callback argument */ - ); + asn_enc_rval_t xer_encode(struct asn_TYPE_descriptor_s *type_descriptor, + void *struct_ptr, /* Structure to be encoded */ + enum xer_encoder_flags_e xer_flags, + asn_app_consume_bytes_f *consume_bytes_cb, + void *app_key /* Arbitrary callback argument */ + ); -/* + /* * The variant of the above function which dumps the BASIC-XER (XER_F_BASIC) * output into the chosen file pointer. * RETURN VALUES: @@ -38,22 +40,22 @@ asn_enc_rval_t xer_encode(struct asn_TYPE_descriptor_s *type_descriptor, * -1: Problem printing the structure. * WARNING: No sensible errno value is returned. */ -int xer_fprint(FILE *stream, struct asn_TYPE_descriptor_s *td, void *sptr); + int xer_fprint(FILE *stream, struct asn_TYPE_descriptor_s *td, void *sptr); -/* + /* * Type of the generic XER encoder. */ -typedef asn_enc_rval_t (xer_type_encoder_f)( - struct asn_TYPE_descriptor_s *type_descriptor, - void *struct_ptr, /* Structure to be encoded */ - int ilevel, /* Level of indentation */ - enum xer_encoder_flags_e xer_flags, - asn_app_consume_bytes_f *consume_bytes_cb, /* Callback */ - void *app_key /* Arbitrary callback argument */ - ); + typedef asn_enc_rval_t(xer_type_encoder_f)( + struct asn_TYPE_descriptor_s *type_descriptor, + void *struct_ptr, /* Structure to be encoded */ + int ilevel, /* Level of indentation */ + enum xer_encoder_flags_e xer_flags, + asn_app_consume_bytes_f *consume_bytes_cb, /* Callback */ + void *app_key /* Arbitrary callback argument */ + ); #ifdef __cplusplus } #endif -#endif /* _XER_ENCODER_H_ */ +#endif /* _XER_ENCODER_H_ */ diff --git a/src/core/libs/supl/asn-rrlp/xer_support.h b/src/core/libs/supl/asn-rrlp/xer_support.h index 8b01944ab..13d8bbd06 100644 --- a/src/core/libs/supl/asn-rrlp/xer_support.h +++ b/src/core/libs/supl/asn-rrlp/xer_support.h @@ -3,31 +3,33 @@ * Copyright (c) 2003, 2004 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ -#ifndef _XER_SUPPORT_H_ -#define _XER_SUPPORT_H_ +#ifndef _XER_SUPPORT_H_ +#define _XER_SUPPORT_H_ -#include /* Platform-specific types */ +#include /* Platform-specific types */ #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* + /* * Types of data transferred to the application. */ -typedef enum { - PXML_TEXT, /* Plain text between XML tags. */ - PXML_TAG, /* A tag, starting with '<'. */ - PXML_COMMENT, /* An XML comment, including "". */ - /* + typedef enum + { + PXML_TEXT, /* Plain text between XML tags. */ + PXML_TAG, /* A tag, starting with '<'. */ + PXML_COMMENT, /* An XML comment, including "". */ + /* * The following chunk types are reported if the chunk * terminates the specified XML element. */ - PXML_TAG_END, /* Tag ended */ - PXML_COMMENT_END /* Comment ended */ -} pxml_chunk_type_e; + PXML_TAG_END, /* Tag ended */ + PXML_COMMENT_END /* Comment ended */ + } pxml_chunk_type_e; -/* + /* * Callback function that is called by the parser when parsed data is * available. The _opaque is the pointer to a field containing opaque user * data specified in pxml_create() call. The chunk type is _type and the text @@ -35,21 +37,21 @@ typedef enum { * pxml_feed() call) starting at offset _offset and of _size bytes size. * The chunk is NOT '\0'-terminated. */ -typedef int (pxml_callback_f)(pxml_chunk_type_e _type, - const void *_chunk_data, size_t _chunk_size, void *_key); + typedef int(pxml_callback_f)(pxml_chunk_type_e _type, + const void *_chunk_data, size_t _chunk_size, void *_key); -/* + /* * Parse the given buffer as it were a chunk of XML data. * Invoke the specified callback each time the meaninful data is found. * This function returns number of bytes consumed from the bufer. * It will always be lesser than or equal to the specified _size. * The next invocation of this function must account the difference. */ -ssize_t pxml_parse(int *_stateContext, const void *_buf, size_t _size, - pxml_callback_f *cb, void *_key); + ssize_t pxml_parse(int *_stateContext, const void *_buf, size_t _size, + pxml_callback_f *cb, void *_key); #ifdef __cplusplus } #endif -#endif /* _XER_SUPPORT_H_ */ +#endif /* _XER_SUPPORT_H_ */ diff --git a/src/core/libs/supl/asn-supl/AltitudeInfo.h b/src/core/libs/supl/asn-supl/AltitudeInfo.h index 5048d16ad..117da26e2 100644 --- a/src/core/libs/supl/asn-supl/AltitudeInfo.h +++ b/src/core/libs/supl/asn-supl/AltitudeInfo.h @@ -4,8 +4,8 @@ * found in "../supl-common.asn" */ -#ifndef _AltitudeInfo_H_ -#define _AltitudeInfo_H_ +#ifndef _AltitudeInfo_H_ +#define _AltitudeInfo_H_ #include @@ -16,36 +16,39 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Dependencies */ -typedef enum altitudeDirection { - altitudeDirection_height = 0, - altitudeDirection_depth = 1 -} e_altitudeDirection; + /* Dependencies */ + typedef enum altitudeDirection + { + altitudeDirection_height = 0, + altitudeDirection_depth = 1 + } e_altitudeDirection; -/* AltitudeInfo */ -typedef struct AltitudeInfo { - ENUMERATED_t altitudeDirection; - long altitude; - long altUncertainty; - /* + /* AltitudeInfo */ + typedef struct AltitudeInfo + { + ENUMERATED_t altitudeDirection; + long altitude; + long altUncertainty; + /* * This type is extensible, * possible extensions are below. */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} AltitudeInfo_t; -/* Implementation */ -/* extern asn_TYPE_descriptor_t asn_DEF_altitudeDirection_2; // (Use -fall-defs-global to expose) */ -extern asn_TYPE_descriptor_t asn_DEF_AltitudeInfo; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } AltitudeInfo_t; + + /* Implementation */ + /* extern asn_TYPE_descriptor_t asn_DEF_altitudeDirection_2; // (Use -fall-defs-global to expose) */ + extern asn_TYPE_descriptor_t asn_DEF_AltitudeInfo; #ifdef __cplusplus } #endif -#endif /* _AltitudeInfo_H_ */ +#endif /* _AltitudeInfo_H_ */ #include diff --git a/src/core/libs/supl/asn-supl/BIT_STRING.h b/src/core/libs/supl/asn-supl/BIT_STRING.h index 732e878bc..0008e0d82 100644 --- a/src/core/libs/supl/asn-supl/BIT_STRING.h +++ b/src/core/libs/supl/asn-supl/BIT_STRING.h @@ -2,32 +2,34 @@ * Copyright (c) 2003 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ -#ifndef _BIT_STRING_H_ -#define _BIT_STRING_H_ +#ifndef _BIT_STRING_H_ +#define _BIT_STRING_H_ -#include /* Some help from OCTET STRING */ +#include /* Some help from OCTET STRING */ #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -typedef struct BIT_STRING_s { - uint8_t *buf; /* BIT STRING body */ - int size; /* Size of the above buffer */ + typedef struct BIT_STRING_s + { + uint8_t *buf; /* BIT STRING body */ + int size; /* Size of the above buffer */ - int bits_unused;/* Unused trailing bits in the last octet (0..7) */ + int bits_unused; /* Unused trailing bits in the last octet (0..7) */ - asn_struct_ctx_t _asn_ctx; /* Parsing across buffer boundaries */ -} BIT_STRING_t; + asn_struct_ctx_t _asn_ctx; /* Parsing across buffer boundaries */ + } BIT_STRING_t; -extern asn_TYPE_descriptor_t asn_DEF_BIT_STRING; + extern asn_TYPE_descriptor_t asn_DEF_BIT_STRING; -asn_struct_print_f BIT_STRING_print; /* Human-readable output */ -asn_constr_check_f BIT_STRING_constraint; -xer_type_encoder_f BIT_STRING_encode_xer; + asn_struct_print_f BIT_STRING_print; /* Human-readable output */ + asn_constr_check_f BIT_STRING_constraint; + xer_type_encoder_f BIT_STRING_encode_xer; #ifdef __cplusplus } #endif -#endif /* _BIT_STRING_H_ */ +#endif /* _BIT_STRING_H_ */ diff --git a/src/core/libs/supl/asn-supl/BOOLEAN.h b/src/core/libs/supl/asn-supl/BOOLEAN.h index 217d0f163..b74f2b430 100644 --- a/src/core/libs/supl/asn-supl/BOOLEAN.h +++ b/src/core/libs/supl/asn-supl/BOOLEAN.h @@ -2,35 +2,36 @@ * Copyright (c) 2003 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ -#ifndef _BOOLEAN_H_ -#define _BOOLEAN_H_ +#ifndef _BOOLEAN_H_ +#define _BOOLEAN_H_ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* + /* * The underlying integer may contain various values, but everything * non-zero is capped to 0xff by the DER encoder. The BER decoder may * yield non-zero values different from 1, beware. */ -typedef int BOOLEAN_t; + typedef int BOOLEAN_t; -extern asn_TYPE_descriptor_t asn_DEF_BOOLEAN; + extern asn_TYPE_descriptor_t asn_DEF_BOOLEAN; -asn_struct_free_f BOOLEAN_free; -asn_struct_print_f BOOLEAN_print; -ber_type_decoder_f BOOLEAN_decode_ber; -der_type_encoder_f BOOLEAN_encode_der; -xer_type_decoder_f BOOLEAN_decode_xer; -xer_type_encoder_f BOOLEAN_encode_xer; -per_type_decoder_f BOOLEAN_decode_uper; -per_type_encoder_f BOOLEAN_encode_uper; + asn_struct_free_f BOOLEAN_free; + asn_struct_print_f BOOLEAN_print; + ber_type_decoder_f BOOLEAN_decode_ber; + der_type_encoder_f BOOLEAN_encode_der; + xer_type_decoder_f BOOLEAN_decode_xer; + xer_type_encoder_f BOOLEAN_encode_xer; + per_type_decoder_f BOOLEAN_decode_uper; + per_type_encoder_f BOOLEAN_encode_uper; #ifdef __cplusplus } #endif -#endif /* _BOOLEAN_H_ */ +#endif /* _BOOLEAN_H_ */ diff --git a/src/core/libs/supl/asn-supl/CPICH-Ec-N0.h b/src/core/libs/supl/asn-supl/CPICH-Ec-N0.h index 164ff7b32..de9c51754 100644 --- a/src/core/libs/supl/asn-supl/CPICH-Ec-N0.h +++ b/src/core/libs/supl/asn-supl/CPICH-Ec-N0.h @@ -4,8 +4,8 @@ * found in "../supl-common.asn" */ -#ifndef _CPICH_Ec_N0_H_ -#define _CPICH_Ec_N0_H_ +#ifndef _CPICH_Ec_N0_H_ +#define _CPICH_Ec_N0_H_ #include @@ -14,27 +14,28 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* CPICH-Ec-N0 */ -typedef long CPICH_Ec_N0_t; + /* CPICH-Ec-N0 */ + typedef long CPICH_Ec_N0_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_CPICH_Ec_N0; -asn_struct_free_f CPICH_Ec_N0_free; -asn_struct_print_f CPICH_Ec_N0_print; -asn_constr_check_f CPICH_Ec_N0_constraint; -ber_type_decoder_f CPICH_Ec_N0_decode_ber; -der_type_encoder_f CPICH_Ec_N0_encode_der; -xer_type_decoder_f CPICH_Ec_N0_decode_xer; -xer_type_encoder_f CPICH_Ec_N0_encode_xer; -per_type_decoder_f CPICH_Ec_N0_decode_uper; -per_type_encoder_f CPICH_Ec_N0_encode_uper; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_CPICH_Ec_N0; + asn_struct_free_f CPICH_Ec_N0_free; + asn_struct_print_f CPICH_Ec_N0_print; + asn_constr_check_f CPICH_Ec_N0_constraint; + ber_type_decoder_f CPICH_Ec_N0_decode_ber; + der_type_encoder_f CPICH_Ec_N0_encode_der; + xer_type_decoder_f CPICH_Ec_N0_decode_xer; + xer_type_encoder_f CPICH_Ec_N0_encode_xer; + per_type_decoder_f CPICH_Ec_N0_decode_uper; + per_type_encoder_f CPICH_Ec_N0_encode_uper; #ifdef __cplusplus } #endif -#endif /* _CPICH_Ec_N0_H_ */ +#endif /* _CPICH_Ec_N0_H_ */ #include diff --git a/src/core/libs/supl/asn-supl/CPICH-RSCP.h b/src/core/libs/supl/asn-supl/CPICH-RSCP.h index 80551bb1c..6b82eac15 100644 --- a/src/core/libs/supl/asn-supl/CPICH-RSCP.h +++ b/src/core/libs/supl/asn-supl/CPICH-RSCP.h @@ -4,8 +4,8 @@ * found in "../supl-common.asn" */ -#ifndef _CPICH_RSCP_H_ -#define _CPICH_RSCP_H_ +#ifndef _CPICH_RSCP_H_ +#define _CPICH_RSCP_H_ #include @@ -14,27 +14,28 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* CPICH-RSCP */ -typedef long CPICH_RSCP_t; + /* CPICH-RSCP */ + typedef long CPICH_RSCP_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_CPICH_RSCP; -asn_struct_free_f CPICH_RSCP_free; -asn_struct_print_f CPICH_RSCP_print; -asn_constr_check_f CPICH_RSCP_constraint; -ber_type_decoder_f CPICH_RSCP_decode_ber; -der_type_encoder_f CPICH_RSCP_encode_der; -xer_type_decoder_f CPICH_RSCP_decode_xer; -xer_type_encoder_f CPICH_RSCP_encode_xer; -per_type_decoder_f CPICH_RSCP_decode_uper; -per_type_encoder_f CPICH_RSCP_encode_uper; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_CPICH_RSCP; + asn_struct_free_f CPICH_RSCP_free; + asn_struct_print_f CPICH_RSCP_print; + asn_constr_check_f CPICH_RSCP_constraint; + ber_type_decoder_f CPICH_RSCP_decode_ber; + der_type_encoder_f CPICH_RSCP_encode_der; + xer_type_decoder_f CPICH_RSCP_decode_xer; + xer_type_encoder_f CPICH_RSCP_encode_xer; + per_type_decoder_f CPICH_RSCP_decode_uper; + per_type_encoder_f CPICH_RSCP_encode_uper; #ifdef __cplusplus } #endif -#endif /* _CPICH_RSCP_H_ */ +#endif /* _CPICH_RSCP_H_ */ #include diff --git a/src/core/libs/supl/asn-supl/CdmaCellInformation.h b/src/core/libs/supl/asn-supl/CdmaCellInformation.h index 6ee49963e..fff07339d 100644 --- a/src/core/libs/supl/asn-supl/CdmaCellInformation.h +++ b/src/core/libs/supl/asn-supl/CdmaCellInformation.h @@ -4,8 +4,8 @@ * found in "../supl-common.asn" */ -#ifndef _CdmaCellInformation_H_ -#define _CdmaCellInformation_H_ +#ifndef _CdmaCellInformation_H_ +#define _CdmaCellInformation_H_ #include @@ -15,34 +15,36 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* CdmaCellInformation */ -typedef struct CdmaCellInformation { - long refNID; - long refSID; - long refBASEID; - long refBASELAT; - long reBASELONG; - long refREFPN; - long refWeekNumber; - long refSeconds; - /* + /* CdmaCellInformation */ + typedef struct CdmaCellInformation + { + long refNID; + long refSID; + long refBASEID; + long refBASELAT; + long reBASELONG; + long refREFPN; + long refWeekNumber; + long refSeconds; + /* * This type is extensible, * possible extensions are below. */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} CdmaCellInformation_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_CdmaCellInformation; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } CdmaCellInformation_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_CdmaCellInformation; #ifdef __cplusplus } #endif -#endif /* _CdmaCellInformation_H_ */ +#endif /* _CdmaCellInformation_H_ */ #include diff --git a/src/core/libs/supl/asn-supl/CellInfo.h b/src/core/libs/supl/asn-supl/CellInfo.h index c797c2699..945d867c6 100644 --- a/src/core/libs/supl/asn-supl/CellInfo.h +++ b/src/core/libs/supl/asn-supl/CellInfo.h @@ -4,8 +4,8 @@ * found in "../supl-common.asn" */ -#ifndef _CellInfo_H_ -#define _CellInfo_H_ +#ifndef _CellInfo_H_ +#define _CellInfo_H_ #include @@ -17,42 +17,46 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Dependencies */ -typedef enum CellInfo_PR { - CellInfo_PR_NOTHING, /* No components present */ - CellInfo_PR_gsmCell, - CellInfo_PR_wcdmaCell, - CellInfo_PR_cdmaCell, - /* Extensions may appear below */ - -} CellInfo_PR; + /* Dependencies */ + typedef enum CellInfo_PR + { + CellInfo_PR_NOTHING, /* No components present */ + CellInfo_PR_gsmCell, + CellInfo_PR_wcdmaCell, + CellInfo_PR_cdmaCell, + /* Extensions may appear below */ -/* CellInfo */ -typedef struct CellInfo { - CellInfo_PR present; - union CellInfo_u { - GsmCellInformation_t gsmCell; - WcdmaCellInformation_t wcdmaCell; - CdmaCellInformation_t cdmaCell; - /* + } CellInfo_PR; + + /* CellInfo */ + typedef struct CellInfo + { + CellInfo_PR present; + union CellInfo_u + { + GsmCellInformation_t gsmCell; + WcdmaCellInformation_t wcdmaCell; + CdmaCellInformation_t cdmaCell; + /* * This type is extensible, * possible extensions are below. */ - } choice; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} CellInfo_t; + } choice; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_CellInfo; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } CellInfo_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_CellInfo; #ifdef __cplusplus } #endif -#endif /* _CellInfo_H_ */ +#endif /* _CellInfo_H_ */ #include diff --git a/src/core/libs/supl/asn-supl/CellMeasuredResults.h b/src/core/libs/supl/asn-supl/CellMeasuredResults.h index 8b1ccc72b..ce08a12dc 100644 --- a/src/core/libs/supl/asn-supl/CellMeasuredResults.h +++ b/src/core/libs/supl/asn-supl/CellMeasuredResults.h @@ -4,8 +4,8 @@ * found in "../supl-common.asn" */ -#ifndef _CellMeasuredResults_H_ -#define _CellMeasuredResults_H_ +#ifndef _CellMeasuredResults_H_ +#define _CellMeasuredResults_H_ #include @@ -23,56 +23,63 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Dependencies */ -typedef enum modeSpecificInfo_PR { - modeSpecificInfo_PR_NOTHING, /* No components present */ - modeSpecificInfo_PR_fdd, - modeSpecificInfo_PR_tdd -} modeSpecificInfo_PR; + /* Dependencies */ + typedef enum modeSpecificInfo_PR + { + modeSpecificInfo_PR_NOTHING, /* No components present */ + modeSpecificInfo_PR_fdd, + modeSpecificInfo_PR_tdd + } modeSpecificInfo_PR; -/* Forward declarations */ -struct TimeslotISCP_List; + /* Forward declarations */ + struct TimeslotISCP_List; -/* CellMeasuredResults */ -typedef struct CellMeasuredResults { - long *cellIdentity /* OPTIONAL */; - struct modeSpecificInfo { - modeSpecificInfo_PR present; - union CellMeasuredResults__modeSpecificInfo_u { - struct fdd { - PrimaryCPICH_Info_t primaryCPICH_Info; - CPICH_Ec_N0_t *cpich_Ec_N0 /* OPTIONAL */; - CPICH_RSCP_t *cpich_RSCP /* OPTIONAL */; - Pathloss_t *pathloss /* OPTIONAL */; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; - } fdd; - struct tdd { - CellParametersID_t cellParametersID; - TGSN_t *proposedTGSN /* OPTIONAL */; - PrimaryCCPCH_RSCP_t *primaryCCPCH_RSCP /* OPTIONAL */; - Pathloss_t *pathloss /* OPTIONAL */; - struct TimeslotISCP_List *timeslotISCP_List /* OPTIONAL */; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; - } tdd; - } choice; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; - } modeSpecificInfo; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} CellMeasuredResults_t; + /* CellMeasuredResults */ + typedef struct CellMeasuredResults + { + long *cellIdentity /* OPTIONAL */; + struct modeSpecificInfo + { + modeSpecificInfo_PR present; + union CellMeasuredResults__modeSpecificInfo_u + { + struct fdd + { + PrimaryCPICH_Info_t primaryCPICH_Info; + CPICH_Ec_N0_t *cpich_Ec_N0 /* OPTIONAL */; + CPICH_RSCP_t *cpich_RSCP /* OPTIONAL */; + Pathloss_t *pathloss /* OPTIONAL */; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_CellMeasuredResults; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } fdd; + struct tdd + { + CellParametersID_t cellParametersID; + TGSN_t *proposedTGSN /* OPTIONAL */; + PrimaryCCPCH_RSCP_t *primaryCCPCH_RSCP /* OPTIONAL */; + Pathloss_t *pathloss /* OPTIONAL */; + struct TimeslotISCP_List *timeslotISCP_List /* OPTIONAL */; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } tdd; + } choice; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } modeSpecificInfo; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } CellMeasuredResults_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_CellMeasuredResults; #ifdef __cplusplus } @@ -81,5 +88,5 @@ extern asn_TYPE_descriptor_t asn_DEF_CellMeasuredResults; /* Referred external types */ #include "TimeslotISCP-List.h" -#endif /* _CellMeasuredResults_H_ */ +#endif /* _CellMeasuredResults_H_ */ #include diff --git a/src/core/libs/supl/asn-supl/CellMeasuredResultsList.h b/src/core/libs/supl/asn-supl/CellMeasuredResultsList.h index 5fa99af82..8e1b3785d 100644 --- a/src/core/libs/supl/asn-supl/CellMeasuredResultsList.h +++ b/src/core/libs/supl/asn-supl/CellMeasuredResultsList.h @@ -4,8 +4,8 @@ * found in "../supl-common.asn" */ -#ifndef _CellMeasuredResultsList_H_ -#define _CellMeasuredResultsList_H_ +#ifndef _CellMeasuredResultsList_H_ +#define _CellMeasuredResultsList_H_ #include @@ -15,22 +15,25 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Forward declarations */ -struct CellMeasuredResults; + /* Forward declarations */ + struct CellMeasuredResults; -/* CellMeasuredResultsList */ -typedef struct CellMeasuredResultsList { - A_SEQUENCE_OF(struct CellMeasuredResults) list; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} CellMeasuredResultsList_t; + /* CellMeasuredResultsList */ + typedef struct CellMeasuredResultsList + { + A_SEQUENCE_OF(struct CellMeasuredResults) + list; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_CellMeasuredResultsList; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } CellMeasuredResultsList_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_CellMeasuredResultsList; #ifdef __cplusplus } @@ -39,5 +42,5 @@ extern asn_TYPE_descriptor_t asn_DEF_CellMeasuredResultsList; /* Referred external types */ #include "CellMeasuredResults.h" -#endif /* _CellMeasuredResultsList_H_ */ +#endif /* _CellMeasuredResultsList_H_ */ #include diff --git a/src/core/libs/supl/asn-supl/CellParametersID.h b/src/core/libs/supl/asn-supl/CellParametersID.h index b331debbd..bf693916e 100644 --- a/src/core/libs/supl/asn-supl/CellParametersID.h +++ b/src/core/libs/supl/asn-supl/CellParametersID.h @@ -4,8 +4,8 @@ * found in "../supl-common.asn" */ -#ifndef _CellParametersID_H_ -#define _CellParametersID_H_ +#ifndef _CellParametersID_H_ +#define _CellParametersID_H_ #include @@ -14,27 +14,28 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* CellParametersID */ -typedef long CellParametersID_t; + /* CellParametersID */ + typedef long CellParametersID_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_CellParametersID; -asn_struct_free_f CellParametersID_free; -asn_struct_print_f CellParametersID_print; -asn_constr_check_f CellParametersID_constraint; -ber_type_decoder_f CellParametersID_decode_ber; -der_type_encoder_f CellParametersID_encode_der; -xer_type_decoder_f CellParametersID_decode_xer; -xer_type_encoder_f CellParametersID_encode_xer; -per_type_decoder_f CellParametersID_decode_uper; -per_type_encoder_f CellParametersID_encode_uper; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_CellParametersID; + asn_struct_free_f CellParametersID_free; + asn_struct_print_f CellParametersID_print; + asn_constr_check_f CellParametersID_constraint; + ber_type_decoder_f CellParametersID_decode_ber; + der_type_encoder_f CellParametersID_encode_der; + xer_type_decoder_f CellParametersID_decode_xer; + xer_type_encoder_f CellParametersID_encode_xer; + per_type_decoder_f CellParametersID_decode_uper; + per_type_encoder_f CellParametersID_encode_uper; #ifdef __cplusplus } #endif -#endif /* _CellParametersID_H_ */ +#endif /* _CellParametersID_H_ */ #include diff --git a/src/core/libs/supl/asn-supl/DUMMY.h b/src/core/libs/supl/asn-supl/DUMMY.h index c9385e2cb..3d884fc68 100644 --- a/src/core/libs/supl/asn-supl/DUMMY.h +++ b/src/core/libs/supl/asn-supl/DUMMY.h @@ -4,8 +4,8 @@ * found in "../supl-ulp.asn" */ -#ifndef _DUMMY_H_ -#define _DUMMY_H_ +#ifndef _DUMMY_H_ +#define _DUMMY_H_ #include @@ -14,27 +14,28 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* DUMMY */ -typedef INTEGER_t DUMMY_t; + /* DUMMY */ + typedef INTEGER_t DUMMY_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_DUMMY; -asn_struct_free_f DUMMY_free; -asn_struct_print_f DUMMY_print; -asn_constr_check_f DUMMY_constraint; -ber_type_decoder_f DUMMY_decode_ber; -der_type_encoder_f DUMMY_encode_der; -xer_type_decoder_f DUMMY_decode_xer; -xer_type_encoder_f DUMMY_encode_xer; -per_type_decoder_f DUMMY_decode_uper; -per_type_encoder_f DUMMY_encode_uper; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_DUMMY; + asn_struct_free_f DUMMY_free; + asn_struct_print_f DUMMY_print; + asn_constr_check_f DUMMY_constraint; + ber_type_decoder_f DUMMY_decode_ber; + der_type_encoder_f DUMMY_encode_der; + xer_type_decoder_f DUMMY_decode_xer; + xer_type_encoder_f DUMMY_encode_xer; + per_type_decoder_f DUMMY_decode_uper; + per_type_encoder_f DUMMY_encode_uper; #ifdef __cplusplus } #endif -#endif /* _DUMMY_H_ */ +#endif /* _DUMMY_H_ */ #include diff --git a/src/core/libs/supl/asn-supl/ENUMERATED.h b/src/core/libs/supl/asn-supl/ENUMERATED.h index 542dcae94..86c1cf643 100644 --- a/src/core/libs/supl/asn-supl/ENUMERATED.h +++ b/src/core/libs/supl/asn-supl/ENUMERATED.h @@ -2,24 +2,25 @@ * Copyright (c) 2003, 2005 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ -#ifndef _ENUMERATED_H_ -#define _ENUMERATED_H_ +#ifndef _ENUMERATED_H_ +#define _ENUMERATED_H_ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -typedef INTEGER_t ENUMERATED_t; /* Implemented via INTEGER */ + typedef INTEGER_t ENUMERATED_t; /* Implemented via INTEGER */ -extern asn_TYPE_descriptor_t asn_DEF_ENUMERATED; + extern asn_TYPE_descriptor_t asn_DEF_ENUMERATED; -per_type_decoder_f ENUMERATED_decode_uper; -per_type_encoder_f ENUMERATED_encode_uper; + per_type_decoder_f ENUMERATED_decode_uper; + per_type_encoder_f ENUMERATED_encode_uper; #ifdef __cplusplus } #endif -#endif /* _ENUMERATED_H_ */ +#endif /* _ENUMERATED_H_ */ diff --git a/src/core/libs/supl/asn-supl/EncodingType.h b/src/core/libs/supl/asn-supl/EncodingType.h index 4dd21e4be..40deead4e 100644 --- a/src/core/libs/supl/asn-supl/EncodingType.h +++ b/src/core/libs/supl/asn-supl/EncodingType.h @@ -4,8 +4,8 @@ * found in "../supl-init.asn" */ -#ifndef _EncodingType_H_ -#define _EncodingType_H_ +#ifndef _EncodingType_H_ +#define _EncodingType_H_ #include @@ -14,37 +14,39 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Dependencies */ -typedef enum EncodingType { - EncodingType_ucs2 = 0, - EncodingType_gsmDefault = 1, - EncodingType_utf8 = 2 - /* + /* Dependencies */ + typedef enum EncodingType + { + EncodingType_ucs2 = 0, + EncodingType_gsmDefault = 1, + EncodingType_utf8 = 2 + /* * Enumeration is extensible */ -} e_EncodingType; + } e_EncodingType; -/* EncodingType */ -typedef ENUMERATED_t EncodingType_t; + /* EncodingType */ + typedef ENUMERATED_t EncodingType_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_EncodingType; -asn_struct_free_f EncodingType_free; -asn_struct_print_f EncodingType_print; -asn_constr_check_f EncodingType_constraint; -ber_type_decoder_f EncodingType_decode_ber; -der_type_encoder_f EncodingType_encode_der; -xer_type_decoder_f EncodingType_decode_xer; -xer_type_encoder_f EncodingType_encode_xer; -per_type_decoder_f EncodingType_decode_uper; -per_type_encoder_f EncodingType_encode_uper; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_EncodingType; + asn_struct_free_f EncodingType_free; + asn_struct_print_f EncodingType_print; + asn_constr_check_f EncodingType_constraint; + ber_type_decoder_f EncodingType_decode_ber; + der_type_encoder_f EncodingType_encode_der; + xer_type_decoder_f EncodingType_decode_xer; + xer_type_encoder_f EncodingType_encode_xer; + per_type_decoder_f EncodingType_decode_uper; + per_type_encoder_f EncodingType_encode_uper; #ifdef __cplusplus } #endif -#endif /* _EncodingType_H_ */ +#endif /* _EncodingType_H_ */ #include diff --git a/src/core/libs/supl/asn-supl/FQDN.h b/src/core/libs/supl/asn-supl/FQDN.h index 37291766a..0aaf7a1ff 100644 --- a/src/core/libs/supl/asn-supl/FQDN.h +++ b/src/core/libs/supl/asn-supl/FQDN.h @@ -4,8 +4,8 @@ * found in "../supl-common.asn" */ -#ifndef _FQDN_H_ -#define _FQDN_H_ +#ifndef _FQDN_H_ +#define _FQDN_H_ #include @@ -14,27 +14,28 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* FQDN */ -typedef VisibleString_t FQDN_t; + /* FQDN */ + typedef VisibleString_t FQDN_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_FQDN; -asn_struct_free_f FQDN_free; -asn_struct_print_f FQDN_print; -asn_constr_check_f FQDN_constraint; -ber_type_decoder_f FQDN_decode_ber; -der_type_encoder_f FQDN_encode_der; -xer_type_decoder_f FQDN_decode_xer; -xer_type_encoder_f FQDN_encode_xer; -per_type_decoder_f FQDN_decode_uper; -per_type_encoder_f FQDN_encode_uper; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_FQDN; + asn_struct_free_f FQDN_free; + asn_struct_print_f FQDN_print; + asn_constr_check_f FQDN_constraint; + ber_type_decoder_f FQDN_decode_ber; + der_type_encoder_f FQDN_encode_der; + xer_type_decoder_f FQDN_decode_xer; + xer_type_encoder_f FQDN_encode_xer; + per_type_decoder_f FQDN_decode_uper; + per_type_encoder_f FQDN_encode_uper; #ifdef __cplusplus } #endif -#endif /* _FQDN_H_ */ +#endif /* _FQDN_H_ */ #include diff --git a/src/core/libs/supl/asn-supl/FormatIndicator.h b/src/core/libs/supl/asn-supl/FormatIndicator.h index 6ac65a25d..b52a8b4e3 100644 --- a/src/core/libs/supl/asn-supl/FormatIndicator.h +++ b/src/core/libs/supl/asn-supl/FormatIndicator.h @@ -4,8 +4,8 @@ * found in "../supl-init.asn" */ -#ifndef _FormatIndicator_H_ -#define _FormatIndicator_H_ +#ifndef _FormatIndicator_H_ +#define _FormatIndicator_H_ #include @@ -14,42 +14,44 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Dependencies */ -typedef enum FormatIndicator { - FormatIndicator_logicalName = 0, - FormatIndicator_e_mailAddress = 1, - FormatIndicator_msisdn = 2, - FormatIndicator_url = 3, - FormatIndicator_sipUrl = 4, - FormatIndicator_min = 5, - FormatIndicator_mdn = 6, - FormatIndicator_imsPublicIdentity = 7 - /* + /* Dependencies */ + typedef enum FormatIndicator + { + FormatIndicator_logicalName = 0, + FormatIndicator_e_mailAddress = 1, + FormatIndicator_msisdn = 2, + FormatIndicator_url = 3, + FormatIndicator_sipUrl = 4, + FormatIndicator_min = 5, + FormatIndicator_mdn = 6, + FormatIndicator_imsPublicIdentity = 7 + /* * Enumeration is extensible */ -} e_FormatIndicator; + } e_FormatIndicator; -/* FormatIndicator */ -typedef ENUMERATED_t FormatIndicator_t; + /* FormatIndicator */ + typedef ENUMERATED_t FormatIndicator_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_FormatIndicator; -asn_struct_free_f FormatIndicator_free; -asn_struct_print_f FormatIndicator_print; -asn_constr_check_f FormatIndicator_constraint; -ber_type_decoder_f FormatIndicator_decode_ber; -der_type_encoder_f FormatIndicator_encode_der; -xer_type_decoder_f FormatIndicator_decode_xer; -xer_type_encoder_f FormatIndicator_encode_xer; -per_type_decoder_f FormatIndicator_decode_uper; -per_type_encoder_f FormatIndicator_encode_uper; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_FormatIndicator; + asn_struct_free_f FormatIndicator_free; + asn_struct_print_f FormatIndicator_print; + asn_constr_check_f FormatIndicator_constraint; + ber_type_decoder_f FormatIndicator_decode_ber; + der_type_encoder_f FormatIndicator_encode_der; + xer_type_decoder_f FormatIndicator_decode_xer; + xer_type_encoder_f FormatIndicator_encode_xer; + per_type_decoder_f FormatIndicator_decode_uper; + per_type_encoder_f FormatIndicator_encode_uper; #ifdef __cplusplus } #endif -#endif /* _FormatIndicator_H_ */ +#endif /* _FormatIndicator_H_ */ #include diff --git a/src/core/libs/supl/asn-supl/FrequencyInfo.h b/src/core/libs/supl/asn-supl/FrequencyInfo.h index 3bdeb0ba5..48ed6c07e 100644 --- a/src/core/libs/supl/asn-supl/FrequencyInfo.h +++ b/src/core/libs/supl/asn-supl/FrequencyInfo.h @@ -4,8 +4,8 @@ * found in "../supl-common.asn" */ -#ifndef _FrequencyInfo_H_ -#define _FrequencyInfo_H_ +#ifndef _FrequencyInfo_H_ +#define _FrequencyInfo_H_ #include @@ -17,49 +17,54 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Dependencies */ -typedef enum fmodeSpecificInfo_PR { - fmodeSpecificInfo_PR_NOTHING, /* No components present */ - fmodeSpecificInfo_PR_fdd, - fmodeSpecificInfo_PR_tdd, - /* Extensions may appear below */ - -} fmodeSpecificInfo_PR; + /* Dependencies */ + typedef enum fmodeSpecificInfo_PR + { + fmodeSpecificInfo_PR_NOTHING, /* No components present */ + fmodeSpecificInfo_PR_fdd, + fmodeSpecificInfo_PR_tdd, + /* Extensions may appear below */ -/* FrequencyInfo */ -typedef struct FrequencyInfo { - struct fmodeSpecificInfo { - fmodeSpecificInfo_PR present; - union FrequencyInfo__fmodeSpecificInfo_u { - FrequencyInfoFDD_t fdd; - FrequencyInfoTDD_t tdd; - /* + } fmodeSpecificInfo_PR; + + /* FrequencyInfo */ + typedef struct FrequencyInfo + { + struct fmodeSpecificInfo + { + fmodeSpecificInfo_PR present; + union FrequencyInfo__fmodeSpecificInfo_u + { + FrequencyInfoFDD_t fdd; + FrequencyInfoTDD_t tdd; + /* * This type is extensible, * possible extensions are below. */ - } choice; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; - } fmodeSpecificInfo; - /* + } choice; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } fmodeSpecificInfo; + /* * This type is extensible, * possible extensions are below. */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} FrequencyInfo_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_FrequencyInfo; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } FrequencyInfo_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_FrequencyInfo; #ifdef __cplusplus } #endif -#endif /* _FrequencyInfo_H_ */ +#endif /* _FrequencyInfo_H_ */ #include diff --git a/src/core/libs/supl/asn-supl/FrequencyInfoFDD.h b/src/core/libs/supl/asn-supl/FrequencyInfoFDD.h index 3ed4ee8d8..2e9ac7f55 100644 --- a/src/core/libs/supl/asn-supl/FrequencyInfoFDD.h +++ b/src/core/libs/supl/asn-supl/FrequencyInfoFDD.h @@ -4,8 +4,8 @@ * found in "../supl-common.asn" */ -#ifndef _FrequencyInfoFDD_H_ -#define _FrequencyInfoFDD_H_ +#ifndef _FrequencyInfoFDD_H_ +#define _FrequencyInfoFDD_H_ #include @@ -15,28 +15,30 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* FrequencyInfoFDD */ -typedef struct FrequencyInfoFDD { - UARFCN_t *uarfcn_UL /* OPTIONAL */; - UARFCN_t uarfcn_DL; - /* + /* FrequencyInfoFDD */ + typedef struct FrequencyInfoFDD + { + UARFCN_t *uarfcn_UL /* OPTIONAL */; + UARFCN_t uarfcn_DL; + /* * This type is extensible, * possible extensions are below. */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} FrequencyInfoFDD_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_FrequencyInfoFDD; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } FrequencyInfoFDD_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_FrequencyInfoFDD; #ifdef __cplusplus } #endif -#endif /* _FrequencyInfoFDD_H_ */ +#endif /* _FrequencyInfoFDD_H_ */ #include diff --git a/src/core/libs/supl/asn-supl/FrequencyInfoTDD.h b/src/core/libs/supl/asn-supl/FrequencyInfoTDD.h index f0d6f0e13..1ccedb199 100644 --- a/src/core/libs/supl/asn-supl/FrequencyInfoTDD.h +++ b/src/core/libs/supl/asn-supl/FrequencyInfoTDD.h @@ -4,8 +4,8 @@ * found in "../supl-common.asn" */ -#ifndef _FrequencyInfoTDD_H_ -#define _FrequencyInfoTDD_H_ +#ifndef _FrequencyInfoTDD_H_ +#define _FrequencyInfoTDD_H_ #include @@ -15,27 +15,29 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* FrequencyInfoTDD */ -typedef struct FrequencyInfoTDD { - UARFCN_t uarfcn_Nt; - /* + /* FrequencyInfoTDD */ + typedef struct FrequencyInfoTDD + { + UARFCN_t uarfcn_Nt; + /* * This type is extensible, * possible extensions are below. */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} FrequencyInfoTDD_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_FrequencyInfoTDD; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } FrequencyInfoTDD_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_FrequencyInfoTDD; #ifdef __cplusplus } #endif -#endif /* _FrequencyInfoTDD_H_ */ +#endif /* _FrequencyInfoTDD_H_ */ #include diff --git a/src/core/libs/supl/asn-supl/GeneralizedTime.h b/src/core/libs/supl/asn-supl/GeneralizedTime.h index 1ea06b068..9e9583c7a 100644 --- a/src/core/libs/supl/asn-supl/GeneralizedTime.h +++ b/src/core/libs/supl/asn-supl/GeneralizedTime.h @@ -2,68 +2,69 @@ * Copyright (c) 2003, 2004 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ -#ifndef _GeneralizedTime_H_ -#define _GeneralizedTime_H_ +#ifndef _GeneralizedTime_H_ +#define _GeneralizedTime_H_ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -typedef OCTET_STRING_t GeneralizedTime_t; /* Implemented via OCTET STRING */ + typedef OCTET_STRING_t GeneralizedTime_t; /* Implemented via OCTET STRING */ -extern asn_TYPE_descriptor_t asn_DEF_GeneralizedTime; + extern asn_TYPE_descriptor_t asn_DEF_GeneralizedTime; -asn_struct_print_f GeneralizedTime_print; -asn_constr_check_f GeneralizedTime_constraint; -der_type_encoder_f GeneralizedTime_encode_der; -xer_type_encoder_f GeneralizedTime_encode_xer; + asn_struct_print_f GeneralizedTime_print; + asn_constr_check_f GeneralizedTime_constraint; + der_type_encoder_f GeneralizedTime_encode_der; + xer_type_encoder_f GeneralizedTime_encode_xer; -/*********************** + /*********************** * Some handy helpers. * ***********************/ -struct tm; /* */ + struct tm; /* */ -/* + /* * Convert a GeneralizedTime structure into time_t * and optionally into struct tm. * If as_gmt is given, the resulting _optional_tm4fill will have a GMT zone, * instead of default local one. * On error returns -1 and errno set to EINVAL */ -time_t asn_GT2time(const GeneralizedTime_t *, struct tm *_optional_tm4fill, - int as_gmt); + time_t asn_GT2time(const GeneralizedTime_t *, struct tm *_optional_tm4fill, + int as_gmt); -/* A version of the above function also returning the fractions of seconds */ -time_t asn_GT2time_frac(const GeneralizedTime_t *, - int *frac_value, int *frac_digits, /* (value / (10 ^ digits)) */ - struct tm *_optional_tm4fill, int as_gmt); + /* A version of the above function also returning the fractions of seconds */ + time_t asn_GT2time_frac(const GeneralizedTime_t *, + int *frac_value, int *frac_digits, /* (value / (10 ^ digits)) */ + struct tm *_optional_tm4fill, int as_gmt); -/* + /* * Another version returning fractions with defined precision * For example, parsing of the time ending with ".1" seconds * with frac_digits=3 (msec) would yield frac_value = 100. */ -time_t asn_GT2time_prec(const GeneralizedTime_t *, - int *frac_value, int frac_digits, - struct tm *_optional_tm4fill, int as_gmt); + time_t asn_GT2time_prec(const GeneralizedTime_t *, + int *frac_value, int frac_digits, + struct tm *_optional_tm4fill, int as_gmt); -/* + /* * Convert a struct tm into GeneralizedTime. * If _optional_gt is not given, this function will try to allocate one. * If force_gmt is given, the resulting GeneralizedTime will be forced * into a GMT time zone (encoding ends with a "Z"). * On error, this function returns 0 and sets errno. */ -GeneralizedTime_t *asn_time2GT(GeneralizedTime_t *_optional_gt, - const struct tm *, int force_gmt); -GeneralizedTime_t *asn_time2GT_frac(GeneralizedTime_t *_optional_gt, - const struct tm *, int frac_value, int frac_digits, int force_gmt); + GeneralizedTime_t *asn_time2GT(GeneralizedTime_t *_optional_gt, + const struct tm *, int force_gmt); + GeneralizedTime_t *asn_time2GT_frac(GeneralizedTime_t *_optional_gt, + const struct tm *, int frac_value, int frac_digits, int force_gmt); #ifdef __cplusplus } #endif -#endif /* _GeneralizedTime_H_ */ +#endif /* _GeneralizedTime_H_ */ diff --git a/src/core/libs/supl/asn-supl/GsmCellInformation.h b/src/core/libs/supl/asn-supl/GsmCellInformation.h index 6c978ebee..f5f2d4c96 100644 --- a/src/core/libs/supl/asn-supl/GsmCellInformation.h +++ b/src/core/libs/supl/asn-supl/GsmCellInformation.h @@ -4,8 +4,8 @@ * found in "../supl-common.asn" */ -#ifndef _GsmCellInformation_H_ -#define _GsmCellInformation_H_ +#ifndef _GsmCellInformation_H_ +#define _GsmCellInformation_H_ #include @@ -15,31 +15,33 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Forward declarations */ -struct NMR; + /* Forward declarations */ + struct NMR; -/* GsmCellInformation */ -typedef struct GsmCellInformation { - long refMCC; - long refMNC; - long refLAC; - long refCI; - struct NMR *nMR /* OPTIONAL */; - long *tA /* OPTIONAL */; - /* + /* GsmCellInformation */ + typedef struct GsmCellInformation + { + long refMCC; + long refMNC; + long refLAC; + long refCI; + struct NMR *nMR /* OPTIONAL */; + long *tA /* OPTIONAL */; + /* * This type is extensible, * possible extensions are below. */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} GsmCellInformation_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_GsmCellInformation; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } GsmCellInformation_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_GsmCellInformation; #ifdef __cplusplus } @@ -48,5 +50,5 @@ extern asn_TYPE_descriptor_t asn_DEF_GsmCellInformation; /* Referred external types */ #include "NMR.h" -#endif /* _GsmCellInformation_H_ */ +#endif /* _GsmCellInformation_H_ */ #include diff --git a/src/core/libs/supl/asn-supl/Horandveruncert.h b/src/core/libs/supl/asn-supl/Horandveruncert.h index e72377ddd..0c84e5baa 100644 --- a/src/core/libs/supl/asn-supl/Horandveruncert.h +++ b/src/core/libs/supl/asn-supl/Horandveruncert.h @@ -4,8 +4,8 @@ * found in "../supl-common.asn" */ -#ifndef _Horandveruncert_H_ -#define _Horandveruncert_H_ +#ifndef _Horandveruncert_H_ +#define _Horandveruncert_H_ #include @@ -15,32 +15,34 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Horandveruncert */ -typedef struct Horandveruncert { - BIT_STRING_t verdirect; - BIT_STRING_t bearing; - BIT_STRING_t horspeed; - BIT_STRING_t verspeed; - BIT_STRING_t horuncertspeed; - BIT_STRING_t veruncertspeed; - /* + /* Horandveruncert */ + typedef struct Horandveruncert + { + BIT_STRING_t verdirect; + BIT_STRING_t bearing; + BIT_STRING_t horspeed; + BIT_STRING_t verspeed; + BIT_STRING_t horuncertspeed; + BIT_STRING_t veruncertspeed; + /* * This type is extensible, * possible extensions are below. */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} Horandveruncert_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_Horandveruncert; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } Horandveruncert_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_Horandveruncert; #ifdef __cplusplus } #endif -#endif /* _Horandveruncert_H_ */ +#endif /* _Horandveruncert_H_ */ #include diff --git a/src/core/libs/supl/asn-supl/Horandvervel.h b/src/core/libs/supl/asn-supl/Horandvervel.h index dccb0ebfc..06e39bf1f 100644 --- a/src/core/libs/supl/asn-supl/Horandvervel.h +++ b/src/core/libs/supl/asn-supl/Horandvervel.h @@ -4,8 +4,8 @@ * found in "../supl-common.asn" */ -#ifndef _Horandvervel_H_ -#define _Horandvervel_H_ +#ifndef _Horandvervel_H_ +#define _Horandvervel_H_ #include @@ -15,30 +15,32 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Horandvervel */ -typedef struct Horandvervel { - BIT_STRING_t verdirect; - BIT_STRING_t bearing; - BIT_STRING_t horspeed; - BIT_STRING_t verspeed; - /* + /* Horandvervel */ + typedef struct Horandvervel + { + BIT_STRING_t verdirect; + BIT_STRING_t bearing; + BIT_STRING_t horspeed; + BIT_STRING_t verspeed; + /* * This type is extensible, * possible extensions are below. */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} Horandvervel_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_Horandvervel; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } Horandvervel_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_Horandvervel; #ifdef __cplusplus } #endif -#endif /* _Horandvervel_H_ */ +#endif /* _Horandvervel_H_ */ #include diff --git a/src/core/libs/supl/asn-supl/Horvel.h b/src/core/libs/supl/asn-supl/Horvel.h index 8dfca28c4..b702cb503 100644 --- a/src/core/libs/supl/asn-supl/Horvel.h +++ b/src/core/libs/supl/asn-supl/Horvel.h @@ -4,8 +4,8 @@ * found in "../supl-common.asn" */ -#ifndef _Horvel_H_ -#define _Horvel_H_ +#ifndef _Horvel_H_ +#define _Horvel_H_ #include @@ -15,28 +15,30 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Horvel */ -typedef struct Horvel { - BIT_STRING_t bearing; - BIT_STRING_t horspeed; - /* + /* Horvel */ + typedef struct Horvel + { + BIT_STRING_t bearing; + BIT_STRING_t horspeed; + /* * This type is extensible, * possible extensions are below. */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} Horvel_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_Horvel; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } Horvel_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_Horvel; #ifdef __cplusplus } #endif -#endif /* _Horvel_H_ */ +#endif /* _Horvel_H_ */ #include diff --git a/src/core/libs/supl/asn-supl/Horveluncert.h b/src/core/libs/supl/asn-supl/Horveluncert.h index 2dffd83ec..08037dc98 100644 --- a/src/core/libs/supl/asn-supl/Horveluncert.h +++ b/src/core/libs/supl/asn-supl/Horveluncert.h @@ -4,8 +4,8 @@ * found in "../supl-common.asn" */ -#ifndef _Horveluncert_H_ -#define _Horveluncert_H_ +#ifndef _Horveluncert_H_ +#define _Horveluncert_H_ #include @@ -15,29 +15,31 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Horveluncert */ -typedef struct Horveluncert { - BIT_STRING_t bearing; - BIT_STRING_t horspeed; - BIT_STRING_t uncertspeed; - /* + /* Horveluncert */ + typedef struct Horveluncert + { + BIT_STRING_t bearing; + BIT_STRING_t horspeed; + BIT_STRING_t uncertspeed; + /* * This type is extensible, * possible extensions are below. */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} Horveluncert_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_Horveluncert; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } Horveluncert_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_Horveluncert; #ifdef __cplusplus } #endif -#endif /* _Horveluncert_H_ */ +#endif /* _Horveluncert_H_ */ #include diff --git a/src/core/libs/supl/asn-supl/IA5String.h b/src/core/libs/supl/asn-supl/IA5String.h index e2a909dd5..74ccf6a75 100644 --- a/src/core/libs/supl/asn-supl/IA5String.h +++ b/src/core/libs/supl/asn-supl/IA5String.h @@ -2,26 +2,27 @@ * Copyright (c) 2003 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ -#ifndef _IA5String_H_ -#define _IA5String_H_ +#ifndef _IA5String_H_ +#define _IA5String_H_ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -typedef OCTET_STRING_t IA5String_t; /* Implemented via OCTET STRING */ + typedef OCTET_STRING_t IA5String_t; /* Implemented via OCTET STRING */ -/* + /* * IA5String ASN.1 type definition. */ -extern asn_TYPE_descriptor_t asn_DEF_IA5String; + extern asn_TYPE_descriptor_t asn_DEF_IA5String; -asn_constr_check_f IA5String_constraint; + asn_constr_check_f IA5String_constraint; #ifdef __cplusplus } #endif -#endif /* _IA5String_H_ */ +#endif /* _IA5String_H_ */ diff --git a/src/core/libs/supl/asn-supl/INTEGER.h b/src/core/libs/supl/asn-supl/INTEGER.h index 8411bfcdd..2acd13ab9 100644 --- a/src/core/libs/supl/asn-supl/INTEGER.h +++ b/src/core/libs/supl/asn-supl/INTEGER.h @@ -2,68 +2,71 @@ * Copyright (c) 2003, 2005 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ -#ifndef _INTEGER_H_ -#define _INTEGER_H_ +#ifndef _INTEGER_H_ +#define _INTEGER_H_ #include #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -typedef ASN__PRIMITIVE_TYPE_t INTEGER_t; + typedef ASN__PRIMITIVE_TYPE_t INTEGER_t; -extern asn_TYPE_descriptor_t asn_DEF_INTEGER; + extern asn_TYPE_descriptor_t asn_DEF_INTEGER; -/* Map with to integer value association */ -typedef struct asn_INTEGER_enum_map_s { - long nat_value; /* associated native integer value */ - size_t enum_len; /* strlen("tag") */ - const char *enum_name; /* "tag" */ -} asn_INTEGER_enum_map_t; + /* Map with to integer value association */ + typedef struct asn_INTEGER_enum_map_s + { + long nat_value; /* associated native integer value */ + size_t enum_len; /* strlen("tag") */ + const char *enum_name; /* "tag" */ + } asn_INTEGER_enum_map_t; -/* This type describes an enumeration for INTEGER and ENUMERATED types */ -typedef struct asn_INTEGER_specifics_s { - asn_INTEGER_enum_map_t *value2enum; /* N -> "tag"; sorted by N */ - unsigned int *enum2value; /* "tag" => N; sorted by tag */ - int map_count; /* Elements in either map */ - int extension; /* This map is extensible */ - int strict_enumeration; /* Enumeration set is fixed */ - int field_width; /* Size of native integer */ - int field_unsigned; /* Signed=0, unsigned=1 */ -} asn_INTEGER_specifics_t; + /* This type describes an enumeration for INTEGER and ENUMERATED types */ + typedef struct asn_INTEGER_specifics_s + { + asn_INTEGER_enum_map_t *value2enum; /* N -> "tag"; sorted by N */ + unsigned int *enum2value; /* "tag" => N; sorted by tag */ + int map_count; /* Elements in either map */ + int extension; /* This map is extensible */ + int strict_enumeration; /* Enumeration set is fixed */ + int field_width; /* Size of native integer */ + int field_unsigned; /* Signed=0, unsigned=1 */ + } asn_INTEGER_specifics_t; -asn_struct_print_f INTEGER_print; -ber_type_decoder_f INTEGER_decode_ber; -der_type_encoder_f INTEGER_encode_der; -xer_type_decoder_f INTEGER_decode_xer; -xer_type_encoder_f INTEGER_encode_xer; -per_type_decoder_f INTEGER_decode_uper; -per_type_encoder_f INTEGER_encode_uper; + asn_struct_print_f INTEGER_print; + ber_type_decoder_f INTEGER_decode_ber; + der_type_encoder_f INTEGER_encode_der; + xer_type_decoder_f INTEGER_decode_xer; + xer_type_encoder_f INTEGER_encode_xer; + per_type_decoder_f INTEGER_decode_uper; + per_type_encoder_f INTEGER_encode_uper; -/*********************************** + /*********************************** * Some handy conversion routines. * ***********************************/ -/* + /* * Returns 0 if it was possible to convert, -1 otherwise. * -1/EINVAL: Mandatory argument missing * -1/ERANGE: Value encoded is out of range for long representation * -1/ENOMEM: Memory allocation failed (in asn_long2INTEGER()). */ -int asn_INTEGER2long(const INTEGER_t *i, long *l); -int asn_INTEGER2ulong(const INTEGER_t *i, unsigned long *l); -int asn_long2INTEGER(INTEGER_t *i, long l); -int asn_ulong2INTEGER(INTEGER_t *i, unsigned long l); + int asn_INTEGER2long(const INTEGER_t *i, long *l); + int asn_INTEGER2ulong(const INTEGER_t *i, unsigned long *l); + int asn_long2INTEGER(INTEGER_t *i, long l); + int asn_ulong2INTEGER(INTEGER_t *i, unsigned long l); -/* + /* * Convert the integer value into the corresponding enumeration map entry. */ -const asn_INTEGER_enum_map_t *INTEGER_map_value2enum(asn_INTEGER_specifics_t *specs, long value); + const asn_INTEGER_enum_map_t *INTEGER_map_value2enum(asn_INTEGER_specifics_t *specs, long value); #ifdef __cplusplus } #endif -#endif /* _INTEGER_H_ */ +#endif /* _INTEGER_H_ */ diff --git a/src/core/libs/supl/asn-supl/IPAddress.h b/src/core/libs/supl/asn-supl/IPAddress.h index 9058a5d27..a049e9d94 100644 --- a/src/core/libs/supl/asn-supl/IPAddress.h +++ b/src/core/libs/supl/asn-supl/IPAddress.h @@ -4,8 +4,8 @@ * found in "../supl-common.asn" */ -#ifndef _IPAddress_H_ -#define _IPAddress_H_ +#ifndef _IPAddress_H_ +#define _IPAddress_H_ #include @@ -15,34 +15,38 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Dependencies */ -typedef enum IPAddress_PR { - IPAddress_PR_NOTHING, /* No components present */ - IPAddress_PR_ipv4Address, - IPAddress_PR_ipv6Address -} IPAddress_PR; + /* Dependencies */ + typedef enum IPAddress_PR + { + IPAddress_PR_NOTHING, /* No components present */ + IPAddress_PR_ipv4Address, + IPAddress_PR_ipv6Address + } IPAddress_PR; -/* IPAddress */ -typedef struct IPAddress { - IPAddress_PR present; - union IPAddress_u { - OCTET_STRING_t ipv4Address; - OCTET_STRING_t ipv6Address; - } choice; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} IPAddress_t; + /* IPAddress */ + typedef struct IPAddress + { + IPAddress_PR present; + union IPAddress_u + { + OCTET_STRING_t ipv4Address; + OCTET_STRING_t ipv6Address; + } choice; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_IPAddress; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } IPAddress_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_IPAddress; #ifdef __cplusplus } #endif -#endif /* _IPAddress_H_ */ +#endif /* _IPAddress_H_ */ #include diff --git a/src/core/libs/supl/asn-supl/KeyIdentity.h b/src/core/libs/supl/asn-supl/KeyIdentity.h index edf2f28dc..1347758dc 100644 --- a/src/core/libs/supl/asn-supl/KeyIdentity.h +++ b/src/core/libs/supl/asn-supl/KeyIdentity.h @@ -4,8 +4,8 @@ * found in "../supl-init.asn" */ -#ifndef _KeyIdentity_H_ -#define _KeyIdentity_H_ +#ifndef _KeyIdentity_H_ +#define _KeyIdentity_H_ #include @@ -14,27 +14,28 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* KeyIdentity */ -typedef BIT_STRING_t KeyIdentity_t; + /* KeyIdentity */ + typedef BIT_STRING_t KeyIdentity_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_KeyIdentity; -asn_struct_free_f KeyIdentity_free; -asn_struct_print_f KeyIdentity_print; -asn_constr_check_f KeyIdentity_constraint; -ber_type_decoder_f KeyIdentity_decode_ber; -der_type_encoder_f KeyIdentity_encode_der; -xer_type_decoder_f KeyIdentity_decode_xer; -xer_type_encoder_f KeyIdentity_encode_xer; -per_type_decoder_f KeyIdentity_decode_uper; -per_type_encoder_f KeyIdentity_encode_uper; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_KeyIdentity; + asn_struct_free_f KeyIdentity_free; + asn_struct_print_f KeyIdentity_print; + asn_constr_check_f KeyIdentity_constraint; + ber_type_decoder_f KeyIdentity_decode_ber; + der_type_encoder_f KeyIdentity_encode_der; + xer_type_decoder_f KeyIdentity_decode_xer; + xer_type_encoder_f KeyIdentity_encode_xer; + per_type_decoder_f KeyIdentity_decode_uper; + per_type_encoder_f KeyIdentity_encode_uper; #ifdef __cplusplus } #endif -#endif /* _KeyIdentity_H_ */ +#endif /* _KeyIdentity_H_ */ #include diff --git a/src/core/libs/supl/asn-supl/KeyIdentity4.h b/src/core/libs/supl/asn-supl/KeyIdentity4.h index bb25f736d..f2e502475 100644 --- a/src/core/libs/supl/asn-supl/KeyIdentity4.h +++ b/src/core/libs/supl/asn-supl/KeyIdentity4.h @@ -4,8 +4,8 @@ * found in "../supl-response.asn" */ -#ifndef _KeyIdentity4_H_ -#define _KeyIdentity4_H_ +#ifndef _KeyIdentity4_H_ +#define _KeyIdentity4_H_ #include @@ -14,27 +14,28 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* KeyIdentity4 */ -typedef BIT_STRING_t KeyIdentity4_t; + /* KeyIdentity4 */ + typedef BIT_STRING_t KeyIdentity4_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_KeyIdentity4; -asn_struct_free_f KeyIdentity4_free; -asn_struct_print_f KeyIdentity4_print; -asn_constr_check_f KeyIdentity4_constraint; -ber_type_decoder_f KeyIdentity4_decode_ber; -der_type_encoder_f KeyIdentity4_encode_der; -xer_type_decoder_f KeyIdentity4_decode_xer; -xer_type_encoder_f KeyIdentity4_encode_xer; -per_type_decoder_f KeyIdentity4_decode_uper; -per_type_encoder_f KeyIdentity4_encode_uper; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_KeyIdentity4; + asn_struct_free_f KeyIdentity4_free; + asn_struct_print_f KeyIdentity4_print; + asn_constr_check_f KeyIdentity4_constraint; + ber_type_decoder_f KeyIdentity4_decode_ber; + der_type_encoder_f KeyIdentity4_encode_der; + xer_type_decoder_f KeyIdentity4_decode_xer; + xer_type_encoder_f KeyIdentity4_encode_xer; + per_type_decoder_f KeyIdentity4_decode_uper; + per_type_encoder_f KeyIdentity4_encode_uper; #ifdef __cplusplus } #endif -#endif /* _KeyIdentity4_H_ */ +#endif /* _KeyIdentity4_H_ */ #include diff --git a/src/core/libs/supl/asn-supl/LocationId.h b/src/core/libs/supl/asn-supl/LocationId.h index 524af12cf..55842f70b 100644 --- a/src/core/libs/supl/asn-supl/LocationId.h +++ b/src/core/libs/supl/asn-supl/LocationId.h @@ -4,8 +4,8 @@ * found in "../supl-common.asn" */ -#ifndef _LocationId_H_ -#define _LocationId_H_ +#ifndef _LocationId_H_ +#define _LocationId_H_ #include @@ -16,28 +16,30 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* LocationId */ -typedef struct LocationId { - CellInfo_t cellInfo; - Status_t status; - /* + /* LocationId */ + typedef struct LocationId + { + CellInfo_t cellInfo; + Status_t status; + /* * This type is extensible, * possible extensions are below. */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} LocationId_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_LocationId; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } LocationId_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_LocationId; #ifdef __cplusplus } #endif -#endif /* _LocationId_H_ */ +#endif /* _LocationId_H_ */ #include diff --git a/src/core/libs/supl/asn-supl/MAC.h b/src/core/libs/supl/asn-supl/MAC.h index 178896171..27a57977b 100644 --- a/src/core/libs/supl/asn-supl/MAC.h +++ b/src/core/libs/supl/asn-supl/MAC.h @@ -4,8 +4,8 @@ * found in "../supl-init.asn" */ -#ifndef _MAC_H_ -#define _MAC_H_ +#ifndef _MAC_H_ +#define _MAC_H_ #include @@ -14,27 +14,28 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* MAC */ -typedef BIT_STRING_t MAC_t; + /* MAC */ + typedef BIT_STRING_t MAC_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_MAC; -asn_struct_free_f MAC_free; -asn_struct_print_f MAC_print; -asn_constr_check_f MAC_constraint; -ber_type_decoder_f MAC_decode_ber; -der_type_encoder_f MAC_encode_der; -xer_type_decoder_f MAC_decode_xer; -xer_type_encoder_f MAC_encode_xer; -per_type_decoder_f MAC_decode_uper; -per_type_encoder_f MAC_encode_uper; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_MAC; + asn_struct_free_f MAC_free; + asn_struct_print_f MAC_print; + asn_constr_check_f MAC_constraint; + ber_type_decoder_f MAC_decode_ber; + der_type_encoder_f MAC_encode_der; + xer_type_decoder_f MAC_decode_xer; + xer_type_encoder_f MAC_encode_xer; + per_type_decoder_f MAC_decode_uper; + per_type_encoder_f MAC_encode_uper; #ifdef __cplusplus } #endif -#endif /* _MAC_H_ */ +#endif /* _MAC_H_ */ #include diff --git a/src/core/libs/supl/asn-supl/MeasuredResults.h b/src/core/libs/supl/asn-supl/MeasuredResults.h index 29a09a839..4b082732f 100644 --- a/src/core/libs/supl/asn-supl/MeasuredResults.h +++ b/src/core/libs/supl/asn-supl/MeasuredResults.h @@ -4,8 +4,8 @@ * found in "../supl-common.asn" */ -#ifndef _MeasuredResults_H_ -#define _MeasuredResults_H_ +#ifndef _MeasuredResults_H_ +#define _MeasuredResults_H_ #include @@ -15,25 +15,27 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Forward declarations */ -struct FrequencyInfo; -struct CellMeasuredResultsList; + /* Forward declarations */ + struct FrequencyInfo; + struct CellMeasuredResultsList; -/* MeasuredResults */ -typedef struct MeasuredResults { - struct FrequencyInfo *frequencyInfo /* OPTIONAL */; - UTRA_CarrierRSSI_t *utra_CarrierRSSI /* OPTIONAL */; - struct CellMeasuredResultsList *cellMeasuredResultsList /* OPTIONAL */; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} MeasuredResults_t; + /* MeasuredResults */ + typedef struct MeasuredResults + { + struct FrequencyInfo *frequencyInfo /* OPTIONAL */; + UTRA_CarrierRSSI_t *utra_CarrierRSSI /* OPTIONAL */; + struct CellMeasuredResultsList *cellMeasuredResultsList /* OPTIONAL */; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_MeasuredResults; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } MeasuredResults_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_MeasuredResults; #ifdef __cplusplus } @@ -43,5 +45,5 @@ extern asn_TYPE_descriptor_t asn_DEF_MeasuredResults; #include "FrequencyInfo.h" #include "CellMeasuredResultsList.h" -#endif /* _MeasuredResults_H_ */ +#endif /* _MeasuredResults_H_ */ #include diff --git a/src/core/libs/supl/asn-supl/MeasuredResultsList.h b/src/core/libs/supl/asn-supl/MeasuredResultsList.h index fe174cdc4..6195c1876 100644 --- a/src/core/libs/supl/asn-supl/MeasuredResultsList.h +++ b/src/core/libs/supl/asn-supl/MeasuredResultsList.h @@ -4,8 +4,8 @@ * found in "../supl-common.asn" */ -#ifndef _MeasuredResultsList_H_ -#define _MeasuredResultsList_H_ +#ifndef _MeasuredResultsList_H_ +#define _MeasuredResultsList_H_ #include @@ -15,22 +15,25 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Forward declarations */ -struct MeasuredResults; + /* Forward declarations */ + struct MeasuredResults; -/* MeasuredResultsList */ -typedef struct MeasuredResultsList { - A_SEQUENCE_OF(struct MeasuredResults) list; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} MeasuredResultsList_t; + /* MeasuredResultsList */ + typedef struct MeasuredResultsList + { + A_SEQUENCE_OF(struct MeasuredResults) + list; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_MeasuredResultsList; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } MeasuredResultsList_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_MeasuredResultsList; #ifdef __cplusplus } @@ -39,5 +42,5 @@ extern asn_TYPE_descriptor_t asn_DEF_MeasuredResultsList; /* Referred external types */ #include "MeasuredResults.h" -#endif /* _MeasuredResultsList_H_ */ +#endif /* _MeasuredResultsList_H_ */ #include diff --git a/src/core/libs/supl/asn-supl/NMR.h b/src/core/libs/supl/asn-supl/NMR.h index de1916002..629681368 100644 --- a/src/core/libs/supl/asn-supl/NMR.h +++ b/src/core/libs/supl/asn-supl/NMR.h @@ -4,8 +4,8 @@ * found in "../supl-common.asn" */ -#ifndef _NMR_H_ -#define _NMR_H_ +#ifndef _NMR_H_ +#define _NMR_H_ #include @@ -15,22 +15,25 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Forward declarations */ -struct NMRelement; + /* Forward declarations */ + struct NMRelement; -/* NMR */ -typedef struct NMR { - A_SEQUENCE_OF(struct NMRelement) list; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} NMR_t; + /* NMR */ + typedef struct NMR + { + A_SEQUENCE_OF(struct NMRelement) + list; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_NMR; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } NMR_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_NMR; #ifdef __cplusplus } @@ -39,5 +42,5 @@ extern asn_TYPE_descriptor_t asn_DEF_NMR; /* Referred external types */ #include "NMRelement.h" -#endif /* _NMR_H_ */ +#endif /* _NMR_H_ */ #include diff --git a/src/core/libs/supl/asn-supl/NMRelement.h b/src/core/libs/supl/asn-supl/NMRelement.h index aa0873bb0..1ea9d3b5e 100644 --- a/src/core/libs/supl/asn-supl/NMRelement.h +++ b/src/core/libs/supl/asn-supl/NMRelement.h @@ -4,8 +4,8 @@ * found in "../supl-common.asn" */ -#ifndef _NMRelement_H_ -#define _NMRelement_H_ +#ifndef _NMRelement_H_ +#define _NMRelement_H_ #include @@ -15,29 +15,31 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* NMRelement */ -typedef struct NMRelement { - long aRFCN; - long bSIC; - long rxLev; - /* + /* NMRelement */ + typedef struct NMRelement + { + long aRFCN; + long bSIC; + long rxLev; + /* * This type is extensible, * possible extensions are below. */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} NMRelement_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_NMRelement; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } NMRelement_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_NMRelement; #ifdef __cplusplus } #endif -#endif /* _NMRelement_H_ */ +#endif /* _NMRelement_H_ */ #include diff --git a/src/core/libs/supl/asn-supl/NativeEnumerated.h b/src/core/libs/supl/asn-supl/NativeEnumerated.h index c59bb1ba9..3b3d4b074 100644 --- a/src/core/libs/supl/asn-supl/NativeEnumerated.h +++ b/src/core/libs/supl/asn-supl/NativeEnumerated.h @@ -10,23 +10,24 @@ * will do). * This type may be used when integer range is limited by subtype constraints. */ -#ifndef _NativeEnumerated_H_ -#define _NativeEnumerated_H_ +#ifndef _NativeEnumerated_H_ +#define _NativeEnumerated_H_ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -extern asn_TYPE_descriptor_t asn_DEF_NativeEnumerated; + extern asn_TYPE_descriptor_t asn_DEF_NativeEnumerated; -xer_type_encoder_f NativeEnumerated_encode_xer; -per_type_decoder_f NativeEnumerated_decode_uper; -per_type_encoder_f NativeEnumerated_encode_uper; + xer_type_encoder_f NativeEnumerated_encode_xer; + per_type_decoder_f NativeEnumerated_decode_uper; + per_type_encoder_f NativeEnumerated_encode_uper; #ifdef __cplusplus } #endif -#endif /* _NativeEnumerated_H_ */ +#endif /* _NativeEnumerated_H_ */ diff --git a/src/core/libs/supl/asn-supl/NativeInteger.h b/src/core/libs/supl/asn-supl/NativeInteger.h index 4e63a8355..14311ae57 100644 --- a/src/core/libs/supl/asn-supl/NativeInteger.h +++ b/src/core/libs/supl/asn-supl/NativeInteger.h @@ -9,29 +9,30 @@ * will do). * This type may be used when integer range is limited by subtype constraints. */ -#ifndef _NativeInteger_H_ -#define _NativeInteger_H_ +#ifndef _NativeInteger_H_ +#define _NativeInteger_H_ #include #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -extern asn_TYPE_descriptor_t asn_DEF_NativeInteger; + extern asn_TYPE_descriptor_t asn_DEF_NativeInteger; -asn_struct_free_f NativeInteger_free; -asn_struct_print_f NativeInteger_print; -ber_type_decoder_f NativeInteger_decode_ber; -der_type_encoder_f NativeInteger_encode_der; -xer_type_decoder_f NativeInteger_decode_xer; -xer_type_encoder_f NativeInteger_encode_xer; -per_type_decoder_f NativeInteger_decode_uper; -per_type_encoder_f NativeInteger_encode_uper; + asn_struct_free_f NativeInteger_free; + asn_struct_print_f NativeInteger_print; + ber_type_decoder_f NativeInteger_decode_ber; + der_type_encoder_f NativeInteger_encode_der; + xer_type_decoder_f NativeInteger_decode_xer; + xer_type_encoder_f NativeInteger_encode_xer; + per_type_decoder_f NativeInteger_decode_uper; + per_type_encoder_f NativeInteger_encode_uper; #ifdef __cplusplus } #endif -#endif /* _NativeInteger_H_ */ +#endif /* _NativeInteger_H_ */ diff --git a/src/core/libs/supl/asn-supl/Notification.h b/src/core/libs/supl/asn-supl/Notification.h index 696de7da6..5e2f488ee 100644 --- a/src/core/libs/supl/asn-supl/Notification.h +++ b/src/core/libs/supl/asn-supl/Notification.h @@ -4,8 +4,8 @@ * found in "../supl-init.asn" */ -#ifndef _Notification_H_ -#define _Notification_H_ +#ifndef _Notification_H_ +#define _Notification_H_ #include @@ -18,32 +18,34 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Notification */ -typedef struct Notification { - NotificationType_t notificationType; - EncodingType_t *encodingType /* OPTIONAL */; - OCTET_STRING_t *requestorId /* OPTIONAL */; - FormatIndicator_t *requestorIdType /* OPTIONAL */; - OCTET_STRING_t *clientName /* OPTIONAL */; - FormatIndicator_t *clientNameType /* OPTIONAL */; - /* + /* Notification */ + typedef struct Notification + { + NotificationType_t notificationType; + EncodingType_t *encodingType /* OPTIONAL */; + OCTET_STRING_t *requestorId /* OPTIONAL */; + FormatIndicator_t *requestorIdType /* OPTIONAL */; + OCTET_STRING_t *clientName /* OPTIONAL */; + FormatIndicator_t *clientNameType /* OPTIONAL */; + /* * This type is extensible, * possible extensions are below. */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} Notification_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_Notification; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } Notification_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_Notification; #ifdef __cplusplus } #endif -#endif /* _Notification_H_ */ +#endif /* _Notification_H_ */ #include diff --git a/src/core/libs/supl/asn-supl/NotificationType.h b/src/core/libs/supl/asn-supl/NotificationType.h index 939b259ca..24012dbcf 100644 --- a/src/core/libs/supl/asn-supl/NotificationType.h +++ b/src/core/libs/supl/asn-supl/NotificationType.h @@ -4,8 +4,8 @@ * found in "../supl-init.asn" */ -#ifndef _NotificationType_H_ -#define _NotificationType_H_ +#ifndef _NotificationType_H_ +#define _NotificationType_H_ #include @@ -14,39 +14,41 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Dependencies */ -typedef enum NotificationType { - NotificationType_noNotificationNoVerification = 0, - NotificationType_notificationOnly = 1, - NotificationType_notificationAndVerficationAllowedNA = 2, - NotificationType_notificationAndVerficationDeniedNA = 3, - NotificationType_privacyOverride = 4 - /* + /* Dependencies */ + typedef enum NotificationType + { + NotificationType_noNotificationNoVerification = 0, + NotificationType_notificationOnly = 1, + NotificationType_notificationAndVerficationAllowedNA = 2, + NotificationType_notificationAndVerficationDeniedNA = 3, + NotificationType_privacyOverride = 4 + /* * Enumeration is extensible */ -} e_NotificationType; + } e_NotificationType; -/* NotificationType */ -typedef ENUMERATED_t NotificationType_t; + /* NotificationType */ + typedef ENUMERATED_t NotificationType_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_NotificationType; -asn_struct_free_f NotificationType_free; -asn_struct_print_f NotificationType_print; -asn_constr_check_f NotificationType_constraint; -ber_type_decoder_f NotificationType_decode_ber; -der_type_encoder_f NotificationType_encode_der; -xer_type_decoder_f NotificationType_decode_xer; -xer_type_encoder_f NotificationType_encode_xer; -per_type_decoder_f NotificationType_decode_uper; -per_type_encoder_f NotificationType_encode_uper; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_NotificationType; + asn_struct_free_f NotificationType_free; + asn_struct_print_f NotificationType_print; + asn_constr_check_f NotificationType_constraint; + ber_type_decoder_f NotificationType_decode_ber; + der_type_encoder_f NotificationType_encode_der; + xer_type_decoder_f NotificationType_decode_xer; + xer_type_encoder_f NotificationType_encode_xer; + per_type_decoder_f NotificationType_decode_uper; + per_type_encoder_f NotificationType_encode_uper; #ifdef __cplusplus } #endif -#endif /* _NotificationType_H_ */ +#endif /* _NotificationType_H_ */ #include diff --git a/src/core/libs/supl/asn-supl/OCTET_STRING.h b/src/core/libs/supl/asn-supl/OCTET_STRING.h index 8df9a182d..124fde559 100644 --- a/src/core/libs/supl/asn-supl/OCTET_STRING.h +++ b/src/core/libs/supl/asn-supl/OCTET_STRING.h @@ -2,42 +2,44 @@ * Copyright (c) 2003 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ -#ifndef _OCTET_STRING_H_ -#define _OCTET_STRING_H_ +#ifndef _OCTET_STRING_H_ +#define _OCTET_STRING_H_ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -typedef struct OCTET_STRING { - uint8_t *buf; /* Buffer with consecutive OCTET_STRING bits */ - int size; /* Size of the buffer */ + typedef struct OCTET_STRING + { + uint8_t *buf; /* Buffer with consecutive OCTET_STRING bits */ + int size; /* Size of the buffer */ - asn_struct_ctx_t _asn_ctx; /* Parsing across buffer boundaries */ -} OCTET_STRING_t; + asn_struct_ctx_t _asn_ctx; /* Parsing across buffer boundaries */ + } OCTET_STRING_t; -extern asn_TYPE_descriptor_t asn_DEF_OCTET_STRING; + extern asn_TYPE_descriptor_t asn_DEF_OCTET_STRING; -asn_struct_free_f OCTET_STRING_free; -asn_struct_print_f OCTET_STRING_print; -asn_struct_print_f OCTET_STRING_print_utf8; -ber_type_decoder_f OCTET_STRING_decode_ber; -der_type_encoder_f OCTET_STRING_encode_der; -xer_type_decoder_f OCTET_STRING_decode_xer_hex; /* Hexadecimal */ -xer_type_decoder_f OCTET_STRING_decode_xer_binary; /* 01010111010 */ -xer_type_decoder_f OCTET_STRING_decode_xer_utf8; /* ASCII/UTF-8 */ -xer_type_encoder_f OCTET_STRING_encode_xer; -xer_type_encoder_f OCTET_STRING_encode_xer_utf8; -per_type_decoder_f OCTET_STRING_decode_uper; -per_type_encoder_f OCTET_STRING_encode_uper; + asn_struct_free_f OCTET_STRING_free; + asn_struct_print_f OCTET_STRING_print; + asn_struct_print_f OCTET_STRING_print_utf8; + ber_type_decoder_f OCTET_STRING_decode_ber; + der_type_encoder_f OCTET_STRING_encode_der; + xer_type_decoder_f OCTET_STRING_decode_xer_hex; /* Hexadecimal */ + xer_type_decoder_f OCTET_STRING_decode_xer_binary; /* 01010111010 */ + xer_type_decoder_f OCTET_STRING_decode_xer_utf8; /* ASCII/UTF-8 */ + xer_type_encoder_f OCTET_STRING_encode_xer; + xer_type_encoder_f OCTET_STRING_encode_xer_utf8; + per_type_decoder_f OCTET_STRING_decode_uper; + per_type_encoder_f OCTET_STRING_encode_uper; -/****************************** + /****************************** * Handy conversion routines. * ******************************/ -/* + /* * This function clears the previous value of the OCTET STRING (if any) * and then allocates a new memory with the specified content (str/size). * If size = -1, the size of the original string will be determined @@ -46,41 +48,43 @@ per_type_encoder_f OCTET_STRING_encode_uper; * current contents of the OCTET STRING. * Returns 0 if it was possible to perform operation, -1 otherwise. */ -int OCTET_STRING_fromBuf(OCTET_STRING_t *s, const char *str, int size); + int OCTET_STRING_fromBuf(OCTET_STRING_t *s, const char *str, int size); /* Handy conversion from the C string into the OCTET STRING. */ -#define OCTET_STRING_fromString(s, str) OCTET_STRING_fromBuf(s, str, -1) +#define OCTET_STRING_fromString(s, str) OCTET_STRING_fromBuf(s, str, -1) -/* + /* * Allocate and fill the new OCTET STRING and return a pointer to the newly * allocated object. NULL is permitted in str: the function will just allocate * empty OCTET STRING. */ -OCTET_STRING_t *OCTET_STRING_new_fromBuf(asn_TYPE_descriptor_t *td, - const char *str, int size); + OCTET_STRING_t *OCTET_STRING_new_fromBuf(asn_TYPE_descriptor_t *td, + const char *str, int size); -/**************************** + /**************************** * Internally useful stuff. * ****************************/ -typedef struct asn_OCTET_STRING_specifics_s { - /* + typedef struct asn_OCTET_STRING_specifics_s + { + /* * Target structure description. */ - int struct_size; /* Size of the structure */ - int ctx_offset; /* Offset of the asn_struct_ctx_t member */ + int struct_size; /* Size of the structure */ + int ctx_offset; /* Offset of the asn_struct_ctx_t member */ - enum asn_OS_Subvariant { - ASN_OSUBV_ANY, /* The open type (ANY) */ - ASN_OSUBV_BIT, /* BIT STRING */ - ASN_OSUBV_STR, /* String types, not {BMP,Universal}String */ - ASN_OSUBV_U16, /* 16-bit character (BMPString) */ - ASN_OSUBV_U32 /* 32-bit character (UniversalString) */ - } subvariant; -} asn_OCTET_STRING_specifics_t; + enum asn_OS_Subvariant + { + ASN_OSUBV_ANY, /* The open type (ANY) */ + ASN_OSUBV_BIT, /* BIT STRING */ + ASN_OSUBV_STR, /* String types, not {BMP,Universal}String */ + ASN_OSUBV_U16, /* 16-bit character (BMPString) */ + ASN_OSUBV_U32 /* 32-bit character (UniversalString) */ + } subvariant; + } asn_OCTET_STRING_specifics_t; #ifdef __cplusplus } #endif -#endif /* _OCTET_STRING_H_ */ +#endif /* _OCTET_STRING_H_ */ diff --git a/src/core/libs/supl/asn-supl/Pathloss.h b/src/core/libs/supl/asn-supl/Pathloss.h index b7cf2c5fc..e0f0aa474 100644 --- a/src/core/libs/supl/asn-supl/Pathloss.h +++ b/src/core/libs/supl/asn-supl/Pathloss.h @@ -4,8 +4,8 @@ * found in "../supl-common.asn" */ -#ifndef _Pathloss_H_ -#define _Pathloss_H_ +#ifndef _Pathloss_H_ +#define _Pathloss_H_ #include @@ -14,27 +14,28 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Pathloss */ -typedef long Pathloss_t; + /* Pathloss */ + typedef long Pathloss_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_Pathloss; -asn_struct_free_f Pathloss_free; -asn_struct_print_f Pathloss_print; -asn_constr_check_f Pathloss_constraint; -ber_type_decoder_f Pathloss_decode_ber; -der_type_encoder_f Pathloss_encode_der; -xer_type_decoder_f Pathloss_decode_xer; -xer_type_encoder_f Pathloss_encode_xer; -per_type_decoder_f Pathloss_decode_uper; -per_type_encoder_f Pathloss_encode_uper; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_Pathloss; + asn_struct_free_f Pathloss_free; + asn_struct_print_f Pathloss_print; + asn_constr_check_f Pathloss_constraint; + ber_type_decoder_f Pathloss_decode_ber; + der_type_encoder_f Pathloss_encode_der; + xer_type_decoder_f Pathloss_decode_xer; + xer_type_encoder_f Pathloss_encode_xer; + per_type_decoder_f Pathloss_decode_uper; + per_type_encoder_f Pathloss_encode_uper; #ifdef __cplusplus } #endif -#endif /* _Pathloss_H_ */ +#endif /* _Pathloss_H_ */ #include diff --git a/src/core/libs/supl/asn-supl/PosMethod.h b/src/core/libs/supl/asn-supl/PosMethod.h index 89d77b330..e34dd5a14 100644 --- a/src/core/libs/supl/asn-supl/PosMethod.h +++ b/src/core/libs/supl/asn-supl/PosMethod.h @@ -4,8 +4,8 @@ * found in "../supl-common.asn" */ -#ifndef _PosMethod_H_ -#define _PosMethod_H_ +#ifndef _PosMethod_H_ +#define _PosMethod_H_ #include @@ -14,44 +14,46 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Dependencies */ -typedef enum PosMethod { - PosMethod_agpsSETassisted = 0, - PosMethod_agpsSETbased = 1, - PosMethod_agpsSETassistedpref = 2, - PosMethod_agpsSETbasedpref = 3, - PosMethod_autonomousGPS = 4, - PosMethod_aFLT = 5, - PosMethod_eCID = 6, - PosMethod_eOTD = 7, - PosMethod_oTDOA = 8, - PosMethod_noPosition = 9 - /* + /* Dependencies */ + typedef enum PosMethod + { + PosMethod_agpsSETassisted = 0, + PosMethod_agpsSETbased = 1, + PosMethod_agpsSETassistedpref = 2, + PosMethod_agpsSETbasedpref = 3, + PosMethod_autonomousGPS = 4, + PosMethod_aFLT = 5, + PosMethod_eCID = 6, + PosMethod_eOTD = 7, + PosMethod_oTDOA = 8, + PosMethod_noPosition = 9 + /* * Enumeration is extensible */ -} e_PosMethod; + } e_PosMethod; -/* PosMethod */ -typedef ENUMERATED_t PosMethod_t; + /* PosMethod */ + typedef ENUMERATED_t PosMethod_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_PosMethod; -asn_struct_free_f PosMethod_free; -asn_struct_print_f PosMethod_print; -asn_constr_check_f PosMethod_constraint; -ber_type_decoder_f PosMethod_decode_ber; -der_type_encoder_f PosMethod_encode_der; -xer_type_decoder_f PosMethod_decode_xer; -xer_type_encoder_f PosMethod_encode_xer; -per_type_decoder_f PosMethod_decode_uper; -per_type_encoder_f PosMethod_encode_uper; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_PosMethod; + asn_struct_free_f PosMethod_free; + asn_struct_print_f PosMethod_print; + asn_constr_check_f PosMethod_constraint; + ber_type_decoder_f PosMethod_decode_ber; + der_type_encoder_f PosMethod_encode_der; + xer_type_decoder_f PosMethod_decode_xer; + xer_type_encoder_f PosMethod_encode_xer; + per_type_decoder_f PosMethod_decode_uper; + per_type_encoder_f PosMethod_encode_uper; #ifdef __cplusplus } #endif -#endif /* _PosMethod_H_ */ +#endif /* _PosMethod_H_ */ #include diff --git a/src/core/libs/supl/asn-supl/PosPayLoad.h b/src/core/libs/supl/asn-supl/PosPayLoad.h index c72c012e7..66c03457d 100644 --- a/src/core/libs/supl/asn-supl/PosPayLoad.h +++ b/src/core/libs/supl/asn-supl/PosPayLoad.h @@ -4,8 +4,8 @@ * found in "../supl-pos.asn" */ -#ifndef _PosPayLoad_H_ -#define _PosPayLoad_H_ +#ifndef _PosPayLoad_H_ +#define _PosPayLoad_H_ #include @@ -15,42 +15,46 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Dependencies */ -typedef enum PosPayLoad_PR { - PosPayLoad_PR_NOTHING, /* No components present */ - PosPayLoad_PR_tia801payload, - PosPayLoad_PR_rrcPayload, - PosPayLoad_PR_rrlpPayload, - /* Extensions may appear below */ - -} PosPayLoad_PR; + /* Dependencies */ + typedef enum PosPayLoad_PR + { + PosPayLoad_PR_NOTHING, /* No components present */ + PosPayLoad_PR_tia801payload, + PosPayLoad_PR_rrcPayload, + PosPayLoad_PR_rrlpPayload, + /* Extensions may appear below */ -/* PosPayLoad */ -typedef struct PosPayLoad { - PosPayLoad_PR present; - union PosPayLoad_u { - OCTET_STRING_t tia801payload; - OCTET_STRING_t rrcPayload; - OCTET_STRING_t rrlpPayload; - /* + } PosPayLoad_PR; + + /* PosPayLoad */ + typedef struct PosPayLoad + { + PosPayLoad_PR present; + union PosPayLoad_u + { + OCTET_STRING_t tia801payload; + OCTET_STRING_t rrcPayload; + OCTET_STRING_t rrlpPayload; + /* * This type is extensible, * possible extensions are below. */ - } choice; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} PosPayLoad_t; + } choice; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_PosPayLoad; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } PosPayLoad_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_PosPayLoad; #ifdef __cplusplus } #endif -#endif /* _PosPayLoad_H_ */ +#endif /* _PosPayLoad_H_ */ #include diff --git a/src/core/libs/supl/asn-supl/PosProtocol.h b/src/core/libs/supl/asn-supl/PosProtocol.h index d22e9cf41..a53abed35 100644 --- a/src/core/libs/supl/asn-supl/PosProtocol.h +++ b/src/core/libs/supl/asn-supl/PosProtocol.h @@ -4,8 +4,8 @@ * found in "../supl-start.asn" */ -#ifndef _PosProtocol_H_ -#define _PosProtocol_H_ +#ifndef _PosProtocol_H_ +#define _PosProtocol_H_ #include @@ -15,29 +15,31 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* PosProtocol */ -typedef struct PosProtocol { - BOOLEAN_t tia801; - BOOLEAN_t rrlp; - BOOLEAN_t rrc; - /* + /* PosProtocol */ + typedef struct PosProtocol + { + BOOLEAN_t tia801; + BOOLEAN_t rrlp; + BOOLEAN_t rrc; + /* * This type is extensible, * possible extensions are below. */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} PosProtocol_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_PosProtocol; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } PosProtocol_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_PosProtocol; #ifdef __cplusplus } #endif -#endif /* _PosProtocol_H_ */ +#endif /* _PosProtocol_H_ */ #include diff --git a/src/core/libs/supl/asn-supl/PosTechnology.h b/src/core/libs/supl/asn-supl/PosTechnology.h index 70f2700f2..dcf3ea1c3 100644 --- a/src/core/libs/supl/asn-supl/PosTechnology.h +++ b/src/core/libs/supl/asn-supl/PosTechnology.h @@ -4,8 +4,8 @@ * found in "../supl-start.asn" */ -#ifndef _PosTechnology_H_ -#define _PosTechnology_H_ +#ifndef _PosTechnology_H_ +#define _PosTechnology_H_ #include @@ -15,33 +15,35 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* PosTechnology */ -typedef struct PosTechnology { - BOOLEAN_t agpsSETassisted; - BOOLEAN_t agpsSETBased; - BOOLEAN_t autonomousGPS; - BOOLEAN_t aFLT; - BOOLEAN_t eCID; - BOOLEAN_t eOTD; - BOOLEAN_t oTDOA; - /* + /* PosTechnology */ + typedef struct PosTechnology + { + BOOLEAN_t agpsSETassisted; + BOOLEAN_t agpsSETBased; + BOOLEAN_t autonomousGPS; + BOOLEAN_t aFLT; + BOOLEAN_t eCID; + BOOLEAN_t eOTD; + BOOLEAN_t oTDOA; + /* * This type is extensible, * possible extensions are below. */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} PosTechnology_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_PosTechnology; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } PosTechnology_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_PosTechnology; #ifdef __cplusplus } #endif -#endif /* _PosTechnology_H_ */ +#endif /* _PosTechnology_H_ */ #include diff --git a/src/core/libs/supl/asn-supl/Position.h b/src/core/libs/supl/asn-supl/Position.h index a56fb2eb4..20306a91f 100644 --- a/src/core/libs/supl/asn-supl/Position.h +++ b/src/core/libs/supl/asn-supl/Position.h @@ -4,8 +4,8 @@ * found in "../supl-common.asn" */ -#ifndef _Position_H_ -#define _Position_H_ +#ifndef _Position_H_ +#define _Position_H_ #include @@ -16,28 +16,30 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Forward declarations */ -struct Velocity; + /* Forward declarations */ + struct Velocity; -/* Position */ -typedef struct Position { - UTCTime_t timestamp; - PositionEstimate_t positionEstimate; - struct Velocity *velocity /* OPTIONAL */; - /* + /* Position */ + typedef struct Position + { + UTCTime_t timestamp; + PositionEstimate_t positionEstimate; + struct Velocity *velocity /* OPTIONAL */; + /* * This type is extensible, * possible extensions are below. */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} Position_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_Position; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } Position_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_Position; #ifdef __cplusplus } @@ -46,5 +48,5 @@ extern asn_TYPE_descriptor_t asn_DEF_Position; /* Referred external types */ #include "Velocity.h" -#endif /* _Position_H_ */ +#endif /* _Position_H_ */ #include diff --git a/src/core/libs/supl/asn-supl/PositionEstimate.h b/src/core/libs/supl/asn-supl/PositionEstimate.h index d3faa7619..d4d48ae55 100644 --- a/src/core/libs/supl/asn-supl/PositionEstimate.h +++ b/src/core/libs/supl/asn-supl/PositionEstimate.h @@ -4,8 +4,8 @@ * found in "../supl-common.asn" */ -#ifndef _PositionEstimate_H_ -#define _PositionEstimate_H_ +#ifndef _PositionEstimate_H_ +#define _PositionEstimate_H_ #include @@ -16,45 +16,49 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Dependencies */ -typedef enum latitudeSign { - latitudeSign_north = 0, - latitudeSign_south = 1 -} e_latitudeSign; + /* Dependencies */ + typedef enum latitudeSign + { + latitudeSign_north = 0, + latitudeSign_south = 1 + } e_latitudeSign; -/* Forward declarations */ -struct AltitudeInfo; + /* Forward declarations */ + struct AltitudeInfo; -/* PositionEstimate */ -typedef struct PositionEstimate { - ENUMERATED_t latitudeSign; - long latitude; - long longitude; - struct uncertainty { - long uncertaintySemiMajor; - long uncertaintySemiMinor; - long orientationMajorAxis; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; - } *uncertainty; - long *confidence /* OPTIONAL */; - struct AltitudeInfo *altitudeInfo /* OPTIONAL */; - /* + /* PositionEstimate */ + typedef struct PositionEstimate + { + ENUMERATED_t latitudeSign; + long latitude; + long longitude; + struct uncertainty + { + long uncertaintySemiMajor; + long uncertaintySemiMinor; + long orientationMajorAxis; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } * uncertainty; + long *confidence /* OPTIONAL */; + struct AltitudeInfo *altitudeInfo /* OPTIONAL */; + /* * This type is extensible, * possible extensions are below. */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} PositionEstimate_t; -/* Implementation */ -/* extern asn_TYPE_descriptor_t asn_DEF_latitudeSign_2; // (Use -fall-defs-global to expose) */ -extern asn_TYPE_descriptor_t asn_DEF_PositionEstimate; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } PositionEstimate_t; + + /* Implementation */ + /* extern asn_TYPE_descriptor_t asn_DEF_latitudeSign_2; // (Use -fall-defs-global to expose) */ + extern asn_TYPE_descriptor_t asn_DEF_PositionEstimate; #ifdef __cplusplus } @@ -63,5 +67,5 @@ extern asn_TYPE_descriptor_t asn_DEF_PositionEstimate; /* Referred external types */ #include "AltitudeInfo.h" -#endif /* _PositionEstimate_H_ */ +#endif /* _PositionEstimate_H_ */ #include diff --git a/src/core/libs/supl/asn-supl/PrefMethod.h b/src/core/libs/supl/asn-supl/PrefMethod.h index af3786945..39c343074 100644 --- a/src/core/libs/supl/asn-supl/PrefMethod.h +++ b/src/core/libs/supl/asn-supl/PrefMethod.h @@ -4,8 +4,8 @@ * found in "../supl-start.asn" */ -#ifndef _PrefMethod_H_ -#define _PrefMethod_H_ +#ifndef _PrefMethod_H_ +#define _PrefMethod_H_ #include @@ -14,34 +14,36 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Dependencies */ -typedef enum PrefMethod { - PrefMethod_agpsSETassistedPreferred = 0, - PrefMethod_agpsSETBasedPreferred = 1, - PrefMethod_noPreference = 2 -} e_PrefMethod; + /* Dependencies */ + typedef enum PrefMethod + { + PrefMethod_agpsSETassistedPreferred = 0, + PrefMethod_agpsSETBasedPreferred = 1, + PrefMethod_noPreference = 2 + } e_PrefMethod; -/* PrefMethod */ -typedef ENUMERATED_t PrefMethod_t; + /* PrefMethod */ + typedef ENUMERATED_t PrefMethod_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_PrefMethod; -asn_struct_free_f PrefMethod_free; -asn_struct_print_f PrefMethod_print; -asn_constr_check_f PrefMethod_constraint; -ber_type_decoder_f PrefMethod_decode_ber; -der_type_encoder_f PrefMethod_encode_der; -xer_type_decoder_f PrefMethod_decode_xer; -xer_type_encoder_f PrefMethod_encode_xer; -per_type_decoder_f PrefMethod_decode_uper; -per_type_encoder_f PrefMethod_encode_uper; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_PrefMethod; + asn_struct_free_f PrefMethod_free; + asn_struct_print_f PrefMethod_print; + asn_constr_check_f PrefMethod_constraint; + ber_type_decoder_f PrefMethod_decode_ber; + der_type_encoder_f PrefMethod_encode_der; + xer_type_decoder_f PrefMethod_decode_xer; + xer_type_encoder_f PrefMethod_encode_xer; + per_type_decoder_f PrefMethod_decode_uper; + per_type_encoder_f PrefMethod_encode_uper; #ifdef __cplusplus } #endif -#endif /* _PrefMethod_H_ */ +#endif /* _PrefMethod_H_ */ #include diff --git a/src/core/libs/supl/asn-supl/PrimaryCCPCH-RSCP.h b/src/core/libs/supl/asn-supl/PrimaryCCPCH-RSCP.h index be672bc37..a425a2daf 100644 --- a/src/core/libs/supl/asn-supl/PrimaryCCPCH-RSCP.h +++ b/src/core/libs/supl/asn-supl/PrimaryCCPCH-RSCP.h @@ -4,8 +4,8 @@ * found in "../supl-common.asn" */ -#ifndef _PrimaryCCPCH_RSCP_H_ -#define _PrimaryCCPCH_RSCP_H_ +#ifndef _PrimaryCCPCH_RSCP_H_ +#define _PrimaryCCPCH_RSCP_H_ #include @@ -14,27 +14,28 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* PrimaryCCPCH-RSCP */ -typedef long PrimaryCCPCH_RSCP_t; + /* PrimaryCCPCH-RSCP */ + typedef long PrimaryCCPCH_RSCP_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_PrimaryCCPCH_RSCP; -asn_struct_free_f PrimaryCCPCH_RSCP_free; -asn_struct_print_f PrimaryCCPCH_RSCP_print; -asn_constr_check_f PrimaryCCPCH_RSCP_constraint; -ber_type_decoder_f PrimaryCCPCH_RSCP_decode_ber; -der_type_encoder_f PrimaryCCPCH_RSCP_encode_der; -xer_type_decoder_f PrimaryCCPCH_RSCP_decode_xer; -xer_type_encoder_f PrimaryCCPCH_RSCP_encode_xer; -per_type_decoder_f PrimaryCCPCH_RSCP_decode_uper; -per_type_encoder_f PrimaryCCPCH_RSCP_encode_uper; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_PrimaryCCPCH_RSCP; + asn_struct_free_f PrimaryCCPCH_RSCP_free; + asn_struct_print_f PrimaryCCPCH_RSCP_print; + asn_constr_check_f PrimaryCCPCH_RSCP_constraint; + ber_type_decoder_f PrimaryCCPCH_RSCP_decode_ber; + der_type_encoder_f PrimaryCCPCH_RSCP_encode_der; + xer_type_decoder_f PrimaryCCPCH_RSCP_decode_xer; + xer_type_encoder_f PrimaryCCPCH_RSCP_encode_xer; + per_type_decoder_f PrimaryCCPCH_RSCP_decode_uper; + per_type_encoder_f PrimaryCCPCH_RSCP_encode_uper; #ifdef __cplusplus } #endif -#endif /* _PrimaryCCPCH_RSCP_H_ */ +#endif /* _PrimaryCCPCH_RSCP_H_ */ #include diff --git a/src/core/libs/supl/asn-supl/PrimaryCPICH-Info.h b/src/core/libs/supl/asn-supl/PrimaryCPICH-Info.h index 79aeef11d..aceb12991 100644 --- a/src/core/libs/supl/asn-supl/PrimaryCPICH-Info.h +++ b/src/core/libs/supl/asn-supl/PrimaryCPICH-Info.h @@ -4,8 +4,8 @@ * found in "../supl-common.asn" */ -#ifndef _PrimaryCPICH_Info_H_ -#define _PrimaryCPICH_Info_H_ +#ifndef _PrimaryCPICH_Info_H_ +#define _PrimaryCPICH_Info_H_ #include @@ -15,23 +15,25 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* PrimaryCPICH-Info */ -typedef struct PrimaryCPICH_Info { - long primaryScramblingCode; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} PrimaryCPICH_Info_t; + /* PrimaryCPICH-Info */ + typedef struct PrimaryCPICH_Info + { + long primaryScramblingCode; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_PrimaryCPICH_Info; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } PrimaryCPICH_Info_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_PrimaryCPICH_Info; #ifdef __cplusplus } #endif -#endif /* _PrimaryCPICH_Info_H_ */ +#endif /* _PrimaryCPICH_Info_H_ */ #include diff --git a/src/core/libs/supl/asn-supl/QoP.h b/src/core/libs/supl/asn-supl/QoP.h index 3ebcfdcb4..2249a2a15 100644 --- a/src/core/libs/supl/asn-supl/QoP.h +++ b/src/core/libs/supl/asn-supl/QoP.h @@ -4,8 +4,8 @@ * found in "../supl-common.asn" */ -#ifndef _QoP_H_ -#define _QoP_H_ +#ifndef _QoP_H_ +#define _QoP_H_ #include @@ -15,30 +15,32 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* QoP */ -typedef struct QoP { - long horacc; - long *veracc /* OPTIONAL */; - long *maxLocAge /* OPTIONAL */; - long *delay /* OPTIONAL */; - /* + /* QoP */ + typedef struct QoP + { + long horacc; + long *veracc /* OPTIONAL */; + long *maxLocAge /* OPTIONAL */; + long *delay /* OPTIONAL */; + /* * This type is extensible, * possible extensions are below. */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} QoP_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_QoP; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } QoP_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_QoP; #ifdef __cplusplus } #endif -#endif /* _QoP_H_ */ +#endif /* _QoP_H_ */ #include diff --git a/src/core/libs/supl/asn-supl/RequestedAssistData.h b/src/core/libs/supl/asn-supl/RequestedAssistData.h index 4e4dfac2f..5341cc072 100644 --- a/src/core/libs/supl/asn-supl/RequestedAssistData.h +++ b/src/core/libs/supl/asn-supl/RequestedAssistData.h @@ -4,8 +4,8 @@ * found in "../supl-posinit.asn" */ -#ifndef _RequestedAssistData_H_ -#define _RequestedAssistData_H_ +#ifndef _RequestedAssistData_H_ +#define _RequestedAssistData_H_ #include @@ -15,35 +15,37 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Forward declarations */ -struct XNavigationModel; + /* Forward declarations */ + struct XNavigationModel; -/* RequestedAssistData */ -typedef struct RequestedAssistData { - BOOLEAN_t almanacRequested; - BOOLEAN_t utcModelRequested; - BOOLEAN_t ionosphericModelRequested; - BOOLEAN_t dgpsCorrectionsRequested; - BOOLEAN_t referenceLocationRequested; - BOOLEAN_t referenceTimeRequested; - BOOLEAN_t acquisitionAssistanceRequested; - BOOLEAN_t realTimeIntegrityRequested; - BOOLEAN_t navigationModelRequested; - struct XNavigationModel *navigationModelData /* OPTIONAL */; - /* + /* RequestedAssistData */ + typedef struct RequestedAssistData + { + BOOLEAN_t almanacRequested; + BOOLEAN_t utcModelRequested; + BOOLEAN_t ionosphericModelRequested; + BOOLEAN_t dgpsCorrectionsRequested; + BOOLEAN_t referenceLocationRequested; + BOOLEAN_t referenceTimeRequested; + BOOLEAN_t acquisitionAssistanceRequested; + BOOLEAN_t realTimeIntegrityRequested; + BOOLEAN_t navigationModelRequested; + struct XNavigationModel *navigationModelData /* OPTIONAL */; + /* * This type is extensible, * possible extensions are below. */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} RequestedAssistData_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_RequestedAssistData; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } RequestedAssistData_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_RequestedAssistData; #ifdef __cplusplus } @@ -52,5 +54,5 @@ extern asn_TYPE_descriptor_t asn_DEF_RequestedAssistData; /* Referred external types */ #include "XNavigationModel.h" -#endif /* _RequestedAssistData_H_ */ +#endif /* _RequestedAssistData_H_ */ #include diff --git a/src/core/libs/supl/asn-supl/SETAuthKey.h b/src/core/libs/supl/asn-supl/SETAuthKey.h index 29f123269..7a9fbe6fe 100644 --- a/src/core/libs/supl/asn-supl/SETAuthKey.h +++ b/src/core/libs/supl/asn-supl/SETAuthKey.h @@ -4,8 +4,8 @@ * found in "../supl-response.asn" */ -#ifndef _SETAuthKey_H_ -#define _SETAuthKey_H_ +#ifndef _SETAuthKey_H_ +#define _SETAuthKey_H_ #include @@ -15,40 +15,44 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Dependencies */ -typedef enum SETAuthKey_PR { - SETAuthKey_PR_NOTHING, /* No components present */ - SETAuthKey_PR_shortKey, - SETAuthKey_PR_longKey, - /* Extensions may appear below */ - -} SETAuthKey_PR; + /* Dependencies */ + typedef enum SETAuthKey_PR + { + SETAuthKey_PR_NOTHING, /* No components present */ + SETAuthKey_PR_shortKey, + SETAuthKey_PR_longKey, + /* Extensions may appear below */ -/* SETAuthKey */ -typedef struct SETAuthKey { - SETAuthKey_PR present; - union SETAuthKey_u { - BIT_STRING_t shortKey; - BIT_STRING_t longKey; - /* + } SETAuthKey_PR; + + /* SETAuthKey */ + typedef struct SETAuthKey + { + SETAuthKey_PR present; + union SETAuthKey_u + { + BIT_STRING_t shortKey; + BIT_STRING_t longKey; + /* * This type is extensible, * possible extensions are below. */ - } choice; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} SETAuthKey_t; + } choice; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_SETAuthKey; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } SETAuthKey_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_SETAuthKey; #ifdef __cplusplus } #endif -#endif /* _SETAuthKey_H_ */ +#endif /* _SETAuthKey_H_ */ #include diff --git a/src/core/libs/supl/asn-supl/SETCapabilities.h b/src/core/libs/supl/asn-supl/SETCapabilities.h index 84f0e8a00..f3429dab4 100644 --- a/src/core/libs/supl/asn-supl/SETCapabilities.h +++ b/src/core/libs/supl/asn-supl/SETCapabilities.h @@ -4,8 +4,8 @@ * found in "../supl-start.asn" */ -#ifndef _SETCapabilities_H_ -#define _SETCapabilities_H_ +#ifndef _SETCapabilities_H_ +#define _SETCapabilities_H_ #include @@ -17,29 +17,31 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* SETCapabilities */ -typedef struct SETCapabilities { - PosTechnology_t posTechnology; - PrefMethod_t prefMethod; - PosProtocol_t posProtocol; - /* + /* SETCapabilities */ + typedef struct SETCapabilities + { + PosTechnology_t posTechnology; + PrefMethod_t prefMethod; + PosProtocol_t posProtocol; + /* * This type is extensible, * possible extensions are below. */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} SETCapabilities_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_SETCapabilities; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } SETCapabilities_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_SETCapabilities; #ifdef __cplusplus } #endif -#endif /* _SETCapabilities_H_ */ +#endif /* _SETCapabilities_H_ */ #include diff --git a/src/core/libs/supl/asn-supl/SETId.h b/src/core/libs/supl/asn-supl/SETId.h index 096777f75..ece63df60 100644 --- a/src/core/libs/supl/asn-supl/SETId.h +++ b/src/core/libs/supl/asn-supl/SETId.h @@ -4,8 +4,8 @@ * found in "../supl-common.asn" */ -#ifndef _SETId_H_ -#define _SETId_H_ +#ifndef _SETId_H_ +#define _SETId_H_ #include @@ -18,48 +18,52 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Dependencies */ -typedef enum SETId_PR { - SETId_PR_NOTHING, /* No components present */ - SETId_PR_msisdn, - SETId_PR_mdn, - SETId_PR_min, - SETId_PR_imsi, - SETId_PR_nai, - SETId_PR_iPAddress, - /* Extensions may appear below */ - -} SETId_PR; + /* Dependencies */ + typedef enum SETId_PR + { + SETId_PR_NOTHING, /* No components present */ + SETId_PR_msisdn, + SETId_PR_mdn, + SETId_PR_min, + SETId_PR_imsi, + SETId_PR_nai, + SETId_PR_iPAddress, + /* Extensions may appear below */ -/* SETId */ -typedef struct SETId { - SETId_PR present; - union SETId_u { - OCTET_STRING_t msisdn; - OCTET_STRING_t mdn; - BIT_STRING_t min; - OCTET_STRING_t imsi; - IA5String_t nai; - IPAddress_t iPAddress; - /* + } SETId_PR; + + /* SETId */ + typedef struct SETId + { + SETId_PR present; + union SETId_u + { + OCTET_STRING_t msisdn; + OCTET_STRING_t mdn; + BIT_STRING_t min; + OCTET_STRING_t imsi; + IA5String_t nai; + IPAddress_t iPAddress; + /* * This type is extensible, * possible extensions are below. */ - } choice; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} SETId_t; + } choice; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_SETId; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } SETId_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_SETId; #ifdef __cplusplus } #endif -#endif /* _SETId_H_ */ +#endif /* _SETId_H_ */ #include diff --git a/src/core/libs/supl/asn-supl/SLPAddress.h b/src/core/libs/supl/asn-supl/SLPAddress.h index fba1f13d9..4b13147ef 100644 --- a/src/core/libs/supl/asn-supl/SLPAddress.h +++ b/src/core/libs/supl/asn-supl/SLPAddress.h @@ -4,8 +4,8 @@ * found in "../supl-common.asn" */ -#ifndef _SLPAddress_H_ -#define _SLPAddress_H_ +#ifndef _SLPAddress_H_ +#define _SLPAddress_H_ #include @@ -16,40 +16,44 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Dependencies */ -typedef enum SLPAddress_PR { - SLPAddress_PR_NOTHING, /* No components present */ - SLPAddress_PR_iPAddress, - SLPAddress_PR_fQDN, - /* Extensions may appear below */ - -} SLPAddress_PR; + /* Dependencies */ + typedef enum SLPAddress_PR + { + SLPAddress_PR_NOTHING, /* No components present */ + SLPAddress_PR_iPAddress, + SLPAddress_PR_fQDN, + /* Extensions may appear below */ -/* SLPAddress */ -typedef struct SLPAddress { - SLPAddress_PR present; - union SLPAddress_u { - IPAddress_t iPAddress; - FQDN_t fQDN; - /* + } SLPAddress_PR; + + /* SLPAddress */ + typedef struct SLPAddress + { + SLPAddress_PR present; + union SLPAddress_u + { + IPAddress_t iPAddress; + FQDN_t fQDN; + /* * This type is extensible, * possible extensions are below. */ - } choice; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} SLPAddress_t; + } choice; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_SLPAddress; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } SLPAddress_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_SLPAddress; #ifdef __cplusplus } #endif -#endif /* _SLPAddress_H_ */ +#endif /* _SLPAddress_H_ */ #include diff --git a/src/core/libs/supl/asn-supl/SLPMode.h b/src/core/libs/supl/asn-supl/SLPMode.h index 3aec2cac0..54f6ffe27 100644 --- a/src/core/libs/supl/asn-supl/SLPMode.h +++ b/src/core/libs/supl/asn-supl/SLPMode.h @@ -4,8 +4,8 @@ * found in "../supl-init.asn" */ -#ifndef _SLPMode_H_ -#define _SLPMode_H_ +#ifndef _SLPMode_H_ +#define _SLPMode_H_ #include @@ -14,33 +14,35 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Dependencies */ -typedef enum SLPMode { - SLPMode_proxy = 0, - SLPMode_nonProxy = 1 -} e_SLPMode; + /* Dependencies */ + typedef enum SLPMode + { + SLPMode_proxy = 0, + SLPMode_nonProxy = 1 + } e_SLPMode; -/* SLPMode */ -typedef ENUMERATED_t SLPMode_t; + /* SLPMode */ + typedef ENUMERATED_t SLPMode_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_SLPMode; -asn_struct_free_f SLPMode_free; -asn_struct_print_f SLPMode_print; -asn_constr_check_f SLPMode_constraint; -ber_type_decoder_f SLPMode_decode_ber; -der_type_encoder_f SLPMode_encode_der; -xer_type_decoder_f SLPMode_decode_xer; -xer_type_encoder_f SLPMode_encode_xer; -per_type_decoder_f SLPMode_decode_uper; -per_type_encoder_f SLPMode_encode_uper; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_SLPMode; + asn_struct_free_f SLPMode_free; + asn_struct_print_f SLPMode_print; + asn_constr_check_f SLPMode_constraint; + ber_type_decoder_f SLPMode_decode_ber; + der_type_encoder_f SLPMode_encode_der; + xer_type_decoder_f SLPMode_decode_xer; + xer_type_encoder_f SLPMode_encode_xer; + per_type_decoder_f SLPMode_decode_uper; + per_type_encoder_f SLPMode_encode_uper; #ifdef __cplusplus } #endif -#endif /* _SLPMode_H_ */ +#endif /* _SLPMode_H_ */ #include diff --git a/src/core/libs/supl/asn-supl/SUPLEND.h b/src/core/libs/supl/asn-supl/SUPLEND.h index 2c75dbc21..0370782b0 100644 --- a/src/core/libs/supl/asn-supl/SUPLEND.h +++ b/src/core/libs/supl/asn-supl/SUPLEND.h @@ -4,8 +4,8 @@ * found in "../supl-end.asn" */ -#ifndef _SUPLEND_H_ -#define _SUPLEND_H_ +#ifndef _SUPLEND_H_ +#define _SUPLEND_H_ #include @@ -16,28 +16,30 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Forward declarations */ -struct Position; + /* Forward declarations */ + struct Position; -/* SUPLEND */ -typedef struct SUPLEND { - struct Position *position /* OPTIONAL */; - StatusCode_t *statusCode /* OPTIONAL */; - Ver_t *ver /* OPTIONAL */; - /* + /* SUPLEND */ + typedef struct SUPLEND + { + struct Position *position /* OPTIONAL */; + StatusCode_t *statusCode /* OPTIONAL */; + Ver_t *ver /* OPTIONAL */; + /* * This type is extensible, * possible extensions are below. */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} SUPLEND_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_SUPLEND; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } SUPLEND_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_SUPLEND; #ifdef __cplusplus } @@ -46,5 +48,5 @@ extern asn_TYPE_descriptor_t asn_DEF_SUPLEND; /* Referred external types */ #include "Position.h" -#endif /* _SUPLEND_H_ */ +#endif /* _SUPLEND_H_ */ #include diff --git a/src/core/libs/supl/asn-supl/SUPLINIT.h b/src/core/libs/supl/asn-supl/SUPLINIT.h index af290986f..40e4ebfed 100644 --- a/src/core/libs/supl/asn-supl/SUPLINIT.h +++ b/src/core/libs/supl/asn-supl/SUPLINIT.h @@ -4,8 +4,8 @@ * found in "../supl-init.asn" */ -#ifndef _SUPLINIT_H_ -#define _SUPLINIT_H_ +#ifndef _SUPLINIT_H_ +#define _SUPLINIT_H_ #include @@ -18,34 +18,36 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Forward declarations */ -struct Notification; -struct SLPAddress; -struct QoP; + /* Forward declarations */ + struct Notification; + struct SLPAddress; + struct QoP; -/* SUPLINIT */ -typedef struct SUPLINIT { - PosMethod_t posMethod; - struct Notification *notification /* OPTIONAL */; - struct SLPAddress *sLPAddress /* OPTIONAL */; - struct QoP *qoP /* OPTIONAL */; - SLPMode_t sLPMode; - MAC_t *mAC /* OPTIONAL */; - KeyIdentity_t *keyIdentity /* OPTIONAL */; - /* + /* SUPLINIT */ + typedef struct SUPLINIT + { + PosMethod_t posMethod; + struct Notification *notification /* OPTIONAL */; + struct SLPAddress *sLPAddress /* OPTIONAL */; + struct QoP *qoP /* OPTIONAL */; + SLPMode_t sLPMode; + MAC_t *mAC /* OPTIONAL */; + KeyIdentity_t *keyIdentity /* OPTIONAL */; + /* * This type is extensible, * possible extensions are below. */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} SUPLINIT_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_SUPLINIT; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } SUPLINIT_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_SUPLINIT; #ifdef __cplusplus } @@ -56,5 +58,5 @@ extern asn_TYPE_descriptor_t asn_DEF_SUPLINIT; #include "SLPAddress.h" #include "QoP.h" -#endif /* _SUPLINIT_H_ */ +#endif /* _SUPLINIT_H_ */ #include diff --git a/src/core/libs/supl/asn-supl/SUPLPOS.h b/src/core/libs/supl/asn-supl/SUPLPOS.h index 7285b26cf..9b9753f2f 100644 --- a/src/core/libs/supl/asn-supl/SUPLPOS.h +++ b/src/core/libs/supl/asn-supl/SUPLPOS.h @@ -4,8 +4,8 @@ * found in "../supl-pos.asn" */ -#ifndef _SUPLPOS_H_ -#define _SUPLPOS_H_ +#ifndef _SUPLPOS_H_ +#define _SUPLPOS_H_ #include @@ -15,27 +15,29 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Forward declarations */ -struct Velocity; + /* Forward declarations */ + struct Velocity; -/* SUPLPOS */ -typedef struct SUPLPOS { - PosPayLoad_t posPayLoad; - struct Velocity *velocity /* OPTIONAL */; - /* + /* SUPLPOS */ + typedef struct SUPLPOS + { + PosPayLoad_t posPayLoad; + struct Velocity *velocity /* OPTIONAL */; + /* * This type is extensible, * possible extensions are below. */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} SUPLPOS_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_SUPLPOS; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } SUPLPOS_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_SUPLPOS; #ifdef __cplusplus } @@ -44,5 +46,5 @@ extern asn_TYPE_descriptor_t asn_DEF_SUPLPOS; /* Referred external types */ #include "Velocity.h" -#endif /* _SUPLPOS_H_ */ +#endif /* _SUPLPOS_H_ */ #include diff --git a/src/core/libs/supl/asn-supl/SUPLPOSINIT.h b/src/core/libs/supl/asn-supl/SUPLPOSINIT.h index 740f7b5b4..741a88564 100644 --- a/src/core/libs/supl/asn-supl/SUPLPOSINIT.h +++ b/src/core/libs/supl/asn-supl/SUPLPOSINIT.h @@ -4,8 +4,8 @@ * found in "../supl-posinit.asn" */ -#ifndef _SUPLPOSINIT_H_ -#define _SUPLPOSINIT_H_ +#ifndef _SUPLPOSINIT_H_ +#define _SUPLPOSINIT_H_ #include @@ -17,33 +17,35 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Forward declarations */ -struct RequestedAssistData; -struct Position; -struct SUPLPOS; + /* Forward declarations */ + struct RequestedAssistData; + struct Position; + struct SUPLPOS; -/* SUPLPOSINIT */ -typedef struct SUPLPOSINIT { - SETCapabilities_t sETCapabilities; - struct RequestedAssistData *requestedAssistData /* OPTIONAL */; - LocationId_t locationId; - struct Position *position /* OPTIONAL */; - struct SUPLPOS *sUPLPOS /* OPTIONAL */; - Ver_t *ver /* OPTIONAL */; - /* + /* SUPLPOSINIT */ + typedef struct SUPLPOSINIT + { + SETCapabilities_t sETCapabilities; + struct RequestedAssistData *requestedAssistData /* OPTIONAL */; + LocationId_t locationId; + struct Position *position /* OPTIONAL */; + struct SUPLPOS *sUPLPOS /* OPTIONAL */; + Ver_t *ver /* OPTIONAL */; + /* * This type is extensible, * possible extensions are below. */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} SUPLPOSINIT_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_SUPLPOSINIT; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } SUPLPOSINIT_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_SUPLPOSINIT; #ifdef __cplusplus } @@ -54,5 +56,5 @@ extern asn_TYPE_descriptor_t asn_DEF_SUPLPOSINIT; #include "Position.h" #include "SUPLPOS.h" -#endif /* _SUPLPOSINIT_H_ */ +#endif /* _SUPLPOSINIT_H_ */ #include diff --git a/src/core/libs/supl/asn-supl/SUPLRESPONSE.h b/src/core/libs/supl/asn-supl/SUPLRESPONSE.h index 698cd32b4..c2eea8bd7 100644 --- a/src/core/libs/supl/asn-supl/SUPLRESPONSE.h +++ b/src/core/libs/supl/asn-supl/SUPLRESPONSE.h @@ -4,8 +4,8 @@ * found in "../supl-response.asn" */ -#ifndef _SUPLRESPONSE_H_ -#define _SUPLRESPONSE_H_ +#ifndef _SUPLRESPONSE_H_ +#define _SUPLRESPONSE_H_ #include @@ -16,30 +16,32 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Forward declarations */ -struct SLPAddress; -struct SETAuthKey; + /* Forward declarations */ + struct SLPAddress; + struct SETAuthKey; -/* SUPLRESPONSE */ -typedef struct SUPLRESPONSE { - PosMethod_t posMethod; - struct SLPAddress *sLPAddress /* OPTIONAL */; - struct SETAuthKey *sETAuthKey /* OPTIONAL */; - KeyIdentity4_t *keyIdentity4 /* OPTIONAL */; - /* + /* SUPLRESPONSE */ + typedef struct SUPLRESPONSE + { + PosMethod_t posMethod; + struct SLPAddress *sLPAddress /* OPTIONAL */; + struct SETAuthKey *sETAuthKey /* OPTIONAL */; + KeyIdentity4_t *keyIdentity4 /* OPTIONAL */; + /* * This type is extensible, * possible extensions are below. */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} SUPLRESPONSE_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_SUPLRESPONSE; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } SUPLRESPONSE_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_SUPLRESPONSE; #ifdef __cplusplus } @@ -49,5 +51,5 @@ extern asn_TYPE_descriptor_t asn_DEF_SUPLRESPONSE; #include "SLPAddress.h" #include "SETAuthKey.h" -#endif /* _SUPLRESPONSE_H_ */ +#endif /* _SUPLRESPONSE_H_ */ #include diff --git a/src/core/libs/supl/asn-supl/SUPLSTART.h b/src/core/libs/supl/asn-supl/SUPLSTART.h index b1061bf3c..fc6fd4b9e 100644 --- a/src/core/libs/supl/asn-supl/SUPLSTART.h +++ b/src/core/libs/supl/asn-supl/SUPLSTART.h @@ -4,8 +4,8 @@ * found in "../supl-start.asn" */ -#ifndef _SUPLSTART_H_ -#define _SUPLSTART_H_ +#ifndef _SUPLSTART_H_ +#define _SUPLSTART_H_ #include @@ -16,28 +16,30 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Forward declarations */ -struct QoP; + /* Forward declarations */ + struct QoP; -/* SUPLSTART */ -typedef struct SUPLSTART { - SETCapabilities_t sETCapabilities; - LocationId_t locationId; - struct QoP *qoP /* OPTIONAL */; - /* + /* SUPLSTART */ + typedef struct SUPLSTART + { + SETCapabilities_t sETCapabilities; + LocationId_t locationId; + struct QoP *qoP /* OPTIONAL */; + /* * This type is extensible, * possible extensions are below. */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} SUPLSTART_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_SUPLSTART; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } SUPLSTART_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_SUPLSTART; #ifdef __cplusplus } @@ -46,5 +48,5 @@ extern asn_TYPE_descriptor_t asn_DEF_SUPLSTART; /* Referred external types */ #include "QoP.h" -#endif /* _SUPLSTART_H_ */ +#endif /* _SUPLSTART_H_ */ #include diff --git a/src/core/libs/supl/asn-supl/SatelliteInfo.h b/src/core/libs/supl/asn-supl/SatelliteInfo.h index ff36af47a..4dea62f31 100644 --- a/src/core/libs/supl/asn-supl/SatelliteInfo.h +++ b/src/core/libs/supl/asn-supl/SatelliteInfo.h @@ -4,8 +4,8 @@ * found in "../supl-posinit.asn" */ -#ifndef _SatelliteInfo_H_ -#define _SatelliteInfo_H_ +#ifndef _SatelliteInfo_H_ +#define _SatelliteInfo_H_ #include @@ -15,22 +15,25 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Forward declarations */ -struct SatelliteInfoElement; + /* Forward declarations */ + struct SatelliteInfoElement; -/* SatelliteInfo */ -typedef struct SatelliteInfo { - A_SEQUENCE_OF(struct SatelliteInfoElement) list; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} SatelliteInfo_t; + /* SatelliteInfo */ + typedef struct SatelliteInfo + { + A_SEQUENCE_OF(struct SatelliteInfoElement) + list; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_SatelliteInfo; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } SatelliteInfo_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_SatelliteInfo; #ifdef __cplusplus } @@ -39,5 +42,5 @@ extern asn_TYPE_descriptor_t asn_DEF_SatelliteInfo; /* Referred external types */ #include "SatelliteInfoElement.h" -#endif /* _SatelliteInfo_H_ */ +#endif /* _SatelliteInfo_H_ */ #include diff --git a/src/core/libs/supl/asn-supl/SatelliteInfoElement.h b/src/core/libs/supl/asn-supl/SatelliteInfoElement.h index 6b2cc69ee..a97dcf643 100644 --- a/src/core/libs/supl/asn-supl/SatelliteInfoElement.h +++ b/src/core/libs/supl/asn-supl/SatelliteInfoElement.h @@ -4,8 +4,8 @@ * found in "../supl-posinit.asn" */ -#ifndef _SatelliteInfoElement_H_ -#define _SatelliteInfoElement_H_ +#ifndef _SatelliteInfoElement_H_ +#define _SatelliteInfoElement_H_ #include @@ -15,28 +15,30 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* SatelliteInfoElement */ -typedef struct SatelliteInfoElement { - long satId; - long iODE; - /* + /* SatelliteInfoElement */ + typedef struct SatelliteInfoElement + { + long satId; + long iODE; + /* * This type is extensible, * possible extensions are below. */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} SatelliteInfoElement_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_SatelliteInfoElement; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } SatelliteInfoElement_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_SatelliteInfoElement; #ifdef __cplusplus } #endif -#endif /* _SatelliteInfoElement_H_ */ +#endif /* _SatelliteInfoElement_H_ */ #include diff --git a/src/core/libs/supl/asn-supl/SessionID.h b/src/core/libs/supl/asn-supl/SessionID.h index c56f8ac07..104229df5 100644 --- a/src/core/libs/supl/asn-supl/SessionID.h +++ b/src/core/libs/supl/asn-supl/SessionID.h @@ -4,8 +4,8 @@ * found in "../supl-common.asn" */ -#ifndef _SessionID_H_ -#define _SessionID_H_ +#ifndef _SessionID_H_ +#define _SessionID_H_ #include @@ -14,24 +14,26 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Forward declarations */ -struct SetSessionID; -struct SlpSessionID; + /* Forward declarations */ + struct SetSessionID; + struct SlpSessionID; -/* SessionID */ -typedef struct SessionID { - struct SetSessionID *setSessionID /* OPTIONAL */; - struct SlpSessionID *slpSessionID /* OPTIONAL */; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} SessionID_t; + /* SessionID */ + typedef struct SessionID + { + struct SetSessionID *setSessionID /* OPTIONAL */; + struct SlpSessionID *slpSessionID /* OPTIONAL */; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_SessionID; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } SessionID_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_SessionID; #ifdef __cplusplus } @@ -41,5 +43,5 @@ extern asn_TYPE_descriptor_t asn_DEF_SessionID; #include "SetSessionID.h" #include "SlpSessionID.h" -#endif /* _SessionID_H_ */ +#endif /* _SessionID_H_ */ #include diff --git a/src/core/libs/supl/asn-supl/SetSessionID.h b/src/core/libs/supl/asn-supl/SetSessionID.h index 6e9cc352f..5ae549773 100644 --- a/src/core/libs/supl/asn-supl/SetSessionID.h +++ b/src/core/libs/supl/asn-supl/SetSessionID.h @@ -4,8 +4,8 @@ * found in "../supl-common.asn" */ -#ifndef _SetSessionID_H_ -#define _SetSessionID_H_ +#ifndef _SetSessionID_H_ +#define _SetSessionID_H_ #include @@ -16,24 +16,26 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* SetSessionID */ -typedef struct SetSessionID { - long sessionId; - SETId_t setId; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} SetSessionID_t; + /* SetSessionID */ + typedef struct SetSessionID + { + long sessionId; + SETId_t setId; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_SetSessionID; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } SetSessionID_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_SetSessionID; #ifdef __cplusplus } #endif -#endif /* _SetSessionID_H_ */ +#endif /* _SetSessionID_H_ */ #include diff --git a/src/core/libs/supl/asn-supl/SlpSessionID.h b/src/core/libs/supl/asn-supl/SlpSessionID.h index 2e1df8300..e381f2fbe 100644 --- a/src/core/libs/supl/asn-supl/SlpSessionID.h +++ b/src/core/libs/supl/asn-supl/SlpSessionID.h @@ -4,8 +4,8 @@ * found in "../supl-common.asn" */ -#ifndef _SlpSessionID_H_ -#define _SlpSessionID_H_ +#ifndef _SlpSessionID_H_ +#define _SlpSessionID_H_ #include @@ -16,24 +16,26 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* SlpSessionID */ -typedef struct SlpSessionID { - OCTET_STRING_t sessionID; - SLPAddress_t slpId; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} SlpSessionID_t; + /* SlpSessionID */ + typedef struct SlpSessionID + { + OCTET_STRING_t sessionID; + SLPAddress_t slpId; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_SlpSessionID; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } SlpSessionID_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_SlpSessionID; #ifdef __cplusplus } #endif -#endif /* _SlpSessionID_H_ */ +#endif /* _SlpSessionID_H_ */ #include diff --git a/src/core/libs/supl/asn-supl/Status.h b/src/core/libs/supl/asn-supl/Status.h index 7107531ab..1405d998d 100644 --- a/src/core/libs/supl/asn-supl/Status.h +++ b/src/core/libs/supl/asn-supl/Status.h @@ -4,8 +4,8 @@ * found in "../supl-common.asn" */ -#ifndef _Status_H_ -#define _Status_H_ +#ifndef _Status_H_ +#define _Status_H_ #include @@ -14,37 +14,39 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Dependencies */ -typedef enum Status { - Status_stale = 0, - Status_current = 1, - Status_unknown = 2 - /* + /* Dependencies */ + typedef enum Status + { + Status_stale = 0, + Status_current = 1, + Status_unknown = 2 + /* * Enumeration is extensible */ -} e_Status; + } e_Status; -/* Status */ -typedef ENUMERATED_t Status_t; + /* Status */ + typedef ENUMERATED_t Status_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_Status; -asn_struct_free_f Status_free; -asn_struct_print_f Status_print; -asn_constr_check_f Status_constraint; -ber_type_decoder_f Status_decode_ber; -der_type_encoder_f Status_encode_der; -xer_type_decoder_f Status_decode_xer; -xer_type_encoder_f Status_encode_xer; -per_type_decoder_f Status_decode_uper; -per_type_encoder_f Status_encode_uper; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_Status; + asn_struct_free_f Status_free; + asn_struct_print_f Status_print; + asn_constr_check_f Status_constraint; + ber_type_decoder_f Status_decode_ber; + der_type_encoder_f Status_encode_der; + xer_type_decoder_f Status_decode_xer; + xer_type_encoder_f Status_encode_xer; + per_type_decoder_f Status_decode_uper; + per_type_encoder_f Status_encode_uper; #ifdef __cplusplus } #endif -#endif /* _Status_H_ */ +#endif /* _Status_H_ */ #include diff --git a/src/core/libs/supl/asn-supl/StatusCode.h b/src/core/libs/supl/asn-supl/StatusCode.h index 35b52a379..b48c43e08 100644 --- a/src/core/libs/supl/asn-supl/StatusCode.h +++ b/src/core/libs/supl/asn-supl/StatusCode.h @@ -4,8 +4,8 @@ * found in "../supl-common.asn" */ -#ifndef _StatusCode_H_ -#define _StatusCode_H_ +#ifndef _StatusCode_H_ +#define _StatusCode_H_ #include @@ -14,54 +14,56 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Dependencies */ -typedef enum StatusCode { - StatusCode_unspecified = 0, - StatusCode_systemFailure = 1, - StatusCode_unexpectedMessage = 2, - StatusCode_protocolError = 3, - StatusCode_dataMissing = 4, - StatusCode_unexpectedDataValue = 5, - StatusCode_posMethodFailure = 6, - StatusCode_posMethodMismatch = 7, - StatusCode_posProtocolMismatch = 8, - StatusCode_targetSETnotReachable = 9, - StatusCode_versionNotSupported = 10, - StatusCode_resourceShortage = 11, - StatusCode_invalidSessionId = 12, - StatusCode_nonProxyModeNotSupported = 13, - StatusCode_proxyModeNotSupported = 14, - StatusCode_positioningNotPermitted = 15, - StatusCode_authNetFailure = 16, - StatusCode_authSuplinitFailure = 17, - StatusCode_consentDeniedByUser = 100, - StatusCode_consentGrantedByUser = 101 - /* + /* Dependencies */ + typedef enum StatusCode + { + StatusCode_unspecified = 0, + StatusCode_systemFailure = 1, + StatusCode_unexpectedMessage = 2, + StatusCode_protocolError = 3, + StatusCode_dataMissing = 4, + StatusCode_unexpectedDataValue = 5, + StatusCode_posMethodFailure = 6, + StatusCode_posMethodMismatch = 7, + StatusCode_posProtocolMismatch = 8, + StatusCode_targetSETnotReachable = 9, + StatusCode_versionNotSupported = 10, + StatusCode_resourceShortage = 11, + StatusCode_invalidSessionId = 12, + StatusCode_nonProxyModeNotSupported = 13, + StatusCode_proxyModeNotSupported = 14, + StatusCode_positioningNotPermitted = 15, + StatusCode_authNetFailure = 16, + StatusCode_authSuplinitFailure = 17, + StatusCode_consentDeniedByUser = 100, + StatusCode_consentGrantedByUser = 101 + /* * Enumeration is extensible */ -} e_StatusCode; + } e_StatusCode; -/* StatusCode */ -typedef ENUMERATED_t StatusCode_t; + /* StatusCode */ + typedef ENUMERATED_t StatusCode_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_StatusCode; -asn_struct_free_f StatusCode_free; -asn_struct_print_f StatusCode_print; -asn_constr_check_f StatusCode_constraint; -ber_type_decoder_f StatusCode_decode_ber; -der_type_encoder_f StatusCode_encode_der; -xer_type_decoder_f StatusCode_decode_xer; -xer_type_encoder_f StatusCode_encode_xer; -per_type_decoder_f StatusCode_decode_uper; -per_type_encoder_f StatusCode_encode_uper; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_StatusCode; + asn_struct_free_f StatusCode_free; + asn_struct_print_f StatusCode_print; + asn_constr_check_f StatusCode_constraint; + ber_type_decoder_f StatusCode_decode_ber; + der_type_encoder_f StatusCode_encode_der; + xer_type_decoder_f StatusCode_decode_xer; + xer_type_encoder_f StatusCode_encode_xer; + per_type_decoder_f StatusCode_decode_uper; + per_type_encoder_f StatusCode_encode_uper; #ifdef __cplusplus } #endif -#endif /* _StatusCode_H_ */ +#endif /* _StatusCode_H_ */ #include diff --git a/src/core/libs/supl/asn-supl/TGSN.h b/src/core/libs/supl/asn-supl/TGSN.h index 3aa40dc25..525479bb4 100644 --- a/src/core/libs/supl/asn-supl/TGSN.h +++ b/src/core/libs/supl/asn-supl/TGSN.h @@ -4,8 +4,8 @@ * found in "../supl-common.asn" */ -#ifndef _TGSN_H_ -#define _TGSN_H_ +#ifndef _TGSN_H_ +#define _TGSN_H_ #include @@ -14,27 +14,28 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* TGSN */ -typedef long TGSN_t; + /* TGSN */ + typedef long TGSN_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_TGSN; -asn_struct_free_f TGSN_free; -asn_struct_print_f TGSN_print; -asn_constr_check_f TGSN_constraint; -ber_type_decoder_f TGSN_decode_ber; -der_type_encoder_f TGSN_encode_der; -xer_type_decoder_f TGSN_decode_xer; -xer_type_encoder_f TGSN_encode_xer; -per_type_decoder_f TGSN_decode_uper; -per_type_encoder_f TGSN_encode_uper; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_TGSN; + asn_struct_free_f TGSN_free; + asn_struct_print_f TGSN_print; + asn_constr_check_f TGSN_constraint; + ber_type_decoder_f TGSN_decode_ber; + der_type_encoder_f TGSN_encode_der; + xer_type_decoder_f TGSN_decode_xer; + xer_type_encoder_f TGSN_encode_xer; + per_type_decoder_f TGSN_decode_uper; + per_type_encoder_f TGSN_encode_uper; #ifdef __cplusplus } #endif -#endif /* _TGSN_H_ */ +#endif /* _TGSN_H_ */ #include diff --git a/src/core/libs/supl/asn-supl/TimeslotISCP-List.h b/src/core/libs/supl/asn-supl/TimeslotISCP-List.h index 8333e73ae..99e60db88 100644 --- a/src/core/libs/supl/asn-supl/TimeslotISCP-List.h +++ b/src/core/libs/supl/asn-supl/TimeslotISCP-List.h @@ -4,8 +4,8 @@ * found in "../supl-common.asn" */ -#ifndef _TimeslotISCP_List_H_ -#define _TimeslotISCP_List_H_ +#ifndef _TimeslotISCP_List_H_ +#define _TimeslotISCP_List_H_ #include @@ -16,23 +16,26 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* TimeslotISCP-List */ -typedef struct TimeslotISCP_List { - A_SEQUENCE_OF(TimeslotISCP_t) list; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} TimeslotISCP_List_t; + /* TimeslotISCP-List */ + typedef struct TimeslotISCP_List + { + A_SEQUENCE_OF(TimeslotISCP_t) + list; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_TimeslotISCP_List; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } TimeslotISCP_List_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_TimeslotISCP_List; #ifdef __cplusplus } #endif -#endif /* _TimeslotISCP_List_H_ */ +#endif /* _TimeslotISCP_List_H_ */ #include diff --git a/src/core/libs/supl/asn-supl/TimeslotISCP.h b/src/core/libs/supl/asn-supl/TimeslotISCP.h index 27ec36634..4b147e70f 100644 --- a/src/core/libs/supl/asn-supl/TimeslotISCP.h +++ b/src/core/libs/supl/asn-supl/TimeslotISCP.h @@ -4,8 +4,8 @@ * found in "../supl-common.asn" */ -#ifndef _TimeslotISCP_H_ -#define _TimeslotISCP_H_ +#ifndef _TimeslotISCP_H_ +#define _TimeslotISCP_H_ #include @@ -14,27 +14,28 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* TimeslotISCP */ -typedef long TimeslotISCP_t; + /* TimeslotISCP */ + typedef long TimeslotISCP_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_TimeslotISCP; -asn_struct_free_f TimeslotISCP_free; -asn_struct_print_f TimeslotISCP_print; -asn_constr_check_f TimeslotISCP_constraint; -ber_type_decoder_f TimeslotISCP_decode_ber; -der_type_encoder_f TimeslotISCP_encode_der; -xer_type_decoder_f TimeslotISCP_decode_xer; -xer_type_encoder_f TimeslotISCP_encode_xer; -per_type_decoder_f TimeslotISCP_decode_uper; -per_type_encoder_f TimeslotISCP_encode_uper; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_TimeslotISCP; + asn_struct_free_f TimeslotISCP_free; + asn_struct_print_f TimeslotISCP_print; + asn_constr_check_f TimeslotISCP_constraint; + ber_type_decoder_f TimeslotISCP_decode_ber; + der_type_encoder_f TimeslotISCP_encode_der; + xer_type_decoder_f TimeslotISCP_decode_xer; + xer_type_encoder_f TimeslotISCP_encode_xer; + per_type_decoder_f TimeslotISCP_decode_uper; + per_type_encoder_f TimeslotISCP_encode_uper; #ifdef __cplusplus } #endif -#endif /* _TimeslotISCP_H_ */ +#endif /* _TimeslotISCP_H_ */ #include diff --git a/src/core/libs/supl/asn-supl/UARFCN.h b/src/core/libs/supl/asn-supl/UARFCN.h index 3ece4c30d..5c4315138 100644 --- a/src/core/libs/supl/asn-supl/UARFCN.h +++ b/src/core/libs/supl/asn-supl/UARFCN.h @@ -4,8 +4,8 @@ * found in "../supl-common.asn" */ -#ifndef _UARFCN_H_ -#define _UARFCN_H_ +#ifndef _UARFCN_H_ +#define _UARFCN_H_ #include @@ -14,27 +14,28 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* UARFCN */ -typedef long UARFCN_t; + /* UARFCN */ + typedef long UARFCN_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_UARFCN; -asn_struct_free_f UARFCN_free; -asn_struct_print_f UARFCN_print; -asn_constr_check_f UARFCN_constraint; -ber_type_decoder_f UARFCN_decode_ber; -der_type_encoder_f UARFCN_encode_der; -xer_type_decoder_f UARFCN_decode_xer; -xer_type_encoder_f UARFCN_encode_xer; -per_type_decoder_f UARFCN_decode_uper; -per_type_encoder_f UARFCN_encode_uper; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_UARFCN; + asn_struct_free_f UARFCN_free; + asn_struct_print_f UARFCN_print; + asn_constr_check_f UARFCN_constraint; + ber_type_decoder_f UARFCN_decode_ber; + der_type_encoder_f UARFCN_encode_der; + xer_type_decoder_f UARFCN_decode_xer; + xer_type_encoder_f UARFCN_encode_xer; + per_type_decoder_f UARFCN_decode_uper; + per_type_encoder_f UARFCN_encode_uper; #ifdef __cplusplus } #endif -#endif /* _UARFCN_H_ */ +#endif /* _UARFCN_H_ */ #include diff --git a/src/core/libs/supl/asn-supl/ULP-PDU.h b/src/core/libs/supl/asn-supl/ULP-PDU.h index c90eb6287..c8582659a 100644 --- a/src/core/libs/supl/asn-supl/ULP-PDU.h +++ b/src/core/libs/supl/asn-supl/ULP-PDU.h @@ -4,8 +4,8 @@ * found in "../supl-ulp.asn" */ -#ifndef _ULP_PDU_H_ -#define _ULP_PDU_H_ +#ifndef _ULP_PDU_H_ +#define _ULP_PDU_H_ #include @@ -18,26 +18,28 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* ULP-PDU */ -typedef struct ULP_PDU { - long length; - Version_t version; - SessionID_t sessionID; - UlpMessage_t message; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} ULP_PDU_t; + /* ULP-PDU */ + typedef struct ULP_PDU + { + long length; + Version_t version; + SessionID_t sessionID; + UlpMessage_t message; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_ULP_PDU; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } ULP_PDU_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_ULP_PDU; #ifdef __cplusplus } #endif -#endif /* _ULP_PDU_H_ */ +#endif /* _ULP_PDU_H_ */ #include diff --git a/src/core/libs/supl/asn-supl/UTCTime.h b/src/core/libs/supl/asn-supl/UTCTime.h index 8035b3456..53517fde6 100644 --- a/src/core/libs/supl/asn-supl/UTCTime.h +++ b/src/core/libs/supl/asn-supl/UTCTime.h @@ -2,37 +2,38 @@ * Copyright (c) 2003, 2004 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ -#ifndef _UTCTime_H_ -#define _UTCTime_H_ +#ifndef _UTCTime_H_ +#define _UTCTime_H_ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -typedef OCTET_STRING_t UTCTime_t; /* Implemented via OCTET STRING */ + typedef OCTET_STRING_t UTCTime_t; /* Implemented via OCTET STRING */ -extern asn_TYPE_descriptor_t asn_DEF_UTCTime; + extern asn_TYPE_descriptor_t asn_DEF_UTCTime; -asn_struct_print_f UTCTime_print; -asn_constr_check_f UTCTime_constraint; -xer_type_encoder_f UTCTime_encode_xer; + asn_struct_print_f UTCTime_print; + asn_constr_check_f UTCTime_constraint; + xer_type_encoder_f UTCTime_encode_xer; -/*********************** + /*********************** * Some handy helpers. * ***********************/ -struct tm; /* */ + struct tm; /* */ -/* See asn_GT2time() in GeneralizedTime.h */ -time_t asn_UT2time(const UTCTime_t *, struct tm *_optional_tm4fill, int as_gmt); + /* See asn_GT2time() in GeneralizedTime.h */ + time_t asn_UT2time(const UTCTime_t *, struct tm *_optional_tm4fill, int as_gmt); -/* See asn_time2GT() in GeneralizedTime.h */ -UTCTime_t *asn_time2UT(UTCTime_t *__opt_ut, const struct tm *, int force_gmt); + /* See asn_time2GT() in GeneralizedTime.h */ + UTCTime_t *asn_time2UT(UTCTime_t *__opt_ut, const struct tm *, int force_gmt); #ifdef __cplusplus } #endif -#endif /* _UTCTime_H_ */ +#endif /* _UTCTime_H_ */ diff --git a/src/core/libs/supl/asn-supl/UTRA-CarrierRSSI.h b/src/core/libs/supl/asn-supl/UTRA-CarrierRSSI.h index 23b1bcb6f..8e9ea3835 100644 --- a/src/core/libs/supl/asn-supl/UTRA-CarrierRSSI.h +++ b/src/core/libs/supl/asn-supl/UTRA-CarrierRSSI.h @@ -4,8 +4,8 @@ * found in "../supl-common.asn" */ -#ifndef _UTRA_CarrierRSSI_H_ -#define _UTRA_CarrierRSSI_H_ +#ifndef _UTRA_CarrierRSSI_H_ +#define _UTRA_CarrierRSSI_H_ #include @@ -14,27 +14,28 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* UTRA-CarrierRSSI */ -typedef long UTRA_CarrierRSSI_t; + /* UTRA-CarrierRSSI */ + typedef long UTRA_CarrierRSSI_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_UTRA_CarrierRSSI; -asn_struct_free_f UTRA_CarrierRSSI_free; -asn_struct_print_f UTRA_CarrierRSSI_print; -asn_constr_check_f UTRA_CarrierRSSI_constraint; -ber_type_decoder_f UTRA_CarrierRSSI_decode_ber; -der_type_encoder_f UTRA_CarrierRSSI_encode_der; -xer_type_decoder_f UTRA_CarrierRSSI_decode_xer; -xer_type_encoder_f UTRA_CarrierRSSI_encode_xer; -per_type_decoder_f UTRA_CarrierRSSI_decode_uper; -per_type_encoder_f UTRA_CarrierRSSI_encode_uper; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_UTRA_CarrierRSSI; + asn_struct_free_f UTRA_CarrierRSSI_free; + asn_struct_print_f UTRA_CarrierRSSI_print; + asn_constr_check_f UTRA_CarrierRSSI_constraint; + ber_type_decoder_f UTRA_CarrierRSSI_decode_ber; + der_type_encoder_f UTRA_CarrierRSSI_encode_der; + xer_type_decoder_f UTRA_CarrierRSSI_decode_xer; + xer_type_encoder_f UTRA_CarrierRSSI_encode_xer; + per_type_decoder_f UTRA_CarrierRSSI_decode_uper; + per_type_encoder_f UTRA_CarrierRSSI_encode_uper; #ifdef __cplusplus } #endif -#endif /* _UTRA_CarrierRSSI_H_ */ +#endif /* _UTRA_CarrierRSSI_H_ */ #include diff --git a/src/core/libs/supl/asn-supl/UlpMessage.h b/src/core/libs/supl/asn-supl/UlpMessage.h index 8447dd73c..15f42aa9c 100644 --- a/src/core/libs/supl/asn-supl/UlpMessage.h +++ b/src/core/libs/supl/asn-supl/UlpMessage.h @@ -4,8 +4,8 @@ * found in "../supl-ulp.asn" */ -#ifndef _UlpMessage_H_ -#define _UlpMessage_H_ +#ifndef _UlpMessage_H_ +#define _UlpMessage_H_ #include @@ -21,52 +21,56 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Dependencies */ -typedef enum UlpMessage_PR { - UlpMessage_PR_NOTHING, /* No components present */ - UlpMessage_PR_msSUPLINIT, - UlpMessage_PR_msSUPLSTART, - UlpMessage_PR_msSUPLRESPONSE, - UlpMessage_PR_msSUPLPOSINIT, - UlpMessage_PR_msSUPLPOS, - UlpMessage_PR_msSUPLEND, - UlpMessage_PR_msDUMMY2, - UlpMessage_PR_msDUMMY3, - /* Extensions may appear below */ - -} UlpMessage_PR; + /* Dependencies */ + typedef enum UlpMessage_PR + { + UlpMessage_PR_NOTHING, /* No components present */ + UlpMessage_PR_msSUPLINIT, + UlpMessage_PR_msSUPLSTART, + UlpMessage_PR_msSUPLRESPONSE, + UlpMessage_PR_msSUPLPOSINIT, + UlpMessage_PR_msSUPLPOS, + UlpMessage_PR_msSUPLEND, + UlpMessage_PR_msDUMMY2, + UlpMessage_PR_msDUMMY3, + /* Extensions may appear below */ -/* UlpMessage */ -typedef struct UlpMessage { - UlpMessage_PR present; - union UlpMessage_u { - SUPLINIT_t msSUPLINIT; - SUPLSTART_t msSUPLSTART; - SUPLRESPONSE_t msSUPLRESPONSE; - SUPLPOSINIT_t msSUPLPOSINIT; - SUPLPOS_t msSUPLPOS; - SUPLEND_t msSUPLEND; - DUMMY_t msDUMMY2; - DUMMY_t msDUMMY3; - /* + } UlpMessage_PR; + + /* UlpMessage */ + typedef struct UlpMessage + { + UlpMessage_PR present; + union UlpMessage_u + { + SUPLINIT_t msSUPLINIT; + SUPLSTART_t msSUPLSTART; + SUPLRESPONSE_t msSUPLRESPONSE; + SUPLPOSINIT_t msSUPLPOSINIT; + SUPLPOS_t msSUPLPOS; + SUPLEND_t msSUPLEND; + DUMMY_t msDUMMY2; + DUMMY_t msDUMMY3; + /* * This type is extensible, * possible extensions are below. */ - } choice; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} UlpMessage_t; + } choice; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_UlpMessage; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } UlpMessage_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_UlpMessage; #ifdef __cplusplus } #endif -#endif /* _UlpMessage_H_ */ +#endif /* _UlpMessage_H_ */ #include diff --git a/src/core/libs/supl/asn-supl/Velocity.h b/src/core/libs/supl/asn-supl/Velocity.h index b4620dcc4..1db003a82 100644 --- a/src/core/libs/supl/asn-supl/Velocity.h +++ b/src/core/libs/supl/asn-supl/Velocity.h @@ -4,8 +4,8 @@ * found in "../supl-common.asn" */ -#ifndef _Velocity_H_ -#define _Velocity_H_ +#ifndef _Velocity_H_ +#define _Velocity_H_ #include @@ -18,44 +18,48 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Dependencies */ -typedef enum Velocity_PR { - Velocity_PR_NOTHING, /* No components present */ - Velocity_PR_horvel, - Velocity_PR_horandvervel, - Velocity_PR_horveluncert, - Velocity_PR_horandveruncert, - /* Extensions may appear below */ - -} Velocity_PR; + /* Dependencies */ + typedef enum Velocity_PR + { + Velocity_PR_NOTHING, /* No components present */ + Velocity_PR_horvel, + Velocity_PR_horandvervel, + Velocity_PR_horveluncert, + Velocity_PR_horandveruncert, + /* Extensions may appear below */ -/* Velocity */ -typedef struct Velocity { - Velocity_PR present; - union Velocity_u { - Horvel_t horvel; - Horandvervel_t horandvervel; - Horveluncert_t horveluncert; - Horandveruncert_t horandveruncert; - /* + } Velocity_PR; + + /* Velocity */ + typedef struct Velocity + { + Velocity_PR present; + union Velocity_u + { + Horvel_t horvel; + Horandvervel_t horandvervel; + Horveluncert_t horveluncert; + Horandveruncert_t horandveruncert; + /* * This type is extensible, * possible extensions are below. */ - } choice; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} Velocity_t; + } choice; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_Velocity; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } Velocity_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_Velocity; #ifdef __cplusplus } #endif -#endif /* _Velocity_H_ */ +#endif /* _Velocity_H_ */ #include diff --git a/src/core/libs/supl/asn-supl/Ver.h b/src/core/libs/supl/asn-supl/Ver.h index 81c4fb55a..17a44483b 100644 --- a/src/core/libs/supl/asn-supl/Ver.h +++ b/src/core/libs/supl/asn-supl/Ver.h @@ -4,8 +4,8 @@ * found in "../supl-common.asn" */ -#ifndef _Ver_H_ -#define _Ver_H_ +#ifndef _Ver_H_ +#define _Ver_H_ #include @@ -14,27 +14,28 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Ver */ -typedef BIT_STRING_t Ver_t; + /* Ver */ + typedef BIT_STRING_t Ver_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_Ver; -asn_struct_free_f Ver_free; -asn_struct_print_f Ver_print; -asn_constr_check_f Ver_constraint; -ber_type_decoder_f Ver_decode_ber; -der_type_encoder_f Ver_encode_der; -xer_type_decoder_f Ver_decode_xer; -xer_type_encoder_f Ver_encode_xer; -per_type_decoder_f Ver_decode_uper; -per_type_encoder_f Ver_encode_uper; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_Ver; + asn_struct_free_f Ver_free; + asn_struct_print_f Ver_print; + asn_constr_check_f Ver_constraint; + ber_type_decoder_f Ver_decode_ber; + der_type_encoder_f Ver_encode_der; + xer_type_decoder_f Ver_decode_xer; + xer_type_encoder_f Ver_encode_xer; + per_type_decoder_f Ver_decode_uper; + per_type_encoder_f Ver_encode_uper; #ifdef __cplusplus } #endif -#endif /* _Ver_H_ */ +#endif /* _Ver_H_ */ #include diff --git a/src/core/libs/supl/asn-supl/Version.h b/src/core/libs/supl/asn-supl/Version.h index e0576ce24..7f1273592 100644 --- a/src/core/libs/supl/asn-supl/Version.h +++ b/src/core/libs/supl/asn-supl/Version.h @@ -4,8 +4,8 @@ * found in "../supl-common.asn" */ -#ifndef _Version_H_ -#define _Version_H_ +#ifndef _Version_H_ +#define _Version_H_ #include @@ -15,25 +15,27 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Version */ -typedef struct Version { - long maj; - long min; - long servind; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} Version_t; + /* Version */ + typedef struct Version + { + long maj; + long min; + long servind; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_Version; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } Version_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_Version; #ifdef __cplusplus } #endif -#endif /* _Version_H_ */ +#endif /* _Version_H_ */ #include diff --git a/src/core/libs/supl/asn-supl/VisibleString.h b/src/core/libs/supl/asn-supl/VisibleString.h index 20ba8cc50..ca9ed7e4d 100644 --- a/src/core/libs/supl/asn-supl/VisibleString.h +++ b/src/core/libs/supl/asn-supl/VisibleString.h @@ -2,23 +2,24 @@ * Copyright (c) 2003 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ -#ifndef _VisibleString_H_ -#define _VisibleString_H_ +#ifndef _VisibleString_H_ +#define _VisibleString_H_ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -typedef OCTET_STRING_t VisibleString_t; /* Implemented via OCTET STRING */ + typedef OCTET_STRING_t VisibleString_t; /* Implemented via OCTET STRING */ -extern asn_TYPE_descriptor_t asn_DEF_VisibleString; + extern asn_TYPE_descriptor_t asn_DEF_VisibleString; -asn_constr_check_f VisibleString_constraint; + asn_constr_check_f VisibleString_constraint; #ifdef __cplusplus } #endif -#endif /* _VisibleString_H_ */ +#endif /* _VisibleString_H_ */ diff --git a/src/core/libs/supl/asn-supl/WcdmaCellInformation.h b/src/core/libs/supl/asn-supl/WcdmaCellInformation.h index 8136982f7..9aaa46fdd 100644 --- a/src/core/libs/supl/asn-supl/WcdmaCellInformation.h +++ b/src/core/libs/supl/asn-supl/WcdmaCellInformation.h @@ -4,8 +4,8 @@ * found in "../supl-common.asn" */ -#ifndef _WcdmaCellInformation_H_ -#define _WcdmaCellInformation_H_ +#ifndef _WcdmaCellInformation_H_ +#define _WcdmaCellInformation_H_ #include @@ -15,32 +15,34 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Forward declarations */ -struct FrequencyInfo; -struct MeasuredResultsList; + /* Forward declarations */ + struct FrequencyInfo; + struct MeasuredResultsList; -/* WcdmaCellInformation */ -typedef struct WcdmaCellInformation { - long refMCC; - long refMNC; - long refUC; - struct FrequencyInfo *frequencyInfo /* OPTIONAL */; - long *primaryScramblingCode /* OPTIONAL */; - struct MeasuredResultsList *measuredResultsList /* OPTIONAL */; - /* + /* WcdmaCellInformation */ + typedef struct WcdmaCellInformation + { + long refMCC; + long refMNC; + long refUC; + struct FrequencyInfo *frequencyInfo /* OPTIONAL */; + long *primaryScramblingCode /* OPTIONAL */; + struct MeasuredResultsList *measuredResultsList /* OPTIONAL */; + /* * This type is extensible, * possible extensions are below. */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} WcdmaCellInformation_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_WcdmaCellInformation; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } WcdmaCellInformation_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_WcdmaCellInformation; #ifdef __cplusplus } @@ -50,5 +52,5 @@ extern asn_TYPE_descriptor_t asn_DEF_WcdmaCellInformation; #include "FrequencyInfo.h" #include "MeasuredResultsList.h" -#endif /* _WcdmaCellInformation_H_ */ +#endif /* _WcdmaCellInformation_H_ */ #include diff --git a/src/core/libs/supl/asn-supl/XNavigationModel.h b/src/core/libs/supl/asn-supl/XNavigationModel.h index 0fa410743..0962aeec4 100644 --- a/src/core/libs/supl/asn-supl/XNavigationModel.h +++ b/src/core/libs/supl/asn-supl/XNavigationModel.h @@ -4,8 +4,8 @@ * found in "../supl-posinit.asn" */ -#ifndef _XNavigationModel_H_ -#define _XNavigationModel_H_ +#ifndef _XNavigationModel_H_ +#define _XNavigationModel_H_ #include @@ -15,30 +15,32 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Forward declarations */ -struct SatelliteInfo; + /* Forward declarations */ + struct SatelliteInfo; -/* XNavigationModel */ -typedef struct XNavigationModel { - long gpsWeek; - long gpsToe; - long nSAT; - long toeLimit; - struct SatelliteInfo *satInfo /* OPTIONAL */; - /* + /* XNavigationModel */ + typedef struct XNavigationModel + { + long gpsWeek; + long gpsToe; + long nSAT; + long toeLimit; + struct SatelliteInfo *satInfo /* OPTIONAL */; + /* * This type is extensible, * possible extensions are below. */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} XNavigationModel_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_XNavigationModel; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } XNavigationModel_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_XNavigationModel; #ifdef __cplusplus } @@ -47,5 +49,5 @@ extern asn_TYPE_descriptor_t asn_DEF_XNavigationModel; /* Referred external types */ #include "SatelliteInfo.h" -#endif /* _XNavigationModel_H_ */ +#endif /* _XNavigationModel_H_ */ #include diff --git a/src/core/libs/supl/asn-supl/asn_SEQUENCE_OF.h b/src/core/libs/supl/asn-supl/asn_SEQUENCE_OF.h index e678f0347..2ad8287a0 100644 --- a/src/core/libs/supl/asn-supl/asn_SEQUENCE_OF.h +++ b/src/core/libs/supl/asn-supl/asn_SEQUENCE_OF.h @@ -2,13 +2,14 @@ * Copyright (c) 2003, 2004 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ -#ifndef ASN_SEQUENCE_OF_H -#define ASN_SEQUENCE_OF_H +#ifndef ASN_SEQUENCE_OF_H +#define ASN_SEQUENCE_OF_H #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif /* @@ -16,37 +17,37 @@ extern "C" { * the delete operation preserves the initial order of elements * and thus MAY operate in non-constant time. */ -#define A_SEQUENCE_OF(type) A_SET_OF(type) +#define A_SEQUENCE_OF(type) A_SET_OF(type) -#define ASN_SEQUENCE_ADD(headptr, ptr) \ - asn_sequence_add((headptr), (ptr)) +#define ASN_SEQUENCE_ADD(headptr, ptr) \ + asn_sequence_add((headptr), (ptr)) -/*********************************************** + /*********************************************** * Implementation of the SEQUENCE OF structure. */ -#define asn_sequence_add asn_set_add -#define asn_sequence_empty asn_set_empty +#define asn_sequence_add asn_set_add +#define asn_sequence_empty asn_set_empty -/* + /* * Delete the element from the set by its number (base 0). * This is NOT a constant-time operation. * The order of elements is preserved. * If _do_free is given AND the (*free) is initialized, the element * will be freed using the custom (*free) function as well. */ -void asn_sequence_del(void *asn_sequence_of_x, int number, int _do_free); + void asn_sequence_del(void *asn_sequence_of_x, int number, int _do_free); -/* + /* * Cope with different conversions requirements to/from void in C and C++. * This is mostly useful for support library. */ -typedef A_SEQUENCE_OF(void) asn_anonymous_sequence_; -#define _A_SEQUENCE_FROM_VOID(ptr) ((asn_anonymous_sequence_ *)(ptr)) -#define _A_CSEQUENCE_FROM_VOID(ptr) ((const asn_anonymous_sequence_ *)(ptr)) + typedef A_SEQUENCE_OF(void) asn_anonymous_sequence_; +#define _A_SEQUENCE_FROM_VOID(ptr) ((asn_anonymous_sequence_ *)(ptr)) +#define _A_CSEQUENCE_FROM_VOID(ptr) ((const asn_anonymous_sequence_ *)(ptr)) #ifdef __cplusplus } #endif -#endif /* ASN_SEQUENCE_OF_H */ +#endif /* ASN_SEQUENCE_OF_H */ diff --git a/src/core/libs/supl/asn-supl/asn_SET_OF.h b/src/core/libs/supl/asn-supl/asn_SET_OF.h index 7edf14b51..0edc0abc4 100644 --- a/src/core/libs/supl/asn-supl/asn_SET_OF.h +++ b/src/core/libs/supl/asn-supl/asn_SET_OF.h @@ -2,36 +2,38 @@ * Copyright (c) 2003, 2004 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ -#ifndef ASN_SET_OF_H -#define ASN_SET_OF_H +#ifndef ASN_SET_OF_H +#define ASN_SET_OF_H #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -#define A_SET_OF(type) \ - struct { \ - type **array; \ - int count; /* Meaningful size */ \ - int size; /* Allocated size */ \ - void (*free)(type *); \ - } +#define A_SET_OF(type) \ + struct \ + { \ + type **array; \ + int count; /* Meaningful size */ \ + int size; /* Allocated size */ \ + void (*free)(type *); \ + } -#define ASN_SET_ADD(headptr, ptr) \ - asn_set_add((headptr), (ptr)) +#define ASN_SET_ADD(headptr, ptr) \ + asn_set_add((headptr), (ptr)) -/******************************************* + /******************************************* * Implementation of the SET OF structure. */ -/* + /* * Add another structure into the set by its pointer. * RETURN VALUES: * 0 for success and -1/errno for failure. */ -int asn_set_add(void *asn_set_of_x, void *ptr); + int asn_set_add(void *asn_set_of_x, void *ptr); -/* + /* * Delete the element from the set by its number (base 0). * This is a constant-time operation. The order of elements before the * deleted ones is guaranteed, the order of elements after the deleted @@ -39,24 +41,24 @@ int asn_set_add(void *asn_set_of_x, void *ptr); * If _do_free is given AND the (*free) is initialized, the element * will be freed using the custom (*free) function as well. */ -void asn_set_del(void *asn_set_of_x, int number, int _do_free); + void asn_set_del(void *asn_set_of_x, int number, int _do_free); -/* + /* * Empty the contents of the set. Will free the elements, if (*free) is given. * Will NOT free the set itself. */ -void asn_set_empty(void *asn_set_of_x); + void asn_set_empty(void *asn_set_of_x); -/* + /* * Cope with different conversions requirements to/from void in C and C++. * This is mostly useful for support library. */ -typedef A_SET_OF(void) asn_anonymous_set_; -#define _A_SET_FROM_VOID(ptr) ((asn_anonymous_set_ *)(ptr)) -#define _A_CSET_FROM_VOID(ptr) ((const asn_anonymous_set_ *)(ptr)) + typedef A_SET_OF(void) asn_anonymous_set_; +#define _A_SET_FROM_VOID(ptr) ((asn_anonymous_set_ *)(ptr)) +#define _A_CSET_FROM_VOID(ptr) ((const asn_anonymous_set_ *)(ptr)) #ifdef __cplusplus } #endif -#endif /* ASN_SET_OF_H */ +#endif /* ASN_SET_OF_H */ diff --git a/src/core/libs/supl/asn-supl/asn_application.h b/src/core/libs/supl/asn-supl/asn_application.h index f40cd86ad..43904afb0 100644 --- a/src/core/libs/supl/asn-supl/asn_application.h +++ b/src/core/libs/supl/asn-supl/asn_application.h @@ -5,27 +5,28 @@ /* * Application-level ASN.1 callbacks. */ -#ifndef _ASN_APPLICATION_H_ -#define _ASN_APPLICATION_H_ +#ifndef _ASN_APPLICATION_H_ +#define _ASN_APPLICATION_H_ -#include "asn_system.h" /* for platform-dependent types */ -#include "asn_codecs.h" /* for ASN.1 codecs specifics */ +#include "asn_system.h" /* for platform-dependent types */ +#include "asn_codecs.h" /* for ASN.1 codecs specifics */ #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* + /* * Generic type of an application-defined callback to return various * types of data to the application. * EXPECTED RETURN VALUES: * -1: Failed to consume bytes. Abort the mission. * Non-negative return values indicate success, and ignored. */ -typedef int (asn_app_consume_bytes_f)(const void *buffer, size_t size, - void *application_specific_key); + typedef int(asn_app_consume_bytes_f)(const void *buffer, size_t size, + void *application_specific_key); -/* + /* * A callback of this type is called whenever constraint validation fails * on some ASN.1 type. See "constraints.h" for more details on constraint * validation. @@ -33,15 +34,15 @@ typedef int (asn_app_consume_bytes_f)(const void *buffer, size_t size, * the constraint check, as well as human readable message on what * particular constraint has failed. */ -typedef void (asn_app_constraint_failed_f)(void *application_specific_key, - struct asn_TYPE_descriptor_s *type_descriptor_which_failed, - const void *structure_which_failed_ptr, - const char *error_message_format, ...) GCC_PRINTFLIKE(4, 5); + typedef void(asn_app_constraint_failed_f)(void *application_specific_key, + struct asn_TYPE_descriptor_s *type_descriptor_which_failed, + const void *structure_which_failed_ptr, + const char *error_message_format, ...) GCC_PRINTFLIKE(4, 5); #ifdef __cplusplus } #endif -#include "constr_TYPE.h" /* for asn_TYPE_descriptor_t */ +#include "constr_TYPE.h" /* for asn_TYPE_descriptor_t */ -#endif /* _ASN_APPLICATION_H_ */ +#endif /* _ASN_APPLICATION_H_ */ diff --git a/src/core/libs/supl/asn-supl/asn_codecs.h b/src/core/libs/supl/asn-supl/asn_codecs.h index 4a251d940..717336ed5 100644 --- a/src/core/libs/supl/asn-supl/asn_codecs.h +++ b/src/core/libs/supl/asn-supl/asn_codecs.h @@ -3,16 +3,17 @@ * All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ -#ifndef _ASN_CODECS_H_ -#define _ASN_CODECS_H_ +#ifndef _ASN_CODECS_H_ +#define _ASN_CODECS_H_ #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -struct asn_TYPE_descriptor_s; /* Forward declaration */ + struct asn_TYPE_descriptor_s; /* Forward declaration */ -/* + /* * This structure defines a set of parameters that may be passed * to every ASN.1 encoder or decoder function. * WARNING: if max_stack_size member is set, and you are calling the @@ -21,8 +22,9 @@ struct asn_TYPE_descriptor_s; /* Forward declaration */ * If you can't always satisfy this requirement, use ber_decode(), * xer_decode() and uper_decode() functions instead. */ -typedef struct asn_codec_ctx_s { - /* + typedef struct asn_codec_ctx_s + { + /* * Limit the decoder routines to use no (much) more stack than a given * number of bytes. Most of decoders are stack-based, and this * would protect against stack overflows if the number of nested @@ -33,45 +35,52 @@ typedef struct asn_codec_ctx_s { * this variable. Be careful in multithreaded environments, as the * stack size is rather limited. */ - size_t max_stack_size; /* 0 disables stack bounds checking */ -} asn_codec_ctx_t; + size_t max_stack_size; /* 0 disables stack bounds checking */ + } asn_codec_ctx_t; -/* + /* * Type of the return value of the encoding functions (der_encode, xer_encode). */ -typedef struct asn_enc_rval_s { - /* + typedef struct asn_enc_rval_s + { + /* * Number of bytes encoded. * -1 indicates failure to encode the structure. * In this case, the members below this one are meaningful. */ - ssize_t encoded; + ssize_t encoded; - /* + /* * Members meaningful when (encoded == -1), for post mortem analysis. */ - /* Type which cannot be encoded */ - struct asn_TYPE_descriptor_s *failed_type; + /* Type which cannot be encoded */ + struct asn_TYPE_descriptor_s *failed_type; - /* Pointer to the structure of that type */ - void *structure_ptr; -} asn_enc_rval_t; -#define _ASN_ENCODE_FAILED do { \ - asn_enc_rval_t tmp_error; \ - tmp_error.encoded = -1; \ - tmp_error.failed_type = td; \ - tmp_error.structure_ptr = sptr; \ - ASN_DEBUG("Failed to encode element %s", td->name); \ - return tmp_error; \ -} while(0) -#define _ASN_ENCODED_OK(rval) do { \ - rval.structure_ptr = 0; \ - rval.failed_type = 0; \ - return rval; \ -} while(0) + /* Pointer to the structure of that type */ + void *structure_ptr; + } asn_enc_rval_t; +#define _ASN_ENCODE_FAILED \ + do \ + { \ + asn_enc_rval_t tmp_error; \ + tmp_error.encoded = -1; \ + tmp_error.failed_type = td; \ + tmp_error.structure_ptr = sptr; \ + ASN_DEBUG("Failed to encode element %s", td->name); \ + return tmp_error; \ + } \ + while (0) +#define _ASN_ENCODED_OK(rval) \ + do \ + { \ + rval.structure_ptr = 0; \ + rval.failed_type = 0; \ + return rval; \ + } \ + while (0) -/* + /* * Type of the return value of the decoding functions (ber_decode, xer_decode) * * Please note that the number of consumed bytes is ALWAYS meaningful, @@ -79,31 +88,39 @@ typedef struct asn_enc_rval_s { * decoded bytes, hence providing a possibility to fail with more diagnostics * (i.e., print the offending remainder of the buffer). */ -enum asn_dec_rval_code_e { - RC_OK, /* Decoded successfully */ - RC_WMORE, /* More data expected, call again */ - RC_FAIL /* Failure to decode data */ -}; -typedef struct asn_dec_rval_s { - enum asn_dec_rval_code_e code; /* Result code */ - size_t consumed; /* Number of bytes consumed */ -} asn_dec_rval_t; -#define _ASN_DECODE_FAILED do { \ - asn_dec_rval_t tmp_error; \ - tmp_error.code = RC_FAIL; \ - tmp_error.consumed = 0; \ - ASN_DEBUG("Failed to decode element %s", td->name); \ - return tmp_error; \ -} while(0) -#define _ASN_DECODE_STARVED do { \ - asn_dec_rval_t tmp_error; \ - tmp_error.code = RC_WMORE; \ - tmp_error.consumed = 0; \ - return tmp_error; \ -} while(0) + enum asn_dec_rval_code_e + { + RC_OK, /* Decoded successfully */ + RC_WMORE, /* More data expected, call again */ + RC_FAIL /* Failure to decode data */ + }; + typedef struct asn_dec_rval_s + { + enum asn_dec_rval_code_e code; /* Result code */ + size_t consumed; /* Number of bytes consumed */ + } asn_dec_rval_t; +#define _ASN_DECODE_FAILED \ + do \ + { \ + asn_dec_rval_t tmp_error; \ + tmp_error.code = RC_FAIL; \ + tmp_error.consumed = 0; \ + ASN_DEBUG("Failed to decode element %s", td->name); \ + return tmp_error; \ + } \ + while (0) +#define _ASN_DECODE_STARVED \ + do \ + { \ + asn_dec_rval_t tmp_error; \ + tmp_error.code = RC_WMORE; \ + tmp_error.consumed = 0; \ + return tmp_error; \ + } \ + while (0) #ifdef __cplusplus } #endif -#endif /* _ASN_CODECS_H_ */ +#endif /* _ASN_CODECS_H_ */ diff --git a/src/core/libs/supl/asn-supl/asn_codecs_prim.h b/src/core/libs/supl/asn-supl/asn_codecs_prim.h index 0f683fdd0..cb8c37937 100644 --- a/src/core/libs/supl/asn-supl/asn_codecs_prim.h +++ b/src/core/libs/supl/asn-supl/asn_codecs_prim.h @@ -2,52 +2,53 @@ * Copyright (c) 2004 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ -#ifndef ASN_CODECS_PRIM_H -#define ASN_CODECS_PRIM_H +#ifndef ASN_CODECS_PRIM_H +#define ASN_CODECS_PRIM_H #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -typedef struct ASN__PRIMITIVE_TYPE_s { - uint8_t *buf; /* Buffer with consecutive primitive encoding bytes */ - int size; /* Size of the buffer */ -} ASN__PRIMITIVE_TYPE_t; /* Do not use this type directly! */ + typedef struct ASN__PRIMITIVE_TYPE_s + { + uint8_t *buf; /* Buffer with consecutive primitive encoding bytes */ + int size; /* Size of the buffer */ + } ASN__PRIMITIVE_TYPE_t; /* Do not use this type directly! */ -asn_struct_free_f ASN__PRIMITIVE_TYPE_free; -ber_type_decoder_f ber_decode_primitive; -der_type_encoder_f der_encode_primitive; + asn_struct_free_f ASN__PRIMITIVE_TYPE_free; + ber_type_decoder_f ber_decode_primitive; + der_type_encoder_f der_encode_primitive; -/* + /* * A callback specification for the xer_decode_primitive() function below. */ -enum xer_pbd_rval { - XPBD_SYSTEM_FAILURE, /* System failure (memory shortage, etc) */ - XPBD_DECODER_LIMIT, /* Hit some decoder limitation or deficiency */ - XPBD_BROKEN_ENCODING, /* Encoding of a primitive body is broken */ - XPBD_NOT_BODY_IGNORE, /* Not a body format, but safe to ignore */ - XPBD_BODY_CONSUMED /* Body is recognized and consumed */ -}; -typedef enum xer_pbd_rval (xer_primitive_body_decoder_f) - (asn_TYPE_descriptor_t *td, void *struct_ptr, - const void *chunk_buf, size_t chunk_size); + enum xer_pbd_rval + { + XPBD_SYSTEM_FAILURE, /* System failure (memory shortage, etc) */ + XPBD_DECODER_LIMIT, /* Hit some decoder limitation or deficiency */ + XPBD_BROKEN_ENCODING, /* Encoding of a primitive body is broken */ + XPBD_NOT_BODY_IGNORE, /* Not a body format, but safe to ignore */ + XPBD_BODY_CONSUMED /* Body is recognized and consumed */ + }; + typedef enum xer_pbd_rval(xer_primitive_body_decoder_f)(asn_TYPE_descriptor_t *td, void *struct_ptr, + const void *chunk_buf, size_t chunk_size); -/* + /* * Specific function to decode simple primitive types. * Also see xer_decode_general() in xer_decoder.h */ -asn_dec_rval_t xer_decode_primitive(asn_codec_ctx_t *opt_codec_ctx, - asn_TYPE_descriptor_t *type_descriptor, - void **struct_ptr, size_t struct_size, - const char *opt_mname, - const void *buf_ptr, size_t size, - xer_primitive_body_decoder_f *prim_body_decoder -); + asn_dec_rval_t xer_decode_primitive(asn_codec_ctx_t *opt_codec_ctx, + asn_TYPE_descriptor_t *type_descriptor, + void **struct_ptr, size_t struct_size, + const char *opt_mname, + const void *buf_ptr, size_t size, + xer_primitive_body_decoder_f *prim_body_decoder); #ifdef __cplusplus } #endif -#endif /* ASN_CODECS_PRIM_H */ +#endif /* ASN_CODECS_PRIM_H */ diff --git a/src/core/libs/supl/asn-supl/asn_internal.h b/src/core/libs/supl/asn-supl/asn_internal.h index 249d7ef64..299c4e0e7 100644 --- a/src/core/libs/supl/asn-supl/asn_internal.h +++ b/src/core/libs/supl/asn-supl/asn_internal.h @@ -6,114 +6,130 @@ /* * Declarations internally useful for the ASN.1 support code. */ -#ifndef _ASN_INTERNAL_H_ -#define _ASN_INTERNAL_H_ +#ifndef _ASN_INTERNAL_H_ +#define _ASN_INTERNAL_H_ -#include "asn_application.h" /* Application-visible API */ +#include "asn_application.h" /* Application-visible API */ -#ifndef __NO_ASSERT_H__ /* Include assert.h only for internal use. */ -#include /* for assert() macro */ +#ifndef __NO_ASSERT_H__ /* Include assert.h only for internal use. */ +#include /* for assert() macro */ #endif -#ifdef __cplusplus -extern "C" { +#ifdef __cplusplus +extern "C" +{ #endif /* Environment version might be used to avoid running with the old library */ -#define ASN1C_ENVIRONMENT_VERSION 922 /* Compile-time version */ -int get_asn1c_environment_version(void); /* Run-time version */ +#define ASN1C_ENVIRONMENT_VERSION 922 /* Compile-time version */ + int get_asn1c_environment_version(void); /* Run-time version */ -#define CALLOC(nmemb, size) calloc(nmemb, size) -#define MALLOC(size) malloc(size) -#define REALLOC(oldptr, size) realloc(oldptr, size) -#define FREEMEM(ptr) free(ptr) +#define CALLOC(nmemb, size) calloc(nmemb, size) +#define MALLOC(size) malloc(size) +#define REALLOC(oldptr, size) realloc(oldptr, size) +#define FREEMEM(ptr) free(ptr) /* * A macro for debugging the ASN.1 internals. * You may enable or override it. */ -#ifndef ASN_DEBUG /* If debugging code is not defined elsewhere... */ -#if EMIT_ASN_DEBUG == 1 /* And it was asked to emit this code... */ -#ifdef __GNUC__ -#ifdef ASN_THREAD_SAFE -#define asn_debug_indent 0 -#else /* !ASN_THREAD_SAFE */ -int asn_debug_indent; -#endif /* ASN_THREAD_SAFE */ -#define ASN_DEBUG(fmt, args...) do { \ - int adi = asn_debug_indent; \ - while(adi--) fprintf(stderr, " "); \ - fprintf(stderr, fmt, ##args); \ - fprintf(stderr, " (%s:%d)\n", \ - __FILE__, __LINE__); \ - } while(0) -#else /* !__GNUC__ */ -void ASN_DEBUG_f(const char *fmt, ...); -#define ASN_DEBUG ASN_DEBUG_f -#endif /* __GNUC__ */ -#else /* EMIT_ASN_DEBUG != 1 */ -static inline void ASN_DEBUG(const char *fmt, ...) { (void)fmt; } -#endif /* EMIT_ASN_DEBUG */ -#endif /* ASN_DEBUG */ +#ifndef ASN_DEBUG /* If debugging code is not defined elsewhere... */ +#if EMIT_ASN_DEBUG == 1 /* And it was asked to emit this code... */ +#ifdef __GNUC__ +#ifdef ASN_THREAD_SAFE +#define asn_debug_indent 0 +#else /* !ASN_THREAD_SAFE */ + int asn_debug_indent; +#endif /* ASN_THREAD_SAFE */ +#define ASN_DEBUG(fmt, args...) \ + do \ + { \ + int adi = asn_debug_indent; \ + while (adi--) fprintf(stderr, " "); \ + fprintf(stderr, fmt, ##args); \ + fprintf(stderr, " (%s:%d)\n", \ + __FILE__, __LINE__); \ + } \ + while (0) +#else /* !__GNUC__ */ + void ASN_DEBUG_f(const char *fmt, ...); +#define ASN_DEBUG ASN_DEBUG_f +#endif /* __GNUC__ */ +#else /* EMIT_ASN_DEBUG != 1 */ + static inline void ASN_DEBUG(const char *fmt, ...) + { + (void)fmt; + } +#endif /* EMIT_ASN_DEBUG */ +#endif /* ASN_DEBUG */ /* * Invoke the application-supplied callback and fail, if something is wrong. */ -#define __ASN_E_cbc(buf, size) (cb((buf), (size), app_key) < 0) -#define _ASN_E_CALLBACK(foo) do { \ - if(foo) goto cb_failed; \ - } while(0) -#define _ASN_CALLBACK(buf, size) \ - _ASN_E_CALLBACK(__ASN_E_cbc(buf, size)) -#define _ASN_CALLBACK2(buf1, size1, buf2, size2) \ - _ASN_E_CALLBACK(__ASN_E_cbc(buf1, size1) || __ASN_E_cbc(buf2, size2)) -#define _ASN_CALLBACK3(buf1, size1, buf2, size2, buf3, size3) \ - _ASN_E_CALLBACK(__ASN_E_cbc(buf1, size1) \ - || __ASN_E_cbc(buf2, size2) \ - || __ASN_E_cbc(buf3, size3)) +#define __ASN_E_cbc(buf, size) (cb((buf), (size), app_key) < 0) +#define _ASN_E_CALLBACK(foo) \ + do \ + { \ + if (foo) goto cb_failed; \ + } \ + while (0) +#define _ASN_CALLBACK(buf, size) \ + _ASN_E_CALLBACK(__ASN_E_cbc(buf, size)) +#define _ASN_CALLBACK2(buf1, size1, buf2, size2) \ + _ASN_E_CALLBACK(__ASN_E_cbc(buf1, size1) || __ASN_E_cbc(buf2, size2)) +#define _ASN_CALLBACK3(buf1, size1, buf2, size2, buf3, size3) \ + _ASN_E_CALLBACK(__ASN_E_cbc(buf1, size1) || __ASN_E_cbc(buf2, size2) || __ASN_E_cbc(buf3, size3)) -#define _i_ASN_TEXT_INDENT(nl, level) do { \ - int __level = (level); \ - int __nl = ((nl) != 0); \ - int __i; \ - if(__nl) _ASN_CALLBACK("\n", 1); \ - if(__level < 0) __level = 0; \ - for(__i = 0; __i < __level; __i++) \ - _ASN_CALLBACK(" ", 4); \ - er.encoded += __nl + 4 * __level; \ -} while(0) +#define _i_ASN_TEXT_INDENT(nl, level) \ + do \ + { \ + int __level = (level); \ + int __nl = ((nl) != 0); \ + int __i; \ + if (__nl) _ASN_CALLBACK("\n", 1); \ + if (__level < 0) __level = 0; \ + for (__i = 0; __i < __level; __i++) \ + _ASN_CALLBACK(" ", 4); \ + er.encoded += __nl + 4 * __level; \ + } \ + while (0) -#define _i_INDENT(nl) do { \ - int __i; \ - if((nl) && cb("\n", 1, app_key) < 0) return -1; \ - for(__i = 0; __i < ilevel; __i++) \ - if(cb(" ", 4, app_key) < 0) return -1; \ -} while(0) +#define _i_INDENT(nl) \ + do \ + { \ + int __i; \ + if ((nl) && cb("\n", 1, app_key) < 0) return -1; \ + for (__i = 0; __i < ilevel; __i++) \ + if (cb(" ", 4, app_key) < 0) return -1; \ + } \ + while (0) /* * Check stack against overflow, if limit is set. */ -#define _ASN_DEFAULT_STACK_MAX (30000) -static inline int -_ASN_STACK_OVERFLOW_CHECK(asn_codec_ctx_t *ctx) { - if(ctx && ctx->max_stack_size) { +#define _ASN_DEFAULT_STACK_MAX (30000) + static inline int + _ASN_STACK_OVERFLOW_CHECK(asn_codec_ctx_t *ctx) + { + if (ctx && ctx->max_stack_size) + { + /* ctx MUST be allocated on the stack */ + ptrdiff_t usedstack = ((char *)ctx - (char *)&ctx); + if (usedstack > 0) usedstack = -usedstack; /* grows up! */ - /* ctx MUST be allocated on the stack */ - ptrdiff_t usedstack = ((char *)ctx - (char *)&ctx); - if(usedstack > 0) usedstack = -usedstack; /* grows up! */ + /* double negative required to avoid int wrap-around */ + if (usedstack < -(ptrdiff_t)ctx->max_stack_size) + { + ASN_DEBUG("Stack limit %ld reached", + (long)ctx->max_stack_size); + return -1; + } + } + return 0; + } - /* double negative required to avoid int wrap-around */ - if(usedstack < -(ptrdiff_t)ctx->max_stack_size) { - ASN_DEBUG("Stack limit %ld reached", - (long)ctx->max_stack_size); - return -1; - } - } - return 0; -} - -#ifdef __cplusplus +#ifdef __cplusplus } #endif -#endif /* _ASN_INTERNAL_H_ */ +#endif /* _ASN_INTERNAL_H_ */ diff --git a/src/core/libs/supl/asn-supl/asn_system.h b/src/core/libs/supl/asn-supl/asn_system.h index 0a9b092c3..1d2958174 100644 --- a/src/core/libs/supl/asn-supl/asn_system.h +++ b/src/core/libs/supl/asn-supl/asn_system.h @@ -6,124 +6,121 @@ /* * Miscellaneous system-dependent types. */ -#ifndef _ASN_SYSTEM_H_ -#define _ASN_SYSTEM_H_ +#ifndef _ASN_SYSTEM_H_ +#define _ASN_SYSTEM_H_ -#ifdef HAVE_CONFIG_H +#ifdef HAVE_CONFIG_H #include "config.h" #endif -#include /* For snprintf(3) */ -#include /* For *alloc(3) */ -#include /* For memcpy(3) */ -#include /* For size_t */ -#include /* For LONG_MAX */ -#include /* For va_start */ -#include /* for offsetof and ptrdiff_t */ +#include /* For snprintf(3) */ +#include /* For *alloc(3) */ +#include /* For memcpy(3) */ +#include /* For size_t */ +#include /* For LONG_MAX */ +#include /* For va_start */ +#include /* for offsetof and ptrdiff_t */ -#ifdef WIN32 +#ifdef WIN32 #include -#define snprintf _snprintf -#define vsnprintf _vsnprintf +#define snprintf _snprintf +#define vsnprintf _vsnprintf /* To avoid linking with ws2_32.lib, here's the definition of ntohl() */ -#define sys_ntohl(l) ((((l) << 24) & 0xff000000) \ - | (((l) << 16) & 0xff0000) \ - | (((l) << 8) & 0xff00) \ - | ((l) & 0xff)) +#define sys_ntohl(l) ((((l) << 24) & 0xff000000) | (((l) << 16) & 0xff0000) | (((l) << 8) & 0xff00) | ((l)&0xff)) -#ifdef _MSC_VER /* MSVS.Net */ +#ifdef _MSC_VER /* MSVS.Net */ #ifndef __cplusplus #define inline __inline #endif -#ifndef ASSUMESTDTYPES /* Standard types have been defined elsewhere */ -#define ssize_t SSIZE_T -typedef char int8_t; -typedef short int16_t; -typedef int int32_t; -typedef unsigned char uint8_t; -typedef unsigned short uint16_t; -typedef unsigned int uint32_t; -#endif /* ASSUMESTDTYPES */ +#ifndef ASSUMESTDTYPES /* Standard types have been defined elsewhere */ +#define ssize_t SSIZE_T +typedef char int8_t; +typedef short int16_t; +typedef int int32_t; +typedef unsigned char uint8_t; +typedef unsigned short uint16_t; +typedef unsigned int uint32_t; +#endif /* ASSUMESTDTYPES */ #define WIN32_LEAN_AND_MEAN #include #include #define isnan _isnan #define finite _finite #define copysign _copysign -#define ilogb _logb -#else /* !_MSC_VER */ +#define ilogb _logb +#else /* !_MSC_VER */ #include -#endif /* _MSC_VER */ +#endif /* _MSC_VER */ -#else /* !WIN32 */ +#else /* !WIN32 */ #if defined(__vxworks) #include -#else /* !defined(__vxworks) */ +#else /* !defined(__vxworks) */ -#include /* C99 specifies this file */ +#include /* C99 specifies this file */ /* * 1. Earlier FreeBSD version didn't have , * but was present. * 2. Sun Solaris requires for alloca(3), * but does not have . */ -#if (!defined(__FreeBSD__) || !defined(_SYS_INTTYPES_H_)) -#if defined(sun) -#include /* For alloca(3) */ -#include /* for finite(3) */ -#elif defined(__hpux) -#ifdef __GNUC__ -#include /* For alloca(3) */ -#else /* !__GNUC__ */ +#if (!defined(__FreeBSD__) || !defined(_SYS_INTTYPES_H_)) +#if defined(sun) +#include /* For alloca(3) */ +#include /* for finite(3) */ +#elif defined(__hpux) +#ifdef __GNUC__ +#include /* For alloca(3) */ +#else /* !__GNUC__ */ #define inline -#endif /* __GNUC__ */ +#endif /* __GNUC__ */ #else -#include /* SUSv2+ and C99 specify this file, for uintXX_t */ -#endif /* defined(sun) */ +#include /* SUSv2+ and C99 specify this file, for uintXX_t */ +#endif /* defined(sun) */ #endif #include /* for ntohl() */ -#define sys_ntohl(foo) ntohl(foo) +#define sys_ntohl(foo) ntohl(foo) -#endif /* defined(__vxworks) */ +#endif /* defined(__vxworks) */ -#endif /* WIN32 */ +#endif /* WIN32 */ -#if __GNUC__ >= 3 -#ifndef GCC_PRINTFLIKE -#define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var))) +#if __GNUC__ >= 3 +#ifndef GCC_PRINTFLIKE +#define GCC_PRINTFLIKE(fmt, var) __attribute__((format(printf, fmt, var))) #endif -#ifndef GCC_NOTUSED -#define GCC_NOTUSED __attribute__((unused)) +#ifndef GCC_NOTUSED +#define GCC_NOTUSED __attribute__((unused)) #endif #else -#ifndef GCC_PRINTFLIKE -#define GCC_PRINTFLIKE(fmt,var) /* nothing */ +#ifndef GCC_PRINTFLIKE +#define GCC_PRINTFLIKE(fmt, var) /* nothing */ #endif -#ifndef GCC_NOTUSED -#define GCC_NOTUSED +#ifndef GCC_NOTUSED +#define GCC_NOTUSED #endif #endif /* Figure out if thread safety is requested */ #if !defined(ASN_THREAD_SAFE) && (defined(THREAD_SAFE) || defined(_REENTRANT)) -#define ASN_THREAD_SAFE -#endif /* Thread safety */ +#define ASN_THREAD_SAFE +#endif /* Thread safety */ -#ifndef offsetof /* If not defined by */ -#define offsetof(s, m) ((ptrdiff_t)&(((s *)0)->m) - (ptrdiff_t)((s *)0)) -#endif /* offsetof */ +#ifndef offsetof /* If not defined by */ +#define offsetof(s, m) ((ptrdiff_t) & (((s *)0)->m) - (ptrdiff_t)((s *)0)) +#endif /* offsetof */ -#ifndef MIN /* Suitable for comparing primitive types (integers) */ +#ifndef MIN /* Suitable for comparing primitive types (integers) */ #if defined(__GNUC__) -#define MIN(a,b) ({ __typeof a _a = a; __typeof b _b = b; \ +#define MIN(a, b) ({ __typeof a _a = a; __typeof b _b = b; \ ((_a)<(_b)?(_a):(_b)); }) -#else /* !__GNUC__ */ -#define MIN(a,b) ((a)<(b)?(a):(b)) /* Unsafe variant */ -#endif /* __GNUC__ */ -#endif /* MIN */ +#else /* !__GNUC__ */ +#define MIN(a, b) ((a) < (b) ? (a) : (b)) /* Unsafe variant */ +#endif /* __GNUC__ */ +#endif /* MIN */ -#endif /* _ASN_SYSTEM_H_ */ +#endif /* _ASN_SYSTEM_H_ */ diff --git a/src/core/libs/supl/asn-supl/ber_decoder.h b/src/core/libs/supl/asn-supl/ber_decoder.h index 9fe2e895d..6a87fc23f 100644 --- a/src/core/libs/supl/asn-supl/ber_decoder.h +++ b/src/core/libs/supl/asn-supl/ber_decoder.h @@ -2,63 +2,64 @@ * Copyright (c) 2003, 2004 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ -#ifndef _BER_DECODER_H_ -#define _BER_DECODER_H_ +#ifndef _BER_DECODER_H_ +#define _BER_DECODER_H_ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -struct asn_TYPE_descriptor_s; /* Forward declaration */ -struct asn_codec_ctx_s; /* Forward declaration */ + struct asn_TYPE_descriptor_s; /* Forward declaration */ + struct asn_codec_ctx_s; /* Forward declaration */ -/* + /* * The BER decoder of any type. * This function may be invoked directly from the application. * The der_encode() function (der_encoder.h) is an opposite to ber_decode(). */ -asn_dec_rval_t ber_decode(struct asn_codec_ctx_s *opt_codec_ctx, - struct asn_TYPE_descriptor_s *type_descriptor, - void **struct_ptr, /* Pointer to a target structure's pointer */ - const void *buffer, /* Data to be decoded */ - size_t size /* Size of that buffer */ - ); + asn_dec_rval_t ber_decode(struct asn_codec_ctx_s *opt_codec_ctx, + struct asn_TYPE_descriptor_s *type_descriptor, + void **struct_ptr, /* Pointer to a target structure's pointer */ + const void *buffer, /* Data to be decoded */ + size_t size /* Size of that buffer */ + ); -/* + /* * Type of generic function which decodes the byte stream into the structure. */ -typedef asn_dec_rval_t (ber_type_decoder_f)( - struct asn_codec_ctx_s *opt_codec_ctx, - struct asn_TYPE_descriptor_s *type_descriptor, - void **struct_ptr, const void *buf_ptr, size_t size, - int tag_mode); + typedef asn_dec_rval_t(ber_type_decoder_f)( + struct asn_codec_ctx_s *opt_codec_ctx, + struct asn_TYPE_descriptor_s *type_descriptor, + void **struct_ptr, const void *buf_ptr, size_t size, + int tag_mode); -/******************************* + /******************************* * INTERNALLY USEFUL FUNCTIONS * *******************************/ -/* + /* * Check that all tags correspond to the type definition (as given in head). * On return, last_length would contain either a non-negative length of the * value part of the last TLV, or the negative number of expected * "end of content" sequences. The number may only be negative if the * head->last_tag_form is non-zero. */ -asn_dec_rval_t ber_check_tags( - struct asn_codec_ctx_s *opt_codec_ctx, /* codec options */ - struct asn_TYPE_descriptor_s *type_descriptor, - asn_struct_ctx_t *opt_ctx, /* saved decoding context */ - const void *ptr, size_t size, - int tag_mode, /* {-1,0,1}: IMPLICIT, no, EXPLICIT */ - int last_tag_form, /* {-1,0:1}: any, primitive, constr */ - ber_tlv_len_t *last_length, - int *opt_tlv_form /* optional tag form */ - ); + asn_dec_rval_t ber_check_tags( + struct asn_codec_ctx_s *opt_codec_ctx, /* codec options */ + struct asn_TYPE_descriptor_s *type_descriptor, + asn_struct_ctx_t *opt_ctx, /* saved decoding context */ + const void *ptr, size_t size, + int tag_mode, /* {-1,0,1}: IMPLICIT, no, EXPLICIT */ + int last_tag_form, /* {-1,0:1}: any, primitive, constr */ + ber_tlv_len_t *last_length, + int *opt_tlv_form /* optional tag form */ + ); #ifdef __cplusplus } #endif -#endif /* _BER_DECODER_H_ */ +#endif /* _BER_DECODER_H_ */ diff --git a/src/core/libs/supl/asn-supl/ber_tlv_length.h b/src/core/libs/supl/asn-supl/ber_tlv_length.h index 349680224..7245624cd 100644 --- a/src/core/libs/supl/asn-supl/ber_tlv_length.h +++ b/src/core/libs/supl/asn-supl/ber_tlv_length.h @@ -2,16 +2,17 @@ * Copyright (c) 2003 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ -#ifndef _BER_TLV_LENGTH_H_ -#define _BER_TLV_LENGTH_H_ +#ifndef _BER_TLV_LENGTH_H_ +#define _BER_TLV_LENGTH_H_ #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -typedef ssize_t ber_tlv_len_t; + typedef ssize_t ber_tlv_len_t; -/* + /* * This function tries to fetch the length of the BER TLV value and place it * in *len_r. * RETURN VALUES: @@ -21,30 +22,30 @@ typedef ssize_t ber_tlv_len_t; * On return with >0, len_r is constrained as -1..MAX, where -1 mean * that the value is of indefinite length. */ -ssize_t ber_fetch_length(int _is_constructed, const void *bufptr, size_t size, - ber_tlv_len_t *len_r); + ssize_t ber_fetch_length(int _is_constructed, const void *bufptr, size_t size, + ber_tlv_len_t *len_r); -/* + /* * This function expects bufptr to be positioned over L in TLV. * It returns number of bytes occupied by L and V together, suitable * for skipping. The function properly handles indefinite length. * RETURN VALUES: * Standard {-1,0,>0} convention. */ -ssize_t ber_skip_length( - struct asn_codec_ctx_s *opt_codec_ctx, /* optional context */ - int _is_constructed, const void *bufptr, size_t size); + ssize_t ber_skip_length( + struct asn_codec_ctx_s *opt_codec_ctx, /* optional context */ + int _is_constructed, const void *bufptr, size_t size); -/* + /* * This function serializes the length (L from TLV) in DER format. * It always returns number of bytes necessary to represent the length, * it is a caller's responsibility to check the return value * against the supplied buffer's size. */ -size_t der_tlv_length_serialize(ber_tlv_len_t len, void *bufptr, size_t size); + size_t der_tlv_length_serialize(ber_tlv_len_t len, void *bufptr, size_t size); #ifdef __cplusplus } #endif -#endif /* _BER_TLV_LENGTH_H_ */ +#endif /* _BER_TLV_LENGTH_H_ */ diff --git a/src/core/libs/supl/asn-supl/ber_tlv_tag.h b/src/core/libs/supl/asn-supl/ber_tlv_tag.h index 60e866861..31b634345 100644 --- a/src/core/libs/supl/asn-supl/ber_tlv_tag.h +++ b/src/core/libs/supl/asn-supl/ber_tlv_tag.h @@ -2,59 +2,61 @@ * Copyright (c) 2003, 2004 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ -#ifndef _BER_TLV_TAG_H_ -#define _BER_TLV_TAG_H_ +#ifndef _BER_TLV_TAG_H_ +#define _BER_TLV_TAG_H_ #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -enum asn_tag_class { - ASN_TAG_CLASS_UNIVERSAL = 0, /* 0b00 */ - ASN_TAG_CLASS_APPLICATION = 1, /* 0b01 */ - ASN_TAG_CLASS_CONTEXT = 2, /* 0b10 */ - ASN_TAG_CLASS_PRIVATE = 3 /* 0b11 */ -}; -typedef unsigned ber_tlv_tag_t; /* BER TAG from Tag-Length-Value */ + enum asn_tag_class + { + ASN_TAG_CLASS_UNIVERSAL = 0, /* 0b00 */ + ASN_TAG_CLASS_APPLICATION = 1, /* 0b01 */ + ASN_TAG_CLASS_CONTEXT = 2, /* 0b10 */ + ASN_TAG_CLASS_PRIVATE = 3 /* 0b11 */ + }; + typedef unsigned ber_tlv_tag_t; /* BER TAG from Tag-Length-Value */ /* * Tag class is encoded together with tag value for optimization purposes. */ -#define BER_TAG_CLASS(tag) ((tag) & 0x3) -#define BER_TAG_VALUE(tag) ((tag) >> 2) -#define BER_TLV_CONSTRUCTED(tagptr) (((*(const uint8_t *)tagptr)&0x20)?1:0) +#define BER_TAG_CLASS(tag) ((tag)&0x3) +#define BER_TAG_VALUE(tag) ((tag) >> 2) +#define BER_TLV_CONSTRUCTED(tagptr) (((*(const uint8_t *)tagptr) & 0x20) ? 1 : 0) -#define BER_TAGS_EQUAL(tag1, tag2) ((tag1) == (tag2)) +#define BER_TAGS_EQUAL(tag1, tag2) ((tag1) == (tag2)) -/* + /* * Several functions for printing the TAG in the canonical form * (i.e. "[PRIVATE 0]"). * Return values correspond to their libc counterparts (if any). */ -ssize_t ber_tlv_tag_snprint(ber_tlv_tag_t tag, char *buf, size_t buflen); -ssize_t ber_tlv_tag_fwrite(ber_tlv_tag_t tag, FILE *); -char *ber_tlv_tag_string(ber_tlv_tag_t tag); + ssize_t ber_tlv_tag_snprint(ber_tlv_tag_t tag, char *buf, size_t buflen); + ssize_t ber_tlv_tag_fwrite(ber_tlv_tag_t tag, FILE *); + char *ber_tlv_tag_string(ber_tlv_tag_t tag); -/* + /* * This function tries to fetch the tag from the input stream. * RETURN VALUES: * 0: More data expected than bufptr contains. * -1: Fatal error deciphering tag. * >0: Number of bytes used from bufptr. tag_r will contain the tag. */ -ssize_t ber_fetch_tag(const void *bufptr, size_t size, ber_tlv_tag_t *tag_r); + ssize_t ber_fetch_tag(const void *bufptr, size_t size, ber_tlv_tag_t *tag_r); -/* + /* * This function serializes the tag (T from TLV) in BER format. * It always returns number of bytes necessary to represent the tag, * it is a caller's responsibility to check the return value * against the supplied buffer's size. */ -size_t ber_tlv_tag_serialize(ber_tlv_tag_t tag, void *bufptr, size_t size); + size_t ber_tlv_tag_serialize(ber_tlv_tag_t tag, void *bufptr, size_t size); #ifdef __cplusplus } #endif -#endif /* _BER_TLV_TAG_H_ */ +#endif /* _BER_TLV_TAG_H_ */ diff --git a/src/core/libs/supl/asn-supl/constr_CHOICE.h b/src/core/libs/supl/asn-supl/constr_CHOICE.h index 83404e6d4..264018481 100644 --- a/src/core/libs/supl/asn-supl/constr_CHOICE.h +++ b/src/core/libs/supl/asn-supl/constr_CHOICE.h @@ -3,55 +3,57 @@ * All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ -#ifndef _CONSTR_CHOICE_H_ -#define _CONSTR_CHOICE_H_ +#ifndef _CONSTR_CHOICE_H_ +#define _CONSTR_CHOICE_H_ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -typedef struct asn_CHOICE_specifics_s { - /* + typedef struct asn_CHOICE_specifics_s + { + /* * Target structure description. */ - int struct_size; /* Size of the target structure. */ - int ctx_offset; /* Offset of the asn_codec_ctx_t member */ - int pres_offset; /* Identifier of the present member */ - int pres_size; /* Size of the identifier (enum) */ + int struct_size; /* Size of the target structure. */ + int ctx_offset; /* Offset of the asn_codec_ctx_t member */ + int pres_offset; /* Identifier of the present member */ + int pres_size; /* Size of the identifier (enum) */ - /* + /* * Tags to members mapping table. */ - asn_TYPE_tag2member_t *tag2el; - int tag2el_count; + asn_TYPE_tag2member_t *tag2el; + int tag2el_count; - /* Canonical ordering of CHOICE elements, for PER */ - int *canonical_order; + /* Canonical ordering of CHOICE elements, for PER */ + int *canonical_order; - /* + /* * Extensions-related stuff. */ - int ext_start; /* First member of extensions, or -1 */ -} asn_CHOICE_specifics_t; + int ext_start; /* First member of extensions, or -1 */ + } asn_CHOICE_specifics_t; -/* + /* * A set specialized functions dealing with the CHOICE type. */ -asn_struct_free_f CHOICE_free; -asn_struct_print_f CHOICE_print; -asn_constr_check_f CHOICE_constraint; -ber_type_decoder_f CHOICE_decode_ber; -der_type_encoder_f CHOICE_encode_der; -xer_type_decoder_f CHOICE_decode_xer; -xer_type_encoder_f CHOICE_encode_xer; -per_type_decoder_f CHOICE_decode_uper; -per_type_encoder_f CHOICE_encode_uper; -asn_outmost_tag_f CHOICE_outmost_tag; + asn_struct_free_f CHOICE_free; + asn_struct_print_f CHOICE_print; + asn_constr_check_f CHOICE_constraint; + ber_type_decoder_f CHOICE_decode_ber; + der_type_encoder_f CHOICE_encode_der; + xer_type_decoder_f CHOICE_decode_xer; + xer_type_encoder_f CHOICE_encode_xer; + per_type_decoder_f CHOICE_decode_uper; + per_type_encoder_f CHOICE_encode_uper; + asn_outmost_tag_f CHOICE_outmost_tag; #ifdef __cplusplus } #endif -#endif /* _CONSTR_CHOICE_H_ */ +#endif /* _CONSTR_CHOICE_H_ */ diff --git a/src/core/libs/supl/asn-supl/constr_SEQUENCE.h b/src/core/libs/supl/asn-supl/constr_SEQUENCE.h index 5f589d5c1..e2664a123 100644 --- a/src/core/libs/supl/asn-supl/constr_SEQUENCE.h +++ b/src/core/libs/supl/asn-supl/constr_SEQUENCE.h @@ -2,59 +2,61 @@ * Copyright (c) 2003, 2004 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ -#ifndef _CONSTR_SEQUENCE_H_ -#define _CONSTR_SEQUENCE_H_ +#ifndef _CONSTR_SEQUENCE_H_ +#define _CONSTR_SEQUENCE_H_ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -typedef struct asn_SEQUENCE_specifics_s { - /* + typedef struct asn_SEQUENCE_specifics_s + { + /* * Target structure description. */ - int struct_size; /* Size of the target structure. */ - int ctx_offset; /* Offset of the asn_struct_ctx_t member */ + int struct_size; /* Size of the target structure. */ + int ctx_offset; /* Offset of the asn_struct_ctx_t member */ - /* + /* * Tags to members mapping table (sorted). */ - asn_TYPE_tag2member_t *tag2el; - int tag2el_count; + asn_TYPE_tag2member_t *tag2el; + int tag2el_count; - /* + /* * Optional members of the extensions root (roms) or additions (aoms). * Meaningful for PER. */ - int *oms; /* Optional MemberS */ - int roms_count; /* Root optional members count */ - int aoms_count; /* Additions optional members count */ + int *oms; /* Optional MemberS */ + int roms_count; /* Root optional members count */ + int aoms_count; /* Additions optional members count */ - /* + /* * Description of an extensions group. */ - int ext_after; /* Extensions start after this member */ - int ext_before; /* Extensions stop before this member */ -} asn_SEQUENCE_specifics_t; + int ext_after; /* Extensions start after this member */ + int ext_before; /* Extensions stop before this member */ + } asn_SEQUENCE_specifics_t; -/* + /* * A set specialized functions dealing with the SEQUENCE type. */ -asn_struct_free_f SEQUENCE_free; -asn_struct_print_f SEQUENCE_print; -asn_constr_check_f SEQUENCE_constraint; -ber_type_decoder_f SEQUENCE_decode_ber; -der_type_encoder_f SEQUENCE_encode_der; -xer_type_decoder_f SEQUENCE_decode_xer; -xer_type_encoder_f SEQUENCE_encode_xer; -per_type_decoder_f SEQUENCE_decode_uper; -per_type_encoder_f SEQUENCE_encode_uper; + asn_struct_free_f SEQUENCE_free; + asn_struct_print_f SEQUENCE_print; + asn_constr_check_f SEQUENCE_constraint; + ber_type_decoder_f SEQUENCE_decode_ber; + der_type_encoder_f SEQUENCE_encode_der; + xer_type_decoder_f SEQUENCE_decode_xer; + xer_type_encoder_f SEQUENCE_encode_xer; + per_type_decoder_f SEQUENCE_decode_uper; + per_type_encoder_f SEQUENCE_encode_uper; #ifdef __cplusplus } #endif -#endif /* _CONSTR_SEQUENCE_H_ */ +#endif /* _CONSTR_SEQUENCE_H_ */ diff --git a/src/core/libs/supl/asn-supl/constr_SEQUENCE_OF.h b/src/core/libs/supl/asn-supl/constr_SEQUENCE_OF.h index e2272f326..927ed5163 100644 --- a/src/core/libs/supl/asn-supl/constr_SEQUENCE_OF.h +++ b/src/core/libs/supl/asn-supl/constr_SEQUENCE_OF.h @@ -2,32 +2,33 @@ * Copyright (c) 2003, 2005 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ -#ifndef _CONSTR_SEQUENCE_OF_H_ -#define _CONSTR_SEQUENCE_OF_H_ +#ifndef _CONSTR_SEQUENCE_OF_H_ +#define _CONSTR_SEQUENCE_OF_H_ #include -#include /* Implemented using SET OF */ +#include /* Implemented using SET OF */ #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif /* * A set specialized functions dealing with the SEQUENCE OF type. * Generally implemented using SET OF. */ -#define SEQUENCE_OF_free SET_OF_free -#define SEQUENCE_OF_print SET_OF_print -#define SEQUENCE_OF_constraint SET_OF_constraint -#define SEQUENCE_OF_decode_ber SET_OF_decode_ber -#define SEQUENCE_OF_decode_xer SET_OF_decode_xer -#define SEQUENCE_OF_decode_uper SET_OF_decode_uper -der_type_encoder_f SEQUENCE_OF_encode_der; -xer_type_encoder_f SEQUENCE_OF_encode_xer; -per_type_encoder_f SEQUENCE_OF_encode_uper; +#define SEQUENCE_OF_free SET_OF_free +#define SEQUENCE_OF_print SET_OF_print +#define SEQUENCE_OF_constraint SET_OF_constraint +#define SEQUENCE_OF_decode_ber SET_OF_decode_ber +#define SEQUENCE_OF_decode_xer SET_OF_decode_xer +#define SEQUENCE_OF_decode_uper SET_OF_decode_uper + der_type_encoder_f SEQUENCE_OF_encode_der; + xer_type_encoder_f SEQUENCE_OF_encode_xer; + per_type_encoder_f SEQUENCE_OF_encode_uper; #ifdef __cplusplus } #endif -#endif /* _CONSTR_SET_OF_H_ */ +#endif /* _CONSTR_SET_OF_H_ */ diff --git a/src/core/libs/supl/asn-supl/constr_SET_OF.h b/src/core/libs/supl/asn-supl/constr_SET_OF.h index bcd096629..52b446281 100644 --- a/src/core/libs/supl/asn-supl/constr_SET_OF.h +++ b/src/core/libs/supl/asn-supl/constr_SET_OF.h @@ -2,41 +2,43 @@ * Copyright (c) 2003 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ -#ifndef _CONSTR_SET_OF_H_ -#define _CONSTR_SET_OF_H_ +#ifndef _CONSTR_SET_OF_H_ +#define _CONSTR_SET_OF_H_ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -typedef struct asn_SET_OF_specifics_s { - /* + typedef struct asn_SET_OF_specifics_s + { + /* * Target structure description. */ - int struct_size; /* Size of the target structure. */ - int ctx_offset; /* Offset of the asn_struct_ctx_t member */ + int struct_size; /* Size of the target structure. */ + int ctx_offset; /* Offset of the asn_struct_ctx_t member */ - /* XER-specific stuff */ - int as_XMLValueList; /* The member type must be encoded like this */ -} asn_SET_OF_specifics_t; + /* XER-specific stuff */ + int as_XMLValueList; /* The member type must be encoded like this */ + } asn_SET_OF_specifics_t; -/* + /* * A set specialized functions dealing with the SET OF type. */ -asn_struct_free_f SET_OF_free; -asn_struct_print_f SET_OF_print; -asn_constr_check_f SET_OF_constraint; -ber_type_decoder_f SET_OF_decode_ber; -der_type_encoder_f SET_OF_encode_der; -xer_type_decoder_f SET_OF_decode_xer; -xer_type_encoder_f SET_OF_encode_xer; -per_type_decoder_f SET_OF_decode_uper; -per_type_encoder_f SET_OF_encode_uper; + asn_struct_free_f SET_OF_free; + asn_struct_print_f SET_OF_print; + asn_constr_check_f SET_OF_constraint; + ber_type_decoder_f SET_OF_decode_ber; + der_type_encoder_f SET_OF_encode_der; + xer_type_decoder_f SET_OF_decode_xer; + xer_type_encoder_f SET_OF_encode_xer; + per_type_decoder_f SET_OF_decode_uper; + per_type_encoder_f SET_OF_encode_uper; #ifdef __cplusplus } #endif -#endif /* _CONSTR_SET_OF_H_ */ +#endif /* _CONSTR_SET_OF_H_ */ diff --git a/src/core/libs/supl/asn-supl/constr_TYPE.h b/src/core/libs/supl/asn-supl/constr_TYPE.h index 95507c809..0641f003c 100644 --- a/src/core/libs/supl/asn-supl/constr_TYPE.h +++ b/src/core/libs/supl/asn-supl/constr_TYPE.h @@ -9,158 +9,164 @@ * This structure even contains pointer to these encoding and decoding routines * for each defined ASN.1 type. */ -#ifndef _CONSTR_TYPE_H_ -#define _CONSTR_TYPE_H_ +#ifndef _CONSTR_TYPE_H_ +#define _CONSTR_TYPE_H_ #include #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -struct asn_TYPE_descriptor_s; /* Forward declaration */ -struct asn_TYPE_member_s; /* Forward declaration */ + struct asn_TYPE_descriptor_s; /* Forward declaration */ + struct asn_TYPE_member_s; /* Forward declaration */ -/* + /* * This type provides the context information for various ASN.1 routines, * primarily ones doing decoding. A member _asn_ctx of this type must be * included into certain target language's structures, such as compound types. */ -typedef struct asn_struct_ctx_s { - short phase; /* Decoding phase */ - short step; /* Elementary step of a phase */ - int context; /* Other context information */ - void *ptr; /* Decoder-specific stuff (stack elements) */ - ber_tlv_len_t left; /* Number of bytes left, -1 for indefinite */ -} asn_struct_ctx_t; + typedef struct asn_struct_ctx_s + { + short phase; /* Decoding phase */ + short step; /* Elementary step of a phase */ + int context; /* Other context information */ + void *ptr; /* Decoder-specific stuff (stack elements) */ + ber_tlv_len_t left; /* Number of bytes left, -1 for indefinite */ + } asn_struct_ctx_t; -#include /* Basic Encoding Rules decoder */ -#include /* Distinguished Encoding Rules encoder */ -#include /* Decoder of XER (XML, text) */ -#include /* Encoder into XER (XML, text) */ -#include /* Packet Encoding Rules decoder */ -#include /* Packet Encoding Rules encoder */ -#include /* Subtype constraints support */ +#include /* Basic Encoding Rules decoder */ +#include /* Distinguished Encoding Rules encoder */ +#include /* Decoder of XER (XML, text) */ +#include /* Encoder into XER (XML, text) */ +#include /* Packet Encoding Rules decoder */ +#include /* Packet Encoding Rules encoder */ +#include /* Subtype constraints support */ -/* + /* * Free the structure according to its specification. * If (free_contents_only) is set, the wrapper structure itself (struct_ptr) * will not be freed. (It may be useful in case the structure is allocated * statically or arranged on the stack, yet its elements are allocated * dynamically.) */ -typedef void (asn_struct_free_f)( - struct asn_TYPE_descriptor_s *type_descriptor, - void *struct_ptr, int free_contents_only); -#define ASN_STRUCT_FREE(asn_DEF, ptr) (asn_DEF).free_struct(&(asn_DEF),ptr,0) -#define ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF, ptr) \ - (asn_DEF).free_struct(&(asn_DEF),ptr,1) + typedef void(asn_struct_free_f)( + struct asn_TYPE_descriptor_s *type_descriptor, + void *struct_ptr, int free_contents_only); +#define ASN_STRUCT_FREE(asn_DEF, ptr) (asn_DEF).free_struct(&(asn_DEF), ptr, 0) +#define ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF, ptr) \ + (asn_DEF).free_struct(&(asn_DEF), ptr, 1) -/* + /* * Print the structure according to its specification. */ -typedef int (asn_struct_print_f)( - struct asn_TYPE_descriptor_s *type_descriptor, - const void *struct_ptr, - int level, /* Indentation level */ - asn_app_consume_bytes_f *callback, void *app_key); + typedef int(asn_struct_print_f)( + struct asn_TYPE_descriptor_s *type_descriptor, + const void *struct_ptr, + int level, /* Indentation level */ + asn_app_consume_bytes_f *callback, void *app_key); -/* + /* * Return the outmost tag of the type. * If the type is untagged CHOICE, the dynamic operation is performed. * NOTE: This function pointer type is only useful internally. * Do not use it in your application. */ -typedef ber_tlv_tag_t (asn_outmost_tag_f)( - struct asn_TYPE_descriptor_s *type_descriptor, - const void *struct_ptr, int tag_mode, ber_tlv_tag_t tag); -/* The instance of the above function type; used internally. */ -asn_outmost_tag_f asn_TYPE_outmost_tag; + typedef ber_tlv_tag_t(asn_outmost_tag_f)( + struct asn_TYPE_descriptor_s *type_descriptor, + const void *struct_ptr, int tag_mode, ber_tlv_tag_t tag); + /* The instance of the above function type; used internally. */ + asn_outmost_tag_f asn_TYPE_outmost_tag; - -/* + + /* * The definitive description of the destination language's structure. */ -typedef struct asn_TYPE_descriptor_s { - char *name; /* A name of the ASN.1 type. "" in some cases. */ - char *xml_tag; /* Name used in XML tag */ + typedef struct asn_TYPE_descriptor_s + { + char *name; /* A name of the ASN.1 type. "" in some cases. */ + char *xml_tag; /* Name used in XML tag */ - /* + /* * Generalized functions for dealing with the specific type. * May be directly invoked by applications. */ - asn_struct_free_f *free_struct; /* Free the structure */ - asn_struct_print_f *print_struct; /* Human readable output */ - asn_constr_check_f *check_constraints; /* Constraints validator */ - ber_type_decoder_f *ber_decoder; /* Generic BER decoder */ - der_type_encoder_f *der_encoder; /* Canonical DER encoder */ - xer_type_decoder_f *xer_decoder; /* Generic XER decoder */ - xer_type_encoder_f *xer_encoder; /* [Canonical] XER encoder */ - per_type_decoder_f *uper_decoder; /* Unaligned PER decoder */ - per_type_encoder_f *uper_encoder; /* Unaligned PER encoder */ + asn_struct_free_f *free_struct; /* Free the structure */ + asn_struct_print_f *print_struct; /* Human readable output */ + asn_constr_check_f *check_constraints; /* Constraints validator */ + ber_type_decoder_f *ber_decoder; /* Generic BER decoder */ + der_type_encoder_f *der_encoder; /* Canonical DER encoder */ + xer_type_decoder_f *xer_decoder; /* Generic XER decoder */ + xer_type_encoder_f *xer_encoder; /* [Canonical] XER encoder */ + per_type_decoder_f *uper_decoder; /* Unaligned PER decoder */ + per_type_encoder_f *uper_encoder; /* Unaligned PER encoder */ - /*********************************************************************** + /*********************************************************************** * Internally useful members. Not to be used by applications directly. * **********************************************************************/ - /* + /* * Tags that are expected to occur. */ - asn_outmost_tag_f *outmost_tag; /* */ - ber_tlv_tag_t *tags; /* Effective tags sequence for this type */ - int tags_count; /* Number of tags which are expected */ - ber_tlv_tag_t *all_tags;/* Every tag for BER/containment */ - int all_tags_count; /* Number of tags */ + asn_outmost_tag_f *outmost_tag; /* */ + ber_tlv_tag_t *tags; /* Effective tags sequence for this type */ + int tags_count; /* Number of tags which are expected */ + ber_tlv_tag_t *all_tags; /* Every tag for BER/containment */ + int all_tags_count; /* Number of tags */ - asn_per_constraints_t *per_constraints; /* PER compiled constraints */ + asn_per_constraints_t *per_constraints; /* PER compiled constraints */ - /* + /* * An ASN.1 production type members (members of SEQUENCE, SET, CHOICE). */ - struct asn_TYPE_member_s *elements; - int elements_count; + struct asn_TYPE_member_s *elements; + int elements_count; - /* + /* * Additional information describing the type, used by appropriate * functions above. */ - void *specifics; -} asn_TYPE_descriptor_t; + void *specifics; + } asn_TYPE_descriptor_t; -/* + /* * This type describes an element of the constructed type, * i.e. SEQUENCE, SET, CHOICE, etc. */ - enum asn_TYPE_flags_e { - ATF_NOFLAGS, - ATF_POINTER = 0x01, /* Represented by the pointer */ - ATF_OPEN_TYPE = 0x02 /* ANY type, without meaningful tag */ - }; -typedef struct asn_TYPE_member_s { - enum asn_TYPE_flags_e flags; /* Element's presentation flags */ - int optional; /* Following optional members, including current */ - int memb_offset; /* Offset of the element */ - ber_tlv_tag_t tag; /* Outmost (most immediate) tag */ - int tag_mode; /* IMPLICIT/no/EXPLICIT tag at current level */ - asn_TYPE_descriptor_t *type; /* Member type descriptor */ - asn_constr_check_f *memb_constraints; /* Constraints validator */ - asn_per_constraints_t *per_constraints; /* PER compiled constraints */ - int (*default_value)(int setval, void **sptr); /* DEFAULT */ - char *name; /* ASN.1 identifier of the element */ -} asn_TYPE_member_t; + enum asn_TYPE_flags_e + { + ATF_NOFLAGS, + ATF_POINTER = 0x01, /* Represented by the pointer */ + ATF_OPEN_TYPE = 0x02 /* ANY type, without meaningful tag */ + }; + typedef struct asn_TYPE_member_s + { + enum asn_TYPE_flags_e flags; /* Element's presentation flags */ + int optional; /* Following optional members, including current */ + int memb_offset; /* Offset of the element */ + ber_tlv_tag_t tag; /* Outmost (most immediate) tag */ + int tag_mode; /* IMPLICIT/no/EXPLICIT tag at current level */ + asn_TYPE_descriptor_t *type; /* Member type descriptor */ + asn_constr_check_f *memb_constraints; /* Constraints validator */ + asn_per_constraints_t *per_constraints; /* PER compiled constraints */ + int (*default_value)(int setval, void **sptr); /* DEFAULT */ + char *name; /* ASN.1 identifier of the element */ + } asn_TYPE_member_t; -/* + /* * BER tag to element number mapping. */ -typedef struct asn_TYPE_tag2member_s { - ber_tlv_tag_t el_tag; /* Outmost tag of the member */ - int el_no; /* Index of the associated member, base 0 */ - int toff_first; /* First occurence of the el_tag, relative */ - int toff_last; /* Last occurence of the el_tag, relatvie */ -} asn_TYPE_tag2member_t; + typedef struct asn_TYPE_tag2member_s + { + ber_tlv_tag_t el_tag; /* Outmost tag of the member */ + int el_no; /* Index of the associated member, base 0 */ + int toff_first; /* First occurence of the el_tag, relative */ + int toff_last; /* Last occurence of the el_tag, relatvie */ + } asn_TYPE_tag2member_t; -/* + /* * This function is a wrapper around (td)->print_struct, which prints out * the contents of the target language's structure (struct_ptr) into the * file pointer (stream) in human readable form. @@ -169,12 +175,12 @@ typedef struct asn_TYPE_tag2member_s { * -1: Problem dumping the structure. * (See also xer_fprint() in xer_encoder.h) */ -int asn_fprint(FILE *stream, /* Destination stream descriptor */ - asn_TYPE_descriptor_t *td, /* ASN.1 type descriptor */ - const void *struct_ptr); /* Structure to be printed */ + int asn_fprint(FILE *stream, /* Destination stream descriptor */ + asn_TYPE_descriptor_t *td, /* ASN.1 type descriptor */ + const void *struct_ptr); /* Structure to be printed */ #ifdef __cplusplus } #endif -#endif /* _CONSTR_TYPE_H_ */ +#endif /* _CONSTR_TYPE_H_ */ diff --git a/src/core/libs/supl/asn-supl/constraints.h b/src/core/libs/supl/asn-supl/constraints.h index 5032345ee..bc4fdb938 100644 --- a/src/core/libs/supl/asn-supl/constraints.h +++ b/src/core/libs/supl/asn-supl/constraints.h @@ -2,18 +2,19 @@ * Copyright (c) 2004, 2006 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ -#ifndef _ASN1_CONSTRAINTS_VALIDATOR_H_ -#define _ASN1_CONSTRAINTS_VALIDATOR_H_ +#ifndef _ASN1_CONSTRAINTS_VALIDATOR_H_ +#define _ASN1_CONSTRAINTS_VALIDATOR_H_ -#include /* Platform-dependent types */ +#include /* Platform-dependent types */ #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -struct asn_TYPE_descriptor_s; /* Forward declaration */ + struct asn_TYPE_descriptor_s; /* Forward declaration */ -/* + /* * Validate the structure according to the ASN.1 constraints. * If errbuf and errlen are given, they shall be pointing to the appropriate * buffer space and its length before calling this function. Alternatively, @@ -25,39 +26,39 @@ struct asn_TYPE_descriptor_s; /* Forward declaration */ * This function returns 0 in case all ASN.1 constraints are met * and -1 if one or more constraints were failed. */ -int -asn_check_constraints(struct asn_TYPE_descriptor_s *type_descriptor, - const void *struct_ptr, /* Target language's structure */ - char *errbuf, /* Returned error description */ - size_t *errlen /* Length of the error description */ - ); + int asn_check_constraints(struct asn_TYPE_descriptor_s *type_descriptor, + const void *struct_ptr, /* Target language's structure */ + char *errbuf, /* Returned error description */ + size_t *errlen /* Length of the error description */ + ); -/* + /* * Generic type for constraint checking callback, * associated with every type descriptor. */ -typedef int (asn_constr_check_f)( - struct asn_TYPE_descriptor_s *type_descriptor, - const void *struct_ptr, - asn_app_constraint_failed_f *optional_callback, /* Log the error */ - void *optional_app_key /* Opaque key passed to a callback */ - ); + typedef int(asn_constr_check_f)( + struct asn_TYPE_descriptor_s *type_descriptor, + const void *struct_ptr, + asn_app_constraint_failed_f *optional_callback, /* Log the error */ + void *optional_app_key /* Opaque key passed to a callback */ + ); -/******************************* + /******************************* * INTERNALLY USEFUL FUNCTIONS * *******************************/ -asn_constr_check_f asn_generic_no_constraint; /* No constraint whatsoever */ -asn_constr_check_f asn_generic_unknown_constraint; /* Not fully supported */ + asn_constr_check_f asn_generic_no_constraint; /* No constraint whatsoever */ + asn_constr_check_f asn_generic_unknown_constraint; /* Not fully supported */ /* * Invoke the callback with a complete error message. */ -#define _ASN_CTFAIL if(ctfailcb) ctfailcb +#define _ASN_CTFAIL \ + if (ctfailcb) ctfailcb #ifdef __cplusplus } #endif -#endif /* _ASN1_CONSTRAINTS_VALIDATOR_H_ */ +#endif /* _ASN1_CONSTRAINTS_VALIDATOR_H_ */ diff --git a/src/core/libs/supl/asn-supl/der_encoder.h b/src/core/libs/supl/asn-supl/der_encoder.h index 61431c6db..3eafbc281 100644 --- a/src/core/libs/supl/asn-supl/der_encoder.h +++ b/src/core/libs/supl/asn-supl/der_encoder.h @@ -2,67 +2,67 @@ * Copyright (c) 2003, 2004 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ -#ifndef _DER_ENCODER_H_ -#define _DER_ENCODER_H_ +#ifndef _DER_ENCODER_H_ +#define _DER_ENCODER_H_ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -struct asn_TYPE_descriptor_s; /* Forward declaration */ + struct asn_TYPE_descriptor_s; /* Forward declaration */ -/* + /* * The DER encoder of any type. May be invoked by the application. * The ber_decode() function (ber_decoder.h) is an opposite of der_encode(). */ -asn_enc_rval_t der_encode(struct asn_TYPE_descriptor_s *type_descriptor, - void *struct_ptr, /* Structure to be encoded */ - asn_app_consume_bytes_f *consume_bytes_cb, - void *app_key /* Arbitrary callback argument */ - ); + asn_enc_rval_t der_encode(struct asn_TYPE_descriptor_s *type_descriptor, + void *struct_ptr, /* Structure to be encoded */ + asn_app_consume_bytes_f *consume_bytes_cb, + void *app_key /* Arbitrary callback argument */ + ); -/* A variant of der_encode() which encodes data into the pre-allocated buffer */ -asn_enc_rval_t der_encode_to_buffer( - struct asn_TYPE_descriptor_s *type_descriptor, - void *struct_ptr, /* Structure to be encoded */ - void *buffer, /* Pre-allocated buffer */ - size_t buffer_size /* Initial buffer size (maximum) */ - ); + /* A variant of der_encode() which encodes data into the pre-allocated buffer */ + asn_enc_rval_t der_encode_to_buffer( + struct asn_TYPE_descriptor_s *type_descriptor, + void *struct_ptr, /* Structure to be encoded */ + void *buffer, /* Pre-allocated buffer */ + size_t buffer_size /* Initial buffer size (maximum) */ + ); -/* + /* * Type of the generic DER encoder. */ -typedef asn_enc_rval_t (der_type_encoder_f)( - struct asn_TYPE_descriptor_s *type_descriptor, - void *struct_ptr, /* Structure to be encoded */ - int tag_mode, /* {-1,0,1}: IMPLICIT, no, EXPLICIT */ - ber_tlv_tag_t tag, - asn_app_consume_bytes_f *consume_bytes_cb, /* Callback */ - void *app_key /* Arbitrary callback argument */ - ); + typedef asn_enc_rval_t(der_type_encoder_f)( + struct asn_TYPE_descriptor_s *type_descriptor, + void *struct_ptr, /* Structure to be encoded */ + int tag_mode, /* {-1,0,1}: IMPLICIT, no, EXPLICIT */ + ber_tlv_tag_t tag, + asn_app_consume_bytes_f *consume_bytes_cb, /* Callback */ + void *app_key /* Arbitrary callback argument */ + ); -/******************************* + /******************************* * INTERNALLY USEFUL FUNCTIONS * *******************************/ -/* + /* * Write out leading TL[v] sequence according to the type definition. */ -ssize_t der_write_tags( - struct asn_TYPE_descriptor_s *type_descriptor, - size_t struct_length, - int tag_mode, /* {-1,0,1}: IMPLICIT, no, EXPLICIT */ - int last_tag_form, /* {0,!0}: prim, constructed */ - ber_tlv_tag_t tag, - asn_app_consume_bytes_f *consume_bytes_cb, - void *app_key - ); + ssize_t der_write_tags( + struct asn_TYPE_descriptor_s *type_descriptor, + size_t struct_length, + int tag_mode, /* {-1,0,1}: IMPLICIT, no, EXPLICIT */ + int last_tag_form, /* {0,!0}: prim, constructed */ + ber_tlv_tag_t tag, + asn_app_consume_bytes_f *consume_bytes_cb, + void *app_key); #ifdef __cplusplus } #endif -#endif /* _DER_ENCODER_H_ */ +#endif /* _DER_ENCODER_H_ */ diff --git a/src/core/libs/supl/asn-supl/per_decoder.h b/src/core/libs/supl/asn-supl/per_decoder.h index 8397a545f..a28509464 100644 --- a/src/core/libs/supl/asn-supl/per_decoder.h +++ b/src/core/libs/supl/asn-supl/per_decoder.h @@ -2,55 +2,55 @@ * Copyright (c) 2005, 2007 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ -#ifndef _PER_DECODER_H_ -#define _PER_DECODER_H_ +#ifndef _PER_DECODER_H_ +#define _PER_DECODER_H_ #include #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -struct asn_TYPE_descriptor_s; /* Forward declaration */ + struct asn_TYPE_descriptor_s; /* Forward declaration */ -/* + /* * Unaligned PER decoder of a "complete encoding" as per X.691#10.1. * On success, this call always returns (.consumed >= 1), as per X.691#10.1.3. */ -asn_dec_rval_t uper_decode_complete(struct asn_codec_ctx_s *opt_codec_ctx, - struct asn_TYPE_descriptor_s *type_descriptor, /* Type to decode */ - void **struct_ptr, /* Pointer to a target structure's pointer */ - const void *buffer, /* Data to be decoded */ - size_t size /* Size of data buffer */ - ); + asn_dec_rval_t uper_decode_complete(struct asn_codec_ctx_s *opt_codec_ctx, + struct asn_TYPE_descriptor_s *type_descriptor, /* Type to decode */ + void **struct_ptr, /* Pointer to a target structure's pointer */ + const void *buffer, /* Data to be decoded */ + size_t size /* Size of data buffer */ + ); -/* + /* * Unaligned PER decoder of any ASN.1 type. May be invoked by the application. * WARNING: This call returns the number of BITS read from the stream. Beware. */ -asn_dec_rval_t uper_decode(struct asn_codec_ctx_s *opt_codec_ctx, - struct asn_TYPE_descriptor_s *type_descriptor, /* Type to decode */ - void **struct_ptr, /* Pointer to a target structure's pointer */ - const void *buffer, /* Data to be decoded */ - size_t size, /* Size of data buffer */ - int skip_bits, /* Number of unused leading bits, 0..7 */ - int unused_bits /* Number of unused tailing bits, 0..7 */ - ); + asn_dec_rval_t uper_decode(struct asn_codec_ctx_s *opt_codec_ctx, + struct asn_TYPE_descriptor_s *type_descriptor, /* Type to decode */ + void **struct_ptr, /* Pointer to a target structure's pointer */ + const void *buffer, /* Data to be decoded */ + size_t size, /* Size of data buffer */ + int skip_bits, /* Number of unused leading bits, 0..7 */ + int unused_bits /* Number of unused tailing bits, 0..7 */ + ); -/* + /* * Type of the type-specific PER decoder function. */ -typedef asn_dec_rval_t (per_type_decoder_f)(asn_codec_ctx_t *opt_codec_ctx, - struct asn_TYPE_descriptor_s *type_descriptor, - asn_per_constraints_t *constraints, - void **struct_ptr, - asn_per_data_t *per_data - ); + typedef asn_dec_rval_t(per_type_decoder_f)(asn_codec_ctx_t *opt_codec_ctx, + struct asn_TYPE_descriptor_s *type_descriptor, + asn_per_constraints_t *constraints, + void **struct_ptr, + asn_per_data_t *per_data); #ifdef __cplusplus } #endif -#endif /* _PER_DECODER_H_ */ +#endif /* _PER_DECODER_H_ */ diff --git a/src/core/libs/supl/asn-supl/per_encoder.h b/src/core/libs/supl/asn-supl/per_encoder.h index 95a6506e4..896013095 100644 --- a/src/core/libs/supl/asn-supl/per_encoder.h +++ b/src/core/libs/supl/asn-supl/per_encoder.h @@ -2,68 +2,68 @@ * Copyright (c) 2006, 2007 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ -#ifndef _PER_ENCODER_H_ -#define _PER_ENCODER_H_ +#ifndef _PER_ENCODER_H_ +#define _PER_ENCODER_H_ #include #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -struct asn_TYPE_descriptor_s; /* Forward declaration */ + struct asn_TYPE_descriptor_s; /* Forward declaration */ -/* + /* * Unaligned PER encoder of any ASN.1 type. May be invoked by the application. * WARNING: This function returns the number of encoded bits in the .encoded * field of the return value. Use the following formula to convert to bytes: * bytes = ((.encoded + 7) / 8) */ -asn_enc_rval_t uper_encode(struct asn_TYPE_descriptor_s *type_descriptor, - void *struct_ptr, /* Structure to be encoded */ - asn_app_consume_bytes_f *consume_bytes_cb, /* Data collector */ - void *app_key /* Arbitrary callback argument */ -); + asn_enc_rval_t uper_encode(struct asn_TYPE_descriptor_s *type_descriptor, + void *struct_ptr, /* Structure to be encoded */ + asn_app_consume_bytes_f *consume_bytes_cb, /* Data collector */ + void *app_key /* Arbitrary callback argument */ + ); -/* + /* * A variant of uper_encode() which encodes data into the existing buffer * WARNING: This function returns the number of encoded bits in the .encoded * field of the return value. */ -asn_enc_rval_t uper_encode_to_buffer( - struct asn_TYPE_descriptor_s *type_descriptor, - void *struct_ptr, /* Structure to be encoded */ - void *buffer, /* Pre-allocated buffer */ - size_t buffer_size /* Initial buffer size (max) */ -); + asn_enc_rval_t uper_encode_to_buffer( + struct asn_TYPE_descriptor_s *type_descriptor, + void *struct_ptr, /* Structure to be encoded */ + void *buffer, /* Pre-allocated buffer */ + size_t buffer_size /* Initial buffer size (max) */ + ); -/* + /* * A variant of uper_encode_to_buffer() which allocates buffer itself. * Returns the number of bytes in the buffer or -1 in case of failure. * WARNING: This function produces a "Production of the complete encoding", * with length of at least one octet. Contrast this to precise bit-packing * encoding of uper_encode() and uper_encode_to_buffer(). */ -ssize_t uper_encode_to_new_buffer( - struct asn_TYPE_descriptor_s *type_descriptor, - asn_per_constraints_t *constraints, - void *struct_ptr, /* Structure to be encoded */ - void **buffer_r /* Buffer allocated and returned */ -); + ssize_t uper_encode_to_new_buffer( + struct asn_TYPE_descriptor_s *type_descriptor, + asn_per_constraints_t *constraints, + void *struct_ptr, /* Structure to be encoded */ + void **buffer_r /* Buffer allocated and returned */ + ); -/* + /* * Type of the generic PER encoder function. */ -typedef asn_enc_rval_t (per_type_encoder_f)( - struct asn_TYPE_descriptor_s *type_descriptor, - asn_per_constraints_t *constraints, - void *struct_ptr, - asn_per_outp_t *per_output -); + typedef asn_enc_rval_t(per_type_encoder_f)( + struct asn_TYPE_descriptor_s *type_descriptor, + asn_per_constraints_t *constraints, + void *struct_ptr, + asn_per_outp_t *per_output); #ifdef __cplusplus } #endif -#endif /* _PER_ENCODER_H_ */ +#endif /* _PER_ENCODER_H_ */ diff --git a/src/core/libs/supl/asn-supl/per_opentype.h b/src/core/libs/supl/asn-supl/per_opentype.h index facfaa637..2110a794a 100644 --- a/src/core/libs/supl/asn-supl/per_opentype.h +++ b/src/core/libs/supl/asn-supl/per_opentype.h @@ -2,21 +2,22 @@ * Copyright (c) 2007 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ -#ifndef _PER_OPENTYPE_H_ -#define _PER_OPENTYPE_H_ +#ifndef _PER_OPENTYPE_H_ +#define _PER_OPENTYPE_H_ #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -asn_dec_rval_t uper_open_type_get(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd); + asn_dec_rval_t uper_open_type_get(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd); -int uper_open_type_skip(asn_codec_ctx_t *opt_codec_ctx, asn_per_data_t *pd); + int uper_open_type_skip(asn_codec_ctx_t *opt_codec_ctx, asn_per_data_t *pd); -int uper_open_type_put(asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void *sptr, asn_per_outp_t *po); + int uper_open_type_put(asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void *sptr, asn_per_outp_t *po); #ifdef __cplusplus } #endif -#endif /* _PER_OPENTYPE_H_ */ +#endif /* _PER_OPENTYPE_H_ */ diff --git a/src/core/libs/supl/asn-supl/per_support.h b/src/core/libs/supl/asn-supl/per_support.h index c3e7794de..c99f12291 100644 --- a/src/core/libs/supl/asn-supl/per_support.h +++ b/src/core/libs/supl/asn-supl/per_support.h @@ -6,137 +6,143 @@ #ifndef _PER_SUPPORT_H_ #define _PER_SUPPORT_H_ -#include /* Platform-specific types */ +#include /* Platform-specific types */ #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* + /* * Pre-computed PER constraints. */ -typedef const struct asn_per_constraint_s { - enum asn_per_constraint_flags { - APC_UNCONSTRAINED = 0x0, /* No PER visible constraints */ - APC_SEMI_CONSTRAINED = 0x1, /* Constrained at "lb" */ - APC_CONSTRAINED = 0x2, /* Fully constrained */ - APC_EXTENSIBLE = 0x4 /* May have extension */ + typedef const struct asn_per_constraint_s + { + enum asn_per_constraint_flags + { + APC_UNCONSTRAINED = 0x0, /* No PER visible constraints */ + APC_SEMI_CONSTRAINED = 0x1, /* Constrained at "lb" */ + APC_CONSTRAINED = 0x2, /* Fully constrained */ + APC_EXTENSIBLE = 0x4 /* May have extension */ } flags; - int range_bits; /* Full number of bits in the range */ - int effective_bits; /* Effective bits */ - long lower_bound; /* "lb" value */ - long upper_bound; /* "ub" value */ -} asn_per_constraint_t; -typedef const struct asn_per_constraints_s { + int range_bits; /* Full number of bits in the range */ + int effective_bits; /* Effective bits */ + long lower_bound; /* "lb" value */ + long upper_bound; /* "ub" value */ + } asn_per_constraint_t; + typedef const struct asn_per_constraints_s + { struct asn_per_constraint_s value; struct asn_per_constraint_s size; int (*value2code)(unsigned int value); int (*code2value)(unsigned int code); -} asn_per_constraints_t; + } asn_per_constraints_t; -/* + /* * This structure describes a position inside an incoming PER bit stream. */ -typedef struct asn_per_data_s { - const uint8_t *buffer; /* Pointer to the octet stream */ - size_t nboff; /* Bit offset to the meaningful bit */ - size_t nbits; /* Number of bits in the stream */ - size_t moved; /* Number of bits moved through this bit stream */ - int (*refill)(struct asn_per_data_s *); - void *refill_key; -} asn_per_data_t; + typedef struct asn_per_data_s + { + const uint8_t *buffer; /* Pointer to the octet stream */ + size_t nboff; /* Bit offset to the meaningful bit */ + size_t nbits; /* Number of bits in the stream */ + size_t moved; /* Number of bits moved through this bit stream */ + int (*refill)(struct asn_per_data_s *); + void *refill_key; + } asn_per_data_t; -/* + /* * Extract a small number of bits (<= 31) from the specified PER data pointer. * This function returns -1 if the specified number of bits could not be * extracted due to EOD or other conditions. */ -int32_t per_get_few_bits(asn_per_data_t *per_data, int get_nbits); + int32_t per_get_few_bits(asn_per_data_t *per_data, int get_nbits); -/* Undo the immediately preceeding "get_few_bits" operation */ -void per_get_undo(asn_per_data_t *per_data, int get_nbits); + /* Undo the immediately preceeding "get_few_bits" operation */ + void per_get_undo(asn_per_data_t *per_data, int get_nbits); -/* + /* * Extract a large number of bits from the specified PER data pointer. * This function returns -1 if the specified number of bits could not be * extracted due to EOD or other conditions. */ -int per_get_many_bits(asn_per_data_t *pd, uint8_t *dst, int right_align, - int get_nbits); + int per_get_many_bits(asn_per_data_t *pd, uint8_t *dst, int right_align, + int get_nbits); -/* + /* * Get the length "n" from the Unaligned PER stream. */ -ssize_t uper_get_length(asn_per_data_t *pd, - int effective_bound_bits, - int *repeat); + ssize_t uper_get_length(asn_per_data_t *pd, + int effective_bound_bits, + int *repeat); -/* + /* * Get the normally small length "n". */ -ssize_t uper_get_nslength(asn_per_data_t *pd); + ssize_t uper_get_nslength(asn_per_data_t *pd); -/* + /* * Get the normally small non-negative whole number. */ -ssize_t uper_get_nsnnwn(asn_per_data_t *pd); + ssize_t uper_get_nsnnwn(asn_per_data_t *pd); -/* X.691-2008/11, #11.5.6 */ -int uper_get_constrained_whole_number(asn_per_data_t *pd, unsigned long *v, int nbits); + /* X.691-2008/11, #11.5.6 */ + int uper_get_constrained_whole_number(asn_per_data_t *pd, unsigned long *v, int nbits); -/* Non-thread-safe debugging function, don't use it */ -char *per_data_string(asn_per_data_t *pd); + /* Non-thread-safe debugging function, don't use it */ + char *per_data_string(asn_per_data_t *pd); -/* + /* * This structure supports forming PER output. */ -typedef struct asn_per_outp_s { - uint8_t *buffer; /* Pointer into the (tmpspace) */ - size_t nboff; /* Bit offset to the meaningful bit */ - size_t nbits; /* Number of bits left in (tmpspace) */ - uint8_t tmpspace[32]; /* Preliminary storage to hold data */ + typedef struct asn_per_outp_s + { + uint8_t *buffer; /* Pointer into the (tmpspace) */ + size_t nboff; /* Bit offset to the meaningful bit */ + size_t nbits; /* Number of bits left in (tmpspace) */ + uint8_t tmpspace[32]; /* Preliminary storage to hold data */ int (*outper)(const void *data, size_t size, void *op_key); - void *op_key; /* Key for (outper) data callback */ - size_t flushed_bytes; /* Bytes already flushed through (outper) */ -} asn_per_outp_t; + void *op_key; /* Key for (outper) data callback */ + size_t flushed_bytes; /* Bytes already flushed through (outper) */ + } asn_per_outp_t; -/* Output a small number of bits (<= 31) */ -int per_put_few_bits(asn_per_outp_t *per_data, uint32_t bits, int obits); + /* Output a small number of bits (<= 31) */ + int per_put_few_bits(asn_per_outp_t *per_data, uint32_t bits, int obits); -/* Output a large number of bits */ -int per_put_many_bits(asn_per_outp_t *po, const uint8_t *src, int put_nbits); + /* Output a large number of bits */ + int per_put_many_bits(asn_per_outp_t *po, const uint8_t *src, int put_nbits); -/* + /* * Flush whole bytes (0 or more) through (outper) member. * The least significant bits which are not used are guaranteed to be set to 0. * Returns -1 if callback returns -1. Otherwise, 0. */ -int per_put_aligned_flush(asn_per_outp_t *po); + int per_put_aligned_flush(asn_per_outp_t *po); -/* X.691-2008/11, #11.5 */ -int uper_put_constrained_whole_number_s(asn_per_outp_t *po, long v, int nbits); -int uper_put_constrained_whole_number_u(asn_per_outp_t *po, unsigned long v, int nbits); + /* X.691-2008/11, #11.5 */ + int uper_put_constrained_whole_number_s(asn_per_outp_t *po, long v, int nbits); + int uper_put_constrained_whole_number_u(asn_per_outp_t *po, unsigned long v, int nbits); -/* + /* * Put the length "n" to the Unaligned PER stream. * This function returns the number of units which may be flushed * in the next units saving iteration. */ -ssize_t uper_put_length(asn_per_outp_t *po, size_t whole_length); + ssize_t uper_put_length(asn_per_outp_t *po, size_t whole_length); -/* + /* * Put the normally small length "n" to the Unaligned PER stream. * Returns 0 or -1. */ -int uper_put_nslength(asn_per_outp_t *po, size_t length); + int uper_put_nslength(asn_per_outp_t *po, size_t length); -/* + /* * Put the normally small non-negative whole number. */ -int uper_put_nsnnwn(asn_per_outp_t *po, int n); + int uper_put_nsnnwn(asn_per_outp_t *po, int n); #ifdef __cplusplus } #endif -#endif /* _PER_SUPPORT_H_ */ +#endif /* _PER_SUPPORT_H_ */ diff --git a/src/core/libs/supl/asn-supl/xer_decoder.h b/src/core/libs/supl/asn-supl/xer_decoder.h index cf0d846fe..52444af51 100644 --- a/src/core/libs/supl/asn-supl/xer_decoder.h +++ b/src/core/libs/supl/asn-supl/xer_decoder.h @@ -2,105 +2,104 @@ * Copyright (c) 2004 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ -#ifndef _XER_DECODER_H_ -#define _XER_DECODER_H_ +#ifndef _XER_DECODER_H_ +#define _XER_DECODER_H_ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -struct asn_TYPE_descriptor_s; /* Forward declaration */ + struct asn_TYPE_descriptor_s; /* Forward declaration */ -/* + /* * The XER decoder of any ASN.1 type. May be invoked by the application. */ -asn_dec_rval_t xer_decode(struct asn_codec_ctx_s *opt_codec_ctx, - struct asn_TYPE_descriptor_s *type_descriptor, - void **struct_ptr, /* Pointer to a target structure's pointer */ - const void *buffer, /* Data to be decoded */ - size_t size /* Size of data buffer */ - ); + asn_dec_rval_t xer_decode(struct asn_codec_ctx_s *opt_codec_ctx, + struct asn_TYPE_descriptor_s *type_descriptor, + void **struct_ptr, /* Pointer to a target structure's pointer */ + const void *buffer, /* Data to be decoded */ + size_t size /* Size of data buffer */ + ); -/* + /* * Type of the type-specific XER decoder function. */ -typedef asn_dec_rval_t (xer_type_decoder_f)(asn_codec_ctx_t *opt_codec_ctx, - struct asn_TYPE_descriptor_s *type_descriptor, - void **struct_ptr, - const char *opt_mname, /* Member name */ - const void *buf_ptr, size_t size - ); + typedef asn_dec_rval_t(xer_type_decoder_f)(asn_codec_ctx_t *opt_codec_ctx, + struct asn_TYPE_descriptor_s *type_descriptor, + void **struct_ptr, + const char *opt_mname, /* Member name */ + const void *buf_ptr, size_t size); -/******************************* + /******************************* * INTERNALLY USEFUL FUNCTIONS * *******************************/ -/* + /* * Generalized function for decoding the primitive values. * Used by more specialized functions, such as OCTET_STRING_decode_xer_utf8 * and others. This function should not be used by applications, as its API * is subject to changes. */ -asn_dec_rval_t xer_decode_general(asn_codec_ctx_t *opt_codec_ctx, - asn_struct_ctx_t *ctx, /* Type decoder context */ - void *struct_key, /* Treated as opaque pointer */ - const char *xml_tag, /* Expected XML tag name */ - const void *buf_ptr, size_t size, - int (*opt_unexpected_tag_decoder) - (void *struct_key, const void *chunk_buf, size_t chunk_size), - ssize_t (*body_receiver) - (void *struct_key, const void *chunk_buf, size_t chunk_size, - int have_more) - ); + asn_dec_rval_t xer_decode_general(asn_codec_ctx_t *opt_codec_ctx, + asn_struct_ctx_t *ctx, /* Type decoder context */ + void *struct_key, /* Treated as opaque pointer */ + const char *xml_tag, /* Expected XML tag name */ + const void *buf_ptr, size_t size, + int (*opt_unexpected_tag_decoder)(void *struct_key, const void *chunk_buf, size_t chunk_size), + ssize_t (*body_receiver)(void *struct_key, const void *chunk_buf, size_t chunk_size, + int have_more)); -/* + /* * Fetch the next XER (XML) token from the stream. * The function returns the number of bytes occupied by the chunk type, * returned in the _ch_type. The _ch_type is only set (and valid) when * the return value is greater than 0. */ - typedef enum pxer_chunk_type { - PXER_TAG, /* Complete XER tag */ - PXER_TEXT, /* Plain text between XER tags */ - PXER_COMMENT /* A comment, may be part of */ - } pxer_chunk_type_e; -ssize_t xer_next_token(int *stateContext, - const void *buffer, size_t size, pxer_chunk_type_e *_ch_type); + typedef enum pxer_chunk_type + { + PXER_TAG, /* Complete XER tag */ + PXER_TEXT, /* Plain text between XER tags */ + PXER_COMMENT /* A comment, may be part of */ + } pxer_chunk_type_e; + ssize_t xer_next_token(int *stateContext, + const void *buffer, size_t size, pxer_chunk_type_e *_ch_type); -/* + /* * This function checks the buffer against the tag name is expected to occur. */ - typedef enum xer_check_tag { - XCT_BROKEN = 0, /* The tag is broken */ - XCT_OPENING = 1, /* This is the tag */ - XCT_CLOSING = 2, /* This is the tag */ - XCT_BOTH = 3, /* This is the tag */ - XCT__UNK__MASK = 4, /* Mask of everything unexpected */ - XCT_UNKNOWN_OP = 5, /* Unexpected tag */ - XCT_UNKNOWN_CL = 6, /* Unexpected tag */ - XCT_UNKNOWN_BO = 7 /* Unexpected tag */ - } xer_check_tag_e; -xer_check_tag_e xer_check_tag(const void *buf_ptr, int size, - const char *need_tag); + typedef enum xer_check_tag + { + XCT_BROKEN = 0, /* The tag is broken */ + XCT_OPENING = 1, /* This is the tag */ + XCT_CLOSING = 2, /* This is the tag */ + XCT_BOTH = 3, /* This is the tag */ + XCT__UNK__MASK = 4, /* Mask of everything unexpected */ + XCT_UNKNOWN_OP = 5, /* Unexpected tag */ + XCT_UNKNOWN_CL = 6, /* Unexpected tag */ + XCT_UNKNOWN_BO = 7 /* Unexpected tag */ + } xer_check_tag_e; + xer_check_tag_e xer_check_tag(const void *buf_ptr, int size, + const char *need_tag); -/* + /* * Check whether this buffer consists of entirely XER whitespace characters. * RETURN VALUES: * 1: Whitespace or empty string * 0: Non-whitespace */ -int xer_is_whitespace(const void *chunk_buf, size_t chunk_size); + int xer_is_whitespace(const void *chunk_buf, size_t chunk_size); -/* + /* * Skip the series of anticipated extensions. */ -int xer_skip_unknown(xer_check_tag_e tcv, ber_tlv_len_t *depth); + int xer_skip_unknown(xer_check_tag_e tcv, ber_tlv_len_t *depth); #ifdef __cplusplus } #endif -#endif /* _XER_DECODER_H_ */ +#endif /* _XER_DECODER_H_ */ diff --git a/src/core/libs/supl/asn-supl/xer_encoder.h b/src/core/libs/supl/asn-supl/xer_encoder.h index 055e73c0c..5b640d425 100644 --- a/src/core/libs/supl/asn-supl/xer_encoder.h +++ b/src/core/libs/supl/asn-supl/xer_encoder.h @@ -2,35 +2,37 @@ * Copyright (c) 2004 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ -#ifndef _XER_ENCODER_H_ -#define _XER_ENCODER_H_ +#ifndef _XER_ENCODER_H_ +#define _XER_ENCODER_H_ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -struct asn_TYPE_descriptor_s; /* Forward declaration */ + struct asn_TYPE_descriptor_s; /* Forward declaration */ -/* Flags used by the xer_encode() and (*xer_type_encoder_f), defined below */ -enum xer_encoder_flags_e { - /* Mode of encoding */ - XER_F_BASIC = 0x01, /* BASIC-XER (pretty-printing) */ - XER_F_CANONICAL = 0x02 /* Canonical XER (strict rules) */ -}; + /* Flags used by the xer_encode() and (*xer_type_encoder_f), defined below */ + enum xer_encoder_flags_e + { + /* Mode of encoding */ + XER_F_BASIC = 0x01, /* BASIC-XER (pretty-printing) */ + XER_F_CANONICAL = 0x02 /* Canonical XER (strict rules) */ + }; -/* + /* * The XER encoder of any type. May be invoked by the application. */ -asn_enc_rval_t xer_encode(struct asn_TYPE_descriptor_s *type_descriptor, - void *struct_ptr, /* Structure to be encoded */ - enum xer_encoder_flags_e xer_flags, - asn_app_consume_bytes_f *consume_bytes_cb, - void *app_key /* Arbitrary callback argument */ - ); + asn_enc_rval_t xer_encode(struct asn_TYPE_descriptor_s *type_descriptor, + void *struct_ptr, /* Structure to be encoded */ + enum xer_encoder_flags_e xer_flags, + asn_app_consume_bytes_f *consume_bytes_cb, + void *app_key /* Arbitrary callback argument */ + ); -/* + /* * The variant of the above function which dumps the BASIC-XER (XER_F_BASIC) * output into the chosen file pointer. * RETURN VALUES: @@ -38,22 +40,22 @@ asn_enc_rval_t xer_encode(struct asn_TYPE_descriptor_s *type_descriptor, * -1: Problem printing the structure. * WARNING: No sensible errno value is returned. */ -int xer_fprint(FILE *stream, struct asn_TYPE_descriptor_s *td, void *sptr); + int xer_fprint(FILE *stream, struct asn_TYPE_descriptor_s *td, void *sptr); -/* + /* * Type of the generic XER encoder. */ -typedef asn_enc_rval_t (xer_type_encoder_f)( - struct asn_TYPE_descriptor_s *type_descriptor, - void *struct_ptr, /* Structure to be encoded */ - int ilevel, /* Level of indentation */ - enum xer_encoder_flags_e xer_flags, - asn_app_consume_bytes_f *consume_bytes_cb, /* Callback */ - void *app_key /* Arbitrary callback argument */ - ); + typedef asn_enc_rval_t(xer_type_encoder_f)( + struct asn_TYPE_descriptor_s *type_descriptor, + void *struct_ptr, /* Structure to be encoded */ + int ilevel, /* Level of indentation */ + enum xer_encoder_flags_e xer_flags, + asn_app_consume_bytes_f *consume_bytes_cb, /* Callback */ + void *app_key /* Arbitrary callback argument */ + ); #ifdef __cplusplus } #endif -#endif /* _XER_ENCODER_H_ */ +#endif /* _XER_ENCODER_H_ */ diff --git a/src/core/libs/supl/asn-supl/xer_support.h b/src/core/libs/supl/asn-supl/xer_support.h index 8b01944ab..13d8bbd06 100644 --- a/src/core/libs/supl/asn-supl/xer_support.h +++ b/src/core/libs/supl/asn-supl/xer_support.h @@ -3,31 +3,33 @@ * Copyright (c) 2003, 2004 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ -#ifndef _XER_SUPPORT_H_ -#define _XER_SUPPORT_H_ +#ifndef _XER_SUPPORT_H_ +#define _XER_SUPPORT_H_ -#include /* Platform-specific types */ +#include /* Platform-specific types */ #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* + /* * Types of data transferred to the application. */ -typedef enum { - PXML_TEXT, /* Plain text between XML tags. */ - PXML_TAG, /* A tag, starting with '<'. */ - PXML_COMMENT, /* An XML comment, including "". */ - /* + typedef enum + { + PXML_TEXT, /* Plain text between XML tags. */ + PXML_TAG, /* A tag, starting with '<'. */ + PXML_COMMENT, /* An XML comment, including "". */ + /* * The following chunk types are reported if the chunk * terminates the specified XML element. */ - PXML_TAG_END, /* Tag ended */ - PXML_COMMENT_END /* Comment ended */ -} pxml_chunk_type_e; + PXML_TAG_END, /* Tag ended */ + PXML_COMMENT_END /* Comment ended */ + } pxml_chunk_type_e; -/* + /* * Callback function that is called by the parser when parsed data is * available. The _opaque is the pointer to a field containing opaque user * data specified in pxml_create() call. The chunk type is _type and the text @@ -35,21 +37,21 @@ typedef enum { * pxml_feed() call) starting at offset _offset and of _size bytes size. * The chunk is NOT '\0'-terminated. */ -typedef int (pxml_callback_f)(pxml_chunk_type_e _type, - const void *_chunk_data, size_t _chunk_size, void *_key); + typedef int(pxml_callback_f)(pxml_chunk_type_e _type, + const void *_chunk_data, size_t _chunk_size, void *_key); -/* + /* * Parse the given buffer as it were a chunk of XML data. * Invoke the specified callback each time the meaninful data is found. * This function returns number of bytes consumed from the bufer. * It will always be lesser than or equal to the specified _size. * The next invocation of this function must account the difference. */ -ssize_t pxml_parse(int *_stateContext, const void *_buf, size_t _size, - pxml_callback_f *cb, void *_key); + ssize_t pxml_parse(int *_stateContext, const void *_buf, size_t _size, + pxml_callback_f *cb, void *_key); #ifdef __cplusplus } #endif -#endif /* _XER_SUPPORT_H_ */ +#endif /* _XER_SUPPORT_H_ */ diff --git a/src/core/libs/supl/supl.h b/src/core/libs/supl/supl.h index 1a9352b09..3761eda24 100644 --- a/src/core/libs/supl/supl.h +++ b/src/core/libs/supl/supl.h @@ -75,149 +75,163 @@ #define MAX_EPHEMERIS 32 -struct supl_acquis_s { - u_int8_t prn; - u_int8_t parts; - int16_t doppler0; - int8_t doppler1; - u_int8_t d_win; - u_int16_t code_ph; - u_int8_t code_ph_int; - u_int8_t bit_num; - u_int16_t code_ph_win; - u_int8_t az; - u_int8_t el; - u_int8_t fill[2]; +struct supl_acquis_s +{ + u_int8_t prn; + u_int8_t parts; + int16_t doppler0; + int8_t doppler1; + u_int8_t d_win; + u_int16_t code_ph; + u_int8_t code_ph_int; + u_int8_t bit_num; + u_int16_t code_ph_win; + u_int8_t az; + u_int8_t el; + u_int8_t fill[2]; }; -struct supl_almanac_s { - u_int8_t prn; - u_int16_t e; - u_int8_t toa; - int16_t Ksii; - int16_t OMEGA_dot; - u_int32_t A_sqrt; - int32_t OMEGA_0; - int32_t w; - int32_t M0; - int16_t AF0; - int16_t AF1; - // int32_t health; -}; - -struct supl_ephemeris_s { - u_int8_t prn; - u_int8_t fill1; - u_int16_t delta_n; - int32_t M0; - u_int32_t e; - u_int32_t A_sqrt; - int32_t OMEGA_0; - int32_t i0; - int32_t w; - int32_t OMEGA_dot; - int16_t i_dot; - int16_t Cuc; - int16_t Cus; - int16_t Crc; - int16_t Crs; - int16_t Cic; - int16_t Cis; - u_int16_t toe; - u_int16_t IODC; - u_int16_t toc; - int32_t AF0; - int16_t AF1; - int8_t AF2; - u_int8_t nav_model; - - /* nav model */ - u_int8_t bits; - u_int8_t ura; - u_int8_t health; - char reserved[11]; - int8_t tgd; - u_int8_t AODA; +struct supl_almanac_s +{ + u_int8_t prn; + u_int16_t e; + u_int8_t toa; + int16_t Ksii; + int16_t OMEGA_dot; + u_int32_t A_sqrt; + int32_t OMEGA_0; + int32_t w; + int32_t M0; + int16_t AF0; + int16_t AF1; + // int32_t health; }; -struct supl_ionospheric_s { - int8_t a0, a1, a2,a3, b0, b1, b2, b3; +struct supl_ephemeris_s +{ + u_int8_t prn; + u_int8_t fill1; + u_int16_t delta_n; + int32_t M0; + u_int32_t e; + u_int32_t A_sqrt; + int32_t OMEGA_0; + int32_t i0; + int32_t w; + int32_t OMEGA_dot; + int16_t i_dot; + int16_t Cuc; + int16_t Cus; + int16_t Crc; + int16_t Crs; + int16_t Cic; + int16_t Cis; + u_int16_t toe; + u_int16_t IODC; + u_int16_t toc; + int32_t AF0; + int16_t AF1; + int8_t AF2; + u_int8_t nav_model; + + /* nav model */ + u_int8_t bits; + u_int8_t ura; + u_int8_t health; + char reserved[11]; + int8_t tgd; + u_int8_t AODA; }; -struct supl_utc_s { - int32_t a0; - int32_t a1; - int8_t delta_tls; - u_int8_t tot; - u_int8_t wnt; - u_int8_t wnlsf; - u_int8_t dn; - u_int8_t delta_tlsf; - u_int8_t fill[8]; +struct supl_ionospheric_s +{ + int8_t a0, a1, a2, a3, b0, b1, b2, b3; }; -typedef struct supl_rrlp_ctx_s { - int set; +struct supl_utc_s +{ + int32_t a0; + int32_t a1; + int8_t delta_tls; + u_int8_t tot; + u_int8_t wnt; + u_int8_t wnlsf; + u_int8_t dn; + u_int8_t delta_tlsf; + u_int8_t fill[8]; +}; - struct { - long gps_tow, gps_week; - struct timeval stamp; - } time; +typedef struct supl_rrlp_ctx_s +{ + int set; - struct { - int uncertainty; - double lat, lon; /* of the base station */ - } pos; + struct + { + long gps_tow, gps_week; + struct timeval stamp; + } time; - struct supl_ionospheric_s iono; + struct + { + int uncertainty; + double lat, lon; /* of the base station */ + } pos; - struct supl_utc_s utc; + struct supl_ionospheric_s iono; - int cnt_eph; - struct supl_ephemeris_s eph[MAX_EPHEMERIS]; + struct supl_utc_s utc; - int cnt_alm; - int alm_week; - struct supl_almanac_s alm[MAX_EPHEMERIS]; + int cnt_eph; + struct supl_ephemeris_s eph[MAX_EPHEMERIS]; - int cnt_acq; - int acq_time; - struct supl_acquis_s acq[MAX_EPHEMERIS]; + int cnt_alm; + int alm_week; + struct supl_almanac_s alm[MAX_EPHEMERIS]; + + int cnt_acq; + int acq_time; + struct supl_acquis_s acq[MAX_EPHEMERIS]; } supl_assist_t; - -typedef struct supl_param_s { - int set; - int request; - struct { - int mcc, mnc, lac, ci; - } gsm; +typedef struct supl_param_s +{ + int set; + int request; - struct { - int mcc, mnc, uc; - } wcdma; + struct + { + int mcc, mnc, lac, ci; + } gsm; - struct { - int mcc, mnc, lac, ci; - double lat, lon; - int uncert; - } known; + struct + { + int mcc, mnc, uc; + } wcdma; - char msisdn[8]; + struct + { + int mcc, mnc, lac, ci; + double lat, lon; + int uncert; + } known; + + char msisdn[8]; } supl_param_t; -typedef struct supl_ctx_s { - supl_param_t p; +typedef struct supl_ctx_s +{ + supl_param_t p; - int fd; - SSL *ssl; - SSL_CTX *ssl_ctx; + int fd; + SSL *ssl; + SSL_CTX *ssl_ctx; - struct { - void *buf; - size_t size; - } slp_session_id; + struct + { + void *buf; + size_t size; + } slp_session_id; } supl_ctx_t; @@ -240,16 +254,18 @@ void supl_set_debug(FILE *log, int flags); typedef void (*supl_debug_cb)(char format, ...); -typedef struct supl_ulp_s { - ULP_PDU_t *pdu; - size_t size; - unsigned char buffer[8192]; +typedef struct supl_ulp_s +{ + ULP_PDU_t *pdu; + size_t size; + unsigned char buffer[8192]; } supl_ulp_t; -typedef struct supl_rrlp_s { - PDU_t *pdu; - size_t size; - unsigned char buffer[8192]; +typedef struct supl_rrlp_s +{ + PDU_t *pdu; + size_t size; + unsigned char buffer[8192]; } supl_rrlp_t; void supl_ulp_free(supl_ulp_t *pdu); diff --git a/src/core/receiver/concurrent_map.h b/src/core/receiver/concurrent_map.h index 27ead329d..3a9fe2dd2 100644 --- a/src/core/receiver/concurrent_map.h +++ b/src/core/receiver/concurrent_map.h @@ -36,7 +36,7 @@ #include -template +template /*! @@ -45,10 +45,11 @@ template */ class concurrent_map { - typedef typename std::map::iterator Data_iterator; // iterator is scope dependent + typedef typename std::map::iterator Data_iterator; // iterator is scope dependent private: - std::map the_map; + std::map the_map; boost::mutex the_mutex; + public: void write(int key, Data const& data) { @@ -57,19 +58,19 @@ public: data_iter = the_map.find(key); if (data_iter != the_map.end()) { - data_iter->second = data; // update + data_iter->second = data; // update } else { - the_map.insert(std::pair(key, data)); // insert SILENTLY fails if the item already exists in the map! + the_map.insert(std::pair(key, data)); // insert SILENTLY fails if the item already exists in the map! } lock.unlock(); } - std::map get_map_copy() + std::map get_map_copy() { boost::mutex::scoped_lock lock(the_mutex); - std::map map_aux = the_map; + std::map map_aux = the_map; lock.unlock(); return map_aux; } diff --git a/src/core/receiver/concurrent_queue.h b/src/core/receiver/concurrent_queue.h index d279c5ad0..dcd104ac5 100644 --- a/src/core/receiver/concurrent_queue.h +++ b/src/core/receiver/concurrent_queue.h @@ -34,7 +34,7 @@ #include #include -template +template /*! * \brief This class implements a thread-safe std::queue @@ -49,6 +49,7 @@ private: std::queue the_queue; mutable boost::mutex the_mutex; boost::condition_variable the_condition_variable; + public: void push(Data const& data) { @@ -67,7 +68,7 @@ public: bool try_pop(Data& popped_value) { boost::mutex::scoped_lock lock(the_mutex); - if(the_queue.empty()) + if (the_queue.empty()) { return false; } @@ -79,7 +80,7 @@ public: void wait_and_pop(Data& popped_value) { boost::mutex::scoped_lock lock(the_mutex); - while(the_queue.empty()) + while (the_queue.empty()) { the_condition_variable.wait(lock); } diff --git a/src/core/receiver/control_message.h b/src/core/receiver/control_message.h index 5a508a18c..b393057d1 100644 --- a/src/core/receiver/control_message.h +++ b/src/core/receiver/control_message.h @@ -29,7 +29,6 @@ */ - #ifndef GNSS_SDR_CONTROL_MESSAGE_H_ #define GNSS_SDR_CONTROL_MESSAGE_H_ @@ -38,7 +37,6 @@ */ class ControlMessage { - public: static unsigned int const ack_success = 0; static unsigned int const ack_failed = 1; diff --git a/src/core/receiver/control_message_factory.cc b/src/core/receiver/control_message_factory.cc index a7da90ab1..e62cdcd39 100644 --- a/src/core/receiver/control_message_factory.cc +++ b/src/core/receiver/control_message_factory.cc @@ -35,13 +35,11 @@ using google::LogMessage; // Constructor -ControlMessageFactory::ControlMessageFactory() -{} +ControlMessageFactory::ControlMessageFactory() {} // Destructor -ControlMessageFactory::~ControlMessageFactory() -{} +ControlMessageFactory::~ControlMessageFactory() {} gr::message::sptr ControlMessageFactory::GetQueueMessage(unsigned int who, unsigned int what) @@ -55,23 +53,21 @@ gr::message::sptr ControlMessageFactory::GetQueueMessage(unsigned int who, unsig } -std::shared_ptr>> ControlMessageFactory::GetControlMessages(gr::message::sptr queue_message) +std::shared_ptr>> ControlMessageFactory::GetControlMessages(gr::message::sptr queue_message) { - std::shared_ptr>> control_messages = std::make_shared>>(); + std::shared_ptr>> control_messages = std::make_shared>>(); unsigned int control_messages_count = queue_message->length() / sizeof(ControlMessage); - if(queue_message->length() % sizeof(ControlMessage) != 0) + if (queue_message->length() % sizeof(ControlMessage) != 0) { LOG(WARNING) << "Queue message has size " << queue_message->length() << ", which is not" << " multiple of control message size " << sizeof(ControlMessage); LOG(WARNING) << "Ignoring this queue message to prevent unexpected results."; return control_messages; } - for(unsigned int i = 0; i < control_messages_count; i++) + for (unsigned int i = 0; i < control_messages_count; i++) { control_messages->push_back(std::make_shared()); - memcpy(control_messages->at(i).get(), queue_message->msg() + (i*sizeof(ControlMessage)), sizeof(ControlMessage)); + memcpy(control_messages->at(i).get(), queue_message->msg() + (i * sizeof(ControlMessage)), sizeof(ControlMessage)); } return control_messages; } - - diff --git a/src/core/receiver/control_message_factory.h b/src/core/receiver/control_message_factory.h index a7bba38d2..75719611e 100644 --- a/src/core/receiver/control_message_factory.h +++ b/src/core/receiver/control_message_factory.h @@ -40,7 +40,7 @@ typedef struct ControlMessage_ { unsigned int who; unsigned int what; -} ControlMessage ; +} ControlMessage; /*! @@ -50,7 +50,6 @@ typedef struct ControlMessage_ */ class ControlMessageFactory { - public: //! Constructor ControlMessageFactory(); diff --git a/src/core/receiver/control_thread.cc b/src/core/receiver/control_thread.cc index 04a76b971..db3e3841b 100644 --- a/src/core/receiver/control_thread.cc +++ b/src/core/receiver/control_thread.cc @@ -69,9 +69,9 @@ using google::LogMessage; ControlThread::ControlThread() { - if(!FLAGS_c.compare("-")) + if (!FLAGS_c.compare("-")) { - configuration_ = std::make_shared(FLAGS_config_file); + configuration_ = std::make_shared(FLAGS_config_file); } else { @@ -90,12 +90,11 @@ ControlThread::ControlThread(std::shared_ptr configurati } - ControlThread::~ControlThread() { // save navigation data to files - // if (save_assistance_to_XML() == true) {} - if(msqid != -1) msgctl(msqid, IPC_RMID, NULL); + // if (save_assistance_to_XML() == true) {} + if (msqid != -1) msgctl(msqid, IPC_RMID, NULL); } @@ -192,10 +191,10 @@ bool ControlThread::read_assistance_from_XML() std::cout << "SUPL: Try read GPS ephemeris from XML file " << eph_xml_filename << std::endl; if (supl_client_ephemeris_.load_ephemeris_xml(eph_xml_filename) == true) { - std::map::const_iterator gps_eph_iter; - for(gps_eph_iter = supl_client_ephemeris_.gps_ephemeris_map.cbegin(); - gps_eph_iter != supl_client_ephemeris_.gps_ephemeris_map.cend(); - gps_eph_iter++) + std::map::const_iterator gps_eph_iter; + for (gps_eph_iter = supl_client_ephemeris_.gps_ephemeris_map.cbegin(); + gps_eph_iter != supl_client_ephemeris_.gps_ephemeris_map.cend(); + gps_eph_iter++) { std::cout << "SUPL: Read XML Ephemeris for GPS SV " << gps_eph_iter->first << std::endl; std::shared_ptr tmp_obj = std::make_shared(gps_eph_iter->second); @@ -285,22 +284,22 @@ void ControlThread::assist_GNSS() std::string default_lac = "0x59e2"; std::string default_ci = "0x31b0"; try - { + { supl_lac = boost::lexical_cast(configuration_->property("GNSS-SDR.SUPL_LAC", default_lac)); - } - catch(boost::bad_lexical_cast &) - { + } + catch (boost::bad_lexical_cast &) + { supl_lac = 0x59e2; - } + } try - { + { supl_ci = boost::lexical_cast(configuration_->property("GNSS-SDR.SUPL_CI", default_ci)); - } - catch(boost::bad_lexical_cast &) - { + } + catch (boost::bad_lexical_cast &) + { supl_ci = 0x31b0; - } + } bool SUPL_read_gps_assistance_xml = configuration_->property("GNSS-SDR.SUPL_read_gps_assistance_xml", false); if (SUPL_read_gps_assistance_xml == true) @@ -320,10 +319,10 @@ void ControlThread::assist_GNSS() error = supl_client_ephemeris_.get_assistance(supl_mcc, supl_mns, supl_lac, supl_ci); if (error == 0) { - std::map::const_iterator gps_eph_iter; - for(gps_eph_iter = supl_client_ephemeris_.gps_ephemeris_map.cbegin(); - gps_eph_iter != supl_client_ephemeris_.gps_ephemeris_map.cend(); - gps_eph_iter++) + std::map::const_iterator gps_eph_iter; + for (gps_eph_iter = supl_client_ephemeris_.gps_ephemeris_map.cbegin(); + gps_eph_iter != supl_client_ephemeris_.gps_ephemeris_map.cend(); + gps_eph_iter++) { std::cout << "SUPL: Received Ephemeris for GPS SV " << gps_eph_iter->first << std::endl; std::shared_ptr tmp_obj = std::make_shared(gps_eph_iter->second); @@ -357,10 +356,10 @@ void ControlThread::assist_GNSS() error = supl_client_ephemeris_.get_assistance(supl_mcc, supl_mns, supl_lac, supl_ci); if (error == 0) { - std::map::const_iterator gps_alm_iter; - for(gps_alm_iter = supl_client_ephemeris_.gps_almanac_map.cbegin(); - gps_alm_iter != supl_client_ephemeris_.gps_almanac_map.cend(); - gps_alm_iter++) + std::map::const_iterator gps_alm_iter; + for (gps_alm_iter = supl_client_ephemeris_.gps_almanac_map.cbegin(); + gps_alm_iter != supl_client_ephemeris_.gps_almanac_map.cend(); + gps_alm_iter++) { std::cout << "SUPL: Received Almanac for GPS SV " << gps_alm_iter->first << std::endl; std::shared_ptr tmp_obj = std::make_shared(gps_alm_iter->second); @@ -393,9 +392,9 @@ void ControlThread::assist_GNSS() if (error == 0) { std::map::const_iterator gps_acq_iter; - for(gps_acq_iter = supl_client_acquisition_.gps_acq_map.cbegin(); - gps_acq_iter != supl_client_acquisition_.gps_acq_map.cend(); - gps_acq_iter++) + for (gps_acq_iter = supl_client_acquisition_.gps_acq_map.cbegin(); + gps_acq_iter != supl_client_acquisition_.gps_acq_map.cend(); + gps_acq_iter++) { std::cout << "SUPL: Received Acquisition assistance for GPS SV " << gps_acq_iter->first << std::endl; global_gps_acq_assist_map.write(gps_acq_iter->second.i_satellite_PRN, gps_acq_iter->second); @@ -429,13 +428,13 @@ void ControlThread::init() // Instantiates a control queue, a GNSS flowgraph, and a control message factory control_queue_ = gr::msg_queue::make(0); try - { + { flowgraph_ = std::make_shared(configuration_, control_queue_); - } - catch (const boost::bad_lexical_cast& e ) - { + } + catch (const boost::bad_lexical_cast &e) + { std::cout << "Caught bad lexical cast with error " << e.what() << std::endl; - } + } control_message_factory_ = std::make_shared(); stop_ = false; processed_control_messages_ = 0; @@ -488,16 +487,16 @@ void ControlThread::process_control_messages() void ControlThread::apply_action(unsigned int what) { switch (what) - { - case 0: - DLOG(INFO) << "Received action STOP"; - stop_ = true; - applied_actions_++; - break; - default: - DLOG(INFO) << "Unrecognized action."; - break; - } + { + case 0: + DLOG(INFO) << "Received action STOP"; + stop_ = true; + applied_actions_++; + break; + default: + DLOG(INFO) << "Unrecognized action."; + break; + } } @@ -506,19 +505,19 @@ void ControlThread::gps_acq_assist_data_collector() // ############ 1.bis READ EPHEMERIS/UTC_MODE/IONO QUEUE #################### Gps_Acq_Assist gps_acq; Gps_Acq_Assist gps_acq_old; - while(stop_ == false) + while (stop_ == false) { global_gps_acq_assist_queue.wait_and_pop(gps_acq); - if(gps_acq.i_satellite_PRN == 0) break; + if (gps_acq.i_satellite_PRN == 0) break; // DEBUG MESSAGE std::cout << "Acquisition assistance record has arrived from SAT ID " << gps_acq.i_satellite_PRN << " with Doppler " << gps_acq.d_Doppler0 - << " [Hz] "<< std::endl; + << " [Hz] " << std::endl; // insert new acq record to the global ephemeris map - if (global_gps_acq_assist_map.read(gps_acq.i_satellite_PRN,gps_acq_old)) + if (global_gps_acq_assist_map.read(gps_acq.i_satellite_PRN, gps_acq_old)) { std::cout << "Acquisition assistance record updated" << std::endl; global_gps_acq_assist_map.write(gps_acq.i_satellite_PRN, gps_acq); @@ -535,8 +534,9 @@ void ControlThread::gps_acq_assist_data_collector() void ControlThread::sysv_queue_listener() { - typedef struct { - long mtype; // required by SysV queue messaging + typedef struct + { + long mtype; // required by SysV queue messaging double stop_message; } stop_msgbuf; @@ -547,18 +547,18 @@ void ControlThread::sysv_queue_listener() key_t key = 1102; - if((msqid = msgget(key, 0644 | IPC_CREAT )) == -1) + if ((msqid = msgget(key, 0644 | IPC_CREAT)) == -1) { perror("GNSS-SDR cannot create SysV message queues"); exit(1); } - while(read_queue && !stop_) + while (read_queue && !stop_) { if (msgrcv(msqid, &msg, msgrcv_size, 1, 0) != -1) { received_message = msg.stop_message; - if( (std::abs(received_message - (-200.0)) < 10 * std::numeric_limits::epsilon()) ) + if ((std::abs(received_message - (-200.0)) < 10 * std::numeric_limits::epsilon())) { std::cout << "Quit order received, stopping GNSS-SDR !!" << std::endl; std::unique_ptr cmf(new ControlMessageFactory()); @@ -577,7 +577,7 @@ void ControlThread::keyboard_listener() { bool read_keys = true; char c = '0'; - while(read_keys && !stop_) + while (read_keys && !stop_) { std::cin.get(c); if (c == 'q') diff --git a/src/core/receiver/control_thread.h b/src/core/receiver/control_thread.h index f84b2f24d..8ee10d531 100644 --- a/src/core/receiver/control_thread.h +++ b/src/core/receiver/control_thread.h @@ -116,10 +116,10 @@ private: //SUPL assistance classes gnss_sdr_supl_client supl_client_acquisition_; gnss_sdr_supl_client supl_client_ephemeris_; - int supl_mcc; // Current network MCC (Mobile country code), 3 digits. - int supl_mns; // Current network MNC (Mobile Network code), 2 or 3 digits. - int supl_lac; // Current network LAC (Location area code),16 bits, 1-65520 are valid values. - int supl_ci; // Cell Identity (16 bits, 0-65535 are valid values). + int supl_mcc; // Current network MCC (Mobile country code), 3 digits. + int supl_mns; // Current network MNC (Mobile Network code), 2 or 3 digits. + int supl_lac; // Current network LAC (Location area code),16 bits, 1-65520 are valid values. + int supl_ci; // Cell Identity (16 bits, 0-65535 are valid values). void init(); @@ -137,12 +137,12 @@ private: * Blocking function that reads the GPS assistance queue */ void gps_acq_assist_data_collector(); - + /* * Read initial GNSS assistance from SUPL server or local XML files */ void assist_GNSS(); - + void apply_action(unsigned int what); std::shared_ptr flowgraph_; std::shared_ptr configuration_; @@ -156,7 +156,7 @@ private: boost::thread keyboard_thread_; boost::thread sysv_queue_thread_; boost::thread gps_acq_assist_data_collector_thread_; - + void keyboard_listener(); void sysv_queue_listener(); int msqid; diff --git a/src/core/receiver/file_configuration.cc b/src/core/receiver/file_configuration.cc index 1e52e819f..e3ce3074a 100644 --- a/src/core/receiver/file_configuration.cc +++ b/src/core/receiver/file_configuration.cc @@ -65,7 +65,7 @@ FileConfiguration::~FileConfiguration() std::string FileConfiguration::property(std::string property_name, std::string default_value) { - if(overrided_->is_present(property_name)) + if (overrided_->is_present(property_name)) { return overrided_->property(property_name, default_value); } @@ -78,7 +78,7 @@ std::string FileConfiguration::property(std::string property_name, std::string d bool FileConfiguration::property(std::string property_name, bool default_value) { - if(overrided_->is_present(property_name)) + if (overrided_->is_present(property_name)) { return overrided_->property(property_name, default_value); } @@ -92,7 +92,7 @@ bool FileConfiguration::property(std::string property_name, bool default_value) long FileConfiguration::property(std::string property_name, long default_value) { - if(overrided_->is_present(property_name)) + if (overrided_->is_present(property_name)) { return overrided_->property(property_name, default_value); } @@ -104,10 +104,9 @@ long FileConfiguration::property(std::string property_name, long default_value) } - int FileConfiguration::property(std::string property_name, int default_value) { - if(overrided_->is_present(property_name)) + if (overrided_->is_present(property_name)) { return overrided_->property(property_name, default_value); } @@ -119,10 +118,9 @@ int FileConfiguration::property(std::string property_name, int default_value) } - unsigned int FileConfiguration::property(std::string property_name, unsigned int default_value) { - if(overrided_->is_present(property_name)) + if (overrided_->is_present(property_name)) { return overrided_->property(property_name, default_value); } @@ -134,10 +132,9 @@ unsigned int FileConfiguration::property(std::string property_name, unsigned int } - unsigned short FileConfiguration::property(std::string property_name, unsigned short default_value) { - if(overrided_->is_present(property_name)) + if (overrided_->is_present(property_name)) { return overrided_->property(property_name, default_value); } @@ -149,10 +146,9 @@ unsigned short FileConfiguration::property(std::string property_name, unsigned s } - float FileConfiguration::property(std::string property_name, float default_value) { - if(overrided_->is_present(property_name)) + if (overrided_->is_present(property_name)) { return overrided_->property(property_name, default_value); } @@ -166,7 +162,7 @@ float FileConfiguration::property(std::string property_name, float default_value double FileConfiguration::property(std::string property_name, double default_value) { - if(overrided_->is_present(property_name)) + if (overrided_->is_present(property_name)) { return overrided_->property(property_name, default_value); } @@ -178,25 +174,23 @@ double FileConfiguration::property(std::string property_name, double default_val } - void FileConfiguration::set_property(std::string property_name, std::string value) { overrided_->set_property(property_name, value); } - void FileConfiguration::init() { std::unique_ptr converter_(new StringConverter); overrided_ = std::make_shared(); ini_reader_ = std::make_shared(filename_); error_ = ini_reader_->ParseError(); - if(error_ == 0) + if (error_ == 0) { DLOG(INFO) << "Configuration file " << filename_ << " opened with no errors"; } - else if(error_ > 0) + else if (error_ > 0) { LOG(WARNING) << "Configuration file " << filename_ << " contains errors in line " << error_; } @@ -205,5 +199,3 @@ void FileConfiguration::init() LOG(WARNING) << "Unable to open configuration file " << filename_; } } - - diff --git a/src/core/receiver/file_configuration.h b/src/core/receiver/file_configuration.h index a968305d5..6af556a32 100644 --- a/src/core/receiver/file_configuration.h +++ b/src/core/receiver/file_configuration.h @@ -33,7 +33,6 @@ */ - #ifndef GNSS_SDR_FILE_CONFIGURATION_H_ #define GNSS_SDR_FILE_CONFIGURATION_H_ @@ -60,7 +59,7 @@ public: FileConfiguration(std::string filename); FileConfiguration(); //! Virtual destructor - ~FileConfiguration(); + ~FileConfiguration(); std::string property(std::string property_name, std::string default_value); bool property(std::string property_name, bool default_value); long property(std::string property_name, long default_value); @@ -70,6 +69,7 @@ public: float property(std::string property_name, float default_value); double property(std::string property_name, double default_value); void set_property(std::string property_name, std::string value); + private: void init(); std::string filename_; diff --git a/src/core/receiver/gnss_block_factory.h b/src/core/receiver/gnss_block_factory.h index be57433d1..4456cc400 100644 --- a/src/core/receiver/gnss_block_factory.h +++ b/src/core/receiver/gnss_block_factory.h @@ -58,7 +58,7 @@ public: GNSSBlockFactory(); virtual ~GNSSBlockFactory(); std::unique_ptr GetSignalSource(std::shared_ptr configuration, - gr::msg_queue::sptr queue, int ID = -1); + gr::msg_queue::sptr queue, int ID = -1); std::unique_ptr GetSignalConditioner(std::shared_ptr configuration, int ID = -1); @@ -67,60 +67,58 @@ public: std::unique_ptr GetObservables(std::shared_ptr configuration); std::unique_ptr>> GetChannels(std::shared_ptr configuration, - gr::msg_queue::sptr queue); + gr::msg_queue::sptr queue); /* * \brief Returns the block with the required configuration and implementation */ std::unique_ptr GetBlock(std::shared_ptr configuration, - std::string role, std::string implementation, - unsigned int in_streams, unsigned int out_streams, - gr::msg_queue::sptr queue = nullptr); + std::string role, std::string implementation, + unsigned int in_streams, unsigned int out_streams, + gr::msg_queue::sptr queue = nullptr); private: - std::unique_ptr GetChannel_1C(std::shared_ptr configuration, - std::string acq, std::string trk, std::string tlm, int channel, - gr::msg_queue::sptr queue); + std::string acq, std::string trk, std::string tlm, int channel, + gr::msg_queue::sptr queue); std::unique_ptr GetChannel_2S(std::shared_ptr configuration, - std::string acq, std::string trk, std::string tlm, int channel, - gr::msg_queue::sptr queue); + std::string acq, std::string trk, std::string tlm, int channel, + gr::msg_queue::sptr queue); std::unique_ptr GetChannel_1B(std::shared_ptr configuration, - std::string acq, std::string trk, std::string tlm, int channel, - gr::msg_queue::sptr queue); + std::string acq, std::string trk, std::string tlm, int channel, + gr::msg_queue::sptr queue); std::unique_ptr GetChannel_5X(std::shared_ptr configuration, - std::string acq, std::string trk, std::string tlm, int channel, - gr::msg_queue::sptr queue); + std::string acq, std::string trk, std::string tlm, int channel, + gr::msg_queue::sptr queue); std::unique_ptr GetChannel_L5(std::shared_ptr configuration, - std::string acq, std::string trk, std::string tlm, int channel, - gr::msg_queue::sptr queue); + std::string acq, std::string trk, std::string tlm, int channel, + gr::msg_queue::sptr queue); std::unique_ptr GetChannel_1G(std::shared_ptr configuration, - std::string acq, std::string trk, std::string tlm, int channel, - boost::shared_ptr queue); + std::string acq, std::string trk, std::string tlm, int channel, + boost::shared_ptr queue); std::unique_ptr GetAcqBlock( - std::shared_ptr configuration, - std::string role, - std::string implementation, unsigned int in_streams, - unsigned int out_streams); + std::shared_ptr configuration, + std::string role, + std::string implementation, unsigned int in_streams, + unsigned int out_streams); std::unique_ptr GetTrkBlock( - std::shared_ptr configuration, - std::string role, - std::string implementation, unsigned int in_streams, - unsigned int out_streams); + std::shared_ptr configuration, + std::string role, + std::string implementation, unsigned int in_streams, + unsigned int out_streams); std::unique_ptr GetTlmBlock( - std::shared_ptr configuration, - std::string role, - std::string implementation, unsigned int in_streams, - unsigned int out_streams); + std::shared_ptr configuration, + std::string role, + std::string implementation, unsigned int in_streams, + unsigned int out_streams); }; #endif /*GNSS_SDR_BLOCK_FACTORY_H_*/ - diff --git a/src/core/receiver/gnss_flowgraph.cc b/src/core/receiver/gnss_flowgraph.cc index a82ab54c1..e379220a5 100644 --- a/src/core/receiver/gnss_flowgraph.cc +++ b/src/core/receiver/gnss_flowgraph.cc @@ -60,8 +60,7 @@ GNSSFlowgraph::GNSSFlowgraph(std::shared_ptr configurati } -GNSSFlowgraph::~GNSSFlowgraph() -{} +GNSSFlowgraph::~GNSSFlowgraph() {} void GNSSFlowgraph::start() @@ -73,15 +72,15 @@ void GNSSFlowgraph::start() } try - { + { top_block_->start(); - } - catch (const std::exception & e) - { + } + catch (const std::exception& e) + { LOG(WARNING) << "Unable to start flowgraph"; LOG(ERROR) << e.what(); return; - } + } running_ = true; } @@ -110,73 +109,73 @@ void GNSSFlowgraph::connect() for (int i = 0; i < sources_count_; i++) { try - { + { sig_source_.at(i)->connect(top_block_); - } - catch (const std::exception & e) - { + } + catch (const std::exception& e) + { LOG(INFO) << "Can't connect signal source block " << i << " internally"; LOG(ERROR) << e.what(); top_block_->disconnect_all(); return; - } + } } // Signal Source > Signal conditioner > for (unsigned int i = 0; i < sig_conditioner_.size(); i++) { try - { + { sig_conditioner_.at(i)->connect(top_block_); - } - catch (const std::exception & e) - { + } + catch (const std::exception& e) + { LOG(INFO) << "Can't connect signal conditioner block " << i << " internally"; LOG(ERROR) << e.what(); top_block_->disconnect_all(); return; - } + } } for (unsigned int i = 0; i < channels_count_; i++) { try - { + { channels_.at(i)->connect(top_block_); - } - catch (const std::exception & e) - { + } + catch (const std::exception& e) + { LOG(WARNING) << "Can't connect channel " << i << " internally"; LOG(ERROR) << e.what(); top_block_->disconnect_all(); return; - } + } } try - { + { observables_->connect(top_block_); - } - catch (const std::exception & e) - { + } + catch (const std::exception& e) + { LOG(WARNING) << "Can't connect observables block internally"; LOG(ERROR) << e.what(); top_block_->disconnect_all(); return; - } + } // Signal Source > Signal conditioner >> Channels >> Observables > PVT try - { + { pvt_->connect(top_block_); - } - catch (const std::exception & e) - { + } + catch (const std::exception& e) + { LOG(WARNING) << "Can't connect PVT block internally"; LOG(ERROR) << e.what(); top_block_->disconnect_all(); return; - } + } DLOG(INFO) << "blocks connected internally"; // Signal Source (i) > Signal conditioner (i) > @@ -186,10 +185,10 @@ void GNSSFlowgraph::connect() for (int i = 0; i < sources_count_; i++) { try - { + { //TODO: Remove this array implementation and create generic multistream connector //(if a signal source has more than 1 stream, then connect it to the multistream signal conditioner) - if(sig_source_.at(i)->implementation().compare("Raw_Array_Signal_Source") == 0) + if (sig_source_.at(i)->implementation().compare("Raw_Array_Signal_Source") == 0) { //Multichannel Array std::cout << "ARRAY MODE" << std::endl; @@ -215,7 +214,6 @@ void GNSSFlowgraph::connect() if (sig_source_.at(i)->get_right_block()->output_signature()->max_streams() > 1) { - LOG(INFO) << "connecting sig_source_ " << i << " stream " << j << " to conditioner " << j; top_block_->connect(sig_source_.at(i)->get_right_block(), j, sig_conditioner_.at(signal_conditioner_ID)->get_left_block(), 0); } @@ -224,7 +222,7 @@ void GNSSFlowgraph::connect() if (j == 0) { // RF_channel 0 backward compatibility with single channel sources - LOG(INFO) << "connecting sig_source_ " << i << " stream " << 0 << " to conditioner " << j; + LOG(INFO) << "connecting sig_source_ " << i << " stream " << 0 << " to conditioner " << j; top_block_->connect(sig_source_.at(i)->get_right_block(), 0, sig_conditioner_.at(signal_conditioner_ID)->get_left_block(), 0); } else @@ -237,14 +235,14 @@ void GNSSFlowgraph::connect() signal_conditioner_ID++; } } - } - catch (const std::exception & e) - { - LOG(WARNING) << "Can't connect signal source " << i << " to signal conditioner " << i; + } + catch (const std::exception& e) + { + LOG(WARNING) << "Can't connect signal source " << i << " to signal conditioner " << i; LOG(ERROR) << e.what(); top_block_->disconnect_all(); return; - } + } } DLOG(INFO) << "Signal source connected to signal conditioner"; @@ -254,35 +252,35 @@ void GNSSFlowgraph::connect() { selected_signal_conditioner_ID = configuration_->property("Channel" + boost::lexical_cast(i) + ".RF_channel_ID", 0); try - { + { top_block_->connect(sig_conditioner_.at(selected_signal_conditioner_ID)->get_right_block(), 0, - channels_.at(i)->get_left_block(), 0); - } - catch (const std::exception & e) - { + channels_.at(i)->get_left_block(), 0); + } + catch (const std::exception& e) + { LOG(WARNING) << "Can't connect signal conditioner " << selected_signal_conditioner_ID << " to channel " << i; LOG(ERROR) << e.what(); top_block_->disconnect_all(); return; - } + } DLOG(INFO) << "signal conditioner " << selected_signal_conditioner_ID << " connected to channel " << i; // Signal Source > Signal conditioner >> Channels >> Observables try - { + { top_block_->connect(channels_.at(i)->get_right_block(), 0, - observables_->get_left_block(), i); - } - catch (const std::exception & e) - { + observables_->get_left_block(), i); + } + catch (const std::exception& e) + { LOG(WARNING) << "Can't connect channel " << i << " to observables"; LOG(ERROR) << e.what(); top_block_->disconnect_all(); return; - } + } - std::string gnss_signal = channels_.at(i)->get_signal().get_signal_str(); // use channel's implicit signal! + std::string gnss_signal = channels_.at(i)->get_signal().get_signal_str(); // use channel's implicit signal! channels_.at(i)->set_signal(search_next_signal(gnss_signal, false)); if (channels_state_[i] == 1) @@ -301,7 +299,6 @@ void GNSSFlowgraph::connect() { ch_out_sample_counter = gnss_sdr_make_sample_counter(); top_block_->connect(channels_.at(i)->get_right_block(), 0, ch_out_sample_counter, 0); - } } @@ -309,20 +306,20 @@ void GNSSFlowgraph::connect() * Connect the observables output of each channel to the PVT block */ try - { + { for (unsigned int i = 0; i < channels_count_; i++) { top_block_->connect(observables_->get_right_block(), i, pvt_->get_left_block(), i); top_block_->msg_connect(channels_.at(i)->get_right_block(), pmt::mp("telemetry"), pvt_->get_left_block(), pmt::mp("telemetry")); } - } - catch (const std::exception & e) - { + } + catch (const std::exception& e) + { LOG(WARNING) << "Can't connect observables to PVT"; LOG(ERROR) << e.what(); top_block_->disconnect_all(); return; - } + } connected_ = true; LOG(INFO) << "Flowgraph connected"; @@ -362,61 +359,60 @@ void GNSSFlowgraph::apply_action(unsigned int who, unsigned int what) { DLOG(INFO) << "Received " << what << " from " << who << ". Number of applied actions = " << applied_actions_; switch (what) - { - case 0: - DLOG(INFO) << "Channel " << who << " ACQ FAILED satellite " << channels_.at(who)->get_signal().get_satellite() << ", Signal " << channels_.at(who)->get_signal().get_signal_str(); - available_GNSS_signals_.push_back(channels_.at(who)->get_signal()); - channels_.at(who)->set_signal(search_next_signal(channels_.at(who)->get_signal().get_signal_str(), true)); - DLOG(INFO) << "Channel "<< who << " Starting acquisition " << channels_.at(who)->get_signal().get_satellite() << ", Signal " << channels_.at(who)->get_signal().get_signal_str(); - channels_.at(who)->start_acquisition(); - break; + { + case 0: + DLOG(INFO) << "Channel " << who << " ACQ FAILED satellite " << channels_.at(who)->get_signal().get_satellite() << ", Signal " << channels_.at(who)->get_signal().get_signal_str(); + available_GNSS_signals_.push_back(channels_.at(who)->get_signal()); + channels_.at(who)->set_signal(search_next_signal(channels_.at(who)->get_signal().get_signal_str(), true)); + DLOG(INFO) << "Channel " << who << " Starting acquisition " << channels_.at(who)->get_signal().get_satellite() << ", Signal " << channels_.at(who)->get_signal().get_signal_str(); + channels_.at(who)->start_acquisition(); + break; - case 1: - LOG(INFO) << "Channel " << who << " ACQ SUCCESS satellite " << channels_.at(who)->get_signal().get_satellite(); - channels_state_[who] = 2; - acq_channels_count_--; - for (unsigned int i = 0; i < channels_count_; i++) - { - if(!available_GNSS_signals_.empty() && (acq_channels_count_ < max_acq_channels_) && (channels_state_[i] == 0)) - { - channels_state_[i] = 1; - channels_.at(i)->set_signal(search_next_signal(channels_.at(i)->get_signal().get_signal_str(), true)); - acq_channels_count_++; - DLOG(INFO) << "Channel "<< i << " Starting acquisition " << channels_.at(i)->get_signal().get_satellite() << ", Signal " << channels_.at(i)->get_signal().get_signal_str(); - channels_.at(i)->start_acquisition(); - } - DLOG(INFO) << "Channel " << i << " in state " << channels_state_[i]; - } - break; + case 1: + LOG(INFO) << "Channel " << who << " ACQ SUCCESS satellite " << channels_.at(who)->get_signal().get_satellite(); + channels_state_[who] = 2; + acq_channels_count_--; + for (unsigned int i = 0; i < channels_count_; i++) + { + if (!available_GNSS_signals_.empty() && (acq_channels_count_ < max_acq_channels_) && (channels_state_[i] == 0)) + { + channels_state_[i] = 1; + channels_.at(i)->set_signal(search_next_signal(channels_.at(i)->get_signal().get_signal_str(), true)); + acq_channels_count_++; + DLOG(INFO) << "Channel " << i << " Starting acquisition " << channels_.at(i)->get_signal().get_satellite() << ", Signal " << channels_.at(i)->get_signal().get_signal_str(); + channels_.at(i)->start_acquisition(); + } + DLOG(INFO) << "Channel " << i << " in state " << channels_state_[i]; + } + break; - case 2: - LOG(INFO) << "Channel " << who << " TRK FAILED satellite " << channels_.at(who)->get_signal().get_satellite(); - DLOG(INFO) << "Number of channels in acquisition = " << acq_channels_count_; + case 2: + LOG(INFO) << "Channel " << who << " TRK FAILED satellite " << channels_.at(who)->get_signal().get_satellite(); + DLOG(INFO) << "Number of channels in acquisition = " << acq_channels_count_; - if (acq_channels_count_ < max_acq_channels_) - { - channels_state_[who] = 1; - acq_channels_count_++; - LOG(INFO) << "Channel "<< who << " Starting acquisition " << channels_.at(who)->get_signal().get_satellite() << ", Signal " << channels_.at(who)->get_signal().get_signal_str(); - channels_.at(who)->start_acquisition(); - } - else - { - channels_state_[who] = 0; - LOG(INFO) << "Channel "<< who << " Idle state"; - available_GNSS_signals_.push_back( channels_.at(who)->get_signal() ); - } - break; + if (acq_channels_count_ < max_acq_channels_) + { + channels_state_[who] = 1; + acq_channels_count_++; + LOG(INFO) << "Channel " << who << " Starting acquisition " << channels_.at(who)->get_signal().get_satellite() << ", Signal " << channels_.at(who)->get_signal().get_signal_str(); + channels_.at(who)->start_acquisition(); + } + else + { + channels_state_[who] = 0; + LOG(INFO) << "Channel " << who << " Idle state"; + available_GNSS_signals_.push_back(channels_.at(who)->get_signal()); + } + break; - default: - break; - } + default: + break; + } DLOG(INFO) << "Number of available signals: " << available_GNSS_signals_.size(); applied_actions_++; } - void GNSSFlowgraph::set_configuration(std::shared_ptr configuration) { if (running_) @@ -433,7 +429,6 @@ void GNSSFlowgraph::set_configuration(std::shared_ptr co } - void GNSSFlowgraph::init() { /* @@ -493,7 +488,7 @@ void GNSSFlowgraph::init() std::string default_str("Default"); std::string obs_implementation = configuration_->property("Observables.implementation", default_str); if ((obs_implementation.compare("GPS_L1_CA_Observables") == 0) || (obs_implementation.compare("GPS_L2C_Observables") == 0) || - (obs_implementation.compare("Galileo_E1B_Observables") == 0) || (obs_implementation.compare("Galileo_E5A_Observables") == 0)) + (obs_implementation.compare("Galileo_E1B_Observables") == 0) || (obs_implementation.compare("Galileo_E5A_Observables") == 0)) { std::cout << "WARNING: Implementation '" << obs_implementation << "' of the Observables block has been replaced by 'Hybrid_Observables'." << std::endl; std::cout << "Please update your configuration file." << std::endl; @@ -545,106 +540,107 @@ void GNSSFlowgraph::set_signals_list() */ unsigned int total_channels = configuration_->property("Channels_1C.count", 0) + - configuration_->property("Channels_2S.count", 0) + - configuration_->property("Channels_1B.count", 0) + - configuration_->property("Channels_5X.count", 0) + - configuration_->property("Channels_1G.count", 0) + - configuration_->property("Channels_5X.count", 0) + - configuration_->property("Channels_L5.count", 0); + configuration_->property("Channels_2S.count", 0) + + configuration_->property("Channels_1B.count", 0) + + configuration_->property("Channels_5X.count", 0) + + configuration_->property("Channels_1G.count", 0) + + configuration_->property("Channels_5X.count", 0) + + configuration_->property("Channels_L5.count", 0); /* * Loop to create the list of GNSS Signals * To add signals from other systems, add another loop 'for' */ - std::set available_gps_prn = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, - 29, 30, 31, 32 }; + std::set available_gps_prn = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, + 29, 30, 31, 32}; std::set available_sbas_prn = {120, 124, 126}; - std::set available_galileo_prn = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, - 29, 30, 31, 32, 33, 34, 35, 36}; + std::set available_galileo_prn = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, + 29, 30, 31, 32, 33, 34, 35, 36}; // Removing satellites sharing same frequency number(1 and 5, 2 and 6, 3 and 7, 4 and 6, 11 and 15, 12 and 16, 14 and 18, 17 and 21 - std::set available_glonass_prn = { 1, 2, 3, 4, 9, 10, 11, 12, 18, 19, 20, 21, 24 }; + std::set available_glonass_prn = {1, 2, 3, 4, 9, 10, 11, 12, 18, 19, 20, 21, 24}; - std::string sv_list = configuration_->property("Galileo.prns", std::string("") ); + std::string sv_list = configuration_->property("Galileo.prns", std::string("")); - if( sv_list.length() > 0 ) + if (sv_list.length() > 0) { // Reset the available prns: - std::set< unsigned int > tmp_set; - boost::tokenizer<> tok( sv_list ); - std::transform( tok.begin(), tok.end(), std::inserter( tmp_set, tmp_set.begin() ), - boost::lexical_cast ); + std::set tmp_set; + boost::tokenizer<> tok(sv_list); + std::transform(tok.begin(), tok.end(), std::inserter(tmp_set, tmp_set.begin()), + boost::lexical_cast); - if( tmp_set.size() > 0 ) + if (tmp_set.size() > 0) { available_galileo_prn = tmp_set; } } - sv_list = configuration_->property("GPS.prns", std::string("") ); + sv_list = configuration_->property("GPS.prns", std::string("")); - if( sv_list.length() > 0 ) + if (sv_list.length() > 0) { // Reset the available prns: - std::set< unsigned int > tmp_set; - boost::tokenizer<> tok( sv_list ); - std::transform( tok.begin(), tok.end(), std::inserter( tmp_set, tmp_set.begin() ), - boost::lexical_cast ); + std::set tmp_set; + boost::tokenizer<> tok(sv_list); + std::transform(tok.begin(), tok.end(), std::inserter(tmp_set, tmp_set.begin()), + boost::lexical_cast); - if( tmp_set.size() > 0 ) + if (tmp_set.size() > 0) { available_gps_prn = tmp_set; } } - sv_list = configuration_->property("SBAS.prns", std::string("") ); + sv_list = configuration_->property("SBAS.prns", std::string("")); - if( sv_list.length() > 0 ) + if (sv_list.length() > 0) { // Reset the available prns: - std::set< unsigned int > tmp_set; - boost::tokenizer<> tok( sv_list ); - std::transform( tok.begin(), tok.end(), std::inserter( tmp_set, tmp_set.begin() ), - boost::lexical_cast ); + std::set tmp_set; + boost::tokenizer<> tok(sv_list); + std::transform(tok.begin(), tok.end(), std::inserter(tmp_set, tmp_set.begin()), + boost::lexical_cast); - if( tmp_set.size() > 0 ) + if (tmp_set.size() > 0) { available_sbas_prn = tmp_set; } } - sv_list = configuration_->property("Glonass.prns", std::string("") ); + sv_list = configuration_->property("Glonass.prns", std::string("")); - if( sv_list.length() > 0 ) + if (sv_list.length() > 0) { // Reset the available prns: - std::set< unsigned int > tmp_set; - boost::tokenizer<> tok( sv_list ); - std::transform( tok.begin(), tok.end(), std::inserter( tmp_set, tmp_set.begin() ), - boost::lexical_cast ); + std::set tmp_set; + boost::tokenizer<> tok(sv_list); + std::transform(tok.begin(), tok.end(), std::inserter(tmp_set, tmp_set.begin()), + boost::lexical_cast); - if( tmp_set.size() > 0 ) + if (tmp_set.size() > 0) { available_glonass_prn = tmp_set; } } - if (configuration_->property("Channels_1C.count", 0) > 0 ) + if (configuration_->property("Channels_1C.count", 0) > 0) { /* * Loop to create GPS L1 C/A signals */ for (available_gnss_prn_iter = available_gps_prn.cbegin(); - available_gnss_prn_iter != available_gps_prn.cend(); - available_gnss_prn_iter++) + available_gnss_prn_iter != available_gps_prn.cend(); + available_gnss_prn_iter++) { - available_GNSS_signals_.push_back(Gnss_Signal(Gnss_Satellite(std::string("GPS"), - *available_gnss_prn_iter), std::string("1C"))); + available_GNSS_signals_.push_back(Gnss_Signal( + Gnss_Satellite(std::string("GPS"), *available_gnss_prn_iter), + std::string("1C"))); } } @@ -654,11 +650,12 @@ void GNSSFlowgraph::set_signals_list() * Loop to create GPS L2C M signals */ for (available_gnss_prn_iter = available_gps_prn.cbegin(); - available_gnss_prn_iter != available_gps_prn.cend(); - available_gnss_prn_iter++) + available_gnss_prn_iter != available_gps_prn.cend(); + available_gnss_prn_iter++) { - available_GNSS_signals_.push_back(Gnss_Signal(Gnss_Satellite(std::string("GPS"), - *available_gnss_prn_iter), std::string("2S"))); + available_GNSS_signals_.push_back(Gnss_Signal( + Gnss_Satellite(std::string("GPS"), *available_gnss_prn_iter), + std::string("2S"))); } } @@ -668,11 +665,12 @@ void GNSSFlowgraph::set_signals_list() * Loop to create GPS L5 signals */ for (available_gnss_prn_iter = available_gps_prn.cbegin(); - available_gnss_prn_iter != available_gps_prn.cend(); - available_gnss_prn_iter++) + available_gnss_prn_iter != available_gps_prn.cend(); + available_gnss_prn_iter++) { - available_GNSS_signals_.push_back(Gnss_Signal(Gnss_Satellite(std::string("GPS"), - *available_gnss_prn_iter), std::string("L5"))); + available_GNSS_signals_.push_back(Gnss_Signal( + Gnss_Satellite(std::string("GPS"), *available_gnss_prn_iter), + std::string("L5"))); } } if (configuration_->property("Channels_SBAS.count", 0) > 0) @@ -681,11 +679,12 @@ void GNSSFlowgraph::set_signals_list() * Loop to create SBAS L1 C/A signals */ for (available_gnss_prn_iter = available_sbas_prn.cbegin(); - available_gnss_prn_iter != available_sbas_prn.cend(); - available_gnss_prn_iter++) + available_gnss_prn_iter != available_sbas_prn.cend(); + available_gnss_prn_iter++) { - available_GNSS_signals_.push_back(Gnss_Signal(Gnss_Satellite(std::string("SBAS"), - *available_gnss_prn_iter), std::string("1C"))); + available_GNSS_signals_.push_back(Gnss_Signal( + Gnss_Satellite(std::string("SBAS"), *available_gnss_prn_iter), + std::string("1C"))); } } @@ -696,41 +695,44 @@ void GNSSFlowgraph::set_signals_list() * Loop to create the list of Galileo E1B signals */ for (available_gnss_prn_iter = available_galileo_prn.cbegin(); - available_gnss_prn_iter != available_galileo_prn.cend(); - available_gnss_prn_iter++) + available_gnss_prn_iter != available_galileo_prn.cend(); + available_gnss_prn_iter++) { - available_GNSS_signals_.push_back(Gnss_Signal(Gnss_Satellite(std::string("Galileo"), - *available_gnss_prn_iter), std::string("1B"))); + available_GNSS_signals_.push_back(Gnss_Signal( + Gnss_Satellite(std::string("Galileo"), *available_gnss_prn_iter), + std::string("1B"))); } } - if (configuration_->property("Channels_5X.count", 0) > 0 ) + if (configuration_->property("Channels_5X.count", 0) > 0) { /* * Loop to create the list of Galileo E5a signals */ for (available_gnss_prn_iter = available_galileo_prn.cbegin(); - available_gnss_prn_iter != available_galileo_prn.cend(); - available_gnss_prn_iter++) + available_gnss_prn_iter != available_galileo_prn.cend(); + available_gnss_prn_iter++) { - available_GNSS_signals_.push_back(Gnss_Signal(Gnss_Satellite(std::string("Galileo"), - *available_gnss_prn_iter), std::string("5X"))); + available_GNSS_signals_.push_back(Gnss_Signal( + Gnss_Satellite(std::string("Galileo"), *available_gnss_prn_iter), + std::string("5X"))); } } - if (configuration_->property("Channels_1G.count", 0) > 0 ) - { - /* + if (configuration_->property("Channels_1G.count", 0) > 0) + { + /* * Loop to create the list of GLONASS L1 C/A signals */ - for (available_gnss_prn_iter = available_glonass_prn.begin(); - available_gnss_prn_iter != available_glonass_prn.end(); - available_gnss_prn_iter++) - { - available_GNSS_signals_.push_back(Gnss_Signal(Gnss_Satellite(std::string("Glonass"), - *available_gnss_prn_iter), std::string("1G"))); - } - } + for (available_gnss_prn_iter = available_glonass_prn.begin(); + available_gnss_prn_iter != available_glonass_prn.end(); + available_gnss_prn_iter++) + { + available_GNSS_signals_.push_back(Gnss_Signal( + Gnss_Satellite(std::string("Glonass"), *available_gnss_prn_iter), + std::string("1G"))); + } + } /* * Ordering the list of signals from configuration file */ @@ -742,12 +744,12 @@ void GNSSFlowgraph::set_signals_list() { std::string gnss_signal = (configuration_->property("Channel" + boost::lexical_cast(i) + ".signal", std::string("1C"))); std::string gnss_system; - if((gnss_signal.compare("1C") == 0) or (gnss_signal.compare("2S") == 0) or (gnss_signal.compare("L5") == 0)) gnss_system = "GPS"; - if((gnss_signal.compare("1B") == 0) or (gnss_signal.compare("5X") == 0) ) gnss_system = "Galileo"; - if((gnss_signal.compare("1G") == 0)/*or (gnss_signal.compare("") == 0)*/) gnss_system = "Glonass"; + if ((gnss_signal.compare("1C") == 0) or (gnss_signal.compare("2S") == 0) or (gnss_signal.compare("L5") == 0)) gnss_system = "GPS"; + if ((gnss_signal.compare("1B") == 0) or (gnss_signal.compare("5X") == 0)) gnss_system = "Galileo"; + if ((gnss_signal.compare("1G") == 0) /*or (gnss_signal.compare("") == 0)*/) gnss_system = "Glonass"; unsigned int sat = configuration_->property("Channel" + boost::lexical_cast(i) + ".satellite", 0); - LOG(INFO) << "Channel " << i << " system " << gnss_system << ", signal " << gnss_signal <<", sat "<::iterator iter = properties_.find(property_name); - if(iter != properties_.end()) + if (iter != properties_.end()) { return iter->second; } diff --git a/src/core/receiver/in_memory_configuration.h b/src/core/receiver/in_memory_configuration.h index de6e1913a..a8d57dce8 100644 --- a/src/core/receiver/in_memory_configuration.h +++ b/src/core/receiver/in_memory_configuration.h @@ -32,7 +32,6 @@ */ - #ifndef GNSS_SDR_IN_MEMORY_CONFIGURATION_H_ #define GNSS_SDR_IN_MEMORY_CONFIGURATION_H_ @@ -65,6 +64,7 @@ public: double property(std::string property_name, double default_value); void set_property(std::string property_name, std::string value); bool is_present(std::string property_name); + private: std::map properties_; std::unique_ptr converter_; diff --git a/src/core/system_parameters/GLONASS_L1_CA.h b/src/core/system_parameters/GLONASS_L1_CA.h index e2558e114..0e12dab25 100644 --- a/src/core/system_parameters/GLONASS_L1_CA.h +++ b/src/core/system_parameters/GLONASS_L1_CA.h @@ -36,60 +36,60 @@ #include "MATH_CONSTANTS.h" #include #include -#include // std::pair +#include // std::pair // Physical constants -const double GLONASS_C_m_s = SPEED_OF_LIGHT; //!< The speed of light, [m/s] -const double GLONASS_C_m_ms = 299792.4580; //!< The speed of light, [m/ms] -const double GLONASS_PI = 3.1415926535898; //!< Pi as defined in IS-GPS-200E -const double GLONASS_TWO_PI = 6.283185307179586; //!< 2Pi as defined in IS-GPS-200E -const double GLONASS_OMEGA_EARTH_DOT = 7.292115e-5; //!< Earth rotation rate, [rad/s] -const double GLONASS_GM = 398600.4418e9; //!< Universal gravitational constant times the mass of the Earth, [m^3/s^2] -const double GLONASS_fM_a = 0.35e9; //!< Gravitational constant of atmosphere [m^3/s^2] -const double GLONASS_SEMI_MAJOR_AXIS = 6378136; //!< Semi-major axis of Earth [m] -const double GLONASS_FLATTENING = 1/29825784; //!< Flattening parameter -const double GLONASS_GRAVITY = 97803284; //!< Equatorial acceleration of gravity [mGal] -const double GLONASS_GRAVITY_CORRECTION = 0.87; //!< Correction to acceleration of gravity at sea-level due to Atmosphere[мGal] -const double GLONASS_J2 = 1082625.75e-9; //!< Second zonal harmonic of the geopotential -const double GLONASS_J4 = -2370.89e-9; //!< Fourth zonal harmonic of the geopotential -const double GLONASS_J6 = 6.08e-9; //!< Sixth zonal harmonic of the geopotential -const double GLONASS_J8 = 1.40e-11; //!< Eighth zonal harmonic of the geopotential -const double GLONASS_U0 = 62636861.4; //!< Normal potential at surface of common terrestrial ellipsoid [m^2/s^2] -const double GLONASS_C20 = -1082.63e-6; //!< Second zonal coefficient of spherical harmonic expansion -const double GLONASS_EARTH_RADIUS = 6378.136; //!< Equatorial radius of Earth [km] -const double GLONASS_EARTH_INCLINATION = 0.000409148809899e3; //!< Mean inclination of ecliptic to equator (23 deg 26 min 33 sec) [rad] +const double GLONASS_C_m_s = SPEED_OF_LIGHT; //!< The speed of light, [m/s] +const double GLONASS_C_m_ms = 299792.4580; //!< The speed of light, [m/ms] +const double GLONASS_PI = 3.1415926535898; //!< Pi as defined in IS-GPS-200E +const double GLONASS_TWO_PI = 6.283185307179586; //!< 2Pi as defined in IS-GPS-200E +const double GLONASS_OMEGA_EARTH_DOT = 7.292115e-5; //!< Earth rotation rate, [rad/s] +const double GLONASS_GM = 398600.4418e9; //!< Universal gravitational constant times the mass of the Earth, [m^3/s^2] +const double GLONASS_fM_a = 0.35e9; //!< Gravitational constant of atmosphere [m^3/s^2] +const double GLONASS_SEMI_MAJOR_AXIS = 6378136; //!< Semi-major axis of Earth [m] +const double GLONASS_FLATTENING = 1 / 29825784; //!< Flattening parameter +const double GLONASS_GRAVITY = 97803284; //!< Equatorial acceleration of gravity [mGal] +const double GLONASS_GRAVITY_CORRECTION = 0.87; //!< Correction to acceleration of gravity at sea-level due to Atmosphere[мGal] +const double GLONASS_J2 = 1082625.75e-9; //!< Second zonal harmonic of the geopotential +const double GLONASS_J4 = -2370.89e-9; //!< Fourth zonal harmonic of the geopotential +const double GLONASS_J6 = 6.08e-9; //!< Sixth zonal harmonic of the geopotential +const double GLONASS_J8 = 1.40e-11; //!< Eighth zonal harmonic of the geopotential +const double GLONASS_U0 = 62636861.4; //!< Normal potential at surface of common terrestrial ellipsoid [m^2/s^2] +const double GLONASS_C20 = -1082.63e-6; //!< Second zonal coefficient of spherical harmonic expansion +const double GLONASS_EARTH_RADIUS = 6378.136; //!< Equatorial radius of Earth [km] +const double GLONASS_EARTH_INCLINATION = 0.000409148809899e3; //!< Mean inclination of ecliptic to equator (23 deg 26 min 33 sec) [rad] -const double GLONASS_TAU_0 = -0.005835151531174e3; //!< (-334 deg 19 min 46.40 sec) [rad]; -const double GLONASS_TAU_1 = 0.071018041257371e3; //!< (4069 deg 02 min 02.52 sec) [rad]; +const double GLONASS_TAU_0 = -0.005835151531174e3; //!< (-334 deg 19 min 46.40 sec) [rad]; +const double GLONASS_TAU_1 = 0.071018041257371e3; //!< (4069 deg 02 min 02.52 sec) [rad]; -const double GLONASS_MOON_Q0 = -0.001115184961435e3; //!< (-63 deg 53 min 43.41 sec) [rad] -const double GLONASS_MOON_Q1 = 8.328691103668023e3; //!< (477198 deg 50 min 56.79 sec) [rad] -const double GLONASS_MOON_OMEGA_0 = 0.004523601514852e3; //!< (259 deg 10 min 59.79 sec) [rad] -const double GLONASS_MOON_OMEGA_1 = -0.033757146246552e3; //!< (-1934 deg 08 min 31.23 sec) [rad] -const double GLONASS_MOON_GM = 4902.835; //!< Lunar gravitational constant [km^3/s^2] -const double GLONASS_MOON_SEMI_MAJOR_AXIS = 3.84385243e5; //!< Semi-major axis of lunar orbit [km]; -const double GLONASS_MOON_ECCENTRICITY = 0.054900489; //!< Eccentricity of lunar orbit -const double GLONASS_MOON_INCLINATION = 0.000089803977407e3; //!< Inclination of lunar orbit to ecliptic plane (5 deg 08 min 43.4 sec) [rad] +const double GLONASS_MOON_Q0 = -0.001115184961435e3; //!< (-63 deg 53 min 43.41 sec) [rad] +const double GLONASS_MOON_Q1 = 8.328691103668023e3; //!< (477198 deg 50 min 56.79 sec) [rad] +const double GLONASS_MOON_OMEGA_0 = 0.004523601514852e3; //!< (259 deg 10 min 59.79 sec) [rad] +const double GLONASS_MOON_OMEGA_1 = -0.033757146246552e3; //!< (-1934 deg 08 min 31.23 sec) [rad] +const double GLONASS_MOON_GM = 4902.835; //!< Lunar gravitational constant [km^3/s^2] +const double GLONASS_MOON_SEMI_MAJOR_AXIS = 3.84385243e5; //!< Semi-major axis of lunar orbit [km]; +const double GLONASS_MOON_ECCENTRICITY = 0.054900489; //!< Eccentricity of lunar orbit +const double GLONASS_MOON_INCLINATION = 0.000089803977407e3; //!< Inclination of lunar orbit to ecliptic plane (5 deg 08 min 43.4 sec) [rad] -const double GLONASS_SUN_OMEGA = 0.004908229466869e3; //!< TODO What is this operation in the seconds with T?(281 deg 13 min 15.0 + 6189.03*Т sec) [rad] -const double GLONASS_SUN_Q0 = 0.006256583774423e3; //!< (358 deg 28 min 33.04 sec) [rad] -const double GLONASS_SUN_Q1 = 0e3; //!< TODO Why is the value greater than 60?(129596579.10 sec) [rad] -const double GLONASS_SUN_GM = 0.1325263e12; //!< Solar gravitational constant [km^3/s^2] -const double GLONASS_SUN_SEMI_MAJOR_AXIS = 1.49598e8; //!< Semi-major axis of solar orbit [km]; -const double GLONASS_SUN_ECCENTRICITY = 0.016719; //!< Eccentricity of solar orbit +const double GLONASS_SUN_OMEGA = 0.004908229466869e3; //!< TODO What is this operation in the seconds with T?(281 deg 13 min 15.0 + 6189.03*Т sec) [rad] +const double GLONASS_SUN_Q0 = 0.006256583774423e3; //!< (358 deg 28 min 33.04 sec) [rad] +const double GLONASS_SUN_Q1 = 0e3; //!< TODO Why is the value greater than 60?(129596579.10 sec) [rad] +const double GLONASS_SUN_GM = 0.1325263e12; //!< Solar gravitational constant [km^3/s^2] +const double GLONASS_SUN_SEMI_MAJOR_AXIS = 1.49598e8; //!< Semi-major axis of solar orbit [km]; +const double GLONASS_SUN_ECCENTRICITY = 0.016719; //!< Eccentricity of solar orbit // carrier and code frequencies -const double GLONASS_L2_FREQ_HZ = FREQ2_GLO; //!< L1 [Hz] +const double GLONASS_L2_FREQ_HZ = FREQ2_GLO; //!< L1 [Hz] -const double GLONASS_L1_CA_FREQ_HZ = FREQ1_GLO; //!< L1 [Hz] -const double GLONASS_L1_CA_DFREQ_HZ = DFRQ1_GLO; //!< Freq Bias for GLONASS L1 [Hz] -const double GLONASS_L1_CA_CODE_RATE_HZ = 0.511e6; //!< GLONASS L1 C/A code rate [chips/s] -const double GLONASS_L1_CA_CODE_LENGTH_CHIPS = 511.0; //!< GLONASS L1 C/A code length [chips] -const double GLONASS_L1_CA_CODE_PERIOD = 0.001; //!< GLONASS L1 C/A code period [seconds] -const double GLONASS_L1_CA_CHIP_PERIOD = 1.9569e-06; //!< GLONASS L1 C/A chip period [seconds] -const double GLONASS_L1_CA_SYMBOL_RATE_BPS = 1000; -const int GLONASS_L1_CA_NBR_SATS = 24; // STRING DATA WITHOUT PREAMBLE +const double GLONASS_L1_CA_FREQ_HZ = FREQ1_GLO; //!< L1 [Hz] +const double GLONASS_L1_CA_DFREQ_HZ = DFRQ1_GLO; //!< Freq Bias for GLONASS L1 [Hz] +const double GLONASS_L1_CA_CODE_RATE_HZ = 0.511e6; //!< GLONASS L1 C/A code rate [chips/s] +const double GLONASS_L1_CA_CODE_LENGTH_CHIPS = 511.0; //!< GLONASS L1 C/A code length [chips] +const double GLONASS_L1_CA_CODE_PERIOD = 0.001; //!< GLONASS L1 C/A code period [seconds] +const double GLONASS_L1_CA_CHIP_PERIOD = 1.9569e-06; //!< GLONASS L1 C/A chip period [seconds] +const double GLONASS_L1_CA_SYMBOL_RATE_BPS = 1000; +const int GLONASS_L1_CA_NBR_SATS = 24; // STRING DATA WITHOUT PREAMBLE /*! * \brief Record of leap seconds definition for GLOT to GPST conversion and vice versa @@ -97,153 +97,227 @@ const int GLONASS_L1_CA_NBR_SATS = 24; // STRING DATA WITHOUT PREAMB * \note Ideally should use leap seconds definitions of rtklib */ const double GLONASS_LEAP_SECONDS[19][7] = { - {2017, 1, 1, 0, 0, 0, -18}, - {2015, 7, 1, 0, 0, 0, -17}, - {2012, 7, 1, 0, 0, 0, -16}, - {2009, 1, 1, 0, 0, 0, -15}, - {2006, 1, 1, 0, 0, 0, -14}, - {1999, 1, 1, 0, 0, 0, -13}, - {1997, 7, 1, 0, 0, 0, -12}, - {1996, 1, 1, 0, 0, 0, -11}, - {1994, 7, 1, 0, 0, 0, -10}, - {1993, 7, 1, 0, 0, 0, -9}, - {1992, 7, 1, 0, 0, 0, -8}, - {1991, 1, 1, 0, 0, 0, -7}, - {1990, 1, 1, 0, 0, 0, -6}, - {1988, 1, 1, 0, 0, 0, -5}, - {1985, 7, 1, 0, 0, 0, -4}, - {1983, 7, 1, 0, 0, 0, -3}, - {1982, 7, 1, 0, 0, 0, -2}, - {1981, 7, 1, 0, 0, 0, -1}, - {} -}; + {2017, 1, 1, 0, 0, 0, -18}, + {2015, 7, 1, 0, 0, 0, -17}, + {2012, 7, 1, 0, 0, 0, -16}, + {2009, 1, 1, 0, 0, 0, -15}, + {2006, 1, 1, 0, 0, 0, -14}, + {1999, 1, 1, 0, 0, 0, -13}, + {1997, 7, 1, 0, 0, 0, -12}, + {1996, 1, 1, 0, 0, 0, -11}, + {1994, 7, 1, 0, 0, 0, -10}, + {1993, 7, 1, 0, 0, 0, -9}, + {1992, 7, 1, 0, 0, 0, -8}, + {1991, 1, 1, 0, 0, 0, -7}, + {1990, 1, 1, 0, 0, 0, -6}, + {1988, 1, 1, 0, 0, 0, -5}, + {1985, 7, 1, 0, 0, 0, -4}, + {1983, 7, 1, 0, 0, 0, -3}, + {1982, 7, 1, 0, 0, 0, -2}, + {1981, 7, 1, 0, 0, 0, -1}, + {}}; //!< GLONASS SV's orbital slots PRN = (orbital_slot - 1) -const std::map GLONASS_PRN = - {{ 0, 8,}, //For test - { 1, 1,}, //Plane 1 - { 2,-4,}, //Plane 1 - { 3, 5,}, //Plane 1 - { 4, 6,}, //Plane 1 - { 5, 1,}, //Plane 1 - { 6,-4,}, //Plane 1 - { 7, 5,}, //Plane 1 - { 8, 6,}, //Plane 1 - { 9,-2,}, //Plane 2 - {10,-7,}, //Plane 2 - {11, 0,}, //Plane 2 - {12,-1,}, //Plane 2 - {13,-2,}, //Plane 2 - {14,-7,}, //Plane 2 - {15, 0,}, //Plane 2 - {16,-1,}, //Plane 2 - {17, 4,}, //Plane 3 - {18,-3,}, //Plane 3 - {19, 3,}, //Plane 3 - {20,-5,}, //Plane 3 - {21, 4,}, //Plane 3 - {22,-3,}, //Plane 3 - {23, 3,}, //Plane 3 - {24, 2}}; //Plane 3 +const std::map GLONASS_PRN = { + { + 0, + 8, + }, //For test + { + 1, + 1, + }, //Plane 1 + { + 2, + -4, + }, //Plane 1 + { + 3, + 5, + }, //Plane 1 + { + 4, + 6, + }, //Plane 1 + { + 5, + 1, + }, //Plane 1 + { + 6, + -4, + }, //Plane 1 + { + 7, + 5, + }, //Plane 1 + { + 8, + 6, + }, //Plane 1 + { + 9, + -2, + }, //Plane 2 + { + 10, + -7, + }, //Plane 2 + { + 11, + 0, + }, //Plane 2 + { + 12, + -1, + }, //Plane 2 + { + 13, + -2, + }, //Plane 2 + { + 14, + -7, + }, //Plane 2 + { + 15, + 0, + }, //Plane 2 + { + 16, + -1, + }, //Plane 2 + { + 17, + 4, + }, //Plane 3 + { + 18, + -3, + }, //Plane 3 + { + 19, + 3, + }, //Plane 3 + { + 20, + -5, + }, //Plane 3 + { + 21, + 4, + }, //Plane 3 + { + 22, + -3, + }, //Plane 3 + { + 23, + 3, + }, //Plane 3 + {24, 2}}; //Plane 3 -const double GLONASS_STARTOFFSET_ms = 68.802; //[ms] Initial sign. travel time (this cannot go here) +const double GLONASS_STARTOFFSET_ms = 68.802; //[ms] Initial sign. travel time (this cannot go here) // OBSERVABLE HISTORY DEEP FOR INTERPOLATION const int GLONASS_L1_CA_HISTORY_DEEP = 100; // NAVIGATION MESSAGE DEMODULATION AND DECODING -#define GLONASS_GNAV_PREAMBLE {1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0} +#define GLONASS_GNAV_PREAMBLE \ + { \ + 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0 \ + } const double GLONASS_GNAV_PREAMBLE_DURATION_S = 0.300; const int GLONASS_GNAV_PREAMBLE_LENGTH_BITS = 30; const int GLONASS_GNAV_PREAMBLE_LENGTH_SYMBOLS = 300; const int GLONASS_GNAV_PREAMBLE_PERIOD_SYMBOLS = 2000; -const int GLONASS_GNAV_TELEMETRY_RATE_BITS_SECOND = 50; //!< NAV message bit rate [bits/s] +const int GLONASS_GNAV_TELEMETRY_RATE_BITS_SECOND = 50; //!< NAV message bit rate [bits/s] const int GLONASS_GNAV_TELEMETRY_SYMBOLS_PER_BIT = 10; const int GLONASS_GNAV_TELEMETRY_SYMBOLS_PER_PREAMBLE_BIT = 10; -const int GLONASS_GNAV_TELEMETRY_RATE_SYMBOLS_SECOND = GLONASS_GNAV_TELEMETRY_RATE_BITS_SECOND*GLONASS_GNAV_TELEMETRY_SYMBOLS_PER_BIT; //!< NAV message bit rate [symbols/s] -const int GLONASS_GNAV_STRING_SYMBOLS = 2000; //!< Number of bits per string in the GNAV message (85 data bits + 30 time mark bits) [bits] -const int GLONASS_GNAV_STRING_BITS = 85; //!< Number of bits per string in the GNAV message (85 data bits + 30 time mark bits) [bits] -const int GLONASS_GNAV_HAMMING_CODE_BITS = 8; //!< Number of bits in hamming code sequence of GNAV message -const int GLONASS_GNAV_DATA_SYMBOLS = 1700; // STRING DATA WITHOUT PREAMBLE +const int GLONASS_GNAV_TELEMETRY_RATE_SYMBOLS_SECOND = GLONASS_GNAV_TELEMETRY_RATE_BITS_SECOND * GLONASS_GNAV_TELEMETRY_SYMBOLS_PER_BIT; //!< NAV message bit rate [symbols/s] +const int GLONASS_GNAV_STRING_SYMBOLS = 2000; //!< Number of bits per string in the GNAV message (85 data bits + 30 time mark bits) [bits] +const int GLONASS_GNAV_STRING_BITS = 85; //!< Number of bits per string in the GNAV message (85 data bits + 30 time mark bits) [bits] +const int GLONASS_GNAV_HAMMING_CODE_BITS = 8; //!< Number of bits in hamming code sequence of GNAV message +const int GLONASS_GNAV_DATA_SYMBOLS = 1700; // STRING DATA WITHOUT PREAMBLE -const std::vector GLONASS_GNAV_CRC_I_INDEX {9, 10, 12, 13, 15, 17, 19, 20, 22, 24, 26, 28, 30, 32, 34, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59, 61, 63, 65, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84}; -const std::vector GLONASS_GNAV_CRC_J_INDEX {9, 11, 12, 14, 15, 18, 19, 21, 22, 25, 26, 29, 30, 33, 34, 36, 37, 40, 41, 44, 45, 48, 49, 52, 53, 56, 57, 60, 61, 64, 65, 67, 68, 71, 72, 75, 76, 79, 80, 83, 84}; -const std::vector GLONASS_GNAV_CRC_K_INDEX {10, 11, 12, 16, 17, 18, 19, 23, 24, 25, 26, 31, 32, 33, 34, 38, 39, 40, 41, 46, 47, 48, 49, 54, 55, 56, 57, 62, 63, 64, 65, 69, 70, 71, 72, 77, 78, 79, 80, 85}; -const std::vector GLONASS_GNAV_CRC_L_INDEX {13, 14, 15, 16, 17, 18, 19, 27, 28, 29, 30, 31, 32, 33, 34, 42, 43, 44, 45, 46, 47, 48, 49, 58, 59, 60, 61, 62, 63, 64, 65, 73, 74, 75, 76, 77, 78, 79, 80}; -const std::vector GLONASS_GNAV_CRC_M_INDEX {20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 81, 82, 83, 84, 85}; -const std::vector GLONASS_GNAV_CRC_N_INDEX {35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65}; -const std::vector GLONASS_GNAV_CRC_P_INDEX {66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85}; -const std::vector GLONASS_GNAV_CRC_Q_INDEX {9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85}; +const std::vector GLONASS_GNAV_CRC_I_INDEX{9, 10, 12, 13, 15, 17, 19, 20, 22, 24, 26, 28, 30, 32, 34, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59, 61, 63, 65, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84}; +const std::vector GLONASS_GNAV_CRC_J_INDEX{9, 11, 12, 14, 15, 18, 19, 21, 22, 25, 26, 29, 30, 33, 34, 36, 37, 40, 41, 44, 45, 48, 49, 52, 53, 56, 57, 60, 61, 64, 65, 67, 68, 71, 72, 75, 76, 79, 80, 83, 84}; +const std::vector GLONASS_GNAV_CRC_K_INDEX{10, 11, 12, 16, 17, 18, 19, 23, 24, 25, 26, 31, 32, 33, 34, 38, 39, 40, 41, 46, 47, 48, 49, 54, 55, 56, 57, 62, 63, 64, 65, 69, 70, 71, 72, 77, 78, 79, 80, 85}; +const std::vector GLONASS_GNAV_CRC_L_INDEX{13, 14, 15, 16, 17, 18, 19, 27, 28, 29, 30, 31, 32, 33, 34, 42, 43, 44, 45, 46, 47, 48, 49, 58, 59, 60, 61, 62, 63, 64, 65, 73, 74, 75, 76, 77, 78, 79, 80}; +const std::vector GLONASS_GNAV_CRC_M_INDEX{20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 81, 82, 83, 84, 85}; +const std::vector GLONASS_GNAV_CRC_N_INDEX{35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65}; +const std::vector GLONASS_GNAV_CRC_P_INDEX{66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85}; +const std::vector GLONASS_GNAV_CRC_Q_INDEX{9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85}; // GLONASS GNAV NAVIGATION MESSAGE STRUCTURE // NAVIGATION MESSAGE FIELDS POSITIONS (from IS-GPS-200E Appendix II) // FRAME 1-4 // COMMON FIELDS -const std::vector> STRING_ID({{2,4}}); -const std::vector> KX({{78,8}}); +const std::vector> STRING_ID({{2, 4}}); +const std::vector> KX({{78, 8}}); //STRING 1 -const std::vector> P1({{8,2}}); -const std::vector> T_K_HR({{10,5}}); -const std::vector> T_K_MIN({{15,6}}); -const std::vector> T_K_SEC({{21,1}}); -const std::vector> X_N_DOT ({{22,24}}); -const std::vector> X_N_DOT_DOT ({{46,5}}); -const std::vector> X_N({{51,27}}); +const std::vector> P1({{8, 2}}); +const std::vector> T_K_HR({{10, 5}}); +const std::vector> T_K_MIN({{15, 6}}); +const std::vector> T_K_SEC({{21, 1}}); +const std::vector> X_N_DOT({{22, 24}}); +const std::vector> X_N_DOT_DOT({{46, 5}}); +const std::vector> X_N({{51, 27}}); //STRING 2 -const std::vector> B_N({{6,3}}); -const std::vector> P2({{9,1}}); -const std::vector> T_B({{10,7}}); -const std::vector> Y_N_DOT ({{22,24}}); -const std::vector> Y_N_DOT_DOT ({{46,5}}); -const std::vector> Y_N({{51,27}}); +const std::vector> B_N({{6, 3}}); +const std::vector> P2({{9, 1}}); +const std::vector> T_B({{10, 7}}); +const std::vector> Y_N_DOT({{22, 24}}); +const std::vector> Y_N_DOT_DOT({{46, 5}}); +const std::vector> Y_N({{51, 27}}); //STRING 3 -const std::vector> P3({{6,1}}); -const std::vector> GAMMA_N({{7,11}}); -const std::vector> P({{19,2}}); -const std::vector> EPH_L_N({{21,1}}); -const std::vector> Z_N_DOT ({{22,24}}); -const std::vector> Z_N_DOT_DOT ({{46,5}}); -const std::vector> Z_N({{51,27}}); +const std::vector> P3({{6, 1}}); +const std::vector> GAMMA_N({{7, 11}}); +const std::vector> P({{19, 2}}); +const std::vector> EPH_L_N({{21, 1}}); +const std::vector> Z_N_DOT({{22, 24}}); +const std::vector> Z_N_DOT_DOT({{46, 5}}); +const std::vector> Z_N({{51, 27}}); // STRING 4 -const std::vector> TAU_N({{6,22}}); -const std::vector> DELTA_TAU_N({{28,5}}); -const std::vector> E_N({{33,5}}); -const std::vector> P4 ({{52,1}}); -const std::vector> F_T ({{53,4}}); -const std::vector> N_T({{60,11}}); -const std::vector> N({{71,5}}); -const std::vector> M({{76,2}}); +const std::vector> TAU_N({{6, 22}}); +const std::vector> DELTA_TAU_N({{28, 5}}); +const std::vector> E_N({{33, 5}}); +const std::vector> P4({{52, 1}}); +const std::vector> F_T({{53, 4}}); +const std::vector> N_T({{60, 11}}); +const std::vector> N({{71, 5}}); +const std::vector> M({{76, 2}}); // STRING 5 -const std::vector> N_A({{6,11}}); -const std::vector> TAU_C({{17,32}}); -const std::vector> N_4({{50,5}}); -const std::vector> TAU_GPS({{55,22}}); -const std::vector> ALM_L_N({{77,1}}); +const std::vector> N_A({{6, 11}}); +const std::vector> TAU_C({{17, 32}}); +const std::vector> N_4({{50, 5}}); +const std::vector> TAU_GPS({{55, 22}}); +const std::vector> ALM_L_N({{77, 1}}); // STRING 6, 8, 10, 12, 14 -const std::vector> C_N({{6,1}}); -const std::vector> M_N_A({{7,2}}); -const std::vector> n_A({{9,5}}); -const std::vector> TAU_N_A({{14,10}}); -const std::vector> LAMBDA_N_A({{24,21}}); -const std::vector> DELTA_I_N_A({{45,18}}); -const std::vector> EPSILON_N_A({{63,15}}); +const std::vector> C_N({{6, 1}}); +const std::vector> M_N_A({{7, 2}}); +const std::vector> n_A({{9, 5}}); +const std::vector> TAU_N_A({{14, 10}}); +const std::vector> LAMBDA_N_A({{24, 21}}); +const std::vector> DELTA_I_N_A({{45, 18}}); +const std::vector> EPSILON_N_A({{63, 15}}); //STRING 7, 9, 11, 13, 15 -const std::vector> OMEGA_N_A({{6,16}}); -const std::vector> T_LAMBDA_N_A({{22,21}}); -const std::vector> DELTA_T_N_A({{43,22}}); -const std::vector> DELTA_T_DOT_N_A({{65,7}}); -const std::vector> H_N_A({{72,5}}); +const std::vector> OMEGA_N_A({{6, 16}}); +const std::vector> T_LAMBDA_N_A({{22, 21}}); +const std::vector> DELTA_T_N_A({{43, 22}}); +const std::vector> DELTA_T_DOT_N_A({{65, 7}}); +const std::vector> H_N_A({{72, 5}}); // STRING 14 FRAME 5 -const std::vector> B1({{6,11}}); -const std::vector> B2({{17,10}}); +const std::vector> B1({{6, 11}}); +const std::vector> B2({{17, 10}}); #endif /* GNSS_SDR_GLONASS_L1_CA_H_ */ diff --git a/src/core/system_parameters/GPS_CNAV.h b/src/core/system_parameters/GPS_CNAV.h index fc2239ab6..d155f77c0 100644 --- a/src/core/system_parameters/GPS_CNAV.h +++ b/src/core/system_parameters/GPS_CNAV.h @@ -35,150 +35,152 @@ #include "MATH_CONSTANTS.h" #include #include -#include // std::pair +#include // std::pair // CNAV GPS NAVIGATION MESSAGE STRUCTURE // NAVIGATION MESSAGE FIELDS POSITIONS (from IS-GPS-200E Appendix III) -#define GPS_CNAV_PREAMBLE {1, 0, 0, 0, 1, 0, 1, 1} +#define GPS_CNAV_PREAMBLE \ + { \ + 1, 0, 0, 0, 1, 0, 1, 1 \ + } #define GPS_CNAV_PREAMBLE_STR "10001011" #define GPS_CNAV_INV_PREAMBLE_STR "01110100" const int GPS_CNAV_DATA_PAGE_BITS = 300; // common to all messages -const std::vector > CNAV_PRN( { {9,6} } ); -const std::vector > CNAV_MSG_TYPE( { {15,6} } ); -const std::vector > CNAV_TOW( { {21,17} } ); //GPS Time Of Week in seconds +const std::vector > CNAV_PRN({{9, 6}}); +const std::vector > CNAV_MSG_TYPE({{15, 6}}); +const std::vector > CNAV_TOW({{21, 17}}); //GPS Time Of Week in seconds const double CNAV_TOW_LSB = 6.0; -const std::vector > CNAV_ALERT_FLAG( { {38,1} } ); +const std::vector > CNAV_ALERT_FLAG({{38, 1}}); // MESSAGE TYPE 10 (Ephemeris 1) -const std::vector > CNAV_WN({{39,13}}); -const std::vector > CNAV_HEALTH({{52,3}}); -const std::vector > CNAV_TOP1({{55,11}}); +const std::vector > CNAV_WN({{39, 13}}); +const std::vector > CNAV_HEALTH({{52, 3}}); +const std::vector > CNAV_TOP1({{55, 11}}); const double CNAV_TOP1_LSB = 300.0; -const std::vector > CNAV_URA({{66,5}}); +const std::vector > CNAV_URA({{66, 5}}); -const std::vector > CNAV_TOE1({{71,11}}); +const std::vector > CNAV_TOE1({{71, 11}}); const double CNAV_TOE1_LSB = 300.0; -const std::vector > CNAV_DELTA_A({{82,26}}); //Relative to AREF = 26,559,710 meters +const std::vector > CNAV_DELTA_A({{82, 26}}); //Relative to AREF = 26,559,710 meters const double CNAV_DELTA_A_LSB = TWO_N9; -const std::vector > CNAV_A_DOT({{108,25}}); +const std::vector > CNAV_A_DOT({{108, 25}}); const double CNAV_A_DOT_LSB = TWO_N21; -const std::vector > CNAV_DELTA_N0({{133,17}}); -const double CNAV_DELTA_N0_LSB = TWO_N44*PI; //semi-circles to radians -const std::vector > CNAV_DELTA_N0_DOT({{150,23}}); -const double CNAV_DELTA_N0_DOT_LSB = TWO_N57*PI;//semi-circles to radians -const std::vector > CNAV_M0({{173,33}}); -const double CNAV_M0_LSB = TWO_N32*PI;//semi-circles to radians -const std::vector > CNAV_E_ECCENTRICITY({{206,33}}); +const std::vector > CNAV_DELTA_N0({{133, 17}}); +const double CNAV_DELTA_N0_LSB = TWO_N44 * PI; //semi-circles to radians +const std::vector > CNAV_DELTA_N0_DOT({{150, 23}}); +const double CNAV_DELTA_N0_DOT_LSB = TWO_N57 * PI; //semi-circles to radians +const std::vector > CNAV_M0({{173, 33}}); +const double CNAV_M0_LSB = TWO_N32 * PI; //semi-circles to radians +const std::vector > CNAV_E_ECCENTRICITY({{206, 33}}); const double CNAV_E_ECCENTRICITY_LSB = TWO_N34; -const std::vector > CNAV_OMEGA({{239,33}}); -const double CNAV_OMEGA_LSB = TWO_N32*PI;//semi-circles to radians -const std::vector > CNAV_INTEGRITY_FLAG({{272,1}}); -const std::vector > CNAV_L2_PHASING_FLAG({{273,1}}); +const std::vector > CNAV_OMEGA({{239, 33}}); +const double CNAV_OMEGA_LSB = TWO_N32 * PI; //semi-circles to radians +const std::vector > CNAV_INTEGRITY_FLAG({{272, 1}}); +const std::vector > CNAV_L2_PHASING_FLAG({{273, 1}}); // MESSAGE TYPE 11 (Ephemeris 2) -const std::vector > CNAV_TOE2({{39,11}}); +const std::vector > CNAV_TOE2({{39, 11}}); const double CNAV_TOE2_LSB = 300.0; -const std::vector > CNAV_OMEGA0({{50,33}}); -const double CNAV_OMEGA0_LSB = TWO_N32*PI;//semi-circles to radians -const std::vector > CNAV_I0({{83,33}}); -const double CNAV_I0_LSB = TWO_N32*PI;//semi-circles to radians -const std::vector > CNAV_DELTA_OMEGA_DOT({{116,17}}); //Relative to REF = -2.6 x 10-9 semi-circles/second. -const double CNAV_DELTA_OMEGA_DOT_LSB = TWO_N44*PI;//semi-circles to radians -const std::vector > CNAV_I0_DOT({{133,15}}); -const double CNAV_I0_DOT_LSB = TWO_N44*PI;//semi-circles to radians -const std::vector > CNAV_CIS({{148,16}}); +const std::vector > CNAV_OMEGA0({{50, 33}}); +const double CNAV_OMEGA0_LSB = TWO_N32 * PI; //semi-circles to radians +const std::vector > CNAV_I0({{83, 33}}); +const double CNAV_I0_LSB = TWO_N32 * PI; //semi-circles to radians +const std::vector > CNAV_DELTA_OMEGA_DOT({{116, 17}}); //Relative to REF = -2.6 x 10-9 semi-circles/second. +const double CNAV_DELTA_OMEGA_DOT_LSB = TWO_N44 * PI; //semi-circles to radians +const std::vector > CNAV_I0_DOT({{133, 15}}); +const double CNAV_I0_DOT_LSB = TWO_N44 * PI; //semi-circles to radians +const std::vector > CNAV_CIS({{148, 16}}); const double CNAV_CIS_LSB = TWO_N30; -const std::vector > CNAV_CIC({{164,16}}); +const std::vector > CNAV_CIC({{164, 16}}); const double CNAV_CIC_LSB = TWO_N30; -const std::vector > CNAV_CRS({{180,24}}); +const std::vector > CNAV_CRS({{180, 24}}); const double CNAV_CRS_LSB = TWO_N8; -const std::vector > CNAV_CRC({{204,24}}); +const std::vector > CNAV_CRC({{204, 24}}); const double CNAV_CRC_LSB = TWO_N8; -const std::vector > CNAV_CUS({{228,21}}); +const std::vector > CNAV_CUS({{228, 21}}); const double CNAV_CUS_LSB = TWO_N30; -const std::vector > CNAV_CUC({{249,21}}); +const std::vector > CNAV_CUC({{249, 21}}); const double CNAV_CUC_LSB = TWO_N30; // MESSAGE TYPE 30 (CLOCK, IONO, GRUP DELAY) -const std::vector > CNAV_TOP2({{39,11}}); +const std::vector > CNAV_TOP2({{39, 11}}); const double CNAV_TOP2_LSB = 300.0; -const std::vector > CNAV_URA_NED0({{50,5}}); -const std::vector > CNAV_URA_NED1({{55,3}}); -const std::vector > CNAV_URA_NED2({{58,3}}); -const std::vector > CNAV_TOC({{61,11}}); +const std::vector > CNAV_URA_NED0({{50, 5}}); +const std::vector > CNAV_URA_NED1({{55, 3}}); +const std::vector > CNAV_URA_NED2({{58, 3}}); +const std::vector > CNAV_TOC({{61, 11}}); const double CNAV_TOC_LSB = 300.0; -const std::vector > CNAV_AF0({{72,26}}); +const std::vector > CNAV_AF0({{72, 26}}); const double CNAV_AF0_LSB = TWO_N60; -const std::vector > CNAV_AF1({{98,20}}); +const std::vector > CNAV_AF1({{98, 20}}); const double CNAV_AF1_LSB = TWO_N48; -const std::vector > CNAV_AF2({{118,10}}); +const std::vector > CNAV_AF2({{118, 10}}); const double CNAV_AF2_LSB = TWO_N35; -const std::vector > CNAV_TGD({{128,13}}); +const std::vector > CNAV_TGD({{128, 13}}); const double CNAV_TGD_LSB = TWO_N35; -const std::vector > CNAV_ISCL1({{141,13}}); +const std::vector > CNAV_ISCL1({{141, 13}}); const double CNAV_ISCL1_LSB = TWO_N35; -const std::vector > CNAV_ISCL2({{154,13}}); +const std::vector > CNAV_ISCL2({{154, 13}}); const double CNAV_ISCL2_LSB = TWO_N35; -const std::vector > CNAV_ISCL5I({{167,13}}); +const std::vector > CNAV_ISCL5I({{167, 13}}); const double CNAV_ISCL5I_LSB = TWO_N35; -const std::vector > CNAV_ISCL5Q({{180,13}}); +const std::vector > CNAV_ISCL5Q({{180, 13}}); const double CNAV_ISCL5Q_LSB = TWO_N35; //Ionospheric parameters -const std::vector > CNAV_ALPHA0({{193,8}}); +const std::vector > CNAV_ALPHA0({{193, 8}}); const double CNAV_ALPHA0_LSB = TWO_N30; -const std::vector > CNAV_ALPHA1({{201,8}}); +const std::vector > CNAV_ALPHA1({{201, 8}}); const double CNAV_ALPHA1_LSB = TWO_N27; -const std::vector > CNAV_ALPHA2({{209,8}}); +const std::vector > CNAV_ALPHA2({{209, 8}}); const double CNAV_ALPHA2_LSB = TWO_N24; -const std::vector > CNAV_ALPHA3({{217,8}}); +const std::vector > CNAV_ALPHA3({{217, 8}}); const double CNAV_ALPHA3_LSB = TWO_N24; -const std::vector > CNAV_BETA0({{225,8}}); +const std::vector > CNAV_BETA0({{225, 8}}); const double CNAV_BETA0_LSB = TWO_P11; -const std::vector > CNAV_BETA1({{233,8}}); +const std::vector > CNAV_BETA1({{233, 8}}); const double CNAV_BETA1_LSB = TWO_P14; -const std::vector > CNAV_BETA2({{241,8}}); +const std::vector > CNAV_BETA2({{241, 8}}); const double CNAV_BETA2_LSB = TWO_P16; -const std::vector > CNAV_BETA3({{249,8}}); +const std::vector > CNAV_BETA3({{249, 8}}); const double CNAV_BETA3_LSB = TWO_P16; -const std::vector > CNAV_WNOP({{257,8}}); +const std::vector > CNAV_WNOP({{257, 8}}); // MESSAGE TYPE 33 (CLOCK and UTC) -const std::vector > CNAV_A0({{128,16}}); +const std::vector > CNAV_A0({{128, 16}}); const double CNAV_A0_LSB = TWO_N35; -const std::vector > CNAV_A1({{144,13}}); +const std::vector > CNAV_A1({{144, 13}}); const double CNAV_A1_LSB = TWO_N51; -const std::vector > CNAV_A2({{157,7}}); +const std::vector > CNAV_A2({{157, 7}}); const double CNAV_A2_LSB = TWO_N68; -const std::vector > CNAV_DELTA_TLS({{164,8}}); +const std::vector > CNAV_DELTA_TLS({{164, 8}}); const double CNAV_DELTA_TLS_LSB = 1; -const std::vector > CNAV_TOT({{172,16}}); +const std::vector > CNAV_TOT({{172, 16}}); const double CNAV_TOT_LSB = TWO_P4; -const std::vector > CNAV_WN_OT({{188,13}}); +const std::vector > CNAV_WN_OT({{188, 13}}); const double CNAV_WN_OT_LSB = 1; -const std::vector > CNAV_WN_LSF({{201,13}}); +const std::vector > CNAV_WN_LSF({{201, 13}}); const double CNAV_WN_LSF_LSB = 1; -const std::vector > CNAV_DN({{214,4}}); +const std::vector > CNAV_DN({{214, 4}}); const double CNAV_DN_LSB = 1; -const std::vector > CNAV_DELTA_TLSF({{218,8}}); +const std::vector > CNAV_DELTA_TLSF({{218, 8}}); const double CNAV_DELTA_TLSF_LSB = 1; // TODO: Add more frames (Almanac, etc...) - #endif /* GNSS_SDR_GPS_CNAV_H_ */ diff --git a/src/core/system_parameters/GPS_L1_CA.h b/src/core/system_parameters/GPS_L1_CA.h index ea1c1f9eb..180ec521b 100644 --- a/src/core/system_parameters/GPS_L1_CA.h +++ b/src/core/system_parameters/GPS_L1_CA.h @@ -35,25 +35,25 @@ #include "gnss_frequencies.h" #include "MATH_CONSTANTS.h" #include -#include // std::pair +#include // std::pair // Physical constants -const double GPS_C_m_s = SPEED_OF_LIGHT; //!< The speed of light, [m/s] -const double GPS_C_m_ms = 299792.4580; //!< The speed of light, [m/ms] -const double GPS_PI = 3.1415926535898; //!< Pi as defined in IS-GPS-200E -const double GPS_TWO_PI = 6.283185307179586;//!< 2Pi as defined in IS-GPS-200E +const double GPS_C_m_s = SPEED_OF_LIGHT; //!< The speed of light, [m/s] +const double GPS_C_m_ms = 299792.4580; //!< The speed of light, [m/ms] +const double GPS_PI = 3.1415926535898; //!< Pi as defined in IS-GPS-200E +const double GPS_TWO_PI = 6.283185307179586; //!< 2Pi as defined in IS-GPS-200E const double OMEGA_EARTH_DOT = DEFAULT_OMEGA_EARTH_DOT; //!< Earth rotation rate, [rad/s] -const double GM = 3.986005e14; //!< Universal gravitational constant times the mass of the Earth, [m^3/s^2] -const double F = -4.442807633e-10; //!< Constant, [s/(m)^(1/2)] +const double GM = 3.986005e14; //!< Universal gravitational constant times the mass of the Earth, [m^3/s^2] +const double F = -4.442807633e-10; //!< Constant, [s/(m)^(1/2)] // carrier and code frequencies -const double GPS_L1_FREQ_HZ = FREQ1; //!< L1 [Hz] -const double GPS_L1_CA_CODE_RATE_HZ = 1.023e6; //!< GPS L1 C/A code rate [chips/s] -const double GPS_L1_CA_CODE_LENGTH_CHIPS = 1023.0; //!< GPS L1 C/A code length [chips] -const double GPS_L1_CA_CODE_PERIOD = 0.001; //!< GPS L1 C/A code period [seconds] -const double GPS_L1_CA_CHIP_PERIOD = 9.7752e-07; //!< GPS L1 C/A chip period [seconds] +const double GPS_L1_FREQ_HZ = FREQ1; //!< L1 [Hz] +const double GPS_L1_CA_CODE_RATE_HZ = 1.023e6; //!< GPS L1 C/A code rate [chips/s] +const double GPS_L1_CA_CODE_LENGTH_CHIPS = 1023.0; //!< GPS L1 C/A code length [chips] +const double GPS_L1_CA_CODE_PERIOD = 0.001; //!< GPS L1 C/A code period [seconds] +const double GPS_L1_CA_CHIP_PERIOD = 9.7752e-07; //!< GPS L1 C/A chip period [seconds] /*! * \brief Maximum Time-Of-Arrival (TOA) difference between satellites for a receiver operated on Earth surface is 20 ms @@ -66,7 +66,7 @@ const double GPS_L1_CA_CHIP_PERIOD = 9.7752e-07; //!< GPS L1 C/A chip const double MAX_TOA_DELAY_MS = 20; //#define NAVIGATION_SOLUTION_RATE_MS 1000 // this cannot go here -const double GPS_STARTOFFSET_ms = 68.802; //[ms] Initial sign. travel time (this cannot go here) +const double GPS_STARTOFFSET_ms = 68.802; //[ms] Initial sign. travel time (this cannot go here) // OBSERVABLE HISTORY DEEP FOR INTERPOLATION @@ -74,172 +74,175 @@ const int GPS_L1_CA_HISTORY_DEEP = 500; // NAVIGATION MESSAGE DEMODULATION AND DECODING -#define GPS_PREAMBLE {1, 0, 0, 0, 1, 0, 1, 1} +#define GPS_PREAMBLE \ + { \ + 1, 0, 0, 0, 1, 0, 1, 1 \ + } const int GPS_CA_PREAMBLE_LENGTH_BITS = 8; const int GPS_CA_PREAMBLE_LENGTH_SYMBOLS = 160; const double GPS_CA_PREAMBLE_DURATION_S = 0.160; -const int GPS_CA_TELEMETRY_RATE_BITS_SECOND = 50; //!< NAV message bit rate [bits/s] +const int GPS_CA_TELEMETRY_RATE_BITS_SECOND = 50; //!< NAV message bit rate [bits/s] const int GPS_CA_TELEMETRY_SYMBOLS_PER_BIT = 20; -const int GPS_CA_TELEMETRY_RATE_SYMBOLS_SECOND = GPS_CA_TELEMETRY_RATE_BITS_SECOND*GPS_CA_TELEMETRY_SYMBOLS_PER_BIT; //!< NAV message bit rate [symbols/s] -const int GPS_WORD_LENGTH = 4; //!< CRC + GPS WORD (-2 -1 0 ... 29) Bits = 4 bytes -const int GPS_SUBFRAME_LENGTH = 40; //!< GPS_WORD_LENGTH x 10 = 40 bytes -const int GPS_SUBFRAME_BITS = 300; //!< Number of bits per subframe in the NAV message [bits] -const int GPS_SUBFRAME_SECONDS = 6; //!< Subframe duration [seconds] -const int GPS_SUBFRAME_MS = 6000; //!< Subframe duration [seconds] -const int GPS_WORD_BITS = 30; //!< Number of bits per word in the NAV message [bits] +const int GPS_CA_TELEMETRY_RATE_SYMBOLS_SECOND = GPS_CA_TELEMETRY_RATE_BITS_SECOND * GPS_CA_TELEMETRY_SYMBOLS_PER_BIT; //!< NAV message bit rate [symbols/s] +const int GPS_WORD_LENGTH = 4; //!< CRC + GPS WORD (-2 -1 0 ... 29) Bits = 4 bytes +const int GPS_SUBFRAME_LENGTH = 40; //!< GPS_WORD_LENGTH x 10 = 40 bytes +const int GPS_SUBFRAME_BITS = 300; //!< Number of bits per subframe in the NAV message [bits] +const int GPS_SUBFRAME_SECONDS = 6; //!< Subframe duration [seconds] +const int GPS_SUBFRAME_MS = 6000; //!< Subframe duration [seconds] +const int GPS_WORD_BITS = 30; //!< Number of bits per word in the NAV message [bits] // GPS NAVIGATION MESSAGE STRUCTURE // NAVIGATION MESSAGE FIELDS POSITIONS (from IS-GPS-200E Appendix II) // SUBFRAME 1-5 (TLM and HOW) -const std::vector > TOW( { {31,17} } ); -const std::vector > INTEGRITY_STATUS_FLAG({{23,1}}); -const std::vector > ALERT_FLAG({{48,1}}); -const std::vector > ANTI_SPOOFING_FLAG({{49,1}}); -const std::vector > SUBFRAME_ID({{50,3}}); +const std::vector> TOW({{31, 17}}); +const std::vector> INTEGRITY_STATUS_FLAG({{23, 1}}); +const std::vector> ALERT_FLAG({{48, 1}}); +const std::vector> ANTI_SPOOFING_FLAG({{49, 1}}); +const std::vector> SUBFRAME_ID({{50, 3}}); // SUBFRAME 1 -const std::vector> GPS_WEEK({{61,10}}); -const std::vector> CA_OR_P_ON_L2({{71,2}}); //* -const std::vector> SV_ACCURACY({{73,4}}); -const std::vector> SV_HEALTH ({{77,6}}); -const std::vector> L2_P_DATA_FLAG ({{91,1}}); -const std::vector> T_GD({{197,8}}); +const std::vector> GPS_WEEK({{61, 10}}); +const std::vector> CA_OR_P_ON_L2({{71, 2}}); //* +const std::vector> SV_ACCURACY({{73, 4}}); +const std::vector> SV_HEALTH({{77, 6}}); +const std::vector> L2_P_DATA_FLAG({{91, 1}}); +const std::vector> T_GD({{197, 8}}); const double T_GD_LSB = TWO_N31; -const std::vector> IODC({{83,2},{211,8}}); -const std::vector> T_OC({{219,16}}); +const std::vector> IODC({{83, 2}, {211, 8}}); +const std::vector> T_OC({{219, 16}}); const double T_OC_LSB = TWO_P4; -const std::vector> A_F2({{241,8}}); +const std::vector> A_F2({{241, 8}}); const double A_F2_LSB = TWO_N55; -const std::vector> A_F1({{249,16}}); +const std::vector> A_F1({{249, 16}}); const double A_F1_LSB = TWO_N43; -const std::vector> A_F0({{271,22}}); +const std::vector> A_F0({{271, 22}}); const double A_F0_LSB = TWO_N31; // SUBFRAME 2 -const std::vector> IODE_SF2({{61,8}}); -const std::vector> C_RS({{69,16}}); +const std::vector> IODE_SF2({{61, 8}}); +const std::vector> C_RS({{69, 16}}); const double C_RS_LSB = TWO_N5; -const std::vector> DELTA_N({{91,16}}); +const std::vector> DELTA_N({{91, 16}}); const double DELTA_N_LSB = PI_TWO_N43; -const std::vector> M_0({{107,8},{121,24}}); +const std::vector> M_0({{107, 8}, {121, 24}}); const double M_0_LSB = PI_TWO_N31; -const std::vector> C_UC({{151,16}}); +const std::vector> C_UC({{151, 16}}); const double C_UC_LSB = TWO_N29; -const std::vector> E({{167,8},{181,24}}); +const std::vector> E({{167, 8}, {181, 24}}); const double E_LSB = TWO_N33; -const std::vector> C_US({{211,16}}); +const std::vector> C_US({{211, 16}}); const double C_US_LSB = TWO_N29; -const std::vector> SQRT_A({{227,8},{241,24}}); +const std::vector> SQRT_A({{227, 8}, {241, 24}}); const double SQRT_A_LSB = TWO_N19; -const std::vector> T_OE({{271,16}}); +const std::vector> T_OE({{271, 16}}); const double T_OE_LSB = TWO_P4; -const std::vector> FIT_INTERVAL_FLAG({{271,1}}); -const std::vector> AODO({{272,5}}); +const std::vector> FIT_INTERVAL_FLAG({{271, 1}}); +const std::vector> AODO({{272, 5}}); const int AODO_LSB = 900; // SUBFRAME 3 -const std::vector> C_IC({{61,16}}); +const std::vector> C_IC({{61, 16}}); const double C_IC_LSB = TWO_N29; -const std::vector> OMEGA_0({{77,8},{91,24}}); +const std::vector> OMEGA_0({{77, 8}, {91, 24}}); const double OMEGA_0_LSB = PI_TWO_N31; -const std::vector> C_IS({{121,16}}); +const std::vector> C_IS({{121, 16}}); const double C_IS_LSB = TWO_N29; -const std::vector> I_0({{137,8},{151,24}}); +const std::vector> I_0({{137, 8}, {151, 24}}); const double I_0_LSB = PI_TWO_N31; -const std::vector> C_RC({{181,16}}); +const std::vector> C_RC({{181, 16}}); const double C_RC_LSB = TWO_N5; -const std::vector> OMEGA({{197,8},{211,24}}); +const std::vector> OMEGA({{197, 8}, {211, 24}}); const double OMEGA_LSB = PI_TWO_N31; -const std::vector> OMEGA_DOT({{241,24}}); +const std::vector> OMEGA_DOT({{241, 24}}); const double OMEGA_DOT_LSB = PI_TWO_N43; -const std::vector> IODE_SF3({{271,8}}); -const std::vector> I_DOT({{279,14}}); +const std::vector> IODE_SF3({{271, 8}}); +const std::vector> I_DOT({{279, 14}}); const double I_DOT_LSB = PI_TWO_N43; // SUBFRAME 4-5 -const std::vector> SV_DATA_ID({{61,2}}); -const std::vector> SV_PAGE({{63,6}}); +const std::vector> SV_DATA_ID({{61, 2}}); +const std::vector> SV_PAGE({{63, 6}}); // SUBFRAME 4 //! \todo read all pages of subframe 4 // Page 18 - Ionospheric and UTC data -const std::vector> ALPHA_0({{69,8}}); +const std::vector> ALPHA_0({{69, 8}}); const double ALPHA_0_LSB = TWO_N30; -const std::vector> ALPHA_1({{77,8}}); +const std::vector> ALPHA_1({{77, 8}}); const double ALPHA_1_LSB = TWO_N27; -const std::vector> ALPHA_2({{91,8}}); +const std::vector> ALPHA_2({{91, 8}}); const double ALPHA_2_LSB = TWO_N24; -const std::vector> ALPHA_3({{99,8}}); +const std::vector> ALPHA_3({{99, 8}}); const double ALPHA_3_LSB = TWO_N24; -const std::vector> BETA_0({{107,8}}); +const std::vector> BETA_0({{107, 8}}); const double BETA_0_LSB = TWO_P11; -const std::vector> BETA_1({{121,8}}); +const std::vector> BETA_1({{121, 8}}); const double BETA_1_LSB = TWO_P14; -const std::vector> BETA_2({{129,8}}); +const std::vector> BETA_2({{129, 8}}); const double BETA_2_LSB = TWO_P16; -const std::vector> BETA_3({{137,8}}); +const std::vector> BETA_3({{137, 8}}); const double BETA_3_LSB = TWO_P16; -const std::vector> A_1({{151,24}}); +const std::vector> A_1({{151, 24}}); const double A_1_LSB = TWO_N50; -const std::vector> A_0({{181,24},{211,8}}); +const std::vector> A_0({{181, 24}, {211, 8}}); const double A_0_LSB = TWO_N30; -const std::vector> T_OT({{219,8}}); +const std::vector> T_OT({{219, 8}}); const double T_OT_LSB = TWO_P12; -const std::vector> WN_T({{227,8}}); +const std::vector> WN_T({{227, 8}}); const double WN_T_LSB = 1; -const std::vector> DELTAT_LS({{241,8}}); +const std::vector> DELTAT_LS({{241, 8}}); const double DELTAT_LS_LSB = 1; -const std::vector> WN_LSF({{249,8}}); +const std::vector> WN_LSF({{249, 8}}); const double WN_LSF_LSB = 1; -const std::vector> DN({{257,8}}); +const std::vector> DN({{257, 8}}); const double DN_LSB = 1; -const std::vector> DELTAT_LSF({{271,8}}); +const std::vector> DELTAT_LSF({{271, 8}}); const double DELTAT_LSF_LSB = 1; // Page 25 - Antispoofing, SV config and SV health (PRN 25 -32) -const std::vector> HEALTH_SV25({{229,6}}); -const std::vector> HEALTH_SV26({{241,6}}); -const std::vector> HEALTH_SV27({{247,6}}); -const std::vector> HEALTH_SV28({{253,6}}); -const std::vector> HEALTH_SV29({{259,6}}); -const std::vector> HEALTH_SV30({{271,6}}); -const std::vector> HEALTH_SV31({{277,6}}); -const std::vector> HEALTH_SV32({{283,6}}); +const std::vector> HEALTH_SV25({{229, 6}}); +const std::vector> HEALTH_SV26({{241, 6}}); +const std::vector> HEALTH_SV27({{247, 6}}); +const std::vector> HEALTH_SV28({{253, 6}}); +const std::vector> HEALTH_SV29({{259, 6}}); +const std::vector> HEALTH_SV30({{271, 6}}); +const std::vector> HEALTH_SV31({{277, 6}}); +const std::vector> HEALTH_SV32({{283, 6}}); // SUBFRAME 5 //! \todo read all pages of subframe 5 // page 25 - Health (PRN 1 - 24) -const std::vector> T_OA({{69,8}}); +const std::vector> T_OA({{69, 8}}); const double T_OA_LSB = TWO_P12; -const std::vector> WN_A({{77,8}}); -const std::vector> HEALTH_SV1({{91,6}}); -const std::vector> HEALTH_SV2({{97,6}}); -const std::vector> HEALTH_SV3({{103,6}}); -const std::vector> HEALTH_SV4({{109,6}}); -const std::vector> HEALTH_SV5({{121,6}}); -const std::vector> HEALTH_SV6({{127,6}}); -const std::vector> HEALTH_SV7({{133,6}}); -const std::vector> HEALTH_SV8({{139,6}}); -const std::vector> HEALTH_SV9({{151,6}}); -const std::vector> HEALTH_SV10({{157,6}}); -const std::vector> HEALTH_SV11({{163,6}}); -const std::vector> HEALTH_SV12({{169,6}}); -const std::vector> HEALTH_SV13({{181,6}}); -const std::vector> HEALTH_SV14({{187,6}}); -const std::vector> HEALTH_SV15({{193,6}}); -const std::vector> HEALTH_SV16({{199,6}}); -const std::vector> HEALTH_SV17({{211,6}}); -const std::vector> HEALTH_SV18({{217,6}}); -const std::vector> HEALTH_SV19({{223,6}}); -const std::vector> HEALTH_SV20({{229,6}}); -const std::vector> HEALTH_SV21({{241,6}}); -const std::vector> HEALTH_SV22({{247,6}}); -const std::vector> HEALTH_SV23({{253,6}}); -const std::vector> HEALTH_SV24({{259,6}}); +const std::vector> WN_A({{77, 8}}); +const std::vector> HEALTH_SV1({{91, 6}}); +const std::vector> HEALTH_SV2({{97, 6}}); +const std::vector> HEALTH_SV3({{103, 6}}); +const std::vector> HEALTH_SV4({{109, 6}}); +const std::vector> HEALTH_SV5({{121, 6}}); +const std::vector> HEALTH_SV6({{127, 6}}); +const std::vector> HEALTH_SV7({{133, 6}}); +const std::vector> HEALTH_SV8({{139, 6}}); +const std::vector> HEALTH_SV9({{151, 6}}); +const std::vector> HEALTH_SV10({{157, 6}}); +const std::vector> HEALTH_SV11({{163, 6}}); +const std::vector> HEALTH_SV12({{169, 6}}); +const std::vector> HEALTH_SV13({{181, 6}}); +const std::vector> HEALTH_SV14({{187, 6}}); +const std::vector> HEALTH_SV15({{193, 6}}); +const std::vector> HEALTH_SV16({{199, 6}}); +const std::vector> HEALTH_SV17({{211, 6}}); +const std::vector> HEALTH_SV18({{217, 6}}); +const std::vector> HEALTH_SV19({{223, 6}}); +const std::vector> HEALTH_SV20({{229, 6}}); +const std::vector> HEALTH_SV21({{241, 6}}); +const std::vector> HEALTH_SV22({{247, 6}}); +const std::vector> HEALTH_SV23({{253, 6}}); +const std::vector> HEALTH_SV24({{259, 6}}); #endif /* GNSS_SDR_GPS_L1_CA_H_ */ diff --git a/src/core/system_parameters/GPS_L2C.h b/src/core/system_parameters/GPS_L2C.h index 625aafe01..597034303 100644 --- a/src/core/system_parameters/GPS_L2C.h +++ b/src/core/system_parameters/GPS_L2C.h @@ -38,64 +38,64 @@ #include "MATH_CONSTANTS.h" #include #include -#include // std::pair +#include // std::pair // Physical constants -const double GPS_L2_C_m_s = 299792458.0; //!< The speed of light, [m/s] -const double GPS_L2_C_m_ms = 299792.4580; //!< The speed of light, [m/ms] -const double GPS_L2_PI = 3.1415926535898; //!< Pi as defined in IS-GPS-200E -const double GPS_L2_TWO_PI = 6.283185307179586; //!< 2Pi as defined in IS-GPS-200E +const double GPS_L2_C_m_s = 299792458.0; //!< The speed of light, [m/s] +const double GPS_L2_C_m_ms = 299792.4580; //!< The speed of light, [m/ms] +const double GPS_L2_PI = 3.1415926535898; //!< Pi as defined in IS-GPS-200E +const double GPS_L2_TWO_PI = 6.283185307179586; //!< 2Pi as defined in IS-GPS-200E const double GPS_L2_OMEGA_EARTH_DOT = 7.2921151467e-5; //!< Earth rotation rate, [rad/s] -const double GPS_L2_GM = 3.986005e14; //!< Universal gravitational constant times the mass of the Earth, [m^3/s^2] -const double GPS_L2_F = -4.442807633e-10; //!< Constant, [s/(m)^(1/2)] +const double GPS_L2_GM = 3.986005e14; //!< Universal gravitational constant times the mass of the Earth, [m^3/s^2] +const double GPS_L2_F = -4.442807633e-10; //!< Constant, [s/(m)^(1/2)] // carrier and code frequencies -const double GPS_L2_FREQ_HZ = FREQ2; //!< L2 [Hz] +const double GPS_L2_FREQ_HZ = FREQ2; //!< L2 [Hz] -const double GPS_L2_M_CODE_RATE_HZ = 0.5115e6; //!< GPS L2 M code rate [chips/s] -const int GPS_L2_M_CODE_LENGTH_CHIPS = 10230; //!< GPS L2 M code length [chips] -const double GPS_L2_M_PERIOD = 0.02; //!< GPS L2 M code period [seconds] +const double GPS_L2_M_CODE_RATE_HZ = 0.5115e6; //!< GPS L2 M code rate [chips/s] +const int GPS_L2_M_CODE_LENGTH_CHIPS = 10230; //!< GPS L2 M code length [chips] +const double GPS_L2_M_PERIOD = 0.02; //!< GPS L2 M code period [seconds] -const double GPS_L2_L_CODE_RATE_HZ = 0.5115e6; //!< GPS L2 L code rate [chips/s] -const int GPS_L2_L_CODE_LENGTH_CHIPS = 767250; //!< GPS L2 L code length [chips] -const double GPS_L2_L_PERIOD = 1.5; //!< GPS L2 L code period [seconds] +const double GPS_L2_L_CODE_RATE_HZ = 0.5115e6; //!< GPS L2 L code rate [chips/s] +const int GPS_L2_L_CODE_LENGTH_CHIPS = 767250; //!< GPS L2 L code length [chips] +const double GPS_L2_L_PERIOD = 1.5; //!< GPS L2 L code period [seconds] const int GPS_L2C_HISTORY_DEEP = 5; const int32_t GPS_L2C_M_INIT_REG[115] = - {0742417664, 0756014035,0002747144,0066265724, // 1:4 - 0601403471, 0703232733, 0124510070, 0617316361, // 5:8 - 0047541621, 0733031046, 0713512145, 0024437606, - 0021264003, 0230655351, 0001314400, 0222021506, - 0540264026, 0205521705, 0064022144, 0120161274, - 0044023533, 0724744327, 0045743577, 0741201660, - 0700274134, 0010247261, 0713433445, 0737324162, - 0311627434, 0710452007, 0722462133, 0050172213, - 0500653703, 0755077436, 0136717361, 0756675453, - 0435506112, 0771353753, 0226107701, 0022025110, - 0402466344, 0752566114, 0702011164, 0041216771, - 0047457275, 0266333164, 0713167356, 0060546335, - 0355173035, 0617201036, 0157465571, 0767360553, - 0023127030, 0431343777, 0747317317, 0045706125, - 0002744276, 0060036467, 0217744147, 0603340174,//57:60 - 0326616775, 0063240065, 0111460621, //61:63 - 0604055104, 0157065232, 0013305707, 0603552017,//159:162 - 0230461355, 0603653437, 0652346475, 0743107103, - 0401521277, 0167335110, 0014013575, 0362051132, - 0617753265, 0216363634, 0755561123, 0365304033, - 0625025543, 0054420334, 0415473671, 0662364360, - 0373446602, 0417564100, 0000526452, 0226631300, - 0113752074, 0706134401, 0041352546, 0664630154, - 0276524255, 0714720530, 0714051771, 0044526647, - 0207164322, 0262120161, 0204244652, 0202133131, - 0714351204, 0657127260, 0130567507, 0670517677, - 0607275514, 0045413633, 0212645405, 0613700455, - 0706202440, 0705056276, 0020373522, 0746013617, - 0132720621, 0434015513, 0566721727, 0140633660}; + {0742417664, 0756014035, 0002747144, 0066265724, // 1:4 + 0601403471, 0703232733, 0124510070, 0617316361, // 5:8 + 0047541621, 0733031046, 0713512145, 0024437606, + 0021264003, 0230655351, 0001314400, 0222021506, + 0540264026, 0205521705, 0064022144, 0120161274, + 0044023533, 0724744327, 0045743577, 0741201660, + 0700274134, 0010247261, 0713433445, 0737324162, + 0311627434, 0710452007, 0722462133, 0050172213, + 0500653703, 0755077436, 0136717361, 0756675453, + 0435506112, 0771353753, 0226107701, 0022025110, + 0402466344, 0752566114, 0702011164, 0041216771, + 0047457275, 0266333164, 0713167356, 0060546335, + 0355173035, 0617201036, 0157465571, 0767360553, + 0023127030, 0431343777, 0747317317, 0045706125, + 0002744276, 0060036467, 0217744147, 0603340174, //57:60 + 0326616775, 0063240065, 0111460621, //61:63 + 0604055104, 0157065232, 0013305707, 0603552017, //159:162 + 0230461355, 0603653437, 0652346475, 0743107103, + 0401521277, 0167335110, 0014013575, 0362051132, + 0617753265, 0216363634, 0755561123, 0365304033, + 0625025543, 0054420334, 0415473671, 0662364360, + 0373446602, 0417564100, 0000526452, 0226631300, + 0113752074, 0706134401, 0041352546, 0664630154, + 0276524255, 0714720530, 0714051771, 0044526647, + 0207164322, 0262120161, 0204244652, 0202133131, + 0714351204, 0657127260, 0130567507, 0670517677, + 0607275514, 0045413633, 0212645405, 0613700455, + 0706202440, 0705056276, 0020373522, 0746013617, + 0132720621, 0434015513, 0566721727, 0140633660}; -const int GPS_L2_CNAV_DATA_PAGE_BITS = 300; //!< GPS L2 CNAV page length, including preamble and CRC [bits] +const int GPS_L2_CNAV_DATA_PAGE_BITS = 300; //!< GPS L2 CNAV page length, including preamble and CRC [bits] const int GPS_L2_SYMBOLS_PER_BIT = 2; const int GPS_L2_SAMPLES_PER_SYMBOL = 1; const int GPS_L2_CNAV_DATA_PAGE_SYMBOLS = 600; diff --git a/src/core/system_parameters/GPS_L5.h b/src/core/system_parameters/GPS_L5.h index 9c3236124..af317cfc3 100644 --- a/src/core/system_parameters/GPS_L5.h +++ b/src/core/system_parameters/GPS_L5.h @@ -39,144 +39,144 @@ // Physical constants -const double GPS_L5_C_m_s = 299792458.0; //!< The speed of light, [m/s] -const double GPS_L5_C_m_ms = 299792.4580; //!< The speed of light, [m/ms] -const double GPS_L5_PI = 3.1415926535898; //!< Pi as defined in IS-GPS-200E -const double GPS_L5_TWO_PI = 6.283185307179586; //!< 2Pi as defined in IS-GPS-200E -const double GPS_L5_OMEGA_EARTH_DOT = 7.2921151467e-5; //!< Earth rotation rate, [rad/s] -const double GPS_L5_GM = 3.986005e14; //!< Universal gravitational constant times the mass of the Earth, [m^3/s^2] -const double GPS_L5_F = -4.442807633e-10; //!< Constant, [s/(m)^(1/2)] +const double GPS_L5_C_m_s = 299792458.0; //!< The speed of light, [m/s] +const double GPS_L5_C_m_ms = 299792.4580; //!< The speed of light, [m/ms] +const double GPS_L5_PI = 3.1415926535898; //!< Pi as defined in IS-GPS-200E +const double GPS_L5_TWO_PI = 6.283185307179586; //!< 2Pi as defined in IS-GPS-200E +const double GPS_L5_OMEGA_EARTH_DOT = 7.2921151467e-5; //!< Earth rotation rate, [rad/s] +const double GPS_L5_GM = 3.986005e14; //!< Universal gravitational constant times the mass of the Earth, [m^3/s^2] +const double GPS_L5_F = -4.442807633e-10; //!< Constant, [s/(m)^(1/2)] // carrier and code frequencies -const double GPS_L5_FREQ_HZ = FREQ5; //!< L5 [Hz] +const double GPS_L5_FREQ_HZ = FREQ5; //!< L5 [Hz] -const double GPS_L5i_CODE_RATE_HZ = 10.23e6; //!< GPS L5i code rate [chips/s] -const int GPS_L5i_CODE_LENGTH_CHIPS = 10230; //!< GPS L5i code length [chips] -const double GPS_L5i_PERIOD = 0.001; //!< GPS L5 code period [seconds] -const double GPS_L5i_SYMBOL_PERIOD = 0.01; //!< GPS L5 symbol period [seconds] +const double GPS_L5i_CODE_RATE_HZ = 10.23e6; //!< GPS L5i code rate [chips/s] +const int GPS_L5i_CODE_LENGTH_CHIPS = 10230; //!< GPS L5i code length [chips] +const double GPS_L5i_PERIOD = 0.001; //!< GPS L5 code period [seconds] +const double GPS_L5i_SYMBOL_PERIOD = 0.01; //!< GPS L5 symbol period [seconds] -const double GPS_L5q_CODE_RATE_HZ = 10.23e6; //!< GPS L5i code rate [chips/s] -const int GPS_L5q_CODE_LENGTH_CHIPS = 10230; //!< GPS L5i code length [chips] -const double GPS_L5q_PERIOD = 0.001; //!< GPS L5 code period [seconds] +const double GPS_L5q_CODE_RATE_HZ = 10.23e6; //!< GPS L5i code rate [chips/s] +const int GPS_L5q_CODE_LENGTH_CHIPS = 10230; //!< GPS L5i code length [chips] +const double GPS_L5q_PERIOD = 0.001; //!< GPS L5 code period [seconds] const int GPS_L5_HISTORY_DEEP = 5; const int32_t GPS_L5i_INIT_REG[210] = - {266, 365, 804, 1138, - 1509, 1559, 1756, 2084, - 2170, 2303, 2527, 2687, - 2930, 3471, 3940, 4132, - 4332, 4924, 5343, 5443, - 5641, 5816, 5898, 5918, - 5955, 6243, 6345, 6477, - 6518, 6875, 7168, 7187, - 7329, 7577, 7720, 7777, - 8057, 5358, 3550, 3412, - 819, - 4608, 3698, 962, 3001, - 4441, 4937, 3717, 4730, - 7291, 2279, 7613, 5723, - 7030, 1475, 2593, 2904, - 2056, 2757, 3756, 6205, - 5053, 6437, - 7789, 2311, 7432, 5155, - 1593, 5841, 5014, 1545, - 3016, 4875, 2119, 229, - 7634, 1406, 4506, 1819, - 7580, 5446, 6053, 7958, - 5267, 2956, 3544, 1277, - 2996, 1758, 3360, 2718, - 3754, 7440, 2781, 6756, - 7314, 208, 5252, 696, - 527, 1399, 5879, 6868, - 217, 7681, 3788, 1337, - 2424, 4243, 5686, 1955, - 4791, 492, 1518, 6566, - 5349, 506, 113, 1953, - 2797, 934, 3023, 3632, - 1330, 4909, 4867, 1183, - 3990, 6217, 1224, 1733, - 2319, 3928, 2380, 841, - 5049, 7027, 1197, 7208, - 8000, 152, 6762, 3745, - 4723, 5502, 4796, 123, - 8142, 5091, 7875, 330, - 5272, 4912, 374, 2045, - 6616, 6321, 7605, 2570, - 2419, 1234, 1922, 4317, - 5110, 825, 958, 1089, - 7813, 6058, 7703, 6702, - 1714, 6371, 2281, 1986, - 6282, 3201, 3760, 1056, - 6233, 1150, 2823, 6250, - 645, 2401, 1639, 2946, - 7091, 923, 7045, 6493, - 1706, 5836, 926, 6086, - 950, 5905, 3240, 6675, - 3197, 1555, 3589, 4555, - 5671, 6948, 4664, 2086, - 5950, 5521, 1515}; + {266, 365, 804, 1138, + 1509, 1559, 1756, 2084, + 2170, 2303, 2527, 2687, + 2930, 3471, 3940, 4132, + 4332, 4924, 5343, 5443, + 5641, 5816, 5898, 5918, + 5955, 6243, 6345, 6477, + 6518, 6875, 7168, 7187, + 7329, 7577, 7720, 7777, + 8057, 5358, 3550, 3412, + 819, + 4608, 3698, 962, 3001, + 4441, 4937, 3717, 4730, + 7291, 2279, 7613, 5723, + 7030, 1475, 2593, 2904, + 2056, 2757, 3756, 6205, + 5053, 6437, + 7789, 2311, 7432, 5155, + 1593, 5841, 5014, 1545, + 3016, 4875, 2119, 229, + 7634, 1406, 4506, 1819, + 7580, 5446, 6053, 7958, + 5267, 2956, 3544, 1277, + 2996, 1758, 3360, 2718, + 3754, 7440, 2781, 6756, + 7314, 208, 5252, 696, + 527, 1399, 5879, 6868, + 217, 7681, 3788, 1337, + 2424, 4243, 5686, 1955, + 4791, 492, 1518, 6566, + 5349, 506, 113, 1953, + 2797, 934, 3023, 3632, + 1330, 4909, 4867, 1183, + 3990, 6217, 1224, 1733, + 2319, 3928, 2380, 841, + 5049, 7027, 1197, 7208, + 8000, 152, 6762, 3745, + 4723, 5502, 4796, 123, + 8142, 5091, 7875, 330, + 5272, 4912, 374, 2045, + 6616, 6321, 7605, 2570, + 2419, 1234, 1922, 4317, + 5110, 825, 958, 1089, + 7813, 6058, 7703, 6702, + 1714, 6371, 2281, 1986, + 6282, 3201, 3760, 1056, + 6233, 1150, 2823, 6250, + 645, 2401, 1639, 2946, + 7091, 923, 7045, 6493, + 1706, 5836, 926, 6086, + 950, 5905, 3240, 6675, + 3197, 1555, 3589, 4555, + 5671, 6948, 4664, 2086, + 5950, 5521, 1515}; const int32_t GPS_L5q_INIT_REG[210] = { - 1701, 323, 5292, 2020, - 5429, 7136, 1041, 5947, - 4315, 148, 535, 1939, - 5206, 5910, 3595, 5135, - 6082, 6990, 3546, 1523, - 4548, 4484, 1893, 3961, - 7106, 5299, 4660, 276, - 4389, 3783, 1591, 1601, - 749, 1387, 1661, 3210, - 708, - 4226, 5604, 6375, 3056, - 1772, 3662, 4401, 5218, - 2838, 6913, 1685, 1194, - 6963, 5001, 6694, 991, - 7489, 2441, 639, 2097, - 2498, 6470, 2399, 242, - 3768, 1186, - 5246, 4259, 5907, 3870, - 3262, 7387, 3069, 2999, - 7993, 7849, 4157, 5031, - 5986, 4833, 5739, 7846, - 898, 2022, 7446, 6404, - 155, 7862, 7795, 6121, - 4840, 6585, 429, 6020, - 200, 1664, 1499, 7298, - 1305, 7323, 7544, 4438, - 2485, 3387, 7319, 1853, - 5781, 1874, 7555, 2132, - 6441, 6722, 1192, 2588, - 2188, 297, 1540, 4138, - 5231, 4789, 659, 871, - 6837, 1393, 7383, 611, - 4920, 5416, 1611, 2474, - 118, 1382, 1092, 7950, - 7223, 1769, 4721, 1252, - 5147, 2165, 7897, 4054, - 3498, 6571, 2858, 8126, - 7017, 1901, 181, 1114, - 5195, 7479, 4186, 3904, - 7128, 1396, 4513, 5967, - 2580, 2575, 7961, 2598, - 4508, 2090, 3685, 7748, - 684, 913, 5558, 2894, - 5858, 6432, 3813, 3573, - 7523, 5280, 3376, 7424, - 2918, 5793, 1747, 7079, - 2921, 2490, 4119, 3373, - 977, 681, 4273, 5419, - 5626, 1266, 5804, 2414, - 6444, 4757, 427, 5452, - 5182, 6606, 6531, 4268, - 3115, 6835, 862, 4856, - 2765, 37, 1943, 7977, - 2512, 4451, 4071}; + 1701, 323, 5292, 2020, + 5429, 7136, 1041, 5947, + 4315, 148, 535, 1939, + 5206, 5910, 3595, 5135, + 6082, 6990, 3546, 1523, + 4548, 4484, 1893, 3961, + 7106, 5299, 4660, 276, + 4389, 3783, 1591, 1601, + 749, 1387, 1661, 3210, + 708, + 4226, 5604, 6375, 3056, + 1772, 3662, 4401, 5218, + 2838, 6913, 1685, 1194, + 6963, 5001, 6694, 991, + 7489, 2441, 639, 2097, + 2498, 6470, 2399, 242, + 3768, 1186, + 5246, 4259, 5907, 3870, + 3262, 7387, 3069, 2999, + 7993, 7849, 4157, 5031, + 5986, 4833, 5739, 7846, + 898, 2022, 7446, 6404, + 155, 7862, 7795, 6121, + 4840, 6585, 429, 6020, + 200, 1664, 1499, 7298, + 1305, 7323, 7544, 4438, + 2485, 3387, 7319, 1853, + 5781, 1874, 7555, 2132, + 6441, 6722, 1192, 2588, + 2188, 297, 1540, 4138, + 5231, 4789, 659, 871, + 6837, 1393, 7383, 611, + 4920, 5416, 1611, 2474, + 118, 1382, 1092, 7950, + 7223, 1769, 4721, 1252, + 5147, 2165, 7897, 4054, + 3498, 6571, 2858, 8126, + 7017, 1901, 181, 1114, + 5195, 7479, 4186, 3904, + 7128, 1396, 4513, 5967, + 2580, 2575, 7961, 2598, + 4508, 2090, 3685, 7748, + 684, 913, 5558, 2894, + 5858, 6432, 3813, 3573, + 7523, 5280, 3376, 7424, + 2918, 5793, 1747, 7079, + 2921, 2490, 4119, 3373, + 977, 681, 4273, 5419, + 5626, 1266, 5804, 2414, + 6444, 4757, 427, 5452, + 5182, 6606, 6531, 4268, + 3115, 6835, 862, 4856, + 2765, 37, 1943, 7977, + 2512, 4451, 4071}; -const int GPS_L5_CNAV_DATA_PAGE_BITS = 300; //!< GPS L5 CNAV page length, including preamble and CRC [bits] +const int GPS_L5_CNAV_DATA_PAGE_BITS = 300; //!< GPS L5 CNAV page length, including preamble and CRC [bits] const int GPS_L5_SYMBOLS_PER_BIT = 2; const int GPS_L5_SAMPLES_PER_SYMBOL = 10; const int GPS_L5_CNAV_DATA_PAGE_SYMBOLS = 600; diff --git a/src/core/system_parameters/Galileo_E1.h b/src/core/system_parameters/Galileo_E1.h index 33ace50ae..e52cb536a 100644 --- a/src/core/system_parameters/Galileo_E1.h +++ b/src/core/system_parameters/Galileo_E1.h @@ -37,31 +37,31 @@ #include "MATH_CONSTANTS.h" #include #include -#include // std::pair +#include // std::pair // Physical constants -const double GALILEO_PI = 3.1415926535898; //!< Pi as defined in GALILEO ICD -const double GALILEO_TWO_PI = 6.283185307179600 ; //!< 2*Pi as defined in GALILEO ICD -const double GALILEO_GM = 3.986004418e14; //!< Geocentric gravitational constant[m^3/s^2] +const double GALILEO_PI = 3.1415926535898; //!< Pi as defined in GALILEO ICD +const double GALILEO_TWO_PI = 6.283185307179600; //!< 2*Pi as defined in GALILEO ICD +const double GALILEO_GM = 3.986004418e14; //!< Geocentric gravitational constant[m^3/s^2] const double GALILEO_OMEGA_EARTH_DOT = 7.2921151467e-5; //!< Mean angular velocity of the Earth [rad/s] -const double GALILEO_C_m_s = 299792458.0; //!< The speed of light, [m/s] -const double GALILEO_C_m_ms = 299792.4580; //!< The speed of light, [m/ms] -const double GALILEO_F = -4.442807309e-10; //!< Constant, [s/(m)^(1/2)] +const double GALILEO_C_m_s = 299792458.0; //!< The speed of light, [m/s] +const double GALILEO_C_m_ms = 299792.4580; //!< The speed of light, [m/ms] +const double GALILEO_F = -4.442807309e-10; //!< Constant, [s/(m)^(1/2)] // carrier and code frequencies -const double Galileo_E1_FREQ_HZ = FREQ1; //!< Galileo E1 carrier frequency [Hz] -const double Galileo_E1_CODE_CHIP_RATE_HZ = 1.023e6; //!< Galileo E1 code rate [chips/s] -const double Galileo_E1_CODE_PERIOD = 0.004; //!< Galileo E1 code period [s] -const int Galileo_E1_CODE_PERIOD_MS = 4; //!< Galileo E1 code period [ms] -const double Galileo_E1_SUB_CARRIER_A_RATE_HZ = 1.023e6; //!< Galileo E1 sub-carrier 'a' rate [Hz] -const double Galileo_E1_SUB_CARRIER_B_RATE_HZ = 6.138e6; //!< Galileo E1 sub-carrier 'b' rate [Hz] -const double Galileo_E1_B_CODE_LENGTH_CHIPS = 4092.0; //!< Galileo E1-B code length [chips] -const double Galileo_E1_B_SYMBOL_RATE_BPS = 250.0; //!< Galileo E1-B symbol rate [bits/second] -const int Galileo_E1_C_SECONDARY_CODE_LENGTH = 25; //!< Galileo E1-C secondary code length [chips] +const double Galileo_E1_FREQ_HZ = FREQ1; //!< Galileo E1 carrier frequency [Hz] +const double Galileo_E1_CODE_CHIP_RATE_HZ = 1.023e6; //!< Galileo E1 code rate [chips/s] +const double Galileo_E1_CODE_PERIOD = 0.004; //!< Galileo E1 code period [s] +const int Galileo_E1_CODE_PERIOD_MS = 4; //!< Galileo E1 code period [ms] +const double Galileo_E1_SUB_CARRIER_A_RATE_HZ = 1.023e6; //!< Galileo E1 sub-carrier 'a' rate [Hz] +const double Galileo_E1_SUB_CARRIER_B_RATE_HZ = 6.138e6; //!< Galileo E1 sub-carrier 'b' rate [Hz] +const double Galileo_E1_B_CODE_LENGTH_CHIPS = 4092.0; //!< Galileo E1-B code length [chips] +const double Galileo_E1_B_SYMBOL_RATE_BPS = 250.0; //!< Galileo E1-B symbol rate [bits/second] +const int Galileo_E1_C_SECONDARY_CODE_LENGTH = 25; //!< Galileo E1-C secondary code length [chips] const int Galileo_E1_NUMBER_OF_CODES = 50; -const double GALILEO_STARTOFFSET_ms = 68.802; //[ms] Initial sign. travel time (this cannot go here) +const double GALILEO_STARTOFFSET_ms = 68.802; //[ms] Initial sign. travel time (this cannot go here) // OBSERVABLE HISTORY DEEP FOR INTERPOLATION @@ -69,337 +69,340 @@ const int GALILEO_E1_HISTORY_DEEP = 100; // Galileo INAV Telemetry structure -#define GALILEO_INAV_PREAMBLE {0, 1, 0, 1, 1, 0, 0, 0, 0, 0} +#define GALILEO_INAV_PREAMBLE \ + { \ + 0, 1, 0, 1, 1, 0, 0, 0, 0, 0 \ + } const int GALILEO_INAV_PREAMBLE_LENGTH_BITS = 10; -const double GALILEO_INAV_PAGE_PART_WITH_PREABLE_SECONDS = 2.0 + GALILEO_INAV_PREAMBLE_LENGTH_BITS*Galileo_E1_CODE_PERIOD; +const double GALILEO_INAV_PAGE_PART_WITH_PREABLE_SECONDS = 2.0 + GALILEO_INAV_PREAMBLE_LENGTH_BITS * Galileo_E1_CODE_PERIOD; const int GALILEO_INAV_PREAMBLE_PERIOD_SYMBOLS = 250; -const int GALILEO_INAV_PAGE_PART_SYMBOLS = 250; //!< Each Galileo INAV pages are composed of two parts (even and odd) each of 250 symbols, including preamble. See Galileo ICD 4.3.2 -const int GALILEO_INAV_PAGE_SYMBOLS = 500; //!< The complete Galileo INAV page length -const int GALILEO_INAV_PAGE_PART_SECONDS = 1; // a page part last 1 sec -const int GALILEO_INAV_PAGE_SECONDS = 2; // a full page last 2 sec +const int GALILEO_INAV_PAGE_PART_SYMBOLS = 250; //!< Each Galileo INAV pages are composed of two parts (even and odd) each of 250 symbols, including preamble. See Galileo ICD 4.3.2 +const int GALILEO_INAV_PAGE_SYMBOLS = 500; //!< The complete Galileo INAV page length +const int GALILEO_INAV_PAGE_PART_SECONDS = 1; // a page part last 1 sec +const int GALILEO_INAV_PAGE_SECONDS = 2; // a full page last 2 sec const int GALILEO_INAV_INTERLEAVER_ROWS = 8; const int GALILEO_INAV_INTERLEAVER_COLS = 30; -const int GALILEO_TELEMETRY_RATE_BITS_SECOND = 250; //bps +const int GALILEO_TELEMETRY_RATE_BITS_SECOND = 250; //bps const int GALILEO_PAGE_TYPE_BITS = 6; const int GALILEO_DATA_JK_BITS = 128; const int GALILEO_DATA_FRAME_BITS = 196; const int GALILEO_DATA_FRAME_BYTES = 25; const double GALILEO_E1_CODE_PERIOD = 0.004; -const std::vector> type({{1,6}}); -const std::vector> PAGE_TYPE_bit({{1,6}});; +const std::vector> type({{1, 6}}); +const std::vector> PAGE_TYPE_bit({{1, 6}}); +; /*Page 1 - Word type 1: Ephemeris (1/4)*/ -const std::vector> IOD_nav_1_bit({{7,10}}); -const std::vector> T0E_1_bit({{17,14}}); +const std::vector> IOD_nav_1_bit({{7, 10}}); +const std::vector> T0E_1_bit({{17, 14}}); const double t0e_1_LSB = 60; -const std::vector> M0_1_bit({{31,32}}); +const std::vector> M0_1_bit({{31, 32}}); const double M0_1_LSB = PI_TWO_N31; -const std::vector> e_1_bit({{63,32}}); +const std::vector> e_1_bit({{63, 32}}); const double e_1_LSB = TWO_N33; -const std::vector> A_1_bit({{95,32}}); +const std::vector> A_1_bit({{95, 32}}); const double A_1_LSB_gal = TWO_N19; //last two bits are reserved /*Page 2 - Word type 2: Ephemeris (2/4)*/ -const std::vector> IOD_nav_2_bit({{7,10}}); -const std::vector> OMEGA_0_2_bit({{17,32}}); +const std::vector> IOD_nav_2_bit({{7, 10}}); +const std::vector> OMEGA_0_2_bit({{17, 32}}); const double OMEGA_0_2_LSB = PI_TWO_N31; -const std::vector> i_0_2_bit({{49,32}}); +const std::vector> i_0_2_bit({{49, 32}}); const double i_0_2_LSB = PI_TWO_N31; -const std::vector> omega_2_bit({{81,32}}); +const std::vector> omega_2_bit({{81, 32}}); const double omega_2_LSB = PI_TWO_N31; -const std::vector> iDot_2_bit({{113,14}}); +const std::vector> iDot_2_bit({{113, 14}}); const double iDot_2_LSB = PI_TWO_N43; //last two bits are reserved /*Word type 3: Ephemeris (3/4) and SISA*/ -const std::vector> IOD_nav_3_bit({{7,10}}); -const std::vector> OMEGA_dot_3_bit({{17,24}}); +const std::vector> IOD_nav_3_bit({{7, 10}}); +const std::vector> OMEGA_dot_3_bit({{17, 24}}); const double OMEGA_dot_3_LSB = PI_TWO_N43; -const std::vector> delta_n_3_bit({{41,16}}); +const std::vector> delta_n_3_bit({{41, 16}}); const double delta_n_3_LSB = PI_TWO_N43; -const std::vector> C_uc_3_bit({{57,16}}); +const std::vector> C_uc_3_bit({{57, 16}}); const double C_uc_3_LSB = TWO_N29; -const std::vector> C_us_3_bit({{73,16}}); +const std::vector> C_us_3_bit({{73, 16}}); const double C_us_3_LSB = TWO_N29; -const std::vector> C_rc_3_bit({{89,16}}); +const std::vector> C_rc_3_bit({{89, 16}}); const double C_rc_3_LSB = TWO_N5; -const std::vector> C_rs_3_bit({{105,16}}); +const std::vector> C_rs_3_bit({{105, 16}}); const double C_rs_3_LSB = TWO_N5; -const std::vector> SISA_3_bit({{121,8}}); +const std::vector> SISA_3_bit({{121, 8}}); /*Word type 4: Ephemeris (4/4) and Clock correction parameters*/ -const std::vector> IOD_nav_4_bit({{7,10}}); -const std::vector> SV_ID_PRN_4_bit({{17,6}}); -const std::vector> C_ic_4_bit({{23,16}}); +const std::vector> IOD_nav_4_bit({{7, 10}}); +const std::vector> SV_ID_PRN_4_bit({{17, 6}}); +const std::vector> C_ic_4_bit({{23, 16}}); const double C_ic_4_LSB = TWO_N29; -const std::vector> C_is_4_bit({{39,16}}); +const std::vector> C_is_4_bit({{39, 16}}); const double C_is_4_LSB = TWO_N29; -const std::vector> t0c_4_bit({{55,14}}); // +const std::vector> t0c_4_bit({{55, 14}}); // const double t0c_4_LSB = 60; -const std::vector> af0_4_bit({{69,31}}); // +const std::vector> af0_4_bit({{69, 31}}); // const double af0_4_LSB = TWO_N34; -const std::vector> af1_4_bit({{100,21}}); // +const std::vector> af1_4_bit({{100, 21}}); // const double af1_4_LSB = TWO_N46; -const std::vector> af2_4_bit({{121,6}}); +const std::vector> af2_4_bit({{121, 6}}); const double af2_4_LSB = TWO_N59; -const std::vector> spare_4_bit({{127,2}}); +const std::vector> spare_4_bit({{127, 2}}); //last two bits are reserved /*Word type 5: Ionospheric correction, BGD, signal health and data validity status and GST*/ /*Ionospheric correction*/ /*Az*/ -const std::vector> ai0_5_bit({{7,11}}); // +const std::vector> ai0_5_bit({{7, 11}}); // const double ai0_5_LSB = TWO_N2; -const std::vector> ai1_5_bit({{18,11}}); // +const std::vector> ai1_5_bit({{18, 11}}); // const double ai1_5_LSB = TWO_N8; -const std::vector> ai2_5_bit({{29,14}}); // +const std::vector> ai2_5_bit({{29, 14}}); // const double ai2_5_LSB = TWO_N15; /*Ionospheric disturbance flag*/ -const std::vector> Region1_5_bit({{43,1}}); // -const std::vector> Region2_5_bit({{44,1}}); // -const std::vector> Region3_5_bit({{45,1}}); // -const std::vector> Region4_5_bit({{46,1}}); // -const std::vector> Region5_5_bit({{47,1}}); // -const std::vector> BGD_E1E5a_5_bit({{48,10}}); // +const std::vector> Region1_5_bit({{43, 1}}); // +const std::vector> Region2_5_bit({{44, 1}}); // +const std::vector> Region3_5_bit({{45, 1}}); // +const std::vector> Region4_5_bit({{46, 1}}); // +const std::vector> Region5_5_bit({{47, 1}}); // +const std::vector> BGD_E1E5a_5_bit({{48, 10}}); // const double BGD_E1E5a_5_LSB = TWO_N32; -const std::vector> BGD_E1E5b_5_bit({{58,10}}); // +const std::vector> BGD_E1E5b_5_bit({{58, 10}}); // const double BGD_E1E5b_5_LSB = TWO_N32; -const std::vector> E5b_HS_5_bit({{68,2}}); // -const std::vector> E1B_HS_5_bit({{70,2}}); // -const std::vector> E5b_DVS_5_bit({{72,1}}); // -const std::vector> E1B_DVS_5_bit({{73,1}}); // +const std::vector> E5b_HS_5_bit({{68, 2}}); // +const std::vector> E1B_HS_5_bit({{70, 2}}); // +const std::vector> E5b_DVS_5_bit({{72, 1}}); // +const std::vector> E1B_DVS_5_bit({{73, 1}}); // /*GST*/ -const std::vector> WN_5_bit({{74,12}}); -const std::vector> TOW_5_bit({{86,20}}); -const std::vector> spare_5_bit({{106,23}}); +const std::vector> WN_5_bit({{74, 12}}); +const std::vector> TOW_5_bit({{86, 20}}); +const std::vector> spare_5_bit({{106, 23}}); /* Page 6 */ -const std::vector> A0_6_bit({{7,32}}); +const std::vector> A0_6_bit({{7, 32}}); const double A0_6_LSB = TWO_N30; -const std::vector> A1_6_bit({{39,24}}); +const std::vector> A1_6_bit({{39, 24}}); const double A1_6_LSB = TWO_N50; -const std::vector> Delta_tLS_6_bit({{63,8}}); -const std::vector> t0t_6_bit({{71,8}}); +const std::vector> Delta_tLS_6_bit({{63, 8}}); +const std::vector> t0t_6_bit({{71, 8}}); const double t0t_6_LSB = 3600; -const std::vector> WNot_6_bit({{79,8}}); -const std::vector> WN_LSF_6_bit({{87,8}}); -const std::vector> DN_6_bit({{95,3}}); -const std::vector> Delta_tLSF_6_bit({{98,8}}); -const std::vector> TOW_6_bit({{106,20}}); +const std::vector> WNot_6_bit({{79, 8}}); +const std::vector> WN_LSF_6_bit({{87, 8}}); +const std::vector> DN_6_bit({{95, 3}}); +const std::vector> Delta_tLSF_6_bit({{98, 8}}); +const std::vector> TOW_6_bit({{106, 20}}); /* Page 7 */ -const std::vector> IOD_a_7_bit({{7,4}}); -const std::vector> WN_a_7_bit({{11,2}}); -const std::vector> t0a_7_bit({{13,10}}); +const std::vector> IOD_a_7_bit({{7, 4}}); +const std::vector> WN_a_7_bit({{11, 2}}); +const std::vector> t0a_7_bit({{13, 10}}); const double t0a_7_LSB = 600; -const std::vector> SVID1_7_bit({{23,6}}); -const std::vector> DELTA_A_7_bit({{29,13}}); +const std::vector> SVID1_7_bit({{23, 6}}); +const std::vector> DELTA_A_7_bit({{29, 13}}); const double DELTA_A_7_LSB = TWO_N9; -const std::vector> e_7_bit({{42,11}}); +const std::vector> e_7_bit({{42, 11}}); const double e_7_LSB = TWO_N16; -const std::vector> omega_7_bit({{53,16}}); +const std::vector> omega_7_bit({{53, 16}}); const double omega_7_LSB = TWO_N15; -const std::vector> delta_i_7_bit({{69,11}}); +const std::vector> delta_i_7_bit({{69, 11}}); const double delta_i_7_LSB = TWO_N14; -const std::vector> Omega0_7_bit({{80,16}}); +const std::vector> Omega0_7_bit({{80, 16}}); const double Omega0_7_LSB = TWO_N15; -const std::vector> Omega_dot_7_bit({{96,11}}); +const std::vector> Omega_dot_7_bit({{96, 11}}); const double Omega_dot_7_LSB = TWO_N33; -const std::vector> M0_7_bit({{107,16}}); +const std::vector> M0_7_bit({{107, 16}}); const double M0_7_LSB = TWO_N15; /* Page 8 */ -const std::vector> IOD_a_8_bit({{7,4}}); -const std::vector> af0_8_bit({{11,16}}); +const std::vector> IOD_a_8_bit({{7, 4}}); +const std::vector> af0_8_bit({{11, 16}}); const double af0_8_LSB = TWO_N19; -const std::vector> af1_8_bit({{27,13}}); +const std::vector> af1_8_bit({{27, 13}}); const double af1_8_LSB = TWO_N38; -const std::vector> E5b_HS_8_bit({{40,2}}); -const std::vector> E1B_HS_8_bit({{42,2}}); -const std::vector> SVID2_8_bit({{44,6}}); -const std::vector> DELTA_A_8_bit({{50,13}}); +const std::vector> E5b_HS_8_bit({{40, 2}}); +const std::vector> E1B_HS_8_bit({{42, 2}}); +const std::vector> SVID2_8_bit({{44, 6}}); +const std::vector> DELTA_A_8_bit({{50, 13}}); const double DELTA_A_8_LSB = TWO_N9; -const std::vector> e_8_bit({{63,11}}); +const std::vector> e_8_bit({{63, 11}}); const double e_8_LSB = TWO_N16; -const std::vector> omega_8_bit({{74,16}}); +const std::vector> omega_8_bit({{74, 16}}); const double omega_8_LSB = TWO_N15; -const std::vector> delta_i_8_bit({{90,11}}); +const std::vector> delta_i_8_bit({{90, 11}}); const double delta_i_8_LSB = TWO_N14; -const std::vector> Omega0_8_bit({{101,16}}); +const std::vector> Omega0_8_bit({{101, 16}}); const double Omega0_8_LSB = TWO_N15; -const std::vector> Omega_dot_8_bit({{117,11}}); +const std::vector> Omega_dot_8_bit({{117, 11}}); const double Omega_dot_8_LSB = TWO_N33; /* Page 9 */ -const std::vector> IOD_a_9_bit({{7,4}}); -const std::vector> WN_a_9_bit({{11,2}}); -const std::vector> t0a_9_bit({{13,10}}); +const std::vector> IOD_a_9_bit({{7, 4}}); +const std::vector> WN_a_9_bit({{11, 2}}); +const std::vector> t0a_9_bit({{13, 10}}); const double t0a_9_LSB = 600; -const std::vector> M0_9_bit({{23,16}}); +const std::vector> M0_9_bit({{23, 16}}); const double M0_9_LSB = TWO_N15; -const std::vector> af0_9_bit({{39,16}}); +const std::vector> af0_9_bit({{39, 16}}); const double af0_9_LSB = TWO_N19; -const std::vector> af1_9_bit({{55,13}}); +const std::vector> af1_9_bit({{55, 13}}); const double af1_9_LSB = TWO_N38; -const std::vector> E5b_HS_9_bit({{68,2}}); -const std::vector> E1B_HS_9_bit({{70,2}}); -const std::vector> SVID3_9_bit({{72,6}}); -const std::vector> DELTA_A_9_bit({{78,13}}); +const std::vector> E5b_HS_9_bit({{68, 2}}); +const std::vector> E1B_HS_9_bit({{70, 2}}); +const std::vector> SVID3_9_bit({{72, 6}}); +const std::vector> DELTA_A_9_bit({{78, 13}}); const double DELTA_A_9_LSB = TWO_N9; -const std::vector> e_9_bit({{91,11}}); +const std::vector> e_9_bit({{91, 11}}); const double e_9_LSB = TWO_N16; -const std::vector> omega_9_bit({{102,16}}); +const std::vector> omega_9_bit({{102, 16}}); const double omega_9_LSB = TWO_N15; -const std::vector> delta_i_9_bit({{118,11}}); +const std::vector> delta_i_9_bit({{118, 11}}); const double delta_i_9_LSB = TWO_N14; /* Page 10 */ -const std::vector> IOD_a_10_bit({{7,4}}); -const std::vector> Omega0_10_bit({{11,16}}); +const std::vector> IOD_a_10_bit({{7, 4}}); +const std::vector> Omega0_10_bit({{11, 16}}); const double Omega0_10_LSB = TWO_N15; -const std::vector> Omega_dot_10_bit({{27,11}}); +const std::vector> Omega_dot_10_bit({{27, 11}}); const double Omega_dot_10_LSB = TWO_N33; -const std::vector> M0_10_bit({{38,16}}); +const std::vector> M0_10_bit({{38, 16}}); const double M0_10_LSB = TWO_N15; -const std::vector> af0_10_bit({{54,16}}); +const std::vector> af0_10_bit({{54, 16}}); const double af0_10_LSB = TWO_N19; -const std::vector> af1_10_bit({{70,13}}); +const std::vector> af1_10_bit({{70, 13}}); const double af1_10_LSB = TWO_N38; -const std::vector> E5b_HS_10_bit({{83,2}}); -const std::vector> E1B_HS_10_bit({{85,2}}); -const std::vector> A_0G_10_bit({{87,16}}); +const std::vector> E5b_HS_10_bit({{83, 2}}); +const std::vector> E1B_HS_10_bit({{85, 2}}); +const std::vector> A_0G_10_bit({{87, 16}}); const double A_0G_10_LSB = TWO_N35; -const std::vector> A_1G_10_bit({{103,12}}); +const std::vector> A_1G_10_bit({{103, 12}}); const double A_1G_10_LSB = TWO_N51; -const std::vector> t_0G_10_bit({{115,8}}); +const std::vector> t_0G_10_bit({{115, 8}}); const double t_0G_10_LSB = 3600; -const std::vector> WN_0G_10_bit({{123,6}}); +const std::vector> WN_0G_10_bit({{123, 6}}); /* Page 0 */ -const std::vector> Time_0_bit({{7,2}}); -const std::vector> WN_0_bit({{97,12}}); -const std::vector> TOW_0_bit({{109,20}}); +const std::vector> Time_0_bit({{7, 2}}); +const std::vector> WN_0_bit({{97, 12}}); +const std::vector> TOW_0_bit({{109, 20}}); // Galileo E1 primary codes const std::string Galileo_E1_B_PRIMARY_CODE[Galileo_E1_NUMBER_OF_CODES] = { - "F5D710130573541B9DBD4FD9E9B20A0D59D144C54BC7935539D2E75810FB51E494093A0A19DD79C70C5A98E5657AA578097777E86BCC4651CC72F2F974DC766E07AEA3D0B557EF42FF57E6A58E805358CE9257669133B18F80FDBDFB38C5524C7FB1DE079842482990DF58F72321D9201F8979EAB159B2679C9E95AA6D53456C0DF75C2B4316D1E2309216882854253A1FA60CA2C94ECE013E2A8C943341E7D9E5A8464B3AD407E0AE465C3E3DD1BE60A8C3D50F831536401E776BE02A6042FC4A27AF653F0CFC4D4D013F115310788D68CAEAD3ECCCC5330587EB3C22A1459FC8E6FCCE9CDE849A5205E70C6D66D125814D698DD0EEBFEAE52CC65C5C84EEDF207379000E169D318426516AC5D1C31F2E18A65E07AE6E33FDD724B13098B3A444688389EFBBB5EEAB588742BB083B679D42FB26FF77919EAB21DE0389D9997498F967AE05AF0F4C7E177416E18C4D5E6987ED3590690AD127D872F14A8F4903A12329732A9768F82F295BEE391879293E3A97D51435A7F03ED7FBE275F102A83202DC3DE94AF4C712E9D006D182693E9632933E6EB773880CF147B922E74539E4582F79E39723B4C80E42EDCE4C08A8D02221BAE6D17734817D5B531C0D3C1AE723911F3FFF6AAC02E97FEA69E376AF4761E6451CA61FDB2F9187642EFCD63A09AAB680770C1593EEDD4FF4293BFFD6DD2C3367E85B14A654C834B6699421A", // 01 - "96B856A629F581D1344FEF597835FE60434625D077ECF0D95FBE1155EA0431979E5AFF544AF591A332FDAEF98AB1EDD847A73F3AF15AAEE7E9A05C9D82C59EC325EF4CF264B8ADF2A8E8BA459354CB4B415CC50BF239ADBC31B3A9C87B0843CF3B9E6D646BA43F866276B053826F3A2334CC5E2EFB9F8F195B382E75EEA63F58A06B3F82A3B5C77C1800FD9498F803E524435B321210BB84690BED0BBBE16D363B3A90656A73720E27008852FB7DACC8284411B177728D9527C560859084A395A6F11A96AD9DB6B43E00642B000ED12BFD967868EAB1108552CD4FC89FBC408ACE7678C381EC91DD000319124EB5D5EF52C4CAC9AADEE2FA045C16CE492D7F43743CA77924C78696FCBF2F9F7F36D8E623752200C6FCBBD71ABBB6877F3C5D6E6740AB0389458A6B66440858B2D383244E853646FE2714211DEA9E6196252815BB704A20BFE556AC474F8998944E0CABBBE21A6400B87BFDCF937D12B2821D59298AF4AD378F0F42BD8C41693B8D993CF37C8B478F3BB5D33AD2A9FA24AD7B8FA895FDBC04964192F7BA3FF74E0E3A435B5DFE042E3115CACF29624C0645E9C917534A2EBC1F5665E4E1B1BC56208DBCD8A27CCB6474D5D0E20CA4072C960E5ACE41BDA3770DF3B681F2B318F6F8E1CB17C2857350FB6009AED665E13B2780D79217F73FAC7A8A48048DB0FB8A8A5007CDDC9A7B2DA8257C99F1CB605A18204", - "E57DE19A3E4A8C122FCB1DD6584B3D2DAE364D800F9C5A9E957B38F624CBD3ACC58FA3ED070B5E44857CCB813FBC0BB83B5D157C6C562422E5963CC4DD753C45B0264F8E136A0F1774D77A543E44D51EF8C6B9408B6E3B5CEE1347A94F13ECDC94DC764976E5A50B4CB0AE7557553B47EDFE03EC2CD32EA8D125A341E1EDFC77E75330D6E7B23DC838EBCE7E5567F5B8C80C3D15E7404B4E10F0BEB0C69626A814AF91334199864FC77E0FF548DC2A6FA6A71C3C0561F2B085CC05E8512E27B9DBA60B93D114B87935776C8E9A67905C429D48BF3AB1B0A56FAFBFD5D9C8D8C8A9E5918BFF273CF5E8664FF2B90314BDBFDAD5AB8C22A0E45C104ECE75EA43FE9BDCE306A5A28AE464628163D249D8056005F1A900951808CC8620F81768153436F741667A8E271DD986C7A1E5046FCC74C7CEBBF9A1296D6CF0B2FF85BE412D87214BB368DFF462AD649D7324A117252311C664D33E4DAFBD830FBCEB6EFBDD7391D4BADA7A775FD1949D981F619655DB3C22BAC34E5AE41222905C0C7E80D6EA28471EC0468756531C09A471EDBE200472E78F1701FEE96E5769A9893C0F11E7906B064442E06E21ED8B0D70AF288690C532A2D03B373E1E0085F62F7AAA658B569C5184E3DDC40ECAA88B887118601691892F9F55E2DE79E49DFF11D434C2BA3AA6447522A7C99DC215CAD2ED0114ED62CBDAE9D315E48AE14D2014B7F8E", - "C0FC4C72A12023BA7093C86775DF3D2F42C7CEDE616876340BE4301361B9DC9DFF4F1DEC6A62E165927BDE4F809E969AAD085437496BB95904719820F4CA8ABBA0B84C34B06DD7E268BA10E386FA7DB9FCFCDAF2B6AFBA46A8A299153B4E11582FBA7F28F0A0F9DE41830AB33335062C57D81DC361EDFE491939100FC827F36273760043D1C35B74E36C6C4DBE1D307847D55AC07D8B212C2DBA632A86AB15BD0FAFFA43070644C7E50623195A3796AA8E8D6E4E964FA0E4488A500B9063FBBFB1204A0E33C6CF2879AC2BA7C86CAB57E3E8A497836194E65C5C39B950F1AFC3B58E850A5EC39F4190D55351D16529CD52B36DF4A2DC68EE202BB758CF19C54B0E1461D547B5D06C2F9DC09C2B15458C3140860E4C6F3FE4F417FDFCEDE00F71212EE137E6669E569A7845470CA564F85CB4772808D65D2B48D409B709BD7AC5F7E28AA804CE9DAC3ABB5A5B768C6A184B5A974E933F2C1772FF64AB26BA2D5A165744E314EFB2238AC4858A8B82723DAE8865478EAA261F35DD4D98A9C07ACB0B822AFF1AD3E739CB214CE737196FEF2DD0B0D45BAC423935670BCF71C2EC04CCB98943786173C309E75A02BB78A788A5E6F8A8F407E57B8403841A9E1FCB3A7AB80D1F6529770E52C173E2C47EDED4400D5E665E325ED845C9E8D0E66FDA16B17D61EDBB336F22688C3F0FB040A55F33B65FA9F3D45F5B22C445CBF9DEB22", - "EA9596357B343DFC31D5875CC0E94117A33651472E476D3892D8112EB6CB6E0151D409C5A514DCDA38A773C58F18B590EF9017B6EDF0192AB7EB29DD6E1E7E7390C13E9B10209D5775F3B066F7B2DBB7307FB44F726DD2F368A5FDBE75BA7248762E1EC7E4589DF1A353A16D6B3CAC1C9ACDB89890ED2C4F44AFEFC763DB51D102230C37E1ED0943CD6F4176B2F5C19119588911ACF81A7A29320AD579C1BFAED1A70DEE1B87037138ADE411E0BB92F5B3148DFA11F2F84CA6C019124B922837503AA9823A97E443A66378D5CB3130A7EC9B05670E85D095D5E6F603092C632E51FD9013FE7FB9F08448FD09F1219A4744CDAF82BF9C60039C8185C7E9559FCE301C6D3F46A2E514AAD44D3889C8CB4ED7439BF47019194F2644363770F8BBD0AE92B6F5F43CBBB503A885239DA636903D4C264B3FF09AB77E3FDBA7EFC63E0792B6D5183759E57D8A694CDB133B4A9E301CEEEB978050AD9A9E410091AD29E389829E2F24BE1E3B24F4540C4A6533EBA72E8AD540BAAE43A0CB82F971F3A51DD77FE9E1956E2EE7553E050A1D10B99552DDD5B68F2E2859712835BD2AD6B08881753B4833FB04740E3364D2CD4921B939393E7EA91B854FA1E5A8EE79FF0A83F111F78435481D462E0E1CBC0C921D190A435A1BA755E4B7021244FC5E3F0630F2A1F439C02AE619393E5624834B05ED7DEDE5F0AFC7A40899424E75D4EE792", // 05 - "90E92279CD4F60D98F6E8FCB3E9263DB60FAB146A835AAC2E96B3BE3FF07119032DEE0521C731117E90C2943B389DD6B65C5E21C34F86F5A7ADE04072DFD1479EA36528D340736B0FED4F6207BE9F6CFC971D5EA11781AC2DA25DBEEB6B903EF8BB0AC0CD2E29F94B8CB67874A7B7441045758E09EA061181A50E0AB7BCCF801554E0644780BC137436E3FB7784C182856A790D6943BB53DB40D13D6A2F7B83A5C521073883B90FB8DB1C0F954D132943C09156A09984B822079FB8FD09BC07C1D6336C7CEAE8CC3162760B9838CA6A38FD0044FDF099E416D57BF9F33A551043F34EBF9BAA90901E62D2D981065F977852072F692535DDE24EE8946387B4E5B0FEFEBD75552C1FC325A608A78079A9AC864F2F30010A3304CB16A26AF98D9BFD3B8D128541190B2BBEE275A6F53B9BC5108306985ECBB983B56E34F18B48A12AEAB88271F4F780CFDFA83E05E35C12464F4350597CCAE9B4498F5A5454DCC3218D3336763674934ADCBCB5EA52891EB240C362248226DE64899BE30735F6495E94AA61ABEF62B803C57FDD045B724ED1966B6E7DFDFCA5B36F7B0FACEDAC62DE8E10B12DFC84B1A9CEB407BDE63CDB5208ABBE5E066AAF262187E94502B1701B2CC8681CB616773DA2B7AF49443CFF528F45DD7F25959836771908C2519171CAED2BCDCFCEA46301E7D99A5AF7199155772E92BAD85F35EDB656F0999EE828", - "A91F570102961D62CA6CB55144AFCCEAF3910F3336DCB029CDCBA164ADA72732771B6ECD1C58E49F468A2BFD23E1B996DABABBAF5AB3A4C74926187B5833006F8BEF7F9CD0F05A2A0B9BD9073C4C3976E8660CE7BF81634CF0B31C3DDD806A6A0C15BC552B83A86789CC675A6D137BE27BC86DF68FEC5D268119EB9E965260FE1F5C56AEF60A8622CDA8C42F24CBA7F5B07A7416917277323314AFD3ECD10F74BEE7B22DC760EFA7F935FC9963411353782547FAEED32E69A4FB5756C1A73CCDFFEDE50F4B2D9B5D2ED5C59C9A52D80CD27B989B8DAA14C569E763C08FD42358CD064B2DE0526607C9536D75E1617EC80615EF5EE2314FAC29907B61B61F8696CB80B14B3A0148EEBC825C91150A08A23FC7B38B5982AA02A18BF6E91B3A1F2EEF360F682A34AB36CAFCAD556841073F219910F7BC2F07CE45E98F77F50475DF9EDFE2DC9E3D7280193D61AB5076A14887E9D9193C3B83C5773BDECA067CA1BC3D4561C3A8B4E30072A6269B529760CA1B5FE9D3DB2B5D1202CE8B18E9E2E80FAFF47108168D3C7EB3C940B1A35A1D1B968A5A9DC0686DD8336E498C240F20871600FF995B9E33169DCFCFCB58E75C94D82F843C60A7118F0D7B40064A8A4176C5158E86AF0BE4C1D5D73D1C051132A85CC0628486AFD660502A515D6353B674B1D4E61750C13E8A3AD48FE1F89F201C288A8F443867C2BAC23C706EE7A2D2C", - "C6E00978E351164532EEA256ECBE0D4F8FCE02A276BD19666DE93936F7A242FC4C7E879791314B043ABF1D5F9B0036ED22AA92028C800C4D62BD6640431170EA77311865074D670AF2847AA47CB94584A793FA82F51574BD7C62BF14386F14A3D7DBD129FDE64EAD67EB35D5E13FF214D7D163B770D4A77A62D02D88C0FCF3FA5EC306EB7F85539105FA2CE5F53D182E58FBBC1C57CFBCD2D2F7FC8A067D6FA0BC834DAB8F370B0971BF6D068CD4D3A32C11C6598DEBBAEA046528C5EF762828CC84D003847069FA18743A809A004431E83924B8FDF0AC78699B905ACCFF82E83FDAFEC8648DF64042FC9438B261B73F0541498ACAD67D702AB631BECEF8680D33CE8F4F0CE29B95132591A350DD68B36734B97D4B3E84A76497F702312F2A8370DCF26A7C3C8EB91DD8699C48F551750712683E0397083714A6CAC3457C0FA70BB3A036C6E0BEF24E6B20BA5565B351C2EFD56BD9455FF7728BE07A097208E73DE4CD0CB4E215B4642365123CDEA419B28459D50E864B762554E7C1D7CAF73DA7D40EDEF5D824A2FE1A6CA473B07370932A8A5D441DEE3C9A60DB68E27A9D3E9C8229B44E5B434C6D18A8CADB6D17BC4614DEBEAD670C73132CE2F999C8716D1098C69277E8ECAC546EF8002E5182E25F31A354DF112E97F8733DD20893B430CD7130E69ED4A0FE4D6C2E4FA479001E42EBC9F36E5DFD3E0BE35A64B89745E", - "821BBB3FB91E50253A9E71AC379ED57AEF394C2CC59587B2D0337CE74002EEAD17AB5D504BCA68BDAE9061C3DBAE2985EBE292B9BEC9D3542015225F44ED3C2C3FFB036A515BF33DA1690F3438FD225A5034106C5F4BCC43301EEC2245D73F63038E2A7D9B8CF95A9FD813FFA071FFDE423E0CE737969578BEB909764A8D6DAA9E15A4FA0867831652C0F6E9AAA39A63F0AEEF62A433476CC7380460ECFB8B7F3B2FE8C4C42A3EF1CDB808FC9747FB4F044B3B47A4EDFCC9463ABB72C55399B2F79EE5FEDA270D6358B27F8466969DE4A5F2E6A5F2C4CF0813C09F468DC97FC0E5DD057A8A0355767B698F8A79BF0350C4200413A15E6591DE70A1B502E19FF515C3DF36935974A4764895B9E3CA2626BD39B7ADB780AAF7E2E914E804CA923089A51F3876649C73CA3C2623A8C95D11EF4B3F941E9772EBA1F47212C666F03F01509FF699F74EDE27182B6E98AF49D1BAACB41A328A8C34D6E8AA3553DA3962B27B041495F269328B6BFB4A385CBB118953F3F009920EC4C8590003290DD60AC89177BB8C4BF753CE723AECA392B8D9E5E9E4113DD062F294A77B6EA9A0477E697C04C787CE78A92C704409D37D37B6B392128698D0D8D4CA101EB38B92F467F0D86EFD8759A14162CAB55F8C457E82392790A5BDDC8DD2663944F880C95EC02FE5363B064623994EE5D4396C0E44DE2A3D225830BA6160270BCD110A942B0", - "92A0DEABA9875D4AFAF99A24C1D5F10EBBE6DEF9CAE5B0C85B2A0417C1CC5D1A5F71CD8F8A4B013C3F012C0A19EE4A23106CAB8662C5A2A93A971D0B6E487FC05BAF5C355A9520C9148584CFED3EDD0F38696E161E64378C831C586D9178A0CE289A67F33AE68C02A3CD138FA09DF1CAD01EFADFC8BF6F5407B79B18D09C82804736752D08A1FE09EB35F544E9F797EA36DB493BA947AA82513EB1615A356B5AA4308B0B4183E070EB494D628159D2D4BC3CB110AB0CCB2E9E73B5B7EB567187621E72D99F1FB78565917B28464A5F29DD8D6F98B6ED703040A44B0ACD97F15049E009E8533FDB0B6DB2F2582E6BBF81D7B0EADC8F402508F6B8531AD13FD1C55978A8A70DF4E053DD475132D348AE27581370EC14A3E0F96E0D70DA4946DEEC0760011404FDC5B436CA7419D05895F5E0EAEEBC88C74947733BE9919F18CE702887A6C4DF7C19279B82FB646090822DA9CD9C7653F6B931A337A28F7A4A01DE0CC0744F22961045F8EF8D4B30B07E5EDF5FA944EDCFB9841A9088AE82444FCB6E90B0E9C567A80E8C42EC713D78132F37AD1D2592C31C93D2EAEFF38AD94E5C0D94F949F47B88B03BC1EA4E5EC9C7D9DF19ED208B8E44FFDEB0B625F633C7DB1C826AA9E1C1309E5B14A0DDDB79714DFDCB52221CEAD7E8A140DF7806F127156478AFBEE922B8ECF322D66B48BEC434299BBB36B3BD9030467B7F2EBBDF358", // 10 - "AFA7FBAC93326D0C36A388831B99DF4D527BCE7C9070F7B46B5FFCDEB07384801AE5F86A89934DE23DFE2C1AD117797D4FA1BBA6175823B41166DBE9D126F17B3761E2C352AB396A5A9CCEA42A5E9EA1BE3497C0A5BA9121DB97F64159AAC78E62D7DEFF3BF4CF73F8CFBE045C9D39E41D5D208DCC4B47CA27E900C3CD8FD1408DC5E0F5114F2FE65817D37CD1452C4967ACAA2119FB8D60E5E2FD8A820D0AADD88B94D40435C095568AE6394D3B97C835BA868A83083316C49C75D36EFDD85165BE74A4F2B2D21295EBCE085D9C4A4758FDD9CF71B97FDF34B7B63A5E9691DBDAB834D87D5B52CA9A53032FFE821398616EA92625C2DB633E37911987083A3B49A86FC562FB1264A75643A5FB6E97162E16ACCE353227FE61A859E094C2359BC4645946AD12AE5C39C70F59EA7B597A9B3372C23AA578146781A61163C92816627DD9C4BF1788087821F9F5D41B75A0F251B06BBD3E29ABD41E72A1D48323D24E2AD6F11C2D49678CC04FCF6B0EFD33BE6DDCD444F5CA02FE158112631F782CA7B0C5F3607ED807495BF8E82C5EA51A922FE28C8168D9844859E7A3EE3038C5D1D4BB4B13406C340894DF46406836739E31D01082BC84489592DA0E985630CEC40702A36DDC301B3AE1E8101786FEDBF752F9E175287C239C18FC25795BCB479DEF59C58C373313C02A1BC5F16355E2B50EFB58855670868728B902653ED80", - "943CAEB680AA3E630755DF32F406F403D7AF5E48A710274D3887A7AAC8EA6744B889F2E0CD2033DEC0B434A9591254A0AA68C5C9BF11D35765E86B437497D84E5DCBBC0C0C580CE9BC50EC6382AD74DB02C2C233B7BB07517D48056226C505ABF2DD244F6BBAA23313D570558B065E42327768078EFDB53DC465DA038E3B216D990EE951B3E13D3C1CD559998F77BCDCD2B9522B6F1DC5E12C912EAEF574AFD69C251F9B2532501AB9F4B3B2223D0F8920BD562B0D358A14AB0D196DF6337D1C96CDB47AFEC6F81DED4B5773864DA32FCCD06B9AC53C122B2C6327E6E5EFE227DE4893FF15BBB2257FAEA836E99676EE32BF6FC14D4F56EA191B8A3870374A0867C49EB0015D1C6D07B87A36BFDD1DCEF20EA7B80D997CBE2D83EB5630F2EE6F73B0D50700C89E4F32438F5541360683DF11DA6E7A3C1E7DB2A87800D9245BF04278C990A8DC9CD86DEF39CBC6D4BC00FF13BBE132F9D86681A8913BE787CFC69C35304824788716D52DC74CEA399E06DE6241780447C74DA8E947134D8B2FAA9648D6D5F34C9D60AE5973B5BB0187796D589C8FDDD7675671F28C04AC1038D09251980683CB712F694D7C5B0D5B1DE86CD10EAC4EA04A55BA8803D78249BEF516D38067890105A23212E72879FA267A8B4F0455A81F17CFD3E5DDC55E5D4FE00F83E18626C676DAF00E6AAFCC23D209DEE0B0FC6C2AE4DE161D13017ADB5D8", - "E5E70E7837D094416558C044D758383EDF5755C80921218ABE76E51FB93249E211A38FE6D07A7DFD2263E6E3D8DA0F921A06A606B804DE7AC3FD097E5F96EFCC0F544D623FD6F43FB88CEA7C341E901CD47A7E24AB141E998FE41CA87CD6CE8C1870D9ABB6503BF7E8B659084BAF2237DFC94F35C9884C7F44B87120BFCB298696E613C1656AC4899781A94869EC603B4D38665337CA8593AAC83AD8BECE10302E4B4694237E96CCD3AD9CD5F8EC039A1D1A4210716371404C5C3FF375CB3A33559B1C1A239F2E442C8EB033501BB290434BE73489F716965393989422CF4D57E5B4F3C76AF3C5E8999E61805134B9D7C40BFB59D0D0FD30F98567E66D6148D6AA64F74A22C50AE49D6B1ECC6BB5A002ABF38FF2E2436766B86BDDE7D95DD6E02AB0FF06E7BC22CEC98D55AA2BC4D7B91C36B2FF9F525A74423498D548318509320FCCBCA582A6C2996AF6538422FF0DF060C0BC7356B0850A139AC3914338127B786F4BC58CEB6064DA881376A147DFF53C6700BD13316A5874A75D7B9713DF54FBB393BAFAAD7F7B0710C049A0B6A8B76A9956BF6185BA39D9C347D179FBB97D4FED68F47DB5AC8E0D40122EA51C4A1F88D23153DF651A180C2AD456ABD7F851B65B220A72BA48FAD0436332E4EE7EDC554B7D75481EE05C3D3453D760E9099DD27B324DD84C0C0C4DEC4C674D25284B16410F959FBD09D9DF09CE875601E", - "BFDBC82ACB4FBCD5A90C5967EB2FED597A02607F426002128AF4B38942C85AF4472B3CBF3B183F240E049B251713740A31117F108936631FD0F11C5F79325BD6677A2C2B242965AEFC147D93358730AA782491209CBE600976F56030753CC979C240A196647CD9EAB1DD0380E59BC7905EF740C3411AD9DD72027D0D3DD6DEB0F5F3C18F6D6F7BC59B758E7E262937B4599B38567C147ED2689BA2CF23736CAF55B6925827E2B70E47D3813C94C85298BD6B49C97B5D0221BE9E3164B6FA3D95AECF53AF170966090F19A69E75F188BD2556B4E8FA7DC4AC6C34F54297C06C2A96DD1C45B42E6175B5E8784568F7FEF0B6C124C5019CB577B374941E8515CCFC21F46D188BDD2C2284C688879A5BEC50CCB97FAEE1F75580577498D509D3DE161BE216C873B29E178CE17DCACC5E9E2224D05ECC842FBEAB82A75AAA20769FD81131CFB69D5E35409273CA106FFB27F63FF997CB500F161F6DD3A8BFA5719F004EC17860152D3290951678A131E4F3D3AB34CFFCAB2967ED9D8F1BB987950306BD28751D2AEAB05F071B08574EFCA01E5386E04F727BF413A8279E9392EFB64D9AEE00877C76C81EBC861E2B484A2D35E592A131726CAE61BC010B954721A82C968CC6F384D9BBB99B4E87846D10B94EE31F64846A5834DF73A67A267B894B1C06242D750F15F3E1E850A11CB2E2B16155008F91493AB3BC77CF9BE56F9DB20", - "D64F3D1CB54CDB9143D9E701BD313779C09DA064D9A85674CCB53B0C5B4446C122098961D5EFFD6A85537486D5EB26B5E18FFBFB8E6EF16C2DD2C02EC7C07DB15CE33015A636E225F744C963BF0653A89A48F1AF04819E273A3AE1F5538AD574D553C5A0DEF47B552957037BCA921970C76DDEF74BA083ED55363760A6780612C075964B083B4F674EA0012FD1DF09F0445CE75A698852098206868AD8241E3B319FA8D2D86DE6E7631DF1AEB571F9676323E0627307F6D8F569536A758DE5EDAAEDF80F4335E3AFCAD07F70AAD5CD08CCA1E71B84D4D97931F924AC0010C0811972ACAA414B89FFF7917E653BB31E9CDFC72595066C662CDB9BBC96152D46BF4E8C15A8D34809C4B9D79871BDF0B63FA294F2D667624F6E0210CD40C92F1C033C3D8BF089EF85C4F571CA727C71B23128A9B0FFD70CEA93C316FC4D69D79B089107F292E03425B2552AF5AA18FDB9AF86EA1972B66B1276B09119437E4DFB8F8E3972D91A93816EBD7D8D715CB47EFA742938B0B49FA27A291B0DEA1DF0B8F878332103F45A99936896181E51FF65C6995F57C2C54B8002DEFF54B0EB3131EE7D61030C33B5502C49CF398FEC4B7615D16FCEA3E8EA12BFB311D426331A06606CA5A066707C4AF8D1048F1CA6065FBE506D06C6C00D5D250E227265551867A6816F05155FCBDE24D4AD115BDA98AFE08B12A1F32E7C2ADA801FFB78BA05726", // 15 - "9D6AD9889EA02FC9A58949290975DB0F512EB37C8156CC9F1242B9E45F22CC1D6ED1CBCB6CB245811CE729261641FDF7A8F389BAFD7311B8BD689E02409F6E8C5202F466349EA466E5398B29C8CB126D9600D89697A07A6900FE8D95951903DAA3419839C2D9E35E9F4EABC04C9006EA585F544C7163A33D7E78DE28256B7B8978FE018CB529F7F79BBF66DC4F0DECE80AE3C2CD479D78C4480E4DE2F06C70E5FEBDFB4ECAEDC2E7BD891AD6C91A7C2446F1B13B340B7160782F6CC5B45F9787CF1B0985202DDF02EC552A6DC41325FD8D31A4316C13C56F7157134F66E1D103CC3AA7EB951C92094EB4409E6E7BC494434FAD80999D46D824A5A57390599052025F7DA4838F7D16A8DACDAFA06D175546FADD1E3F7975265230F6C01B9C1FB1B7AB1F2FDD43A5778E3C88FBEA70575CA26D94D249670E4D9FF28EC67D15829776D7BC6754D2A2BB01554E5FF0C3FAD8A1CB546E8AD5E5314103D086D14ABD30EA95DDC591C13D96C1CC3F60FD18D216B67181B6324AC09A97C0C45E50EE8380ED42F6E0430639373E7760C708248EE7D74830E9594114879748883F247D056B2BA94A0FC54CECF6F5C6AB4DCB7CFC8C224F40D886427504233DDBEDCE160DEFDFFD69EE2B75746D9CF71676DC453FD01C315ACA96373ED387B040BDEBA7FF3CE00D915F90AE6E1796971F8052160154E8986913AD7BA291188EC49A60BE27C", - "B5184F7D580935ACFF18201CE8B5D54CD0A1CACF102FBC8AADF391C4CA5807BAEEF4E5E47F7459E74485E48E0C42D27CADE6970714FD97C08F9592FDD387C859FC12C1CCCFC3EBF510D66FBD8C448C25A322CC5887F94A55D48ECA362C690F24833C3B032A047D12BDA2ADC6824A1F6EA9320BED27968E9CFBDEC60D041EF538F1740C0519003FAA89CD4224293167E05344998FD396EEF618E8F547990BC06A8B76D0FD6FAC13284601AB7191CEB813C46C45CE7B3FC09EDF08DAFE136BFBDD63E6CE7E4BCBB16C5DA68AC71A1298FD27363349A261C2F2CA8CB799E8604ADF70092BDBD6A04CB80568776A537AD1711891B251C74E42FCB095B23EEF70F167E8B4856BB7F92E3A43C79FF4437262DD70BAF9B16CBF5F10D1AD7559AB0F8CEE1B9FAD058E84FCC342D9F0D9FBE4207D40E281416506242CA1B8DAB28DE88D2D00BA21AA7FDDC25940CB29F02811F8DC6850A6A87D72CA9F3476A73649FB4A254B1204CC1261E7D512BFE7B0D0091AD5CB0FBBB765FB5AFDFAB0D701941DA54832FE8253BC0CF61924BCA2CA231A196C7C32A350AC9A5FA2884D8571FEEEDB7D29632E71898BB62B5E4E0104F73AA6A9C6B8CDA816872805D75ECA64F961641077B259C9D39E2F3CCD9FCFB1E6B6E2692EA34336A967E587F32E49B961B91311198A204D11874B4BEBC6C04DDB5B82D5B741D3CEDC03A56A2017B3D2C4FBBD4", - "CFDD6B78AEB21CDCD6AF8C349F6DF8FF8B96BC8246A672A16E45B5D0AB7D992570EC45A534B77F204039FE200D4C5E7C78FE24941F578097B216177D8AD4E1844B2E52D843256D0BE8504CF2D5B639E2CD501A6FE39B8AA7DB7DEA924B38692E43195DB7E5F25E25152DF0FB7E0D4EF63F99CD95F699E16576702B651C29583645070011B2A1F88C947BAE7C94D48EB07A132DB38D4FE2B77EEAFB31AFB442710BD0AE4E6102DA69A454517B6F148D97DBFBAC7305979B5D74D7D7568A0CA56CA89F23D8330261025CC741F9D7A4BDB356B544C68C89CCC2C125F5C71E18C4EA102343AE4A44F6FC695810E6F28C86BF53F4C8B8AAE46DF6006B1679EBEA790266D4D02A2095074ADA634EE60C7070285C316E1F191BC5A88B80D673F144D65B870A65FC93D8B4BB29B80FD58F9FE95F5994878308CAC5394781E4D5A3F5EA2A8ED834EE5BD31D2058C843F22EB778C4C25144193DAA65F9B57AEC4A344713E9EDF913F3CD29196B42E71BB182AC3B1A60AFDBF1112A86A20BFC1D28D3E0DBBABF38E8F12651C207C951654FE8C4CECB6C6F93EC46456DAFFD7320DEC8D08F2F712CEB4D82407D61CC47B333F69310C06EE1FB5ED84F83945F05D4A87CF5A68D78B5536880DE3443E804040E599BC5837E22150C93CC1E5E711F9B889C78C6FF882D80857EF41ABC5F12E99105E6C894EC0B796E0A645780341CBD039E8C6EE", - "ABA759AE16B9D8778FAC203FADF48015331D6499B8CD74BD71ABEBD3E53ED90625E3057EA47BE587600F308D38743A686EF6FA189A4D86E4A35EB798FD2307345FBD10FA701265F6417603365FCC4CE7635924428167115BA372294C27A23CE6C27C506603C5A6618A2B3344BAC50AB7FDC29D36BCBDFCE0D48D088EFD8EA1DE492C543093C30AB7694627C01B334CE3368AEB4BB3267EBB1096450BDFC2571977D7EF78D6E288FCE0388A041838EC2031248F5FD659C70180634A1DC7196C8D9111C75B51C50F854CEC63DEBF9FFE1AB9406735EC3187276DE7CA2FAD4287027956C93B8E84B7C0C3A9C3F7E82B3DB35EB6D2CEBDFE0708FEDD764C839954F2CC9044B652D0A01D28BD6B9D3DD9740CAE39AA52597FFC1227FAD8B78EAFFC31BE94A632A1AA7A60AA5A9E090DA2B62F6DBDFDC50DF6EBE1D9949619FE9B2302248D6C801DD2D6C01FF8206A93C0AD22C6990C4EECA7D4BDF36C3246A5D2D2B3982C608E6AD6BDD85C92682EBDC9E4117F8B7F841239C2A5AD7977E11E4E9CA73A55859EADF7C9C2F1B28A6B4AC7202019230063331FC5586756CEA1F8478173A0A4964D00C1AC099590152125A4D01592C54DC2555E1BA34C7AC039394D1979AEA2BF7B2B2A8CB9D62E89132CE9E3B325F023AC6E8117CE57AD4B271EFB0C172FBFF8FA6A17A490B67CA7B15F865A8AEEF37651A622390E82AFD418C7AFD48", - "CEA29601B96AD3A831646922000BBFF02C014A9136D9A151A0E61A51F9FC2EC0C3A8F4C83E64BDE569A33B4CD653C1345B7CBEA3B3AC0411B6145727B1DBF6066ABCE9DAA8B0DE58ADC2510C02C2619A542A139FA3EF7A03AD3467345D9573C107A13E7FCD43C0D51DB5EC1A09D409DA75462F9C71F0C9E36C2742C279C910F07CFC5CF7F98AD48D67232A2DF29A66B78209557357A4BC91922D4195DA9533CD3501F388AF6EE2BB3AD08BC7D53015059988F5B9BF7824D066DCBDC61CA588DCCF0EBDE4A96632DBA22CA0D770C61A1DD66EDA882D02C5FA284798E12296E89C45906D315EFDBA816FD869DF869A65DD8BA4E0B13C441EEB052EF3D0FD436E4AC68EFC749E0CF4C7E15599D5514E136ABD134BA638A02E9EC1FE66CC9ACBCE5082C8734196BADC21F4DA7621D9FA725362C411127836A26CB44CB3851D53C599B94A5E67862665D7092C43D9B4AD3FE20B8AFACCEDE920F440F3BF5552CFAFAD04A7D7E0A9CEA18D497282D44778FB7D5072832C0B77C4C51F4DCFD7AC07DC7A9863DB8A38F1C003CB852F6119BE801AD12B8BC7393B00640F125C734447DB2FD8B02F7F7FC7A23B84FB80F9CC08E3EF888634FFB6F51ECEE9B20A89941FBF2B49314DBDD67CB7A1B5BD8D629FA327AF2CBB47B5419A0A8CB807D30152FA560690DBAC49D6B043D5BC9D51E82C3B1CF4ED69E997050C65197F3D93E21CBE91E", // 20 - "D358BFC8C6AD1DC94E71D1F5D05589424275875AF8CDA2ABCC6404D6FCB7A2E0A74C68024827E02621C10CD5FB149FBA373AE32DFFF275CF386C3D7A04E3FE10B6F1A6F4782B4823242F29672E847CCE760BA005D6852A3459E7576A254B10A9A78A9F8112BEA39BA65898CFED1179D68211D98E6950ED06399E39433ACD898E2F6C87F5FB9D99518EF36429D447B0EF0C5B7D834ACFA388578BDF60D4B1FB5A0CEE7D1D613BB9B99E36DC9636E70A543BA6BF0B3A448DBDF80469494239D4B7C4979D82E80C08EF36EA67560C86665D458040CE31BA009BCDC30CCBAC50259E4485E570F190613CB010563F6BD24C2F1CF73F6A6844AB8350D23BBC3D1361E73DCE94AF83697BB817BA366C9855A754EFC2F007D99A964125682E6F5CF7FBBF687D221B5A0FD844477A2F87D5370F4469F76073A93AEF7812275FD4F70B2040C12A83ADE5E5D862684D119DCA0F75AE2B56C794968A68566291B731579A1055A84F083B3072B7BD5AC9D520F64F0829B592875613BDD81C11622B331289C98501B01EE1D813C0E97CF36878260F80BF88071D258B9DE02F3F90B4C12BB56CBC731550B5EFDE6D97A1283EEFE61CD6E5DF312D0F0153A32DD65B143EC6A3F2B64E2B8FFB47EAE46BD92A6EB9ACBDD11A2D730D027A3EDEADBA5965198FD59BBC8574B680B96AD48586E5B17625251BF4374E28C6AB956C6818183FDC119499E", - "FE69433233B6067B0EACF1F47BD3AAD9783FA30F684110D1152459233896479D08A976B853E4B7B52A34511239961048B7C1B9009095327C86F2EA291FAC1734ED2596EF19D04528F3D8F2A3430A0C19DA6A70A37DB6DC034BA0053B57ACB9E7C00ED9BD6AC11339EA169D9D54E6739B051AF40EE79A1034D6294261E1AFFCD61B9CA5016C56B2D1172D9B2A7283E4EE0A06C8149E5A2DAA263A5D2429C2B1FCE75C41887DD02E056EF8724645FEC6FE7FC1EF180529B1E894773CF3E2E1D938EFE9CD824D91454116797F5A84746537FED5F0EBF0583C8508EA0745B4989954EBC4F215BE3D515687BCDD5DFDAB9814358B07038E0CB869A8C34F916FC67773191679C60A15A0A399E224D0B0168439386C0AEE8F5EF77185AC847A66D934CB0ED6A3467C3B386BA7F115877F36B49E111DE49E409468F343A98974F4EF1EEEDD282F73013EC2727518DB46C6751A58AE3E0D5F9D2B966D4465BC5595BC31B2712AE1E1BF9915CC0E02CA7240EBB9A045F959E77DFCDADAB6248D58B47BBEF3C775DEFD629A2EED15201A21ADCA470B1AD3084924FABCDAB6B12FA6201E2A239AE8F1BCD7CC39FEC62587E58C84AAC15935D45261E3AFEB60016AFA0902DB98DCFE586513FF70EF4E3F47773635D475754A158FACC9C470921FB0186BD6EEDEFCBEE9C803118851F82CACBF8C0A544B0562E2E27286CEA5FBAF83AA5C1F97A", - "C7386F9FF39FDDBFEB223AD8B856EA2E7F3AFEDE197A61F183FF7DF2FD6DE208E71E6E1063FB3774B696913524F7488EFC2CA54E8B653EF5BCB7A8F4994E312DCEE99A316C2ABF3FDF85B8FA9BBD4366ABBD7B3D3D433C14710A95EBB3D0FCDA2D37A443D62A8361DA78ACA781CEC04542D01DE7B6C6D14CDD4EA709264251D46C42AAF404094286DA5BFF8E81FA2F8C54B172821054F4CED82287F29EA3D3AA798C9CF5C5A909B9FBA641A8D9E310248B0F9A1375CE4DAA98EB62286B4EF4DFC58B877A73D017B17AFD7F1F58D3D2CAD3B7AF2F06699B08B88FB4EB70D2511190158BB4928ED1735C94400980144EF9ED06E06074E2F29325C1AA316A46E8E617B3CE916CFCF05A389052DE120498341EE26A27A3D757AAE763046B8CBC841350292F06AFF97C9707CE5561F5C119E2FF6C137094F62573EB80DC13862797C3319158DDD465FBC033CAD81BFBBBB54D9467599D751B9980A9AE8BFC6715C5EA74859E6A10DB369D5DF83A92655A9A5908228B33B36F55DE563005B886EB324CEC4160F0D18938E9FE41D39234C29E13B814DDCD13CA6450774800924B0848735C5DE076F66EDC973FC83B13938811CD9887371470AC5DD985481185F1191EA8C1D3A7DC65E1E82E2318D0FF0C9AF65EA1515DDC536C5A8BD0AF481789838DA54A39BA56D014E12242600AC78D28ADAC3FFD3600E896445868064D1D2ACF22E", - "BF5202D3599D2DDAAE5F526B6B6AC469D4BA0D0BA5D79B1DB89173320F0EB68F5D9DA495AA0981F8022426F68519B548B19B5F8CF068A6CA1442AF77C83B7D8649DC281BF438F9576F7A719A902A860B9ECE9AE9C14B98859B282010A5DC90DCE612AFEFD44E0E9E7666A461AE50C2656BC036648B826CA9C3C7C53B30976335B097C19390716A41FD437A2098BCFA2B2975F1EAE5BDBB8192024C20136D2542FD89FB8F2F94C08F765109279BC4E511787496233F15F52D7C3BC3E98A6DC39AFA1818B9533EDE72FDAF021E2C9B7D6C74E49B849F372B1A131F4C532DBE3B63635E0E1334C87DDB6F3D73883D2B43E87CF19E40D6B404E581E807E6EC1A94F5261C7F7EFD4CF043C90A1A7E97465022ABAA1DC21588FD285E7158FD9B67EC5FE7C9E84029E961E045EB5227E4726154F4F057FA337BB20DDA25D11632A7995B810764084EBDE01AF07372EA82FBAFE0434401FCFE05CE8FE3C20C01ACF4E9B8EAF4D50C73D5C42A95526CDC8313DBCA6ECEACB457D9673565A1CC0AAE23FD6261A8943E8FB84CCEC676601A4B302A9CACDEC8998EDC847A53B3CB0E12C8B4A7897D5680CB14A3D11BDBF4826C3938EBEEFA0075B6494CC714D3C0DDA2F5F783CF23AD2D2545C899867C1115BF4A4F559F63E68098955550BFA1EF7771598EF86A08C0C634B291674BB77615121BF0838DA96D6E7C53BFE6A58A382FD9721CC", - "BF8903A3918B3FDC06CAB4EF675F7BE3962CD7E3C6ED643386EE533C3B24A3D94D2EA2CFB83F0A346FF2875DB07BA647492D47A807E7FD9717CF12BC97B3C1BE1361E598850B39D50CF7BE700507863BC4BBF26620FAC11D97128049BD96C5E09DC8FF3F62655D660FE66D31AB0B0F6D4F8420E3D2E633C571D7FE2AF1CB4E3BEE95E092B00EFD2796A3DEF376F75B7EFCBB141337D81AE52939D87956C41B1E42C1CCA4317D31AB4F53DC9502A3DC774E05E1ED5008CD931DDDB98DFA69960A6ACD45B60895C4FBA2BDAE8BC7DB8C821697558B1E0A3111F156738409FD180C5A4A33B24C5EE4991B84133CE9AC089724D62DA9D9827A2A04FC103652F216A0895E78A96086270814C2699F475CEFD6359428D8C505BBE8C1A96D2793802219144CA6B3EDB455929B39A3E9F3AB74D685608CE3F301FE38202ADFEF529CCFF46AF36DC24956A7CD07CEBA55AA4C89F7913A8A4B844FD8F152C8A823CB9888E3BFEA97D7E4AAFA07125DA4F51D974A5DAFF0045BCE5B868177A91BD932963451EE2673A85AA8B7D493BDF25BCC2F64AEC3150D8C40C835AB4F5D0B7F259DF099BD6FA9F5CB198B61018B1448035CCD34E7E7A2138F437490026050BBE3CE2D4CF4F4F095CB97548E5731A338CB3903519D6B13A029727F047A7D00904A556C883745410360FC878F77707A716D549ACD6A70A18F9EE0AA8A6EE2080608E10AC", // 25 - "F58CDE0EFE2356F429B0F2F9A7869A4142A6173188DD75B570F1D1ECD282E4AFBAD11370C5B4CCF3C98535D27D73C0111F11A84711F732441EAECAB684F2F0D7FD4FC4070749574922A906E84B3350CDE5957DC388FDA23BF45F05951A393DA253EAF691940897B57ACE655E9630F09856E76958D6BF7B830E0CB8182AE226F39D48036C867BEFA7E7ADBAD17C1AB45297C757DA4AFFBAE677B05677D60DE1D975A4F3D7EB3461B424B67B61025AAC257A69FF720CB9DAC007C50C69A7ACDBBCE210BAD4DC2E629A039D98E7EA037A5C344B5CAEDCDA035F28677A41D55A0E3E6E480CCB12B8F17062A983F4E651B4F7CB217FD06BE46747CD5418C0C81916465A4F5660152B3E4781DA8040D4246F9BC47366BF663CF9DA3BB247D9238873CCDC6FC62D1D8F669EFBA42527112FF4072262F7E65AEAC328871DDF47588A0A0DD13A4139F4145822A5917F624B881BFC354F37B6D59C566823F629A21C973324F7167BC39FBD2C121D2A849308D13DA1A28948EB59F7DE97E364223E17A30119BBC7F43E21E7DC3093F7505055ADAB4654194A77C1CCB61898840125455A275A8F071273D8C13934915D379CC603657D99CE4075C1F1DCAB60B6BD62ABA1A10B5402A59706798002EF30ADED2F354E38CE0B57900FDAD31E7F684E53D097B4313DB552EA66F6D337F29594470D3DC0BC6CD361831251004DD3C5357BC0BECFE", - "D9086F7C272AA317C64C00AF43C924DB5DAC97F8EE3ED2296252FC4756FCE6928BB009D4488B9BAB757411BBA52BA6F61AF1181CC7BBA94257593FA1BD26D52AD5014C3F1A1832FC4F7445C8BBB77C8FD31C88F0C5D4736D49DCDFBEEF2B8301E31185793BFF87CFD9E6F7E084D343AB98BA3518A87A5F915BC0D76B01AF7DC1CE45F1C5280BD39D3E3D94D0A0286F8BD9FA942849664E08F2BE0B93C6E3B89061193FADA0FA9485F62CA87F3E68E204186EF1187642D651162E4D8E7DA049F462362D8C94539CAAD09AE4768C96ED6C2CAB8025EBB6901CBB26865E1F19FA1B193D47ECE390B881233578950175C85B928582D5B439EEF2F56A8C7EA09278E47741051223AC182456C4FA04D025BDB33FA10C48C70EC91BC709E3CB0FA3E01DCE5FE5ECB9018130A8DE5D0583EDD68EA2EF227A612748B2F785A30A01014BD479DEC6256C8AD88470F79DE0E1432CAE448DD7049E5B7D4DF3C978F65E708CA3759AAB9D329C11FAD71204E1E92322E3EA1BBDD9D034E2A23ACAFA21CF490AA5E2E419197DBE990667BCF277ED61B264632F694392EF52F0A27C38E478257AEC8D2542938BF0713EBE60779C95A0EEC8F32A5202A849CEE8CE0F99702F595AEA839531D4CFB5F5A6166B06EB64387552A1F9BC6BB97B9B99D19C3D2E1E8E9B305D525E7413496E40FF50CF77D4D4E2D41B1D5929848FB2F1FDDA5A39DEA0546", - "AE4E3B30560A50DA55AB3E59FFF512844A2700D2D763D85D5C3FD8CFEFACD4D023BD926D3EF2E55EB1B3831F2276EB07E5C07B44FD7D79333699BED0804B678915FE0F092DA9A62F69CB020DA21932F9FDF9AF332E1B400C6B7E7880508E840D62FBA07E827A23A2575AE68E15AC444A1CE35DF3C3F7CA49DEF2966DF3BA89C8E90ED5E2421A6407F2EC51A3E92A3608FCBD6AD9FF9E5C7817E79A0C09FE9014F7AC291448263E4346CBC4BAA6EABFB59B4526B654070084F52B864F9769181DC6EA91B576956397CE55CCDDBE41F94E5DC366E775C86ADB1C807B66D08696A2BEE45B90E8736469A371F05929D9D9FD34980DE08E00BDE2CD0EAB6AF2165D76519F8F2D894AC70740D2372B37407BDA4D943EDF1CBD35CCE4D81340CC97751C568731C009DF65571F28B7F58106AE67279E83C3A0C130DE0C5B6C99117099548661D290C4CAF3BC60EF719E2F7B210FCD4381C33904AFDF96DC3A6557B42B6EE895B4D604F5F8985F454C51E32B2C874E90926CBC58D044D483D6D2A7C26C7AC4D190531F79993D07B2E830FEB99BFDB00AE8C008DB1B762F3F4A81D41295FDDA37F3056B1110D4F0CF385F9FCC7E14C34F6752A2FB17F5CD3FC4AF0D51E4A0AF7D28DB0D4D651156189209480054F8287266B1CB26C9E8CACAA0BE5A69C696300025D160F9DA29F9EC79838941459B7B8164AAD95577A0C532EC2EDB35250", - "9CF0CC00B5788DD743A5F33D87E8FA5733B72EDBCD61AA4B8D0B81213DB52E7EF17AE90934F5EC0711ADD19E881CC330F696179C1BA464FFE6D7B04EEC383A4106BE5892C5DD1BD719AB3739A909A384FACA455E6AF96600AC6FF809788700DD2AB93DD228483759BD903EC002D4C1278808B764F018E3B740EFD821A61F5BEA2948A653041FB31F6D5D0DE0A045DA366E44112C820FD7FA966B2CCFD5A6816AF84DC0A3EEB8F9D2F0A912586F91D50B1AE3D930A680A8FB7435B6875ED2E599B87598A7C20245296C4965E2E0CF372B6ED1219BA68CB646D3E73D52665AAF2E3D1C4DE8D264578299B166FA0E148281C877FA9B14818759CBF7FF575307E80B73933599D94EAD2FB1C08A30006330BF0AC1F1C0A4EE6B07F9F3381AD7E2E469E8DA9C2D22CFC0A208B58924D2F994AFC0268EFE206E0A9EB79BB51CA26FB49013B9A17017E0C08F9FFC6C319BB1B5AE41771443BC670EEB91D7769F9890A9B80F52CB0167EAAF850FAF2A52B74ABB1792E7CEFF68C0D38B01F244AC0CC0EF0731E3BDDCDAB89DF376973A7ED5D4264EE82C334671FCD39ECD6E2CF869493914F332767BBE461707166A9164776D29F5EC9291F505AF291254D7319AA594B5F397D5BDF00BB840C4DDCB425F4325ED8AB77E57BECA3441B89414616671692EA88A89D2690A4B5FE958F990BD84A3884A60FADD5DA57EDF01865F85829195460", - "B85B6E754CC8F6805A8A19DA104418D9C134C8B0DBCFD5DAAF5A71BC047A73BEDBC192A453674BC624959BB76E44C5B34244D4736ED3F0F3C9658FEC0DA5437E01E128795EDD7593D636CD73FC1780B37A381502633CCF2EFDA0BBB494C1D0FC7F602DF8C282F55E3828E81A92458EB16B74835040D8A9C8F2DDF180A617B0592344B4373E1B526C9706B843B0CED4D25D7324C6FDD0F33133C00443638E6249061C56A116CEC7822F4512AFAEE52CE8F94D8547F72612EA8C7D160C65FA3BCC92BE01493706EC4E5F203F0BF85C52F417BAF8AF490E50133505685CE63AC5B173E07D8DABB2D439C6DC18B41B9CF37D02C92AB5C2F27EC83AB6B2DDCB7ABCEA30A95BBC39E9FD0CBB28118823F7D0342F1EB7B45FA6BB3A50223D0D7B14E975E7658352BC9288B48AF1346955F4551F2ECA47D423EFC63D20681057E5EF234D061A5E6E234ED01F3DF223A0E8B4DEDDC552C7DC3ECF663D5011FC907EB4A7CF746AB9E07C2929B7427DFE9E00B0A1308881912635A72EA99927F343EBAD32436A9B8EB1934AC29E79BB80AB3ED9F5CE39D1E43C251564654365DA43FB8A0FBA27F2328D82445A1EAAED67B92716147E859064AC326A42DC7880DE82FA782AFFF9C59FBDCE088746F8CEDBA288BC8C2C4B458782CC9BE63A86168B671BE99A09F2217B7BB2A7BC88651C1BCE8A0B89316ABFE72B22722273AF570974D8EDEE4", // 30 - "DD40DD438251E401FC926CC6968393415D52D521A5BB34D4272D6BC7B5431062B35112CA709C0680CBB18EEE053AAD62B2391C9E9D580562541A453ED936CE8E88DFA61A88CA3BEE66CFFF801785CCE863ED9C36A04D2DC8742A81CA55127B44314AB4E687ED921B4881CB363AFB3CCE7EB774E3205D4591939ED7D3C0C508A31786421F49669E120F01D35D467B40F85F2454F13F591F3B830937421B5C8A6C20EA878971AEC941FD99CEA92FEE00E5DC2264987DBC549EFF3E4A26AF0CAD7421C4256D107A3E8908F67450960E4E41FD7E2E84F754BAC81C8F5F1D6F650DEB3E6EFF6059836643209E3880D7BDA701869208D8E4BC8D0614066414DB3F93D6EA187950285F55BB7A1B026EA4BFCAB4671B07704828D5CBF9730EFC99E68E91F1FE9664DFA73297F2D6BD9497DE04982C9FF3730BB6FC3EA2053B3F45DC7FB587BA19B3C6B7E780EA5F25B45BB727174D4CD3B401FE1906360BF0B15DB13B62752F82EC62226AABC83C1C26376F8366BB849DDB65958AD969B25654DEF1841518993033AF47EABEE3CAAA936F19E28A205F3CDDB5CAC649DB6A90483ACB63A24EA46D397508EEB5DA94E9C883EB0451D036E28CC303D52B1BB31FFF582605F340D449508959ED1FE2FF0BD22FDF77F9680D6B5647D59E7E6A003AF0C6A95092F0DE43D1252EA6DE00F288BCCE3ED9CE273DCB4F3BA7E8D17353B8ECA24F03A", - "FE38B1ACA366B4C15F3FDD4DF0E0274FBEFDA0042BB203A4F6627ED9E29F405379B2F2DDC0F3B02A0CA70A9499F3CE82B87603FAA347B7052CB5D13D9DE84C114EF3B8F62418FB1F3E374B997127667FD6BCA2E2F9DBC04ECA9D908CD37C62F08EEA6F44B3FDC149465AA8037D65A6C8B9B8B3D5E9A40578E5EA3AE1209BA49E5E2AC615C59A2D71AC1605B98E39A5E66A890754C7D1C07E06DE78632587BADAF7FAAB0A529AB791095DB0A708B691E9D81F2CEA8F07B05495528B9FD56F77A4C8209DB972FAADD9791BA59F47C06F241F50C0619FC04F8456339E0AF331310FA4DCCBEA0E5DC2795CA6B3ADD0174AE4B30AC0428320ACEAFF68F73ED11DC1BC9F0237BDC75F7F48BE518EB3305CF2BB898B329716FC9ECF7E99B510B3309808735FD0A77B15731C233998F9ECEF46E2CAA6E6EDC8D05B943ABD17027A80D636E535038FAE44D60AAEC5406A372D62479192FA84D844520C6774CC589FEE16A3A5549495D968AABAABFE4DB94F5AE0C54E603D6DA5C3056769A064890533EA8EA1E5D1CD410CC8DD4B1D7E0F5F787232439AA4B3911C5DC792ECB873E8105A1AA61C627BE57E809C6863073E1E19AD8B987DE97D88A817FB43ADBB7751E36D1F0E7B70B3759D6EA8F2350D10AF38C331E22703B2B5103C908E1D35A8E814E45BAE81DCA0530FC3525CD640548245C259738E749E195B006081A18C45475F906", - "961408BD52EA1C6A9F340D9109B2388CC358BBA2D35BB6AB672A9C16F3AF968BE4613BA6B13D115B896BE71CFEC4A4AFC0BF5D2BB1B5DC19405F40E60FDF361E6CC362CDC28B75B8C30B468D3BBB77F3FC62869FBB635A3F7AEA63420CF1B80A4B3813B2240B83ECE999808E1394DA2881DE2DE62C870EC163AD8D81495DBE2C7383B78E19AC506AED9F3BD1280A77F2D9C55600BFA258E76761391145D45F74253C6E14BAE16179884F0F0EEF8150A445BE1B5AA4FEDC2198CC39763A3DB473C1CC4263CE2DD587447DDA6BD0A496E8DF60859CFCDAFED2EEC5B1E77E68F449ECF129AA17395BA39392EB610DF45134571BBCBB26162C83FFE77D188160EBCF598EF6F092881612A04BA9F4215D429BB521E737F6C3048B5D95B20AC37F79AA99A12CD0469268228463C317A1F31E63E4754890F20B4516D179342A76201402BC0DB2AD091A70B4232473343FE9E0002E59044C5F3B6E3D7368DB7E7F9F42E7A4A1942B1161552C5C84390197A54079F570B57E8EA8A30659FF5A61048142E4368D5542B968966E54DBF91D3970B9A3A278B951D6F914246FA5CCCC20DE53713D4830AA86D758ADA7A8747FCD455B2C320FF9E5E7FE1CCCFD6F7928884FC0B35F34118B4E7E6F6A5D6E3FB4E3DF90CEEBCEEF9D7D595A4C456C373C5356EF0DB0E6F8D61E413F80E4C32532BAA39170AAE2FC606B7206C379C4155031AF918", - "E03A069F63220109A77232F2BAF29D345737AAFED2E5E8D5C846B937277DC88392DB2D55073CE063F5FFC5717BB89B481B8C86EC01808A85ADD78517CE12DF776CD3F02D948BA795215599CFCCD9B4FE56DD681A59C71D24946225171DC18E47BFA9068302BA428929790EE62306C5FC8C10E71F6F372105C9421A563A4DA704E01FFD71E46B28C6EE1B7CDF95BCA6A794E8CFCB6BCA6AFBB67DED5C1267A12A4752176C3C1E6C2F665194C7F11C1CE6CC8481A5A966719B57124CA33D8EC9862AE5485788106562A0BEBD3980AFC4469BB1FD1653678192B3022E26CE8788C68F202D506DF098D49EBAFF7741CA96A02BD68BFC4FDBE24D34770FBBF8EAD9647C911B2E6AA705F0236301162CD2B41B88BDCFC2A79EC54698276126D6EC0213931609985224BF515AD3221FB5E8A1C4CECD51DB4AFF612157ABA6640866DC6D3602C446B8C6EAEF359BC8703D5EF9FE8EC7F5F2685C53924C6F1F71519E0AB589EEFB393A12C06B906402FE0A2FBD793272BC101D3B57F10A52C172E505B74F2A00BD5D2F7C7EA2883908434C125969A62F1B09F42E578BE22C08E88B11767D97C4C0CBD2BBD98508AFD591EB0B0C846A95FB72159E561F9D87DB446E9A19AF378B6DB4DCCB49FF8DB547B3040FFD0171B87245CF73A0747287B6FA1F1E4AE99518E8C53DBEEA942AFEF75B69E4790D75CC8A5181C609BEFAB641E28C07082", - "D8D7DD9242E54C6DCDB2A717A6F33226A94D5794FA0BDC401F4ED842A5CFA4AAB462F703239F684DB9B95E5101A5DC6067C7062AED9259CDB2067BC815C157A7E150F8557C3A54DDDAE94E5C569A1E09C383A062B601F920EF4D957F4BCA8E329123BD6FDC3B731361864CC139EBE3C68FED0F40FB127D9D1DC071DFA1552ABC6703494A632AA1314984A2D4B7A8BB32C555B79DEE013A66745AE15E8E5E4E129E44A119203425F2ABF1F03CE9CB33C0BDC3285ADFAAF4D7B51EC31F02D1E654BB10F0CD97EC3E389CAA34398166B4D5C9FCBC6E957FFEC9CEE4071F90EE2926FACC8FDE884CC6FF1F6EF1D3CC681FB44E45C5CF681AAD13226DFE19E22CE81265F3088D193EDB098988B2640EBD8D9D66708E1E9880DC41A72FD3D64792B14AA18C13E371CA17FB46B21DA9C59FFA2FD075852D42E2A578744792EC02F9A35F869912BBB44DCC648CE6075DBDF457A9AA891488A5450FC719778739AF323E87F9633E621B404F70614F77C65697E71F281675C843C523740AB66756E4DA784F555B5B4D797A06A0AFD35A69DEEA6E948B9B3C2A62D7B1D56832D9CCF56F2680A5A0A3037F4E0252413FB86520F2815C8824975634C0889A486963A2C874638559E14F780A7F3E2318B88B2C2010174150AFD4BECE2C5FF2D37BC2FF791F4A3136E19C373FCF03E471DFCCED19471182A93E91ED3EA68C402234AB2B00ECF62", // 35 - "87F0D84B811E4635AE8023B74306DE789ADDF1CABAF5F47885CF7F9A33F2C533093A339EB0D5E05C0763A215459CFF0D31CA92573EF2074CE2B6A11FDD6BAA3C6FA100D23A9AA413BAAFDA22F746CF74562F9DB0EF2F7CDF266142F177681CF2EF388E2E9AA012459ECCA332B779E48CA44E536082D59C3951ECA42F66B600D2621BF5F3584B59DC0DB76EC66ED7D00E943BFDE703E7D5050A8F263366948253B3576311CE88B463791DFA6F401ABDCFD7FA44B158AA97EF1CFD7A8802662A633EED958052DEDB12A6FB353BF2224ECC2322937DE3D39DCF82650B18FC0BC2BCB8CC456141C9F3FB09A0906AC1EB77E50E8D260041E4B3FF4BF3A53F7EB62E0FC503E8E38F185AF795F67FCE17665AEE29BD0D5521024A70B61446CA4CD2B3DC274FBE72A9AE29EF67A2217D6CC81BD8831B5160E4E81238B379B657FFB49023B040B6D504B287F684A0A0C07304E6BFA21E8D0A7629BA32F3F2BC9A33DEE2EAC1A2C22462EA0D24162543945B78FB6E26B86E12621588735B32A4F9A50157F20BDB7A4B6D151B3F28B40A03CFEB3CCA635261ADA2295B74947F1B1D676F6C014AB362C1F5AEBB439DB137D034D00591235B6F8D11C735A0C1964B29D3002D5243374628FB488A04EF245E64F598EB6ACBDE8B87F2FC5D1ACD105460C26BC6E1C7DCEC2E92E33F722E0A613A86356343EB111D0B166AFEC5C7A44B81A607A24", - "DDEC47E0FE3E2F4205206CD673EC66D7435E8BD4A523A8681ED77F51453B904E4468C70C2224C5F1D01A1C5ACA89BCD72673F82955FACFDDC4DA499EFD8D18A2BCC5035B0C69D095AE0EF1AFDC389B6253BD6FC83D3C37E809EE732A87D065207684332CBB9BB0519CFF51B553B3689246EC1EA42E236773A5AC4A7BCD37381615F78A41E5B181AF5C502E22FE79436D6EEC07F7FFAA739356CD9544C7DDBC42C56BB1C965441903962703986C93C6F8135A8EC42A89DCB46E754EF5B5250E1171398FD31793594831B0775F2A39E63FAD99929A0F257ADF332C078B0B7E209229ADA46D69512FF2DE930F962B8F81EEFCFDD358FEF8E4DA0D49F39C43AE9D99D8052FCD60305FF4D9FD4CAAA3FA6BF258B867E3F266F1BCC77390D02132E370AC79B34FB37F12D102985950FA5FD53D3D4783DA5B284494EBFAB51DE6CE259E27712A0EB4D78EFD6573A03D629F29166B902795FC8DF59050C9FA48584F0EB69293C7FACEA8972098E1367D183C0B91C3550852AEE6721A84341612E820CA4F53C71A51774134923FA00FAFD84811C07620917C1966F6A26A032B125D76BFA149FD66EBD18F7536285CF94A8A750680D6BE0F4A4E7F2433018796A358CE465E7507F186752EA2FFB01941902129936F7B18321902780E2C6A5EA7D3607227D6315C570815BD0E808EAE242B554824ABAF30614CC72B74E647D5B5A6306632E", - "DB29CD5101A3FB7A651BAB94E0CEF2BF737BBEBF0F755AA42F1C0B2E6A2E00422458CD8E2244576F139E811B2469E1B8F10FD95A988FCF872607A9B5CF81EB5875C427515D8D6D4FC58F3C69A92AB4932ED3D1CE6191E648276AD746F12A0D7B1ACE96B80CD2C3B99BD1094ED29F7020121076A6E6D5D750C39633B00F3DCB4793A27B4838C492EFCFDF94D955ED33814C954FFE8B8D29A81C3C62BB2E95ECB393F06EBAB479494628027CD02E59F1AA32F78C53142137965E662DF4B3EEB0B92A6FEBDC91F8B31D41E2EF69ACDE1CFF2AB49E2A4B12C275A20439E30C690D14D4F661C81308F11EFA3D014009D80D794D9F2C8B51E2E6C83686DBB07D1790F56D7C8EE495657BDC081A63B1353F4C4CA74CC0D02CFD7BE60E063A33D1A4D9050A9100F0E181704799357532DE152CA54FFC089E8DF80F29DFA14C19C9D6B7855482622504F95A8948A5DD640EE88B87CA98F8248DF148AE4F992BC7D1FEB3BE07E70F22CC052D92FB263337528C41ABA642C6B1C6F8883B21ACDC69196733FFB684451D188107C1DD219AB8B0AE5F49628A1CE32FDBA4B8CF02F38513E37542D020F4BAFE03EAFD7DCCAAEE9E28258322E43DD47DA3AD625DC2795ADBBBB9FE061917573936E31DE6355023F8D74500D2D032B7A53630F37FFA80567BA36F771C4ACD71D76DE528FF47E8281ABCD325E4C4620D0B73B2BE2787A7F6F485492", - "E8F24D8DFB54C5BF909CA2CC5496AEA76E583D2D865259C356E64E76793290BB00E7029A146E1E90DC0C45356E13EF59D60F20F080A0FEA743FC1C222AAEFA3E55876F2C9E6F7BD29C09AE32E80B15DBA0E6B594E951EAA3BFD166DFCC17AFD2621EAE6539C74FD776BB998C24C30EDB3A8B6814DE088E7E6B7CE9A64EEE9ED8C9D987A21A3BF35A9D59171DD456D8D0D7D1BEB3F37D4A31812BE00077F0F0064DA56EF9C4D36D1D3CAB4D1D4C024665BBE1DC227DD29E1CF814EA65B64DE60ECA4AB9B19F937DF15914F3CA577EB3A6A0A2C8ADDA53DE536721FFFD519FC5E7CD9A3BF4F030B1EB638D6A0F8C4E24085012D758414211585EF6E0DB8C670064885B67256BB6AD7E12E380C5E25BF58EB1731E935899C1FD2B20008CF87529AA3E714BFFA86D8B66AA94811A43ABD868A7711C4FFB339C01D72D4974ED53E7DDACCD36B5F459DDC05E9D475D3E2AE383F6FFC9C2A0D1791B4675DA843303C96A98ECA88B54735293C4E1906AF30221EE71AB58F3E38271608DA6AC0A488C0850DD86F8B6588C91589632EB781637C14D9D24B57ABFC301790B3C11C1B2938845F08F7280388E0B9D5A9682A6FD40374542634590F336E42D8FDD92F3F6C82BE4D3B953CCDAC984F6C94D8F2FF70BDFBA63C922060C322FE34188FF70A37648C362BB68B06D74A2012050FC007F276A54882A8A04DCE014655AE43E448639F56", - "FE35174BF6B56B67D39271D92AE0DC2B64FE31AAE8D1135BD8FD308D7E281F3ECE84784423A48C1362B5852719023F8861E861AD8B22219259E357EB9CD8505A66EF7CCEB53636B47D38A2AF5506E1FD72D3E30A29EF897C5C44A271EE562D67B279806E8A5DCD78DE538D8121CAF4C217F8A969AEA50D6FAC68066277242B1979F1A6B3051CE5B9949A11719F556EBEF844C808E5C1AFCE5E312C53AA9DDBFAF7280A7FB8502D2C7D1B91614157AE0C6C962F868D05D0463131DC841169946B732F8000E686467BD5D8086CC249693FF9794374266BD6A5C8AFEC65C66A834012365D60179450C58FAFE724B8B9E99C33900A86649B04CD54351D6C4CC7068B28F070417CC9C4430390493BEA50799FCBCD7A13BF75947C597B3D7AD486E3AF99CDD743B6230BC473DA35E6D05FDD17F7CB8D04A2B00EFBAA30946EDA96BED467A45EBA54578D9001637702F1DBAFAD16D2608C475B8DC7994DAB93FB34DF2237E4A13D0C04A6CACD42FA9463674AF8ABA97CF511A82E8E61F8330004E165D753323F4AFFE598E4D108DD8EA8EFA45693A2F9EC8335C756393585E052FE5D150A58F058CF8C3C720F37112DCBC6324877E87541F06C968C46FF846CB512EFE65CC401174BBD1C977694ED7BD1702EBD2D1EF23BB56D0D0C1EC2D90A27CC63F0A09D83F8B0A5ECC181D5D4265911BEE77EB1DCB4780B53CE74DC7A42252F3FE", // 40 - "8FC54C96AC76BECE7284BB32C63FCCABED194E82FBBCFBDFDC6AD09AF95DCE6A5D6E13CC06B247E38253D359A6C0EEE00A660BC3BE6FB217B9B554C90186711B1E85117DF0CA17463E132333B8469ADF72C3BC6F218A96697E172CE2E6D6F4E70EEC2A0CB48F0A2E7991B1B90A85088CD2C59E3C9AE7FD939592C14AFE9A13829DD97E345D1AF92AB46BF196DF906BBCAE16F5A58A4D99C7D586869C81E182352C210E3B1EE822F4A95DD0BB3B285632978B18FC1CC29BD58C2152FD3BE73482DE1A6A79C3929DDA1D20B6E99E25A666AB20CD371A85DD20BF0A76C5A81041EC943A89A94AA64C5207B3166441FFFBDF4AA28A2A88173F280F3A2838A98667775F597D0368DC0BC53C1AB8B7670EE23E0ECA08CB09FCA68FE2153F01FCB7061CA1B6AEDCD815D611FF71868F50855054085AA1B7CA3309581532D658C7D2D6069C3B44E0E3CDE45222DD9EB40C369762CDDAC6D9A6923FE0EA7DFA1DF73BFF8B60EFDDB8863538A38528803F3EC27E09C87A2D0E160C2480F7D2003DA331FD5C7FE05B582DC9AFB114D2AD2F822922067F1FDB3261078F33879C497035003171165FB139F79BC508AB9D3250D1B53508410A01C35B53179076D9F46C5BE1A26DEAA2F9F71F442FD7D19D34979F6ADF96BECF1124551D4806E7136551291352748DD2D58443978C3DEA5ED0544E6596769A760B476B9CE7BB09543991EADFAD8", - "BA63AF12FA5F7D03F714CA9AFBF19375D2A7E31EEF4A9E10C7C2F8650552A6CD22FDE0E012D46CEBC773C87729C7E746FA4C0361099D4876701C0B2A16EA2B5A6B750CDCEB573DC711F95CEF06B8DF516CA2F9BE6387550F22502E53A772436F324569B25BBACCC781D30DE25B806D369AD1EB1D1137EFACD0BE765DF4D06E177D3E3F13E9A3165F269244FE8B130E9066B23474418A5191ED481BC8974074336E71BEB02B1BC34CC620BDBC24CDA8BCEBE068416E5F5B5A263A51CB3F6589F77D4E607939F7A0FA637858B96189A014B5688A9DA32FE2ABFC31FB00401DE475BA07265B3FD1890ED0FDA487D7C616E099B4EF4E47C9F9114E6BF8CC757C92C02C46546130ECF7CD44160F55A72831692A5E69146086C43A5F043BD1184965E2A6B154BD7B8BFB3B4B28C081B0F349900492C703913885428A82A8D2EF1240414CC0B6D56D969BA1A121D9D61584C6A880D533AB58B94C85F07732B5EBEE7FC87FF3AA279ED703858957A1C1501D71DC5420C24BB2D570F7589F0AC5B6EAA87AF68442FBB38EF693D2200E73DC73F58CFCBBE43FFCBF76DB4241FC4A7B131F29C8BC0F77C95843D2FD2DE39E3D4D44237DB39994380C5F1A1A3AFD927F6B736D585112920296B90CE31D58BCAAF8CCBCBF15BB36199B48F00F308F7E8264D039D6DAA6E848CECDD1544323C9654232F45689076B7C4B1123AE0FF152124E930", - "F2CE3D09E701F60716A413AF06E14E6FB7BBC29DCCD8273A083B00D429B57EBE9FD5270EC0C299D243A9FF0FF73DE19977EC16C2772C6B7FF88F83481924C921F49EEE41121DC79B7C23295EFA50292B11C7D45D66BCFADC3C3A390E03E13CCCD51309BD4061782273CE5D0E1BD3E11271A3C52654D2B846B5600D3E68D2C234807BBC32F1A350839500DEB6D387AECBFF5344606CD04BE3614262F068FBD256B2855EABD5A7C0AB5C28D5719C844F2A6FFC500628CDBCE869D2F090E588B57B796029A84E2319FB6E59960553B62BD30DE99AA7ACF508168EEED8DAB9996041BDD78BAA2A1CAAD2EF366F4A3244DCAA3F06EC9A24572CC80C3CF44B557CDCF6279165414066D6B700DAEA8D361034D9DE455A55E55CBE39898B65651FE709506D1A1FF67585D0D3E1B2C5EB599704B3925CEFDA45C33D92C9ED9F0C45B7A80706E6629594F66A0F74A4A767493B73B23AF323D519B0D05EEC62C6123A0829CF612DEDFB7F275A55F1629DC64D2F77125A1BDFD7B9C213C51DD9FFD83DEF42E87AD4E0F9E5ABBAA6B120E131F9E5A3097F7EC766539C733522FEB0F02604613CA1190024CC1C3297E7CDC3C514F8C3787943EE8CE457B516677437B2212A19629A0A04B0DAB8258A17B28F52BCE915A680152225304301FD2BB1BA2A557B3E3CFE6553CABBF79A47FEC31DA590308D156C3537B97116224F3E21EA3841A505E", - "AB2F844287488AB6B0F47218F2A4C54E6BE79A80F1209CD747FD88A575EBB11F2F0756E2C263E753D9388876E159EF3BBF99448D0865173572F4B6A03FB72244334E4E861E0495AAEF15276379F8DD88AF9313096805D5596446B48EF1F1BF2ABEDDABCB1FFC98ED408846D85732F807196C9CC9B283EA4E0D78681C73CB6AF89E5C361476F84E979814F30C0AB03E97156015A493E091EC5D854E8B08328581D80091564C25D6A714407D6B591F17D376953F18308B8BC12EAB5B5C9FC11AFEF293109785CCE29C978955CAE2601A1DBAA274B72CC18CF27FE077A0123258A1B879E1ABF84458BB10652CF7310278C7FA11BDC5D00DB65E5D6A13D77FBF9D02DD0574DC7AE3849C7C47820126FC99B9766920516AD1D63E7EAA366005714D6C1695E731E88D43A38B615407A99B32A101C4D417D5E36B886C26EA1CBA9FAB0C040468781897145489121EE47BB2FBD6A064CB325AF5CECE5D5A4BD590C70C7A9B068D318247D8FE16A3609C94A8D431E9872E26A3CDB19DD971971AE1FBEB2FB76F7A71AFC5815CF7871BB5EFE3BD0C49BAC441ACD9CE1DA4AFBDB972659D13775AE77F843259EED57A62CEA93FC449EEE1EFFD9AA2D36D8FDBC06A95A6AC9B067468F1D813F2DB95D3456063D5B23395824385D5C68D3F869C4F639962D599AEB26FE2D5148A51579EF385D31E744450E11307F0C803C70ECCA93F831EBFC", - "9B1066F98BA2299266D8C1351E6945D7EAA658BCEA46D5AB353C2CE48D01E915E740DC90E9CC487126AF9FA722A335FA1A8D11C2719F07CCA23B1DC5E5B9AB198077177BAE0B5F35C14666FF32926AE0239F21811921C77FFB56F7B218A353F8EA67448F61ECA318196B1186514D27416EE2F61764940A70300B69EBD02719191ACAD969B1075EDD09EAE26F883AC99DED1AE9355C2F30CC656934C0175E824E76947F83D791CE7A2960FEF547CD3BA94CA064659D1F68C0DA8C13AFACC07F3D5A653F259DD141E2ECE9B6D25F67CD38AF3F802CCE332049DCDAE1504061C2437C7D3BF4E15D88185D4114E96BFF7EC673A7AF8AFD53C979C89FEFACDDF873686D892DEF5FB67877734CD981C16684320AF392A464C7216FC5C8B22BC29C8430151FACC94AA1513A08E1FF2F6A965F68E368245510B975595EFDA4E80B7FAE432FCE9737962974905F367FF637121237B2A404C42A5A9318DC5ED9CFBBC2EA9C17A6CA37BBD98F8771CFA7EF58B1EEE40BA2D6C2031EBDE4AF0590AAE8FD10B2BC02A254C97726521E4D4D4D9FFB74FA5D06F8AA0BD43631FAAFFCBF01FCA87C9360C5E6A62A4B025B894E2C30F9003D29B642335DB0A3F2A3436A917B61776F96292A06A6B4DACE4F6F0EE0232E1C206427A0386075BF50D6074006D45E3A3CAB085431032AC20D2690F0435D257D3E2C93FAE49D75FF0F320CB4D348C6288", // 45 - "8A7F8C99EA79E1B2118E3B203F72FD8921BAA5C336B006ED66AC7181575D66ADE21D00FC8C7DCCA7DC9E430D1D086F2922487B5B025AD38750B4F60993368D829CC361B600ABA990E570370AFFF9BF171610F2A0B0B93A0A3AC54244073A0E816DD691BF1B0041BDC165125A14C621E01C8F069C3E05F48FB77E66A998C27A87FEAF07B5912B303A98AE5796F1B5D4E2EF52F38E68F0EC5786C19ED93612D7152BCF0CA1A3044898F9347FCA8370CE6E4A0510750DF6A42C1C35FDBD91BD2A26A60FB229CC35FC45525D12A092505D901A4F9E1E8D42D25C41B8FDBA13AFED8BC5566D4F3BA13A779D7BAAC1E25B6710D7718B73A641F23E1D22CBDED3B7BC3AF7D92B2DA1CF874D908CD8590C80F1D5055CB8228AD964DE099A4D037202C65D197A35D8A268D8A3BFFFAB39B93615DA295A09AB979AF925D895CB60B5DC5580055BC4347F0DDCB1090DAEF46C8ADD1009A5126362B0B4F1FFDDAB4A00AD8290EB84F76AA345DD73FFF7733035026E3CC1D99428CA68ADEB8CBE98E4A630F99F4F33E8AB66895AE7435D2E84EAC95CF19E9B440373EC0B4D4B2CFAD672C7FE1FE8CE5F34F55B016F8B115FAD6CC7B53DA7555E67672FBF6BDE324AA09FA18F13D9FF1041A12B04F30304774B07659F397554E66CA589D9D9F1F262CF659F718CA7F443B8331BDEA8C3980045562D909EA44E917FF5D47812A0390139B2A87D0", - "80B35D641CF6EEF705D51DAACE1EA5EE92057FD497B0D937C7CE9A546BB32DE580F8E434D644F191798A518785BFB9471AAA5D03700CB0B7B2635A6A14750F03DA4FCCB1B363C254A5294DD8E7943E4CDDA318C4B92B57B14EB0F8EB250686CE129BBB2B18EBE7FF53C9DA9C0B664C527A3C69D905CC6FAAE8BEBA7D83294C1656DA4B8308968EE49DDDC2D0C71A17B02053027D7DB8F4E77E3AD1C80FFDBD37938876B671D80E99F5F1C7BAEF50B7E05CC0CAB8979A3A2A852A7018673292CDBCECAABC74B839FD3C084682357A5414E431C1F25E34850FBC779285854FC6AFDCFB7B7749E0DFFF5F93A8AC146C873B407F2CD6CCB461312AE35DEE8D6D51347B0824156DDD60762807A5C132C0667FBBCA7489058C47A156B2A50CA5C24B894C1EE7C44B87179176905B7657A8E95AF7F2EA6C6D2A12384CAC9E6D14253DC5C31BB8FDD2462581C109D2DAF72238E4B63F436DFD7DD5571548D2206BCB8B837D8CE8C9C3B3066E46A1655E3D84AF42DE1051DDDEF438821E0F0C1EDBFE148356D707036B269C19C4CEF4C4BB4048364E2A3886E38B42EFA15F22CC8F92D802EAF3FFAF9BF45247DB76C03E99F662884DC2A29EE488023BF0EBD46539DAC307410846B25280349106CBAADFD658A066C3664E35C4C696726140275AF7611D2369ADB8258EBD2279DD24DBFE002377B9A3C1B120890A6FDF20597417F88F15C", - "ED6621A6BAAF64578BD988D08FA8D3D2873C87C38AD7EB38C0922FF3F7E59F0A8DE00744698939D42D459E6105ADD3C77E9FC4911F572B3856C9AF6C15ACE704F026C6B2FC8BDCD9D84022DC10C47E11E934BEB7E1DCE8B6A2BAECD384D810BC3AE587E7EDE57CDEA908DDB020885624BE042DE0ACCDE1511CE38AFB6C9DD812FEC339B8137D88108F07035A3869CDCFCB9402CF96B9E331297B644DB13DFA88F60605E067B9F35607D2D75573E0913F8080EF603AC4B7133D836B84F32F48534237CC559ACABA53A96885D297CBB572BAB1C3275F7CC7A3AAD10F29E727B28BC29B038F4003F8C93FEDC88C63D72609A5330F36F4986CD9536812676A89305C6CE58D4C49C088B5E273F2AF77A8D31D1B8574B9DF02CAD4930D7A7F76C067E7160ECD1A845FC6A3B508708C279A2C94F29108FCE34A63E5D5554FB530522394BCA00508DDAE6039ED9F47609781CC60F6E211BDF29E6F44ECC873DD24F1D37E49D7BB7D6279FA7B9D08B5FA8F9364EF6D4C8D129A5A97A8BBF17DBD5E64C4A31426881687BB79285B09290DE61AE40C295CB1BF3C8AF756E88068A777ACCE3C4B6E78C62AC1E8EAEBEED0AF3153983214D7459AA8E254633B52E5C0ABF4647B906AC50A62543710EE92B335A7162B540AC70F2B2F49FEA892BD72DBFC5F7A35C3AE56636AF2887BE680FA63768C27040E888202F700007DE648482F5307C56", - "914BDB196CD56E3B7D7D3F1D7A5E4B0A1389578F111449DC2DF643E6E29F688227C3C07033C2A3818342B229F63C229FAC11EE1AB6F0FCE8608E03B46DC983318DF15FD8DBF2970EB342BE2E534BB0455BE58290A48FC60973553E94C4CB53566CE0250D9FCF055936523A8ABFC9287DB9DDEC54710859DF62829D2B6A100358EB64E6219451868D6BBC2AE4DCEA0C0E338B26B748D4A1A34AC16233046CB7D346D0D79A3CCDD4CDCB435B9B3075AEBEDB4C0F18C5DC006F5C208D882308510C75E729D08C779CA99D5A685E78D5628094AD137BAA635B7FC0F492C48A9CDBE63209C8231455012EB3E830B5B2A79ACD8FEA8016243EBC85BF5D6F46A48FE013D2B3B789BC5F743200BCDE03995BB2B6A640CFB099788E380B4E01D75409A8D8B3887DF2B1CD34960091653EEA6C52EDD745B9363BFFF666891D9C8BF511C3C07D38F49DA2892DCCEC81E1722F6EACB3214E3335C93E6141AB94E5EC31BABF8108F6BEBC3E60B1BFE37579B4D5DC8B77A347940CC1F6BFB5B46097B1EEEC4C354159BB3475E05FAB6BDE5672014D9489CB70DDF537F7209BB9EBF1FC6B8B94564AAAD5ADDD83CE6E51EFCF73DC6080D738C4FF1CBC87ED420A0B92FA459AD7BE58789F0A191D149F88173184A22874DF6D39DC1BCD4413648B178ECB03F8358547A68DE7B672BE9BA1FFC8BA392F8A58ED2806155C00F86B7669BEE4220D420", - "97051FC67ACA30E8AEE73D3A8CF38BB13524D4E0EBD9BE68398C7C16227CABB1D0B0A0ABE7B6384ABA02905BA0C3C7363599D059C7B4C99DB165CD14FA12FA7912449CA7DD5E346D8010C85A757382270DAD15BA3CE36A76EF55F81A1E80BF366B37FE3A88EC722028C25E234E624040450A99CD808F942568AA7133981D72E7F2928894670AD5399482DF1B90E7E64062F830B736C79C30F36281495C76699CD48404673FA334F042F9E0E67DD7F3853BF71ABEAF6A9A5546855E840CE42B224D8F6490C6CE5FC02EBAF4FFC390107058F54CD635D4A7F2878099C1EF495750E6921BE2F39AD808C4210F287319F811A254CEF8CF153FC50AB2F3D694A530949E5F578D075DB96DDCF2BB90ED3DE09D9CA8E08662FD8982741DE1CE0A6B64C3D3D5004B5C04B2B0DFD976A20FACC94D1762D41EE03B40D2CF367612812EF4CC41D1BFE9CEB51AE3A22AF1BE7B85A057D3048D0E73FA0FDAF1119EFD76F0A41BE63128B22D64A5553E9549D411483BBCA1483EF30CF6A6D317AD2C7973EFA6D4C1121F703D2F48FCDA3177AD450D75D2A28D2C244AEA13F0E60AEED8ACBAB444D400DF5E280DB799B2D9A984DF1E2567D39D1DE58EF78CA6B4D8BC172B07DCB02D156CA96EEFAC69E556CFCE0AAB617C7FBB8C34871C1D35E74B7BD307D3F2E424C7A9AD676A1A69E0FE735EA50887A1DFAE6CA2FE4460FC7EF323ADE493020" // 50 + "F5D710130573541B9DBD4FD9E9B20A0D59D144C54BC7935539D2E75810FB51E494093A0A19DD79C70C5A98E5657AA578097777E86BCC4651CC72F2F974DC766E07AEA3D0B557EF42FF57E6A58E805358CE9257669133B18F80FDBDFB38C5524C7FB1DE079842482990DF58F72321D9201F8979EAB159B2679C9E95AA6D53456C0DF75C2B4316D1E2309216882854253A1FA60CA2C94ECE013E2A8C943341E7D9E5A8464B3AD407E0AE465C3E3DD1BE60A8C3D50F831536401E776BE02A6042FC4A27AF653F0CFC4D4D013F115310788D68CAEAD3ECCCC5330587EB3C22A1459FC8E6FCCE9CDE849A5205E70C6D66D125814D698DD0EEBFEAE52CC65C5C84EEDF207379000E169D318426516AC5D1C31F2E18A65E07AE6E33FDD724B13098B3A444688389EFBBB5EEAB588742BB083B679D42FB26FF77919EAB21DE0389D9997498F967AE05AF0F4C7E177416E18C4D5E6987ED3590690AD127D872F14A8F4903A12329732A9768F82F295BEE391879293E3A97D51435A7F03ED7FBE275F102A83202DC3DE94AF4C712E9D006D182693E9632933E6EB773880CF147B922E74539E4582F79E39723B4C80E42EDCE4C08A8D02221BAE6D17734817D5B531C0D3C1AE723911F3FFF6AAC02E97FEA69E376AF4761E6451CA61FDB2F9187642EFCD63A09AAB680770C1593EEDD4FF4293BFFD6DD2C3367E85B14A654C834B6699421A", // 01 + "96B856A629F581D1344FEF597835FE60434625D077ECF0D95FBE1155EA0431979E5AFF544AF591A332FDAEF98AB1EDD847A73F3AF15AAEE7E9A05C9D82C59EC325EF4CF264B8ADF2A8E8BA459354CB4B415CC50BF239ADBC31B3A9C87B0843CF3B9E6D646BA43F866276B053826F3A2334CC5E2EFB9F8F195B382E75EEA63F58A06B3F82A3B5C77C1800FD9498F803E524435B321210BB84690BED0BBBE16D363B3A90656A73720E27008852FB7DACC8284411B177728D9527C560859084A395A6F11A96AD9DB6B43E00642B000ED12BFD967868EAB1108552CD4FC89FBC408ACE7678C381EC91DD000319124EB5D5EF52C4CAC9AADEE2FA045C16CE492D7F43743CA77924C78696FCBF2F9F7F36D8E623752200C6FCBBD71ABBB6877F3C5D6E6740AB0389458A6B66440858B2D383244E853646FE2714211DEA9E6196252815BB704A20BFE556AC474F8998944E0CABBBE21A6400B87BFDCF937D12B2821D59298AF4AD378F0F42BD8C41693B8D993CF37C8B478F3BB5D33AD2A9FA24AD7B8FA895FDBC04964192F7BA3FF74E0E3A435B5DFE042E3115CACF29624C0645E9C917534A2EBC1F5665E4E1B1BC56208DBCD8A27CCB6474D5D0E20CA4072C960E5ACE41BDA3770DF3B681F2B318F6F8E1CB17C2857350FB6009AED665E13B2780D79217F73FAC7A8A48048DB0FB8A8A5007CDDC9A7B2DA8257C99F1CB605A18204", + "E57DE19A3E4A8C122FCB1DD6584B3D2DAE364D800F9C5A9E957B38F624CBD3ACC58FA3ED070B5E44857CCB813FBC0BB83B5D157C6C562422E5963CC4DD753C45B0264F8E136A0F1774D77A543E44D51EF8C6B9408B6E3B5CEE1347A94F13ECDC94DC764976E5A50B4CB0AE7557553B47EDFE03EC2CD32EA8D125A341E1EDFC77E75330D6E7B23DC838EBCE7E5567F5B8C80C3D15E7404B4E10F0BEB0C69626A814AF91334199864FC77E0FF548DC2A6FA6A71C3C0561F2B085CC05E8512E27B9DBA60B93D114B87935776C8E9A67905C429D48BF3AB1B0A56FAFBFD5D9C8D8C8A9E5918BFF273CF5E8664FF2B90314BDBFDAD5AB8C22A0E45C104ECE75EA43FE9BDCE306A5A28AE464628163D249D8056005F1A900951808CC8620F81768153436F741667A8E271DD986C7A1E5046FCC74C7CEBBF9A1296D6CF0B2FF85BE412D87214BB368DFF462AD649D7324A117252311C664D33E4DAFBD830FBCEB6EFBDD7391D4BADA7A775FD1949D981F619655DB3C22BAC34E5AE41222905C0C7E80D6EA28471EC0468756531C09A471EDBE200472E78F1701FEE96E5769A9893C0F11E7906B064442E06E21ED8B0D70AF288690C532A2D03B373E1E0085F62F7AAA658B569C5184E3DDC40ECAA88B887118601691892F9F55E2DE79E49DFF11D434C2BA3AA6447522A7C99DC215CAD2ED0114ED62CBDAE9D315E48AE14D2014B7F8E", + "C0FC4C72A12023BA7093C86775DF3D2F42C7CEDE616876340BE4301361B9DC9DFF4F1DEC6A62E165927BDE4F809E969AAD085437496BB95904719820F4CA8ABBA0B84C34B06DD7E268BA10E386FA7DB9FCFCDAF2B6AFBA46A8A299153B4E11582FBA7F28F0A0F9DE41830AB33335062C57D81DC361EDFE491939100FC827F36273760043D1C35B74E36C6C4DBE1D307847D55AC07D8B212C2DBA632A86AB15BD0FAFFA43070644C7E50623195A3796AA8E8D6E4E964FA0E4488A500B9063FBBFB1204A0E33C6CF2879AC2BA7C86CAB57E3E8A497836194E65C5C39B950F1AFC3B58E850A5EC39F4190D55351D16529CD52B36DF4A2DC68EE202BB758CF19C54B0E1461D547B5D06C2F9DC09C2B15458C3140860E4C6F3FE4F417FDFCEDE00F71212EE137E6669E569A7845470CA564F85CB4772808D65D2B48D409B709BD7AC5F7E28AA804CE9DAC3ABB5A5B768C6A184B5A974E933F2C1772FF64AB26BA2D5A165744E314EFB2238AC4858A8B82723DAE8865478EAA261F35DD4D98A9C07ACB0B822AFF1AD3E739CB214CE737196FEF2DD0B0D45BAC423935670BCF71C2EC04CCB98943786173C309E75A02BB78A788A5E6F8A8F407E57B8403841A9E1FCB3A7AB80D1F6529770E52C173E2C47EDED4400D5E665E325ED845C9E8D0E66FDA16B17D61EDBB336F22688C3F0FB040A55F33B65FA9F3D45F5B22C445CBF9DEB22", + "EA9596357B343DFC31D5875CC0E94117A33651472E476D3892D8112EB6CB6E0151D409C5A514DCDA38A773C58F18B590EF9017B6EDF0192AB7EB29DD6E1E7E7390C13E9B10209D5775F3B066F7B2DBB7307FB44F726DD2F368A5FDBE75BA7248762E1EC7E4589DF1A353A16D6B3CAC1C9ACDB89890ED2C4F44AFEFC763DB51D102230C37E1ED0943CD6F4176B2F5C19119588911ACF81A7A29320AD579C1BFAED1A70DEE1B87037138ADE411E0BB92F5B3148DFA11F2F84CA6C019124B922837503AA9823A97E443A66378D5CB3130A7EC9B05670E85D095D5E6F603092C632E51FD9013FE7FB9F08448FD09F1219A4744CDAF82BF9C60039C8185C7E9559FCE301C6D3F46A2E514AAD44D3889C8CB4ED7439BF47019194F2644363770F8BBD0AE92B6F5F43CBBB503A885239DA636903D4C264B3FF09AB77E3FDBA7EFC63E0792B6D5183759E57D8A694CDB133B4A9E301CEEEB978050AD9A9E410091AD29E389829E2F24BE1E3B24F4540C4A6533EBA72E8AD540BAAE43A0CB82F971F3A51DD77FE9E1956E2EE7553E050A1D10B99552DDD5B68F2E2859712835BD2AD6B08881753B4833FB04740E3364D2CD4921B939393E7EA91B854FA1E5A8EE79FF0A83F111F78435481D462E0E1CBC0C921D190A435A1BA755E4B7021244FC5E3F0630F2A1F439C02AE619393E5624834B05ED7DEDE5F0AFC7A40899424E75D4EE792", // 05 + "90E92279CD4F60D98F6E8FCB3E9263DB60FAB146A835AAC2E96B3BE3FF07119032DEE0521C731117E90C2943B389DD6B65C5E21C34F86F5A7ADE04072DFD1479EA36528D340736B0FED4F6207BE9F6CFC971D5EA11781AC2DA25DBEEB6B903EF8BB0AC0CD2E29F94B8CB67874A7B7441045758E09EA061181A50E0AB7BCCF801554E0644780BC137436E3FB7784C182856A790D6943BB53DB40D13D6A2F7B83A5C521073883B90FB8DB1C0F954D132943C09156A09984B822079FB8FD09BC07C1D6336C7CEAE8CC3162760B9838CA6A38FD0044FDF099E416D57BF9F33A551043F34EBF9BAA90901E62D2D981065F977852072F692535DDE24EE8946387B4E5B0FEFEBD75552C1FC325A608A78079A9AC864F2F30010A3304CB16A26AF98D9BFD3B8D128541190B2BBEE275A6F53B9BC5108306985ECBB983B56E34F18B48A12AEAB88271F4F780CFDFA83E05E35C12464F4350597CCAE9B4498F5A5454DCC3218D3336763674934ADCBCB5EA52891EB240C362248226DE64899BE30735F6495E94AA61ABEF62B803C57FDD045B724ED1966B6E7DFDFCA5B36F7B0FACEDAC62DE8E10B12DFC84B1A9CEB407BDE63CDB5208ABBE5E066AAF262187E94502B1701B2CC8681CB616773DA2B7AF49443CFF528F45DD7F25959836771908C2519171CAED2BCDCFCEA46301E7D99A5AF7199155772E92BAD85F35EDB656F0999EE828", + "A91F570102961D62CA6CB55144AFCCEAF3910F3336DCB029CDCBA164ADA72732771B6ECD1C58E49F468A2BFD23E1B996DABABBAF5AB3A4C74926187B5833006F8BEF7F9CD0F05A2A0B9BD9073C4C3976E8660CE7BF81634CF0B31C3DDD806A6A0C15BC552B83A86789CC675A6D137BE27BC86DF68FEC5D268119EB9E965260FE1F5C56AEF60A8622CDA8C42F24CBA7F5B07A7416917277323314AFD3ECD10F74BEE7B22DC760EFA7F935FC9963411353782547FAEED32E69A4FB5756C1A73CCDFFEDE50F4B2D9B5D2ED5C59C9A52D80CD27B989B8DAA14C569E763C08FD42358CD064B2DE0526607C9536D75E1617EC80615EF5EE2314FAC29907B61B61F8696CB80B14B3A0148EEBC825C91150A08A23FC7B38B5982AA02A18BF6E91B3A1F2EEF360F682A34AB36CAFCAD556841073F219910F7BC2F07CE45E98F77F50475DF9EDFE2DC9E3D7280193D61AB5076A14887E9D9193C3B83C5773BDECA067CA1BC3D4561C3A8B4E30072A6269B529760CA1B5FE9D3DB2B5D1202CE8B18E9E2E80FAFF47108168D3C7EB3C940B1A35A1D1B968A5A9DC0686DD8336E498C240F20871600FF995B9E33169DCFCFCB58E75C94D82F843C60A7118F0D7B40064A8A4176C5158E86AF0BE4C1D5D73D1C051132A85CC0628486AFD660502A515D6353B674B1D4E61750C13E8A3AD48FE1F89F201C288A8F443867C2BAC23C706EE7A2D2C", + "C6E00978E351164532EEA256ECBE0D4F8FCE02A276BD19666DE93936F7A242FC4C7E879791314B043ABF1D5F9B0036ED22AA92028C800C4D62BD6640431170EA77311865074D670AF2847AA47CB94584A793FA82F51574BD7C62BF14386F14A3D7DBD129FDE64EAD67EB35D5E13FF214D7D163B770D4A77A62D02D88C0FCF3FA5EC306EB7F85539105FA2CE5F53D182E58FBBC1C57CFBCD2D2F7FC8A067D6FA0BC834DAB8F370B0971BF6D068CD4D3A32C11C6598DEBBAEA046528C5EF762828CC84D003847069FA18743A809A004431E83924B8FDF0AC78699B905ACCFF82E83FDAFEC8648DF64042FC9438B261B73F0541498ACAD67D702AB631BECEF8680D33CE8F4F0CE29B95132591A350DD68B36734B97D4B3E84A76497F702312F2A8370DCF26A7C3C8EB91DD8699C48F551750712683E0397083714A6CAC3457C0FA70BB3A036C6E0BEF24E6B20BA5565B351C2EFD56BD9455FF7728BE07A097208E73DE4CD0CB4E215B4642365123CDEA419B28459D50E864B762554E7C1D7CAF73DA7D40EDEF5D824A2FE1A6CA473B07370932A8A5D441DEE3C9A60DB68E27A9D3E9C8229B44E5B434C6D18A8CADB6D17BC4614DEBEAD670C73132CE2F999C8716D1098C69277E8ECAC546EF8002E5182E25F31A354DF112E97F8733DD20893B430CD7130E69ED4A0FE4D6C2E4FA479001E42EBC9F36E5DFD3E0BE35A64B89745E", + "821BBB3FB91E50253A9E71AC379ED57AEF394C2CC59587B2D0337CE74002EEAD17AB5D504BCA68BDAE9061C3DBAE2985EBE292B9BEC9D3542015225F44ED3C2C3FFB036A515BF33DA1690F3438FD225A5034106C5F4BCC43301EEC2245D73F63038E2A7D9B8CF95A9FD813FFA071FFDE423E0CE737969578BEB909764A8D6DAA9E15A4FA0867831652C0F6E9AAA39A63F0AEEF62A433476CC7380460ECFB8B7F3B2FE8C4C42A3EF1CDB808FC9747FB4F044B3B47A4EDFCC9463ABB72C55399B2F79EE5FEDA270D6358B27F8466969DE4A5F2E6A5F2C4CF0813C09F468DC97FC0E5DD057A8A0355767B698F8A79BF0350C4200413A15E6591DE70A1B502E19FF515C3DF36935974A4764895B9E3CA2626BD39B7ADB780AAF7E2E914E804CA923089A51F3876649C73CA3C2623A8C95D11EF4B3F941E9772EBA1F47212C666F03F01509FF699F74EDE27182B6E98AF49D1BAACB41A328A8C34D6E8AA3553DA3962B27B041495F269328B6BFB4A385CBB118953F3F009920EC4C8590003290DD60AC89177BB8C4BF753CE723AECA392B8D9E5E9E4113DD062F294A77B6EA9A0477E697C04C787CE78A92C704409D37D37B6B392128698D0D8D4CA101EB38B92F467F0D86EFD8759A14162CAB55F8C457E82392790A5BDDC8DD2663944F880C95EC02FE5363B064623994EE5D4396C0E44DE2A3D225830BA6160270BCD110A942B0", + "92A0DEABA9875D4AFAF99A24C1D5F10EBBE6DEF9CAE5B0C85B2A0417C1CC5D1A5F71CD8F8A4B013C3F012C0A19EE4A23106CAB8662C5A2A93A971D0B6E487FC05BAF5C355A9520C9148584CFED3EDD0F38696E161E64378C831C586D9178A0CE289A67F33AE68C02A3CD138FA09DF1CAD01EFADFC8BF6F5407B79B18D09C82804736752D08A1FE09EB35F544E9F797EA36DB493BA947AA82513EB1615A356B5AA4308B0B4183E070EB494D628159D2D4BC3CB110AB0CCB2E9E73B5B7EB567187621E72D99F1FB78565917B28464A5F29DD8D6F98B6ED703040A44B0ACD97F15049E009E8533FDB0B6DB2F2582E6BBF81D7B0EADC8F402508F6B8531AD13FD1C55978A8A70DF4E053DD475132D348AE27581370EC14A3E0F96E0D70DA4946DEEC0760011404FDC5B436CA7419D05895F5E0EAEEBC88C74947733BE9919F18CE702887A6C4DF7C19279B82FB646090822DA9CD9C7653F6B931A337A28F7A4A01DE0CC0744F22961045F8EF8D4B30B07E5EDF5FA944EDCFB9841A9088AE82444FCB6E90B0E9C567A80E8C42EC713D78132F37AD1D2592C31C93D2EAEFF38AD94E5C0D94F949F47B88B03BC1EA4E5EC9C7D9DF19ED208B8E44FFDEB0B625F633C7DB1C826AA9E1C1309E5B14A0DDDB79714DFDCB52221CEAD7E8A140DF7806F127156478AFBEE922B8ECF322D66B48BEC434299BBB36B3BD9030467B7F2EBBDF358", // 10 + "AFA7FBAC93326D0C36A388831B99DF4D527BCE7C9070F7B46B5FFCDEB07384801AE5F86A89934DE23DFE2C1AD117797D4FA1BBA6175823B41166DBE9D126F17B3761E2C352AB396A5A9CCEA42A5E9EA1BE3497C0A5BA9121DB97F64159AAC78E62D7DEFF3BF4CF73F8CFBE045C9D39E41D5D208DCC4B47CA27E900C3CD8FD1408DC5E0F5114F2FE65817D37CD1452C4967ACAA2119FB8D60E5E2FD8A820D0AADD88B94D40435C095568AE6394D3B97C835BA868A83083316C49C75D36EFDD85165BE74A4F2B2D21295EBCE085D9C4A4758FDD9CF71B97FDF34B7B63A5E9691DBDAB834D87D5B52CA9A53032FFE821398616EA92625C2DB633E37911987083A3B49A86FC562FB1264A75643A5FB6E97162E16ACCE353227FE61A859E094C2359BC4645946AD12AE5C39C70F59EA7B597A9B3372C23AA578146781A61163C92816627DD9C4BF1788087821F9F5D41B75A0F251B06BBD3E29ABD41E72A1D48323D24E2AD6F11C2D49678CC04FCF6B0EFD33BE6DDCD444F5CA02FE158112631F782CA7B0C5F3607ED807495BF8E82C5EA51A922FE28C8168D9844859E7A3EE3038C5D1D4BB4B13406C340894DF46406836739E31D01082BC84489592DA0E985630CEC40702A36DDC301B3AE1E8101786FEDBF752F9E175287C239C18FC25795BCB479DEF59C58C373313C02A1BC5F16355E2B50EFB58855670868728B902653ED80", + "943CAEB680AA3E630755DF32F406F403D7AF5E48A710274D3887A7AAC8EA6744B889F2E0CD2033DEC0B434A9591254A0AA68C5C9BF11D35765E86B437497D84E5DCBBC0C0C580CE9BC50EC6382AD74DB02C2C233B7BB07517D48056226C505ABF2DD244F6BBAA23313D570558B065E42327768078EFDB53DC465DA038E3B216D990EE951B3E13D3C1CD559998F77BCDCD2B9522B6F1DC5E12C912EAEF574AFD69C251F9B2532501AB9F4B3B2223D0F8920BD562B0D358A14AB0D196DF6337D1C96CDB47AFEC6F81DED4B5773864DA32FCCD06B9AC53C122B2C6327E6E5EFE227DE4893FF15BBB2257FAEA836E99676EE32BF6FC14D4F56EA191B8A3870374A0867C49EB0015D1C6D07B87A36BFDD1DCEF20EA7B80D997CBE2D83EB5630F2EE6F73B0D50700C89E4F32438F5541360683DF11DA6E7A3C1E7DB2A87800D9245BF04278C990A8DC9CD86DEF39CBC6D4BC00FF13BBE132F9D86681A8913BE787CFC69C35304824788716D52DC74CEA399E06DE6241780447C74DA8E947134D8B2FAA9648D6D5F34C9D60AE5973B5BB0187796D589C8FDDD7675671F28C04AC1038D09251980683CB712F694D7C5B0D5B1DE86CD10EAC4EA04A55BA8803D78249BEF516D38067890105A23212E72879FA267A8B4F0455A81F17CFD3E5DDC55E5D4FE00F83E18626C676DAF00E6AAFCC23D209DEE0B0FC6C2AE4DE161D13017ADB5D8", + "E5E70E7837D094416558C044D758383EDF5755C80921218ABE76E51FB93249E211A38FE6D07A7DFD2263E6E3D8DA0F921A06A606B804DE7AC3FD097E5F96EFCC0F544D623FD6F43FB88CEA7C341E901CD47A7E24AB141E998FE41CA87CD6CE8C1870D9ABB6503BF7E8B659084BAF2237DFC94F35C9884C7F44B87120BFCB298696E613C1656AC4899781A94869EC603B4D38665337CA8593AAC83AD8BECE10302E4B4694237E96CCD3AD9CD5F8EC039A1D1A4210716371404C5C3FF375CB3A33559B1C1A239F2E442C8EB033501BB290434BE73489F716965393989422CF4D57E5B4F3C76AF3C5E8999E61805134B9D7C40BFB59D0D0FD30F98567E66D6148D6AA64F74A22C50AE49D6B1ECC6BB5A002ABF38FF2E2436766B86BDDE7D95DD6E02AB0FF06E7BC22CEC98D55AA2BC4D7B91C36B2FF9F525A74423498D548318509320FCCBCA582A6C2996AF6538422FF0DF060C0BC7356B0850A139AC3914338127B786F4BC58CEB6064DA881376A147DFF53C6700BD13316A5874A75D7B9713DF54FBB393BAFAAD7F7B0710C049A0B6A8B76A9956BF6185BA39D9C347D179FBB97D4FED68F47DB5AC8E0D40122EA51C4A1F88D23153DF651A180C2AD456ABD7F851B65B220A72BA48FAD0436332E4EE7EDC554B7D75481EE05C3D3453D760E9099DD27B324DD84C0C0C4DEC4C674D25284B16410F959FBD09D9DF09CE875601E", + "BFDBC82ACB4FBCD5A90C5967EB2FED597A02607F426002128AF4B38942C85AF4472B3CBF3B183F240E049B251713740A31117F108936631FD0F11C5F79325BD6677A2C2B242965AEFC147D93358730AA782491209CBE600976F56030753CC979C240A196647CD9EAB1DD0380E59BC7905EF740C3411AD9DD72027D0D3DD6DEB0F5F3C18F6D6F7BC59B758E7E262937B4599B38567C147ED2689BA2CF23736CAF55B6925827E2B70E47D3813C94C85298BD6B49C97B5D0221BE9E3164B6FA3D95AECF53AF170966090F19A69E75F188BD2556B4E8FA7DC4AC6C34F54297C06C2A96DD1C45B42E6175B5E8784568F7FEF0B6C124C5019CB577B374941E8515CCFC21F46D188BDD2C2284C688879A5BEC50CCB97FAEE1F75580577498D509D3DE161BE216C873B29E178CE17DCACC5E9E2224D05ECC842FBEAB82A75AAA20769FD81131CFB69D5E35409273CA106FFB27F63FF997CB500F161F6DD3A8BFA5719F004EC17860152D3290951678A131E4F3D3AB34CFFCAB2967ED9D8F1BB987950306BD28751D2AEAB05F071B08574EFCA01E5386E04F727BF413A8279E9392EFB64D9AEE00877C76C81EBC861E2B484A2D35E592A131726CAE61BC010B954721A82C968CC6F384D9BBB99B4E87846D10B94EE31F64846A5834DF73A67A267B894B1C06242D750F15F3E1E850A11CB2E2B16155008F91493AB3BC77CF9BE56F9DB20", + "D64F3D1CB54CDB9143D9E701BD313779C09DA064D9A85674CCB53B0C5B4446C122098961D5EFFD6A85537486D5EB26B5E18FFBFB8E6EF16C2DD2C02EC7C07DB15CE33015A636E225F744C963BF0653A89A48F1AF04819E273A3AE1F5538AD574D553C5A0DEF47B552957037BCA921970C76DDEF74BA083ED55363760A6780612C075964B083B4F674EA0012FD1DF09F0445CE75A698852098206868AD8241E3B319FA8D2D86DE6E7631DF1AEB571F9676323E0627307F6D8F569536A758DE5EDAAEDF80F4335E3AFCAD07F70AAD5CD08CCA1E71B84D4D97931F924AC0010C0811972ACAA414B89FFF7917E653BB31E9CDFC72595066C662CDB9BBC96152D46BF4E8C15A8D34809C4B9D79871BDF0B63FA294F2D667624F6E0210CD40C92F1C033C3D8BF089EF85C4F571CA727C71B23128A9B0FFD70CEA93C316FC4D69D79B089107F292E03425B2552AF5AA18FDB9AF86EA1972B66B1276B09119437E4DFB8F8E3972D91A93816EBD7D8D715CB47EFA742938B0B49FA27A291B0DEA1DF0B8F878332103F45A99936896181E51FF65C6995F57C2C54B8002DEFF54B0EB3131EE7D61030C33B5502C49CF398FEC4B7615D16FCEA3E8EA12BFB311D426331A06606CA5A066707C4AF8D1048F1CA6065FBE506D06C6C00D5D250E227265551867A6816F05155FCBDE24D4AD115BDA98AFE08B12A1F32E7C2ADA801FFB78BA05726", // 15 + "9D6AD9889EA02FC9A58949290975DB0F512EB37C8156CC9F1242B9E45F22CC1D6ED1CBCB6CB245811CE729261641FDF7A8F389BAFD7311B8BD689E02409F6E8C5202F466349EA466E5398B29C8CB126D9600D89697A07A6900FE8D95951903DAA3419839C2D9E35E9F4EABC04C9006EA585F544C7163A33D7E78DE28256B7B8978FE018CB529F7F79BBF66DC4F0DECE80AE3C2CD479D78C4480E4DE2F06C70E5FEBDFB4ECAEDC2E7BD891AD6C91A7C2446F1B13B340B7160782F6CC5B45F9787CF1B0985202DDF02EC552A6DC41325FD8D31A4316C13C56F7157134F66E1D103CC3AA7EB951C92094EB4409E6E7BC494434FAD80999D46D824A5A57390599052025F7DA4838F7D16A8DACDAFA06D175546FADD1E3F7975265230F6C01B9C1FB1B7AB1F2FDD43A5778E3C88FBEA70575CA26D94D249670E4D9FF28EC67D15829776D7BC6754D2A2BB01554E5FF0C3FAD8A1CB546E8AD5E5314103D086D14ABD30EA95DDC591C13D96C1CC3F60FD18D216B67181B6324AC09A97C0C45E50EE8380ED42F6E0430639373E7760C708248EE7D74830E9594114879748883F247D056B2BA94A0FC54CECF6F5C6AB4DCB7CFC8C224F40D886427504233DDBEDCE160DEFDFFD69EE2B75746D9CF71676DC453FD01C315ACA96373ED387B040BDEBA7FF3CE00D915F90AE6E1796971F8052160154E8986913AD7BA291188EC49A60BE27C", + "B5184F7D580935ACFF18201CE8B5D54CD0A1CACF102FBC8AADF391C4CA5807BAEEF4E5E47F7459E74485E48E0C42D27CADE6970714FD97C08F9592FDD387C859FC12C1CCCFC3EBF510D66FBD8C448C25A322CC5887F94A55D48ECA362C690F24833C3B032A047D12BDA2ADC6824A1F6EA9320BED27968E9CFBDEC60D041EF538F1740C0519003FAA89CD4224293167E05344998FD396EEF618E8F547990BC06A8B76D0FD6FAC13284601AB7191CEB813C46C45CE7B3FC09EDF08DAFE136BFBDD63E6CE7E4BCBB16C5DA68AC71A1298FD27363349A261C2F2CA8CB799E8604ADF70092BDBD6A04CB80568776A537AD1711891B251C74E42FCB095B23EEF70F167E8B4856BB7F92E3A43C79FF4437262DD70BAF9B16CBF5F10D1AD7559AB0F8CEE1B9FAD058E84FCC342D9F0D9FBE4207D40E281416506242CA1B8DAB28DE88D2D00BA21AA7FDDC25940CB29F02811F8DC6850A6A87D72CA9F3476A73649FB4A254B1204CC1261E7D512BFE7B0D0091AD5CB0FBBB765FB5AFDFAB0D701941DA54832FE8253BC0CF61924BCA2CA231A196C7C32A350AC9A5FA2884D8571FEEEDB7D29632E71898BB62B5E4E0104F73AA6A9C6B8CDA816872805D75ECA64F961641077B259C9D39E2F3CCD9FCFB1E6B6E2692EA34336A967E587F32E49B961B91311198A204D11874B4BEBC6C04DDB5B82D5B741D3CEDC03A56A2017B3D2C4FBBD4", + "CFDD6B78AEB21CDCD6AF8C349F6DF8FF8B96BC8246A672A16E45B5D0AB7D992570EC45A534B77F204039FE200D4C5E7C78FE24941F578097B216177D8AD4E1844B2E52D843256D0BE8504CF2D5B639E2CD501A6FE39B8AA7DB7DEA924B38692E43195DB7E5F25E25152DF0FB7E0D4EF63F99CD95F699E16576702B651C29583645070011B2A1F88C947BAE7C94D48EB07A132DB38D4FE2B77EEAFB31AFB442710BD0AE4E6102DA69A454517B6F148D97DBFBAC7305979B5D74D7D7568A0CA56CA89F23D8330261025CC741F9D7A4BDB356B544C68C89CCC2C125F5C71E18C4EA102343AE4A44F6FC695810E6F28C86BF53F4C8B8AAE46DF6006B1679EBEA790266D4D02A2095074ADA634EE60C7070285C316E1F191BC5A88B80D673F144D65B870A65FC93D8B4BB29B80FD58F9FE95F5994878308CAC5394781E4D5A3F5EA2A8ED834EE5BD31D2058C843F22EB778C4C25144193DAA65F9B57AEC4A344713E9EDF913F3CD29196B42E71BB182AC3B1A60AFDBF1112A86A20BFC1D28D3E0DBBABF38E8F12651C207C951654FE8C4CECB6C6F93EC46456DAFFD7320DEC8D08F2F712CEB4D82407D61CC47B333F69310C06EE1FB5ED84F83945F05D4A87CF5A68D78B5536880DE3443E804040E599BC5837E22150C93CC1E5E711F9B889C78C6FF882D80857EF41ABC5F12E99105E6C894EC0B796E0A645780341CBD039E8C6EE", + "ABA759AE16B9D8778FAC203FADF48015331D6499B8CD74BD71ABEBD3E53ED90625E3057EA47BE587600F308D38743A686EF6FA189A4D86E4A35EB798FD2307345FBD10FA701265F6417603365FCC4CE7635924428167115BA372294C27A23CE6C27C506603C5A6618A2B3344BAC50AB7FDC29D36BCBDFCE0D48D088EFD8EA1DE492C543093C30AB7694627C01B334CE3368AEB4BB3267EBB1096450BDFC2571977D7EF78D6E288FCE0388A041838EC2031248F5FD659C70180634A1DC7196C8D9111C75B51C50F854CEC63DEBF9FFE1AB9406735EC3187276DE7CA2FAD4287027956C93B8E84B7C0C3A9C3F7E82B3DB35EB6D2CEBDFE0708FEDD764C839954F2CC9044B652D0A01D28BD6B9D3DD9740CAE39AA52597FFC1227FAD8B78EAFFC31BE94A632A1AA7A60AA5A9E090DA2B62F6DBDFDC50DF6EBE1D9949619FE9B2302248D6C801DD2D6C01FF8206A93C0AD22C6990C4EECA7D4BDF36C3246A5D2D2B3982C608E6AD6BDD85C92682EBDC9E4117F8B7F841239C2A5AD7977E11E4E9CA73A55859EADF7C9C2F1B28A6B4AC7202019230063331FC5586756CEA1F8478173A0A4964D00C1AC099590152125A4D01592C54DC2555E1BA34C7AC039394D1979AEA2BF7B2B2A8CB9D62E89132CE9E3B325F023AC6E8117CE57AD4B271EFB0C172FBFF8FA6A17A490B67CA7B15F865A8AEEF37651A622390E82AFD418C7AFD48", + "CEA29601B96AD3A831646922000BBFF02C014A9136D9A151A0E61A51F9FC2EC0C3A8F4C83E64BDE569A33B4CD653C1345B7CBEA3B3AC0411B6145727B1DBF6066ABCE9DAA8B0DE58ADC2510C02C2619A542A139FA3EF7A03AD3467345D9573C107A13E7FCD43C0D51DB5EC1A09D409DA75462F9C71F0C9E36C2742C279C910F07CFC5CF7F98AD48D67232A2DF29A66B78209557357A4BC91922D4195DA9533CD3501F388AF6EE2BB3AD08BC7D53015059988F5B9BF7824D066DCBDC61CA588DCCF0EBDE4A96632DBA22CA0D770C61A1DD66EDA882D02C5FA284798E12296E89C45906D315EFDBA816FD869DF869A65DD8BA4E0B13C441EEB052EF3D0FD436E4AC68EFC749E0CF4C7E15599D5514E136ABD134BA638A02E9EC1FE66CC9ACBCE5082C8734196BADC21F4DA7621D9FA725362C411127836A26CB44CB3851D53C599B94A5E67862665D7092C43D9B4AD3FE20B8AFACCEDE920F440F3BF5552CFAFAD04A7D7E0A9CEA18D497282D44778FB7D5072832C0B77C4C51F4DCFD7AC07DC7A9863DB8A38F1C003CB852F6119BE801AD12B8BC7393B00640F125C734447DB2FD8B02F7F7FC7A23B84FB80F9CC08E3EF888634FFB6F51ECEE9B20A89941FBF2B49314DBDD67CB7A1B5BD8D629FA327AF2CBB47B5419A0A8CB807D30152FA560690DBAC49D6B043D5BC9D51E82C3B1CF4ED69E997050C65197F3D93E21CBE91E", // 20 + "D358BFC8C6AD1DC94E71D1F5D05589424275875AF8CDA2ABCC6404D6FCB7A2E0A74C68024827E02621C10CD5FB149FBA373AE32DFFF275CF386C3D7A04E3FE10B6F1A6F4782B4823242F29672E847CCE760BA005D6852A3459E7576A254B10A9A78A9F8112BEA39BA65898CFED1179D68211D98E6950ED06399E39433ACD898E2F6C87F5FB9D99518EF36429D447B0EF0C5B7D834ACFA388578BDF60D4B1FB5A0CEE7D1D613BB9B99E36DC9636E70A543BA6BF0B3A448DBDF80469494239D4B7C4979D82E80C08EF36EA67560C86665D458040CE31BA009BCDC30CCBAC50259E4485E570F190613CB010563F6BD24C2F1CF73F6A6844AB8350D23BBC3D1361E73DCE94AF83697BB817BA366C9855A754EFC2F007D99A964125682E6F5CF7FBBF687D221B5A0FD844477A2F87D5370F4469F76073A93AEF7812275FD4F70B2040C12A83ADE5E5D862684D119DCA0F75AE2B56C794968A68566291B731579A1055A84F083B3072B7BD5AC9D520F64F0829B592875613BDD81C11622B331289C98501B01EE1D813C0E97CF36878260F80BF88071D258B9DE02F3F90B4C12BB56CBC731550B5EFDE6D97A1283EEFE61CD6E5DF312D0F0153A32DD65B143EC6A3F2B64E2B8FFB47EAE46BD92A6EB9ACBDD11A2D730D027A3EDEADBA5965198FD59BBC8574B680B96AD48586E5B17625251BF4374E28C6AB956C6818183FDC119499E", + "FE69433233B6067B0EACF1F47BD3AAD9783FA30F684110D1152459233896479D08A976B853E4B7B52A34511239961048B7C1B9009095327C86F2EA291FAC1734ED2596EF19D04528F3D8F2A3430A0C19DA6A70A37DB6DC034BA0053B57ACB9E7C00ED9BD6AC11339EA169D9D54E6739B051AF40EE79A1034D6294261E1AFFCD61B9CA5016C56B2D1172D9B2A7283E4EE0A06C8149E5A2DAA263A5D2429C2B1FCE75C41887DD02E056EF8724645FEC6FE7FC1EF180529B1E894773CF3E2E1D938EFE9CD824D91454116797F5A84746537FED5F0EBF0583C8508EA0745B4989954EBC4F215BE3D515687BCDD5DFDAB9814358B07038E0CB869A8C34F916FC67773191679C60A15A0A399E224D0B0168439386C0AEE8F5EF77185AC847A66D934CB0ED6A3467C3B386BA7F115877F36B49E111DE49E409468F343A98974F4EF1EEEDD282F73013EC2727518DB46C6751A58AE3E0D5F9D2B966D4465BC5595BC31B2712AE1E1BF9915CC0E02CA7240EBB9A045F959E77DFCDADAB6248D58B47BBEF3C775DEFD629A2EED15201A21ADCA470B1AD3084924FABCDAB6B12FA6201E2A239AE8F1BCD7CC39FEC62587E58C84AAC15935D45261E3AFEB60016AFA0902DB98DCFE586513FF70EF4E3F47773635D475754A158FACC9C470921FB0186BD6EEDEFCBEE9C803118851F82CACBF8C0A544B0562E2E27286CEA5FBAF83AA5C1F97A", + "C7386F9FF39FDDBFEB223AD8B856EA2E7F3AFEDE197A61F183FF7DF2FD6DE208E71E6E1063FB3774B696913524F7488EFC2CA54E8B653EF5BCB7A8F4994E312DCEE99A316C2ABF3FDF85B8FA9BBD4366ABBD7B3D3D433C14710A95EBB3D0FCDA2D37A443D62A8361DA78ACA781CEC04542D01DE7B6C6D14CDD4EA709264251D46C42AAF404094286DA5BFF8E81FA2F8C54B172821054F4CED82287F29EA3D3AA798C9CF5C5A909B9FBA641A8D9E310248B0F9A1375CE4DAA98EB62286B4EF4DFC58B877A73D017B17AFD7F1F58D3D2CAD3B7AF2F06699B08B88FB4EB70D2511190158BB4928ED1735C94400980144EF9ED06E06074E2F29325C1AA316A46E8E617B3CE916CFCF05A389052DE120498341EE26A27A3D757AAE763046B8CBC841350292F06AFF97C9707CE5561F5C119E2FF6C137094F62573EB80DC13862797C3319158DDD465FBC033CAD81BFBBBB54D9467599D751B9980A9AE8BFC6715C5EA74859E6A10DB369D5DF83A92655A9A5908228B33B36F55DE563005B886EB324CEC4160F0D18938E9FE41D39234C29E13B814DDCD13CA6450774800924B0848735C5DE076F66EDC973FC83B13938811CD9887371470AC5DD985481185F1191EA8C1D3A7DC65E1E82E2318D0FF0C9AF65EA1515DDC536C5A8BD0AF481789838DA54A39BA56D014E12242600AC78D28ADAC3FFD3600E896445868064D1D2ACF22E", + "BF5202D3599D2DDAAE5F526B6B6AC469D4BA0D0BA5D79B1DB89173320F0EB68F5D9DA495AA0981F8022426F68519B548B19B5F8CF068A6CA1442AF77C83B7D8649DC281BF438F9576F7A719A902A860B9ECE9AE9C14B98859B282010A5DC90DCE612AFEFD44E0E9E7666A461AE50C2656BC036648B826CA9C3C7C53B30976335B097C19390716A41FD437A2098BCFA2B2975F1EAE5BDBB8192024C20136D2542FD89FB8F2F94C08F765109279BC4E511787496233F15F52D7C3BC3E98A6DC39AFA1818B9533EDE72FDAF021E2C9B7D6C74E49B849F372B1A131F4C532DBE3B63635E0E1334C87DDB6F3D73883D2B43E87CF19E40D6B404E581E807E6EC1A94F5261C7F7EFD4CF043C90A1A7E97465022ABAA1DC21588FD285E7158FD9B67EC5FE7C9E84029E961E045EB5227E4726154F4F057FA337BB20DDA25D11632A7995B810764084EBDE01AF07372EA82FBAFE0434401FCFE05CE8FE3C20C01ACF4E9B8EAF4D50C73D5C42A95526CDC8313DBCA6ECEACB457D9673565A1CC0AAE23FD6261A8943E8FB84CCEC676601A4B302A9CACDEC8998EDC847A53B3CB0E12C8B4A7897D5680CB14A3D11BDBF4826C3938EBEEFA0075B6494CC714D3C0DDA2F5F783CF23AD2D2545C899867C1115BF4A4F559F63E68098955550BFA1EF7771598EF86A08C0C634B291674BB77615121BF0838DA96D6E7C53BFE6A58A382FD9721CC", + "BF8903A3918B3FDC06CAB4EF675F7BE3962CD7E3C6ED643386EE533C3B24A3D94D2EA2CFB83F0A346FF2875DB07BA647492D47A807E7FD9717CF12BC97B3C1BE1361E598850B39D50CF7BE700507863BC4BBF26620FAC11D97128049BD96C5E09DC8FF3F62655D660FE66D31AB0B0F6D4F8420E3D2E633C571D7FE2AF1CB4E3BEE95E092B00EFD2796A3DEF376F75B7EFCBB141337D81AE52939D87956C41B1E42C1CCA4317D31AB4F53DC9502A3DC774E05E1ED5008CD931DDDB98DFA69960A6ACD45B60895C4FBA2BDAE8BC7DB8C821697558B1E0A3111F156738409FD180C5A4A33B24C5EE4991B84133CE9AC089724D62DA9D9827A2A04FC103652F216A0895E78A96086270814C2699F475CEFD6359428D8C505BBE8C1A96D2793802219144CA6B3EDB455929B39A3E9F3AB74D685608CE3F301FE38202ADFEF529CCFF46AF36DC24956A7CD07CEBA55AA4C89F7913A8A4B844FD8F152C8A823CB9888E3BFEA97D7E4AAFA07125DA4F51D974A5DAFF0045BCE5B868177A91BD932963451EE2673A85AA8B7D493BDF25BCC2F64AEC3150D8C40C835AB4F5D0B7F259DF099BD6FA9F5CB198B61018B1448035CCD34E7E7A2138F437490026050BBE3CE2D4CF4F4F095CB97548E5731A338CB3903519D6B13A029727F047A7D00904A556C883745410360FC878F77707A716D549ACD6A70A18F9EE0AA8A6EE2080608E10AC", // 25 + "F58CDE0EFE2356F429B0F2F9A7869A4142A6173188DD75B570F1D1ECD282E4AFBAD11370C5B4CCF3C98535D27D73C0111F11A84711F732441EAECAB684F2F0D7FD4FC4070749574922A906E84B3350CDE5957DC388FDA23BF45F05951A393DA253EAF691940897B57ACE655E9630F09856E76958D6BF7B830E0CB8182AE226F39D48036C867BEFA7E7ADBAD17C1AB45297C757DA4AFFBAE677B05677D60DE1D975A4F3D7EB3461B424B67B61025AAC257A69FF720CB9DAC007C50C69A7ACDBBCE210BAD4DC2E629A039D98E7EA037A5C344B5CAEDCDA035F28677A41D55A0E3E6E480CCB12B8F17062A983F4E651B4F7CB217FD06BE46747CD5418C0C81916465A4F5660152B3E4781DA8040D4246F9BC47366BF663CF9DA3BB247D9238873CCDC6FC62D1D8F669EFBA42527112FF4072262F7E65AEAC328871DDF47588A0A0DD13A4139F4145822A5917F624B881BFC354F37B6D59C566823F629A21C973324F7167BC39FBD2C121D2A849308D13DA1A28948EB59F7DE97E364223E17A30119BBC7F43E21E7DC3093F7505055ADAB4654194A77C1CCB61898840125455A275A8F071273D8C13934915D379CC603657D99CE4075C1F1DCAB60B6BD62ABA1A10B5402A59706798002EF30ADED2F354E38CE0B57900FDAD31E7F684E53D097B4313DB552EA66F6D337F29594470D3DC0BC6CD361831251004DD3C5357BC0BECFE", + "D9086F7C272AA317C64C00AF43C924DB5DAC97F8EE3ED2296252FC4756FCE6928BB009D4488B9BAB757411BBA52BA6F61AF1181CC7BBA94257593FA1BD26D52AD5014C3F1A1832FC4F7445C8BBB77C8FD31C88F0C5D4736D49DCDFBEEF2B8301E31185793BFF87CFD9E6F7E084D343AB98BA3518A87A5F915BC0D76B01AF7DC1CE45F1C5280BD39D3E3D94D0A0286F8BD9FA942849664E08F2BE0B93C6E3B89061193FADA0FA9485F62CA87F3E68E204186EF1187642D651162E4D8E7DA049F462362D8C94539CAAD09AE4768C96ED6C2CAB8025EBB6901CBB26865E1F19FA1B193D47ECE390B881233578950175C85B928582D5B439EEF2F56A8C7EA09278E47741051223AC182456C4FA04D025BDB33FA10C48C70EC91BC709E3CB0FA3E01DCE5FE5ECB9018130A8DE5D0583EDD68EA2EF227A612748B2F785A30A01014BD479DEC6256C8AD88470F79DE0E1432CAE448DD7049E5B7D4DF3C978F65E708CA3759AAB9D329C11FAD71204E1E92322E3EA1BBDD9D034E2A23ACAFA21CF490AA5E2E419197DBE990667BCF277ED61B264632F694392EF52F0A27C38E478257AEC8D2542938BF0713EBE60779C95A0EEC8F32A5202A849CEE8CE0F99702F595AEA839531D4CFB5F5A6166B06EB64387552A1F9BC6BB97B9B99D19C3D2E1E8E9B305D525E7413496E40FF50CF77D4D4E2D41B1D5929848FB2F1FDDA5A39DEA0546", + "AE4E3B30560A50DA55AB3E59FFF512844A2700D2D763D85D5C3FD8CFEFACD4D023BD926D3EF2E55EB1B3831F2276EB07E5C07B44FD7D79333699BED0804B678915FE0F092DA9A62F69CB020DA21932F9FDF9AF332E1B400C6B7E7880508E840D62FBA07E827A23A2575AE68E15AC444A1CE35DF3C3F7CA49DEF2966DF3BA89C8E90ED5E2421A6407F2EC51A3E92A3608FCBD6AD9FF9E5C7817E79A0C09FE9014F7AC291448263E4346CBC4BAA6EABFB59B4526B654070084F52B864F9769181DC6EA91B576956397CE55CCDDBE41F94E5DC366E775C86ADB1C807B66D08696A2BEE45B90E8736469A371F05929D9D9FD34980DE08E00BDE2CD0EAB6AF2165D76519F8F2D894AC70740D2372B37407BDA4D943EDF1CBD35CCE4D81340CC97751C568731C009DF65571F28B7F58106AE67279E83C3A0C130DE0C5B6C99117099548661D290C4CAF3BC60EF719E2F7B210FCD4381C33904AFDF96DC3A6557B42B6EE895B4D604F5F8985F454C51E32B2C874E90926CBC58D044D483D6D2A7C26C7AC4D190531F79993D07B2E830FEB99BFDB00AE8C008DB1B762F3F4A81D41295FDDA37F3056B1110D4F0CF385F9FCC7E14C34F6752A2FB17F5CD3FC4AF0D51E4A0AF7D28DB0D4D651156189209480054F8287266B1CB26C9E8CACAA0BE5A69C696300025D160F9DA29F9EC79838941459B7B8164AAD95577A0C532EC2EDB35250", + "9CF0CC00B5788DD743A5F33D87E8FA5733B72EDBCD61AA4B8D0B81213DB52E7EF17AE90934F5EC0711ADD19E881CC330F696179C1BA464FFE6D7B04EEC383A4106BE5892C5DD1BD719AB3739A909A384FACA455E6AF96600AC6FF809788700DD2AB93DD228483759BD903EC002D4C1278808B764F018E3B740EFD821A61F5BEA2948A653041FB31F6D5D0DE0A045DA366E44112C820FD7FA966B2CCFD5A6816AF84DC0A3EEB8F9D2F0A912586F91D50B1AE3D930A680A8FB7435B6875ED2E599B87598A7C20245296C4965E2E0CF372B6ED1219BA68CB646D3E73D52665AAF2E3D1C4DE8D264578299B166FA0E148281C877FA9B14818759CBF7FF575307E80B73933599D94EAD2FB1C08A30006330BF0AC1F1C0A4EE6B07F9F3381AD7E2E469E8DA9C2D22CFC0A208B58924D2F994AFC0268EFE206E0A9EB79BB51CA26FB49013B9A17017E0C08F9FFC6C319BB1B5AE41771443BC670EEB91D7769F9890A9B80F52CB0167EAAF850FAF2A52B74ABB1792E7CEFF68C0D38B01F244AC0CC0EF0731E3BDDCDAB89DF376973A7ED5D4264EE82C334671FCD39ECD6E2CF869493914F332767BBE461707166A9164776D29F5EC9291F505AF291254D7319AA594B5F397D5BDF00BB840C4DDCB425F4325ED8AB77E57BECA3441B89414616671692EA88A89D2690A4B5FE958F990BD84A3884A60FADD5DA57EDF01865F85829195460", + "B85B6E754CC8F6805A8A19DA104418D9C134C8B0DBCFD5DAAF5A71BC047A73BEDBC192A453674BC624959BB76E44C5B34244D4736ED3F0F3C9658FEC0DA5437E01E128795EDD7593D636CD73FC1780B37A381502633CCF2EFDA0BBB494C1D0FC7F602DF8C282F55E3828E81A92458EB16B74835040D8A9C8F2DDF180A617B0592344B4373E1B526C9706B843B0CED4D25D7324C6FDD0F33133C00443638E6249061C56A116CEC7822F4512AFAEE52CE8F94D8547F72612EA8C7D160C65FA3BCC92BE01493706EC4E5F203F0BF85C52F417BAF8AF490E50133505685CE63AC5B173E07D8DABB2D439C6DC18B41B9CF37D02C92AB5C2F27EC83AB6B2DDCB7ABCEA30A95BBC39E9FD0CBB28118823F7D0342F1EB7B45FA6BB3A50223D0D7B14E975E7658352BC9288B48AF1346955F4551F2ECA47D423EFC63D20681057E5EF234D061A5E6E234ED01F3DF223A0E8B4DEDDC552C7DC3ECF663D5011FC907EB4A7CF746AB9E07C2929B7427DFE9E00B0A1308881912635A72EA99927F343EBAD32436A9B8EB1934AC29E79BB80AB3ED9F5CE39D1E43C251564654365DA43FB8A0FBA27F2328D82445A1EAAED67B92716147E859064AC326A42DC7880DE82FA782AFFF9C59FBDCE088746F8CEDBA288BC8C2C4B458782CC9BE63A86168B671BE99A09F2217B7BB2A7BC88651C1BCE8A0B89316ABFE72B22722273AF570974D8EDEE4", // 30 + "DD40DD438251E401FC926CC6968393415D52D521A5BB34D4272D6BC7B5431062B35112CA709C0680CBB18EEE053AAD62B2391C9E9D580562541A453ED936CE8E88DFA61A88CA3BEE66CFFF801785CCE863ED9C36A04D2DC8742A81CA55127B44314AB4E687ED921B4881CB363AFB3CCE7EB774E3205D4591939ED7D3C0C508A31786421F49669E120F01D35D467B40F85F2454F13F591F3B830937421B5C8A6C20EA878971AEC941FD99CEA92FEE00E5DC2264987DBC549EFF3E4A26AF0CAD7421C4256D107A3E8908F67450960E4E41FD7E2E84F754BAC81C8F5F1D6F650DEB3E6EFF6059836643209E3880D7BDA701869208D8E4BC8D0614066414DB3F93D6EA187950285F55BB7A1B026EA4BFCAB4671B07704828D5CBF9730EFC99E68E91F1FE9664DFA73297F2D6BD9497DE04982C9FF3730BB6FC3EA2053B3F45DC7FB587BA19B3C6B7E780EA5F25B45BB727174D4CD3B401FE1906360BF0B15DB13B62752F82EC62226AABC83C1C26376F8366BB849DDB65958AD969B25654DEF1841518993033AF47EABEE3CAAA936F19E28A205F3CDDB5CAC649DB6A90483ACB63A24EA46D397508EEB5DA94E9C883EB0451D036E28CC303D52B1BB31FFF582605F340D449508959ED1FE2FF0BD22FDF77F9680D6B5647D59E7E6A003AF0C6A95092F0DE43D1252EA6DE00F288BCCE3ED9CE273DCB4F3BA7E8D17353B8ECA24F03A", + "FE38B1ACA366B4C15F3FDD4DF0E0274FBEFDA0042BB203A4F6627ED9E29F405379B2F2DDC0F3B02A0CA70A9499F3CE82B87603FAA347B7052CB5D13D9DE84C114EF3B8F62418FB1F3E374B997127667FD6BCA2E2F9DBC04ECA9D908CD37C62F08EEA6F44B3FDC149465AA8037D65A6C8B9B8B3D5E9A40578E5EA3AE1209BA49E5E2AC615C59A2D71AC1605B98E39A5E66A890754C7D1C07E06DE78632587BADAF7FAAB0A529AB791095DB0A708B691E9D81F2CEA8F07B05495528B9FD56F77A4C8209DB972FAADD9791BA59F47C06F241F50C0619FC04F8456339E0AF331310FA4DCCBEA0E5DC2795CA6B3ADD0174AE4B30AC0428320ACEAFF68F73ED11DC1BC9F0237BDC75F7F48BE518EB3305CF2BB898B329716FC9ECF7E99B510B3309808735FD0A77B15731C233998F9ECEF46E2CAA6E6EDC8D05B943ABD17027A80D636E535038FAE44D60AAEC5406A372D62479192FA84D844520C6774CC589FEE16A3A5549495D968AABAABFE4DB94F5AE0C54E603D6DA5C3056769A064890533EA8EA1E5D1CD410CC8DD4B1D7E0F5F787232439AA4B3911C5DC792ECB873E8105A1AA61C627BE57E809C6863073E1E19AD8B987DE97D88A817FB43ADBB7751E36D1F0E7B70B3759D6EA8F2350D10AF38C331E22703B2B5103C908E1D35A8E814E45BAE81DCA0530FC3525CD640548245C259738E749E195B006081A18C45475F906", + "961408BD52EA1C6A9F340D9109B2388CC358BBA2D35BB6AB672A9C16F3AF968BE4613BA6B13D115B896BE71CFEC4A4AFC0BF5D2BB1B5DC19405F40E60FDF361E6CC362CDC28B75B8C30B468D3BBB77F3FC62869FBB635A3F7AEA63420CF1B80A4B3813B2240B83ECE999808E1394DA2881DE2DE62C870EC163AD8D81495DBE2C7383B78E19AC506AED9F3BD1280A77F2D9C55600BFA258E76761391145D45F74253C6E14BAE16179884F0F0EEF8150A445BE1B5AA4FEDC2198CC39763A3DB473C1CC4263CE2DD587447DDA6BD0A496E8DF60859CFCDAFED2EEC5B1E77E68F449ECF129AA17395BA39392EB610DF45134571BBCBB26162C83FFE77D188160EBCF598EF6F092881612A04BA9F4215D429BB521E737F6C3048B5D95B20AC37F79AA99A12CD0469268228463C317A1F31E63E4754890F20B4516D179342A76201402BC0DB2AD091A70B4232473343FE9E0002E59044C5F3B6E3D7368DB7E7F9F42E7A4A1942B1161552C5C84390197A54079F570B57E8EA8A30659FF5A61048142E4368D5542B968966E54DBF91D3970B9A3A278B951D6F914246FA5CCCC20DE53713D4830AA86D758ADA7A8747FCD455B2C320FF9E5E7FE1CCCFD6F7928884FC0B35F34118B4E7E6F6A5D6E3FB4E3DF90CEEBCEEF9D7D595A4C456C373C5356EF0DB0E6F8D61E413F80E4C32532BAA39170AAE2FC606B7206C379C4155031AF918", + "E03A069F63220109A77232F2BAF29D345737AAFED2E5E8D5C846B937277DC88392DB2D55073CE063F5FFC5717BB89B481B8C86EC01808A85ADD78517CE12DF776CD3F02D948BA795215599CFCCD9B4FE56DD681A59C71D24946225171DC18E47BFA9068302BA428929790EE62306C5FC8C10E71F6F372105C9421A563A4DA704E01FFD71E46B28C6EE1B7CDF95BCA6A794E8CFCB6BCA6AFBB67DED5C1267A12A4752176C3C1E6C2F665194C7F11C1CE6CC8481A5A966719B57124CA33D8EC9862AE5485788106562A0BEBD3980AFC4469BB1FD1653678192B3022E26CE8788C68F202D506DF098D49EBAFF7741CA96A02BD68BFC4FDBE24D34770FBBF8EAD9647C911B2E6AA705F0236301162CD2B41B88BDCFC2A79EC54698276126D6EC0213931609985224BF515AD3221FB5E8A1C4CECD51DB4AFF612157ABA6640866DC6D3602C446B8C6EAEF359BC8703D5EF9FE8EC7F5F2685C53924C6F1F71519E0AB589EEFB393A12C06B906402FE0A2FBD793272BC101D3B57F10A52C172E505B74F2A00BD5D2F7C7EA2883908434C125969A62F1B09F42E578BE22C08E88B11767D97C4C0CBD2BBD98508AFD591EB0B0C846A95FB72159E561F9D87DB446E9A19AF378B6DB4DCCB49FF8DB547B3040FFD0171B87245CF73A0747287B6FA1F1E4AE99518E8C53DBEEA942AFEF75B69E4790D75CC8A5181C609BEFAB641E28C07082", + "D8D7DD9242E54C6DCDB2A717A6F33226A94D5794FA0BDC401F4ED842A5CFA4AAB462F703239F684DB9B95E5101A5DC6067C7062AED9259CDB2067BC815C157A7E150F8557C3A54DDDAE94E5C569A1E09C383A062B601F920EF4D957F4BCA8E329123BD6FDC3B731361864CC139EBE3C68FED0F40FB127D9D1DC071DFA1552ABC6703494A632AA1314984A2D4B7A8BB32C555B79DEE013A66745AE15E8E5E4E129E44A119203425F2ABF1F03CE9CB33C0BDC3285ADFAAF4D7B51EC31F02D1E654BB10F0CD97EC3E389CAA34398166B4D5C9FCBC6E957FFEC9CEE4071F90EE2926FACC8FDE884CC6FF1F6EF1D3CC681FB44E45C5CF681AAD13226DFE19E22CE81265F3088D193EDB098988B2640EBD8D9D66708E1E9880DC41A72FD3D64792B14AA18C13E371CA17FB46B21DA9C59FFA2FD075852D42E2A578744792EC02F9A35F869912BBB44DCC648CE6075DBDF457A9AA891488A5450FC719778739AF323E87F9633E621B404F70614F77C65697E71F281675C843C523740AB66756E4DA784F555B5B4D797A06A0AFD35A69DEEA6E948B9B3C2A62D7B1D56832D9CCF56F2680A5A0A3037F4E0252413FB86520F2815C8824975634C0889A486963A2C874638559E14F780A7F3E2318B88B2C2010174150AFD4BECE2C5FF2D37BC2FF791F4A3136E19C373FCF03E471DFCCED19471182A93E91ED3EA68C402234AB2B00ECF62", // 35 + "87F0D84B811E4635AE8023B74306DE789ADDF1CABAF5F47885CF7F9A33F2C533093A339EB0D5E05C0763A215459CFF0D31CA92573EF2074CE2B6A11FDD6BAA3C6FA100D23A9AA413BAAFDA22F746CF74562F9DB0EF2F7CDF266142F177681CF2EF388E2E9AA012459ECCA332B779E48CA44E536082D59C3951ECA42F66B600D2621BF5F3584B59DC0DB76EC66ED7D00E943BFDE703E7D5050A8F263366948253B3576311CE88B463791DFA6F401ABDCFD7FA44B158AA97EF1CFD7A8802662A633EED958052DEDB12A6FB353BF2224ECC2322937DE3D39DCF82650B18FC0BC2BCB8CC456141C9F3FB09A0906AC1EB77E50E8D260041E4B3FF4BF3A53F7EB62E0FC503E8E38F185AF795F67FCE17665AEE29BD0D5521024A70B61446CA4CD2B3DC274FBE72A9AE29EF67A2217D6CC81BD8831B5160E4E81238B379B657FFB49023B040B6D504B287F684A0A0C07304E6BFA21E8D0A7629BA32F3F2BC9A33DEE2EAC1A2C22462EA0D24162543945B78FB6E26B86E12621588735B32A4F9A50157F20BDB7A4B6D151B3F28B40A03CFEB3CCA635261ADA2295B74947F1B1D676F6C014AB362C1F5AEBB439DB137D034D00591235B6F8D11C735A0C1964B29D3002D5243374628FB488A04EF245E64F598EB6ACBDE8B87F2FC5D1ACD105460C26BC6E1C7DCEC2E92E33F722E0A613A86356343EB111D0B166AFEC5C7A44B81A607A24", + "DDEC47E0FE3E2F4205206CD673EC66D7435E8BD4A523A8681ED77F51453B904E4468C70C2224C5F1D01A1C5ACA89BCD72673F82955FACFDDC4DA499EFD8D18A2BCC5035B0C69D095AE0EF1AFDC389B6253BD6FC83D3C37E809EE732A87D065207684332CBB9BB0519CFF51B553B3689246EC1EA42E236773A5AC4A7BCD37381615F78A41E5B181AF5C502E22FE79436D6EEC07F7FFAA739356CD9544C7DDBC42C56BB1C965441903962703986C93C6F8135A8EC42A89DCB46E754EF5B5250E1171398FD31793594831B0775F2A39E63FAD99929A0F257ADF332C078B0B7E209229ADA46D69512FF2DE930F962B8F81EEFCFDD358FEF8E4DA0D49F39C43AE9D99D8052FCD60305FF4D9FD4CAAA3FA6BF258B867E3F266F1BCC77390D02132E370AC79B34FB37F12D102985950FA5FD53D3D4783DA5B284494EBFAB51DE6CE259E27712A0EB4D78EFD6573A03D629F29166B902795FC8DF59050C9FA48584F0EB69293C7FACEA8972098E1367D183C0B91C3550852AEE6721A84341612E820CA4F53C71A51774134923FA00FAFD84811C07620917C1966F6A26A032B125D76BFA149FD66EBD18F7536285CF94A8A750680D6BE0F4A4E7F2433018796A358CE465E7507F186752EA2FFB01941902129936F7B18321902780E2C6A5EA7D3607227D6315C570815BD0E808EAE242B554824ABAF30614CC72B74E647D5B5A6306632E", + "DB29CD5101A3FB7A651BAB94E0CEF2BF737BBEBF0F755AA42F1C0B2E6A2E00422458CD8E2244576F139E811B2469E1B8F10FD95A988FCF872607A9B5CF81EB5875C427515D8D6D4FC58F3C69A92AB4932ED3D1CE6191E648276AD746F12A0D7B1ACE96B80CD2C3B99BD1094ED29F7020121076A6E6D5D750C39633B00F3DCB4793A27B4838C492EFCFDF94D955ED33814C954FFE8B8D29A81C3C62BB2E95ECB393F06EBAB479494628027CD02E59F1AA32F78C53142137965E662DF4B3EEB0B92A6FEBDC91F8B31D41E2EF69ACDE1CFF2AB49E2A4B12C275A20439E30C690D14D4F661C81308F11EFA3D014009D80D794D9F2C8B51E2E6C83686DBB07D1790F56D7C8EE495657BDC081A63B1353F4C4CA74CC0D02CFD7BE60E063A33D1A4D9050A9100F0E181704799357532DE152CA54FFC089E8DF80F29DFA14C19C9D6B7855482622504F95A8948A5DD640EE88B87CA98F8248DF148AE4F992BC7D1FEB3BE07E70F22CC052D92FB263337528C41ABA642C6B1C6F8883B21ACDC69196733FFB684451D188107C1DD219AB8B0AE5F49628A1CE32FDBA4B8CF02F38513E37542D020F4BAFE03EAFD7DCCAAEE9E28258322E43DD47DA3AD625DC2795ADBBBB9FE061917573936E31DE6355023F8D74500D2D032B7A53630F37FFA80567BA36F771C4ACD71D76DE528FF47E8281ABCD325E4C4620D0B73B2BE2787A7F6F485492", + "E8F24D8DFB54C5BF909CA2CC5496AEA76E583D2D865259C356E64E76793290BB00E7029A146E1E90DC0C45356E13EF59D60F20F080A0FEA743FC1C222AAEFA3E55876F2C9E6F7BD29C09AE32E80B15DBA0E6B594E951EAA3BFD166DFCC17AFD2621EAE6539C74FD776BB998C24C30EDB3A8B6814DE088E7E6B7CE9A64EEE9ED8C9D987A21A3BF35A9D59171DD456D8D0D7D1BEB3F37D4A31812BE00077F0F0064DA56EF9C4D36D1D3CAB4D1D4C024665BBE1DC227DD29E1CF814EA65B64DE60ECA4AB9B19F937DF15914F3CA577EB3A6A0A2C8ADDA53DE536721FFFD519FC5E7CD9A3BF4F030B1EB638D6A0F8C4E24085012D758414211585EF6E0DB8C670064885B67256BB6AD7E12E380C5E25BF58EB1731E935899C1FD2B20008CF87529AA3E714BFFA86D8B66AA94811A43ABD868A7711C4FFB339C01D72D4974ED53E7DDACCD36B5F459DDC05E9D475D3E2AE383F6FFC9C2A0D1791B4675DA843303C96A98ECA88B54735293C4E1906AF30221EE71AB58F3E38271608DA6AC0A488C0850DD86F8B6588C91589632EB781637C14D9D24B57ABFC301790B3C11C1B2938845F08F7280388E0B9D5A9682A6FD40374542634590F336E42D8FDD92F3F6C82BE4D3B953CCDAC984F6C94D8F2FF70BDFBA63C922060C322FE34188FF70A37648C362BB68B06D74A2012050FC007F276A54882A8A04DCE014655AE43E448639F56", + "FE35174BF6B56B67D39271D92AE0DC2B64FE31AAE8D1135BD8FD308D7E281F3ECE84784423A48C1362B5852719023F8861E861AD8B22219259E357EB9CD8505A66EF7CCEB53636B47D38A2AF5506E1FD72D3E30A29EF897C5C44A271EE562D67B279806E8A5DCD78DE538D8121CAF4C217F8A969AEA50D6FAC68066277242B1979F1A6B3051CE5B9949A11719F556EBEF844C808E5C1AFCE5E312C53AA9DDBFAF7280A7FB8502D2C7D1B91614157AE0C6C962F868D05D0463131DC841169946B732F8000E686467BD5D8086CC249693FF9794374266BD6A5C8AFEC65C66A834012365D60179450C58FAFE724B8B9E99C33900A86649B04CD54351D6C4CC7068B28F070417CC9C4430390493BEA50799FCBCD7A13BF75947C597B3D7AD486E3AF99CDD743B6230BC473DA35E6D05FDD17F7CB8D04A2B00EFBAA30946EDA96BED467A45EBA54578D9001637702F1DBAFAD16D2608C475B8DC7994DAB93FB34DF2237E4A13D0C04A6CACD42FA9463674AF8ABA97CF511A82E8E61F8330004E165D753323F4AFFE598E4D108DD8EA8EFA45693A2F9EC8335C756393585E052FE5D150A58F058CF8C3C720F37112DCBC6324877E87541F06C968C46FF846CB512EFE65CC401174BBD1C977694ED7BD1702EBD2D1EF23BB56D0D0C1EC2D90A27CC63F0A09D83F8B0A5ECC181D5D4265911BEE77EB1DCB4780B53CE74DC7A42252F3FE", // 40 + "8FC54C96AC76BECE7284BB32C63FCCABED194E82FBBCFBDFDC6AD09AF95DCE6A5D6E13CC06B247E38253D359A6C0EEE00A660BC3BE6FB217B9B554C90186711B1E85117DF0CA17463E132333B8469ADF72C3BC6F218A96697E172CE2E6D6F4E70EEC2A0CB48F0A2E7991B1B90A85088CD2C59E3C9AE7FD939592C14AFE9A13829DD97E345D1AF92AB46BF196DF906BBCAE16F5A58A4D99C7D586869C81E182352C210E3B1EE822F4A95DD0BB3B285632978B18FC1CC29BD58C2152FD3BE73482DE1A6A79C3929DDA1D20B6E99E25A666AB20CD371A85DD20BF0A76C5A81041EC943A89A94AA64C5207B3166441FFFBDF4AA28A2A88173F280F3A2838A98667775F597D0368DC0BC53C1AB8B7670EE23E0ECA08CB09FCA68FE2153F01FCB7061CA1B6AEDCD815D611FF71868F50855054085AA1B7CA3309581532D658C7D2D6069C3B44E0E3CDE45222DD9EB40C369762CDDAC6D9A6923FE0EA7DFA1DF73BFF8B60EFDDB8863538A38528803F3EC27E09C87A2D0E160C2480F7D2003DA331FD5C7FE05B582DC9AFB114D2AD2F822922067F1FDB3261078F33879C497035003171165FB139F79BC508AB9D3250D1B53508410A01C35B53179076D9F46C5BE1A26DEAA2F9F71F442FD7D19D34979F6ADF96BECF1124551D4806E7136551291352748DD2D58443978C3DEA5ED0544E6596769A760B476B9CE7BB09543991EADFAD8", + "BA63AF12FA5F7D03F714CA9AFBF19375D2A7E31EEF4A9E10C7C2F8650552A6CD22FDE0E012D46CEBC773C87729C7E746FA4C0361099D4876701C0B2A16EA2B5A6B750CDCEB573DC711F95CEF06B8DF516CA2F9BE6387550F22502E53A772436F324569B25BBACCC781D30DE25B806D369AD1EB1D1137EFACD0BE765DF4D06E177D3E3F13E9A3165F269244FE8B130E9066B23474418A5191ED481BC8974074336E71BEB02B1BC34CC620BDBC24CDA8BCEBE068416E5F5B5A263A51CB3F6589F77D4E607939F7A0FA637858B96189A014B5688A9DA32FE2ABFC31FB00401DE475BA07265B3FD1890ED0FDA487D7C616E099B4EF4E47C9F9114E6BF8CC757C92C02C46546130ECF7CD44160F55A72831692A5E69146086C43A5F043BD1184965E2A6B154BD7B8BFB3B4B28C081B0F349900492C703913885428A82A8D2EF1240414CC0B6D56D969BA1A121D9D61584C6A880D533AB58B94C85F07732B5EBEE7FC87FF3AA279ED703858957A1C1501D71DC5420C24BB2D570F7589F0AC5B6EAA87AF68442FBB38EF693D2200E73DC73F58CFCBBE43FFCBF76DB4241FC4A7B131F29C8BC0F77C95843D2FD2DE39E3D4D44237DB39994380C5F1A1A3AFD927F6B736D585112920296B90CE31D58BCAAF8CCBCBF15BB36199B48F00F308F7E8264D039D6DAA6E848CECDD1544323C9654232F45689076B7C4B1123AE0FF152124E930", + "F2CE3D09E701F60716A413AF06E14E6FB7BBC29DCCD8273A083B00D429B57EBE9FD5270EC0C299D243A9FF0FF73DE19977EC16C2772C6B7FF88F83481924C921F49EEE41121DC79B7C23295EFA50292B11C7D45D66BCFADC3C3A390E03E13CCCD51309BD4061782273CE5D0E1BD3E11271A3C52654D2B846B5600D3E68D2C234807BBC32F1A350839500DEB6D387AECBFF5344606CD04BE3614262F068FBD256B2855EABD5A7C0AB5C28D5719C844F2A6FFC500628CDBCE869D2F090E588B57B796029A84E2319FB6E59960553B62BD30DE99AA7ACF508168EEED8DAB9996041BDD78BAA2A1CAAD2EF366F4A3244DCAA3F06EC9A24572CC80C3CF44B557CDCF6279165414066D6B700DAEA8D361034D9DE455A55E55CBE39898B65651FE709506D1A1FF67585D0D3E1B2C5EB599704B3925CEFDA45C33D92C9ED9F0C45B7A80706E6629594F66A0F74A4A767493B73B23AF323D519B0D05EEC62C6123A0829CF612DEDFB7F275A55F1629DC64D2F77125A1BDFD7B9C213C51DD9FFD83DEF42E87AD4E0F9E5ABBAA6B120E131F9E5A3097F7EC766539C733522FEB0F02604613CA1190024CC1C3297E7CDC3C514F8C3787943EE8CE457B516677437B2212A19629A0A04B0DAB8258A17B28F52BCE915A680152225304301FD2BB1BA2A557B3E3CFE6553CABBF79A47FEC31DA590308D156C3537B97116224F3E21EA3841A505E", + "AB2F844287488AB6B0F47218F2A4C54E6BE79A80F1209CD747FD88A575EBB11F2F0756E2C263E753D9388876E159EF3BBF99448D0865173572F4B6A03FB72244334E4E861E0495AAEF15276379F8DD88AF9313096805D5596446B48EF1F1BF2ABEDDABCB1FFC98ED408846D85732F807196C9CC9B283EA4E0D78681C73CB6AF89E5C361476F84E979814F30C0AB03E97156015A493E091EC5D854E8B08328581D80091564C25D6A714407D6B591F17D376953F18308B8BC12EAB5B5C9FC11AFEF293109785CCE29C978955CAE2601A1DBAA274B72CC18CF27FE077A0123258A1B879E1ABF84458BB10652CF7310278C7FA11BDC5D00DB65E5D6A13D77FBF9D02DD0574DC7AE3849C7C47820126FC99B9766920516AD1D63E7EAA366005714D6C1695E731E88D43A38B615407A99B32A101C4D417D5E36B886C26EA1CBA9FAB0C040468781897145489121EE47BB2FBD6A064CB325AF5CECE5D5A4BD590C70C7A9B068D318247D8FE16A3609C94A8D431E9872E26A3CDB19DD971971AE1FBEB2FB76F7A71AFC5815CF7871BB5EFE3BD0C49BAC441ACD9CE1DA4AFBDB972659D13775AE77F843259EED57A62CEA93FC449EEE1EFFD9AA2D36D8FDBC06A95A6AC9B067468F1D813F2DB95D3456063D5B23395824385D5C68D3F869C4F639962D599AEB26FE2D5148A51579EF385D31E744450E11307F0C803C70ECCA93F831EBFC", + "9B1066F98BA2299266D8C1351E6945D7EAA658BCEA46D5AB353C2CE48D01E915E740DC90E9CC487126AF9FA722A335FA1A8D11C2719F07CCA23B1DC5E5B9AB198077177BAE0B5F35C14666FF32926AE0239F21811921C77FFB56F7B218A353F8EA67448F61ECA318196B1186514D27416EE2F61764940A70300B69EBD02719191ACAD969B1075EDD09EAE26F883AC99DED1AE9355C2F30CC656934C0175E824E76947F83D791CE7A2960FEF547CD3BA94CA064659D1F68C0DA8C13AFACC07F3D5A653F259DD141E2ECE9B6D25F67CD38AF3F802CCE332049DCDAE1504061C2437C7D3BF4E15D88185D4114E96BFF7EC673A7AF8AFD53C979C89FEFACDDF873686D892DEF5FB67877734CD981C16684320AF392A464C7216FC5C8B22BC29C8430151FACC94AA1513A08E1FF2F6A965F68E368245510B975595EFDA4E80B7FAE432FCE9737962974905F367FF637121237B2A404C42A5A9318DC5ED9CFBBC2EA9C17A6CA37BBD98F8771CFA7EF58B1EEE40BA2D6C2031EBDE4AF0590AAE8FD10B2BC02A254C97726521E4D4D4D9FFB74FA5D06F8AA0BD43631FAAFFCBF01FCA87C9360C5E6A62A4B025B894E2C30F9003D29B642335DB0A3F2A3436A917B61776F96292A06A6B4DACE4F6F0EE0232E1C206427A0386075BF50D6074006D45E3A3CAB085431032AC20D2690F0435D257D3E2C93FAE49D75FF0F320CB4D348C6288", // 45 + "8A7F8C99EA79E1B2118E3B203F72FD8921BAA5C336B006ED66AC7181575D66ADE21D00FC8C7DCCA7DC9E430D1D086F2922487B5B025AD38750B4F60993368D829CC361B600ABA990E570370AFFF9BF171610F2A0B0B93A0A3AC54244073A0E816DD691BF1B0041BDC165125A14C621E01C8F069C3E05F48FB77E66A998C27A87FEAF07B5912B303A98AE5796F1B5D4E2EF52F38E68F0EC5786C19ED93612D7152BCF0CA1A3044898F9347FCA8370CE6E4A0510750DF6A42C1C35FDBD91BD2A26A60FB229CC35FC45525D12A092505D901A4F9E1E8D42D25C41B8FDBA13AFED8BC5566D4F3BA13A779D7BAAC1E25B6710D7718B73A641F23E1D22CBDED3B7BC3AF7D92B2DA1CF874D908CD8590C80F1D5055CB8228AD964DE099A4D037202C65D197A35D8A268D8A3BFFFAB39B93615DA295A09AB979AF925D895CB60B5DC5580055BC4347F0DDCB1090DAEF46C8ADD1009A5126362B0B4F1FFDDAB4A00AD8290EB84F76AA345DD73FFF7733035026E3CC1D99428CA68ADEB8CBE98E4A630F99F4F33E8AB66895AE7435D2E84EAC95CF19E9B440373EC0B4D4B2CFAD672C7FE1FE8CE5F34F55B016F8B115FAD6CC7B53DA7555E67672FBF6BDE324AA09FA18F13D9FF1041A12B04F30304774B07659F397554E66CA589D9D9F1F262CF659F718CA7F443B8331BDEA8C3980045562D909EA44E917FF5D47812A0390139B2A87D0", + "80B35D641CF6EEF705D51DAACE1EA5EE92057FD497B0D937C7CE9A546BB32DE580F8E434D644F191798A518785BFB9471AAA5D03700CB0B7B2635A6A14750F03DA4FCCB1B363C254A5294DD8E7943E4CDDA318C4B92B57B14EB0F8EB250686CE129BBB2B18EBE7FF53C9DA9C0B664C527A3C69D905CC6FAAE8BEBA7D83294C1656DA4B8308968EE49DDDC2D0C71A17B02053027D7DB8F4E77E3AD1C80FFDBD37938876B671D80E99F5F1C7BAEF50B7E05CC0CAB8979A3A2A852A7018673292CDBCECAABC74B839FD3C084682357A5414E431C1F25E34850FBC779285854FC6AFDCFB7B7749E0DFFF5F93A8AC146C873B407F2CD6CCB461312AE35DEE8D6D51347B0824156DDD60762807A5C132C0667FBBCA7489058C47A156B2A50CA5C24B894C1EE7C44B87179176905B7657A8E95AF7F2EA6C6D2A12384CAC9E6D14253DC5C31BB8FDD2462581C109D2DAF72238E4B63F436DFD7DD5571548D2206BCB8B837D8CE8C9C3B3066E46A1655E3D84AF42DE1051DDDEF438821E0F0C1EDBFE148356D707036B269C19C4CEF4C4BB4048364E2A3886E38B42EFA15F22CC8F92D802EAF3FFAF9BF45247DB76C03E99F662884DC2A29EE488023BF0EBD46539DAC307410846B25280349106CBAADFD658A066C3664E35C4C696726140275AF7611D2369ADB8258EBD2279DD24DBFE002377B9A3C1B120890A6FDF20597417F88F15C", + "ED6621A6BAAF64578BD988D08FA8D3D2873C87C38AD7EB38C0922FF3F7E59F0A8DE00744698939D42D459E6105ADD3C77E9FC4911F572B3856C9AF6C15ACE704F026C6B2FC8BDCD9D84022DC10C47E11E934BEB7E1DCE8B6A2BAECD384D810BC3AE587E7EDE57CDEA908DDB020885624BE042DE0ACCDE1511CE38AFB6C9DD812FEC339B8137D88108F07035A3869CDCFCB9402CF96B9E331297B644DB13DFA88F60605E067B9F35607D2D75573E0913F8080EF603AC4B7133D836B84F32F48534237CC559ACABA53A96885D297CBB572BAB1C3275F7CC7A3AAD10F29E727B28BC29B038F4003F8C93FEDC88C63D72609A5330F36F4986CD9536812676A89305C6CE58D4C49C088B5E273F2AF77A8D31D1B8574B9DF02CAD4930D7A7F76C067E7160ECD1A845FC6A3B508708C279A2C94F29108FCE34A63E5D5554FB530522394BCA00508DDAE6039ED9F47609781CC60F6E211BDF29E6F44ECC873DD24F1D37E49D7BB7D6279FA7B9D08B5FA8F9364EF6D4C8D129A5A97A8BBF17DBD5E64C4A31426881687BB79285B09290DE61AE40C295CB1BF3C8AF756E88068A777ACCE3C4B6E78C62AC1E8EAEBEED0AF3153983214D7459AA8E254633B52E5C0ABF4647B906AC50A62543710EE92B335A7162B540AC70F2B2F49FEA892BD72DBFC5F7A35C3AE56636AF2887BE680FA63768C27040E888202F700007DE648482F5307C56", + "914BDB196CD56E3B7D7D3F1D7A5E4B0A1389578F111449DC2DF643E6E29F688227C3C07033C2A3818342B229F63C229FAC11EE1AB6F0FCE8608E03B46DC983318DF15FD8DBF2970EB342BE2E534BB0455BE58290A48FC60973553E94C4CB53566CE0250D9FCF055936523A8ABFC9287DB9DDEC54710859DF62829D2B6A100358EB64E6219451868D6BBC2AE4DCEA0C0E338B26B748D4A1A34AC16233046CB7D346D0D79A3CCDD4CDCB435B9B3075AEBEDB4C0F18C5DC006F5C208D882308510C75E729D08C779CA99D5A685E78D5628094AD137BAA635B7FC0F492C48A9CDBE63209C8231455012EB3E830B5B2A79ACD8FEA8016243EBC85BF5D6F46A48FE013D2B3B789BC5F743200BCDE03995BB2B6A640CFB099788E380B4E01D75409A8D8B3887DF2B1CD34960091653EEA6C52EDD745B9363BFFF666891D9C8BF511C3C07D38F49DA2892DCCEC81E1722F6EACB3214E3335C93E6141AB94E5EC31BABF8108F6BEBC3E60B1BFE37579B4D5DC8B77A347940CC1F6BFB5B46097B1EEEC4C354159BB3475E05FAB6BDE5672014D9489CB70DDF537F7209BB9EBF1FC6B8B94564AAAD5ADDD83CE6E51EFCF73DC6080D738C4FF1CBC87ED420A0B92FA459AD7BE58789F0A191D149F88173184A22874DF6D39DC1BCD4413648B178ECB03F8358547A68DE7B672BE9BA1FFC8BA392F8A58ED2806155C00F86B7669BEE4220D420", + "97051FC67ACA30E8AEE73D3A8CF38BB13524D4E0EBD9BE68398C7C16227CABB1D0B0A0ABE7B6384ABA02905BA0C3C7363599D059C7B4C99DB165CD14FA12FA7912449CA7DD5E346D8010C85A757382270DAD15BA3CE36A76EF55F81A1E80BF366B37FE3A88EC722028C25E234E624040450A99CD808F942568AA7133981D72E7F2928894670AD5399482DF1B90E7E64062F830B736C79C30F36281495C76699CD48404673FA334F042F9E0E67DD7F3853BF71ABEAF6A9A5546855E840CE42B224D8F6490C6CE5FC02EBAF4FFC390107058F54CD635D4A7F2878099C1EF495750E6921BE2F39AD808C4210F287319F811A254CEF8CF153FC50AB2F3D694A530949E5F578D075DB96DDCF2BB90ED3DE09D9CA8E08662FD8982741DE1CE0A6B64C3D3D5004B5C04B2B0DFD976A20FACC94D1762D41EE03B40D2CF367612812EF4CC41D1BFE9CEB51AE3A22AF1BE7B85A057D3048D0E73FA0FDAF1119EFD76F0A41BE63128B22D64A5553E9549D411483BBCA1483EF30CF6A6D317AD2C7973EFA6D4C1121F703D2F48FCDA3177AD450D75D2A28D2C244AEA13F0E60AEED8ACBAB444D400DF5E280DB799B2D9A984DF1E2567D39D1DE58EF78CA6B4D8BC172B07DCB02D156CA96EEFAC69E556CFCE0AAB617C7FBB8C34871C1D35E74B7BD307D3F2E424C7A9AD676A1A69E0FE735EA50887A1DFAE6CA2FE4460FC7EF323ADE493020" // 50 }; const std::string Galileo_E1_C_PRIMARY_CODE[Galileo_E1_NUMBER_OF_CODES] = { - "B39340CA1C817D81EF4FAE4E95BF3504A7709089FB48560E9E3EF802180E85EB2194E05902C6C4C52021FEB7EC64FD416BCEBC8E39D64A4B5EE345291911AB8204A888C25B1CD3D9342A56C538636D3EAB957037D09E879AE5F3A39834FBB84A3D8D5090D7814246B62E9CA68533D2EC403B4FB9488467FF9758B0D15A8CEF89187A1D5897880040B6C3C5244E85A2AD14BCF2F5ABC44A7B1D4A87E8BDA05766218773ED4F70F8D1D07CBB1E8CA6298E64EE6DC5886D37495BA2EDB3E0B0B68AD9F300310B88898DDEEFD484538C31A9BCAA76ECAD0C16607D32189058B0862EE9D70CEA9D304755CE8037BA4C46C2573181748A212E4B2BDD04F9BC240518273DC17CBAFF21A03E9120FA7DCA18D56DD1D9A7E510C90CF219104385F531F2EFAFD185ECB6B911F9B7809D98D86F15516FFDDBE9BD1CF8662EB777C3F94EA3F962D7B79449FAAD39935429E92CAE5637E9BCF4E94D413D27934952409AB536BE4055AFBC4330CD1E4B5509EFE5F8EFC9ECBE9EF377DE7E37C479BB9D3EE7745E4609B0A6D2C5D92EB3C9E2278C1F2221FF907596AA5E096ACF8990EBA907E43AD320F8019CB6355A2BA8670EE5A4F463E8E56F8F1D3E7F4922510FB668E32C4CF23AD8496399638B095B47833E0CBB34977EB3E4242EAF870D86660D6A73F83E45D6E8A41EDCA3815079649544597C5C43B6C93FEBAD5700D22EDAF431FD340", - "A64F94BB47BD4033C76D4924305907EC1F618B43C7535F3CFC093E5AF5DDD5C4339F3BB6D835B5C2C2053CD3D5693368D4E1A7CAC59425D1FD96809C67285CFD3FC05B01053CB0773221D7205778022F487BF99D1650566BE287FD7AE882AA8E8F52E5D4E3C0C2F971C9FF70AA378691EBD8ADE45CF213822D09FD05243F9726F6C69893845E57C37A7643E16B770E26F431FF69D437271905D270EB85D8D229D7D87662121F0BEEB1E895ED9589A9CF5833408A04197AC9025D8570AD9B75DB7E192EA0A089504996E9DC652975D83633619CFF80667D8B519536B3475248BA8213C8A4C66DE69B4B3774BF9142425C57F34A27B1E288119E3FFCC6AF6A21087F9394F09DDFBD42F32D059B8CD4104A519BA640765D5CDE490E62F10E695FBFD33CBC9D2208A532C8EC25DA28B8CC1B6850AB43D9B5C00B6E74B7A148791AB07B328D347058C7E6233E18C5ED172C9F9E9ACF29D913E2A1614BFC0893D4967ED033B2B9AE6B51F908F1CED57C14FEEA85CD4D9711216BE7F79FA6721B7DCCA033C80127AC6E5FCF58EB4005EC24CB4886D787355362D5E7031B9B2AC2A86D730AD734181E723A811FF510A4DF868001973FE83288D78E6F9B9441DAF5BE2974A2848FD917C3BCD346A431922246EC852E4AAD467E60C15D61DD3BF4A207BB57DB45DCADEFE3210BE74B9DACC918A394469F2E2C95AD1E211947948FE24F5E4", - "FD1F6976002C39C87187C44E3D224ED4DF0B67750105944C651A5E57798F168A136AC0FB5979C4E847A82B20A2E6C45DB42EF2B930A80D3257BCCC53EDA966F5DCD9AD47CFB226EED9B62A874E9F6404D4087798A1005F4131171D3A47907A3CD602B83DABE094D2CB031867DF4595F3ED59FD8C4D76EDEEE59E422CE5C7D0A5F720BE94FA24DF05F758348EADD5EFE9197C6BB2292E2B14DB8C6DB24AA94C5FF0F5106D2B566058D32C58B63A150784F7B02478D9973DD4CFD2E84059AE0F4F1320754B7EE83F04A51C67EFFC2EB1C301C0C58DBAEBE95474E3484A76500103C14C40BB0B7D3A04D8BDABB605C1EF9FD4A6564934DEC50BD5878243AEE80F9796EED70CE1B1E8B55725DF76472D12D4A7A487989F42E6705818B1F7E149E97153A7B05A82FA3FBE51763E61171A4E12931472E94CCBA74CC09483DF93623FC60945070FDDF3A00B561650427E4BD64D675B1EB398B35EF057A66FD0B48EDBABBDCD57C32ABAE46F5CDD0CB1FCF17765258236F3DE40BD5D0A3C5C978D81DEB07367AB20B2CAA9834B9576161C4F20FB9C184A01DC9021A4E92B71333354E05BBEA9015E5AC4C66312E8B79F0B92279AC7EF1936BCC30802B83DB3D113BEF64452CAD7ACF6674FDA44023A661019841A101BE80FDA4E3210AE774E433A9ABD97F2755259AECE21F7A8C3B1A3D471F874D2EEC85B9B21BC0C2E2EC9016F847C6", - "EE38BAF6F61704B01509B5210A0534E4702F93190C392E749869B5572BB7AC4D7120E2BECD6618CD376C4C1B4965F7D9D73400824E88A5C7B5B66BA88C3E0065F9628A9AC6B91A1882192FC553E3140349934D20698C9F291B5370948AF6CC90C837B9F3607F13CAFD492CEF1723376E6A5B813A56301B88A8799519CB7646F33F91C44CDBE7F768D7DD9B323A5002D2F784C4101AF90D6E4C5ADE7D085C79E827D43E10DF63AC70BCDF13DCE0471B487C5ECB752B9C3E20F75DBD243790C91355ADFD7199081BFEA03D80E82445EC2831FB5014B85EFC2A52748A8ABFAC1BA3904E178DFBAB26C1750228C9A031104F58BB3B91905EDB9EADF7B0F6DF22ACEB0DE944E277809D77507D18EAEDAA1767697398421115D04AB2EBFC466E99F0AA540482A49C6AC8FF95E3F962734B03EF39873A93B70470B46FFFDFDC15C89F8FE2F4637B59F9BF9C5752D9F8AE7EA75D1EAF1C22CA27E5D5C9499624105D61BE2A691F9194D277414532A5E6C63875F7F20DD13C6EE73B0C3568392B14A5042843926472ABA343D2C427792199B543BE1D43A178FAA7ECF53B98AB7528D8E1B8B82C52D973CA0427636505837F94284E8D6B4F496FC5A48B7958D4681DA00651B8A7BC56EC859C071E4396A05F33588B8087EFE9635E565E6B5A8A70DA70F50ECAD1A85E6E36FF07B4FB3B9119EDE0B611CFA91D9D4C58C1F4815B07B9EB1DE", - "CD37D0FB0043D03444A939E93676B9DAF5F2D19A2615E3D97D624E62ACAC8098099FDB9A5A2F4B3ACF20F75B6807A5A3F157C2C0F479158F4A10FB4972855F3AE2FDCBDEEC00A4D470AADF5F5E571818AD6E872D897E2DDC402006965ADF16582B1E06B1861BF7D0C7E7BA491C79E86224AF6B246317F725FA74DD8376D63D7993FE2F2BBBB2F1DA9238C6F3FFCAEC50FF61E645FADEB6E03F883892C42CCCF904708B123C9271A670D4DCFCD602951D12F5213937CA2C05ADDE9EE3908E99AAE8DA31951C36D36D671CD7BF15DF60B707F00BF6EBBE5476926D015628A85758BFF35C4AC540F39E761B2ED3CA9116E8680E28BC387058E0F69345CC6AB3AD160E9F2BC4D6047A1934E15D3D7A242A296333C09296981BBF3B8577E4B8ED2A3624866111F6638F8955431195B60C5C089F9897DDF0D34A3DC627CE337AC8128C28B63A394908E4C083BCC4522DB8CE5720C45EF76B2716225E53405FCAAAA72AC198226575D5225195F106C1249E4B87AC05287A3ABE6C51A2A41E07F56ECDC46E989A8568D35669B525A6FFCA90DC91D3013967F6A5F4C022FFCC17751B68FB0D8F16FC9229851DFDCC060838F923BD44C1AD70A993E8EBAC1667DA80F91B66F8F5B375D35275188E3C7702C2312CEAC5B20D67BB34400401BDF1DBFE79DFA0EB73F173A04807215DA5CE8E1D28F2126424C3DB44ADCD7A961260FDBCAB31E", - "CAA02DD19DB9C721EB35AB7D64B8A387796427242698A47D832C3F1AD4DDA0B5926FFCE9319EEEDA1565ECB0FA1EEDB424414120AAE8CFD0BE88D4D248899A0BCE31F9BEE7A4DC4DB3C3B10444FAD6ADCCE28F0EDF7B808536ACF5EB05AADAE92693EE02C9512B3EEF000844BA35E24620A2E8935354B8432C07C8FD615534BCFD0D8E3B572BF2CF06AD343997590FE8B244A32BBE69125B5D7C5E513A493724EEA8DA6CB0FFF3ACF1C5085A8120694CBC40FAE1A6326FD71487CC3BE7C10A34315CDFFA8C618B68EA93D330945586B080381F0076351B888087F56B969E6D6A311AE03CC79FF6861E715C9DA9AEE751F1220661581C75DCEC0515A1C9259B9CF8E944CEC4B1754E5809E985D6F43FE45710893242ADE0D3B84F1E1942B7A95648611595FED13F546CA11DB8E5A55A3C3C78C3793C6689E1B3AFB5F67526A480DF923A586A779F94A09CF963594FF4B0A387876EBB3E8FAB888C97F6773E7F0317B038E47DD7D109545BB07263B1AA84284B86E47FFB9784A171D101E7B0A6D38BCAE7E63D827C999BF551728FFC642EE690B01D486CB6EBEEB9D5C888112589EA5CBC9BDF49E675965223416D6DA02D2333BFD4614706BF13373973207C849A0DE41EBA137FDF79A1EB25D74E30CF60B577C2787DF04740BA8CADE3F9DA55D3F0084F02809E37543239E0A71E99751EEB21CB3B41488244193A4868CBA9276", - "FB227530F82BD527E648619E532D7646A5ABBD15DB91A6E7033DFECCC65D095A3D83AB77EDD2F3FEC52659CB3AD1BEB009D7A1C9BFB544291EC1C67B75DD6DAB06E70C32C714983139DE4A41EE07B4F3C03BF566558484F19A3BB674B6795F0D8537BC31BC8D7A38B2FF1B2EC8B78539B2251D0E385DE484B05A411477681A3AE7527AC98BC2943AF1CF7F09ACF2DDE4530AE896BDE1266FE916E833A1C0CAA2B2D2F5985AD47B2D0D1D3AFB6E50D4B3DA7DEEC4385E6CA8FE22760F92807AC55556AAF7973E8016ADFD43A3919088B768351B1057498D2D668D7C1E8C63438055FDF7D36C5E7DF02FCAFCBD9291A2149E7B429B3202D329E47CED51EA5771772E308C5BEBA7B934597540D83DBEC6C3BC61A96EA4CB2D7530D9D760AA9403338CD95B829F17547C5A90D161F7B8CE0037EBF403C91C0D0C70C589BA87CAE8DF26CF14281E235A686CCD10E2D520A76265C4C2780EDFD0705E89EFE3C953FE760DE45A8CF1F2D3F36DE3164D5BC2CF32204228ADD7C182EC55F1158AFA9358BE179C722ADAF1D0BF1306A0B56218857FC5C21001499F61E273442281E585B3E6DCE148AA97B6622B23BDAECF983BF186F1B34962764758AC3C20C84036061D49CA33B3C3FCDF03F47F7E53B940DBB6E1E4A26702A118E525A9A0EC229085C925D133750ED0B200CB28A113289DE143D1D5839D2AF8B0525E0027F34FF32106A", - "9E5DA18A19514CCC849E9697AE4BD1B317BB34927D0461A96A7AF4A5D6C13107FFB9DE38C5E8CB7C5682827F57D94ED2E77D36F9F1CB05E4C2C62B1DE254C7B1CB236FC4ED70BF8DD1F43AC773C16A37392B895F8B157578C477C85E53FA7CA58BE70D9187AF5F7A18D5A1E5642335E46C2F8F4691AEEE6A9692E21B9668E2C083D9F45C2DB3E991588BA87A0A23808732EE39E8B3C876BE79227C782F07EE3FB3086AF913D71D71910A0F56D62B5DE5E224F7856A42A4A1B2AFE380827BE86E381FCE486FD08A91B22BD91D09615F417E178C5593E41B0917E075133960AD28B4DD4096D1E84BEF1363098DDE92C29CD508C40BA7E785F46C1E0DC72E729D394911DA919EA6F94D14567FFADC61CEB8DCA2821B1CF048477E2433E9DC718DE618EDEEF302CDCB5DE472656D6687DC41EA34C2BB4DF1CA08DCB933BE3EF4B419158BA0B68AE82A64ADD58559214FD88A4CB34D99F646310697DA982C2FD4EE069DC1CB102125C34A89AB20F17B6EF648A834627320410FF6881C7919AE4E71CBAE5F8200E523934D84BFA897C44B89B9BC6BC0129F7F97EE0EC049BA1AFD67D00CD624A75FF5A30514399BE4801CED057B498B9DBBF0EB9944295D5B6AE968C4B8BBD2B9A9E17A3039C5FA35A0D30AA54CA426C58353943DDDD3FD185895C0DAEE950455FC131F520B46AE118C7406D0A72BE6127C5307730AD441B6FC3D1E0", - "8589F8396F5B1C54CAF2B17D4C152CEF347E66EC7903C878F2823D4ADB9E7CCFAFEBB926B7EEB4AE1BECA339A027CE8EF997957532FA871F356E0326ECE0BCE3399F81179BF78C5C7D135018ABC340C0BE58D3063DD7CDA4C1918A0187BACF830C8B6900D43B62E04DF6E831CFEFA13BDB5E873A527F24327C95DB4BBDB65C81A20F959F828F5DAE4DC13E5CAC7417EE089401FB497ABE10144E28EA383E61D4A9B63B618AA7CEA4588B2911EC581F506062B05E7BEF723A5A465C9FBE70E313753BDE3102845A79A206BF7D996F49A21752D534B73EE83B48C1A225F85F5103DDB9B6B8380F61AAF26E5CA643EB62EAF58AFEE0D3494E4F7A4F642A3454F4F56A406A264148FF5DAC9DF5F151C12E89ED9D4FDCC04EC5F0022DF8CBAF3CBC67CED2853FB4F8C5894C96CD00550950E7EA2A26C80A72DF533270A0E23EDBAA4D0BE935D62CC885E1CCE653D66C51E49C43952042E1B2D043BDA1CFFC1E98A3F806EB587A4EC9AE299BD838C68B9BBF7C420C12B23AA2793FA0248C932A91BCDD641DCB38F0B2D7187D8986928DF4602B381BA13B263291134628FC91C8EDE92594B39650B877D9A91DAAA05295457DFB2C5D8207BBCDFE16AC5B93600E33BC970B38E18808B1A732889320352B524B109560136E605D32784CA01F8B11D077C81EAD6B7A5741C82D76CEEF764FD07E361D531B75106AF1572AD1375B2BBAB68", - "A3E17A4CAD2ABE76E32D18501899F8D60D293BB1AC3ADB64F81148AF56741790F87F8B7A2D9A6E7645EA50B75514C394508884CBF9E320B24D41D8246EB3C163B9101240776C312DB63C33889E3C1218435850471C454486DF7FF4D2DC0AAA14980F394CC8EB7B828A60C53A2FEC3315BEAEB30045B3E65006C6EBB23B47A8A069EAD45E32E771B9C467B4359EBB681AB48C891ABB796544169178203BCC4BC6B4A278DCEFACE5E9385C059346A23DCCA001FC9E47CFEED4BCBDD947B12A3F7E5FF8B9372D9497EE1A508D8BD3392BF3CFAD58F0191B18F6A300FF9CB8D914FDF37B48BF24C2C5CA76ABDFCCF833D51D48FC90E06E7B972944BCBAD169232A8429B6100BA562F7F3C55A625A1870A7C7D7BC9BD4C4783278CD95D07F89E8010E78876547F9AEC44322B0029A922B2922634ECCF2BBB47BF87909C494049550F1E6D03BB5354DEA7E777F499D2D6239BFA5C1CFA536F8CB16F4DB9EAD96F83A4AD34AE2C6893ECD6994C89E7F4FE426D95A18F93B88CB357996B8E5A34C43533EDB1F28A8162FCBEF03704FCCCD80C32874F345D34E81EE813DF5CC9B9C299362F8443AABE91BD0EAB9746E431804B6129FD32916303A570323FA121F7AEB2829F2A50A82CACCF6D273FFBD7AC6FFC5807771D216F50742F7091946F91460115989C87E8BBBC8402B4C8B95C102CAB53843D581FA9F16C0ECCE8944E5FC4BF4C", - "9D7B1CF0029261D65AE1F021DAFA81CF1673C9E0B47FF2C37D1B1AF46E7A91BC5E529C8F93EE3BC74E92B2743AAB1EDE16A6523B5B8A591C617C1FD0150E63F3B7EF0494162437B0FD555A83A3BDB519B3BB209EF7924D6BCDE5992BA6248690442E72CD5EB64B4C3D3F7DA339108A18B61AD88ABE87BB7C85A3A352D7B882FD683B2637A17A2D9CB0B7F41456DCFA66D62913F145600BAAEEE7EFA5071C3C9E6FDD0A6779A737071FA6965978CBC89776386B108DD7216FCE962FA87A26B29FE0E732309C0124B0C1E99E5642E5EAE670005B078C097D16C58B8923633C18FDB0E8FF8C4610B789387ACB5A2DD0B6AE7E0DF43A6A9E8C3B89C7E5D628D59759C58D07E0687812AEDAEEDBC63B4FEE8524D10E4B467696957E6791C1E94B13CADCD0ED60752C2DB1B65E035EA72F89FC679138D3609FD2A30E4DD1A946418253C67AA69B07EBB95D4973F562CE3773430007A6DB77271D5F2B342CC5E76E115178F9C7B1600554F5C794961BAE81A5E9B621BA17851008BED9B556E461A553FE9BE00A40891750E4EA4B475216283B530CB8D479DC70B026E07889229F6017552AB9E01EDE6703FD1E2D59AF0B71E0F1DC9A42ACC5823324BEFC52CA0DCD25FE8B10C999152AA3676A30602D3506F78751477033DB7AB1A2EDC21A6FE51273B6B2890088703CEFE74F9EA89881896E5BE124B1FC9430B92F0C0568F5A068A80", - "F23088E3EAA0A6BA04D0633AAFE85203E8B1829223FA6B730F6DEE6799B521F2E8323B8793D0F7F2BB9305B3EF4F5B4F1CB822836E4D92C8E4928A851BCE688329DECA6F7285DCC85195E5BDA3B503B8AEE6F1CD7FBB158444E7DE8BF6A9A3CDA311787755A827BCAD3DA5621908EA913C0316B9B52BFB07ADADEFF17D3766BB450DD71328A0353B09DC24DE93CF83A2E5F98BA9D612187B601157D6B140E675228B58C9398618C3BF0D11A226E489366102B9C35A916653F0DB36711ACBA5F32B327F5789F3EF48A338E4676F4BC2C6A1308597171903D2AA299CE7E523C2ABE4B15AA4FC48954187E0097583EB099419047244B4931326E5923B6313DE08423DB00866374ABBF5C31A00542CB97CDFB8F71046AA2A6DBFD7E1A71C068ED70E8D7C3268EA3E0EEF2262BD7991B6C59FF471F73A4E85F4FA015E164F9C15FE0AA5F4772BF2D62B26D3EAA25CE83EAEC5EB3577CA83A68168FB64C40A7A155905CBA6E64159E55EBC928D125E55165C639F545B0071EE3CF1A3F58B4994BB4BF50C2B24F2E06E4ADC90BC1C0954A257D88444347AAECF136C15242633463DCF984BB6736666E38F1A45150B1B7D1C31DE06EB9C2F4097E9D9B4D21EBC9F3A918000DE2449DCB3F5FDDC3C773A645DF560F7E013E847E2356D33EFF1E215782638F58034B09F4739F98915BFB0B1DC124681492F58021670D03CBF5E8F962351E", - "EB07F9EDF03596ADC2A3B7EB6DB1CFC911E9A4C42336A57309F7B6C3389282E557D94BCC71827D7C5737B1C530D2A087E3F507242F3DA5BD1BBCA4DF8B78BEEC1DBF7EBB2EA1CF1DFA79E60785BAFA23658490C9A64AC61C45779DFAFC6C55CB5C9FE457BF47E45A3FEF092E178ED4495C0357B459E95AAC82132FF1C8044F4EC84EB882DC195D9CE996B1CCF523098E9E1A57C37C2E2D0ACB0EAA34B0B56FE5A0747130B1E75AA923F6F94C0D024A7FCD22E7A4ED8B201966C417AE864420767AB3223BFF56C64D4F8F557DD950F7C50D9A39AB2C742CE686C8F92B35711904C600A9D4D3DD83F3DF1ED7DB8042C76B0B7D5D9BCD6E0B5524184BF99D8D0B4F14967FA48A93A2F44E2275ED7E59F3991EFB0CBF2E26AC1F8D9A41AAE4563179254BA37028867E68C8179454B8B71FAB49DBD1F889104CFB64C8121151364BDB64BAF854B0DA22B8620BD7EE3D4302A88A115F8BFBA649CAA9EE7EF5BC95CFAB26503A9D26033370A4EF3CB8A5D094C63305A833387B4F8371C6FE1987514BB458C571E6CB5DF5FC900631652D3FA4444F8F1F0312204340FDB2092F709FDC51D2680753131ABC33712B4F1067EA1CC87C40B281E69209EDEC42C22A88950E9C1CE8130DA9291897BF2D8D1D106911743E7A9DA36220FA90A02A34EB0B28543217839374EBE79F40B3B612236C902E4CD05CE2E1C07F3DA10E2AEE8E387494E", - "E9D537A821DEDE526B441BA4252785779B54DE76F82747F8607B8952DF990F268C039CC792883B1C76C297D81C6C0CF17DA8BA2C71110B16741728725839D33B5942BC0A5614A3650675FDA5D70F29154A429A42819D6EDE324C64596F93E84CC9B2C9DA3717AA6DFFCD03B75AC96543020A9F2024620353E1364E4320FD44933799FFF083E73F5D20B83BF77EC2247964ECE442C3213DE99026F8FAF0E96302EC60067EA38C5CA0CD989475205FA38869E349FC7F79EB81F8457CA3D1A875A8D166C96EBAF1F39C88815E2258EA1A14943298DA39EB9B738AAA4E0035F9567A0A9D572785594496316D56EB3D39E1F3F243D4F16111E194FC537A635FAEB2FB4401CAA9EE0091CF3CB28B366CB5446A6D3B10AB86B4B1A0714D107FCCBBD50EAE520D56A1161E03849192F5096346FBE5150B6D04025A564A43A3D22BD4B7E10DD4061CE20FA2ECDD36F66BAAD7EA96CDBAA0F063B814707718F47278F8570F77F3B15799D0E354CCA50DAA38C31C746B17482297D9C089FF379454FCCCB8730D89B1462AD95426370AC37DE50B775B952663B97AFBC403F6F729BB9CC1D21DD89EE78AF09DF8558F7E68B3711A7D9075DD4754174802F52CB9683FFE746471C7E543FF388D024327D1866CC5CA6775C58A14D70A3ECCD3EFAB52F9AE6CCE146766A8419FB546E39EB604F43B15AB88C72741F8C7D0A7FE2F462D360676D6E", - "D79D916241BBE52B61BE8210A02543F75A47032E9C0CC128524A675E94D8F79A69B6842B0C5CFF5C1AC98D2085299BDBAEA67A41C724CA36B6275A80D377DC3A6EB4C8D0B6B88241334A95300B53FFB546163D2889D7C85F1D1397924F126DA76085BEF131A65C7DDF60DDF4086BD33B44D25025D689FF41E0C256EA12F4353D9E722EE37907AA8BED0A5A606333A031AC6B9A16614250916759B72FE6C1828BC6C1966C9EBCD51413A77F41F808BCA2534AC49DB1D32D37878DF5CC0BEFCC099C56CAF50D8B92E7CE616AA026EA1D81DC7ABC17C4705F9B57A0F99FA749F30F93DFA982A083EAE6582C8461A11ABA74B11663ED7D66EB4F8DE14F090EB1CA6D8D81CB6B063A391FD354DCEAF7DB71C277D0E92B4B463873DCBEFFB698BDCA17F80845EFD5F0FF150ADDC9D7797E21E4279B54BDD4B7C9D403D9FA6101604B79AC377780A5461499714082942313CF74AD1147CD10571A31D82871B6B3A055D50C6CDA4BDDF3871F41EFDAEBE8ABB995344DB6366E35C6E506907AD7FC76632F99124A58A32C86360FD6DDBF50324D86694518AC44F1FA19662C0EF0C0860811B5B976A96EC2A1449E53A7E4A07923E9F85794F228E441D92903922E5783F2FA21C677251B6B8DB02AC2E242C0C8652E0C17C9E3858E52DE78DC712B2DD5D2AF9A42DB2E2BEB3FB6E0FFF13DB9A1E02C8F84FCEF3F7C4D2DDC09F2A2813E8C2", - "F8E2DACDD88277D482951555C657B3E3C5DB79E5A43500F7A2C8B30C854DBE611FAC1087FA03D439AC4635D39211E234B82A91248DEE5D4FE67A02D5AE25C676E64C4843E419EBB3C4D81FB606B9CA0836F8207CD19D106C0E287EFD8F8DB5C1A3A22886C2765FED26B5189153657B7C47D5590F11C6340067B800669B05A0849BCD2005DFEE6DF95833C9E94328D72F931D69CFBB2BDA81AC83DD660B3B17D2BA4023491DED324FC4F22510ECA4A5194B1245F4F3FE334DA9C1E6BF83A3FB30897BE54C688D2A7C5845F425866F25DD0A9852BA6DAAF8437DD80BCC72B3E258A906DE079A2D33EC5C5F6927503BA13158305DFFD3F86345524394151AA557D6242060F276BB6BB25586F632942ACF5E0883CD3F8393688F360323A000B82BD89414E9C807994B0234D730BC6D7CD0A2BF75D9F510786E83EE98D4CACF20EFF86EE9C38B8D52455D8A694B689F0D9A632E7A6AC6675E190A12ADD716D2C6322657B878FA97267C1BA4631584356768EBBD1F13FD2F37EBDCD1DF96FB943942E8A5188666235B455BE2F770C9759A8F070971CBA49789744FD2F64DC4DC6E003B3F9BEC7617C7EEDF6BACA94D374400499CA6813C90A03DFE2C537261DA93A1C0F6D8BA93D1EB5FB17255DF28B78737582FD675D056A4C474A71CA8EF0D77BAEBE5637711AEA3FF2B014700448C3D74E3DF264D773360F45CCC3342987169C9A", - "94741D7F05B0CA50908E6BC14801A28E353551F01769451B1482FAD0043D5C72331246D9AC3344F0FA2E28FD00E86B38F5E0452F46CA111E92D01B37E966455DF1374883DB8B055C4DF25B42182280F86D0D825C096018D2949B4BFCEB7BB2C8A5BFA2C79E27F11A7F9B43A50AF928D81FA95CEC86A114222B99786072311025672AB04B2593C5AF50100B71D052AE268FBA992BF7868E58EFCD07A24D2111774A36115C1C527B5192EA955722EAE849EF83817FE8595C96EA2D76FECF6476D89F65A262D94B3F5E89A5DE8B1A7333EFCDFDED17FE1CCADEBA0D1E7B73E67491B413A862E34A308D5C211787E6ED8683C6E1DDEB8EE2D281166C03E7A72D7D7BD8B878D07D2216C21B855CCDA76B7B75DD1B2CB876E59F91F040D42B97050043499DCFFC65AF803E2F7455C9669DD9896FE1F62227936DF905835A644D31130A39479DE75B4DC4361E41202D51D50E0E4B4B218AF7F5CAF264DCD060C296E777DF1EED6AE8147E9B6CA73184C345FBDD89DE4A999C42AB4681D9EA3B86DD75031A33DCDC807F8FB14EE0CE61B16068AF01CCE7378C9D965943476AD21A469D8B0CAE15BA8FE04971FE1EC61D3AAD3386DF71B33FD0B4F324F3DA518F0CC0353182B3D76CF4EF5AB150FB9E74C28234CB3D907AC81CB6D3B99D510B481E1F0423D6F4987F5517ABBBEEC07F46AECEBA5F15D91AEB0FE91490E91F739D465225C", - "839A01464B473A64A3D1EA24EB363EAAA590F4BD0E4492FEC4E3D4DB5883E4873BBA17595FF48134893F16F5C4A43659C46484A268C3303B2DC345E8C98FBBA6D06946F997074AE15680EC9423D6464585D98804B3541662E183F6540503BEC204749D58E3DB9ECF11C80CD3A38F8D66FFE6CC8A003BDD35F547E5039DE9A21F70A8A07B2DD89B68E43B42C2E021A11909817C543F839E6862268E38DCE712B4D49C39A5035F3D6BA19AE028AE70CCF557720794FEF6442999E740CD6AFE6235F165515FDC24AB6F578DB2549C8065E008577FCF8B8DD8A3BA679BABBC9A747A4E2DABD91501424E4191097E689A741EB6644A771CABDBFE6B74ED3ED171DF8DE641C1D42213B9D0F8CAD1E11FF63670F5587F1FB7FF92276AB48F31751E7A591AF4F0966F3909883EE6015639671BDC3D1378750F66F5DD165912CFF1A54ED463905404EB7D3412EE2B0F0D9E6B99EC81678ABCD1789BD8F1D72D3DF8754A16DC2106B83B325807E27BCBD22A25DAC32F27EACAB6A4CB6CBA4CC90D5302BE5E9827B7AB48BB696B2902975C48B3A4BA4630B14E0FD8A050B0718C2829371BEC597387172B0B3192EF958BD1F7977EF9A3A6C80D53BC961315F97B714253B9731A017BE2CA1D43024F75E26BBE989C4D514D01538956FE4B90BE17B3407B55BD08BA50FA807D0E448B7CAC65EB3FF856772A933F0C5F3E6F41E051015C6F9B8", - "BDA2B72F0BB0265269F198207FB061DA29DE43E30847E7C062A581A7EB53491EA51B51EDD36F991D15AF89AB53198537988350FD5FDF8E003019BE115840B9BA55C238C3CBC72C0E24E25090A3D6A59BEA9FED0FAC9EAD40451A95649638FE0BB0F8FFE61AF5B9A8AB84BE84C65EA1E12E9F6650ADB59A824E608E80D1FC3AC19F418169B3879CC946165511D5AA280AE644AF360C42F7A3EEDF27E368E46480E3353E67F536E02B33505341BAF3941069567B723D7C125C8F066F9A6255436AAFDCAA8C554FDAFB0A9AAD91F1263DC62EF91A748FFB29F57E325D65A38ECB4F2851923DC6E9B7296064148A9BA2D938116266C597D9E1F11A46BE0EF526225BE750F0F3E5B0AEB7DC2140FA3A48B7238D0F5A872000782CB6F7751443EC6A1B7FA1ED02B9ABCD1C1DE4FC85E9B405C7851913C60F85582B1529276AD475AE52BD8115B6E73A53506E7A0244E1C29BCEF4CF20CFDF883392BB3990BE2A11B3213B68EC4A166C77D724CFAEBDC34C45ED09848A994BCE1FF6A9BB80C7F5CA8FD44D3FDF8DEC8BA6552C234EF8DC52382D52D2B01BB23404FC453725C7C9269A785FE09C712D4ADE7072B66295CA0C6405D9859E134FBBD3737F2956DD1D718A9F8242CE95BDB1E49F265EBF19976BC46E29F7DE0EE5C89A43AF2E107588A46E1B6762E6F8E48B8FC4F4FF93EC60938B8E5C3719022C750C4309FC62ADA4E9028", - "D240216C5C4A70742CAA03AE910E8859C92E5A90A352CB8B45847BAC7793E1F75720D44919E896AD4581E1FD83986FF235C9834BEECAA1556794BE49033E79D4CCDB4DC67C5200E8B6A3EE891E700B348CBF092E4D3FA5E648B620E34E491D7B628A1FE7E2C45586B6577E50788687F0858C10F78F371B25C712ED2760C3D605D4ED4F052E8B66FC308D3ADD4A9B86F00CE4257EED085EAE95FBB1E113FCB42CE12BB6076178A20903C55DA570EF8A25BA7AC8B7E134B8D4E35AB172CA33CC97294A5E7E579B9361B92B49B63BB1982740015DFEC16882989C917F50D5FDD9166FE1001F3282D3C54A28AC7FD773CCC0634AF7CDF225F94107C169D2F2BB757EEB55933CCE0FF116D7FFBA992F9A075A2439CCB369D5B5DE460CADC9F8C81D98E71651AEBFC2A918C551082D85F75675CDC8CCA1D3E486CFFB3B025D27C8D67C451FDFCF59C3BFA163EB791152390E9488C604B9B8116C329453A98F7A104527BC677411034CC49686108E569B7595E1DDC85918D90BBCB337855860D6E4718C0679DAB6982D23FCB6648E8561F44BCF9B052D8B58384523BC592C9B7F824B96AD1A39AEBD2232D6D34DC171E8FBF933900960F207B55597759D23E1E794507586114228A2FC100CC200D2B862DF3F26E6D1C9370373FE165C326D8C29FD2F0B3071AFD5215781BFB589F605263FF065B7A5CA3F6AA9DE3FD8BF5589BDE3526", - "8E7752C52805DD0A723D61F0BBE0122DF576A42B5AFDF9F196A766C9B3BFE296DC16A892FAECEEDD8256D2B1AE6BFE5437D4A2691803043B59862B30D68E4FF94A0700D735CFE967299724DA9D680200C898EED1C785E7B8CEB14F1DCDC73FC625F9678B407603587220C2FDFE0A47E82ADF36C26F942797D608BA6B38A3AD1A967315E1F2D665B27D51E350F075531A179DB2EED55547EA61761CD2B3962FCB347279117D1C7A7574B49FFE0991AF572A2B0C962A8A79800CFD524AAF9E6401C44569600F41F04422DB891D25B9F714713086BBFD0FB268E66A4FB10C0ABEEB31D0FBFBA20B0E4FFF404051596FC6F6C8093AD01807FA52041CD33007B205D15D47AF733966411A36F4C7B846D0BE049ADC21B89EA4CE0FBA414C005E66F36FACF3C43B474D47DAD78AC114D0171C031DFBE4A15FE1A22603CD79B6BB448B67A4DEDC97262F7B869C54F385F3682C744ED5AD6C0B6E16793920E6B45A024010896D5FECFA111CC9F0C34E728B32F2C4D45B8AA69B621AB9AC3D9D79B38BF205E8D0D19FAC44A76B9F5644526E06858F76B3EE2D74AEB1971D6B6E68B83773399AC32203164564B102B26C370A9FEC673C285AE0D1D3DF239D48B6492B89846EBED4618AEC940DC62AF4C3FF0D56FC9FBE23EE3B0A4890BA2665A88E9F40C4B6A770F9630234ED10A3A7FF3C5BCCBA836F3EDC8B821AB18D4B1D51D9962C328", - "E682E9D8E92A7837823C9B7714D267F9CE290E9FA6CC0A8432D3F7507DAF6CF681246AA4C2323C6B53BCC6E53B31F49742EE5F4E6F79DC36727E98B06D0300ED21F0CF5F2B51D8304A51D0B498F4BFA39C0049B8117DAD334D4B2E37676EC42DFE0EED63B3726872CCF9A10223A8A4563BE8AC266E0697004921DCCEEA5DD80C62567FDEBF2AFDF030192831A6FD871F63D5DADA4B270AA9EC0ACE47E75BD19018CB809B548D4F2C24831C384DD2B807852F596BD4FE32CAB3A16899D0B100E9F96D06AACB8DA8D51DB0B0F600F3B614461F5238188B5EDA68EA753B6ACC58569E841BAF92CEE04E6E2626B1FBD01B9B67D1311B1C3D67427298E2D193F0647EA17D16FD7FD6A40A1BDBB320A1F5FC64B97759AF4EA92AAEB759B5DD30A726E9B8EAFA372FBD83CBFF0000CA75F219A95D6A3CDE38B8DFA9281609A20EE39B73FEBDF6A155359476D073E7153BC918C1191C9BAAF0E0F161384DAD8AFC31A3FC1E9EAFA495E22D18C05194EB85298AB0F042E447DD627904B73E6E505712DF010531C88E695F6510C78B443C731D7FDCD62EB7C4015AB5D530BD09CE5229FA4DC5642AF176C39D60FE070DF635CC5435136C7BB9C4DC83B0D382B9BB636A6C2B3838542904D53B862585FE6EC8960A9A77783D17B2D90506F5D60998602AE5430E86025C8864883CECD7CE51B49CC2953A2A41D7EF8027F1A83815BBEF6F6B2", - "F6BD4204243CBA14DAA15A256FBCD138B5D875E28BCC0BA36855E648434CD04F49935C3D074DD5BA2EB82AB14E82C30991A1159E990D1D36DAF794853A23C499AB6B3DC02A89F014310372813643F786BF19D3FA8C463EE50D9FA87107E91C461AD2E5DF2FC99630D2005894CB7698123111FAFC0C5BC9D1E8E84FCCA5179A6C9AFE3E369222D66854F90D2668A57FDEE00C300AEA4E88F03F05C4D7695B206DE9F7E1D429E5E6B65DFE05D4C861F4E7844DDB9062C0B6DB46B27AD0368992F54A44829DD11A05AB97BA8AD854E428B87F20C4E5E4BB1FF3803809A81F2E4C109572006729A5E490E0AA40BA55F4391C9FB758EFA79B97E6D413BCB02D33A00DA6705BFBADED66CFC21291C494B7C3293810012ECC61415E609DD97AAFFDEB795DE36026B4602DD546A1AD937F1A6DEACD3393F5530C48A7974E2882CB327AE600C05A535BDE5D15AC524859582EEE2D62194B73E01643359E7B2625F3EB9FE7137514ED549A3196FFCBC8072B4F6C18CC67AAFA0ED6029A805EF0987E2F27A3260F849C68F3EF91DAA9E579AA16FDA698CC18AE8706E28C6D84CB3F593273D763C2969933D8EFA564E8C06C427809E6A5A6F76DE7C8B07FF4EDDF6CF2B7595066DFB15F5C6F3839DEE642FC86BC1F3AED7ED2E65B665198AA034817DBBBE0FE30E662B2161276CBD969FDA05AFD6D6A570C1E3CF7E324634441983F257E2BA", - "A9366308475F2D8D0C2D451C4A65A01EE58A0AF19B791D97382EC59A52616C7480B86EB1D0A83E93224B0DF73DE1D7EE6D51088F3B20B7937E6C0144E0DACA6324F0C8E5F9D93A8CBA1045E5B509D7DF98619FDDFDD7892C3082D69008D9D3ED6C9C1367D9DB7C04621D7CDD8A5A2599EE45B87A82F8CE8D60293E7A71D11700CA9AF117D630C5D8B876A9DCE519BD653114448C68B265813C608435B96CD642A420A15FBAB467692931BCA74F1F9D23F5BFDDC5B8651139B5A73F04FEF3DA64B7BD56E49235069EE5E8A136B921051F1D1C7D5993E6EEEEA2D58583152ADCD87AA89CF5962BC8341EF99CEB3682A2D0686602CE140ABC2FDF79A778A9D75AFFDBBA00C0BD6A8A8AFF9B5D1F30C8373572C81BD9594890102F46B5A393ED126C36AEF6A66E231A246FDFCBD3DED198ABC54CF357ABC67AC83680C048932D7C902AB7DB16952B3C95DF4E845B46A362FFE1A27CD1388483FFA41AA563933371C0180848F9E3C03AFC1F00D6ABA29A953327A4E3D9FAD4616C8546C9AF89FB4D08D4256923B736A8F68FEA5A097E0640C16E0F7F942E6A6F5CBA76BB00D81C606C7FED908789A63F01F9B5FC7B7BE434E85A0A44B2070BE71AB2BA0132D9D7B32E2D2FE229619F85643E75B4141D355386D1A09F45738455BC21607086C7BBCD4B73F87DD83E905BCE8FC6C5BF1824E904C4F5C26518B2FEBF8EB06B22437270C", - "92D87BF3F54B0445C05E508E80F9CBC0502F0897D717CA232004362F394A023BFBFE3322C1D331AFC6454FC756FB48768693FD5C46DDB40DCBF14C726C24ED67D8F3EB613BA80B0E39CF0747DF62D258613640D881E085C377DE1C3D149C8359407C2C6ABC0D2718A2D42439A8E7B38CD7DCED72AE750B2BE88D0069FBE94BD69A9A4B4AD42FEC5E651A31F86B90DC2FEBAA6FA6E5F6368B620C1750278DF393F7C5035D47897FC05FBC419A61330135F24365F13D653D77CA2930DBB05A3815FE83F75BB1BD8B2DE12A2FAADCD1ED62329C55B87FB32CC8F3B42D888981B4192480D1F57CEB0C55897BDA6B9C0ACE1E7E4595E30C7368306243208444FCF4574C47B07725B25EC2E28F4C50B744B3860B361DDDD22D949AA94EBA4F97606FCAD91394B6FC0E634BD15E099E697403B2AE84CDF5DBDF36D91FB82C0BC12B984FEE83CA9E97C194CADF8382CECAAF49EB3BD446F660F94C188C074CC312E186BEE0F6585535B050C226659A94B4C4974DA32CDFF30DBEB4DEA588C6F490F7432DA5FA2408BBC931EAF60EADD7B891A61C157147B8DDE7A45F909BD20D5B12009783DE410940245FE4E91ACCF72942E486AE773CD665912173EA29875A1722F8658C414CD08CBFDFE1DD356E167A9D7B20BF7441562EE816435A78BAE7E5A5EB4DA6AAAC36F594C93E2851D76B6A18B0B03B30CD38B97E38109C494C557643D58", - "BAA2716F115D72D2037841EF9138D19833C7C5FF40F058A960826E690315577710EFE64BB37691564B3B0B6C577DA603CC3ACDFE1785541AAD23904758A5A13BDB018E7169D479A1FAA031CA72FA6D6AE9613D6B2F82AB07500B49DF535F86A76350C140F9CD25295D6BC2F38C5D13C99540E2363862F06DDCC486D884999BCB840BCCAF2AB84F5906B9AA0F77D6432F6531558392641C52FEAF9D8ED86BF0158134129F34ECD0768BC02ED442254515A74999C6B8052A1FC797F5720738C69DD9B3FFABDDC8515CD279B246EA7C67754920038C5A4C8D301119CEB95FAB2765DE39DDA84180CEBAAFBF4976118A8373FF6BBFC7FEBC3CFEAB1DA69DD3DB9E428C594950FD51F4D98A393BAB96001461F2765834ED70C60BC56406CFCB3E784C59B91C19783E67CE6C86713C43DCDA9512B2E7173AFC2EF9A172C9CFDDD3000D7A981440AD994C39DAE6FC0B645BA0FD49ECAA19E572ED0FAC748EC837A7D6F28A8D004402F71CA209BB9403B21E29836C5FE897268DE0736E985F9631DFDD1AC59D5411E684BE082F41108E33D2B92B2D45ED70FA52EA2D6DE121EB9F9C886DA479464A9DFD9970A406491E334372D7B78936095A7459BFAFF0E9090C2C6B6D62624A79334F879A5C92C685B50F75F04BA664EC95893FF40D62EEB24DCDD288729D0C297DF5ABB83C77FC11D0EA3EF18E3BC7C2C065CAC51390C610B591D24", - "98CDFCBAD056240E180F347C00912F2D9ABEBCF5464D410BE6A50404B830F744D78F7D97180404FB3BCCC2288B7991810B2562C4D509200CE1F9C4DF6DCA4C600D9ED49C9C1456141C7B71513E728D41970ACDB6C15B4A4E327B9A87ADA73D1D46EB0A21F2F5481C3B42931C51B780FA526C29B98E6B9C714B20049F7A05252CBB84B8E36026DB2379C9632A0843436ECB72D15EA2950ACDE18DBDC6DFB01BF08F7E191EC885F11D1D8B7BC96E9836B395108F6854545082A694D5974CC36C8A658349186C1BA892DAA85D3F156BFBE94C73BCD815E7652C38E178AAF02014F0E6F23A4E7EF689EBF3ABDCCDD40E2DECED316F07E20716927C8F7B203D51D957EE6EAB062B99ACA0D28E0AB50B516CD92CBB9BA90333E73D58DE0B4B633D81EC93D15EBCCC813EE63D63BD18517F4FE85C37469574B8122FB91388123E1D5E805166FB7157494F8559F90A4FA3DE9E71DA6FA7CCC6086E638BDD4FD3E4487506ACCF84F1E1678D714B86FAAD57A6B76E085CFAC30DE469BE32E2D203C63B43F073DD24F4A1E039B941E7A97F8BB28B516217455268B6EFBB0E1745C23D6D12A8CD13E5D242F562F56FE92496342000A731BF3DB0A7D3110705DFD0D8DEFB85665B77347CEFC8629F3757304F6129DA9845F6509FE3D32DE9FA86EA4FA9BF86FF7CC8E726C0FA9F93F889C467642C5E944501BEF8ED59793AF8804A9951B4B88", - "906F6C5A1D3BD03A03802EEF5937E214E87B5E2F0182BA2C258F44B516EC66EACB705E06EA6DFDB56600B8463A421DB03A51460091D7FE889E6DAE32EC19190E7211F08D37846CEE7364B6ECC07C1740CE990141C4DC4CB0AC9F25CAFCA6BC9111102EABA250ADFD505201FFF638B31A77CCE7A1ECB273F9C8ED84EC2F403C1191596A53EAD823421EC47DC5E78F3BD1339532C97E4EAA024CCC906EBFB870C1467C3D845A178EB07C11BE8D57E4EDEA7ADEF162923E9521451B871DF6E357DCEEA7F62022106F647DD8A23074AC10AA632C56DC32B34A4A184FACC64E5D1E8FD69269660543EEA2FD584117A3EBCF6268352F0212ABCE7CD28A93C9AF76722FB5A71FF9E5AC4579A2BA32B91818CDCB62C77A6A8EB1F4C34132EB463812B329B6B22108AC36E71F38338AE3A52C632796E45189632B73FDC0BD37A457204757261B7CFC01E06BC767A57A5FA7CFE43794F65398A94B4EF09D6DC2A8691BD0CB018BBE7B66E0C37BAA4723247AF3424BDE22614A9A581A7982E8C2323178BD2D46E6912A2FB2D2531819A180689D7F2C9B5C5AFC2DCF1C7FAEB1927EB79A72EB1203BB0FF17DAAF27D66022195890BBDDA786CF1C36ABFD96BC36FA1D2A5A0CC3D7EEE1A1050CA840209903CB9FF429C7EE9DF9CBC2BAB84CF28FAEF5BB45AE9588970A28B6BD9ADF8DF134C1FAB0DE274B5C7452C4836A573A26A0B4C14B74", - "C6D5046A5000ECDB54C872F2DC494F2DEB88430007C9BE8EC39FFB148F00F7861D8277589AC839AAD30AF7D7A2E0F9EE8217A39C521311E9BD59A71BC6663A7738669D6D3BB28124A80ABDF905DFE2C9539CCF0C8FA39EF84E9633D63BE0C32F3B2AA9FCDC18AC38C3C00924E9D54977BDAE61410F997038BE066DA6C945D8258B7DD133EECBA836A7A6A2907C431C522619D466430E6ACF15030F7FBA4F3D6BB545CAD85678E81898D2DE358CFF3951C8184066B18930DDA867890871AF6F4133B492FC894DBE4AA5F1E44BD361C4560ABBCD3101B4AA4E065FD60308795DDAEBADBB604A3D58776006CD074389AF49A0EF09586410015C7DE4FEFEEBEA6262B23571B93BEE15CDA2BBA60B6CC72A7DC9C80C81C9A25FE3D149C7A8BB2F704BE11177F92E2CEF0BBD12C0766D691CCF093D456AFEA411A8FE5F1C1A44F31017760F0D0CC3B271FB15F56D9F51A594C34FDFF8F8ADC91584ED8D7E1B6DAB27B2BE1BBDC4486FB1C822F23704BB2EF4B521E02E42FDCABF69588B0B9D92AAA73116D26E8E9E48DE94F6267414AC845467597B4C1F2A9A8E1E82C0A1C05955022CDF87386098EAFC5BF1A040716A89BE53A36B143376927028A561BBC07AFAF42494DF5BC0D95170D853DCCCCB22FD36B7947712EB369077D02BF85B0A4F57757ED80B247E521AC640D1B1CE30F93DEBBE2389D364A8B7971A51AFA4F557A8E12", - "FDCF36E6C842D2ABCCE9D8783D0D7A7EB74992EACEEF6C618AC7DED4E457B1A708BE2C82B28A9563F4A088FF7DB146B16B47A900DF49A4F3FA8EDAAFCA09F408B025D04EB673E105E0F55959B7951CF0E999CDF68EA9B32333DBFE0516D272111CBBD9933CA8AD8AA6025E5F9A062D8305344CAFC3CA391BD8DEBDC58F7FDBC041B349900E397609C71E4EA3A9D8407C63E8A6BBEEAEFC92E9C939147920E48E35DAC6D123DA46E4F0838FD732E43FE4EEF6BD68D5AF0C9BA3A0CB28233743B291D4E10054F695DC10A847E661F39C4C133289B07ACA8B544EE3E2EC288CB18C40CD9A8E48A93378FD50E077EFBC21996424B539A397B3D2A6C7DE58112CF55E82E8FF10F75571A15DC248E6B77CBB91D8BF2D53E5C4E9A85C7EB8FB690F74BE029CE1B569EFACFC16872C5008820FC6A7D12AB43E08B4AFF57DE6B43B613DF8480ACA556E29D792C6C81CB1CB54A67245C571A04965267BA0F9CD3FA0950B9A5B393B4A230A41E455267CD396F42285F0E49C5AFA0B53EC7B60C1C317EDA3FAE4B1713A80D4EBAD32FC685C13649C4806D6FD887A24A4F7AE801405EF28F058B37112A680F9E9AD0456314E9F490393CA25775797E4CCF9184FF0C6A237AFFA8DE1B84C420A6183B1D49D6F2AC1E673E7FDE161A8159DCEB00D85F032EE76E3931C459CE935DFE4AD6C6110591EE58496B82A16630E82320B9510880BE4E72", - "94964FC9F66389FE3880283C4250E6E19F195DFEBD2104FC0959E084308BC9CFDC6E5ED1C4B48B4ECAEB4FDE5F215FBED85A6CD4D1C1466E68A4CF21AEF29F77933549A3A6FF7ACD8AB6E6C689F1E8DF0AD8AB289D5C33023DF90B21A26320CE8C1CEB2C099FC1DB58737665855DCD20D587E176483E33EF14C80AA4760F751EE5B28460811E5110FEC3D689AE2A6E91D0A3F1E22623E88571F4DAC895AA428D42634EC142E56D0D57CE68D7949BE13AF234229E546E9D66D5C58E510BF3EAC7B73309BE16DCE6E2280AA80247D9EDEDD20E06295C9876B412B786CF7E5F1073792158131AFA002FE7750A17015A9C2580646A9A0D2A3F0243AF1AB4FEFB3D028504553AF9C5C34D1A4A2FE3B8DD8BF8CEADA82AE63C319BD7981D97155AA2F105D724A8C09310D5C316877062152419A006ABF56AADED74DF0DF325D666C31DF51F194CFEB331E7DAF00410372999D2D05B023B2C3067E6CE4A472FED3B8BE1C15C24DFBF4956A5B670FFCF128E5A23039764BE39CBE55636B83674060B3CCF5EF9A7B7EAB0813ADEE82E271C422FB78A9820007753B1E62BF4CCC074F7796D5B2008FE6542DC0C77ECA3810120ABE9F90BE5934E8EAE365D02B3D2DF4EA4A827E033263B113EEE5823DD3912FB31E3C4B46B274D7115F34CDA793DB6AD2CD8BCAF4B13B832AB605BE42B2877EE2E66B411668EA29A7DBA5BD969B9F152638", - "9B8071D96E7D361B2462CA93748DE4D31746972DAE582AD4F70A188CB40C2E6E418288B6A713ED4B647013B3EC31C9EA6217DE55D016A1977A0B285224129CDC59A9E54F3E5094258F11C0C995F60785614E560764312CD86C6969B3274236EE602EFAE392C015E4C3972D6FA2A47AB48D5C5F6836AFA54F28CCC03BB4DAA0A1DC0DCA3FD3F2B15FB2ADD907D3BF7719D1D9A8284A47C30F32712A8CD440148B8DFDB851FFD25ECA2864150B832F8B5DC3A7C701371785A66285601E96D285FF88947804AA4D88665B3E15760CDE327FBD21393042BAF62FDCE6EC41955E877ECAC331D594ED40547AFED34D410714CE57FCB4F01C8826519ACB85F447306C86BD1BA8189E0621DD09451E8F341AE47E7FCF1FD2DE2AF78E0AFA27A4B6DD51A0710FC1FC4A5998234EDAA1D4CF0786B779F637EE1A72058774C1B4BF5E125DEBB4230645ECF87E3C6FDC91E1D14397FA72686784815D9654839AE8FA43864709EE0F4A336E3C399CA20B2E652E2AB17719F9253F772EB7A9E8838FED4EBCD0F8CD977583BDCEEBBD925676F56AAB0C36F3DD915F6691A30D60D523216FB233CBBEDE7FDFBA827450E595AB51237F9E77058E40F862D3A5A96E4AA3DA74503812EDEFA501E526DB6B4C642222D7F33B06D9CD0023471DF5730CF8E2BEE834D108A25729C1C1484C207ECEB0E4598965EAB5216D4E7C30577A89FB8BEC0B118F4", - "E43093167F77AAA20EF9F4AB7D715CD0E86542A0523BDF0256BCCFB1FA987A6565F808C03C71E6343EF41D2ED4C4FDBBB1AB1D617BBBDB776F07B000922FCBB3718F5FF326A7BBF4BDF148206411E86506FE5CEB8EC0F7AAD1DAE3BB46482F5E85D3B46DDF93F4BA19DF9DFD700C35DC038CF4E499A058995AF06BEE8535631966751A85571271E6877BE6216AFF16AA2B9046F1AB9126E1DCADBF40C4B390D23379D52C80C10CA05079D1F05CA294EAF7E2C66B884DDBB52DC85A45FFABB2BA6EB95869689486DDDE372DCCDFCB408496E647F33575BB99FF1699219D00D2608AEA1A47CF52DD21A3CEB3F043AAEB40EB27F042D276227C09CC8201304C55D254AC228FF309FE8DB74C85430FCF9441EF1B51A1192703B140CE3703E5848477FB0BBC2E82DC38702D4C6A78A41729B7EC86F9890EAD369DE4F25EAD61DB0B5B0ED764EC84FDAB904FAD9DBEDEBBE89F338DF52F7A6FAC8EA1D76001846802B328E8D1F110219BD6BB51214814026BFD6E32627B696C7990F53591CC811A9A09A1154A50585B882DE0B404D7B5846DBDC8C66E4AA0C7B90B08CC96A5CF2352A6592BCA536359C863D639CDA60FD23326619A9014FD878EBFF3E73E4424B045CBD506ED744D3243725EF9491D6165D332FB12985022A71C7DD4E3F942AF5CDF2396F6C346088EAE89535E1B21DA8F7B2E1E12DC8A37738310248808B9973041E", - "F5B9B9204186466AF61609CC856B6B2B33D6F526EF1E4BE4DCAA1E1055F033072B3801B642700249C024414B3217D160513E5A804B3AE8425852CF5FB9F51D2601F9BFF9F5E4512A45ED8F615A6671315590DEC31720387533A4E090646F17244EB571DBD6E6A10890FF19809D935A5E88228D424FF2E54B1A37576C059A756290BAAEA5E36AC977526339CDFF915A763B2CD0657F3A3D385A5D92466A44980AD8A1B4E1593DC177E2447ADB53B1EAE15A91BD6703E46F01AE91D6C316C1DB983688576B3B2BAB280FF196D5BF545755097249C517E1271202E3856475A3C95324F827961DD7A827709DA2924B21949B6BF032675D80FD120180F6850BFC385E72399F840B80E5525EE70B89E1C524D580390D487D0CD31AF3CA5691067BDBE8E2E91E0099F59700CDFCFDF8B3ACBEBCB61DB23A28E80C3E463D9E53328C37EF8FF0D4FCBD287932C8197DF57EEBC9DDB29E2046C7FC14970F9F37CED37D8BB0958155192C8595E2A9369944DAF58FCC1D9E1987DC4FA77ACB256A65DA78B733178FED14DA3E3E41DB808849132EB05E48BCA03ED499A314C857FF7C7C1FC8BD2478635396BD7F252ED984C102E23F55450F57ADC7EAC50A57B78BF4F988565A172E878638ADB1D992703D0BB742605EB76E3C85319F567D71B9F2E40251EEB936B323DE98496229B1F8A996AE4F6C0C2FBB3B2244F3BC57EB3FD067F535102", - "A7F21431EF8C75A1E9723B1FBB602EB4B92BE5FC8DE70183659A45A31EDDC46643ED1287A69DC876634231D3AF95F2D02FC9C0C7BBBB12319CBDBFDF6CBF94E47A05204AB14A490C6FBABCF329B5B0EFD8C2FA28845764510624398BFDED1B250003FBA61A67D2127550FF07A6FAE2CB5B8FEB23D289FA235BB4959F8845B25405A75A30E7D05D7BDEB721BFD4A998DAA6F1A54712901551E30D618DC80FADF7CB7863EADB7EEE708F1050AB0510A956C3C7706756B6CEAF611F02656C3CACBFD9E4507AC2B4B78D0EB0BF757496C84C7260CA972F0F45A393A89AC2BD70F15E629473D61FFA29BA18A468D8D4B1F72DDFF99608AC9E6A6D6A9231F24388991E80FBE6A9269AD6D31182E79235A0E33CFEE9E3526FC068A9253789407AF8CAECE14BC337FCE02333B63224A61E913367CB36641A74E2DB2892C4E939A50127DBEFED7456F7E61454FA5016A6B75E6133B0417C2860B2F640ED8EE62D5100EA172BBF8FB02E2022D29DF33C25654C96F8FB2305B72A92105E027444EE0F27769946A67E58D9A26AD01483FCA4BCDA4C00A8119E355CE733474349DC8311AE9853A064931FD68D598B02E0724A13FF63D88416FD5D03A962B5D8F79586E696C484D7F287773851831EBF33B0158F51C89C493C116157D20DE66F3990061135F5CBC46862BCFDA5EB0322793BD6AE188698A2E1DEDDF71702B6CB01EC2BDF85680", - "FB2C4002173D1E1581890C14672C1F232E8A1332655108F24F78E53638EFECA3DAD18D19FBB1E91C6AA4761017DB37FA76F70BBBC4C8E8015384DC9E9EF14C6AE60DE55974D448DB8C36B030DD55DF5EC6F6C56DA8CB9BBAACF6784628B669913A7B291632730C11710D7E181401FB535FE8A9A0B81578CE54123A6C3897496375CD7C60BB4E05AD16BDD4CB8F652448E3020EDF4D51FF5EBB9FA93A740AE779419002994348358CD7827A63BABCD7C4501CF8ACD77A2200059DFF5B180AFFBF3CE52133C7451CD108AF9CC8FA32428AE9ABC55D89E1931E6607160BF96015901DC097B56299F9F358DBBE921FBD7D0DB43C9C5BF97468813C0AC632D35C858D8384C32EBDEE933C9037EC36D2322F54FB0D3CF305801DE42B4EBCB5F83F3D3FCC1AF56910B7A547F50F851079B6D0D262676145C27DB362AF383037FFAD5E3B26BD2095143B361F82425734842E2153C5F428D89DBA45EF59BD9DF1FE1BA941F172A685F08C18B76B6A8FDC86EED2867A57AF48E00467993864EF70D80CE5550C5EDF085E94435ECA89F6513D23A56235739534C777C17BC6DC7BF6E04BDAA9B0C94C4D7AF1368C6B4B9D3C97D25A26B05703EBC4D1F8869C5DDA359D189F4A3E548D53731FB429F3536880CAD9FE13F70DB0A080B949C3636611CBFF0F644ABA8B56D2C6E988B3392A7452A8C8E52F2288560331A78F4CF021D2A41B2ECB6", - "CB7A566070A06E759017D62CF78A429913370E6498BCDC038C1D3079A0A3E6FD4FDCC851DCBEA9EB3A7D266479F75C40452A282CB406E9A2581372BE2FFBAF6E7F3359EAA594631CEF876FD62DEFBB3B816EC98A1F72B55F6023B572A51F320CD7ABF489AA905CE2274729C0EE0F677A04D7449A489BD02704CA65BCD8B753B689CB90C87C73FB4A45219DCD817E9AB584EFF049EA711CD3E24CE41423FEE6F258A65CA8EC3A00D45371EC5B846CF1549CB5CA4FF14B696140D3483DDC7801BFE6CFEFB9189B5C7AC3DB9C0709F630D80F361442BBD22636B00530EEF21D96D4A12CCF85E0124939B025CF35A0A5F1B4C2FA5B5DFCB3772CBFEC1F0C1C824B5CC22BA8FB2DC92164FCBC60333EBF920A14599F1E8EFD4E8CB0257134947331D820595BF5630EDF00814C32994039B47E8784C29D0D1C5B5D219A9F55FC14CC18DACBE6A79698A8073276A424BA9A6606DFF369CCF5F9F4AEC9605F6E44807507B36A4918FDAC448E3134106683EBA80A2D97E12EC2BC1EBBCBADBDC631CE7D61BB9DDF143C3EEA4E36EAAEAFC001849812A7CDE3EBC194A51EA2A9A2AA15A0A4F29C2FFD8B2CB4ADEE99B59553BB2398273C04329A5C884989D417C131D68E9B505594C9B9CF1C13AABF05093A9E4224D71B54C6F61F1255E25FF7527E47768FBD51523F42915133E02CD7E404147E7AAE95BE651BFBBD65E29130D0CA31C2A", - "D90A7D104DEF06F51CA5FE107C115C130B8823C423423608DEE00E0C2E6C202B60C5D20BCC9CDC18767D89E5E7857BABC9531C21B08436AC14C5B34EB986E5521369BC3D9B1FCD07C99240FD0DA306C69303B310B8F78D2BF97D6E9E88843234D73214431F6BAEFE5109AFDA22C4C348A469370BBF9B0A81CF27ED919A0A48DA3E9061113C56659F7561175A608B7FB37A76EB9E5ABA5F4A6B485EA5D097482A28F4EF7DE785D31DDEBFE41DFF7C51CA2B64A0D2A7A70269FDE399FF7628202289EA97141F995FF51DB5AF7C9C5CA76F0AFB4981D021FEA9EE6A49ECCCD18AF290B6C231265247DECE33B3E165FDE4FCF82EA84A4A8AE3FA90972D96DB68550AEF21FCE82E0FC75FCDE33C2B6F659A873AF09067D94B068DCEEDCA4D392BE5077587785CB6A1F1947841F483BE5080E85B49F1073D4778A39239266DB2A24B57B5F51B1F021D05C634D66DAD081D1668EF0520424581E5E0B62ED085D005F169950F971E1493A49A60A595342AACBA236EB16D5EF94E749889E50656D98F94EEF205445AC027387AE1363696185E24749EB67518B89057899548BABE29F3487D273C54EE2BE6254C7F3ED3D3B22FA3FC94791A7BC7C499A391179368D9B1F0DDC325F55022F5AB7B91142E2880BAC761D154C11F2C58F4A42E8B3DBCFD44777F08A74676DFB7039F24C9A4C4620726FE12849C9D3C15293A3DF7F4870DCCF56", - "9D238D97CE04FEC0D292181D145EA0EFA727DBB7BADDCC60357762D262DD7D7A3BB0189E05BE490018ABBB61B154F94A4FA81985E774019CCCE4B8ECE9858C0C2BDFFD7923B3354A2144ACCC5C9DA34E50299EBF68E9BA0A269760386E5531F8964F8024ACC99E7AC3F40BFA9D94ECA1B14A1B173A06867100C57883FE7333C079C5871A8A7603395A87387EFB92A77C5812EF548CBC3B9178E874E45DFA8796BA6FECB5D81687EDC0AD5F804FF36A9CDDC58A5F991A2A0BA999F86E663715CC79A439DEC44C394ECF1F14801D8F9F292A648D29D2E910032F224ECE51D0708E4ED6D3E65FC788A2C1D286750F4B6D768CBF1B6EDE8524C2A7457A82404A491DB5EC868E6B95B02167A0C4E785290156943FA091F28234C4CAAB586F8095895FD21582E0356BC15EC7CEE893E70902CE4D01217474E0226FFF30CB78597726C74B95732E44D03A626F1D1DBA7785F55859B71C2DAFCF71D99EB99FFEF4877518C579D2623FF6EB326B8D6C7674826984CCAF98CE41724183952EAD69F05F44750F3B857EA01475555FD25A828BE1DBEF5E8B1C1237779E9E69D35E7BA9ADA124CBE710490280B64B2DC5EA2C41D6644012A18B369E3CA2FD93A254C493506C54FA6CB4DFE24E0B5035230F2BDE6FF21101164F322B4B066ECBCA3BB4F3C476B41BD02D8948E555AF74EA13228F07A1BEDBF95FA7E16F2BDC5D178E74FE5A1A0", - "8DD8032BC8D741905EDAE449212146878D8FA15AB037E41C36D21B0064D65BEBB74A18F4370C80DB44EE93C2AB06DCC6C6FE7DEA83F270C9FB52CE00BDBF546348F0E6285A35A32A47512823DD6E22FB7949071D4B58B46241544AB97B0F6023C70AFCFF0C7541B4B9E1FC6B3C3C55500251665D964871B9D1247B3A9728AE02FF47368053B1DE928B6A8D01ED3BCB18A3180EFC9700871F480959137CA1480C3640547497ED7CDB4912ADE1385F9F35B6D27BE64E362BD71E0981BE952B00AA20DC57465DA89B87BBE07F27454FB24B3B86766F95A5A5B4EAECA2620C3BF87C0654E6561398F27F96178EB1062E42F6E6AE0A669FC6C7170F217C850E822B4E70C9033A375BBCF6D62D11B3DAF7DA976D4A9D955B924E7F0A19CE77A53EDD424ADFDEE8558F06887E82A936193AD5E508938DD3FBFE02DFEBD98C2272DEAAD8AD3B0FC86C3637A6CE694DD95E4FD55F433E151D35DD4C930177CA66322001110B9BD0B89A096C8C3A3431C100E39E3D2E65504A770F4EB2F19E9D8FCCAF15B8E58DFB52A0B88406A48A036193F3EA9F8ED2322FC69CEAEB9E2DD6AC627DCF4CB109EA05AB5DCEA5F92902F3E7BD457C240C958FCA7B17F2EDA1248961C9C827E99BE0A3D60B3E27E42B1FF696DD58E48C7B832D8FE95529B9C8F075E67294C1B1060EC6736DB73FEF7407B320D850B049D80F9F4D536361038C4BAEAD92F24", - "C10051089B11B578F56E6C24FAB973C5D1B4A2F937E4A402FFCC45267F4A3F4CF4EED3DFF530838A570000F7E523D1B97FF798A3C6E12F9704126A9B6FDF606031E4D8E1AE39A470FE929124FC95961B85A5A6E10A79CBA60F54F37D4DCCB13FA3B0A3A1729184C59036428532E3DDB3F7B8D373DC08842EBC2ABBFDEB5B73B2F9B7E83C81D5D0EB3037A32AC0E5B6CDCC7CD84B9289BE16106D1D019D47209AFD8DA78EFA0F9108377C187B170CD53F366B17899EB41903FA1627AA245C07EEA5D6DA78039B3C4C1D70DD28870A40EE3A048D8209C4088A0847D6859513E01E0F4172C383D64F0B307D721C01495070336A753A75E1CA433FA973BB131E558FACC298C0A6E934E9F717E19EBCEA11EDF3736D4EAF593A8E5AC8EDFFE4D2B17B613E024B41AAD19BC0A27A1E9BE9D25344D4350596B9B0A48AA014191511B26E61A9753D8A38C4E3BECAC93E67CAB5696888C06B9099E9AE856486436FDD1AF1C193057AD1DFBBB14AF772F7D9B00F37A6DC9E805A8DFD9D53A161885E5C2C2A6DED0C54D00A8E0704877DA2F1EB6F6D8EB93B5604A4E2545D454C3D4F0D606AC192E170D44E85E2ADC91E54F56906909024DEDB6F9050BF3D3928D9AE23D9C42576AE4DAD1336F47519EDE436C3B1829CD2C5A0AF63476C7928B32F5E51826D844A1DF765C5578F9C2E5F79024BFDA96FB3199A3C7B47D3755FAF376761B4E", - "9C6674915677A62A7AFD4FCB27B45F8E6DDDD08980B7DBE1131E6E2425C5ADBEE8474E93A8A2D4E495B195A6B83F2CF6472A36E690928362B9A1FA994A9FEB7BCBA7FDCB771F59FB434ED289CCEABDAFAE29113389EB98D6F17E5508D5976E11BC8A1E93AF9F7B1C81686265930B4D334568E3F29E1C2F58A62572A610016C1C1C1C9E1D0EB3FEB2B3A210C59EB3980C44BC656FA7C5E05A4472D4255B40B8A1604FE39D8B5026A976310648D5C84CEBC87A8BF6545DC843A3A0B64DC4CCAF2D2203122DDD75BA42E096844899A35A899FDFD72C26E3392EA03351DC78BB9F62F51D913F8008DB00969C64003773FB2014FAF97E794A45792495BD52D7BE7ACA47FF2BF570CF88303377092B5B6BFF3B01D38A53E8A68B0D81FC2D1D375EB27C7AEEDD70679E8DDBA6DE656442ED951478FB96A979B4A9091F344EF39AF23DAA886C6FBAA8611C61686332C630690109E2869D18EE7A2C21B22921B9E3DE40BF063E370FF64E7AFE160B7EBFC4AF6AEDA043042552F5F36C2CABD339FE1442242EAD931D1B83968D1A31A7E32A0838401DBB9C1034D56ADCAF5942462EF63440FD70F91520137A50372D0D125A6285F7D715FD9225D03A109E1FC5EB547303CD7708F88FEED2814607171930436B249924714E8D8E024C24B3C0C9E40127DECE1AD966C3F9DF01793864615F291B73F73D27B624ACBEAD3D371B8D4FDA823C0", - "A1B9E8AB6C44A3610768CC17E3B899CEDDB44B746319EC50BA7E006EA0F3C09E9D67EF8A20154B2F93EC265B800503BC72831800CE0C9FB6CCADC8327A840F69DDF29BE212BEFE4AB1810026FF786D9D3A88B29745EB61131FB47B385F83CA211B4A2BC0449F7ECE43B2DDAC94C10955FF2E078AF573FFA7349907571AF501FA6A2FCF24E4B5676F8213475351C0398748FBD60A5EE8A1128C0998E57D076A201453EA7C70B1F171E7D084F444311C9829CAD03E0C2330D7E8D39DB6B7901C30787FF123CFBAD4E974A5F6412FB1BC927FD65CAD1F3AA4ED52E2D84AF6257EF311222467DE179E89438524116D8E0A4A94C19A4D66D0AE0FC535D69C4953C2E43136AC07D6A5774D59DEF1471B4097146C2124DF83D36678FBD7BEA6E258D826645DD88AC9A7EA5E05FB49F2CB29EA9081323FFB2A00F3915D1F36675BA1C9AAA3B166D9FB2529150D3573E502668E33DFA5BE95AA6C2F1F106D69218839BA590406B4FE4A03C4B16E29E6BC31335234BCA55D34955880B702F08203198EB7BAE381B231FAFE513F24C8BA9E58798F35465C2679DD5BA8B16EEDAFB04E5A807B9BE6EE4B3AD77609D2B9E0985BB23397BBDE08F4D0B21494A3129857E37D13862C1FF77A57AC663C206A92F8358E6C05FDE1A9D68131BC04B76F6865E8DF5C48F9424CD9AB6FEFB3B49BA8D32C923CDB8602C5367AA9ECAE48AEE6A276CF25C", - "ED1196222AA470CB4FC8A0B7D2C785EB45D232E06453B77DB76F60E5F7BAA0FAE80467EC8C656FC27FFDE8BFAADD2368B41AFF69460495923942ACF85C09EF01BCED0076960E5CDB1D36061933C1B6037548D27932CDF969FD5A910D5564F3A6BAF896A2A69F40EDA76E813AA261530F686042235A39A76081F58D952662894E6E648BA72098D840235EC4A2B963F8E74B52F2D0088DACA7EDF48115618DBBABC698C04AAAC0632475BEE65BB26A4EAA08F0209B75EB259B826724F580209F8B991808411F823819CC5F42A9FC1F0CEDBDC54C046EB1D1658FFF7252908B09F8C1D82E5F6D605F0B17B25506FAF91D4B3D4EBCB7A705E5BCB2A6FB409ABE4B1B0B47630F1AB0B40A3455181678573F82A7C139F072659D80671961D614D9F7DA72914BD5D6F417EBC152595972FDFAE876176923CF1F2F745A6FC27E134CEBC2D9AD5CC733F619C1B296026B7C4717D2086D91765D83AB76605050B810C542819BBB7CD87EA2305AB4A567B2C500D9913B7C6046F748DEECFE3C3AF829EF97E03799EA50F7C9EB38990F0D466498C091C3ABAA18453B173F0AA3A486DFAFEEE68E7998EA30E5C1349F2A54AE753963CEF58332A114F964B83B4E446A44147B11FFC60DA25B5FA705F34725B1388B17E99018236BD646DC714F8B7CD3BF2648063B2D3FB713AB94D82ED81D571D5BB4D3E5F2F067E2F2C90E8B6857E6A651B8E", - "EBE597534C0A6FEE9CE6AD10A80D2DFD160D7DE7A20154F62AFD7C3187D51D09DA39A958432CDCCBD83FCE19131E65A30DE99DB796D93D0944223D960BA233798323D368DDBD407D51B80350976951AE0E50CF409279301939624C741D20D5CDBF4BC3ABC8723E267BE75707024F6398CC6D32A7BCD0989555E0EE49C1A2354D1E961CA9910A5169ADFA71D56745181E0CF13469D8F3C6020637B8118ED8421A680FD4D515DF6B31C39ACFA36B601027AFBC861493D34ACEACFB501DF9A311B7EB9D38D7107E6B5ECBE74FD35CC8BC8319DF9F1948653C94C868DC24AB8D7E650D8F70A3D1D878558AC9BFA50D425604037F3DA323192654F1296C8320AF934AF60DACAD7F9630EA4ED0A635678213F6D09D73A2544C779596990DA42079C23581E22F541E6A3B6D3FA383597A8BDD7CA42930816D74FE8B12F92CBB9303CA5FA12BF5FE954FA7B53E0D88B79BE263B4B55B42A7672F5C4F7E6E2DB4C02AFD6034B7371E01215CED3F73AB8E3419D7447781AE5DEB4F4547C5549E9B0AD59940C162790650344E5ACAB33A187A58E29C9032963F088C044ABE73A855FF1FC93AB8DC258E419777311B7997EA95D32CF1F0140CAB9E6707E73E4FE575E0752816122C39B8D12F34ED6771EAEE192D830797DBE97A0BFD00E39CA382D44F080BB4F8FF6FAAFF2A82744C6E14D3036E00EC2ED5C9D184ECCA300030D7BD77B27DA", - "A56990B45E9AA5F9523D563D53E854A47629A4183E85CA1995BB374EE5601BDBCE5C7407999D28FF0F1B3EC7A463D3C941C57B7EB71E6262DA3A7136627814EA6D28C8D16E91680B0D961AAFACE2CA4099F986CD45A2AB387E39497B13678447480514B4008F0FA3B95AD7D2B4751C680F0C7D3651F9621E1355CEC76F10468ED33DE4C7D7D68B786B7F0006C604BCF893739FFE6AE56AD5AAD07D5BE76DE1CD581B10EDFEC9DF65AF925C4C1289837BE1854A62FCCEECCC4E2AB47B4864C467F5E4C276047501EABE444E051DEA933863E0FCB2356CC0C3817BA59B2E0AD78BBFEF4C3E4C35343331CD81C7F4C428B0418DFA4D6FF655BC50AF49C9A5E8A67BC265A3F30800B93E42C0E66F117E6C59C85BA5E273234EC7212C7B7AC3D87FC0E0EC5FBAE6654461F24BBDF9A063FD0E3F98741C5622ACC8BC008EB0E3F3D57680F12E52FB94CD957EFDD49BF512D9131757161A73DD9650E3561FB31509A908D3EA8DBD1C3AA95AC32E6960E0D17A218A25784332A88E85303DEBE117BEFEDF46882995AEBD704AEAE032668AEC6B8E5BD28D3F110C9F8C1DCA8FACFDC1188A073037796555DC4FAA26ACB9F51B545D32C224424BAC3DAB20D3C08D784E9FEDB47547C25671C269A62163742B55AB4CF9406D2C5047F92C76356F0B90221E019B31890C0B8FCFD04E6B5D06114B967D1358797238D5B14D824C8F0BD7B8BD0", - "D85AAA53F2DE2946EB0CA09DEBB6CB61D91D27C8907B90C89E20C01F681D33BF0DC70B6C79F19E4DB64793505A0E055C33D1E07B7F5AE09F7EFF0C8CEBE80C84373804A48A945CA406D3A1B17CA787DA265C1D8FC735CB098C1AB37A0452F1A287B8E19E3A57E59EF8F2E6CCE2F0AA7772955977982B1F6880AE8717520753636591BA36E351310E98ABB77E26E2CA5BF267935FC38DE173CA20C3A964B56924A5E82A9E36D005EDE6680D543C021C7A9F53DB69BFA3201880B7797E90D31011AFA17BAE836505F5B337C23A07D6AF167258C314C3001291DD9FC565F6B7FB74D99C1B42B496422B3D3E1A564769C2306E40264641EC14724301795B4D54F5FF8D6C4AB3645B56C1D0FFE9B977FC5017E2A53392E7458BAA308C343AAFF5B46B808BDA1FE5C284299A9EEEFC755132F9D3B475E2FCD6BA84917C601B5E8340B5A68148A33563E40AC5A1E49BD8D5FA77BEB6B99E6F4F68A10ECA112475531E7C1942AB9504B8F76EA7BCCAE4A19EF859FD6B6753F07BDD9A19421A2A0B8F27643B2311FAD7978F4366C41BD9F609486FC6EC7CE833A00D7A48AD816412BD201F40C93D136ABB8E329DDB816D1F59A1F3124D6314C64C9B640E4D5BB201CDB4490A65C73228E78055AD6632D81709AA443EBF29A4607A504DD5CBC0D271FE595677B8E6A5E29E23D171D50B878D0D3F9416657E3997D077677B87399A6D1936E", - "A0E629454DE594F7693888C9ADB907F83EC6818D6FC0019B70077BF1B0E3C2CB16A263BE145EA8129FED6BD98F3D9120BAD28379EC8E36DEC69C59B37BD6C2B65D172C70C69C23E29A6143121AEB9E6A9AB46C3DBC3979BC876F4357F6BAA5A0CB33C3AFF1654FE547D5D760E8CE095A9B324E15CEC1596BB7E0D56433D8908EA69925A5CCDCF01702811AD1103F237D36C5F12A3CD938A61EF76A3387340499E4EF1855F892F57AC39AB419F1A397CD43FE7F4C5E609ADF3A2A8E401FFAC870985826CA0DE211996A3549A203B798A5162E98FFC8B5CC2CFA68D618AE80D399D8DFE0FE4AA81ED9B586EA89F646D5C0AA8B107506C7F86879419D0F717E8F70C5A9DC2C3F122CB52F3B691087EF5971C27086512F1890494ABA38B1619969F8846B8876B95C56142F5B171502FA44ACD0299E82FC94EBCD4CDDBE1F5DF978871128F79C1758BB512D5C3BDE59A89786CF4E4716F0515F45A1CA31B06B23E4883F99EE0488848EB0A60FA14AABBD41EC5421D0C162590FEFFEBB4DD0300221471DE8DC0C87DB3F1D54DB11744F8A7115DCA0595F6CD99B74A6FB10C0D14E430F8B40E3E7105C89B2C8F12B37A8879AD9BEAD49AFA1BD56569713CCDA3FB634C3011D51A8DCF84437251A7B19EB61FCE5DF6E2278784722BABE384BA5424646FA23F6D10CE23DC5E0D8D512E7C5C094B1627D6285B57EDF38A7DB1BD57B72044", - "CD7AAC98501F29507EA4E0183E8A40D2E5117E47BB5D18D01A3732DE4C821DFE86521CBEA7DB29BE1148BD544ECC681689BCD1B41EAF755310B7659342F8EE11CB41550CC30E566E192796B66C1A83C0B28BACCFA6C393043A0A2CB89712BC1CCB174DE58E66896AF39C1CEED1E05B0435F8CF6FD920D100F51584FE24879987399481DBF27DDB6286B6353919E552E669290CE02AB4CD5113D7F484229F379C7332767EC69E4336439B05DE1C1E3563DD303A4F580BFF20A40E49CB0822F715ED0221EBCDB5DBAD751124B1715E82F37488265135B6C8BBCF4F801ECC4D3525FF189493AD4EFF0C042B070C4CA8FB1FDF43D79F06A6E4E3D35D7B07D4B728D5DC54EEDACBBBA1EDDCDC07ADF7DFCFEF835E44DF1FF66DAF2A7BAEBE218AC3B15E183044D6A8A89B3C101B40BED97ED5DF93BBC1B84931D56B8C822A6D058AC74CFA4C85D8B456698E82D5B7574C17B041E5F4BEED09F75012355CBC322B822C63F10C18A8F279E9A0E18E1FEF183D23E13894E31F6D046956FE8A647558228F6D4D6910151EC03937876B6ED7A078D33DAEB3F2239353BB8181E62B286BBC41588DE10F478A5CE5B508F205A41820356767B0A0ED4B8DB9EFE348362E9A90D6C30218B295B338B51C09239D02FC8A1E7DAAAB60AC37F5E67CFC88EEF69567B5C81A03B449F4ED38B9D295A36AA3503173F6F6F66D93CE72D753076040FACDE", - "ADDCEDB50E907D20E826E6E8A0D30C20C74B2DF204EA784BAE9F618CAE33A3C937729DF9CB10BA2A4C33E0182A37200C0CC509729D828B8A2A20F283AC4F9306596684EA3FB5492A4C9F2DB459E7531C9F9C0950E7D9E93B3EE5912AE7E39AC8F4EC14B18F24E325003F477E347C5AC1B67CDB11AF3BBBBCD0AC3703024B5767AA67A208254F798684BFD1D3EACD757EEC77254950A146620400DB95E694574F739A991EBA771EBBDFF1056BB39A77DBE0636A032E17141332F951C57C6C90F348F165E3ABDD60D429D5D6BEC7E3E3463806F819EB2D212B3528A5EDE51F235AD100A35E890955F8A1DC51FDCB53EABCA2540997DD054C1F5B29462995B876B44D085904E55E1B838BEF600A992EB49CE078DF75AF3D0F137685AC0D07F0BE1EB87B63A41E74DDE869C8A683BDE60AF5D77FF18F7137495BCEFD0ED28F62F9C3E25D332B5F861D999FCDC0B4851A984A4DBB53401FD40351ADA4335C702BCC8D900C737507B990BDDBE91D201E3A0946DC968D43FD10D04B0B76667FF5B4291C2124B0124C6B710A6D1BCFAEB016B9DEEB0F7A4FE044CA4EA0CCD84B7682617C3A545071EC295B0663B3F577D562DE1D9DD80DE6A1EFD6D5991EB5246F1597B86D0E9A90CF6DB0EB2B8E7BAE9431E567F01AA98502C773742246467ABF911A91A51F6C1B9E0C3233DC1A37D17DB91A5F0F661B0EB5886964456C7818601BD0C" -}; + "B39340CA1C817D81EF4FAE4E95BF3504A7709089FB48560E9E3EF802180E85EB2194E05902C6C4C52021FEB7EC64FD416BCEBC8E39D64A4B5EE345291911AB8204A888C25B1CD3D9342A56C538636D3EAB957037D09E879AE5F3A39834FBB84A3D8D5090D7814246B62E9CA68533D2EC403B4FB9488467FF9758B0D15A8CEF89187A1D5897880040B6C3C5244E85A2AD14BCF2F5ABC44A7B1D4A87E8BDA05766218773ED4F70F8D1D07CBB1E8CA6298E64EE6DC5886D37495BA2EDB3E0B0B68AD9F300310B88898DDEEFD484538C31A9BCAA76ECAD0C16607D32189058B0862EE9D70CEA9D304755CE8037BA4C46C2573181748A212E4B2BDD04F9BC240518273DC17CBAFF21A03E9120FA7DCA18D56DD1D9A7E510C90CF219104385F531F2EFAFD185ECB6B911F9B7809D98D86F15516FFDDBE9BD1CF8662EB777C3F94EA3F962D7B79449FAAD39935429E92CAE5637E9BCF4E94D413D27934952409AB536BE4055AFBC4330CD1E4B5509EFE5F8EFC9ECBE9EF377DE7E37C479BB9D3EE7745E4609B0A6D2C5D92EB3C9E2278C1F2221FF907596AA5E096ACF8990EBA907E43AD320F8019CB6355A2BA8670EE5A4F463E8E56F8F1D3E7F4922510FB668E32C4CF23AD8496399638B095B47833E0CBB34977EB3E4242EAF870D86660D6A73F83E45D6E8A41EDCA3815079649544597C5C43B6C93FEBAD5700D22EDAF431FD340", + "A64F94BB47BD4033C76D4924305907EC1F618B43C7535F3CFC093E5AF5DDD5C4339F3BB6D835B5C2C2053CD3D5693368D4E1A7CAC59425D1FD96809C67285CFD3FC05B01053CB0773221D7205778022F487BF99D1650566BE287FD7AE882AA8E8F52E5D4E3C0C2F971C9FF70AA378691EBD8ADE45CF213822D09FD05243F9726F6C69893845E57C37A7643E16B770E26F431FF69D437271905D270EB85D8D229D7D87662121F0BEEB1E895ED9589A9CF5833408A04197AC9025D8570AD9B75DB7E192EA0A089504996E9DC652975D83633619CFF80667D8B519536B3475248BA8213C8A4C66DE69B4B3774BF9142425C57F34A27B1E288119E3FFCC6AF6A21087F9394F09DDFBD42F32D059B8CD4104A519BA640765D5CDE490E62F10E695FBFD33CBC9D2208A532C8EC25DA28B8CC1B6850AB43D9B5C00B6E74B7A148791AB07B328D347058C7E6233E18C5ED172C9F9E9ACF29D913E2A1614BFC0893D4967ED033B2B9AE6B51F908F1CED57C14FEEA85CD4D9711216BE7F79FA6721B7DCCA033C80127AC6E5FCF58EB4005EC24CB4886D787355362D5E7031B9B2AC2A86D730AD734181E723A811FF510A4DF868001973FE83288D78E6F9B9441DAF5BE2974A2848FD917C3BCD346A431922246EC852E4AAD467E60C15D61DD3BF4A207BB57DB45DCADEFE3210BE74B9DACC918A394469F2E2C95AD1E211947948FE24F5E4", + "FD1F6976002C39C87187C44E3D224ED4DF0B67750105944C651A5E57798F168A136AC0FB5979C4E847A82B20A2E6C45DB42EF2B930A80D3257BCCC53EDA966F5DCD9AD47CFB226EED9B62A874E9F6404D4087798A1005F4131171D3A47907A3CD602B83DABE094D2CB031867DF4595F3ED59FD8C4D76EDEEE59E422CE5C7D0A5F720BE94FA24DF05F758348EADD5EFE9197C6BB2292E2B14DB8C6DB24AA94C5FF0F5106D2B566058D32C58B63A150784F7B02478D9973DD4CFD2E84059AE0F4F1320754B7EE83F04A51C67EFFC2EB1C301C0C58DBAEBE95474E3484A76500103C14C40BB0B7D3A04D8BDABB605C1EF9FD4A6564934DEC50BD5878243AEE80F9796EED70CE1B1E8B55725DF76472D12D4A7A487989F42E6705818B1F7E149E97153A7B05A82FA3FBE51763E61171A4E12931472E94CCBA74CC09483DF93623FC60945070FDDF3A00B561650427E4BD64D675B1EB398B35EF057A66FD0B48EDBABBDCD57C32ABAE46F5CDD0CB1FCF17765258236F3DE40BD5D0A3C5C978D81DEB07367AB20B2CAA9834B9576161C4F20FB9C184A01DC9021A4E92B71333354E05BBEA9015E5AC4C66312E8B79F0B92279AC7EF1936BCC30802B83DB3D113BEF64452CAD7ACF6674FDA44023A661019841A101BE80FDA4E3210AE774E433A9ABD97F2755259AECE21F7A8C3B1A3D471F874D2EEC85B9B21BC0C2E2EC9016F847C6", + "EE38BAF6F61704B01509B5210A0534E4702F93190C392E749869B5572BB7AC4D7120E2BECD6618CD376C4C1B4965F7D9D73400824E88A5C7B5B66BA88C3E0065F9628A9AC6B91A1882192FC553E3140349934D20698C9F291B5370948AF6CC90C837B9F3607F13CAFD492CEF1723376E6A5B813A56301B88A8799519CB7646F33F91C44CDBE7F768D7DD9B323A5002D2F784C4101AF90D6E4C5ADE7D085C79E827D43E10DF63AC70BCDF13DCE0471B487C5ECB752B9C3E20F75DBD243790C91355ADFD7199081BFEA03D80E82445EC2831FB5014B85EFC2A52748A8ABFAC1BA3904E178DFBAB26C1750228C9A031104F58BB3B91905EDB9EADF7B0F6DF22ACEB0DE944E277809D77507D18EAEDAA1767697398421115D04AB2EBFC466E99F0AA540482A49C6AC8FF95E3F962734B03EF39873A93B70470B46FFFDFDC15C89F8FE2F4637B59F9BF9C5752D9F8AE7EA75D1EAF1C22CA27E5D5C9499624105D61BE2A691F9194D277414532A5E6C63875F7F20DD13C6EE73B0C3568392B14A5042843926472ABA343D2C427792199B543BE1D43A178FAA7ECF53B98AB7528D8E1B8B82C52D973CA0427636505837F94284E8D6B4F496FC5A48B7958D4681DA00651B8A7BC56EC859C071E4396A05F33588B8087EFE9635E565E6B5A8A70DA70F50ECAD1A85E6E36FF07B4FB3B9119EDE0B611CFA91D9D4C58C1F4815B07B9EB1DE", + "CD37D0FB0043D03444A939E93676B9DAF5F2D19A2615E3D97D624E62ACAC8098099FDB9A5A2F4B3ACF20F75B6807A5A3F157C2C0F479158F4A10FB4972855F3AE2FDCBDEEC00A4D470AADF5F5E571818AD6E872D897E2DDC402006965ADF16582B1E06B1861BF7D0C7E7BA491C79E86224AF6B246317F725FA74DD8376D63D7993FE2F2BBBB2F1DA9238C6F3FFCAEC50FF61E645FADEB6E03F883892C42CCCF904708B123C9271A670D4DCFCD602951D12F5213937CA2C05ADDE9EE3908E99AAE8DA31951C36D36D671CD7BF15DF60B707F00BF6EBBE5476926D015628A85758BFF35C4AC540F39E761B2ED3CA9116E8680E28BC387058E0F69345CC6AB3AD160E9F2BC4D6047A1934E15D3D7A242A296333C09296981BBF3B8577E4B8ED2A3624866111F6638F8955431195B60C5C089F9897DDF0D34A3DC627CE337AC8128C28B63A394908E4C083BCC4522DB8CE5720C45EF76B2716225E53405FCAAAA72AC198226575D5225195F106C1249E4B87AC05287A3ABE6C51A2A41E07F56ECDC46E989A8568D35669B525A6FFCA90DC91D3013967F6A5F4C022FFCC17751B68FB0D8F16FC9229851DFDCC060838F923BD44C1AD70A993E8EBAC1667DA80F91B66F8F5B375D35275188E3C7702C2312CEAC5B20D67BB34400401BDF1DBFE79DFA0EB73F173A04807215DA5CE8E1D28F2126424C3DB44ADCD7A961260FDBCAB31E", + "CAA02DD19DB9C721EB35AB7D64B8A387796427242698A47D832C3F1AD4DDA0B5926FFCE9319EEEDA1565ECB0FA1EEDB424414120AAE8CFD0BE88D4D248899A0BCE31F9BEE7A4DC4DB3C3B10444FAD6ADCCE28F0EDF7B808536ACF5EB05AADAE92693EE02C9512B3EEF000844BA35E24620A2E8935354B8432C07C8FD615534BCFD0D8E3B572BF2CF06AD343997590FE8B244A32BBE69125B5D7C5E513A493724EEA8DA6CB0FFF3ACF1C5085A8120694CBC40FAE1A6326FD71487CC3BE7C10A34315CDFFA8C618B68EA93D330945586B080381F0076351B888087F56B969E6D6A311AE03CC79FF6861E715C9DA9AEE751F1220661581C75DCEC0515A1C9259B9CF8E944CEC4B1754E5809E985D6F43FE45710893242ADE0D3B84F1E1942B7A95648611595FED13F546CA11DB8E5A55A3C3C78C3793C6689E1B3AFB5F67526A480DF923A586A779F94A09CF963594FF4B0A387876EBB3E8FAB888C97F6773E7F0317B038E47DD7D109545BB07263B1AA84284B86E47FFB9784A171D101E7B0A6D38BCAE7E63D827C999BF551728FFC642EE690B01D486CB6EBEEB9D5C888112589EA5CBC9BDF49E675965223416D6DA02D2333BFD4614706BF13373973207C849A0DE41EBA137FDF79A1EB25D74E30CF60B577C2787DF04740BA8CADE3F9DA55D3F0084F02809E37543239E0A71E99751EEB21CB3B41488244193A4868CBA9276", + "FB227530F82BD527E648619E532D7646A5ABBD15DB91A6E7033DFECCC65D095A3D83AB77EDD2F3FEC52659CB3AD1BEB009D7A1C9BFB544291EC1C67B75DD6DAB06E70C32C714983139DE4A41EE07B4F3C03BF566558484F19A3BB674B6795F0D8537BC31BC8D7A38B2FF1B2EC8B78539B2251D0E385DE484B05A411477681A3AE7527AC98BC2943AF1CF7F09ACF2DDE4530AE896BDE1266FE916E833A1C0CAA2B2D2F5985AD47B2D0D1D3AFB6E50D4B3DA7DEEC4385E6CA8FE22760F92807AC55556AAF7973E8016ADFD43A3919088B768351B1057498D2D668D7C1E8C63438055FDF7D36C5E7DF02FCAFCBD9291A2149E7B429B3202D329E47CED51EA5771772E308C5BEBA7B934597540D83DBEC6C3BC61A96EA4CB2D7530D9D760AA9403338CD95B829F17547C5A90D161F7B8CE0037EBF403C91C0D0C70C589BA87CAE8DF26CF14281E235A686CCD10E2D520A76265C4C2780EDFD0705E89EFE3C953FE760DE45A8CF1F2D3F36DE3164D5BC2CF32204228ADD7C182EC55F1158AFA9358BE179C722ADAF1D0BF1306A0B56218857FC5C21001499F61E273442281E585B3E6DCE148AA97B6622B23BDAECF983BF186F1B34962764758AC3C20C84036061D49CA33B3C3FCDF03F47F7E53B940DBB6E1E4A26702A118E525A9A0EC229085C925D133750ED0B200CB28A113289DE143D1D5839D2AF8B0525E0027F34FF32106A", + "9E5DA18A19514CCC849E9697AE4BD1B317BB34927D0461A96A7AF4A5D6C13107FFB9DE38C5E8CB7C5682827F57D94ED2E77D36F9F1CB05E4C2C62B1DE254C7B1CB236FC4ED70BF8DD1F43AC773C16A37392B895F8B157578C477C85E53FA7CA58BE70D9187AF5F7A18D5A1E5642335E46C2F8F4691AEEE6A9692E21B9668E2C083D9F45C2DB3E991588BA87A0A23808732EE39E8B3C876BE79227C782F07EE3FB3086AF913D71D71910A0F56D62B5DE5E224F7856A42A4A1B2AFE380827BE86E381FCE486FD08A91B22BD91D09615F417E178C5593E41B0917E075133960AD28B4DD4096D1E84BEF1363098DDE92C29CD508C40BA7E785F46C1E0DC72E729D394911DA919EA6F94D14567FFADC61CEB8DCA2821B1CF048477E2433E9DC718DE618EDEEF302CDCB5DE472656D6687DC41EA34C2BB4DF1CA08DCB933BE3EF4B419158BA0B68AE82A64ADD58559214FD88A4CB34D99F646310697DA982C2FD4EE069DC1CB102125C34A89AB20F17B6EF648A834627320410FF6881C7919AE4E71CBAE5F8200E523934D84BFA897C44B89B9BC6BC0129F7F97EE0EC049BA1AFD67D00CD624A75FF5A30514399BE4801CED057B498B9DBBF0EB9944295D5B6AE968C4B8BBD2B9A9E17A3039C5FA35A0D30AA54CA426C58353943DDDD3FD185895C0DAEE950455FC131F520B46AE118C7406D0A72BE6127C5307730AD441B6FC3D1E0", + "8589F8396F5B1C54CAF2B17D4C152CEF347E66EC7903C878F2823D4ADB9E7CCFAFEBB926B7EEB4AE1BECA339A027CE8EF997957532FA871F356E0326ECE0BCE3399F81179BF78C5C7D135018ABC340C0BE58D3063DD7CDA4C1918A0187BACF830C8B6900D43B62E04DF6E831CFEFA13BDB5E873A527F24327C95DB4BBDB65C81A20F959F828F5DAE4DC13E5CAC7417EE089401FB497ABE10144E28EA383E61D4A9B63B618AA7CEA4588B2911EC581F506062B05E7BEF723A5A465C9FBE70E313753BDE3102845A79A206BF7D996F49A21752D534B73EE83B48C1A225F85F5103DDB9B6B8380F61AAF26E5CA643EB62EAF58AFEE0D3494E4F7A4F642A3454F4F56A406A264148FF5DAC9DF5F151C12E89ED9D4FDCC04EC5F0022DF8CBAF3CBC67CED2853FB4F8C5894C96CD00550950E7EA2A26C80A72DF533270A0E23EDBAA4D0BE935D62CC885E1CCE653D66C51E49C43952042E1B2D043BDA1CFFC1E98A3F806EB587A4EC9AE299BD838C68B9BBF7C420C12B23AA2793FA0248C932A91BCDD641DCB38F0B2D7187D8986928DF4602B381BA13B263291134628FC91C8EDE92594B39650B877D9A91DAAA05295457DFB2C5D8207BBCDFE16AC5B93600E33BC970B38E18808B1A732889320352B524B109560136E605D32784CA01F8B11D077C81EAD6B7A5741C82D76CEEF764FD07E361D531B75106AF1572AD1375B2BBAB68", + "A3E17A4CAD2ABE76E32D18501899F8D60D293BB1AC3ADB64F81148AF56741790F87F8B7A2D9A6E7645EA50B75514C394508884CBF9E320B24D41D8246EB3C163B9101240776C312DB63C33889E3C1218435850471C454486DF7FF4D2DC0AAA14980F394CC8EB7B828A60C53A2FEC3315BEAEB30045B3E65006C6EBB23B47A8A069EAD45E32E771B9C467B4359EBB681AB48C891ABB796544169178203BCC4BC6B4A278DCEFACE5E9385C059346A23DCCA001FC9E47CFEED4BCBDD947B12A3F7E5FF8B9372D9497EE1A508D8BD3392BF3CFAD58F0191B18F6A300FF9CB8D914FDF37B48BF24C2C5CA76ABDFCCF833D51D48FC90E06E7B972944BCBAD169232A8429B6100BA562F7F3C55A625A1870A7C7D7BC9BD4C4783278CD95D07F89E8010E78876547F9AEC44322B0029A922B2922634ECCF2BBB47BF87909C494049550F1E6D03BB5354DEA7E777F499D2D6239BFA5C1CFA536F8CB16F4DB9EAD96F83A4AD34AE2C6893ECD6994C89E7F4FE426D95A18F93B88CB357996B8E5A34C43533EDB1F28A8162FCBEF03704FCCCD80C32874F345D34E81EE813DF5CC9B9C299362F8443AABE91BD0EAB9746E431804B6129FD32916303A570323FA121F7AEB2829F2A50A82CACCF6D273FFBD7AC6FFC5807771D216F50742F7091946F91460115989C87E8BBBC8402B4C8B95C102CAB53843D581FA9F16C0ECCE8944E5FC4BF4C", + "9D7B1CF0029261D65AE1F021DAFA81CF1673C9E0B47FF2C37D1B1AF46E7A91BC5E529C8F93EE3BC74E92B2743AAB1EDE16A6523B5B8A591C617C1FD0150E63F3B7EF0494162437B0FD555A83A3BDB519B3BB209EF7924D6BCDE5992BA6248690442E72CD5EB64B4C3D3F7DA339108A18B61AD88ABE87BB7C85A3A352D7B882FD683B2637A17A2D9CB0B7F41456DCFA66D62913F145600BAAEEE7EFA5071C3C9E6FDD0A6779A737071FA6965978CBC89776386B108DD7216FCE962FA87A26B29FE0E732309C0124B0C1E99E5642E5EAE670005B078C097D16C58B8923633C18FDB0E8FF8C4610B789387ACB5A2DD0B6AE7E0DF43A6A9E8C3B89C7E5D628D59759C58D07E0687812AEDAEEDBC63B4FEE8524D10E4B467696957E6791C1E94B13CADCD0ED60752C2DB1B65E035EA72F89FC679138D3609FD2A30E4DD1A946418253C67AA69B07EBB95D4973F562CE3773430007A6DB77271D5F2B342CC5E76E115178F9C7B1600554F5C794961BAE81A5E9B621BA17851008BED9B556E461A553FE9BE00A40891750E4EA4B475216283B530CB8D479DC70B026E07889229F6017552AB9E01EDE6703FD1E2D59AF0B71E0F1DC9A42ACC5823324BEFC52CA0DCD25FE8B10C999152AA3676A30602D3506F78751477033DB7AB1A2EDC21A6FE51273B6B2890088703CEFE74F9EA89881896E5BE124B1FC9430B92F0C0568F5A068A80", + "F23088E3EAA0A6BA04D0633AAFE85203E8B1829223FA6B730F6DEE6799B521F2E8323B8793D0F7F2BB9305B3EF4F5B4F1CB822836E4D92C8E4928A851BCE688329DECA6F7285DCC85195E5BDA3B503B8AEE6F1CD7FBB158444E7DE8BF6A9A3CDA311787755A827BCAD3DA5621908EA913C0316B9B52BFB07ADADEFF17D3766BB450DD71328A0353B09DC24DE93CF83A2E5F98BA9D612187B601157D6B140E675228B58C9398618C3BF0D11A226E489366102B9C35A916653F0DB36711ACBA5F32B327F5789F3EF48A338E4676F4BC2C6A1308597171903D2AA299CE7E523C2ABE4B15AA4FC48954187E0097583EB099419047244B4931326E5923B6313DE08423DB00866374ABBF5C31A00542CB97CDFB8F71046AA2A6DBFD7E1A71C068ED70E8D7C3268EA3E0EEF2262BD7991B6C59FF471F73A4E85F4FA015E164F9C15FE0AA5F4772BF2D62B26D3EAA25CE83EAEC5EB3577CA83A68168FB64C40A7A155905CBA6E64159E55EBC928D125E55165C639F545B0071EE3CF1A3F58B4994BB4BF50C2B24F2E06E4ADC90BC1C0954A257D88444347AAECF136C15242633463DCF984BB6736666E38F1A45150B1B7D1C31DE06EB9C2F4097E9D9B4D21EBC9F3A918000DE2449DCB3F5FDDC3C773A645DF560F7E013E847E2356D33EFF1E215782638F58034B09F4739F98915BFB0B1DC124681492F58021670D03CBF5E8F962351E", + "EB07F9EDF03596ADC2A3B7EB6DB1CFC911E9A4C42336A57309F7B6C3389282E557D94BCC71827D7C5737B1C530D2A087E3F507242F3DA5BD1BBCA4DF8B78BEEC1DBF7EBB2EA1CF1DFA79E60785BAFA23658490C9A64AC61C45779DFAFC6C55CB5C9FE457BF47E45A3FEF092E178ED4495C0357B459E95AAC82132FF1C8044F4EC84EB882DC195D9CE996B1CCF523098E9E1A57C37C2E2D0ACB0EAA34B0B56FE5A0747130B1E75AA923F6F94C0D024A7FCD22E7A4ED8B201966C417AE864420767AB3223BFF56C64D4F8F557DD950F7C50D9A39AB2C742CE686C8F92B35711904C600A9D4D3DD83F3DF1ED7DB8042C76B0B7D5D9BCD6E0B5524184BF99D8D0B4F14967FA48A93A2F44E2275ED7E59F3991EFB0CBF2E26AC1F8D9A41AAE4563179254BA37028867E68C8179454B8B71FAB49DBD1F889104CFB64C8121151364BDB64BAF854B0DA22B8620BD7EE3D4302A88A115F8BFBA649CAA9EE7EF5BC95CFAB26503A9D26033370A4EF3CB8A5D094C63305A833387B4F8371C6FE1987514BB458C571E6CB5DF5FC900631652D3FA4444F8F1F0312204340FDB2092F709FDC51D2680753131ABC33712B4F1067EA1CC87C40B281E69209EDEC42C22A88950E9C1CE8130DA9291897BF2D8D1D106911743E7A9DA36220FA90A02A34EB0B28543217839374EBE79F40B3B612236C902E4CD05CE2E1C07F3DA10E2AEE8E387494E", + "E9D537A821DEDE526B441BA4252785779B54DE76F82747F8607B8952DF990F268C039CC792883B1C76C297D81C6C0CF17DA8BA2C71110B16741728725839D33B5942BC0A5614A3650675FDA5D70F29154A429A42819D6EDE324C64596F93E84CC9B2C9DA3717AA6DFFCD03B75AC96543020A9F2024620353E1364E4320FD44933799FFF083E73F5D20B83BF77EC2247964ECE442C3213DE99026F8FAF0E96302EC60067EA38C5CA0CD989475205FA38869E349FC7F79EB81F8457CA3D1A875A8D166C96EBAF1F39C88815E2258EA1A14943298DA39EB9B738AAA4E0035F9567A0A9D572785594496316D56EB3D39E1F3F243D4F16111E194FC537A635FAEB2FB4401CAA9EE0091CF3CB28B366CB5446A6D3B10AB86B4B1A0714D107FCCBBD50EAE520D56A1161E03849192F5096346FBE5150B6D04025A564A43A3D22BD4B7E10DD4061CE20FA2ECDD36F66BAAD7EA96CDBAA0F063B814707718F47278F8570F77F3B15799D0E354CCA50DAA38C31C746B17482297D9C089FF379454FCCCB8730D89B1462AD95426370AC37DE50B775B952663B97AFBC403F6F729BB9CC1D21DD89EE78AF09DF8558F7E68B3711A7D9075DD4754174802F52CB9683FFE746471C7E543FF388D024327D1866CC5CA6775C58A14D70A3ECCD3EFAB52F9AE6CCE146766A8419FB546E39EB604F43B15AB88C72741F8C7D0A7FE2F462D360676D6E", + "D79D916241BBE52B61BE8210A02543F75A47032E9C0CC128524A675E94D8F79A69B6842B0C5CFF5C1AC98D2085299BDBAEA67A41C724CA36B6275A80D377DC3A6EB4C8D0B6B88241334A95300B53FFB546163D2889D7C85F1D1397924F126DA76085BEF131A65C7DDF60DDF4086BD33B44D25025D689FF41E0C256EA12F4353D9E722EE37907AA8BED0A5A606333A031AC6B9A16614250916759B72FE6C1828BC6C1966C9EBCD51413A77F41F808BCA2534AC49DB1D32D37878DF5CC0BEFCC099C56CAF50D8B92E7CE616AA026EA1D81DC7ABC17C4705F9B57A0F99FA749F30F93DFA982A083EAE6582C8461A11ABA74B11663ED7D66EB4F8DE14F090EB1CA6D8D81CB6B063A391FD354DCEAF7DB71C277D0E92B4B463873DCBEFFB698BDCA17F80845EFD5F0FF150ADDC9D7797E21E4279B54BDD4B7C9D403D9FA6101604B79AC377780A5461499714082942313CF74AD1147CD10571A31D82871B6B3A055D50C6CDA4BDDF3871F41EFDAEBE8ABB995344DB6366E35C6E506907AD7FC76632F99124A58A32C86360FD6DDBF50324D86694518AC44F1FA19662C0EF0C0860811B5B976A96EC2A1449E53A7E4A07923E9F85794F228E441D92903922E5783F2FA21C677251B6B8DB02AC2E242C0C8652E0C17C9E3858E52DE78DC712B2DD5D2AF9A42DB2E2BEB3FB6E0FFF13DB9A1E02C8F84FCEF3F7C4D2DDC09F2A2813E8C2", + "F8E2DACDD88277D482951555C657B3E3C5DB79E5A43500F7A2C8B30C854DBE611FAC1087FA03D439AC4635D39211E234B82A91248DEE5D4FE67A02D5AE25C676E64C4843E419EBB3C4D81FB606B9CA0836F8207CD19D106C0E287EFD8F8DB5C1A3A22886C2765FED26B5189153657B7C47D5590F11C6340067B800669B05A0849BCD2005DFEE6DF95833C9E94328D72F931D69CFBB2BDA81AC83DD660B3B17D2BA4023491DED324FC4F22510ECA4A5194B1245F4F3FE334DA9C1E6BF83A3FB30897BE54C688D2A7C5845F425866F25DD0A9852BA6DAAF8437DD80BCC72B3E258A906DE079A2D33EC5C5F6927503BA13158305DFFD3F86345524394151AA557D6242060F276BB6BB25586F632942ACF5E0883CD3F8393688F360323A000B82BD89414E9C807994B0234D730BC6D7CD0A2BF75D9F510786E83EE98D4CACF20EFF86EE9C38B8D52455D8A694B689F0D9A632E7A6AC6675E190A12ADD716D2C6322657B878FA97267C1BA4631584356768EBBD1F13FD2F37EBDCD1DF96FB943942E8A5188666235B455BE2F770C9759A8F070971CBA49789744FD2F64DC4DC6E003B3F9BEC7617C7EEDF6BACA94D374400499CA6813C90A03DFE2C537261DA93A1C0F6D8BA93D1EB5FB17255DF28B78737582FD675D056A4C474A71CA8EF0D77BAEBE5637711AEA3FF2B014700448C3D74E3DF264D773360F45CCC3342987169C9A", + "94741D7F05B0CA50908E6BC14801A28E353551F01769451B1482FAD0043D5C72331246D9AC3344F0FA2E28FD00E86B38F5E0452F46CA111E92D01B37E966455DF1374883DB8B055C4DF25B42182280F86D0D825C096018D2949B4BFCEB7BB2C8A5BFA2C79E27F11A7F9B43A50AF928D81FA95CEC86A114222B99786072311025672AB04B2593C5AF50100B71D052AE268FBA992BF7868E58EFCD07A24D2111774A36115C1C527B5192EA955722EAE849EF83817FE8595C96EA2D76FECF6476D89F65A262D94B3F5E89A5DE8B1A7333EFCDFDED17FE1CCADEBA0D1E7B73E67491B413A862E34A308D5C211787E6ED8683C6E1DDEB8EE2D281166C03E7A72D7D7BD8B878D07D2216C21B855CCDA76B7B75DD1B2CB876E59F91F040D42B97050043499DCFFC65AF803E2F7455C9669DD9896FE1F62227936DF905835A644D31130A39479DE75B4DC4361E41202D51D50E0E4B4B218AF7F5CAF264DCD060C296E777DF1EED6AE8147E9B6CA73184C345FBDD89DE4A999C42AB4681D9EA3B86DD75031A33DCDC807F8FB14EE0CE61B16068AF01CCE7378C9D965943476AD21A469D8B0CAE15BA8FE04971FE1EC61D3AAD3386DF71B33FD0B4F324F3DA518F0CC0353182B3D76CF4EF5AB150FB9E74C28234CB3D907AC81CB6D3B99D510B481E1F0423D6F4987F5517ABBBEEC07F46AECEBA5F15D91AEB0FE91490E91F739D465225C", + "839A01464B473A64A3D1EA24EB363EAAA590F4BD0E4492FEC4E3D4DB5883E4873BBA17595FF48134893F16F5C4A43659C46484A268C3303B2DC345E8C98FBBA6D06946F997074AE15680EC9423D6464585D98804B3541662E183F6540503BEC204749D58E3DB9ECF11C80CD3A38F8D66FFE6CC8A003BDD35F547E5039DE9A21F70A8A07B2DD89B68E43B42C2E021A11909817C543F839E6862268E38DCE712B4D49C39A5035F3D6BA19AE028AE70CCF557720794FEF6442999E740CD6AFE6235F165515FDC24AB6F578DB2549C8065E008577FCF8B8DD8A3BA679BABBC9A747A4E2DABD91501424E4191097E689A741EB6644A771CABDBFE6B74ED3ED171DF8DE641C1D42213B9D0F8CAD1E11FF63670F5587F1FB7FF92276AB48F31751E7A591AF4F0966F3909883EE6015639671BDC3D1378750F66F5DD165912CFF1A54ED463905404EB7D3412EE2B0F0D9E6B99EC81678ABCD1789BD8F1D72D3DF8754A16DC2106B83B325807E27BCBD22A25DAC32F27EACAB6A4CB6CBA4CC90D5302BE5E9827B7AB48BB696B2902975C48B3A4BA4630B14E0FD8A050B0718C2829371BEC597387172B0B3192EF958BD1F7977EF9A3A6C80D53BC961315F97B714253B9731A017BE2CA1D43024F75E26BBE989C4D514D01538956FE4B90BE17B3407B55BD08BA50FA807D0E448B7CAC65EB3FF856772A933F0C5F3E6F41E051015C6F9B8", + "BDA2B72F0BB0265269F198207FB061DA29DE43E30847E7C062A581A7EB53491EA51B51EDD36F991D15AF89AB53198537988350FD5FDF8E003019BE115840B9BA55C238C3CBC72C0E24E25090A3D6A59BEA9FED0FAC9EAD40451A95649638FE0BB0F8FFE61AF5B9A8AB84BE84C65EA1E12E9F6650ADB59A824E608E80D1FC3AC19F418169B3879CC946165511D5AA280AE644AF360C42F7A3EEDF27E368E46480E3353E67F536E02B33505341BAF3941069567B723D7C125C8F066F9A6255436AAFDCAA8C554FDAFB0A9AAD91F1263DC62EF91A748FFB29F57E325D65A38ECB4F2851923DC6E9B7296064148A9BA2D938116266C597D9E1F11A46BE0EF526225BE750F0F3E5B0AEB7DC2140FA3A48B7238D0F5A872000782CB6F7751443EC6A1B7FA1ED02B9ABCD1C1DE4FC85E9B405C7851913C60F85582B1529276AD475AE52BD8115B6E73A53506E7A0244E1C29BCEF4CF20CFDF883392BB3990BE2A11B3213B68EC4A166C77D724CFAEBDC34C45ED09848A994BCE1FF6A9BB80C7F5CA8FD44D3FDF8DEC8BA6552C234EF8DC52382D52D2B01BB23404FC453725C7C9269A785FE09C712D4ADE7072B66295CA0C6405D9859E134FBBD3737F2956DD1D718A9F8242CE95BDB1E49F265EBF19976BC46E29F7DE0EE5C89A43AF2E107588A46E1B6762E6F8E48B8FC4F4FF93EC60938B8E5C3719022C750C4309FC62ADA4E9028", + "D240216C5C4A70742CAA03AE910E8859C92E5A90A352CB8B45847BAC7793E1F75720D44919E896AD4581E1FD83986FF235C9834BEECAA1556794BE49033E79D4CCDB4DC67C5200E8B6A3EE891E700B348CBF092E4D3FA5E648B620E34E491D7B628A1FE7E2C45586B6577E50788687F0858C10F78F371B25C712ED2760C3D605D4ED4F052E8B66FC308D3ADD4A9B86F00CE4257EED085EAE95FBB1E113FCB42CE12BB6076178A20903C55DA570EF8A25BA7AC8B7E134B8D4E35AB172CA33CC97294A5E7E579B9361B92B49B63BB1982740015DFEC16882989C917F50D5FDD9166FE1001F3282D3C54A28AC7FD773CCC0634AF7CDF225F94107C169D2F2BB757EEB55933CCE0FF116D7FFBA992F9A075A2439CCB369D5B5DE460CADC9F8C81D98E71651AEBFC2A918C551082D85F75675CDC8CCA1D3E486CFFB3B025D27C8D67C451FDFCF59C3BFA163EB791152390E9488C604B9B8116C329453A98F7A104527BC677411034CC49686108E569B7595E1DDC85918D90BBCB337855860D6E4718C0679DAB6982D23FCB6648E8561F44BCF9B052D8B58384523BC592C9B7F824B96AD1A39AEBD2232D6D34DC171E8FBF933900960F207B55597759D23E1E794507586114228A2FC100CC200D2B862DF3F26E6D1C9370373FE165C326D8C29FD2F0B3071AFD5215781BFB589F605263FF065B7A5CA3F6AA9DE3FD8BF5589BDE3526", + "8E7752C52805DD0A723D61F0BBE0122DF576A42B5AFDF9F196A766C9B3BFE296DC16A892FAECEEDD8256D2B1AE6BFE5437D4A2691803043B59862B30D68E4FF94A0700D735CFE967299724DA9D680200C898EED1C785E7B8CEB14F1DCDC73FC625F9678B407603587220C2FDFE0A47E82ADF36C26F942797D608BA6B38A3AD1A967315E1F2D665B27D51E350F075531A179DB2EED55547EA61761CD2B3962FCB347279117D1C7A7574B49FFE0991AF572A2B0C962A8A79800CFD524AAF9E6401C44569600F41F04422DB891D25B9F714713086BBFD0FB268E66A4FB10C0ABEEB31D0FBFBA20B0E4FFF404051596FC6F6C8093AD01807FA52041CD33007B205D15D47AF733966411A36F4C7B846D0BE049ADC21B89EA4CE0FBA414C005E66F36FACF3C43B474D47DAD78AC114D0171C031DFBE4A15FE1A22603CD79B6BB448B67A4DEDC97262F7B869C54F385F3682C744ED5AD6C0B6E16793920E6B45A024010896D5FECFA111CC9F0C34E728B32F2C4D45B8AA69B621AB9AC3D9D79B38BF205E8D0D19FAC44A76B9F5644526E06858F76B3EE2D74AEB1971D6B6E68B83773399AC32203164564B102B26C370A9FEC673C285AE0D1D3DF239D48B6492B89846EBED4618AEC940DC62AF4C3FF0D56FC9FBE23EE3B0A4890BA2665A88E9F40C4B6A770F9630234ED10A3A7FF3C5BCCBA836F3EDC8B821AB18D4B1D51D9962C328", + "E682E9D8E92A7837823C9B7714D267F9CE290E9FA6CC0A8432D3F7507DAF6CF681246AA4C2323C6B53BCC6E53B31F49742EE5F4E6F79DC36727E98B06D0300ED21F0CF5F2B51D8304A51D0B498F4BFA39C0049B8117DAD334D4B2E37676EC42DFE0EED63B3726872CCF9A10223A8A4563BE8AC266E0697004921DCCEEA5DD80C62567FDEBF2AFDF030192831A6FD871F63D5DADA4B270AA9EC0ACE47E75BD19018CB809B548D4F2C24831C384DD2B807852F596BD4FE32CAB3A16899D0B100E9F96D06AACB8DA8D51DB0B0F600F3B614461F5238188B5EDA68EA753B6ACC58569E841BAF92CEE04E6E2626B1FBD01B9B67D1311B1C3D67427298E2D193F0647EA17D16FD7FD6A40A1BDBB320A1F5FC64B97759AF4EA92AAEB759B5DD30A726E9B8EAFA372FBD83CBFF0000CA75F219A95D6A3CDE38B8DFA9281609A20EE39B73FEBDF6A155359476D073E7153BC918C1191C9BAAF0E0F161384DAD8AFC31A3FC1E9EAFA495E22D18C05194EB85298AB0F042E447DD627904B73E6E505712DF010531C88E695F6510C78B443C731D7FDCD62EB7C4015AB5D530BD09CE5229FA4DC5642AF176C39D60FE070DF635CC5435136C7BB9C4DC83B0D382B9BB636A6C2B3838542904D53B862585FE6EC8960A9A77783D17B2D90506F5D60998602AE5430E86025C8864883CECD7CE51B49CC2953A2A41D7EF8027F1A83815BBEF6F6B2", + "F6BD4204243CBA14DAA15A256FBCD138B5D875E28BCC0BA36855E648434CD04F49935C3D074DD5BA2EB82AB14E82C30991A1159E990D1D36DAF794853A23C499AB6B3DC02A89F014310372813643F786BF19D3FA8C463EE50D9FA87107E91C461AD2E5DF2FC99630D2005894CB7698123111FAFC0C5BC9D1E8E84FCCA5179A6C9AFE3E369222D66854F90D2668A57FDEE00C300AEA4E88F03F05C4D7695B206DE9F7E1D429E5E6B65DFE05D4C861F4E7844DDB9062C0B6DB46B27AD0368992F54A44829DD11A05AB97BA8AD854E428B87F20C4E5E4BB1FF3803809A81F2E4C109572006729A5E490E0AA40BA55F4391C9FB758EFA79B97E6D413BCB02D33A00DA6705BFBADED66CFC21291C494B7C3293810012ECC61415E609DD97AAFFDEB795DE36026B4602DD546A1AD937F1A6DEACD3393F5530C48A7974E2882CB327AE600C05A535BDE5D15AC524859582EEE2D62194B73E01643359E7B2625F3EB9FE7137514ED549A3196FFCBC8072B4F6C18CC67AAFA0ED6029A805EF0987E2F27A3260F849C68F3EF91DAA9E579AA16FDA698CC18AE8706E28C6D84CB3F593273D763C2969933D8EFA564E8C06C427809E6A5A6F76DE7C8B07FF4EDDF6CF2B7595066DFB15F5C6F3839DEE642FC86BC1F3AED7ED2E65B665198AA034817DBBBE0FE30E662B2161276CBD969FDA05AFD6D6A570C1E3CF7E324634441983F257E2BA", + "A9366308475F2D8D0C2D451C4A65A01EE58A0AF19B791D97382EC59A52616C7480B86EB1D0A83E93224B0DF73DE1D7EE6D51088F3B20B7937E6C0144E0DACA6324F0C8E5F9D93A8CBA1045E5B509D7DF98619FDDFDD7892C3082D69008D9D3ED6C9C1367D9DB7C04621D7CDD8A5A2599EE45B87A82F8CE8D60293E7A71D11700CA9AF117D630C5D8B876A9DCE519BD653114448C68B265813C608435B96CD642A420A15FBAB467692931BCA74F1F9D23F5BFDDC5B8651139B5A73F04FEF3DA64B7BD56E49235069EE5E8A136B921051F1D1C7D5993E6EEEEA2D58583152ADCD87AA89CF5962BC8341EF99CEB3682A2D0686602CE140ABC2FDF79A778A9D75AFFDBBA00C0BD6A8A8AFF9B5D1F30C8373572C81BD9594890102F46B5A393ED126C36AEF6A66E231A246FDFCBD3DED198ABC54CF357ABC67AC83680C048932D7C902AB7DB16952B3C95DF4E845B46A362FFE1A27CD1388483FFA41AA563933371C0180848F9E3C03AFC1F00D6ABA29A953327A4E3D9FAD4616C8546C9AF89FB4D08D4256923B736A8F68FEA5A097E0640C16E0F7F942E6A6F5CBA76BB00D81C606C7FED908789A63F01F9B5FC7B7BE434E85A0A44B2070BE71AB2BA0132D9D7B32E2D2FE229619F85643E75B4141D355386D1A09F45738455BC21607086C7BBCD4B73F87DD83E905BCE8FC6C5BF1824E904C4F5C26518B2FEBF8EB06B22437270C", + "92D87BF3F54B0445C05E508E80F9CBC0502F0897D717CA232004362F394A023BFBFE3322C1D331AFC6454FC756FB48768693FD5C46DDB40DCBF14C726C24ED67D8F3EB613BA80B0E39CF0747DF62D258613640D881E085C377DE1C3D149C8359407C2C6ABC0D2718A2D42439A8E7B38CD7DCED72AE750B2BE88D0069FBE94BD69A9A4B4AD42FEC5E651A31F86B90DC2FEBAA6FA6E5F6368B620C1750278DF393F7C5035D47897FC05FBC419A61330135F24365F13D653D77CA2930DBB05A3815FE83F75BB1BD8B2DE12A2FAADCD1ED62329C55B87FB32CC8F3B42D888981B4192480D1F57CEB0C55897BDA6B9C0ACE1E7E4595E30C7368306243208444FCF4574C47B07725B25EC2E28F4C50B744B3860B361DDDD22D949AA94EBA4F97606FCAD91394B6FC0E634BD15E099E697403B2AE84CDF5DBDF36D91FB82C0BC12B984FEE83CA9E97C194CADF8382CECAAF49EB3BD446F660F94C188C074CC312E186BEE0F6585535B050C226659A94B4C4974DA32CDFF30DBEB4DEA588C6F490F7432DA5FA2408BBC931EAF60EADD7B891A61C157147B8DDE7A45F909BD20D5B12009783DE410940245FE4E91ACCF72942E486AE773CD665912173EA29875A1722F8658C414CD08CBFDFE1DD356E167A9D7B20BF7441562EE816435A78BAE7E5A5EB4DA6AAAC36F594C93E2851D76B6A18B0B03B30CD38B97E38109C494C557643D58", + "BAA2716F115D72D2037841EF9138D19833C7C5FF40F058A960826E690315577710EFE64BB37691564B3B0B6C577DA603CC3ACDFE1785541AAD23904758A5A13BDB018E7169D479A1FAA031CA72FA6D6AE9613D6B2F82AB07500B49DF535F86A76350C140F9CD25295D6BC2F38C5D13C99540E2363862F06DDCC486D884999BCB840BCCAF2AB84F5906B9AA0F77D6432F6531558392641C52FEAF9D8ED86BF0158134129F34ECD0768BC02ED442254515A74999C6B8052A1FC797F5720738C69DD9B3FFABDDC8515CD279B246EA7C67754920038C5A4C8D301119CEB95FAB2765DE39DDA84180CEBAAFBF4976118A8373FF6BBFC7FEBC3CFEAB1DA69DD3DB9E428C594950FD51F4D98A393BAB96001461F2765834ED70C60BC56406CFCB3E784C59B91C19783E67CE6C86713C43DCDA9512B2E7173AFC2EF9A172C9CFDDD3000D7A981440AD994C39DAE6FC0B645BA0FD49ECAA19E572ED0FAC748EC837A7D6F28A8D004402F71CA209BB9403B21E29836C5FE897268DE0736E985F9631DFDD1AC59D5411E684BE082F41108E33D2B92B2D45ED70FA52EA2D6DE121EB9F9C886DA479464A9DFD9970A406491E334372D7B78936095A7459BFAFF0E9090C2C6B6D62624A79334F879A5C92C685B50F75F04BA664EC95893FF40D62EEB24DCDD288729D0C297DF5ABB83C77FC11D0EA3EF18E3BC7C2C065CAC51390C610B591D24", + "98CDFCBAD056240E180F347C00912F2D9ABEBCF5464D410BE6A50404B830F744D78F7D97180404FB3BCCC2288B7991810B2562C4D509200CE1F9C4DF6DCA4C600D9ED49C9C1456141C7B71513E728D41970ACDB6C15B4A4E327B9A87ADA73D1D46EB0A21F2F5481C3B42931C51B780FA526C29B98E6B9C714B20049F7A05252CBB84B8E36026DB2379C9632A0843436ECB72D15EA2950ACDE18DBDC6DFB01BF08F7E191EC885F11D1D8B7BC96E9836B395108F6854545082A694D5974CC36C8A658349186C1BA892DAA85D3F156BFBE94C73BCD815E7652C38E178AAF02014F0E6F23A4E7EF689EBF3ABDCCDD40E2DECED316F07E20716927C8F7B203D51D957EE6EAB062B99ACA0D28E0AB50B516CD92CBB9BA90333E73D58DE0B4B633D81EC93D15EBCCC813EE63D63BD18517F4FE85C37469574B8122FB91388123E1D5E805166FB7157494F8559F90A4FA3DE9E71DA6FA7CCC6086E638BDD4FD3E4487506ACCF84F1E1678D714B86FAAD57A6B76E085CFAC30DE469BE32E2D203C63B43F073DD24F4A1E039B941E7A97F8BB28B516217455268B6EFBB0E1745C23D6D12A8CD13E5D242F562F56FE92496342000A731BF3DB0A7D3110705DFD0D8DEFB85665B77347CEFC8629F3757304F6129DA9845F6509FE3D32DE9FA86EA4FA9BF86FF7CC8E726C0FA9F93F889C467642C5E944501BEF8ED59793AF8804A9951B4B88", + "906F6C5A1D3BD03A03802EEF5937E214E87B5E2F0182BA2C258F44B516EC66EACB705E06EA6DFDB56600B8463A421DB03A51460091D7FE889E6DAE32EC19190E7211F08D37846CEE7364B6ECC07C1740CE990141C4DC4CB0AC9F25CAFCA6BC9111102EABA250ADFD505201FFF638B31A77CCE7A1ECB273F9C8ED84EC2F403C1191596A53EAD823421EC47DC5E78F3BD1339532C97E4EAA024CCC906EBFB870C1467C3D845A178EB07C11BE8D57E4EDEA7ADEF162923E9521451B871DF6E357DCEEA7F62022106F647DD8A23074AC10AA632C56DC32B34A4A184FACC64E5D1E8FD69269660543EEA2FD584117A3EBCF6268352F0212ABCE7CD28A93C9AF76722FB5A71FF9E5AC4579A2BA32B91818CDCB62C77A6A8EB1F4C34132EB463812B329B6B22108AC36E71F38338AE3A52C632796E45189632B73FDC0BD37A457204757261B7CFC01E06BC767A57A5FA7CFE43794F65398A94B4EF09D6DC2A8691BD0CB018BBE7B66E0C37BAA4723247AF3424BDE22614A9A581A7982E8C2323178BD2D46E6912A2FB2D2531819A180689D7F2C9B5C5AFC2DCF1C7FAEB1927EB79A72EB1203BB0FF17DAAF27D66022195890BBDDA786CF1C36ABFD96BC36FA1D2A5A0CC3D7EEE1A1050CA840209903CB9FF429C7EE9DF9CBC2BAB84CF28FAEF5BB45AE9588970A28B6BD9ADF8DF134C1FAB0DE274B5C7452C4836A573A26A0B4C14B74", + "C6D5046A5000ECDB54C872F2DC494F2DEB88430007C9BE8EC39FFB148F00F7861D8277589AC839AAD30AF7D7A2E0F9EE8217A39C521311E9BD59A71BC6663A7738669D6D3BB28124A80ABDF905DFE2C9539CCF0C8FA39EF84E9633D63BE0C32F3B2AA9FCDC18AC38C3C00924E9D54977BDAE61410F997038BE066DA6C945D8258B7DD133EECBA836A7A6A2907C431C522619D466430E6ACF15030F7FBA4F3D6BB545CAD85678E81898D2DE358CFF3951C8184066B18930DDA867890871AF6F4133B492FC894DBE4AA5F1E44BD361C4560ABBCD3101B4AA4E065FD60308795DDAEBADBB604A3D58776006CD074389AF49A0EF09586410015C7DE4FEFEEBEA6262B23571B93BEE15CDA2BBA60B6CC72A7DC9C80C81C9A25FE3D149C7A8BB2F704BE11177F92E2CEF0BBD12C0766D691CCF093D456AFEA411A8FE5F1C1A44F31017760F0D0CC3B271FB15F56D9F51A594C34FDFF8F8ADC91584ED8D7E1B6DAB27B2BE1BBDC4486FB1C822F23704BB2EF4B521E02E42FDCABF69588B0B9D92AAA73116D26E8E9E48DE94F6267414AC845467597B4C1F2A9A8E1E82C0A1C05955022CDF87386098EAFC5BF1A040716A89BE53A36B143376927028A561BBC07AFAF42494DF5BC0D95170D853DCCCCB22FD36B7947712EB369077D02BF85B0A4F57757ED80B247E521AC640D1B1CE30F93DEBBE2389D364A8B7971A51AFA4F557A8E12", + "FDCF36E6C842D2ABCCE9D8783D0D7A7EB74992EACEEF6C618AC7DED4E457B1A708BE2C82B28A9563F4A088FF7DB146B16B47A900DF49A4F3FA8EDAAFCA09F408B025D04EB673E105E0F55959B7951CF0E999CDF68EA9B32333DBFE0516D272111CBBD9933CA8AD8AA6025E5F9A062D8305344CAFC3CA391BD8DEBDC58F7FDBC041B349900E397609C71E4EA3A9D8407C63E8A6BBEEAEFC92E9C939147920E48E35DAC6D123DA46E4F0838FD732E43FE4EEF6BD68D5AF0C9BA3A0CB28233743B291D4E10054F695DC10A847E661F39C4C133289B07ACA8B544EE3E2EC288CB18C40CD9A8E48A93378FD50E077EFBC21996424B539A397B3D2A6C7DE58112CF55E82E8FF10F75571A15DC248E6B77CBB91D8BF2D53E5C4E9A85C7EB8FB690F74BE029CE1B569EFACFC16872C5008820FC6A7D12AB43E08B4AFF57DE6B43B613DF8480ACA556E29D792C6C81CB1CB54A67245C571A04965267BA0F9CD3FA0950B9A5B393B4A230A41E455267CD396F42285F0E49C5AFA0B53EC7B60C1C317EDA3FAE4B1713A80D4EBAD32FC685C13649C4806D6FD887A24A4F7AE801405EF28F058B37112A680F9E9AD0456314E9F490393CA25775797E4CCF9184FF0C6A237AFFA8DE1B84C420A6183B1D49D6F2AC1E673E7FDE161A8159DCEB00D85F032EE76E3931C459CE935DFE4AD6C6110591EE58496B82A16630E82320B9510880BE4E72", + "94964FC9F66389FE3880283C4250E6E19F195DFEBD2104FC0959E084308BC9CFDC6E5ED1C4B48B4ECAEB4FDE5F215FBED85A6CD4D1C1466E68A4CF21AEF29F77933549A3A6FF7ACD8AB6E6C689F1E8DF0AD8AB289D5C33023DF90B21A26320CE8C1CEB2C099FC1DB58737665855DCD20D587E176483E33EF14C80AA4760F751EE5B28460811E5110FEC3D689AE2A6E91D0A3F1E22623E88571F4DAC895AA428D42634EC142E56D0D57CE68D7949BE13AF234229E546E9D66D5C58E510BF3EAC7B73309BE16DCE6E2280AA80247D9EDEDD20E06295C9876B412B786CF7E5F1073792158131AFA002FE7750A17015A9C2580646A9A0D2A3F0243AF1AB4FEFB3D028504553AF9C5C34D1A4A2FE3B8DD8BF8CEADA82AE63C319BD7981D97155AA2F105D724A8C09310D5C316877062152419A006ABF56AADED74DF0DF325D666C31DF51F194CFEB331E7DAF00410372999D2D05B023B2C3067E6CE4A472FED3B8BE1C15C24DFBF4956A5B670FFCF128E5A23039764BE39CBE55636B83674060B3CCF5EF9A7B7EAB0813ADEE82E271C422FB78A9820007753B1E62BF4CCC074F7796D5B2008FE6542DC0C77ECA3810120ABE9F90BE5934E8EAE365D02B3D2DF4EA4A827E033263B113EEE5823DD3912FB31E3C4B46B274D7115F34CDA793DB6AD2CD8BCAF4B13B832AB605BE42B2877EE2E66B411668EA29A7DBA5BD969B9F152638", + "9B8071D96E7D361B2462CA93748DE4D31746972DAE582AD4F70A188CB40C2E6E418288B6A713ED4B647013B3EC31C9EA6217DE55D016A1977A0B285224129CDC59A9E54F3E5094258F11C0C995F60785614E560764312CD86C6969B3274236EE602EFAE392C015E4C3972D6FA2A47AB48D5C5F6836AFA54F28CCC03BB4DAA0A1DC0DCA3FD3F2B15FB2ADD907D3BF7719D1D9A8284A47C30F32712A8CD440148B8DFDB851FFD25ECA2864150B832F8B5DC3A7C701371785A66285601E96D285FF88947804AA4D88665B3E15760CDE327FBD21393042BAF62FDCE6EC41955E877ECAC331D594ED40547AFED34D410714CE57FCB4F01C8826519ACB85F447306C86BD1BA8189E0621DD09451E8F341AE47E7FCF1FD2DE2AF78E0AFA27A4B6DD51A0710FC1FC4A5998234EDAA1D4CF0786B779F637EE1A72058774C1B4BF5E125DEBB4230645ECF87E3C6FDC91E1D14397FA72686784815D9654839AE8FA43864709EE0F4A336E3C399CA20B2E652E2AB17719F9253F772EB7A9E8838FED4EBCD0F8CD977583BDCEEBBD925676F56AAB0C36F3DD915F6691A30D60D523216FB233CBBEDE7FDFBA827450E595AB51237F9E77058E40F862D3A5A96E4AA3DA74503812EDEFA501E526DB6B4C642222D7F33B06D9CD0023471DF5730CF8E2BEE834D108A25729C1C1484C207ECEB0E4598965EAB5216D4E7C30577A89FB8BEC0B118F4", + "E43093167F77AAA20EF9F4AB7D715CD0E86542A0523BDF0256BCCFB1FA987A6565F808C03C71E6343EF41D2ED4C4FDBBB1AB1D617BBBDB776F07B000922FCBB3718F5FF326A7BBF4BDF148206411E86506FE5CEB8EC0F7AAD1DAE3BB46482F5E85D3B46DDF93F4BA19DF9DFD700C35DC038CF4E499A058995AF06BEE8535631966751A85571271E6877BE6216AFF16AA2B9046F1AB9126E1DCADBF40C4B390D23379D52C80C10CA05079D1F05CA294EAF7E2C66B884DDBB52DC85A45FFABB2BA6EB95869689486DDDE372DCCDFCB408496E647F33575BB99FF1699219D00D2608AEA1A47CF52DD21A3CEB3F043AAEB40EB27F042D276227C09CC8201304C55D254AC228FF309FE8DB74C85430FCF9441EF1B51A1192703B140CE3703E5848477FB0BBC2E82DC38702D4C6A78A41729B7EC86F9890EAD369DE4F25EAD61DB0B5B0ED764EC84FDAB904FAD9DBEDEBBE89F338DF52F7A6FAC8EA1D76001846802B328E8D1F110219BD6BB51214814026BFD6E32627B696C7990F53591CC811A9A09A1154A50585B882DE0B404D7B5846DBDC8C66E4AA0C7B90B08CC96A5CF2352A6592BCA536359C863D639CDA60FD23326619A9014FD878EBFF3E73E4424B045CBD506ED744D3243725EF9491D6165D332FB12985022A71C7DD4E3F942AF5CDF2396F6C346088EAE89535E1B21DA8F7B2E1E12DC8A37738310248808B9973041E", + "F5B9B9204186466AF61609CC856B6B2B33D6F526EF1E4BE4DCAA1E1055F033072B3801B642700249C024414B3217D160513E5A804B3AE8425852CF5FB9F51D2601F9BFF9F5E4512A45ED8F615A6671315590DEC31720387533A4E090646F17244EB571DBD6E6A10890FF19809D935A5E88228D424FF2E54B1A37576C059A756290BAAEA5E36AC977526339CDFF915A763B2CD0657F3A3D385A5D92466A44980AD8A1B4E1593DC177E2447ADB53B1EAE15A91BD6703E46F01AE91D6C316C1DB983688576B3B2BAB280FF196D5BF545755097249C517E1271202E3856475A3C95324F827961DD7A827709DA2924B21949B6BF032675D80FD120180F6850BFC385E72399F840B80E5525EE70B89E1C524D580390D487D0CD31AF3CA5691067BDBE8E2E91E0099F59700CDFCFDF8B3ACBEBCB61DB23A28E80C3E463D9E53328C37EF8FF0D4FCBD287932C8197DF57EEBC9DDB29E2046C7FC14970F9F37CED37D8BB0958155192C8595E2A9369944DAF58FCC1D9E1987DC4FA77ACB256A65DA78B733178FED14DA3E3E41DB808849132EB05E48BCA03ED499A314C857FF7C7C1FC8BD2478635396BD7F252ED984C102E23F55450F57ADC7EAC50A57B78BF4F988565A172E878638ADB1D992703D0BB742605EB76E3C85319F567D71B9F2E40251EEB936B323DE98496229B1F8A996AE4F6C0C2FBB3B2244F3BC57EB3FD067F535102", + "A7F21431EF8C75A1E9723B1FBB602EB4B92BE5FC8DE70183659A45A31EDDC46643ED1287A69DC876634231D3AF95F2D02FC9C0C7BBBB12319CBDBFDF6CBF94E47A05204AB14A490C6FBABCF329B5B0EFD8C2FA28845764510624398BFDED1B250003FBA61A67D2127550FF07A6FAE2CB5B8FEB23D289FA235BB4959F8845B25405A75A30E7D05D7BDEB721BFD4A998DAA6F1A54712901551E30D618DC80FADF7CB7863EADB7EEE708F1050AB0510A956C3C7706756B6CEAF611F02656C3CACBFD9E4507AC2B4B78D0EB0BF757496C84C7260CA972F0F45A393A89AC2BD70F15E629473D61FFA29BA18A468D8D4B1F72DDFF99608AC9E6A6D6A9231F24388991E80FBE6A9269AD6D31182E79235A0E33CFEE9E3526FC068A9253789407AF8CAECE14BC337FCE02333B63224A61E913367CB36641A74E2DB2892C4E939A50127DBEFED7456F7E61454FA5016A6B75E6133B0417C2860B2F640ED8EE62D5100EA172BBF8FB02E2022D29DF33C25654C96F8FB2305B72A92105E027444EE0F27769946A67E58D9A26AD01483FCA4BCDA4C00A8119E355CE733474349DC8311AE9853A064931FD68D598B02E0724A13FF63D88416FD5D03A962B5D8F79586E696C484D7F287773851831EBF33B0158F51C89C493C116157D20DE66F3990061135F5CBC46862BCFDA5EB0322793BD6AE188698A2E1DEDDF71702B6CB01EC2BDF85680", + "FB2C4002173D1E1581890C14672C1F232E8A1332655108F24F78E53638EFECA3DAD18D19FBB1E91C6AA4761017DB37FA76F70BBBC4C8E8015384DC9E9EF14C6AE60DE55974D448DB8C36B030DD55DF5EC6F6C56DA8CB9BBAACF6784628B669913A7B291632730C11710D7E181401FB535FE8A9A0B81578CE54123A6C3897496375CD7C60BB4E05AD16BDD4CB8F652448E3020EDF4D51FF5EBB9FA93A740AE779419002994348358CD7827A63BABCD7C4501CF8ACD77A2200059DFF5B180AFFBF3CE52133C7451CD108AF9CC8FA32428AE9ABC55D89E1931E6607160BF96015901DC097B56299F9F358DBBE921FBD7D0DB43C9C5BF97468813C0AC632D35C858D8384C32EBDEE933C9037EC36D2322F54FB0D3CF305801DE42B4EBCB5F83F3D3FCC1AF56910B7A547F50F851079B6D0D262676145C27DB362AF383037FFAD5E3B26BD2095143B361F82425734842E2153C5F428D89DBA45EF59BD9DF1FE1BA941F172A685F08C18B76B6A8FDC86EED2867A57AF48E00467993864EF70D80CE5550C5EDF085E94435ECA89F6513D23A56235739534C777C17BC6DC7BF6E04BDAA9B0C94C4D7AF1368C6B4B9D3C97D25A26B05703EBC4D1F8869C5DDA359D189F4A3E548D53731FB429F3536880CAD9FE13F70DB0A080B949C3636611CBFF0F644ABA8B56D2C6E988B3392A7452A8C8E52F2288560331A78F4CF021D2A41B2ECB6", + "CB7A566070A06E759017D62CF78A429913370E6498BCDC038C1D3079A0A3E6FD4FDCC851DCBEA9EB3A7D266479F75C40452A282CB406E9A2581372BE2FFBAF6E7F3359EAA594631CEF876FD62DEFBB3B816EC98A1F72B55F6023B572A51F320CD7ABF489AA905CE2274729C0EE0F677A04D7449A489BD02704CA65BCD8B753B689CB90C87C73FB4A45219DCD817E9AB584EFF049EA711CD3E24CE41423FEE6F258A65CA8EC3A00D45371EC5B846CF1549CB5CA4FF14B696140D3483DDC7801BFE6CFEFB9189B5C7AC3DB9C0709F630D80F361442BBD22636B00530EEF21D96D4A12CCF85E0124939B025CF35A0A5F1B4C2FA5B5DFCB3772CBFEC1F0C1C824B5CC22BA8FB2DC92164FCBC60333EBF920A14599F1E8EFD4E8CB0257134947331D820595BF5630EDF00814C32994039B47E8784C29D0D1C5B5D219A9F55FC14CC18DACBE6A79698A8073276A424BA9A6606DFF369CCF5F9F4AEC9605F6E44807507B36A4918FDAC448E3134106683EBA80A2D97E12EC2BC1EBBCBADBDC631CE7D61BB9DDF143C3EEA4E36EAAEAFC001849812A7CDE3EBC194A51EA2A9A2AA15A0A4F29C2FFD8B2CB4ADEE99B59553BB2398273C04329A5C884989D417C131D68E9B505594C9B9CF1C13AABF05093A9E4224D71B54C6F61F1255E25FF7527E47768FBD51523F42915133E02CD7E404147E7AAE95BE651BFBBD65E29130D0CA31C2A", + "D90A7D104DEF06F51CA5FE107C115C130B8823C423423608DEE00E0C2E6C202B60C5D20BCC9CDC18767D89E5E7857BABC9531C21B08436AC14C5B34EB986E5521369BC3D9B1FCD07C99240FD0DA306C69303B310B8F78D2BF97D6E9E88843234D73214431F6BAEFE5109AFDA22C4C348A469370BBF9B0A81CF27ED919A0A48DA3E9061113C56659F7561175A608B7FB37A76EB9E5ABA5F4A6B485EA5D097482A28F4EF7DE785D31DDEBFE41DFF7C51CA2B64A0D2A7A70269FDE399FF7628202289EA97141F995FF51DB5AF7C9C5CA76F0AFB4981D021FEA9EE6A49ECCCD18AF290B6C231265247DECE33B3E165FDE4FCF82EA84A4A8AE3FA90972D96DB68550AEF21FCE82E0FC75FCDE33C2B6F659A873AF09067D94B068DCEEDCA4D392BE5077587785CB6A1F1947841F483BE5080E85B49F1073D4778A39239266DB2A24B57B5F51B1F021D05C634D66DAD081D1668EF0520424581E5E0B62ED085D005F169950F971E1493A49A60A595342AACBA236EB16D5EF94E749889E50656D98F94EEF205445AC027387AE1363696185E24749EB67518B89057899548BABE29F3487D273C54EE2BE6254C7F3ED3D3B22FA3FC94791A7BC7C499A391179368D9B1F0DDC325F55022F5AB7B91142E2880BAC761D154C11F2C58F4A42E8B3DBCFD44777F08A74676DFB7039F24C9A4C4620726FE12849C9D3C15293A3DF7F4870DCCF56", + "9D238D97CE04FEC0D292181D145EA0EFA727DBB7BADDCC60357762D262DD7D7A3BB0189E05BE490018ABBB61B154F94A4FA81985E774019CCCE4B8ECE9858C0C2BDFFD7923B3354A2144ACCC5C9DA34E50299EBF68E9BA0A269760386E5531F8964F8024ACC99E7AC3F40BFA9D94ECA1B14A1B173A06867100C57883FE7333C079C5871A8A7603395A87387EFB92A77C5812EF548CBC3B9178E874E45DFA8796BA6FECB5D81687EDC0AD5F804FF36A9CDDC58A5F991A2A0BA999F86E663715CC79A439DEC44C394ECF1F14801D8F9F292A648D29D2E910032F224ECE51D0708E4ED6D3E65FC788A2C1D286750F4B6D768CBF1B6EDE8524C2A7457A82404A491DB5EC868E6B95B02167A0C4E785290156943FA091F28234C4CAAB586F8095895FD21582E0356BC15EC7CEE893E70902CE4D01217474E0226FFF30CB78597726C74B95732E44D03A626F1D1DBA7785F55859B71C2DAFCF71D99EB99FFEF4877518C579D2623FF6EB326B8D6C7674826984CCAF98CE41724183952EAD69F05F44750F3B857EA01475555FD25A828BE1DBEF5E8B1C1237779E9E69D35E7BA9ADA124CBE710490280B64B2DC5EA2C41D6644012A18B369E3CA2FD93A254C493506C54FA6CB4DFE24E0B5035230F2BDE6FF21101164F322B4B066ECBCA3BB4F3C476B41BD02D8948E555AF74EA13228F07A1BEDBF95FA7E16F2BDC5D178E74FE5A1A0", + "8DD8032BC8D741905EDAE449212146878D8FA15AB037E41C36D21B0064D65BEBB74A18F4370C80DB44EE93C2AB06DCC6C6FE7DEA83F270C9FB52CE00BDBF546348F0E6285A35A32A47512823DD6E22FB7949071D4B58B46241544AB97B0F6023C70AFCFF0C7541B4B9E1FC6B3C3C55500251665D964871B9D1247B3A9728AE02FF47368053B1DE928B6A8D01ED3BCB18A3180EFC9700871F480959137CA1480C3640547497ED7CDB4912ADE1385F9F35B6D27BE64E362BD71E0981BE952B00AA20DC57465DA89B87BBE07F27454FB24B3B86766F95A5A5B4EAECA2620C3BF87C0654E6561398F27F96178EB1062E42F6E6AE0A669FC6C7170F217C850E822B4E70C9033A375BBCF6D62D11B3DAF7DA976D4A9D955B924E7F0A19CE77A53EDD424ADFDEE8558F06887E82A936193AD5E508938DD3FBFE02DFEBD98C2272DEAAD8AD3B0FC86C3637A6CE694DD95E4FD55F433E151D35DD4C930177CA66322001110B9BD0B89A096C8C3A3431C100E39E3D2E65504A770F4EB2F19E9D8FCCAF15B8E58DFB52A0B88406A48A036193F3EA9F8ED2322FC69CEAEB9E2DD6AC627DCF4CB109EA05AB5DCEA5F92902F3E7BD457C240C958FCA7B17F2EDA1248961C9C827E99BE0A3D60B3E27E42B1FF696DD58E48C7B832D8FE95529B9C8F075E67294C1B1060EC6736DB73FEF7407B320D850B049D80F9F4D536361038C4BAEAD92F24", + "C10051089B11B578F56E6C24FAB973C5D1B4A2F937E4A402FFCC45267F4A3F4CF4EED3DFF530838A570000F7E523D1B97FF798A3C6E12F9704126A9B6FDF606031E4D8E1AE39A470FE929124FC95961B85A5A6E10A79CBA60F54F37D4DCCB13FA3B0A3A1729184C59036428532E3DDB3F7B8D373DC08842EBC2ABBFDEB5B73B2F9B7E83C81D5D0EB3037A32AC0E5B6CDCC7CD84B9289BE16106D1D019D47209AFD8DA78EFA0F9108377C187B170CD53F366B17899EB41903FA1627AA245C07EEA5D6DA78039B3C4C1D70DD28870A40EE3A048D8209C4088A0847D6859513E01E0F4172C383D64F0B307D721C01495070336A753A75E1CA433FA973BB131E558FACC298C0A6E934E9F717E19EBCEA11EDF3736D4EAF593A8E5AC8EDFFE4D2B17B613E024B41AAD19BC0A27A1E9BE9D25344D4350596B9B0A48AA014191511B26E61A9753D8A38C4E3BECAC93E67CAB5696888C06B9099E9AE856486436FDD1AF1C193057AD1DFBBB14AF772F7D9B00F37A6DC9E805A8DFD9D53A161885E5C2C2A6DED0C54D00A8E0704877DA2F1EB6F6D8EB93B5604A4E2545D454C3D4F0D606AC192E170D44E85E2ADC91E54F56906909024DEDB6F9050BF3D3928D9AE23D9C42576AE4DAD1336F47519EDE436C3B1829CD2C5A0AF63476C7928B32F5E51826D844A1DF765C5578F9C2E5F79024BFDA96FB3199A3C7B47D3755FAF376761B4E", + "9C6674915677A62A7AFD4FCB27B45F8E6DDDD08980B7DBE1131E6E2425C5ADBEE8474E93A8A2D4E495B195A6B83F2CF6472A36E690928362B9A1FA994A9FEB7BCBA7FDCB771F59FB434ED289CCEABDAFAE29113389EB98D6F17E5508D5976E11BC8A1E93AF9F7B1C81686265930B4D334568E3F29E1C2F58A62572A610016C1C1C1C9E1D0EB3FEB2B3A210C59EB3980C44BC656FA7C5E05A4472D4255B40B8A1604FE39D8B5026A976310648D5C84CEBC87A8BF6545DC843A3A0B64DC4CCAF2D2203122DDD75BA42E096844899A35A899FDFD72C26E3392EA03351DC78BB9F62F51D913F8008DB00969C64003773FB2014FAF97E794A45792495BD52D7BE7ACA47FF2BF570CF88303377092B5B6BFF3B01D38A53E8A68B0D81FC2D1D375EB27C7AEEDD70679E8DDBA6DE656442ED951478FB96A979B4A9091F344EF39AF23DAA886C6FBAA8611C61686332C630690109E2869D18EE7A2C21B22921B9E3DE40BF063E370FF64E7AFE160B7EBFC4AF6AEDA043042552F5F36C2CABD339FE1442242EAD931D1B83968D1A31A7E32A0838401DBB9C1034D56ADCAF5942462EF63440FD70F91520137A50372D0D125A6285F7D715FD9225D03A109E1FC5EB547303CD7708F88FEED2814607171930436B249924714E8D8E024C24B3C0C9E40127DECE1AD966C3F9DF01793864615F291B73F73D27B624ACBEAD3D371B8D4FDA823C0", + "A1B9E8AB6C44A3610768CC17E3B899CEDDB44B746319EC50BA7E006EA0F3C09E9D67EF8A20154B2F93EC265B800503BC72831800CE0C9FB6CCADC8327A840F69DDF29BE212BEFE4AB1810026FF786D9D3A88B29745EB61131FB47B385F83CA211B4A2BC0449F7ECE43B2DDAC94C10955FF2E078AF573FFA7349907571AF501FA6A2FCF24E4B5676F8213475351C0398748FBD60A5EE8A1128C0998E57D076A201453EA7C70B1F171E7D084F444311C9829CAD03E0C2330D7E8D39DB6B7901C30787FF123CFBAD4E974A5F6412FB1BC927FD65CAD1F3AA4ED52E2D84AF6257EF311222467DE179E89438524116D8E0A4A94C19A4D66D0AE0FC535D69C4953C2E43136AC07D6A5774D59DEF1471B4097146C2124DF83D36678FBD7BEA6E258D826645DD88AC9A7EA5E05FB49F2CB29EA9081323FFB2A00F3915D1F36675BA1C9AAA3B166D9FB2529150D3573E502668E33DFA5BE95AA6C2F1F106D69218839BA590406B4FE4A03C4B16E29E6BC31335234BCA55D34955880B702F08203198EB7BAE381B231FAFE513F24C8BA9E58798F35465C2679DD5BA8B16EEDAFB04E5A807B9BE6EE4B3AD77609D2B9E0985BB23397BBDE08F4D0B21494A3129857E37D13862C1FF77A57AC663C206A92F8358E6C05FDE1A9D68131BC04B76F6865E8DF5C48F9424CD9AB6FEFB3B49BA8D32C923CDB8602C5367AA9ECAE48AEE6A276CF25C", + "ED1196222AA470CB4FC8A0B7D2C785EB45D232E06453B77DB76F60E5F7BAA0FAE80467EC8C656FC27FFDE8BFAADD2368B41AFF69460495923942ACF85C09EF01BCED0076960E5CDB1D36061933C1B6037548D27932CDF969FD5A910D5564F3A6BAF896A2A69F40EDA76E813AA261530F686042235A39A76081F58D952662894E6E648BA72098D840235EC4A2B963F8E74B52F2D0088DACA7EDF48115618DBBABC698C04AAAC0632475BEE65BB26A4EAA08F0209B75EB259B826724F580209F8B991808411F823819CC5F42A9FC1F0CEDBDC54C046EB1D1658FFF7252908B09F8C1D82E5F6D605F0B17B25506FAF91D4B3D4EBCB7A705E5BCB2A6FB409ABE4B1B0B47630F1AB0B40A3455181678573F82A7C139F072659D80671961D614D9F7DA72914BD5D6F417EBC152595972FDFAE876176923CF1F2F745A6FC27E134CEBC2D9AD5CC733F619C1B296026B7C4717D2086D91765D83AB76605050B810C542819BBB7CD87EA2305AB4A567B2C500D9913B7C6046F748DEECFE3C3AF829EF97E03799EA50F7C9EB38990F0D466498C091C3ABAA18453B173F0AA3A486DFAFEEE68E7998EA30E5C1349F2A54AE753963CEF58332A114F964B83B4E446A44147B11FFC60DA25B5FA705F34725B1388B17E99018236BD646DC714F8B7CD3BF2648063B2D3FB713AB94D82ED81D571D5BB4D3E5F2F067E2F2C90E8B6857E6A651B8E", + "EBE597534C0A6FEE9CE6AD10A80D2DFD160D7DE7A20154F62AFD7C3187D51D09DA39A958432CDCCBD83FCE19131E65A30DE99DB796D93D0944223D960BA233798323D368DDBD407D51B80350976951AE0E50CF409279301939624C741D20D5CDBF4BC3ABC8723E267BE75707024F6398CC6D32A7BCD0989555E0EE49C1A2354D1E961CA9910A5169ADFA71D56745181E0CF13469D8F3C6020637B8118ED8421A680FD4D515DF6B31C39ACFA36B601027AFBC861493D34ACEACFB501DF9A311B7EB9D38D7107E6B5ECBE74FD35CC8BC8319DF9F1948653C94C868DC24AB8D7E650D8F70A3D1D878558AC9BFA50D425604037F3DA323192654F1296C8320AF934AF60DACAD7F9630EA4ED0A635678213F6D09D73A2544C779596990DA42079C23581E22F541E6A3B6D3FA383597A8BDD7CA42930816D74FE8B12F92CBB9303CA5FA12BF5FE954FA7B53E0D88B79BE263B4B55B42A7672F5C4F7E6E2DB4C02AFD6034B7371E01215CED3F73AB8E3419D7447781AE5DEB4F4547C5549E9B0AD59940C162790650344E5ACAB33A187A58E29C9032963F088C044ABE73A855FF1FC93AB8DC258E419777311B7997EA95D32CF1F0140CAB9E6707E73E4FE575E0752816122C39B8D12F34ED6771EAEE192D830797DBE97A0BFD00E39CA382D44F080BB4F8FF6FAAFF2A82744C6E14D3036E00EC2ED5C9D184ECCA300030D7BD77B27DA", + "A56990B45E9AA5F9523D563D53E854A47629A4183E85CA1995BB374EE5601BDBCE5C7407999D28FF0F1B3EC7A463D3C941C57B7EB71E6262DA3A7136627814EA6D28C8D16E91680B0D961AAFACE2CA4099F986CD45A2AB387E39497B13678447480514B4008F0FA3B95AD7D2B4751C680F0C7D3651F9621E1355CEC76F10468ED33DE4C7D7D68B786B7F0006C604BCF893739FFE6AE56AD5AAD07D5BE76DE1CD581B10EDFEC9DF65AF925C4C1289837BE1854A62FCCEECCC4E2AB47B4864C467F5E4C276047501EABE444E051DEA933863E0FCB2356CC0C3817BA59B2E0AD78BBFEF4C3E4C35343331CD81C7F4C428B0418DFA4D6FF655BC50AF49C9A5E8A67BC265A3F30800B93E42C0E66F117E6C59C85BA5E273234EC7212C7B7AC3D87FC0E0EC5FBAE6654461F24BBDF9A063FD0E3F98741C5622ACC8BC008EB0E3F3D57680F12E52FB94CD957EFDD49BF512D9131757161A73DD9650E3561FB31509A908D3EA8DBD1C3AA95AC32E6960E0D17A218A25784332A88E85303DEBE117BEFEDF46882995AEBD704AEAE032668AEC6B8E5BD28D3F110C9F8C1DCA8FACFDC1188A073037796555DC4FAA26ACB9F51B545D32C224424BAC3DAB20D3C08D784E9FEDB47547C25671C269A62163742B55AB4CF9406D2C5047F92C76356F0B90221E019B31890C0B8FCFD04E6B5D06114B967D1358797238D5B14D824C8F0BD7B8BD0", + "D85AAA53F2DE2946EB0CA09DEBB6CB61D91D27C8907B90C89E20C01F681D33BF0DC70B6C79F19E4DB64793505A0E055C33D1E07B7F5AE09F7EFF0C8CEBE80C84373804A48A945CA406D3A1B17CA787DA265C1D8FC735CB098C1AB37A0452F1A287B8E19E3A57E59EF8F2E6CCE2F0AA7772955977982B1F6880AE8717520753636591BA36E351310E98ABB77E26E2CA5BF267935FC38DE173CA20C3A964B56924A5E82A9E36D005EDE6680D543C021C7A9F53DB69BFA3201880B7797E90D31011AFA17BAE836505F5B337C23A07D6AF167258C314C3001291DD9FC565F6B7FB74D99C1B42B496422B3D3E1A564769C2306E40264641EC14724301795B4D54F5FF8D6C4AB3645B56C1D0FFE9B977FC5017E2A53392E7458BAA308C343AAFF5B46B808BDA1FE5C284299A9EEEFC755132F9D3B475E2FCD6BA84917C601B5E8340B5A68148A33563E40AC5A1E49BD8D5FA77BEB6B99E6F4F68A10ECA112475531E7C1942AB9504B8F76EA7BCCAE4A19EF859FD6B6753F07BDD9A19421A2A0B8F27643B2311FAD7978F4366C41BD9F609486FC6EC7CE833A00D7A48AD816412BD201F40C93D136ABB8E329DDB816D1F59A1F3124D6314C64C9B640E4D5BB201CDB4490A65C73228E78055AD6632D81709AA443EBF29A4607A504DD5CBC0D271FE595677B8E6A5E29E23D171D50B878D0D3F9416657E3997D077677B87399A6D1936E", + "A0E629454DE594F7693888C9ADB907F83EC6818D6FC0019B70077BF1B0E3C2CB16A263BE145EA8129FED6BD98F3D9120BAD28379EC8E36DEC69C59B37BD6C2B65D172C70C69C23E29A6143121AEB9E6A9AB46C3DBC3979BC876F4357F6BAA5A0CB33C3AFF1654FE547D5D760E8CE095A9B324E15CEC1596BB7E0D56433D8908EA69925A5CCDCF01702811AD1103F237D36C5F12A3CD938A61EF76A3387340499E4EF1855F892F57AC39AB419F1A397CD43FE7F4C5E609ADF3A2A8E401FFAC870985826CA0DE211996A3549A203B798A5162E98FFC8B5CC2CFA68D618AE80D399D8DFE0FE4AA81ED9B586EA89F646D5C0AA8B107506C7F86879419D0F717E8F70C5A9DC2C3F122CB52F3B691087EF5971C27086512F1890494ABA38B1619969F8846B8876B95C56142F5B171502FA44ACD0299E82FC94EBCD4CDDBE1F5DF978871128F79C1758BB512D5C3BDE59A89786CF4E4716F0515F45A1CA31B06B23E4883F99EE0488848EB0A60FA14AABBD41EC5421D0C162590FEFFEBB4DD0300221471DE8DC0C87DB3F1D54DB11744F8A7115DCA0595F6CD99B74A6FB10C0D14E430F8B40E3E7105C89B2C8F12B37A8879AD9BEAD49AFA1BD56569713CCDA3FB634C3011D51A8DCF84437251A7B19EB61FCE5DF6E2278784722BABE384BA5424646FA23F6D10CE23DC5E0D8D512E7C5C094B1627D6285B57EDF38A7DB1BD57B72044", + "CD7AAC98501F29507EA4E0183E8A40D2E5117E47BB5D18D01A3732DE4C821DFE86521CBEA7DB29BE1148BD544ECC681689BCD1B41EAF755310B7659342F8EE11CB41550CC30E566E192796B66C1A83C0B28BACCFA6C393043A0A2CB89712BC1CCB174DE58E66896AF39C1CEED1E05B0435F8CF6FD920D100F51584FE24879987399481DBF27DDB6286B6353919E552E669290CE02AB4CD5113D7F484229F379C7332767EC69E4336439B05DE1C1E3563DD303A4F580BFF20A40E49CB0822F715ED0221EBCDB5DBAD751124B1715E82F37488265135B6C8BBCF4F801ECC4D3525FF189493AD4EFF0C042B070C4CA8FB1FDF43D79F06A6E4E3D35D7B07D4B728D5DC54EEDACBBBA1EDDCDC07ADF7DFCFEF835E44DF1FF66DAF2A7BAEBE218AC3B15E183044D6A8A89B3C101B40BED97ED5DF93BBC1B84931D56B8C822A6D058AC74CFA4C85D8B456698E82D5B7574C17B041E5F4BEED09F75012355CBC322B822C63F10C18A8F279E9A0E18E1FEF183D23E13894E31F6D046956FE8A647558228F6D4D6910151EC03937876B6ED7A078D33DAEB3F2239353BB8181E62B286BBC41588DE10F478A5CE5B508F205A41820356767B0A0ED4B8DB9EFE348362E9A90D6C30218B295B338B51C09239D02FC8A1E7DAAAB60AC37F5E67CFC88EEF69567B5C81A03B449F4ED38B9D295A36AA3503173F6F6F66D93CE72D753076040FACDE", + "ADDCEDB50E907D20E826E6E8A0D30C20C74B2DF204EA784BAE9F618CAE33A3C937729DF9CB10BA2A4C33E0182A37200C0CC509729D828B8A2A20F283AC4F9306596684EA3FB5492A4C9F2DB459E7531C9F9C0950E7D9E93B3EE5912AE7E39AC8F4EC14B18F24E325003F477E347C5AC1B67CDB11AF3BBBBCD0AC3703024B5767AA67A208254F798684BFD1D3EACD757EEC77254950A146620400DB95E694574F739A991EBA771EBBDFF1056BB39A77DBE0636A032E17141332F951C57C6C90F348F165E3ABDD60D429D5D6BEC7E3E3463806F819EB2D212B3528A5EDE51F235AD100A35E890955F8A1DC51FDCB53EABCA2540997DD054C1F5B29462995B876B44D085904E55E1B838BEF600A992EB49CE078DF75AF3D0F137685AC0D07F0BE1EB87B63A41E74DDE869C8A683BDE60AF5D77FF18F7137495BCEFD0ED28F62F9C3E25D332B5F861D999FCDC0B4851A984A4DBB53401FD40351ADA4335C702BCC8D900C737507B990BDDBE91D201E3A0946DC968D43FD10D04B0B76667FF5B4291C2124B0124C6B710A6D1BCFAEB016B9DEEB0F7A4FE044CA4EA0CCD84B7682617C3A545071EC295B0663B3F577D562DE1D9DD80DE6A1EFD6D5991EB5246F1597B86D0E9A90CF6DB0EB2B8E7BAE9431E567F01AA98502C773742246467ABF911A91A51F6C1B9E0C3233DC1A37D17DB91A5F0F661B0EB5886964456C7818601BD0C"}; const std::string Galileo_E1_C_SECONDARY_CODE = "0011100000001010110110010"; diff --git a/src/core/system_parameters/Galileo_E5a.h b/src/core/system_parameters/Galileo_E5a.h index cedd414fb..6bb63dfdb 100644 --- a/src/core/system_parameters/Galileo_E5a.h +++ b/src/core/system_parameters/Galileo_E5a.h @@ -35,20 +35,20 @@ #include "MATH_CONSTANTS.h" #include #include -#include // std::pair +#include // std::pair // Carrier and code frequencies -const double Galileo_E5a_FREQ_HZ = FREQ5; //!< Galileo E5a carrier frequency [Hz] -const double Galileo_E5a_CODE_CHIP_RATE_HZ = 1.023e7; //!< Galileo E5a code rate [chips/s] -const double Galileo_E5a_I_TIERED_CODE_PERIOD = 0.020; //!< Galileo E5a-I tiered code period [s] -const double Galileo_E5a_Q_TIERED_CODE_PERIOD = 0.100; //!< Galileo E5a-Q tiered code period [s] -const int Galileo_E5a_CODE_LENGTH_CHIPS = 10230; //!< Galileo E5a primary code length [chips] -const int Galileo_E5a_I_SECONDARY_CODE_LENGTH = 20; //!< Galileo E5a-I secondary code length [chips] -const int Galileo_E5a_Q_SECONDARY_CODE_LENGTH = 100; //!< Galileo E5a-Q secondary code length [chips] -const double GALILEO_E5a_CODE_PERIOD = 0.001; //!< Galileo E1 primary code period [s] -const int GALILEO_E5a_CODE_PERIOD_MS = 1; //!< Galileo E1 primary code period [ms] -const int Galileo_E5a_SYMBOL_RATE_BPS = 50; //!< Galileo E5a symbol rate [bits/second] +const double Galileo_E5a_FREQ_HZ = FREQ5; //!< Galileo E5a carrier frequency [Hz] +const double Galileo_E5a_CODE_CHIP_RATE_HZ = 1.023e7; //!< Galileo E5a code rate [chips/s] +const double Galileo_E5a_I_TIERED_CODE_PERIOD = 0.020; //!< Galileo E5a-I tiered code period [s] +const double Galileo_E5a_Q_TIERED_CODE_PERIOD = 0.100; //!< Galileo E5a-Q tiered code period [s] +const int Galileo_E5a_CODE_LENGTH_CHIPS = 10230; //!< Galileo E5a primary code length [chips] +const int Galileo_E5a_I_SECONDARY_CODE_LENGTH = 20; //!< Galileo E5a-I secondary code length [chips] +const int Galileo_E5a_Q_SECONDARY_CODE_LENGTH = 100; //!< Galileo E5a-Q secondary code length [chips] +const double GALILEO_E5a_CODE_PERIOD = 0.001; //!< Galileo E1 primary code period [s] +const int GALILEO_E5a_CODE_PERIOD_MS = 1; //!< Galileo E1 primary code period [ms] +const int Galileo_E5a_SYMBOL_RATE_BPS = 50; //!< Galileo E5a symbol rate [bits/second] const int Galileo_E5a_NUMBER_OF_CODES = 50; @@ -60,11 +60,11 @@ const int GALILEO_E5A_CRC_ERROR_LIMIT = 6; const int GALILEO_FNAV_PREAMBLE_LENGTH_BITS = 12; const std::string GALILEO_FNAV_PREAMBLE = {"101101110000"}; -const int GALILEO_FNAV_CODES_PER_SYMBOL = 20; // (chip rate/ code length)/telemetry bps -const int GALILEO_FNAV_CODES_PER_PREAMBLE = 240; // bits preamble * codes/symbol -const int GALILEO_FNAV_SYMBOLS_PER_PAGE = 500; //Total symbols per page including preamble. See Galileo ICD 4.2.2 +const int GALILEO_FNAV_CODES_PER_SYMBOL = 20; // (chip rate/ code length)/telemetry bps +const int GALILEO_FNAV_CODES_PER_PREAMBLE = 240; // bits preamble * codes/symbol +const int GALILEO_FNAV_SYMBOLS_PER_PAGE = 500; //Total symbols per page including preamble. See Galileo ICD 4.2.2 const int GALILEO_FNAV_SECONDS_PER_PAGE = 10; -const int GALILEO_FNAV_CODES_PER_PAGE = 10000; // symbols * codes/symbol, where code stands for primary code +const int GALILEO_FNAV_CODES_PER_PAGE = 10000; // symbols * codes/symbol, where code stands for primary code const int GALILEO_FNAV_INTERLEAVER_ROWS = 8; const int GALILEO_FNAV_INTERLEAVER_COLS = 61; @@ -73,311 +73,311 @@ const int GALILEO_FNAV_PAGE_TYPE_BITS = 6; const int GALILEO_FNAV_DATA_FRAME_BITS = 214; const int GALILEO_FNAV_DATA_FRAME_BYTES = 27; -const std::vector> FNAV_PAGE_TYPE_bit({{1,6}}); +const std::vector> FNAV_PAGE_TYPE_bit({{1, 6}}); /* WORD 1 iono corrections. FNAV (Galileo E5a message)*/ -const std::vector> FNAV_SV_ID_PRN_1_bit({{7,6}}); -const std::vector> FNAV_IODnav_1_bit({{13,10}}); -const std::vector> FNAV_t0c_1_bit({{23,14}}); +const std::vector> FNAV_SV_ID_PRN_1_bit({{7, 6}}); +const std::vector> FNAV_IODnav_1_bit({{13, 10}}); +const std::vector> FNAV_t0c_1_bit({{23, 14}}); const double FNAV_t0c_1_LSB = 60; -const std::vector> FNAV_af0_1_bit({{37,31}}); +const std::vector> FNAV_af0_1_bit({{37, 31}}); const double FNAV_af0_1_LSB = TWO_N34; -const std::vector> FNAV_af1_1_bit({{68,21}}); +const std::vector> FNAV_af1_1_bit({{68, 21}}); const double FNAV_af1_1_LSB = TWO_N46; -const std::vector> FNAV_af2_1_bit({{89,6}}); +const std::vector> FNAV_af2_1_bit({{89, 6}}); const double FNAV_af2_1_LSB = TWO_N59; -const std::vector> FNAV_SISA_1_bit({{95,8}}); -const std::vector> FNAV_ai0_1_bit({{103,11}}); +const std::vector> FNAV_SISA_1_bit({{95, 8}}); +const std::vector> FNAV_ai0_1_bit({{103, 11}}); const double FNAV_ai0_1_LSB = TWO_N2; -const std::vector> FNAV_ai1_1_bit({{114,11}}); +const std::vector> FNAV_ai1_1_bit({{114, 11}}); const double FNAV_ai1_1_LSB = TWO_N8; -const std::vector> FNAV_ai2_1_bit({{125,14}}); +const std::vector> FNAV_ai2_1_bit({{125, 14}}); const double FNAV_ai2_1_LSB = TWO_N15; -const std::vector> FNAV_region1_1_bit({{139,1}}); -const std::vector> FNAV_region2_1_bit({{140,1}}); -const std::vector> FNAV_region3_1_bit({{141,1}}); -const std::vector> FNAV_region4_1_bit({{142,1}}); -const std::vector> FNAV_region5_1_bit({{143,1}}); -const std::vector> FNAV_BGD_1_bit({{144,10}}); +const std::vector> FNAV_region1_1_bit({{139, 1}}); +const std::vector> FNAV_region2_1_bit({{140, 1}}); +const std::vector> FNAV_region3_1_bit({{141, 1}}); +const std::vector> FNAV_region4_1_bit({{142, 1}}); +const std::vector> FNAV_region5_1_bit({{143, 1}}); +const std::vector> FNAV_BGD_1_bit({{144, 10}}); const double FNAV_BGD_1_LSB = TWO_N32; -const std::vector> FNAV_E5ahs_1_bit({{154,2}}); -const std::vector> FNAV_WN_1_bit({{156,12}}); -const std::vector> FNAV_TOW_1_bit({{168,20}}); -const std::vector> FNAV_E5advs_1_bit({{188,1}}); +const std::vector> FNAV_E5ahs_1_bit({{154, 2}}); +const std::vector> FNAV_WN_1_bit({{156, 12}}); +const std::vector> FNAV_TOW_1_bit({{168, 20}}); +const std::vector> FNAV_E5advs_1_bit({{188, 1}}); // WORD 2 Ephemeris (1/3) -const std::vector> FNAV_IODnav_2_bit({{7,10}}); -const std::vector> FNAV_M0_2_bit({{17,32}}); +const std::vector> FNAV_IODnav_2_bit({{7, 10}}); +const std::vector> FNAV_M0_2_bit({{17, 32}}); const double FNAV_M0_2_LSB = PI_TWO_N31; -const std::vector> FNAV_omegadot_2_bit({{49,24}}); +const std::vector> FNAV_omegadot_2_bit({{49, 24}}); const double FNAV_omegadot_2_LSB = PI_TWO_N43; -const std::vector> FNAV_e_2_bit({{73,32}}); +const std::vector> FNAV_e_2_bit({{73, 32}}); const double FNAV_e_2_LSB = TWO_N33; -const std::vector> FNAV_a12_2_bit({{105,32}}); +const std::vector> FNAV_a12_2_bit({{105, 32}}); const double FNAV_a12_2_LSB = TWO_N19; -const std::vector> FNAV_omega0_2_bit({{137,32}}); +const std::vector> FNAV_omega0_2_bit({{137, 32}}); const double FNAV_omega0_2_LSB = PI_TWO_N31; -const std::vector> FNAV_idot_2_bit({{169,14}}); +const std::vector> FNAV_idot_2_bit({{169, 14}}); const double FNAV_idot_2_LSB = PI_TWO_N43; -const std::vector> FNAV_WN_2_bit({{183,12}}); -const std::vector> FNAV_TOW_2_bit({{195,20}}); +const std::vector> FNAV_WN_2_bit({{183, 12}}); +const std::vector> FNAV_TOW_2_bit({{195, 20}}); // WORD 3 Ephemeris (2/3) -const std::vector> FNAV_IODnav_3_bit({{7,10}}); -const std::vector> FNAV_i0_3_bit({{17,32}}); +const std::vector> FNAV_IODnav_3_bit({{7, 10}}); +const std::vector> FNAV_i0_3_bit({{17, 32}}); const double FNAV_i0_3_LSB = PI_TWO_N31; -const std::vector> FNAV_w_3_bit({{49,32}}); +const std::vector> FNAV_w_3_bit({{49, 32}}); const double FNAV_w_3_LSB = PI_TWO_N31; -const std::vector> FNAV_deltan_3_bit({{81,16}}); +const std::vector> FNAV_deltan_3_bit({{81, 16}}); const double FNAV_deltan_3_LSB = PI_TWO_N43; -const std::vector> FNAV_Cuc_3_bit({{97,16}}); +const std::vector> FNAV_Cuc_3_bit({{97, 16}}); const double FNAV_Cuc_3_LSB = TWO_N29; -const std::vector> FNAV_Cus_3_bit({{113,16}}); +const std::vector> FNAV_Cus_3_bit({{113, 16}}); const double FNAV_Cus_3_LSB = TWO_N29; -const std::vector> FNAV_Crc_3_bit({{129,16}}); +const std::vector> FNAV_Crc_3_bit({{129, 16}}); const double FNAV_Crc_3_LSB = TWO_N5; -const std::vector> FNAV_Crs_3_bit({{145,16}}); +const std::vector> FNAV_Crs_3_bit({{145, 16}}); const double FNAV_Crs_3_LSB = TWO_N5; -const std::vector> FNAV_t0e_3_bit({{161,14}}); +const std::vector> FNAV_t0e_3_bit({{161, 14}}); const double FNAV_t0e_3_LSB = 60; -const std::vector> FNAV_WN_3_bit({{175,12}}); -const std::vector> FNAV_TOW_3_bit({{187,20}}); +const std::vector> FNAV_WN_3_bit({{175, 12}}); +const std::vector> FNAV_TOW_3_bit({{187, 20}}); // WORD 4 Ephemeris (3/3) -const std::vector> FNAV_IODnav_4_bit({{7,10}}); -const std::vector> FNAV_Cic_4_bit({{17,16}}); +const std::vector> FNAV_IODnav_4_bit({{7, 10}}); +const std::vector> FNAV_Cic_4_bit({{17, 16}}); const double FNAV_Cic_4_LSB = TWO_N29; -const std::vector> FNAV_Cis_4_bit({{33,16}}); +const std::vector> FNAV_Cis_4_bit({{33, 16}}); const double FNAV_Cis_4_LSB = TWO_N29; -const std::vector> FNAV_A0_4_bit({{49,32}}); +const std::vector> FNAV_A0_4_bit({{49, 32}}); const double FNAV_A0_4_LSB = TWO_N30; -const std::vector> FNAV_A1_4_bit({{81,24}}); +const std::vector> FNAV_A1_4_bit({{81, 24}}); const double FNAV_A1_4_LSB = TWO_N50; -const std::vector> FNAV_deltatls_4_bit({{105,8}}); -const std::vector> FNAV_t0t_4_bit({{113,8}}); +const std::vector> FNAV_deltatls_4_bit({{105, 8}}); +const std::vector> FNAV_t0t_4_bit({{113, 8}}); const double FNAV_t0t_4_LSB = 3600; -const std::vector> FNAV_WNot_4_bit({{121,8}}); -const std::vector> FNAV_WNlsf_4_bit({{129,8}}); -const std::vector> FNAV_DN_4_bit({{137,3}}); -const std::vector> FNAV_deltatlsf_4_bit({{140,8}}); -const std::vector> FNAV_t0g_4_bit({{148,8}}); +const std::vector> FNAV_WNot_4_bit({{121, 8}}); +const std::vector> FNAV_WNlsf_4_bit({{129, 8}}); +const std::vector> FNAV_DN_4_bit({{137, 3}}); +const std::vector> FNAV_deltatlsf_4_bit({{140, 8}}); +const std::vector> FNAV_t0g_4_bit({{148, 8}}); const double FNAV_t0g_4_LSB = 3600; -const std::vector> FNAV_A0g_4_bit({{156,16}}); +const std::vector> FNAV_A0g_4_bit({{156, 16}}); const double FNAV_A0g_4_LSB = TWO_N35; -const std::vector> FNAV_A1g_4_bit({{172,12}}); +const std::vector> FNAV_A1g_4_bit({{172, 12}}); const double FNAV_A1g_4_LSB = TWO_N51; -const std::vector> FNAV_WN0g_4_bit({{184,6}}); -const std::vector> FNAV_TOW_4_bit({{190,20}}); +const std::vector> FNAV_WN0g_4_bit({{184, 6}}); +const std::vector> FNAV_TOW_4_bit({{190, 20}}); // WORD 5 Almanac SVID1 SVID2(1/2) -const std::vector> FNAV_IODa_5_bit({{7,4}}); -const std::vector> FNAV_WNa_5_bit({{11,2}}); -const std::vector> FNAV_t0a_5_bit({{13,10}}); +const std::vector> FNAV_IODa_5_bit({{7, 4}}); +const std::vector> FNAV_WNa_5_bit({{11, 2}}); +const std::vector> FNAV_t0a_5_bit({{13, 10}}); const double FNAV_t0a_5_LSB = 600; -const std::vector> FNAV_SVID1_5_bit({{23,6}}); -const std::vector> FNAV_Deltaa12_1_5_bit({{29,13}}); +const std::vector> FNAV_SVID1_5_bit({{23, 6}}); +const std::vector> FNAV_Deltaa12_1_5_bit({{29, 13}}); const double FNAV_Deltaa12_5_LSB = TWO_N9; -const std::vector> FNAV_e_1_5_bit({{42,11}}); +const std::vector> FNAV_e_1_5_bit({{42, 11}}); const double FNAV_e_5_LSB = TWO_N16; -const std::vector> FNAV_w_1_5_bit({{53,16}}); +const std::vector> FNAV_w_1_5_bit({{53, 16}}); const double FNAV_w_5_LSB = TWO_N15; -const std::vector> FNAV_deltai_1_5_bit({{69,11}}); +const std::vector> FNAV_deltai_1_5_bit({{69, 11}}); const double FNAV_deltai_5_LSB = TWO_N14; -const std::vector> FNAV_Omega0_1_5_bit({{80,16}}); +const std::vector> FNAV_Omega0_1_5_bit({{80, 16}}); const double FNAV_Omega0_5_LSB = TWO_N15; -const std::vector> FNAV_Omegadot_1_5_bit({{96,11}}); +const std::vector> FNAV_Omegadot_1_5_bit({{96, 11}}); const double FNAV_Omegadot_5_LSB = TWO_N33; -const std::vector> FNAV_M0_1_5_bit({{107,16}}); +const std::vector> FNAV_M0_1_5_bit({{107, 16}}); const double FNAV_M0_5_LSB = TWO_N15; -const std::vector> FNAV_af0_1_5_bit({{123,16}}); +const std::vector> FNAV_af0_1_5_bit({{123, 16}}); const double FNAV_af0_5_LSB = TWO_N19; -const std::vector> FNAV_af1_1_5_bit({{139,13}}); +const std::vector> FNAV_af1_1_5_bit({{139, 13}}); const double FNAV_af1_5_LSB = TWO_N38; -const std::vector> FNAV_E5ahs_1_5_bit({{152,2}}); -const std::vector> FNAV_SVID2_5_bit({{154,6}}); -const std::vector> FNAV_Deltaa12_2_5_bit({{160,13}}); -const std::vector> FNAV_e_2_5_bit({{173,11}}); -const std::vector> FNAV_w_2_5_bit({{184,16}}); -const std::vector> FNAV_deltai_2_5_bit({{200,11}}); +const std::vector> FNAV_E5ahs_1_5_bit({{152, 2}}); +const std::vector> FNAV_SVID2_5_bit({{154, 6}}); +const std::vector> FNAV_Deltaa12_2_5_bit({{160, 13}}); +const std::vector> FNAV_e_2_5_bit({{173, 11}}); +const std::vector> FNAV_w_2_5_bit({{184, 16}}); +const std::vector> FNAV_deltai_2_5_bit({{200, 11}}); //const std::vector> FNAV_Omega012_2_5_bit({{210,4}}); // WORD 6 Almanac SVID2(1/2) SVID3 -const std::vector> FNAV_IODa_6_bit({{7,4}}); +const std::vector> FNAV_IODa_6_bit({{7, 4}}); //const std::vector> FNAV_Omega022_2_6_bit({{10,12}}); -const std::vector> FNAV_Omegadot_2_6_bit({{23,11}}); -const std::vector> FNAV_M0_2_6_bit({{34,16}}); -const std::vector> FNAV_af0_2_6_bit({{50,16}}); -const std::vector> FNAV_af1_2_6_bit({{66,13}}); -const std::vector> FNAV_E5ahs_2_6_bit({{79,2}}); -const std::vector> FNAV_SVID3_6_bit({{81,6}}); -const std::vector> FNAV_Deltaa12_3_6_bit({{87,13}}); -const std::vector> FNAV_e_3_6_bit({{100,11}}); -const std::vector> FNAV_w_3_6_bit({{111,16}}); -const std::vector> FNAV_deltai_3_6_bit({{127,11}}); -const std::vector> FNAV_Omega0_3_6_bit({{138,16}}); -const std::vector> FNAV_Omegadot_3_6_bit({{154,11}}); -const std::vector> FNAV_M0_3_6_bit({{165,16}}); -const std::vector> FNAV_af0_3_6_bit({{181,16}}); -const std::vector> FNAV_af1_3_6_bit({{197,13}}); -const std::vector> FNAV_E5ahs_3_6_bit({{210,2}}); +const std::vector> FNAV_Omegadot_2_6_bit({{23, 11}}); +const std::vector> FNAV_M0_2_6_bit({{34, 16}}); +const std::vector> FNAV_af0_2_6_bit({{50, 16}}); +const std::vector> FNAV_af1_2_6_bit({{66, 13}}); +const std::vector> FNAV_E5ahs_2_6_bit({{79, 2}}); +const std::vector> FNAV_SVID3_6_bit({{81, 6}}); +const std::vector> FNAV_Deltaa12_3_6_bit({{87, 13}}); +const std::vector> FNAV_e_3_6_bit({{100, 11}}); +const std::vector> FNAV_w_3_6_bit({{111, 16}}); +const std::vector> FNAV_deltai_3_6_bit({{127, 11}}); +const std::vector> FNAV_Omega0_3_6_bit({{138, 16}}); +const std::vector> FNAV_Omegadot_3_6_bit({{154, 11}}); +const std::vector> FNAV_M0_3_6_bit({{165, 16}}); +const std::vector> FNAV_af0_3_6_bit({{181, 16}}); +const std::vector> FNAV_af1_3_6_bit({{197, 13}}); +const std::vector> FNAV_E5ahs_3_6_bit({{210, 2}}); // Galileo E5a-I primary codes const std::string Galileo_E5a_I_PRIMARY_CODE[Galileo_E5a_NUMBER_OF_CODES] = { - "3CEA9DA7B07B13A6CC0AE53DAD1EE2A0FCC70009338C08AC0EE457F76A1690815C3C940AB722487CC8F3D1F4C428828E7FD2A21230E42A3BBDF1E792165F644D0E0335F95EBDC93D6005CC0C680DB7B0E1B8C4946B7974319F9816141DB9E01011E4F20DA8F1B8E15A6F618CF599C3F5C1A1B276D51318ED4119BCE0ACD0332F3DD8F88EC5215AB311C51FF4987DA93B09A43BA84CF08032F6CB28F43043C54586811D870AD6FA27AA63785345C8BCDD3DA26A0134738BC7E08461D5409FF0B791D8574CE797FC5EF7821055028CB4AF92AE1088F8806CD55F0E5FDFCD8D74ED801B2B44AD5D79D1924D41DDC6AB2070B5360CB64CCF487FE517420348CC39BF50BDF78BE7DA91542FEAB689457B3EE69E43C75FADC303F31032FD96B7DC70A88C3B7BAC7322B285D9CFB3A93AC8B890165F23848FAD8477DBDD3D0AA4CB3CD73A48000B6D134DA2DA70B56E590A101AEE78864DA0C64A7BCC6B37CD6F31E9AFF10CA4D47630752D253944632DF6EC60AECDCD223F29399CDA3B74D1DFA5471277EE6C814464A8C55D3C0B83B36B6AC9FA90CE876ACDF65E3EA3FD61D309EB71ED29A3D510B2F4C0B6D6C5B57EC9060CFBE48389DCB17CBB2284E7F578565B91503B06F49CF3E8534870AEB6AD9707265A9A1E6E2E5E6DF6DAA367239A96EF5B02C19A4543D537EB4D9D73966C09E9B52B4706F57B3E0987885EB84DEA26F7823D895F62015188ED38C04CC6714F797FDB0BC713E3D0208462F9A68E3872A167BF1BF9791AEE8BB73CF527C50975B55C4E5C2F2E95B677F833ECC878D1764839608CC1108A75EE9E58FFCFE4CB52884E7AF15EE0632E0729DA1CF5B7A227028CFE1E08F8B881E1A743D52DD27BED33DE0EE75DC031B4864CF192DFEAF64F726D73321363A233F81C57232432D2B0A5A4C44F4320847A9C143F378F204185D2B571482FE45D6BCA152E6EA7223BFC6DCE06CEF90CE9114623EAB9B1EC789B2051B4AB711DABF5B16FCD970F437B8860313B4F1F14D384EE3976B7E55D2FDCB7E1BD9BE18B722E37C853ADC7E1CC2870A02881F95B78487780E1D1C296415109CF07AB63D0782A9F451CBEB3E8B919917AEDBCA8A8E563AD3784639793E0F25CC9CC62240FA04B2F141E71BF5C84EAC56431159556B8BCE077A51469A87737D3D6F06D97DD479FCC35129F4499C19EF98BDCEA9D4941B3756CDE1997C3AFCAE62B6D9E23341E11CD05A7FFF52F5814011A84D737E1264109006BEF5F19E3C6A9C7521B44741A8282755A8F0DC2FA0E1F6CA4FB34D8CD5FAA27E18808868725B9634376137C1BBC46934F83958112D03082DDD6148F353BD1DD24B9F8FD7AD89C40DA0A92A8DBE3608038CD56FFC4ACA35241D76FAC4CAE1211AAD9D73D51C81C59BCE05F71C345730D3A2C670F8F533A950EF24B00EFE6A3F1354694ABCC6FD9EC4E74DDE1F287AD4F847A297ECCCC39AF029EFCDDDB19932D906B9CEDFCBE0D422CEE305DD05E407340F28EEEA866664D60AF293A45D5D6D5C0000B05F79463DB513ED488DE7BD4EC9EACFEF973B23CE4E9539EFCB797456CF5FD1EC54FDCEE80B39063C48B91A5C2D2BEBC81B9B46D0AD6503BE5AACED2BA5EBE81F630B4E07510356E8229F7FC5EA532B8729CDB819E066A15379AC6942CD4BC5E97C6791E098105C323A3A3DA3880D5EE5562ABBA2BDC9906F4486B51ACF8AA4405E9D7A63DB9E3058782DD9AF3995FFB3D34AEF98234A0B3DC62C339325B60706C068F0198BD8FA658396D06931B069155217690C7F88FD230CDB38E3E48530BD47722FC", - "9D8CF144C4B667345D44F765622A956CAC4E097AB1CAB05CFBCC6BB68C709503AD9DB09C09C983D46A04A05B6F7EB26DB4D46F868C10E112828B1AEDB3C0074BE0DE3C9B7821BABB4F8B8E24F69869CCD981B09A783BF6A95F39ECFAF25DED6B16F89EA09D3A8413CCEBB545651B363DD385D12BB72420440C40E804FA27DE029A1E08629BAAB598C035DC58FDD309844F3BEBDE40FCC231F38605DED06572ADD85DC51D3D8B89B4480143D0B75283522354330E5CCF4DE1A6E68047D5B8D45D835A891F2D40C9DB8A76CEB1D18FE2BC38D080A8D97064CC87D692DF21184ABFDDA7642D0BD6F3209D06B4AE7600F7DDDB71DA751120599117ECCE645FD109CCA2EC7DB98F4177F14DB854FEB314B5D7CDC3385AD203464EADEAFF4AD08DFEF3D21240BFB8EFCAAC1356C72A0F5C61BE03CD2A21A7D756FA9003D562FC4A49A6BE788EC8D80054ACA881DFFF72C2966EECD09F185EDD11218C6696DB14E05FFF3644D11E508F4F1E9C5AB3074FB1C3FB21092A1C8D5AE05688FA4A9226C3C30D0BC3981933DC8648240F8CB67085F53AC5295428DC8447A1E5A46C2BA86796982C4C6CC647FD8079BC4024BB69E2B226E6F3D0F8A90B4D36DA2AED4C6BB60D318AA7479FDC2031143C67CB4381C27072E12935001524C7BECEDAA9954BCC2AA218E9EC2C95498FD8DF655C015896D9ED42CE7F91CBBA2CC4A7920038EBB5F5CE638F969F8B179E72AE252BE7E826E5CB53C2E85AAF1E1F1AD8D534F78A681928818AC3154651FFC583DEB0A6A1F40B98771ACC528AAF80D210ADAF83597869968D499ADE9A19BAF341E8CBA20F0E1473BDD898C24C7A5466F9924EC7EE992A2086AF295BEE1F6D0F8843D91180BF2C981C11FD978B23B6BAF7786BD526B458B76A87C31D7C52DFA43F3D362C8EEFFFB3FE5FB3F6E5F34B1FEC7EF1031146F3F609B32677F148F7DEBCF3526BB45582436A3092408193D6312626E46ECFA96FEAD12A234CACE10FAF9DE75EE2D238088146328E10E9ECDBB0B018ECDF2725415CF5A06AAB857403BBF6CBFC350903A982864827988BC805A3484A31FECF7A40D4FE251BC7E487613B9D3A48D3C7DAEFDC49C4B7E625F868DB53A798515A61050978552699EF2A5BF2F13BDD444EADC9B60B479FDD4633EB4C1062AA78BEF06692DED203819D3160310FD7F2343732156A9CBCB0B50BA9A8F93E339B702670E54BFA6DB2E2E773202C690FB71EB03671AB0B1B02B2F189BD99061ADD23F75F4914067AE638C9A29DD3661C28AE272CE692CBDE6AE880FBCF272E548342372CBAF6370C7E3AE9648341CE7310BE1C534B5702B0611AF65868F840B6B7613FDAEA21DEFB4F2024487023B02B8B58C9E9F27AA787EE775249EFC40913CBBD69C38538F239B203815F00F7B9CB30DC79E6A0C3E069D109E4A1BAEEE36D354C3D0121F1342F1F4AC504A68D69DEC158D54B04BE8164B48F31BC0827A0379C5237070B6F963741AD9ED4F3865698FB8233D7F49ED4E0EEF3AD927CBAF4FAE183252BC56AE4CDE3E329B1D9C87C6C11429B15B8EE589213CFAC208A12AA01B4F1F7CC35CD0AEAE217471B3DAC1C279F353DC61994FC45FEDBBE0005D8EC729385645864EF98A3A417E62F1EACA7E60D4E773BB2E4024D62830F103A7988733DD7BBCF3AB0CD0049006FE2F7EB3821724BEC37EAE44681A9699A025D212724CD98CA3415FE2BD09FADC02F1501FA38A6083427B662DDCBD0460E12A09072698EC8966C47B8A640AC79C1B7722E78A6C28680F4BB77BBA477BE0A6FAB959B9753217C5708", - "45D1C8FF162EE106CC87C3EBF6A837930F8CC797EC7A446E8A213ABD239582350636B19B5BE428A9C13F980B7AF5CD7F32630AFE8693CDF0EC0BC2C84F2472F5B86576E8C43136C14717A24705953D392BAC96C1055B782C7941D82FEA357E5FDEFF772FB9F3DF248455CADEAC4CBA2EBA9C91184006D1680E000D59E4BC8FBE2C2F7CC2E78BFA5B60EB292F244E6CF497D5A287432F2520B31B9D9FEC1210923299EDFF043CE077195509E92372F5959AAB4666AE486DEFA400D81463C388CD05C677BFD4953D2627105B0A776960FEE916C75D53981D30DC689581B7E8E0723D65949662ECFAA6FCC9F0CE8892E367721718F906207663F9AD450AE98D75DF004080FC15DC2CD7A1DCE013A0E547ADDC29A397ECB9E7FA02035327AC40240E2091098708D424563AB7C5867F3F2D78EE3EF5B658FDDBD49435060CA2EA3D559CDE957B7E48B98DB41CF875F7B3D9EBDF6547B4EDD98DF4B747B0793152FA8CC07C6D9EE5A2002464566D86466C2EDE54A2BF4BBE823049E57364C127A14BFE1B88ECF70EFB81EB831BBF50F6AE124E5F6A775F3F2620E91D489CCF24811C0890EF905E9E2ACD399E13DC81333A54BDD295B872EB74E412E2FB654A9874854FBC3A68C73434C5FC5CED27534B2B13C316205FF4E432FAFC13A7B5B7A7FFA9FEEDB5AE69036F8F2955DA124CE5856E8C53F24E609F7D3386DC5212B2E78B5AA23B59D45FE98AA08E9CFAA9D52ED260A36AF07522C047ED43808A39D7019E444EDF84D885A9AC84092A0F6BFED562F3E0D79FB5CF62F98E67EF219FA3F5AEB7D4E344642D3D4B1A7EEA18464F6CE8D4CB3181D9EBF6F4122751B54D0D7F3FC470A91B547148AAB1CA0DF59872120190640555A7561B0F2C11280768F74B1A56674FD5480B0F510491431810D99CECBC6DB85888BACBE2B020FB8B3D78039773229714156494EAEC3A2D0A59E718F72205747D69C05DDF1C678E2E154A1F84EF0CA2E24DC4A6A996F0850A396D2432596EAE84AEC0935B8C25D5C65B52A32722F01D281C4F753EE03EB10020E9FA02462CA303DA39560669637532D381EB78AE5EC0F6DBF6273EC979442E6243F65FC51F26C6C9554C6C0E3EFF33BC4EAB6A27CAB9383BE7DDDE4218C4998033B47919503E1C9A789711EBEAAD6C0298B3DC563F54D28675260F6D896F1B8D4FD0001C429210398E9544B3DAA12C31F7EE82EF4D2234E26F873610B76756DDACD24B6132BCFFE735FE75513ED527DD04D7DC6D24059F85706679DCD1474A9DB9571426BE17E6DEBA58B33B708567697F471CA8B78E8FA73B0E18CB6F88BF9E4F442F0FC21FAB89305484828F18B65F9D373A6A2B380D73F5924F80DA234C1DD87416D025E4E663C96F287B0C83DC92C2164D81830781B715209FD11A65E64962D805389BAAA91DFBB990D3511E506A8EC101131C5B7284252F861D047DB2C2027DBAAD487ABFE429CA21CBEA7671350618E441F4D62F2D579CAE29D97023A8873869B553293D9F54D4A929E252AF132325A6E3BCBF7B36D0DAFA1E56A39A5D801FD0D5A41111017BF62AAF8346C7D424FE007C32B437ADE60AAA9540AA5078FE6C3C3CCEA53EE863086646C976FE6C79434A0AA4F53B2E9E2C3B4CF9C9C4015391E27CDFF5C1FCCCC00BBF5B99715A1265F591E294D530DB14DFD485AD34BBCEA32E5B5D0EED15F88BF5D96D058E6D70BB1A232597E35A625E5E8C2EF5E7031A71F70309019A0591BA0A50E87C839498255A3602C0FAE53166BE5E49E29D24AEC47002B698F80FC49E718B66A8959259ACC540", - "7A0133D5CC3754D6B259A2CC4EC0298111D098CDFB40549E5C40B36A2846CB4B256672BA189CD3A05293BB36B167508A7BECA3110BFF339BA06340585DE8EDA03AD244A77F54B7931610B6F9C5C54D688A0526A9B52605BD7D7BB01A63F3D1565CF78ED904BBE4AFA4A290EADFE9DC156E59BAC162A818B6CDF38D2BC715144D44A1578BFC727423777784D15ACFE80FACAB61F9E58B5D3FFDDB065A00C5D49DF0237EA6C488D7758F1A689DC59DBFF78261016A7C723FE52FFE571F5876FE0ED50FB00A90BB82B27BCAF5A67374284844E06BB1B2D84B1D20228F5C2208CA7E8EEC2E95027B09372A309223A15C132543FF3A89B7AFBA56AA7A8DBE70E0805D3A54191CC6884D75ED0FC00C06D9D488B0F4816E12D6C2A4324EF742AC8FF885E42100849DA05E3B7C451D43ADBEDDFDD13076CD8D22BDA101F665B5878E321A009B970D1F4C48503CE35365543B3F36786802E5C53FDD756C595784E4F130904044660784ECD9C9161477F5BCEFC98987540AD1E86CABD3EC7823D83877605FFC79820F1381DA29282C3C5B3443B6A67973F0622EA5DAA14FA239542EB140082F242958B39014486E5D5632C62C3EC8BE0E09E038C0ABD52B1322E0F7407FA53AE8D761858136CB371AED5E6FC9D32CADC8F870EE833B7120BC0278D9A05554D90DBEB24ED6F5A8861698D48B4BF7AFE7763C1401572643E246DC65853996B0480D38DB7302364409357137DCD0B416561B9511BA43CA34341FEF7954C28B2D9FF96EA110E0818309C32AD306DA077CC911299FAD6396C872F3F6AF7871395D7E67879EFED929E4C05AB4C09E8BB396048150A4161D7944CBD99C94DD16CD8E0D8BB73768B17EC02C0D4206AF623037D6F4257DAB4C07B4A6C0B4D2E0C9923FBADE3DFF7FDAB45F4E6BC5A895FAE4F5BB9EA247F2D4446E260F7988C452203EEA1DFA64DEC2DCC090BB3ABE13F6A8718F8DA2BE551407B59B8EF1806A65526B6B872CB8922BB929F09341554A71E69B41B60987FE3A5E7E3424D947455083A827FFE27FB5BC5365C80998DE01CCDB66213575FB61B3E6F877D0E2E4EFDE4467D9F07B6A28148FE2FD6EDC9202F55FC855D0DF8C49E244C40CC3D95FC06C6778D397461BD157F4A0FFD915799820D55F52C96AEC0CC5A3E7A2151A845EECEE78B82ED9A217E326CF6C49F7D31C4D8ACAFD827E6ABB760150203448C000819E7E0B6E424C43A5500164CF128D686B4810D9838480604A891792987FDC549D87F95BCA120AB84FCCD8C9F93F988C87E79599F3C1952BC0F7773BDFFC50B19BDF8E3D8F52D887E45B643297650044E80124BEA0ED60FEC4449BB3BBE394CDF7CC7AA39BC1A5023044F6A843186C01EE1BF5834EB5401AF7905FC04447AE00DAC50B051B432F831FE5AAA7506160CFD7D4639C489ECA447F4F993AF0503CE5EF68A837FCF85B85993ECC55A9A3673F8F2C5CB8D3DD4C60E8421E3417EA958EF87E0764B061A39C32ABD5E0E3A712B54B0A3E2D351A0E00F4E901521C63C1F4ED829F6E259A1F720FDE96EA9CBB8F7BD7485531A81A49CDEFCE725493A04B5EAAF7411DEACDE5A95AB6C2AA7BE3269F6AE4D166D8A5FD5264B135FF8361FF75B2FF22A61905A349C6B2C1DB2BD7B385B8FBDCB2768C7926F138D5F8107111563CE527322AC42E6BD42485668106B8CE91F157E0C94448869F7AABA255821DF981CD5298D40378FB0E33A3DF8A037BC21F0AE268E69F7CF61E7E117BB463EDE3C7D2EF95987C66AC3E5C7D79C44A7590BFCF998683701DAD7B98731DBCB455E61428", - "64D4236F326627BC08E9B2B96C1A9E5BA2631DCCA3F7A5B63736E4EA8074056DCD6BF0E5D6DB8845D9271C0D706F972AF22E652E3B2A7CC482B125EF8BE005F25D5109F6F9DD84DF966E2E0B8950FE1C01E2DF15205EC48BECEFB32511DCC39678F9DB08ED0EFF64C7B5DAED1DFD202F63B6EDBCFB7E4FBB431718BBFA2B65594D78D3983B0457DDDB350AF2C1B9743AB9EFC260A78C3144622C50D528B7D47DDE46FB9DA33D1E7DE6D5829258C2F02D54085AD0121A1BC8339A2847F6F161CB6EEFC5E3FFB12E6C77E5FE10E0D4B02E58142DBE5BF900B7B64EA79D520A35506AF4987E67BCC80D00FF467A0889A14B85B4745888B09DF7B4D3316D9B4A9B17C4CEDFCB0A55E2AAC53B538705673B2A2EE4ABA914E20ECAED730E3D5E272A65A74C366177A711095624A679C9300FEC18E20E65DA3645F23AABEF7EB7C7FF49B289FD2F44661F6F5F689B6E06EFCC99F8A5EAF558E10F2236E002F7D97C316698D6833792C456F812A339166E9FB3B3F61734B98AD2DC9A484A14A6025114D072B68C47DDE97322E213F5D6A93762A45C4C73C7832BB31209C4B1F0094BD24BA23CA9378FB893AB078FA3BC4763704EB6A0C8EC965690CA5B858DAFE623AB88ED39154F46B9030462DEC9070DA9DC34063C1CAB3FB84D60337F1D6D95D1A173650C96128D3C036D0B72B4D2A298186CCA8E1F386E1F70C0716F0BE370A6B325CDFDEAD3CC67E021E9D4C839230708DCCB062096F32C4DBE3C4876A7D1A26072673A6CABDD8D65A5E91CC5E973F00FA67619F749930F9D40B767E434D0955D47FC17BB37E4B7CCE63B1D666AF5D67FCE5FE5469D3DF6B6855F9C308DDFDF6733FA7B8511B25193C27925F3619F5F836014A64A2C8B783A50C6B3001001D621CEC582FA4E52C2B916A418F49ECFDB5ABCA40E1A8D38FE400FC2D0C185009E85546A92E829DC1AD2A7AC3DD23EB77F3D80015BDA4135B1194B10ECFC87C1102B3D366C5460D20D83E778142F1A4EDFDECF3D0BC448CE24A49C609B035A99B64FABF071C58DF592BBC625359BC23A565F4BB077DCF879E14ACE87F709D276982A3D10B23A9538A6A3DEEBBF0B712DB4C16B0FF508F3E4AF4AA759738302D24C6D13037DC81B0394FE785FD14A322BC00ED95E0E9D527FE5316748DD893DB03D5C4149D471DE98C386A2E9DCFF05181E837A1814D54C9CA708CB5E7A10B0FF4F540338BE403E4B9713015A99260795DF5832CCE8D5F763C68BDA51133AF1D012C283E8F4B1DDBB4EE8C351C4AF86FB436571F53B2E80AC04BE26EA617EFA9C5578FBBD81DD1809EC5BCA5DF4A85B24970EBD88D9856B2136616F85A338771BEE80F20F6E5652FAD00F49F3C349061DE3052841992EAA04CE15DB6C48888BD3CC5EF4D6CEBF00431CCB7C5289D79E67FC6CF2DA88AB60CB65D0F687455A535C33547553966D197BAD9778542F6CC7182289AED366ED1CDB0C5EC1E9C0F0E21D4D2B8D01EF4BA394E0C6B05B8EF42D81F773D3D251D6264CA23DA5CA2D4884544FDB81A243974FEECB416D0748449BA0CDC69E56D666FCD24D9BD7C322CBC038CEC658B5253227D87C527473F34BBA3E2FC18784F864233FF8528A874A8503840AAD03B63F79FEAA6C07E4467C4A04366ACD35E32A142DD76A23417EDBB8004944A1E51880CAA97937493EA5BD5A41298863A71D33156CDB942C166748DF66B80ECAD27675A673C8692805B42E97F1B28DCC9BCB58FDF8BE55E2034E73E444A225DDDCA5B46BEBA51AE98A27990F622B32B2C337046E459B173D94BBE5FDAE31FFD4", - "23300D5D80ECA6A471DE5CBA1D29B7010240D95FE341A62FF8175ECAA9566011AEDE6EDA0EF2CFFA7BFF9F4C9AB2C97F6554BB182B23F2772090FE7C4ACB8BE7427E7A8535DA3A670341D88CFE694D1CF40156E9B0557EA317A0B3E21F3A629D1CA971482B1A54697BBC2020BBACBBB9D1E67DC33F52C4B446A36D4331FB02F19BF1A647D05714450E591C65853176A04DD561E0933CF3F24A2E4707C44FE29C5D7706723FF53ADDDC67A67C23769CA32876F0CF31D233D352FF6A7277E5A3A7578A6F2A76456C0AA876680CDF2702B114E02D22D9F59077B9DB2ABFED673158EFAE4C23A75FC8BE701D973169AA7015297BDCAD4870D4F152DC556A06BBBBAEDFFCE40E6BA4F0FEB154F32D8E1492F74EE7085937600EE176ABFD6B8638E983EAD26C63805B98745BA290813CB65CCE33DF6B98240E571DEC4BFB2430C4B8FEC23C1BD5C3E87E0E746BA8A7722A6A660C5095FEA8E1C4978B966F487376DF42C9668E5D3102F123FDCE7B8D80E8BC84AF0D91E9355FF6F7482BA74E0BBA7DACE85BC053F31074151566334B4DDA37C6C51BB947811F284B671FE53FC464CC30DDE59A3D9CAD26822183E96D2F4BE60905B94BB8B167B734A0F0B26AD0E5083A34E68A620151966D073293E5D430D0726C0FE35BA3F1F44D851D374ABD80E826DD84A665165B3B82D540CDED9EF60CE48E87802F16F5DD89163AEC8E9C523E9F99AACCC6F00126C4C8663A7D64D919EC41ACA337379496D0CC876199A86404CE5844F8E2CACFB00A985B92B7A393CE464DB19E0B5FD65BA92D8EC1164CB1ECD994F82396F6A52BE2B66C8780A5AEFC0293EE437E7FBF9BF8880B61C8313C3865561A4287BFCABABB90B3A11F6AA57C2B2A6047F1316AFE1DFE540C4F1D5270F3EE3E023E202AA530211DC51F8C2E87636C14EC8300271A6454A924A8093716756F79780D94DC6863C24C80A405D6F52DEE81810EB850C1F60732AB24209773F66B2D2AEDEDAD6FFF60902910D4858B0F706414F5779590F2DA7C249E5DC1484EC40EDBB01920A5175CB9D74EFF957A61FE3E08DD7C5DED5B299C03299F25E39B161E1DC1C586E39D0BAF38C09C2EC0B22589AC489C3199EA4E66611C45A68A7254D292C78C3978C381F297D7DCD8C0F7646E7AB6DCF155B67F10C3F915F9B3AD96C21379993D8C5D6957847EA81B3BB4BB0863F0CED12F5CC48A4325CDA65268110C1C156F845951AF3C3C90280F8883CE0236FF02DB0CB07721261432C7E0D479F859D8EB7C433F67721B06E001498656578F0E3CEF2A6B941519885BBBB03F33DEEA07802226AEBA473CFEA6EB894F45D1BB937ADF5180F5FE22857CE0EB75D251B02D89E5502560A0B6B012C191DE9D62FD28CF503375F2A1FA9EFE0E42DA81A6EB3A6DBA299726EACC6F3BE91ED51A25EAD5F3E7067720F7D4BB72F8BE2DF978C46E1DFB4B0EA17BFCEFEBBFE40C66ED1F288BE08D6CD0B097C7ED1205E43F8FFB7086120FD153C47272188799D0F4554E9A4131C6B1460077A99E8198B3717AFE5E7C95D3F49B3779EFF9E935FA63A6F881F039436EBDCA2EBE6FE00109B658BA5555BAAA4A401D1FFCBCE0369798BB3BF8B54FCEAA5FE25F31AA02208B0F070270F9E043BAEEDAD4432B1C2DAC9F7B4CDCB52965EC43C2E99764AD2613BCBE468C9477E64B8BDCB64CFCE01C06EB66A15FB034D1AAA507AFB6842AF66AC8C18807E98884C6A780805720718A3A4D1A7B094846C55B0808736199CF4EC3F66B713259CC715B22B92AFB1599B7AD539B188E99B39F9A92987D0ED15C94", - "91CEF241899B4DD47BF31F3BBEF20F5BF13D9A98D3F133AE61F3E4A87A299A6B115B96DA6B2811414D204A49EDA0E1A763E1EAFB78CE05C181DD0947CD50276A10D62543A0ECBA57DAB5DC794AD7006A520B419533CE8519F4EE4194B58B2E36F9E9705266B6E304D1DBC6B73491045548637449E5C657B263CBD9577AD8DB7D5A5BB5DF43A869FF91BB8706D4E81A4F8243C214D9884104675F2BCB426CD785A28F4856E363E1ECC974325487DC40E7304D3D7CADA5DCCA6E60F4457DA181A39801D35F20E1DFA05BC09E7699FA289A87EAB311BA8700AEC0F90950E5FF740DAE7EAE7FCAE8B0D9FB82ABD25BF46FAA635F570C22A76C52F9733D5BE64BA67AEB5D826288D03D8A23C5BD3FD6DBA68082B7815044E24859865ED557C7DE8F866823CD4716E573BFF30067F0931D0AFED0146D55B0B2A3D6C57481D94F61279DC4D2C6DCA1CEE27DF24426E55AB4FFB87068AC8AA6F286151356CEB29D993B4FB26192319C373A1F0F58FF5949783E71671FB58A683DC1CFE166FE1AEFEC8A41C5FC06A31F4EFFFA3EB7C388E1BF99667A5D2697F7132409641AA812EE84EA8735BB46E5069A7BF1B2618B56ACB97C368AA7BDE1BE0F0BF286B6D08B42702F1EDEF408BC529B4158824F673B30E3D3247FA59DCB83D004459CC5EF87BD6C7D188FD91A2A7FFDB008244F8618ED46A73323E9C7F9D5A83298F8C81702FB4523AFEA589D4CC269BD226D04689F132F766770FF23C832EB5695713AB99B74035540031AD1D9D9047D72B1910BC320A65A9F63A40C02FAFE217BA0C51FFE24E96DACE57C1318351038FBB81E76EA34853484E7ECEB672A4180A3D24B6C692747E9D306DD0AF275EC0581A30AC2E80EC73B04B1EF83160FD88DC43406CD715EAB1677F1422FCAB85D1D1EAC64F698B9ED69FC9F2B5519AF9153D5AB722339434C780886B81DC2878B27177B4616450BC1DE99C49C965DC9257BC78ACA052E998493A0CBF7B6AC86EDBC2627E43E7521A9DE7824DFA7DE19AEEA5892685D50EB10128B3D14F3C670F639AF6F2B2F6168A1E551A65781A418ED697E6AB3CF91EA2470995A401B08380CA58B9439DDA7BDB7A92E91016567D57D57D5D0DC4D8E3C1490CA1BEC03FDE065C7B7F34DBC40BF704149A0573C55A0EE4C415533829EEE71BD8C392FD622572DE009044E937AEEDF672886CF4A36ECFE7B0F8BA9CD9EBDEAEC40BD74AD34CCD2C7DD07F7AA64EBF4DA9C8810C05F55619B808127CCA00D171BFEA3E1EC0895A22218DF1A0514FE5D16DC416D9FFEEA8EA3BC9FC650F678EB731E70A6110E138E059371D5A10BEF6420A0C8BD45F836B7D310E732BDD0FE57D93A6934317FD8E2449BA0F0C6E1B36821B62D1F80B9CB6A5B407B6755977C06BB2C3CEED0B14D4D73A3554FAA54EF2C350C388B230B30148605035E4F481A769564E2814A160A67E6F0DFFA7814D0C12772C0496737C52016A93C6753C82FA896BDFF3BCC72105D6EA5B52B3810004DDEDC266F1C90CACF49BA7DB5016A4E485F06355441CA204F7D589F2A3159541F991682E6AEAC0C7359B3282A04B2DC69BB0AD6CF49C48343C8A769D3EFBE8D0814E72934F7CDE698061EC68FAAB39016B96BDC5363D2B53363A548E6476647C10F55611469828564C189430D351CA01D2F1029CA3CE1D2853E8E595D46C9C3EE9F7D3EB9C72A25F7B2138063A0F9186FF41CA9C579DA61772FD60408668A877CCF6B65FC2B88935822A6DDABB97D19F7455A9725A8DF2B8E6B28D83ACDACC66F02370575831490B8D8838D4E56AF36ADF8", - "AA82DC5072A45A21B7880DEA3E2691FCC22EFF3AC815A2576A7F480ADA6F8426EADB4A96A17EB949BC049A646D46926F0D69E0B3E1911D2CE652FF4D9CBFCFDC30065FF4F779DF896D38587B297BE8E224EFB1DFD04BC2D22832B2955A250B7D0448AD9C0A76DE7C33A4E2B5DA1B3A868852B7F04D848EA6495BE8D2501BB47F24E8DC4B254DC56BB5A4760DF62BDB229F3DF0E0C06274A63A28D11F928AE2DEA72A9974E3C55CE261943F78B771CAE7B5B98642A01DBC06111B137774898F0F113A4DB23BC240BFF147568493FCF0C3D767D3548A1C0EF7AA4B6B2DF566C3E94BF9A183264F63E4FBA58B517FC46C4F0017F8D763A54D044C644D6326677A425F0F5A2A7C8796B9C9F8CD0FC49A1F035BB6662C0CCC0E9508AF8D2B834B929D80096F9BFC922BBF1BFC6F101317EC08ECC1DB52404B30B153F43C266D3E64FC496CFBBD350668B2AB3B596B5E0F0A00757E0D4A771F5A386AE86F5105C1718F7E93CF00F588C722509A03597B95512CFC705F08D3B4D5A3E23C56EB461A719A955AFD3EDC8329BC97E3EC6BAB24D97E16A724ED2D4C02B2371FA3ACAF49175A441C3FDE53C2DDA440C18BDB8A6F27805F944EAA7991D404CA74544E2F3A669DCC4052B6770AAD9EE29A6EF7791C6DF93054D07A2B3CB2327B0EBE7D983624639961AC4C3CEC2A84DBB3A10A830DCAABA9600DED87FD5CBAF4D5F1DB357ED42374175257474BAC200AC1B6A5B87D2FB2092458F51185C380B8BFF682C5BA1D2CBF8BC02E5D485FD811797AED167DE6ACA66B927363D12EA405D75A2E9182B1FD30ABA700C5683611A24EC5DC453F523EAEA44C6E06261A98346328ED9E86CA8F7EA79EEC551F36836272127A45984EE165BEF8AED80D26DC45E34E1794F56C1265DD92B4078FD2AF2F13981C08FE27C55C3C9238BBDE193A956E3F834445D949CAD84D3FF0FCD511C6C598735D5B3B07BDD7D437ADED3ABD6EC3171F3735883C9F511A06F4C6C7D0B137DD0D57869B8FB1375FBFCF9C3D08CDCB12B8D01614AA3C965550E5862AF49B04410D25BA4BE86FA6B0B9D9142461AD3CB4BD6D902EFA49632A78F1463619E1309CC89452C2B453BF9F08A714D67ED90972C62C0468CE17006F9B60138D28DA6362670BA3048CD8D099AF193619AA8384A1758FDF4A04CE56ABE464A66E913DB7BBBFF7EB2ADBD47E6347D7054CCA13000DE13F550C6263AA4135A2E16F1A2A58BEF962113C209CF58CE514FB51EC162D05A4DF832697E544037CA18E62A267D81D539F879F50C654E74BA21B47FFA5C704FAD2147EB3DD8617DE98B3ED4859B605310A777F3DD161F4038486F0872AF55FA3610EE0D68C1D51E0F91EF7D9AF4ED01BFF53FDA16BA3197A518BAC0F82F8895A2BDD9FF4C3035379E870C49DA1AF18B3668792B6640E687BB71F13DF1650C4E1A2CC487C247D1D1356EE16DB8F97363465614E9E63F36C853FB63C12963A8A5D98B52BE8DB31F0954B35C3C749A62C2B34A690803FA66087015506225181C5D6FC101D1494C3A7961ACFB4D9B905323DAADABA1DCD2DDC1F9CBFED7D726E602578CFDC1519925F8DBF9AC5FB4E4CA723BB264B5D106B6206574C46C1A49309C22E1935904942C36148F764B59F10A5CBA0C9397F5798E200A606EFC75DEEA1FFB10A85398E5BFBBC6AA3619A0F611E591245D03B6ADC0C50440A1B1C236ADBA933B2BF84D2C60C807E9F52436904BC62B813FFF8B9C824819C760D0BD636B10572C781B112CC0C603A260AB87986B0280FB913A9E0BCCDEE347F0C744BF8299A9099B8", - "F2A17D19ECA96F67ADACC0D83FDCF235F07832E8E78A44A53F9C4CD09C3F88DB226701963147EE0E1AD0F549E11BBA70053A105BD62C40DA810BA37BA72D999CC4FF9BA4D01FCFC670E0D7819871D06C4935C10B85594CB7202F037B25F85141A580AE1CB3E0CA91AD73C6947D2492B8FD2F889B1421E04FF0FB7866218A491D9EF6A35DCACC12CE098EC575C697F5F8D1BF9178B3B36C999EADFFB5CB3A41DB672165CF73A7874FF68B3B901C4E9B8112EF4FF9B9308742ED678DF30E2F7C40BF922099C1A95BE0C231E9F8332EBEEFD99C6DDEF25CA5EBB2985A9689912616815AEA022BFBB87353B8B799D64280A6922CB09044ECAFA51037AC2FCB11516E9E286F64B4CE3E30A55191F24AB53F2E10E5A8920FFBAED77FD4C476E9AEC751763D68409ED9BF7F435E53D401CAD787A50033BB8547C910D90DE100FDF6B904A1F529830E3A51919299FD4476F02C3600AD5D42E3E154AEDCD1C99C1C5B531FE179860EC1EAC69EA0381CD4DCDE8716F94D6510F10FD1915864BA968440CCA6D0D5AD8983C421079B033B56FC34481B9F27188F829F91DD73F27BE8E0456B0F75DBEF40A3C67F274F6A50CDBFFF9798F8DBF1A6CE7158B577550E40639D38861A3CC4E060C9E5BC1F0D3760FA9A89C2CF0A23505F4A642F5EB0A055B96843198CE20133DFE022AFEE043191007276427DC82E877BDE27E20D65DFF8232E9E4DD786C23D4E8B5E84637A22AE5562651BA45369947C159B641710C98494ACAD48B4AD6AD9828897437AFACEE442DF2330669D5F2C6A9893E08507ADBF104C62F6B4D568C5381B28D5162EF0FBECF396E7C622B54A7864F9B31CCB396A0DF82AB86D950B4657237FB769122BE6B783ECE3F798AF68E354C521C77735EDB97D580CC80877ED702231CE2F8B73262AE39EF94E84736949292E065515D40A16BAB13EB9437D30AEC44AD8C67E3AFCE9AB377753BDC481E8E79EB10F89A7C4F7AA24E6FA48A36DD1CFC02CF3FF6DFD0CC1C4030C312532A70B60F678FF2B3586D77DDE74167CFFA62C12F7D0086A6FA59B36C6A025DEA1EA0BFA9861BEFEBEC6B2601DF225E29F36AC97EBDDB21D7E8206E1EC42F3B9CB314E7AE6464D54ABD53D090DE83B466FAF5384E0FAAA6E67F2FBD6A72E00D9274C9B5C768DB4AA4281F25EB2DC6BBE0EA85CE1CD31B32BD1971D6AA20B6C68D66426F09C0C1128A679AF06CAD490DCE3A2DB50181278BC40DF9E094D1D09B281CD1EF1C369E5927407E04918BD21315E12583D7D845933AEF186DAF8B6609C3CA9452857DD2112E86227422491DC7821D7E41DF759BABE6ADD11A4C771CF16469F86262D169F221D97DAC9686B6DA29568B4A2D2579C76CBF948C321F5158EB3FF5F6D4D6D68FA255C81F62A8DD605507D0C6C9D82E6AD258B32DE4AB6FF8FCC4A8C237E270B9673C208E56AA6F4796867762399FC8549DBD232B2CD0F9957A8A24FCEC6E8B3DCCBC67085C542A134F3E80A3CCE8D3DBEF0528432F2BAB2F5DC89D6015BE7F24B2B1F378EE75222EF125A5645AE37AFE6ABDF84CCC3026507BAD9CD8C2EB4020E7763E0F85164734C851532FFE705C111CCB7D738BA8C0D29C5A0A50250D0BE53353A6C407D4F7EDD62F271F099528CCB520E5B6B5695D3FBE628FF65D67CC0D1B766149B9C89D3C770AA133FAE2BF3C9846B30C46584E9F93A8216627CFAD84C37AAD7986B8D69F83392FF8F98C828F8B136633A09718D375327B98A0CF8B7736D229499A52D91D19CBB896A5BF4131691682741797A25FFFE6AC60E30C79385DC778C90", - "3D84AE0F7756BCB2518300DB110A07EC46869AC35F1B02650A36C3CA0350356E2808B84A0D9A8A648F920B7D48AFBBF6CA9A37F673DE2B6FB15B189FBBF2444BDE8808118595AA995AE0DF53F5146B011A0AF5B7FCB4B3D3EC074F2DF15CC9708EC50EBEEAFE06F7A0235A50E2DF7F6C023B53819AEA87318C4E67C4742FDEACF57DC539FBD5BA01F64CB45322212C707923303D96E58EB95F7392292885391283DD9477218697698AD6D83AA96B06D68F58FC2B8FD9D61E75337C6815BBFA8B76833FE1856B714ACCB6FB1B5E957DD385658AC760AC5811E3BC079DDF2CE30BDC21AB8D2C7B56D2F6B384FECDE4EB0206A6C00282950C1B72B3E464570364A919812E86BBFD0E1CB2DC98D6FF42617355F2131F72A11F50618CF21A4C4961083FC6BFAB63F544677428BB9F10FE341B947C41AAC1B367E338CC2AA08D6CAD1067F02654794571FA4AA11E211F5E75D194197BE4AF6543009C40EA86F74AEADAAB134CA9E35D79F7CD062B53BE2AD86FA7C2E30D9222A494A25044153420AEB6C8FFC4E0D4C514B8D9F5DD922D8EA387003409539D0B40210B05C9209B008D3E47E8F84C376F46001FFE463F21A92E34D3345751E8E94205EA06FAC16292B8C6D4FA028867AD4C4E8DE0D51BB7AED59547707CFBC2CF3A9235C29EE3A3873B96FB75DD50E758CB2C7196BDC09336A97756DAB994C46D5BBB87F9D80008D09C603A68022BADB1D2F6B98B6B76CB3C0EDAEA07A23065B93DAD67BC59C9BDEF7BDCDEF39D9AC04C9CE8F6DB4A925F77BBF8150AD478E3C6D7D32512ED75BFBCB82C66D505CD8BC5A5679014B355BDC66F365BE9AAF15B76C0CFC0B51E53F86BB4763F0302B448E84B9792F34442743E2D979C5133514D4BB1DE5E8AF938C4CF158336D04B6723F9422161805D5EB059E55C86D0C461399073A705FD6E919D1760B2D6860D65665B486DC0AAD8F7B3ADA9BD681D7FAE4185350BAA543E9F8671F1B4BAEB6D18674516033B2E2E4E427521C290A6E44E1EAF9974BBB360FEA3535CF46D68193C0E208AE5B2F85C2049C906725C92F598E6C0B67DC5F8B7C48CD411E107F4860CFB3C4229A44694ADE0E31A4FD70AE5702C0A7710678763B035C5C6B4B9214D507313F5ED85C444B98278B40446C861057AB9B897638DE4739088FC28A577CBD52A3910885276A2DC8DA99EC74D30DF707BFC60663C869DA4C47BBF4D64A789425C5C894EC2B512C3296D0070DE4942113FFC0B13D03515F2B4EC07A0E3BB7AAF08DE24779F9EEBE26CE7C316EAF47396E538672BB646E1B2016356A407B8828DC25D8F8A8296B4F855290131734C94CB92CBA5689574CE95B60988C42558DAD978F36D67BDDDAA92FEF21282683EBF6D59763384781EB4D3431DF5BB909ADACB397D36D55D2ADEE537D7B1B942F3A815917A388B12285689B40C3B45C04A591672A2B957F924F1CF6049B96A38E304B8641DF6A079614C9F9984FD9C9F0A82ED6E440164AC484252B45147929A58B069E663663CEDF0FA44FD67580BFD23BF77C61B95B533107A25684FDBAA4C1285AB568C9FAB387C6FDDFD5EBDF5AF1CE094C59630E19F621CDED14E3847BDE9B0EEC64C159F23C779C4B80163554900393CD7F1B885F92F183839CDAD7801DC7FCFD08B7E08D23BE21BC80F8655A2F3BD0C483B2C1D23D447682CCD9CE098AECFD7BA7C48F5BDEAC8397220A7852077A8D7933FD353C25E37DAA473E996A5920DEDB80C26DE4FC3AFBD6ACEA16DD3208C9384021D9B1FC1C884319B59276D48D8BF5A0A37D84B8C579EE0D9BC", - "446D385D09A3464D1ABDC6D6CCB015280BBE7DCF00078634371D7F327322DD720E8DBD7B8CD97FB9505A118B469762ACA10C4E135ED782FC905EF30F9FBA82F11AE679431F270351F70F0508BA998AD9A71D2BE05F55348B275A0E537C63699C96DD8AB8E0645CA2606E35805F66CE586C81B4A65E2EF036697A18DA49C36CB22404497577107924DC02FD87072490D7EC8D5B376D0C3370F9753E0E7C781952C03D844490370D6853FCA49E12139805C24FE9C9914E3CF91464D332C934570DCD5D1C3C609C6984E28C9BFCBA3669B75452478DA4099CFE0F6311FF782D1D0123A120F657CB536A3810984871B69D25913C305117A7E51D199A56387C2777E349748B9C2C40DECC03DE7235F7237CF43FD421039743CA72361DFEF2491953A3C3F0091FE3EE064B838BD73E9E6EDF8FD90235CDB374892BFC42759792E5636D031795C0DCC70D7DB86C161FE7059CE17B6926FE5D024D6B1B9DD5608839DF85C7802F5655525B633BDAD0803CE14649095C0A7F870F66888C072C410E0E0854238BA7FB259901CAFE3570D398B621518193BBDD75258BCB53AF2789EC66DBE2311DACDC1F9CDB6DBD4BCDCD15F9C2E77E0D2736CD191D2B83389A71B1804A0FB5F2480E38343CA48EC6D1830BA3466E53FC51C4EF05F4D10711A78AB215650462E9A26D9301EFDF15A3CD5EEE14DDAFEFA45171BA3A757CD6FAA5887A5D5A98045BEC7FEB331D01A997282910B6B946CADF0AEA57973520EF0561B233BCF798805B3B048751EA086FA71BCAAE15F8BEB837CD2974EB3E54D3B6D3F99A51F88313FB64218610CD1831E2E6E18EADCFCBE72BE5818B4AE4F3780BAA7D8C4A55DAFC10ACA3EE7AB7D1337506C485C83EB0C41748C668705B4D41D926221D33C31BE7D56B42BAC7E9240FE4C2287B5B41FE88F9B9E19970D0E4569DBFF167EC42BAA2566676EB055B69D159358D23DABFFC86A917490B4942A220038CDADBE24C335DEB895F3472F0D22778BC79B169D1EDA9FD18B31DA66F0246359DB3EBA36269EC5F92E5A1A89560C7DEEFA121A7035EC2501C553854724C5176AE60F87004F6FAEA907B91D1C58837C9FE25BD9C32F66257BD78169B1A4B8ADEBA72B5699D4C2D14F67BB347EC8A96B04278AD9F97A9B40DBB56E7593CF4B3C905108F10968F0AE6A2E7F1D214FC7B45637A256ADA5EEB70E03C02DA2ABF86C36E581A31032DFFEF4343C3E59EC7A2A715E9C199DAFD3BF8C9B43C1D016DCD33E2590A20EC8B657C08E5C0C0BB4F159A07206504780715A252D1F4F5DC65ACCC43E3CDC255123A77792685C9B68AF281863AC89ADBD5F778733E95050ACF781FFA386B3EBCD633D6E8E6D4A42EA85F005AA80A4597D40738A8E8823FE3C84B10CEF044E9651E45D1ECDF59C537AACA58D2BE42655259DFE6CFFFBDAED252254B732EDC93B4D610C50DC81B576C5A5C5BBCAC0BAFD7BDD7771EF1A19C29D7A82E448AFA07E7FAA8651C11D1BD550DDC69F4C9C6A44435034D80B47B512155E5141378A94CD277D4BE11B2A383B1539AC9731079624E81D3A3404F5325F5D2EFBC0929F510529C84B1BC3E7C08F661640E55AC49452C00256BEB49B7A52DA23EFFD85B8C303C6EEDD2202768ECABBFBEE87FBF1DAA992C8439602B1645C462D3297DDA1AD941617B508E481A28D1540212CB281B5388A3691A26AD7D3CEF52FEEE9F59F477EC98AFCFE38034B762B9D4B5DF3BB312758C4238EFFF94BD16D9C39655CF07263CD6DBA96D1C0EA425610C1FC81061FAAC5C0F8E6AA9591EDE2FAA1AAB8F76EE18", - "C514F282EE4B5E02A90A2AE126DA52A9FF5274735ECAFA74CB36D607EF299E0227E94B6CC2B78B1F71D6B5FB8BB4C78C09B3A6E3ED6CD590AD526F74CBF869085F2BD3A9DF66D7DA9DD06FC6748D8FBB78D98A4D860B362BEC6295F34A6A16A58BB21C9632F8B3A64370B7A7547E329B39BCC82D17B82F6E4ADB514444F62AA800C97B748D73B0168ACF2FA898C262820F8981713D00CEB8453E3E9E452F5EF41452A9C8CD1F1260000C4CA9AF4E6E629B13DFF203187C0DEDA08315AF24181015D2E68D6AA4E7E938FC4FA9A8B80CBF49E3A9F27953A05FC7609146EE39F09FF485015168636D1F452FF311D4D8749C31AC8420865A87A707E540D7FDF0D25F63C7F3AC906E048281BFEA46263B4350BAFA8B5A27E0CFB23DE145622BC2FE34DCF4E1B4DCBF60ECD5426C27B3559B73A59CB1B71587C685542F5E6DF9FE3C5E75A8E9600E89217343D29C67A7AE80F9A8589D82AAE7B2A1B8D6546D3CE2482DDABCE7FFD3BEB2F1009297A77503E7155ABD4692F1244A49AB32628947A681388AD75A750AB92C81ADFBCED0AF166326FADAE6B79070473D67A8FCEBA7F21BBA932168CEC2A754247CA324081900636D87D001A605C4E5C31AEAA44A8DB9693617566726C7120AD15D96D917F5ADD0D86A5A9CDD7527644EED58A9BED014D9F4C0F62FCAD8D7D5DA2899D57C5510EF15B7482CB3E087493959AA12D73D55E194E48CD128FBA2788829AB4A86C325D60227074EA55BEB601128D5FF42371E74972B802D3117E1F2AF2018177D4E994903996DC365D3B52582AF2085EE5919DA7E84A2F3A200F4F6E76F11CC95F87BD2EE5935CDA0D52D9EE6FBA6D59E80427EEF4B80372091C65E059B566C38A6B3664974396BD0383A35EED0494C2BDDC167725C4160AFA58D408978D5A345EB03A55127C6BFB08FC0B4EF7037482EA724D9D121E26F2249C0C7A927946A846A67FB7C565E86C8C59A49265ECC4927A8FC88873DDEAEF6F8B629BAA1819807F38AFAC501EC9F206346581174A037B1D7EA56628C660E17BA0A97F2E189299A7844FEDC562BE678B0606CE18493F717559365F66201AA598C68F99A8F28AFD74AAB0E3619BC342AE9F36D3811EEB52C8DF6544C96B679CF434B9C64FCA0F43DA73B9BC8FEBD609678F5E691AA706E3586176ACDC25652BCB68D98417D3FEE12B23724EBDF496D6AC3B35EF706EAC11BB0090066F3C421C3E298B00821C90DDADE472331B9B2CA1F1E53E6D68BFB059EE0811EB7E7FDBEF394E3E35E59BCC4B63FA8E09851843F28CD941F9A97E5B72C8DCB9D32F37B79DFDD1B9D7C22C10E6F65DF07DBC7734430B811BCDD450A10F491B1E0DA3746868622E457774D0BCB1B29F9C1CB161DEFAE78354B7F718D18F07ED6672665D35562D6F05A2B3666B667A7C57D2617711F27DEC15D0A4079519D0ACC6B3591EBF0A61A12C42A6820CBA755C07FC531610C4192A0BE9BF241BBC5ADF758FAA4DE47C6B766AFAD728BB1D2C672EE0969303E42AF789FB295E766E90319D98F0618C1B4B8BD31CD2C5EBABEADA30C6E43D03F380F4C2B9C3AEA20BC89B852BFCD042AD3C9440AB395E9E251DA758D317E39792973083B20B79BA36A14057E1DFFADCF903B10F8D3D4D35222E4584D520D6FF675D3EBE9FB43ED1B79252648A5E0C2552E388AA3D1168790A09854F1151A94DB4E5AAF1C941FA61B196D869B16051B75F56AC1BC769C6E7A7EC173264A2E56BDE4BB9952A422855D65AF1C209D561F8210FFD7C2FD6A540BE788BE3D2822D49DBD2C6B33299604A835F07A34", - "0C0184CC1854C2013817663EBD9E23F3B78DB8009E761F1B38C2DA2036F26819D2DC68AC38C18FC15EB00BDBF5A11316C7B6075BF9DEAE9B0A651527DB3E3B3039BA01398B3923A2C40DC4706A0BC186D2F8FFB124EDE35E8C427FB6FF05A3C2ECB81E275D1AE370AFDFB6F731E27F4B22B877B1990FE479239526C655796BBB8545051527ED0E532E0440048912C64D0913227C2F6657B8B80FDA076E49B7E3DBA1D0E23C9D7F43280A324DF16BEE2A87B87C21692FEACBC3348C9186DC6C0BCB7C1DBEC60AFCF4F1D76FD3D45A24ACFAEB8E7C95145D07427CD67003019AB57DC233D566BB9A20AB82ED4130D9B4C0FAA6F2EFEDC8977498315FED436F67F3B170877040265EBA49415B1B2904C8277A11598432B973AA63F628456AF2320D3478FE669E2835C00D13EEC7B6ABC6BB94F1677C9A05B2D0CB87ED3E529AE1D2E3354B1E30C6634E10AB3BB0F39815049DD5321B11B80CF1D1F1426A413D0D11FAE969F3BA266F4F7B60684224A6279380D08D46FFBA2E1D684416405A02A2AB2E260ADB23498AF716EE58B03C8CC442DE0EA201C4DE39FA7038EA4E0E1544BB08F149F57F03FA910E09C27303038EDCA21A618A54DA87CA747763EE6D4D1DD4912AB7E3BBFC999939F82563B944CFC5F4460D41A47573DA92CBB28439BCDDBEBFF16491C404B356E5889D33A034680F8648F2CBB1888FEAFC410FD5A3C8ED85B90EC875D7D4466904F5D4A4048D8DAD848313232B80FEBAA09D4D86F70045C0C2499A93610DD088A6263DE5AD71067B9B3C82E20658AE98677889BDFEC65C2574E4AB7C9059F1C13CBEC17EC630F9E5B891DCDE1E81552738D4C8612F3BEBD570EB39B24EC94A153465D1326765D9B8F23D7E4AE3F2782F6F9738C189D0D20C4DFCCCD37D9A510250F0941423CB9055C7BFED84520AB119FF921CF81CBC6967E9CE1D759E5F4481ACCC5881F9328093B63ACB7D04404D8C0FAE8747D39A270399000CB690CDE17A46E81DC5CCED183BB863FD7A535CCBC592C25B059496C45DAD179B83EE02543B5EF93213E10E2BDD480F7C7D007CA2988942F65E46B886EBCEF05498C655048C4B32A081A059A28DCF4D84AAA586F0291F322B25D186FCB5ED2DE7AF7EBE58CD8314CF846AA39C67E2F284162524A14BD2765642B31F31EF4704548C13D5F5A132E983203EEB91795BCA934BA7EB26DAA5450745333446D2B86ADE99788476A3417DB7FE9E53F4906CAECBBA984657969B4592F9213612AE6812C215D5C6E28BC89BB76B9CCC937BA4D4C6368CD4C491BDF41B242BD8FCF9DE2D35907F08AB80BE71EF90F84BFDBC6777A020DC97BCA1E963050FF991A4F0E1E468813AE1CCF05B819012377334AD6B5A41A87A7D7C4F0AAD241FF7D3AFFFF40D7E6D5E62F9884B63E23C3A8B96260A6E9E3BCEC001D487E3E75DF4D35959633BE719FE592C4659970C0B67596E9CDA4EE3B05237C02CF2E36FFDB7CAE37F0BE993FAC46DA6F56B15FA74EB4511AEC2C861C2A9253259268A9BB95468FB02867394AA8D83EEB6464A65CD15DAB6A696FABAC4661F439F377560F3D2F3B668A7648BA4017DB5083BDD0D76B0DE99FBC06D7938D7D2F0566D3DDD036CF6A5E336359F0896B9B1E3B685D963A0EA70CAC175574C5AD41E20EA1332CF103BDE6B1C3B3F117C21E8FE7450866C5036C244856B5FAC176671270EF7225BE7CC36D24498C92E5306C2870FA7839DB1D7646A62AE0623EEF3199E8DBE32020B71F23FEF2F2BF3C9E0EBF0FDC629D97837B97D76C99398EAB044AFEEBD5BFBC35FD4", - "8767E0FD01FC0DFEFA6640DA0B47AB5B2B2CFD25C8943FDAE6AF46C3898AA1FD2E2DD0FE19D1A9BD0353A16ED03C448B7005D56D108FF2035E948E3C4FB8F0F928A5797D491389AC431F271DD1C8FDDA2B1FE623D410190FA81F74E042C0BE9F97F99120DDF442D5A4ECD1EC9789DBDFA8C8E577E0AC5A1BA7DD6D5A474CAC3C2C04E71A14DD2244A30D64B17E4C9B081EA8AF0175D7D0A6E039B6A289EFEEAA20763B1F106667745EE2795CC588721BFBCA6D659D81192A02FF2CE11CC878CDCE73CAC9B92A972CC9340ABA7A03C3384ECD28301103F347D35FCC9B12B85FFF170894F7D104F34D95B56A23C486CD9E7520EF8CC0BD928EACCFDC5D230D77EB9B19EE274113E1F8BFA79FCA93EF54B86900859BA6688FD29444E03E2F14033F076FF2F23711129099051C59E0126A907B57905A021F024D98736C3F5D1AA11C25F32319546F91DCFD4940FDC7C4428CE78A998694E6B19AA3CFF470AE4582666D350ACB02CFECD0E9EC39D1607912B892479EF94CC67797F443EE6BA4008F46C0E61C3819C5F82DE7A7802E62E7050C8AC506186878F08ADCA8A7674DC3D0D156060AB7BB08511D2F8DB46EAB9B46AF359135030A9EB46A6137A9419D97C7069147BF5065712B1F03BB8B328CBD1E583F59B662B64C0F06ECEC8B71AA2213EC29F8968E0F3093AD04E739F01DF51C644FD4CB65AEFC7073018DDAA81185627B613242260CA7A9270FDBAC3EBEF62865D0341B5392DD5FEA4827D60D5AD1C9AF0739CF5BFE0F658E72C436BFABEFCC403B87AD4B64F3143DBAE1D2CC25130E65D72ADECA1A8FDE09EDFD723072D538792F50A067BA78D7E4749F0344AB1AC1CC0E8EFA1A42515877C4539EDE35556D444516474628BE9D8B29DE428BEFA12EF99C985F1EED4F937BA4794776C63033C03EE356991607473835A50718E473D036F3C522A9DE2E49FEC2E686F17A5023FB7E82E94B26A4AC6236E0B656A938BD7A8575D734F53CA419836110DF78197D7DE4D45B6589CC31F5057759B8402F43ED9A423A7D69DB02EB9357B1E51207161E08FFEC8FE286722159C570ED4AF63EB554BBA582404C0E978CEAEC1CC1404CD15BA22EE6D8C98C4278C1714695927C2389D74BBAC72C2516AF1E5D0C52066A656170091B68A7E4C8399ADE63605E9DA1727C189C541A404B7335DA27843A32E470FB4DED8EB5EFCFD30BF15AAF37D7CFF4B545DD09DE3E7C8D0E77427B3C0764608912616E5DA2A3B885688F25E83DC8D632BC00015C2C8E6923A3D9E7C7344CDE87D6F0DEECA2006F644F7BDFA0A524759B2B16313501A1CB8D4D762D3E9D9C8D32154F69F0DBABEBD26AEDA947485FE0B40D1D7731D7F4E41D1EA5FC645DE31CD850273B6EF9C374CC8E8149960B349BA16FBDFAADFF12E86EF05AA38B6B17EEF7B55D27D7CE27FEC916DF99F0715F1DDFB93C7E1130EDFA44663CF19F4008D5CACA48262C1E8209D0C353ACD72A542B93EF18EC7E15FD4C9B1633161D94B285FE8CFAC30FBB1E140E9561A35715AF982370AB4DDF25BC30850E5F0509297289C0045BD3B3912843A9B0BB88CB7E961639849B8A0A75E3E903182F0CC6C7ECAD4A38081BEB18DA72EF9F9439DA7DB2B4D59AF6CB71808E604E56E1D4BFEF627226FC28875888BD486D0C8052068D12BBEC6B27E9DCDD73DBC93D33EE66AB63936C2273525A517280FB4BC33A724D20BB7D988B938018EAC4738D03D583A71C16671B87CD60BD6FDD101BF2AD07492A794FB8696E84CF24B9707D7706F0AEED606C3A7FB5B1DF7FCF86E65F6DEAA4", - "CB8EFFE09FE09C622B34574E74D4B061C284F96FB7937481FA7C204F449BE9B2DB0957E428D177C5525C67BD75D75989EE98D97C4D0DEB5E72E2B0DD62E66EDBEF0D22D2EA97D42A3374B9B659804F1EEB01D7743DD9AEADDEF356C7C4FE94077411DE58DFA5035271015AF65FD1D78C0F17632C10EA02C537706A7C14E3A1D7124FCC11F579333A68A1AF70BD3E86F7B1D13A3B4EBCDE343F36A2B226DC53A0E1A084EE966272EE852A349D7A5606F1AFDBD81B8C3CB556DAE83D6A34ED4F9C06BBFFCD5953C51814FE0F4CF5A697EEF5559886D92F811004C04FB399E06DFA845DEF183160BEF8546F6E8995E403FE0E464008646330CEC4B4149DC464F229A47E0CD9F89C83A28FBD0C1E758D380C2A7C17A487191A46C04C23F7906418B69E2527F3293588952919D220EDC36BD9687C7347AEEEFC8CD24E91299900AE4ACF018FA2829E215CB13CDDECC918DC85BBFA317FEF7D2FFA9E3A30D9D1F1B9DFA0AD0D641E800850B43D7E0B187F2ACFA74FC5DBC99471A7511B838BEBD6E2744C3AA9AA9D46060C83FFF803C148C35209F840AC23D60FD046B461CC2D776AF51612DD166E1450B8A998052EBB25D1C8F426391A8571C88C2012A8940CB0B4DB3223CCB39021D20142FB5039A6ACB250994AD7A99B1A43494EFFBD8D3692F213B46C6CE9AF3477BD6061398CB19C099F27F48F4F785E9E741988412F070F39727FB8B74071E007210D939B0EC5D6148A5931D38A030374E5C0B575AE27D49DF49A77245BE310E49262C56A616C757A80C5989F27962303825EAA3AA014A4C9C9E5B3CF93F1A031F82D6A0C877277EC41356D1BE2154F03D807940A1CB2848A6A23B905BDE9A907F7C20E333586389014126765CBA8D5C8951CE09DF085B5F18A24E1E5D638651687CD2A2F75CBAF738F65A8B24E7C67E64FFD9CB8A34A473F11996E3663607A49EF663C4D87A0F65D92067132B5EF3CFCFA9B49FF66CB6E363BC1C7EAAC392605200A5EE704D1E754CBD1C9CDAB75355BCA41DC129722F855215220092CF6248609DE9EDC5603562F5C82B5414BA305CEFA60020E1CD93FC756241FE7A20CB4B550D980A7266E7B23B6FFCFFC4461F925A14EF6584B02005E1D795ECFEF93312B3369C52A8A2ABF99AB5255E8E09C05AC722F37A5E95AE46B226C7319411750562DBD0296F0CD1326055577BEAAF270E75F4433D5312038854C30AB23BD51F1246EC46599FEC1B628137A73A702606112CF61CEA7C3977BCA6701C8E5F63132C15EFF01CA1EDFA5CCA8FC0E3FAD392F21972F857B53F62CAF3BDB75D556E6857067015E11C5E217F5D1C1AB1D603571F9EDDE04499E23D39DCAAEF16263A5EBAB9BEAD8F61B0ED942EF261E0ACD309A903E73AC4E4569A65FE6490F6DD6842812DF61CD858D9AB54D3456C89CFEDF2621426E3F9D13FB94177104F6EB4E30B018C01F78CB4FA9C89F453B87FA7D4716B96B0BD2DC532D4AA7D8FB9D264B095BCE39BA017E8BB90D600DD2C58647B9D95F63783B4B90BDB83A175E5201784AE000A493A387E16F5F0C5CAEBF62A360A6A927B3FE4CBFD310A3163BFFF1836FBF9770583FA4F88E5A6E7BE5796145890A41FAE8BD1839110EC05C325012E19C69C3868C7507D04458C074DB3440A0E018A23CDD32ED35E7A28DC8AA8BD63C8CD0A9F4876B56C04D5D3D5CE52A0601ABE2AD3CF3106CFEA6D761335F420EE3D277DA358DF4F6813D543424653B256E325346F677EB7F69B2FAF9536DE80E8EB018D978484509804D600783708D48C4F7100E0AF891BDFC75352C", - "93EBCDC22C36C3BDC8B579B31AD5F5C9B2B08218BCCD1B29829A365DF4A8D5259753381B6786877A5250DCE6A2B182734E363B39560D3DF44E88CD6394324765087DD1A77B3D8121CBA61F665F9B719E75B740BD930D6FEF316325B8B3A2FDD93AC488714AD9AB525248EF60B2649B70DDE6849BED793264062B38EE74270CC190C6A86AC4E106781BB3D09F0A6D7AA4DDBB0116D3452CE041BFF4247819FD8D78304088355D8DE741B1A6461C74A4832ACF4D4004BFB22F6C9BB397D7CADC6FC05AB74919CA346F9A54DBDA80F8E1303A1D43239C5DE043C2AC21E182CF49BEF9BCFC109BC884E41FE2D8669915701992200BCB938A745FB0994E6AD01187C4A24212DA421A178E42216287DB1F6A25E8370E4209E09057E16253BF477A061399AD1B3FE985D6A10D8B05FD94B67F878649862D68F285EC0BFC06B7006589A590AE7B116EFEFC871010993F4768197473BF22AD54B2A8FDB0BBF2B181A2A1CB9FF0D0989F2F68B339A8D8B27FE1781F3DD6F7CB972D73E3DD702FCD0CC3CBDF66A6237460E3B2F45DE273D2BCADB96C118DCC19F7C1E703BCBAA04DA5370A5CB3B78112B8E95B63328B43C51557AD84B3564749C2802B52EB33458394747C176E119E1774BC905119312963401C1DEE02964DC9F1D836069CFBB9B33791C908ADCC717B08FE3C0AE98C0D5DC0C22876595AF95A02AB33BCE3502A92E532E72D0E3455A3D7EE796B3CD5D61DB902B8C0057F2D47F2655E95DF55DA562F632A4F9A2CA8B1D2DB8F5745A71318C37043D3EB08F9950D06C1301F9E9FAF4EF560B238BEC483DF0E017E3CB27A251156221F183F3E9B0581838D04BEB5DFD9EFC26B979BCAC7DF631F1ECCB777E2617EE7386C8BE9834D26B96D80074BBEFE8CBBD203299AFAE8E6F90273B92182CE7EDCA9154E0A33AF9981B8CEC94E6A7C78C4716B47790EAFC771C3DFDE276E4E617CC0DA50F05099B9BF587127D1D18D5F892E0090C8D033F21E7382738F1EAACFBA493D776821DBDFCCBC24B1D5F877B157AE6BF6D307AE9BA54CD053E68594505D038747A7D8450EC3CB4F2E980C5D97A2AFB31147906CFD3E9000BF166EACA8D16A532BCF69526FB4B86B1F71D2C5F38958EB11F9ACC438CCE14E88A11DC431CE4E20B99DF0ABDD2B5AF358260A64012F4A408C6840D365AB95167B54FD479E8527B5FF662161F75FBA7CF790DBAA51613DE7C52A2A94E4AB78E051F32D10233161A4EBD8682389D091B5C4509171650ABA574F1FE954698268450E11D2FB52C1AB3E4DF426D26DC6D5319FB762CCCDD552F4B1BF4E82AD1F78606C644185AE87827F022C9508805472136DC48E71D1C45944413485EC1CC72BC092D6F9990148E12C2A3FFB3D8C9F91C18CC9086F176733A83F2CC9BAFFBBD810A99B66DC3B399891B2045BA402749B55E7E363F5D062427A9BFA8B599367F1D07A38DA16074F75A4E095A528C26DE4083B044055F73D207A6571196263D8BF5A53B7679791BDE49E869F0F58431829396A34415CDF4CB986281840BC48857361281CB4BADF8FF5B86ADC76FD3A812D7641C5FC88A21F137A6980B42FD3858E2A057BD4D3FF57A5ED3F5C41C71C70036E1762C0079DEDE282175072A073A90AB83C9DB447AC07E6BF99DB04BF276FD876F4E4816B0294333BF3403DACA2077BCAC3889B55E76D62F58DE7D1C49816D03DA2D492D1F3CDB2B6B186439CBBFAABB645E9745F404538BE8FC4C698765A3C67D01CB54D404D2A2E78098FC334F0A375EB41C3031F57FF9A773612445AD3D98BD09C949616D4", - "5D55CEF58C74B4C681E813564F1903FDB56BE053280D438BBE5E2480CF279CE47FBAFD179E270D838F764C2E7F496AEA9C0800056F2E0456EAA7E59CB20432B65875455975AB37186D6B06FC7D0BEE743CB974DF92B19F4D2EEE82F36598F8E400DCAACA4EEB110ABE352D3A0F58DEFF8D51DBDCE5C23E84D1166FFEE5428541ACA407B9578E4295C3F79F9376384B630D25F11271C6234B9AA9C1B4C8015AC2C73CF768B9EC30C61BBFEAE1426F72FFBC995A834C9D4FB8350C301133F123313370C33FCFD711D1847CFA84E782F4B39762A02F9476D5F45237A29E3E269D16DAD60033E0907D5431C1CE36D37BD388024A020B612E1DE42492A3759AB82AB393237F4A1AFEB8217D2733916B7B610342C0D182C17BFBD4556B071D82E6C6E554F2127654C15671FA1A843347BDFBF9498C7B5E7636318C3EDBAF7BC4BCE123698A05538DD5D42F01970A41A75F0A46E61520911D86A39D892700AA23A033EDC836EBC17CD2EA274252F53A4BFFD5CAD88F8066744C737B364A0DD0B5FFD96787F7D18357DF728FB66B212DD4DACAF7218292216808E7B81E3514BDA947E436A301C4181CE53A298250835AB98DC89D0A3D6240C57C699A5BC31EC4CBF8C111149CF6802942256520BC7FA22968556E2B390E63C9DB7D0AB79939924ABF068BC3D44264D607F088A38FA67F8E25933091BD3EB0A3590F3E62E63CC6C66AF66128F7C3F97B76E62F1AB82F24D8C147FB2C8BE207FBAD7E5CD355230EFD48DC9FDAA4FD1C970781674E901D35D7C651EEFEE2356F825ACD348FF0FF590E8CBFA0332F77A063581E6F19F53CDF1BFE952585E93EA13A83BBAD06070850EC824397A9FF13227F4C60D65B67AF810EF1BF5D5EA95A5512F95AECAEFA25BFBB24CBE6785E91A4874E81E465AB91B1F2E990F37AB145645F2681B47592990CA78264DF8902620E796D4DA9A260D1BA67DF9BB0292561FACCB2478AD7F7D7CAB3DF179897596604F2B0F1E3F10CF842C311F49C6B5EFD5D73DFEFF59127384D3B4D855F8C412E949E3A941782C186413946DF8AE33C9640704CB0D930C12F5FA1C4CEC5883CDA699E294019562948AB028548FA974D6C56AD667023F9C417F067810C4C7E4A712FC3417A92C075423A57C208AF683DDD695AAAA5F027CE535412DFE0029B292D32B2366DF978294FD263DAF8C6A6F7CC895BEB1437CA189C2AD9B6FD5BAC06DDC3D075DF55BAA6E75865CE375DBAE862EEB7A51D0DDB5DFE03234CC8F14EA99110DE78A3463546C6CCE5F7C623028134968C59E247E642CE17D8933B6701DB7952FBCDC6CAF7F2FD24A241D82D8BB1C0F5D55BF55E57BE4AFEB4200C1C57938F4A6B1BE9AA02FA86AA811577BCF1D6BE545D6F12046735AE963DC7FDAA9A2F7270B8BB37B3BCEF7C73F59013041B6CF9FE10FAAA86DE369E868FEE7A37F62E2E9CB1409DFF11FBB09A76AEEAD0F8E443582319F6F74ED0AA3229BB7A50043636E881BD139EB7442FA35F5DE1D6CC227B921A1343E34030D2F1F361D7651C487282C907577765161DB781C49655A5F87BBCB68D08C04290B4A2A94B61BD0C7CFA41821B7F5641B899E90DA026290FDCFA4FB956414523041E14ABD7B1AC7CDAA1148A03B6EA17C49503F01707BD3373EACFD4E248BA0F8D4B845251BAA35D41DB186E10464F6FCCD2CAFC9CB06FFE9DC97FF41E07084B00B7B31FADE0E093C8968D1CEEF9810986821F1741F11A71F5F20C809F54852307FBF33A6C33C6A230EC7CB2CC6C44A3A53AFA49477037E55BE691ABDF6D4A852799453930A4", - "B19B7C4DE003906A0001E0DEEF57CFDD2B50514CDD6F57FAA2859061678DB9F8B5AAC67442D8B737F635DC297E3A46C34735AE4D2C607B06964D1FE264B7786B8B0604781D4814E2A81F3A0250D4EDDB77C121B962D0E7109A738630557F5AD47F95A0971A58704CB5B53AC378781B48D67FE5D5349440261C58C26D9370DF37255CFE845F7B0F735CAACF4921CC9D55B3431C6C888787D7C2B436C9DCF1DB94FF0D510BCF15DF0DE42AAC7640741B4893C960FADDCE4261E6284681BDBFB0F471C864FD560DFD87DDFEB4EE7A1267E285BBF2966F6A8BB408A105034220F2565E38F6A15A45B7FFA82DA63965BF44A182FB4672E90BA7933A0120A449323340D0368CF057DF299A8CF60035170D197104B394CA9F2A05983980A1BD93CF3AF8799E613BCEF26234DB2550A15BD53FFA306D3F616D78A6204AD1D50FF4F9972B0CFEB48B76516155791C14E0C9E18457900CE13F672882BF423400D2E6FF94CB16BF3071F44CF2DFE8317A9B761FDC8FDE90D7D05827521B070492AEAC90187EE48D93374B463C3381C7D80178F54C676479BC92470FEA7069CBA95BFDAF099A994AB8244CA786E7767B8400464BD08D5C560D61F27A96E3886A4E821E0087E7A56F96DC6F6E85F1FDFB5C82FD7BD48B63EA794BDE01439FE4C3D7F08864263A0A8B1C1ADAA5DDE86B99EB2A619A12A1A76A39D8B1F04AB55B67D15C7878651BA1F6621658757B890DB0D2BB533BA1C6A5E3226DB4FEE7D561842EFCB5B459598CF5AD3F98217CA720B6781E83C2297C96F4F51CBBBEFA708AD4B3F682FA0C67C82A5F5797030E0724AE9715A911CEE347E80F774EC780DF7E2279924F67ADF9D07FE4F56DE99E06B58099E1104DCE62CCA82D100D90BAF44F26F19ED7AEDEAE609C04C530CFBEBDD161A2C324A382FC8234D405BF900F0B6CE895F9BD534A6474680A7D63C0CF7B4AF1D1E93958CFC02FB379AC09B205708A68D11683B9282564C06290F5E6B57E3E7A75D30C9E21DF8F27F85E1FF347B32105A000BC613006BD7FA6D845C8E6D4053FF012D0D85F99737D045871BE017D672C8FDEB16F944E3020BA7FF0351A303A0D3280D71CBDE42F55657671A79CA30A7A33E744E74B34D27453654DCC8E87911B3701FBC27CD16C4D9D6C29D1BB9AFCCDAB28DB6C2B42C5D6BC1D1386AB26669985B626BD54791930CED4A13716BC9AF8F4DC37A04184FCF711EFF515B92C943E53879B5098BCC4E87B98000BD0BA2E1CA3C7A97AC95C1AD145EBA3950B154888272A0ED49289157091DB2C55D43AE77FA3384BCE92E5840459B405237E194B6F5788F16B217D8BF7539EF8809FC7AE1BA931DBDB2A7D15F139EF4FDA60F02FFF9462777647D675309AAB8201B5FCC1ED7AE066FC0E4F32D260DD9406BCEFE7DC5DFB38D66CFA08E5CEDBA636EFC23B3CB7AC38FF7C390542C9814A86D2D8F676720B7E2FD93217F916F10FF34A1AF34E3B8563319E92A3BAEE34258B4DD63FBFED854E08B1A2F4B560FFC40AA1048F081E66748E05EC3EA02837272FBD9CBF1A658B86B19B7DFC63436185D02C6411142291645692A92E3EA6A113B5436B0BB78990942146956795DFE003A4AB6D9ED875FE7E5B895EBD69C43BB7317CA5C97BCAEA97CFC6068431B24673FEA931EC1DC1A3F72625AD531CD89CBEB0E07F47B26971059FEEAE3986E23286D13BADEA3585D73F1092E41AD041D59120D3D25FD3BB0AAABABA738049C91B22649E715F3710EA51C41C1705C4F1FFB1DCEC85F0EE704240EA8A20526DC01C7C8389B21DA979B99FBF44", - "5805FC5E7042027201F3517AB8BA6F5C3BFB0BC7657337ECCC99CA480BA9C3D36033336AFAC0BE172AF430A98D8462D46453E935805E594C18C0EBF735D90D5027067006193854E7DB6424688BD715A7BE72EAF93C2F763F3BC340EF4BCF90B03AF20C28A59F72114F693848289873BE3869590A64658C0A3938A414BDE86BE8DBC25165217B1605EB0402FED48DC09139751DC1DCFF532CBF599E9AA13F3A72142E05A1D8E47A4044269A0B414976670094C9785811628718C6FE5201221A5822E29DAD564B6EECF025DE7783B7842DEA40D4F72D083D112C608C596F25E09EA85BC6CBDEA39300774301C1C36790D7D9C0B59741F6B53E16BCABF8120112C81D70F30E44561EBF3A3A4571F207305BB3A292C46C46E285C246EE9A7442F869711F52D921EF379DF7CFEC4CE64BAE4D7AE7DBA3CAF47EFCEEE78B477C02550D1DABE4FF4EC67A38A705F60706D948C017E333B645C0D80AAC1CEA393CF3ECF711CA3D59ADD7CA02DB6C5E3F259B4ABC138D24C47A650EFB96AAAE93E69F08077D0CF38B230F199C3B353229C529278DB1F5846086BC8F5F54F9631423105673FE92799FFBE5DE6ED167658BA5DB5AAAF921926FFC27956758CAE8B2367E3C5C5C6CC81DA875AEBC8F3460275C4EE6EF43570B4F571994C7690DFDA3DE311F2FB77057732B19E6FFC96221DE1DAAF9B8CCC21609160457365877519D2B332FA3A85B9801EF435D04DAEC3643CBB5413A036CC1AA0968A40F4EB5A76D2D0C3DFCC53C97BB3896E855957B1941FEF59048562171F6241AF278F6D6B580B4C94C5CED65CBC0F810D46E864C2B567BEC920F6D1DE42CDF32300805E6022EF184B43C1733F809F98B129C937930B984F5539F574AE144EDAF7BABBF379EF1A1AE69B7B4FF9212BA817A4F223FA8B182FEA231E7029F80DB126641725C36AB4AE950725435561C6FE37F960E37927585026B8ADD92E4ACA3B4500F0CBE078680D16DBB90ADF6A127FBC7F791B4F93D5463F8C71EEC1EBDEECA881FBDF3D2940C2EA0F8E4DEA1074EB5C0C9EB34534C9C3992E988DAF8979FD8AA90F540F028708BC6D0EBBFC00FA946DEE5E9D01CC272A4FE61E5B86FF1347340FE64F650996F65E5702A61FB53EADCD457A5ED66DCFE1B019A79104842C51B60142267392DC51F86F69367C25B999B3153C1B7895298B6B1B43EFCD8CEC3694F90BBF1A417C48E5CC4983782F874A7C64E05BBF462220950DA9E8F56BA324002E91D934469225E57309C7F562407DB900267553B85C4314A63351F20D57DED0B3D210269B09B976C07878C324F74758D9D507A4CCEB4AA30CC9CD05CEF32F1174C7B0F7AF93875F66E3A7B12F163920825885CBE5092CB7728A1B74B2F3FA9A01264214761DC5101BB0C18D65BF972A3587F95B3E13F52EB6D1F334B15220ADA5A59497558EAA0F4ED358A995F7444B633FEB900EFD9528B51FD82F5AA30699900D3EA3F3644E4FE3F6F2900ED45DFD997FA905D91521CD9C898AF4CE09B6EE00A15057C17DF4C656E00DD876529CD75A169977962DF3F6E4CB6950BCA37A79C98F108AA7B02AA488AA4ECE05F702B468C20C81630F51F884AD74A76491DA378DDB8290ECB8F5879F019BFB416BAF1D9361126F3514557403415F286C8E77C0BCE4FDF0F4EAA96D19F22F189971155F749EC19687657B245D392BDDA62935A44BF6C82E0AF3593BE06745099F06DC4A66C0768F17916AA360988D5E578D169CA84AD1A36B12CA4929223BCC52AA9B47FB138E999CD6423D1171AD3BF87B5D405A174B0398A689DB4", - "F99EA1599DA410098772B05B5D7F9AFD485A04CA036BAA9C71AD5DAA3EA5F1C757BC83F3C0028DCB93DDEFFD157EFC2CB29C0F8146D6704D34091EAF1EAA29AB915E652309491F0BDE632172914C132CB9A533E97F89F567A7A9B0776B400FDBEE71B49AAAEAD156753F5BF564CACE2C1285C4E65B5D8B2803A11B22350ADF79645AB6E458B1C9E2031C4D4D6361F77B53329C3530F6EF727225DE668A960FEE1F6D7588BC126D0E2AD23C2ACDED06AA2331E9D0E7F99234A391926F0DBE610C600964E89BE1842CB1F1551D5CDD4AE3FE45B628E9A990C872622C9257BE40A8A124FFD6B135BDD2EBAC05E2DDE5B7DCC13C76C27C8A3E778063F3DBB3488CC52836E92A89641F4559F377273FD51FC45550C727689CA4D5CEBB26263F4268502658F40D4EC2BBC0DFD0E41F16A399F02711BCFA96C2456EB8A77FBEB852726B0DE4F927C13CCB329F8B9BDD760D1DD299863BABF42EA7D7F6204BF13F7355610527A38E89F66D3D73522B421AF013197D649D64EAD17F6A6BC8148D9989E786AAA94FA19077292015EF7CABA4B1545CA9CA20E5A816D6EFF7FCA31FDFABC611253FEE80FF0D75518001C2DD6C604387C2656E1362A3EFC1AB85461A5B55C6374733FB6B17090E6EC1186EDCE2C49EAFE84B139C66A2E8308CF2370095B0129B6CE7FF6E17D14F79258BB3E555EDDEF12E634A5AF748BA40735B90BA1E7DE7EA00D2F4A8B3BED32BFAC17D10050B420DA32EB6D14035CEEA1B7951592AD75FB751FCCF190452FA88AEF45080161C5544AF80FB0FF93C62B02B2E5D1966F77760D446F2625C3FFC91A07A5E852BE406F1638B521579FF299227769DC4B88A805E168F08ABE606B5D745433584BEED712453785B1C01D2B9F1020BDB7EF11936F0BC449EF26DBC2D5FB35A2131BE9C0DE2746DDB6D0356294D0E09076C9A77A076F6B659B7B4F54A06BE2F353A3A0EDC6A5123598DF9BA1CA852A5D1FA16877A78D88F0B367E6C4471758F0663A7498CB1C8F13B03F0E2A941DA89C717A15143F4ECF594B0DE2E43B657DD87E4BF536ECAF3820127B1FBBCC0BF2E53B9E0E1CF10191BA9B43D4D33FAA379B1B543C593F1BD5CC05E0B7511E8D4925BBFC5923AB0E2FA90D05ED580F56071A62A334408D3C454C892328AE1DAF16CBD530ADA7B858DA3763BACBC989F056EE1D46192CFF6DDD7F066D2EEDCEE5BC6B72551245EF8D10389984D3B3455A7B9664475CF6B837D72D42E49BA2F61298DE9BCC707209D7F1E56BCECE1B21FDE69293D2560B8940223E0AE966459C249751A2BAB98323F184532F4D6FA396D5C0AA2A4A41C75C638DC3DA5822AD7D3D7D51FE0811ED3673D875039D3625362D7D00356E8461FBFFC49FE1B0624F6D30D550FE1F5FE4211341B9D57D210237902BB7C62514AD872C1CA87976809717817AECE1E224733079478A5DDF5F2A067DDE111A3FF911D0B511A6AEE16046039B229C00D6D10317F66E1202449DF20CF28BBAB4112948C65DD7342D09059EE2701B36E2ACAA6A9948F818B61B9A3155729EEA670D4AEDD6F0AC314DB12E0DA62FBA01D419F7C48B09BEED87F7292FB0315A597CCCB7B51AF776509818A73A0BED7A656AEBD7ACA2646605797940CB737548E83653E204B6A7A5AFE2EF16EBBFD73484314C5699EC8D24E899BAA0E202F37E3C8D8B5F75ED34417E608EEE4B26B453C07DFC6E62FAC215B6122CB14A07739E86FCF816398DD49970AE8A216BDD8C4C478647A8D07EE8BBCE6631C22920474154B3C83942C842A728EDCE7466565D9A6BB030CE684", - "B23CE558D0DE0D584768E83A066B9BF6A12C78D173AA3262866339B86EB8A8D5208159C5873CB29E9C4C0BE918CE4E8DA85C85E070CAC29850CDE48E2DC5E0609F419CFA46EF650B9022273AF14BD9EA28FA856B7BCB580D8949C1F732F87EB34BC1257205BCB6820FDF3BD1E7B9C99E114B3C7607D01235E111E3AB1F30E8A9311F0F30B601C833FB0D8C4D76AC1B02F85E93D4C3D0205F735E20223410CCF56317B6A12D07F3BCD42D2023BA0676A00E7268733C41C8C7DED2555FBD2BE09584B3063BE41BFE93340955788603F1D52190B35FFB8148CEC733CFC1BA49F609ECD3C4512A99308043F3C377EB65870535388376C2C748D18A748F5828B3362666C49F803828B4A019F26D6A9362726E32B650A85523484C4BB2ACFCABD16E754EECE0466D1B370175C37C8CE9DE236FC58ADFAB4FAEAAA12E048BF40CE084467C8835A1E209D2CD67C5BF01E0D62CC78A12130F5EF2E3CFCDEDF86D489C4C5D9AB99484CDD469F2F8EE5E14BE43B9EACB92E72237FB54F9615627EEEB193EFF888AA0A908327C61C50D20C613C933D736F6C3D7F60969A5D3770275081365BA8A57DF600F10A1652167AE3E18AD3715532B7C4BAD97980DFB0C4F69D9137EC7B21BC72AF16F0BEC30B94A4A5C2F55074ABC6233CDF4D8D347F4FA942944D9B2539D0211B24E2C7FCB56BA877371AD7701ED087269DD643C4B62E4B40D3F6572C0730E465C5ADE50FDDD11BD30C07EFF35AA6218D0B73B22095D320448E0671E1CA59BFD52A517A50932A06C4897BA6F7E7038A39C92C20F6DB18D6F6AFB3563D10BDF48BC194B79FEA6861F1CB9756281E969968B65161D3980C4CBD036467850EDE9397321913D57C1EBD7743A44A12E8C85F8D2D1EFE2A8754B5ED0E93EE9649C53F28129130DEEE66E58181787137B262E1EB3FDFEE0604ED1AFC798B198044DD5D0A3E87A754C7EBF0852953ACF3371BBFA0FD5979901252EFF69473FC5655709EA193DCA2A2BA63D706C84F49802684F80C576706FCF1BCEB2892B9179A72B7CD886AF36C7D3ED09270A4077C481736BB69A333AB4BD864AEC1EFA944A591608A2469C85AA6431C47F657AA9C2043F373A69323E735B56BC8177E1E37AB03BAE93A7B304EA1C5C52B244FC265EBD674FA7F1647E29CED527FCBC93CA7A56A4E771D7D2E576C40B2EC736DDBB4FD7411168C5C568C446D1E454249E6F7529AD83215EDB62F57D25272F351CB2C40965B1DB65EF5835923EC2D2FC7D8AD56B67980A3DBB77E6C4415F54F3FC00A790DBCF39A2FB699A20FC634F1B1C177C37898A81D7693B21020C6B592E5A6359AE395A841B434B675F1C30A9CDD0ECF987ABC2406178EB2DE941393AB4F96BCD43626978AEA548173413EC9DEAE7B53B175AFAAC5A1E02D6EF7E27AC41268C1FD8DD83D1AC55ED45D087083C0D136048B7F61EADB94C88CBA5503000A90F91A39A8C9E2DED567F7FA0DF605AD7870189600B941B99240A15310E7B3FCCF5ABDDB56D50CECC06B4303BA39EFCAB2F7E9F5CC8F542E96034145115AFE3788DE0A4985EE1929D4935EF975E760DF7FED8A257718DFDC5A0B4B87024C59DCC6FEF6F2715582023C3C80EAADBC7AA8712FFAF80CF5E159CF5418A1CB50845C97A7F19DF3CC5FA344562DFDD819DD736E9ECEB7BD57AF324256934CE6DB0CF295AA0ADC5931D339027CCCDE1441891067DEA40F69F6EE07187F9B78DDF6D59CE02EC3BA6DD68F06851B10AFE9672EF84020CD53ECA25B3D5E527405AAADF60593A8080373A387111EA898499F096FF46FC58", - "8515E8CF42FC33A8CEECBD6E1B65BE307A5BFEA9CA59FC51A382C24CCCF012C38DFAD3FF3DCA3180934DD6AA52D828439F1052A959DE23BDDC3EA3F2E8CD70F7A765F77549BDE6CF8E444762DE51CBA3431439D1F1E42F1773FCA2F90E48126A000E69C0964B1955F586CDE1895419083322FB4E6528F61768F8BE4CDCB37FE9D02B27193A0BD79D15F3CC9AC6DDDDC82B02201BEAB86D13EA560F7EB5328AC0B534C52BB9D266F291425EF1607A19AECB9AD681815EC4FD1888BF5449421D92E473C21BD44F2C419A0B3E0603EE3C5C82E56466C5A76B76F81A6C394BA693991A5808334EFF1E996AA1B1394A4DAAE00995F02E9518053FC744BA391214DF2464DB9F01A5A53870173B3E8FB6B9B698A8DEE80745D7F71B70B811867D3513197B32115882348FC704B2AF8BD6FB3BCCE30361C1198B84865162734719D88BB62B7431FA39D452E0A1B0A7E45534BF76B6AEC48DC25B7487FEB4B5FFA9C56CC7C83E39AC196987747D664943A600B106F0C3D6B2D0D4425073EAAF89AB33BF6AD76B151CAC32A670A2B03BA31FBDB48B949D3074CD9F56D39553708CB0EF2BC96170E2FCAA3CB2811EF1C67FEF6FE85CD450FEA37A04A07EA732A696EAE8E76D497F5C350CDF72F8970FAD94C03909F67FC895785D5DB6C3A68641D68895AC8544C6A1096DC4CCD45A68BFED7ED86961B5E035E61E9C126319A7B3C1468457C423C4A4E2DD1D42BB90C8BDE2A162F999A8C3A99BE998B9DB7A14C101CE78F08857ADD9A96059DC22592B90488D77D6F0A6D459CA65FC947D742714A42277A79745C73CB157BB825E65872D9BEF5066C444229ED1A097AF6B0308DF2793A2284F911C764BD1158742EF4109CD8AE6111DCF8A40BE03409FA6C430829D0C9BA28B466916C67311F8BAEA2D8CD2DF9C95094E4FC6D43F4491AC5FFBF05BA6B7DB9D7FE4A6DFC386D136B1710DA5F30E67C8DE97A981895476B8E4E0DB5E1AE630C8034F949AA4095DC81EAA0F645B0B440138AA7C5C7C5FAF3B57E1504A5FE477CD61A355D9AA66C39FF89E2DDCBC1862E19102205A9F343FAEA71D4C67192D4D5A1AB08BFADAF6753244BE5B14B1F911700B4A947D53645DCE170401135D0D7E968F03A9B19D2ABBDC94BEE623FB64C1DFC4AD9040197C319A79391016D6D44B8EBAAD5B2F1AAEA58AEFA21B5B3D9ECB66B3B70626AB31CEE5CA759499073B4FDD96457392E58C0EC871B95C7B77F74B81C4CF5B1B243BD35F4D540C1CE878E80AAFC635D363B9D72DFCDAFF62FA8339BAFF4DE1EB3E146DB93E7E444403E0D4290AF501C841B66302A345F5541B1C797D630B5B7E788A793192CE1F362B22B91A837184106D852391A241A903E3BECD192C4FE52586BA4044C4FBDB20B711D2624B6CC13E0C5EF62F2B2E00CA516991C7572732DB94DB809FA0535D2E8376685506186170E3702903A6D08996BDE20F74BEAD391245680A029FB439FFB96EB829F0BFE58A6446B00B4E1894BE1B5017F706156072E2DCFAB25A3BED2DB310DA1A7262ACF24A65F41FADAE3F81A32077BB9CB64AADCC2F92B95EE56F20CCBA24DEC9F5F75B36EF1A101D0F3FF6D730DC199869F8F26DEFC6F51451BFEA2C0EE77CB17422E2790A8B29573405F112EDD704E3F46C7CD8ACF0E495C6BA9ED448B0B89A9997850F09A813FB23788681D3CC04996E931CB00A879E2FFA1BA6A63F9D3BBFC20405244B0F838A040F125AC2B4999A197A2D53DEF8CB167FB7E37DA3862CE3ECB57B081DCFD98894E45C6019B9229315108E37DCFC57C9F80201486AEC", - "4368224792A5CD4ACD64D6956A334DB4614EE5EF8F98EDE0B4A5CD3D06819A4858EE0037DE64ED93BCC7FDB47E90409638B3789BBC63134308B972765565651902A9CAF4F310E93BB08EF1E4B325D414DB5DD7CBF660A880642A27378A7427F2627BAB3444149181C54E9D3FB7967DE33BED89AAC255A47482835D17E329ACF3F08F23AA1DDEB730D9602243A6894989EE2D900FF6AC0579864C2361EA56CBCE2F39A75A12100670AF3FF1A36E98D1931D17CA68D8D031CC527EF7FFFB35AD6E046F4AF1B2B3F66210D978F8607039BBA99AFBC6A499A5A948C5C59055A140293CA97306BFFCEE37CE77C114478D0F73D1C8C9954780830D56878EB786967DDBC71951ECF815CC4266D66F84195CA1AE0375E90017FA5C66DB8329D668BE6C0BFD85742088B7A3256A3277AE2A1F4E72BBB82BB2A59B08FC59FE5F24EAD5DF43D95917A144B4DC6587C893314D5C2C427EA92D02E6922FB0B60ACA646092E0D4A127799FEE4B76587F26AC1EB89BE0BA46F2A212ACF50D93D3345AFE72AEDA1A0F855C45AFE14161E22DA3E223CAD6B47E591896F4283F10C4073AB524CF5D0ED88F979458BB928F1C179E2C5914B4CC52CC000383D154830A54332D4C0E652F98B91BC086370B04CCB1AACA56C9A33B9F0A65C33467BF45C74905B67607B83FEDA063857AC4E326B4293483C8841572174CC8A384014945F5C3072C5575A5BE322E3F2FE3A7E30F3F21118FDDAF23645A40E0A359A3572153F5C3ADBE1BBC4EBA5E063E9F73510C5D1D4326D3D7A20384724279C3B4795C68BA332EA706E8127672E41DE4BF1E8B5EA60B39CAE2C3B7B21A225115BAE051FB0401A69A7FC56AE4B7E31CE2CD575D82C8279E8B8499EEDFC134503E6798056324B17B8AB045FFDC2A35B190B39FF212C17C36537A1F99F2EC3A4CE693DCEC7DA80861FC6F3D064B82CE5581F9781289A085A300CCEFB6E80A86D961408250846A374ED00F5379F446FE6E551F608AC3D71346B738C75DCDF63E19EA79AFCADD5E1E07E2F7C0AC709F6428FEA1DCDD835E3F56B026CD8DC9D4629AFDA9015295C2CE55DFD9C83223821682B5AF876B1CE156343A0F4C1655448FEDBC992602BED5DA4B299B86EE2F86D02C757CB5696B32D60357B21F9DAAA06EB3BE2E9117D2C99DFBB5328B3636F41A06A020E3CB47851891AC3825369C037B0C0D8412204FC3D5FA9585F3218F01295375A09463AEC65F591A594551E19DD00D5738086A31712AE9FA7BABD4E9C10E9F4DA82C12EB2F3319E852B96E61EAD2F85BB6765DAF874FC8AF42746F14B8FA489DFAA9540B4D0470CB31F99B10C335F672C2E06E8A2378B9DD28E8F56BC7A4C017327404C79F1E8E67BCAEB5C4C793C176F0A3C1833007FC44103DCC6E273C9FD1909AEF1656E2B5756B7F4D69F4F2EA576228DD794777BEB2F34296691A1FC38AE44FE60A44AD894CE92DB77FC0246C779C13E8AA16648843BA68CFC5E4E02FB564B0ADF3163C5E167C275A8C15E58659E2F70A3AF792565422D3327CCE25C9D488EF3C32B195066BD27DBD44EF1A20AC6AA22250BC0592AEC734477E1112DC3913F6B7CE323FD1F7B3F8299B8C9BBAC23487F735070AFD5C3627506D4C96B0A1427F7EFC07EFCC62DDC5455A77B57D3FD0B8CAD30A346F8C34F42D87827FAFADD54264A323907A89334C0E7F98AFC9060D7767BC9D8D261BC0BF64FCA389BB192A9B4B00CB566D254CB0226FA17F3BF21E2926CA52CE5DDC401E74A92C7989552CA66675A9BB9E9C198BCFFC488BE1DD5E47DEDD94015BE09B44", - "30F77B7E7E40E42A52452A26283CF3A29B02DE3398DE5179773F2CCA4978059495B9DB13069B00107462C0034064A024DF3AD33C063F9608783E79E38F706B92AB117029EBD6156CB5D278149875B95AFBE877A21AC3128BD6D0B11D31DE7A2BF7CCB68911309BBD2215F592D56AF0F700D962E49E4C6D089548C7587B0598374C3D7BE80F7F20D6855AA28A27AF668A8AD3552CFDE3CE0B35DCEFD5240C8FAAB89D013D0DDF5B66E60328AE32BF4EDB8021E43762E96E5999CF23BF2457B1CD75D1457D4926E7C2A324BCFF70A7CF59047DF3F08EAF2922CAE6A7BE1BBFA3BDDFB864AC965B7FF093CFE74B53DB332B411962DA01D4E6C62CE6731E893574A097328CA7606ECF373CC987F98C31AD74EB4A863084266869D28C07F9C5B5F10385EE44E463324A81D523DFCFBABEF20F3F71FDA33B7EC1B2A35A98F01D13693CECFF23E00CBDBA2A2D09C8A86A819E82D781AE88B9F207889EDA1EBC54CADE6A69A564ABF48F950FFBE7A86243C544A78362D9BFB6CCDF20CEDE386B9E3F8D7EE0E4A58596F095AC1B99E4F787472A734252D6C00B177FD2B99A85D49B9C0F32D728F7D9BA4DF96D1BF6C365F5F4EED7D38727B339A223263B58560ECA6778069DFCE48703AAD1BFAD59CE298C6BB464552408946265B1E19C1FFEE000771814FB5E4688140E1333B270F05EC9345E8BDFA7B412F295AE3DD4DBF33D6D2D62582887D4CBB9EB55F5FE3C1BC32DC689548B66893356704968C143AD3CC2E48BDC154620ECADF336E218FF1B22521D183EB2D13B15A15D39A42A25B46F1AEC07A14CB805AC382DAC8CF96829B8F1D241CF5CDE5D849DEB242295D7870432EBB642A45A6C6F1C2786B88C883B9B47343E822978155D079AD9F6C8CD4A21479B32B2112EB0121C3C74E7C23284812F74A2B413B9A18D6372AA3E09BB04A262E7FCFB6FABBB074C7C603C89FF607F83DA32DA50F2A19C38BA0965BEDC7A961966895E17A20A4D8028FAF7B6947A1964601DA45643C5FCECEBDEAAAA83EA5420F2984CB606E9F3191EF323D644635EDD801130893D84DFB19E661E04188C6CE596DD38C11D1CE5DE1EDE0D15D8FC427842085D300E6801CDE02768E44BAFBB302684FD945C9AC722561B0EDA92E8D845EEB99F6FB1889328C74D6D9CC6DAB59D55463A613AF33226660C0C034B896075D9EC2F51165A754A7D2393E15955BE327587943ECC1F3BB97180E751941728B94948B6648D2C606D66B9BA1898FA28EFA38A413B066D715F7DC5F0C755B6A3126AFCB606EC6B12E332FD71E386ACDDD1DEEF1533D6386AE5994BFD857380874B14ED836D9DED47DE4760ABB05E80DC622C8D7882CD74B2720884DA747BAC3ED9A6EFA2287D5F7D6AC7821E79C79EAFE7A68D2543D7CDDEDB63A13FBA4B894A6D0B3E14C44876364C9FCF93DC066CE953E89851A49B6EDB38661C9316C82ED902EEB894321C84331F6646A5C1AFEF832F38AFEAB89D181D3DD1338DAA236BE0E87A6381D00845CCFCF4DBEC3D41F8AE1E6F39167A499945DAFE77601147EB29804A8B98E7EEB31DE20C84E9148BCCB15CD02D1E3B519EE0A2E4F70F57A69281E651B189C08D575D52E997E3A435B4CC86F938BC79EF4961CD03DF8B92A8C507DFB2DE4D5EB0ECAC2F3D712A46CD3EE01B8D4DCB845D23E53A2E01DF3FFA100078F7B2467A45BBB4A18D14E0CFCD089433959F07F6F60F651DD7FD9828069D340D048FC079E4F8B92824D54322611A3698FAF181008DB5E3E327EDC431A8F6E481484BD5A429D0F5DC55AEA8A18F719A7865B0", - "A7D629A25F82015CD70688CC461244E4AABDCBF2CFFC2D73A3247F4264101FEFBD5759FFB83E8ABE9EF5B6662DA3CF7196385C05D0E5BD50C71D3CED424AB805AD632F2C1930868ABEDF493BB4E3A9DE538D8E35146320EB9F5B71C40E6F32E9243E6A25F503B68EB484ECB73C436930F30E2776D17A2E5F9CAF157F368E0FD9C26A9E9AE30A30E15DDD8A56482C85B46F973D000292CFCF0021577E5DCE8220353E23DD8507D0F561BBCD96F6FAA451E9C595E00CE0F99C8C40359B103D621CE0C837A3D1598D814BE6E22B7A509DBF1ABD2EA60955364791A5910414646F9928B5676ED590F41BD128A55549170211A0630BF5C5BEFEA204896C7FBB40F0C72E40DF19C95F3A0ACD641834E5BCBD26E91315DA34708E2025E0B7D38F9513945DE44AEE57077C8CC32C707D9A39BF098E4928420B3FDE8C74F39F81790D827A628B8F2776251F51095C1193B2FFEE8C93F49DF6D4E3C2E1BDA52F7356394BD5A675543493E04D602F332761AA1D57DF3EF8213E4E9B8D4BF6C8BE8BCCF661507C394CC9D5E9DD4D81DEAEB6D638FB9225247818710E4724111F522610075AE757AB5ECF6FF32CF087DEC9A04A7DAD8C613B22F2AFD31466574AA87CF0B8545B38C53A8F4597D5F1BB6837AF26114D72C609B624252722DD867572D449ED7C170F99D4ECB995B76C8DBD14F50F3DEA077FBE4F838A03AF1DA6757C70C5F3394092D7EADB1E0A859A8487F70D9F7EE523AFCA08DAA5F8E9260D63330773FB7EBE01373C3719129E483DE3D132697EC4C108654256315A38D7060C6F52B4A444EF33E87946C2537A3FB3B5FACBB0F3292C7F2498F0A11509FD9678CC7C678D4623DC07D8F218E4B65F2EB844D24D696A31483E1EDD1063AED60D7A110F7992E3E46F8C7D5CB1AF02D598440D79D649AA415E5F3ED033A8FDCADF8DBAC48F9905BACB37E31ABB0174CC08A9584E25B94423BF395E097E2D0B7ED76B55C6231F180D1A7BD969F6B874B9255138A1C3A2847EBA159C7EA281433A39D2F88D724B6350E846B365BE838F25B904E7B02B12ABE543961D33D991D0DA93310CDDA1EF551D7B6A02765DCF0D870C2BBF578BF8457CA1B599D0FE445B1E9C39E9C8756EDAAC6A10F62C84F60A27268FC5B436A323AC5BF4A9ACFC55510558C5A354D96A5D74F69687385C123C497543EC14C40117ABE46C22FE54DC4D2D6F4823A7F3DBFD3A1FEED428B90945B8F6B2C9A162F9C0287C758603E2C7845A11DDFC37B815A62A1A665C3FC003DC9F064CD5D950DEE02F48505CBE1A1E515E6516E926FF6DC0123E1E4F94587F1F1568DFBACC3728BDC1D153196CD91D9F6DA84ED6B70D0DBA7E7DB4A71B224E5122328D1DCDB9FAA98E88E9823A49E7560DF822D67C908E9AFF7D429E84350163E49AFA4015337532B6E928BE2001CA202C5D975A3E54808AF8E110575AD5FCA28185B2A7D8A3019B97AFBA933BE2F9CD5F279266EBEF52E0B92114AACC30237B712FE53DB1B8596CA72DC82BEA99DF8FE845D390B8DE1C00F24D0D9C619651FB16A280102CA8BD7FC3F7868E4649C636064F4D0EB06D06595A0023E6C5D32654EAB9C8EB011186A32C3E5DB9BA6489895FD50A26CDF1BC27D599F7A8BD1922B30187E0DDC54AD369CC61E958661C4FA76054C2C6658AECAD7D0AE23A9F36DB1B0E1141ED6A1084A8EBF8975325A1DE4A679BBD0E022BC35A07B40C52FA1B0BCDFE17BB6EAD099088963D7937CFA5B51ACCF722FE4F9DF99DADA8CB05C17B6A6AE884F1C7DA09049027D6EA570BAA064736219CE1DBEA7DB0", - "9BFAC777848D427BC9D39876B843378E100DDB87ED269AA91097FA433CA7EEC7D6210E7F100C449876F83439E3E494941D8CFB3E11ED7AF04EDFFAD2729FF75A8FB14A9BCF386ED8D95C046A326A9A92D3F316C758F6939F14BC88789B17F3DFB5AA691A872CA44E908AB966D5F672FB90196D71136ED26591404202AF5858D44C8E0B0ADE3441F554040E458F5AA64AC3D5B32399E453FA1565F4E71FC9EE5BAAC97552AD75D0154FDE48AD914F6D59800A7FEF91BFB6465A296E217E554631FCAC48FB7FDE1244F00697C2155A3161169225109AF5AE218D51D70BFD452433BED94FAFA5920B35353013BE2CD0C32B8AACDFAC6C6B4CCCC2C222AE845FD76630E963CA22F5214033FEDEE3296112F9C127865137CE6182BBF09D1489A1DFFA82D9B391A5AFAE6C80414698703EF03BA42893786FB10C9DBD21E7292E197A2959D605EC466CD202BB4E7BB1E9D5B9B3F07F55FD8637314E3D68C763CBE79982FCCC0147AE6D4C96F7A1C251BC35D8EE3A4F6FDD9CEBF771878B80E3AE481619D80B7BB7EFCFA9C20F11A0FE18505299EF1BB195EC7A93263420D183BD89335411CDD66B4809BEB30AC649CF76552A6F08E9D77C2E9C5AE05FE469705E2E6F44485395C054F401DC6CB9F581E52978BD93CD927D47472DC52D81960F98D60A061C5ACBF9F5E4434B31BC3C55CCD71CC2F2DA6385A3D040DE8B8D5F5CAABB6FC301FE3D5DEB95A00F01772505201B33464F2BB1D45A2F55EC907E86803A94F9340960A5E99C727517C520D338A41320E7E8BAAD6C4470300DB904B1848AC84F67F67C6BDD6AB71E2531C5C662AA9DCC2E84634A5ACA48C5A5CD1CDA454C6689E2484274EB1A2D1CE2D94876F4978987331D16AFBA205E1D81CF287E5E59A6DE000FFFC99E50B0B124E718CAC8FB51A708B42C0FE669894383C01D020E45B301DB2FE85B177FCDD1A688264A0327614A4483BFB689DAA49E8F59BD2D3943BA06F39119D46E5DCD0DEF78BA40798384BEB03292F231A62F7B6E456F3542425599B2BCF96978626543266E8AC0426B3C4346AEAA1E2FE20B54F70273A5DEB9BDF92B8B4DE940C48963DDC569FEA89B4A6940B7644E33D105C5BDC61C3EB7D823D4CF3FA0AC7196D6004CF6654BB4E4602974FBFCF6E74FB58A83540254EAAA4ACFF41C5E1481B2C38E7084B944684B21B7C661F92A28508F449D8ADE8881D40AF4A161A08C5846C78FC5C562CBD36ACB83284223B2891F73947804B6AD40BB99A4E7D9ED1912448C99E5B572760E53DFC434D06DCCA06DDAD3BA09DE063378A98943EFA0CD3E75B1B860E8D1350CB920BD6FBE30D437B96290F49E37BEBCD2FF9F8A4BAC7CF8F4571DAA9E788A3A411AE231D369D35055EA48D03AF54D968EB71F7BD14E51A1E617F81B492FBC3AF3761C601CF108DEA9E198BD1B576F94DB9A15975CA55D356C209E5CE1D8329A5D353223AE3C5C9BC55468AD4C2756BB54B6FC66FCC3B0BBA3962EFB4ABA17B1B08B01C296A578D5AD63F605BAB75C90924AD456D53CB72436F3A2086EE61D7C3479E0381A52715292DCB8CD2833720572A40CFF97928D4EB54265F3110714C360A0479AE7D51126C5CCAC09372AE7139C20C46AE13E4C41E89AE12097C6A198A979DCE9FCBEC5D1AF9D9189059E5E317B77B6E98C29F38E29A35FCC3BEBE3ED0267C5503BAB0FDC46C7D89766475F2676C80CBA71110F815A84CA7EF91ACBA63AF7933056DDA345D527DCB5549C9CCBD5B201BF9D0C82683A8865DBB4DDD057002025D088B7121C118B3A6C901BFF83DC1114", - "18A25B1D741562F456B84CF500F138FBB34AE1D18E9BD6FBAD05D0AFA14BD1FFD10334E6AF3ACC7AC2698BA10465ED5EC26B13265E5ECD1C79359095F36B1B5333EF87E78FC44571ECC00F294243FE64C4BD7833FED71F3B6471ABDDBBBF4C374519D24DEB11A8D2EBDEFB8D2CB3BF517AD92CA598040D0F5F8E5607CD879C75E15755087EFF796EF432073AB647C9DCED072FCC9DC74D78326EEC1BDC9CD3272180E38DF556715CD1D37DEB8B6BA06B81F01C26A3E97B9475B688D32BB642EBBAFC4406B7625944603FC085B38E5E4C9ACF0D0F92A65EC9BAEC8AFD9A1C7805854B19EF516BCF65125603F131084CD13BA6E72201B13C1897D0ACCB8C4266884F3439F6833D22C08A68CA0EB7B636D866182E6F42B35EE9E255F3FD30014F4EF3484EF31FB1D17A6FC0913DCC1443439494BDA221336D05CEF0FF168A9C54830066A6E986672EB92B2CA01C7ECABD5B5B40049B2161F8F52445FC27379B0706866AF20800C521BD0DCAD90E8F4367929A9D21F1921049FBFFCB2BFFB69B27A2A4FC9E48256CE24302A57B69B04D6E51469D5D7C7E41DB6113693322E1DAD218FCBBFD47892E8BFDC28FE1461AFC769286C6F75165CF945E5CD3C9322955261922B6C00CA2C006070EF26141BD8B44798110A9F20E86C52CE88D6FAE122FD7208C9216011D7D91750A800576F575B8EDDA2545B3D60310D61F7351CA1C82C90E18641FCD747FE901351524B9D0B92CCBE86067EE5F126FF4B2C582B280CC1549CB3A18D5D9FD25A09A67DB83A8F3F7DABFAA3C09CDF00C6F16D722EBCE259723B97017885B70CEBBC1C164E1A5361738B1F3FA426D077AA97AFC56F4F147D3EC04E52AF0CC518AB4CE8B3ED66A1EDEA49E904B81DF00EEABBB5EA8437C18C0282EA1AEE445331C5B0414C2E3CEE637933753B30FBD2160E93C3E7956BC032FF839B81179DC5C41CC81E6B8A74EDADE4F6EA0FC2077D3AFEE342D75DDEC1539F5C00F640A56EBA718A77A88E2E8070AB9663037AD66D9B6314C268806C2856E233D37BA73E61B8CE393F9DE86DF5C76610766DAF68A8DADD37C3146F59115E8AC18330977D7BBF677C755B79C902A50DC457FEC314323927BFD45DD4A5AB7AF351228986F3B03E51581C8A8D5E4F8C24ED9E14FDB5D0D6BD2A6F563D66A31247D4EA17CF6C158BE7FDA81DBA14B9A1549D5092658BEE5542BCFD42C8DB540447AA13F208223DE36AEE06BCC2F280333D81964ED05A275EEF56C21F0BE0EAD9D6A8F2C70660C0CB04AF6D84E0D18D3EF56504CB18EA259BDA23AC1D8CAB42BC340448283D9CEF770872F3B94FE85A23CD9A864F76FA82EB637086D12244DBBB9E7B2951D3B0B6C345E513883F261D3EE312A31017BA33A08586F58084A8087144CDF634517F42AEDF185D53366FF728C0E7C0748A776F3932CA874D3C2C48B30D01A5F579DDB1A038AE1E20D986515309A13B369F644A856C995C2F6942B7E6BB624A0DF34FBF31CD9F96C486E530A2F3FF8A43D7DDD578D72B1E93338EAACC244650F8BB37AA9CDF721B1EDC334755B63CD34AAA832725A883333A4AF4ECE71416146A4F05232968680AD41C89872E14AE1CE2FA65B7A3BC099FE265173B0B7159662259FA64FB70902BA09988A30697F110B892D7D6C763EF80D6E904A2CE47BECED5E98AB2A3BB70A73D6AF7175BABF8CF8F38F2AADE3BAFBBEADF208415A2C2FD4A1ACC3140E185A2534AFFE6C01EB30FF0137503349EEDC1F9BB263C18F427E2B119BFC692D5FF44421208E8AF146FDE964C2DEC3E1C9D5699ED01A7D78", - "69A39F2889ADC98D94B5C678A3D3D8736BC17256367EEE3FE8EF5AC6453A0691D894F1F3202CE84EA8BA5A341D1733C6BD0150CE9C0019168E67768B33B64DD4C9F0E2BCCCF2FF7E370C2BDE4F403C270F36937119950121A840913CC1D663F32F01B665840EC9E09E5A9C345EE001F84B2C1154359BC066D29E0405941476C5B7B11CFF124F5324D4D090E2BC49C3E8D83122DA9268FF58B523EAAAE4493217609FDD5A5C510038CF383B65FFC7671119556702F630404C0BC686975E853C86AB392D25C853964693AA7F4A63BEC12BF51762DB46295D2062FFF24000E4F9FDD21972D747ED2F37DBBA2D6DECE1009222EE06B846FB7D49E8014DACFAECBEF2560CCF5E06EAD04B113D1F8E341F200DD8CDB3F36AB99B566B16A84F8C040ED8827F0E9F0D4FA340B0ECCC98F5CA4B05A990F3B410CAEBAFB409E985A722E4C442F59AF3ECEB1AF0B148A3E8B958D9F6C0E45BA4EC8553332DF170872E60967E106BD27AAE4A6C15D391C1B4DF7D77357B4D4E8B29FC874947A75CDB1A1ACE512C5CD08405F2D9F21D50197DC151B5E5A735F759628BCB5A70B5CC9855A39188FBBA8E6BA0F5B6538ACCAF394A809C68F810441BB81CE71F7DBB2A11D3905225DC9B1F0F0D8B7E5268020039E03FD97D42204E503EF98C26B5D9DCCF5424573775E536C4AA26BF4B0351530857B8F640495377E9A08AE82F227BA487FA1D945EC233EB1B42C18FEC4BEC651D4CE1313C9574976F092A5E52D1B37B5D4B33800F5C3803BC6ED2759AE3F6888E7120D3AC2F24729A08B2B4C8D44EF807987C156DD3ED871B0A6217E9783A78BFE56C819F2C8FFC2D2D83945FE846833E5ADE3F840B53EE67E5D13BF0B7031B6C1D004D274F43C1982C43FB58011389D2C7E9111B8ADDD89C37756F1E4C4A931D828ADC3597429AF3A00C0C9A71A44A62F922102CABA479BDDF25A088BEFDF630E2AED4351A90B9567FB6DB5FECD6F168966DB2EB6161DA84479DBED9090026C3CACC19B91EF5680A40073FEAFCAE161E3A2F0DAC9C0A5A7AA31D93B425D5B5A7BF6D38FE797FB53793EED791C82DDFBB2D224455349F26F147FE0D59747AB091585DAE61A32B04DCEF19D907C1159FF69443843248D75E772B558E7AA0FFAE2A9D2B6B1E9F34B79DABBC98B2FAB34F76FEEC635E6E756F7724106D08F296019FDEC94FA7B7CBFD780F2C0B75B1D88EA0D5885237F4D09F03B2E8E1A98879656AA33AB23583DAFF96D8FCEF548302F323A8BA959710A78A803185D88A9C971D9491613E5BA2044D0B640FECF219CEFE377445E5256FD687A15C9F66475C0270C9C1A7189507E881DC6FD5B31FFF9949342586E24C7827F260CDAE356F874CC7C913ABCB40E892E495CD4388AFB84AADB45069F37ABF7DF966CBB8EC86C0CA5A86E79350DA5D6BC2B23EEB51B9C9C352FD9D3FFAE368891D8FD4E2861B8002BB16DA0C4A96E6A9B8D8FF553CA1E6D85B16F996FAB677FE58608BF58AC1AFA9482CA957B03924945B4260A4147625EE657C7763B4C9F4C00466394DB4F222DDC16B72C579FB80B3861D6B4364007FE856DD8D498F3732AF3A7041A2D71498ACB3793C250CEA60DE84FCD0C227A08F903A0B5ADC936FBDB7BC6AB8F7AF002266C8740AC3D75B0628EF6A05C0481CB283E3645F7D8A0ED7415EECD52E4BF70F00ADB11BAEB947F03140446AF31C2BD41F1D34D75FEAE64B91C6007CABC91A07DFE8AD753CE183C611178B8F63B822F03AFBD41AEF17F6A1D58F341D172D4682F38FED397FB01B396352C37397991D2E1473784900B4", - "39B27D6129F6C84173251B68B742EACD5A1BBD49DA6A4DE039831B66B054A9BB13299EE828282F1779AAB7FDFD82F4CC3296E9777A03C64AC4F08DC8882A9454B301264284F7226A4AABABBDC8336CA2BD1EC6517A9F54A776446C5A12FEAE387629FE5A66188C671C80A6C83B08322C2068ABBBC03261AAB8280F4E36507788CDAC4D3F0817327FC0D19B0BCA35D89819A9DC2D5C0CED08A87AF8DDD99304505EA08855CDB514357F8A9A7F3F4D062705E7B26632CA617F640F4D99417CE5C90D432D6B8955DE269460B9DB3C08432FB7BA08F5A658DD79DA8E9AE5B0751152847EA6ADA78D0BB4A8BD9F6E221990CEAF771B5AF603F463D2369DF9BF556A1CE60D1EA6172BD05EDCD166255810C1FEFE029EF21147DFE8EDD5B333F6C7274997E1BC61F253AA375B9CC6B5B64BE8DE11CA00C9530DDB1F218870611D4037BBB88F257614EB7F2A6FF395376C5DAEE4E83C5D11BD6600DEDA47D1CAD95B11E5BCE680D2F18CF92353A11840DB88C38B363BE8813E8004D2BC1DBF95E86C64E060F735C404E8945EAA3DB31A27C63AD818D96EDC6B0111CEE3B3E9F0E1B7DAAB22364FC1B36D25ACF77630DBD1E3CDB194FF8B8D1BE8ADABCF4D0760BF5CD406E982E0F743AFA2C4B333152A74177DD79E64566BF34A10515AC0E050CA135D7357E1F94F1653E9EFB0FBA0BEA1C2B09D6378E4E33EB98B5DB2A2DDA5D9F29CC68766AACBA09DE25B338BEE82700203628ACBDD4B828B34856910D0F2230260FF41EC371D08BE96EE2E821A1F3F328B631B53BECA81BBC74A92F608F2B040548BB5E805EAAB46815793F1D01D121D2E347ABF1FE62B4E00E31C8DAA01202340219430E88938D859D62B709D43934265B9DA9DBDA01537F54B439111126613FFF46ED0A39B2B19C22B8776618B065E15A515B752E1846F51F8469CE32FA076F47A5C49541A19D54CD63512DDE1126D7850B4300610E066AD53E094F26DDB40980B47D632DA9B4524EE5473B521A8F79A4B84CAE714B65E30824068305858CE9F39BB2EB06821C3C07EF2E030DA4BB3DC2D7A29A69DED7EF7B03825C663F5EF44B9A1A174ACFBB164FFFFF0419E13A8DDD108FCA9B2A8CF1A5A2E0471046FCFE32555E72D857ADFBC123B190B48CFC91CE8F0BF86CE2B439DCD3AF6F2CB26EEBF393FFB34290D2B7EC33FEE285547BDCC922312D36D9D25AE5DCB0A03EB0B603A6F75A5EE878266221C9B606B185250231E4B5C8B9470E5BAAA9859A963A51B83ECC111DA4779F012AC23AD2E2DF2965A39E52BD684A0E8D2406A173465B57BA6DC095298DD716BFE30E42CFDB0F2202D56E97772E3D64F1CA9B628B6EF2217A837165A1BA1A8612638C8387EC3854AC557C326CE88DA10F9DA027B204CFE634A695F2B59BC57F987C613131DF2F0F6A5F6081C96098DC03F82B3691AE9E4F14C32324CE495FC94EFCD1CBA88842223DDA27999E0B1762C581162FD1839352E8FB7E4FC143E8D3C774BE9BFD7BA4C3091A04D08EFCAA98B5D3AEBD1FBC65BF1CD7BEE784B58A877D8AE9DA9B3D459521A53010D42242DA0181F661F7CFECC2E74BF3C8E959D84F91904F4F8DE602B214A2E3C42B93BF904058FDBC37528D467E323039F101209D60C56BCEA60BF9C3714A05437A978F3601FA625B31562B5C9B5DE2C6B84F560FE35296E2715D905BCA71BAF6B577E7A03CA4A5DC816E79E21C9B688B0857887A25AB624E2233FE8C9A80C6FFE9AE77108F44A72AAE91885BA9541939A34519C457C41964D4FBD492E11B2890BE2BE0E069D274621FABEE60934", - "4545989EE35583C07E91C0FF1F5FD605F39D51A0485105A71ECAF9C7EC0748F7FE5FB5C4E90F1A59B1E31F74912BA831BCB9C95A315008F4C7C72D8AFF51DD09D9E4738E72C325B128E03F7D90915066AFC3FDDE335EBC4EB34895FB9807731EE6E123A28E815E5927BC9FEB02AA960308978D8DB5E131A22CD601D88069D145D4366FAF97FD7B71F4B39AB73A97C715BEE20A175931D7108AC1FCEF63CBE82D9CFA3569883A448220CD92C433ADD11A52F72303BB4A5D1DCBDCDEF605913D8D424F513EB8920EB864641B5833A39839822AB8ED011762756D6E16540D544B5CC8D9F8B671F19DE2BF7ED74CDF8EC9592CF1FF61095D0749A6404BE49AEB7434C75379DC02A87D213FDD6E0E6DA751657D7D221BC5EFFC8211F6C86B0F77096A81B1F60F51C23A5D525C3411DFF07CD5FCD54A60FE7AEA7E4C182885B2EF08BDE99995121FCDD5DDB0335DAC07DE1AEDBC9E988D7D90CD81D30E6C8E598BE6743D2853D975F236E6AED206846FE8F6AC9FF72C585606FDF6C25F5CBEC0C47567F389D5F317DA01F4A801FA2E2CA60344EAC2CCDEF9274608D8EA0A0D6323A1510FBE7BDF1EB8C0F580DBD3BAD17B268BB6E232B109504CFA3DBA305C7F273F8FBB7D8880303492CBED0B8AE374ACDF582A945A1B1D2000E71FCA445CAB59EDA8977E5595734A508495F2A742E30A006D383FBB6F83BFF1D0DA35805B6CC6A54BD1A7C3BFE81DCBF47021D6813B0E28000AEAA0654D085A9D5A0F0E0BEF802AFCEACE79FAB3F85E09E968BBED03B00AD50D079D9290F7E18904ACA46A2F0472E64CD16429547DA8A35CB1D9D532D4223483E7CDCDDD9E406B4920EFDD2E134B169A1DFC3F2AE54C3CE78A121F9F46F5D7BA6BFDD9CA25FEDAF0B2AD447902DAB3282AA9339C235FFD874C5E893E7E171CA838678C05936F9C9F794300DFBE63AA842A3B9541B07EF486C4823EF1EC56ADDA3143B89052D624EBCA9DC5A3A68E19F7E50E4DD71F4B111B24459EA8FB211053AC3CEE16F0D2C75B68E6F264A4E2874DFA99D6C6B3330B634A65D1B3617AFD7C32981D73C8607996F107211A7F37C6D6FD1D72B56432D66A8CE99E30E16847E549E54E7A3EFDEDD39741A55E94B1B735238093F856D8690A813E0ABCDB630747EC7A9D4729A6E0A70F001F5867E9AF613E9A0494BBBAA59CD1D75C83265E494530711F18313B0643890492BD13B49296827D7444876A98DBF99A6FDCFAF7883E02FD4ABFAD610FDD2BC8306377EDBEDA3EFE03041101A489051431B91BECD6E9DAA5633C8E99839DFE70F4C156FC2B1D27ED307757E0335EAA699C3FBC43CF47E520CA1404054F38D13CFE0339D87FC1440504AFE91AF4088820F7A1D8128ABA53DAD634250CB0C467592C27D1DDF7C64E7E5308567375FF73C02951DAE125866C53F845852C5008A69DEECA708E5A621FFC81C3C932319D15E867AFB67B1B1E07B261ECB56A013C441A7DB94523F103E93D95A7A0FD95141A6342922D1A7130ED95F4B1FED18F3FC61315A1FF0CFA66382BF10DD284AA4B54B80FC2415CB8AF7F3E686AD0664C21EE9F20070F99A8A44A5D51D8CB4BA010659C3070EB3374DAF2168562D89FEFB10100670663E71D029C2B09107611C41B202B0815DA2071256988918DCE69B35F46B8AA4F11DE63CE565AAA1172D7CAC8296B9334FAEA08D3BFFB34264D3487ACAE3C9781C1664E800732C387F9D65C152948FACFABD175C0FBA3B45F9892F8E98F2BAAC48E304EC9CB9D2A41487751B8E37F3B58F66710EA2A2CE02354B85E56EF7AEBE52388", - "F2BC6298F0B96E3B736B5A6EFF22ED079C8AE2FF586E0F4D53ADFB17300D11CA7B8C2E79C0877970ADD0579DD90187CB8095278FEA5F4BD3D9123D300100AE63635463FB5019926B9B53BA7CC826A14EC4B5AA5E9B6C72685B4517A4564028FB6D5584994F8999F9AE7E59D4327FD95C2A45E83A63E9D9F04B554C8906E0E2095448F75DDB68C8057F54630BAFEF06232F7609282B1EC5D0AECFA93E8A7EF3E6FFED7F6E4A2EB8B82D22C5B9AA7B8617DC13B69386742C09C2055AE5C2E71E73EE0DDF1D23E4928D7120B8C171A4F4421DDDEE6229656295430B936F6AE18254A11612B9ECAED23869178CF6B1E6ED7430958039A7DA988C1DA03E0DF5E1D8EACB7C726A9108E5472329280184861ACFEB110ADAB5ED03ACF5EE7E806AB0C850AB7E2256F817883394177AC0E0EF5B74E27CF6B315D0F134B282EE527E32A762C1AD06991C733A7F2E23776B01EAD68363A361F28F381F6190635A6BB38CA9461749E8E3117CE4F767007E2C38FC0EFFA4AAA693664F30A5704D369C9BEE225890021DF8450EF25B28CC123EB178D113B07B99ADC4AA47FE0078EF3D750B2E600B09353CCCC8BACFF198EDD2B3C551C212D005CF33763875B3753E14B14F96847142410DAD4046C9C8340946D922B6EB6CF2D2BF3ADA92A492D2C43397716A4BFEACA01BF2051E029D5C664E4D9C3B7248A9142092DC25FD0DE44275AFFE90848463E7E68A7DC4ECDBD5325AEA355E111929BF700179AEBAE60E26AB2C6ADC3967AA55FC9A2BB1CAC49098C16CF85C569E2E4A146568C41C815C76629061A483AC30DD27ABAA1469C1AC6C527BBBA5BE8BB0541358FEAB34B1E3EDD7E37EAF307AC213055FCF44E65882CCC9A12AFE5F7FFFEF4262C19AC072C291ED636C3FB1D36D7B99F77E93A5DC2848B01595D8DD3C7DCB95075AC52168897126055E8EA8D1028AF2718DCDA34496ED6FD1D86B49BA42F77A714D65D594965A748EBE83501D963F7B8D3EF55804B4FD5462D12571B77384E3D23C77ADDBE7F4BF667CECE0717C7156623AA6FAED9C1D2ED3C46403F750951AD8BD192FCB1A7FF95A590D085E7A733DB1CA0A821631245100FF92A5B1F63F53A6D831EE041966571EBA5914D81F838FC3CC5C449BC39709A489CF31B7CB91ABDE6FC8BA6E4D41E048D5C59377EF4DE7BBFA2406C6F400232E6B502A10802B420A11316D93638A926FD0BE4A368A223FF767B11ED73E6DD1AFDA6508D4CA6EF3517CD3362CD1604CEC574DD35FABF6D5004208146C93BF179ECAE54D9794FD13C34053FEAE2E7286C964BF2B2371D9BA8AE3F0114BC138EB3C304102846E65E7908B40358BEF9F290038FC645979951AD82D98106440CFE2261C5BDB6BED587C19EBABC54469D6ECA9D9DD59A92DB30868297CECC90AA8228E28C4D1B074881B939C60D8A4530A193290C5E5399FADEBDFC42CEC5FC2738DB18FFE9FB20B7D443FA3F1FEEF91E65279460D27F6308B6B0F8B450452DA56E81D37851E8D589F9B0822ED525BAC86575FCBA54E67BEE4512A7F215820E1885F79A5406772A8241FF96533C644B1B5200FDDF4CD1F270E6EEC77324DEF0150183CBDE7D042C33DC0C27AC6F17D670D379AA778E6EF48D41DCB6C9F0F7C5E57BD0A7875D4B2D8E31AEBAA58AAF78947683E373AD517DEF236B037F29C2A09AA4D596609B7AB761FC8D7F566A6BC8840CA626BD36B1D50AF74342BE0B54475D0AE3E30CAE146306AA540E0D63AC325252DD66D5DF50AF7C1D3A651E5A145192E1F05FD31AD2F37719B62DBBFDEB84EDFE0D64490", - "9DDBC6F5221BD70BDA886C59D62F7A95BEB41276DC3B5B505D883DCC478B697388421D5C217C8DD2E56A4130A28BBD7176163980EB820899CF74F3074DD7E74A77B54677A35EEEAE93C32D44EC4D2E4196366E40FD0C2A4741575ECFB8FC927142229E63FAEA97C51E12809FFD336BCFDDEA3FC03A1FE99EA685DAAB6F27DA6BACACD5D432352FC6FCC323EA9BC72FAF2569A7C6D55E1260DF0963EDD6CD3CCF97A033F74201E4390F64F06F89080C830986F8D6E90AFED3BE6A54202A59ECCEF101E5DB790E997918DDBFA1B160D472490F3CCC2B0E1C10AEC61ACC1F36BB6A8735AA86C50D2AC986721C003A2A8F1056BB9910F5A8D62D358DDB31589280BD14319C27A13D847D84C02A039B869B52669DDAD47CBEE6892E2A881A020867405FC1756DF2AAF2E5706A16F53E1E459BCDC430C26403F60B979A4D74F78CCD34E48321E67A8B896A162C873CFDEE8D58BE234C34FA20FAD472F0EB570F5B2BDABEDEA0D0483176163E20E47EBF51262B19442016EE5867BD3345DAA7CADFB2BFBF14B4EAF986951B024D876150CD64B7B0A188CA79B122F274FFB39F1EF88D5B9D36437AE8BA43770DD69E3994F8CD673EC3E1F0A51E798271AA7793CACD7E53E27A325193A9B9FA33ADA3BDBDB9A916DC8BC6188C3D4C38848E3506E38621DB57C2B0FA80BE5CA34C295159163F23ADC249BFB1ACD94FF0A42054C1A2C304F3C515B8B44F2AB1A760E784B95D9FFA905EB5541D14D5F12B4489403645A15F004828AC8FD3D8B44C5C070E8A64BA086462E5CD447C58E0D96130E9BA3400CD7AC266AF3E3D33DF214D3E98C6B7585C552979738879552FC758F04B122889E81B887B653FD7D4A8A5CCECFB0850B58CFD4BE990FAE223803EAE972D0C65A97960421D3FF5B2B75079AEB42A92E0D0EC2F04967C91CCB84FE6E39B6B136CB64424686DC6CDC4AC39C26BFCE81478AB6429D4E9B4877EFFC8740FCB5D9968ACF8D69C771E9E48CB542BA5BBF0327A4C55CC83E466D6DE0E639A54576D85A44F305958A325CE98A45E2C227AA9E85BED652F3EA5CD31AB99E299930F5AE92B12E10D597F69272ACC8185C1E83412A67CCA39DB06A77329475A3A87A1D4586B191E2E8E7C3EC39171CE6E775E7B369C8EED0B2E74A7233CDB5905F6AAC099820A227B6FA0FE5057CDCE6C8175F4CF27D70EE76CC0D769A324AD66D013A3F699C7F024C22C03B353177C3D721EC56E472AD6B383A653FFCD078774C728258146BD8D928B209C0A6A8CC60069F160D33F673C139534362B58E065F7D1176FE95F4A6DB7CC75FAA408C4FB09B7026DD640BB08945B364646D9154D00CDF5BBE432390607904BC3D70A0207F696152CE6FC5A0BD79625E437197B929203CF028384558071B625E0F8801EC1B13F6DF17EB8135687F08071DFC3BB06C8EB4ED296C821CFDDB7F2779B0B913E623ACA6E3C5FF023C58EAAB547BF1A67EA020F317658E1328FC845F65464D2E06ABB63F678A94614E3EFE281E41ECD6C85FE10ACE427FB1960BDF06630B20CF0401F450D71D3FCF0C477682FE342F5511DE926AA24E776CB9C798058A7576E1F76ABFD2C86B8C741230D6D95ADE980ADEA22547B88E607AAA8C3462FA34114DFA46046848CB10482314D1240516AA7EC7160215A54F69EBC39FE4CC97EF710BB7E8B55F9AC158B7F9C87B738FD993D2F0E35E4E9969FE5FC4B301BFCBA8A28D7150602ABE7635A2FB48AC65EA29B829DAE037D8711127F80CE85BE003B4F94E958E493D7C2236DF970D7DFE8495CE083E79B777D44F96C6C", - "33282734E9BBA791CE9CAA5CD9F80DEA9EDFCA4E3F5E32FE046FA978612D25F79FEC5DCD026666C35CAF0B5A682C9FC6C97F54BEDC056A6D900DAD88CBCA846702B0BC435DDD5ECEF1D3356E85247940A3892CB61BC8FBFDAACBC1DCA9208DE593DEE6944822EC80F823B2ACEA3FFF66E4CD6F542CED77C81F29F144C9D0FCF3B61C4887C6B42EC97C83ED2C5DAF28CB8C9B352B37255F54835EEB978966A14AC91D58857CB7FED677EB87F8556B343BE0056744655B6D97615F7F32BD4A537D8D586F477EF6B2871AF0524F71763748C57DE63D62D6824EC5075498D492A2C621FCDA2A5540038A50E6765ECD69CDD45D10153171DECB85AD45A8A6D3C609E350023C32E1F72B8D5E1AF803F68E288CEB2F5CEE3F10B7BCD7FB15D11DB3445266BDA913D5930776EEA4446337EC5A50F9E4CB230BA735B656EE26BD6BB5632B907CB81BB65EF4D85BA379E4C164DE83CDCC023FD458606E09552303B8535B63E37FF038F2AAFDBBEFAC8BBBCF04EEB41BF126C20C533DBBAD8FE10771F01BDD14AE113760DDE4C0D71FC7C29EB8D23D668E401B3A026C46913E2F08DF8434FF64B48036A37166F32CFC8747F13B656BA6D18300935195D0411E8B24E1F47298AE9F9617DAD3F39C4251566CD92A64860949BFEC05EE2EDD7F2DA0FFBF3D3C9F5A349130B7A5BC5B839000431D00FFEDB344C0DF86073F73C6833C091AE132D121F4568D011BA0DDC27DFDA5284478F5AFF037D89DD8EB9FB0EC066AF20740DAD8D29C1866DA0998E580BEBD311BF6E3BBB31D89D2DB162A680D2AFAC4903F9838B616EEBAB56C2D0386C65CFCA946D33073684FA119B2A6411E1786C723A466C7070E58248ECBE1D86C6D6CAA199944D9944BD6E8B108060B612F8FE724742DC158BC1E5E3F71AAEF1864A7989CFC68CB2396D010E1485C3238F6385D68E20D36A4D3BB8A5A265E686DF558A73020588EA16B4B0D3F74916038A9954F75232087822BBD8831222F7B94968C5A324018192A6377661AD1E15FF05AFFF75FF60B60C5B41C08F001D85A237443EDF3E361030FEC44573B044CE66F7A036EA78EB83E1863259BA363D517049B13F61956740B1DA3CCB5C9EDF190C89A2FE908916F9DF9B2BDF0DB50D032FAB059309F3DAFE1723D8031C93F9CF657F17D1B214492786F0D297D3C4C01A25DF2B1C3892B6724DC7CCA704E9AF0163D37F91DEE0850D9F2AD4860BBD2266FD7EE4E3D56349B90155BD843EBC0899FAD39C67050B5F8A1A9DB38EE821EF7561FCDCD6F833DD3C9FF3C5D978BF7E70288BBF665F4F20260A74DD0D414B3538FCA93671DB4371F2CF6AD94070014BCD5ABAC89157836CBA9A34FC8D84090A3BACD7D641C5FF58A5E1489E1D2F410E65650AA30D7FEE4AC3AB37D5AFE208EF3023E88D96F4760120DB5FC705A005976BB27F580CF5C10988BD2221507F8A6BF84B19CC3BAA186050870D88C6B14F98E56CC470291FC96AC5BE10704CAFB10CCCDD8E3EEC9D58E448BC655A0A899C2FB39073CF28252FE3FBC6BB61189B154EEAA37A797A8E6F329C64DE5836EA44F7FE04837E343963FE89B0624779212F1E5E399427ACC8BA83C10F3893C7551FFFDB62BE893DCEE02AC893928E81A080CC2EC8B95C4FEF1A6B65723408F12F6E3B7B384B149F4002135EF114B67AA3CCD406A78A732374CD7C72814BCA01F4D44909E6CA1245B25E27A67F2350D285E3B37218495CDFBB9C7FBF2C40FE31C57702519B5DF1D41D85F48DE4E46639104445FC2C078CFC853B25BDC3E4C58222B2F2C5AB40F5906C314", - "6E2FCAD2FBC021102FBD4F992C597E4B91D2AC56A22E8FCA938D9C74533912782F75670F31BADFEA83FB93A0F6D449092FCB9236F50446A4655586FBEF31323F1795AC3216315BC9F4C92FF583AF7E977A996F10989067975A53E153364B59662B6CE9E1EB65D6D69B9EFEFE57ADD58A7921506C2BCF4D51A01F79A67D41436B519D314D1953C6D133305AC06A45428C0D6FD9228B7B9228C3A2C03EBCFAAA09B9343C736BF99022D1CA0B5C25A6179EC0ADD8AC95E8D6C00D6273AEC61E1196741DA2ED9436F353919A8D25BFB8234DA7A2229CCF0FDC4C65CC6C0374A4ABB918E1B5BC7B929F6554C568DCEA62D5289E45284DFA975D5AF56609EF4DCB3CA54A26F100E00D48446C4C35D1D911CE7EBECC58347940BB411F475ED18D8A1315C069C63E59CE2F69E6F7B48B005107A69EBD9715303563F6A217E2ED4CD373648DA437E10754CC5636790930947650E6C5D1B3D1AB853A52A89D208301C54F8E7DA8D419559555859AD1B4D096A1805DA251B6767DC2C0D917919E119E71CC78A884A24F5061CA1A999DA65AED69CA02C20B6EB163B2CF435135D3B34FE6EF52F3AB84DE084E37958BAA4EFCE8165E2F5AAD1D84E9F7669FEFB6E60F1B9F69C79DE9296B7A01BDB04CAAE8E6A16ACF9A119A8E577919CB22B58EEB7EB289E708F229ADF81E2350B211AB48043A491D4CEF1721936B71145F07A40947D2A89A584D5D0A708F3480F0892E331B2B73D8B7D88B7E85F73DBE5346D801B1904CD41A8070A0DC74073217AC415654F4170F42314AC0AF4213CBD28094F8C4FFAC06BB0114B2C1924A4A1B7655965468574845864ACE82B8839036DEF45E88F341A5DA37A511D583C51DDBDD51577488A29D7663CCA7AB2AEBB53A4EEE7F38B8637C96CDB86B23092FE0CF669858C5374F6F078FCE4E945FED340903FF26A6AD6C408E390F08ADBFCA9646CF224A5410D0ACE93380314541982A8AB6443FC358B66B027A15722A0BB7C61484CA65A62E4496053C947D5F4744B69B4A73F7801453FE20557224878B8FBD318E8B572911D09839FABFC267416B4E2245FEEA6967677C1C57A3F72E76BC297CBA73AA729B890E90A4B29CCAE4DF5D959BEE30D836C859F4F67A06B4A479954CF20C7D0639D680EB61A2CA11B007EC9772293EB8E6525A56CC0F380ED4F088D8CADB0B95BDCBC84C0C746D4DE3307AC7050FA2531FD24164D29294D492A07024FDF1B988060FD766128120226E63F4973278DC9F07FD5699A1313002CC9FA7CB44A72C9C9D740AEF0984D7D4C5749F9071138BF93BCC6DCB601CEF5F60E4BF2361A083D158BE93134DBC1D4FC79FB866B0B215E230713137EB6BFF388307CF2F07CB07E974C8A874EB20B06C843579921ED0839F9454DCAF71BF56387E01F3DDCDBDE6C15C58BEEBC137B673F122179100613D6708B6B16AB750A3A311AC85E795FDBA002CFB2A9D9734FEE1922D984DA9F76EF65EBC9F647B280B0433A3C2E73B08A3669C78CB9885F65E97A6B4D64D2B3A29184EA87163B06F267FE94714977525AC061BC54F7FD95CC0C4285E45D75772AA3543AC00EAA32626CE2F9DC48862657C1E156E08136F3B1EECAD329072EE4EDAB16F385D736AB806157409496A9CBFEEB3F5AFC91E2FC5569DA2C5DF20FFDEDEB6BB57D18AEF1DF03C7D5A16BACAD645772C4C016D147EC11EE9996D2E791C5251CA8FB7719F2093DD2E4505B7BF320204556D06B91D547C9C6B0B19FB57608934D4A4F748FD07F3F57CB108A310319F7835C082FAED651ECA42EF823AD83D6B22375B20", - "22C6D5CF65DCB08CFEEF580D53CA6571787AA81CDD29C4918F5EFAF89E285A37DA51E01500BA0192D2F45573533F540BB1569E27A8865FF94923B81AC26FAC1DD03DF79DB5B5064F84A2B15E0BE7CC53BA875E477159D0352CBFC374B07573FEC884A699E93497514E7375E49FF5D9D9DEFED637DB89158F30B27E802EEE4E806FD61A46F8F7D7AFF89C9101A9375F73A2164C18B0109CBA1CADD42E13C9170378E28382EDFD85B80A02469D9A78637494BC6DD284557ABCD5756225EE3B26C7BCD597E9744FA1674C5088D3301D779B1C3A922A0723AE1BB253EF2BFFFC99BC8BB4CE539BF6D2D0951F6C76BB001B48E52387C95E49FF1A9D1DC12FAAA2B967754113FE59822A1E5C56A6053F73A2CAFDB0CA0B58312ED54B4F9D1832FA089C5923133F47EAB56C56EB7AF20D8006EF8D9674089CC49D37E82A1FFB88C97C3267569B5AD1A57CD67A0C94219AAACEEF99A11B28D01EA4329568E42A7E717437B030D3B649DAB105C700F30AEEA7B82A9759ED54F890C6E9B2C9F3F1D1A7A14A245817DDD4E2343BFDC5DE774EC60C5C41362805281C3019CB2915182F525576B3BF537FDD5236300DBFFFBCF8A8C9489B1A119D66181A79AE93E7DA8AB81A1A3E8D5A888F5144AE0DEA33ED8B7B6392B789EF9C544F876D179DDD822E3906F76FBD579FBE27B4A2752D4878962008B7873765B9BDD3FA581FA192C0C422C15153D7FF16F2732EF68B66042B5053E458518EB65C66E3955CCE4AA212ED4980411D3E4BDC6918B30BBC400A8A338DB982CF55F2C3B0C3DC6D64DF10A8CE1BC117338DA3987965A5EAB6C2E8E368F59C7D9C77750717B4440AADFF57D0EADFEE7C1A92EE72283D425BDB0CFA9F3BCF602634BD8526AA80E0247BD0A043D277A3E575C1D1EBDC0565330FCB30C63AD02F48D485AA43358D957ECBC6991D0358AFA953A41C67019E96576BF88122CA76D2804B73EABB88007A121BED76F33AE0E0433EA74FB2C7AD672D0DF5927D87BABFB30989EB91BBBDDCA40ED8BCAF7684E8EC9D1017D6147039D3C3423A9A0081A17B70F56FA300E8F2F97C399498F4AE85FF2707B50E3A4492BBEF19E14834B261F700DF4E685DEFF476ADD919D5A15A7BCA06F382E1F0649B6934D70A80416F732552872BEA44A5A42D64844532DCE8ACD5D20039D397BA9EBE04EC4742F4E2DCAD29F89E0A9FF572579237863890DD13E7168CF2B4CA8F6A36B49A5734BC85F811087B9541605F44FBEB3313D3B56EA13676CB69F4FCF14A1BD285455BA516F20B2B0D3E8922B71C0731F2BFD1124067D4CEF2111FB754CEE5AB73DF629797FB5E012515609B1E9A2085643691BAE5E4A2A52E904651DDB340090EEF578675B778D1E6EA868FC1106F19B0435BB464887DA311545300841E10441E9316656698C879089FD009D3F8F49097B6AB6AD2D744AE79F1D15F0DADCA70C1177374ACF5D07979CED4F3173FA4ABF571F6DF2112E8AB26C257D6861923CD92CBDE33683F27D2CD542ADC623230470FF7E950475EDB761E57ACEE78318FD60325B871936A51FE23A63C9B4B7DD8A72556311877DD6A8EE053D6CA28261BD359C0C997F2A184270847A13FD3C952741C5D1C47ECE09DEC3D8E0223110A627084BF826548E60886D7EA15C585F5A16A813F030EF3D150FE7A4D271856623D96742E848F7797526238E56C102191600AF7756C562A9B627B1F05B56FB2C768F6B57986BDBA95816E0842759438E262FD9BEDAFCB594731E9A04512A22D1EFFE104EB8F7E502B94FD846C71004E534FEF2A30812F84A8", - "E881D91D5F8EBA0700605336E6BCA6A1B1BD1D58F39650CD55F056FC8360EC9A2CFD0CF440EC2C6E98EE88E6B31558B838EC9D473F75CE2FB04155330C9FEE2C381F872C3A79331C536A05C766124E69AE1EBE9425387279FF9FDCD28CE6569215A65F678611C96103D710E45029521D6EF7D5A2AFF378C9C26ABB52AF1ECBBF615561932791A23A3BFF2824CD3810EFE7143A79B4E14132E306C48D9B2FCAA475A7D2AA0BAD046314E5BB4839B27FF4ACB7F4B3CA8C97CE976F11DF6DDC71144A600DBF9AD43B6E471791CCE636D67CED546A377D786CB085D0E4E91258719A9233F342180C9A827FBAF77C8B5C1BF72E9A81E4E4908EEAD39772DABCC8CC0BEEF0812DEDCDEDD7B4110C6A0B89484C2F0F6CBAEDC219BEBC85903CD03AE727B1849735F62B385F4D5CB58C527CACDB3586AF4525BE1CE424A0879546505F86E324EFC4FBB0B9E86EC243432866DC9CCD4D9FB258886EA75AB006D87CA5C10B5BD0E0CC4DFDC6B152D65D5FB268DB6AEAEFC9EDB4954CCA7E88DE2269533D54AAC447124EFA9BA62FACD2FA914885C162D59BC6BA2FAA3389DB9AEA4C350843B3361C9F343955AA616E661ED1A137EC0BF957BD7DD7105856499367E91849C99F0F7138CC7AE120CA36164658BF3B67BCFC1BECDFFF49606448AC8B38619EF4A997AAA688D3FA7FF169B8BF537314CA8ED865F395E300E5AEC2CBCBC5A8B5AAA31C811E3968FCE32B82CE5EB1EE839134EFCA68E4CC4C2957329A7CAEF675AE2F990CB108CAE8EA5EC21F6C442CE1B818ABC203327087146D67275300868B95052261AFCCEA3EE854F38DE7CE1FA5649AD7E9083DF2DFB3ED4186244045390F0C843777A677B8A82B69EBF43D8FD24C9BC0792A2336581F3B45EA6F8BBBAC89A0314570084D683C76D32C2B0A6868A428DA7D72D9C6D37D99BC05D14ECE27C6C1E3F849332C1CD67381B6CCC907E1A911D3C97F1B40CC11822257491AC9C22642C4FA2CF8754E6AB2574AFEC65062ED5C1E914F8DADD52ABD7A9D74E545C362880F38A567BC3E6D7BD7156C87F698C870008C2AFC78F94354C2DB9833A0635E2C63E5A47A828610E2A5E8B2F914306C966D1EF8222BD8FDA2DCADA05991ABADAE250B942F8FC82AAC026696D62BFB27C8731149C49114EFD2AC47250E0454E33383082E7826569AA4D6F5661A9968C1A784E0A080D6BA7F8956E37AA55C07257AB5971E03069E74D245C4A2A0BA0BA397376141FCDD486B2B3C865E97D1CC327E4E3320A131A91B61F5A78AEE77D1DA75A1F121D777DC4E3714B0B515DD96F477E9232472353FF7FF07B0C23D1C88F7DC4516C36B3D1820AEFFEE62EC3DFB6143630E1C532A4FC9740369617E80312BF3CDD7E3723F287DF666A34FEEE38B3A1461E1B5FA03907125359025AC125D6E86FC6AAF0223F83F252AC0C6D578DDAA8A2841DC35AE6B6DAB2E7A31EF4282DF4E20D471A3A8B28EC6F510453728F981D7BC2F1BC2A8E024FA65BE18AE8CD272B05403E05C6006AB1E612CBD9F8A71C50D618E9FE46B243AFF2529F2A0FB42C7B990BFBFCF6C4CFF59DE230EDD411BC93C398C49E76FCE8EBA3C2C93752B38886162745ECF4F80EB59AA3F3660C4B1D4B9850632548A6D5A9F5A8DFB5A74881C0E93E38AD2FD1F0C23E66AE4631F25DD442E1A010D6A04FB73559C76CB30494352B24FEFB1E529BB6407BA7B68535D06C7207B2126A585BD59C43ED1E36AF6408E33EA1CD6F43BA41401048AE9C5638077C8AA8A033F0C18E5899A6E9400531731486774E30C1A6292FDA7D06A6A48", - "74C4DB6B3E8A4BDA889FF8264534407C16B05809DB70004C8EEEB10156C32686ACC5076D21A2F583EAAC92954996BFEFEB1A28DD699B55B5B94A122A1349C58DDFEEE9D4270368DEF85D86CCA4FFEA81880739A934BB8831AD75794986D60A92AA6DE661ABAB1010F3999A57A53F3868026C64307C47370E0B82FCF8C02A3155E787DE359624510D5008E229E9DAD0005CFC9DFDBE5080BFD01D7342E570360E411FC27146147EE2C72931D0577CE6D7183386C754A6820BA97BDF080F6EBD063934E13B005CADA4D2D8492E143402C9D1BF8A04077C4BC7314532474704BEF9D24E4566A1409F085C76B65158E4EF6B30141DB42B0A96454E451BD63117428273D3629E2E5FDE4D9E53FEE5F9EA2F111A0FE5F50D2B72DD26E941A57213EED915147473D630F7556CA46FF8EF1F0C88E6272D6E95FD3741AA675BB0ED839BDE162F9A308B3B092663B1963221708404CE8BB54F61BE9AE987344228BB60921726D90FCC07D5F64BEF673E06B969511E111F0293BC5E57186B283AE81CB2803363A1266E7A78B47F5A35AAC2FF0B3A348DE73C81D74E7868683918FFAA42A91B89E1E2AFF4BBE6F11867DE292A6FAAA689CFF87F4A629FC354ABA202EDBEA3F08609D1A4C350A7BB7376A897AC15A1B0CFEA0D35DA71039A97B8C99A5367DE46C338D75A845A4CC7CA292DF57F2AD8C5E20D95670E3748E8A1BBD3D728980DED4FE0DEC90884B7A528D0B4C27DA315195B7D8D8CCAFEFEA3D62AE34B40F5049D06C3AC92CC59A85C5D5BD04DFE0CC89A7DD7A1B6AC4F5F3D2AD8858B83C761485B77F6D512DC2EE1DA402FC6158C644F14C2F6274E8113B453F9130BB6C24E36BF84C2942F8B28A3914110BB3D48DCAA3ACB1D7A89769E0B9048566671760AD83BA7F7209832AC10FDDC299F7F90A3744F72ABFBAC19382EDA24D0BD5859634EC3790C7390AC2866B1379ECEDED50D5127324A4EE6AF50D9A6826DFB3E27B9922E4A8652526A6DA29A4C2B9B8465E3F99E72A82A27645CDEFF1C42E77359FC913A9074516720BC61EB171AF90AD427A574080970282539A05471AB7AE2EB027DFD3D496BD27746D0ABA30EBD9D13AD9DB6D405CA19EEB90CB088D9CFF93B20DE07F86B978C7FEBA8AC29FD4E257D23380B955CD79E93E3135BD14AA338FCA16560A123131DDBA8A2B63923860EC3EFC2E0339015662C3DF1E837C879969573E0DC4A63EB7C0D6E7419F079D4CD05A1A9791330F1F1B7EBAD8CE76933D54A224571796A3A046116964B98A7EB5D9FD8311CDD6BCC9B63F2B7302347C0D3407219228BBA73B8B53DC3645EDE1969D345D8C23E691A58370B351BD6C86EA6EC9349D524BD05D07E68F853FD9214414507ED507F0E3CED126F95630FC6A3B40152A318278B8605F30C389C1826478635753FCFA9D227325463581DC51EF4AC47E1C49EA005D5AAB9138706671D64082F6E2BC39A802685BD8EE8001031F7C56CBE5FC68CA5B14109249C210B4ED7B9B2ABB4D4E83C9EC82911E9CBCE5DFAC8D4A1A6CC81B5378D29E8E339CCB31B85D9DEE3080ED75057CD5EEDBEDAAE7F3CAB4BB1BFF54042E28C8CC79741FB04246ED66B3E34D83F08D98D7070D3D6A032BA442E46CE38F45957D7485B17B51C562B94985FAEC8362A8D6DE43FC0EFE1529E662899F1D21BFB643C22293E0A0F2E1D40EAC1934A0421C1617DDEC3D40A3AC9EFAF0F8D94FB7DEA085C8179290FB4C917C7D6F8B75DA8790404F8191C0EEFCFF9DA2208E7E5D382B5A9D1E72089B3C4976036AD530BFD31F6D08C2CDE5C26E68C", - "13AB0304EA5EC4D96147EB5EF8AEB8FDEEE70A62E36686ACDC275D2FCA1ECFCAEFDC4F8CBBE5BFC2BBD343742EE011379103102BC11E824732D147FF93CA6C9B0A503C49BB2B621B47D4C5971643EFC01E760EE958A9764397AA551423EFD49AEC50E22FBD9AE99659E36341361286D8452EF70C662DBB3A421898FB34EDA3314A1C7A6AA9E9B5A6960156A549C32B91246A9CDDCCFE0FF278C3285A5F20081EE6FE121E3CAF922C75915DA773D0673EEBBB268998861C3018642A6A1B1FA1DD8DD54991254067B4E9BB95D1AE807B8A41B88B772B5590FA9F0D71093854C213283093D5EB9D4C7B1D57DEB27B1E2A1F0CEA306B28A5DD3D1B23EBB7494AF61F771052798C6FA104940EAA5698AC24910DF692D5C89C29F318E090F30CB12397B88702418C467EAD9599670DA2F993D5B6FD7A9A43CB89274719A2F1491FC3C3E1528EC00A6D3117C5D2E0CBCEBB7B91881CB7540809B5B9BD4DD37BB6B94133504981829410B4F348A5A7DC553F089C5F759F032F0F45C13991C1F442F2DAA5C43C5A6815383091ACA7101735A0A3D8E5E88A454067F8D92C4090DA1035B7880A303125ED48A5E4EBDD9308BBD45B77BA6B84093210D9B011E3FC5313F2CF1B20A9C08D3F4D8AD7003B32A49850808F1B78115D1E727A7BD387D2D4C4CBAA4CB94CE71FF25229B37BF1D671CA50A04EFCACFBD980263EF16015A97909BAC6FE4F981B96AFA2692CF3603C5C655BBF7AD4DCB06CC3BBF8BC819CCF20619535D399BDB5FD0D40CB261FEFCCD4B0B0FF3684FB0D992ADF1AC6046BAA8C8E0F16B6E691A23DFF7014AAA67C7F84A9429064139809E1569145DF3CD8240D49BB9D9FEFC2176C697D9950F11D56979DDC01ED19EBC9690893D6D8E76041BC4FE35982D5C535FBB883654FA3A2253D52F06B62022744442D880EF9DD4CC2141DD25ACF2EE3B26103D6A16710D8BDCD43731A59DAADC1B40092D9B166E822A8A7AE0B4323B8CEAED7AC3BF3CA6F24BD79A58DDFFB59FC2E5FF634C83F6F7B03441DF9B5763FF827D4E74764C3E0EEA21ABC1AFEDFC2BB9F73E3FBA165A7DF3ED9997A588CFFEA8E3C193F505C741C1863C3437A80B41B7668D12B0DC7CDC6A61923C102D3D9071D9937F36A39484ACF1A2497F238E78A9D8C9C1B96CAB0AA15B643B81F6C5439C2336055C8DE4A392B8C110753E060CE92325C3B67F0610D79D46F2E7FDA96538D43B09DED1D647E8289986EDFF482FF7E24F40FD489E4051F7D0C9267E934ED16B13827A8C3D47C192F5C5FCF6A8E82521B7062F6A23B463262E425F4820AAAD8E23E85DF0448B00533FA29FCB815BC83AD29B32D12F614AF4A6C60F7F1339E639706C4C671B71C99B55056832544A23C996C6BE5230AB5D8AA6B89A0E05B4235CEB352C70D3787F740EA6B8F05CD97409EEBDC9F1F98E428AECCB124F656EBC316664376CA4B38046E5640B377457EB82A5CF0E81966865908DB4B1E9B482F8740A470E4F5F0333A11E1D67A350ED7BD9C8306186E83FDF6FEA9A09BA1AE266A24AB6D3C192A4DF53D0A627EA2A2847AAE9D5EAB2DB183A45632B2145C3A2FB9C4EDCEA521E4DFC5AD34FB6E2CFC2E5C38B30996542C09CE9542E2F692B863CFAAB27FB549BA99A1DD77CFAB7E26057055737E6D08E5592D17DA8322B0DB650AFD6ACF4ECE23F1C9613AA7670302428512238E608B6AF8E0862452319E3ADE719928AFD059A58D39EA819F3C14DEA608F80D3C93E374C2170D2836E2EE9F600A010B97418B52CEA1592F4D6C4E91547EF019AF4BB4F1ED010242DC", - "1193230653E34BEC0CC617609C775D5DC198C2F533BEE5C3537F381DE8AD1995303FCEA2468BBE8713A3770F59EB4F58397BF63DD3AEB17BA59D1D906C853B6BB55030F2E0FC04C0BD746B755358EF16B44A6494E65FA26A294D25E7567E7ECFE7A830896D9CF2A8D97DD5D6FFBC521907C1677F195AE7539C564DAD1D78DF994A3F33DF3F0400EA6AD3A742FE3EB8A1855BC78F5E9ECB5F6E41A13E2411902BA48D0061D318C1D026FD379C5E4D9ECC3FC5AFDF0ED8D99E35FDBAAE7DBC9E228411D203FE2645169B3E8144F508F88D380EF8F9D6B6B7696CCB9041BC145BE25FBE39017DE8120DC3989669DE5B587E5F2C5C057ABEF2195F5E0AA441E05E256B5BDFCF636350777392CC1D5B5BCDD59C82BF8F3F885C86F5E6ACED0F0BA503944A9E2F15E8ECFFBC5B2C1444776A5FA7DC54EA0B1C9739E21E2ACD85DF739DD5761C17D71444039B3CD53EA47D67E8E8C505C39690D09E52127C8F055521EE8BE8ADC6479EC436B96DE2CF8784C71B585B1EC1475F16D92DAE9C29BE7375C527B1CFCEAC5FAEC37C3D892525FE1ADAA164E1E90680EDF0876A0C50CEC8123CF2EE2CAE3C35409ED5C5E6840E004C9F69918AC8B39899D0B846590F17243210FB32D3CBD4E3F8AB4C7C42DACB17716CC5B330B009EABEB31FDBE086602F370EE9172D66A8B4991CC56A0AEBAA3A623BB37EFFDDBE273DCA7B0C09649B1D0CB5F811F6A27ED3370D1A1E922A70214AD71C2668077E59C562DEED43C282333BADD38CF3B01E3C1F8A55B3822A7D41991CF4E4ED36D2D7AD71BF6BF100643EDDDD23B6C04486DF1193F552EFE21BD9B5A6A1D93D4459CB147647052906599533AF69D3CF1ACB1EB89EAF3004B2E4CCCF6D4CE8E3D6CBF8BD90E6D4637335D5939A3CCB8CBF6F6423388FDCC9B11A159813FABBA39263F337B3856B0A6B3102D920AB5D216FF4D370C836A85B753EA0E43E2D9E9442C9A4E64A061A0BE7CA61B67B0F012CC43E42ACD298B3057F9CD3089C59B39200E8B005772AAE2C2138172DAE25B7D54FCE9C6F8A410C50079012F069A9A7D6581CB6B2A3EA9E09E4F2C1C57BC9F127B4EF8E39220371EEFEF0254877B19B37E0785583683E5AC8062B438889130038ACD1F52098E5E4AEFC3717016321C263B4155BE8418F22E523F514B1F8BE737449A48EDB9F3B38D55E9C26DFD4C8BCA111D162DE23984DF208D5AB1B82623D2A4F4E3A104E3F84F65A020BE96711BA3B3BCE7E6630F8336B16EAC987E8FF10D97C62E9B2B1B10AE466451FB70D345A88A549967C367F6DC1C87D817EB7B4B0A5032E1A72D2078AF3CEB8116B1BFA0BA64F9C1352577BD9D0C552084898EE52AC1613617DB42209B5A8406DA72EBA89CBB1893E69BCB0E0058E4C227ECC507108152C248ACD033DB3C276E77D80AA7FB7C7D3ED6DA7CA79D469B1F2668DF1278FDDFD20CD02668C429CCB2D64E6AE7EA6C65A52B49D2A18EB48CDB26861AA872D74D51BBF34C56F5455C98E02AEBA0D3E658FFBBB82960205A1ACC2988D274E74A3C885F1E1F0660EEC75EBF839E8E3D5057F7C39DD8369F9BD6EC41A918BC8A42291384E2688F20A7B78A96746263991D57BE8BB2A516D9FBFA2028EE46CCA591086EFDA8C97B2DF9CD939D99A87A0AF0AAC65ED40B6551E6F84E699483CEF2C9099693B895C475C52C56598AAE7A9848CA6AF2E7970FB80768704209F117776AFC230158067B52AD83AEEE587F81014B0947A183F629D319FAD66FAC270A4D115F469833097897A40F185687084816F1D2CE615FFCDB27D060331F0", - "594886432182182A60A8457BB3531920208BCA5F9B84F988DEC9D71119DEFE0956740D55AFCF2FF33EF9801B2C9EA25E0565F587553A9DB639F3843EFED712A9FE49D67C197615E1930423A24D464A113C76A8545601964EBB9AF89E236A2021D25D5A4F71E592716BEA4B4F9A9BBD46A835D49379873CF2B0129E236DBD2E510F2CE164F08307C4EB11CF12AD26AC9ED8863B0EF1FE28D2FBE71859BA4340B13DBF103F6A1A855C4D51717B4B6435E6A34F7122AB6C214028766BD398C6A03AF19D67D7E9CE96EC95FF00CCB56851289D52FC2F2BBD6CF27F8D7BEFCE6817A52FC06A468C0BCCC6E27581F11A9394226D7EF8E1E7FCA24295275042F14FE0BEB7C1BFA5A1161FA57796F21C5860D6CC3C9F2D28F5C3EB0F18D27D9C512A4C7D3A3C8B55E0452405643091F679A9352E2B3EB74C0562DD08A45339B1517339C19B88D1E6B13E341C7B932D3613CADCE8B349EFF25DFB15B9306B0520006C72C01B8E1F5D625C76778DC8ED95D62DBCC655500EEFE96F90C8F5D83E4A9FBD2BE87594B6DE62DFFBC056824A4E4EB61B6E83AB9BDFCC9804FE3E2EDBB788BF3E421E62644BCF44B8023213A8FF374A14B8A1EEA61830771C6E2B48AE0AC68B14601D8AAE182A840F98198A8BECF4EC119EECFC5D7FB4D2920AFDB10968F70E65D2C8D5C8102DF73BF6AB44BDAD9B8577FAE45C83D76A3C6E425664131FB3F38E5946B47C0C9444416877D9FD7F3923C5EECAFC435FC17A806C13D79055844164A8216A605615312EA5792592AED524608BFA44DF569B5C6DA880DAB9C2B7CC0171C785ED77104E08B61C7B7625E80EF034EEEF7E13502CC6510A8EBEE8D7C2D6DD85A6DF2D13999042C0B3E78C0188A741B399E212FE05053B9F166EF9B876B17AB413072CE8DCC6004B99233B73F1E9C494B23457767C2197B101D9BAA41BABFE33224B2C1C112E1C3C5F099320603968AA648B2792E7D0F009C1C7C33D6CB5B94CCAA72F7CA5EECC827F34457DA961B39DD98A64C0DF1A1618DBA84681657E108C8620723F31F04728814055924B638319F13011EBDA0289A0BEEB732ACBCB71FDC411B9F981969023F6A3F8411D9D9681DA28DEAFFC84195A442340A537244E69989DD7F5A0F9A33D9ADEF27362321D4CD3A6DD3624D98E8DD1709C3AC48167D91CAC26705A549CD2E0C62621BC275530EBF37AE97458C3CA841E264976F2CE212462AED47D5A0F6EFB27BB657D47BF6BA303CD66FBB1C273A83EC36A4A2EFE2AAE0CE1FEC1B8740E83A73DF7A3B24CA22BBFE52584824445B2ED95D8B8A0BFF28DA14D382B8B54ADF00AD82B3CD5ABBD4935738679DE633243B4C6A6CFDAFC43C908492CAC991FE4000124E0745CBFC21FCA91FB90E6F1183E5E96F67240DCF790D87A569F6603B185DFB5524BFC6959F717891FCDF39C7B66210BA5837A5645C62777D83C07125DEF9E6371991DA53E79A7B5767B6FA08450A806B2E2148B50F9FBC79FC66C47844E3CB6EA74C7DA86F313BA8C54F0FAC364F5C0D49F2C10238D44446AB58EA8FA3B5A5F14ADF3B9FF1AA225BACB62F3BD6028EB1066D7DF265BD210CB4EC7DE71CF028E354FF81B76E3C621ADDE054CBC1366FE069ED6F99BB74DE007B9E2BD31D1A96536F2260FC137AD11C5D2C2108C2C8F3C893F4A6C4A7FA2DE0AAC7931FB85C5882933C128A9C3191C35FE3CA022427B6AD9447A09B6EA0AA9AD70916E9127900DF0457C6B901FA2740353988E26E4B9BA1711E451F375029FED9AC02564333761603E99A1B725136B5494538C88FA2357FD7D9C", - "9F4D899456FD3841B890A61EDAFD40C7B43FECF9D700EE269E58F40BF2CF47CC1C1EC7F28D78909A53C7B79C4E6AFD275BEA739A3617E8B3C3C77ABD4EB770B9E663BF154E77205ED1F2C5669CFCA18DA365B988499547B2C36D4A56582FC610E06E4D43E54CAB563B7E5DBD04CD04EA83DA72645F1F26422D416AA26CB2AE11C1EA270CF7E7AE3679FC2D69E012F0C950FC64A56C7B766F909526EFA0AC383E4A28CC5C52A26CDFD2C3FD2AD820EAD3885DE63114DF5D19A2EA6C2BB338A2171C73A7C10AF41A9E4F0E49142B363AE9D306378B3211CA3B0F21EBA2E72BC131459E9D05CECFC76D6E540587073B0CEA1EE973B56EA2E671353210885EBF3A6465C1D2AD12C89217F1ACB1B209552F1DA1543293D6D1D273C4AC5AA5A4B9D2B368AA82A7FF8E10259FD1FE52BA14F45A40F72B75AB7DA9F73DAEF5642CC1744E6550ED6CE2E547F33598034E8970A74D7B1D58FA2D4248186083BFBB8BC1A34C744B6F08AAC374C28B1C0F9E8C2B220C6EF0B5C0400D3B725005A711EE66FEBA353778ABD4552DEF9E5309FD0002FEAF1F3C5AA3753CFD7CFD62907CAD3B1F68071C01886748201050E39EB0DB18240C5D598D213CBC508B8F0EE7708CED659CE85BCA8BE714DA5A607E023F9609EA3D790501C4A9969FFCDC7B3E7317F6AA6B99CFC32FF1B74AFBD42A9773EB0615598C943BF55C1E8AA3B85D5D2EA2892CC33FA809D71621B02D141C74722397318B8CA0F4F9DEA01096234025573995DD2F915D35F7EBB6F7F3A9E83C2D23D769B639042FC669BE9778390A3E4404C04FC9991FA6860AC811BC07BCAE69756FE9DAB27B91B91C51892D61E94DB2B486C25D13C225810620023F1B9FED1E89B002B7B11A609FF348867E1CFD827199A5F0D6FA267F60F89B09B5A1D8FF62744B386709990589D0557F5EA477974CBB87A86F2E6E94B758607454E3937A539C85569B5E68ACFE4911CB053CE207394B686B962A7487516971740287DE8C51CFD26A14AAA3D974068D227089093812DE910649512D966CB97FCDED09F4BCF7749E16E3391B75A4846F65EEAABC5A1CC89B1D9D52C541DC65CC468B27493F76F6D68AFFCFADAACF20BD979CD63A42EA3B8961EAA2F731C6250436A5A739D3E015FB32E07D373FF650CDCE417EA85A6DB8A9A24FDF62487855DA1C807943154C162AE17BA4E477531100431D647F2D8AE76DEF070A0418D2365549BC66DCA95722801F3A77E435205E919B4B349ABACDB2BD111087B05C05FF01E4BF04F5685665B361D37634855BBA312E96F2C6314590E298770C3CFC4207A0FC944622D4CD7280CDF5AA241232B6B5E78BBE5C6684319AF624124BE84CD2F1512E89D6CAAB620009206AAC993A9F4D6A67859C20A8B9307D8F8E370F2E600A9B363C2A460E0DF5AC007EE110F4C088CFBC2EE82D623D5EC42DB739C2267DFC81C830244A6DEFFD4966480D6EA8D258FC047500062F42446230456F9B5405610863500A8AE2440A00CD16E5B6136B0BF1611345CE7D70319962896B3F5E69583F8D305B760E0ACFFAD762DD06C54EBF8075C1B0ED97FEF59FBB48A7A65C2251DA406D5E9E5F67586C64E5F8FCC805DA4F33BB583DE2D5F85A348AFF0215233EF88C310FD1343934F5AA2A2AAF8F58DED34D0E35D210FF01AB4114E18019A2F7D6927FD843F842AD6AA0E171DDDC2BCF6B49EBF5D91C35665D8F88C0924A453FE96CC06617D81DCE66A3C813F1D3DCD5C37E60BC672ABA16C2025C78E9A1A6B1CBC4C02249AACCF55862C538ECC42D0169B7E3F4B188F2698C", - "47A3C0CD552EDF50F80D3E5FE68A22F85EFBC41BEEB787E5CF0CBE3266EF310BA5E1B29A7FFFB0945121EFCFF811A1B7DD768D3ACFC21C4E6EA1EF06E851F2FB37A5F8E0C49F59A28A4CC2380A0C0B4043A7493320AF4E34A2A20E36A6BDD2AA49088FCFF24C84A4D53FD6D3B29178F921768F21C5827D64C125DE4F7F435C6BD000BCC1C95D0F82D61581049CDF2A34A27F2D9DDC409895B9742443D0CF74F8A7DB13CBAD88E1F1D6F52E4486809E20AAFBFD82B297B038BE774BA13649ED922FC67F6DB9F0864B742F6FB60E849F9A253E8B0B873C8501F72D3523EEF62C1430350852FD17177203DD2BD4065984190EA2075B5385E1D29226236ED894DD10FF82F1DAF16AF55F0940415685B3A58D1DF7CE0B0F069F33E6FFA29FFE6134285CCCEA2DBDF1B901A700765449D67C24766A042D43695D1F5D241974E62817FF9259879813F37AB1E8E51F6C654324118E411ABFBB6448E9EA3CF1F636D2142D65775EF9FE046B80F0DC1D1480158D603626F7002290058E62DA252328927BD20C05E5D3BB0CDFB6C60C04DD8BF4A3C9413241339AC186B054B34B24D9ADE710A79978158F1E2EA5AF6FAE9077CEFA4E335473D29BEEF00624FE6A9DEF0BA52464028BA25D9A9C1BC85901F507AF046D56B17CEE0F23433959CD7F1085481697808B99EE619BD0500B55945186A81B89A9C6B0E32F1D5196C4787BDBB08A6F1D79AF329B38304B1203E9B8093146B15F1207C7EABB020B72B2B92EDB95377D698F10CE7737FA3DA501E0CD09F3FAE9504ACC414E63F60E2721E759CBF2CA1E2671A98656707F4629626219E4F16D8A765AF3E75DEC1B6AA82622916E47872DF33689D820DBEE6EFF26E70F61ADB2EC3D8FC9A0AE30F12E3CC5E9A8E1A820DA15952401D3910F6F500D4CDB7D85401AA4C8F418F7E2A166B491D5CA3B415378891B359112894274F25E9DD2B391A96636D468290AF22FC6BD5C2E7842AC5A62BE24D80E6AF79C6F2118C126D60720601272FA89F966C812EB875052A0BCEC16D0E6C973EBB683214ADAC9BCD0541D32D33AFE16EC2BB424EC8BEAEF0BB8A3DDB18EFDF58EBD84B2DC8C7AD54B86E698BE762E73CEC7C1DFB290F6CC1B63F5257FBFECD9EC87D8DCD2FF393B1C1D1BB2EA9BC10323E6CA3EB8EDCFCCED055680109C03C5C668BB8848F38C4C3369A4E5C0515C7245B0C092F0B8525434468E775F40C4D4206B6420039BE1F695DE802DD718B9AE4FB41320C220F6B9971A4CB8E67C6B0CA3049C2772D2B3C1024A502B48362CE9A1B84BF4C9D47D62409B5CD9BAF1E18DE57E9BA9CCE077266D720DEB23F192C70145FE201561AA2A46B55F9B6E5BC8FAF888FB74BF6510AA7E6BCC40DFD471D6CBD2FCC28B33EBC763E8CA58D5D74C1996D66CD827A6A6B9F22AE7C24B13799A7D0A9C9DE940CA217FDB870A1640B55C69B2E704EA21262DA831C7E23411D81773A965DF6AE015CFAA0D5DD3890D0327C514968C2F72A02A0A35243616AAD673DCF57A684E1C9A6B6F35E12C09553AEA89DD40CFF53EB16C5EB9F98B6D04674F8DE9B6AC125B8B0BBFBA71267A6BFBDE26B64FFAB35E5C5F27B7CA273B901D28997E6298E610404C07569E906AF09A968A9E40475EFEBE524357B044B964136C989FFFC70244DAEC0CE3BBAC48B5A0CC79F20AA1E58DDEFE7BCC9B3C3A04EFA49769A50F81AA8F3D152757F33E935CC6ECE9959B47BB90810BFEB6108C8DE4643B24B4154CB7EC3889F5FEF9045A59E82300275EB4D379BD85A29915796B8125351C1CA84EAEEB7607894508", - "C9ED53081796789261D7D209BF086C92C36B574AFC6ED55C3410E0723C799696D9E7DDDAFB114606EBF4256461FDC9B86BB21A134F735837E6845571F6C2712AE42FE113878AAA18C76D5383FBDD38E43FD1314166DC0B7CFCF3F07ACA56740A582173D2DF20F7E94F0CE29693AEAC6B3D1E4B22BC63395BDA6B49E30B49261FE045CAC9AC29BE5A2D91347EE4543495CCC1A38CAA59593BC3DA05611BDC74806284B4ED73013A415E6B36BC2CE31181971BF4C7B488E78E921C6AC1070772EC36A9BE74DA8AC4FF68B6210A392866B689110D9BC2C7ABB2D82A38EB990891F264DDE5FEC75C6B4E539F971AF2728343F1641F4B05EE8EF3A520DC170B3D8D562A7AB72C409995034F6CE1C258F486ADC9E44FEE47D5E81BF1259C0AAD3BDA4A9E17CA9C74AEE77FABA25B3481C0317199D585BC75BE5A774F8D5CFFDFA9FA652C4B14E29AF2DB5ECBE682CA724BD98E05BBFC82320C8883A56F687F840319DF2D8BDB3FA8553BA3FFFAE0D4EE33E84B62228F924A86C5FD5B3E12672DB6377D807356144009F741325714B5B6AF0803F3DD1AF558C0B76620F77056A18896D2047C967BF69ED972BDCA50409929CC2E2DE802ED09EF87433B978A850ED7710508889EEA4558097A7FD83EACB365371F80FB6EE1F7A6D258B97BF1AF9C321A629A5AB7559CF1B82311F816836E391BDAF741E493298B49C001783921ED1569C149C90D26CBA94F8604BFFC94FE303CCEDD8812A95F7B0E71DE95869D2515E524083C7B2E06C4B5E9DA12BFCA74049F03A352C15DF3B79C3F2015E86FA527BEA76102DCDDC863263F0C7E43CD9D49F05D8F6A124354036388FAE37DEEB43909E415EF9F5877D04CB5A86AFB74FCDC990623C9D4D034816E39B692B68B732322695C97CA93CFF0FE7FACFC1DA29BF0D0C08D93B4485D6664E96B09C8B011B3107FF5232DCDD9B3B8DE7BFDB4CABF31D2E92AF686EB8C2FDFCBEB80B5F5591B3F7AAEEE0FC7A3E4BBDA652C8E857AEE81F499D9DD537139B7A6275C64DDBDD17BFF7594DA69335C01AC24270403E880987F69D4EFBC2BF2B787A631859241063E7EE106D3EFFFE60479A8BB5C11ABE38A76804D43A44327FB4D4F986BE3C52DF109E4D72A092F25CE7FD384B0404628936256877CDDF543099D5B0389A9E05CA93A2B12C3C89BD76F55084A03148E29275159DD41A75FDDC75994B8E8D9FB10E6E80A4E30E2CCE8F8DF3FD7A8DD567BEFF109ECFE3B8C843BAFFEEF5B70D5747471FB84DE2A26747DC73C9B2BE9905C53743159E489E1D0CC14E72046E4C8D84F893CFC7EF15CD9F52C71D91A503802FB5A6813A7BD2DB705BADB58C06E0883F0848E44C20A4948119058226031B5731F36B3A9177065BE9A0294F726E80B5AD2F2723B8698D831DBA376061FC2029979F0EA7AC4BCCD87B6A432051DDA7AB2387260082E6D3BFFD3B2ACE807FB6792DB21AC235C1A58D9E47D42EE055E716D389066AB0814B36291AC71B0AACB666F7CAEA37B89CB424C4EC3CBC68F97AD6FCCF5F3B5094E60D68C2F1180E5CF2141EFC84DAE7509490138E0EE466AE0C7469F4EAB2E5ACC29EBF2BB225E595181F96700B552BC0E1171428FB2A2F0448463CC86DA6F7DD10FB5F789857A29FFE9535D7CA35F70640B9D4B9862234554770331B52E42002D123560BA7DCF9114BA9B8B23D08C3240E3EBCB7359D13767810AD3F3F66A8D698D17F20DA5242259090C0A9AADB9385A2897A5A1F32A7B1549A45D4EA8787523AA210BCB55AF6B15A1F150E79FECB104CE01DAC70125FAE9D1B8D0", - "334994DCE050CEED5471E648F7010ADD69AA0CD3DBB3679C9D3863F86319BEAEF1370902CF4978B8237638507B392AEFEF731E6FB42DFC2A23142EDCECFBA399F9C583866B1BFD7C280CAA43C2CCEC29C6657654C251F7BBC0F83E2C356934C825BCCCB36073A5D540AB82DB7158C7893AFF166B108363405B206E53B13A51BAD149AFEA2A40A37328D4CB3961C9EE2EAD29C76F70FB4E6409F468364DDE7A2439D24FBB05719A6A489513B14229E1949142301AB538AC775AF716707193959417B14A65E2D20319721FCAEE6364D04C480C07D732AE0182090C517B96DB8FBBF66B8B6FBBA35CDCFC87B1C8C0F2E4ADB486474F842434CE9383A57B69D4CDAE68E5306DFD737AB075A60073846634AA6E2A6D6F7CE56A631FE1E3DF256A1E39F0C44C3EDC3A9457EB4FD4477F2AE094979599B9B90EFD1BB9347DF2E654BB9687A2EFB857D9AC1306E20769FEC4329BD54804354E0235AE443AF3BE01E26F0D5998D7FC36DDFA5EDBD3958623B6F065627D6A4EC9901891E3C63522744CBC48BAC51BCC89602D66D1B3E0966398927E869E73AA8B986D9FBB428BB3A71AE7B273A16228349B81927B53DD9B7E96E3D078F25EE564495BFE7B7E6CC042E016499952DCD37F171C709D4734CBD8D46E7989C2C497B5EB9613DC311643ED4B1B08C0C4C2A5854CBA30AA225C683913B5BD46E1DA483BD7EFC2C469DF017BFCB5BB07C64A68E3CE828A537115A07876D30999468358869AC7681380A7E462ECD497A6A6FB6AA134C15C6BDF89A2B8D58B875C00892C50A791D8A50514029F790F7748EB0C1CDDBB07AADEB920238F9C19BFA31097F9AE3B26509DE5C4040CBD82C859EE7C4D094CD7CF8F04395684BF7BAFADF75027B4A47A21CBCC6E3ADFA6A2AC66EA32F670F49BF245F6CDD0FECA201E3E7706F8E37C25FE87B3040C0D8431A00FD4B49E7A050837560D458BB5C2E93986EBED14944F9E92463C312942E6D8340BAF149042FF611DA8ADFF9DC86CD28185555E033F3E22856A80C482D52B2EB21E2D51625FDEC689595EFC3160351B5F30E1B802D5F4F35CFA2C25D8E4101298E6B0B917B5ABEE5DAE3CE09DA595122AA3BB3D8BA8BF0D68EC99C2DE8B4BD7C2A0E0E32ADD32D72696C43C7CDDDF92DACF13D18DE4A1403D0002454E7081B92EBA207DF9411870B91CE9DCC5E26887A437726B6CE2B2DC51907FB108EBFD2F089F893A6D5B5141393C08F497C180AC4A95357E417D40C5E7FB324F0D72F417F688D45B980E215DA436CEAD3794A135A719942FD0C998F3F6F165C16612E2B3ECD4CFAA9A18631AD9D878D63A8E09B0F82C12EAC730E6C5A083399B7A098819F2F25FB2CBD1B6E65E3C30302CEC61680B699F504E5AEB959370E32B58B9FBC832F85AB0846AE4BF678C272CADCB5277EF13A38B1AB787F8E5344D7DDDB074A92DD68A2A2F9695FD52DD685E4316FA7E913DCBF34C3F0D9E9D22CA862D76DF3B5E9E3B54992A7F731C893980F151BF29EB1AAF677B439DB6D20AC69A5A41166799FC54FA68AFFB8D54EFC45B49E25A93B28E87E41CD7B3C61FF24F1D0BB74CB20D2A8D817473188FF8E56EE9C4006083BAD781C3F46BCEC777B2C72A9A3F551353DF186FF9D7B342D86629C4085FF2108B98D8EBC886CFE3C7A4B673D447DAC5B1DBF6BE6064936AAD014C0AEF0078C5D1A626830C480E8B72439C9BD0ECA0B41561E5B0D6618E77042FFEB6CA0F29622EB9F21B83A4560FB26BB98468F33BBFD5CB29AC4F45EE9D68A1E5DFA757DC218B536A9231D7FE228925F96C32E0ADC0", - "1B2A30E6054391704DAD57B34530294AA46DEEA044EA5E707811036742E50DECFE891FF88372A4AF65CAA193E1D8DDA016ECC2A2E3F6D8F2DCF9AD1449C614A70D253161E2B05AC67489E13345C779F3D36BFDFD7AEB2AA30604692969E0C4E375D18293D5D3CC39E31189698BCEED3290A2CFFEA79EDE157F2A52B4EA52FCD82DC4BBD11EABED2F311DB72EAA53A1B6811D03D3C2A30C76A8638E6A775EB3A51FFD4CDFFBB4B961075E6102D2E5555ACB06548D119ECB6895AA00394D4A98C8302E02F8D4FC5CA34B405F25D2B090932A10A4A68CA18D799C1DF1C86B1F88AB219D69C25CAB6AF6CA0B3A4AE390CAE3AA65D3AC95339EE734126226D1F292BA3ED968FD2CD835F621C3CB09E59B9DA5CD23163F573821FB64E296853A8263AC9DC896D6E355A4C4377BDB4E7004CF399C0891C1D23E39F03CDDD94DF7FCDA06261E923C9E0FBD8DE32B49935A03E66C13FE7B00E83674E64D5CBC14C0B9F62A842A17551E5E7001BBFBADAEF36228513A43D4864B8D2C8B272562A6B548C0B3E4610609191B807CE861538B89FA079217C91745EA61ADA6AA96464A135DF216FE5DA5143F55D76D44131FE6E329826F2BA062EAC329161C8D158EC7A3BD5FE57908C7523430ACCAEE3091FAD4B14DFFE0DFED92F014D19641EBAD22052FF8D262D39D6FAB21ED66A82CF8336FE8E3CB3641F15EC5F2E2AC0E99CA07223868BAB78DB3A008B233FCC7966D816082C231C18165422F7123325F365D257FE69867CF0CCBBB875D5153B8C1C0300EBB1AFBA3371B83488143EA2562FA477D210BF68251312A7EC26BC837F9D861101B580249FF24C364DA978C0F57C3A3C29F03F3696C04A3CD330247DEC04A385739D90739847867592B09DF211D8B349FBAA760D64D5E00C9D596CBB8B73E7B17317AD315004B35E7F98672085811DCFE7C86DC0169997F2F9EC9B2B77B97FFA6CE2AA70E2A1030BD3ACC5FC3241F291D0304B71D727828BAD824445226CAA77E210A48EC8F79E0DBCA01505D1AB9F79642716146F7A8F9EA25238FCB2F9C46BDC1489D35B958C44C7928BB4503DB8DFE4C1AF5406C04575C4DAB11995BAC0C7FD72B10ECAE376937B56A035DC0A4D7B2E1A180EDA4A84F97D53B57EFC5562643AA62C37211C2363EEBAB6A2AAC22FFD0BF623CE6867F3C50FE502FF535A68BED2FC98C50BF673B2C5BE8D7D690764C256CDED17E4023A04E70387EC53947395B00E8ED6541CBF0B076AD2B2A26CBF220BC665598D9BC1D1EDD309E687F7D1E7D71F4B2C1B5BA020EFB1DE4248C234A68670916EC8A72FD1EDAF0615CF3FA768FEAA586B08990E05E24E7D8E0DB32F4370CEE72D74BAAB68F6E57F2B9B0F51691990DB46DFADDA7503BE7F64A13F5EB5D49788CE21BA768D028037BBB06F3573CCB244CA51362374776B9EFC776AD71AD1F5635B6CB73822A112149208F10E657E1297026113481BE7C862FA099F331FA5C6B1099AE77D4F6DF2C74736CCD9AE8342287986842063A65845ABF45BA037441D967FA102134B25BC7F1F9E8BD4E54306BF8C36DC01A500F4A1184D7412841329DE6B27BA4D772B1B2B68348228037A9A048C0989AB12B42FBEC45C69203ABF843423D51CFA2D67FA548BB39D0996D4C215157C707DC251032ABE51686BAE8F00E0CB4EDB664A3CABBBDEC85EA7AC7724A461F9F650F9752C1E5B8DF204C3520CEE4A51BF8D3BC9A0AA3AF9D31B95FACD006ECD27889F1D0D1B696DF57403EF0E6FD83164E5900691FB29B19BA4F64084ACFE98567987632483F2EB2CE76E1E0B8", - "5513F3F1C262853F074269AF598A2E43052CA2C0141729078A17BEE4CCD35B761B1766B3C118C06724B0459AF3E973110D7096044F5CAAD9A70F3BC7AABE628848D2A4891AD18CF4A3D9BE900A2F42F5D54AFC7FDC7DBFD3155F9D06078C89F8DB684B62E4CE0DC0AE0E4EE6F0E26A86CEC1DCDD96EE175FECB827BDAB3DD53D465E796FE4C49F46B0B6BEFB951BB1A679190F3FAEC58C00E2FCA744A97907765A3834585E4E00B952B5B7B5F10E34F43C8EA3F46C58F8E31B3239C0658F81FC7DDD5049FD8D67587C85C78C12CF122CCA327A7860A0E34A34DADC677F82014EC7217D2710112B6C0067AD402A941877970C95097A47AACB74A8DAE4C9B5F360B755EFC4546D7D63C580F108B197375AC08EBB1F51E8AAC68C39BEE69EB886BFC2558F0A52AE16F514EC168992775060A5E474E8B2A1180C8F9FD6F3E106963DFA09D48007CC276C1464B00C86CEB1B7372684ED6BFED1DBFA6248F4725E7F8123904BD0552EF70A2E21B8A078CB90EBE75B127A1C887002D70E32CBFB6875138D8DA5B312A97AEAC2DAF9D6506FB08FAA9C334FD686F6CE07F4BAC70766C6FDB001BCDD43421CF70B8B33D22795303769B2C37D25752C9C4494A8E8A0D9A1205A03889946833C065AFECBBEB026E95987C022CFE65DED4F4CB78ABD4DB2CEFC3D69A4303EEA5CB2E8F39A2FCC995DC4BABA644F65411F6809891DF1C0958FB281A7852C8330109EE9D87362F461D3266BA8C2D3E82C9B1400220B19277649CC804A9FDE4C2730AE11CE633975EB3126E8AF60803DDB5C0258F7974BA7C93499B2C2ED1E71CB64E61854D3FC186333328D14A12AC06586246EC7621FBF1BCA2578F2E16A83C9A6800A378C8E280C7F3378CC71011681C884B83A56865F138FE35C123E28F1FD461F60836645A9F9F8CE211A8FD6B07D477674A34F78E3B916A7AC73A0AD9C8323D0229706A8C2214B5ECE1301E470C37818D68092D5DA3F0F794B8D476878A5B9FB339999F5422EAD28A16D8F8B39CDE00D14B659AD8DC33A46F64DDB8E4F142FEAE8A9F55B94C40D62723CC51EF718C0DFA6D9799AA1863498173A0659F816FDEACF2DDCAC54C1D535E1C0FD9922B333C780C1149C4B294AFC5CD23CA8EFF423A3FEFD0EE1A5B0CB28964B8E80C42AB660665C4B55E06E44557689AC22196CE641644959BC7F80D1AA828DE75CC21E0A8FD211BCF6185A7DA81222CAE0B632A7F98484ADD6E83A220CD49D5942B7D16309AB1DFB705852A22A4D51EDD96DB3E318CAD7E96D5531193DB24B50D3EBF55DF8214093ED0491B037E1B38FBCED71199A063ED101C227A10313051F0B4BF4142057A73C491AEDBBE916CE4BC05D1A44FE7A2E7DD76CBD24C13F3758BF7E3BB8139690E33631F180ABA7425DE3E512B53663CF9A8D1B28C0B886C655AD3A03FA8698A5F5AB5484E3CE53CDE1F34A66FCBD734D15BEB727B0FDFDF68BAE40299C73A8F455ED471C82F6DCE240B3BA4EF6364A56828FE2D6BD8DFF03F35F5C6CBDF0C907F7473F24938016615835D801598409F1004C478BB1B2283AEAB437BEEA2F5FC51D8E43F78C0092ED4D0B08FFBDF1CD60454D3BFE6EA1F41EDC5EEC06357DB41F73CAB23556634416369365D13FC8FF9E20EDD8FDEC673F0BD6C8A1EF60E394B596B70F751EF0D9D7E8D573E3526D2D90325B52A08D25F18DB0E6757EBB6002251809ED47C85D4FA37C5890D60B40BAE3AD22258BBEC4CEAA1B6B585EEF32615F7254268DB82532BACBD9C553624AFEA6BE2AE9E1401F9BE05D68A881AC8D9E0CD437F60C00", - "7831C1BA1031B6B0E0ECE28BC7E6A8ED16E3068E8F0006DA96B8740114397B19AA19370B1E1F061AEE3895C30D0B7099668BE752BCD8B1CCBC497E06BB0F75AF47A36EF8925A59E070115D3ED63C6D7FFE54D037B4A818703F6D78BB37725D7F0AECF6CAF120A80C938FF44BFF16544C7847B1A989598F1602A220392CAAC2EBC390FD53D15CFD3372426CA41DCF816E29C731FDCA2E84CF90180039FB1AED0DB9630BC28D54201D5606906091A3F867D257C3A0F8193DCCAB2625D40DE5EDE651C20F2DBC83FD551EF46C4E724D2C516560749AA89D35C7283385E98AB34BB88F8ACF50A0EDCB70888DCBBCF0B792A5D1F2F6977FA081B4EB08BBDA076A43BF1EFCF1C387DD5B92BEB5000B4139938CB0A3B6DFF47B729BB5826C7E188A177CF6DB1B88F051B537DA014B396645218DF4EFDB0DA597B3A78E9884DE4A7B3D06C259C10B78DEA1DB711CBA8FAA2CDF37EF0378091E408960B011F4E4FE24771D0FF3B8DD01DB0527087AC5C0F64EB693D38E0A128FBCB8053E811602A05F3DADF2166CE49EBA13F382E90EF4A143B2CF4FC12DD4873A40FF7354C6E648A56623457665402632C41942D23001C08470AAF1F3FF0A474AC6586C76915FC91AF074103A1CB9304485F92F9639399028EBBFDF9394B4BACD6BD3B2177368B94F639AA8D202D6BCA88D74AF0610C7B565067ABDE4F2BFCF8CFFAAF93274CBC913EE7DC5C77BBE978AB9F82B546462DB933D67E0C6748F943F39B8FD6791847C50A5A834A78C2FBE5D21448A035D83D45F9ECF44C21C4DE726AE8111CF277049331D78B06E9D7D3D0D8915C7C32CD6954D37045E7AFF8AB496A4827574C457523AD6B85F78641BCC4C9535D29B3F8AB4D944125E6E54B3B3F23EBC04BAE3AB102977EF829337F51CD833B4F5D4559D79E695470F498EB4388E573D004D725FE41AB1B39F9526867BF7B99301E0E50AA569B3B23EF78D02FA53C4BB2A184B02977F2D2AB3B71DB09E3E8D9D5B13DB8AEB0A95F9296B7C49B1B3D6903BEEB1B9792B5ACC1A5D11672CA5D8E3825D044DA986D01F6E1E292D74443583E49CEFBCA177BE275977BB4A4F77ECD6FEDC886B4B83AEF5F34AF1A78DDF6B11C201760175D57823DEE0FA5C6A9C1A91638561B857E993779B6B0576994CE86E7DCCA4A89BA2ED84ADD1D8B4E11446C41DD4B1EA71352E26B2AD4B8A1C5C64822CE21BA4B8D7D6589FCFA906768A2BA0C5AD1758AE7B8A2BD757C8E459814CBDD6375DC58497279C0C327F67D14FFA5C90167941CF9AC642B1693D7DE52578AAAA56E0EEDFA4CC12C7469DBFAEAF5F9D3D72FF103918B6F6DF7E0DDACB208A8764B459EB01092A101D42E762FD5C5AB381AEA19BA6EB8CC9CE138892FEDDCBDBF818E97EA8AE9846C0CDABE9B4FD5D80431FE03A4CBDA566314BD1AF59AF120EEE4105E1B701A4058F1112F2A5C8D9F68EECC870DBE78D851F89AFACAEA3A2A068C59654EF5E5BE2F6727136908D993434E5EB1B84331119DB1C02547EAF7C9DD479C5B326CEA6224B16A2E108E76CDF0C54D16E472D0CBC80DAE7980713602FDA31A6B04E4FECCCED96AA3901D7B35D445BDBA020DDF1BE5E9914ACE600ED24E492138F82AE583A2EA454EE7548882C1A192F11345A3F5A3F2CF64B85DF6306F7FD396C4E773FA66CC098EDB3CF8E5599C2EA13A6F726161BB0C0D6673F02E3DB24FF75A5698E91C1522424D443165B52C90FFECFFCE6C42656138BD85409C45D8AC453D6742B42A43A7626E70C212B7318834B7D29CAD0C29F22E6AC3A59359B1A75F727E1DC", - "30B93A783620E3E094D47590AA38B10FF12C3E421887E9081F9A9C5BA1D753F341C33B7322187317C6610EFBD0382DBDC2D863C48F15AC3FA86B3C5A5B9EDB937AE961E8EBC3D880CC79141B79869F95D6E90C5C5E7D9448CDACCBDE184F6FB545324995184770CD2838B61376B148ADF3A42123AEFCF8890CAC7D3AA87A624DF3B883E86AA5FE6DB385778F50BD4E528C6604CFAE0E39BD949118EEA3972327EA355EFB98E9DB563FF72C5B860103AD262BF34BE17295E37A81D1C98EE6FD6690914467048A50AF09435A68FF9A70B59DF8FA7A543BBA24EF8E13AA509C7A311E12773405A4024A0C2D7C2802025FC48E8FC12E4B60543001971FD20F1641B968CAC283BCF8140629DA13D1289B7130F3714B8318518770EE1399CECFF1D3074A65F8913596F92B269529B5FC63D824AC7B6390580C516BDA78BB1F158B2C69AD2FC1BC610AC24DA696F44B58DF813D9DA52529D325BF2B3575768DB43AC3BE5D0402C717FB587B6976E6701B0A70D04F3250B6C54E99983E2B1057DFD9EB7B621504A1004E7E67B33B138628EC7C43A199D00D9FAB8B1990A5FF29E4399051D1C62AD0D86B651E9DD94D27DD6A7B09AFBF1EC737B161A4A398F7F424889C0BE6FBF8EBAE9F1A835FCF4AFD45FB36919D362CF73F0786D93552A7B4E421EFF9D6F98078F85098DC99A1009D6551F02B60E12BC28499A27FD7DEBE1047CD44EFC0D9081323DC08866DDE79F8AE34136B04787F6A5918F5AEE705CFDD5071ACF8FF54A232FE39E1D79D82EFFCB6CE1B68A17B4585817CC9AC33FD6CA21A00929F1EE5B9E3518B27060867624D8262EA18F1B01A525EB6CB337B257C8855FCAB72D7A83DE52E4F1D5E29EA697930C25109182B95A202E519B3757092239BFC633C4A7099290FF7B99FEBF81DF5AC41366D3DAC3384C65AD0EC84F0DA4A0ABF7D8E1E2F8B898FC97325878D911512F1FA5C24F009856D44123EE49C77370F1D58E8476542384A0E45CD852D19EE00025A8BCDCC011BD259AD7360D12B6A630BFEC8A97AC40781694B0D5B3D50D9E843FFAF7A023D451E282FAFFBC38BFDAFEDB34528DC792ACD499179ACD26AA3765523E91A137F52BC959D5969B301B1893564AB348606864916C8D79DE6FFBDB0C2ECE83B0A3BB846FC37C7D4D2A37B2B841CFF9820DB444FB090B430D9714FE2ED731F097FD30C2ECDA7B6A276990647741496729219F244FBC6F1CE02F24F98D0212AD005E54F242A77858622D6BA961190F97438FC4B33217A84B5EA9D3471C27D08C2D52DF19F2DE486C9A5EDBA2A56E1349C3BFD312B8927A9E86A97830DD0B11F505AC481FC6834F8FF7D0E67126033502EB5C593D15E1A56DCB03ACA1A5DBDBD6E6FA9DD3D7D152E8FC1741BD876760F99CE780EA5BDC018022397587357614ED37266C69AFE4644D7D5259770B85B70E7E395D2ABCA3FAEDD5AB32C4B61117BBF707A58530EC435D36370D6AD8F9DA503F8994F6CD627336A731BB149D3D3E96075385DF8CEB3D9B48757A79C67C0E0C701A2CEFA092D5462E28D12548FA041C5407AC321FF049B37225742345E065720A81098B5785AF12927167ADD2F72F766292F421C290C2648E270C34443ABE5B95B7E635B4CBEFF74478F65C77899418C8ABEA6A4C3FE217D784823CB448A7EC0739C7166F4AF733BE758B6D5011EAA9B05ED995DC70E3D5A2D2298801C25049661FCF4CB2E9F7501C86D763CECADB0C86B348C7BF31DF7BB0CEFB4A2EE6861D3D9D441AFF4CDDB979465C1ED95692C5A46F5ABEC180ACDA140AD11BCD5B8", - "84D5B404488AFCC35CFC6EF1CF7A848EE5EE527B7D2D2081EBD8FA8432414FCCB271A43FD618EF95CAF1CEF445B50F02AFDC6B41D5C1F1FF4B6B8F2AB94F90F259383F44246B2D400C3012FD76E2980827C9B5476C4651293CBE9FAA77EFC53E369B94F51BE480EEAA389D88AE421E75EC67C76E30A6FA7EF02500372E4C9AB875EBA1C357C003938B979859B0A914D58F21B3BF1BE8C33A1AF079C5A0A4EA532F93A10F6D96D0A63F3C99E6F06CBC072CC5D71A517FFF40BC260A26E3A46688E79E733E1E2F0010846937689E2998BC769186E0B977AE0A1689245D255AE7D5F34715AD526E824838B62546D9569009A191BA5192535E23142236F4035C90D1405C8530A57B402118FDED2A5DA4B40635D2F95AC7CEAA370686F0AB23AB31DED369BEFB066909B76F2C04039E49FF0CFD323628D03C26F0BD4054C127F21355C33B49F86895D5354C3BBD2C0D38ECD169289F7D8403AA1753B393AC06C887F98315324DBD78F9BFD1AD8880D41D4EA98956EC89BBDAD08F7CFEBF26988EB5AB01D4E49AA8273CAB6AFDFA1CC1C95EDF85284E6570332A0B8242FBA495D87A01A945E61CD36E865CD4F430F04A3B3EE74CE0486B5676F7A938B18E1DB2DAE2FE1C04B3D56892C7394D0B07C5A2F7698D196711DC83FFF6ABDD4E8131E1106EBA23245FB0E2A696E440FB6B0B1CB4DD22C9720AC76F09863711647A7E369FDE5D6911A5FCF987470B8C06C4EF7063B08A8320B4371866789147E9D7C5D477A662A501627F91E95C6E2CB6814651E9DFACD67CA0B1FE62F44081E3BDDB964C1E5ADDC093AD185F0203B4C0F7E3E96811F14C79BC54F2919FCE5B653F6845CF1AC34DA9E4CF52EBA626B739246E25204F9EF2CCF4F5ADBFC53CD8F629FDB82186CB52BEB7136F105D3CFF9CCCC2610BF2C8F943DF5BD03877ED7AFA25CA81C4063E1B97452A937FCF77F1AA068FE2A26F6ECDF662ACDF18391AF7D627C2AA07CF5597B5F33AA0ED4DAC98AA73C8321EBF6918EE568ADEB1A823527AD75CD5BF7ED3EB5633A4EDC8C59DB0A91DA79C248D6894CAF9CB411F302635BEEF1A1C7916C7545B8BE7C577692245E285D32B4FD18E1478F88F8373E22A5CEC6D22EACAD2A41612F05AB2C54A1C03C0512359B0F9C5F91615EF2EA80DE97230480F489FEDA38D52FC84E2F1258CB20FF0E850639B31C2958BA6C064D0D0F4AAEFF313E43C65EFFFBB47CF09F2A122D15F76E8B704DA8F2B8C71449AA49774EBB7B2DC97CF6004D2FF6D37B9C689261189B85CFD50C20C961F22A644F51497377426556B956DB8C899045B175A8B9CB22EFDE535CF487E9D958281E0467539853054FC3475D2E142D58F9201C1DC6B2C1A12B2878F9366E2216405069B7D03852AB37EE83112EF2EE172F4E5317A41653A656A06F6633AF59062A47263A9977A50B9115456A58F9C3424FE7E0CC57DA70FEE0411C1479B4CC2E6E720B01432CFB3C503983B37FFBE38C92E50D6C5795443F73244F6D28AE6270E27D46A25621F86A2BC4259DE6C04CCAA657FE656C640833B290F00A1660329A3F09FFE60152A23925F4D8B0933AC016B5802CA863F66F8CEB5C8383B1180A515AE6C51B5F56597C3A004F8D25F8A6235C97B4DE38468B63E3B859A487AFC4320598EB6D143E5C914409D25F6DFF6E957D575C71D3ECBC6743CCCC03E5F34791744637A994F3ADF86966B4FE911C06F7BA1A6C20A2971D82B64E49721A530D9D5A2319D5BE0F47B8119C5A835CABEC735A935E23CB439970437C6F4CCDE2525EF0D7B1555CBE70280D5E760", - "A5029C9EB4623226D321FF78D3C4EAB1F672A8B2B24A09CAEF21F561A851323C05A3C5E136A2DA7104ED19FBFFCAC3FC49B6D598F3060E93552EA6C700B837F7CE04721919B9C96A57B42AA1D832307C7A847091848066CB84947BE5F6B54654479E39F654819D3EF7AF4939FB9F4C9B20CA7F83DA0FDA2F171FDB72455B7ED0D43206992520CDD86B29C48BCC687573AAC4217D0B7DCF852811ADC3ECADDB2B34B4572675CCAEFDAAA01F83561E6E240878F229698185A80E6FECEE89455A72A377C24CE3FECAEC2A34B9CA98D288596D1C769CDEAB06871316CA7D1DDC5862E6282DECE33F362C64A73E57AB266715068932ECC31E62AD2ECFF7C6FBFE213384DA086ADF49E30F432EE2C715D9AC4DEF53A7B09B0D722CAC560FE8CF0059B80428458282F7E81717647D72E321A3E4BEF16FAEF76009BD98B8D9822B771EB62F1D0748E462FB7F3BEE9B12AA86D9629085AEDF8E43E1252EE59970CFF66A6F865C7651EF83F8FE10EB0E2615BF8F5C7F12FC601B0CF795C0D8B7057F54408BEFF86747C0F6F23EF212A9086EADD464A25341AB71FBA4ADED8F599C38FC15E790A5B86E64977C5AC718DD0B47C1A476AC9D7369396144F6288E84F7FFBDE02EC00EEAE8ED415C84648364ECBEC42164514D3E26BFD3187E0641C216FFC57E00DD752CDA581686916221DCD1AF07582391C5FBEF047FD1B7B956B458DE925C02A756FE197233E0304D0E034FF9A176B5B3F5FB683AB41D2691E13F97B3F4EB33238851331197C49C60233232DA0E2610430461876FF6F77FF3CCAF1BB2424B8B347588667B48480476D40BD9E487468CD5AFEB597C750A5E665B4E7C4C169ED08ADFC731FEA928052C4FB85B3064EC07B0CB988E324893B3F084291D964403F0350B7E1B06DFB73362C38318B762A972972BFB76CC5C08B5D47DBA0F3A2473D7749DE9F49F50C4C1620A9EE9FE56296124D72906497411DB87D4D8EC4E1F79BEF27232008A2299F5317FC1A6F455F1B827F1712BC01814F0B9D0CC162B25B804278B9C7BC5FC5616B317F2050234A7AF92FE35A59E22C959C7163DFA5F142022BE5CC4D5EF16D218216C57C2E29DA926436C00DCB82E68E16CA5A07158D8B8864D38A765D14E82175114A28CD97D11D564C8C7B87411589A4FBD49F9900D08939B7A73B5E6466B6F607F8AD22120A559A02BFCEF6456E7AECE8C9B7C9D2B322D2197124C05363B2CBFA58B74CD88877F22A5E5C202FC2C33531125F1518F4F0F38FA788E5E6B3307A75EC73E545391CEA200243DD6D25A5B8654A00B82BA57437BF0ACCB0ED37ED2FED221E54EC12B93AFA6E3939223596075F4C47340355D7222A8234A1F65EDDA42FFF5D19F7FACBF09AA77E7962F4CFBF61A0F26FB18E31A504B371714048874BEB286AFF71B43E4739A17E8AC25FA77121ABBE6E99754AF42F1D0021EA1E3FF088D0734BB191F91A520C96E22B4A28F9A2BD7DF81E8079EE5D0DDCBD517046F12098FAF6920E0EBA10DE8CFB391C63C60D62C1F4BB26BF8B6E421A830575731F67D306CEB5D6FF04637144790EC4AA2F435906320114CB81EB40C22B271FBB065474687AA5880F1DBAAA1744AB3E9B831A932A9208BEA9F5D526C52F5FDA56320E123CFB553E2B71A595DDED2ECBBD6E890B0421D765D2E9FD0D3995DF2A9523A65FE2040710DF16F2A83F510DCA08493DC138541E5681B51EE87D84C9AC11612EB5C06F5A63E22BD6275E35216766D79B215DBD087E9CADA0CEB09BFE435DF9B7809A76DE323B373682B8C58CB4F08D9C708EB050DEC", + "3CEA9DA7B07B13A6CC0AE53DAD1EE2A0FCC70009338C08AC0EE457F76A1690815C3C940AB722487CC8F3D1F4C428828E7FD2A21230E42A3BBDF1E792165F644D0E0335F95EBDC93D6005CC0C680DB7B0E1B8C4946B7974319F9816141DB9E01011E4F20DA8F1B8E15A6F618CF599C3F5C1A1B276D51318ED4119BCE0ACD0332F3DD8F88EC5215AB311C51FF4987DA93B09A43BA84CF08032F6CB28F43043C54586811D870AD6FA27AA63785345C8BCDD3DA26A0134738BC7E08461D5409FF0B791D8574CE797FC5EF7821055028CB4AF92AE1088F8806CD55F0E5FDFCD8D74ED801B2B44AD5D79D1924D41DDC6AB2070B5360CB64CCF487FE517420348CC39BF50BDF78BE7DA91542FEAB689457B3EE69E43C75FADC303F31032FD96B7DC70A88C3B7BAC7322B285D9CFB3A93AC8B890165F23848FAD8477DBDD3D0AA4CB3CD73A48000B6D134DA2DA70B56E590A101AEE78864DA0C64A7BCC6B37CD6F31E9AFF10CA4D47630752D253944632DF6EC60AECDCD223F29399CDA3B74D1DFA5471277EE6C814464A8C55D3C0B83B36B6AC9FA90CE876ACDF65E3EA3FD61D309EB71ED29A3D510B2F4C0B6D6C5B57EC9060CFBE48389DCB17CBB2284E7F578565B91503B06F49CF3E8534870AEB6AD9707265A9A1E6E2E5E6DF6DAA367239A96EF5B02C19A4543D537EB4D9D73966C09E9B52B4706F57B3E0987885EB84DEA26F7823D895F62015188ED38C04CC6714F797FDB0BC713E3D0208462F9A68E3872A167BF1BF9791AEE8BB73CF527C50975B55C4E5C2F2E95B677F833ECC878D1764839608CC1108A75EE9E58FFCFE4CB52884E7AF15EE0632E0729DA1CF5B7A227028CFE1E08F8B881E1A743D52DD27BED33DE0EE75DC031B4864CF192DFEAF64F726D73321363A233F81C57232432D2B0A5A4C44F4320847A9C143F378F204185D2B571482FE45D6BCA152E6EA7223BFC6DCE06CEF90CE9114623EAB9B1EC789B2051B4AB711DABF5B16FCD970F437B8860313B4F1F14D384EE3976B7E55D2FDCB7E1BD9BE18B722E37C853ADC7E1CC2870A02881F95B78487780E1D1C296415109CF07AB63D0782A9F451CBEB3E8B919917AEDBCA8A8E563AD3784639793E0F25CC9CC62240FA04B2F141E71BF5C84EAC56431159556B8BCE077A51469A87737D3D6F06D97DD479FCC35129F4499C19EF98BDCEA9D4941B3756CDE1997C3AFCAE62B6D9E23341E11CD05A7FFF52F5814011A84D737E1264109006BEF5F19E3C6A9C7521B44741A8282755A8F0DC2FA0E1F6CA4FB34D8CD5FAA27E18808868725B9634376137C1BBC46934F83958112D03082DDD6148F353BD1DD24B9F8FD7AD89C40DA0A92A8DBE3608038CD56FFC4ACA35241D76FAC4CAE1211AAD9D73D51C81C59BCE05F71C345730D3A2C670F8F533A950EF24B00EFE6A3F1354694ABCC6FD9EC4E74DDE1F287AD4F847A297ECCCC39AF029EFCDDDB19932D906B9CEDFCBE0D422CEE305DD05E407340F28EEEA866664D60AF293A45D5D6D5C0000B05F79463DB513ED488DE7BD4EC9EACFEF973B23CE4E9539EFCB797456CF5FD1EC54FDCEE80B39063C48B91A5C2D2BEBC81B9B46D0AD6503BE5AACED2BA5EBE81F630B4E07510356E8229F7FC5EA532B8729CDB819E066A15379AC6942CD4BC5E97C6791E098105C323A3A3DA3880D5EE5562ABBA2BDC9906F4486B51ACF8AA4405E9D7A63DB9E3058782DD9AF3995FFB3D34AEF98234A0B3DC62C339325B60706C068F0198BD8FA658396D06931B069155217690C7F88FD230CDB38E3E48530BD47722FC", + "9D8CF144C4B667345D44F765622A956CAC4E097AB1CAB05CFBCC6BB68C709503AD9DB09C09C983D46A04A05B6F7EB26DB4D46F868C10E112828B1AEDB3C0074BE0DE3C9B7821BABB4F8B8E24F69869CCD981B09A783BF6A95F39ECFAF25DED6B16F89EA09D3A8413CCEBB545651B363DD385D12BB72420440C40E804FA27DE029A1E08629BAAB598C035DC58FDD309844F3BEBDE40FCC231F38605DED06572ADD85DC51D3D8B89B4480143D0B75283522354330E5CCF4DE1A6E68047D5B8D45D835A891F2D40C9DB8A76CEB1D18FE2BC38D080A8D97064CC87D692DF21184ABFDDA7642D0BD6F3209D06B4AE7600F7DDDB71DA751120599117ECCE645FD109CCA2EC7DB98F4177F14DB854FEB314B5D7CDC3385AD203464EADEAFF4AD08DFEF3D21240BFB8EFCAAC1356C72A0F5C61BE03CD2A21A7D756FA9003D562FC4A49A6BE788EC8D80054ACA881DFFF72C2966EECD09F185EDD11218C6696DB14E05FFF3644D11E508F4F1E9C5AB3074FB1C3FB21092A1C8D5AE05688FA4A9226C3C30D0BC3981933DC8648240F8CB67085F53AC5295428DC8447A1E5A46C2BA86796982C4C6CC647FD8079BC4024BB69E2B226E6F3D0F8A90B4D36DA2AED4C6BB60D318AA7479FDC2031143C67CB4381C27072E12935001524C7BECEDAA9954BCC2AA218E9EC2C95498FD8DF655C015896D9ED42CE7F91CBBA2CC4A7920038EBB5F5CE638F969F8B179E72AE252BE7E826E5CB53C2E85AAF1E1F1AD8D534F78A681928818AC3154651FFC583DEB0A6A1F40B98771ACC528AAF80D210ADAF83597869968D499ADE9A19BAF341E8CBA20F0E1473BDD898C24C7A5466F9924EC7EE992A2086AF295BEE1F6D0F8843D91180BF2C981C11FD978B23B6BAF7786BD526B458B76A87C31D7C52DFA43F3D362C8EEFFFB3FE5FB3F6E5F34B1FEC7EF1031146F3F609B32677F148F7DEBCF3526BB45582436A3092408193D6312626E46ECFA96FEAD12A234CACE10FAF9DE75EE2D238088146328E10E9ECDBB0B018ECDF2725415CF5A06AAB857403BBF6CBFC350903A982864827988BC805A3484A31FECF7A40D4FE251BC7E487613B9D3A48D3C7DAEFDC49C4B7E625F868DB53A798515A61050978552699EF2A5BF2F13BDD444EADC9B60B479FDD4633EB4C1062AA78BEF06692DED203819D3160310FD7F2343732156A9CBCB0B50BA9A8F93E339B702670E54BFA6DB2E2E773202C690FB71EB03671AB0B1B02B2F189BD99061ADD23F75F4914067AE638C9A29DD3661C28AE272CE692CBDE6AE880FBCF272E548342372CBAF6370C7E3AE9648341CE7310BE1C534B5702B0611AF65868F840B6B7613FDAEA21DEFB4F2024487023B02B8B58C9E9F27AA787EE775249EFC40913CBBD69C38538F239B203815F00F7B9CB30DC79E6A0C3E069D109E4A1BAEEE36D354C3D0121F1342F1F4AC504A68D69DEC158D54B04BE8164B48F31BC0827A0379C5237070B6F963741AD9ED4F3865698FB8233D7F49ED4E0EEF3AD927CBAF4FAE183252BC56AE4CDE3E329B1D9C87C6C11429B15B8EE589213CFAC208A12AA01B4F1F7CC35CD0AEAE217471B3DAC1C279F353DC61994FC45FEDBBE0005D8EC729385645864EF98A3A417E62F1EACA7E60D4E773BB2E4024D62830F103A7988733DD7BBCF3AB0CD0049006FE2F7EB3821724BEC37EAE44681A9699A025D212724CD98CA3415FE2BD09FADC02F1501FA38A6083427B662DDCBD0460E12A09072698EC8966C47B8A640AC79C1B7722E78A6C28680F4BB77BBA477BE0A6FAB959B9753217C5708", + "45D1C8FF162EE106CC87C3EBF6A837930F8CC797EC7A446E8A213ABD239582350636B19B5BE428A9C13F980B7AF5CD7F32630AFE8693CDF0EC0BC2C84F2472F5B86576E8C43136C14717A24705953D392BAC96C1055B782C7941D82FEA357E5FDEFF772FB9F3DF248455CADEAC4CBA2EBA9C91184006D1680E000D59E4BC8FBE2C2F7CC2E78BFA5B60EB292F244E6CF497D5A287432F2520B31B9D9FEC1210923299EDFF043CE077195509E92372F5959AAB4666AE486DEFA400D81463C388CD05C677BFD4953D2627105B0A776960FEE916C75D53981D30DC689581B7E8E0723D65949662ECFAA6FCC9F0CE8892E367721718F906207663F9AD450AE98D75DF004080FC15DC2CD7A1DCE013A0E547ADDC29A397ECB9E7FA02035327AC40240E2091098708D424563AB7C5867F3F2D78EE3EF5B658FDDBD49435060CA2EA3D559CDE957B7E48B98DB41CF875F7B3D9EBDF6547B4EDD98DF4B747B0793152FA8CC07C6D9EE5A2002464566D86466C2EDE54A2BF4BBE823049E57364C127A14BFE1B88ECF70EFB81EB831BBF50F6AE124E5F6A775F3F2620E91D489CCF24811C0890EF905E9E2ACD399E13DC81333A54BDD295B872EB74E412E2FB654A9874854FBC3A68C73434C5FC5CED27534B2B13C316205FF4E432FAFC13A7B5B7A7FFA9FEEDB5AE69036F8F2955DA124CE5856E8C53F24E609F7D3386DC5212B2E78B5AA23B59D45FE98AA08E9CFAA9D52ED260A36AF07522C047ED43808A39D7019E444EDF84D885A9AC84092A0F6BFED562F3E0D79FB5CF62F98E67EF219FA3F5AEB7D4E344642D3D4B1A7EEA18464F6CE8D4CB3181D9EBF6F4122751B54D0D7F3FC470A91B547148AAB1CA0DF59872120190640555A7561B0F2C11280768F74B1A56674FD5480B0F510491431810D99CECBC6DB85888BACBE2B020FB8B3D78039773229714156494EAEC3A2D0A59E718F72205747D69C05DDF1C678E2E154A1F84EF0CA2E24DC4A6A996F0850A396D2432596EAE84AEC0935B8C25D5C65B52A32722F01D281C4F753EE03EB10020E9FA02462CA303DA39560669637532D381EB78AE5EC0F6DBF6273EC979442E6243F65FC51F26C6C9554C6C0E3EFF33BC4EAB6A27CAB9383BE7DDDE4218C4998033B47919503E1C9A789711EBEAAD6C0298B3DC563F54D28675260F6D896F1B8D4FD0001C429210398E9544B3DAA12C31F7EE82EF4D2234E26F873610B76756DDACD24B6132BCFFE735FE75513ED527DD04D7DC6D24059F85706679DCD1474A9DB9571426BE17E6DEBA58B33B708567697F471CA8B78E8FA73B0E18CB6F88BF9E4F442F0FC21FAB89305484828F18B65F9D373A6A2B380D73F5924F80DA234C1DD87416D025E4E663C96F287B0C83DC92C2164D81830781B715209FD11A65E64962D805389BAAA91DFBB990D3511E506A8EC101131C5B7284252F861D047DB2C2027DBAAD487ABFE429CA21CBEA7671350618E441F4D62F2D579CAE29D97023A8873869B553293D9F54D4A929E252AF132325A6E3BCBF7B36D0DAFA1E56A39A5D801FD0D5A41111017BF62AAF8346C7D424FE007C32B437ADE60AAA9540AA5078FE6C3C3CCEA53EE863086646C976FE6C79434A0AA4F53B2E9E2C3B4CF9C9C4015391E27CDFF5C1FCCCC00BBF5B99715A1265F591E294D530DB14DFD485AD34BBCEA32E5B5D0EED15F88BF5D96D058E6D70BB1A232597E35A625E5E8C2EF5E7031A71F70309019A0591BA0A50E87C839498255A3602C0FAE53166BE5E49E29D24AEC47002B698F80FC49E718B66A8959259ACC540", + "7A0133D5CC3754D6B259A2CC4EC0298111D098CDFB40549E5C40B36A2846CB4B256672BA189CD3A05293BB36B167508A7BECA3110BFF339BA06340585DE8EDA03AD244A77F54B7931610B6F9C5C54D688A0526A9B52605BD7D7BB01A63F3D1565CF78ED904BBE4AFA4A290EADFE9DC156E59BAC162A818B6CDF38D2BC715144D44A1578BFC727423777784D15ACFE80FACAB61F9E58B5D3FFDDB065A00C5D49DF0237EA6C488D7758F1A689DC59DBFF78261016A7C723FE52FFE571F5876FE0ED50FB00A90BB82B27BCAF5A67374284844E06BB1B2D84B1D20228F5C2208CA7E8EEC2E95027B09372A309223A15C132543FF3A89B7AFBA56AA7A8DBE70E0805D3A54191CC6884D75ED0FC00C06D9D488B0F4816E12D6C2A4324EF742AC8FF885E42100849DA05E3B7C451D43ADBEDDFDD13076CD8D22BDA101F665B5878E321A009B970D1F4C48503CE35365543B3F36786802E5C53FDD756C595784E4F130904044660784ECD9C9161477F5BCEFC98987540AD1E86CABD3EC7823D83877605FFC79820F1381DA29282C3C5B3443B6A67973F0622EA5DAA14FA239542EB140082F242958B39014486E5D5632C62C3EC8BE0E09E038C0ABD52B1322E0F7407FA53AE8D761858136CB371AED5E6FC9D32CADC8F870EE833B7120BC0278D9A05554D90DBEB24ED6F5A8861698D48B4BF7AFE7763C1401572643E246DC65853996B0480D38DB7302364409357137DCD0B416561B9511BA43CA34341FEF7954C28B2D9FF96EA110E0818309C32AD306DA077CC911299FAD6396C872F3F6AF7871395D7E67879EFED929E4C05AB4C09E8BB396048150A4161D7944CBD99C94DD16CD8E0D8BB73768B17EC02C0D4206AF623037D6F4257DAB4C07B4A6C0B4D2E0C9923FBADE3DFF7FDAB45F4E6BC5A895FAE4F5BB9EA247F2D4446E260F7988C452203EEA1DFA64DEC2DCC090BB3ABE13F6A8718F8DA2BE551407B59B8EF1806A65526B6B872CB8922BB929F09341554A71E69B41B60987FE3A5E7E3424D947455083A827FFE27FB5BC5365C80998DE01CCDB66213575FB61B3E6F877D0E2E4EFDE4467D9F07B6A28148FE2FD6EDC9202F55FC855D0DF8C49E244C40CC3D95FC06C6778D397461BD157F4A0FFD915799820D55F52C96AEC0CC5A3E7A2151A845EECEE78B82ED9A217E326CF6C49F7D31C4D8ACAFD827E6ABB760150203448C000819E7E0B6E424C43A5500164CF128D686B4810D9838480604A891792987FDC549D87F95BCA120AB84FCCD8C9F93F988C87E79599F3C1952BC0F7773BDFFC50B19BDF8E3D8F52D887E45B643297650044E80124BEA0ED60FEC4449BB3BBE394CDF7CC7AA39BC1A5023044F6A843186C01EE1BF5834EB5401AF7905FC04447AE00DAC50B051B432F831FE5AAA7506160CFD7D4639C489ECA447F4F993AF0503CE5EF68A837FCF85B85993ECC55A9A3673F8F2C5CB8D3DD4C60E8421E3417EA958EF87E0764B061A39C32ABD5E0E3A712B54B0A3E2D351A0E00F4E901521C63C1F4ED829F6E259A1F720FDE96EA9CBB8F7BD7485531A81A49CDEFCE725493A04B5EAAF7411DEACDE5A95AB6C2AA7BE3269F6AE4D166D8A5FD5264B135FF8361FF75B2FF22A61905A349C6B2C1DB2BD7B385B8FBDCB2768C7926F138D5F8107111563CE527322AC42E6BD42485668106B8CE91F157E0C94448869F7AABA255821DF981CD5298D40378FB0E33A3DF8A037BC21F0AE268E69F7CF61E7E117BB463EDE3C7D2EF95987C66AC3E5C7D79C44A7590BFCF998683701DAD7B98731DBCB455E61428", + "64D4236F326627BC08E9B2B96C1A9E5BA2631DCCA3F7A5B63736E4EA8074056DCD6BF0E5D6DB8845D9271C0D706F972AF22E652E3B2A7CC482B125EF8BE005F25D5109F6F9DD84DF966E2E0B8950FE1C01E2DF15205EC48BECEFB32511DCC39678F9DB08ED0EFF64C7B5DAED1DFD202F63B6EDBCFB7E4FBB431718BBFA2B65594D78D3983B0457DDDB350AF2C1B9743AB9EFC260A78C3144622C50D528B7D47DDE46FB9DA33D1E7DE6D5829258C2F02D54085AD0121A1BC8339A2847F6F161CB6EEFC5E3FFB12E6C77E5FE10E0D4B02E58142DBE5BF900B7B64EA79D520A35506AF4987E67BCC80D00FF467A0889A14B85B4745888B09DF7B4D3316D9B4A9B17C4CEDFCB0A55E2AAC53B538705673B2A2EE4ABA914E20ECAED730E3D5E272A65A74C366177A711095624A679C9300FEC18E20E65DA3645F23AABEF7EB7C7FF49B289FD2F44661F6F5F689B6E06EFCC99F8A5EAF558E10F2236E002F7D97C316698D6833792C456F812A339166E9FB3B3F61734B98AD2DC9A484A14A6025114D072B68C47DDE97322E213F5D6A93762A45C4C73C7832BB31209C4B1F0094BD24BA23CA9378FB893AB078FA3BC4763704EB6A0C8EC965690CA5B858DAFE623AB88ED39154F46B9030462DEC9070DA9DC34063C1CAB3FB84D60337F1D6D95D1A173650C96128D3C036D0B72B4D2A298186CCA8E1F386E1F70C0716F0BE370A6B325CDFDEAD3CC67E021E9D4C839230708DCCB062096F32C4DBE3C4876A7D1A26072673A6CABDD8D65A5E91CC5E973F00FA67619F749930F9D40B767E434D0955D47FC17BB37E4B7CCE63B1D666AF5D67FCE5FE5469D3DF6B6855F9C308DDFDF6733FA7B8511B25193C27925F3619F5F836014A64A2C8B783A50C6B3001001D621CEC582FA4E52C2B916A418F49ECFDB5ABCA40E1A8D38FE400FC2D0C185009E85546A92E829DC1AD2A7AC3DD23EB77F3D80015BDA4135B1194B10ECFC87C1102B3D366C5460D20D83E778142F1A4EDFDECF3D0BC448CE24A49C609B035A99B64FABF071C58DF592BBC625359BC23A565F4BB077DCF879E14ACE87F709D276982A3D10B23A9538A6A3DEEBBF0B712DB4C16B0FF508F3E4AF4AA759738302D24C6D13037DC81B0394FE785FD14A322BC00ED95E0E9D527FE5316748DD893DB03D5C4149D471DE98C386A2E9DCFF05181E837A1814D54C9CA708CB5E7A10B0FF4F540338BE403E4B9713015A99260795DF5832CCE8D5F763C68BDA51133AF1D012C283E8F4B1DDBB4EE8C351C4AF86FB436571F53B2E80AC04BE26EA617EFA9C5578FBBD81DD1809EC5BCA5DF4A85B24970EBD88D9856B2136616F85A338771BEE80F20F6E5652FAD00F49F3C349061DE3052841992EAA04CE15DB6C48888BD3CC5EF4D6CEBF00431CCB7C5289D79E67FC6CF2DA88AB60CB65D0F687455A535C33547553966D197BAD9778542F6CC7182289AED366ED1CDB0C5EC1E9C0F0E21D4D2B8D01EF4BA394E0C6B05B8EF42D81F773D3D251D6264CA23DA5CA2D4884544FDB81A243974FEECB416D0748449BA0CDC69E56D666FCD24D9BD7C322CBC038CEC658B5253227D87C527473F34BBA3E2FC18784F864233FF8528A874A8503840AAD03B63F79FEAA6C07E4467C4A04366ACD35E32A142DD76A23417EDBB8004944A1E51880CAA97937493EA5BD5A41298863A71D33156CDB942C166748DF66B80ECAD27675A673C8692805B42E97F1B28DCC9BCB58FDF8BE55E2034E73E444A225DDDCA5B46BEBA51AE98A27990F622B32B2C337046E459B173D94BBE5FDAE31FFD4", + "23300D5D80ECA6A471DE5CBA1D29B7010240D95FE341A62FF8175ECAA9566011AEDE6EDA0EF2CFFA7BFF9F4C9AB2C97F6554BB182B23F2772090FE7C4ACB8BE7427E7A8535DA3A670341D88CFE694D1CF40156E9B0557EA317A0B3E21F3A629D1CA971482B1A54697BBC2020BBACBBB9D1E67DC33F52C4B446A36D4331FB02F19BF1A647D05714450E591C65853176A04DD561E0933CF3F24A2E4707C44FE29C5D7706723FF53ADDDC67A67C23769CA32876F0CF31D233D352FF6A7277E5A3A7578A6F2A76456C0AA876680CDF2702B114E02D22D9F59077B9DB2ABFED673158EFAE4C23A75FC8BE701D973169AA7015297BDCAD4870D4F152DC556A06BBBBAEDFFCE40E6BA4F0FEB154F32D8E1492F74EE7085937600EE176ABFD6B8638E983EAD26C63805B98745BA290813CB65CCE33DF6B98240E571DEC4BFB2430C4B8FEC23C1BD5C3E87E0E746BA8A7722A6A660C5095FEA8E1C4978B966F487376DF42C9668E5D3102F123FDCE7B8D80E8BC84AF0D91E9355FF6F7482BA74E0BBA7DACE85BC053F31074151566334B4DDA37C6C51BB947811F284B671FE53FC464CC30DDE59A3D9CAD26822183E96D2F4BE60905B94BB8B167B734A0F0B26AD0E5083A34E68A620151966D073293E5D430D0726C0FE35BA3F1F44D851D374ABD80E826DD84A665165B3B82D540CDED9EF60CE48E87802F16F5DD89163AEC8E9C523E9F99AACCC6F00126C4C8663A7D64D919EC41ACA337379496D0CC876199A86404CE5844F8E2CACFB00A985B92B7A393CE464DB19E0B5FD65BA92D8EC1164CB1ECD994F82396F6A52BE2B66C8780A5AEFC0293EE437E7FBF9BF8880B61C8313C3865561A4287BFCABABB90B3A11F6AA57C2B2A6047F1316AFE1DFE540C4F1D5270F3EE3E023E202AA530211DC51F8C2E87636C14EC8300271A6454A924A8093716756F79780D94DC6863C24C80A405D6F52DEE81810EB850C1F60732AB24209773F66B2D2AEDEDAD6FFF60902910D4858B0F706414F5779590F2DA7C249E5DC1484EC40EDBB01920A5175CB9D74EFF957A61FE3E08DD7C5DED5B299C03299F25E39B161E1DC1C586E39D0BAF38C09C2EC0B22589AC489C3199EA4E66611C45A68A7254D292C78C3978C381F297D7DCD8C0F7646E7AB6DCF155B67F10C3F915F9B3AD96C21379993D8C5D6957847EA81B3BB4BB0863F0CED12F5CC48A4325CDA65268110C1C156F845951AF3C3C90280F8883CE0236FF02DB0CB07721261432C7E0D479F859D8EB7C433F67721B06E001498656578F0E3CEF2A6B941519885BBBB03F33DEEA07802226AEBA473CFEA6EB894F45D1BB937ADF5180F5FE22857CE0EB75D251B02D89E5502560A0B6B012C191DE9D62FD28CF503375F2A1FA9EFE0E42DA81A6EB3A6DBA299726EACC6F3BE91ED51A25EAD5F3E7067720F7D4BB72F8BE2DF978C46E1DFB4B0EA17BFCEFEBBFE40C66ED1F288BE08D6CD0B097C7ED1205E43F8FFB7086120FD153C47272188799D0F4554E9A4131C6B1460077A99E8198B3717AFE5E7C95D3F49B3779EFF9E935FA63A6F881F039436EBDCA2EBE6FE00109B658BA5555BAAA4A401D1FFCBCE0369798BB3BF8B54FCEAA5FE25F31AA02208B0F070270F9E043BAEEDAD4432B1C2DAC9F7B4CDCB52965EC43C2E99764AD2613BCBE468C9477E64B8BDCB64CFCE01C06EB66A15FB034D1AAA507AFB6842AF66AC8C18807E98884C6A780805720718A3A4D1A7B094846C55B0808736199CF4EC3F66B713259CC715B22B92AFB1599B7AD539B188E99B39F9A92987D0ED15C94", + "91CEF241899B4DD47BF31F3BBEF20F5BF13D9A98D3F133AE61F3E4A87A299A6B115B96DA6B2811414D204A49EDA0E1A763E1EAFB78CE05C181DD0947CD50276A10D62543A0ECBA57DAB5DC794AD7006A520B419533CE8519F4EE4194B58B2E36F9E9705266B6E304D1DBC6B73491045548637449E5C657B263CBD9577AD8DB7D5A5BB5DF43A869FF91BB8706D4E81A4F8243C214D9884104675F2BCB426CD785A28F4856E363E1ECC974325487DC40E7304D3D7CADA5DCCA6E60F4457DA181A39801D35F20E1DFA05BC09E7699FA289A87EAB311BA8700AEC0F90950E5FF740DAE7EAE7FCAE8B0D9FB82ABD25BF46FAA635F570C22A76C52F9733D5BE64BA67AEB5D826288D03D8A23C5BD3FD6DBA68082B7815044E24859865ED557C7DE8F866823CD4716E573BFF30067F0931D0AFED0146D55B0B2A3D6C57481D94F61279DC4D2C6DCA1CEE27DF24426E55AB4FFB87068AC8AA6F286151356CEB29D993B4FB26192319C373A1F0F58FF5949783E71671FB58A683DC1CFE166FE1AEFEC8A41C5FC06A31F4EFFFA3EB7C388E1BF99667A5D2697F7132409641AA812EE84EA8735BB46E5069A7BF1B2618B56ACB97C368AA7BDE1BE0F0BF286B6D08B42702F1EDEF408BC529B4158824F673B30E3D3247FA59DCB83D004459CC5EF87BD6C7D188FD91A2A7FFDB008244F8618ED46A73323E9C7F9D5A83298F8C81702FB4523AFEA589D4CC269BD226D04689F132F766770FF23C832EB5695713AB99B74035540031AD1D9D9047D72B1910BC320A65A9F63A40C02FAFE217BA0C51FFE24E96DACE57C1318351038FBB81E76EA34853484E7ECEB672A4180A3D24B6C692747E9D306DD0AF275EC0581A30AC2E80EC73B04B1EF83160FD88DC43406CD715EAB1677F1422FCAB85D1D1EAC64F698B9ED69FC9F2B5519AF9153D5AB722339434C780886B81DC2878B27177B4616450BC1DE99C49C965DC9257BC78ACA052E998493A0CBF7B6AC86EDBC2627E43E7521A9DE7824DFA7DE19AEEA5892685D50EB10128B3D14F3C670F639AF6F2B2F6168A1E551A65781A418ED697E6AB3CF91EA2470995A401B08380CA58B9439DDA7BDB7A92E91016567D57D57D5D0DC4D8E3C1490CA1BEC03FDE065C7B7F34DBC40BF704149A0573C55A0EE4C415533829EEE71BD8C392FD622572DE009044E937AEEDF672886CF4A36ECFE7B0F8BA9CD9EBDEAEC40BD74AD34CCD2C7DD07F7AA64EBF4DA9C8810C05F55619B808127CCA00D171BFEA3E1EC0895A22218DF1A0514FE5D16DC416D9FFEEA8EA3BC9FC650F678EB731E70A6110E138E059371D5A10BEF6420A0C8BD45F836B7D310E732BDD0FE57D93A6934317FD8E2449BA0F0C6E1B36821B62D1F80B9CB6A5B407B6755977C06BB2C3CEED0B14D4D73A3554FAA54EF2C350C388B230B30148605035E4F481A769564E2814A160A67E6F0DFFA7814D0C12772C0496737C52016A93C6753C82FA896BDFF3BCC72105D6EA5B52B3810004DDEDC266F1C90CACF49BA7DB5016A4E485F06355441CA204F7D589F2A3159541F991682E6AEAC0C7359B3282A04B2DC69BB0AD6CF49C48343C8A769D3EFBE8D0814E72934F7CDE698061EC68FAAB39016B96BDC5363D2B53363A548E6476647C10F55611469828564C189430D351CA01D2F1029CA3CE1D2853E8E595D46C9C3EE9F7D3EB9C72A25F7B2138063A0F9186FF41CA9C579DA61772FD60408668A877CCF6B65FC2B88935822A6DDABB97D19F7455A9725A8DF2B8E6B28D83ACDACC66F02370575831490B8D8838D4E56AF36ADF8", + "AA82DC5072A45A21B7880DEA3E2691FCC22EFF3AC815A2576A7F480ADA6F8426EADB4A96A17EB949BC049A646D46926F0D69E0B3E1911D2CE652FF4D9CBFCFDC30065FF4F779DF896D38587B297BE8E224EFB1DFD04BC2D22832B2955A250B7D0448AD9C0A76DE7C33A4E2B5DA1B3A868852B7F04D848EA6495BE8D2501BB47F24E8DC4B254DC56BB5A4760DF62BDB229F3DF0E0C06274A63A28D11F928AE2DEA72A9974E3C55CE261943F78B771CAE7B5B98642A01DBC06111B137774898F0F113A4DB23BC240BFF147568493FCF0C3D767D3548A1C0EF7AA4B6B2DF566C3E94BF9A183264F63E4FBA58B517FC46C4F0017F8D763A54D044C644D6326677A425F0F5A2A7C8796B9C9F8CD0FC49A1F035BB6662C0CCC0E9508AF8D2B834B929D80096F9BFC922BBF1BFC6F101317EC08ECC1DB52404B30B153F43C266D3E64FC496CFBBD350668B2AB3B596B5E0F0A00757E0D4A771F5A386AE86F5105C1718F7E93CF00F588C722509A03597B95512CFC705F08D3B4D5A3E23C56EB461A719A955AFD3EDC8329BC97E3EC6BAB24D97E16A724ED2D4C02B2371FA3ACAF49175A441C3FDE53C2DDA440C18BDB8A6F27805F944EAA7991D404CA74544E2F3A669DCC4052B6770AAD9EE29A6EF7791C6DF93054D07A2B3CB2327B0EBE7D983624639961AC4C3CEC2A84DBB3A10A830DCAABA9600DED87FD5CBAF4D5F1DB357ED42374175257474BAC200AC1B6A5B87D2FB2092458F51185C380B8BFF682C5BA1D2CBF8BC02E5D485FD811797AED167DE6ACA66B927363D12EA405D75A2E9182B1FD30ABA700C5683611A24EC5DC453F523EAEA44C6E06261A98346328ED9E86CA8F7EA79EEC551F36836272127A45984EE165BEF8AED80D26DC45E34E1794F56C1265DD92B4078FD2AF2F13981C08FE27C55C3C9238BBDE193A956E3F834445D949CAD84D3FF0FCD511C6C598735D5B3B07BDD7D437ADED3ABD6EC3171F3735883C9F511A06F4C6C7D0B137DD0D57869B8FB1375FBFCF9C3D08CDCB12B8D01614AA3C965550E5862AF49B04410D25BA4BE86FA6B0B9D9142461AD3CB4BD6D902EFA49632A78F1463619E1309CC89452C2B453BF9F08A714D67ED90972C62C0468CE17006F9B60138D28DA6362670BA3048CD8D099AF193619AA8384A1758FDF4A04CE56ABE464A66E913DB7BBBFF7EB2ADBD47E6347D7054CCA13000DE13F550C6263AA4135A2E16F1A2A58BEF962113C209CF58CE514FB51EC162D05A4DF832697E544037CA18E62A267D81D539F879F50C654E74BA21B47FFA5C704FAD2147EB3DD8617DE98B3ED4859B605310A777F3DD161F4038486F0872AF55FA3610EE0D68C1D51E0F91EF7D9AF4ED01BFF53FDA16BA3197A518BAC0F82F8895A2BDD9FF4C3035379E870C49DA1AF18B3668792B6640E687BB71F13DF1650C4E1A2CC487C247D1D1356EE16DB8F97363465614E9E63F36C853FB63C12963A8A5D98B52BE8DB31F0954B35C3C749A62C2B34A690803FA66087015506225181C5D6FC101D1494C3A7961ACFB4D9B905323DAADABA1DCD2DDC1F9CBFED7D726E602578CFDC1519925F8DBF9AC5FB4E4CA723BB264B5D106B6206574C46C1A49309C22E1935904942C36148F764B59F10A5CBA0C9397F5798E200A606EFC75DEEA1FFB10A85398E5BFBBC6AA3619A0F611E591245D03B6ADC0C50440A1B1C236ADBA933B2BF84D2C60C807E9F52436904BC62B813FFF8B9C824819C760D0BD636B10572C781B112CC0C603A260AB87986B0280FB913A9E0BCCDEE347F0C744BF8299A9099B8", + "F2A17D19ECA96F67ADACC0D83FDCF235F07832E8E78A44A53F9C4CD09C3F88DB226701963147EE0E1AD0F549E11BBA70053A105BD62C40DA810BA37BA72D999CC4FF9BA4D01FCFC670E0D7819871D06C4935C10B85594CB7202F037B25F85141A580AE1CB3E0CA91AD73C6947D2492B8FD2F889B1421E04FF0FB7866218A491D9EF6A35DCACC12CE098EC575C697F5F8D1BF9178B3B36C999EADFFB5CB3A41DB672165CF73A7874FF68B3B901C4E9B8112EF4FF9B9308742ED678DF30E2F7C40BF922099C1A95BE0C231E9F8332EBEEFD99C6DDEF25CA5EBB2985A9689912616815AEA022BFBB87353B8B799D64280A6922CB09044ECAFA51037AC2FCB11516E9E286F64B4CE3E30A55191F24AB53F2E10E5A8920FFBAED77FD4C476E9AEC751763D68409ED9BF7F435E53D401CAD787A50033BB8547C910D90DE100FDF6B904A1F529830E3A51919299FD4476F02C3600AD5D42E3E154AEDCD1C99C1C5B531FE179860EC1EAC69EA0381CD4DCDE8716F94D6510F10FD1915864BA968440CCA6D0D5AD8983C421079B033B56FC34481B9F27188F829F91DD73F27BE8E0456B0F75DBEF40A3C67F274F6A50CDBFFF9798F8DBF1A6CE7158B577550E40639D38861A3CC4E060C9E5BC1F0D3760FA9A89C2CF0A23505F4A642F5EB0A055B96843198CE20133DFE022AFEE043191007276427DC82E877BDE27E20D65DFF8232E9E4DD786C23D4E8B5E84637A22AE5562651BA45369947C159B641710C98494ACAD48B4AD6AD9828897437AFACEE442DF2330669D5F2C6A9893E08507ADBF104C62F6B4D568C5381B28D5162EF0FBECF396E7C622B54A7864F9B31CCB396A0DF82AB86D950B4657237FB769122BE6B783ECE3F798AF68E354C521C77735EDB97D580CC80877ED702231CE2F8B73262AE39EF94E84736949292E065515D40A16BAB13EB9437D30AEC44AD8C67E3AFCE9AB377753BDC481E8E79EB10F89A7C4F7AA24E6FA48A36DD1CFC02CF3FF6DFD0CC1C4030C312532A70B60F678FF2B3586D77DDE74167CFFA62C12F7D0086A6FA59B36C6A025DEA1EA0BFA9861BEFEBEC6B2601DF225E29F36AC97EBDDB21D7E8206E1EC42F3B9CB314E7AE6464D54ABD53D090DE83B466FAF5384E0FAAA6E67F2FBD6A72E00D9274C9B5C768DB4AA4281F25EB2DC6BBE0EA85CE1CD31B32BD1971D6AA20B6C68D66426F09C0C1128A679AF06CAD490DCE3A2DB50181278BC40DF9E094D1D09B281CD1EF1C369E5927407E04918BD21315E12583D7D845933AEF186DAF8B6609C3CA9452857DD2112E86227422491DC7821D7E41DF759BABE6ADD11A4C771CF16469F86262D169F221D97DAC9686B6DA29568B4A2D2579C76CBF948C321F5158EB3FF5F6D4D6D68FA255C81F62A8DD605507D0C6C9D82E6AD258B32DE4AB6FF8FCC4A8C237E270B9673C208E56AA6F4796867762399FC8549DBD232B2CD0F9957A8A24FCEC6E8B3DCCBC67085C542A134F3E80A3CCE8D3DBEF0528432F2BAB2F5DC89D6015BE7F24B2B1F378EE75222EF125A5645AE37AFE6ABDF84CCC3026507BAD9CD8C2EB4020E7763E0F85164734C851532FFE705C111CCB7D738BA8C0D29C5A0A50250D0BE53353A6C407D4F7EDD62F271F099528CCB520E5B6B5695D3FBE628FF65D67CC0D1B766149B9C89D3C770AA133FAE2BF3C9846B30C46584E9F93A8216627CFAD84C37AAD7986B8D69F83392FF8F98C828F8B136633A09718D375327B98A0CF8B7736D229499A52D91D19CBB896A5BF4131691682741797A25FFFE6AC60E30C79385DC778C90", + "3D84AE0F7756BCB2518300DB110A07EC46869AC35F1B02650A36C3CA0350356E2808B84A0D9A8A648F920B7D48AFBBF6CA9A37F673DE2B6FB15B189FBBF2444BDE8808118595AA995AE0DF53F5146B011A0AF5B7FCB4B3D3EC074F2DF15CC9708EC50EBEEAFE06F7A0235A50E2DF7F6C023B53819AEA87318C4E67C4742FDEACF57DC539FBD5BA01F64CB45322212C707923303D96E58EB95F7392292885391283DD9477218697698AD6D83AA96B06D68F58FC2B8FD9D61E75337C6815BBFA8B76833FE1856B714ACCB6FB1B5E957DD385658AC760AC5811E3BC079DDF2CE30BDC21AB8D2C7B56D2F6B384FECDE4EB0206A6C00282950C1B72B3E464570364A919812E86BBFD0E1CB2DC98D6FF42617355F2131F72A11F50618CF21A4C4961083FC6BFAB63F544677428BB9F10FE341B947C41AAC1B367E338CC2AA08D6CAD1067F02654794571FA4AA11E211F5E75D194197BE4AF6543009C40EA86F74AEADAAB134CA9E35D79F7CD062B53BE2AD86FA7C2E30D9222A494A25044153420AEB6C8FFC4E0D4C514B8D9F5DD922D8EA387003409539D0B40210B05C9209B008D3E47E8F84C376F46001FFE463F21A92E34D3345751E8E94205EA06FAC16292B8C6D4FA028867AD4C4E8DE0D51BB7AED59547707CFBC2CF3A9235C29EE3A3873B96FB75DD50E758CB2C7196BDC09336A97756DAB994C46D5BBB87F9D80008D09C603A68022BADB1D2F6B98B6B76CB3C0EDAEA07A23065B93DAD67BC59C9BDEF7BDCDEF39D9AC04C9CE8F6DB4A925F77BBF8150AD478E3C6D7D32512ED75BFBCB82C66D505CD8BC5A5679014B355BDC66F365BE9AAF15B76C0CFC0B51E53F86BB4763F0302B448E84B9792F34442743E2D979C5133514D4BB1DE5E8AF938C4CF158336D04B6723F9422161805D5EB059E55C86D0C461399073A705FD6E919D1760B2D6860D65665B486DC0AAD8F7B3ADA9BD681D7FAE4185350BAA543E9F8671F1B4BAEB6D18674516033B2E2E4E427521C290A6E44E1EAF9974BBB360FEA3535CF46D68193C0E208AE5B2F85C2049C906725C92F598E6C0B67DC5F8B7C48CD411E107F4860CFB3C4229A44694ADE0E31A4FD70AE5702C0A7710678763B035C5C6B4B9214D507313F5ED85C444B98278B40446C861057AB9B897638DE4739088FC28A577CBD52A3910885276A2DC8DA99EC74D30DF707BFC60663C869DA4C47BBF4D64A789425C5C894EC2B512C3296D0070DE4942113FFC0B13D03515F2B4EC07A0E3BB7AAF08DE24779F9EEBE26CE7C316EAF47396E538672BB646E1B2016356A407B8828DC25D8F8A8296B4F855290131734C94CB92CBA5689574CE95B60988C42558DAD978F36D67BDDDAA92FEF21282683EBF6D59763384781EB4D3431DF5BB909ADACB397D36D55D2ADEE537D7B1B942F3A815917A388B12285689B40C3B45C04A591672A2B957F924F1CF6049B96A38E304B8641DF6A079614C9F9984FD9C9F0A82ED6E440164AC484252B45147929A58B069E663663CEDF0FA44FD67580BFD23BF77C61B95B533107A25684FDBAA4C1285AB568C9FAB387C6FDDFD5EBDF5AF1CE094C59630E19F621CDED14E3847BDE9B0EEC64C159F23C779C4B80163554900393CD7F1B885F92F183839CDAD7801DC7FCFD08B7E08D23BE21BC80F8655A2F3BD0C483B2C1D23D447682CCD9CE098AECFD7BA7C48F5BDEAC8397220A7852077A8D7933FD353C25E37DAA473E996A5920DEDB80C26DE4FC3AFBD6ACEA16DD3208C9384021D9B1FC1C884319B59276D48D8BF5A0A37D84B8C579EE0D9BC", + "446D385D09A3464D1ABDC6D6CCB015280BBE7DCF00078634371D7F327322DD720E8DBD7B8CD97FB9505A118B469762ACA10C4E135ED782FC905EF30F9FBA82F11AE679431F270351F70F0508BA998AD9A71D2BE05F55348B275A0E537C63699C96DD8AB8E0645CA2606E35805F66CE586C81B4A65E2EF036697A18DA49C36CB22404497577107924DC02FD87072490D7EC8D5B376D0C3370F9753E0E7C781952C03D844490370D6853FCA49E12139805C24FE9C9914E3CF91464D332C934570DCD5D1C3C609C6984E28C9BFCBA3669B75452478DA4099CFE0F6311FF782D1D0123A120F657CB536A3810984871B69D25913C305117A7E51D199A56387C2777E349748B9C2C40DECC03DE7235F7237CF43FD421039743CA72361DFEF2491953A3C3F0091FE3EE064B838BD73E9E6EDF8FD90235CDB374892BFC42759792E5636D031795C0DCC70D7DB86C161FE7059CE17B6926FE5D024D6B1B9DD5608839DF85C7802F5655525B633BDAD0803CE14649095C0A7F870F66888C072C410E0E0854238BA7FB259901CAFE3570D398B621518193BBDD75258BCB53AF2789EC66DBE2311DACDC1F9CDB6DBD4BCDCD15F9C2E77E0D2736CD191D2B83389A71B1804A0FB5F2480E38343CA48EC6D1830BA3466E53FC51C4EF05F4D10711A78AB215650462E9A26D9301EFDF15A3CD5EEE14DDAFEFA45171BA3A757CD6FAA5887A5D5A98045BEC7FEB331D01A997282910B6B946CADF0AEA57973520EF0561B233BCF798805B3B048751EA086FA71BCAAE15F8BEB837CD2974EB3E54D3B6D3F99A51F88313FB64218610CD1831E2E6E18EADCFCBE72BE5818B4AE4F3780BAA7D8C4A55DAFC10ACA3EE7AB7D1337506C485C83EB0C41748C668705B4D41D926221D33C31BE7D56B42BAC7E9240FE4C2287B5B41FE88F9B9E19970D0E4569DBFF167EC42BAA2566676EB055B69D159358D23DABFFC86A917490B4942A220038CDADBE24C335DEB895F3472F0D22778BC79B169D1EDA9FD18B31DA66F0246359DB3EBA36269EC5F92E5A1A89560C7DEEFA121A7035EC2501C553854724C5176AE60F87004F6FAEA907B91D1C58837C9FE25BD9C32F66257BD78169B1A4B8ADEBA72B5699D4C2D14F67BB347EC8A96B04278AD9F97A9B40DBB56E7593CF4B3C905108F10968F0AE6A2E7F1D214FC7B45637A256ADA5EEB70E03C02DA2ABF86C36E581A31032DFFEF4343C3E59EC7A2A715E9C199DAFD3BF8C9B43C1D016DCD33E2590A20EC8B657C08E5C0C0BB4F159A07206504780715A252D1F4F5DC65ACCC43E3CDC255123A77792685C9B68AF281863AC89ADBD5F778733E95050ACF781FFA386B3EBCD633D6E8E6D4A42EA85F005AA80A4597D40738A8E8823FE3C84B10CEF044E9651E45D1ECDF59C537AACA58D2BE42655259DFE6CFFFBDAED252254B732EDC93B4D610C50DC81B576C5A5C5BBCAC0BAFD7BDD7771EF1A19C29D7A82E448AFA07E7FAA8651C11D1BD550DDC69F4C9C6A44435034D80B47B512155E5141378A94CD277D4BE11B2A383B1539AC9731079624E81D3A3404F5325F5D2EFBC0929F510529C84B1BC3E7C08F661640E55AC49452C00256BEB49B7A52DA23EFFD85B8C303C6EEDD2202768ECABBFBEE87FBF1DAA992C8439602B1645C462D3297DDA1AD941617B508E481A28D1540212CB281B5388A3691A26AD7D3CEF52FEEE9F59F477EC98AFCFE38034B762B9D4B5DF3BB312758C4238EFFF94BD16D9C39655CF07263CD6DBA96D1C0EA425610C1FC81061FAAC5C0F8E6AA9591EDE2FAA1AAB8F76EE18", + "C514F282EE4B5E02A90A2AE126DA52A9FF5274735ECAFA74CB36D607EF299E0227E94B6CC2B78B1F71D6B5FB8BB4C78C09B3A6E3ED6CD590AD526F74CBF869085F2BD3A9DF66D7DA9DD06FC6748D8FBB78D98A4D860B362BEC6295F34A6A16A58BB21C9632F8B3A64370B7A7547E329B39BCC82D17B82F6E4ADB514444F62AA800C97B748D73B0168ACF2FA898C262820F8981713D00CEB8453E3E9E452F5EF41452A9C8CD1F1260000C4CA9AF4E6E629B13DFF203187C0DEDA08315AF24181015D2E68D6AA4E7E938FC4FA9A8B80CBF49E3A9F27953A05FC7609146EE39F09FF485015168636D1F452FF311D4D8749C31AC8420865A87A707E540D7FDF0D25F63C7F3AC906E048281BFEA46263B4350BAFA8B5A27E0CFB23DE145622BC2FE34DCF4E1B4DCBF60ECD5426C27B3559B73A59CB1B71587C685542F5E6DF9FE3C5E75A8E9600E89217343D29C67A7AE80F9A8589D82AAE7B2A1B8D6546D3CE2482DDABCE7FFD3BEB2F1009297A77503E7155ABD4692F1244A49AB32628947A681388AD75A750AB92C81ADFBCED0AF166326FADAE6B79070473D67A8FCEBA7F21BBA932168CEC2A754247CA324081900636D87D001A605C4E5C31AEAA44A8DB9693617566726C7120AD15D96D917F5ADD0D86A5A9CDD7527644EED58A9BED014D9F4C0F62FCAD8D7D5DA2899D57C5510EF15B7482CB3E087493959AA12D73D55E194E48CD128FBA2788829AB4A86C325D60227074EA55BEB601128D5FF42371E74972B802D3117E1F2AF2018177D4E994903996DC365D3B52582AF2085EE5919DA7E84A2F3A200F4F6E76F11CC95F87BD2EE5935CDA0D52D9EE6FBA6D59E80427EEF4B80372091C65E059B566C38A6B3664974396BD0383A35EED0494C2BDDC167725C4160AFA58D408978D5A345EB03A55127C6BFB08FC0B4EF7037482EA724D9D121E26F2249C0C7A927946A846A67FB7C565E86C8C59A49265ECC4927A8FC88873DDEAEF6F8B629BAA1819807F38AFAC501EC9F206346581174A037B1D7EA56628C660E17BA0A97F2E189299A7844FEDC562BE678B0606CE18493F717559365F66201AA598C68F99A8F28AFD74AAB0E3619BC342AE9F36D3811EEB52C8DF6544C96B679CF434B9C64FCA0F43DA73B9BC8FEBD609678F5E691AA706E3586176ACDC25652BCB68D98417D3FEE12B23724EBDF496D6AC3B35EF706EAC11BB0090066F3C421C3E298B00821C90DDADE472331B9B2CA1F1E53E6D68BFB059EE0811EB7E7FDBEF394E3E35E59BCC4B63FA8E09851843F28CD941F9A97E5B72C8DCB9D32F37B79DFDD1B9D7C22C10E6F65DF07DBC7734430B811BCDD450A10F491B1E0DA3746868622E457774D0BCB1B29F9C1CB161DEFAE78354B7F718D18F07ED6672665D35562D6F05A2B3666B667A7C57D2617711F27DEC15D0A4079519D0ACC6B3591EBF0A61A12C42A6820CBA755C07FC531610C4192A0BE9BF241BBC5ADF758FAA4DE47C6B766AFAD728BB1D2C672EE0969303E42AF789FB295E766E90319D98F0618C1B4B8BD31CD2C5EBABEADA30C6E43D03F380F4C2B9C3AEA20BC89B852BFCD042AD3C9440AB395E9E251DA758D317E39792973083B20B79BA36A14057E1DFFADCF903B10F8D3D4D35222E4584D520D6FF675D3EBE9FB43ED1B79252648A5E0C2552E388AA3D1168790A09854F1151A94DB4E5AAF1C941FA61B196D869B16051B75F56AC1BC769C6E7A7EC173264A2E56BDE4BB9952A422855D65AF1C209D561F8210FFD7C2FD6A540BE788BE3D2822D49DBD2C6B33299604A835F07A34", + "0C0184CC1854C2013817663EBD9E23F3B78DB8009E761F1B38C2DA2036F26819D2DC68AC38C18FC15EB00BDBF5A11316C7B6075BF9DEAE9B0A651527DB3E3B3039BA01398B3923A2C40DC4706A0BC186D2F8FFB124EDE35E8C427FB6FF05A3C2ECB81E275D1AE370AFDFB6F731E27F4B22B877B1990FE479239526C655796BBB8545051527ED0E532E0440048912C64D0913227C2F6657B8B80FDA076E49B7E3DBA1D0E23C9D7F43280A324DF16BEE2A87B87C21692FEACBC3348C9186DC6C0BCB7C1DBEC60AFCF4F1D76FD3D45A24ACFAEB8E7C95145D07427CD67003019AB57DC233D566BB9A20AB82ED4130D9B4C0FAA6F2EFEDC8977498315FED436F67F3B170877040265EBA49415B1B2904C8277A11598432B973AA63F628456AF2320D3478FE669E2835C00D13EEC7B6ABC6BB94F1677C9A05B2D0CB87ED3E529AE1D2E3354B1E30C6634E10AB3BB0F39815049DD5321B11B80CF1D1F1426A413D0D11FAE969F3BA266F4F7B60684224A6279380D08D46FFBA2E1D684416405A02A2AB2E260ADB23498AF716EE58B03C8CC442DE0EA201C4DE39FA7038EA4E0E1544BB08F149F57F03FA910E09C27303038EDCA21A618A54DA87CA747763EE6D4D1DD4912AB7E3BBFC999939F82563B944CFC5F4460D41A47573DA92CBB28439BCDDBEBFF16491C404B356E5889D33A034680F8648F2CBB1888FEAFC410FD5A3C8ED85B90EC875D7D4466904F5D4A4048D8DAD848313232B80FEBAA09D4D86F70045C0C2499A93610DD088A6263DE5AD71067B9B3C82E20658AE98677889BDFEC65C2574E4AB7C9059F1C13CBEC17EC630F9E5B891DCDE1E81552738D4C8612F3BEBD570EB39B24EC94A153465D1326765D9B8F23D7E4AE3F2782F6F9738C189D0D20C4DFCCCD37D9A510250F0941423CB9055C7BFED84520AB119FF921CF81CBC6967E9CE1D759E5F4481ACCC5881F9328093B63ACB7D04404D8C0FAE8747D39A270399000CB690CDE17A46E81DC5CCED183BB863FD7A535CCBC592C25B059496C45DAD179B83EE02543B5EF93213E10E2BDD480F7C7D007CA2988942F65E46B886EBCEF05498C655048C4B32A081A059A28DCF4D84AAA586F0291F322B25D186FCB5ED2DE7AF7EBE58CD8314CF846AA39C67E2F284162524A14BD2765642B31F31EF4704548C13D5F5A132E983203EEB91795BCA934BA7EB26DAA5450745333446D2B86ADE99788476A3417DB7FE9E53F4906CAECBBA984657969B4592F9213612AE6812C215D5C6E28BC89BB76B9CCC937BA4D4C6368CD4C491BDF41B242BD8FCF9DE2D35907F08AB80BE71EF90F84BFDBC6777A020DC97BCA1E963050FF991A4F0E1E468813AE1CCF05B819012377334AD6B5A41A87A7D7C4F0AAD241FF7D3AFFFF40D7E6D5E62F9884B63E23C3A8B96260A6E9E3BCEC001D487E3E75DF4D35959633BE719FE592C4659970C0B67596E9CDA4EE3B05237C02CF2E36FFDB7CAE37F0BE993FAC46DA6F56B15FA74EB4511AEC2C861C2A9253259268A9BB95468FB02867394AA8D83EEB6464A65CD15DAB6A696FABAC4661F439F377560F3D2F3B668A7648BA4017DB5083BDD0D76B0DE99FBC06D7938D7D2F0566D3DDD036CF6A5E336359F0896B9B1E3B685D963A0EA70CAC175574C5AD41E20EA1332CF103BDE6B1C3B3F117C21E8FE7450866C5036C244856B5FAC176671270EF7225BE7CC36D24498C92E5306C2870FA7839DB1D7646A62AE0623EEF3199E8DBE32020B71F23FEF2F2BF3C9E0EBF0FDC629D97837B97D76C99398EAB044AFEEBD5BFBC35FD4", + "8767E0FD01FC0DFEFA6640DA0B47AB5B2B2CFD25C8943FDAE6AF46C3898AA1FD2E2DD0FE19D1A9BD0353A16ED03C448B7005D56D108FF2035E948E3C4FB8F0F928A5797D491389AC431F271DD1C8FDDA2B1FE623D410190FA81F74E042C0BE9F97F99120DDF442D5A4ECD1EC9789DBDFA8C8E577E0AC5A1BA7DD6D5A474CAC3C2C04E71A14DD2244A30D64B17E4C9B081EA8AF0175D7D0A6E039B6A289EFEEAA20763B1F106667745EE2795CC588721BFBCA6D659D81192A02FF2CE11CC878CDCE73CAC9B92A972CC9340ABA7A03C3384ECD28301103F347D35FCC9B12B85FFF170894F7D104F34D95B56A23C486CD9E7520EF8CC0BD928EACCFDC5D230D77EB9B19EE274113E1F8BFA79FCA93EF54B86900859BA6688FD29444E03E2F14033F076FF2F23711129099051C59E0126A907B57905A021F024D98736C3F5D1AA11C25F32319546F91DCFD4940FDC7C4428CE78A998694E6B19AA3CFF470AE4582666D350ACB02CFECD0E9EC39D1607912B892479EF94CC67797F443EE6BA4008F46C0E61C3819C5F82DE7A7802E62E7050C8AC506186878F08ADCA8A7674DC3D0D156060AB7BB08511D2F8DB46EAB9B46AF359135030A9EB46A6137A9419D97C7069147BF5065712B1F03BB8B328CBD1E583F59B662B64C0F06ECEC8B71AA2213EC29F8968E0F3093AD04E739F01DF51C644FD4CB65AEFC7073018DDAA81185627B613242260CA7A9270FDBAC3EBEF62865D0341B5392DD5FEA4827D60D5AD1C9AF0739CF5BFE0F658E72C436BFABEFCC403B87AD4B64F3143DBAE1D2CC25130E65D72ADECA1A8FDE09EDFD723072D538792F50A067BA78D7E4749F0344AB1AC1CC0E8EFA1A42515877C4539EDE35556D444516474628BE9D8B29DE428BEFA12EF99C985F1EED4F937BA4794776C63033C03EE356991607473835A50718E473D036F3C522A9DE2E49FEC2E686F17A5023FB7E82E94B26A4AC6236E0B656A938BD7A8575D734F53CA419836110DF78197D7DE4D45B6589CC31F5057759B8402F43ED9A423A7D69DB02EB9357B1E51207161E08FFEC8FE286722159C570ED4AF63EB554BBA582404C0E978CEAEC1CC1404CD15BA22EE6D8C98C4278C1714695927C2389D74BBAC72C2516AF1E5D0C52066A656170091B68A7E4C8399ADE63605E9DA1727C189C541A404B7335DA27843A32E470FB4DED8EB5EFCFD30BF15AAF37D7CFF4B545DD09DE3E7C8D0E77427B3C0764608912616E5DA2A3B885688F25E83DC8D632BC00015C2C8E6923A3D9E7C7344CDE87D6F0DEECA2006F644F7BDFA0A524759B2B16313501A1CB8D4D762D3E9D9C8D32154F69F0DBABEBD26AEDA947485FE0B40D1D7731D7F4E41D1EA5FC645DE31CD850273B6EF9C374CC8E8149960B349BA16FBDFAADFF12E86EF05AA38B6B17EEF7B55D27D7CE27FEC916DF99F0715F1DDFB93C7E1130EDFA44663CF19F4008D5CACA48262C1E8209D0C353ACD72A542B93EF18EC7E15FD4C9B1633161D94B285FE8CFAC30FBB1E140E9561A35715AF982370AB4DDF25BC30850E5F0509297289C0045BD3B3912843A9B0BB88CB7E961639849B8A0A75E3E903182F0CC6C7ECAD4A38081BEB18DA72EF9F9439DA7DB2B4D59AF6CB71808E604E56E1D4BFEF627226FC28875888BD486D0C8052068D12BBEC6B27E9DCDD73DBC93D33EE66AB63936C2273525A517280FB4BC33A724D20BB7D988B938018EAC4738D03D583A71C16671B87CD60BD6FDD101BF2AD07492A794FB8696E84CF24B9707D7706F0AEED606C3A7FB5B1DF7FCF86E65F6DEAA4", + "CB8EFFE09FE09C622B34574E74D4B061C284F96FB7937481FA7C204F449BE9B2DB0957E428D177C5525C67BD75D75989EE98D97C4D0DEB5E72E2B0DD62E66EDBEF0D22D2EA97D42A3374B9B659804F1EEB01D7743DD9AEADDEF356C7C4FE94077411DE58DFA5035271015AF65FD1D78C0F17632C10EA02C537706A7C14E3A1D7124FCC11F579333A68A1AF70BD3E86F7B1D13A3B4EBCDE343F36A2B226DC53A0E1A084EE966272EE852A349D7A5606F1AFDBD81B8C3CB556DAE83D6A34ED4F9C06BBFFCD5953C51814FE0F4CF5A697EEF5559886D92F811004C04FB399E06DFA845DEF183160BEF8546F6E8995E403FE0E464008646330CEC4B4149DC464F229A47E0CD9F89C83A28FBD0C1E758D380C2A7C17A487191A46C04C23F7906418B69E2527F3293588952919D220EDC36BD9687C7347AEEEFC8CD24E91299900AE4ACF018FA2829E215CB13CDDECC918DC85BBFA317FEF7D2FFA9E3A30D9D1F1B9DFA0AD0D641E800850B43D7E0B187F2ACFA74FC5DBC99471A7511B838BEBD6E2744C3AA9AA9D46060C83FFF803C148C35209F840AC23D60FD046B461CC2D776AF51612DD166E1450B8A998052EBB25D1C8F426391A8571C88C2012A8940CB0B4DB3223CCB39021D20142FB5039A6ACB250994AD7A99B1A43494EFFBD8D3692F213B46C6CE9AF3477BD6061398CB19C099F27F48F4F785E9E741988412F070F39727FB8B74071E007210D939B0EC5D6148A5931D38A030374E5C0B575AE27D49DF49A77245BE310E49262C56A616C757A80C5989F27962303825EAA3AA014A4C9C9E5B3CF93F1A031F82D6A0C877277EC41356D1BE2154F03D807940A1CB2848A6A23B905BDE9A907F7C20E333586389014126765CBA8D5C8951CE09DF085B5F18A24E1E5D638651687CD2A2F75CBAF738F65A8B24E7C67E64FFD9CB8A34A473F11996E3663607A49EF663C4D87A0F65D92067132B5EF3CFCFA9B49FF66CB6E363BC1C7EAAC392605200A5EE704D1E754CBD1C9CDAB75355BCA41DC129722F855215220092CF6248609DE9EDC5603562F5C82B5414BA305CEFA60020E1CD93FC756241FE7A20CB4B550D980A7266E7B23B6FFCFFC4461F925A14EF6584B02005E1D795ECFEF93312B3369C52A8A2ABF99AB5255E8E09C05AC722F37A5E95AE46B226C7319411750562DBD0296F0CD1326055577BEAAF270E75F4433D5312038854C30AB23BD51F1246EC46599FEC1B628137A73A702606112CF61CEA7C3977BCA6701C8E5F63132C15EFF01CA1EDFA5CCA8FC0E3FAD392F21972F857B53F62CAF3BDB75D556E6857067015E11C5E217F5D1C1AB1D603571F9EDDE04499E23D39DCAAEF16263A5EBAB9BEAD8F61B0ED942EF261E0ACD309A903E73AC4E4569A65FE6490F6DD6842812DF61CD858D9AB54D3456C89CFEDF2621426E3F9D13FB94177104F6EB4E30B018C01F78CB4FA9C89F453B87FA7D4716B96B0BD2DC532D4AA7D8FB9D264B095BCE39BA017E8BB90D600DD2C58647B9D95F63783B4B90BDB83A175E5201784AE000A493A387E16F5F0C5CAEBF62A360A6A927B3FE4CBFD310A3163BFFF1836FBF9770583FA4F88E5A6E7BE5796145890A41FAE8BD1839110EC05C325012E19C69C3868C7507D04458C074DB3440A0E018A23CDD32ED35E7A28DC8AA8BD63C8CD0A9F4876B56C04D5D3D5CE52A0601ABE2AD3CF3106CFEA6D761335F420EE3D277DA358DF4F6813D543424653B256E325346F677EB7F69B2FAF9536DE80E8EB018D978484509804D600783708D48C4F7100E0AF891BDFC75352C", + "93EBCDC22C36C3BDC8B579B31AD5F5C9B2B08218BCCD1B29829A365DF4A8D5259753381B6786877A5250DCE6A2B182734E363B39560D3DF44E88CD6394324765087DD1A77B3D8121CBA61F665F9B719E75B740BD930D6FEF316325B8B3A2FDD93AC488714AD9AB525248EF60B2649B70DDE6849BED793264062B38EE74270CC190C6A86AC4E106781BB3D09F0A6D7AA4DDBB0116D3452CE041BFF4247819FD8D78304088355D8DE741B1A6461C74A4832ACF4D4004BFB22F6C9BB397D7CADC6FC05AB74919CA346F9A54DBDA80F8E1303A1D43239C5DE043C2AC21E182CF49BEF9BCFC109BC884E41FE2D8669915701992200BCB938A745FB0994E6AD01187C4A24212DA421A178E42216287DB1F6A25E8370E4209E09057E16253BF477A061399AD1B3FE985D6A10D8B05FD94B67F878649862D68F285EC0BFC06B7006589A590AE7B116EFEFC871010993F4768197473BF22AD54B2A8FDB0BBF2B181A2A1CB9FF0D0989F2F68B339A8D8B27FE1781F3DD6F7CB972D73E3DD702FCD0CC3CBDF66A6237460E3B2F45DE273D2BCADB96C118DCC19F7C1E703BCBAA04DA5370A5CB3B78112B8E95B63328B43C51557AD84B3564749C2802B52EB33458394747C176E119E1774BC905119312963401C1DEE02964DC9F1D836069CFBB9B33791C908ADCC717B08FE3C0AE98C0D5DC0C22876595AF95A02AB33BCE3502A92E532E72D0E3455A3D7EE796B3CD5D61DB902B8C0057F2D47F2655E95DF55DA562F632A4F9A2CA8B1D2DB8F5745A71318C37043D3EB08F9950D06C1301F9E9FAF4EF560B238BEC483DF0E017E3CB27A251156221F183F3E9B0581838D04BEB5DFD9EFC26B979BCAC7DF631F1ECCB777E2617EE7386C8BE9834D26B96D80074BBEFE8CBBD203299AFAE8E6F90273B92182CE7EDCA9154E0A33AF9981B8CEC94E6A7C78C4716B47790EAFC771C3DFDE276E4E617CC0DA50F05099B9BF587127D1D18D5F892E0090C8D033F21E7382738F1EAACFBA493D776821DBDFCCBC24B1D5F877B157AE6BF6D307AE9BA54CD053E68594505D038747A7D8450EC3CB4F2E980C5D97A2AFB31147906CFD3E9000BF166EACA8D16A532BCF69526FB4B86B1F71D2C5F38958EB11F9ACC438CCE14E88A11DC431CE4E20B99DF0ABDD2B5AF358260A64012F4A408C6840D365AB95167B54FD479E8527B5FF662161F75FBA7CF790DBAA51613DE7C52A2A94E4AB78E051F32D10233161A4EBD8682389D091B5C4509171650ABA574F1FE954698268450E11D2FB52C1AB3E4DF426D26DC6D5319FB762CCCDD552F4B1BF4E82AD1F78606C644185AE87827F022C9508805472136DC48E71D1C45944413485EC1CC72BC092D6F9990148E12C2A3FFB3D8C9F91C18CC9086F176733A83F2CC9BAFFBBD810A99B66DC3B399891B2045BA402749B55E7E363F5D062427A9BFA8B599367F1D07A38DA16074F75A4E095A528C26DE4083B044055F73D207A6571196263D8BF5A53B7679791BDE49E869F0F58431829396A34415CDF4CB986281840BC48857361281CB4BADF8FF5B86ADC76FD3A812D7641C5FC88A21F137A6980B42FD3858E2A057BD4D3FF57A5ED3F5C41C71C70036E1762C0079DEDE282175072A073A90AB83C9DB447AC07E6BF99DB04BF276FD876F4E4816B0294333BF3403DACA2077BCAC3889B55E76D62F58DE7D1C49816D03DA2D492D1F3CDB2B6B186439CBBFAABB645E9745F404538BE8FC4C698765A3C67D01CB54D404D2A2E78098FC334F0A375EB41C3031F57FF9A773612445AD3D98BD09C949616D4", + "5D55CEF58C74B4C681E813564F1903FDB56BE053280D438BBE5E2480CF279CE47FBAFD179E270D838F764C2E7F496AEA9C0800056F2E0456EAA7E59CB20432B65875455975AB37186D6B06FC7D0BEE743CB974DF92B19F4D2EEE82F36598F8E400DCAACA4EEB110ABE352D3A0F58DEFF8D51DBDCE5C23E84D1166FFEE5428541ACA407B9578E4295C3F79F9376384B630D25F11271C6234B9AA9C1B4C8015AC2C73CF768B9EC30C61BBFEAE1426F72FFBC995A834C9D4FB8350C301133F123313370C33FCFD711D1847CFA84E782F4B39762A02F9476D5F45237A29E3E269D16DAD60033E0907D5431C1CE36D37BD388024A020B612E1DE42492A3759AB82AB393237F4A1AFEB8217D2733916B7B610342C0D182C17BFBD4556B071D82E6C6E554F2127654C15671FA1A843347BDFBF9498C7B5E7636318C3EDBAF7BC4BCE123698A05538DD5D42F01970A41A75F0A46E61520911D86A39D892700AA23A033EDC836EBC17CD2EA274252F53A4BFFD5CAD88F8066744C737B364A0DD0B5FFD96787F7D18357DF728FB66B212DD4DACAF7218292216808E7B81E3514BDA947E436A301C4181CE53A298250835AB98DC89D0A3D6240C57C699A5BC31EC4CBF8C111149CF6802942256520BC7FA22968556E2B390E63C9DB7D0AB79939924ABF068BC3D44264D607F088A38FA67F8E25933091BD3EB0A3590F3E62E63CC6C66AF66128F7C3F97B76E62F1AB82F24D8C147FB2C8BE207FBAD7E5CD355230EFD48DC9FDAA4FD1C970781674E901D35D7C651EEFEE2356F825ACD348FF0FF590E8CBFA0332F77A063581E6F19F53CDF1BFE952585E93EA13A83BBAD06070850EC824397A9FF13227F4C60D65B67AF810EF1BF5D5EA95A5512F95AECAEFA25BFBB24CBE6785E91A4874E81E465AB91B1F2E990F37AB145645F2681B47592990CA78264DF8902620E796D4DA9A260D1BA67DF9BB0292561FACCB2478AD7F7D7CAB3DF179897596604F2B0F1E3F10CF842C311F49C6B5EFD5D73DFEFF59127384D3B4D855F8C412E949E3A941782C186413946DF8AE33C9640704CB0D930C12F5FA1C4CEC5883CDA699E294019562948AB028548FA974D6C56AD667023F9C417F067810C4C7E4A712FC3417A92C075423A57C208AF683DDD695AAAA5F027CE535412DFE0029B292D32B2366DF978294FD263DAF8C6A6F7CC895BEB1437CA189C2AD9B6FD5BAC06DDC3D075DF55BAA6E75865CE375DBAE862EEB7A51D0DDB5DFE03234CC8F14EA99110DE78A3463546C6CCE5F7C623028134968C59E247E642CE17D8933B6701DB7952FBCDC6CAF7F2FD24A241D82D8BB1C0F5D55BF55E57BE4AFEB4200C1C57938F4A6B1BE9AA02FA86AA811577BCF1D6BE545D6F12046735AE963DC7FDAA9A2F7270B8BB37B3BCEF7C73F59013041B6CF9FE10FAAA86DE369E868FEE7A37F62E2E9CB1409DFF11FBB09A76AEEAD0F8E443582319F6F74ED0AA3229BB7A50043636E881BD139EB7442FA35F5DE1D6CC227B921A1343E34030D2F1F361D7651C487282C907577765161DB781C49655A5F87BBCB68D08C04290B4A2A94B61BD0C7CFA41821B7F5641B899E90DA026290FDCFA4FB956414523041E14ABD7B1AC7CDAA1148A03B6EA17C49503F01707BD3373EACFD4E248BA0F8D4B845251BAA35D41DB186E10464F6FCCD2CAFC9CB06FFE9DC97FF41E07084B00B7B31FADE0E093C8968D1CEEF9810986821F1741F11A71F5F20C809F54852307FBF33A6C33C6A230EC7CB2CC6C44A3A53AFA49477037E55BE691ABDF6D4A852799453930A4", + "B19B7C4DE003906A0001E0DEEF57CFDD2B50514CDD6F57FAA2859061678DB9F8B5AAC67442D8B737F635DC297E3A46C34735AE4D2C607B06964D1FE264B7786B8B0604781D4814E2A81F3A0250D4EDDB77C121B962D0E7109A738630557F5AD47F95A0971A58704CB5B53AC378781B48D67FE5D5349440261C58C26D9370DF37255CFE845F7B0F735CAACF4921CC9D55B3431C6C888787D7C2B436C9DCF1DB94FF0D510BCF15DF0DE42AAC7640741B4893C960FADDCE4261E6284681BDBFB0F471C864FD560DFD87DDFEB4EE7A1267E285BBF2966F6A8BB408A105034220F2565E38F6A15A45B7FFA82DA63965BF44A182FB4672E90BA7933A0120A449323340D0368CF057DF299A8CF60035170D197104B394CA9F2A05983980A1BD93CF3AF8799E613BCEF26234DB2550A15BD53FFA306D3F616D78A6204AD1D50FF4F9972B0CFEB48B76516155791C14E0C9E18457900CE13F672882BF423400D2E6FF94CB16BF3071F44CF2DFE8317A9B761FDC8FDE90D7D05827521B070492AEAC90187EE48D93374B463C3381C7D80178F54C676479BC92470FEA7069CBA95BFDAF099A994AB8244CA786E7767B8400464BD08D5C560D61F27A96E3886A4E821E0087E7A56F96DC6F6E85F1FDFB5C82FD7BD48B63EA794BDE01439FE4C3D7F08864263A0A8B1C1ADAA5DDE86B99EB2A619A12A1A76A39D8B1F04AB55B67D15C7878651BA1F6621658757B890DB0D2BB533BA1C6A5E3226DB4FEE7D561842EFCB5B459598CF5AD3F98217CA720B6781E83C2297C96F4F51CBBBEFA708AD4B3F682FA0C67C82A5F5797030E0724AE9715A911CEE347E80F774EC780DF7E2279924F67ADF9D07FE4F56DE99E06B58099E1104DCE62CCA82D100D90BAF44F26F19ED7AEDEAE609C04C530CFBEBDD161A2C324A382FC8234D405BF900F0B6CE895F9BD534A6474680A7D63C0CF7B4AF1D1E93958CFC02FB379AC09B205708A68D11683B9282564C06290F5E6B57E3E7A75D30C9E21DF8F27F85E1FF347B32105A000BC613006BD7FA6D845C8E6D4053FF012D0D85F99737D045871BE017D672C8FDEB16F944E3020BA7FF0351A303A0D3280D71CBDE42F55657671A79CA30A7A33E744E74B34D27453654DCC8E87911B3701FBC27CD16C4D9D6C29D1BB9AFCCDAB28DB6C2B42C5D6BC1D1386AB26669985B626BD54791930CED4A13716BC9AF8F4DC37A04184FCF711EFF515B92C943E53879B5098BCC4E87B98000BD0BA2E1CA3C7A97AC95C1AD145EBA3950B154888272A0ED49289157091DB2C55D43AE77FA3384BCE92E5840459B405237E194B6F5788F16B217D8BF7539EF8809FC7AE1BA931DBDB2A7D15F139EF4FDA60F02FFF9462777647D675309AAB8201B5FCC1ED7AE066FC0E4F32D260DD9406BCEFE7DC5DFB38D66CFA08E5CEDBA636EFC23B3CB7AC38FF7C390542C9814A86D2D8F676720B7E2FD93217F916F10FF34A1AF34E3B8563319E92A3BAEE34258B4DD63FBFED854E08B1A2F4B560FFC40AA1048F081E66748E05EC3EA02837272FBD9CBF1A658B86B19B7DFC63436185D02C6411142291645692A92E3EA6A113B5436B0BB78990942146956795DFE003A4AB6D9ED875FE7E5B895EBD69C43BB7317CA5C97BCAEA97CFC6068431B24673FEA931EC1DC1A3F72625AD531CD89CBEB0E07F47B26971059FEEAE3986E23286D13BADEA3585D73F1092E41AD041D59120D3D25FD3BB0AAABABA738049C91B22649E715F3710EA51C41C1705C4F1FFB1DCEC85F0EE704240EA8A20526DC01C7C8389B21DA979B99FBF44", + "5805FC5E7042027201F3517AB8BA6F5C3BFB0BC7657337ECCC99CA480BA9C3D36033336AFAC0BE172AF430A98D8462D46453E935805E594C18C0EBF735D90D5027067006193854E7DB6424688BD715A7BE72EAF93C2F763F3BC340EF4BCF90B03AF20C28A59F72114F693848289873BE3869590A64658C0A3938A414BDE86BE8DBC25165217B1605EB0402FED48DC09139751DC1DCFF532CBF599E9AA13F3A72142E05A1D8E47A4044269A0B414976670094C9785811628718C6FE5201221A5822E29DAD564B6EECF025DE7783B7842DEA40D4F72D083D112C608C596F25E09EA85BC6CBDEA39300774301C1C36790D7D9C0B59741F6B53E16BCABF8120112C81D70F30E44561EBF3A3A4571F207305BB3A292C46C46E285C246EE9A7442F869711F52D921EF379DF7CFEC4CE64BAE4D7AE7DBA3CAF47EFCEEE78B477C02550D1DABE4FF4EC67A38A705F60706D948C017E333B645C0D80AAC1CEA393CF3ECF711CA3D59ADD7CA02DB6C5E3F259B4ABC138D24C47A650EFB96AAAE93E69F08077D0CF38B230F199C3B353229C529278DB1F5846086BC8F5F54F9631423105673FE92799FFBE5DE6ED167658BA5DB5AAAF921926FFC27956758CAE8B2367E3C5C5C6CC81DA875AEBC8F3460275C4EE6EF43570B4F571994C7690DFDA3DE311F2FB77057732B19E6FFC96221DE1DAAF9B8CCC21609160457365877519D2B332FA3A85B9801EF435D04DAEC3643CBB5413A036CC1AA0968A40F4EB5A76D2D0C3DFCC53C97BB3896E855957B1941FEF59048562171F6241AF278F6D6B580B4C94C5CED65CBC0F810D46E864C2B567BEC920F6D1DE42CDF32300805E6022EF184B43C1733F809F98B129C937930B984F5539F574AE144EDAF7BABBF379EF1A1AE69B7B4FF9212BA817A4F223FA8B182FEA231E7029F80DB126641725C36AB4AE950725435561C6FE37F960E37927585026B8ADD92E4ACA3B4500F0CBE078680D16DBB90ADF6A127FBC7F791B4F93D5463F8C71EEC1EBDEECA881FBDF3D2940C2EA0F8E4DEA1074EB5C0C9EB34534C9C3992E988DAF8979FD8AA90F540F028708BC6D0EBBFC00FA946DEE5E9D01CC272A4FE61E5B86FF1347340FE64F650996F65E5702A61FB53EADCD457A5ED66DCFE1B019A79104842C51B60142267392DC51F86F69367C25B999B3153C1B7895298B6B1B43EFCD8CEC3694F90BBF1A417C48E5CC4983782F874A7C64E05BBF462220950DA9E8F56BA324002E91D934469225E57309C7F562407DB900267553B85C4314A63351F20D57DED0B3D210269B09B976C07878C324F74758D9D507A4CCEB4AA30CC9CD05CEF32F1174C7B0F7AF93875F66E3A7B12F163920825885CBE5092CB7728A1B74B2F3FA9A01264214761DC5101BB0C18D65BF972A3587F95B3E13F52EB6D1F334B15220ADA5A59497558EAA0F4ED358A995F7444B633FEB900EFD9528B51FD82F5AA30699900D3EA3F3644E4FE3F6F2900ED45DFD997FA905D91521CD9C898AF4CE09B6EE00A15057C17DF4C656E00DD876529CD75A169977962DF3F6E4CB6950BCA37A79C98F108AA7B02AA488AA4ECE05F702B468C20C81630F51F884AD74A76491DA378DDB8290ECB8F5879F019BFB416BAF1D9361126F3514557403415F286C8E77C0BCE4FDF0F4EAA96D19F22F189971155F749EC19687657B245D392BDDA62935A44BF6C82E0AF3593BE06745099F06DC4A66C0768F17916AA360988D5E578D169CA84AD1A36B12CA4929223BCC52AA9B47FB138E999CD6423D1171AD3BF87B5D405A174B0398A689DB4", + "F99EA1599DA410098772B05B5D7F9AFD485A04CA036BAA9C71AD5DAA3EA5F1C757BC83F3C0028DCB93DDEFFD157EFC2CB29C0F8146D6704D34091EAF1EAA29AB915E652309491F0BDE632172914C132CB9A533E97F89F567A7A9B0776B400FDBEE71B49AAAEAD156753F5BF564CACE2C1285C4E65B5D8B2803A11B22350ADF79645AB6E458B1C9E2031C4D4D6361F77B53329C3530F6EF727225DE668A960FEE1F6D7588BC126D0E2AD23C2ACDED06AA2331E9D0E7F99234A391926F0DBE610C600964E89BE1842CB1F1551D5CDD4AE3FE45B628E9A990C872622C9257BE40A8A124FFD6B135BDD2EBAC05E2DDE5B7DCC13C76C27C8A3E778063F3DBB3488CC52836E92A89641F4559F377273FD51FC45550C727689CA4D5CEBB26263F4268502658F40D4EC2BBC0DFD0E41F16A399F02711BCFA96C2456EB8A77FBEB852726B0DE4F927C13CCB329F8B9BDD760D1DD299863BABF42EA7D7F6204BF13F7355610527A38E89F66D3D73522B421AF013197D649D64EAD17F6A6BC8148D9989E786AAA94FA19077292015EF7CABA4B1545CA9CA20E5A816D6EFF7FCA31FDFABC611253FEE80FF0D75518001C2DD6C604387C2656E1362A3EFC1AB85461A5B55C6374733FB6B17090E6EC1186EDCE2C49EAFE84B139C66A2E8308CF2370095B0129B6CE7FF6E17D14F79258BB3E555EDDEF12E634A5AF748BA40735B90BA1E7DE7EA00D2F4A8B3BED32BFAC17D10050B420DA32EB6D14035CEEA1B7951592AD75FB751FCCF190452FA88AEF45080161C5544AF80FB0FF93C62B02B2E5D1966F77760D446F2625C3FFC91A07A5E852BE406F1638B521579FF299227769DC4B88A805E168F08ABE606B5D745433584BEED712453785B1C01D2B9F1020BDB7EF11936F0BC449EF26DBC2D5FB35A2131BE9C0DE2746DDB6D0356294D0E09076C9A77A076F6B659B7B4F54A06BE2F353A3A0EDC6A5123598DF9BA1CA852A5D1FA16877A78D88F0B367E6C4471758F0663A7498CB1C8F13B03F0E2A941DA89C717A15143F4ECF594B0DE2E43B657DD87E4BF536ECAF3820127B1FBBCC0BF2E53B9E0E1CF10191BA9B43D4D33FAA379B1B543C593F1BD5CC05E0B7511E8D4925BBFC5923AB0E2FA90D05ED580F56071A62A334408D3C454C892328AE1DAF16CBD530ADA7B858DA3763BACBC989F056EE1D46192CFF6DDD7F066D2EEDCEE5BC6B72551245EF8D10389984D3B3455A7B9664475CF6B837D72D42E49BA2F61298DE9BCC707209D7F1E56BCECE1B21FDE69293D2560B8940223E0AE966459C249751A2BAB98323F184532F4D6FA396D5C0AA2A4A41C75C638DC3DA5822AD7D3D7D51FE0811ED3673D875039D3625362D7D00356E8461FBFFC49FE1B0624F6D30D550FE1F5FE4211341B9D57D210237902BB7C62514AD872C1CA87976809717817AECE1E224733079478A5DDF5F2A067DDE111A3FF911D0B511A6AEE16046039B229C00D6D10317F66E1202449DF20CF28BBAB4112948C65DD7342D09059EE2701B36E2ACAA6A9948F818B61B9A3155729EEA670D4AEDD6F0AC314DB12E0DA62FBA01D419F7C48B09BEED87F7292FB0315A597CCCB7B51AF776509818A73A0BED7A656AEBD7ACA2646605797940CB737548E83653E204B6A7A5AFE2EF16EBBFD73484314C5699EC8D24E899BAA0E202F37E3C8D8B5F75ED34417E608EEE4B26B453C07DFC6E62FAC215B6122CB14A07739E86FCF816398DD49970AE8A216BDD8C4C478647A8D07EE8BBCE6631C22920474154B3C83942C842A728EDCE7466565D9A6BB030CE684", + "B23CE558D0DE0D584768E83A066B9BF6A12C78D173AA3262866339B86EB8A8D5208159C5873CB29E9C4C0BE918CE4E8DA85C85E070CAC29850CDE48E2DC5E0609F419CFA46EF650B9022273AF14BD9EA28FA856B7BCB580D8949C1F732F87EB34BC1257205BCB6820FDF3BD1E7B9C99E114B3C7607D01235E111E3AB1F30E8A9311F0F30B601C833FB0D8C4D76AC1B02F85E93D4C3D0205F735E20223410CCF56317B6A12D07F3BCD42D2023BA0676A00E7268733C41C8C7DED2555FBD2BE09584B3063BE41BFE93340955788603F1D52190B35FFB8148CEC733CFC1BA49F609ECD3C4512A99308043F3C377EB65870535388376C2C748D18A748F5828B3362666C49F803828B4A019F26D6A9362726E32B650A85523484C4BB2ACFCABD16E754EECE0466D1B370175C37C8CE9DE236FC58ADFAB4FAEAAA12E048BF40CE084467C8835A1E209D2CD67C5BF01E0D62CC78A12130F5EF2E3CFCDEDF86D489C4C5D9AB99484CDD469F2F8EE5E14BE43B9EACB92E72237FB54F9615627EEEB193EFF888AA0A908327C61C50D20C613C933D736F6C3D7F60969A5D3770275081365BA8A57DF600F10A1652167AE3E18AD3715532B7C4BAD97980DFB0C4F69D9137EC7B21BC72AF16F0BEC30B94A4A5C2F55074ABC6233CDF4D8D347F4FA942944D9B2539D0211B24E2C7FCB56BA877371AD7701ED087269DD643C4B62E4B40D3F6572C0730E465C5ADE50FDDD11BD30C07EFF35AA6218D0B73B22095D320448E0671E1CA59BFD52A517A50932A06C4897BA6F7E7038A39C92C20F6DB18D6F6AFB3563D10BDF48BC194B79FEA6861F1CB9756281E969968B65161D3980C4CBD036467850EDE9397321913D57C1EBD7743A44A12E8C85F8D2D1EFE2A8754B5ED0E93EE9649C53F28129130DEEE66E58181787137B262E1EB3FDFEE0604ED1AFC798B198044DD5D0A3E87A754C7EBF0852953ACF3371BBFA0FD5979901252EFF69473FC5655709EA193DCA2A2BA63D706C84F49802684F80C576706FCF1BCEB2892B9179A72B7CD886AF36C7D3ED09270A4077C481736BB69A333AB4BD864AEC1EFA944A591608A2469C85AA6431C47F657AA9C2043F373A69323E735B56BC8177E1E37AB03BAE93A7B304EA1C5C52B244FC265EBD674FA7F1647E29CED527FCBC93CA7A56A4E771D7D2E576C40B2EC736DDBB4FD7411168C5C568C446D1E454249E6F7529AD83215EDB62F57D25272F351CB2C40965B1DB65EF5835923EC2D2FC7D8AD56B67980A3DBB77E6C4415F54F3FC00A790DBCF39A2FB699A20FC634F1B1C177C37898A81D7693B21020C6B592E5A6359AE395A841B434B675F1C30A9CDD0ECF987ABC2406178EB2DE941393AB4F96BCD43626978AEA548173413EC9DEAE7B53B175AFAAC5A1E02D6EF7E27AC41268C1FD8DD83D1AC55ED45D087083C0D136048B7F61EADB94C88CBA5503000A90F91A39A8C9E2DED567F7FA0DF605AD7870189600B941B99240A15310E7B3FCCF5ABDDB56D50CECC06B4303BA39EFCAB2F7E9F5CC8F542E96034145115AFE3788DE0A4985EE1929D4935EF975E760DF7FED8A257718DFDC5A0B4B87024C59DCC6FEF6F2715582023C3C80EAADBC7AA8712FFAF80CF5E159CF5418A1CB50845C97A7F19DF3CC5FA344562DFDD819DD736E9ECEB7BD57AF324256934CE6DB0CF295AA0ADC5931D339027CCCDE1441891067DEA40F69F6EE07187F9B78DDF6D59CE02EC3BA6DD68F06851B10AFE9672EF84020CD53ECA25B3D5E527405AAADF60593A8080373A387111EA898499F096FF46FC58", + "8515E8CF42FC33A8CEECBD6E1B65BE307A5BFEA9CA59FC51A382C24CCCF012C38DFAD3FF3DCA3180934DD6AA52D828439F1052A959DE23BDDC3EA3F2E8CD70F7A765F77549BDE6CF8E444762DE51CBA3431439D1F1E42F1773FCA2F90E48126A000E69C0964B1955F586CDE1895419083322FB4E6528F61768F8BE4CDCB37FE9D02B27193A0BD79D15F3CC9AC6DDDDC82B02201BEAB86D13EA560F7EB5328AC0B534C52BB9D266F291425EF1607A19AECB9AD681815EC4FD1888BF5449421D92E473C21BD44F2C419A0B3E0603EE3C5C82E56466C5A76B76F81A6C394BA693991A5808334EFF1E996AA1B1394A4DAAE00995F02E9518053FC744BA391214DF2464DB9F01A5A53870173B3E8FB6B9B698A8DEE80745D7F71B70B811867D3513197B32115882348FC704B2AF8BD6FB3BCCE30361C1198B84865162734719D88BB62B7431FA39D452E0A1B0A7E45534BF76B6AEC48DC25B7487FEB4B5FFA9C56CC7C83E39AC196987747D664943A600B106F0C3D6B2D0D4425073EAAF89AB33BF6AD76B151CAC32A670A2B03BA31FBDB48B949D3074CD9F56D39553708CB0EF2BC96170E2FCAA3CB2811EF1C67FEF6FE85CD450FEA37A04A07EA732A696EAE8E76D497F5C350CDF72F8970FAD94C03909F67FC895785D5DB6C3A68641D68895AC8544C6A1096DC4CCD45A68BFED7ED86961B5E035E61E9C126319A7B3C1468457C423C4A4E2DD1D42BB90C8BDE2A162F999A8C3A99BE998B9DB7A14C101CE78F08857ADD9A96059DC22592B90488D77D6F0A6D459CA65FC947D742714A42277A79745C73CB157BB825E65872D9BEF5066C444229ED1A097AF6B0308DF2793A2284F911C764BD1158742EF4109CD8AE6111DCF8A40BE03409FA6C430829D0C9BA28B466916C67311F8BAEA2D8CD2DF9C95094E4FC6D43F4491AC5FFBF05BA6B7DB9D7FE4A6DFC386D136B1710DA5F30E67C8DE97A981895476B8E4E0DB5E1AE630C8034F949AA4095DC81EAA0F645B0B440138AA7C5C7C5FAF3B57E1504A5FE477CD61A355D9AA66C39FF89E2DDCBC1862E19102205A9F343FAEA71D4C67192D4D5A1AB08BFADAF6753244BE5B14B1F911700B4A947D53645DCE170401135D0D7E968F03A9B19D2ABBDC94BEE623FB64C1DFC4AD9040197C319A79391016D6D44B8EBAAD5B2F1AAEA58AEFA21B5B3D9ECB66B3B70626AB31CEE5CA759499073B4FDD96457392E58C0EC871B95C7B77F74B81C4CF5B1B243BD35F4D540C1CE878E80AAFC635D363B9D72DFCDAFF62FA8339BAFF4DE1EB3E146DB93E7E444403E0D4290AF501C841B66302A345F5541B1C797D630B5B7E788A793192CE1F362B22B91A837184106D852391A241A903E3BECD192C4FE52586BA4044C4FBDB20B711D2624B6CC13E0C5EF62F2B2E00CA516991C7572732DB94DB809FA0535D2E8376685506186170E3702903A6D08996BDE20F74BEAD391245680A029FB439FFB96EB829F0BFE58A6446B00B4E1894BE1B5017F706156072E2DCFAB25A3BED2DB310DA1A7262ACF24A65F41FADAE3F81A32077BB9CB64AADCC2F92B95EE56F20CCBA24DEC9F5F75B36EF1A101D0F3FF6D730DC199869F8F26DEFC6F51451BFEA2C0EE77CB17422E2790A8B29573405F112EDD704E3F46C7CD8ACF0E495C6BA9ED448B0B89A9997850F09A813FB23788681D3CC04996E931CB00A879E2FFA1BA6A63F9D3BBFC20405244B0F838A040F125AC2B4999A197A2D53DEF8CB167FB7E37DA3862CE3ECB57B081DCFD98894E45C6019B9229315108E37DCFC57C9F80201486AEC", + "4368224792A5CD4ACD64D6956A334DB4614EE5EF8F98EDE0B4A5CD3D06819A4858EE0037DE64ED93BCC7FDB47E90409638B3789BBC63134308B972765565651902A9CAF4F310E93BB08EF1E4B325D414DB5DD7CBF660A880642A27378A7427F2627BAB3444149181C54E9D3FB7967DE33BED89AAC255A47482835D17E329ACF3F08F23AA1DDEB730D9602243A6894989EE2D900FF6AC0579864C2361EA56CBCE2F39A75A12100670AF3FF1A36E98D1931D17CA68D8D031CC527EF7FFFB35AD6E046F4AF1B2B3F66210D978F8607039BBA99AFBC6A499A5A948C5C59055A140293CA97306BFFCEE37CE77C114478D0F73D1C8C9954780830D56878EB786967DDBC71951ECF815CC4266D66F84195CA1AE0375E90017FA5C66DB8329D668BE6C0BFD85742088B7A3256A3277AE2A1F4E72BBB82BB2A59B08FC59FE5F24EAD5DF43D95917A144B4DC6587C893314D5C2C427EA92D02E6922FB0B60ACA646092E0D4A127799FEE4B76587F26AC1EB89BE0BA46F2A212ACF50D93D3345AFE72AEDA1A0F855C45AFE14161E22DA3E223CAD6B47E591896F4283F10C4073AB524CF5D0ED88F979458BB928F1C179E2C5914B4CC52CC000383D154830A54332D4C0E652F98B91BC086370B04CCB1AACA56C9A33B9F0A65C33467BF45C74905B67607B83FEDA063857AC4E326B4293483C8841572174CC8A384014945F5C3072C5575A5BE322E3F2FE3A7E30F3F21118FDDAF23645A40E0A359A3572153F5C3ADBE1BBC4EBA5E063E9F73510C5D1D4326D3D7A20384724279C3B4795C68BA332EA706E8127672E41DE4BF1E8B5EA60B39CAE2C3B7B21A225115BAE051FB0401A69A7FC56AE4B7E31CE2CD575D82C8279E8B8499EEDFC134503E6798056324B17B8AB045FFDC2A35B190B39FF212C17C36537A1F99F2EC3A4CE693DCEC7DA80861FC6F3D064B82CE5581F9781289A085A300CCEFB6E80A86D961408250846A374ED00F5379F446FE6E551F608AC3D71346B738C75DCDF63E19EA79AFCADD5E1E07E2F7C0AC709F6428FEA1DCDD835E3F56B026CD8DC9D4629AFDA9015295C2CE55DFD9C83223821682B5AF876B1CE156343A0F4C1655448FEDBC992602BED5DA4B299B86EE2F86D02C757CB5696B32D60357B21F9DAAA06EB3BE2E9117D2C99DFBB5328B3636F41A06A020E3CB47851891AC3825369C037B0C0D8412204FC3D5FA9585F3218F01295375A09463AEC65F591A594551E19DD00D5738086A31712AE9FA7BABD4E9C10E9F4DA82C12EB2F3319E852B96E61EAD2F85BB6765DAF874FC8AF42746F14B8FA489DFAA9540B4D0470CB31F99B10C335F672C2E06E8A2378B9DD28E8F56BC7A4C017327404C79F1E8E67BCAEB5C4C793C176F0A3C1833007FC44103DCC6E273C9FD1909AEF1656E2B5756B7F4D69F4F2EA576228DD794777BEB2F34296691A1FC38AE44FE60A44AD894CE92DB77FC0246C779C13E8AA16648843BA68CFC5E4E02FB564B0ADF3163C5E167C275A8C15E58659E2F70A3AF792565422D3327CCE25C9D488EF3C32B195066BD27DBD44EF1A20AC6AA22250BC0592AEC734477E1112DC3913F6B7CE323FD1F7B3F8299B8C9BBAC23487F735070AFD5C3627506D4C96B0A1427F7EFC07EFCC62DDC5455A77B57D3FD0B8CAD30A346F8C34F42D87827FAFADD54264A323907A89334C0E7F98AFC9060D7767BC9D8D261BC0BF64FCA389BB192A9B4B00CB566D254CB0226FA17F3BF21E2926CA52CE5DDC401E74A92C7989552CA66675A9BB9E9C198BCFFC488BE1DD5E47DEDD94015BE09B44", + "30F77B7E7E40E42A52452A26283CF3A29B02DE3398DE5179773F2CCA4978059495B9DB13069B00107462C0034064A024DF3AD33C063F9608783E79E38F706B92AB117029EBD6156CB5D278149875B95AFBE877A21AC3128BD6D0B11D31DE7A2BF7CCB68911309BBD2215F592D56AF0F700D962E49E4C6D089548C7587B0598374C3D7BE80F7F20D6855AA28A27AF668A8AD3552CFDE3CE0B35DCEFD5240C8FAAB89D013D0DDF5B66E60328AE32BF4EDB8021E43762E96E5999CF23BF2457B1CD75D1457D4926E7C2A324BCFF70A7CF59047DF3F08EAF2922CAE6A7BE1BBFA3BDDFB864AC965B7FF093CFE74B53DB332B411962DA01D4E6C62CE6731E893574A097328CA7606ECF373CC987F98C31AD74EB4A863084266869D28C07F9C5B5F10385EE44E463324A81D523DFCFBABEF20F3F71FDA33B7EC1B2A35A98F01D13693CECFF23E00CBDBA2A2D09C8A86A819E82D781AE88B9F207889EDA1EBC54CADE6A69A564ABF48F950FFBE7A86243C544A78362D9BFB6CCDF20CEDE386B9E3F8D7EE0E4A58596F095AC1B99E4F787472A734252D6C00B177FD2B99A85D49B9C0F32D728F7D9BA4DF96D1BF6C365F5F4EED7D38727B339A223263B58560ECA6778069DFCE48703AAD1BFAD59CE298C6BB464552408946265B1E19C1FFEE000771814FB5E4688140E1333B270F05EC9345E8BDFA7B412F295AE3DD4DBF33D6D2D62582887D4CBB9EB55F5FE3C1BC32DC689548B66893356704968C143AD3CC2E48BDC154620ECADF336E218FF1B22521D183EB2D13B15A15D39A42A25B46F1AEC07A14CB805AC382DAC8CF96829B8F1D241CF5CDE5D849DEB242295D7870432EBB642A45A6C6F1C2786B88C883B9B47343E822978155D079AD9F6C8CD4A21479B32B2112EB0121C3C74E7C23284812F74A2B413B9A18D6372AA3E09BB04A262E7FCFB6FABBB074C7C603C89FF607F83DA32DA50F2A19C38BA0965BEDC7A961966895E17A20A4D8028FAF7B6947A1964601DA45643C5FCECEBDEAAAA83EA5420F2984CB606E9F3191EF323D644635EDD801130893D84DFB19E661E04188C6CE596DD38C11D1CE5DE1EDE0D15D8FC427842085D300E6801CDE02768E44BAFBB302684FD945C9AC722561B0EDA92E8D845EEB99F6FB1889328C74D6D9CC6DAB59D55463A613AF33226660C0C034B896075D9EC2F51165A754A7D2393E15955BE327587943ECC1F3BB97180E751941728B94948B6648D2C606D66B9BA1898FA28EFA38A413B066D715F7DC5F0C755B6A3126AFCB606EC6B12E332FD71E386ACDDD1DEEF1533D6386AE5994BFD857380874B14ED836D9DED47DE4760ABB05E80DC622C8D7882CD74B2720884DA747BAC3ED9A6EFA2287D5F7D6AC7821E79C79EAFE7A68D2543D7CDDEDB63A13FBA4B894A6D0B3E14C44876364C9FCF93DC066CE953E89851A49B6EDB38661C9316C82ED902EEB894321C84331F6646A5C1AFEF832F38AFEAB89D181D3DD1338DAA236BE0E87A6381D00845CCFCF4DBEC3D41F8AE1E6F39167A499945DAFE77601147EB29804A8B98E7EEB31DE20C84E9148BCCB15CD02D1E3B519EE0A2E4F70F57A69281E651B189C08D575D52E997E3A435B4CC86F938BC79EF4961CD03DF8B92A8C507DFB2DE4D5EB0ECAC2F3D712A46CD3EE01B8D4DCB845D23E53A2E01DF3FFA100078F7B2467A45BBB4A18D14E0CFCD089433959F07F6F60F651DD7FD9828069D340D048FC079E4F8B92824D54322611A3698FAF181008DB5E3E327EDC431A8F6E481484BD5A429D0F5DC55AEA8A18F719A7865B0", + "A7D629A25F82015CD70688CC461244E4AABDCBF2CFFC2D73A3247F4264101FEFBD5759FFB83E8ABE9EF5B6662DA3CF7196385C05D0E5BD50C71D3CED424AB805AD632F2C1930868ABEDF493BB4E3A9DE538D8E35146320EB9F5B71C40E6F32E9243E6A25F503B68EB484ECB73C436930F30E2776D17A2E5F9CAF157F368E0FD9C26A9E9AE30A30E15DDD8A56482C85B46F973D000292CFCF0021577E5DCE8220353E23DD8507D0F561BBCD96F6FAA451E9C595E00CE0F99C8C40359B103D621CE0C837A3D1598D814BE6E22B7A509DBF1ABD2EA60955364791A5910414646F9928B5676ED590F41BD128A55549170211A0630BF5C5BEFEA204896C7FBB40F0C72E40DF19C95F3A0ACD641834E5BCBD26E91315DA34708E2025E0B7D38F9513945DE44AEE57077C8CC32C707D9A39BF098E4928420B3FDE8C74F39F81790D827A628B8F2776251F51095C1193B2FFEE8C93F49DF6D4E3C2E1BDA52F7356394BD5A675543493E04D602F332761AA1D57DF3EF8213E4E9B8D4BF6C8BE8BCCF661507C394CC9D5E9DD4D81DEAEB6D638FB9225247818710E4724111F522610075AE757AB5ECF6FF32CF087DEC9A04A7DAD8C613B22F2AFD31466574AA87CF0B8545B38C53A8F4597D5F1BB6837AF26114D72C609B624252722DD867572D449ED7C170F99D4ECB995B76C8DBD14F50F3DEA077FBE4F838A03AF1DA6757C70C5F3394092D7EADB1E0A859A8487F70D9F7EE523AFCA08DAA5F8E9260D63330773FB7EBE01373C3719129E483DE3D132697EC4C108654256315A38D7060C6F52B4A444EF33E87946C2537A3FB3B5FACBB0F3292C7F2498F0A11509FD9678CC7C678D4623DC07D8F218E4B65F2EB844D24D696A31483E1EDD1063AED60D7A110F7992E3E46F8C7D5CB1AF02D598440D79D649AA415E5F3ED033A8FDCADF8DBAC48F9905BACB37E31ABB0174CC08A9584E25B94423BF395E097E2D0B7ED76B55C6231F180D1A7BD969F6B874B9255138A1C3A2847EBA159C7EA281433A39D2F88D724B6350E846B365BE838F25B904E7B02B12ABE543961D33D991D0DA93310CDDA1EF551D7B6A02765DCF0D870C2BBF578BF8457CA1B599D0FE445B1E9C39E9C8756EDAAC6A10F62C84F60A27268FC5B436A323AC5BF4A9ACFC55510558C5A354D96A5D74F69687385C123C497543EC14C40117ABE46C22FE54DC4D2D6F4823A7F3DBFD3A1FEED428B90945B8F6B2C9A162F9C0287C758603E2C7845A11DDFC37B815A62A1A665C3FC003DC9F064CD5D950DEE02F48505CBE1A1E515E6516E926FF6DC0123E1E4F94587F1F1568DFBACC3728BDC1D153196CD91D9F6DA84ED6B70D0DBA7E7DB4A71B224E5122328D1DCDB9FAA98E88E9823A49E7560DF822D67C908E9AFF7D429E84350163E49AFA4015337532B6E928BE2001CA202C5D975A3E54808AF8E110575AD5FCA28185B2A7D8A3019B97AFBA933BE2F9CD5F279266EBEF52E0B92114AACC30237B712FE53DB1B8596CA72DC82BEA99DF8FE845D390B8DE1C00F24D0D9C619651FB16A280102CA8BD7FC3F7868E4649C636064F4D0EB06D06595A0023E6C5D32654EAB9C8EB011186A32C3E5DB9BA6489895FD50A26CDF1BC27D599F7A8BD1922B30187E0DDC54AD369CC61E958661C4FA76054C2C6658AECAD7D0AE23A9F36DB1B0E1141ED6A1084A8EBF8975325A1DE4A679BBD0E022BC35A07B40C52FA1B0BCDFE17BB6EAD099088963D7937CFA5B51ACCF722FE4F9DF99DADA8CB05C17B6A6AE884F1C7DA09049027D6EA570BAA064736219CE1DBEA7DB0", + "9BFAC777848D427BC9D39876B843378E100DDB87ED269AA91097FA433CA7EEC7D6210E7F100C449876F83439E3E494941D8CFB3E11ED7AF04EDFFAD2729FF75A8FB14A9BCF386ED8D95C046A326A9A92D3F316C758F6939F14BC88789B17F3DFB5AA691A872CA44E908AB966D5F672FB90196D71136ED26591404202AF5858D44C8E0B0ADE3441F554040E458F5AA64AC3D5B32399E453FA1565F4E71FC9EE5BAAC97552AD75D0154FDE48AD914F6D59800A7FEF91BFB6465A296E217E554631FCAC48FB7FDE1244F00697C2155A3161169225109AF5AE218D51D70BFD452433BED94FAFA5920B35353013BE2CD0C32B8AACDFAC6C6B4CCCC2C222AE845FD76630E963CA22F5214033FEDEE3296112F9C127865137CE6182BBF09D1489A1DFFA82D9B391A5AFAE6C80414698703EF03BA42893786FB10C9DBD21E7292E197A2959D605EC466CD202BB4E7BB1E9D5B9B3F07F55FD8637314E3D68C763CBE79982FCCC0147AE6D4C96F7A1C251BC35D8EE3A4F6FDD9CEBF771878B80E3AE481619D80B7BB7EFCFA9C20F11A0FE18505299EF1BB195EC7A93263420D183BD89335411CDD66B4809BEB30AC649CF76552A6F08E9D77C2E9C5AE05FE469705E2E6F44485395C054F401DC6CB9F581E52978BD93CD927D47472DC52D81960F98D60A061C5ACBF9F5E4434B31BC3C55CCD71CC2F2DA6385A3D040DE8B8D5F5CAABB6FC301FE3D5DEB95A00F01772505201B33464F2BB1D45A2F55EC907E86803A94F9340960A5E99C727517C520D338A41320E7E8BAAD6C4470300DB904B1848AC84F67F67C6BDD6AB71E2531C5C662AA9DCC2E84634A5ACA48C5A5CD1CDA454C6689E2484274EB1A2D1CE2D94876F4978987331D16AFBA205E1D81CF287E5E59A6DE000FFFC99E50B0B124E718CAC8FB51A708B42C0FE669894383C01D020E45B301DB2FE85B177FCDD1A688264A0327614A4483BFB689DAA49E8F59BD2D3943BA06F39119D46E5DCD0DEF78BA40798384BEB03292F231A62F7B6E456F3542425599B2BCF96978626543266E8AC0426B3C4346AEAA1E2FE20B54F70273A5DEB9BDF92B8B4DE940C48963DDC569FEA89B4A6940B7644E33D105C5BDC61C3EB7D823D4CF3FA0AC7196D6004CF6654BB4E4602974FBFCF6E74FB58A83540254EAAA4ACFF41C5E1481B2C38E7084B944684B21B7C661F92A28508F449D8ADE8881D40AF4A161A08C5846C78FC5C562CBD36ACB83284223B2891F73947804B6AD40BB99A4E7D9ED1912448C99E5B572760E53DFC434D06DCCA06DDAD3BA09DE063378A98943EFA0CD3E75B1B860E8D1350CB920BD6FBE30D437B96290F49E37BEBCD2FF9F8A4BAC7CF8F4571DAA9E788A3A411AE231D369D35055EA48D03AF54D968EB71F7BD14E51A1E617F81B492FBC3AF3761C601CF108DEA9E198BD1B576F94DB9A15975CA55D356C209E5CE1D8329A5D353223AE3C5C9BC55468AD4C2756BB54B6FC66FCC3B0BBA3962EFB4ABA17B1B08B01C296A578D5AD63F605BAB75C90924AD456D53CB72436F3A2086EE61D7C3479E0381A52715292DCB8CD2833720572A40CFF97928D4EB54265F3110714C360A0479AE7D51126C5CCAC09372AE7139C20C46AE13E4C41E89AE12097C6A198A979DCE9FCBEC5D1AF9D9189059E5E317B77B6E98C29F38E29A35FCC3BEBE3ED0267C5503BAB0FDC46C7D89766475F2676C80CBA71110F815A84CA7EF91ACBA63AF7933056DDA345D527DCB5549C9CCBD5B201BF9D0C82683A8865DBB4DDD057002025D088B7121C118B3A6C901BFF83DC1114", + "18A25B1D741562F456B84CF500F138FBB34AE1D18E9BD6FBAD05D0AFA14BD1FFD10334E6AF3ACC7AC2698BA10465ED5EC26B13265E5ECD1C79359095F36B1B5333EF87E78FC44571ECC00F294243FE64C4BD7833FED71F3B6471ABDDBBBF4C374519D24DEB11A8D2EBDEFB8D2CB3BF517AD92CA598040D0F5F8E5607CD879C75E15755087EFF796EF432073AB647C9DCED072FCC9DC74D78326EEC1BDC9CD3272180E38DF556715CD1D37DEB8B6BA06B81F01C26A3E97B9475B688D32BB642EBBAFC4406B7625944603FC085B38E5E4C9ACF0D0F92A65EC9BAEC8AFD9A1C7805854B19EF516BCF65125603F131084CD13BA6E72201B13C1897D0ACCB8C4266884F3439F6833D22C08A68CA0EB7B636D866182E6F42B35EE9E255F3FD30014F4EF3484EF31FB1D17A6FC0913DCC1443439494BDA221336D05CEF0FF168A9C54830066A6E986672EB92B2CA01C7ECABD5B5B40049B2161F8F52445FC27379B0706866AF20800C521BD0DCAD90E8F4367929A9D21F1921049FBFFCB2BFFB69B27A2A4FC9E48256CE24302A57B69B04D6E51469D5D7C7E41DB6113693322E1DAD218FCBBFD47892E8BFDC28FE1461AFC769286C6F75165CF945E5CD3C9322955261922B6C00CA2C006070EF26141BD8B44798110A9F20E86C52CE88D6FAE122FD7208C9216011D7D91750A800576F575B8EDDA2545B3D60310D61F7351CA1C82C90E18641FCD747FE901351524B9D0B92CCBE86067EE5F126FF4B2C582B280CC1549CB3A18D5D9FD25A09A67DB83A8F3F7DABFAA3C09CDF00C6F16D722EBCE259723B97017885B70CEBBC1C164E1A5361738B1F3FA426D077AA97AFC56F4F147D3EC04E52AF0CC518AB4CE8B3ED66A1EDEA49E904B81DF00EEABBB5EA8437C18C0282EA1AEE445331C5B0414C2E3CEE637933753B30FBD2160E93C3E7956BC032FF839B81179DC5C41CC81E6B8A74EDADE4F6EA0FC2077D3AFEE342D75DDEC1539F5C00F640A56EBA718A77A88E2E8070AB9663037AD66D9B6314C268806C2856E233D37BA73E61B8CE393F9DE86DF5C76610766DAF68A8DADD37C3146F59115E8AC18330977D7BBF677C755B79C902A50DC457FEC314323927BFD45DD4A5AB7AF351228986F3B03E51581C8A8D5E4F8C24ED9E14FDB5D0D6BD2A6F563D66A31247D4EA17CF6C158BE7FDA81DBA14B9A1549D5092658BEE5542BCFD42C8DB540447AA13F208223DE36AEE06BCC2F280333D81964ED05A275EEF56C21F0BE0EAD9D6A8F2C70660C0CB04AF6D84E0D18D3EF56504CB18EA259BDA23AC1D8CAB42BC340448283D9CEF770872F3B94FE85A23CD9A864F76FA82EB637086D12244DBBB9E7B2951D3B0B6C345E513883F261D3EE312A31017BA33A08586F58084A8087144CDF634517F42AEDF185D53366FF728C0E7C0748A776F3932CA874D3C2C48B30D01A5F579DDB1A038AE1E20D986515309A13B369F644A856C995C2F6942B7E6BB624A0DF34FBF31CD9F96C486E530A2F3FF8A43D7DDD578D72B1E93338EAACC244650F8BB37AA9CDF721B1EDC334755B63CD34AAA832725A883333A4AF4ECE71416146A4F05232968680AD41C89872E14AE1CE2FA65B7A3BC099FE265173B0B7159662259FA64FB70902BA09988A30697F110B892D7D6C763EF80D6E904A2CE47BECED5E98AB2A3BB70A73D6AF7175BABF8CF8F38F2AADE3BAFBBEADF208415A2C2FD4A1ACC3140E185A2534AFFE6C01EB30FF0137503349EEDC1F9BB263C18F427E2B119BFC692D5FF44421208E8AF146FDE964C2DEC3E1C9D5699ED01A7D78", + "69A39F2889ADC98D94B5C678A3D3D8736BC17256367EEE3FE8EF5AC6453A0691D894F1F3202CE84EA8BA5A341D1733C6BD0150CE9C0019168E67768B33B64DD4C9F0E2BCCCF2FF7E370C2BDE4F403C270F36937119950121A840913CC1D663F32F01B665840EC9E09E5A9C345EE001F84B2C1154359BC066D29E0405941476C5B7B11CFF124F5324D4D090E2BC49C3E8D83122DA9268FF58B523EAAAE4493217609FDD5A5C510038CF383B65FFC7671119556702F630404C0BC686975E853C86AB392D25C853964693AA7F4A63BEC12BF51762DB46295D2062FFF24000E4F9FDD21972D747ED2F37DBBA2D6DECE1009222EE06B846FB7D49E8014DACFAECBEF2560CCF5E06EAD04B113D1F8E341F200DD8CDB3F36AB99B566B16A84F8C040ED8827F0E9F0D4FA340B0ECCC98F5CA4B05A990F3B410CAEBAFB409E985A722E4C442F59AF3ECEB1AF0B148A3E8B958D9F6C0E45BA4EC8553332DF170872E60967E106BD27AAE4A6C15D391C1B4DF7D77357B4D4E8B29FC874947A75CDB1A1ACE512C5CD08405F2D9F21D50197DC151B5E5A735F759628BCB5A70B5CC9855A39188FBBA8E6BA0F5B6538ACCAF394A809C68F810441BB81CE71F7DBB2A11D3905225DC9B1F0F0D8B7E5268020039E03FD97D42204E503EF98C26B5D9DCCF5424573775E536C4AA26BF4B0351530857B8F640495377E9A08AE82F227BA487FA1D945EC233EB1B42C18FEC4BEC651D4CE1313C9574976F092A5E52D1B37B5D4B33800F5C3803BC6ED2759AE3F6888E7120D3AC2F24729A08B2B4C8D44EF807987C156DD3ED871B0A6217E9783A78BFE56C819F2C8FFC2D2D83945FE846833E5ADE3F840B53EE67E5D13BF0B7031B6C1D004D274F43C1982C43FB58011389D2C7E9111B8ADDD89C37756F1E4C4A931D828ADC3597429AF3A00C0C9A71A44A62F922102CABA479BDDF25A088BEFDF630E2AED4351A90B9567FB6DB5FECD6F168966DB2EB6161DA84479DBED9090026C3CACC19B91EF5680A40073FEAFCAE161E3A2F0DAC9C0A5A7AA31D93B425D5B5A7BF6D38FE797FB53793EED791C82DDFBB2D224455349F26F147FE0D59747AB091585DAE61A32B04DCEF19D907C1159FF69443843248D75E772B558E7AA0FFAE2A9D2B6B1E9F34B79DABBC98B2FAB34F76FEEC635E6E756F7724106D08F296019FDEC94FA7B7CBFD780F2C0B75B1D88EA0D5885237F4D09F03B2E8E1A98879656AA33AB23583DAFF96D8FCEF548302F323A8BA959710A78A803185D88A9C971D9491613E5BA2044D0B640FECF219CEFE377445E5256FD687A15C9F66475C0270C9C1A7189507E881DC6FD5B31FFF9949342586E24C7827F260CDAE356F874CC7C913ABCB40E892E495CD4388AFB84AADB45069F37ABF7DF966CBB8EC86C0CA5A86E79350DA5D6BC2B23EEB51B9C9C352FD9D3FFAE368891D8FD4E2861B8002BB16DA0C4A96E6A9B8D8FF553CA1E6D85B16F996FAB677FE58608BF58AC1AFA9482CA957B03924945B4260A4147625EE657C7763B4C9F4C00466394DB4F222DDC16B72C579FB80B3861D6B4364007FE856DD8D498F3732AF3A7041A2D71498ACB3793C250CEA60DE84FCD0C227A08F903A0B5ADC936FBDB7BC6AB8F7AF002266C8740AC3D75B0628EF6A05C0481CB283E3645F7D8A0ED7415EECD52E4BF70F00ADB11BAEB947F03140446AF31C2BD41F1D34D75FEAE64B91C6007CABC91A07DFE8AD753CE183C611178B8F63B822F03AFBD41AEF17F6A1D58F341D172D4682F38FED397FB01B396352C37397991D2E1473784900B4", + "39B27D6129F6C84173251B68B742EACD5A1BBD49DA6A4DE039831B66B054A9BB13299EE828282F1779AAB7FDFD82F4CC3296E9777A03C64AC4F08DC8882A9454B301264284F7226A4AABABBDC8336CA2BD1EC6517A9F54A776446C5A12FEAE387629FE5A66188C671C80A6C83B08322C2068ABBBC03261AAB8280F4E36507788CDAC4D3F0817327FC0D19B0BCA35D89819A9DC2D5C0CED08A87AF8DDD99304505EA08855CDB514357F8A9A7F3F4D062705E7B26632CA617F640F4D99417CE5C90D432D6B8955DE269460B9DB3C08432FB7BA08F5A658DD79DA8E9AE5B0751152847EA6ADA78D0BB4A8BD9F6E221990CEAF771B5AF603F463D2369DF9BF556A1CE60D1EA6172BD05EDCD166255810C1FEFE029EF21147DFE8EDD5B333F6C7274997E1BC61F253AA375B9CC6B5B64BE8DE11CA00C9530DDB1F218870611D4037BBB88F257614EB7F2A6FF395376C5DAEE4E83C5D11BD6600DEDA47D1CAD95B11E5BCE680D2F18CF92353A11840DB88C38B363BE8813E8004D2BC1DBF95E86C64E060F735C404E8945EAA3DB31A27C63AD818D96EDC6B0111CEE3B3E9F0E1B7DAAB22364FC1B36D25ACF77630DBD1E3CDB194FF8B8D1BE8ADABCF4D0760BF5CD406E982E0F743AFA2C4B333152A74177DD79E64566BF34A10515AC0E050CA135D7357E1F94F1653E9EFB0FBA0BEA1C2B09D6378E4E33EB98B5DB2A2DDA5D9F29CC68766AACBA09DE25B338BEE82700203628ACBDD4B828B34856910D0F2230260FF41EC371D08BE96EE2E821A1F3F328B631B53BECA81BBC74A92F608F2B040548BB5E805EAAB46815793F1D01D121D2E347ABF1FE62B4E00E31C8DAA01202340219430E88938D859D62B709D43934265B9DA9DBDA01537F54B439111126613FFF46ED0A39B2B19C22B8776618B065E15A515B752E1846F51F8469CE32FA076F47A5C49541A19D54CD63512DDE1126D7850B4300610E066AD53E094F26DDB40980B47D632DA9B4524EE5473B521A8F79A4B84CAE714B65E30824068305858CE9F39BB2EB06821C3C07EF2E030DA4BB3DC2D7A29A69DED7EF7B03825C663F5EF44B9A1A174ACFBB164FFFFF0419E13A8DDD108FCA9B2A8CF1A5A2E0471046FCFE32555E72D857ADFBC123B190B48CFC91CE8F0BF86CE2B439DCD3AF6F2CB26EEBF393FFB34290D2B7EC33FEE285547BDCC922312D36D9D25AE5DCB0A03EB0B603A6F75A5EE878266221C9B606B185250231E4B5C8B9470E5BAAA9859A963A51B83ECC111DA4779F012AC23AD2E2DF2965A39E52BD684A0E8D2406A173465B57BA6DC095298DD716BFE30E42CFDB0F2202D56E97772E3D64F1CA9B628B6EF2217A837165A1BA1A8612638C8387EC3854AC557C326CE88DA10F9DA027B204CFE634A695F2B59BC57F987C613131DF2F0F6A5F6081C96098DC03F82B3691AE9E4F14C32324CE495FC94EFCD1CBA88842223DDA27999E0B1762C581162FD1839352E8FB7E4FC143E8D3C774BE9BFD7BA4C3091A04D08EFCAA98B5D3AEBD1FBC65BF1CD7BEE784B58A877D8AE9DA9B3D459521A53010D42242DA0181F661F7CFECC2E74BF3C8E959D84F91904F4F8DE602B214A2E3C42B93BF904058FDBC37528D467E323039F101209D60C56BCEA60BF9C3714A05437A978F3601FA625B31562B5C9B5DE2C6B84F560FE35296E2715D905BCA71BAF6B577E7A03CA4A5DC816E79E21C9B688B0857887A25AB624E2233FE8C9A80C6FFE9AE77108F44A72AAE91885BA9541939A34519C457C41964D4FBD492E11B2890BE2BE0E069D274621FABEE60934", + "4545989EE35583C07E91C0FF1F5FD605F39D51A0485105A71ECAF9C7EC0748F7FE5FB5C4E90F1A59B1E31F74912BA831BCB9C95A315008F4C7C72D8AFF51DD09D9E4738E72C325B128E03F7D90915066AFC3FDDE335EBC4EB34895FB9807731EE6E123A28E815E5927BC9FEB02AA960308978D8DB5E131A22CD601D88069D145D4366FAF97FD7B71F4B39AB73A97C715BEE20A175931D7108AC1FCEF63CBE82D9CFA3569883A448220CD92C433ADD11A52F72303BB4A5D1DCBDCDEF605913D8D424F513EB8920EB864641B5833A39839822AB8ED011762756D6E16540D544B5CC8D9F8B671F19DE2BF7ED74CDF8EC9592CF1FF61095D0749A6404BE49AEB7434C75379DC02A87D213FDD6E0E6DA751657D7D221BC5EFFC8211F6C86B0F77096A81B1F60F51C23A5D525C3411DFF07CD5FCD54A60FE7AEA7E4C182885B2EF08BDE99995121FCDD5DDB0335DAC07DE1AEDBC9E988D7D90CD81D30E6C8E598BE6743D2853D975F236E6AED206846FE8F6AC9FF72C585606FDF6C25F5CBEC0C47567F389D5F317DA01F4A801FA2E2CA60344EAC2CCDEF9274608D8EA0A0D6323A1510FBE7BDF1EB8C0F580DBD3BAD17B268BB6E232B109504CFA3DBA305C7F273F8FBB7D8880303492CBED0B8AE374ACDF582A945A1B1D2000E71FCA445CAB59EDA8977E5595734A508495F2A742E30A006D383FBB6F83BFF1D0DA35805B6CC6A54BD1A7C3BFE81DCBF47021D6813B0E28000AEAA0654D085A9D5A0F0E0BEF802AFCEACE79FAB3F85E09E968BBED03B00AD50D079D9290F7E18904ACA46A2F0472E64CD16429547DA8A35CB1D9D532D4223483E7CDCDDD9E406B4920EFDD2E134B169A1DFC3F2AE54C3CE78A121F9F46F5D7BA6BFDD9CA25FEDAF0B2AD447902DAB3282AA9339C235FFD874C5E893E7E171CA838678C05936F9C9F794300DFBE63AA842A3B9541B07EF486C4823EF1EC56ADDA3143B89052D624EBCA9DC5A3A68E19F7E50E4DD71F4B111B24459EA8FB211053AC3CEE16F0D2C75B68E6F264A4E2874DFA99D6C6B3330B634A65D1B3617AFD7C32981D73C8607996F107211A7F37C6D6FD1D72B56432D66A8CE99E30E16847E549E54E7A3EFDEDD39741A55E94B1B735238093F856D8690A813E0ABCDB630747EC7A9D4729A6E0A70F001F5867E9AF613E9A0494BBBAA59CD1D75C83265E494530711F18313B0643890492BD13B49296827D7444876A98DBF99A6FDCFAF7883E02FD4ABFAD610FDD2BC8306377EDBEDA3EFE03041101A489051431B91BECD6E9DAA5633C8E99839DFE70F4C156FC2B1D27ED307757E0335EAA699C3FBC43CF47E520CA1404054F38D13CFE0339D87FC1440504AFE91AF4088820F7A1D8128ABA53DAD634250CB0C467592C27D1DDF7C64E7E5308567375FF73C02951DAE125866C53F845852C5008A69DEECA708E5A621FFC81C3C932319D15E867AFB67B1B1E07B261ECB56A013C441A7DB94523F103E93D95A7A0FD95141A6342922D1A7130ED95F4B1FED18F3FC61315A1FF0CFA66382BF10DD284AA4B54B80FC2415CB8AF7F3E686AD0664C21EE9F20070F99A8A44A5D51D8CB4BA010659C3070EB3374DAF2168562D89FEFB10100670663E71D029C2B09107611C41B202B0815DA2071256988918DCE69B35F46B8AA4F11DE63CE565AAA1172D7CAC8296B9334FAEA08D3BFFB34264D3487ACAE3C9781C1664E800732C387F9D65C152948FACFABD175C0FBA3B45F9892F8E98F2BAAC48E304EC9CB9D2A41487751B8E37F3B58F66710EA2A2CE02354B85E56EF7AEBE52388", + "F2BC6298F0B96E3B736B5A6EFF22ED079C8AE2FF586E0F4D53ADFB17300D11CA7B8C2E79C0877970ADD0579DD90187CB8095278FEA5F4BD3D9123D300100AE63635463FB5019926B9B53BA7CC826A14EC4B5AA5E9B6C72685B4517A4564028FB6D5584994F8999F9AE7E59D4327FD95C2A45E83A63E9D9F04B554C8906E0E2095448F75DDB68C8057F54630BAFEF06232F7609282B1EC5D0AECFA93E8A7EF3E6FFED7F6E4A2EB8B82D22C5B9AA7B8617DC13B69386742C09C2055AE5C2E71E73EE0DDF1D23E4928D7120B8C171A4F4421DDDEE6229656295430B936F6AE18254A11612B9ECAED23869178CF6B1E6ED7430958039A7DA988C1DA03E0DF5E1D8EACB7C726A9108E5472329280184861ACFEB110ADAB5ED03ACF5EE7E806AB0C850AB7E2256F817883394177AC0E0EF5B74E27CF6B315D0F134B282EE527E32A762C1AD06991C733A7F2E23776B01EAD68363A361F28F381F6190635A6BB38CA9461749E8E3117CE4F767007E2C38FC0EFFA4AAA693664F30A5704D369C9BEE225890021DF8450EF25B28CC123EB178D113B07B99ADC4AA47FE0078EF3D750B2E600B09353CCCC8BACFF198EDD2B3C551C212D005CF33763875B3753E14B14F96847142410DAD4046C9C8340946D922B6EB6CF2D2BF3ADA92A492D2C43397716A4BFEACA01BF2051E029D5C664E4D9C3B7248A9142092DC25FD0DE44275AFFE90848463E7E68A7DC4ECDBD5325AEA355E111929BF700179AEBAE60E26AB2C6ADC3967AA55FC9A2BB1CAC49098C16CF85C569E2E4A146568C41C815C76629061A483AC30DD27ABAA1469C1AC6C527BBBA5BE8BB0541358FEAB34B1E3EDD7E37EAF307AC213055FCF44E65882CCC9A12AFE5F7FFFEF4262C19AC072C291ED636C3FB1D36D7B99F77E93A5DC2848B01595D8DD3C7DCB95075AC52168897126055E8EA8D1028AF2718DCDA34496ED6FD1D86B49BA42F77A714D65D594965A748EBE83501D963F7B8D3EF55804B4FD5462D12571B77384E3D23C77ADDBE7F4BF667CECE0717C7156623AA6FAED9C1D2ED3C46403F750951AD8BD192FCB1A7FF95A590D085E7A733DB1CA0A821631245100FF92A5B1F63F53A6D831EE041966571EBA5914D81F838FC3CC5C449BC39709A489CF31B7CB91ABDE6FC8BA6E4D41E048D5C59377EF4DE7BBFA2406C6F400232E6B502A10802B420A11316D93638A926FD0BE4A368A223FF767B11ED73E6DD1AFDA6508D4CA6EF3517CD3362CD1604CEC574DD35FABF6D5004208146C93BF179ECAE54D9794FD13C34053FEAE2E7286C964BF2B2371D9BA8AE3F0114BC138EB3C304102846E65E7908B40358BEF9F290038FC645979951AD82D98106440CFE2261C5BDB6BED587C19EBABC54469D6ECA9D9DD59A92DB30868297CECC90AA8228E28C4D1B074881B939C60D8A4530A193290C5E5399FADEBDFC42CEC5FC2738DB18FFE9FB20B7D443FA3F1FEEF91E65279460D27F6308B6B0F8B450452DA56E81D37851E8D589F9B0822ED525BAC86575FCBA54E67BEE4512A7F215820E1885F79A5406772A8241FF96533C644B1B5200FDDF4CD1F270E6EEC77324DEF0150183CBDE7D042C33DC0C27AC6F17D670D379AA778E6EF48D41DCB6C9F0F7C5E57BD0A7875D4B2D8E31AEBAA58AAF78947683E373AD517DEF236B037F29C2A09AA4D596609B7AB761FC8D7F566A6BC8840CA626BD36B1D50AF74342BE0B54475D0AE3E30CAE146306AA540E0D63AC325252DD66D5DF50AF7C1D3A651E5A145192E1F05FD31AD2F37719B62DBBFDEB84EDFE0D64490", + "9DDBC6F5221BD70BDA886C59D62F7A95BEB41276DC3B5B505D883DCC478B697388421D5C217C8DD2E56A4130A28BBD7176163980EB820899CF74F3074DD7E74A77B54677A35EEEAE93C32D44EC4D2E4196366E40FD0C2A4741575ECFB8FC927142229E63FAEA97C51E12809FFD336BCFDDEA3FC03A1FE99EA685DAAB6F27DA6BACACD5D432352FC6FCC323EA9BC72FAF2569A7C6D55E1260DF0963EDD6CD3CCF97A033F74201E4390F64F06F89080C830986F8D6E90AFED3BE6A54202A59ECCEF101E5DB790E997918DDBFA1B160D472490F3CCC2B0E1C10AEC61ACC1F36BB6A8735AA86C50D2AC986721C003A2A8F1056BB9910F5A8D62D358DDB31589280BD14319C27A13D847D84C02A039B869B52669DDAD47CBEE6892E2A881A020867405FC1756DF2AAF2E5706A16F53E1E459BCDC430C26403F60B979A4D74F78CCD34E48321E67A8B896A162C873CFDEE8D58BE234C34FA20FAD472F0EB570F5B2BDABEDEA0D0483176163E20E47EBF51262B19442016EE5867BD3345DAA7CADFB2BFBF14B4EAF986951B024D876150CD64B7B0A188CA79B122F274FFB39F1EF88D5B9D36437AE8BA43770DD69E3994F8CD673EC3E1F0A51E798271AA7793CACD7E53E27A325193A9B9FA33ADA3BDBDB9A916DC8BC6188C3D4C38848E3506E38621DB57C2B0FA80BE5CA34C295159163F23ADC249BFB1ACD94FF0A42054C1A2C304F3C515B8B44F2AB1A760E784B95D9FFA905EB5541D14D5F12B4489403645A15F004828AC8FD3D8B44C5C070E8A64BA086462E5CD447C58E0D96130E9BA3400CD7AC266AF3E3D33DF214D3E98C6B7585C552979738879552FC758F04B122889E81B887B653FD7D4A8A5CCECFB0850B58CFD4BE990FAE223803EAE972D0C65A97960421D3FF5B2B75079AEB42A92E0D0EC2F04967C91CCB84FE6E39B6B136CB64424686DC6CDC4AC39C26BFCE81478AB6429D4E9B4877EFFC8740FCB5D9968ACF8D69C771E9E48CB542BA5BBF0327A4C55CC83E466D6DE0E639A54576D85A44F305958A325CE98A45E2C227AA9E85BED652F3EA5CD31AB99E299930F5AE92B12E10D597F69272ACC8185C1E83412A67CCA39DB06A77329475A3A87A1D4586B191E2E8E7C3EC39171CE6E775E7B369C8EED0B2E74A7233CDB5905F6AAC099820A227B6FA0FE5057CDCE6C8175F4CF27D70EE76CC0D769A324AD66D013A3F699C7F024C22C03B353177C3D721EC56E472AD6B383A653FFCD078774C728258146BD8D928B209C0A6A8CC60069F160D33F673C139534362B58E065F7D1176FE95F4A6DB7CC75FAA408C4FB09B7026DD640BB08945B364646D9154D00CDF5BBE432390607904BC3D70A0207F696152CE6FC5A0BD79625E437197B929203CF028384558071B625E0F8801EC1B13F6DF17EB8135687F08071DFC3BB06C8EB4ED296C821CFDDB7F2779B0B913E623ACA6E3C5FF023C58EAAB547BF1A67EA020F317658E1328FC845F65464D2E06ABB63F678A94614E3EFE281E41ECD6C85FE10ACE427FB1960BDF06630B20CF0401F450D71D3FCF0C477682FE342F5511DE926AA24E776CB9C798058A7576E1F76ABFD2C86B8C741230D6D95ADE980ADEA22547B88E607AAA8C3462FA34114DFA46046848CB10482314D1240516AA7EC7160215A54F69EBC39FE4CC97EF710BB7E8B55F9AC158B7F9C87B738FD993D2F0E35E4E9969FE5FC4B301BFCBA8A28D7150602ABE7635A2FB48AC65EA29B829DAE037D8711127F80CE85BE003B4F94E958E493D7C2236DF970D7DFE8495CE083E79B777D44F96C6C", + "33282734E9BBA791CE9CAA5CD9F80DEA9EDFCA4E3F5E32FE046FA978612D25F79FEC5DCD026666C35CAF0B5A682C9FC6C97F54BEDC056A6D900DAD88CBCA846702B0BC435DDD5ECEF1D3356E85247940A3892CB61BC8FBFDAACBC1DCA9208DE593DEE6944822EC80F823B2ACEA3FFF66E4CD6F542CED77C81F29F144C9D0FCF3B61C4887C6B42EC97C83ED2C5DAF28CB8C9B352B37255F54835EEB978966A14AC91D58857CB7FED677EB87F8556B343BE0056744655B6D97615F7F32BD4A537D8D586F477EF6B2871AF0524F71763748C57DE63D62D6824EC5075498D492A2C621FCDA2A5540038A50E6765ECD69CDD45D10153171DECB85AD45A8A6D3C609E350023C32E1F72B8D5E1AF803F68E288CEB2F5CEE3F10B7BCD7FB15D11DB3445266BDA913D5930776EEA4446337EC5A50F9E4CB230BA735B656EE26BD6BB5632B907CB81BB65EF4D85BA379E4C164DE83CDCC023FD458606E09552303B8535B63E37FF038F2AAFDBBEFAC8BBBCF04EEB41BF126C20C533DBBAD8FE10771F01BDD14AE113760DDE4C0D71FC7C29EB8D23D668E401B3A026C46913E2F08DF8434FF64B48036A37166F32CFC8747F13B656BA6D18300935195D0411E8B24E1F47298AE9F9617DAD3F39C4251566CD92A64860949BFEC05EE2EDD7F2DA0FFBF3D3C9F5A349130B7A5BC5B839000431D00FFEDB344C0DF86073F73C6833C091AE132D121F4568D011BA0DDC27DFDA5284478F5AFF037D89DD8EB9FB0EC066AF20740DAD8D29C1866DA0998E580BEBD311BF6E3BBB31D89D2DB162A680D2AFAC4903F9838B616EEBAB56C2D0386C65CFCA946D33073684FA119B2A6411E1786C723A466C7070E58248ECBE1D86C6D6CAA199944D9944BD6E8B108060B612F8FE724742DC158BC1E5E3F71AAEF1864A7989CFC68CB2396D010E1485C3238F6385D68E20D36A4D3BB8A5A265E686DF558A73020588EA16B4B0D3F74916038A9954F75232087822BBD8831222F7B94968C5A324018192A6377661AD1E15FF05AFFF75FF60B60C5B41C08F001D85A237443EDF3E361030FEC44573B044CE66F7A036EA78EB83E1863259BA363D517049B13F61956740B1DA3CCB5C9EDF190C89A2FE908916F9DF9B2BDF0DB50D032FAB059309F3DAFE1723D8031C93F9CF657F17D1B214492786F0D297D3C4C01A25DF2B1C3892B6724DC7CCA704E9AF0163D37F91DEE0850D9F2AD4860BBD2266FD7EE4E3D56349B90155BD843EBC0899FAD39C67050B5F8A1A9DB38EE821EF7561FCDCD6F833DD3C9FF3C5D978BF7E70288BBF665F4F20260A74DD0D414B3538FCA93671DB4371F2CF6AD94070014BCD5ABAC89157836CBA9A34FC8D84090A3BACD7D641C5FF58A5E1489E1D2F410E65650AA30D7FEE4AC3AB37D5AFE208EF3023E88D96F4760120DB5FC705A005976BB27F580CF5C10988BD2221507F8A6BF84B19CC3BAA186050870D88C6B14F98E56CC470291FC96AC5BE10704CAFB10CCCDD8E3EEC9D58E448BC655A0A899C2FB39073CF28252FE3FBC6BB61189B154EEAA37A797A8E6F329C64DE5836EA44F7FE04837E343963FE89B0624779212F1E5E399427ACC8BA83C10F3893C7551FFFDB62BE893DCEE02AC893928E81A080CC2EC8B95C4FEF1A6B65723408F12F6E3B7B384B149F4002135EF114B67AA3CCD406A78A732374CD7C72814BCA01F4D44909E6CA1245B25E27A67F2350D285E3B37218495CDFBB9C7FBF2C40FE31C57702519B5DF1D41D85F48DE4E46639104445FC2C078CFC853B25BDC3E4C58222B2F2C5AB40F5906C314", + "6E2FCAD2FBC021102FBD4F992C597E4B91D2AC56A22E8FCA938D9C74533912782F75670F31BADFEA83FB93A0F6D449092FCB9236F50446A4655586FBEF31323F1795AC3216315BC9F4C92FF583AF7E977A996F10989067975A53E153364B59662B6CE9E1EB65D6D69B9EFEFE57ADD58A7921506C2BCF4D51A01F79A67D41436B519D314D1953C6D133305AC06A45428C0D6FD9228B7B9228C3A2C03EBCFAAA09B9343C736BF99022D1CA0B5C25A6179EC0ADD8AC95E8D6C00D6273AEC61E1196741DA2ED9436F353919A8D25BFB8234DA7A2229CCF0FDC4C65CC6C0374A4ABB918E1B5BC7B929F6554C568DCEA62D5289E45284DFA975D5AF56609EF4DCB3CA54A26F100E00D48446C4C35D1D911CE7EBECC58347940BB411F475ED18D8A1315C069C63E59CE2F69E6F7B48B005107A69EBD9715303563F6A217E2ED4CD373648DA437E10754CC5636790930947650E6C5D1B3D1AB853A52A89D208301C54F8E7DA8D419559555859AD1B4D096A1805DA251B6767DC2C0D917919E119E71CC78A884A24F5061CA1A999DA65AED69CA02C20B6EB163B2CF435135D3B34FE6EF52F3AB84DE084E37958BAA4EFCE8165E2F5AAD1D84E9F7669FEFB6E60F1B9F69C79DE9296B7A01BDB04CAAE8E6A16ACF9A119A8E577919CB22B58EEB7EB289E708F229ADF81E2350B211AB48043A491D4CEF1721936B71145F07A40947D2A89A584D5D0A708F3480F0892E331B2B73D8B7D88B7E85F73DBE5346D801B1904CD41A8070A0DC74073217AC415654F4170F42314AC0AF4213CBD28094F8C4FFAC06BB0114B2C1924A4A1B7655965468574845864ACE82B8839036DEF45E88F341A5DA37A511D583C51DDBDD51577488A29D7663CCA7AB2AEBB53A4EEE7F38B8637C96CDB86B23092FE0CF669858C5374F6F078FCE4E945FED340903FF26A6AD6C408E390F08ADBFCA9646CF224A5410D0ACE93380314541982A8AB6443FC358B66B027A15722A0BB7C61484CA65A62E4496053C947D5F4744B69B4A73F7801453FE20557224878B8FBD318E8B572911D09839FABFC267416B4E2245FEEA6967677C1C57A3F72E76BC297CBA73AA729B890E90A4B29CCAE4DF5D959BEE30D836C859F4F67A06B4A479954CF20C7D0639D680EB61A2CA11B007EC9772293EB8E6525A56CC0F380ED4F088D8CADB0B95BDCBC84C0C746D4DE3307AC7050FA2531FD24164D29294D492A07024FDF1B988060FD766128120226E63F4973278DC9F07FD5699A1313002CC9FA7CB44A72C9C9D740AEF0984D7D4C5749F9071138BF93BCC6DCB601CEF5F60E4BF2361A083D158BE93134DBC1D4FC79FB866B0B215E230713137EB6BFF388307CF2F07CB07E974C8A874EB20B06C843579921ED0839F9454DCAF71BF56387E01F3DDCDBDE6C15C58BEEBC137B673F122179100613D6708B6B16AB750A3A311AC85E795FDBA002CFB2A9D9734FEE1922D984DA9F76EF65EBC9F647B280B0433A3C2E73B08A3669C78CB9885F65E97A6B4D64D2B3A29184EA87163B06F267FE94714977525AC061BC54F7FD95CC0C4285E45D75772AA3543AC00EAA32626CE2F9DC48862657C1E156E08136F3B1EECAD329072EE4EDAB16F385D736AB806157409496A9CBFEEB3F5AFC91E2FC5569DA2C5DF20FFDEDEB6BB57D18AEF1DF03C7D5A16BACAD645772C4C016D147EC11EE9996D2E791C5251CA8FB7719F2093DD2E4505B7BF320204556D06B91D547C9C6B0B19FB57608934D4A4F748FD07F3F57CB108A310319F7835C082FAED651ECA42EF823AD83D6B22375B20", + "22C6D5CF65DCB08CFEEF580D53CA6571787AA81CDD29C4918F5EFAF89E285A37DA51E01500BA0192D2F45573533F540BB1569E27A8865FF94923B81AC26FAC1DD03DF79DB5B5064F84A2B15E0BE7CC53BA875E477159D0352CBFC374B07573FEC884A699E93497514E7375E49FF5D9D9DEFED637DB89158F30B27E802EEE4E806FD61A46F8F7D7AFF89C9101A9375F73A2164C18B0109CBA1CADD42E13C9170378E28382EDFD85B80A02469D9A78637494BC6DD284557ABCD5756225EE3B26C7BCD597E9744FA1674C5088D3301D779B1C3A922A0723AE1BB253EF2BFFFC99BC8BB4CE539BF6D2D0951F6C76BB001B48E52387C95E49FF1A9D1DC12FAAA2B967754113FE59822A1E5C56A6053F73A2CAFDB0CA0B58312ED54B4F9D1832FA089C5923133F47EAB56C56EB7AF20D8006EF8D9674089CC49D37E82A1FFB88C97C3267569B5AD1A57CD67A0C94219AAACEEF99A11B28D01EA4329568E42A7E717437B030D3B649DAB105C700F30AEEA7B82A9759ED54F890C6E9B2C9F3F1D1A7A14A245817DDD4E2343BFDC5DE774EC60C5C41362805281C3019CB2915182F525576B3BF537FDD5236300DBFFFBCF8A8C9489B1A119D66181A79AE93E7DA8AB81A1A3E8D5A888F5144AE0DEA33ED8B7B6392B789EF9C544F876D179DDD822E3906F76FBD579FBE27B4A2752D4878962008B7873765B9BDD3FA581FA192C0C422C15153D7FF16F2732EF68B66042B5053E458518EB65C66E3955CCE4AA212ED4980411D3E4BDC6918B30BBC400A8A338DB982CF55F2C3B0C3DC6D64DF10A8CE1BC117338DA3987965A5EAB6C2E8E368F59C7D9C77750717B4440AADFF57D0EADFEE7C1A92EE72283D425BDB0CFA9F3BCF602634BD8526AA80E0247BD0A043D277A3E575C1D1EBDC0565330FCB30C63AD02F48D485AA43358D957ECBC6991D0358AFA953A41C67019E96576BF88122CA76D2804B73EABB88007A121BED76F33AE0E0433EA74FB2C7AD672D0DF5927D87BABFB30989EB91BBBDDCA40ED8BCAF7684E8EC9D1017D6147039D3C3423A9A0081A17B70F56FA300E8F2F97C399498F4AE85FF2707B50E3A4492BBEF19E14834B261F700DF4E685DEFF476ADD919D5A15A7BCA06F382E1F0649B6934D70A80416F732552872BEA44A5A42D64844532DCE8ACD5D20039D397BA9EBE04EC4742F4E2DCAD29F89E0A9FF572579237863890DD13E7168CF2B4CA8F6A36B49A5734BC85F811087B9541605F44FBEB3313D3B56EA13676CB69F4FCF14A1BD285455BA516F20B2B0D3E8922B71C0731F2BFD1124067D4CEF2111FB754CEE5AB73DF629797FB5E012515609B1E9A2085643691BAE5E4A2A52E904651DDB340090EEF578675B778D1E6EA868FC1106F19B0435BB464887DA311545300841E10441E9316656698C879089FD009D3F8F49097B6AB6AD2D744AE79F1D15F0DADCA70C1177374ACF5D07979CED4F3173FA4ABF571F6DF2112E8AB26C257D6861923CD92CBDE33683F27D2CD542ADC623230470FF7E950475EDB761E57ACEE78318FD60325B871936A51FE23A63C9B4B7DD8A72556311877DD6A8EE053D6CA28261BD359C0C997F2A184270847A13FD3C952741C5D1C47ECE09DEC3D8E0223110A627084BF826548E60886D7EA15C585F5A16A813F030EF3D150FE7A4D271856623D96742E848F7797526238E56C102191600AF7756C562A9B627B1F05B56FB2C768F6B57986BDBA95816E0842759438E262FD9BEDAFCB594731E9A04512A22D1EFFE104EB8F7E502B94FD846C71004E534FEF2A30812F84A8", + "E881D91D5F8EBA0700605336E6BCA6A1B1BD1D58F39650CD55F056FC8360EC9A2CFD0CF440EC2C6E98EE88E6B31558B838EC9D473F75CE2FB04155330C9FEE2C381F872C3A79331C536A05C766124E69AE1EBE9425387279FF9FDCD28CE6569215A65F678611C96103D710E45029521D6EF7D5A2AFF378C9C26ABB52AF1ECBBF615561932791A23A3BFF2824CD3810EFE7143A79B4E14132E306C48D9B2FCAA475A7D2AA0BAD046314E5BB4839B27FF4ACB7F4B3CA8C97CE976F11DF6DDC71144A600DBF9AD43B6E471791CCE636D67CED546A377D786CB085D0E4E91258719A9233F342180C9A827FBAF77C8B5C1BF72E9A81E4E4908EEAD39772DABCC8CC0BEEF0812DEDCDEDD7B4110C6A0B89484C2F0F6CBAEDC219BEBC85903CD03AE727B1849735F62B385F4D5CB58C527CACDB3586AF4525BE1CE424A0879546505F86E324EFC4FBB0B9E86EC243432866DC9CCD4D9FB258886EA75AB006D87CA5C10B5BD0E0CC4DFDC6B152D65D5FB268DB6AEAEFC9EDB4954CCA7E88DE2269533D54AAC447124EFA9BA62FACD2FA914885C162D59BC6BA2FAA3389DB9AEA4C350843B3361C9F343955AA616E661ED1A137EC0BF957BD7DD7105856499367E91849C99F0F7138CC7AE120CA36164658BF3B67BCFC1BECDFFF49606448AC8B38619EF4A997AAA688D3FA7FF169B8BF537314CA8ED865F395E300E5AEC2CBCBC5A8B5AAA31C811E3968FCE32B82CE5EB1EE839134EFCA68E4CC4C2957329A7CAEF675AE2F990CB108CAE8EA5EC21F6C442CE1B818ABC203327087146D67275300868B95052261AFCCEA3EE854F38DE7CE1FA5649AD7E9083DF2DFB3ED4186244045390F0C843777A677B8A82B69EBF43D8FD24C9BC0792A2336581F3B45EA6F8BBBAC89A0314570084D683C76D32C2B0A6868A428DA7D72D9C6D37D99BC05D14ECE27C6C1E3F849332C1CD67381B6CCC907E1A911D3C97F1B40CC11822257491AC9C22642C4FA2CF8754E6AB2574AFEC65062ED5C1E914F8DADD52ABD7A9D74E545C362880F38A567BC3E6D7BD7156C87F698C870008C2AFC78F94354C2DB9833A0635E2C63E5A47A828610E2A5E8B2F914306C966D1EF8222BD8FDA2DCADA05991ABADAE250B942F8FC82AAC026696D62BFB27C8731149C49114EFD2AC47250E0454E33383082E7826569AA4D6F5661A9968C1A784E0A080D6BA7F8956E37AA55C07257AB5971E03069E74D245C4A2A0BA0BA397376141FCDD486B2B3C865E97D1CC327E4E3320A131A91B61F5A78AEE77D1DA75A1F121D777DC4E3714B0B515DD96F477E9232472353FF7FF07B0C23D1C88F7DC4516C36B3D1820AEFFEE62EC3DFB6143630E1C532A4FC9740369617E80312BF3CDD7E3723F287DF666A34FEEE38B3A1461E1B5FA03907125359025AC125D6E86FC6AAF0223F83F252AC0C6D578DDAA8A2841DC35AE6B6DAB2E7A31EF4282DF4E20D471A3A8B28EC6F510453728F981D7BC2F1BC2A8E024FA65BE18AE8CD272B05403E05C6006AB1E612CBD9F8A71C50D618E9FE46B243AFF2529F2A0FB42C7B990BFBFCF6C4CFF59DE230EDD411BC93C398C49E76FCE8EBA3C2C93752B38886162745ECF4F80EB59AA3F3660C4B1D4B9850632548A6D5A9F5A8DFB5A74881C0E93E38AD2FD1F0C23E66AE4631F25DD442E1A010D6A04FB73559C76CB30494352B24FEFB1E529BB6407BA7B68535D06C7207B2126A585BD59C43ED1E36AF6408E33EA1CD6F43BA41401048AE9C5638077C8AA8A033F0C18E5899A6E9400531731486774E30C1A6292FDA7D06A6A48", + "74C4DB6B3E8A4BDA889FF8264534407C16B05809DB70004C8EEEB10156C32686ACC5076D21A2F583EAAC92954996BFEFEB1A28DD699B55B5B94A122A1349C58DDFEEE9D4270368DEF85D86CCA4FFEA81880739A934BB8831AD75794986D60A92AA6DE661ABAB1010F3999A57A53F3868026C64307C47370E0B82FCF8C02A3155E787DE359624510D5008E229E9DAD0005CFC9DFDBE5080BFD01D7342E570360E411FC27146147EE2C72931D0577CE6D7183386C754A6820BA97BDF080F6EBD063934E13B005CADA4D2D8492E143402C9D1BF8A04077C4BC7314532474704BEF9D24E4566A1409F085C76B65158E4EF6B30141DB42B0A96454E451BD63117428273D3629E2E5FDE4D9E53FEE5F9EA2F111A0FE5F50D2B72DD26E941A57213EED915147473D630F7556CA46FF8EF1F0C88E6272D6E95FD3741AA675BB0ED839BDE162F9A308B3B092663B1963221708404CE8BB54F61BE9AE987344228BB60921726D90FCC07D5F64BEF673E06B969511E111F0293BC5E57186B283AE81CB2803363A1266E7A78B47F5A35AAC2FF0B3A348DE73C81D74E7868683918FFAA42A91B89E1E2AFF4BBE6F11867DE292A6FAAA689CFF87F4A629FC354ABA202EDBEA3F08609D1A4C350A7BB7376A897AC15A1B0CFEA0D35DA71039A97B8C99A5367DE46C338D75A845A4CC7CA292DF57F2AD8C5E20D95670E3748E8A1BBD3D728980DED4FE0DEC90884B7A528D0B4C27DA315195B7D8D8CCAFEFEA3D62AE34B40F5049D06C3AC92CC59A85C5D5BD04DFE0CC89A7DD7A1B6AC4F5F3D2AD8858B83C761485B77F6D512DC2EE1DA402FC6158C644F14C2F6274E8113B453F9130BB6C24E36BF84C2942F8B28A3914110BB3D48DCAA3ACB1D7A89769E0B9048566671760AD83BA7F7209832AC10FDDC299F7F90A3744F72ABFBAC19382EDA24D0BD5859634EC3790C7390AC2866B1379ECEDED50D5127324A4EE6AF50D9A6826DFB3E27B9922E4A8652526A6DA29A4C2B9B8465E3F99E72A82A27645CDEFF1C42E77359FC913A9074516720BC61EB171AF90AD427A574080970282539A05471AB7AE2EB027DFD3D496BD27746D0ABA30EBD9D13AD9DB6D405CA19EEB90CB088D9CFF93B20DE07F86B978C7FEBA8AC29FD4E257D23380B955CD79E93E3135BD14AA338FCA16560A123131DDBA8A2B63923860EC3EFC2E0339015662C3DF1E837C879969573E0DC4A63EB7C0D6E7419F079D4CD05A1A9791330F1F1B7EBAD8CE76933D54A224571796A3A046116964B98A7EB5D9FD8311CDD6BCC9B63F2B7302347C0D3407219228BBA73B8B53DC3645EDE1969D345D8C23E691A58370B351BD6C86EA6EC9349D524BD05D07E68F853FD9214414507ED507F0E3CED126F95630FC6A3B40152A318278B8605F30C389C1826478635753FCFA9D227325463581DC51EF4AC47E1C49EA005D5AAB9138706671D64082F6E2BC39A802685BD8EE8001031F7C56CBE5FC68CA5B14109249C210B4ED7B9B2ABB4D4E83C9EC82911E9CBCE5DFAC8D4A1A6CC81B5378D29E8E339CCB31B85D9DEE3080ED75057CD5EEDBEDAAE7F3CAB4BB1BFF54042E28C8CC79741FB04246ED66B3E34D83F08D98D7070D3D6A032BA442E46CE38F45957D7485B17B51C562B94985FAEC8362A8D6DE43FC0EFE1529E662899F1D21BFB643C22293E0A0F2E1D40EAC1934A0421C1617DDEC3D40A3AC9EFAF0F8D94FB7DEA085C8179290FB4C917C7D6F8B75DA8790404F8191C0EEFCFF9DA2208E7E5D382B5A9D1E72089B3C4976036AD530BFD31F6D08C2CDE5C26E68C", + "13AB0304EA5EC4D96147EB5EF8AEB8FDEEE70A62E36686ACDC275D2FCA1ECFCAEFDC4F8CBBE5BFC2BBD343742EE011379103102BC11E824732D147FF93CA6C9B0A503C49BB2B621B47D4C5971643EFC01E760EE958A9764397AA551423EFD49AEC50E22FBD9AE99659E36341361286D8452EF70C662DBB3A421898FB34EDA3314A1C7A6AA9E9B5A6960156A549C32B91246A9CDDCCFE0FF278C3285A5F20081EE6FE121E3CAF922C75915DA773D0673EEBBB268998861C3018642A6A1B1FA1DD8DD54991254067B4E9BB95D1AE807B8A41B88B772B5590FA9F0D71093854C213283093D5EB9D4C7B1D57DEB27B1E2A1F0CEA306B28A5DD3D1B23EBB7494AF61F771052798C6FA104940EAA5698AC24910DF692D5C89C29F318E090F30CB12397B88702418C467EAD9599670DA2F993D5B6FD7A9A43CB89274719A2F1491FC3C3E1528EC00A6D3117C5D2E0CBCEBB7B91881CB7540809B5B9BD4DD37BB6B94133504981829410B4F348A5A7DC553F089C5F759F032F0F45C13991C1F442F2DAA5C43C5A6815383091ACA7101735A0A3D8E5E88A454067F8D92C4090DA1035B7880A303125ED48A5E4EBDD9308BBD45B77BA6B84093210D9B011E3FC5313F2CF1B20A9C08D3F4D8AD7003B32A49850808F1B78115D1E727A7BD387D2D4C4CBAA4CB94CE71FF25229B37BF1D671CA50A04EFCACFBD980263EF16015A97909BAC6FE4F981B96AFA2692CF3603C5C655BBF7AD4DCB06CC3BBF8BC819CCF20619535D399BDB5FD0D40CB261FEFCCD4B0B0FF3684FB0D992ADF1AC6046BAA8C8E0F16B6E691A23DFF7014AAA67C7F84A9429064139809E1569145DF3CD8240D49BB9D9FEFC2176C697D9950F11D56979DDC01ED19EBC9690893D6D8E76041BC4FE35982D5C535FBB883654FA3A2253D52F06B62022744442D880EF9DD4CC2141DD25ACF2EE3B26103D6A16710D8BDCD43731A59DAADC1B40092D9B166E822A8A7AE0B4323B8CEAED7AC3BF3CA6F24BD79A58DDFFB59FC2E5FF634C83F6F7B03441DF9B5763FF827D4E74764C3E0EEA21ABC1AFEDFC2BB9F73E3FBA165A7DF3ED9997A588CFFEA8E3C193F505C741C1863C3437A80B41B7668D12B0DC7CDC6A61923C102D3D9071D9937F36A39484ACF1A2497F238E78A9D8C9C1B96CAB0AA15B643B81F6C5439C2336055C8DE4A392B8C110753E060CE92325C3B67F0610D79D46F2E7FDA96538D43B09DED1D647E8289986EDFF482FF7E24F40FD489E4051F7D0C9267E934ED16B13827A8C3D47C192F5C5FCF6A8E82521B7062F6A23B463262E425F4820AAAD8E23E85DF0448B00533FA29FCB815BC83AD29B32D12F614AF4A6C60F7F1339E639706C4C671B71C99B55056832544A23C996C6BE5230AB5D8AA6B89A0E05B4235CEB352C70D3787F740EA6B8F05CD97409EEBDC9F1F98E428AECCB124F656EBC316664376CA4B38046E5640B377457EB82A5CF0E81966865908DB4B1E9B482F8740A470E4F5F0333A11E1D67A350ED7BD9C8306186E83FDF6FEA9A09BA1AE266A24AB6D3C192A4DF53D0A627EA2A2847AAE9D5EAB2DB183A45632B2145C3A2FB9C4EDCEA521E4DFC5AD34FB6E2CFC2E5C38B30996542C09CE9542E2F692B863CFAAB27FB549BA99A1DD77CFAB7E26057055737E6D08E5592D17DA8322B0DB650AFD6ACF4ECE23F1C9613AA7670302428512238E608B6AF8E0862452319E3ADE719928AFD059A58D39EA819F3C14DEA608F80D3C93E374C2170D2836E2EE9F600A010B97418B52CEA1592F4D6C4E91547EF019AF4BB4F1ED010242DC", + "1193230653E34BEC0CC617609C775D5DC198C2F533BEE5C3537F381DE8AD1995303FCEA2468BBE8713A3770F59EB4F58397BF63DD3AEB17BA59D1D906C853B6BB55030F2E0FC04C0BD746B755358EF16B44A6494E65FA26A294D25E7567E7ECFE7A830896D9CF2A8D97DD5D6FFBC521907C1677F195AE7539C564DAD1D78DF994A3F33DF3F0400EA6AD3A742FE3EB8A1855BC78F5E9ECB5F6E41A13E2411902BA48D0061D318C1D026FD379C5E4D9ECC3FC5AFDF0ED8D99E35FDBAAE7DBC9E228411D203FE2645169B3E8144F508F88D380EF8F9D6B6B7696CCB9041BC145BE25FBE39017DE8120DC3989669DE5B587E5F2C5C057ABEF2195F5E0AA441E05E256B5BDFCF636350777392CC1D5B5BCDD59C82BF8F3F885C86F5E6ACED0F0BA503944A9E2F15E8ECFFBC5B2C1444776A5FA7DC54EA0B1C9739E21E2ACD85DF739DD5761C17D71444039B3CD53EA47D67E8E8C505C39690D09E52127C8F055521EE8BE8ADC6479EC436B96DE2CF8784C71B585B1EC1475F16D92DAE9C29BE7375C527B1CFCEAC5FAEC37C3D892525FE1ADAA164E1E90680EDF0876A0C50CEC8123CF2EE2CAE3C35409ED5C5E6840E004C9F69918AC8B39899D0B846590F17243210FB32D3CBD4E3F8AB4C7C42DACB17716CC5B330B009EABEB31FDBE086602F370EE9172D66A8B4991CC56A0AEBAA3A623BB37EFFDDBE273DCA7B0C09649B1D0CB5F811F6A27ED3370D1A1E922A70214AD71C2668077E59C562DEED43C282333BADD38CF3B01E3C1F8A55B3822A7D41991CF4E4ED36D2D7AD71BF6BF100643EDDDD23B6C04486DF1193F552EFE21BD9B5A6A1D93D4459CB147647052906599533AF69D3CF1ACB1EB89EAF3004B2E4CCCF6D4CE8E3D6CBF8BD90E6D4637335D5939A3CCB8CBF6F6423388FDCC9B11A159813FABBA39263F337B3856B0A6B3102D920AB5D216FF4D370C836A85B753EA0E43E2D9E9442C9A4E64A061A0BE7CA61B67B0F012CC43E42ACD298B3057F9CD3089C59B39200E8B005772AAE2C2138172DAE25B7D54FCE9C6F8A410C50079012F069A9A7D6581CB6B2A3EA9E09E4F2C1C57BC9F127B4EF8E39220371EEFEF0254877B19B37E0785583683E5AC8062B438889130038ACD1F52098E5E4AEFC3717016321C263B4155BE8418F22E523F514B1F8BE737449A48EDB9F3B38D55E9C26DFD4C8BCA111D162DE23984DF208D5AB1B82623D2A4F4E3A104E3F84F65A020BE96711BA3B3BCE7E6630F8336B16EAC987E8FF10D97C62E9B2B1B10AE466451FB70D345A88A549967C367F6DC1C87D817EB7B4B0A5032E1A72D2078AF3CEB8116B1BFA0BA64F9C1352577BD9D0C552084898EE52AC1613617DB42209B5A8406DA72EBA89CBB1893E69BCB0E0058E4C227ECC507108152C248ACD033DB3C276E77D80AA7FB7C7D3ED6DA7CA79D469B1F2668DF1278FDDFD20CD02668C429CCB2D64E6AE7EA6C65A52B49D2A18EB48CDB26861AA872D74D51BBF34C56F5455C98E02AEBA0D3E658FFBBB82960205A1ACC2988D274E74A3C885F1E1F0660EEC75EBF839E8E3D5057F7C39DD8369F9BD6EC41A918BC8A42291384E2688F20A7B78A96746263991D57BE8BB2A516D9FBFA2028EE46CCA591086EFDA8C97B2DF9CD939D99A87A0AF0AAC65ED40B6551E6F84E699483CEF2C9099693B895C475C52C56598AAE7A9848CA6AF2E7970FB80768704209F117776AFC230158067B52AD83AEEE587F81014B0947A183F629D319FAD66FAC270A4D115F469833097897A40F185687084816F1D2CE615FFCDB27D060331F0", + "594886432182182A60A8457BB3531920208BCA5F9B84F988DEC9D71119DEFE0956740D55AFCF2FF33EF9801B2C9EA25E0565F587553A9DB639F3843EFED712A9FE49D67C197615E1930423A24D464A113C76A8545601964EBB9AF89E236A2021D25D5A4F71E592716BEA4B4F9A9BBD46A835D49379873CF2B0129E236DBD2E510F2CE164F08307C4EB11CF12AD26AC9ED8863B0EF1FE28D2FBE71859BA4340B13DBF103F6A1A855C4D51717B4B6435E6A34F7122AB6C214028766BD398C6A03AF19D67D7E9CE96EC95FF00CCB56851289D52FC2F2BBD6CF27F8D7BEFCE6817A52FC06A468C0BCCC6E27581F11A9394226D7EF8E1E7FCA24295275042F14FE0BEB7C1BFA5A1161FA57796F21C5860D6CC3C9F2D28F5C3EB0F18D27D9C512A4C7D3A3C8B55E0452405643091F679A9352E2B3EB74C0562DD08A45339B1517339C19B88D1E6B13E341C7B932D3613CADCE8B349EFF25DFB15B9306B0520006C72C01B8E1F5D625C76778DC8ED95D62DBCC655500EEFE96F90C8F5D83E4A9FBD2BE87594B6DE62DFFBC056824A4E4EB61B6E83AB9BDFCC9804FE3E2EDBB788BF3E421E62644BCF44B8023213A8FF374A14B8A1EEA61830771C6E2B48AE0AC68B14601D8AAE182A840F98198A8BECF4EC119EECFC5D7FB4D2920AFDB10968F70E65D2C8D5C8102DF73BF6AB44BDAD9B8577FAE45C83D76A3C6E425664131FB3F38E5946B47C0C9444416877D9FD7F3923C5EECAFC435FC17A806C13D79055844164A8216A605615312EA5792592AED524608BFA44DF569B5C6DA880DAB9C2B7CC0171C785ED77104E08B61C7B7625E80EF034EEEF7E13502CC6510A8EBEE8D7C2D6DD85A6DF2D13999042C0B3E78C0188A741B399E212FE05053B9F166EF9B876B17AB413072CE8DCC6004B99233B73F1E9C494B23457767C2197B101D9BAA41BABFE33224B2C1C112E1C3C5F099320603968AA648B2792E7D0F009C1C7C33D6CB5B94CCAA72F7CA5EECC827F34457DA961B39DD98A64C0DF1A1618DBA84681657E108C8620723F31F04728814055924B638319F13011EBDA0289A0BEEB732ACBCB71FDC411B9F981969023F6A3F8411D9D9681DA28DEAFFC84195A442340A537244E69989DD7F5A0F9A33D9ADEF27362321D4CD3A6DD3624D98E8DD1709C3AC48167D91CAC26705A549CD2E0C62621BC275530EBF37AE97458C3CA841E264976F2CE212462AED47D5A0F6EFB27BB657D47BF6BA303CD66FBB1C273A83EC36A4A2EFE2AAE0CE1FEC1B8740E83A73DF7A3B24CA22BBFE52584824445B2ED95D8B8A0BFF28DA14D382B8B54ADF00AD82B3CD5ABBD4935738679DE633243B4C6A6CFDAFC43C908492CAC991FE4000124E0745CBFC21FCA91FB90E6F1183E5E96F67240DCF790D87A569F6603B185DFB5524BFC6959F717891FCDF39C7B66210BA5837A5645C62777D83C07125DEF9E6371991DA53E79A7B5767B6FA08450A806B2E2148B50F9FBC79FC66C47844E3CB6EA74C7DA86F313BA8C54F0FAC364F5C0D49F2C10238D44446AB58EA8FA3B5A5F14ADF3B9FF1AA225BACB62F3BD6028EB1066D7DF265BD210CB4EC7DE71CF028E354FF81B76E3C621ADDE054CBC1366FE069ED6F99BB74DE007B9E2BD31D1A96536F2260FC137AD11C5D2C2108C2C8F3C893F4A6C4A7FA2DE0AAC7931FB85C5882933C128A9C3191C35FE3CA022427B6AD9447A09B6EA0AA9AD70916E9127900DF0457C6B901FA2740353988E26E4B9BA1711E451F375029FED9AC02564333761603E99A1B725136B5494538C88FA2357FD7D9C", + "9F4D899456FD3841B890A61EDAFD40C7B43FECF9D700EE269E58F40BF2CF47CC1C1EC7F28D78909A53C7B79C4E6AFD275BEA739A3617E8B3C3C77ABD4EB770B9E663BF154E77205ED1F2C5669CFCA18DA365B988499547B2C36D4A56582FC610E06E4D43E54CAB563B7E5DBD04CD04EA83DA72645F1F26422D416AA26CB2AE11C1EA270CF7E7AE3679FC2D69E012F0C950FC64A56C7B766F909526EFA0AC383E4A28CC5C52A26CDFD2C3FD2AD820EAD3885DE63114DF5D19A2EA6C2BB338A2171C73A7C10AF41A9E4F0E49142B363AE9D306378B3211CA3B0F21EBA2E72BC131459E9D05CECFC76D6E540587073B0CEA1EE973B56EA2E671353210885EBF3A6465C1D2AD12C89217F1ACB1B209552F1DA1543293D6D1D273C4AC5AA5A4B9D2B368AA82A7FF8E10259FD1FE52BA14F45A40F72B75AB7DA9F73DAEF5642CC1744E6550ED6CE2E547F33598034E8970A74D7B1D58FA2D4248186083BFBB8BC1A34C744B6F08AAC374C28B1C0F9E8C2B220C6EF0B5C0400D3B725005A711EE66FEBA353778ABD4552DEF9E5309FD0002FEAF1F3C5AA3753CFD7CFD62907CAD3B1F68071C01886748201050E39EB0DB18240C5D598D213CBC508B8F0EE7708CED659CE85BCA8BE714DA5A607E023F9609EA3D790501C4A9969FFCDC7B3E7317F6AA6B99CFC32FF1B74AFBD42A9773EB0615598C943BF55C1E8AA3B85D5D2EA2892CC33FA809D71621B02D141C74722397318B8CA0F4F9DEA01096234025573995DD2F915D35F7EBB6F7F3A9E83C2D23D769B639042FC669BE9778390A3E4404C04FC9991FA6860AC811BC07BCAE69756FE9DAB27B91B91C51892D61E94DB2B486C25D13C225810620023F1B9FED1E89B002B7B11A609FF348867E1CFD827199A5F0D6FA267F60F89B09B5A1D8FF62744B386709990589D0557F5EA477974CBB87A86F2E6E94B758607454E3937A539C85569B5E68ACFE4911CB053CE207394B686B962A7487516971740287DE8C51CFD26A14AAA3D974068D227089093812DE910649512D966CB97FCDED09F4BCF7749E16E3391B75A4846F65EEAABC5A1CC89B1D9D52C541DC65CC468B27493F76F6D68AFFCFADAACF20BD979CD63A42EA3B8961EAA2F731C6250436A5A739D3E015FB32E07D373FF650CDCE417EA85A6DB8A9A24FDF62487855DA1C807943154C162AE17BA4E477531100431D647F2D8AE76DEF070A0418D2365549BC66DCA95722801F3A77E435205E919B4B349ABACDB2BD111087B05C05FF01E4BF04F5685665B361D37634855BBA312E96F2C6314590E298770C3CFC4207A0FC944622D4CD7280CDF5AA241232B6B5E78BBE5C6684319AF624124BE84CD2F1512E89D6CAAB620009206AAC993A9F4D6A67859C20A8B9307D8F8E370F2E600A9B363C2A460E0DF5AC007EE110F4C088CFBC2EE82D623D5EC42DB739C2267DFC81C830244A6DEFFD4966480D6EA8D258FC047500062F42446230456F9B5405610863500A8AE2440A00CD16E5B6136B0BF1611345CE7D70319962896B3F5E69583F8D305B760E0ACFFAD762DD06C54EBF8075C1B0ED97FEF59FBB48A7A65C2251DA406D5E9E5F67586C64E5F8FCC805DA4F33BB583DE2D5F85A348AFF0215233EF88C310FD1343934F5AA2A2AAF8F58DED34D0E35D210FF01AB4114E18019A2F7D6927FD843F842AD6AA0E171DDDC2BCF6B49EBF5D91C35665D8F88C0924A453FE96CC06617D81DCE66A3C813F1D3DCD5C37E60BC672ABA16C2025C78E9A1A6B1CBC4C02249AACCF55862C538ECC42D0169B7E3F4B188F2698C", + "47A3C0CD552EDF50F80D3E5FE68A22F85EFBC41BEEB787E5CF0CBE3266EF310BA5E1B29A7FFFB0945121EFCFF811A1B7DD768D3ACFC21C4E6EA1EF06E851F2FB37A5F8E0C49F59A28A4CC2380A0C0B4043A7493320AF4E34A2A20E36A6BDD2AA49088FCFF24C84A4D53FD6D3B29178F921768F21C5827D64C125DE4F7F435C6BD000BCC1C95D0F82D61581049CDF2A34A27F2D9DDC409895B9742443D0CF74F8A7DB13CBAD88E1F1D6F52E4486809E20AAFBFD82B297B038BE774BA13649ED922FC67F6DB9F0864B742F6FB60E849F9A253E8B0B873C8501F72D3523EEF62C1430350852FD17177203DD2BD4065984190EA2075B5385E1D29226236ED894DD10FF82F1DAF16AF55F0940415685B3A58D1DF7CE0B0F069F33E6FFA29FFE6134285CCCEA2DBDF1B901A700765449D67C24766A042D43695D1F5D241974E62817FF9259879813F37AB1E8E51F6C654324118E411ABFBB6448E9EA3CF1F636D2142D65775EF9FE046B80F0DC1D1480158D603626F7002290058E62DA252328927BD20C05E5D3BB0CDFB6C60C04DD8BF4A3C9413241339AC186B054B34B24D9ADE710A79978158F1E2EA5AF6FAE9077CEFA4E335473D29BEEF00624FE6A9DEF0BA52464028BA25D9A9C1BC85901F507AF046D56B17CEE0F23433959CD7F1085481697808B99EE619BD0500B55945186A81B89A9C6B0E32F1D5196C4787BDBB08A6F1D79AF329B38304B1203E9B8093146B15F1207C7EABB020B72B2B92EDB95377D698F10CE7737FA3DA501E0CD09F3FAE9504ACC414E63F60E2721E759CBF2CA1E2671A98656707F4629626219E4F16D8A765AF3E75DEC1B6AA82622916E47872DF33689D820DBEE6EFF26E70F61ADB2EC3D8FC9A0AE30F12E3CC5E9A8E1A820DA15952401D3910F6F500D4CDB7D85401AA4C8F418F7E2A166B491D5CA3B415378891B359112894274F25E9DD2B391A96636D468290AF22FC6BD5C2E7842AC5A62BE24D80E6AF79C6F2118C126D60720601272FA89F966C812EB875052A0BCEC16D0E6C973EBB683214ADAC9BCD0541D32D33AFE16EC2BB424EC8BEAEF0BB8A3DDB18EFDF58EBD84B2DC8C7AD54B86E698BE762E73CEC7C1DFB290F6CC1B63F5257FBFECD9EC87D8DCD2FF393B1C1D1BB2EA9BC10323E6CA3EB8EDCFCCED055680109C03C5C668BB8848F38C4C3369A4E5C0515C7245B0C092F0B8525434468E775F40C4D4206B6420039BE1F695DE802DD718B9AE4FB41320C220F6B9971A4CB8E67C6B0CA3049C2772D2B3C1024A502B48362CE9A1B84BF4C9D47D62409B5CD9BAF1E18DE57E9BA9CCE077266D720DEB23F192C70145FE201561AA2A46B55F9B6E5BC8FAF888FB74BF6510AA7E6BCC40DFD471D6CBD2FCC28B33EBC763E8CA58D5D74C1996D66CD827A6A6B9F22AE7C24B13799A7D0A9C9DE940CA217FDB870A1640B55C69B2E704EA21262DA831C7E23411D81773A965DF6AE015CFAA0D5DD3890D0327C514968C2F72A02A0A35243616AAD673DCF57A684E1C9A6B6F35E12C09553AEA89DD40CFF53EB16C5EB9F98B6D04674F8DE9B6AC125B8B0BBFBA71267A6BFBDE26B64FFAB35E5C5F27B7CA273B901D28997E6298E610404C07569E906AF09A968A9E40475EFEBE524357B044B964136C989FFFC70244DAEC0CE3BBAC48B5A0CC79F20AA1E58DDEFE7BCC9B3C3A04EFA49769A50F81AA8F3D152757F33E935CC6ECE9959B47BB90810BFEB6108C8DE4643B24B4154CB7EC3889F5FEF9045A59E82300275EB4D379BD85A29915796B8125351C1CA84EAEEB7607894508", + "C9ED53081796789261D7D209BF086C92C36B574AFC6ED55C3410E0723C799696D9E7DDDAFB114606EBF4256461FDC9B86BB21A134F735837E6845571F6C2712AE42FE113878AAA18C76D5383FBDD38E43FD1314166DC0B7CFCF3F07ACA56740A582173D2DF20F7E94F0CE29693AEAC6B3D1E4B22BC63395BDA6B49E30B49261FE045CAC9AC29BE5A2D91347EE4543495CCC1A38CAA59593BC3DA05611BDC74806284B4ED73013A415E6B36BC2CE31181971BF4C7B488E78E921C6AC1070772EC36A9BE74DA8AC4FF68B6210A392866B689110D9BC2C7ABB2D82A38EB990891F264DDE5FEC75C6B4E539F971AF2728343F1641F4B05EE8EF3A520DC170B3D8D562A7AB72C409995034F6CE1C258F486ADC9E44FEE47D5E81BF1259C0AAD3BDA4A9E17CA9C74AEE77FABA25B3481C0317199D585BC75BE5A774F8D5CFFDFA9FA652C4B14E29AF2DB5ECBE682CA724BD98E05BBFC82320C8883A56F687F840319DF2D8BDB3FA8553BA3FFFAE0D4EE33E84B62228F924A86C5FD5B3E12672DB6377D807356144009F741325714B5B6AF0803F3DD1AF558C0B76620F77056A18896D2047C967BF69ED972BDCA50409929CC2E2DE802ED09EF87433B978A850ED7710508889EEA4558097A7FD83EACB365371F80FB6EE1F7A6D258B97BF1AF9C321A629A5AB7559CF1B82311F816836E391BDAF741E493298B49C001783921ED1569C149C90D26CBA94F8604BFFC94FE303CCEDD8812A95F7B0E71DE95869D2515E524083C7B2E06C4B5E9DA12BFCA74049F03A352C15DF3B79C3F2015E86FA527BEA76102DCDDC863263F0C7E43CD9D49F05D8F6A124354036388FAE37DEEB43909E415EF9F5877D04CB5A86AFB74FCDC990623C9D4D034816E39B692B68B732322695C97CA93CFF0FE7FACFC1DA29BF0D0C08D93B4485D6664E96B09C8B011B3107FF5232DCDD9B3B8DE7BFDB4CABF31D2E92AF686EB8C2FDFCBEB80B5F5591B3F7AAEEE0FC7A3E4BBDA652C8E857AEE81F499D9DD537139B7A6275C64DDBDD17BFF7594DA69335C01AC24270403E880987F69D4EFBC2BF2B787A631859241063E7EE106D3EFFFE60479A8BB5C11ABE38A76804D43A44327FB4D4F986BE3C52DF109E4D72A092F25CE7FD384B0404628936256877CDDF543099D5B0389A9E05CA93A2B12C3C89BD76F55084A03148E29275159DD41A75FDDC75994B8E8D9FB10E6E80A4E30E2CCE8F8DF3FD7A8DD567BEFF109ECFE3B8C843BAFFEEF5B70D5747471FB84DE2A26747DC73C9B2BE9905C53743159E489E1D0CC14E72046E4C8D84F893CFC7EF15CD9F52C71D91A503802FB5A6813A7BD2DB705BADB58C06E0883F0848E44C20A4948119058226031B5731F36B3A9177065BE9A0294F726E80B5AD2F2723B8698D831DBA376061FC2029979F0EA7AC4BCCD87B6A432051DDA7AB2387260082E6D3BFFD3B2ACE807FB6792DB21AC235C1A58D9E47D42EE055E716D389066AB0814B36291AC71B0AACB666F7CAEA37B89CB424C4EC3CBC68F97AD6FCCF5F3B5094E60D68C2F1180E5CF2141EFC84DAE7509490138E0EE466AE0C7469F4EAB2E5ACC29EBF2BB225E595181F96700B552BC0E1171428FB2A2F0448463CC86DA6F7DD10FB5F789857A29FFE9535D7CA35F70640B9D4B9862234554770331B52E42002D123560BA7DCF9114BA9B8B23D08C3240E3EBCB7359D13767810AD3F3F66A8D698D17F20DA5242259090C0A9AADB9385A2897A5A1F32A7B1549A45D4EA8787523AA210BCB55AF6B15A1F150E79FECB104CE01DAC70125FAE9D1B8D0", + "334994DCE050CEED5471E648F7010ADD69AA0CD3DBB3679C9D3863F86319BEAEF1370902CF4978B8237638507B392AEFEF731E6FB42DFC2A23142EDCECFBA399F9C583866B1BFD7C280CAA43C2CCEC29C6657654C251F7BBC0F83E2C356934C825BCCCB36073A5D540AB82DB7158C7893AFF166B108363405B206E53B13A51BAD149AFEA2A40A37328D4CB3961C9EE2EAD29C76F70FB4E6409F468364DDE7A2439D24FBB05719A6A489513B14229E1949142301AB538AC775AF716707193959417B14A65E2D20319721FCAEE6364D04C480C07D732AE0182090C517B96DB8FBBF66B8B6FBBA35CDCFC87B1C8C0F2E4ADB486474F842434CE9383A57B69D4CDAE68E5306DFD737AB075A60073846634AA6E2A6D6F7CE56A631FE1E3DF256A1E39F0C44C3EDC3A9457EB4FD4477F2AE094979599B9B90EFD1BB9347DF2E654BB9687A2EFB857D9AC1306E20769FEC4329BD54804354E0235AE443AF3BE01E26F0D5998D7FC36DDFA5EDBD3958623B6F065627D6A4EC9901891E3C63522744CBC48BAC51BCC89602D66D1B3E0966398927E869E73AA8B986D9FBB428BB3A71AE7B273A16228349B81927B53DD9B7E96E3D078F25EE564495BFE7B7E6CC042E016499952DCD37F171C709D4734CBD8D46E7989C2C497B5EB9613DC311643ED4B1B08C0C4C2A5854CBA30AA225C683913B5BD46E1DA483BD7EFC2C469DF017BFCB5BB07C64A68E3CE828A537115A07876D30999468358869AC7681380A7E462ECD497A6A6FB6AA134C15C6BDF89A2B8D58B875C00892C50A791D8A50514029F790F7748EB0C1CDDBB07AADEB920238F9C19BFA31097F9AE3B26509DE5C4040CBD82C859EE7C4D094CD7CF8F04395684BF7BAFADF75027B4A47A21CBCC6E3ADFA6A2AC66EA32F670F49BF245F6CDD0FECA201E3E7706F8E37C25FE87B3040C0D8431A00FD4B49E7A050837560D458BB5C2E93986EBED14944F9E92463C312942E6D8340BAF149042FF611DA8ADFF9DC86CD28185555E033F3E22856A80C482D52B2EB21E2D51625FDEC689595EFC3160351B5F30E1B802D5F4F35CFA2C25D8E4101298E6B0B917B5ABEE5DAE3CE09DA595122AA3BB3D8BA8BF0D68EC99C2DE8B4BD7C2A0E0E32ADD32D72696C43C7CDDDF92DACF13D18DE4A1403D0002454E7081B92EBA207DF9411870B91CE9DCC5E26887A437726B6CE2B2DC51907FB108EBFD2F089F893A6D5B5141393C08F497C180AC4A95357E417D40C5E7FB324F0D72F417F688D45B980E215DA436CEAD3794A135A719942FD0C998F3F6F165C16612E2B3ECD4CFAA9A18631AD9D878D63A8E09B0F82C12EAC730E6C5A083399B7A098819F2F25FB2CBD1B6E65E3C30302CEC61680B699F504E5AEB959370E32B58B9FBC832F85AB0846AE4BF678C272CADCB5277EF13A38B1AB787F8E5344D7DDDB074A92DD68A2A2F9695FD52DD685E4316FA7E913DCBF34C3F0D9E9D22CA862D76DF3B5E9E3B54992A7F731C893980F151BF29EB1AAF677B439DB6D20AC69A5A41166799FC54FA68AFFB8D54EFC45B49E25A93B28E87E41CD7B3C61FF24F1D0BB74CB20D2A8D817473188FF8E56EE9C4006083BAD781C3F46BCEC777B2C72A9A3F551353DF186FF9D7B342D86629C4085FF2108B98D8EBC886CFE3C7A4B673D447DAC5B1DBF6BE6064936AAD014C0AEF0078C5D1A626830C480E8B72439C9BD0ECA0B41561E5B0D6618E77042FFEB6CA0F29622EB9F21B83A4560FB26BB98468F33BBFD5CB29AC4F45EE9D68A1E5DFA757DC218B536A9231D7FE228925F96C32E0ADC0", + "1B2A30E6054391704DAD57B34530294AA46DEEA044EA5E707811036742E50DECFE891FF88372A4AF65CAA193E1D8DDA016ECC2A2E3F6D8F2DCF9AD1449C614A70D253161E2B05AC67489E13345C779F3D36BFDFD7AEB2AA30604692969E0C4E375D18293D5D3CC39E31189698BCEED3290A2CFFEA79EDE157F2A52B4EA52FCD82DC4BBD11EABED2F311DB72EAA53A1B6811D03D3C2A30C76A8638E6A775EB3A51FFD4CDFFBB4B961075E6102D2E5555ACB06548D119ECB6895AA00394D4A98C8302E02F8D4FC5CA34B405F25D2B090932A10A4A68CA18D799C1DF1C86B1F88AB219D69C25CAB6AF6CA0B3A4AE390CAE3AA65D3AC95339EE734126226D1F292BA3ED968FD2CD835F621C3CB09E59B9DA5CD23163F573821FB64E296853A8263AC9DC896D6E355A4C4377BDB4E7004CF399C0891C1D23E39F03CDDD94DF7FCDA06261E923C9E0FBD8DE32B49935A03E66C13FE7B00E83674E64D5CBC14C0B9F62A842A17551E5E7001BBFBADAEF36228513A43D4864B8D2C8B272562A6B548C0B3E4610609191B807CE861538B89FA079217C91745EA61ADA6AA96464A135DF216FE5DA5143F55D76D44131FE6E329826F2BA062EAC329161C8D158EC7A3BD5FE57908C7523430ACCAEE3091FAD4B14DFFE0DFED92F014D19641EBAD22052FF8D262D39D6FAB21ED66A82CF8336FE8E3CB3641F15EC5F2E2AC0E99CA07223868BAB78DB3A008B233FCC7966D816082C231C18165422F7123325F365D257FE69867CF0CCBBB875D5153B8C1C0300EBB1AFBA3371B83488143EA2562FA477D210BF68251312A7EC26BC837F9D861101B580249FF24C364DA978C0F57C3A3C29F03F3696C04A3CD330247DEC04A385739D90739847867592B09DF211D8B349FBAA760D64D5E00C9D596CBB8B73E7B17317AD315004B35E7F98672085811DCFE7C86DC0169997F2F9EC9B2B77B97FFA6CE2AA70E2A1030BD3ACC5FC3241F291D0304B71D727828BAD824445226CAA77E210A48EC8F79E0DBCA01505D1AB9F79642716146F7A8F9EA25238FCB2F9C46BDC1489D35B958C44C7928BB4503DB8DFE4C1AF5406C04575C4DAB11995BAC0C7FD72B10ECAE376937B56A035DC0A4D7B2E1A180EDA4A84F97D53B57EFC5562643AA62C37211C2363EEBAB6A2AAC22FFD0BF623CE6867F3C50FE502FF535A68BED2FC98C50BF673B2C5BE8D7D690764C256CDED17E4023A04E70387EC53947395B00E8ED6541CBF0B076AD2B2A26CBF220BC665598D9BC1D1EDD309E687F7D1E7D71F4B2C1B5BA020EFB1DE4248C234A68670916EC8A72FD1EDAF0615CF3FA768FEAA586B08990E05E24E7D8E0DB32F4370CEE72D74BAAB68F6E57F2B9B0F51691990DB46DFADDA7503BE7F64A13F5EB5D49788CE21BA768D028037BBB06F3573CCB244CA51362374776B9EFC776AD71AD1F5635B6CB73822A112149208F10E657E1297026113481BE7C862FA099F331FA5C6B1099AE77D4F6DF2C74736CCD9AE8342287986842063A65845ABF45BA037441D967FA102134B25BC7F1F9E8BD4E54306BF8C36DC01A500F4A1184D7412841329DE6B27BA4D772B1B2B68348228037A9A048C0989AB12B42FBEC45C69203ABF843423D51CFA2D67FA548BB39D0996D4C215157C707DC251032ABE51686BAE8F00E0CB4EDB664A3CABBBDEC85EA7AC7724A461F9F650F9752C1E5B8DF204C3520CEE4A51BF8D3BC9A0AA3AF9D31B95FACD006ECD27889F1D0D1B696DF57403EF0E6FD83164E5900691FB29B19BA4F64084ACFE98567987632483F2EB2CE76E1E0B8", + "5513F3F1C262853F074269AF598A2E43052CA2C0141729078A17BEE4CCD35B761B1766B3C118C06724B0459AF3E973110D7096044F5CAAD9A70F3BC7AABE628848D2A4891AD18CF4A3D9BE900A2F42F5D54AFC7FDC7DBFD3155F9D06078C89F8DB684B62E4CE0DC0AE0E4EE6F0E26A86CEC1DCDD96EE175FECB827BDAB3DD53D465E796FE4C49F46B0B6BEFB951BB1A679190F3FAEC58C00E2FCA744A97907765A3834585E4E00B952B5B7B5F10E34F43C8EA3F46C58F8E31B3239C0658F81FC7DDD5049FD8D67587C85C78C12CF122CCA327A7860A0E34A34DADC677F82014EC7217D2710112B6C0067AD402A941877970C95097A47AACB74A8DAE4C9B5F360B755EFC4546D7D63C580F108B197375AC08EBB1F51E8AAC68C39BEE69EB886BFC2558F0A52AE16F514EC168992775060A5E474E8B2A1180C8F9FD6F3E106963DFA09D48007CC276C1464B00C86CEB1B7372684ED6BFED1DBFA6248F4725E7F8123904BD0552EF70A2E21B8A078CB90EBE75B127A1C887002D70E32CBFB6875138D8DA5B312A97AEAC2DAF9D6506FB08FAA9C334FD686F6CE07F4BAC70766C6FDB001BCDD43421CF70B8B33D22795303769B2C37D25752C9C4494A8E8A0D9A1205A03889946833C065AFECBBEB026E95987C022CFE65DED4F4CB78ABD4DB2CEFC3D69A4303EEA5CB2E8F39A2FCC995DC4BABA644F65411F6809891DF1C0958FB281A7852C8330109EE9D87362F461D3266BA8C2D3E82C9B1400220B19277649CC804A9FDE4C2730AE11CE633975EB3126E8AF60803DDB5C0258F7974BA7C93499B2C2ED1E71CB64E61854D3FC186333328D14A12AC06586246EC7621FBF1BCA2578F2E16A83C9A6800A378C8E280C7F3378CC71011681C884B83A56865F138FE35C123E28F1FD461F60836645A9F9F8CE211A8FD6B07D477674A34F78E3B916A7AC73A0AD9C8323D0229706A8C2214B5ECE1301E470C37818D68092D5DA3F0F794B8D476878A5B9FB339999F5422EAD28A16D8F8B39CDE00D14B659AD8DC33A46F64DDB8E4F142FEAE8A9F55B94C40D62723CC51EF718C0DFA6D9799AA1863498173A0659F816FDEACF2DDCAC54C1D535E1C0FD9922B333C780C1149C4B294AFC5CD23CA8EFF423A3FEFD0EE1A5B0CB28964B8E80C42AB660665C4B55E06E44557689AC22196CE641644959BC7F80D1AA828DE75CC21E0A8FD211BCF6185A7DA81222CAE0B632A7F98484ADD6E83A220CD49D5942B7D16309AB1DFB705852A22A4D51EDD96DB3E318CAD7E96D5531193DB24B50D3EBF55DF8214093ED0491B037E1B38FBCED71199A063ED101C227A10313051F0B4BF4142057A73C491AEDBBE916CE4BC05D1A44FE7A2E7DD76CBD24C13F3758BF7E3BB8139690E33631F180ABA7425DE3E512B53663CF9A8D1B28C0B886C655AD3A03FA8698A5F5AB5484E3CE53CDE1F34A66FCBD734D15BEB727B0FDFDF68BAE40299C73A8F455ED471C82F6DCE240B3BA4EF6364A56828FE2D6BD8DFF03F35F5C6CBDF0C907F7473F24938016615835D801598409F1004C478BB1B2283AEAB437BEEA2F5FC51D8E43F78C0092ED4D0B08FFBDF1CD60454D3BFE6EA1F41EDC5EEC06357DB41F73CAB23556634416369365D13FC8FF9E20EDD8FDEC673F0BD6C8A1EF60E394B596B70F751EF0D9D7E8D573E3526D2D90325B52A08D25F18DB0E6757EBB6002251809ED47C85D4FA37C5890D60B40BAE3AD22258BBEC4CEAA1B6B585EEF32615F7254268DB82532BACBD9C553624AFEA6BE2AE9E1401F9BE05D68A881AC8D9E0CD437F60C00", + "7831C1BA1031B6B0E0ECE28BC7E6A8ED16E3068E8F0006DA96B8740114397B19AA19370B1E1F061AEE3895C30D0B7099668BE752BCD8B1CCBC497E06BB0F75AF47A36EF8925A59E070115D3ED63C6D7FFE54D037B4A818703F6D78BB37725D7F0AECF6CAF120A80C938FF44BFF16544C7847B1A989598F1602A220392CAAC2EBC390FD53D15CFD3372426CA41DCF816E29C731FDCA2E84CF90180039FB1AED0DB9630BC28D54201D5606906091A3F867D257C3A0F8193DCCAB2625D40DE5EDE651C20F2DBC83FD551EF46C4E724D2C516560749AA89D35C7283385E98AB34BB88F8ACF50A0EDCB70888DCBBCF0B792A5D1F2F6977FA081B4EB08BBDA076A43BF1EFCF1C387DD5B92BEB5000B4139938CB0A3B6DFF47B729BB5826C7E188A177CF6DB1B88F051B537DA014B396645218DF4EFDB0DA597B3A78E9884DE4A7B3D06C259C10B78DEA1DB711CBA8FAA2CDF37EF0378091E408960B011F4E4FE24771D0FF3B8DD01DB0527087AC5C0F64EB693D38E0A128FBCB8053E811602A05F3DADF2166CE49EBA13F382E90EF4A143B2CF4FC12DD4873A40FF7354C6E648A56623457665402632C41942D23001C08470AAF1F3FF0A474AC6586C76915FC91AF074103A1CB9304485F92F9639399028EBBFDF9394B4BACD6BD3B2177368B94F639AA8D202D6BCA88D74AF0610C7B565067ABDE4F2BFCF8CFFAAF93274CBC913EE7DC5C77BBE978AB9F82B546462DB933D67E0C6748F943F39B8FD6791847C50A5A834A78C2FBE5D21448A035D83D45F9ECF44C21C4DE726AE8111CF277049331D78B06E9D7D3D0D8915C7C32CD6954D37045E7AFF8AB496A4827574C457523AD6B85F78641BCC4C9535D29B3F8AB4D944125E6E54B3B3F23EBC04BAE3AB102977EF829337F51CD833B4F5D4559D79E695470F498EB4388E573D004D725FE41AB1B39F9526867BF7B99301E0E50AA569B3B23EF78D02FA53C4BB2A184B02977F2D2AB3B71DB09E3E8D9D5B13DB8AEB0A95F9296B7C49B1B3D6903BEEB1B9792B5ACC1A5D11672CA5D8E3825D044DA986D01F6E1E292D74443583E49CEFBCA177BE275977BB4A4F77ECD6FEDC886B4B83AEF5F34AF1A78DDF6B11C201760175D57823DEE0FA5C6A9C1A91638561B857E993779B6B0576994CE86E7DCCA4A89BA2ED84ADD1D8B4E11446C41DD4B1EA71352E26B2AD4B8A1C5C64822CE21BA4B8D7D6589FCFA906768A2BA0C5AD1758AE7B8A2BD757C8E459814CBDD6375DC58497279C0C327F67D14FFA5C90167941CF9AC642B1693D7DE52578AAAA56E0EEDFA4CC12C7469DBFAEAF5F9D3D72FF103918B6F6DF7E0DDACB208A8764B459EB01092A101D42E762FD5C5AB381AEA19BA6EB8CC9CE138892FEDDCBDBF818E97EA8AE9846C0CDABE9B4FD5D80431FE03A4CBDA566314BD1AF59AF120EEE4105E1B701A4058F1112F2A5C8D9F68EECC870DBE78D851F89AFACAEA3A2A068C59654EF5E5BE2F6727136908D993434E5EB1B84331119DB1C02547EAF7C9DD479C5B326CEA6224B16A2E108E76CDF0C54D16E472D0CBC80DAE7980713602FDA31A6B04E4FECCCED96AA3901D7B35D445BDBA020DDF1BE5E9914ACE600ED24E492138F82AE583A2EA454EE7548882C1A192F11345A3F5A3F2CF64B85DF6306F7FD396C4E773FA66CC098EDB3CF8E5599C2EA13A6F726161BB0C0D6673F02E3DB24FF75A5698E91C1522424D443165B52C90FFECFFCE6C42656138BD85409C45D8AC453D6742B42A43A7626E70C212B7318834B7D29CAD0C29F22E6AC3A59359B1A75F727E1DC", + "30B93A783620E3E094D47590AA38B10FF12C3E421887E9081F9A9C5BA1D753F341C33B7322187317C6610EFBD0382DBDC2D863C48F15AC3FA86B3C5A5B9EDB937AE961E8EBC3D880CC79141B79869F95D6E90C5C5E7D9448CDACCBDE184F6FB545324995184770CD2838B61376B148ADF3A42123AEFCF8890CAC7D3AA87A624DF3B883E86AA5FE6DB385778F50BD4E528C6604CFAE0E39BD949118EEA3972327EA355EFB98E9DB563FF72C5B860103AD262BF34BE17295E37A81D1C98EE6FD6690914467048A50AF09435A68FF9A70B59DF8FA7A543BBA24EF8E13AA509C7A311E12773405A4024A0C2D7C2802025FC48E8FC12E4B60543001971FD20F1641B968CAC283BCF8140629DA13D1289B7130F3714B8318518770EE1399CECFF1D3074A65F8913596F92B269529B5FC63D824AC7B6390580C516BDA78BB1F158B2C69AD2FC1BC610AC24DA696F44B58DF813D9DA52529D325BF2B3575768DB43AC3BE5D0402C717FB587B6976E6701B0A70D04F3250B6C54E99983E2B1057DFD9EB7B621504A1004E7E67B33B138628EC7C43A199D00D9FAB8B1990A5FF29E4399051D1C62AD0D86B651E9DD94D27DD6A7B09AFBF1EC737B161A4A398F7F424889C0BE6FBF8EBAE9F1A835FCF4AFD45FB36919D362CF73F0786D93552A7B4E421EFF9D6F98078F85098DC99A1009D6551F02B60E12BC28499A27FD7DEBE1047CD44EFC0D9081323DC08866DDE79F8AE34136B04787F6A5918F5AEE705CFDD5071ACF8FF54A232FE39E1D79D82EFFCB6CE1B68A17B4585817CC9AC33FD6CA21A00929F1EE5B9E3518B27060867624D8262EA18F1B01A525EB6CB337B257C8855FCAB72D7A83DE52E4F1D5E29EA697930C25109182B95A202E519B3757092239BFC633C4A7099290FF7B99FEBF81DF5AC41366D3DAC3384C65AD0EC84F0DA4A0ABF7D8E1E2F8B898FC97325878D911512F1FA5C24F009856D44123EE49C77370F1D58E8476542384A0E45CD852D19EE00025A8BCDCC011BD259AD7360D12B6A630BFEC8A97AC40781694B0D5B3D50D9E843FFAF7A023D451E282FAFFBC38BFDAFEDB34528DC792ACD499179ACD26AA3765523E91A137F52BC959D5969B301B1893564AB348606864916C8D79DE6FFBDB0C2ECE83B0A3BB846FC37C7D4D2A37B2B841CFF9820DB444FB090B430D9714FE2ED731F097FD30C2ECDA7B6A276990647741496729219F244FBC6F1CE02F24F98D0212AD005E54F242A77858622D6BA961190F97438FC4B33217A84B5EA9D3471C27D08C2D52DF19F2DE486C9A5EDBA2A56E1349C3BFD312B8927A9E86A97830DD0B11F505AC481FC6834F8FF7D0E67126033502EB5C593D15E1A56DCB03ACA1A5DBDBD6E6FA9DD3D7D152E8FC1741BD876760F99CE780EA5BDC018022397587357614ED37266C69AFE4644D7D5259770B85B70E7E395D2ABCA3FAEDD5AB32C4B61117BBF707A58530EC435D36370D6AD8F9DA503F8994F6CD627336A731BB149D3D3E96075385DF8CEB3D9B48757A79C67C0E0C701A2CEFA092D5462E28D12548FA041C5407AC321FF049B37225742345E065720A81098B5785AF12927167ADD2F72F766292F421C290C2648E270C34443ABE5B95B7E635B4CBEFF74478F65C77899418C8ABEA6A4C3FE217D784823CB448A7EC0739C7166F4AF733BE758B6D5011EAA9B05ED995DC70E3D5A2D2298801C25049661FCF4CB2E9F7501C86D763CECADB0C86B348C7BF31DF7BB0CEFB4A2EE6861D3D9D441AFF4CDDB979465C1ED95692C5A46F5ABEC180ACDA140AD11BCD5B8", + "84D5B404488AFCC35CFC6EF1CF7A848EE5EE527B7D2D2081EBD8FA8432414FCCB271A43FD618EF95CAF1CEF445B50F02AFDC6B41D5C1F1FF4B6B8F2AB94F90F259383F44246B2D400C3012FD76E2980827C9B5476C4651293CBE9FAA77EFC53E369B94F51BE480EEAA389D88AE421E75EC67C76E30A6FA7EF02500372E4C9AB875EBA1C357C003938B979859B0A914D58F21B3BF1BE8C33A1AF079C5A0A4EA532F93A10F6D96D0A63F3C99E6F06CBC072CC5D71A517FFF40BC260A26E3A46688E79E733E1E2F0010846937689E2998BC769186E0B977AE0A1689245D255AE7D5F34715AD526E824838B62546D9569009A191BA5192535E23142236F4035C90D1405C8530A57B402118FDED2A5DA4B40635D2F95AC7CEAA370686F0AB23AB31DED369BEFB066909B76F2C04039E49FF0CFD323628D03C26F0BD4054C127F21355C33B49F86895D5354C3BBD2C0D38ECD169289F7D8403AA1753B393AC06C887F98315324DBD78F9BFD1AD8880D41D4EA98956EC89BBDAD08F7CFEBF26988EB5AB01D4E49AA8273CAB6AFDFA1CC1C95EDF85284E6570332A0B8242FBA495D87A01A945E61CD36E865CD4F430F04A3B3EE74CE0486B5676F7A938B18E1DB2DAE2FE1C04B3D56892C7394D0B07C5A2F7698D196711DC83FFF6ABDD4E8131E1106EBA23245FB0E2A696E440FB6B0B1CB4DD22C9720AC76F09863711647A7E369FDE5D6911A5FCF987470B8C06C4EF7063B08A8320B4371866789147E9D7C5D477A662A501627F91E95C6E2CB6814651E9DFACD67CA0B1FE62F44081E3BDDB964C1E5ADDC093AD185F0203B4C0F7E3E96811F14C79BC54F2919FCE5B653F6845CF1AC34DA9E4CF52EBA626B739246E25204F9EF2CCF4F5ADBFC53CD8F629FDB82186CB52BEB7136F105D3CFF9CCCC2610BF2C8F943DF5BD03877ED7AFA25CA81C4063E1B97452A937FCF77F1AA068FE2A26F6ECDF662ACDF18391AF7D627C2AA07CF5597B5F33AA0ED4DAC98AA73C8321EBF6918EE568ADEB1A823527AD75CD5BF7ED3EB5633A4EDC8C59DB0A91DA79C248D6894CAF9CB411F302635BEEF1A1C7916C7545B8BE7C577692245E285D32B4FD18E1478F88F8373E22A5CEC6D22EACAD2A41612F05AB2C54A1C03C0512359B0F9C5F91615EF2EA80DE97230480F489FEDA38D52FC84E2F1258CB20FF0E850639B31C2958BA6C064D0D0F4AAEFF313E43C65EFFFBB47CF09F2A122D15F76E8B704DA8F2B8C71449AA49774EBB7B2DC97CF6004D2FF6D37B9C689261189B85CFD50C20C961F22A644F51497377426556B956DB8C899045B175A8B9CB22EFDE535CF487E9D958281E0467539853054FC3475D2E142D58F9201C1DC6B2C1A12B2878F9366E2216405069B7D03852AB37EE83112EF2EE172F4E5317A41653A656A06F6633AF59062A47263A9977A50B9115456A58F9C3424FE7E0CC57DA70FEE0411C1479B4CC2E6E720B01432CFB3C503983B37FFBE38C92E50D6C5795443F73244F6D28AE6270E27D46A25621F86A2BC4259DE6C04CCAA657FE656C640833B290F00A1660329A3F09FFE60152A23925F4D8B0933AC016B5802CA863F66F8CEB5C8383B1180A515AE6C51B5F56597C3A004F8D25F8A6235C97B4DE38468B63E3B859A487AFC4320598EB6D143E5C914409D25F6DFF6E957D575C71D3ECBC6743CCCC03E5F34791744637A994F3ADF86966B4FE911C06F7BA1A6C20A2971D82B64E49721A530D9D5A2319D5BE0F47B8119C5A835CABEC735A935E23CB439970437C6F4CCDE2525EF0D7B1555CBE70280D5E760", + "A5029C9EB4623226D321FF78D3C4EAB1F672A8B2B24A09CAEF21F561A851323C05A3C5E136A2DA7104ED19FBFFCAC3FC49B6D598F3060E93552EA6C700B837F7CE04721919B9C96A57B42AA1D832307C7A847091848066CB84947BE5F6B54654479E39F654819D3EF7AF4939FB9F4C9B20CA7F83DA0FDA2F171FDB72455B7ED0D43206992520CDD86B29C48BCC687573AAC4217D0B7DCF852811ADC3ECADDB2B34B4572675CCAEFDAAA01F83561E6E240878F229698185A80E6FECEE89455A72A377C24CE3FECAEC2A34B9CA98D288596D1C769CDEAB06871316CA7D1DDC5862E6282DECE33F362C64A73E57AB266715068932ECC31E62AD2ECFF7C6FBFE213384DA086ADF49E30F432EE2C715D9AC4DEF53A7B09B0D722CAC560FE8CF0059B80428458282F7E81717647D72E321A3E4BEF16FAEF76009BD98B8D9822B771EB62F1D0748E462FB7F3BEE9B12AA86D9629085AEDF8E43E1252EE59970CFF66A6F865C7651EF83F8FE10EB0E2615BF8F5C7F12FC601B0CF795C0D8B7057F54408BEFF86747C0F6F23EF212A9086EADD464A25341AB71FBA4ADED8F599C38FC15E790A5B86E64977C5AC718DD0B47C1A476AC9D7369396144F6288E84F7FFBDE02EC00EEAE8ED415C84648364ECBEC42164514D3E26BFD3187E0641C216FFC57E00DD752CDA581686916221DCD1AF07582391C5FBEF047FD1B7B956B458DE925C02A756FE197233E0304D0E034FF9A176B5B3F5FB683AB41D2691E13F97B3F4EB33238851331197C49C60233232DA0E2610430461876FF6F77FF3CCAF1BB2424B8B347588667B48480476D40BD9E487468CD5AFEB597C750A5E665B4E7C4C169ED08ADFC731FEA928052C4FB85B3064EC07B0CB988E324893B3F084291D964403F0350B7E1B06DFB73362C38318B762A972972BFB76CC5C08B5D47DBA0F3A2473D7749DE9F49F50C4C1620A9EE9FE56296124D72906497411DB87D4D8EC4E1F79BEF27232008A2299F5317FC1A6F455F1B827F1712BC01814F0B9D0CC162B25B804278B9C7BC5FC5616B317F2050234A7AF92FE35A59E22C959C7163DFA5F142022BE5CC4D5EF16D218216C57C2E29DA926436C00DCB82E68E16CA5A07158D8B8864D38A765D14E82175114A28CD97D11D564C8C7B87411589A4FBD49F9900D08939B7A73B5E6466B6F607F8AD22120A559A02BFCEF6456E7AECE8C9B7C9D2B322D2197124C05363B2CBFA58B74CD88877F22A5E5C202FC2C33531125F1518F4F0F38FA788E5E6B3307A75EC73E545391CEA200243DD6D25A5B8654A00B82BA57437BF0ACCB0ED37ED2FED221E54EC12B93AFA6E3939223596075F4C47340355D7222A8234A1F65EDDA42FFF5D19F7FACBF09AA77E7962F4CFBF61A0F26FB18E31A504B371714048874BEB286AFF71B43E4739A17E8AC25FA77121ABBE6E99754AF42F1D0021EA1E3FF088D0734BB191F91A520C96E22B4A28F9A2BD7DF81E8079EE5D0DDCBD517046F12098FAF6920E0EBA10DE8CFB391C63C60D62C1F4BB26BF8B6E421A830575731F67D306CEB5D6FF04637144790EC4AA2F435906320114CB81EB40C22B271FBB065474687AA5880F1DBAAA1744AB3E9B831A932A9208BEA9F5D526C52F5FDA56320E123CFB553E2B71A595DDED2ECBBD6E890B0421D765D2E9FD0D3995DF2A9523A65FE2040710DF16F2A83F510DCA08493DC138541E5681B51EE87D84C9AC11612EB5C06F5A63E22BD6275E35216766D79B215DBD087E9CADA0CEB09BFE435DF9B7809A76DE323B373682B8C58CB4F08D9C708EB050DEC", }; // Galileo E5a-Q primary codes const std::string Galileo_E5a_Q_PRIMARY_CODE[Galileo_E5a_NUMBER_OF_CODES] = { - "515537AD5E5F4216C16046FB0AC50DCDBE5CEE7E3CBB51B6ABB4E87A407B90E0EFD49DE1DE5ED29184E7FF0DC31F75FBB94F46FF6586B36C7771E5A68D060A965ACCF8D640C6B6E4530FDF19DD2491BCAB69ACBCFD3EC7281CCC31253A471B652E21C4CB0B43613EC542266460F0A6199B436BEFD95572DEBEE920A915FD854D17FFD0DF8C74E23B21B28493A0927709709B07C65878C43B69DC501E9D0AA21061ECF173876CAE708C764435832D9D6FCFE62DDF2543016D6325A56D9BF1007886E62E8A832BC32063CB0717D723C5E8C5F0C0EB3960577D364C93060B64EE04A539B7601CC3113E0AEC53CF21AFAD0154DC5CCECF038474E0F4004A65B1EE2801F81968B88C3D35E87CBB126C02D770CC3D32A552883D351DEF47847391484F80646728221F993921BFC14126EE3D9527DE607152724C6D2DD305D3FEA0AAAEDF6509A2FE3248494A54FDA8E3CE7E6BBCE234E4686BA5A19724BA2CB78CFE71A6AF45532EFB286C5BB47BC3C1EEF4E4A8C757786AE974F30A86CD60EBCBFDF5502AA8F643819CBA4301E731ADBA1345B61C0B444FE7B817EA86F8DD749C451AE7D24A68D914F26C918238953E8AE61CC8553213DD6856C7863F9F6BAB1B4C84B225911E7B92BFFC12AC211B2B2CD905877FE976E07057963D47C437FE47D89648053F81AC39E8FD2F3A726866F6693E503CB6F0C3F0AA9B3EE2EA3BCDB16D726E1C6D8B073AA15F64EB68D53B1F8CDAC19C7AC33361226E81F1C793BF188755A3FE1BAC38B91ABBD4F077F7A28983EAFADC346CB941D49492625893453B364D07FE06FE42B160C16FE0462AB6366FFDEE54DC9CE4DCCA21E4E4AE5E92C872D1E4EC6FF6D3063C98A5AA5EE72481A0BDF15152E2A5425AB722101474D0E1EC8401273EA1BE1DAF7403190A94305BD1C7DFBE1F35F65D5CB97E82B7A297047507FFA0012FB73360FB8719C174E78A989A96E60A9184B3F3A8188DE100AB361921D38E8142859C8F0F7D441DB1B2E9687BBD1086643987C83DEE0BE8CED4C83BCC82B62B45311CE4F13ABC55BF5EB1ECDF15F5A07F8B2C42F07FACE0E299E87727E2D534FEBF7B9C3894CC3E2E4127A294B9FA2A671273B174DBB81D247CD2846116500A072DC3962C65FFECD0C0B46DC2AF52882058259C26FDE50BEB319AEECFA1FABA34C069680B9EBAA9D96EEBD7EA30E748213E1283396A2AFC63527624641D4E1F1022A973B1898BD4CEF4D712B49371A51D60E08F42ED1EA90AC49EEFBCC53E7F9E899DD1AA4056F11462DF1A4C81620A73C831CEB897430A22252B901EC3D6F3DF58EF26422F796EA31AA4E0E9CE5B4A9C312A22305E298FEB3B3628283D405EDF726937327D90C542434BA3B60684584A9DB244839D2ACBCD7EF147A541E35687B5B8F5F07764973112D20D1ED75DC31F6A938542B42EFAAEE0F11B0583AA4925C3132356200E8D6BDB3127B975F4115A7A8A1C471836E3C5450B501A24D4A1308BB319AA827222B550F253F64B6F7D2322C6A2D3012FEC265A66A60102A3340CBDAB900DFDB36693D41DAD8DDB8875F8C3BE76AD5355DD81D67AAEBFFFE9458E522BE0312E60F63DD92F25C0D7CF82F223AEC0BD7456752CBD5151FEB5368F8857EAFAA90E8C7499B75D46EC4CA20BA8A24C90C016B5BD2CD7864828C6140E98EDB9509AD1194F56D49675D077DE92CD481B469E3A37F7DF0D5392DA4CE4CB282530F1C73482CC0926B877B00B0CE49FAD21E4C26194C7E950E0078F3854EF88755E08E9380165C584A3DBF1ECEF6A31B224FC321326B93797BFE8", - "D67539AFB80711A0BA3CD67D963BAD346BA813D35A2EEA104D36AAAB863C656A07AD61BA60598C07744D32ED01EFCE928346C09EAAC2D392E5655F0FEBC486815AE30A38014DD8520F73CCBB71D9D42636328A50998A2A3BED3E4B34D0DCD65B94807064E2EF0C420898DB96E3B99EA9A0AD91C63857DEAEDDA5E644E62212B23D72FEDBBAA78C6581C677B10689C4AF387626DAC55F4EBE1893D52D28D20EA365702448A64A0C553ED337C3BB911DDAE2A91727299D8064BEC880183064574B5E3631E70A0590210143F4079C572BD5E2F7634C2D53B1FB1DABE79C484799E7075EFF98F033F5B2EC66C373825335D883911CEC9CFBBE2E38129B7E03D9646A7E513D5069043BC62AF4C524F12D8F98D8C9DAC5D8642DFFF48CF6737AFBBCBE965925F55F03BBD5123C9DB47AAC780301DE91FBED3C01D03E6464C2C2915BFA187A4BD93E20C24574FB91F0358CBE0921DCC8D6B7E9976763A1D2158511861EFF5D1C0B71F608E7ADE91D9DCFF5640B55BC9BD1BB322C879C7EB5C06EB2601D06241D09CFB1BC1695DFA55FA044E0E2E4BC86EFBF6A55740C4640512DDD6CA069940BC0FE1738FD376C68BA8AF7CCBA7D89F7966B29355538836372EF418D149EBF3AC104919D91BCA2F13E79A7CF7684A4DC0AC556A2843E041A71F97C94B859FE009659F593EFFEBAA6F6C1C57A5BF22752613AFB26379C42AC25804AEDAE22D63B230FCB858F496B8EA6F37104D0890525DBDE06AD988BA0287B0938572F14A98EC9E60E973FD693DB1F2AFF671AB03FB12B729D0867938DF6B60EC69790C992C6C33A531FE56D0ECC1465F65E3E57FC9E45F0F65A1061CE6D3190B6C1B8708A8A5A47222369AE889D26499CDE8F0548B8D7071F2D4DF6C0F2418BE449552327981CB0B54F792F29A71E30DE257CE1B3A7553A22275E4C8B9FAC3B8D4E9912BB22B0A899E7337513C7ACBEDA15FAD3D6919FDDD941CA659D78B74FD39E2E2F622691B89CA82FFE602DB2578A20D4665184456F32DF4DD6CBC412EC7C6914CA427CEE02F6D9810AAE1406DD68ED3869BD8E3947A2B3A803E875FF82005D853E3F43A6BF936030744C34C8B71B7722BE0AD3F475E531C9249A42671D5F3A5C77C4C28DE29AE953EBFB572578B17B636F8365FC755C22871E7D53A1F1561C92909305C9FD36AAF79E8844B63370B800B25CC1355211D9919B830A988926829F808DD2C66400279E6AC14F8EECBBE8B6E9ABFA3BDBB38A49535F64F719EF48C5FE6B2738DC6F71AACD70274FD40A29BFCAA594AC3E7D0C3C522E406BA6392444C9F362339E8FF34BE330911DC7EB11A47FF3A62A46CDE961A40CD5B24020909E5B034F45FE96CB156FFE8E2FDBC12A7C12D60D24BFBE596544E4F03AF26F086A5A667496B7DF302E4DCFC568C7ABD665EA7EAD8A7F5A000DAD9F43E68C4D8A14742E050769B3CB270E3856D7E8F4E827046D3E55A52F0E02C883881914DE87AE3C24D93E61A94919B40398D3EABB1B5142431AB919208A9785962D05061EDC951C83C73FBF6AE8DD6FF839E631C9FCF6635FA053DBCF932E359F83FBB3EE310281569741E3A8975FAAD1E573E0EC3207F6DBCDB8CC90DCA1CE517C8DFC1D31AE4841F87A5157792738DAEE7C29240DAE26C6C3E9D8A899D2271B0C374BD2EE846C6625E31B2F8379A96F601323039D281608A01A1844E5D1D20CF1D92C52107CDA71BB3B7EC4DEA958CFD7A79F71868116CD1DD2B2E66BB94D1373B733F324BE489DA51BE72B01A8572880AE1E61650B839D03B0192D290D5B36A9CF93B304", - "58B2E58A13D4D5F84F37A389E6B01DFA66DBC6A25338B2884EF08056BF0A9124DA29254AA79CDF1B0944DDED4BC7FE683EF7A3C7A1C359E61E959471E30F9D534F43EEF274AC6535C616ADC7455BFBFF43ABF268F7C995CE020CEC73BDBD04007562F2710498AD1A324F25A6233B2DF2D9A429F1C39943E45F934986D1979D293F90CFBEBE01665C98C0D72D09A382348136980B31F5D4696B85C3F42D5C445996804159CD4C4CE7547C4A3FB718AB62D9E9826D05C44C6BD21D708CABB01F46514F29FBE7352866EDBFABD0ADBB6093E1A519D0E11E27737239A07866752B6D864686AF1E308481C53C635046C0756E8008D3CD26DB970C5D6EF8CB9DE6BC4339EE9F88EA45D11B74A1525E2F1B9F91567A78E403F7ECD47A99E95C098870B928E1B0DAA984CCECA13C6857F350E808BBF66AB4EDFB0F369F6F009268D19DEEB377F7D0C4ED6414EF6D23A0A5F37A25AAD3CD62C2115CB70409049CF0CE6D4DBCC5C96767614C6FAF73E9A76C7550BB970AB3D3ACE0C07FAA9F36F1935DFCD5228427BBEB5FC7A2F951D9210A5BC32ACCA7E78AFD5FD460CE2A79348714E5542BF2D453680B070E85F3244E8A6B4EB6ED49F803E60B8A383C8BE6283B1C4DF79E0C4A23D5DAFCB26DFC5DF1D1520FB6CDA23A05A1513F751EBD0143C2B9F5494BAA74F9F95F189C5767C6F5623559D9F20CC9B9C9ADFE285FA4E1BBDA481A52ABAB36A5393370091A49A59B968CFAE89BEAF33BCA5C2A9BCC1758CEEFC2D0A175C8A5CAD5C7E3FA706C2FEA55F4971A7B8A0C5D1F22A26D7DA9A70603AC34566E4929AE78C8F1926239950EC0A6E1B37D919E24431E53FB08B2F7DCDCA2EF4177BD7D2F81BFC784FBEA0471831CDCBB9E11D60C53D0E062E8BB8D98B8EE5A40960EBE10FA642751B96E1407B38A024DC64D5C2005E71198EF394673A4A0097187D2475CF27B3EAA7955AD9F412A89B36AFB27FDF7FE699B2CC8C03F7FA40549178DF8A3C1A39441EAE869BBC89D583ECB18E310885F33B95B719045CA6955720CA75D5CF0B29E5F1B9E9EAC5EC92980B2D37EF6509CCA6E67544A8116494AC7EB9032E1E8CDB053B5AC0F60DE59BBFB78E3491D50C7ADED95042A8885FE284E90C04FFC0370B92B68379B2E7D52392A42FEB26B2419CC64412BFFC036C01109B9EAEC5FAF485F0D61C37A703EAD02127611F9D25E4EC515CABE21247156F0779CAB57C35581646BB71E87941AB5D06FB3C06C423E9E83E0C07E611C89CB000344AF49498EF5C30305DDC8958F45A45E1218837269DEEDBB0AE51D2AD8B41BE425EB7AB798856911B6F0DC721756A8154B9D1CCD61092D16A3E9E1CD5E1D7C2C45D236C9B21A0ED64AD4C0660FE42FC0B543A34FB545B0D88D42F696D53BF54A1A259486846E81B44C16EF146310AEFB3933BA9F9D4497E74AFE1449D69105B9F295DB24B4563C3FC0166CB70F104B3360BC0998EFEBABC6276F570F7679865036DB59B51AD2F91C0CCD3BCF5C07492765D480494AB5B87E83FD04B75A35F88656D3329AA5FD550DBF493B0CD2C19DEBE4358661C72A71FB17C812F75BEB61302AAAA1F757288C1D8626461F4162A2EC6296B3CCABE21B4F0695F2D2CB02B86035251FC9C5F2FB5BBF28237417DC56471629B3B4C25AFEDC4C9CD108ADAD9DB1330AB680E4998C5B3D99BCE8F08156B630A63EF36A51C813CE22A6B178683EDA389ACF58653582BC2AE8170ADEC4BE03C04CBA603C0E4572A74BD9599A8442E894EB504F7703F2353A8A3525EC5535E750303AC07E08D952755F97AF236014", - "3059141DB31B84555DDC1C5F40372C50BEF6E82B433D87603BB7803FDE8FFD74DE06809357F11C1D6ABF02D4DB8EBE1D5ABE7F30C91A451EE3C1AA36735FAB9185C785F05D28BD470D433ED4ADDF36406487CA1710ACAB57EA0DD577A49C841F5E78B70FDE90BC1087E79E27E53A4B131C06BF33843BFEBDC0C2A207510590E52158C0855C40146AFCB75DEEEB872ADC5E77CD1DD6A66EA96CC223B3295C136E2766ECE9F2CB807C68C84FD04E0A5179D58473860962083DA8D68B70DB95C0EB91679CF5E1BA468786725EDFB179A2C5E7C28B396A53D89A98C7B79867E240176A9DF9FB0BECCC22A526B617CB8FC2B05A8DE411C8C5F9BE682459B487B26643FA894F9B3C97282EAE397A03DD15F07FBDF7432DD95D29E6D50CE95860BEC2649E482F40F7B83A13135A7C71D83ABA44A363C864BCD78050AC69A8DC0A9E601859087DBD49AA01A75053792F74D9A8EE726608D1F009D06363F6E5A463BC362178918737C5F3E71EBF130691A2048F07F3F8CDAB70C9D0F7B9A1180046076E1B894AFC620244B30A571DF359C7D60969A9436F05417DB5759B2D3ABDF6A238B5B5DCA8A0E4C27F7078DBB6600FC0105463E745A321884A4F6C5963B188919EC24C460F1B9CB9C063B2CD1FD5F49C06AC2E61EEA55056A6ED08B6C7C750E30EE66508FF243FE1B5C494E8EAEE5467AA0ADEA834523C536855D3BF5ACFFFC0802365B3889C31910A5E63B9457E46B4B7E29189F1BC21E7950BF9FB44BF5D76078D8602FFD986E1A1F1A74C677BD8811FC6992F39384CB3F9B2C91F381DC01D4E79D2E66E6D76796728E0C48F71817ED182759D8B10F7B5D361D7138CAFBECA3234B9F2F4A76FB00DEC05D67FA8E7217E488688CF87D59AB4FE7B13C793C1A1711C401B49C381F76B5CE120BDFDF30A858DE62A3F4331E4A3CC167030829906935FAC167A7327B5FC0527E014801A27FE0F2D40EC13C66235EFED070979576DA7268D1871E8487C4DFFC62D27B83488A73FDDEE1470832EAEFF621CE8E126267A47EC00773922BE480C7F26C8E4785D886BF8E6518DF13DA86BB2925A432D479E8B8FA9F92442891F71AC7C05C0BB0E4396158A492BD49E42AB4C4737A952D6B2B2780EAA73DEE13037D659A43DE1A8F0E525D7F96FDD1629FE51560F77E4A1CFE903DF0891B39F50B71E0F84965413DB34B1EE95CC1B6728AC3D1924B34D1BAD4A4E4F7D98D1B938C567B6F3C95770068775F78EFA147ACC619AFD0B6D8C66034C21B2991419217256D88F265922FD49B4BB38D2955305A8D01D01758B01134196C525315726D9BB6D77917A57F2C46A05DE91A3FF80DD2B5AAAD899D679EB55341FAC6D5C2E9C6B703806E342B2C11CF84B394BFDFCA378B26C7E0CD23C8A87B7CBEF6828D9E023B2B7060A0FEEE0D29CE59B379A02AAB7DFCC41A35CB9A94408A321BF78A54D2D4DB0E170101798F6622D8087A2022A993E85DEB5CBF0F4DC2A047877EEC9DD145471D57015DD59A37BA60C9BE39A4AFB92289562601BCE8102C83292E2ED842470D715D34F11981BCCB81ACB443FA732F792C5F11B7DA5D1BCDD84EB80820EB2BA3813F5E6EC5300E622DD81B1FDE8C786387864D78246A432CE245E0883745D9A1DE9D68253CCBFE7C00EA908E452DD3B9669F1E6812E40D9E2C423180BCA98F4591307CF8B8E98B7F828989CA7F3F0BEEA4D408898364C6DC160C94B89D879B1D07286EAA3FFBC6CD7FFE5700304AF3FC049098590DD7F6D4770ED66FF60DB2909C2DC6DC67ACFDB7CDEEF1B714BFE4CA04F2D5172137C", - "4427106DF31EF72E43B6C75CB84BE5E375B6B6D4D21226D0FD689E8F14EBB81372B93F5455ACE6C168345234B378500BE6612FC10536607E85B884AEC780550F2A26FBF0445E0AE9C0F4CB95F01BBC76652A9E6FC457D6BA425EA8B9457A6F3C0AD2A0FE7BDD1C1CB19A9F1A8815D84EB5843AECA4DD005378111E9AFBA9C3CFD808C0C3CF2B39B1962EA44B0848452778168F7F60034A68E5980EB63B94E50D170C680FD6345F12CF30E9089A7C0A422661DB7B1BCF2480238AD043FA1D0DADEE998F7CD69FF04BC336BBD5985315D4E1CC78558D4E235CD7E05015A5734896597F16E65E45E0C819CB0B895A38883ABE4F439D10195D88366CD14F45947716AAFD770C27FAF6374CDEB53B118277906F7E61C583E8C7CE3FE733541882C511936076DBCF65094E37FE2FF54E0977595077EA26E03711FE9054E2D31AE7F99939B415F46C05BB55BA7BC4F31F337D624A94C9629526ED51A9B93B1B3C5551F9B92A30759D7A40025E98E50128232A706CF6C3F6734D00571F91307EFDBC9718D78B3B792909C1C56BB8526CF5B229D4DB47E61D962538BBB17E6CE8CFB7854EFEB5591CDFD5DD8BB22FCA50E4D97BFC4C36E2573C0B495FEC9830FAC229976FB651B82DBA34173F5635875B1460A023CDA65333138C89DC81275F7F3446472F5F8C5F93AB130009F5B797D9ED536ADF5A42ABF6345B1457D5C96CFCBFFBA56CF124E78FEBF8A8BCDFFA97831A589D177AD260499130EECF8247FA5C44B3C0C19AFE6BBB0A7B87080E14F3C3457C8424557BD9078DEC09A3A6704E1D77049A1A4431E423B28B9476EAB6292CA1B3B4B43E18EF929EFFCDD574417B15A4DC1269E593F884DF5D492A464AC3F2436B8C691B88658180E53228AD83C4FB843F8571D42A9BDEF37EC4926DCEE5002A12144600C9CE7AFE483F3A64E480CD09F8CAFEABC9710E01A8120E84BE5861D75705A8D18F02756D8FA78392F1C89D05F37CB9F768289B8CA99E22E86F8200770D6DD2D76951A45F73C0730162C363886282524436D029786E7CFA2EFBCD3D05169D362DC8BD472AB376C12097443080F3C83AF1EF7339D8FCB85FA098BBCB5EC3645A03902B758DB263A21C8CC4874F96D672EB192BC1A183A1B271BC1D6429CEAA8208F5CB240F451A71B6F884537ACD49471010ACDF28887F6A02A04E738CF9FB5B00E0C474C460EED1F791F4EAB3F9AEC225B40CCE223D23D07CF0B60846C111A07A86448B9CF119754935E8C350752CC60AACB55C71F4D5F5F2BDC3E412039D336ABC6F3D46EB0D1C2080CF260EE77F5C73A35C23396E2324998B7DD375537DD35B5F27C3B545492F682C4B89F13F65FC4F72539E4A7763BF4AE2443FE0A2F683A86274672FB9581668CD2B075C274B242536087C4DA1E69D0712161B868ABE86C98468FE43A42DD2AE30089ED92B7A750C73B19A6D70FBC0AC08299EE2A9BC94652B35D5B2D679220D34D3372AD756F842861470CC3A3F2BEE75112B138613A40FA585E449FADD6353A09363EB6025D4B81F9F224817FC2DEEAE01D797AA8A0F8C945FC69D5891355C28ACAB8997A0518C8F4465953819113914A7CB472EABDD1A8D943A82FA41315D006E54AEA4CAB21601A2ECF6CA0521579A6A92DFB6B77BEC6D5A05B0A72F16B0328C860FAB66A1D6113B7098FE50F3B09C2306D0B9D00987B351CB2BE099A7AA7EB7AA691A4E2D243DD7D0D864CF80A4D2FACBEC3C1CB222883CED667477D189100A5677CC3FF0DF31D1119D5F31ED2120E5DAAFB99E8F36E77B3B078C47B3D527DFD6521D7C", - "593CF84751C21D591BB62FA0B0AB65E993408A016415D6296E0F080FA9149A4C31D8B2EA68CD7209E2FB0B4BCCF654B013D92AD7A4F6B1935995FD106663CD5760E63702196F63563DC994570C1B8E9B0A7705002ED56D335632ABE3ED8BC6CAF109F0588040DFD167DC364EA7F692D5F59C5616A6A7DA0C5EAA4D9FF017820225D5B164B6106CE9307B56EB08C563F123A05A4C93488DF63A6E4274BF5188475E8F7ABB8C3E7A8323F689DD93B043BD98BC948A567E8C6C95FD3788ABE728F7B7E299C460F9B35A59BA4429BF417B9F8C54F2DC475A7109B9C25C0843AA86ADAEF388A9915E65EA08C96C4C84022368E79A3A466B247EE6A37918CA0A8DC6AFE291CB9D360D727B6E7415D360AC414BD34DA40A1D995EE1303896465D52707A4F31A30C7B7DF936391435A5FD3F06E336CDA36E473E3D990A6F04FB5E6340581AE86D8EF81B9BA68979058BCFA1363D3F711D33EE9E3A8402A14AFEBF339BA7C34FA4EA2004FFD09129667646A79B6322CF00E1B46C1418557E0E62E106901176CA771979F4B6B299BEEFEF7B847F4E3ED99F56D44F5C73F00488E1DD862BFFE5290DBA737FAFA0C9D95C8307A10DD309C177BFC46A9F6D3BC86F598DC1AC69B070B9AF1CA2824F456E73747A0CED38631F9AC222914825CC3898F04F6AC09B01EF4CB09A63C9436625E2D0AC3C433A31D86948CE34663E5462652980B3B57C0920EB63879E28CA9565BEADC47F29C43F1718CE34CA5717D7AC2CEB6758A16F6D769CC277BDB483808CCA3A6DB99D1018888BB6A49D325891B5D6B4B77B18A5A4133AFD5E8AFA4542710483B52E3D51D8A4FB77D2458C4FBE2DEC1F6DD8C0FDD8FABE2130297D0606F07B305B2CEDB39204E2B8F8507ABD49C0FEFAD0332F8ED98736FEF5AE4FAF8515CD638E28F1555F54D7A64FB38D0B47734D0AEB8B55A792259427613733F237FC57DFC1AD49930D9844C9F44C3D6265BE3102D93E2B62D3B0D7760F613B1F5F5176E0C5EAE47970D30D211403477894B8D66D03CB3AE8992E16D52F6B2073DED09D504B36289644241EFD21018C570A2CEE6D59667F274CBA5733E41BE3370DFA47464AF850B14DCC32BCF1A5A8385314E8B38B2A642AA90B8A5647DF9B32B83D3B4B2AAA54472BFE84EF7DF68ABD0236DE171E5AEDE1770F63823EC143B30FFC69ECC464CD755F5AFD2B51AB5F05B74E96F6108810CDA94F99DF828EDE147BE061FEA46CF6A84CAC720717733A17677BF620C4963DD1A08512CDB6A96DD3ADA995D84A934C9825FA3B588D916CE1898F6C2F75B75481383B27204C343CCCE41E10DFAFBB42BC6BCCFBF7BA4C460147814014F9470ECC8B99D677EEC872172B72E5839D263F55B9FC91AE6143FCD1BC3AEDB12312ED10647E011A020B27C69E35CBA94623960543DB08D67B8CFD06760450A067E3F868386975793AF43AC4D0F3773AFF6C2CEFC8310C0701CB934098D842604E38370182BF05A401C38B6CFBD19CD7D4BA186A595ABAA48B8740DC321FC031D76F82B4F5FD6949AA101D70A702E18D8C2BC1283C2E2CB138699D507FAEC5B6A092E5AECB0AD9BF2E59F175DACE05DC18E485B04DDB963426A117CA0B761EF485B234971B6F681CE3CC5CE58A9BDAD9267E5C075D1BCEE2C88637E2A10AD441E9B1CF4A324B77C6623F4DF9FC6C4AACE068F66017BC82D562722FC93B02489DFBB5560BF60F57B736212DD8A0533071D10ABFCB4EEAD5AD9E36E856C8ADE0B9C4F6F5116EED43A39AF8FFCFA01BD558D7575AF0E36F2AFF74E29435778F4BA57A5D90", - "214AD702A657F5A17A601D77E0F4C6A67B7B8C074514548FF89A781CF2E0B5225D95A944D1048338FF3AF206D331DBCB3F5E9E89C7E592A2295CB783F416C4160FCFD26983ADDDAC52BBFDD6A7125BA4426715F82AD9815F30B2DDA972A2E814D6BD231D453858749D65EE1B4C2025F61EFDF8E12E50A3719899C611682E7B2AE0CC85294542DDC04140ADDCCD5DCA315C22E5ACB196531A3B0071DC787C2753C3069F5D302A9FCF99B71317FF2749749C6E00B73F382983E1C91BC8115FEAEFF083434DEC7E8A22ECF2D1CDFC7B7ACB80FE0DD1EAF7510F694961E09882E50994169BF60C47B95BF37B5D6F13CFE48A9405637F87C157863C58E479488278B918DDF041214BCEE2ADEEF4242F55DE971E1A7F2EC566B362F89DABF163A690C8A8B808ABC1217C7D49933E30272A08689F7519B35FF8C1CE0F338D0B75332D163A5DCDE714B821AD3B8393A1740B6BE4AAC6008EBBBA30B8E5FA2253DDCF16B3F87B4FA47C1D36AC86E2FC39DE8BAFA79E7D58A3A6CD83FE09448EAB6020BF121234B23A72BB7DC02A2E235BB5DE3B2AA97D3931CB800165B93851EC81A1B4B7781F23E5C946F035026888C3D8C31170787F78333FFF8ECD8835AB5E9D165A8B1D97B19936940EC4C74D115A34120EAC800E8D680B36D9E29180BEAF5B3CFCC3913EE7FFDC37AC881C441F79A39F4A4161F3B403564F654B0E7D8D5415DEB9A6E11F845314421CC59C6A90826974B4CC477C280ADF4FBEB368BD848AF7F91D12E9BF4AD3E9587DCD7A280DEE9A7F2B6F2D2EBFF7EC9454173B748D2D90A6AA650D3BB97701EAD27D6AA1D05B817603EF1026E643C8816F183AECE863968664E01D6AC58C2A10AFB51B1A19A5B7BDBAD77D651B78C141AE70B074B9EF74BED349E58CF8A80A910F6DF8887202317BA36950F3B7EBAD45E6E940921043476B0FBC136EB397DB44445706F032FC47C454BA08DDBB8E71D1E7D9045655E1039C3C3D199EBA21596335BB04078DB6B39A4452662D282C7AC9B76D92E112B0027B711151C56A6459FFC70BFFC86941736EEF705E8DF5197B4D3AADCB31E421A90FD5179D9C3EA3EBC8FD7E9F4C29D736076723E2D4146EC325CFD616F6B0B70AE0DE179FA8F33A2536DBCAFAA2BC0A9740BBF41134655EA16438BAA5F8FC96256A6F9999CB1C57B69087C0612FEF4E6CF0BE5D1FB77258AF418EE0B90E8AF3DC38B7A15FF6B8D2BB739FE7D0099AA4694781E581A8F7A49BFCD102B7880E97B89880FC41D0890C33481B01D9BA991BD41B8D6501D34E0A401474CF89D089F3F6A189ED80C3006515CEB7F9DEA85D0766D2989B88280FD46F7BDC7C32C2294B2A1FD435102C2D92E85A03775CAF11D05F2367B57F651C7586FCD32FE920B1B94EB431AD2497E75F4E3C408A0FEF89907C6C830FA14402B1103DA4607F3DFAD625AEBC235D2392954B8D3BAE8A6D02CAE6D12EFC73EB46EC56E13D2729787CBB5C64910347AEE384972A5716B5DEDB99FCDDD5660E9453900DC1AF1B76D151C00E8E4BAD38E84830EDE92CC3099861C92BDBB59D8DE31AD9F4B889D480FC8DC70382E8494E1A25D2140740A5F327D51D0D3CA4259F1CF5DA3474FE28270C9B4E7F8A714F7C69D1F65B48D7C9C69A39CC58E2C77D7A750CC0B0E5D54B2F3450B66994DB524F15AF77CEBACD3CC611B2C95F6C93EDFEB652A70748DF1788E6FA2D45AF171C1AB59B0B2A160C075AA4A92272BC0F22631A24EC94C5D38664B08B46DC96B448C351C77F81051881055ACE0F364C80372EEE5BE7C660C7406B03C8F5345A04", - "435EA61E7DE31409D04501BDF0CFA57A84C1387E0684538E8BB651C7CF4EFD6113EAF9383BFEFDEE4C702FD5A070FAA3DC7D644CB3D96C8FF65F18C88C43A2E66EB78FDD1EA91E9CB519CDA9EE1806F0F10653F3AACE782810776AF25C9CE1C580C381D00B95CB02AF3F9892B4D918FEEBB01E7E730079266C4FF0AF0EC305D3A168197158B5A0D4B1C1FBE4FCFBA947A5CD2E5324D0C4182069C6F328465EC2900B468E145C0F41D724D65547808BED468256EEBD76431E715A4ADAC80D5314ECDD03177AD9175EEA9D9149128DE8715534A648069F5EB9ADDE486029C69C81B1ACECE89FC468887962AE2C063C5EC7B594D88E56F2F3FA4A20963F3BC730E74923BC2DCAED6EF38412E9094326930D2D2E3A0FFAB2217E9059A88882E2AFD3E62FA4DFCB5B084D0CE53655539BD0931BC063CBD4E660A0B1BD9C7D6CF2836C947CEF2C07B859686424B57FFDD0DB6C34DEF824D835918505F36755C298A09F935A2F95328248B5E923E55AA4C91BBB0733E4940A34AF5226C21EEE9B0E0C3D15397A4D8C069B94C2C38F61FEA2077AEBC1F7C5E0875B9A7F2041BAEACE95807EE05A366016B6E0FA2E7E722BA34D3654DFECEE78DCAE199BB44E164E61729CC7A924CA6C7A6C061C6DA0936B4C70A02223EDA01D7B8C0D2E012F998C3B94D1387B6CC65DDA36360ED765F0A23EA562626E12145EB2FAC0F49BB0DD7D1ED3E9B2860DE1C54FEE8D60EF56D4382497C36181E864F92A95E76CC516E2E1396E2B0D880ED6CD14D2410C9BCA159F57DC9B763ED7CAB73F9EA5D42F4BEF91977C114900CB0F249B10DE8F4FBE220181D4FDB5D836AD2FB70F06869DD7F197F121FF748ADD6DF6C48ED9910F51BD7528DB60FC5A42CC0B72DCA6FA66B617F12FB2A9530247B1709DFA7729A6C9FF5B13D073FD7165033C45B5B7C7C66045D1735979132C49CA4442986760CF8F0FDEC0C0BD5E992641075C76168B8316057A993F513536FC917BFB783C28B2D4878D120889945FEBAB84BFE4840C61012043E96910A374CE33B45F461B5492E2F96F0EF91E42D7DC755F37117852C4FA99B106F5CB5C70BE5055ECEA5DF90B517B08252DAD6F20013FAD50F47A1682CEB37AA0DB64E4B699E126CEA7034969FC5468D19455A1F2BA4011AE5CFFC2544329E268326345C9970756F8712E7793301E9D3C92787FD10B7637F5511E27A16B8DDC21C116F13B0F27FA2E5B6DE60837F011937A986C00A4D9551D37E994DCA480493DCD5C4DE6F40D0E25349284131B9E0B3B6B9BEF6B9DB6DDBED89CA329D9F3B032E2C05BA9999CB02D7896258E3C4504643DBF49A155F96A69148A51F243CFCC3B2BEA7E8BD534308E752C675CF478A231CA99C2EE402EB5DD5BE2AF5F4FAAC783141BE8D2A3BA44156A3D1EE98763108B9EF4670B25569DFF3568FE0E183938FB150FB79F7F28D51C8CE40089C06D6A09F25845B50E64AD231B367C280883CB7FFCDD5E4C044BAFE6C0915A0C52BB14876088267EB84A01B9931C03DC799995B6969E65CCEC63697F1F0E146B75EB6987550C23DF2793FBA8F04D019C31AF4AA747F3BCF00D6FC86CAA707F1F27DCBE598B18ADD6BA048B2B174FFFCD20F93DD2F8E860885A15CBC2F06CB10537C205E143ADDAD33CE8CE5E6EB22C6A917172BF962080290AD6FB88A91C7B63B64047BBCB60309C01F15271CAAA73AD93DCF99400BEE17F6F771AFD156CF28B788586A18C21739AE5BFDF8F6B8FC94A9CF1EAB0399F9FB53FE70FE5E4278AB909B2A00F5A181F67CA7F7E046209A2394C5583CEF4", - "C1A7D5578EE6929147D34AB5B29B97864F46686736A0966EE7298963AE27040F4598E0AEA235B562DE84BB1943891101155AFF6D185D9F66E5F9DD037B048914D7C1B55505455D08DB2E0C58716AA4C4E779EB7348D486F445CB8BF499DA3054F087ED95C2561770335DBA67F1EDEAC600071AB5918ABEAD7E55C5C6E609896ACE2426C47941C1FBDBC4804D8FF4C9290E8ED35C967D65837D6E2B153A3DD843712AA34BE1FD7CE0D829B04DDAF036D9D16063E28F627491C1C37018FBD1EA3D33899BEDE421C1910C2957C13B8CC4B8A06C8D3B2264E8E1B8FB5811622A9986B4B6F673994F6F5FA072ED8A8564C2AD450CF801C9992779F292994A98800AB12A9EF07F777F441F19FED6314404A9949218B2ED4E239EE677D8D1425D0547CBA99C1333FCB1620A8D11DA5CEFC51DEF5B3C4862E17A6BE3C194F88B7BBCED98325D638877757ACD448C0A970D63603B58E3F4B8A361D36EFCB6AAFF2858E14B1830F0FFFC4C5CB08BFC21FB091045B9A7F8DC0FAA02A62D1FDF7178B5DC90D2111A64CFAB0D83680196B21D75EB91A5B3E2568C7E8A6EDC65048C88EB34F6494CB697E44F895012AFCD7AA86DF341CB9C63A7EEE8E5F95E3D60213BC23C5A83CFFAD4225BC731F07B34FCA550DE26E0D6DA29F03A1D9C4233D9A0633D31AC5F55A11C1208C8B85306CAD41EDDE3FF5EC3A61194E724EE2D6A4C94FCDA217BD7C7FB328A9CEA8064D94FC66049B56AA1DB9F977216AB4242D0EFA59AD18540F1430A6F4EBEC5CA7EA81EE4BFC6E77F9EB6352B71275D450843304F073AA82D77EE5602B43DB62B9A733320A67B2727B21B705B86D5DC1459B5EB688D37236FD37A7163E78E8425C589DC600609DF3E9F36F9094D06C60731527B8ADF58A95E40C1390FF657D418D675F528B3B665FB5F3C56504DF40C1D3EAB6F3CB85F5C7954587F87744775382517B4C652B4259571A8AD219A6517E2D6D3212AC1684404DE7CF71478BEF7819DA24B09A11DDAD5717CC63995BF83DDA735C3A50F6B164F26D6A79E3B20A1488DE2AB44347694DB8EDD3D957B6B5510C4A266E514164D23F1594D84487757EE6F4353BD06CA7F90912AAF5188F217FCC11A62198E2DB04A016D36A583891D346C0D84241027DDE80090356ADEE1AAFE7CCDFF983FD7F8827BE286280BE118FD9FCAB26A10D19BCC63A9AD9D202036193CDA36321A5FA7252D0E65FC0D8E588D70C3B629D830CD1DE2798309A6B6113FC2A16B341BCA4271B5994ED767F2064FCA7DA335BD1D6B21F54CFA0DDCD47E2A38CA924DF85D2DA869F6DEA8FDDDBD20728A21034355728DDB4287FF0EB5A9DC113A71F7C69899EE76BE7D186B39C7C868E78C03E923FF199246908FEB48AE45261B3F7A8D6E4FD0C280545A9E3A578916364196E483F57EC37439B0FC9FC37C5CF56E21A5CAE0B70D25B928EEEE456F19821DBB974781C646E860EB3DDA8EF8577CB0E3B9E96245E14CF4E51A5D11F7AD9A77B932467808FF55E588455F810CD50367DB1621469AEE8BA6FCD52C75BB027521C530A918F9D646C69EF8DEA1F7B14354815F11E0187F01F677E2A0FBF78ECA2B1E51E898E26CE55693ABC8812F4CB4C10B9BBDF385C6AF0B340DF8DD2E957D877DC1AEC30D4A6195F40F09B4CF4010E810C764EBB57891652C156DD20584E427902DBE82AAA3CFA728059D31C36253649FDC00CCD29517AF2FFF4F5050B0FCBB73B2888C989761A7F0551375E4D3C54E0C9F8A4679E640A73476BCC6587195A82CF5E6F550B0A85D57A97E3E5D0B9A194EEC3E41C0", - "F0E94A299789538824A90801AE02D93A78EA914B9A8F10FEA2D2A7D0812009C732665D48F6DD58CEE4CFC72513CBADCFE171F837E79B8776B392B2224C02766D0468E513D0BD1BFE6ADD6C04374604503A3EC8539CC707110D18FCDC8E000EC1A3DD03F7008D37C1FA02E419FD4FC7A6C81157E07E353F3C4882C2AEF4A0CCE1F7A5CB5EC753528152C521A2ACF7548F19862EC31D8783BEF406EB7F756E41CAC3FBAEB9A901F9268E78E06ED5D6CB19BF4606C9DB660C03A9D5B06BC235DD7936ADD74268577256F72C7F36CFD7D4D09D3726F1908BB3277AFA69C7166EA2F4CC9387B13AAA8131D9F21A5D97C13C7DABEBCE61D72556466093EE0F87E9EAA9CB42245E1BF55157013C4350F38596CD26D2819F98698CE98F5D4023BDB3C974B0E61FC6E6604CB1707BB22FF5689F3DB3AD4831BFFD3F93C702E0DDBEBCAF626FC2655447134570B7150E030A3524A6979579296CEE062D18CFAFFC4474490DA81268B27B60E9E9BAC2A9B7D2E2377A2006AA5C439C263E8F9EE360B42E217646F7C44EBBA6D9E3B98AD20B1BF7CB8CDFC62CA7AB139BC2DD1C85A837F51AC9BF08B3F36CEF176A03F358E2E37EB5DECD0DD2D544E58D203910613EB14744E914F92C5E9274FAB025CB6D8AF16EE03FC86AE3947F7A30FD8C1EA23EC7EDAED4054174E4E6DE048C563B1832F8839927ED3EA54B19BA41CC144C8D8A6D8FB66032BA6F4E16DC81C98D37129B3458C2F2A6517694FD8816E8C71E00D77189768C423702612D9863FC2DC1C4593809C74D0AA881DD7477BC584376DC6C177347EE17F3E17B524D0DFB315196035FE6AEE83675494E23BF2433310D4C72E84DC82BDCA9B791D5BFD620212172AB2562B5C36DCA28C5CB8078CF41F2BDFAEE651B04243326DCE0C51ED88699CFAE4DA3B478DBDB92DCFC8D2EDC4472691173B6C5B9E5E116C30DFFDCE7B0381E8E1013CB392056E3BC7442B2A2EBB631ACB65DE639B3CFD8EF3918531480A35314F3F23F9AA6CA41A9B8F6D08F6C589DD2584B6B8285230808EDBCBB99C0E918D4E73AE7B397328502F2D47078CA2FC0BBACBFC9D9E491EFA2A2DBD69D82E0D829F74D5ADEF4100E6195CF3D7AAD2041078AACAB8A8EA62FA42C6AAB6203D92794F77D4E30B84BD16518A9A0BD0AE4B372A537BEDE43B31A6FC1A58F9B43AABD485C55E630FFF8A4359DCD52552B8A090DFD5CEFD972551714E5F0A2A16442345B33DD9D232AC8431EBFBCC5D5165D12961D1E954D01C0379B5489AC0DC0357667325AA864D44269799DB710BC6A25D90AE8E0C9368BE911C91D68A49815850B4B29708BAD74B4BF3590E6488655622DAF3A7B52356C804487133223337679B33E583B622EF873962E8FE259DA8F5DF61748B6799A14ECC763A1B54542D67E57BB73E411AC023907E54BA0EA8B7F20E55739BEBD7F83E408238B73249CE69FD2DD593565141FDAF12BFAD3A43670935354ADA4067DF0AE4150AF306AAD3071EC4DC0AEDE6F568DCDDBABEC98E4D17AA99F8E881600D35B25CDBDBE5DE184180A9C35EE8B42F6890E068700F06E4829A742FFEBBB214D17BA925B5C0B41244DB5BC7AF49D9A24B2C135131E553CEDB2CF4E6E2EAB840AB37788323024123853A19CC04F6E344A175A4BF1A16776B7F84A17501DE4A594BC515E788FD0AA08ED4BA3602838A6D1D485B1CB80BD24D97905A9A7E2DE71A9A4CA32689C46AA9EE52A9EA985C85C9289ED1577B577C444FC73FD1BC3DE03F9FEFC10E6A17553A7E3FEA6D57AB71E2379C9C5F8904EC43E57D5FB119CDC", - "A8C2390D6C3F0B9D01B9794A4207DE3F62F00A4D1188C727B2910153D9BC6337AA46D2D79D09DB7656C0B28654F1FBAC5C3DAA8A75B16BEB5FAD8A256E38EFD232E007A741028319EBA4A6DBD0AE1C1F8989246476AD4090F9F4F560D0CD72815FF6AAC29C8674B1D366120EB3213300E99DF390B3169A1CE03D2A5E471B9B8DCAA957259311B97817088B486CB680047359440DD39386DC2BC24AD2AC30436A08C335199F08861F93177640074A241D9C5884EED07EF0C0FCE8CCE08BA30221150C9EDC6562344CD3E14D3735B41DE2CBFAF4DE0F6D417299FEB38146625F3C70D8872103FDC6970D9D37D1CAE92375F81B26566A78A02139CFD83415BFAA5D328674797DE51E4AD9B3B9E1F9BD18A0FCA255CA8AE7E9E192ECAE5C60E9F5D578E59F7F7074A12FA75F9388CAC0A148CE9223681A93D62A679254AC2F41CDD871BD73BBC6C4E0CC9DA67633B61BFEE815F4E15ABDF639899DE105A5F4D74CCDA3EED32219BB447EA5C6411CEDB351DD76CF11456EA762C2F300671A12DD6ED8EE9AEFB4D0BD86D0CF35AEABC9B9E7822478A6DFEBB887DA0E2D3ED4C010E5031C4332FED83480C21ECF904B65925C4CF64595F20D072C7C6AF12DD3C76C682833CC6296DBDC73DC8C979004DE4ECD749BA45D9748DA728AF757FF5422B862223146AF86AD4AC4D4F407DC2025B8166E2CD64C8E1543E046ED91AB1AA5524E88AB6851752AE5A2F02F933DB3CB7EF48775017E000386805EFEB8CDCEEBABE613A87E0C554F99DF0C8FDE49FE73DFFD48379299FFCF738EE21B9AA1AE4DCE7BAB98A356241545B6F7D186AB544F77CB61B6492BE1F02C4B77DCD5083DE4319D1A1B792961D11D552F8AFA649EB5D2AD64227524722B0CC97260A8B3B6493B00D258A570CB238D3C2511C0582DCB478F878528B8A88A5B33F9FA6C41302DD1BFAC664C692001F7F7D207A8850D6FAF22ED887589405739EA5B5B9812BAE617889A225FB2E6F9EAF77D3B3758F9ECB89637D1FB20C428AE3420C3679B834EFB0F89A389FFD72D7420F2435D118045FF7B7361FFDA0BBB6934F81AD8513A626CC25D9A5E2A5FD1C51229E2D5FF803B8983B672E92A1FD72C16520531C694F44C9C99BC3385A610239F6963E0BB66ECDF4CA29E1C175E414A5D3F9E9F495F2D03A073965643186C46EE9BDB41876A41ECDA224719F5C76AFA6E955061805F023498AAE965184ADD6F6BA1DFE0BBEFC3D1EDCD40D8F55BB518C9B45CEDC95682B24F2818795CBE5D8E504F0885863C750524D9D238E4110AEAEE095E1C545C2989BD7E0BC0BE8AB750A7D319AE69CB080DA562F7DAA7068F38B14AD7282E041835B58E2A48A340F993D10FF4F805280C183A3FB45555B8D54EC145CB7B9BEE71D7BA652FC533ACE1BC8D621F7257422B363A5AD2798FB0E6E536854F2BD25914AA0B6DBEF1E2EF71FC7890E20FBCBDAF751CCB0DD16098D96FF22961B6141257AEAECACA339750950F6895107355F04F9BB3EEAAB3A9024E4CB79B19ED7947EDE79958B669077E6BE182020536F7F234AB2332C2F2790DD96F5816AE3FB5F2CCD72C6D177845DD0CACB44128F6EE6B1C2F673A8A50842E13C8FF0087CF71B8BA0715637A40021998652FEAEAF5719ADB71EEAAFC8093E525602599278B35600C743AEB41EA78CB0427D0894158DD4ED564C4742033324C58B01C15822B97C9634FC8F320C0B103F0A904D98C9AC529FA799B30F8B2C0888E47A3BACDAAE5A3DE6DF39A693A9AB3D95E7C973C7125C0F7D8C59B37EC924D7B9737724DD92818360F2C", - "2EB63BA5756AF5865AE33947E311A5EED4A0CD056442E19888A2B8302ED8017085DD5D137A3769058F0AE0476AB202CAD822D6A781291C537120F316E90D2C3CAD13381EDBAD35505A5B7DDC41E46771F460E501B9BE17DF8D4DFFF631C365AAEBDCB7D5CFF7010BE2EBEAA0B99820E0BF3D290CF27DDACF397A5E4922EEB7D8BDFDEC96B87F8202BD409F31A200515EB6A05E25A5FA504093F1D82A83A777F5389B5C90E66C369BB654598CBF3F258E9E14DAE819837A86EA775A05EC829B4889B816154A2B7882EC7FF71BA7CDAFF873B5CA4F35011DCDED8C0CAAD101F7BDCE1CBE67E081D98EFAB71490AD12AB7BD9B4CB9331B6B04D6DA2C12311F96E01AEBBB350BBC7311E8AFC9A6F42CD541ED40E2D7BAB44BF7F1E4465CA942A0E8767A38D89D0231BB897A995627EFF71B3E4483ADDCAED084B402A3CB23D5F91872BAA49AB361281454AADA57AC838AE2B34B799A1B46595AAA02A9738019EC3644C63BFDC72F72CFC35D48D83B831E6EF397474C43CF665D64DC0376A437CC768862A92C941B9BCB8FABC6804C03BEF7BD2C5EEE4609870803A5E9BB2FBC42028C5619C3706F773426CEC39D096FAD267BF5E6C7C7510B0D1948FAC573C5716EB4D6AC6EEC492B347497B47C0D18C77E7C264E9A04A4C3DEB83B1101E40A0A8653D9495D4A7C13A5BFF3C6956E668DFA999926231811F3AE84195B65213FFB824478911230719E8EAF206DD99C7CD7D3D7661E9F39250793C1391033EA99A0E31D8CF83997ACA08C43B47240BF1E5E9D1D741CD9E6D3F5DC2043C9D3D68A2A689615D39014B75FB53B4866488C4B37B68B5DC5F9B9D6AB9AF190789CD610E939960ACF607A488964C33DF0091FA4EE86654142083F68436D9700B3B50949C0D97098D969BA25622C2EC15FBE7D7C7B78C1C49F671672971E38996C2D77A024919FC1A87BB9BFEFC951EB75326CE48D3837068F31B9592DDD8505AFF1E0E31911D1F4E311CB1B81DD8A03D68A5EC075D8ED7D69A1D595E7AAA70928DE93B979438315A4B98EABDC8B5E932257AAF79A9CCC74E6FF88C02C33217FCB3FA8DD72AFA1E549B9E5CF6099E2DABA07C91BD3BA6A9A4936556FFDAD89D5F080DD7F818EBC8ADAFB3D51D8BA7B48209AAFEAC184E1A869FC88BDF92E77C6D4B8B983F4B93A52C473F1BF27B4D7514DBA522ACA79463A0B9C2E0D9A2D47DB238AB9E2A1636B9AA825272F2B9C8D36D64614A4CCE2EF31B67682F328B46D31FAA31DF874FA15799B5D53E143C9E9127AF358BA1B43A9418FFDE00CB16D32AA137FC7A5A1CFC2070FDA112DE600F3C05BA0F50F8AE1703AA2CB64135C29FA621385C803673A4D77195B4B74E554B043FC07B106533D0B41F7D882FF3702692709A64052C4AAE51CDF8B733A92D86D507B6FF4CFF5F3BAE4D0D9F3F90AFFD774591E6E14539CAF99C833D2A1D9A12F7E9CB1CF74FCB353D11E22B8216FB91564DDA8F1D2C9865080422DF0E0D8AA47577F31A7682B54E36BC8344D5F5F725C819D3DD3A948F4E6F6C893491127267145DF1B286C18C4F3EFEF0BB61541883E413EC3EC3BBF99D83E3919501A3CD59341BDED35BC39B655D61686555CBAD7A1B033C2E326887249E6E30AB12E43793DD1B72EBE858B40ADF4400A59363BC56063115492E114688F47447132D606F2B99DB9CA4083A91E35AED045C513EAFB7A3F0040848C1DDEC0FB3C2CFF717BC4CA36C425EC3CA9BC51B3B3C1885FD8B4182AA22AD38CCF8FE3990DA75CDF5712B358BE866A6435329677CED89571C3877F9ACD0D3E66884", - "8F0A4621BCBCE418BF2A77BD47D671191216B230C276A0D081C4F79AEF839857586F9DBA52B4E35AEF22D86FBA66DAFE801C686F03342849B5C3A492280950C7F3B725DB4BD6984A6389CEC1AB86F29D653781EED847D7E69C99320F8584700E662070E9C43957F4DDAB28DD2427415FEC6F1503551D972DCF11BC4EC3B3FE745DA7F717F35832B8CE373A00AE6572D8DFBD7720E00517C50E2B634B6BC3942F9A8C035AC80161CDB45AFDD7E9C473F8EEB4F1FEE7A677E820874F03B546464939F3EFDDA157C9F478988F3ABF39BEC02B722C559CEAF997A13AF66BCC0BBB4DA7B68EB6C6E8498129A95D021B7C3A072683593C2990627FEDC52F66F3A16A8064018E6618BE5D7C63BC622DDD4A15A33EE19E4161A50EA38CF6626D5A088FBC5721F567145CCE30C66DE60CAD79D31B703B129D27627BB5AAFBD9BC7D43944B9B0D255D8F338C7CB7EC56D121C3F4E61FC0D46CB0E036262FC182E8F266741842DE923D276CED79D4A25FF7AB3D2571B1B589E01583371BC8D8196A1C991BEB90F7FE71B99EF9E100375D3E767637B2BB1FC907846C53550DC4E6C7B8AD7FFB9DBB65ACB30C9644FE9D59A74B0E81A5BA068CBAEC9D6B362BA05202260B1E86EBB67BAE2D74F60B7E1C0B510BCE4EDD8D71E342D5465A8032E87617790ADE2770D0DEB1ED26D62A863D030C781D2FB02490718A5B55D1BF6B3BD1E3B3C163361B2F13E616FFC87C1BDAA7D7C88A331511ACE5A45CB94DBA557EC47A670BFFE839069A546FEB7183C27697A56B65AD762735782FA009350ED52819C23AEAD72A7150DE845B899669EA37B4A12D63BA7D6DFDCA495A0957BDCCEE6BE11B8B296358E92E60A2317CF4B7542CDDFBADFD18C88F5AA4984614A113E992DEAA18FA172C998EE6FC8E936E69953EDDAA3FD233182C7B986DF90386B3661C649EB0F9A7E65B90572132408929968CDC39D18020C6D81A3665639CD2A3612FB2135A6E057F0F68B10D3CC1C35DDA2600AD1C0A6FCC0C5DD0D82F6218F2C1F8F5B714C47636CF68D5361D97DD1367681116F2A2A045894A85F5FAF1BAA27F93A3B8809404181040C24156433B3B87467B27D7C3ECE44EB763D14356D6EBC7542E21863700505B8A10D4B4B6E9D2A4C2EEC9653BBC0D9FC68DCB53AE7C8B6CF3120C921B824765E7641A3E9CDDA804CF341012964EACBF55D6430673B83C12CDC53100DD8BD6B18A56B5AB68D83EA484F48D4641B94AA2816BF06EC1D1285C11AD060735509367FDD0E300413911442846DB240612C1389CD4554DC8D7D7C7E4D4B79145D4684F1FB75759E2D506F9DFE7632CC553B945D91FE0F9A829AD6A9A18817B09B986B18FECD615414A0FD6B6070B15F2484AE8B3EC3DA36D7F8007A7BE336B749104C2695327A49D34741D76752DC943897B29C9651EA3C034BC4B8E1F380A9FB0F9D2C23B627D9DD8317894AA754B8998573F025A024F43E03EE86A1EF583CE02DC7EC2BF2A8EF9A3C7743DE2E6DE38D72B5E33BC5CDFCD12184C9664EE7A3F4FBE9498F59107BF8B6DF69DBD6732AA8013FF8B4525EA9E40FF6F96FDEA2AEC03311D6E8908D426293E369D52F818233FAE1C2BA2657B38FB82E7864CE1177D5E21EBC8AB773EE928EBC4A7EE9F4A9CD2D9F15146C08E4BE0A77CE272A98AEA05A6DC18D5B856EF1B402F9851BC84DC95FCE71320D2A5540D40BEF67EE2709147EAF3C3D5BABB0B21090BA4C94CF7242982BE35925F691847A7C296B973EF2172F83AC9ED5E0A0C91AA697305F79A3FC6A8EA4E7D1DA88A81D4DDBC1F604BB0", - "896DD4C837F11BF155D4605D46411A63FECDCD64D7AAE873E1DE22DD62CC2F8982EAAA66BCAA8DE8DA687910A03200FE437BB87CD5E6D17C6F5B8CCFDA073F29183A1E12917C5D78CC1CCEC5C2B04040D39E1E74867B21192EFF2629AEEE22427EB5D2399515D892EEAD80934668BCA906109F6ED85AF29E702FE6C112992CBF851232A4C140BE6CA9C8DB383D1729B41BE939704297BCB41E4B8C7DA5B24B93FE7E7D2214287145A764D3263C9EE136457A2A270EBD03408ECB657B78CB8C0A5C1767521D75A8E12D9FCCB3CE8F6321B55C50A6102381E95C12644549A0E5AF29183316016B89F6797BD89BA8F1E932F4C91C0460F35EAE32F46D42D66F639A87C25AC6E9B9C4E475B7A4A94F10EE0C1043159CA71BA3FB4F794E766C5A7C6F7B85088CE1A2584D4A765D7888F1496ABE23ACA42FC001E2D30B3959AD7BD941916E27DA648833EC82004AA0937723CAEC0A8E7FE3C6742DF8E1CA797F13FCC4A07BA75874FDB6A66014C0EC688C5F5E0D1ACE231B32A1A14A2503155D412BDA98FBEB450D35797BDF96264D141EEAC77550408F6A63993DF3F89D1EDC90DD0885227C273546C2D86D3513AC3241AAF96C137B69970E273B73EEFBF8668B9946CBD118CD1977445F87557DA03668D4F3A6B5DE6D0088982F6C5DCF082207A99B376B155FDCBA8A5E47F2CA4A50D48DDFBE05F8C1D28A080147FE9FE04FD49C370DD9E4861D8E553A22B7DF7324C51C20F10BCFC18EB59BE931C69232419F5E037333B52FCE4A138617B08767506B793A430CB3EA0A4D9A2CCCF813625FBD2F471C39DEB2DFD0792F3374A980FA4B208185332FC68798DEA1728054F28771E0AC3FC065645B3E996EA729DC6A29CC23F872BABE6A84911B1B6C256C38C0A62331EB66E2F8B9A77ED79E323B4A96728F0ECAC851C3E9C15F2863CE6839D3752F4F206C72EF0BD60F087315E6AD3C7C836FA3C5CA6BF2B72D877E33C17EBEE283EFD62F395637E784A84A3E4EA174BB501D2CC216306673B06433A05ED052860666A3C3D7E7D7C991911A56100A31048BB81FF71110697C941CD0ADB08705A5A73CE66AA87008B08B51DABBBC3FCE66B11135844BCD8CCDF4D010D7B135AC764B678CF307154B5A96D1541B75FBA65D7A0D5C2BA2D1DA48BF0EFB9BEFB5141AA6D30A59695EF7FFAE250AB52DF0969FCC349E1C7B8D90099EF0410A861FB05E37D7156991FC65542B3495CCE223CCBD383DD4432113B817B0AC4000F9EEC55EB377CF48B0F51B8D02359449CBAAFD6AB69E3616D6A3806BF67069F2572D1AA0E7DE28042DCA01533E1C381449E22A68D901424498DEA67F0EE80FAB6FEEC56BE01950969550F01D62ADD52396E927962F209B262674D2F079D0E48D1C994864BA90CC4CCF3CEA06A5995072904CCD97313E82D3CF76F24E3B3946D11FFF45319DDFEE619D2B5D777795567A44767F12B41D84A4BF738A2C6AFC0DA08356DFAC343EF090176425CDDEBD1264871CB7AD526D9B4E469E866817A1ABC9973C598B1724C8C3185DA3C999636074C27320694F0BA758B0842D2D3EC93DA9A9CD3F65B321E378D95F003C744EBD7BCCD4712B6FBFD084D9EEF0C84C70651E3AD999D64BCFB5E8F7D9582C290CE59176072A5157B1CEBB5684D47271ED482B9FEB7FDDE78B424988E88627FB1299AB8B96CAA72239BE6930BBA4396118041D6F3CE51CEAD81DA54CFDC8BBEB0F6C8E9FAEF93E2C404D543A0F0026C291CE992CD71BCB0C6E9C459143D995C92A4A1C9A6AFD36E1CA87E1F8EEBD30EC9D209BB3F6410018", - "0245F1FF6639D3C45134190F729CD06608426830011170C357160EAF351BB00AAA61F254B939D89335881D5D15F3DAFAE92ADAB2B59DB7D3EBFF526D9A6F44E1D8DD779753433A9A32A541A798805AD307787C1832385D8B11DE57BC3ABA2A81B70AA2221C8C9247EFB3A40943D8A0677F1D4E6F9149D97D6D83173FD3D3114293D628AB97AA4CC0121E2A88BD5B5C290AE7E5EE4BCBCC1CE73017E3C58FBE575701C919ADE5E94208789CC2BCC330719F022C1F79880B1BAC4E377D486ED467BC58B13F2FF97454BF1B4F4DEFEB3B5998FFFF604EA0BCAFE859CABA133AF969827887AC252B9D21D8AEC49A0D77FC83B4D9A2930732E9A22B7B823E302E469B52537DB5341AA0979642F4505151AED71B690430AFBDB09A8454183A23F86F598719B86D1E3FCCB72DD6599C9895CF6AC28FC5B1D4A821A6F9DD9BB7AA63DCDA1678AD816D96B919E47D0D0E95756BFDDC71AE430C4F71E521701452709B6E670306A20C2F60F84D6009DF6D749C5E02D3DD5495DBCCBE9326D7D302E2A56032F4CA5C82A107E06A867D09A2E5DE7DB9C250E25B5279A4867657AACAE0E3D601DD3BE26C936BF527CA9EEBF3B247F75487A01694C7595619FE6E90AD78BEA799B0BB0C126ACF3DE54F805725CA01879BA5B8412D4FD3D3CBBB37AFA955CF90248CC521B0FBD0214A8D4C9E4A41705714C8DF5EBFBBF2FBDAB93707B0D779357E3DBBB20D5CCAE707BA7BC5D21D4C23D72AA231E83880867FFF3A6B587EDBF5485C516239028271B5462F78E3B226B057F01DE2D348C7D08108B990DE8484E839EDAA174B3CA0DD6D1338513B3D1E4ACABF9C14A9E03CB373D039645B6447D7853257F74665CE10EAF27DC1640C0AF88FF4C207994AA23EFA97D1CE707AB08E4A615C580E3AB971D64371715CF0BCB8421D8178D708E4D3DB24B2AD3143E2176B4BE37DBD8812116E134DC9B72E35E8811F7F404485ADD7321D3DFDCED23BC8209A9DAAA198307EF1BC0E204CA42D7274EBFA74C88251398D6E479D53C5C6E7528BEA5BEDC8677F6F5A81A07BF7CE58E4AC38387824300D14FFF131A54390711F95E03CA59DFECE3EA4696643A16874F98B76F6D280F7328AFADC455C51712BA748D33741998838D33F65F0166BD4D9788B129CF7F9F0802758631E5A718A5058C63B0D38D9E6877778FB8CD8BB7AF099ED442C52DDE7D3C0746BBCB8595C35C815E80C71E98425FDC629C7F8084BA2556CEC31E707408BA6FD7A2F0AB83286A93E565FDAA34B7344474EF48FE5C99017887C8086AE4C8916914142151550B0222C5FF617817EF86920F1FC00B9D9E5BD95C6047731373DB142398EB7E5F1B29EFDBE41ED1E9BE725C2748EAA2F7A1471AAB6C15BC4596B6C6CEA5CB3C9F1E57179F96B3C3017C2244B179C384ACB93557170F4E0CD387D1D3428A7030B4276F8D3FD38074E9348033E3BB3B4A05B3366064C68E0B25F36C2E45FB0AD4606CF5A6B8FEAD45CD9790BF5BA1B0AEB5C67196C05D637E878F6D3108B36ED2CBC007F6BDBC7D74362085D651ECFDAE47FFB069ACCC7C55B726C0C6ADCE2760DD3509649DC58189CD7195B11245D76F64DF2D61B07E0C172313F39961BBC410E4000C7F7BCC52593AB7915D5B5B3E746CE8F15AFD2AFEA8200687BD1E0D767ED297347A1B0634A4F006033322F787FD901E7F2492E1B491D4F5B901FF12CA88B2B2B2982D7EEC9DEC4538F8E946172AC82CD468812EB9E7062AED4075AF0A587A92E9BD971637B3222CDE1A8965DE1EF2CD4A36F2B7457D27CD328016FD2D92B0560", - "EB01608B4B6324D02441F4094E82D3DC8ED644FD9D7FE96DC544276D7E02568453EBE375974990442B96B85A9DCF163A5974EE96274A6AAA9EEB0C83AF9A2E27C4A4174EE1D4A4035782AEF83774E93F67A5A7B91E7C8E05611BA6747FA9F83A788DA50C9D4EFA17BCABB0361E055CE6D07DADE204EF601AF3D1C7A54AE1011C2AD46C27FC060A27073781A221D182D4AF531D3056401D61024A29FBB0030B8340E91AE3A32468CA48183567199F34A76209F7846ACEE0B5DE327B3A381087204DBB6FF40E1463CC7BD38311DDB99FBD05BDAF3B84D9E64958F67421CFA09903400DC87E212FA320DB95DF83AD6A6E247E92151AEA0638D3755A6B409E5853E1A7FEB54FEC711D75AB9CAB21DDB34D7115174E01E9F0A3E650F852666D06A2A8E133C872FE9034BF9A61E29CC319255B09E40096B6D15809FCE4C8993A056E4133BA1FC05933B643B5D476D3987E7BD372412852D439D38600BE4A7F22BE1777CD86F70F05DF3B260B41DED95653243419C5BD9B6288697460A0FF7C0E2928D707BBA41E46D1AE11BF3751852DA1516941BF67E5C1775383A7F88CBA065BABD2235C155FC69D3C11F5658B019B089A9B3A983A2D2533BFF7694FC271597C42EF35F8AEF804E18AA37E3F42E49D23FB9171A312A562BBC9B093D92D45EB6A1A8A665257D596174E1FC44E117397AA7C4C77FC1BB176C8284DBF4558B5259FA69836B68322705CF783121E3C4513EC11B76329F1310731CEBD2CC8B7F49AE8D87BCAC07B1CEBABE872B5F83D71FD10F300F9FA30F4054C476F86EE75AC68F1F80E352D3F9753233E53F67C3917C26F4B0E8A61AC0299FEBEF95D9A46BBEC9F5C16B5EF127EA18BFA609B99B0B362036F4AE14D11BD7EC8ED2B02C8BCAEE2CFE409899E06DA304E23305DB1AC0A7746A72746C24E6D073F1FFFD3BFAEF300299C8009043FA392DE2054F237A098EA5FF0E537105F25B7D85355A44FAE707B0A3D1D6B30356CF1BD6EA3BE57B3A6147B943D1C96C4E2C871DB1AB64D9359F1F3D15F9DE5F45FE8E03269EBB9759AC78F47DA7B913F09402EE65271859D623908D464B1B5E59E4580BE30E01C553DCC79B190A809C71D8204A735350C75C3361EF3C89C07B84270502BAB82FF089793838B13B3041A17AB396C09C4BEF716329318B95C7C4779889956961F8D2200C163C86F45C1FBA0567C8615F4E815AE8CE2E05589C006B4560D66A67495C2B99E3A951500FECF953D9FA7FB5843F102FE0F82E72867A65C09318A52D4634A3FA28B032B92160CB2E7D6ED156586D071B8CB147D139212BC47774CE580E80791C14FE49DE7688B3A99E966A9F869B0A7421062F18705AD23AC238B52E6D80F43DCF2B43F66965F6075469E0E789B40687D104DDB5CE5A12C0B741EDBF1A3E57BDACC92265D592FDD63703E534B78DBE9F13CA04B9920EB740FB220E01DC176C09CA51EB905E32398E739C6A39C02043042C5FFBDC9BF959D56842DB894FC108AFCA51039A9B28D19D67127856E29FBA3812F764D31AD4E2FBA5F00A828F85087B4A5ACF24CFA79A3B60C954DCE40BA6BFAAE4466C88A60293AB46FA2FEEFA2E3B0DAF0CD72B0CF914848AE6A9BC26F6578D08E896479879D3469E0CF39E3EA6508A412853C83BD33D0B993678FA08DF14AB40F41CEF0E7A4B992DAE6F884E193B10E5136DE079BF85936D3B5A586323B08FAF8A39B24ADDC2D7E1EAE1F2F90A39F26B130F060ADED352AF085F9169C4E21093FB2256C4E17416F57D29CD37CDE3BBEC8CBAB280DB69643C86696C3A6D3517150", - "ED28B364884EDCF3082EBC5FCD11FA0B0823DBD808FA19BFCDFB42BB1BE2B73D5D1434C95DD48DF1ACDFD7DD17C741A387F18E7D78B2A9A894266167897AF1C8FED13D463B6BACDD81BCC2F3BFB17D2DFC0D43DD04FEFE39C801C8917D52BFE8D2E6F8C0C5159E0185805BF9DF91194AC97F6448B9189028D50B274848B429AD4DE45194ABC458485617B59FC5B1F1606DB20283A73F41A6B36731F6F9E978B276B33B5DEA3BF87282D21F63787BEB1F6FCD3B21004E6FA79330A3345F2C01C8CD1FE661FF9AB5B484B3260F2332FDB00216DA42D2840D3180B6521B01281E6D0F09664675531EED14A5C1794F3ED1FE634EF3D6E9D1B6F4871A45A83DB56FE2BBC52FCBC1E05FDCA884F98DEB436A9A238E086FB339E1A7AFE8E04A5110737F021C89EC5DCA1168E5CCAF92A04C950154F6209CDD01B287FC360B93E2A5661E7809FF1BDF3F71B40BA756411894B340CBAFF9E0EDC8292E7C316ADF4F3B827F1B82A406B53AAD8D2D660FD0CD2D6A6C693A73511FBBB97612A8CD3F0E177EE38D46100E64C4C540C834DD87E062DA2C6C3BE8A0BBC46D2070FB8D9E1DC396423D2BD1DD22F1F4FEE0E24F48CAD9241990B5F48A50B3B178A9C1CA71F71321226E98D1F79DD7F3CB75E0B0C16915E34A92750BE9EA173C276421CD0E54319ADB0C4E5ACB4BD599842E5028F613067083522F0D2A891BFDB190855B9BF36A7F2EC81EA89AE11A37B6B89126DA7C51A4BD0C902D0DDA55A4286E36835D2EE95EB46AE7D6B919C05D42E543D96D22CD241A8E6985A18F29184586E6A7C10D4A955D0A1983EEBEDC5A9FDE306FC366F77A25CFC10E5B8732D8F40D068224177288E9A13408F06AEC841C2E8612E6C794DE216A2B758C676022D4C0B99A4A54166CA1153F43FF66AC03F183DC30E9C83E6EC3BA33F63F262F39838E5C044625B4CB1DBEB7ED957B8F7CCCA6C63B837ED93B2C260F276175F2F95B235D4D1DC0C9014192D72CFE014094F29A0AB8F0A9BE896067D74BE5489F7ABFBD7EF442579875CB1795669991438C0B6FF13E06D5BA805DD2D0DD06731ECA45FC8CB9D7CE568921A60E68E31F31392EB82A39982BDFE8D953DE2CE0AEFFBF0243E43ED202FD6FF9E075A90684FED84A4334A8E709979FD5B60BCD60D41907D1FC5D927F9CCAFF2DE85AE1350C8EF8D68EAE38EBD0DA0D252F0B5C82E1C3EF78CADF92CC78BD990B06461BD77B78635C406B4109FE58850D2A97A6C23CAA18B9AEA535D344E41E783B767A439DE0762A23D18244E76D3219A10100264EEFCA45F19022EFEE72B856FC34E59ADF6DFC78D31C8690CECFA45321AEE33DFD40943B158BCBEA764C3579FD5A06BE297D363994E6B959338A3B48F14A3C58CDAF1D91EA1711FB39CF78F04E72B293B80847516DA41D5024CEBFCBB399393E59FC4C89BA310377AF576105CDEB4F6DA314E990B1513BE9DF738AD35B1460DA23326D2FBD86722DEA5D37CE5E34C11408C01E1881BCDA250C7FCAEBA9DF85AA08FC9503546A55F2B4D6A7D0FAB2F50CA8667C7456DF6972273B62A0DAF38BBC7D38B5B62F2F1EA8476F300D0116598725C0903B0323779E02977F33AA8C45C2933B412490EC17FFC2AB2B4130CE8FED8D34419FD15971EEA5759EEAF9F3E8FB4FBB26615B4286AB4C2AC57A6E4BC80DDB396043251DBAE26ADB03767DC9EE4ED3E0FC7D74C58175BC1F393F0CE5D16589879C6D53645B861B079B298E056E4539B2E2E70920D3A273398B4E9247771B8A23B276DA9A06945DCF343E7A4C9E7B06960A1F624A75B1B48AF0", - "CB9F5B3A549646C4555D2FBDAF2A79F9921C54C6FEA316D7713D64FD790325A87A30DEDBDF0ADE3B7BEA52A0E319A57084A79DD706228989642E78BF51B7F1246BEF6F1B8724C57B0A3633FCF4440E9D57DAEEB343283D642710266386DED8FFCFD68B32949FAC691E66FE9B8D736EBCA6F4551B39E79557154E9AF590B6F5CA1C6A0ACA82FF4B839B6F9C555CC57255F96B2C963536E48EC9B5BCBD270110EAF7C64AD9DAB53BC791CB111189117A34A74B4F23A8573A59886BF974528D17B31CA9B6A6B7EF7F923B8915B640C599D2453941CD16633383F36F9849C0165D94698D793A58A7869AAC8B4C007CB9E43D8DD100E9504B1942CEABBA733A242599D5B8C60AA42F4C8BE7F040877DA2648D083A2272A46A90D215D96DB2FF1ACA6CE24A2936C18B7A283615E8E6B729602D018174276E2ADCBC869C43879B6BD0CF22CC0601F7491862971F65D3E0BB2474549FA18964B14D9EF81429F08383F77E8880E858B3F350076B709046284A4BF500A6C7D9D694F03ADC9753852285075197FE5F30F5FEA91C7740AF38CBF5B984ED852C99FD27113F690CA7BD5CA46DCA330A7E30E7AA3AEE8CB62251DDDD62DDCC29C94D79759357FD92855279A8516ED0B07D8F2CF6509DEB6C180AFFE120B1C06A4DFB1CB76B9DF3113B08BE85A50BF76480D2FE05E75A4F77909E0D146EDF0D751A1099EB2BD019525048BA145C7E0B3FEBE21A13A41A9BACED48E1A4ED32A57FA061243EE840ECA69191B1BCDC0358A86DDC98920C45F1FD193D529C85B33E0135DCF2B81C7FEED32E07A2431755F3EF3EA685577A6884041C6600CCAEE0E4182CF54EEC1B078D74A18D8C81E0678A7D1309E494938083786C67436FE55FA955D3281F7F6C145B7C769D9019AE1B8666834B51AE95BEE2A8D606825C7609FD3F24057425B27D01573FF353771BD47902A9BBC41B2016086A3F9E366F96DA8AE3C62123DF05113980D8FDEAC5B2C828D44C69F2D1420BF8E7913E59FCB88845A7FA6A84AA296875CA6D2FA21A4FDF8E75B5CDF0E1C0D84FEE983A469FEC80F02923695640FA0858E9B91812DD4D91AF0DFD97655C7FDC60EFEB19DB5AD7D7D0A5F93FC88A2AC1205D1BB60DB2F3BCE203C802752350B5E8240B6FEF4A38D8F35AE5868498DCCF1BA047DC56D67F15E3C3807BD5638A9494DDC268378DDED39A910A6C7A59E6738DC68D1A531C7EFA68BE06AD20BAC86BC36083E45AB0A314ADAAB741C6E24A530B3E3FE318E4A1B3827057F944918664A96277528D185E821093D392012803ADB63A4DDB14983E844392542F2C5A978F1911A2720E201FBB862AE98C3CCDA720A244B5B58AE601C1ED814B0753FCE5F51E7ED797AAA98FCC833EA272D86A238524C07349F5DD0BA4A2F6281B2EC2D29EB546EF52F07B832053AA433A7E8BF81C6C9F562B603421787BCFF621A69ECA5CF07CE8512BEF945DC744AF403B9DF0FDD48AFFF264D4AAEDBD8702863B5A345A733328466B22FFEB20906543639F0F6F85F3F7DBBD28034019F4D517676C5D8C8CABD4118768B10158D83BFF569D3B71F30AB57B8337C50674E2290C950E9D48D6527E885A0F7CF580717CF467759CA0D41CD03A91B75648DFCEC5C5BDCEFC2EB2007AEF2F01651A328DE030546933C1BF88F34AF14D0C1F0F37FC8FF4E015DA5D25D4A1D52EEC44DA8E832F01BB1D9FF6D067021D4703E8F2D511E73ADCE564EB53A048864D191F21C759F0B629E0053845D7049900924832DB7831CCB80B36644BF23EC71847286C959BF54C6CF9EF075B1EB7F43898", - "576592F533BF0DC0AC52CA27BF57894E407D8A264496F2196DEA6B4706CFDB4E108E07FD18F5B2253EC3BF1914BEA0E7B8EAC0EAD4C6A3D2E0162411811F8579262AB9F3411327C320D27C7DAEC764EC5277EDFC2635ED39B0C497365B8C3633626E66D83DBFFD8E24BDBBF09A97061D7F530F69D929DEB7AB12488951D753EFF9F8C8DA17F3F4B17ABB9A1955F40A4EDE9D058E6F48BF1B5533D91B55D333CE4AE379E124CFD375D82DD97B682D80704EFA3DDE799DC6F7D5E55B72A99DF2A89159CAC16B47F297A467358EC67A2EC72A01007C47D757DFE274893BB0E141337105C46B159B08A0414A7EF8DE0806F90B5C5A9362E837191DA4573B473C6E4354E62C5667F75721370F036BD6CA025A49C15BF63A8B30AA5DA01CCF9746222F2113AF119DA4370DCE98ABEA322483C127CFC4AB990496CB53BA7D20255E63368FFDA40BB7022A1FC115B91ADE56B2711DDBBDDB9FB00C5FBE928F3121420288CC9001F865D44ABB4D78B3A1F2BF6B1B2C251AB1075A65A233C4472A460FBC76ECF191313D700F73BAE29795EF9A5FBD0DDB5E2E04DD172C85E15CB0A63EFC2A4E317C5FF01965FEB3BCC81CBADFB201C670F4C8AAEE2E7E75F1AC4E4AE0B826FA9F87B300188546E42F3F142AF19A4F91192741ACA71EBF29A6E1BB0D00A4534095A8B9885267F27DB9B676009631114A2EFF9B2D4C10111195F0C178D2634EDE70B4C0C87613CC9344BF2F62E9BCB42C4CECE15AA61A0C7915E51A5645609620695B4D0C913337DEEFD9195CC9545A8B1AFEBFE5F21BBDFA2F140A4D146ACC25B8332861C2EA55BA75086FD948BD27923BD2590C62389CFBE89498C82279258D11689613C21CA8F1788C4926EADE381C9CDB41D09563890433AC4BF9421475EE42AE5735D1CD10653713BD62299F66F793FA095B2E04EEA1CF59EFA731143D5849032DA833E1660A95117A2ED97DBF4D22FC0BEC0B5CB8EC32B63BA18B63F737F3ED775B6D91E052FCDBC0C33A6F4498082542B039A26BCB25CFB1B23088D9BAB9DB12CD18BF2AE73C78792BA9096AF766114337FBC06CD63BA8D1C0A5E5C6BBF5AEAC38D6B4EC2922B8ABC930F58CFAF2C65C43422193F4AEB436C05AE3213CD19F58CC7623886525FDB77DAF08CEDBD5D48233D63F1D6BDA7DAD15E817775DB4C9DFE754F4AEB2A94DE6F883961DF23801A645906BEEF9128F3F6C9FDB57E6D7B5EB46326C4C39F2C0694230CC28852D54281417C4D24470B9EBB625AD1D144B4889D23EC975CAB65A855CDA704128A61CC7C50C5ACFD6355570E07CE55578E4453CEF4582C368E585CE0F08BF786CDC2C0158E1A10971AB769872C52DAEA5D7C8947A2B6300815B42125A7B8773E6E8C79239D32D7AF37CB9D4E8688CEDCD71A213795B0C1BD5ADB0AA337989ED3E4E65DAA164C26946978C9468EAF74617C47EE4328C51F41418F2D35BD33D47A9A1ADBB7C4F5A968946A7A900C293C65648C3127EF62D58BA9995B19B10D931C07D67164B2E685FB840A019EF4752602DC9317714D89F6D9318256EDBAF002C40D5721525AC0D2BD2B4FC64138F0FCC5EE648E84AB6908C1AF71408D51D31F7587F1BC8E19D1C045D8921B447CFA9287AD03B4EDFC3FB85C7792CB2C479BD5A14B72EB8D3077CC511B0A7364C80C32F11CD1EDB4B3A0806BBE9D7765B091E04F46620C23DB801A46C544A935FEE00F0A07927171D37D3FDAD3DFA81C40CE60F93EB65E667FE032A79DB745EBCD7EDE57FD51B647CE25624444199EE2D9647FAAF9F43554433B25CE78098BB33CF24", - "A888113D9682BAFE58B278C036FC2EF41CF8C156C39D67C378E4E0EEBE750656D67250F8447C420E6EAEF139A11EC90B1B50CB582E5089694A4BFD843602382C022085141A7B8AA1DC5F68469A2C2AB04BBE91EBEDAFA2A19CF0538AE9D47421C3F98084073F340F0292B8946452251630987DDA49E56A79F1562C1EF57134F036A5DE932B2AF9ED5D24D28463DA55F4E7C29045DE9CFFC4372F7A6AEBDCBF35DFF2D952D90BD4650FDB3BD68F25B65A7876B65C5AFFE8B9CB06CF91B88A588136C80D9CD361AD83F25B6D1E17D161817E64CB06262AFED0417DF26B9B3C0AAB0A06B1310A7375352C46A410E167366AD768559A6DC618B416395F432C0CAAA8D10F88E9765F36B196B37EEF1F1C13C4AC08150C9E4CE45D9B1663FA317263672875E0BB5CFFAE2A132A6B431AA7099E47E7FC8349D04EFF0B84C3E8A743572C4B1EF38F760656E49FB1A4DF4E2D1F6B24090EC675D299B32FC5EBDE40BBC2B1DD44CC01D1935F1FC084749DF9713DE41365D8CC9AE5041D60967B25E16FF1941A9A7336DC2D46DF5AB88C14A4BDEF077EACFB1F08B834AAECFC75B5E3C1BBAFD3EBC73E187D862411AB97D694B2E557C47E5093FC15780805518758B4C5B548306F92B559DC58475464C6DCC18D2B3905FE5F60B4530F87716107A1A4EB40090C23527895582B02141386A726FFA11E9930B6099B22816DEEA2626E60F4B17C5E175A852A2E174D59FE8219C190D0D6C50C14A3C5215BB193FA56209CA4D14AB2DB5CEAC2B3B20CEE6DA1F798B681D2DADE8DD13674B9156E5C3C4AA09B1932CF69D62621DEEF990AD264996069B01E6F7A21F2E5996251D09FD955CCA7DAA902FA7D46E03AABD4FFC5A1A873711FBDFDEA0935C399A0178CF2516FD03746B86B5A80576A34119373EA7F059A0EDA3F0D18CF33ED63DC27C8157E0C43C537E86FD37E58EB5ABEB5524FE8E19B2298B9DF539C7C31FF0F7AE96A56FD3806B81088DC13224131998DF42066802ADC2A08AF6F69D36A7B9B518430C5532D3AEFB20BE0BD1BF4B2C968AA78331C614EE51B8E677B19A98E30756B39BB6A1AEF0E91915BC91D98E86FFE7584BA6ED8D6D51A132EBC124C056FBB9363B8610EB3D7A77A3E581C02E7D25184ECE47A688E718922E4672CA9567BBA9BAEC81CD8DE7FBB8CA04D20B51C850DA2A4AA63E87FFB27AC89D18FAC40AAFB21331AEDABFC3545333E57C73CB7D6B601B7180E4489269001A6786415F4D1ACD8EBC3CCD8E78F6577A9E107ECBA3EF5EFA242F80202C1EDAD26D9FDB8F43F70D250D899EAAC973042149B8F0BF7327D72A49222B5C403645BFDF3FBAF78F2AAC71B9FB582346CA456EC183867409C18E11A1BBFE6FF5B681B0F893778C87A9BE8A67E196919945F4F22D70FF5D85C55D23893E7EFD9D685C41B28B118EFC905C450A9E91112C5CEA2475EBD07DBEF0A125C298F467377E2BF8D4BBCCA25A2DCC4AC83AF877E1FC820D09F31888802B3226FB0129AB9E47FA65BAC527CE74BADAF59F95CAFCB6EFBDAC889EE8075CF7C71518535DA63E7BC9DC5668417123CF11DAB1070B050DEA01F46BD86E59C5B3175EC1C0C1244E0E7B5B6FB5D26979393E430C7B79893E3BF819380D206438174038764B7196DC0FD94D4A9CB8382CEED4490C43C19061D2BECABCDF386F1512EF3D635601E8E9CDECE9A452A0E6C6AE0D6BBBF3AFE226A46AB3285531C7AA9E0FCFDE0D9A557F20E9802139A7C8EC2B2872CBA3AAE87F0BC6DA226BE4AA5681B114E080A399BF7480E8583DF2505AEEE32E45C4112FC48", - "DD364986DCF106EED4C8705C1A9FDDF9480D337BE5C61AA3F661C6968AA01E3E454698FFADF366C73599B987DE85005C9743A2416E637E4BBB67FFC4D35F26B7539C33256EDBF680939CC8986F5BF32D2ECE4905A4F6A1727BE1131771954856A1C66A402FDD0DB86B51E9C02E6BB136465FC4253C8D98FED1582EF8AD22828B6A35580FD58A0038A9D97FE2F661F312658041839969752C4ED321D4EC8229C5753F399029B0BD5F065D5A19CB4548C86CCC1F3A9873FFB9E4F421D033E4EEDD4ADBAF302E24371EA97D817AA33C72708C1EDAECBDE7C06AE0C95D8237517666D0FB43B2434BC50EC2BC8DF1E3CB46099BAEB869B251E79E9B175B75FF62F408A5FCAA4F6DEC90F97B926272389696B5E38D26B946E0575907C358DB17D046D58D061683E07F1B075C10934FC4260043AAC28928DC877D27DB9BAE618910564EC3EDE3C402E86BC3981203CB7DCB9940C37D948556A57A11488D1332B05F4E5757D470A22D0B86C88DC456CE014B673CF5FEECAAF26F4662C9B243F46969025692E445ABF375AECBAE50EC9E48AD25EE1D1D0C16624CC5BCD1BEA8C8FFE3579C50B732625A381002115A1D69DAFF5844731F41AFCDE42CCF1A13FC98A64FB9769F03CA631B1C3ADA6A98F40343BFEDCD80966652292B60DE83385FFEA9CBCBFF51450C768EC8C4FF6FDF2F76FDA7D5886148168CE2BF693BE0179DE250D41DAA80553488D4DDB01FF97329E94C7DB33005B498FA8408E13FD5BBFE079F6E40EC5C8B735EBF9914B932A82441D9D5136C662294956CB52939F4F7E335A3B9749CC1B9F374AAC89C9AD1E718BC469CA21D2CA467F5DED54C402BA0CEA000DCC878822EE3E1D329CE76E421305178FDB31F5DAC177838197C5B46A4F96721139695EBBCF39F04BC1BDBEAB567E8FD812C355CF72785CDB3A6909F801BD2F448B3EA0C7F96D09DBE4EFFB1CAAF2A47FE6BB830FDB937CC5ED2B485AA6B85DA799C1266562DF181005A345C62BF94004C1B8D85AC06D114C8F2C5E2D569C709251EB929237C76E9CCFB9CB39206BE3C391FCF5E814E42AC2BE1576B9F0664B20F03BDA1F6431D1D1CD4C0783CDAA2A7AD32281A06B2BEC53EF1568840277EA4341F5570388045526AB214B477EA23023C13F4327DD0C84CD1744677091B21D8F95F38A8904EC5D6542AD6E3A68B355D688B1F6CA50DB7181272B3D564B1DE41C14575217FEE44E5B631CA49995EC2CA787EEC4533657FFDDE7370329C9BCC301B8785F7A307F1D06F88F21F5BD19F94827C128F799A9C354A021146985256B3D3E8BE46AF6E370EE193BDA3494E0FCC7AA287C3A5B93B638AAF9BAEA46288DDF690A464017765FC2F769A5A930FD3E5A5F399B2F972EC286E81062B6BA85FC04DBBBC05B9971799225E2F0867B55CBCDCDD3B85D6D56C6948B03E91080FBCE3B2C5438491050BD2E81C41D5C2F6790AB1F327D2C7023FD891F8D6E13D6F69E7AB1604692F21ECC7794F028A8306657D72B5858301F5296A5FFDCBEC4863D0503749E9B483E4760AFC05682304EB17D67E016553FE9108895DF3EA98890172D795009AB414E4539C47200C56828919DBC1AFFE040FB3319A068264607CE51D387B9291B7483CE1C38C1F059AA86B68BC7F852D21BF759A56557AF5B4E8CAD60356AE1D9D11AB49CFB9F627DFB1AF5BF8A6D85A775B66767616FEFEF6488C383F5ABAD4E06DF0B6C82BD2582B284BC1D4B27168525C69FFE8117FCC38FE758B2DF09E38DCB1688789B2AF3A050142E50787EBF2098C229E6965FE134593AE47AF7FC4", - "B59F424CE3388B73A01C7279251C7854C664803D834EBE840CF3851B922071026DC17B967F06E8467AD73F8F70440CF20178BD31F8CC315AD8B3D213029D08746BA9FC70AAFFAFE2F393D0339BBF28FC15B8581667E9B43E0A1534AB70BDE8954B30AFCD4BF10B91B8BE2AEDD6489D590E0947B6155A1E0B4E7DBB7D5DF08A340FE33DEF34330EC77E65B57FEBD4745B0A07CB8BCEF0ABA92E387E2C2F80230818DB1F70F65F872A2C5580A6C39B9EF600C797FF0C61641100903B5243D847C7243EADCB69F69D75F4B1D921C72A4B5B67D11B78F84BD9682963E075C76350BC301641E76BFAA23EFF0FDA33B1A41729AF935C09C1E5257F84A4AA0AA3A54525BDF1E3A51EDDA6A35A2C2B6DA82E5C7FC989475D99585A9DCB66325B98C20BD7550871BF66979BA3D58562C1125EFF230FDC77A3BE8A7A8CAEE2F83C62688E0EE5D72D4C858624C7362A57B7C0065670DD8776D1E97F67CDAE4110E53E78BC17793CD34F11089AF317407B5F43E26424A752DA5AD58470FB8FDC193D2B28FD4620C879BD22A24DE4EFCE4FC46D7A5A4350136F43D21698AEF1B4C318156D574E93BDEAC252675BB1F1819B651D08E637538DC14505779521CBA1C5695CE7C5F9BFA3A7E68E14ECDE399144E6D514CBEA519FFD2C677310214DF222CD79C9B9F763060C48D8FC4E02DBCF0D6396F6A28BED4ADB4F69FA44BF6F52E7516E77CAA981712F10E94DAE683DF1CD858492A6B7C1FDC92B3A8A4B121B1C8B8791E18062548BDD31DC544FD94DA7BD77A0BD18B3940760A3746ECAEFEDBB6B99562E836421F24C2F2A99F686DCF9C57E910748031521E359D21A69933D3B3173D520E7B8810035140A9F30DECF99A117B8C81990473378C58D1313E29A9824034B86D46BDF15479E8273BBFC4710958348B17C8EB8EBF8581AA9D1032AD591B7AB62B3E2DE12F36BF0ED71CB0DB342D5233243F466291DAFFD75971427F37549BC74CC8EA2C9D61C55FF4EEF46EC74F37E30AE9227F9A346A5A379A386E4706FC6DADCC80FC7CAAF6164673DF6B7505C1CF8C1A2C262F13A65CF1DA6D3CD277494735E5E0B4366804A816373AA0A33F3FB3566D9811D26380EF7E049F004E5540E3A984793553B866E364BF3ADE51ADEF86D37A9392B6D0D518C0F07F80E9BCF795C540BCF8BE8AE72C0A0A67160F296E30A0F5727391F82DF95DBF2376B82EE6DD6C87C05CA191AB8F32671C4E404734D6626DA299682D9A49788A7D961B737282CF16DBCB233124C5EF4800E1F25316763BDD92F090088218C071E91EF2D76D80BD05D23C6C06EE975279B0505CA18623A33A4D94EA882A6C0C5510986D537B49BAE93E363833A8571F91C47F022A6E05FC7673149128E3876AB6F423CA96A7F0F4D5AC1682DFC05BD4D3ED478218D40A42A894DAD908A587A83299D9CA685C4E25155760F53B27EC3F3E722E46E63BA2CA0D353C60DBF985F3E10893A0BC01539FBE6126215B090F1355D211E833BC019C7BB351B1A51E5286A178F70DB39D3A8DB65E510A0A93FD717FF30BB586B8FF49D62ABD56F0AA4B01D2A8E6A3BFEA54FF1D36C8ABA385D0974C7F29B25BF12B1036E4926F0E70E6CDC93233E211693F7B315C15594790BFF888ECE21352C8FDF906DEB1085408C877A98BC5B145BB1D0945E33409EB01E243D386492BD62847AA67D4EAEF5E8B84468F70457470C1FA15BBB44AE4D77BC401BC4128654B52B2B8CA48721DBB267EFA7F0B2ADAEF8C2BE9516A42BD2FC2C7AFB8D0D71FBB8A6D7034892078F4FE50A3B63105B31451A7910", - "FF81F6EFB1CF3169B63C2F2544105BE42B20467E1FF2E4204601A486928A77571247AD40EF058003E423521B4196118088D773BD1694CC83C02219F5E16C31BBC7350A023E4FE0720DCA713444B455DA085653B539A555F37AEE9357BF538E3EA6A2C3B2BD30EFC32665B597A611EE9DDBDA9A9857FFA648CBB75677DAB55EE8528DB18C4A188C693A9DA0D7DD736401DA333DDA13F572D4652D23F9016CE9D39605B5E2F341F487980331D88511836C7560B9F3E8DF6FF4CDB7F74459BA199E081FA49BA205B368B4D519B2D0ABF92405409EDF1DF280A04F398758E5511B6E6325CE00C57186A0938974207E0059B2B8BC81156E2FC0A76E84C5BBADF4FDFABA379E6F960DFF5DB82FA306535F0A8C4D925246DF1D9B8C7A711554E9087A5FDEDD656CAE74357FC6AAE8EA0C72B74BDA7BD4898C6FC7BC50367FEDE6D5261B0B72E171043C89C8C2149D01466B226F6A1F3F3FF378E34A3956C660F0FC8022E15EA68DE5DAC57BC370B30F9DDCA6404C5A152831230DA9EC3662DE701767953AE8DDB9918598844202DC2AB41A0ED711D640F3C60A8CC69BD8D9340A32330F9D27E7A023CC99D173BFE6CA4F0604FF6E5B4C59EC2E1BD4FAEB3321F755B2494343BB6E647210041A1B96A02B7755EFB6B482B3C7122EEF9242FD64D0D7BE24D320FD33ED0D4DF2756BDB13BBFB622E7E928676D228DC395DC32465E0E3480B7ED2EDDE04101E9C0F8020D48F3D43A0F756622A3DD866B966B7B0BFC1F40B1D460D6A54A45ECCF5AFC93DAF8541FCC62A5FDBE907D2DA6397B3F7B535DD8E30D400610971E4960859DFBD4A441F209021E9E4B05D3EA0C80A738F0C4EE9B03492692C543968122FE39BE1F2E5D682C1FB8549B12D6F32AD5938FAF63C5F490EAFCDA9D7DB70681B5650081B098D0BEC87013C70F890666AE984C5FD92F6939419AB0C1E981FF6EB03B1A48D708438A8F6AF81515D8C42E0DA5E13DC07D22A0CE018105BA075A696BAB7CAF420A65E38EA1961B61ECA43AA0085BF2BA6244EDCB56EAC6DED736712045911D7724E9DDED1C05DC7205580FDF52143C07960AFAC71528C1B87BFD9D21EA5DA5F9649AB037CEFA5713647DBA70A2D0456A24AFB0B55B8C859F9C9617E83E12C0D963397DDCA09CB16E22A47EAD91206E8F3D925444AB85D76DE73A43AA45BD3B0412FBDF254CF273E5F20F6BD0D938E30ECDF159120BFB28FEFC0FEA1DB898D5D1E674452DA86C9AD4AAAAFA07AC6A304CEAADA8AC82870313BBD56E746E7C9C183EF5B53BFB5A374B955D053D1CD7E8EE25108BBB8F2A60663375832213D1B9064C9F12CA77835ADFE28D1A5E1E65FDBA45147F052948A507180EF21052D5FBAC2B3F4E46DBC4ECC7DE08D6FB3B6162432B25EEDA07911CDF4E98A219603E19FCAA8142621F546C898181E1761AE7907F624A5D01E36612F06ACAA157BBC316E9AA7568E359803A408B0C36B4593DA1B4D4D6D1E6AC290C90D19635394E10F0BE0B51165777517AF168F38B702DB2BB43ECB3DA55D9CF9E8166D99B971137F6845653B8CFBFADB778E16A8F64BEF8DBFC6DD4F6F9093FE629C99585D59445ABC30DCAD609903A26C181FDF481642043066E5B0561F13934247D19975F136C0E0F4CD41ED3F8E22739FE2D88358CAED503D7C36FE755ED34B9EF871F2323AB593A0AA8BFDA8DD3D86304E206E5B4FAA6B905751EAAB46FB576C3AAC9387E38A02A6AF8EC72BC953C4831FED1337EA65241E4D94F90A0E99018DA735E1CD4C835AD9F301A618395C8FD4C982CB5282256F8A4894", - "CE812897E0C0F7BA13D73227DA8D57F576A25F233384DAC16B5F3AA455222CF8B1C3F0C69F6E1EA86C6BE0DF818820D7611EC41F6078EEA4461C336D02847EC3C5644B85EBA26B68C5927D67E36BD381F8100B6BA90852D529419EBC8118A5354706D2CC769C2402E517A86809687BA7E0B1940A88F0B2586484EB7D1B63E119D489A41691D0C1A88543D43D8962D17FCB8E91A6CBE2635F4D0814A8C9A4DCD7767CE7D62E8BF17117A6650E3E8933DABD4CCBA43F40ECDC46EFC541CAEF6271E87BE92E63DFB7C2E5B7D7D2ABCD56A0A19E3C9F75894860A850029ADA36F990DAAAAC5AF56B157475EB18943D7CCB8D99CD14813A27036ED1F4DE3234BE28FBA413046A26113124B5FEA24F4074E991E163AC879520669ABE6B1A0203FAD6E4082CD5ECE201A86EC87676E350021FB2A1E04AE9B19A03152F8244542B4D21B4173D05F159EDCE12BA12A5767363794DEF4D390F56208EAA7680AB527C2035B065DD58AC8182BD5660DF75511EE1E0F407F4EA72AB3FCB028C82D8FA3003B034EFF4DC1C179029C452BC4B4D75AD02CE9E393C15872F8D130AFFAAE9A95640EC68771EBE628C42DA59AE4AC2E9156534430D00164E3D2D28665BD2DE6AC1482EE3475F7E00F41078B672835B435711C560166CB4DF17B56884C8A66DCE5D4B42AE675335EF457AC20E4BE7FC32FEAAF7EF4CAD795ABA7F9A20C6703E7DADA30B63CD6CC214114242C81A9614712271CC05867595D9938ED557007713F36D1A44AD2285A564C9B242AF6BE9979F7C474385680FD574D9D33B8E2DBC1318EA71977FF83E8977B93BE3EAB2401A136E021DA182B1AE68007FB36067507FF6900AFC4743A9A8503B7A2CEE04A1BDBE9D661691E5E8C6E5568D16F70C15D156F45DC41199A9C67FAAA36D8CF67672717ED0124E996CE855392F5A8BD24EBCD644AE0CD5B1AD2711200130AA4F8D3B4599AE660A56EB6E192709CFB8890510CFB0195D7FE794B9EDBCCB25ABE6F3B6AAECF3FCAB9ADD6D270D3D5B934C46C8D6800CFCF99617AAB8192C28AB627EB0D6234F7C68F0F4241662A9F062B361FE89E92BF9254F823E4164AE54661C2991A56C4AF8884DEDCB20EAA02D3097F2D5BC45FAD616F2DE3F37FE2DA9CAC838ECB3BF649AB6CCC38675126381561D546B37C743241297476497184A861ED1FCC75BD508915AF39752866B39F1BF00799F3B254C6710D15F5F79E29766E3EB75B93CEEAD0F3D454A3A0A4B9B88534AA91B604424CA1F9801F7F16E0A5489CEA18CCF76537CE33481328C83F3205B59AB1BAC1467C56A28DA696DF2B08CD380049C5E0FABC6AC8C5C50F9481161C1D60B0976FF459B2C11679DF8239AF63C1379997A8CDD47954DA1A9ED1606A3D1D2700A2B9B0C9FEED839E011D52752CE543ED224E5241340CFE1219A1A0117E033F48B262A6C83FB13BAEBF036C2ADD4ACC5D1CD9C5C334F4EE7D964851D9A5B7CF5A38B3C1CCD6DFDB5D1AE3FEAEDFEB72A25C7CA779DC4602FA0E6D8C4B35900F634130D48BDB8291B7BA751256EF38FD6FF0D5662C1691B825714442F5B633B30514058C778C78BBD6A70A2096CC9A375AA99CE11E8FE4388ED8D403EFDA3E604EA77820D4D7A1FE7C51B73F286520D56DF828B659FC636DE3DEC09FFBEC46FC143D943A09634A91194D77F0A70DAED26ABD3F6B51457EEC61F9AB544F544B21A1284F0E70D75DAED0B9D0FD864CC73236CB64EFC7C696882B1B408B6B02F35EFC4B5DCAAFC600330C59B1338DC593BC22C86A1C4F16D72E7BD622A3561F60362F3612580", - "DCD55CF8406A7CC9BA0A5224797D74777689C4FBC0D202DEA8B9773A0F20DB0438BEFD40A996EB2E3F49CBE2E475DEEF73F112FF742269A701AB43D8E47EF94DA4056086D86B1FAD636D89929C60238133A5B61DC4B7F8DFC765CF0C8C7206F3E0DD3DA13407CA75EA20F172AC38C42ACADC946B3B18BBB30DF871905777CFE0D3BE5363574D2545D0214D6A43E2D34B50D7FF7D9F2DAE7053736B71FAAECFC2C355C1DA645A995981E1D617BDDD14EB9AB230D10085DA1AE55D1C9E55C225997D128CC2393D6E5BE9F1BDE1543DCAE918B38AFD5FAE6031E105BA12EA4162F7E24572688C54291A61635C9DA26BB367348473D4DD4AEF9A5C4E8A6512AB149D62F625D8D45576FAA4CE28E5C3D52D293A0D5C48821E1F5CDAD7257C97B3C1A6DD83A4ABB55F780D09964D4B3940D36B6709D00094B89F319E1C2CBBB3EC33A6F0398880B8079E6A39DE697D76803B04C230EE980765604929D60733BBB6382B4CA4B13AD3FC48AC9F944B97133C5AE6C3B9D295A760D786DDBFF346C873C2DCF3D2591926116A318F63835783A33A17C452AA6C620284BA99DEAF023972082AD2B370CF3016F0739103A518B25AE8D59BB017C8199ECCAF3E908F9F144C778E0F5F47FA06FE8A22E3B2CE3493EAA8745478D653F8D3711F832D9212D060A7F0B0B62AB9A3C9BF012B61A9B5E6DBAF4B48D9031250419627E96076925AF95E2B238E8CD227A0F3D8C9C3BC68D5990952D6CB62803B8D193FB06120BCA9B195E92B995B86B92C455A6145D3F77898E457E1B938183E1D76FF61C163057A4D70697507BE020CC28BE6527CE306A5D2506B86152B5E3B954D5A660C79CDAABB2EEF0D135C0D4AACC7FC3EB5A3575D95070B168FCEF4F9B36FC3D55B84DDBEF10DF6BA659F70CB2AB82FA001D51ED0F040F9DAD4129C324BE8B44316C0E3E15B27C2A8D54A948585834C2DBD40337B61F58F3AB99B3303D56EC1D30ED82F29CF6A68208B07DA120AC4073F102F4D796E38628D344384551810998F6211A082BA225A1B7D63C9A3E8703DD945BE1D979677FEBE715396988A873B88EBCB10209E4DAFF939776AD14C5DC90BBE9C1A57581A145BE0D4BB47CF50721EFECCB50C96E824DF93D675B1A1B4D920CB1EE82B0369094DD84FAB4A3FA94F152F87525ED6D17A800EDB1BAA6C13A2EDB5C9B7C5A82AE5824AE9BA63156EDF78517AE2B357C1A1E8EF6CB12DA415A914FB69FA633527B8A1659292D079B580DEC210231BCA77465BC6A9516F2917226957DDDD9787313FA599BC2BDD14DEC9DCAF0F2520318A85C55DF40881FF65E4AC21F2C9EA3CC06651309E1F89982D45FD6EB5BD588B647A80D27433EF85080A7AB2FFDBFC7D2B54B215E7D27A333D4942CD23D53142F04976093CC0344C19F9CB3A5A4D522E26B7E2C1C85C1ABAE1B4A360945A46D097A1F3676A80E3BB9CBED0BD363CB70C2B250EA053B183CFD1EDF2F6A211CE618F70EA1AB535E96CDD0B2FAB7CB7F0396B6DEB59745C1BDBCD452FFD70C95E45B88325A82CF07EFEAD7176FAF04C8C3E0CC4458540BED99ABB9F52AFBE48E42C636DD076A37C07C8E4EB6830FAC011936EC047F6D5B5857AAF90F80B5D33B502A116828BD27E30B3A69F351E22D943A482BC6BC41BE7BF941F3AA7BF85A2BA5C38FC930680FDE5A4E174AEC4156A755E7650CE488620D6CC62BF9D085FE1782EADB11541A5C19C9061734513316B9CA608A6E48D333A110B57BA5128E9331E6266174B85F7B7D1DB264361B1C6C044A8274A7C8DB19C253BF8DAB819E85130E920", - "79E4509D63EC15D4930F17DB3EF8E9ADCDE82C9F2308A0C9F77359575876D90A9CE5ABBBFFE09B8E145F35C7E91B141F66F74B3BA923D9ECF863A8A455086DAADC247872C953476A85772079783A6F37C964AB1788479175F7B4E9651C7DD5EDA94F8BCFA57B3542788FE9547E0A444D249976333F99710930CED2E93B1526A02BFCCCE416F0CFAA631B878BF23E41F95770315F1E169EF22B9DAF0E2F269E06B03B125CC6F20D2AA9A13B98CE23FE3A7FBC70CD05496ABD89ABA5BF58FBD8D88EB9653963F0452CA43CB964F7B145020D637905E8D26E8CCCE4EF892BC48381303161644FCAA1DB9C4775E8F0A6367F1A842C3101C9F94730F6724257F2EE1657CC93950C9C1F20832DCC11E0001AB347781F21DDCD4786234C908772B553D7BDF4795FE69D7D55E950D4C6E2A76C44995CCA5C9CD539ED235CC55DF6A004C1BCA852C2813DD17F333CF67711EB8A5DA439D73271272D0D62B34DD457C7412A26FE2F4F23E5F5AE8C2F91DDF86B7048A40872AB7C728B20DF7AE2A0E8E52B00899C565E68390DFC83344DBEB7257CF8031664FD93DB65738013BA234035F11B611DEA4F74B1000724B2682EDA9639C11F4F4580683DDCA2D9159F637976293FDF76AE2AC7EB5203766009577DF87D9DB654ACD64229495A5B4A94AB3AD8237B9CFA2B5AB6B7239A5146C777C4A3CCA9E1573D96A7C1B333F11D284AEB55DBABE6B4F12A421FF7BD442AB6B8A7FC33A2087886328B33037EA78D9A7015ADA2C8F463AC1FEA8FF3EA886823063992176C31152573C10516BE386CDF81A6568D8E3BA2FF195B23903C95B16277BD60D238F309A7DD6BDB4ACF4541A56DF5D3D4BA4078E58641C0453B1BC8DAAF6F1DB28836D6FBA3474D69870E07997DF4541BDA5C62291A3360F5C5840752A25CFE366186F7E4E21DA0704266B5C14ADC1541E463917D5DA677945574F800BF47FA028E82200F9E53C48C887355D9E3CE5FB778341A356423D00B18D3048C92A80279C2785AECAE9EA57F828766D6F953AACF93FBE8A4C32C7FC9843F466141DD018CBD05ED8A16E27B43C5C0EE16045D39CDCC7E4A27EF636408E968B4C99C895CE77288C819701EE7184DFCE889328E4CD2D8BA7BE5A1DAE50E36D562BF2441B56242EF9C4EE63022F88F0F77E6094AD7DA93F672C06B6BF4ED5523D1DBE7D8F13892BF90DFFD5D2A3BD0E9B56EEF03E560BB28650D873116C0CDD00148C90CFCECB6BE9C4BDD7603B5CE9FC458431C00B1D704702B552D847D0C89265D842FF6599A150854848B730AB33CCF2BA6533638860BA564540C6678061CD97BE3D00B103314894AF13999FCBDECAFB5A895671DD1ECDD95C0C94A250B014CBB657ABE3028C8D6CE436FAD8FB7BDD12AA2DA32FA6435889F1B8C16EA8488FD6AFDC7AFBF5358A31B23E0C05E315B60F180986BA17E26621D92CB639A0B815E65D140BA8A68F99BD42A2F428345AD3037274E515684EEEF018BA41A7B0138D7FF2C0B838823192FDEED577028052EE73D65E92812E4C33FA3CDC11234F47F702AD81F3829ACF1910B9D00167A3541372DB79996FC8F4B15F2A56B272B7DCBC4B074A36543B12B3A5396B0635068B62F81A56E33B40516A376D4ECF7BEA4F8ADBEAEACBDBE23F5F311A39D90D0B11BCAD30609F6CB4A657CC620CF8F727E30F77618E5870F72EDA78EB89399236F7F5432560049262E29A2979F832F2B57CEB25BBC2405A3098CBCD3CA0CDF631B37440A47D316F4860597AF78E5ACEA13E8B8B5420210D7BF54B1F07A433E7A2B193D7EEFDB2288", - "B63460020483CDBB47DB98D8D720FAD57072D41EDB5FF2A2CF65DFB70ABF3524003842F7BCF9D36F8E187F86B864C5FE0181E5E3D33AE11A50E67F56DE93387F5CA7D1641CED92F7195F2ABCC7B32C6C7BD8AE561E36A6359BA6171726A2F9B00C7655C7E346310C6EBE10D2D470BD5BB7B4C88378DBE2352AA45EDD728F42A3DF3B5E80BB6B6BF55CD663203437F575F769CACE66809FD25933204387F8C51E0A6B2C4C6113DD45D31AD7567C9B924D5B10F124F6C1CAF3458B3B84E9E42DBA9AC879E2D711ED8681207374CCD299FDB7D7004678D56FFFE0CD34B4858CC0CF4F611D8EB5B47768D69AA69BB1875E9C397EE9453D37D4983359393A02941E772F912708085F2FC7211DB358EA5D4E00263E14A1CA3430A6E6FBCBA94CBC8281C356B4114B0E0B67B3265D3E1B9A64B1D4BA5501CC0F6E19F56A7B3B1BDEFD8018340ADF7640C58FB26ACE46B788FCA44BF228A737B02F160B0462846DBED0792B27FC6B55757BE01FEAD3655FA9E992485E2B29321816B04C2BF079BA5CD01CD7DC0CC8CFA471FAEC74C95041B7C62DC9BDFD11FBD4D3B7173A3A92044C793EDB6AF4DCF760D38D3D412B3B292C74E08EF4B4515B99A0D4A167D9103C3E776E213AC2C1614B432A8A7D243B0EB5E7AE82118DE996BB55329F49ED4A7EE738350B565F50CCC313DF274EA203757B372D542D451DB960DD8D7F0C5E532AFBA105C7963A39426732E2E30C68317C4CBB3C10802C5104923E9EAEC89C6F421B8EA3D5039D5175F1EA854971407C7B260BF57FA912DF3829BA91BEFC9A7A88E5A289366A88E7E6C5C4D4781D583CC15C827A4FC753F66C81B5095D51F3069AF2E3BCBF01362F118690C35D3E6B5C0F41F4A4964226E4646DBD948FE2D1AE837C0C0062F77A40DD02371EA4B69BFD02803AC3AB972CF450F59FFDE724F79DDB7D534D261A44DC4BED2A47E78289BEE615218D1F861896AE5B07729568508B0E35F82BAD9387B52E2243E456C2DAC3F82176E4859A8288FB8E2B86FFF4BEEF93D9F677CCACA1E760D045F28C819A44F5F678E61585B74D49B1F12A9B28D4056CEFB98845385FCA12A6AB0C86DAB01C7E8BF5D77618F797288706F18DD71B33F909CDB15A63047D0EC462BCC02AA7E6D4D4D5C3D0C5FA2C03502EC51D781E8CDBB63A2578CDD9116701F7840D6A268DB082223F3D42376C5D796557BDC568791BB3A5BB6A9F501837CAF0ABEFBCBB500868EBE0FA0184ABFB927A414A87BC3A1903DDFBAC369B77B5C9FA203C7F6CBAA7BA826867CBD37AFD20E32DBCDCBBE7C12E3974BA0133B9ACE768AD4652C3FFB01D7E2F4EA026D543B2292419B10DB09C47C110005D667EED5D066D4634175B58F4BEA53CC39F2D1A9623B7C9AF2ED29A37891F2BE24418746A233743BD340256801EE39E7C05932AA41B56F7DF4E479A365BA224E94D72A395741D3D8135208C96AF089FE2FAB29B9D7DDB02D149275727E12A2358F4CAF9DEF137397AAB54DF78F5CEB17CA323B696C3267A4D2A944C65B2E8F542A2F0AC3DA7A9D6F2AF073FDED7424942B700AABA291FB8672DF10AFDD154218C0B0088E84486EDA5F21615C06770A2607E93A2ABA60B864505434ACC6B6BB15BD00C3881E59F0B481653BE10929E7EAF4A90BC181DF76434C08F3ED37D862038232AE6A5C56F36F98574029AF4B4A280693551082BEE4CB6DD4B55E00AC4954F2A01129861DD2A70FC30FCD9073FD2F45B31CEF9724E673032D0C87B2A9FE7706040293B6DFC3A3197AA58A53997BE5A2A763B027D5E14152774E3FFB8", - "6D562B96C4DB6F8783C945E358693B3D99B7D8E77AD50B7FE9F5176AF257ACF63E037ECE9FC071CBA13080A08E1116AE09151BED458CD8BC9DFFE5744E0CD2365293B365A01D30E894F8616AFDB6115663FA15522C8CFED9E6644DAA1AE776E0BB2912CF584AD1DB53E90043B1F93D67D51B1B10179F0FED6EEB52A127BE857341CB5A223864C02E4AE3F3902C90BACAFBDE2A42D73DBE88577F871D9C2EB9885C7CEF0443EE4A1C449951B24764CCBE716487F2EBE474ED6DAA65E393F1AE17E52B75EAFC245A161AA30CC8250631DEDD2B233D202CDFD1C3DB64FEEB2F515F2568DD7C11DDCCFCDD77B9D1182A29AD5813791DD9987BA735082F8A669F38DDD84EE7C09334AC732849119D769DB8CD79375D1C8EB4E051777A057A4738FC4E06ABC70F8FBA6B52948F91FAC2F2E248F0C417E2E727C60872F905DB2CCDCF15B2363696424BA5B62E98D5E4B51ADAF38DC97144CA32BB6DF129EAB07313059C725051883475E30B25C8CEDC63BB517319ACDC1E0ED86D5BC5790F11CD2F4B2CD882345706A4CA5863C0395C3159AC3D7FF8F7B5F7B59907CCFAA53EDE296087B04FFDDB0B221B3DCD1A6C64A591729A039C230CA52C94ED2C3118794876F7478E7968F962004F01E8FD0546207A64C09A2292376F77D7789CE2CF04995C7EFDEC91B5F13EFF915E9158F6202D6A7B0B97BB1FB121FF99AB12F56732E9049A2C33597A308A47FBEEE3F530E357BA6B7C98D58114D89C0E9599C6B17BF409B3B63FCF67DE29FDEE152711B63C02F919FEEE1A31636E36ABB4F9BA607020529814E06AB2D8E4FDE4D6C1A0D709ACDD7E442B1EB65643FE7D9E8D89906915AA868E9DB2E070CE6511EDA0506A19A731C0DFE149788BCC155B829D52E2921430566F9DB82DB062023BA5FF61FD26F8209421EE8C2C22FAC9F58059D223B4659A23BE538BEE894015F8E137849280668B971AD628CC57ECB49701EA1F0CE2D07B2D7D8406FB1D2E010A51C02F6F8F04F38703326711B85ABF70D46D947A42855B7F13B79D39D222A3578D6336C9B8A69A12DD38184EBF9DCF787C0D7611AB4176294C239B60351B62309E5DBC92BE0C0EE1422D9074905131757F70343CA00ACF2CF9DE239D8C794AC868565FF9900A1B9D187580884D509642AB4F6331A89FCBDB367067712B7B4A7A32E266D7FE571E4474FEB5DE28CC0D480D4AD11D0CF6B599A56925D68C1B076CC57612290221AAA0F91C8F7D21EAB354310250A224BC0455C760F62B2981ED68F7E10619AEF954B79D0D0DCF039DF951BA2245DEC02E71968009ED5364774644E995DCB33A41D53B3C9C1BE952449CA8E671E15EA888789CCDFCDCC91E0ED093CBFF538909886E27972C9D262F5E1A481B8F483BFB311D1595F51FE1AC8CB43EBC92C0D17868986B6F2BA8127BF95E159776570E273393FEFE203FB079780E675BD62F475CC0D1DF76CCA50B5145565C3615498DEF9B7BD37887BC6988A9853B4E639C1BFB61E32954D1166156F944C722444C29AF577C12F567E568BB1BB44A9D0783F126D6A079345C3842AD6240F1740585102F558C5DB6C22A057EC2D902CBFED926BA5F9C298E6F9118B9D2B446A47E4DB2F4F1CC30E75B6A1B67FDA687E672E7136AED3E02F8CC346F520E5929526B6E9126450E708D30168D1A60B41D19949AA4BA5CB7A691DB90A7B5040B01518FDDB6035454280BEF79E019FB96D899FD97BA47D0A7EBB39A11A84036659598294B0B9A905CE2E0CBA0E3AFAC85FEF2CD3446057ED5DF2FC389D411CC3128A8DD23188F830D90", - "3A9010CF2726ED13F833686B6C7796E87CEEAF4A99B40BE702CF35774B6BBE4EDF528C39A8FCB1B04AB9D25FE6666535391A45D5DA45D8073F705184427C3C5C4225F66F041151A22423A1F5516C744FDA91305B2B70BC11569416ED456BCBE6C1A47A5805B464EF6A645682D88D75E7FCB458BA2F9C44E14589D2805A904AF02FD3693DE69D0CAC00E058B26277018C3339EDA876CF820AD6C99149BF76A8C47ABF795EEF76D55862F4A88B26A73385589048B2E22C542461AA9CBB41DA58C7A5A32047B9F85426119402E531B023E3C8C1EFC7AF70D3D553B50408AB568E4D2EF96E5FAD8BD3EDF830FF2B12829E97C5C57927E69A438737B1920553F2B921E62A3E25331BD3BBBF99C9FE1912E0A84B15EECAD16B03D059876B7B02908C7A7DDCCC51E01213B4829D21C9FE65AE129F3B58B51798C604C9A2D2BDF7376FBB50732D9694E199DC532623309CA43D837EBCE0EE9F3943BF57F9ECAB4D939B2AE599FF5CF5370C9B56B7B9800A651FA64F854962A6D84E1270EFE2A481D399DD3F35C9C43605FB03315259989C4F2EB41B83C62DC2F7EA15B315126D227A0CED8B626022F9F665B49B8C32A10BBCEB0AC7FA80335A255076BEEA7E5BEA0472531B22E07A6579F9726600E661B389A221D2A6D2AE9E0059D24874BA5AEF82B1B53734F0835FAC5732FF0AED0F092E06EA84B3B5191BE3D226A41A6BC39AE3064A789A8DD9CED68FC3B902249622576D4086D63B924CB0C309F75F1FE9A62071FD2629E927A3ECCF3B575961221C5C1E76D2D6F1D330028F262E671905340C7621150074C49D9D3D64563E4E6C8B3221EBDFAD5A369E25DCB2C95A1E19D05B4ECB8E605BBF49623F6C62383A4ABF25FF823CB5F924ACF6D6173BEB850C46E0CCF6AFA873096046B7CE53271A33D18BBEBD6452D1874E312B9DD2035E511FA43BCBDF3E3A9EA8C602EFF6051AC0062232BF8A2C1AAAE76F0C12ACF4A290AC376A0DFA55BCECCDDFC1702D38F74BCC3FDB3160C3F52518EF2B1E14CE9CF22AE5E4CF2DFD531057EC85896708C8BB9D810B7D258AE975D678F19139A760F5609F57E2558E1AC0B6AACA4636017083D25190CECF73D29E2F7B44393D274074A68570B720EE6CEA533AD788F9A7F127BDA09D43F96AB9863B5365C9361A9EADA698F5A616D5EA0EB9F83B0647698DAFFE659979F5A5F086FC8B59D53C737E2D38EBB4F74C5CC6429B526FEFC9D1426969AB14DBD3F54BEBF25A5A8846874562CB282B2BECBECEDAF015F41037486297B30C905572211F80727CEF292CB2DB118157E666B190809A10B177BC63158505BAB5C915D37626EF7CB011041B08B03FA92A40EC3E39BF9B4D7279A5D1E4CF38377BE6C00EE12CFB4549C036E75240D3DF9FF92B50954F461BC25BD155AF84316A1752B9F1834AC4DA1B1B5A4C84992141CCFB0CC6AC5672753F4877403FC3F4A52848786C976B18CE968509A4014F3C69A77F9CB4915A1E389C1EA74A05DC08B6A6BB1BE755365F1E96E06FCFDBC7210099601912F55F639C9C96F28460CFC392C855CB2D3986989FF85A0DC7889AA2F6AEBD3E1AA196F97A3C3A0FBB33ACD3BBEDFEE06606DDAC5DA26290149E6361E8BEEE7F2400588F3FF853EC85B5F5742DE3547F362B0A094D6F935DB0A2B5D1480DB2CEFB9D665887F6030358AB9E5B26DE8955B188C39D6B146063FA59D1BA260796A2DE8CDDE8560915F07087E84589340103CCF7E1B75AD5BFD209A99C429A52E8D4FE96EEB9A32A4CD24A7940B446003E1F8296EAC6653659CCC3C85E01F7A154", - "59CD72F81F8FA04AACD73E9C815A312E8C02F1C1769FDA17C16350D9EBD4F8D10F248035EAFFB4FD67933279518E3BE9E1807288A9D63A6504F3A31E7DF322AA1B2A9ED3C23717C0C5B134D2758666CD04C2FA8C1EF5C1E58870C5EE1378619851845BA80DADBC37A764BA17E6DF285BB3DDFE31A56D4BAAB0FA622B8D3D24B7F91034D2F773FE578C874FAF5204F3DDB90B8533906AE05834BE67263447FB4485BA069EAACB68806028CFDAA8FC6DAC6383837F9A059EBD1529A92F98F44D55AC06083D6B751FF8F9FC5A6444C1A7D346025AD4B67EA12439242FC02D228CE537AC9044F6D193E0592684FAA4D259DFB00F5F98DCA9FAE4C0D5F0427C6936E501148C56EAD1817A81DA30989D0D9C85BF8D9972FFE67AE3DEB2A8959D63B3C3E7737A1851EDC8B313D75AA7838C6F7750280FFA6321CC9228ACC596431D72AC0302582CA56C6172599F30D0CA04E71F3FD7A03D467E37A8320CC0FE3AC72099CEF7C4265F7F18E2980168DACF9C058E39EC9FFE1EEBDCEA5F78D63BB18BF054465179401346D4CF8927580B9E0370B2D27E4C6BD4687CF0D4348B04BECE8424A42B2CECC668DF9809F580BBB3F3D59BFD96DC8C2E57EF5D2989D6DA54C04B15F85EFF639253DA3301FB6E6F92264FE48968C2C2CA6D40C54C327E0673BF769CF116DFD70CE374BC447AA1B121827E5BA510E387974B19B050D9909185A514BCD8CD374EFE2089290D3DF46D088D74F556A8E5F36B08AB17E54143B6FC374BEDD6FF88AE74E71C72297A31E13D1F668DDB455DF00DC91DBBDB2E96ACDB811ADF7E4C1C460D8FF1FB03BCF95EC489446A8DFC5D2220E58CC298FBB7A9B8EB33B61F6461D77CEBF9C36BBA32B34998B7B9B7950E7E98857371003F40279FC2623F716B808912651E55A04F9418989047331C454D2AB04FAA192938209261029FB3C070FA056D2AD52BF9C7A0535FE2868888BA55CB9389E358CEEC68D7A0E5505FF0DE4263C6E47406EEE83E8C797BF58EF49F2F8BB4EB3656A2636A5EC604A4990001190A8A7965A36BBB41019EE19C8EB45C10173B513F617B9688D7102ED82E60DDCD080233A7B3B43B641A3282C4AF6D3F01BE30DD78AA184B9D565F7B1F927EDE214E363A18547263412EBE35E939942C4B5EFE81E439B325902EDD4D2AC06340296D00DD5F0908F5C8AD88049D88282D0F2DEC28D133E1D4736869C352A7CD87D8A56687CC25D5517A62F0CA5A023E8709F181A0D96F1154B3D7517EC5B076B7C59DE90A223B96AF93F94B11EA0EB08A280379BE028DC494C296BC46659CF9C26A3F8BBB47E063AA4EBCBC9873CCA2866865CF45076E6E642B8E3BF9F4A3F9F057DCE71D4D5F3B621D8791CA5333398ADB31486D22F608E9A8745B9548EADDA654F1D4BC042DFF9B3C21B15AEBC37050864E4275D5C36F301D533552D119039242BCA25DFABB524C971821B2C0EEA602A4C02C6487DD113DA4DC5ADD7BBBC325CFC896C942682945A1BE921FF71E6D76FA1E3345589B53C549BD5056FA01BD688D0A9011497C0DFDEC20210BC7F8B713C46A100A396A9ABD9A2BB94E5455793BFA28E39E130645973C30FDCDE52F6C272576291F0130474DC2E3C30EAD54818E9F531A538028DD40FE01D993DFCFF82679DC3C66850528A173FBB534843AB540E21C7731C65044D697B42694A1654B3572FE321F61E98EA22171580F5DB90C997D0C9C7CF44D174E8D24F500832C158278CF62BBFC6DFC46AEE5DD3F8906A5770C3BB6CC3B731243974A76C0BCACD9EFE37E52CD9751894A68AE3596E0", - "C0211AF7A94B37632C667AE5097F8B5992917210A515C3E48276A363A6F5696AFEF5B3919689CC8F21E077310FDFC5A58D6BD428B8FFC678299FD053E7C016EF3A154A41DE5FD3C3BC5070ED6EC8F16170C880F82EB0B7EDED047436E8FCD4E2290F450963133226D17D7BB99C71097978CEFE496032EC8C6E73B99B05A33C4F5373BB73CA93F7128A9818197E6FD2BD88451A4D8905214157C4259228DEB5F8B216FFB206E4EE1025D3E16987FB6064147D3E99CEED73112F62D513C8B6F19B582D0F6794B307E8AF97354573C758AA95AB0A926386E7D288D74F9C6B0E2C71EAEBB36422C2120511F5F3D2B308674AE355B1FA1E72DA55098AAE3C70CB1B85C902C103056E00EBB70D37F08FA4D90E860C74E841F4E99957B3097ABE602E65F07B8787DA172E8E9ABF9ACDCCDFF6FEE2F902082BDD49547EFD95B54C3B8F6C6D243D07F16819E03189F0A3F3E0D05B3AF3EC92CA08846FC909E809CE9C30F1F3AC6FECED9043245A00590CBBD83EFC41C9EE3CBD0E328426F821ECA32E0E84A8B64F200DFAA5F01B262F4E816A90AA33A2984AB8E269B8CCF61E65094FBB7D10E11F9E1022CD97F17011DA53455B24E4ECD0793486C1E6D4E3BEA94E6DC9C710CFFF30CCD48E43076D763957260D1ED4F7C41EFA0B7F78BFAB7A9274E932013E605246C36CA1FFA003A4B24DAED61D15327BCA1067ACE961E718DD5E57667F5F33411D17BE093A9D7C6675097FC551014545727BA3F19C5D5D23A0922B11C4BADBF285A17EE96C916238C1E1DE8A0D28FB79E72EAF5AC37710B4E6550CEECA2F22697DA18F858507CCB95BB7F25A0056FFA55EE9564782C6042686195BF56901D4ABB3398C557CD47D30EEB344B532E77566887693CFAE50CE8C0BBAA204465FF33456ECFBB1B4DE4F8D6E2F3E8A84E90410EE3A79ABB47D40F4691CEF37E0BDBE1BE386098181EE36051EFFEEB0F5898738E400D44ADA4B3348315E0BE88C4C43E8CF95CE8D56EEAEADE754A09F170D3ACC44DB101037E001DCFBE2C52DC32D040BC27C1A55C9EF5D65FE418F3B761284C461606ACC84D36B9A7A3C9353723BEEEC80CF75D84DA7B2533F844E81EB8835289487CC7EA4EB277A4BA4BD50B59953E3DF3EBB2BB69D7E148792DF55D429B2DAE9B40B00FB14A948F2797B7488EBBBEB4B11880F7D3062D3C0561D7F6FE715C3BA6BC703BAC33C29DD87EBB84C178BA09961F2C10D8CCA42BFC3977EA66D039FC24CBD2A7B3316EF37C0D0F98D3CB8D5E4708B4287FEE6B656F1E300260D5643E9AC323A7F0527A7B98174AFD3277D35D6EC63865BD4E816351B8492474116E2426A3298606039280AEB595293D18EEC671E1E139EFC7936CAE3056F9698BFE95568D050F281F17F2CD65B62B98BF36DE469474F440E27073613A121370C606D5729DDFA12C8C400D0364251D850D90804ABF000ACE57AB195F6EE24163E8C443C8AEB641AACABE70675ECF22A5B9DAB6DDF0078EC89F2354C27D296411041432AF390DC71CC6141B52C54FC778B5BCD31B55EDDEB62EE364983E97BBB65EE98863AFFD2310B482AFCC28A2FE9C7D8E3ED24D20FFAD1F5B0AADB344C77F89FB88BB2FDCD64A77203BC331FC23BF78E284ACE3016FF570E3AF32ACDD5BD5E7B59115950CE804C231AB1AB80276842FAF80A576C9A3148F527596252E2F9F76FD6B4C03EFCE924A4740EDED98B290FF138926811607CC553FFAD5ACE0FC24D7FA1D7F3701A8E0D7F614941C9FB9215389CC5EF6D3CAC193EB15798CB1FF2950E2E0EA96A6B9E672CC343A7FA9C", - "28EB964EC60708D60D921BCA637AF0F0E19E127E0E563EEB30DB02F8FBF2848CEC8E351077A8294AD441049000D2A3BD101B691C2F1DF3741B8BE7DC57592C2D09C9F368010B4B3922A8A622887C37E959C9AC31DBE89C9EC9FFC26EFDD9C49362E3400E660928BDD7F67C6E45614ADFFB96622390AACC03F1186D18BD11333AF0348125A92EBB40370A32F5E383ED858F6720D43633A9A3E3559A0ACF5FCC326DF117AA495759FC12398B2E060F8C6DA823F3E58E1158B81AFEDE50B89F956D4F63619332928B4CDF5A16E0536FE7426518B1C50FBBEB4EF3830D77924BE1DB002BF2B0A9A8CD6FDF3BE7D7D1D7A3EB4E8CEFF8BEB9E2CEA9BCA74349D67413E7D05DEC014D1E6990062F0C4CF1E4720D45E23719D748D0C9BE3C3CA444E357F181E44EE841E35CB5207C3F993CF224A4A90EF5E3610254EEC4C2F2EAEFE041E1791518F93BE9080634AD5594B98C6D0161BAD23EF1403FEE6FF846D344BF0B42A65762804A33F00F12D769B3C58F123E14B4001CC631049F6E35013DF92AA50F89E71E78879A9B428341A738CA001E4233652802FC16AE2377C9C0B5650805205D31445EA0AC0F82A109E5F7C0758EBD5C737CF48D3D5D44816504D972CD2FBBF0AE566B8247F81E404D7DAB5A939AAE51375154A3125345C061CD479F8D7D9EB21C6ACD971F75D8430FAE557DE7A669C59E35DAC4E7686C53C34AF64A5AB7F6B5ADF48585417DBA3584D4552C241DEC336E5EBA84C4D295148B29FE824D3934F4D2A8EA2D27D29255988396A5C350421E2C2BD89B5D18155B20260DAED20E3DFF52F2E84E6D6CC2C040FA3D0B8726C63778A601CF95BCFD381FA520F95146292B8D854C5F057440833E78057D13FFFEEF4418E97986A064AC8DB74A001BCBF8B8E26CE9C68BACFCF4895C956666F92B5EADD27FF6FB032207FCD2100FE0DDEAAE8A860F89BDE341E59671BB0368B1C68B44B131139A44BB37EAB251A0339A79D358D73281325A594E2156E981C519419D925F0D6C8661F7C294D91F527454AE82EFF98344A6E39B2BB3E36431255E33DAA31B75E961FB306792510924C3E9B89150691BDDFB275B9128677DFEAFC89E6562FA245DEECEE2E788EFCD06C4BE744CA97693CC1AD7F0EE4C633D706AD278A46A8DBF2DAA0CCB69806912F8C081BF192ED7D17EC222392B6E84D6CD88FE66DB10B1EFB9CC7F3E4F3719338B8D6BBE47644009743829F288A194EB3F6F21FE7D7FF55F8FBFD1312AA603CBB0C011CEA377E6E2AD1541C5BF55AB73777BDC20DE77F701E7DF26728A44D881EC44E905608CEAFEDB670A261F2109DBFF79CE13E98A3519A9A86F3E01B7C3EBE2F01C657EE017F0740328B97392C6824FDF4D5820458F0DC9E999A4F878D09493D249D0B43268D44135C966B05AC8A69518BA5AA10423615DD3BD8B6E38D37D4E7ABAD0F8752A64736EB4D6656F6C3A6C6E1595AE0ADB31ADACFD6B4146F4496E739C4DC98835CE4C5E2F1FA899D4B896B02CE97822E90CABF5850321487D0C9DF07772031F1A438E9D63374373958DD9708C6BC38C3028C2C7DBC7B2A5A0CE8EBF87A72EA394FBC0046B62D60CFCC4256930BE65B22305C750B2A7483CBE0B3FC0824A011D274FCC289B8EEB9ADC5505426D8618369E0135FCA2FFF5456E480109952CFBBDA22758E14643AB48F11AB4F4EB475CEA238C6493166BF384B1DED53072D897E368C8BF8239DE53290766A4727CBBAB88691400E9FB9CD53442B91B5D421323A24571DBAB65B7EA7015775B6C8DE25247D0E7BF3DB7F2506B4384B328", - "D7554B01374AB97EE1246C2DA82B0AD5BBC76968B6E058A821418E0707D596E2A7E3AD9AFE623D18812F269C1D347A732BECE58260D2E8F1399AE5BB928716865B902611DA70761A4C3DB3EB0D332E58E081C08D4AF96B1A85DD68CE15A8EAA5B95F73CBA9975924F8F9A3CB57249A6A904A33F6471ED4F389168702EDA2054B4A523B6CE189B26C50900913CBC7693C4E447CAC4CA7B783106698CBB78F5E793284F27E182CE12BC792935FE38CEAA7F659967111AC2607C8316FD3CFF111DC5C2D58502555AA589010F9DE4F735D456CB9F0896FEB163984710BCA11C5D78D9ACE6CC9E2EAA70B177A9D33D8C59245FF9773AC181548BC82C751D59A350C65C895AA79E9B57FBFA2D17F53EFBE0C490B43C3369B71DE45B9AD67C88B2A8F1AEA2F5D871970FE9D4C6D63F81647DEA310F76DE6C050729DA4575087E3AE8F6804128FDA47C1867A6FB5065C4186C47D1199BEDED29D26BF9825676FFD9A98BF91E3921A07EFC949D7473CBF04E6647390E33CF765BBF73714E0AD38C4D1EFBC3BC4144CC9AEEBA0B9B4843F910A7F9CFDD347F6DC1017C010DF0EED1A71958CC5BB8D50BBEC164E186B6572FD09715C29611A3A5162496968C1DFBC1B6A8A4E617922D152FAF2B08BA40E47AA0E9F30515C9AFC74A5C2D87828BAE5243BB7988DED81731126E4C7E9609863929F943930FC72D0F3A4784990E08145485CA0FBCD69BAB2391C82E75BC2CB2DCAF0E94A3717B6A157070C77A8A3B5DD1E30AAB09F5368F46F66575599C04296982E6AE8F8C334ED24CC58449CAB0B7660E0F2BB9D96BE515245DF9654EAFB5060D21291DB8A2D820BF372E795957D59ADED6A72C265D19C852312BFDACCA65431B9AF4DA6AD56B97E9FDA9AE4650C9165037F353D9BE92322B4383C30404706D102F15D8D39B21D22E0B23FFB0AA0F58F477DEBC4F130BF501C765295A54913A7A0190FC907BF2420B329B97F30FA65A7429E7D71E572E1BE0AB0793B606F480A1526085637BBF89CABDBD9D19D808F230AE48505CDA9ADE68FDC826682BC406D4A7575EE913B60769C3BE4D81A073C05FE2BD6D7A1C3B52FD2F22875BE856CE0F6D7A3AEA1897FCDF951DF4A86184E717B4077A25D37935A82E073373ABBA58B0F5F744CE52284D96200CD90F0A7B4A03869A93C9371B7F946EAF2EDF35ADCE873407C7BEF0A750CEE48BE3A33CC47979648FBC5EA7E79DBC725C3901D4D05BC5B804007BD46E48B424665763F028E3777FC1A00F588D9A26F68DC7ADEEAF8214B747B409395016A05D8C72FC3E838DBF7C5A222D03699897E5606433CA760C6D67C8BECAE0FA8C312C9875AE26D61FCBD3A320829B615FED0587E4225E4B62264C9B37D2D2B45FDDCEFC060257960DF6A1AA2AC0544FC333914D192A1629061730213B1455E6FD7A712A08122C8BAD77EAB9CB9687AF97A3AFC02B8F413930DFEC10DB37C385B5643E91F3345C73EF353453F34A5EADC8EB41CB098E9243E57258AE608C9FE7BBEAC524B21A0734D8EE51EB30DD6974B87FDF3B0B1E1DB01FEF13061E4B072DAF927C99BDBB7691069E2493E86239A69BA33AF82998CC1D7B368A4343BC63EACEED280415FFF40B0B61221D7D1C098C6391E5C888228045494F86644F34AFB1B191BFCFD1A29C678956DB16D0BBEE458AC6DDBF00E738198C093170FB37F3F141619E65502AC57E9042CABC72372E5FAB9DFF5E42A00EB023E44B4E536706FD63BFEBCE1C0DD59E465A61DABF566EE7216973ABFF5D34A5A62518E12E8352C61BED9348E5826290EC0F84C", - "4251265EB325D261D721A84F62224701C9F564298EFE0C2516330F7AA43CC3D7090581B74C69218D74C8C6563FE276F24F39BB7998CBFB9C49EC649106DFA51E45498DF0F347DE8A562341DB34E94F286F583832E49AB38C09DBCC3B2C307188A980574461CB3C41EDFB933938F89C88F61886B60097F272E511B49CAED645190E98C3AB8AB5CDDC021F76567AC1EAE9F4F8D782B91BDBA3037BFF8FF43879FB6598D84046CA06B3C8EFE275BC61E449853F979AD6BFDF27DF453E2551F09FC1916F4E9884012BD4B946E2A65C86C609CF8EDDEDCECBE9B1DD6715C1792E261A3A013D64F00118DDB1FDAC9900E8BCCCEF9246446D5248D5E3423D859E1AA9BC38F8697F8A4EA08632983F268BF7D0BE639ADFCE6625E00229FD510A41AEE418C3AB85F5D2256D8EA4E9AE47316BE6DCF792537F28514B99BD76D098C8B4CA16DE1A9ED0F2693DFBA9B460BD842452BF563B03874DCCCD3E18B76AA3E352978473A2E02C6398438A35639457DBA7316577B0863762FC177010E0FA0F7537420C0443D8D7F51AEE4F40A67E249D678E77F17503A0A6DBEC3C60FAD140DA592082C334E3B1D021E34104A9A724FB6EE3B5A22CE5D3BB9C5E896956B4C6F7B1F51A74A56A7232E027F706EBB999708BA8ECBF42F44E41EF63A7627C60E5E75C678B5B3F7846CBBECC9A1B6EF78D7912AFF0EA56B7E25C31784DF9D63398FEF53F6193554C4D8B7A96C170A89961D2654B9A663B39C76401A439CAEC482BF44F20DD12140D47D0580DDA48EA905D409BAF5BCADBB8394333B97C0FD9501AA4B4BCEB3F041520422530A09A9B24EC04206CE907A33D0A18CD5C1640CFEF970623B1AB2B7EA5342B6F38C717416C17545D27C21A8F37AC2B98991395D3D170FB2D03C6B152915DDF9CAA12B5EB19E45FAC4CFD4ABA726A723237A6488773C05D0D38D38D920C6E8F2D3476B06B40094463CDAF380026BC36B8EF3DED6A01CA89E015A0B75BDFB97D859C620D329C9B26B1DBE3A3C92D8510B060ADF4151AFEED125ABC0D6FD3FA9F7F3C67B6BAF14A672977F2052A84F0437027956AAED010F63471C5848781BEF8F2BAB9F8CB0DB00253E2C6FD30D2A0794FCEC489376261CDD407B4ACECA129D87FFA0C76E28B9483034A40F84EA21E06C37BBEF2987AC16E77E021D29CBBDF077A912B89CEF82FF0EA59F7FDA55EE99F4602B5437CE71B4183BF28BE79327483898C39D09DCAC59C3CE32333BEF4B0720B30944B9998A01CB3C135D53B4A76FCDAD1C321D39D4466F0BF95710FC975ABCA1181070A4A5741624CE9AB0FEF27A5BB1805BF295861D0208BEBE7DF92EEFA7FB123B6AD42541C1A1057DA2560469A680E3664B1455D6851E6C8DC8C4940281AFF025B2BAD2CBB53D1670641EBDE2AE91E71F7F69AFD0C1A0225351CB1290EE40F81560A52463FB04E1364F9F3E5C454C311240EDA5C6AD78A094A73DDC1463E19A8E12419DE4966A1F12872E566F178E256F257FD1890DAE6F84DE013C2490B57DC1DED2E705C0134E889EECBE5575587EDFC240DE938C6D2D9CE543D5BA3A4A3EADE1A6A5F0CFF996311F72B3C6761414E34342C3D1A48F5D3011D7BC7F936E8E086581AC256DC6A376F9C4ABAF87FFAAD67BAC64401F4D976129EFD57102A84E63DDFEF60CF13EAF8973881FEDEBFF8D4B356B2A03EE9FFBDFA99F77EF7251C11EB1D2514D5E657697EFC47FC42CF10FFA7F09765E2EC39E0A99E4FEEBD410BF4AFE51855341279F7E47DFF0066602618ED5BF70B2F6D002805F41E991C68D64ADEAB7374F25B60", - "E0DAFB980D888AA2580DB37930D1942D6D088FDC706871A90D887B5F2CA6B21911BBB8BFEE1376F48428238607AF7CF82C3B3C9223746BA9A5F01523B20889ED8F139EA3D505D55D766BD056416193CACA6D5D6175C16C38BF44D7F89D4A5E3406C7944AD05D86C310E1EC78E0C8AD80FA0DB202AB1768AD446AC7FEC60B30D741114B45857FA5223E64AF32476319F16DE15C04F34F4730AB31F4F6BB13252D706F0B3BD5860BEB864618353CE62469E25CF4AED50D8BDE9633CF18F76AB1EA5552614D4AC3848A0CFFFDFD51F17A4E744533DC52979D7012AE53E9B08C4980AF8876ED2FD8A6F174B3AF651517BDDA1965264F1CCF0EEC8E3A9969D1359C5C9FD20CAD8698F3E28ACE77001F563BF456B5A46FC747E5D7EFED93314F7AA87CFA60405F968A4F9774E30E2266938BB19E9265FB71BE0D40FE6BF14FE02E36FE10FF110D63E02145C78B73217EED9DD87F70077E4229572E6547DD71828C773E46462E30B497F9F5F99D723D657E17A288DC98724B11AE87B7E56D33386A7FDEE0698353CD46409FE8D2236958B166B1C697BB8A42946D66E390A045775A6FE7DEE4BE260490B69C56476B894383091C827D02E960D9359E8D3E151F50EB87FABAEE8ACC6E325B36674D9C7CE249B879B3FDC6AF95E92FAE53047BC211757FD12564EDDA4DDB6AE8C94DD3305C21970E90BE05ABBAF912ACC52C77714F87C2B059A9E21005D8903A604D82EC22192C46CEB63C588A219CBF755B5D44CC0E918CA6705156CB497FAABFF63745C826FE16F65582D4820141DEBE3B949C29EEC6D99C2A4EF34DC878DD82D0FE6D5ACA302ADFB897DAE78EB0BD28A938D6FD5A3535CADEDD7C521E45AF4BA92FD40DDB009E35C21254A6DB959698303D56B59D8F319F18E688F9A20DAC8058E0496E0E46BD01880F3C78EEFE98A511768919116A288CD3CD28098BF5D4719EB64D548A6D791F1A9A9A3E9B08E7184AEFE60A3D7D7179CE47562E9133068789BBE0297FDA2B2D6F4248B288CD899BF3231EB360ED45F769C0167284319D2C2B11375C2B18E5B67594CF499A6AF2687E0C1AAF09F4161F3AA8369BDBA68AB022459A2DA9DEEA13E509AF3A68D011998D9C30BEBEBD04BC9983F36FA549BFF3E3D323722B2136AFCE0A2CC8E593B370C7B48635926B9575A77AD7C0DA18E94FF1C8FABFB57B25981288E1771465360E2D619272CF3F56268B7EE130FD07DE29215FBD5D0A72B73081869F60CB149A1E4871150778A2229F3C886200E0DC2C76AE049231FD3171E49FF44BDADE185883198D21629CE0AB252C7451398E0D411CB01A66BC5B141CB150BA9CFA9F9F46339625E1D5127998302AFD19D5B2D85F3F0B2B354C7CFAACA3D4E7C7B7DF44E22EC2C226178DDD480DF7787EB28F0285B1F973DC47B094491DDDC12BF1CAEB99E0E13781FE8A64DCB0A05A30763A055A6ADFE5434D7694A0F6A0366B5D74E73227F3D503E6B989C5BBF9E6D81EDA7C46D890FB2C5CB439C5B49FE16A9BEB14B12B08C47713331E8932D4AF6B85444E3F848C5AFDC095E984449F0D126EF711F8B43831755BC0FAE8D9FC79E894CEC183DC24B1E3C81FAF6A546E464AF8C0307263680CEAD9ED6E80217F98CA82458BEE59D2A4FA76BD7D4425E0C77164A50A2933972108661820C75EB51C8A0ABDDDEB30F31F2E575AB9DB723DD084656691096B72193C52053EBB8B72C6B30C49185166FC39F3D9F3497606D15E8D696CDC256DCBDB6D01DD2C33C0249D6069788DEC09802630597C13EB1AE152E8E84F6A4BF60BB09E049EEC", - "EF79F2E35DA357E9C076B00C6ACE7C50F865830698571E999E544F5025A99C36BCB025B7967846306FADCA22B8BED499BC9A80EFA7BDBDB83B15DC6D48AC4E3978D528DCE0A3E11C3E62B619EBA0C853EDB0EFA1DCE9EFB2E024FFC0B59A8AEC329FAAF418DF9BF70A250F2F6409A9FC0153161F6E8713005E53154DDBE15242AD801C216A1E5CE207757BFFBED75EE4C96CA0C3CF448966540EB434C68E9A4CCF3C5907DA216BA664B073D73B0779204EBCAEB55446AC6E2C40B8BDC666D4C9D33B7C644F867BCD8962274630191EADAEE7248398B9F02744AC5D4DEBDAB2D6D9F8D6C6392683FC1A795F70134E790718D56DB6D424725DF8AE7E11F02D684DA78ACB4B9C311806D082C1FADE4B31B8A6DC0E5F16618C47E03E8D78DDCCC6ED869F77CD39926945466369CC2371D3B51F58DFC6471D742C9C82B1B7A2B1B1BFAD15FEBE592AC0F41B19C126D923BF5944408506ACED28FBED161902EC5FF19CEED25D18F47A76860777A3D86B3E0BA7446C3F1EBDA88F8A8E182CC0938384842D42F41E0042C53C645DC87C88429E06BA9906A7A3C1F6A76671D69703496324406C7FDB20B9C3CE9BC273A743DCECC0016BDF85D82112DBD4C49E2A6A5DCA22738750EB8DD6AF15B27A0601970AD12660A51C560E5CD44B55960AA266A88B82E761B53A8B42E7332EF2FCCE093BCB06FD18D916FA10F4E9891B103DDE5D808963E6F71AE7479A5D0BFCDB8A2B2086308CFB7813EF6B7B5304225C2E9690E47CBFCD534570933541E8DC99227986C0CDE40924D64710A7FE28D248E667E18197B44D83FF1A0691E9049611AA1E04A1DB06595EC32A9B91C46F50096553C0B5716D2EA9C9E3D373C787783B50F28948EF96D21FB323CB69FBA26E8C869C745FF08AC0C71D2B656E42928D09AB4274C307FBB04AE41FE847721D95FDA55510893DF24F56522EE537F609FD54E4DAB4E98E9F3F8E8243C5D056B4CF6F2330408514C6CA22DBC79BE374E2B34B3E9A9B689B9375035F5E32013587C402C14997741654DF70FF5F74C0DC26D82AE7F036731AAE15D596E426EE2E7383EB540A48EF41FE2172F1565AD79202A016EF31255DBA5DE29C8C77B4704EF177C97DD507360FD01B44D612DCB18D7B5650032B1E768851C84EF794F833F9D5D198603224016D3FEA90F3C65DA465418750A69C43050A738A7EC4D415CC0B404B475936F8F675D49C67B875BD8BE2B2D65E05C49EDFE72163CF3F3BCAD87D8E956101964A1C1345F3978E144303FD1AEFA4675F521BBA59F0EF43DE19418993F444C1F75BEA24B295CDB73A51510B8B4B59DD20829466409444D4FF428B3B94164666A642FC2A187FDD7ADFE75E813BF64DE664B131F58B9CD825A19AC360F4F83E43FFBE0923494D978B1B2ECEEF07F2387E03B1D933008C0131A9ABB08DE1EADEF78291141D285EADFE1228554733CD927E9740D39EC9F539FAB960EA829552CFC36CD8BFD9092C821CE4FB4F29115BF533A56D7663CE9FAF2B9DA374B6E1CE5528A5B11ACB9FBE818BF4C41787F5E4FF4D517D46D2234B77F20ED3928BB38A32BBA350A66540E19B586C47EBB9EBF4E4A671CB41DA55BFBE5B39C025BF8F11A786D60C9DA6EE5299B17C0135689AC9D880B594EC51BB52398E78AC7DC2439D0C4BE7BBFB7F044661C9CD8D6D7EB16AFB943589C6210882557C65034BD7D044C6E957722C93537473E2EF1AF5A6D05D7404E274D2DA8B83F6D2AFF9EAA55D122F69F469927EB682977715FB1617B36368C22FD6A2A7B10412E9F202C6FC9BA1D7789311D0", - "18085D480B93B422C6BB24B09E05556F8298FCA307341877435D2D76B9DA1A1932F20D2903A63A0856D9C431FA3C4C591D606E0043B0C6BF277971588390BCAFFC01E14C6256290E1A01EB7BDC98611EB4E40BF72B04C21526D4139E3E75A13DC25C0691B67F24B195F57923684BAAF94C7E3CFF4830FB5E828B8F7A8692C1A0CFBB9FD3F021D3FCF12C7497021178A2AB8D3256E8606374D6D0E7FE11BB1F313BE2BDD4D977780C1A2053F6CB0F60F89671AE59C178FE33900FD11B4DEC25C698CE0FD4E451D6A3CEB4E41BDF08F05F556B4394858983D515266F25703C17B48B1AA13056ADB2AF9A865A0FD30BC4BAC0D7B1D185AA2903D1956DDA3D5541873EFE487E08E83613428B64D2A499BCF3783466079714FDC3D0B04ECDCED5C89F77F5E6E6F1141D47EE7A3C32382A89F512F9C9BD96AB24EBD4F77B911D8B8206CEE29ADC1E055B7BDFFEFF94AAFA750B857EC6FFCA693787C0E2817554717CE5DD5568DB1AE585B9BEED0C6E228FF47C43FD7565D3D5664BEBD73F97DCF73D8EBBA3FA092BF6EF21730EB909327313FE1493BFB44397567DFA30BDD7D090245057098AF775CE977528E91D9C3976A4D478A5695482E4EBC1FCB2F7FCF6E5F9B08BA8C7DF12E6F77C3B0362B1132F9209AC1D69579D5E9815535FF72820BE1414020694A3E2DE53BBE7DDB582C70455BCD18AA0A4E0A8BBD718217C616129F236487194B266F95E644D1FA79532D7AC13CD9C839BE14AD4BEC179923EFAC48965A8C915812C0F0886C11ABB0D2DD58FEE6AB2549AF9380B8699F3EBB0F96D295C22B940044819D7FBF2364610893457DDECED6113D1B14BDDDA8077BB32E70D19733CB795BC8964FD9788ED317B5E433CDFAC3CE3E0EA2A8359671F2ABF49946217358E92828AE32E6CE645C3C0E4D1CB64E5C8532DA7FC179CC7ACA241AE496D821EF7FB9E8D878B746C50DEB281604830360C8ABA336D1E8F444FD46A74F6B1A0F1F61EEC42C1DA2B6D88CD1AE94B3208866BD1757B1ACC09BC155DE4690A97D0244B819C0A66785EC764276BF39FCD6A1A172C777F2E9A44817D1B6B3C09AEB4436A3B115605A850AA9D11BE2E660F2B214C45B00134604EE395A77BAB321298ADE920BE3050CD2D7BAC4931C3E3687BC4FD7E2EFB536E26404E9950C928A3CFA8A11BE42D15EA8DB2037154F79C67860844D04DF51F5F21E90B8A16E7504947B90B655744758D97886E4860FBDF28FDE80B8F32C94D09F4F827F34E8FCE92B576A8809738D6227C9A31A43CEB3EDE56BF7306DC6F208D6229CC3E5C4B49AC54486ABA7F0079EDDBCA82C3C77F41C58A88C4ECF4DBEA754DFB3424BC3106A9FF280E8C6A7D086FA06C44ED23A82E23A03D3FD4CF62DE1AAF3A95747CB5CBCEEDA5B1929C13DF6CFDBA6A94A62AD3035C8CBEFA10AD9D37389B2EB90822E10B422BC165A3BA86F37C0A5B96D0EABCAA331FBF2806C65B376665A434A6D59B3BC9C339F4437F4598D0D6C62812A2083C32359B938D78390F9B4F86E42F297405069D350F86B089ADE021C1599FAA2460EF5904A6E25708032540A7747BB254679454A7B38C7491BDCC835033A76514869ADCFE268FE49CF38A9B844A97214E1E1ACE873FE051FAF282664552DC98618E35DBA4AD9B1FBE50700726091534091C631B54C944C28D97DA0961F8E4106408017CF1EC86456BCC1F4EE7118D0691F0F327A0436D3145E5FBF8FAC33E5179094FDB03D9DA0D9A2EEDDC221A21189B68EE1A94B13F062F21472DB5466B266562E2186FE01D028CD4AB5B6AC9F048D8", - "D50CD8EB871C5F371648DC07E20BE84263CD676282D56EA5374E21B52752DBE416DB787BCE232226568621ED792A9135A59849451A4A4D8A1DCF3C804AF966881FE5156FB761B3736F4282240FC0BBE72F51F0122D96B3755109E7CDFC70F9DD04C58B4A51C00B4FC0EF252B05ED76440C97DABA04079C121351CD43BCDDD4AA2D2495B49B908A9AF815DEE1405C3CE9CEC7D5BA9919621E8C4E920E08061D228038F73F8E5DD66BAB806D2DD953C6FA5360487957912249DE009655658BE8CACF00E6E0621739648A7A75EA06E93946987E62EDC270B266BBBCEF61D7CC63013AD797589A7CA62B65D4127E701BC95D45C74DBCBFF498D3F87CBD1B288D6012EC392B901A3DDFF16EF1E1685EA1F92B1F32DFED2F9076EF9CB1ADD8B04953E5509B24C48977FFEE6044B8C5B80F9DED6FA7110C3A2EA42EEE8A83F4A28FE78B27E84AAE7B3FABA56C1A4D2414E0341C69C40A43D65E16583A151826F7C7CC0CF0A5999A1016BE6912F067913AEFB525EE41F1B9C82881054E9624C03DECE74976228B119974BC546F823A597C7486DD594F1FEB2B6D0330918936DCBC12E3752A7072C5FD7B145571DC4A22C770E00F24B8C91E27F2C727FB049D04BCA813948D2F7B531C906F2018F51C9EF8B7642C0F1CC06AD338BEDE17683E0BD2A90D4D4746189F792952037E4918D2D6E61C1C8A8B6C437075ABC38913C250BBE6EDDA5CD24B630AB8FE9123B08D5E8FB8B71BC95BDA4AF1A71D5E54BE98B16D7D3083AB1649CBBBF44B3D5DC33B77DC1171A66F6F40E75EB86801EAA36E02D138093F28ECC6DA4CE4B128DAFB8D49A17C683FFAA8E6910B8BB7B832B3A3D0765DE2ECDA9D7BFF0A822F5FD389A04B660F832687CD67F7E1E1C3F5257C6FEB27B763AC7327DE8FDB989413B6D002FDFFB1DE5A80F1C5E39F06E6D716A69ABEF37B2DA9783FC494574689948DB51F78C8812E09367E6C8D70F5FC4139C64B96C71ED851D171AFA69D2A646ABA85279B7D3D31D268A2E8A272C91902F12C49D07D74E82728AD61BBABDA333DE7138A976A2267DCAB1A02E19B0685F64B608E3DA41108D54A07D4BDD24D79D293830C04209C98F037283BAEC00B1923CF404E1F21584F515F9D59B53FA9B4774FA8D3B34B7C66907BA127A095CD8CBB23375CB188CF9DF22CFB4CEC528C581DB63598DDD9A53438409D72507D2CEB5BD45DB5C760415A5E3B3A909EEDA73B7FE122DF04CB1E9F29E7A5A7385F632AEF63771A4CA2164B9B3FAC3C13911DBE9668D1127DB02A94CDCE2C8C7B66F0C21601781552B384DF0FA002DE08892D0881174CA1F6DE80B98BAE545237C5CEF9E1655F9EF8F8293D644CB47963734197F1976600CF2767A59FD56B9B67659168ECD57C485E5726C150DEC6C302456AFD4F12B2F2D1F36B03E100E109827726020BDBA970A6B768C580E34116DD0011299B4DEAAB8B04DE1DCC5FFCCBE57254CA79743D6B00D119CBB2C0B0BBB2FB8FB0B0EC97204E1720F99D16A3257846D09BF8EAE02DB21FCABF03CB0989FB4D99B6D71D5E64C6FCACCABDE63B223A91D1278D676839E1A5CE6C5EE05AB4F10EEC511C366DBFD7AA1E139AF671CBEDB3160A775E5214C862E95C3A7993E508D8F8B7ABD68213A531B5C648C537FA2674346FA0B3AB43A7B58B4F83B36D58C506C188DAF72381DE53F83AD4D9E6C6B1F5D689AE24CD158BB2898F06AA28C8FFAB1703871A6A6FE41ABB6B8B9188C90EEF88E7DA3338F119770B31167E3AB541371FF7F98A2D59D3557438DEAD71C96B97F3839F5E28DA6227E5B4", - "0447B9C85642F3F8BEBD1CC7AB0D0E4D07CAFA93A26C75970C8B40443506AF8BB671F30867FE4225F576026F79010AED56CE915AD9AC001447CDCB7CC3846B0E291DE0E9E443984E0ABF7C1C1D2F6D073B0B77116A21C3C0B7F360439D11D2DE370CFF8FF73FFFBABFE4D52BCE58CB32612870B0EA23CDA21E3B6E851B063BC76FBF7BC394A7D3805D45616C6A313C887D2FDC51F065F8F3C05ABCF70F31EA5746A513D2DB3F4F3C61006F19420AA82107AF855649EA5D90ED0A8540D0A2CEC685D18EC8F4508A7D092E52DB2117C233A7BB542B61C26BB92491A88942A506ED60354EC1963ACC189A248E37C9367F3F6FE065EDF6A1205BC80B267C1062BE20950617FE0EB59BF8F1E69982F3E89E7EF85F3319A22A22B8BAA491BE76AC7257A2DF631A98477544E3E57C7D63616D22789968CA5E929B507AC394B6772096CC70B69ACDBADF900D055881FDD209AEF54CE6966767C07EB7A2B40A3410C3417D114FC9E293DA7262171325D8179262B2BF041F5A977E2D648900295B14950EDF245C7EEB663F8292625F804BB839BE3A5510036F7A50288C69F94434A03466701BF1313020A4DC4F87D272FB9D1B7676C195C0B7B4D3C2CC6B20D5C2066C7DE5DFB5C9FAD43D80FA43BA917F200A73F258BF21ED8BF3E39F69E501AB3EB115C9414C82C52CE91F6CAEF4A163E288A6FBAD4FA83477909FBC972E2EE2A5379456105E8EA02F92B0D8F79588E2282D1970C3A033F738011BF273EA65912D3ED09398A7F851BA2D6141F97843E90F5C66B38D71D70DB9D93FAEB07FE1AF5783D71CF50931C282CA8B483D1F2E5DC5AD5FF2B06C4355E46768AE5014A22E7CA26267A1E6CBFAB24C8C436535F23D419819D6D458551EE78AEA4779574BF86DE7960969B0635F0B2996F955D863E078DBF8689C142736BD5177DBFEA3CA8C58871B1FCCBFDFD67BB12AF82C3B8F935CCC507D510CAB63B831721E0ED9C258BA7A3FE245D42DDA1AD8A962847D7C724DD2418F72508FAC194EC43D17533AE522187B44D71B6E993F2CEFC6349141094C8CF935D90F2F238728D29E1F5AA09B46FA7CB651F688A8A06AB97FD2363486F61D3F42B9C015652A53B3CD66372849FD2EBA05CFB5AA28520B01FCBD9C835F98D15FE01C84D7FFBBA4B2DB93E44E4341AE95B8AAA4D59CB88F7E192E89954E22B1B8157FB0B89E3E1E3862BD4C2799F2D8C621064EC9BA1EC30E0F7F5FFD7013A7E1C102DBF01698322992EB05978A5A2878756BEABEDC660DA2D5370A98CA2C0A4C65141EA273EB787B2E7AF646DEF7DA77A93E45C37E69B474D04FBDC3B5982D8492FFC37FDE42385DDFE97A73B8575C1305A0B9AC0B0CE061A423556B6FDADB67D0A5BBA7435929D658FB0869BFFBE5D2FEC96051FE03CB7B0D944304C2D433459A97C43268E43951D4C1708C702FB9C0A0C6D82876057F4D043B21A92FA6D034B1DF5C2B463107AAA814C79022D96D1BD9D33DE5A1FF9E435D9607575856CE4DF5F1E9E90FEF5ACC4AAFBDBE0F982DBFE78C5ABE1D9C85E0452AAD7836D39591411B382BCCE72CA1702A20C9DF384F5BD539F53CEE8B9977AFB705D1D28680D1733BAF5F298282846EFA26B0DD7514422C0EF9088F796B38C15EDF6C8D88009B10CD0D6B4B2FD93679712BEFFC4D1F7A3898AD0CDC61D2FCDC360C66FDFE0AFF0E8A7B26359606CD4F47D28DE115261E6F98F323FBDF3E3046BCC2ACA0831D2BB4DDF1EF443632A229CFE6BBA5179079DC7FA50C56BE7FE5FEA0C5AD09D891895508722861E9EE8568F59616890C6370", - "8DE87744B81A0E21A62CD72148FC3782AB560CE136DC3A07F2D2E143EA0DD2ADAB9FF8AB39B2A3E8858DA593B6EF6C46BB5CFD252F6DE446D9165406B3DD18CAFCCE3DC7A6E6200D8F7591169A6AB9DB6665FB72140A416EF30B75EBABB6C284E73809DE2A3A26C7F4F188FEE0B401E9EFF6DA22EF3DBE0FAA6DDFFB5D8C265D1A1855CF7019D8659062AD7A705362D1510ED5013B96D6EE803E7C6418B05828243496753E8616F4075A08346038E3F3549C0AB1E761790E818C2B531F06805D92FE53D45B9A6FA5E30E3D6A2F467AECA07D29E1E9123247C69220E2B9D4501EE42E5BDAD07F0D092B33A938B8FC0EB7E435713E3E428E87DB24AC570E4EF64840A1B4D43C5026C80F321E537755366B16FAFF2423908FB74E9A5B08F0C1064815472AF48240F1C374F2AAF8ADE55117E0FB1D08AA40C4D8AEF35CE6A91E54A89BBE55BF5E78ED5F66B2FA1E8936342656C63263D4E7ABD70F7899DAC9A315E9508AE65287C6660A7D7F3FF408CD06F3B19E1238E6D5EF040B3E54F4469BEC17198AF3F78F660C6753157603138BC98AA9F01FE79036D4564A7396725E57F875FCDA4EAF80C5E2815862AD52340571A571B331CC8122C13CC58403B22B61BD404C6D94C36FEF187C712B524BAE9EF150A71CE32366AE536B5B94ECFA351EF0DE77E729C42BBB32C7D35F9A5BB29D2D84BFC91F510F9A1C907540AE3A80CB7023AE0635EA5C2EA0548D9D14CE4BDE142436521ED1637C7B7CF6CC1DA5F826B800AC6FFFB83509A81ACE30FD969495313F9E18CE4D8A2E1D5F9C7DA14A0A9D4C4D49BF00B622B6AA07FEBFF0A8B274C297C0B4AD1CBD64BB4941543FB63D9E15059E0C0FD250753B2AA664A677780C39A013E1AA6B8F786D677755ADA03E51ED55F936FFA1ABD0430DA8750575C37D1EEADEC5E17148DB9FA202F8748B0611EBB5015F1D26C0D810F1AA5A40D73C32C269EBA5CDA134267231FC3783D3D4CC639E567681275F423439A29118C6A0C1B07D08416537D4707E9CA3FCD3494F64B69E2AE9EDD0079CD428CEB8A00BE0FC9A791FE2DCFC10D7F813315E964828A4DCC2A2D42EB313CCF192F32AA9A17C984E0D3CF3A0BD86E0B751B30C096F5F0B08A0BC439294D2BE2CB387648F8119D8820D39F17C6AEC976A0B8C89C76D12AFF73059B49EE856B2591E8D2E817DC43793F20B2AFBBD49FD9A05F5B4CB69165420AB96F26A46861AD9423F7DAE8829FD392799EF967E1270563BCF3D46025CDBBAFD15DC23F33EE5B621DF6A12263CC0A506A5E9AB191F896D13382B3BC2D536442A62B09F3C2C2252D0BE377CFBD59097259ED243EFB36C9AC0AB01B3AADD502DAACCE17A49CC82FC9ADF67B4EDE81D9355CD8295DE21468FAAA25036B2DB6E24A3AF3E5FE59324867658EAD5198C47D362EF64B71179D107DA748F00400F15167E84B62588F6D81FA4B68A59A24BB3D27167D0720718BD24EE556FB72113FCBD37831251DCD538F6815382E119355CF3490DF0AD552ECAE0D00462C10CBA4011E95C7FEC968AF6E39E1FD15D1026879202C57E2CF7AB02B08B15373C13435D8A55ED6B9BDD98FCD5B4539428D90A2C73D37DB112D2025EC8A4AC8EB82C51C46FACE88AC0E1F161705801C781EA07F6914122E5DD6BFFA3812EE44E314BC09B785B344584AA8522B63FB34BAD2122F9FEE1245E6DC837DB032387EFF5036A021C8112CDF03BEEFD89EEFE1BB88A132CAE9E1E9EED3A855B364F2A4A2F81086172FEBC64614BC04D11E74AF00F54AF6B5D85EE4773644C3FA768532B1821EC6E5C", - "0D1FA0561DE4DECF411AB73FF48D0810AA2149FE5F3C22E62E06C02F60189AB5690A991CB88DFA5C4FBED745FCFD63BE3ECD9CC599E35B5FA31AA11C62F3A33796A64EDD0B64F2E51E75C2481D3EC9DDF07DADB71448BB336C0DA9DBCD897F777E3C9DD97C7EBB08827C19316F61420D96F3D94EC395F8BF88F5927C71397F6C24901914826B1BE26E14FE93EED37141109CCD00C92772B96D9EFD74B3EAD3903854801B22DC3F98232023E1F9CDFD4B4C952A6D268DF9FD3FA83C707941F8F1ACDC195AD66E7AF48D7B06C62F3204E8D03D2C92920C589CC56A5C2B0A1F10401BBF747B60B9D2179BF9CD7DDF50B10823372CC4E24005D73B4C5AB918F22918B16D98F15C365FE69786C1ADE9FAD71516E389938D5D38420FC79F82C6C0AB1C6D93D1896FE8A2BEBA134C138EB1FB00115E50A8A676B9D9939E7375F4B7D62D449EB341B0C03EE3FB18564DA3CF64261055594E0F8D322EAA9B56B5328574AB323C4376464F3C27786DF7026BFD6C7757BAEDE7887217A2D3EA22AF7D6809BFE4985EDB32ED503C6034FECE55F4379920C73A515C7390B3405ABCC54F51F686903D5354468AC566D5A03C5AB536934A6CE698E06B9E2C815B15B4F8A1857FE7C0B5486759B150F48AE9745AFBCE856830078EFD7F4CB4A463587B7DDACC79FC9FBD9C2A0351D91DDF27A65CC79005DD24F1C26252BEB8C3F1D69DF79D386401EC5AD57BF2129D1E828D6D57CABEA84C7F77B16B919653C12AA7F770741E4AC11F0AD08507C3E7C4716F14F14C548A88DC4047EA96CF96BC0CF786EF7D02424314BC846682109A2F80044B51B12A0350DB9FE06E72581EE874665B9680EC118C86DB575F9E5F687CF35DB3CA83475051AFDABDC974B2991B47BEB4CB967E3CF20D2B7CA2BB50825EE33FBD7C6E87095DE8E36CA6143F673A8C18882D89F22C08971CC709F1518169123EE59EF50846C95C313F14F9472D4CCB8EB71301488901F27E895B5D44420F91D123E3EF5527121B9B0C9536CC3D4E5EA03F63BA8FED0FDF593AABC3E768962DA165CCACE066ED7D6E46DAE97EA08789C36BD3CA6888229D15714302A39EE4F39DB0751F0E99877237524ED8EAC5F7EE2CC40A69408DC43E2AD88A661D7E443D7E99A14484E3011A41912E2AD4F6B7D62D8D9F3332F79A5FE1E16E8064C91DE56B1F89A9A3A220165872128771745D086DD3F8DDB2C35AAF3DC6DA70684DF270ED50D188FAE62CE4C98B9019D308772EF036F9FB2775137377CE61529A40E03B388CFDA3BAD55FD62D7ECAC2A72FB68068BE08383CC36FB66CC252A0412CFB3C993803C038A1828E8893DB453D47C5727CF8BF80850346063AF4976610F984ACCA00BB5963D5DFD018E0790F4A6B14A9B5FB9517783EC1F16773C49A744D8576F7957D4CD4C4E35D1BD580FC76E2632D47661A6838344CCF6476BB793FB12F92143524E5A01DD5294B6528C5A18B24B0B75D017C4DB3663BCD561AA8F27E510A7C031ABD3708385B03294E3BD1A695C573701B9D4F60232DF767439E252B7DB10D4E3FACAC8C2E8D16F9500828826EA807C2C7C48C0EE8457E757854C1540EFE9BDCE7C09AF5BE09AEA54A4BB0D2A328092F3B8741A128D4BF588384A3848A5E4F55DACFA64F7FE081366330D16589991C52A1BB782364AE969E8A21260518662B00EDB117278170CA2C0D186B173F93879F6F702E03DE768CFEA1E39FF8453C7B3AB46E83FC90FC56D0EC0847DF16A4BF1ECBFE29D94CCBD49DABDCC5FB81B62A2CDE7D2DA3E67042944F33A007096DE5C79133C7F4", - "C9FCF7D2DCE0A2341FBEAAFA64F6A50A93F3FAE3B55EB70ABF51A4C001E15A8C78DE54E50CCAEFF8C2421079F7333541018D5EB8045C3AE0F0489D13C593EED560CDACDAEA39BB49FE2FD9C956197967830A0886182D98B5051080DE887638F2E3E626B8941A58D2206B46FB410C155B94FD7D15956EAEC9F855B96A8F1C7202EE600C12DBAFC6E3DE5F075B05AFC037847BB521D1D3638135591B6E1A0137CA74E27ADA3FD673684A8A1330DFA46D449F8B63FF90E36881C09FAEDF61672AC32CBBF71F34367E7547C13BF08C4B688A397DD4D00D8B19212F85EF11C0FEA19C890D73DCAE9B532CAB7BB5931B2F648072F35FAA31C6A77FAF3F72F9F57D5AE65BBC7DFF1C2A5A2A2721AD5B50DBDA2CEBA27A3864A6628F24B0D24FC2450890E278C4599C1015C2B4AE61F2DB2A3A85F02882DCB57A7A471B5F8E51DDC284E0C1869D41EF25E260EDC53AF55BE8217FEADE6C74B9C0EAE7C3417156D671577E05A63E03052663F420B70E99DE068971C5CB8D9055864460D6B2C269E4E5D2585BB7A08E28B15851C6E8438EBC1272D517A076C08631A9890F4FB627D05B91ED2164355D7F20B32498E4773FFFD17F3B15E7F2BAF5EBDC98E617A7437BCF94B0EA1B2FD6F98F8BE6D64F769FEA28A5FED9DBF4B3700BFA8C0495772A14254D7AD9525B6ECDC028C43EEEBF91D2B17C9ADDC071CCC83EFC6401A22846500E0CCD3D4E5184A05AECBD92808AD2DA42C57621C66142784692D4F28662A2B37DA4D3CAE332A97D465D3E492ACC964AED603058CB6BA6972C83C2906CFCC813C0603B775E2DE8BC946DAFA510532CEFF2B2FC5E1F25540FA07B577003D67F8A3C63E9BC2B89EC7AEDD8C2E91CA426398BEC4D98FB6233832BCAB8F10E5DE6668F7DF8FE10AC0EA63B7D46837EE4D1D203D54615042203552430DB97C24FE0088334BA154FB2157DD2D12715ABC6D329A819A1A664727F40CC26204949926E78B0BB8947FDA9026813FCF19795F8BFF2F56DB70DB7EA9280A6C504134A1B653D336101A9C166883599477DB557406FAD495BA31B488D9EDEB783759EDA32968AE4B4B96A14C9DA960ECEF511D4102E1EC27E17AF2746DFEA54F42D2133281ECA9F5CA87F8A2DE4C937B5F9526591A583DD3211F78871BBEDDE79206F946B9CEC6EBD0DA4A25AF259E4B3EC2195578C74B7DF87963BF561D7F4C6755D4DB0F288341D5E525B15F2BDA314DA38D2B2C7CD7D64F6DE35EE782A076333941FC3505AEB1FA5783C6C2553D73AFD6AF896A5C2E1C15EDDC408B6D9D7EE2E7E9F706C2A6CDE36A41BFF88960612C46996A9E7D43511302F925351240B5B77A7183C45A1B66C8FCD34EB6EBF5F5FFEAC8441BD1103D2151689BFCF8D4E29B9C39B1BE4972186B099C2C35572DB1BE2A28D751D6857B7E4EF181B786C2A6FFA30A5D6E2E1120E7B1F313302ADD1012E43EC24E5E5B5D03950E009272452ADEB9DB626FF38F335A520B12CD981636BCFB882FC06B440E348512E6ACF980A1ECF360E33DCADFFF5A2B413DD214D5AD1070E88B63FC9765295BBC92C557F3AAAB6AEB293249761F95EE4338243D35AF883AC33832155AC758ED05AA1BFFF0E9FD58E03384704DA5A9237F1AAF52E12C821BB0F54C0820AF8124AE6D0F4BFECDA6500995B2B61ECB0628BFE2A9E6A05DC94A781137522E85A3BEF28B76E49B27BD05C113C9B3A9AB1285BFD926D65BCCD5CC3837490B21527A1E94544C4ACED0352BC84D378625E3655F74B039CD681D98579A190AB2B89104C83F46235757D2D22FEEF59A250B564", - "48116D6CCE73D8BD1E1F45D9676B031D9B0E65684FB88A83D791CE8F5278D33EA9D3A6ADF04F29AE93123376D1CEF52F27E875EC0024A888E688EE2A21A4AAD0448103569C8A7CB2FB072E3D0D09115AD8A1C234F7765E77042156AACC4D4A8AC697E41B71F436ABA09C91E9E4F2C5B573CB1D0B291F915BF922FC75E6FC6AE332B42D7E51BA8EFB1CCA66EC849099834E48C7F79BC16C79B0C87A8EAC8F88D30EEE8FC0EEF8C89520E2602A7226BFAC0E8B30A117B718875687F81A6125D09EB3BD2B2F5209C386DEC5AFF7DA0FF5454FF0451F825E5AC55680EC7DEC56E72CAB953E5B822E0A1D95F3F948E95DA7078C850C43AF46B4EFEEAD6AF807CCFEB1B61CFCEFB770D1923B41BB354C81F340CFD851EDFD537C373CB9F29303A988635C5CD37AFA576D6E8A8C2B7C56DE2FD49E5DB970B50E04436B1F8B22A6DCEE3BC27EE1885CEEA23E12541554EB2EFE615A140831DE6C555804432CAC0A73DC2EE5CEC8ED139ABCA4D17B22BCBE60F05F5D7F526ECB29A51ED6ABB4DE4A2865AD1AEA64041EB0F505BE3CB8F351BA21A8D941902BA565039EFEEAFB87DC6DECEC1C091ACE228931A147C491C11169AC87884D5EE9DF128C98A084CC6EA0A50D494FF8E0B902A9EAA4B4F9D3BB2BA1FFD3DCC93C45133B9008E2B188F57A82B5DC01862D35F633CD6CC3FC12BD6F3A20C1EEE1F9018E41027788950DF09C4B482837677B33B15CE24EFE6797291C0DE291AC04F04AF975703BEFD3CB8E59C1496E547285E3F7A29F99C5F210327CB328B8A3094DB7C27CF7FA077791160A2287F44F92BA6F5346E48D4D4AE6C2C7185926526719537AAD530EEB3B0B4CD718C7BA38BDBA21671ECCE0AB4044B797B7D10797EB1BAA024B76D0B82BF25C94655545227B46DB2A038F87301BCBECE0C99A98AA5BCB648DE58B6CD59AC6471462BF5985C595B00A4DDF2948A84203890E2989D8DFC9864392E7E75262DF1CB78C1E2872CFCD22D561F8788F42A0323CDF3EE1588EFF2F7BEDACF5AF710CC7C6F9957D992A7FE39DB696DA414AC36CBDC99AF050023597734D94C2A8FCBF41D6004C21E4F4357C19ED09488797CA012F4BEF8F1743E396236E708D96A7DAAB07FE03D5483319241CB35F66F66D99D981DB4427C4C84A9EA24AEE4F7C4E023E0ED2FEDF59FEB6D8AC0FE87DD42580F7B0CC6339752230A69BE83AE13FC12AD4719D45CAEAC6E8695F6F403A0713ED37DC120B80DE82F7AC4991B4B9DADB31A304E16D03251CA140659CBF99E891DCBB764293A967DE1E96848B8F225D2F9D28EC2F428AFEBFB57AB79B126E6FC3D66102E3813347D7CDA5499F6AA5BA6AB5EA6F3A82D730EDF3FF74B9BC0F954BED21E77146A5591941962C49F6B2BEBD060A9C82D8FC780FB3AED527D40CC426988F042841250B4A85A3F3501FA3436103313C3C4CDEA772B6C840DB866B9730798B69D6AE12D24E4DDF31FA9B4C8DECF6CBCEA2E8A0F9CC67CCDCB64523725972D81ED2E6562283DE99297458452B94467B83F3111CBFF61006814CCB6550D19A1EC026996695D46C31BFA9BD371CCDF1B512C61CE7BDFBE419B477DAB1E7E1D012DA4BDB05F4C4CD39511D5071C0982F68D9C6F558D22940D541A3C67003D05306FFC070C2131832F737872114566ADF3074F7F6274AEF9B894D0AAD5ED60998A0363B92D841F4A441C39965FC1479E93C99B083CDE6CD6CB9E26D49E16B969A357E28A61B444AB0FA665B853FC89B64E02BB02C5273CC948B00041701459408C95E4BE49EDC7CB605BD2DF31C3C8BB2AA9FC780", - "840BCC55474C2F66B7E16C6F527695D367F70F570B13C1ACB546D8439A1AE06F362C224FBD86441D82430A345B8458EB666BC93739E3D679754117C95100E8F00879B891C9E03788543C415AA964C3F861916BD7C141777A93B374943CC4CEDF928AEA3EB72F412DD8256227D7D7244E876955B13FB2EAD1C3980AF6F8F36B3E71FE3B189F8DC22C55E3720DA11C6AC4328DCF670CF948123FC7280D6891EEB356C195D2A79326299A684F5D68DC0ACF00B780CDCEFCD7CBE4140FB5B6DF896883D3C6FFC42BAA41E6A75713F8861C18A833C688C2BF6EED7F0CE66242B8196C7C254F9D48FD56AE5ADA9105A5C4AF28D0042E059A90979C6439BF6D498991CF64C68080B9B5392CC9FCA4397647A9AAC42C3810FA33BCF31C89A641D1078A0822D93EB773F418B9B3B20D5FEEE1067766AC561525F88F8F097BED0CBFF5BC498CDFC9A5B9D20F4D4A03CA190563CE543B2EAFD8DC6E4A5885DEA120DA7D157D00EB1329E500D41C7E6BD603E95BFAE227A9B613A71C7BEFC8449B668C59147E1DD5411CBD967CBBD46A9DDD76C547506A54A8245532FF9AA5312607F1AB99F4F9BCF85D93B58D76C5583856595AF5CA1AAC07C945400B35885071802620855E18E0A3B1EE92BB95241EFCAD82B3435BBB8916C4866471BD5715882F6BE508C7648A59B2AA91A69F60C78482197C04B31759054FFDAA254A143021E37874DE407690B9ECF8DB99CC16B004116F51DC7853370BD3538E14A0F02E7BF74D66FF898AEE93BF0697EB6E8E62B95C6C525A03E1A89CC2F56BAC591FA81BF6A1B3B9F1259F13AB45F2E9B0D93DA7B4984A9C71272CA261CC4EE4A44FBA4CD03C75D216672C18A60183A52B28796B356EC498F4926D833D94007E92EC190E9713354C7506BEA6B7B5DB2BE659E2A5BA92D00C01611347F67971478F2C71648E33F99EF201367CA3AC8814DE0F83B0BAFF34A192349C5DE87453167820C0EB0AC8349ECA683111776980FEBDC993314278B37B289B528DB319CF59B09B83342C71FD5E9F13EDF4F18783FF328BC67A03F1F62FD1A4631AFD76363DB1A79CD1EA95FD43934955AE211E00EF5AFC114BE00EAE2A7AB63042992E086810E61AEE3CE5CB0FE75C04969485899D552AD4B006D543BEB93C1E8578168C66667D62CBCB56F98DFBA248EECD891F9936382087F2AAD6F83FFE25E77F8BAB9C62675D4024E9BDCA5581126BD1ED6035994029BB54615E593D4CA81B31A5AE8CBEF8E1A81C32698FB7B4A339A7E4E575460F79C4F4C5F57F9E8DB459177067869E03E2E1681004EBBF62B4F60A9EFFE47921AD22C7236F25438AF46885E120825509D1E28652361EAC64AF1806317416E5550A39AA8DAE2C6B970D44F4F38D571F67E304AA57BA435C4E06CC97C848422216BA778B2736C30200527960A66D63280AF7DC691F9D0540AA47F0D26416B46A6D53B0B93F1B7C3D4DA8BF8AD2FE410ADDE00B0372E9E830C09B206A08D968AF2F716DD04D220E619FDE28FE70286E7EB9C2068F7A37413BD9E65F1B59C331D45AE914731A564D33875A0939A2185348C197CD14DAC59C5E2BEF09876353FB16D849EE67A774B05C51AA2480F18DE40051654DD2C7B9E3B753FEE5696B10BE40BFFE89487DA1E8B1C2000D53B2A98B4DE6C9DAF07F0B4DB72834361E520E45F5E958FE0760F229C16CCFE0BDBF07E186B28AA69231DDA8378DD6338A94D23541B9D8B63B85962C6304E1ACE2B56A3E433F7E9B2A88FBAD5FC71703231D38DFA8C378E15B6503A3B9959E1759EECCBFF14AA09E6BB8F2CC", - "152004D3334E877FE21F773408369872718CDEE15BD489D97F606779A9A38398524E6560260980FABCF179ED91D699D52592AFB3269FFB8DED36AFE7DC79DB773DBA560E3ADF8E12FB8A08EB56BFC4692BEA05AA288012B580E43BE085CE583E9C9DC18A9D32567EA950D8165A2F8A443E7AB5E79F687690A8D8D92FBF877C5B84D26E6FCB3671073BD808A7E908130A845C95A2F5E360645611B4B55B03169CC1F50AE2FFFAAF50FED8CB782BF3C67775B613CF82A2D102199E49A329496C0FA24AAF6370A3636EAFEB992C663C308AD181DC308D81FFD713505916300732FB1F8DCE238CC4104D26C588F28FE7EE4F2B8C2024357D52C7AA29D339249086CB2202DC1C847210EAEBD3F06A39642711B4608638564B0DD2BFDF38CD79CC1CFCE1226CA835E6EE19E4089A6F18E7ECC3597CAD3FFFE13A5F77A58C2B079DA25B928396FFAEE81FBD9C6243CE0EB0872A187E6CF99F16B1511672821D11EF88884964BAC6686C2A7732035493FB9765B7A51E845C1C79FABD99438FD84C09642FBC7CF1740DEB012AD050F5E8FF03E859E85C51D2E87AC41185C67C33820EFFCF2D79D384B11B44A806ABB8247AF36E3972222C805EB9854D9FCCDC7E58A101A5239E60CF4836C38A6ADE67686E6487547933859D46D046BFC15AE95B8D0A42A57C401EBE78ABF495EB390B8922C97270C790C2FAB9849ADE48EA8F4F7C6996F6DB661500199BCFE1EAFA1ECCFAB1F674E0BEB1D03319E73126D7191A64A80FCBBB06B1CFB718275BDDB571E8F53FAF81DBBC0522263FCDFB537B3BE9078F2AD449423152BB9DCCEEE97003D1988540FAE39CAB62593A9EC909489415EEF4229358229BDDD45CC35EBDBA088C4BA097BB0E28814BF5048F4F64E6A587B0BDAAA8A1B3E3E69D3D7B6782FC42474773C61DE12B4C6F183F9E625E337EFDC97A79A5D2C0C939FA668F440688F7A3E0E28A33D36D331069294DBA8BF768010AD93A224E28964A780304F59B7994D972832728249934B5347580C16BCDBE9F84EB34EA7F7645635437B0F5422E3DA99EC2D53B22B1A55BC783CE86CC6B1BE7B11F837CF2BD09A514B12ED7CF0AFC2F70F1D6D08288524263B1129135D664A48B0596C4E880E4E01BA3889014C07ED1B7F172AB4F4A69FC8C04F0ACE8AD1329A4FB594E9EA30EFEF31BBE418CB5515CFF8A375CBE58515B32E799E8449101093A053EC99F9CF78122FA2D36DDFBD258EC81D7B4D18BF882663CBF24D2A35A93C00AE8EA81A3B0E8040C1E259515156D67DC76602924BA51507C4994221A3B1CAD674BECB11574212EBCCFDCAF6AFEE288BCE11B7FFF1D7191AB329B04A237F75B204634676932FB0842E2AB888E7D5A4A6B7F77EA04ABF4B9A567E5DA5267F35CBBC928B5F607E9C08359F0031A934152D77E65C937181C92EF4CF17F6EA45171DEBAB545755795097766318CB132ACD96CDD65777F41BA127CF251A4E9B3348927757A42AD8FA83F6CE7342D935CB54984E45886D888627F0228E50082B85E8E9DDBECAAF049C25C4D7B2EA919716271500D81EDF574C5AE91E5F0FAD7585EF69C5051473AF913F887B31BD730F67B4A44081BBD567B57C061AF465237374E0BF4753F3C6CA28D45220CCA3EE6F07F93A29982EB5AAD70763ACBFBE55015D1C52B64954D4855ABCC319DDCAEE75CDFE3B3C31C329A77C76131F18F3C3904B3EA4E691C03C32CA5E7A1F9460760231473115B5AB7E159013C96AE4885566065883CA3B9661C6773B77819BC68755D529FCE05E80E08A5097EB37BDDC1AF9BDFCD0A04", - "0D4897E7FB496EF0C6D62C034088E7E9B8DB52F232CDC9EA88429655ABE366C54CD534DC9038F45AC0D0362E31086CA2FC0FCAC3FE71B2D4EEE548F69CE4433601CD3431D01BA6F0C23D612807EB8E50BFCA736D917F67DD72631BEE8728006D2AE69D1A1BAEA8DE50852CEBF7491FFF989C37A54EAE31652230A0D3E4397B051222C4A22BF481BC52E2012188C7576A7ACE81185C85A2E841119B47B5429DF277A976F15D5652156445905EC797729A6647E1B593484ACF2724E81786A0C062DE87759E82202A561FD077D64FDD3226A1E290F660722040EC7AD4383431E195412DBAD0AE620BFE808D65D3937AC9C5AEFD6FA106C88A6B192D4FEC1FB1A06907B0796F724AAC6A5EFEBF50C168F990BDBD6B1D23E098858C07E8D2144532AFE040E45B25AD9AF7D92F9DCCBFF3DF25DF574A4B65A219289407EB63FF7152BF1E651C6F124BE32545B50E8E2CE37F1042A68A62AB70D9DB540D2B39293E008EBAA632B85EF1052FDA17A07B9B1D89A76FF7E7EDEB7090496855B29A9174780D504F7228F8B7436F4676F51975BCA614554FE6B3F946F5E0D1016371F9CEED4521477CE8E9CD0668643686D8482CEC0BB4D6A9E8678B1835F0952E2700FE0C85A8683DA91638D81A85231CA4C7B55C0C0DA57DE5E6553F22290CE7EE72867285D096C0FC16A60A664C6BAB048939FF9DA476024235DDDBF7F264C90ED44E953C4AC0FB50362FB2CB4C4FC2097F07B71772000D2C2A5DBDF0B6FB83B1BBD70CE9D6A8BF1F924AAC4DAEB6AADD891A8974C9BF46FC6038F6B77D6AC0D6107AE6AF5B93B186253AFFFD8CD21835097C4B764F3E0B2447776549D5045E4346FCD3B7880F1B3BA794ADD6B7F291D3534DF034F822D0A41DB2AF9F1E51F212D5631D2525B1804A75B50D8372B6A1C200B81AC1122AA3C13D7463C383FD123DF4029BDAF6C227B3C4B54F75C5315FE139F6A0A3E2E819D3062B3309E2630EE4A64D1E3DBF23B489B96E198BA98D8D3347217A5FDE4DE453012E8564BAEFBE3939E59C0A725A75CEDE373501F9103011FE0EAA40C583AC73C92F47BD528600C42E0029FB3A4F03A3CCE87E5AAF4FCCB47EA8BC62E0F542DBD455F7163A2A8803583896E3C803C0D01846EBD8BB1B3FD396A7C7BC3F72A9D0503C44FE30E5E77E0FC8B373EE931CBF4A9867406BC91972B946B9ADE62415CE2FFC71C2E64DEB7E6205D635977C778BC40C11E36BFC22A17FE641346C74DADD255D329AEFC2CE5B4AC5B195FE2DB453F1B41B3334D5C480BBF10FDE88C722091ABC85667F2B52A3505A142E4D1546CC41E154B345E8456B9CD0E241D70EB4876A70623DFF3FF43A8D66EF60488A7860485A8E518AF4A7056CD02C72E1BAEA3944781642A36932ABFAEE3B88B57B213F9B358CC3F05154DF8D2132A74DF27556DB6C5E45256481C09D18DA604CB91E6AB7AA29C0C1009A406F1B3AAE268564E04B07E4E9128FF02513AB8A8665BFE1E352F46DBDE7870EE027A6E84560014659888EB6AACF993D7C9F9FBC2974CAE290059802F5D224520CE445C404A2ECC57CE6FD5961EB20DC12D436F0B93614CFC844B476D449416F54459BAD09F886CE3C1C307A91E62FC736051E6F6F8F5AD3372398458299EFDC1809997FAAAFDE14B15566B381714E3522F629A5ED9DDA1EF4B9D4498DD55F8B0A48ABB2F9B1FCBD991B5465108147BB6125FFEA6B6D479DB6A9983A51C041375B39FE6546AB5B5E089DD7E228D5AB17127A3A1E3AE82A31E952E660F72A1F399ADEB4E1E11C390BB8652F2F7B6D05E9F4B6FC90", - "AF6D254288BF564C4663014C7A70EB3739D28F1F17B8627FDF714E85B48EEFEB1FD456546328BF2E2EED112992AF78911A89E1248AEBF1F79906EA91D41CAFC6E541D2BB40A7050C5AE4B66547C9DDA88590AB8B0A4B01B5F8216447A310D1E52C155F92659835F1086D381F1F2995138856DEC6FF59380FD6C1B6EEA6E4061930CEF7217701DDFE17742721794DE824377392AF3D949ED9B0455C58F7395DE0FDA5485E310E8457A4270D603BA5AD1854811530FB7178525F4BB1E5DFF89F6FFE0C83C3E47E244D8F3F8AAD8374E3FDF996060E18D2A5397192823681CE6DA561816C0EEC0C0600732A37731ED13948439E8961BE44D32A3097C1AA5E19876ACD21DF812265181774580A8C04ED4FD1DE2FD5A1DFF9DCDF4D97C448BF9A4DACC22D4A55F588C87CCF5C9E178A8FFA032A454908BBE41E13D829FA98C066A7736577CDEFC6D5441656D0AC95C872861BCE0A28C2ED6E9420D4D167F37F96087F9E761F38B882CD41521DE8E2C40564C0E001EDBC04982669B82F05CD0411A6BADDCB704B545FCB19A286BFFAF0FB6DC889BCE75C5763BE1D70DCAD1D39F395A75E637E0663F3D5A855F53F700AF5F82124E72CC2A4E41A4B43FCBA41E55298A1B799368BD5F9B507FB11E8BD2D80FE517A5FA935006064278CDDC5EED43B7C2D309BECCCBB2C0AE3B8D09509315933E2DF91304B1DD3777EC9FA2415F7D18A96CD08095A30F7EB9BC12F8739E409EE7DC062703CB3EA591531F47F5D1C0431E9F1883C3BA249492EE619719C8B3BDFC1DECF7E3C4CE4CE032FB2882247D1D54566E3819464837C248D35647D273A87F8BE667760D26A7EA1FFA682A931A4D35F7407FBBBAD725BEA62449623AADE97A2789F2F8642F1CE12A06C93861DE9D27C5ACE0E4ECE40B58664176113ED6437B8AC8B4059653EA30F71A023544BFFA685343E278129DA12EEAADBDD5AB0E2CCA0B840E87AF0D0E859449893276B9B5894EB0C57C3222E01E7538FF7E91807C10CDB465A12CCD358151D96856C6143C9F8D25AF8E8086C83D4CAE37BD660D15C0C0707691E8366C4AFE6DC0AE1BFECEF9BEF46CFEA3356A3155E027D1C921ECB852BA4B8FE8E0C8C00829CEE4049A21A1C3424D2BE532B735232D12B81C3C9E5B02294701E6BCBC8607F2AFCFB2DD9B1142B4D261418C1B239B0B22451D7D3AC64636B0C7F96B41D7E775C1CFA2E277C957F0D59BD1FB02226A462533850E99E917E310A684E81634F3876D6AB32CB5B8FAE9E82224BD2A17A7C72CDACDC6B3438A083A6B0DB9FD91E05BF4C83A36916EF35C5D4871E94B1671493FDBC497BFA30328DD24D340A07A960828A855FA95EE33FE4FCD15B14B7929D338611239AC34CFDA6503E4DD9570EC339CFDC8D1C3D3536F5176901D012BABB133EBB4560484344E044F86A77C21183C82BB2B6632CF69F5A661C98EFDE5529F8FB965DCC6AF185CA8CDB4D01C5E8902966B063B8D1724AD18DAE495AD47416B61321DEEBF782EF7A6ADE3CD0D5B9ECA84DB5D50C2E5C7D8B8DB9E0F398376CDE3D7E8DC46F0D77D38D6CF6055D6D074CBA92A27C6F9018CAE87C97F1B3ACCEE495ED9DCE46DF4FA5255DB2C7F2669F5201058E90F7567672162E17D5B6D028C6AD23F2AEBA32061E6B33EA86915FAFA2344CC58162C032CE837D5C32F5993013314BD261DE6EBB35B94B8F690C5624A8CF5509BF50D3AF5FDAD77311B6D6F9398213AC1A267CAA0F52A262DA4F85F5ADC79947D2C5128B8E0B0C41B9FDEEF6AEC228EF97762CDBDB78273C16C39E446576D54A4FD0", - "4B7593A9ED7897766CACD515D3A55959FF99C1CE28A745DEC1D8F2565F24F4A1E14E9083AFF510F106D982A2911197338499CBE38CDF3D99463B13EE26B47D26A62CE45EAAA04A3E70850D5F23470FB94C42D3235D5FF9E6C37CEE8C93591CB69E0735B03EB262CE6BE6F0144DFD66BC089B36D66287EA588C78E39D9B6907EFE85C1211612952CF13C369C2AB3D921E4630ACC75F2AE99014776B26CD1F296F736A4616FF662D5C6E18C4EDA6D1791A71BE969556FF11E1192D3941F8020D2C731403ACD856A3AEE6ED7F23023BAD7BF138C702B6449E2601042D7990ADB988B650AE202F3433CF26EE132A7CB13650E86A6DBA6F7FA53B2354DEBF1268734D7120F721E18FEED2F93C268A2D3EA012F3D7F68DB0B18A5CDEBE13CE4A05683947DD985D4AED1E192FBD2719755846C9B758FC8FF28B9999D07E634645064C2C9DB4CFE50BB8A030B60F43AFBD588EC17102F614D3029FA811457568D7726C651C062391A2EC2843A95A3A48AF58A898BB65FB852F73E9A82C6AA9D406D80C072A3B426D8EBF261BF7AE0E9DC0C6DE9F4BEE880D775783F910AF19DFD8EC2656213FB9B74EEBD8E1BF860E4650D446683B7794086ECE1E2AA723024C219E3DCB371624C6D721BB60C797003D89096BA0F489D1CA60C57AD907BFC8E97F4E057B6D709414FB0A302D3057FB4635F70BB6A32CFD842DCD8D9C9D45FE082B3746951A862EA870D903382C138425DF936A505120D93FABB8F523C1D3946B85425FB338CA7DC4B2FB6512F0C8A67FA47A416284EAA943E1A9C0607A02D27F55F1DF2EB6090F94B64076FC2D3D3B3694DA5C7EB2A180DEA14AEC21156E1110DF75616685FD53C72252FB87E7D19EF5AE8D9E129D0984A06520C789DE22CBF6E2271801691E0C3CC672F6865A41559910D0279AB9E0112E66B2A1C2B22B6679CF70E3FF870084562ADB36F532E64D44C7264E44D488076F7714A1089526118D4655FFE16B02D803AC2601493CEC3AB27878CE95ED3F321913217DE12B8E5E8FB75A85707EAF6F1FF08CC86B91632ABC7CDC42D1C5D0F2F49D5F412B4AD0C5C46CFA74643C9333C5F3558DC3ABDBCBE23A3573146D648D540116136F3F29E42FF07E26C1504E47FCAD1FDAE63357E421E46440424921404ED02FD4BFA2FDE68CBE6CE49E4E120C141013DF5C0BDF776EE36FD5899C0FC057DAE2C9DAEF6D37BF8E85258BB36B54ED8374BDDD49B6AC2C8BF3105A194F76DD512336EAAFC7BD2054AF6A9606517DE03AF445CCA5FA65307D2E116E42A3676EB6033AA17D76A87F52D144CE25E3A8DAFD3E044289C4600BFAA9CCD963D14A19C5911C3DE649439440D11A21154EF25649F7DA295E0FDAE8C48351BC005C011A10D201B3062492A7CC933AB5D854B26232B7091CD0B7AA3135F28E3AE75E267C223C5E03B60FAC1BF78123C5AF76719191CB6BA277A5BE81E64117AB344D92837B6D600F36702F4BB4532C5EB1C9BAD8A111C540F52A225DACFAB37641898B1FF770A523F8BC8BB0DADB59235DE055810396F1993539A9CAAB622389607DCDFDD51FB67CBE89F0F868DB4D27A7A38542A076D158919DCB621BD325F23AA0DF694C444206FD42192FE7F9A05743CD54D8F111676AC35A3230E372A5A6D7E213C4584EEA1A4993067FD28DF6690BE9D3E94AC06BCF89BF1AA47496F8F6A18524187BE80D59A4E80193CFD757B706AD483A916AFBE2A56E0A69F3B1BBF9F4B239D05C6C556A8D22B00E9BB1FDAA620D949ECDE86EAA299BE93A7884C99FA782F2BB3BEEE86046489B3B8A5930", - "71BB1B2E833793D854F8A9A81E6A6947057B9571F2BA99380DDB25D878D6B48F09ED7DBFACE92B6B82F413E038128F6128AF3BC467E9A4DF2861DAAC674B6D948A10F28F7D43657FEE26577AF438A2F4422186930702EBC6C9173E661D59CE7594DF95B861F9D12EB060FCD3BA43159C9A1BDC1EF13E04893E411267331588CF4831978469FF569C1A738C54001BB5CF4FABD289075A165EDE0A58F6CF6D215D306A7840CBECD0E87E3AD186F7A67A967373551E13D2956E5C578A7F5BD50E2D570F9B914848D46A640913EBED2E2ABFB86916BC34EEB3E8A671AD771F6D3780B6FEC143E26F53B02977255314BAE9A2CD9E5BA2B49C73226FDC724A859F8BAD3A9FACA1B0E5F2DFE7E1E45DB6D4BE2B76535A817F94594A4541C01BB62AA83A690B6D84FC13B632972C61D940F2C9D32837413AF8E42045ECA3072CD044B2183400CE63C418879D13FD281A8D0835256DDD2BC3C9750C1D44CF1037FD7264B7716398FCF1D31CFFD0B7C52C6370E4CE6FC163B40436490A757465B20B8890C3B5C0AFB971ABFD01796569E3BC73C13D1E4B1FBC1CDCE59D21B6B110272E5770C589603FE67779A49AD0EC66910A2BF4D8C8ECC18A32EF92F502126A5DC3DE618233B9914A9608B2F17E5161115D9A3BEF1D5701A9D465A1437DE24371C9179800CB5728A7F3D734A2A706BC64D356BDF591389970B6CC139AC510A98E3C75F20120450CE45373AAEA6A279BBD17221BCD32ECF82C11B4C1CEE0A44792CF56978D3D2399F7ECDE9F8D9217F8BA22770E210D0F1AA852178B872E296762873765A73DEC08873C04ED69C995C5751B97DEC23B94CA674FE3F66211317B074D8203EC530A20B6E6DD21AB55895BEE1CBD0876183D652F4A0D2EFC95749F8F192F860BEA534598FD709B396C209CEAE4D9190980733E7E98C8ABE52A53C68D86053B56BA6FCAB5C827292D729CB8BFD1FC8CAFCDE15E4527B604018F28AA16C1E913F55461AF87C9A7BE1A742002E52B3A14EC30B259DDE7BB892CEAF77D25B7670B339B334878F697C00CE6740117AE7C67DF3F8A7BEAC89D4872682C47F368F835AFD7ECF0D8471AD01468B7BBB0A974EC469A8F79ECF8D379DC13685D2A8F6F19CE102C3DE34B11422AFB42E894C8D00F606296DABA7123FCE039ED27324D60E853BA94DC638454088281335D437A954333FF1A8D08E2A4D25CB3BA0D08BF6625E25EAD3C1EBFA2666AA49550578D3763ECDCE81303B53F18B00C8900AF4E0532C5ECBC94513DD9F50BE511CFE4D3DDBB3F112AE148DB062B2EADDB901CDA6AB6BF59D37F356AB34AF97D3DAAAA417642E87C9B95AA546C682ED641214605F82A4F486C9C72576106F76D7152615EC8E77187D4485071CFC6B0AE44880442790696E057A3AE20C860691353B3F6BEC5F1C2DA07563B423BC01E0334099571158A432441256D7C409B7B6EF26442075ED17E2BE37F8EBC049CFBE0FA89CDA7A58DD32C417B34E899FBE86E2FAB8D30846DA17144A6A66AAE1C24FCFABDA5B573FD2D6337226B5E49BB031B4D2B455B6DB871076F67AC03C3A73CEC01BD0B1EC42ABD177127E62A66FE8E475B982B4490F0877466EEFC7317A703C5C07937340ED4B53E5DE5325197FA31B8C8E05AA2222064EE5D7C06D4A1EB53151F75C94A2E259688CA0716548465C5C255D81FF10BACC2C13098ED8CF7F5B15193EE14FB5D258E95EDCC93E9796FA823892C705A5771D561787C12592D269D657FBB71F021F365B7453D50C35F748FB2B7F36DF28769B81EF12A26A237FB0239C173559540", - "53DA0E7B84741AA9E225483630169ACBCC03EB8CDA28B7BDA685C756D66B14488A2D0AEF7E6CB2D80F2726327257B7284B93EA1B56AB80FAE668C04FA49FCD658D896A997685E1EDB4DDF85456B37F32FC8CDE50882EF0F09BE4ED4AB9A425806A49E8347A42A50B38FA8D1DA2FD2C9438618B6701DEE159060C186D50170F24F38E07B185E3272EAEA4A0A7CA41A69C69E9D95E271287D3AB8284146A58440EA131A7F47D73CB2BCF40FE3A58E1B998C2E5EF9CEEC8EA2F8467BB7757C03A99FC8F014EE933A7080CD46625A2A7A251B7A37E4208956A8C9BD35E6F8674BC06FCAA5DD04A2558C9665C7985014D3AD95ED256FAFA358962EF5BB26AE2FCE899392DF858F99303E2417BCA7672E991FEB891F5DFCA2D461148367C5C0DE1460BF557194533DAF01A5E8E0E43D57B825AF7EEFF163DAA23B9F95C063A26B3D213459D885AA96023715CD21DFA2A2250F7610B78A77123443BD06EFB7DC85D1F16D0019D2937C3DEC4DE6389485ABB21642B6E41ADD43CE96F228C08DF6288A647EC2FE96032B6DCD651FF950B72964EE08FC2030272E3F601DB7F7E770E655389CA6CFA2F9B87CE76FB0E0CDCA4EEE5E80FC756BE46CC09F84BDB34ADA2AFC024ABDE0066ED939F8EBC236CB3F577C1BFD741F9D101A038EC86AB0A85462BAFB2E484D6722499A6310FA449D979030B2A21206D44225800BE2228FA00AE6D92C8DA652E1B003BD2734D30557B735CC2A591E090394DB791245C22B4D29E706476593B6F90C694C5B87BBB0FA2C479E292A768A9687A713336A21D1199186F852C41F586E9BBC64004D8BB6814BFE739834C99923177AAF87B926D56A7AFC0879C027332A60951C84E9314380A5A78E1196D094F15D856AA36742825D2B397156BCAD8ABE7291FB41DB4365AAE49CA82CA066D3B4366D3122ABBC00F05559DAFEBA9F98361DDAEF068D60B18265E7184C4D6BC9C3619CFF5C758090FF6398CCCEB78176D2A8A2A4B9854C4ACF5CB614DC1CA0E15E7E85442241D48FD3D6E851A5D3947FA769560928948FA26FA16EFBD2159994BD92B3D6B0C62818C91D4724413A7F40B2A2D67F4FC97B5DF6A7E3CEC03158E201D6643F402D3DD6995A42900D46C2881198CAD28A27489F5116ECEC3E38D999B2020E0C381DB3B8230811270D75950D9BB61548802DBBCB68ED8C7BCCB50D606BE400BECF873498621E66ABD2AA179B3E90E055C3719CE2FE047F815B95B065BA086B467AF4124E276F8CEAD000BCA5499D36217B250009A7B43E81CB3F8B1A3238EE436FE61F2F942796DBCBE570BB4FC783B35C3CA31BDD432B33AD75B08107253E8F910EFE0D0B5453A8A055D884892278688B3ECA612452B590AF38DBDD9A7070C5610E7A3CA6C91D24438E7F45E7A2A330F164AEDFFF1789D5E875EEF121298DB79C77278ABFEC3FE3DF843C46F40E847272EB2669BABA808C38E31F13516D5066AF4DFCDE6EDB2FF0B0A4CE9FA9B4101F6F144B02384868617CD39175852E065473D6F566CD18D7403FFD24DD33ADDB52C7CC22167E49102C46DC369A92CE2D2FCB81B4D1F14B7CD2F80A65D8FBD20FDAA23219873ACB8CF934E68D6F8FED6B41193CFAB1F44CE4BFC7C67DE1E8804B47DFD7E8AE281E19846AEB6FF94AE7E7CF6FFAB46242843811E6C5BDB78157C76DF4F92FD3653D7FA5978316EB055059C6A2B6306C957418860A88F63355E76D96F4727128D9B3EB98501AF5B093F2C314F98EA2CDB89468E1BD51138CBF25E8B911C26B97DCCA47F1A1D6C1CD415A5079A756B8A8715DD3164", + "515537AD5E5F4216C16046FB0AC50DCDBE5CEE7E3CBB51B6ABB4E87A407B90E0EFD49DE1DE5ED29184E7FF0DC31F75FBB94F46FF6586B36C7771E5A68D060A965ACCF8D640C6B6E4530FDF19DD2491BCAB69ACBCFD3EC7281CCC31253A471B652E21C4CB0B43613EC542266460F0A6199B436BEFD95572DEBEE920A915FD854D17FFD0DF8C74E23B21B28493A0927709709B07C65878C43B69DC501E9D0AA21061ECF173876CAE708C764435832D9D6FCFE62DDF2543016D6325A56D9BF1007886E62E8A832BC32063CB0717D723C5E8C5F0C0EB3960577D364C93060B64EE04A539B7601CC3113E0AEC53CF21AFAD0154DC5CCECF038474E0F4004A65B1EE2801F81968B88C3D35E87CBB126C02D770CC3D32A552883D351DEF47847391484F80646728221F993921BFC14126EE3D9527DE607152724C6D2DD305D3FEA0AAAEDF6509A2FE3248494A54FDA8E3CE7E6BBCE234E4686BA5A19724BA2CB78CFE71A6AF45532EFB286C5BB47BC3C1EEF4E4A8C757786AE974F30A86CD60EBCBFDF5502AA8F643819CBA4301E731ADBA1345B61C0B444FE7B817EA86F8DD749C451AE7D24A68D914F26C918238953E8AE61CC8553213DD6856C7863F9F6BAB1B4C84B225911E7B92BFFC12AC211B2B2CD905877FE976E07057963D47C437FE47D89648053F81AC39E8FD2F3A726866F6693E503CB6F0C3F0AA9B3EE2EA3BCDB16D726E1C6D8B073AA15F64EB68D53B1F8CDAC19C7AC33361226E81F1C793BF188755A3FE1BAC38B91ABBD4F077F7A28983EAFADC346CB941D49492625893453B364D07FE06FE42B160C16FE0462AB6366FFDEE54DC9CE4DCCA21E4E4AE5E92C872D1E4EC6FF6D3063C98A5AA5EE72481A0BDF15152E2A5425AB722101474D0E1EC8401273EA1BE1DAF7403190A94305BD1C7DFBE1F35F65D5CB97E82B7A297047507FFA0012FB73360FB8719C174E78A989A96E60A9184B3F3A8188DE100AB361921D38E8142859C8F0F7D441DB1B2E9687BBD1086643987C83DEE0BE8CED4C83BCC82B62B45311CE4F13ABC55BF5EB1ECDF15F5A07F8B2C42F07FACE0E299E87727E2D534FEBF7B9C3894CC3E2E4127A294B9FA2A671273B174DBB81D247CD2846116500A072DC3962C65FFECD0C0B46DC2AF52882058259C26FDE50BEB319AEECFA1FABA34C069680B9EBAA9D96EEBD7EA30E748213E1283396A2AFC63527624641D4E1F1022A973B1898BD4CEF4D712B49371A51D60E08F42ED1EA90AC49EEFBCC53E7F9E899DD1AA4056F11462DF1A4C81620A73C831CEB897430A22252B901EC3D6F3DF58EF26422F796EA31AA4E0E9CE5B4A9C312A22305E298FEB3B3628283D405EDF726937327D90C542434BA3B60684584A9DB244839D2ACBCD7EF147A541E35687B5B8F5F07764973112D20D1ED75DC31F6A938542B42EFAAEE0F11B0583AA4925C3132356200E8D6BDB3127B975F4115A7A8A1C471836E3C5450B501A24D4A1308BB319AA827222B550F253F64B6F7D2322C6A2D3012FEC265A66A60102A3340CBDAB900DFDB36693D41DAD8DDB8875F8C3BE76AD5355DD81D67AAEBFFFE9458E522BE0312E60F63DD92F25C0D7CF82F223AEC0BD7456752CBD5151FEB5368F8857EAFAA90E8C7499B75D46EC4CA20BA8A24C90C016B5BD2CD7864828C6140E98EDB9509AD1194F56D49675D077DE92CD481B469E3A37F7DF0D5392DA4CE4CB282530F1C73482CC0926B877B00B0CE49FAD21E4C26194C7E950E0078F3854EF88755E08E9380165C584A3DBF1ECEF6A31B224FC321326B93797BFE8", + "D67539AFB80711A0BA3CD67D963BAD346BA813D35A2EEA104D36AAAB863C656A07AD61BA60598C07744D32ED01EFCE928346C09EAAC2D392E5655F0FEBC486815AE30A38014DD8520F73CCBB71D9D42636328A50998A2A3BED3E4B34D0DCD65B94807064E2EF0C420898DB96E3B99EA9A0AD91C63857DEAEDDA5E644E62212B23D72FEDBBAA78C6581C677B10689C4AF387626DAC55F4EBE1893D52D28D20EA365702448A64A0C553ED337C3BB911DDAE2A91727299D8064BEC880183064574B5E3631E70A0590210143F4079C572BD5E2F7634C2D53B1FB1DABE79C484799E7075EFF98F033F5B2EC66C373825335D883911CEC9CFBBE2E38129B7E03D9646A7E513D5069043BC62AF4C524F12D8F98D8C9DAC5D8642DFFF48CF6737AFBBCBE965925F55F03BBD5123C9DB47AAC780301DE91FBED3C01D03E6464C2C2915BFA187A4BD93E20C24574FB91F0358CBE0921DCC8D6B7E9976763A1D2158511861EFF5D1C0B71F608E7ADE91D9DCFF5640B55BC9BD1BB322C879C7EB5C06EB2601D06241D09CFB1BC1695DFA55FA044E0E2E4BC86EFBF6A55740C4640512DDD6CA069940BC0FE1738FD376C68BA8AF7CCBA7D89F7966B29355538836372EF418D149EBF3AC104919D91BCA2F13E79A7CF7684A4DC0AC556A2843E041A71F97C94B859FE009659F593EFFEBAA6F6C1C57A5BF22752613AFB26379C42AC25804AEDAE22D63B230FCB858F496B8EA6F37104D0890525DBDE06AD988BA0287B0938572F14A98EC9E60E973FD693DB1F2AFF671AB03FB12B729D0867938DF6B60EC69790C992C6C33A531FE56D0ECC1465F65E3E57FC9E45F0F65A1061CE6D3190B6C1B8708A8A5A47222369AE889D26499CDE8F0548B8D7071F2D4DF6C0F2418BE449552327981CB0B54F792F29A71E30DE257CE1B3A7553A22275E4C8B9FAC3B8D4E9912BB22B0A899E7337513C7ACBEDA15FAD3D6919FDDD941CA659D78B74FD39E2E2F622691B89CA82FFE602DB2578A20D4665184456F32DF4DD6CBC412EC7C6914CA427CEE02F6D9810AAE1406DD68ED3869BD8E3947A2B3A803E875FF82005D853E3F43A6BF936030744C34C8B71B7722BE0AD3F475E531C9249A42671D5F3A5C77C4C28DE29AE953EBFB572578B17B636F8365FC755C22871E7D53A1F1561C92909305C9FD36AAF79E8844B63370B800B25CC1355211D9919B830A988926829F808DD2C66400279E6AC14F8EECBBE8B6E9ABFA3BDBB38A49535F64F719EF48C5FE6B2738DC6F71AACD70274FD40A29BFCAA594AC3E7D0C3C522E406BA6392444C9F362339E8FF34BE330911DC7EB11A47FF3A62A46CDE961A40CD5B24020909E5B034F45FE96CB156FFE8E2FDBC12A7C12D60D24BFBE596544E4F03AF26F086A5A667496B7DF302E4DCFC568C7ABD665EA7EAD8A7F5A000DAD9F43E68C4D8A14742E050769B3CB270E3856D7E8F4E827046D3E55A52F0E02C883881914DE87AE3C24D93E61A94919B40398D3EABB1B5142431AB919208A9785962D05061EDC951C83C73FBF6AE8DD6FF839E631C9FCF6635FA053DBCF932E359F83FBB3EE310281569741E3A8975FAAD1E573E0EC3207F6DBCDB8CC90DCA1CE517C8DFC1D31AE4841F87A5157792738DAEE7C29240DAE26C6C3E9D8A899D2271B0C374BD2EE846C6625E31B2F8379A96F601323039D281608A01A1844E5D1D20CF1D92C52107CDA71BB3B7EC4DEA958CFD7A79F71868116CD1DD2B2E66BB94D1373B733F324BE489DA51BE72B01A8572880AE1E61650B839D03B0192D290D5B36A9CF93B304", + "58B2E58A13D4D5F84F37A389E6B01DFA66DBC6A25338B2884EF08056BF0A9124DA29254AA79CDF1B0944DDED4BC7FE683EF7A3C7A1C359E61E959471E30F9D534F43EEF274AC6535C616ADC7455BFBFF43ABF268F7C995CE020CEC73BDBD04007562F2710498AD1A324F25A6233B2DF2D9A429F1C39943E45F934986D1979D293F90CFBEBE01665C98C0D72D09A382348136980B31F5D4696B85C3F42D5C445996804159CD4C4CE7547C4A3FB718AB62D9E9826D05C44C6BD21D708CABB01F46514F29FBE7352866EDBFABD0ADBB6093E1A519D0E11E27737239A07866752B6D864686AF1E308481C53C635046C0756E8008D3CD26DB970C5D6EF8CB9DE6BC4339EE9F88EA45D11B74A1525E2F1B9F91567A78E403F7ECD47A99E95C098870B928E1B0DAA984CCECA13C6857F350E808BBF66AB4EDFB0F369F6F009268D19DEEB377F7D0C4ED6414EF6D23A0A5F37A25AAD3CD62C2115CB70409049CF0CE6D4DBCC5C96767614C6FAF73E9A76C7550BB970AB3D3ACE0C07FAA9F36F1935DFCD5228427BBEB5FC7A2F951D9210A5BC32ACCA7E78AFD5FD460CE2A79348714E5542BF2D453680B070E85F3244E8A6B4EB6ED49F803E60B8A383C8BE6283B1C4DF79E0C4A23D5DAFCB26DFC5DF1D1520FB6CDA23A05A1513F751EBD0143C2B9F5494BAA74F9F95F189C5767C6F5623559D9F20CC9B9C9ADFE285FA4E1BBDA481A52ABAB36A5393370091A49A59B968CFAE89BEAF33BCA5C2A9BCC1758CEEFC2D0A175C8A5CAD5C7E3FA706C2FEA55F4971A7B8A0C5D1F22A26D7DA9A70603AC34566E4929AE78C8F1926239950EC0A6E1B37D919E24431E53FB08B2F7DCDCA2EF4177BD7D2F81BFC784FBEA0471831CDCBB9E11D60C53D0E062E8BB8D98B8EE5A40960EBE10FA642751B96E1407B38A024DC64D5C2005E71198EF394673A4A0097187D2475CF27B3EAA7955AD9F412A89B36AFB27FDF7FE699B2CC8C03F7FA40549178DF8A3C1A39441EAE869BBC89D583ECB18E310885F33B95B719045CA6955720CA75D5CF0B29E5F1B9E9EAC5EC92980B2D37EF6509CCA6E67544A8116494AC7EB9032E1E8CDB053B5AC0F60DE59BBFB78E3491D50C7ADED95042A8885FE284E90C04FFC0370B92B68379B2E7D52392A42FEB26B2419CC64412BFFC036C01109B9EAEC5FAF485F0D61C37A703EAD02127611F9D25E4EC515CABE21247156F0779CAB57C35581646BB71E87941AB5D06FB3C06C423E9E83E0C07E611C89CB000344AF49498EF5C30305DDC8958F45A45E1218837269DEEDBB0AE51D2AD8B41BE425EB7AB798856911B6F0DC721756A8154B9D1CCD61092D16A3E9E1CD5E1D7C2C45D236C9B21A0ED64AD4C0660FE42FC0B543A34FB545B0D88D42F696D53BF54A1A259486846E81B44C16EF146310AEFB3933BA9F9D4497E74AFE1449D69105B9F295DB24B4563C3FC0166CB70F104B3360BC0998EFEBABC6276F570F7679865036DB59B51AD2F91C0CCD3BCF5C07492765D480494AB5B87E83FD04B75A35F88656D3329AA5FD550DBF493B0CD2C19DEBE4358661C72A71FB17C812F75BEB61302AAAA1F757288C1D8626461F4162A2EC6296B3CCABE21B4F0695F2D2CB02B86035251FC9C5F2FB5BBF28237417DC56471629B3B4C25AFEDC4C9CD108ADAD9DB1330AB680E4998C5B3D99BCE8F08156B630A63EF36A51C813CE22A6B178683EDA389ACF58653582BC2AE8170ADEC4BE03C04CBA603C0E4572A74BD9599A8442E894EB504F7703F2353A8A3525EC5535E750303AC07E08D952755F97AF236014", + "3059141DB31B84555DDC1C5F40372C50BEF6E82B433D87603BB7803FDE8FFD74DE06809357F11C1D6ABF02D4DB8EBE1D5ABE7F30C91A451EE3C1AA36735FAB9185C785F05D28BD470D433ED4ADDF36406487CA1710ACAB57EA0DD577A49C841F5E78B70FDE90BC1087E79E27E53A4B131C06BF33843BFEBDC0C2A207510590E52158C0855C40146AFCB75DEEEB872ADC5E77CD1DD6A66EA96CC223B3295C136E2766ECE9F2CB807C68C84FD04E0A5179D58473860962083DA8D68B70DB95C0EB91679CF5E1BA468786725EDFB179A2C5E7C28B396A53D89A98C7B79867E240176A9DF9FB0BECCC22A526B617CB8FC2B05A8DE411C8C5F9BE682459B487B26643FA894F9B3C97282EAE397A03DD15F07FBDF7432DD95D29E6D50CE95860BEC2649E482F40F7B83A13135A7C71D83ABA44A363C864BCD78050AC69A8DC0A9E601859087DBD49AA01A75053792F74D9A8EE726608D1F009D06363F6E5A463BC362178918737C5F3E71EBF130691A2048F07F3F8CDAB70C9D0F7B9A1180046076E1B894AFC620244B30A571DF359C7D60969A9436F05417DB5759B2D3ABDF6A238B5B5DCA8A0E4C27F7078DBB6600FC0105463E745A321884A4F6C5963B188919EC24C460F1B9CB9C063B2CD1FD5F49C06AC2E61EEA55056A6ED08B6C7C750E30EE66508FF243FE1B5C494E8EAEE5467AA0ADEA834523C536855D3BF5ACFFFC0802365B3889C31910A5E63B9457E46B4B7E29189F1BC21E7950BF9FB44BF5D76078D8602FFD986E1A1F1A74C677BD8811FC6992F39384CB3F9B2C91F381DC01D4E79D2E66E6D76796728E0C48F71817ED182759D8B10F7B5D361D7138CAFBECA3234B9F2F4A76FB00DEC05D67FA8E7217E488688CF87D59AB4FE7B13C793C1A1711C401B49C381F76B5CE120BDFDF30A858DE62A3F4331E4A3CC167030829906935FAC167A7327B5FC0527E014801A27FE0F2D40EC13C66235EFED070979576DA7268D1871E8487C4DFFC62D27B83488A73FDDEE1470832EAEFF621CE8E126267A47EC00773922BE480C7F26C8E4785D886BF8E6518DF13DA86BB2925A432D479E8B8FA9F92442891F71AC7C05C0BB0E4396158A492BD49E42AB4C4737A952D6B2B2780EAA73DEE13037D659A43DE1A8F0E525D7F96FDD1629FE51560F77E4A1CFE903DF0891B39F50B71E0F84965413DB34B1EE95CC1B6728AC3D1924B34D1BAD4A4E4F7D98D1B938C567B6F3C95770068775F78EFA147ACC619AFD0B6D8C66034C21B2991419217256D88F265922FD49B4BB38D2955305A8D01D01758B01134196C525315726D9BB6D77917A57F2C46A05DE91A3FF80DD2B5AAAD899D679EB55341FAC6D5C2E9C6B703806E342B2C11CF84B394BFDFCA378B26C7E0CD23C8A87B7CBEF6828D9E023B2B7060A0FEEE0D29CE59B379A02AAB7DFCC41A35CB9A94408A321BF78A54D2D4DB0E170101798F6622D8087A2022A993E85DEB5CBF0F4DC2A047877EEC9DD145471D57015DD59A37BA60C9BE39A4AFB92289562601BCE8102C83292E2ED842470D715D34F11981BCCB81ACB443FA732F792C5F11B7DA5D1BCDD84EB80820EB2BA3813F5E6EC5300E622DD81B1FDE8C786387864D78246A432CE245E0883745D9A1DE9D68253CCBFE7C00EA908E452DD3B9669F1E6812E40D9E2C423180BCA98F4591307CF8B8E98B7F828989CA7F3F0BEEA4D408898364C6DC160C94B89D879B1D07286EAA3FFBC6CD7FFE5700304AF3FC049098590DD7F6D4770ED66FF60DB2909C2DC6DC67ACFDB7CDEEF1B714BFE4CA04F2D5172137C", + "4427106DF31EF72E43B6C75CB84BE5E375B6B6D4D21226D0FD689E8F14EBB81372B93F5455ACE6C168345234B378500BE6612FC10536607E85B884AEC780550F2A26FBF0445E0AE9C0F4CB95F01BBC76652A9E6FC457D6BA425EA8B9457A6F3C0AD2A0FE7BDD1C1CB19A9F1A8815D84EB5843AECA4DD005378111E9AFBA9C3CFD808C0C3CF2B39B1962EA44B0848452778168F7F60034A68E5980EB63B94E50D170C680FD6345F12CF30E9089A7C0A422661DB7B1BCF2480238AD043FA1D0DADEE998F7CD69FF04BC336BBD5985315D4E1CC78558D4E235CD7E05015A5734896597F16E65E45E0C819CB0B895A38883ABE4F439D10195D88366CD14F45947716AAFD770C27FAF6374CDEB53B118277906F7E61C583E8C7CE3FE733541882C511936076DBCF65094E37FE2FF54E0977595077EA26E03711FE9054E2D31AE7F99939B415F46C05BB55BA7BC4F31F337D624A94C9629526ED51A9B93B1B3C5551F9B92A30759D7A40025E98E50128232A706CF6C3F6734D00571F91307EFDBC9718D78B3B792909C1C56BB8526CF5B229D4DB47E61D962538BBB17E6CE8CFB7854EFEB5591CDFD5DD8BB22FCA50E4D97BFC4C36E2573C0B495FEC9830FAC229976FB651B82DBA34173F5635875B1460A023CDA65333138C89DC81275F7F3446472F5F8C5F93AB130009F5B797D9ED536ADF5A42ABF6345B1457D5C96CFCBFFBA56CF124E78FEBF8A8BCDFFA97831A589D177AD260499130EECF8247FA5C44B3C0C19AFE6BBB0A7B87080E14F3C3457C8424557BD9078DEC09A3A6704E1D77049A1A4431E423B28B9476EAB6292CA1B3B4B43E18EF929EFFCDD574417B15A4DC1269E593F884DF5D492A464AC3F2436B8C691B88658180E53228AD83C4FB843F8571D42A9BDEF37EC4926DCEE5002A12144600C9CE7AFE483F3A64E480CD09F8CAFEABC9710E01A8120E84BE5861D75705A8D18F02756D8FA78392F1C89D05F37CB9F768289B8CA99E22E86F8200770D6DD2D76951A45F73C0730162C363886282524436D029786E7CFA2EFBCD3D05169D362DC8BD472AB376C12097443080F3C83AF1EF7339D8FCB85FA098BBCB5EC3645A03902B758DB263A21C8CC4874F96D672EB192BC1A183A1B271BC1D6429CEAA8208F5CB240F451A71B6F884537ACD49471010ACDF28887F6A02A04E738CF9FB5B00E0C474C460EED1F791F4EAB3F9AEC225B40CCE223D23D07CF0B60846C111A07A86448B9CF119754935E8C350752CC60AACB55C71F4D5F5F2BDC3E412039D336ABC6F3D46EB0D1C2080CF260EE77F5C73A35C23396E2324998B7DD375537DD35B5F27C3B545492F682C4B89F13F65FC4F72539E4A7763BF4AE2443FE0A2F683A86274672FB9581668CD2B075C274B242536087C4DA1E69D0712161B868ABE86C98468FE43A42DD2AE30089ED92B7A750C73B19A6D70FBC0AC08299EE2A9BC94652B35D5B2D679220D34D3372AD756F842861470CC3A3F2BEE75112B138613A40FA585E449FADD6353A09363EB6025D4B81F9F224817FC2DEEAE01D797AA8A0F8C945FC69D5891355C28ACAB8997A0518C8F4465953819113914A7CB472EABDD1A8D943A82FA41315D006E54AEA4CAB21601A2ECF6CA0521579A6A92DFB6B77BEC6D5A05B0A72F16B0328C860FAB66A1D6113B7098FE50F3B09C2306D0B9D00987B351CB2BE099A7AA7EB7AA691A4E2D243DD7D0D864CF80A4D2FACBEC3C1CB222883CED667477D189100A5677CC3FF0DF31D1119D5F31ED2120E5DAAFB99E8F36E77B3B078C47B3D527DFD6521D7C", + "593CF84751C21D591BB62FA0B0AB65E993408A016415D6296E0F080FA9149A4C31D8B2EA68CD7209E2FB0B4BCCF654B013D92AD7A4F6B1935995FD106663CD5760E63702196F63563DC994570C1B8E9B0A7705002ED56D335632ABE3ED8BC6CAF109F0588040DFD167DC364EA7F692D5F59C5616A6A7DA0C5EAA4D9FF017820225D5B164B6106CE9307B56EB08C563F123A05A4C93488DF63A6E4274BF5188475E8F7ABB8C3E7A8323F689DD93B043BD98BC948A567E8C6C95FD3788ABE728F7B7E299C460F9B35A59BA4429BF417B9F8C54F2DC475A7109B9C25C0843AA86ADAEF388A9915E65EA08C96C4C84022368E79A3A466B247EE6A37918CA0A8DC6AFE291CB9D360D727B6E7415D360AC414BD34DA40A1D995EE1303896465D52707A4F31A30C7B7DF936391435A5FD3F06E336CDA36E473E3D990A6F04FB5E6340581AE86D8EF81B9BA68979058BCFA1363D3F711D33EE9E3A8402A14AFEBF339BA7C34FA4EA2004FFD09129667646A79B6322CF00E1B46C1418557E0E62E106901176CA771979F4B6B299BEEFEF7B847F4E3ED99F56D44F5C73F00488E1DD862BFFE5290DBA737FAFA0C9D95C8307A10DD309C177BFC46A9F6D3BC86F598DC1AC69B070B9AF1CA2824F456E73747A0CED38631F9AC222914825CC3898F04F6AC09B01EF4CB09A63C9436625E2D0AC3C433A31D86948CE34663E5462652980B3B57C0920EB63879E28CA9565BEADC47F29C43F1718CE34CA5717D7AC2CEB6758A16F6D769CC277BDB483808CCA3A6DB99D1018888BB6A49D325891B5D6B4B77B18A5A4133AFD5E8AFA4542710483B52E3D51D8A4FB77D2458C4FBE2DEC1F6DD8C0FDD8FABE2130297D0606F07B305B2CEDB39204E2B8F8507ABD49C0FEFAD0332F8ED98736FEF5AE4FAF8515CD638E28F1555F54D7A64FB38D0B47734D0AEB8B55A792259427613733F237FC57DFC1AD49930D9844C9F44C3D6265BE3102D93E2B62D3B0D7760F613B1F5F5176E0C5EAE47970D30D211403477894B8D66D03CB3AE8992E16D52F6B2073DED09D504B36289644241EFD21018C570A2CEE6D59667F274CBA5733E41BE3370DFA47464AF850B14DCC32BCF1A5A8385314E8B38B2A642AA90B8A5647DF9B32B83D3B4B2AAA54472BFE84EF7DF68ABD0236DE171E5AEDE1770F63823EC143B30FFC69ECC464CD755F5AFD2B51AB5F05B74E96F6108810CDA94F99DF828EDE147BE061FEA46CF6A84CAC720717733A17677BF620C4963DD1A08512CDB6A96DD3ADA995D84A934C9825FA3B588D916CE1898F6C2F75B75481383B27204C343CCCE41E10DFAFBB42BC6BCCFBF7BA4C460147814014F9470ECC8B99D677EEC872172B72E5839D263F55B9FC91AE6143FCD1BC3AEDB12312ED10647E011A020B27C69E35CBA94623960543DB08D67B8CFD06760450A067E3F868386975793AF43AC4D0F3773AFF6C2CEFC8310C0701CB934098D842604E38370182BF05A401C38B6CFBD19CD7D4BA186A595ABAA48B8740DC321FC031D76F82B4F5FD6949AA101D70A702E18D8C2BC1283C2E2CB138699D507FAEC5B6A092E5AECB0AD9BF2E59F175DACE05DC18E485B04DDB963426A117CA0B761EF485B234971B6F681CE3CC5CE58A9BDAD9267E5C075D1BCEE2C88637E2A10AD441E9B1CF4A324B77C6623F4DF9FC6C4AACE068F66017BC82D562722FC93B02489DFBB5560BF60F57B736212DD8A0533071D10ABFCB4EEAD5AD9E36E856C8ADE0B9C4F6F5116EED43A39AF8FFCFA01BD558D7575AF0E36F2AFF74E29435778F4BA57A5D90", + "214AD702A657F5A17A601D77E0F4C6A67B7B8C074514548FF89A781CF2E0B5225D95A944D1048338FF3AF206D331DBCB3F5E9E89C7E592A2295CB783F416C4160FCFD26983ADDDAC52BBFDD6A7125BA4426715F82AD9815F30B2DDA972A2E814D6BD231D453858749D65EE1B4C2025F61EFDF8E12E50A3719899C611682E7B2AE0CC85294542DDC04140ADDCCD5DCA315C22E5ACB196531A3B0071DC787C2753C3069F5D302A9FCF99B71317FF2749749C6E00B73F382983E1C91BC8115FEAEFF083434DEC7E8A22ECF2D1CDFC7B7ACB80FE0DD1EAF7510F694961E09882E50994169BF60C47B95BF37B5D6F13CFE48A9405637F87C157863C58E479488278B918DDF041214BCEE2ADEEF4242F55DE971E1A7F2EC566B362F89DABF163A690C8A8B808ABC1217C7D49933E30272A08689F7519B35FF8C1CE0F338D0B75332D163A5DCDE714B821AD3B8393A1740B6BE4AAC6008EBBBA30B8E5FA2253DDCF16B3F87B4FA47C1D36AC86E2FC39DE8BAFA79E7D58A3A6CD83FE09448EAB6020BF121234B23A72BB7DC02A2E235BB5DE3B2AA97D3931CB800165B93851EC81A1B4B7781F23E5C946F035026888C3D8C31170787F78333FFF8ECD8835AB5E9D165A8B1D97B19936940EC4C74D115A34120EAC800E8D680B36D9E29180BEAF5B3CFCC3913EE7FFDC37AC881C441F79A39F4A4161F3B403564F654B0E7D8D5415DEB9A6E11F845314421CC59C6A90826974B4CC477C280ADF4FBEB368BD848AF7F91D12E9BF4AD3E9587DCD7A280DEE9A7F2B6F2D2EBFF7EC9454173B748D2D90A6AA650D3BB97701EAD27D6AA1D05B817603EF1026E643C8816F183AECE863968664E01D6AC58C2A10AFB51B1A19A5B7BDBAD77D651B78C141AE70B074B9EF74BED349E58CF8A80A910F6DF8887202317BA36950F3B7EBAD45E6E940921043476B0FBC136EB397DB44445706F032FC47C454BA08DDBB8E71D1E7D9045655E1039C3C3D199EBA21596335BB04078DB6B39A4452662D282C7AC9B76D92E112B0027B711151C56A6459FFC70BFFC86941736EEF705E8DF5197B4D3AADCB31E421A90FD5179D9C3EA3EBC8FD7E9F4C29D736076723E2D4146EC325CFD616F6B0B70AE0DE179FA8F33A2536DBCAFAA2BC0A9740BBF41134655EA16438BAA5F8FC96256A6F9999CB1C57B69087C0612FEF4E6CF0BE5D1FB77258AF418EE0B90E8AF3DC38B7A15FF6B8D2BB739FE7D0099AA4694781E581A8F7A49BFCD102B7880E97B89880FC41D0890C33481B01D9BA991BD41B8D6501D34E0A401474CF89D089F3F6A189ED80C3006515CEB7F9DEA85D0766D2989B88280FD46F7BDC7C32C2294B2A1FD435102C2D92E85A03775CAF11D05F2367B57F651C7586FCD32FE920B1B94EB431AD2497E75F4E3C408A0FEF89907C6C830FA14402B1103DA4607F3DFAD625AEBC235D2392954B8D3BAE8A6D02CAE6D12EFC73EB46EC56E13D2729787CBB5C64910347AEE384972A5716B5DEDB99FCDDD5660E9453900DC1AF1B76D151C00E8E4BAD38E84830EDE92CC3099861C92BDBB59D8DE31AD9F4B889D480FC8DC70382E8494E1A25D2140740A5F327D51D0D3CA4259F1CF5DA3474FE28270C9B4E7F8A714F7C69D1F65B48D7C9C69A39CC58E2C77D7A750CC0B0E5D54B2F3450B66994DB524F15AF77CEBACD3CC611B2C95F6C93EDFEB652A70748DF1788E6FA2D45AF171C1AB59B0B2A160C075AA4A92272BC0F22631A24EC94C5D38664B08B46DC96B448C351C77F81051881055ACE0F364C80372EEE5BE7C660C7406B03C8F5345A04", + "435EA61E7DE31409D04501BDF0CFA57A84C1387E0684538E8BB651C7CF4EFD6113EAF9383BFEFDEE4C702FD5A070FAA3DC7D644CB3D96C8FF65F18C88C43A2E66EB78FDD1EA91E9CB519CDA9EE1806F0F10653F3AACE782810776AF25C9CE1C580C381D00B95CB02AF3F9892B4D918FEEBB01E7E730079266C4FF0AF0EC305D3A168197158B5A0D4B1C1FBE4FCFBA947A5CD2E5324D0C4182069C6F328465EC2900B468E145C0F41D724D65547808BED468256EEBD76431E715A4ADAC80D5314ECDD03177AD9175EEA9D9149128DE8715534A648069F5EB9ADDE486029C69C81B1ACECE89FC468887962AE2C063C5EC7B594D88E56F2F3FA4A20963F3BC730E74923BC2DCAED6EF38412E9094326930D2D2E3A0FFAB2217E9059A88882E2AFD3E62FA4DFCB5B084D0CE53655539BD0931BC063CBD4E660A0B1BD9C7D6CF2836C947CEF2C07B859686424B57FFDD0DB6C34DEF824D835918505F36755C298A09F935A2F95328248B5E923E55AA4C91BBB0733E4940A34AF5226C21EEE9B0E0C3D15397A4D8C069B94C2C38F61FEA2077AEBC1F7C5E0875B9A7F2041BAEACE95807EE05A366016B6E0FA2E7E722BA34D3654DFECEE78DCAE199BB44E164E61729CC7A924CA6C7A6C061C6DA0936B4C70A02223EDA01D7B8C0D2E012F998C3B94D1387B6CC65DDA36360ED765F0A23EA562626E12145EB2FAC0F49BB0DD7D1ED3E9B2860DE1C54FEE8D60EF56D4382497C36181E864F92A95E76CC516E2E1396E2B0D880ED6CD14D2410C9BCA159F57DC9B763ED7CAB73F9EA5D42F4BEF91977C114900CB0F249B10DE8F4FBE220181D4FDB5D836AD2FB70F06869DD7F197F121FF748ADD6DF6C48ED9910F51BD7528DB60FC5A42CC0B72DCA6FA66B617F12FB2A9530247B1709DFA7729A6C9FF5B13D073FD7165033C45B5B7C7C66045D1735979132C49CA4442986760CF8F0FDEC0C0BD5E992641075C76168B8316057A993F513536FC917BFB783C28B2D4878D120889945FEBAB84BFE4840C61012043E96910A374CE33B45F461B5492E2F96F0EF91E42D7DC755F37117852C4FA99B106F5CB5C70BE5055ECEA5DF90B517B08252DAD6F20013FAD50F47A1682CEB37AA0DB64E4B699E126CEA7034969FC5468D19455A1F2BA4011AE5CFFC2544329E268326345C9970756F8712E7793301E9D3C92787FD10B7637F5511E27A16B8DDC21C116F13B0F27FA2E5B6DE60837F011937A986C00A4D9551D37E994DCA480493DCD5C4DE6F40D0E25349284131B9E0B3B6B9BEF6B9DB6DDBED89CA329D9F3B032E2C05BA9999CB02D7896258E3C4504643DBF49A155F96A69148A51F243CFCC3B2BEA7E8BD534308E752C675CF478A231CA99C2EE402EB5DD5BE2AF5F4FAAC783141BE8D2A3BA44156A3D1EE98763108B9EF4670B25569DFF3568FE0E183938FB150FB79F7F28D51C8CE40089C06D6A09F25845B50E64AD231B367C280883CB7FFCDD5E4C044BAFE6C0915A0C52BB14876088267EB84A01B9931C03DC799995B6969E65CCEC63697F1F0E146B75EB6987550C23DF2793FBA8F04D019C31AF4AA747F3BCF00D6FC86CAA707F1F27DCBE598B18ADD6BA048B2B174FFFCD20F93DD2F8E860885A15CBC2F06CB10537C205E143ADDAD33CE8CE5E6EB22C6A917172BF962080290AD6FB88A91C7B63B64047BBCB60309C01F15271CAAA73AD93DCF99400BEE17F6F771AFD156CF28B788586A18C21739AE5BFDF8F6B8FC94A9CF1EAB0399F9FB53FE70FE5E4278AB909B2A00F5A181F67CA7F7E046209A2394C5583CEF4", + "C1A7D5578EE6929147D34AB5B29B97864F46686736A0966EE7298963AE27040F4598E0AEA235B562DE84BB1943891101155AFF6D185D9F66E5F9DD037B048914D7C1B55505455D08DB2E0C58716AA4C4E779EB7348D486F445CB8BF499DA3054F087ED95C2561770335DBA67F1EDEAC600071AB5918ABEAD7E55C5C6E609896ACE2426C47941C1FBDBC4804D8FF4C9290E8ED35C967D65837D6E2B153A3DD843712AA34BE1FD7CE0D829B04DDAF036D9D16063E28F627491C1C37018FBD1EA3D33899BEDE421C1910C2957C13B8CC4B8A06C8D3B2264E8E1B8FB5811622A9986B4B6F673994F6F5FA072ED8A8564C2AD450CF801C9992779F292994A98800AB12A9EF07F777F441F19FED6314404A9949218B2ED4E239EE677D8D1425D0547CBA99C1333FCB1620A8D11DA5CEFC51DEF5B3C4862E17A6BE3C194F88B7BBCED98325D638877757ACD448C0A970D63603B58E3F4B8A361D36EFCB6AAFF2858E14B1830F0FFFC4C5CB08BFC21FB091045B9A7F8DC0FAA02A62D1FDF7178B5DC90D2111A64CFAB0D83680196B21D75EB91A5B3E2568C7E8A6EDC65048C88EB34F6494CB697E44F895012AFCD7AA86DF341CB9C63A7EEE8E5F95E3D60213BC23C5A83CFFAD4225BC731F07B34FCA550DE26E0D6DA29F03A1D9C4233D9A0633D31AC5F55A11C1208C8B85306CAD41EDDE3FF5EC3A61194E724EE2D6A4C94FCDA217BD7C7FB328A9CEA8064D94FC66049B56AA1DB9F977216AB4242D0EFA59AD18540F1430A6F4EBEC5CA7EA81EE4BFC6E77F9EB6352B71275D450843304F073AA82D77EE5602B43DB62B9A733320A67B2727B21B705B86D5DC1459B5EB688D37236FD37A7163E78E8425C589DC600609DF3E9F36F9094D06C60731527B8ADF58A95E40C1390FF657D418D675F528B3B665FB5F3C56504DF40C1D3EAB6F3CB85F5C7954587F87744775382517B4C652B4259571A8AD219A6517E2D6D3212AC1684404DE7CF71478BEF7819DA24B09A11DDAD5717CC63995BF83DDA735C3A50F6B164F26D6A79E3B20A1488DE2AB44347694DB8EDD3D957B6B5510C4A266E514164D23F1594D84487757EE6F4353BD06CA7F90912AAF5188F217FCC11A62198E2DB04A016D36A583891D346C0D84241027DDE80090356ADEE1AAFE7CCDFF983FD7F8827BE286280BE118FD9FCAB26A10D19BCC63A9AD9D202036193CDA36321A5FA7252D0E65FC0D8E588D70C3B629D830CD1DE2798309A6B6113FC2A16B341BCA4271B5994ED767F2064FCA7DA335BD1D6B21F54CFA0DDCD47E2A38CA924DF85D2DA869F6DEA8FDDDBD20728A21034355728DDB4287FF0EB5A9DC113A71F7C69899EE76BE7D186B39C7C868E78C03E923FF199246908FEB48AE45261B3F7A8D6E4FD0C280545A9E3A578916364196E483F57EC37439B0FC9FC37C5CF56E21A5CAE0B70D25B928EEEE456F19821DBB974781C646E860EB3DDA8EF8577CB0E3B9E96245E14CF4E51A5D11F7AD9A77B932467808FF55E588455F810CD50367DB1621469AEE8BA6FCD52C75BB027521C530A918F9D646C69EF8DEA1F7B14354815F11E0187F01F677E2A0FBF78ECA2B1E51E898E26CE55693ABC8812F4CB4C10B9BBDF385C6AF0B340DF8DD2E957D877DC1AEC30D4A6195F40F09B4CF4010E810C764EBB57891652C156DD20584E427902DBE82AAA3CFA728059D31C36253649FDC00CCD29517AF2FFF4F5050B0FCBB73B2888C989761A7F0551375E4D3C54E0C9F8A4679E640A73476BCC6587195A82CF5E6F550B0A85D57A97E3E5D0B9A194EEC3E41C0", + "F0E94A299789538824A90801AE02D93A78EA914B9A8F10FEA2D2A7D0812009C732665D48F6DD58CEE4CFC72513CBADCFE171F837E79B8776B392B2224C02766D0468E513D0BD1BFE6ADD6C04374604503A3EC8539CC707110D18FCDC8E000EC1A3DD03F7008D37C1FA02E419FD4FC7A6C81157E07E353F3C4882C2AEF4A0CCE1F7A5CB5EC753528152C521A2ACF7548F19862EC31D8783BEF406EB7F756E41CAC3FBAEB9A901F9268E78E06ED5D6CB19BF4606C9DB660C03A9D5B06BC235DD7936ADD74268577256F72C7F36CFD7D4D09D3726F1908BB3277AFA69C7166EA2F4CC9387B13AAA8131D9F21A5D97C13C7DABEBCE61D72556466093EE0F87E9EAA9CB42245E1BF55157013C4350F38596CD26D2819F98698CE98F5D4023BDB3C974B0E61FC6E6604CB1707BB22FF5689F3DB3AD4831BFFD3F93C702E0DDBEBCAF626FC2655447134570B7150E030A3524A6979579296CEE062D18CFAFFC4474490DA81268B27B60E9E9BAC2A9B7D2E2377A2006AA5C439C263E8F9EE360B42E217646F7C44EBBA6D9E3B98AD20B1BF7CB8CDFC62CA7AB139BC2DD1C85A837F51AC9BF08B3F36CEF176A03F358E2E37EB5DECD0DD2D544E58D203910613EB14744E914F92C5E9274FAB025CB6D8AF16EE03FC86AE3947F7A30FD8C1EA23EC7EDAED4054174E4E6DE048C563B1832F8839927ED3EA54B19BA41CC144C8D8A6D8FB66032BA6F4E16DC81C98D37129B3458C2F2A6517694FD8816E8C71E00D77189768C423702612D9863FC2DC1C4593809C74D0AA881DD7477BC584376DC6C177347EE17F3E17B524D0DFB315196035FE6AEE83675494E23BF2433310D4C72E84DC82BDCA9B791D5BFD620212172AB2562B5C36DCA28C5CB8078CF41F2BDFAEE651B04243326DCE0C51ED88699CFAE4DA3B478DBDB92DCFC8D2EDC4472691173B6C5B9E5E116C30DFFDCE7B0381E8E1013CB392056E3BC7442B2A2EBB631ACB65DE639B3CFD8EF3918531480A35314F3F23F9AA6CA41A9B8F6D08F6C589DD2584B6B8285230808EDBCBB99C0E918D4E73AE7B397328502F2D47078CA2FC0BBACBFC9D9E491EFA2A2DBD69D82E0D829F74D5ADEF4100E6195CF3D7AAD2041078AACAB8A8EA62FA42C6AAB6203D92794F77D4E30B84BD16518A9A0BD0AE4B372A537BEDE43B31A6FC1A58F9B43AABD485C55E630FFF8A4359DCD52552B8A090DFD5CEFD972551714E5F0A2A16442345B33DD9D232AC8431EBFBCC5D5165D12961D1E954D01C0379B5489AC0DC0357667325AA864D44269799DB710BC6A25D90AE8E0C9368BE911C91D68A49815850B4B29708BAD74B4BF3590E6488655622DAF3A7B52356C804487133223337679B33E583B622EF873962E8FE259DA8F5DF61748B6799A14ECC763A1B54542D67E57BB73E411AC023907E54BA0EA8B7F20E55739BEBD7F83E408238B73249CE69FD2DD593565141FDAF12BFAD3A43670935354ADA4067DF0AE4150AF306AAD3071EC4DC0AEDE6F568DCDDBABEC98E4D17AA99F8E881600D35B25CDBDBE5DE184180A9C35EE8B42F6890E068700F06E4829A742FFEBBB214D17BA925B5C0B41244DB5BC7AF49D9A24B2C135131E553CEDB2CF4E6E2EAB840AB37788323024123853A19CC04F6E344A175A4BF1A16776B7F84A17501DE4A594BC515E788FD0AA08ED4BA3602838A6D1D485B1CB80BD24D97905A9A7E2DE71A9A4CA32689C46AA9EE52A9EA985C85C9289ED1577B577C444FC73FD1BC3DE03F9FEFC10E6A17553A7E3FEA6D57AB71E2379C9C5F8904EC43E57D5FB119CDC", + "A8C2390D6C3F0B9D01B9794A4207DE3F62F00A4D1188C727B2910153D9BC6337AA46D2D79D09DB7656C0B28654F1FBAC5C3DAA8A75B16BEB5FAD8A256E38EFD232E007A741028319EBA4A6DBD0AE1C1F8989246476AD4090F9F4F560D0CD72815FF6AAC29C8674B1D366120EB3213300E99DF390B3169A1CE03D2A5E471B9B8DCAA957259311B97817088B486CB680047359440DD39386DC2BC24AD2AC30436A08C335199F08861F93177640074A241D9C5884EED07EF0C0FCE8CCE08BA30221150C9EDC6562344CD3E14D3735B41DE2CBFAF4DE0F6D417299FEB38146625F3C70D8872103FDC6970D9D37D1CAE92375F81B26566A78A02139CFD83415BFAA5D328674797DE51E4AD9B3B9E1F9BD18A0FCA255CA8AE7E9E192ECAE5C60E9F5D578E59F7F7074A12FA75F9388CAC0A148CE9223681A93D62A679254AC2F41CDD871BD73BBC6C4E0CC9DA67633B61BFEE815F4E15ABDF639899DE105A5F4D74CCDA3EED32219BB447EA5C6411CEDB351DD76CF11456EA762C2F300671A12DD6ED8EE9AEFB4D0BD86D0CF35AEABC9B9E7822478A6DFEBB887DA0E2D3ED4C010E5031C4332FED83480C21ECF904B65925C4CF64595F20D072C7C6AF12DD3C76C682833CC6296DBDC73DC8C979004DE4ECD749BA45D9748DA728AF757FF5422B862223146AF86AD4AC4D4F407DC2025B8166E2CD64C8E1543E046ED91AB1AA5524E88AB6851752AE5A2F02F933DB3CB7EF48775017E000386805EFEB8CDCEEBABE613A87E0C554F99DF0C8FDE49FE73DFFD48379299FFCF738EE21B9AA1AE4DCE7BAB98A356241545B6F7D186AB544F77CB61B6492BE1F02C4B77DCD5083DE4319D1A1B792961D11D552F8AFA649EB5D2AD64227524722B0CC97260A8B3B6493B00D258A570CB238D3C2511C0582DCB478F878528B8A88A5B33F9FA6C41302DD1BFAC664C692001F7F7D207A8850D6FAF22ED887589405739EA5B5B9812BAE617889A225FB2E6F9EAF77D3B3758F9ECB89637D1FB20C428AE3420C3679B834EFB0F89A389FFD72D7420F2435D118045FF7B7361FFDA0BBB6934F81AD8513A626CC25D9A5E2A5FD1C51229E2D5FF803B8983B672E92A1FD72C16520531C694F44C9C99BC3385A610239F6963E0BB66ECDF4CA29E1C175E414A5D3F9E9F495F2D03A073965643186C46EE9BDB41876A41ECDA224719F5C76AFA6E955061805F023498AAE965184ADD6F6BA1DFE0BBEFC3D1EDCD40D8F55BB518C9B45CEDC95682B24F2818795CBE5D8E504F0885863C750524D9D238E4110AEAEE095E1C545C2989BD7E0BC0BE8AB750A7D319AE69CB080DA562F7DAA7068F38B14AD7282E041835B58E2A48A340F993D10FF4F805280C183A3FB45555B8D54EC145CB7B9BEE71D7BA652FC533ACE1BC8D621F7257422B363A5AD2798FB0E6E536854F2BD25914AA0B6DBEF1E2EF71FC7890E20FBCBDAF751CCB0DD16098D96FF22961B6141257AEAECACA339750950F6895107355F04F9BB3EEAAB3A9024E4CB79B19ED7947EDE79958B669077E6BE182020536F7F234AB2332C2F2790DD96F5816AE3FB5F2CCD72C6D177845DD0CACB44128F6EE6B1C2F673A8A50842E13C8FF0087CF71B8BA0715637A40021998652FEAEAF5719ADB71EEAAFC8093E525602599278B35600C743AEB41EA78CB0427D0894158DD4ED564C4742033324C58B01C15822B97C9634FC8F320C0B103F0A904D98C9AC529FA799B30F8B2C0888E47A3BACDAAE5A3DE6DF39A693A9AB3D95E7C973C7125C0F7D8C59B37EC924D7B9737724DD92818360F2C", + "2EB63BA5756AF5865AE33947E311A5EED4A0CD056442E19888A2B8302ED8017085DD5D137A3769058F0AE0476AB202CAD822D6A781291C537120F316E90D2C3CAD13381EDBAD35505A5B7DDC41E46771F460E501B9BE17DF8D4DFFF631C365AAEBDCB7D5CFF7010BE2EBEAA0B99820E0BF3D290CF27DDACF397A5E4922EEB7D8BDFDEC96B87F8202BD409F31A200515EB6A05E25A5FA504093F1D82A83A777F5389B5C90E66C369BB654598CBF3F258E9E14DAE819837A86EA775A05EC829B4889B816154A2B7882EC7FF71BA7CDAFF873B5CA4F35011DCDED8C0CAAD101F7BDCE1CBE67E081D98EFAB71490AD12AB7BD9B4CB9331B6B04D6DA2C12311F96E01AEBBB350BBC7311E8AFC9A6F42CD541ED40E2D7BAB44BF7F1E4465CA942A0E8767A38D89D0231BB897A995627EFF71B3E4483ADDCAED084B402A3CB23D5F91872BAA49AB361281454AADA57AC838AE2B34B799A1B46595AAA02A9738019EC3644C63BFDC72F72CFC35D48D83B831E6EF397474C43CF665D64DC0376A437CC768862A92C941B9BCB8FABC6804C03BEF7BD2C5EEE4609870803A5E9BB2FBC42028C5619C3706F773426CEC39D096FAD267BF5E6C7C7510B0D1948FAC573C5716EB4D6AC6EEC492B347497B47C0D18C77E7C264E9A04A4C3DEB83B1101E40A0A8653D9495D4A7C13A5BFF3C6956E668DFA999926231811F3AE84195B65213FFB824478911230719E8EAF206DD99C7CD7D3D7661E9F39250793C1391033EA99A0E31D8CF83997ACA08C43B47240BF1E5E9D1D741CD9E6D3F5DC2043C9D3D68A2A689615D39014B75FB53B4866488C4B37B68B5DC5F9B9D6AB9AF190789CD610E939960ACF607A488964C33DF0091FA4EE86654142083F68436D9700B3B50949C0D97098D969BA25622C2EC15FBE7D7C7B78C1C49F671672971E38996C2D77A024919FC1A87BB9BFEFC951EB75326CE48D3837068F31B9592DDD8505AFF1E0E31911D1F4E311CB1B81DD8A03D68A5EC075D8ED7D69A1D595E7AAA70928DE93B979438315A4B98EABDC8B5E932257AAF79A9CCC74E6FF88C02C33217FCB3FA8DD72AFA1E549B9E5CF6099E2DABA07C91BD3BA6A9A4936556FFDAD89D5F080DD7F818EBC8ADAFB3D51D8BA7B48209AAFEAC184E1A869FC88BDF92E77C6D4B8B983F4B93A52C473F1BF27B4D7514DBA522ACA79463A0B9C2E0D9A2D47DB238AB9E2A1636B9AA825272F2B9C8D36D64614A4CCE2EF31B67682F328B46D31FAA31DF874FA15799B5D53E143C9E9127AF358BA1B43A9418FFDE00CB16D32AA137FC7A5A1CFC2070FDA112DE600F3C05BA0F50F8AE1703AA2CB64135C29FA621385C803673A4D77195B4B74E554B043FC07B106533D0B41F7D882FF3702692709A64052C4AAE51CDF8B733A92D86D507B6FF4CFF5F3BAE4D0D9F3F90AFFD774591E6E14539CAF99C833D2A1D9A12F7E9CB1CF74FCB353D11E22B8216FB91564DDA8F1D2C9865080422DF0E0D8AA47577F31A7682B54E36BC8344D5F5F725C819D3DD3A948F4E6F6C893491127267145DF1B286C18C4F3EFEF0BB61541883E413EC3EC3BBF99D83E3919501A3CD59341BDED35BC39B655D61686555CBAD7A1B033C2E326887249E6E30AB12E43793DD1B72EBE858B40ADF4400A59363BC56063115492E114688F47447132D606F2B99DB9CA4083A91E35AED045C513EAFB7A3F0040848C1DDEC0FB3C2CFF717BC4CA36C425EC3CA9BC51B3B3C1885FD8B4182AA22AD38CCF8FE3990DA75CDF5712B358BE866A6435329677CED89571C3877F9ACD0D3E66884", + "8F0A4621BCBCE418BF2A77BD47D671191216B230C276A0D081C4F79AEF839857586F9DBA52B4E35AEF22D86FBA66DAFE801C686F03342849B5C3A492280950C7F3B725DB4BD6984A6389CEC1AB86F29D653781EED847D7E69C99320F8584700E662070E9C43957F4DDAB28DD2427415FEC6F1503551D972DCF11BC4EC3B3FE745DA7F717F35832B8CE373A00AE6572D8DFBD7720E00517C50E2B634B6BC3942F9A8C035AC80161CDB45AFDD7E9C473F8EEB4F1FEE7A677E820874F03B546464939F3EFDDA157C9F478988F3ABF39BEC02B722C559CEAF997A13AF66BCC0BBB4DA7B68EB6C6E8498129A95D021B7C3A072683593C2990627FEDC52F66F3A16A8064018E6618BE5D7C63BC622DDD4A15A33EE19E4161A50EA38CF6626D5A088FBC5721F567145CCE30C66DE60CAD79D31B703B129D27627BB5AAFBD9BC7D43944B9B0D255D8F338C7CB7EC56D121C3F4E61FC0D46CB0E036262FC182E8F266741842DE923D276CED79D4A25FF7AB3D2571B1B589E01583371BC8D8196A1C991BEB90F7FE71B99EF9E100375D3E767637B2BB1FC907846C53550DC4E6C7B8AD7FFB9DBB65ACB30C9644FE9D59A74B0E81A5BA068CBAEC9D6B362BA05202260B1E86EBB67BAE2D74F60B7E1C0B510BCE4EDD8D71E342D5465A8032E87617790ADE2770D0DEB1ED26D62A863D030C781D2FB02490718A5B55D1BF6B3BD1E3B3C163361B2F13E616FFC87C1BDAA7D7C88A331511ACE5A45CB94DBA557EC47A670BFFE839069A546FEB7183C27697A56B65AD762735782FA009350ED52819C23AEAD72A7150DE845B899669EA37B4A12D63BA7D6DFDCA495A0957BDCCEE6BE11B8B296358E92E60A2317CF4B7542CDDFBADFD18C88F5AA4984614A113E992DEAA18FA172C998EE6FC8E936E69953EDDAA3FD233182C7B986DF90386B3661C649EB0F9A7E65B90572132408929968CDC39D18020C6D81A3665639CD2A3612FB2135A6E057F0F68B10D3CC1C35DDA2600AD1C0A6FCC0C5DD0D82F6218F2C1F8F5B714C47636CF68D5361D97DD1367681116F2A2A045894A85F5FAF1BAA27F93A3B8809404181040C24156433B3B87467B27D7C3ECE44EB763D14356D6EBC7542E21863700505B8A10D4B4B6E9D2A4C2EEC9653BBC0D9FC68DCB53AE7C8B6CF3120C921B824765E7641A3E9CDDA804CF341012964EACBF55D6430673B83C12CDC53100DD8BD6B18A56B5AB68D83EA484F48D4641B94AA2816BF06EC1D1285C11AD060735509367FDD0E300413911442846DB240612C1389CD4554DC8D7D7C7E4D4B79145D4684F1FB75759E2D506F9DFE7632CC553B945D91FE0F9A829AD6A9A18817B09B986B18FECD615414A0FD6B6070B15F2484AE8B3EC3DA36D7F8007A7BE336B749104C2695327A49D34741D76752DC943897B29C9651EA3C034BC4B8E1F380A9FB0F9D2C23B627D9DD8317894AA754B8998573F025A024F43E03EE86A1EF583CE02DC7EC2BF2A8EF9A3C7743DE2E6DE38D72B5E33BC5CDFCD12184C9664EE7A3F4FBE9498F59107BF8B6DF69DBD6732AA8013FF8B4525EA9E40FF6F96FDEA2AEC03311D6E8908D426293E369D52F818233FAE1C2BA2657B38FB82E7864CE1177D5E21EBC8AB773EE928EBC4A7EE9F4A9CD2D9F15146C08E4BE0A77CE272A98AEA05A6DC18D5B856EF1B402F9851BC84DC95FCE71320D2A5540D40BEF67EE2709147EAF3C3D5BABB0B21090BA4C94CF7242982BE35925F691847A7C296B973EF2172F83AC9ED5E0A0C91AA697305F79A3FC6A8EA4E7D1DA88A81D4DDBC1F604BB0", + "896DD4C837F11BF155D4605D46411A63FECDCD64D7AAE873E1DE22DD62CC2F8982EAAA66BCAA8DE8DA687910A03200FE437BB87CD5E6D17C6F5B8CCFDA073F29183A1E12917C5D78CC1CCEC5C2B04040D39E1E74867B21192EFF2629AEEE22427EB5D2399515D892EEAD80934668BCA906109F6ED85AF29E702FE6C112992CBF851232A4C140BE6CA9C8DB383D1729B41BE939704297BCB41E4B8C7DA5B24B93FE7E7D2214287145A764D3263C9EE136457A2A270EBD03408ECB657B78CB8C0A5C1767521D75A8E12D9FCCB3CE8F6321B55C50A6102381E95C12644549A0E5AF29183316016B89F6797BD89BA8F1E932F4C91C0460F35EAE32F46D42D66F639A87C25AC6E9B9C4E475B7A4A94F10EE0C1043159CA71BA3FB4F794E766C5A7C6F7B85088CE1A2584D4A765D7888F1496ABE23ACA42FC001E2D30B3959AD7BD941916E27DA648833EC82004AA0937723CAEC0A8E7FE3C6742DF8E1CA797F13FCC4A07BA75874FDB6A66014C0EC688C5F5E0D1ACE231B32A1A14A2503155D412BDA98FBEB450D35797BDF96264D141EEAC77550408F6A63993DF3F89D1EDC90DD0885227C273546C2D86D3513AC3241AAF96C137B69970E273B73EEFBF8668B9946CBD118CD1977445F87557DA03668D4F3A6B5DE6D0088982F6C5DCF082207A99B376B155FDCBA8A5E47F2CA4A50D48DDFBE05F8C1D28A080147FE9FE04FD49C370DD9E4861D8E553A22B7DF7324C51C20F10BCFC18EB59BE931C69232419F5E037333B52FCE4A138617B08767506B793A430CB3EA0A4D9A2CCCF813625FBD2F471C39DEB2DFD0792F3374A980FA4B208185332FC68798DEA1728054F28771E0AC3FC065645B3E996EA729DC6A29CC23F872BABE6A84911B1B6C256C38C0A62331EB66E2F8B9A77ED79E323B4A96728F0ECAC851C3E9C15F2863CE6839D3752F4F206C72EF0BD60F087315E6AD3C7C836FA3C5CA6BF2B72D877E33C17EBEE283EFD62F395637E784A84A3E4EA174BB501D2CC216306673B06433A05ED052860666A3C3D7E7D7C991911A56100A31048BB81FF71110697C941CD0ADB08705A5A73CE66AA87008B08B51DABBBC3FCE66B11135844BCD8CCDF4D010D7B135AC764B678CF307154B5A96D1541B75FBA65D7A0D5C2BA2D1DA48BF0EFB9BEFB5141AA6D30A59695EF7FFAE250AB52DF0969FCC349E1C7B8D90099EF0410A861FB05E37D7156991FC65542B3495CCE223CCBD383DD4432113B817B0AC4000F9EEC55EB377CF48B0F51B8D02359449CBAAFD6AB69E3616D6A3806BF67069F2572D1AA0E7DE28042DCA01533E1C381449E22A68D901424498DEA67F0EE80FAB6FEEC56BE01950969550F01D62ADD52396E927962F209B262674D2F079D0E48D1C994864BA90CC4CCF3CEA06A5995072904CCD97313E82D3CF76F24E3B3946D11FFF45319DDFEE619D2B5D777795567A44767F12B41D84A4BF738A2C6AFC0DA08356DFAC343EF090176425CDDEBD1264871CB7AD526D9B4E469E866817A1ABC9973C598B1724C8C3185DA3C999636074C27320694F0BA758B0842D2D3EC93DA9A9CD3F65B321E378D95F003C744EBD7BCCD4712B6FBFD084D9EEF0C84C70651E3AD999D64BCFB5E8F7D9582C290CE59176072A5157B1CEBB5684D47271ED482B9FEB7FDDE78B424988E88627FB1299AB8B96CAA72239BE6930BBA4396118041D6F3CE51CEAD81DA54CFDC8BBEB0F6C8E9FAEF93E2C404D543A0F0026C291CE992CD71BCB0C6E9C459143D995C92A4A1C9A6AFD36E1CA87E1F8EEBD30EC9D209BB3F6410018", + "0245F1FF6639D3C45134190F729CD06608426830011170C357160EAF351BB00AAA61F254B939D89335881D5D15F3DAFAE92ADAB2B59DB7D3EBFF526D9A6F44E1D8DD779753433A9A32A541A798805AD307787C1832385D8B11DE57BC3ABA2A81B70AA2221C8C9247EFB3A40943D8A0677F1D4E6F9149D97D6D83173FD3D3114293D628AB97AA4CC0121E2A88BD5B5C290AE7E5EE4BCBCC1CE73017E3C58FBE575701C919ADE5E94208789CC2BCC330719F022C1F79880B1BAC4E377D486ED467BC58B13F2FF97454BF1B4F4DEFEB3B5998FFFF604EA0BCAFE859CABA133AF969827887AC252B9D21D8AEC49A0D77FC83B4D9A2930732E9A22B7B823E302E469B52537DB5341AA0979642F4505151AED71B690430AFBDB09A8454183A23F86F598719B86D1E3FCCB72DD6599C9895CF6AC28FC5B1D4A821A6F9DD9BB7AA63DCDA1678AD816D96B919E47D0D0E95756BFDDC71AE430C4F71E521701452709B6E670306A20C2F60F84D6009DF6D749C5E02D3DD5495DBCCBE9326D7D302E2A56032F4CA5C82A107E06A867D09A2E5DE7DB9C250E25B5279A4867657AACAE0E3D601DD3BE26C936BF527CA9EEBF3B247F75487A01694C7595619FE6E90AD78BEA799B0BB0C126ACF3DE54F805725CA01879BA5B8412D4FD3D3CBBB37AFA955CF90248CC521B0FBD0214A8D4C9E4A41705714C8DF5EBFBBF2FBDAB93707B0D779357E3DBBB20D5CCAE707BA7BC5D21D4C23D72AA231E83880867FFF3A6B587EDBF5485C516239028271B5462F78E3B226B057F01DE2D348C7D08108B990DE8484E839EDAA174B3CA0DD6D1338513B3D1E4ACABF9C14A9E03CB373D039645B6447D7853257F74665CE10EAF27DC1640C0AF88FF4C207994AA23EFA97D1CE707AB08E4A615C580E3AB971D64371715CF0BCB8421D8178D708E4D3DB24B2AD3143E2176B4BE37DBD8812116E134DC9B72E35E8811F7F404485ADD7321D3DFDCED23BC8209A9DAAA198307EF1BC0E204CA42D7274EBFA74C88251398D6E479D53C5C6E7528BEA5BEDC8677F6F5A81A07BF7CE58E4AC38387824300D14FFF131A54390711F95E03CA59DFECE3EA4696643A16874F98B76F6D280F7328AFADC455C51712BA748D33741998838D33F65F0166BD4D9788B129CF7F9F0802758631E5A718A5058C63B0D38D9E6877778FB8CD8BB7AF099ED442C52DDE7D3C0746BBCB8595C35C815E80C71E98425FDC629C7F8084BA2556CEC31E707408BA6FD7A2F0AB83286A93E565FDAA34B7344474EF48FE5C99017887C8086AE4C8916914142151550B0222C5FF617817EF86920F1FC00B9D9E5BD95C6047731373DB142398EB7E5F1B29EFDBE41ED1E9BE725C2748EAA2F7A1471AAB6C15BC4596B6C6CEA5CB3C9F1E57179F96B3C3017C2244B179C384ACB93557170F4E0CD387D1D3428A7030B4276F8D3FD38074E9348033E3BB3B4A05B3366064C68E0B25F36C2E45FB0AD4606CF5A6B8FEAD45CD9790BF5BA1B0AEB5C67196C05D637E878F6D3108B36ED2CBC007F6BDBC7D74362085D651ECFDAE47FFB069ACCC7C55B726C0C6ADCE2760DD3509649DC58189CD7195B11245D76F64DF2D61B07E0C172313F39961BBC410E4000C7F7BCC52593AB7915D5B5B3E746CE8F15AFD2AFEA8200687BD1E0D767ED297347A1B0634A4F006033322F787FD901E7F2492E1B491D4F5B901FF12CA88B2B2B2982D7EEC9DEC4538F8E946172AC82CD468812EB9E7062AED4075AF0A587A92E9BD971637B3222CDE1A8965DE1EF2CD4A36F2B7457D27CD328016FD2D92B0560", + "EB01608B4B6324D02441F4094E82D3DC8ED644FD9D7FE96DC544276D7E02568453EBE375974990442B96B85A9DCF163A5974EE96274A6AAA9EEB0C83AF9A2E27C4A4174EE1D4A4035782AEF83774E93F67A5A7B91E7C8E05611BA6747FA9F83A788DA50C9D4EFA17BCABB0361E055CE6D07DADE204EF601AF3D1C7A54AE1011C2AD46C27FC060A27073781A221D182D4AF531D3056401D61024A29FBB0030B8340E91AE3A32468CA48183567199F34A76209F7846ACEE0B5DE327B3A381087204DBB6FF40E1463CC7BD38311DDB99FBD05BDAF3B84D9E64958F67421CFA09903400DC87E212FA320DB95DF83AD6A6E247E92151AEA0638D3755A6B409E5853E1A7FEB54FEC711D75AB9CAB21DDB34D7115174E01E9F0A3E650F852666D06A2A8E133C872FE9034BF9A61E29CC319255B09E40096B6D15809FCE4C8993A056E4133BA1FC05933B643B5D476D3987E7BD372412852D439D38600BE4A7F22BE1777CD86F70F05DF3B260B41DED95653243419C5BD9B6288697460A0FF7C0E2928D707BBA41E46D1AE11BF3751852DA1516941BF67E5C1775383A7F88CBA065BABD2235C155FC69D3C11F5658B019B089A9B3A983A2D2533BFF7694FC271597C42EF35F8AEF804E18AA37E3F42E49D23FB9171A312A562BBC9B093D92D45EB6A1A8A665257D596174E1FC44E117397AA7C4C77FC1BB176C8284DBF4558B5259FA69836B68322705CF783121E3C4513EC11B76329F1310731CEBD2CC8B7F49AE8D87BCAC07B1CEBABE872B5F83D71FD10F300F9FA30F4054C476F86EE75AC68F1F80E352D3F9753233E53F67C3917C26F4B0E8A61AC0299FEBEF95D9A46BBEC9F5C16B5EF127EA18BFA609B99B0B362036F4AE14D11BD7EC8ED2B02C8BCAEE2CFE409899E06DA304E23305DB1AC0A7746A72746C24E6D073F1FFFD3BFAEF300299C8009043FA392DE2054F237A098EA5FF0E537105F25B7D85355A44FAE707B0A3D1D6B30356CF1BD6EA3BE57B3A6147B943D1C96C4E2C871DB1AB64D9359F1F3D15F9DE5F45FE8E03269EBB9759AC78F47DA7B913F09402EE65271859D623908D464B1B5E59E4580BE30E01C553DCC79B190A809C71D8204A735350C75C3361EF3C89C07B84270502BAB82FF089793838B13B3041A17AB396C09C4BEF716329318B95C7C4779889956961F8D2200C163C86F45C1FBA0567C8615F4E815AE8CE2E05589C006B4560D66A67495C2B99E3A951500FECF953D9FA7FB5843F102FE0F82E72867A65C09318A52D4634A3FA28B032B92160CB2E7D6ED156586D071B8CB147D139212BC47774CE580E80791C14FE49DE7688B3A99E966A9F869B0A7421062F18705AD23AC238B52E6D80F43DCF2B43F66965F6075469E0E789B40687D104DDB5CE5A12C0B741EDBF1A3E57BDACC92265D592FDD63703E534B78DBE9F13CA04B9920EB740FB220E01DC176C09CA51EB905E32398E739C6A39C02043042C5FFBDC9BF959D56842DB894FC108AFCA51039A9B28D19D67127856E29FBA3812F764D31AD4E2FBA5F00A828F85087B4A5ACF24CFA79A3B60C954DCE40BA6BFAAE4466C88A60293AB46FA2FEEFA2E3B0DAF0CD72B0CF914848AE6A9BC26F6578D08E896479879D3469E0CF39E3EA6508A412853C83BD33D0B993678FA08DF14AB40F41CEF0E7A4B992DAE6F884E193B10E5136DE079BF85936D3B5A586323B08FAF8A39B24ADDC2D7E1EAE1F2F90A39F26B130F060ADED352AF085F9169C4E21093FB2256C4E17416F57D29CD37CDE3BBEC8CBAB280DB69643C86696C3A6D3517150", + "ED28B364884EDCF3082EBC5FCD11FA0B0823DBD808FA19BFCDFB42BB1BE2B73D5D1434C95DD48DF1ACDFD7DD17C741A387F18E7D78B2A9A894266167897AF1C8FED13D463B6BACDD81BCC2F3BFB17D2DFC0D43DD04FEFE39C801C8917D52BFE8D2E6F8C0C5159E0185805BF9DF91194AC97F6448B9189028D50B274848B429AD4DE45194ABC458485617B59FC5B1F1606DB20283A73F41A6B36731F6F9E978B276B33B5DEA3BF87282D21F63787BEB1F6FCD3B21004E6FA79330A3345F2C01C8CD1FE661FF9AB5B484B3260F2332FDB00216DA42D2840D3180B6521B01281E6D0F09664675531EED14A5C1794F3ED1FE634EF3D6E9D1B6F4871A45A83DB56FE2BBC52FCBC1E05FDCA884F98DEB436A9A238E086FB339E1A7AFE8E04A5110737F021C89EC5DCA1168E5CCAF92A04C950154F6209CDD01B287FC360B93E2A5661E7809FF1BDF3F71B40BA756411894B340CBAFF9E0EDC8292E7C316ADF4F3B827F1B82A406B53AAD8D2D660FD0CD2D6A6C693A73511FBBB97612A8CD3F0E177EE38D46100E64C4C540C834DD87E062DA2C6C3BE8A0BBC46D2070FB8D9E1DC396423D2BD1DD22F1F4FEE0E24F48CAD9241990B5F48A50B3B178A9C1CA71F71321226E98D1F79DD7F3CB75E0B0C16915E34A92750BE9EA173C276421CD0E54319ADB0C4E5ACB4BD599842E5028F613067083522F0D2A891BFDB190855B9BF36A7F2EC81EA89AE11A37B6B89126DA7C51A4BD0C902D0DDA55A4286E36835D2EE95EB46AE7D6B919C05D42E543D96D22CD241A8E6985A18F29184586E6A7C10D4A955D0A1983EEBEDC5A9FDE306FC366F77A25CFC10E5B8732D8F40D068224177288E9A13408F06AEC841C2E8612E6C794DE216A2B758C676022D4C0B99A4A54166CA1153F43FF66AC03F183DC30E9C83E6EC3BA33F63F262F39838E5C044625B4CB1DBEB7ED957B8F7CCCA6C63B837ED93B2C260F276175F2F95B235D4D1DC0C9014192D72CFE014094F29A0AB8F0A9BE896067D74BE5489F7ABFBD7EF442579875CB1795669991438C0B6FF13E06D5BA805DD2D0DD06731ECA45FC8CB9D7CE568921A60E68E31F31392EB82A39982BDFE8D953DE2CE0AEFFBF0243E43ED202FD6FF9E075A90684FED84A4334A8E709979FD5B60BCD60D41907D1FC5D927F9CCAFF2DE85AE1350C8EF8D68EAE38EBD0DA0D252F0B5C82E1C3EF78CADF92CC78BD990B06461BD77B78635C406B4109FE58850D2A97A6C23CAA18B9AEA535D344E41E783B767A439DE0762A23D18244E76D3219A10100264EEFCA45F19022EFEE72B856FC34E59ADF6DFC78D31C8690CECFA45321AEE33DFD40943B158BCBEA764C3579FD5A06BE297D363994E6B959338A3B48F14A3C58CDAF1D91EA1711FB39CF78F04E72B293B80847516DA41D5024CEBFCBB399393E59FC4C89BA310377AF576105CDEB4F6DA314E990B1513BE9DF738AD35B1460DA23326D2FBD86722DEA5D37CE5E34C11408C01E1881BCDA250C7FCAEBA9DF85AA08FC9503546A55F2B4D6A7D0FAB2F50CA8667C7456DF6972273B62A0DAF38BBC7D38B5B62F2F1EA8476F300D0116598725C0903B0323779E02977F33AA8C45C2933B412490EC17FFC2AB2B4130CE8FED8D34419FD15971EEA5759EEAF9F3E8FB4FBB26615B4286AB4C2AC57A6E4BC80DDB396043251DBAE26ADB03767DC9EE4ED3E0FC7D74C58175BC1F393F0CE5D16589879C6D53645B861B079B298E056E4539B2E2E70920D3A273398B4E9247771B8A23B276DA9A06945DCF343E7A4C9E7B06960A1F624A75B1B48AF0", + "CB9F5B3A549646C4555D2FBDAF2A79F9921C54C6FEA316D7713D64FD790325A87A30DEDBDF0ADE3B7BEA52A0E319A57084A79DD706228989642E78BF51B7F1246BEF6F1B8724C57B0A3633FCF4440E9D57DAEEB343283D642710266386DED8FFCFD68B32949FAC691E66FE9B8D736EBCA6F4551B39E79557154E9AF590B6F5CA1C6A0ACA82FF4B839B6F9C555CC57255F96B2C963536E48EC9B5BCBD270110EAF7C64AD9DAB53BC791CB111189117A34A74B4F23A8573A59886BF974528D17B31CA9B6A6B7EF7F923B8915B640C599D2453941CD16633383F36F9849C0165D94698D793A58A7869AAC8B4C007CB9E43D8DD100E9504B1942CEABBA733A242599D5B8C60AA42F4C8BE7F040877DA2648D083A2272A46A90D215D96DB2FF1ACA6CE24A2936C18B7A283615E8E6B729602D018174276E2ADCBC869C43879B6BD0CF22CC0601F7491862971F65D3E0BB2474549FA18964B14D9EF81429F08383F77E8880E858B3F350076B709046284A4BF500A6C7D9D694F03ADC9753852285075197FE5F30F5FEA91C7740AF38CBF5B984ED852C99FD27113F690CA7BD5CA46DCA330A7E30E7AA3AEE8CB62251DDDD62DDCC29C94D79759357FD92855279A8516ED0B07D8F2CF6509DEB6C180AFFE120B1C06A4DFB1CB76B9DF3113B08BE85A50BF76480D2FE05E75A4F77909E0D146EDF0D751A1099EB2BD019525048BA145C7E0B3FEBE21A13A41A9BACED48E1A4ED32A57FA061243EE840ECA69191B1BCDC0358A86DDC98920C45F1FD193D529C85B33E0135DCF2B81C7FEED32E07A2431755F3EF3EA685577A6884041C6600CCAEE0E4182CF54EEC1B078D74A18D8C81E0678A7D1309E494938083786C67436FE55FA955D3281F7F6C145B7C769D9019AE1B8666834B51AE95BEE2A8D606825C7609FD3F24057425B27D01573FF353771BD47902A9BBC41B2016086A3F9E366F96DA8AE3C62123DF05113980D8FDEAC5B2C828D44C69F2D1420BF8E7913E59FCB88845A7FA6A84AA296875CA6D2FA21A4FDF8E75B5CDF0E1C0D84FEE983A469FEC80F02923695640FA0858E9B91812DD4D91AF0DFD97655C7FDC60EFEB19DB5AD7D7D0A5F93FC88A2AC1205D1BB60DB2F3BCE203C802752350B5E8240B6FEF4A38D8F35AE5868498DCCF1BA047DC56D67F15E3C3807BD5638A9494DDC268378DDED39A910A6C7A59E6738DC68D1A531C7EFA68BE06AD20BAC86BC36083E45AB0A314ADAAB741C6E24A530B3E3FE318E4A1B3827057F944918664A96277528D185E821093D392012803ADB63A4DDB14983E844392542F2C5A978F1911A2720E201FBB862AE98C3CCDA720A244B5B58AE601C1ED814B0753FCE5F51E7ED797AAA98FCC833EA272D86A238524C07349F5DD0BA4A2F6281B2EC2D29EB546EF52F07B832053AA433A7E8BF81C6C9F562B603421787BCFF621A69ECA5CF07CE8512BEF945DC744AF403B9DF0FDD48AFFF264D4AAEDBD8702863B5A345A733328466B22FFEB20906543639F0F6F85F3F7DBBD28034019F4D517676C5D8C8CABD4118768B10158D83BFF569D3B71F30AB57B8337C50674E2290C950E9D48D6527E885A0F7CF580717CF467759CA0D41CD03A91B75648DFCEC5C5BDCEFC2EB2007AEF2F01651A328DE030546933C1BF88F34AF14D0C1F0F37FC8FF4E015DA5D25D4A1D52EEC44DA8E832F01BB1D9FF6D067021D4703E8F2D511E73ADCE564EB53A048864D191F21C759F0B629E0053845D7049900924832DB7831CCB80B36644BF23EC71847286C959BF54C6CF9EF075B1EB7F43898", + "576592F533BF0DC0AC52CA27BF57894E407D8A264496F2196DEA6B4706CFDB4E108E07FD18F5B2253EC3BF1914BEA0E7B8EAC0EAD4C6A3D2E0162411811F8579262AB9F3411327C320D27C7DAEC764EC5277EDFC2635ED39B0C497365B8C3633626E66D83DBFFD8E24BDBBF09A97061D7F530F69D929DEB7AB12488951D753EFF9F8C8DA17F3F4B17ABB9A1955F40A4EDE9D058E6F48BF1B5533D91B55D333CE4AE379E124CFD375D82DD97B682D80704EFA3DDE799DC6F7D5E55B72A99DF2A89159CAC16B47F297A467358EC67A2EC72A01007C47D757DFE274893BB0E141337105C46B159B08A0414A7EF8DE0806F90B5C5A9362E837191DA4573B473C6E4354E62C5667F75721370F036BD6CA025A49C15BF63A8B30AA5DA01CCF9746222F2113AF119DA4370DCE98ABEA322483C127CFC4AB990496CB53BA7D20255E63368FFDA40BB7022A1FC115B91ADE56B2711DDBBDDB9FB00C5FBE928F3121420288CC9001F865D44ABB4D78B3A1F2BF6B1B2C251AB1075A65A233C4472A460FBC76ECF191313D700F73BAE29795EF9A5FBD0DDB5E2E04DD172C85E15CB0A63EFC2A4E317C5FF01965FEB3BCC81CBADFB201C670F4C8AAEE2E7E75F1AC4E4AE0B826FA9F87B300188546E42F3F142AF19A4F91192741ACA71EBF29A6E1BB0D00A4534095A8B9885267F27DB9B676009631114A2EFF9B2D4C10111195F0C178D2634EDE70B4C0C87613CC9344BF2F62E9BCB42C4CECE15AA61A0C7915E51A5645609620695B4D0C913337DEEFD9195CC9545A8B1AFEBFE5F21BBDFA2F140A4D146ACC25B8332861C2EA55BA75086FD948BD27923BD2590C62389CFBE89498C82279258D11689613C21CA8F1788C4926EADE381C9CDB41D09563890433AC4BF9421475EE42AE5735D1CD10653713BD62299F66F793FA095B2E04EEA1CF59EFA731143D5849032DA833E1660A95117A2ED97DBF4D22FC0BEC0B5CB8EC32B63BA18B63F737F3ED775B6D91E052FCDBC0C33A6F4498082542B039A26BCB25CFB1B23088D9BAB9DB12CD18BF2AE73C78792BA9096AF766114337FBC06CD63BA8D1C0A5E5C6BBF5AEAC38D6B4EC2922B8ABC930F58CFAF2C65C43422193F4AEB436C05AE3213CD19F58CC7623886525FDB77DAF08CEDBD5D48233D63F1D6BDA7DAD15E817775DB4C9DFE754F4AEB2A94DE6F883961DF23801A645906BEEF9128F3F6C9FDB57E6D7B5EB46326C4C39F2C0694230CC28852D54281417C4D24470B9EBB625AD1D144B4889D23EC975CAB65A855CDA704128A61CC7C50C5ACFD6355570E07CE55578E4453CEF4582C368E585CE0F08BF786CDC2C0158E1A10971AB769872C52DAEA5D7C8947A2B6300815B42125A7B8773E6E8C79239D32D7AF37CB9D4E8688CEDCD71A213795B0C1BD5ADB0AA337989ED3E4E65DAA164C26946978C9468EAF74617C47EE4328C51F41418F2D35BD33D47A9A1ADBB7C4F5A968946A7A900C293C65648C3127EF62D58BA9995B19B10D931C07D67164B2E685FB840A019EF4752602DC9317714D89F6D9318256EDBAF002C40D5721525AC0D2BD2B4FC64138F0FCC5EE648E84AB6908C1AF71408D51D31F7587F1BC8E19D1C045D8921B447CFA9287AD03B4EDFC3FB85C7792CB2C479BD5A14B72EB8D3077CC511B0A7364C80C32F11CD1EDB4B3A0806BBE9D7765B091E04F46620C23DB801A46C544A935FEE00F0A07927171D37D3FDAD3DFA81C40CE60F93EB65E667FE032A79DB745EBCD7EDE57FD51B647CE25624444199EE2D9647FAAF9F43554433B25CE78098BB33CF24", + "A888113D9682BAFE58B278C036FC2EF41CF8C156C39D67C378E4E0EEBE750656D67250F8447C420E6EAEF139A11EC90B1B50CB582E5089694A4BFD843602382C022085141A7B8AA1DC5F68469A2C2AB04BBE91EBEDAFA2A19CF0538AE9D47421C3F98084073F340F0292B8946452251630987DDA49E56A79F1562C1EF57134F036A5DE932B2AF9ED5D24D28463DA55F4E7C29045DE9CFFC4372F7A6AEBDCBF35DFF2D952D90BD4650FDB3BD68F25B65A7876B65C5AFFE8B9CB06CF91B88A588136C80D9CD361AD83F25B6D1E17D161817E64CB06262AFED0417DF26B9B3C0AAB0A06B1310A7375352C46A410E167366AD768559A6DC618B416395F432C0CAAA8D10F88E9765F36B196B37EEF1F1C13C4AC08150C9E4CE45D9B1663FA317263672875E0BB5CFFAE2A132A6B431AA7099E47E7FC8349D04EFF0B84C3E8A743572C4B1EF38F760656E49FB1A4DF4E2D1F6B24090EC675D299B32FC5EBDE40BBC2B1DD44CC01D1935F1FC084749DF9713DE41365D8CC9AE5041D60967B25E16FF1941A9A7336DC2D46DF5AB88C14A4BDEF077EACFB1F08B834AAECFC75B5E3C1BBAFD3EBC73E187D862411AB97D694B2E557C47E5093FC15780805518758B4C5B548306F92B559DC58475464C6DCC18D2B3905FE5F60B4530F87716107A1A4EB40090C23527895582B02141386A726FFA11E9930B6099B22816DEEA2626E60F4B17C5E175A852A2E174D59FE8219C190D0D6C50C14A3C5215BB193FA56209CA4D14AB2DB5CEAC2B3B20CEE6DA1F798B681D2DADE8DD13674B9156E5C3C4AA09B1932CF69D62621DEEF990AD264996069B01E6F7A21F2E5996251D09FD955CCA7DAA902FA7D46E03AABD4FFC5A1A873711FBDFDEA0935C399A0178CF2516FD03746B86B5A80576A34119373EA7F059A0EDA3F0D18CF33ED63DC27C8157E0C43C537E86FD37E58EB5ABEB5524FE8E19B2298B9DF539C7C31FF0F7AE96A56FD3806B81088DC13224131998DF42066802ADC2A08AF6F69D36A7B9B518430C5532D3AEFB20BE0BD1BF4B2C968AA78331C614EE51B8E677B19A98E30756B39BB6A1AEF0E91915BC91D98E86FFE7584BA6ED8D6D51A132EBC124C056FBB9363B8610EB3D7A77A3E581C02E7D25184ECE47A688E718922E4672CA9567BBA9BAEC81CD8DE7FBB8CA04D20B51C850DA2A4AA63E87FFB27AC89D18FAC40AAFB21331AEDABFC3545333E57C73CB7D6B601B7180E4489269001A6786415F4D1ACD8EBC3CCD8E78F6577A9E107ECBA3EF5EFA242F80202C1EDAD26D9FDB8F43F70D250D899EAAC973042149B8F0BF7327D72A49222B5C403645BFDF3FBAF78F2AAC71B9FB582346CA456EC183867409C18E11A1BBFE6FF5B681B0F893778C87A9BE8A67E196919945F4F22D70FF5D85C55D23893E7EFD9D685C41B28B118EFC905C450A9E91112C5CEA2475EBD07DBEF0A125C298F467377E2BF8D4BBCCA25A2DCC4AC83AF877E1FC820D09F31888802B3226FB0129AB9E47FA65BAC527CE74BADAF59F95CAFCB6EFBDAC889EE8075CF7C71518535DA63E7BC9DC5668417123CF11DAB1070B050DEA01F46BD86E59C5B3175EC1C0C1244E0E7B5B6FB5D26979393E430C7B79893E3BF819380D206438174038764B7196DC0FD94D4A9CB8382CEED4490C43C19061D2BECABCDF386F1512EF3D635601E8E9CDECE9A452A0E6C6AE0D6BBBF3AFE226A46AB3285531C7AA9E0FCFDE0D9A557F20E9802139A7C8EC2B2872CBA3AAE87F0BC6DA226BE4AA5681B114E080A399BF7480E8583DF2505AEEE32E45C4112FC48", + "DD364986DCF106EED4C8705C1A9FDDF9480D337BE5C61AA3F661C6968AA01E3E454698FFADF366C73599B987DE85005C9743A2416E637E4BBB67FFC4D35F26B7539C33256EDBF680939CC8986F5BF32D2ECE4905A4F6A1727BE1131771954856A1C66A402FDD0DB86B51E9C02E6BB136465FC4253C8D98FED1582EF8AD22828B6A35580FD58A0038A9D97FE2F661F312658041839969752C4ED321D4EC8229C5753F399029B0BD5F065D5A19CB4548C86CCC1F3A9873FFB9E4F421D033E4EEDD4ADBAF302E24371EA97D817AA33C72708C1EDAECBDE7C06AE0C95D8237517666D0FB43B2434BC50EC2BC8DF1E3CB46099BAEB869B251E79E9B175B75FF62F408A5FCAA4F6DEC90F97B926272389696B5E38D26B946E0575907C358DB17D046D58D061683E07F1B075C10934FC4260043AAC28928DC877D27DB9BAE618910564EC3EDE3C402E86BC3981203CB7DCB9940C37D948556A57A11488D1332B05F4E5757D470A22D0B86C88DC456CE014B673CF5FEECAAF26F4662C9B243F46969025692E445ABF375AECBAE50EC9E48AD25EE1D1D0C16624CC5BCD1BEA8C8FFE3579C50B732625A381002115A1D69DAFF5844731F41AFCDE42CCF1A13FC98A64FB9769F03CA631B1C3ADA6A98F40343BFEDCD80966652292B60DE83385FFEA9CBCBFF51450C768EC8C4FF6FDF2F76FDA7D5886148168CE2BF693BE0179DE250D41DAA80553488D4DDB01FF97329E94C7DB33005B498FA8408E13FD5BBFE079F6E40EC5C8B735EBF9914B932A82441D9D5136C662294956CB52939F4F7E335A3B9749CC1B9F374AAC89C9AD1E718BC469CA21D2CA467F5DED54C402BA0CEA000DCC878822EE3E1D329CE76E421305178FDB31F5DAC177838197C5B46A4F96721139695EBBCF39F04BC1BDBEAB567E8FD812C355CF72785CDB3A6909F801BD2F448B3EA0C7F96D09DBE4EFFB1CAAF2A47FE6BB830FDB937CC5ED2B485AA6B85DA799C1266562DF181005A345C62BF94004C1B8D85AC06D114C8F2C5E2D569C709251EB929237C76E9CCFB9CB39206BE3C391FCF5E814E42AC2BE1576B9F0664B20F03BDA1F6431D1D1CD4C0783CDAA2A7AD32281A06B2BEC53EF1568840277EA4341F5570388045526AB214B477EA23023C13F4327DD0C84CD1744677091B21D8F95F38A8904EC5D6542AD6E3A68B355D688B1F6CA50DB7181272B3D564B1DE41C14575217FEE44E5B631CA49995EC2CA787EEC4533657FFDDE7370329C9BCC301B8785F7A307F1D06F88F21F5BD19F94827C128F799A9C354A021146985256B3D3E8BE46AF6E370EE193BDA3494E0FCC7AA287C3A5B93B638AAF9BAEA46288DDF690A464017765FC2F769A5A930FD3E5A5F399B2F972EC286E81062B6BA85FC04DBBBC05B9971799225E2F0867B55CBCDCDD3B85D6D56C6948B03E91080FBCE3B2C5438491050BD2E81C41D5C2F6790AB1F327D2C7023FD891F8D6E13D6F69E7AB1604692F21ECC7794F028A8306657D72B5858301F5296A5FFDCBEC4863D0503749E9B483E4760AFC05682304EB17D67E016553FE9108895DF3EA98890172D795009AB414E4539C47200C56828919DBC1AFFE040FB3319A068264607CE51D387B9291B7483CE1C38C1F059AA86B68BC7F852D21BF759A56557AF5B4E8CAD60356AE1D9D11AB49CFB9F627DFB1AF5BF8A6D85A775B66767616FEFEF6488C383F5ABAD4E06DF0B6C82BD2582B284BC1D4B27168525C69FFE8117FCC38FE758B2DF09E38DCB1688789B2AF3A050142E50787EBF2098C229E6965FE134593AE47AF7FC4", + "B59F424CE3388B73A01C7279251C7854C664803D834EBE840CF3851B922071026DC17B967F06E8467AD73F8F70440CF20178BD31F8CC315AD8B3D213029D08746BA9FC70AAFFAFE2F393D0339BBF28FC15B8581667E9B43E0A1534AB70BDE8954B30AFCD4BF10B91B8BE2AEDD6489D590E0947B6155A1E0B4E7DBB7D5DF08A340FE33DEF34330EC77E65B57FEBD4745B0A07CB8BCEF0ABA92E387E2C2F80230818DB1F70F65F872A2C5580A6C39B9EF600C797FF0C61641100903B5243D847C7243EADCB69F69D75F4B1D921C72A4B5B67D11B78F84BD9682963E075C76350BC301641E76BFAA23EFF0FDA33B1A41729AF935C09C1E5257F84A4AA0AA3A54525BDF1E3A51EDDA6A35A2C2B6DA82E5C7FC989475D99585A9DCB66325B98C20BD7550871BF66979BA3D58562C1125EFF230FDC77A3BE8A7A8CAEE2F83C62688E0EE5D72D4C858624C7362A57B7C0065670DD8776D1E97F67CDAE4110E53E78BC17793CD34F11089AF317407B5F43E26424A752DA5AD58470FB8FDC193D2B28FD4620C879BD22A24DE4EFCE4FC46D7A5A4350136F43D21698AEF1B4C318156D574E93BDEAC252675BB1F1819B651D08E637538DC14505779521CBA1C5695CE7C5F9BFA3A7E68E14ECDE399144E6D514CBEA519FFD2C677310214DF222CD79C9B9F763060C48D8FC4E02DBCF0D6396F6A28BED4ADB4F69FA44BF6F52E7516E77CAA981712F10E94DAE683DF1CD858492A6B7C1FDC92B3A8A4B121B1C8B8791E18062548BDD31DC544FD94DA7BD77A0BD18B3940760A3746ECAEFEDBB6B99562E836421F24C2F2A99F686DCF9C57E910748031521E359D21A69933D3B3173D520E7B8810035140A9F30DECF99A117B8C81990473378C58D1313E29A9824034B86D46BDF15479E8273BBFC4710958348B17C8EB8EBF8581AA9D1032AD591B7AB62B3E2DE12F36BF0ED71CB0DB342D5233243F466291DAFFD75971427F37549BC74CC8EA2C9D61C55FF4EEF46EC74F37E30AE9227F9A346A5A379A386E4706FC6DADCC80FC7CAAF6164673DF6B7505C1CF8C1A2C262F13A65CF1DA6D3CD277494735E5E0B4366804A816373AA0A33F3FB3566D9811D26380EF7E049F004E5540E3A984793553B866E364BF3ADE51ADEF86D37A9392B6D0D518C0F07F80E9BCF795C540BCF8BE8AE72C0A0A67160F296E30A0F5727391F82DF95DBF2376B82EE6DD6C87C05CA191AB8F32671C4E404734D6626DA299682D9A49788A7D961B737282CF16DBCB233124C5EF4800E1F25316763BDD92F090088218C071E91EF2D76D80BD05D23C6C06EE975279B0505CA18623A33A4D94EA882A6C0C5510986D537B49BAE93E363833A8571F91C47F022A6E05FC7673149128E3876AB6F423CA96A7F0F4D5AC1682DFC05BD4D3ED478218D40A42A894DAD908A587A83299D9CA685C4E25155760F53B27EC3F3E722E46E63BA2CA0D353C60DBF985F3E10893A0BC01539FBE6126215B090F1355D211E833BC019C7BB351B1A51E5286A178F70DB39D3A8DB65E510A0A93FD717FF30BB586B8FF49D62ABD56F0AA4B01D2A8E6A3BFEA54FF1D36C8ABA385D0974C7F29B25BF12B1036E4926F0E70E6CDC93233E211693F7B315C15594790BFF888ECE21352C8FDF906DEB1085408C877A98BC5B145BB1D0945E33409EB01E243D386492BD62847AA67D4EAEF5E8B84468F70457470C1FA15BBB44AE4D77BC401BC4128654B52B2B8CA48721DBB267EFA7F0B2ADAEF8C2BE9516A42BD2FC2C7AFB8D0D71FBB8A6D7034892078F4FE50A3B63105B31451A7910", + "FF81F6EFB1CF3169B63C2F2544105BE42B20467E1FF2E4204601A486928A77571247AD40EF058003E423521B4196118088D773BD1694CC83C02219F5E16C31BBC7350A023E4FE0720DCA713444B455DA085653B539A555F37AEE9357BF538E3EA6A2C3B2BD30EFC32665B597A611EE9DDBDA9A9857FFA648CBB75677DAB55EE8528DB18C4A188C693A9DA0D7DD736401DA333DDA13F572D4652D23F9016CE9D39605B5E2F341F487980331D88511836C7560B9F3E8DF6FF4CDB7F74459BA199E081FA49BA205B368B4D519B2D0ABF92405409EDF1DF280A04F398758E5511B6E6325CE00C57186A0938974207E0059B2B8BC81156E2FC0A76E84C5BBADF4FDFABA379E6F960DFF5DB82FA306535F0A8C4D925246DF1D9B8C7A711554E9087A5FDEDD656CAE74357FC6AAE8EA0C72B74BDA7BD4898C6FC7BC50367FEDE6D5261B0B72E171043C89C8C2149D01466B226F6A1F3F3FF378E34A3956C660F0FC8022E15EA68DE5DAC57BC370B30F9DDCA6404C5A152831230DA9EC3662DE701767953AE8DDB9918598844202DC2AB41A0ED711D640F3C60A8CC69BD8D9340A32330F9D27E7A023CC99D173BFE6CA4F0604FF6E5B4C59EC2E1BD4FAEB3321F755B2494343BB6E647210041A1B96A02B7755EFB6B482B3C7122EEF9242FD64D0D7BE24D320FD33ED0D4DF2756BDB13BBFB622E7E928676D228DC395DC32465E0E3480B7ED2EDDE04101E9C0F8020D48F3D43A0F756622A3DD866B966B7B0BFC1F40B1D460D6A54A45ECCF5AFC93DAF8541FCC62A5FDBE907D2DA6397B3F7B535DD8E30D400610971E4960859DFBD4A441F209021E9E4B05D3EA0C80A738F0C4EE9B03492692C543968122FE39BE1F2E5D682C1FB8549B12D6F32AD5938FAF63C5F490EAFCDA9D7DB70681B5650081B098D0BEC87013C70F890666AE984C5FD92F6939419AB0C1E981FF6EB03B1A48D708438A8F6AF81515D8C42E0DA5E13DC07D22A0CE018105BA075A696BAB7CAF420A65E38EA1961B61ECA43AA0085BF2BA6244EDCB56EAC6DED736712045911D7724E9DDED1C05DC7205580FDF52143C07960AFAC71528C1B87BFD9D21EA5DA5F9649AB037CEFA5713647DBA70A2D0456A24AFB0B55B8C859F9C9617E83E12C0D963397DDCA09CB16E22A47EAD91206E8F3D925444AB85D76DE73A43AA45BD3B0412FBDF254CF273E5F20F6BD0D938E30ECDF159120BFB28FEFC0FEA1DB898D5D1E674452DA86C9AD4AAAAFA07AC6A304CEAADA8AC82870313BBD56E746E7C9C183EF5B53BFB5A374B955D053D1CD7E8EE25108BBB8F2A60663375832213D1B9064C9F12CA77835ADFE28D1A5E1E65FDBA45147F052948A507180EF21052D5FBAC2B3F4E46DBC4ECC7DE08D6FB3B6162432B25EEDA07911CDF4E98A219603E19FCAA8142621F546C898181E1761AE7907F624A5D01E36612F06ACAA157BBC316E9AA7568E359803A408B0C36B4593DA1B4D4D6D1E6AC290C90D19635394E10F0BE0B51165777517AF168F38B702DB2BB43ECB3DA55D9CF9E8166D99B971137F6845653B8CFBFADB778E16A8F64BEF8DBFC6DD4F6F9093FE629C99585D59445ABC30DCAD609903A26C181FDF481642043066E5B0561F13934247D19975F136C0E0F4CD41ED3F8E22739FE2D88358CAED503D7C36FE755ED34B9EF871F2323AB593A0AA8BFDA8DD3D86304E206E5B4FAA6B905751EAAB46FB576C3AAC9387E38A02A6AF8EC72BC953C4831FED1337EA65241E4D94F90A0E99018DA735E1CD4C835AD9F301A618395C8FD4C982CB5282256F8A4894", + "CE812897E0C0F7BA13D73227DA8D57F576A25F233384DAC16B5F3AA455222CF8B1C3F0C69F6E1EA86C6BE0DF818820D7611EC41F6078EEA4461C336D02847EC3C5644B85EBA26B68C5927D67E36BD381F8100B6BA90852D529419EBC8118A5354706D2CC769C2402E517A86809687BA7E0B1940A88F0B2586484EB7D1B63E119D489A41691D0C1A88543D43D8962D17FCB8E91A6CBE2635F4D0814A8C9A4DCD7767CE7D62E8BF17117A6650E3E8933DABD4CCBA43F40ECDC46EFC541CAEF6271E87BE92E63DFB7C2E5B7D7D2ABCD56A0A19E3C9F75894860A850029ADA36F990DAAAAC5AF56B157475EB18943D7CCB8D99CD14813A27036ED1F4DE3234BE28FBA413046A26113124B5FEA24F4074E991E163AC879520669ABE6B1A0203FAD6E4082CD5ECE201A86EC87676E350021FB2A1E04AE9B19A03152F8244542B4D21B4173D05F159EDCE12BA12A5767363794DEF4D390F56208EAA7680AB527C2035B065DD58AC8182BD5660DF75511EE1E0F407F4EA72AB3FCB028C82D8FA3003B034EFF4DC1C179029C452BC4B4D75AD02CE9E393C15872F8D130AFFAAE9A95640EC68771EBE628C42DA59AE4AC2E9156534430D00164E3D2D28665BD2DE6AC1482EE3475F7E00F41078B672835B435711C560166CB4DF17B56884C8A66DCE5D4B42AE675335EF457AC20E4BE7FC32FEAAF7EF4CAD795ABA7F9A20C6703E7DADA30B63CD6CC214114242C81A9614712271CC05867595D9938ED557007713F36D1A44AD2285A564C9B242AF6BE9979F7C474385680FD574D9D33B8E2DBC1318EA71977FF83E8977B93BE3EAB2401A136E021DA182B1AE68007FB36067507FF6900AFC4743A9A8503B7A2CEE04A1BDBE9D661691E5E8C6E5568D16F70C15D156F45DC41199A9C67FAAA36D8CF67672717ED0124E996CE855392F5A8BD24EBCD644AE0CD5B1AD2711200130AA4F8D3B4599AE660A56EB6E192709CFB8890510CFB0195D7FE794B9EDBCCB25ABE6F3B6AAECF3FCAB9ADD6D270D3D5B934C46C8D6800CFCF99617AAB8192C28AB627EB0D6234F7C68F0F4241662A9F062B361FE89E92BF9254F823E4164AE54661C2991A56C4AF8884DEDCB20EAA02D3097F2D5BC45FAD616F2DE3F37FE2DA9CAC838ECB3BF649AB6CCC38675126381561D546B37C743241297476497184A861ED1FCC75BD508915AF39752866B39F1BF00799F3B254C6710D15F5F79E29766E3EB75B93CEEAD0F3D454A3A0A4B9B88534AA91B604424CA1F9801F7F16E0A5489CEA18CCF76537CE33481328C83F3205B59AB1BAC1467C56A28DA696DF2B08CD380049C5E0FABC6AC8C5C50F9481161C1D60B0976FF459B2C11679DF8239AF63C1379997A8CDD47954DA1A9ED1606A3D1D2700A2B9B0C9FEED839E011D52752CE543ED224E5241340CFE1219A1A0117E033F48B262A6C83FB13BAEBF036C2ADD4ACC5D1CD9C5C334F4EE7D964851D9A5B7CF5A38B3C1CCD6DFDB5D1AE3FEAEDFEB72A25C7CA779DC4602FA0E6D8C4B35900F634130D48BDB8291B7BA751256EF38FD6FF0D5662C1691B825714442F5B633B30514058C778C78BBD6A70A2096CC9A375AA99CE11E8FE4388ED8D403EFDA3E604EA77820D4D7A1FE7C51B73F286520D56DF828B659FC636DE3DEC09FFBEC46FC143D943A09634A91194D77F0A70DAED26ABD3F6B51457EEC61F9AB544F544B21A1284F0E70D75DAED0B9D0FD864CC73236CB64EFC7C696882B1B408B6B02F35EFC4B5DCAAFC600330C59B1338DC593BC22C86A1C4F16D72E7BD622A3561F60362F3612580", + "DCD55CF8406A7CC9BA0A5224797D74777689C4FBC0D202DEA8B9773A0F20DB0438BEFD40A996EB2E3F49CBE2E475DEEF73F112FF742269A701AB43D8E47EF94DA4056086D86B1FAD636D89929C60238133A5B61DC4B7F8DFC765CF0C8C7206F3E0DD3DA13407CA75EA20F172AC38C42ACADC946B3B18BBB30DF871905777CFE0D3BE5363574D2545D0214D6A43E2D34B50D7FF7D9F2DAE7053736B71FAAECFC2C355C1DA645A995981E1D617BDDD14EB9AB230D10085DA1AE55D1C9E55C225997D128CC2393D6E5BE9F1BDE1543DCAE918B38AFD5FAE6031E105BA12EA4162F7E24572688C54291A61635C9DA26BB367348473D4DD4AEF9A5C4E8A6512AB149D62F625D8D45576FAA4CE28E5C3D52D293A0D5C48821E1F5CDAD7257C97B3C1A6DD83A4ABB55F780D09964D4B3940D36B6709D00094B89F319E1C2CBBB3EC33A6F0398880B8079E6A39DE697D76803B04C230EE980765604929D60733BBB6382B4CA4B13AD3FC48AC9F944B97133C5AE6C3B9D295A760D786DDBFF346C873C2DCF3D2591926116A318F63835783A33A17C452AA6C620284BA99DEAF023972082AD2B370CF3016F0739103A518B25AE8D59BB017C8199ECCAF3E908F9F144C778E0F5F47FA06FE8A22E3B2CE3493EAA8745478D653F8D3711F832D9212D060A7F0B0B62AB9A3C9BF012B61A9B5E6DBAF4B48D9031250419627E96076925AF95E2B238E8CD227A0F3D8C9C3BC68D5990952D6CB62803B8D193FB06120BCA9B195E92B995B86B92C455A6145D3F77898E457E1B938183E1D76FF61C163057A4D70697507BE020CC28BE6527CE306A5D2506B86152B5E3B954D5A660C79CDAABB2EEF0D135C0D4AACC7FC3EB5A3575D95070B168FCEF4F9B36FC3D55B84DDBEF10DF6BA659F70CB2AB82FA001D51ED0F040F9DAD4129C324BE8B44316C0E3E15B27C2A8D54A948585834C2DBD40337B61F58F3AB99B3303D56EC1D30ED82F29CF6A68208B07DA120AC4073F102F4D796E38628D344384551810998F6211A082BA225A1B7D63C9A3E8703DD945BE1D979677FEBE715396988A873B88EBCB10209E4DAFF939776AD14C5DC90BBE9C1A57581A145BE0D4BB47CF50721EFECCB50C96E824DF93D675B1A1B4D920CB1EE82B0369094DD84FAB4A3FA94F152F87525ED6D17A800EDB1BAA6C13A2EDB5C9B7C5A82AE5824AE9BA63156EDF78517AE2B357C1A1E8EF6CB12DA415A914FB69FA633527B8A1659292D079B580DEC210231BCA77465BC6A9516F2917226957DDDD9787313FA599BC2BDD14DEC9DCAF0F2520318A85C55DF40881FF65E4AC21F2C9EA3CC06651309E1F89982D45FD6EB5BD588B647A80D27433EF85080A7AB2FFDBFC7D2B54B215E7D27A333D4942CD23D53142F04976093CC0344C19F9CB3A5A4D522E26B7E2C1C85C1ABAE1B4A360945A46D097A1F3676A80E3BB9CBED0BD363CB70C2B250EA053B183CFD1EDF2F6A211CE618F70EA1AB535E96CDD0B2FAB7CB7F0396B6DEB59745C1BDBCD452FFD70C95E45B88325A82CF07EFEAD7176FAF04C8C3E0CC4458540BED99ABB9F52AFBE48E42C636DD076A37C07C8E4EB6830FAC011936EC047F6D5B5857AAF90F80B5D33B502A116828BD27E30B3A69F351E22D943A482BC6BC41BE7BF941F3AA7BF85A2BA5C38FC930680FDE5A4E174AEC4156A755E7650CE488620D6CC62BF9D085FE1782EADB11541A5C19C9061734513316B9CA608A6E48D333A110B57BA5128E9331E6266174B85F7B7D1DB264361B1C6C044A8274A7C8DB19C253BF8DAB819E85130E920", + "79E4509D63EC15D4930F17DB3EF8E9ADCDE82C9F2308A0C9F77359575876D90A9CE5ABBBFFE09B8E145F35C7E91B141F66F74B3BA923D9ECF863A8A455086DAADC247872C953476A85772079783A6F37C964AB1788479175F7B4E9651C7DD5EDA94F8BCFA57B3542788FE9547E0A444D249976333F99710930CED2E93B1526A02BFCCCE416F0CFAA631B878BF23E41F95770315F1E169EF22B9DAF0E2F269E06B03B125CC6F20D2AA9A13B98CE23FE3A7FBC70CD05496ABD89ABA5BF58FBD8D88EB9653963F0452CA43CB964F7B145020D637905E8D26E8CCCE4EF892BC48381303161644FCAA1DB9C4775E8F0A6367F1A842C3101C9F94730F6724257F2EE1657CC93950C9C1F20832DCC11E0001AB347781F21DDCD4786234C908772B553D7BDF4795FE69D7D55E950D4C6E2A76C44995CCA5C9CD539ED235CC55DF6A004C1BCA852C2813DD17F333CF67711EB8A5DA439D73271272D0D62B34DD457C7412A26FE2F4F23E5F5AE8C2F91DDF86B7048A40872AB7C728B20DF7AE2A0E8E52B00899C565E68390DFC83344DBEB7257CF8031664FD93DB65738013BA234035F11B611DEA4F74B1000724B2682EDA9639C11F4F4580683DDCA2D9159F637976293FDF76AE2AC7EB5203766009577DF87D9DB654ACD64229495A5B4A94AB3AD8237B9CFA2B5AB6B7239A5146C777C4A3CCA9E1573D96A7C1B333F11D284AEB55DBABE6B4F12A421FF7BD442AB6B8A7FC33A2087886328B33037EA78D9A7015ADA2C8F463AC1FEA8FF3EA886823063992176C31152573C10516BE386CDF81A6568D8E3BA2FF195B23903C95B16277BD60D238F309A7DD6BDB4ACF4541A56DF5D3D4BA4078E58641C0453B1BC8DAAF6F1DB28836D6FBA3474D69870E07997DF4541BDA5C62291A3360F5C5840752A25CFE366186F7E4E21DA0704266B5C14ADC1541E463917D5DA677945574F800BF47FA028E82200F9E53C48C887355D9E3CE5FB778341A356423D00B18D3048C92A80279C2785AECAE9EA57F828766D6F953AACF93FBE8A4C32C7FC9843F466141DD018CBD05ED8A16E27B43C5C0EE16045D39CDCC7E4A27EF636408E968B4C99C895CE77288C819701EE7184DFCE889328E4CD2D8BA7BE5A1DAE50E36D562BF2441B56242EF9C4EE63022F88F0F77E6094AD7DA93F672C06B6BF4ED5523D1DBE7D8F13892BF90DFFD5D2A3BD0E9B56EEF03E560BB28650D873116C0CDD00148C90CFCECB6BE9C4BDD7603B5CE9FC458431C00B1D704702B552D847D0C89265D842FF6599A150854848B730AB33CCF2BA6533638860BA564540C6678061CD97BE3D00B103314894AF13999FCBDECAFB5A895671DD1ECDD95C0C94A250B014CBB657ABE3028C8D6CE436FAD8FB7BDD12AA2DA32FA6435889F1B8C16EA8488FD6AFDC7AFBF5358A31B23E0C05E315B60F180986BA17E26621D92CB639A0B815E65D140BA8A68F99BD42A2F428345AD3037274E515684EEEF018BA41A7B0138D7FF2C0B838823192FDEED577028052EE73D65E92812E4C33FA3CDC11234F47F702AD81F3829ACF1910B9D00167A3541372DB79996FC8F4B15F2A56B272B7DCBC4B074A36543B12B3A5396B0635068B62F81A56E33B40516A376D4ECF7BEA4F8ADBEAEACBDBE23F5F311A39D90D0B11BCAD30609F6CB4A657CC620CF8F727E30F77618E5870F72EDA78EB89399236F7F5432560049262E29A2979F832F2B57CEB25BBC2405A3098CBCD3CA0CDF631B37440A47D316F4860597AF78E5ACEA13E8B8B5420210D7BF54B1F07A433E7A2B193D7EEFDB2288", + "B63460020483CDBB47DB98D8D720FAD57072D41EDB5FF2A2CF65DFB70ABF3524003842F7BCF9D36F8E187F86B864C5FE0181E5E3D33AE11A50E67F56DE93387F5CA7D1641CED92F7195F2ABCC7B32C6C7BD8AE561E36A6359BA6171726A2F9B00C7655C7E346310C6EBE10D2D470BD5BB7B4C88378DBE2352AA45EDD728F42A3DF3B5E80BB6B6BF55CD663203437F575F769CACE66809FD25933204387F8C51E0A6B2C4C6113DD45D31AD7567C9B924D5B10F124F6C1CAF3458B3B84E9E42DBA9AC879E2D711ED8681207374CCD299FDB7D7004678D56FFFE0CD34B4858CC0CF4F611D8EB5B47768D69AA69BB1875E9C397EE9453D37D4983359393A02941E772F912708085F2FC7211DB358EA5D4E00263E14A1CA3430A6E6FBCBA94CBC8281C356B4114B0E0B67B3265D3E1B9A64B1D4BA5501CC0F6E19F56A7B3B1BDEFD8018340ADF7640C58FB26ACE46B788FCA44BF228A737B02F160B0462846DBED0792B27FC6B55757BE01FEAD3655FA9E992485E2B29321816B04C2BF079BA5CD01CD7DC0CC8CFA471FAEC74C95041B7C62DC9BDFD11FBD4D3B7173A3A92044C793EDB6AF4DCF760D38D3D412B3B292C74E08EF4B4515B99A0D4A167D9103C3E776E213AC2C1614B432A8A7D243B0EB5E7AE82118DE996BB55329F49ED4A7EE738350B565F50CCC313DF274EA203757B372D542D451DB960DD8D7F0C5E532AFBA105C7963A39426732E2E30C68317C4CBB3C10802C5104923E9EAEC89C6F421B8EA3D5039D5175F1EA854971407C7B260BF57FA912DF3829BA91BEFC9A7A88E5A289366A88E7E6C5C4D4781D583CC15C827A4FC753F66C81B5095D51F3069AF2E3BCBF01362F118690C35D3E6B5C0F41F4A4964226E4646DBD948FE2D1AE837C0C0062F77A40DD02371EA4B69BFD02803AC3AB972CF450F59FFDE724F79DDB7D534D261A44DC4BED2A47E78289BEE615218D1F861896AE5B07729568508B0E35F82BAD9387B52E2243E456C2DAC3F82176E4859A8288FB8E2B86FFF4BEEF93D9F677CCACA1E760D045F28C819A44F5F678E61585B74D49B1F12A9B28D4056CEFB98845385FCA12A6AB0C86DAB01C7E8BF5D77618F797288706F18DD71B33F909CDB15A63047D0EC462BCC02AA7E6D4D4D5C3D0C5FA2C03502EC51D781E8CDBB63A2578CDD9116701F7840D6A268DB082223F3D42376C5D796557BDC568791BB3A5BB6A9F501837CAF0ABEFBCBB500868EBE0FA0184ABFB927A414A87BC3A1903DDFBAC369B77B5C9FA203C7F6CBAA7BA826867CBD37AFD20E32DBCDCBBE7C12E3974BA0133B9ACE768AD4652C3FFB01D7E2F4EA026D543B2292419B10DB09C47C110005D667EED5D066D4634175B58F4BEA53CC39F2D1A9623B7C9AF2ED29A37891F2BE24418746A233743BD340256801EE39E7C05932AA41B56F7DF4E479A365BA224E94D72A395741D3D8135208C96AF089FE2FAB29B9D7DDB02D149275727E12A2358F4CAF9DEF137397AAB54DF78F5CEB17CA323B696C3267A4D2A944C65B2E8F542A2F0AC3DA7A9D6F2AF073FDED7424942B700AABA291FB8672DF10AFDD154218C0B0088E84486EDA5F21615C06770A2607E93A2ABA60B864505434ACC6B6BB15BD00C3881E59F0B481653BE10929E7EAF4A90BC181DF76434C08F3ED37D862038232AE6A5C56F36F98574029AF4B4A280693551082BEE4CB6DD4B55E00AC4954F2A01129861DD2A70FC30FCD9073FD2F45B31CEF9724E673032D0C87B2A9FE7706040293B6DFC3A3197AA58A53997BE5A2A763B027D5E14152774E3FFB8", + "6D562B96C4DB6F8783C945E358693B3D99B7D8E77AD50B7FE9F5176AF257ACF63E037ECE9FC071CBA13080A08E1116AE09151BED458CD8BC9DFFE5744E0CD2365293B365A01D30E894F8616AFDB6115663FA15522C8CFED9E6644DAA1AE776E0BB2912CF584AD1DB53E90043B1F93D67D51B1B10179F0FED6EEB52A127BE857341CB5A223864C02E4AE3F3902C90BACAFBDE2A42D73DBE88577F871D9C2EB9885C7CEF0443EE4A1C449951B24764CCBE716487F2EBE474ED6DAA65E393F1AE17E52B75EAFC245A161AA30CC8250631DEDD2B233D202CDFD1C3DB64FEEB2F515F2568DD7C11DDCCFCDD77B9D1182A29AD5813791DD9987BA735082F8A669F38DDD84EE7C09334AC732849119D769DB8CD79375D1C8EB4E051777A057A4738FC4E06ABC70F8FBA6B52948F91FAC2F2E248F0C417E2E727C60872F905DB2CCDCF15B2363696424BA5B62E98D5E4B51ADAF38DC97144CA32BB6DF129EAB07313059C725051883475E30B25C8CEDC63BB517319ACDC1E0ED86D5BC5790F11CD2F4B2CD882345706A4CA5863C0395C3159AC3D7FF8F7B5F7B59907CCFAA53EDE296087B04FFDDB0B221B3DCD1A6C64A591729A039C230CA52C94ED2C3118794876F7478E7968F962004F01E8FD0546207A64C09A2292376F77D7789CE2CF04995C7EFDEC91B5F13EFF915E9158F6202D6A7B0B97BB1FB121FF99AB12F56732E9049A2C33597A308A47FBEEE3F530E357BA6B7C98D58114D89C0E9599C6B17BF409B3B63FCF67DE29FDEE152711B63C02F919FEEE1A31636E36ABB4F9BA607020529814E06AB2D8E4FDE4D6C1A0D709ACDD7E442B1EB65643FE7D9E8D89906915AA868E9DB2E070CE6511EDA0506A19A731C0DFE149788BCC155B829D52E2921430566F9DB82DB062023BA5FF61FD26F8209421EE8C2C22FAC9F58059D223B4659A23BE538BEE894015F8E137849280668B971AD628CC57ECB49701EA1F0CE2D07B2D7D8406FB1D2E010A51C02F6F8F04F38703326711B85ABF70D46D947A42855B7F13B79D39D222A3578D6336C9B8A69A12DD38184EBF9DCF787C0D7611AB4176294C239B60351B62309E5DBC92BE0C0EE1422D9074905131757F70343CA00ACF2CF9DE239D8C794AC868565FF9900A1B9D187580884D509642AB4F6331A89FCBDB367067712B7B4A7A32E266D7FE571E4474FEB5DE28CC0D480D4AD11D0CF6B599A56925D68C1B076CC57612290221AAA0F91C8F7D21EAB354310250A224BC0455C760F62B2981ED68F7E10619AEF954B79D0D0DCF039DF951BA2245DEC02E71968009ED5364774644E995DCB33A41D53B3C9C1BE952449CA8E671E15EA888789CCDFCDCC91E0ED093CBFF538909886E27972C9D262F5E1A481B8F483BFB311D1595F51FE1AC8CB43EBC92C0D17868986B6F2BA8127BF95E159776570E273393FEFE203FB079780E675BD62F475CC0D1DF76CCA50B5145565C3615498DEF9B7BD37887BC6988A9853B4E639C1BFB61E32954D1166156F944C722444C29AF577C12F567E568BB1BB44A9D0783F126D6A079345C3842AD6240F1740585102F558C5DB6C22A057EC2D902CBFED926BA5F9C298E6F9118B9D2B446A47E4DB2F4F1CC30E75B6A1B67FDA687E672E7136AED3E02F8CC346F520E5929526B6E9126450E708D30168D1A60B41D19949AA4BA5CB7A691DB90A7B5040B01518FDDB6035454280BEF79E019FB96D899FD97BA47D0A7EBB39A11A84036659598294B0B9A905CE2E0CBA0E3AFAC85FEF2CD3446057ED5DF2FC389D411CC3128A8DD23188F830D90", + "3A9010CF2726ED13F833686B6C7796E87CEEAF4A99B40BE702CF35774B6BBE4EDF528C39A8FCB1B04AB9D25FE6666535391A45D5DA45D8073F705184427C3C5C4225F66F041151A22423A1F5516C744FDA91305B2B70BC11569416ED456BCBE6C1A47A5805B464EF6A645682D88D75E7FCB458BA2F9C44E14589D2805A904AF02FD3693DE69D0CAC00E058B26277018C3339EDA876CF820AD6C99149BF76A8C47ABF795EEF76D55862F4A88B26A73385589048B2E22C542461AA9CBB41DA58C7A5A32047B9F85426119402E531B023E3C8C1EFC7AF70D3D553B50408AB568E4D2EF96E5FAD8BD3EDF830FF2B12829E97C5C57927E69A438737B1920553F2B921E62A3E25331BD3BBBF99C9FE1912E0A84B15EECAD16B03D059876B7B02908C7A7DDCCC51E01213B4829D21C9FE65AE129F3B58B51798C604C9A2D2BDF7376FBB50732D9694E199DC532623309CA43D837EBCE0EE9F3943BF57F9ECAB4D939B2AE599FF5CF5370C9B56B7B9800A651FA64F854962A6D84E1270EFE2A481D399DD3F35C9C43605FB03315259989C4F2EB41B83C62DC2F7EA15B315126D227A0CED8B626022F9F665B49B8C32A10BBCEB0AC7FA80335A255076BEEA7E5BEA0472531B22E07A6579F9726600E661B389A221D2A6D2AE9E0059D24874BA5AEF82B1B53734F0835FAC5732FF0AED0F092E06EA84B3B5191BE3D226A41A6BC39AE3064A789A8DD9CED68FC3B902249622576D4086D63B924CB0C309F75F1FE9A62071FD2629E927A3ECCF3B575961221C5C1E76D2D6F1D330028F262E671905340C7621150074C49D9D3D64563E4E6C8B3221EBDFAD5A369E25DCB2C95A1E19D05B4ECB8E605BBF49623F6C62383A4ABF25FF823CB5F924ACF6D6173BEB850C46E0CCF6AFA873096046B7CE53271A33D18BBEBD6452D1874E312B9DD2035E511FA43BCBDF3E3A9EA8C602EFF6051AC0062232BF8A2C1AAAE76F0C12ACF4A290AC376A0DFA55BCECCDDFC1702D38F74BCC3FDB3160C3F52518EF2B1E14CE9CF22AE5E4CF2DFD531057EC85896708C8BB9D810B7D258AE975D678F19139A760F5609F57E2558E1AC0B6AACA4636017083D25190CECF73D29E2F7B44393D274074A68570B720EE6CEA533AD788F9A7F127BDA09D43F96AB9863B5365C9361A9EADA698F5A616D5EA0EB9F83B0647698DAFFE659979F5A5F086FC8B59D53C737E2D38EBB4F74C5CC6429B526FEFC9D1426969AB14DBD3F54BEBF25A5A8846874562CB282B2BECBECEDAF015F41037486297B30C905572211F80727CEF292CB2DB118157E666B190809A10B177BC63158505BAB5C915D37626EF7CB011041B08B03FA92A40EC3E39BF9B4D7279A5D1E4CF38377BE6C00EE12CFB4549C036E75240D3DF9FF92B50954F461BC25BD155AF84316A1752B9F1834AC4DA1B1B5A4C84992141CCFB0CC6AC5672753F4877403FC3F4A52848786C976B18CE968509A4014F3C69A77F9CB4915A1E389C1EA74A05DC08B6A6BB1BE755365F1E96E06FCFDBC7210099601912F55F639C9C96F28460CFC392C855CB2D3986989FF85A0DC7889AA2F6AEBD3E1AA196F97A3C3A0FBB33ACD3BBEDFEE06606DDAC5DA26290149E6361E8BEEE7F2400588F3FF853EC85B5F5742DE3547F362B0A094D6F935DB0A2B5D1480DB2CEFB9D665887F6030358AB9E5B26DE8955B188C39D6B146063FA59D1BA260796A2DE8CDDE8560915F07087E84589340103CCF7E1B75AD5BFD209A99C429A52E8D4FE96EEB9A32A4CD24A7940B446003E1F8296EAC6653659CCC3C85E01F7A154", + "59CD72F81F8FA04AACD73E9C815A312E8C02F1C1769FDA17C16350D9EBD4F8D10F248035EAFFB4FD67933279518E3BE9E1807288A9D63A6504F3A31E7DF322AA1B2A9ED3C23717C0C5B134D2758666CD04C2FA8C1EF5C1E58870C5EE1378619851845BA80DADBC37A764BA17E6DF285BB3DDFE31A56D4BAAB0FA622B8D3D24B7F91034D2F773FE578C874FAF5204F3DDB90B8533906AE05834BE67263447FB4485BA069EAACB68806028CFDAA8FC6DAC6383837F9A059EBD1529A92F98F44D55AC06083D6B751FF8F9FC5A6444C1A7D346025AD4B67EA12439242FC02D228CE537AC9044F6D193E0592684FAA4D259DFB00F5F98DCA9FAE4C0D5F0427C6936E501148C56EAD1817A81DA30989D0D9C85BF8D9972FFE67AE3DEB2A8959D63B3C3E7737A1851EDC8B313D75AA7838C6F7750280FFA6321CC9228ACC596431D72AC0302582CA56C6172599F30D0CA04E71F3FD7A03D467E37A8320CC0FE3AC72099CEF7C4265F7F18E2980168DACF9C058E39EC9FFE1EEBDCEA5F78D63BB18BF054465179401346D4CF8927580B9E0370B2D27E4C6BD4687CF0D4348B04BECE8424A42B2CECC668DF9809F580BBB3F3D59BFD96DC8C2E57EF5D2989D6DA54C04B15F85EFF639253DA3301FB6E6F92264FE48968C2C2CA6D40C54C327E0673BF769CF116DFD70CE374BC447AA1B121827E5BA510E387974B19B050D9909185A514BCD8CD374EFE2089290D3DF46D088D74F556A8E5F36B08AB17E54143B6FC374BEDD6FF88AE74E71C72297A31E13D1F668DDB455DF00DC91DBBDB2E96ACDB811ADF7E4C1C460D8FF1FB03BCF95EC489446A8DFC5D2220E58CC298FBB7A9B8EB33B61F6461D77CEBF9C36BBA32B34998B7B9B7950E7E98857371003F40279FC2623F716B808912651E55A04F9418989047331C454D2AB04FAA192938209261029FB3C070FA056D2AD52BF9C7A0535FE2868888BA55CB9389E358CEEC68D7A0E5505FF0DE4263C6E47406EEE83E8C797BF58EF49F2F8BB4EB3656A2636A5EC604A4990001190A8A7965A36BBB41019EE19C8EB45C10173B513F617B9688D7102ED82E60DDCD080233A7B3B43B641A3282C4AF6D3F01BE30DD78AA184B9D565F7B1F927EDE214E363A18547263412EBE35E939942C4B5EFE81E439B325902EDD4D2AC06340296D00DD5F0908F5C8AD88049D88282D0F2DEC28D133E1D4736869C352A7CD87D8A56687CC25D5517A62F0CA5A023E8709F181A0D96F1154B3D7517EC5B076B7C59DE90A223B96AF93F94B11EA0EB08A280379BE028DC494C296BC46659CF9C26A3F8BBB47E063AA4EBCBC9873CCA2866865CF45076E6E642B8E3BF9F4A3F9F057DCE71D4D5F3B621D8791CA5333398ADB31486D22F608E9A8745B9548EADDA654F1D4BC042DFF9B3C21B15AEBC37050864E4275D5C36F301D533552D119039242BCA25DFABB524C971821B2C0EEA602A4C02C6487DD113DA4DC5ADD7BBBC325CFC896C942682945A1BE921FF71E6D76FA1E3345589B53C549BD5056FA01BD688D0A9011497C0DFDEC20210BC7F8B713C46A100A396A9ABD9A2BB94E5455793BFA28E39E130645973C30FDCDE52F6C272576291F0130474DC2E3C30EAD54818E9F531A538028DD40FE01D993DFCFF82679DC3C66850528A173FBB534843AB540E21C7731C65044D697B42694A1654B3572FE321F61E98EA22171580F5DB90C997D0C9C7CF44D174E8D24F500832C158278CF62BBFC6DFC46AEE5DD3F8906A5770C3BB6CC3B731243974A76C0BCACD9EFE37E52CD9751894A68AE3596E0", + "C0211AF7A94B37632C667AE5097F8B5992917210A515C3E48276A363A6F5696AFEF5B3919689CC8F21E077310FDFC5A58D6BD428B8FFC678299FD053E7C016EF3A154A41DE5FD3C3BC5070ED6EC8F16170C880F82EB0B7EDED047436E8FCD4E2290F450963133226D17D7BB99C71097978CEFE496032EC8C6E73B99B05A33C4F5373BB73CA93F7128A9818197E6FD2BD88451A4D8905214157C4259228DEB5F8B216FFB206E4EE1025D3E16987FB6064147D3E99CEED73112F62D513C8B6F19B582D0F6794B307E8AF97354573C758AA95AB0A926386E7D288D74F9C6B0E2C71EAEBB36422C2120511F5F3D2B308674AE355B1FA1E72DA55098AAE3C70CB1B85C902C103056E00EBB70D37F08FA4D90E860C74E841F4E99957B3097ABE602E65F07B8787DA172E8E9ABF9ACDCCDFF6FEE2F902082BDD49547EFD95B54C3B8F6C6D243D07F16819E03189F0A3F3E0D05B3AF3EC92CA08846FC909E809CE9C30F1F3AC6FECED9043245A00590CBBD83EFC41C9EE3CBD0E328426F821ECA32E0E84A8B64F200DFAA5F01B262F4E816A90AA33A2984AB8E269B8CCF61E65094FBB7D10E11F9E1022CD97F17011DA53455B24E4ECD0793486C1E6D4E3BEA94E6DC9C710CFFF30CCD48E43076D763957260D1ED4F7C41EFA0B7F78BFAB7A9274E932013E605246C36CA1FFA003A4B24DAED61D15327BCA1067ACE961E718DD5E57667F5F33411D17BE093A9D7C6675097FC551014545727BA3F19C5D5D23A0922B11C4BADBF285A17EE96C916238C1E1DE8A0D28FB79E72EAF5AC37710B4E6550CEECA2F22697DA18F858507CCB95BB7F25A0056FFA55EE9564782C6042686195BF56901D4ABB3398C557CD47D30EEB344B532E77566887693CFAE50CE8C0BBAA204465FF33456ECFBB1B4DE4F8D6E2F3E8A84E90410EE3A79ABB47D40F4691CEF37E0BDBE1BE386098181EE36051EFFEEB0F5898738E400D44ADA4B3348315E0BE88C4C43E8CF95CE8D56EEAEADE754A09F170D3ACC44DB101037E001DCFBE2C52DC32D040BC27C1A55C9EF5D65FE418F3B761284C461606ACC84D36B9A7A3C9353723BEEEC80CF75D84DA7B2533F844E81EB8835289487CC7EA4EB277A4BA4BD50B59953E3DF3EBB2BB69D7E148792DF55D429B2DAE9B40B00FB14A948F2797B7488EBBBEB4B11880F7D3062D3C0561D7F6FE715C3BA6BC703BAC33C29DD87EBB84C178BA09961F2C10D8CCA42BFC3977EA66D039FC24CBD2A7B3316EF37C0D0F98D3CB8D5E4708B4287FEE6B656F1E300260D5643E9AC323A7F0527A7B98174AFD3277D35D6EC63865BD4E816351B8492474116E2426A3298606039280AEB595293D18EEC671E1E139EFC7936CAE3056F9698BFE95568D050F281F17F2CD65B62B98BF36DE469474F440E27073613A121370C606D5729DDFA12C8C400D0364251D850D90804ABF000ACE57AB195F6EE24163E8C443C8AEB641AACABE70675ECF22A5B9DAB6DDF0078EC89F2354C27D296411041432AF390DC71CC6141B52C54FC778B5BCD31B55EDDEB62EE364983E97BBB65EE98863AFFD2310B482AFCC28A2FE9C7D8E3ED24D20FFAD1F5B0AADB344C77F89FB88BB2FDCD64A77203BC331FC23BF78E284ACE3016FF570E3AF32ACDD5BD5E7B59115950CE804C231AB1AB80276842FAF80A576C9A3148F527596252E2F9F76FD6B4C03EFCE924A4740EDED98B290FF138926811607CC553FFAD5ACE0FC24D7FA1D7F3701A8E0D7F614941C9FB9215389CC5EF6D3CAC193EB15798CB1FF2950E2E0EA96A6B9E672CC343A7FA9C", + "28EB964EC60708D60D921BCA637AF0F0E19E127E0E563EEB30DB02F8FBF2848CEC8E351077A8294AD441049000D2A3BD101B691C2F1DF3741B8BE7DC57592C2D09C9F368010B4B3922A8A622887C37E959C9AC31DBE89C9EC9FFC26EFDD9C49362E3400E660928BDD7F67C6E45614ADFFB96622390AACC03F1186D18BD11333AF0348125A92EBB40370A32F5E383ED858F6720D43633A9A3E3559A0ACF5FCC326DF117AA495759FC12398B2E060F8C6DA823F3E58E1158B81AFEDE50B89F956D4F63619332928B4CDF5A16E0536FE7426518B1C50FBBEB4EF3830D77924BE1DB002BF2B0A9A8CD6FDF3BE7D7D1D7A3EB4E8CEFF8BEB9E2CEA9BCA74349D67413E7D05DEC014D1E6990062F0C4CF1E4720D45E23719D748D0C9BE3C3CA444E357F181E44EE841E35CB5207C3F993CF224A4A90EF5E3610254EEC4C2F2EAEFE041E1791518F93BE9080634AD5594B98C6D0161BAD23EF1403FEE6FF846D344BF0B42A65762804A33F00F12D769B3C58F123E14B4001CC631049F6E35013DF92AA50F89E71E78879A9B428341A738CA001E4233652802FC16AE2377C9C0B5650805205D31445EA0AC0F82A109E5F7C0758EBD5C737CF48D3D5D44816504D972CD2FBBF0AE566B8247F81E404D7DAB5A939AAE51375154A3125345C061CD479F8D7D9EB21C6ACD971F75D8430FAE557DE7A669C59E35DAC4E7686C53C34AF64A5AB7F6B5ADF48585417DBA3584D4552C241DEC336E5EBA84C4D295148B29FE824D3934F4D2A8EA2D27D29255988396A5C350421E2C2BD89B5D18155B20260DAED20E3DFF52F2E84E6D6CC2C040FA3D0B8726C63778A601CF95BCFD381FA520F95146292B8D854C5F057440833E78057D13FFFEEF4418E97986A064AC8DB74A001BCBF8B8E26CE9C68BACFCF4895C956666F92B5EADD27FF6FB032207FCD2100FE0DDEAAE8A860F89BDE341E59671BB0368B1C68B44B131139A44BB37EAB251A0339A79D358D73281325A594E2156E981C519419D925F0D6C8661F7C294D91F527454AE82EFF98344A6E39B2BB3E36431255E33DAA31B75E961FB306792510924C3E9B89150691BDDFB275B9128677DFEAFC89E6562FA245DEECEE2E788EFCD06C4BE744CA97693CC1AD7F0EE4C633D706AD278A46A8DBF2DAA0CCB69806912F8C081BF192ED7D17EC222392B6E84D6CD88FE66DB10B1EFB9CC7F3E4F3719338B8D6BBE47644009743829F288A194EB3F6F21FE7D7FF55F8FBFD1312AA603CBB0C011CEA377E6E2AD1541C5BF55AB73777BDC20DE77F701E7DF26728A44D881EC44E905608CEAFEDB670A261F2109DBFF79CE13E98A3519A9A86F3E01B7C3EBE2F01C657EE017F0740328B97392C6824FDF4D5820458F0DC9E999A4F878D09493D249D0B43268D44135C966B05AC8A69518BA5AA10423615DD3BD8B6E38D37D4E7ABAD0F8752A64736EB4D6656F6C3A6C6E1595AE0ADB31ADACFD6B4146F4496E739C4DC98835CE4C5E2F1FA899D4B896B02CE97822E90CABF5850321487D0C9DF07772031F1A438E9D63374373958DD9708C6BC38C3028C2C7DBC7B2A5A0CE8EBF87A72EA394FBC0046B62D60CFCC4256930BE65B22305C750B2A7483CBE0B3FC0824A011D274FCC289B8EEB9ADC5505426D8618369E0135FCA2FFF5456E480109952CFBBDA22758E14643AB48F11AB4F4EB475CEA238C6493166BF384B1DED53072D897E368C8BF8239DE53290766A4727CBBAB88691400E9FB9CD53442B91B5D421323A24571DBAB65B7EA7015775B6C8DE25247D0E7BF3DB7F2506B4384B328", + "D7554B01374AB97EE1246C2DA82B0AD5BBC76968B6E058A821418E0707D596E2A7E3AD9AFE623D18812F269C1D347A732BECE58260D2E8F1399AE5BB928716865B902611DA70761A4C3DB3EB0D332E58E081C08D4AF96B1A85DD68CE15A8EAA5B95F73CBA9975924F8F9A3CB57249A6A904A33F6471ED4F389168702EDA2054B4A523B6CE189B26C50900913CBC7693C4E447CAC4CA7B783106698CBB78F5E793284F27E182CE12BC792935FE38CEAA7F659967111AC2607C8316FD3CFF111DC5C2D58502555AA589010F9DE4F735D456CB9F0896FEB163984710BCA11C5D78D9ACE6CC9E2EAA70B177A9D33D8C59245FF9773AC181548BC82C751D59A350C65C895AA79E9B57FBFA2D17F53EFBE0C490B43C3369B71DE45B9AD67C88B2A8F1AEA2F5D871970FE9D4C6D63F81647DEA310F76DE6C050729DA4575087E3AE8F6804128FDA47C1867A6FB5065C4186C47D1199BEDED29D26BF9825676FFD9A98BF91E3921A07EFC949D7473CBF04E6647390E33CF765BBF73714E0AD38C4D1EFBC3BC4144CC9AEEBA0B9B4843F910A7F9CFDD347F6DC1017C010DF0EED1A71958CC5BB8D50BBEC164E186B6572FD09715C29611A3A5162496968C1DFBC1B6A8A4E617922D152FAF2B08BA40E47AA0E9F30515C9AFC74A5C2D87828BAE5243BB7988DED81731126E4C7E9609863929F943930FC72D0F3A4784990E08145485CA0FBCD69BAB2391C82E75BC2CB2DCAF0E94A3717B6A157070C77A8A3B5DD1E30AAB09F5368F46F66575599C04296982E6AE8F8C334ED24CC58449CAB0B7660E0F2BB9D96BE515245DF9654EAFB5060D21291DB8A2D820BF372E795957D59ADED6A72C265D19C852312BFDACCA65431B9AF4DA6AD56B97E9FDA9AE4650C9165037F353D9BE92322B4383C30404706D102F15D8D39B21D22E0B23FFB0AA0F58F477DEBC4F130BF501C765295A54913A7A0190FC907BF2420B329B97F30FA65A7429E7D71E572E1BE0AB0793B606F480A1526085637BBF89CABDBD9D19D808F230AE48505CDA9ADE68FDC826682BC406D4A7575EE913B60769C3BE4D81A073C05FE2BD6D7A1C3B52FD2F22875BE856CE0F6D7A3AEA1897FCDF951DF4A86184E717B4077A25D37935A82E073373ABBA58B0F5F744CE52284D96200CD90F0A7B4A03869A93C9371B7F946EAF2EDF35ADCE873407C7BEF0A750CEE48BE3A33CC47979648FBC5EA7E79DBC725C3901D4D05BC5B804007BD46E48B424665763F028E3777FC1A00F588D9A26F68DC7ADEEAF8214B747B409395016A05D8C72FC3E838DBF7C5A222D03699897E5606433CA760C6D67C8BECAE0FA8C312C9875AE26D61FCBD3A320829B615FED0587E4225E4B62264C9B37D2D2B45FDDCEFC060257960DF6A1AA2AC0544FC333914D192A1629061730213B1455E6FD7A712A08122C8BAD77EAB9CB9687AF97A3AFC02B8F413930DFEC10DB37C385B5643E91F3345C73EF353453F34A5EADC8EB41CB098E9243E57258AE608C9FE7BBEAC524B21A0734D8EE51EB30DD6974B87FDF3B0B1E1DB01FEF13061E4B072DAF927C99BDBB7691069E2493E86239A69BA33AF82998CC1D7B368A4343BC63EACEED280415FFF40B0B61221D7D1C098C6391E5C888228045494F86644F34AFB1B191BFCFD1A29C678956DB16D0BBEE458AC6DDBF00E738198C093170FB37F3F141619E65502AC57E9042CABC72372E5FAB9DFF5E42A00EB023E44B4E536706FD63BFEBCE1C0DD59E465A61DABF566EE7216973ABFF5D34A5A62518E12E8352C61BED9348E5826290EC0F84C", + "4251265EB325D261D721A84F62224701C9F564298EFE0C2516330F7AA43CC3D7090581B74C69218D74C8C6563FE276F24F39BB7998CBFB9C49EC649106DFA51E45498DF0F347DE8A562341DB34E94F286F583832E49AB38C09DBCC3B2C307188A980574461CB3C41EDFB933938F89C88F61886B60097F272E511B49CAED645190E98C3AB8AB5CDDC021F76567AC1EAE9F4F8D782B91BDBA3037BFF8FF43879FB6598D84046CA06B3C8EFE275BC61E449853F979AD6BFDF27DF453E2551F09FC1916F4E9884012BD4B946E2A65C86C609CF8EDDEDCECBE9B1DD6715C1792E261A3A013D64F00118DDB1FDAC9900E8BCCCEF9246446D5248D5E3423D859E1AA9BC38F8697F8A4EA08632983F268BF7D0BE639ADFCE6625E00229FD510A41AEE418C3AB85F5D2256D8EA4E9AE47316BE6DCF792537F28514B99BD76D098C8B4CA16DE1A9ED0F2693DFBA9B460BD842452BF563B03874DCCCD3E18B76AA3E352978473A2E02C6398438A35639457DBA7316577B0863762FC177010E0FA0F7537420C0443D8D7F51AEE4F40A67E249D678E77F17503A0A6DBEC3C60FAD140DA592082C334E3B1D021E34104A9A724FB6EE3B5A22CE5D3BB9C5E896956B4C6F7B1F51A74A56A7232E027F706EBB999708BA8ECBF42F44E41EF63A7627C60E5E75C678B5B3F7846CBBECC9A1B6EF78D7912AFF0EA56B7E25C31784DF9D63398FEF53F6193554C4D8B7A96C170A89961D2654B9A663B39C76401A439CAEC482BF44F20DD12140D47D0580DDA48EA905D409BAF5BCADBB8394333B97C0FD9501AA4B4BCEB3F041520422530A09A9B24EC04206CE907A33D0A18CD5C1640CFEF970623B1AB2B7EA5342B6F38C717416C17545D27C21A8F37AC2B98991395D3D170FB2D03C6B152915DDF9CAA12B5EB19E45FAC4CFD4ABA726A723237A6488773C05D0D38D38D920C6E8F2D3476B06B40094463CDAF380026BC36B8EF3DED6A01CA89E015A0B75BDFB97D859C620D329C9B26B1DBE3A3C92D8510B060ADF4151AFEED125ABC0D6FD3FA9F7F3C67B6BAF14A672977F2052A84F0437027956AAED010F63471C5848781BEF8F2BAB9F8CB0DB00253E2C6FD30D2A0794FCEC489376261CDD407B4ACECA129D87FFA0C76E28B9483034A40F84EA21E06C37BBEF2987AC16E77E021D29CBBDF077A912B89CEF82FF0EA59F7FDA55EE99F4602B5437CE71B4183BF28BE79327483898C39D09DCAC59C3CE32333BEF4B0720B30944B9998A01CB3C135D53B4A76FCDAD1C321D39D4466F0BF95710FC975ABCA1181070A4A5741624CE9AB0FEF27A5BB1805BF295861D0208BEBE7DF92EEFA7FB123B6AD42541C1A1057DA2560469A680E3664B1455D6851E6C8DC8C4940281AFF025B2BAD2CBB53D1670641EBDE2AE91E71F7F69AFD0C1A0225351CB1290EE40F81560A52463FB04E1364F9F3E5C454C311240EDA5C6AD78A094A73DDC1463E19A8E12419DE4966A1F12872E566F178E256F257FD1890DAE6F84DE013C2490B57DC1DED2E705C0134E889EECBE5575587EDFC240DE938C6D2D9CE543D5BA3A4A3EADE1A6A5F0CFF996311F72B3C6761414E34342C3D1A48F5D3011D7BC7F936E8E086581AC256DC6A376F9C4ABAF87FFAAD67BAC64401F4D976129EFD57102A84E63DDFEF60CF13EAF8973881FEDEBFF8D4B356B2A03EE9FFBDFA99F77EF7251C11EB1D2514D5E657697EFC47FC42CF10FFA7F09765E2EC39E0A99E4FEEBD410BF4AFE51855341279F7E47DFF0066602618ED5BF70B2F6D002805F41E991C68D64ADEAB7374F25B60", + "E0DAFB980D888AA2580DB37930D1942D6D088FDC706871A90D887B5F2CA6B21911BBB8BFEE1376F48428238607AF7CF82C3B3C9223746BA9A5F01523B20889ED8F139EA3D505D55D766BD056416193CACA6D5D6175C16C38BF44D7F89D4A5E3406C7944AD05D86C310E1EC78E0C8AD80FA0DB202AB1768AD446AC7FEC60B30D741114B45857FA5223E64AF32476319F16DE15C04F34F4730AB31F4F6BB13252D706F0B3BD5860BEB864618353CE62469E25CF4AED50D8BDE9633CF18F76AB1EA5552614D4AC3848A0CFFFDFD51F17A4E744533DC52979D7012AE53E9B08C4980AF8876ED2FD8A6F174B3AF651517BDDA1965264F1CCF0EEC8E3A9969D1359C5C9FD20CAD8698F3E28ACE77001F563BF456B5A46FC747E5D7EFED93314F7AA87CFA60405F968A4F9774E30E2266938BB19E9265FB71BE0D40FE6BF14FE02E36FE10FF110D63E02145C78B73217EED9DD87F70077E4229572E6547DD71828C773E46462E30B497F9F5F99D723D657E17A288DC98724B11AE87B7E56D33386A7FDEE0698353CD46409FE8D2236958B166B1C697BB8A42946D66E390A045775A6FE7DEE4BE260490B69C56476B894383091C827D02E960D9359E8D3E151F50EB87FABAEE8ACC6E325B36674D9C7CE249B879B3FDC6AF95E92FAE53047BC211757FD12564EDDA4DDB6AE8C94DD3305C21970E90BE05ABBAF912ACC52C77714F87C2B059A9E21005D8903A604D82EC22192C46CEB63C588A219CBF755B5D44CC0E918CA6705156CB497FAABFF63745C826FE16F65582D4820141DEBE3B949C29EEC6D99C2A4EF34DC878DD82D0FE6D5ACA302ADFB897DAE78EB0BD28A938D6FD5A3535CADEDD7C521E45AF4BA92FD40DDB009E35C21254A6DB959698303D56B59D8F319F18E688F9A20DAC8058E0496E0E46BD01880F3C78EEFE98A511768919116A288CD3CD28098BF5D4719EB64D548A6D791F1A9A9A3E9B08E7184AEFE60A3D7D7179CE47562E9133068789BBE0297FDA2B2D6F4248B288CD899BF3231EB360ED45F769C0167284319D2C2B11375C2B18E5B67594CF499A6AF2687E0C1AAF09F4161F3AA8369BDBA68AB022459A2DA9DEEA13E509AF3A68D011998D9C30BEBEBD04BC9983F36FA549BFF3E3D323722B2136AFCE0A2CC8E593B370C7B48635926B9575A77AD7C0DA18E94FF1C8FABFB57B25981288E1771465360E2D619272CF3F56268B7EE130FD07DE29215FBD5D0A72B73081869F60CB149A1E4871150778A2229F3C886200E0DC2C76AE049231FD3171E49FF44BDADE185883198D21629CE0AB252C7451398E0D411CB01A66BC5B141CB150BA9CFA9F9F46339625E1D5127998302AFD19D5B2D85F3F0B2B354C7CFAACA3D4E7C7B7DF44E22EC2C226178DDD480DF7787EB28F0285B1F973DC47B094491DDDC12BF1CAEB99E0E13781FE8A64DCB0A05A30763A055A6ADFE5434D7694A0F6A0366B5D74E73227F3D503E6B989C5BBF9E6D81EDA7C46D890FB2C5CB439C5B49FE16A9BEB14B12B08C47713331E8932D4AF6B85444E3F848C5AFDC095E984449F0D126EF711F8B43831755BC0FAE8D9FC79E894CEC183DC24B1E3C81FAF6A546E464AF8C0307263680CEAD9ED6E80217F98CA82458BEE59D2A4FA76BD7D4425E0C77164A50A2933972108661820C75EB51C8A0ABDDDEB30F31F2E575AB9DB723DD084656691096B72193C52053EBB8B72C6B30C49185166FC39F3D9F3497606D15E8D696CDC256DCBDB6D01DD2C33C0249D6069788DEC09802630597C13EB1AE152E8E84F6A4BF60BB09E049EEC", + "EF79F2E35DA357E9C076B00C6ACE7C50F865830698571E999E544F5025A99C36BCB025B7967846306FADCA22B8BED499BC9A80EFA7BDBDB83B15DC6D48AC4E3978D528DCE0A3E11C3E62B619EBA0C853EDB0EFA1DCE9EFB2E024FFC0B59A8AEC329FAAF418DF9BF70A250F2F6409A9FC0153161F6E8713005E53154DDBE15242AD801C216A1E5CE207757BFFBED75EE4C96CA0C3CF448966540EB434C68E9A4CCF3C5907DA216BA664B073D73B0779204EBCAEB55446AC6E2C40B8BDC666D4C9D33B7C644F867BCD8962274630191EADAEE7248398B9F02744AC5D4DEBDAB2D6D9F8D6C6392683FC1A795F70134E790718D56DB6D424725DF8AE7E11F02D684DA78ACB4B9C311806D082C1FADE4B31B8A6DC0E5F16618C47E03E8D78DDCCC6ED869F77CD39926945466369CC2371D3B51F58DFC6471D742C9C82B1B7A2B1B1BFAD15FEBE592AC0F41B19C126D923BF5944408506ACED28FBED161902EC5FF19CEED25D18F47A76860777A3D86B3E0BA7446C3F1EBDA88F8A8E182CC0938384842D42F41E0042C53C645DC87C88429E06BA9906A7A3C1F6A76671D69703496324406C7FDB20B9C3CE9BC273A743DCECC0016BDF85D82112DBD4C49E2A6A5DCA22738750EB8DD6AF15B27A0601970AD12660A51C560E5CD44B55960AA266A88B82E761B53A8B42E7332EF2FCCE093BCB06FD18D916FA10F4E9891B103DDE5D808963E6F71AE7479A5D0BFCDB8A2B2086308CFB7813EF6B7B5304225C2E9690E47CBFCD534570933541E8DC99227986C0CDE40924D64710A7FE28D248E667E18197B44D83FF1A0691E9049611AA1E04A1DB06595EC32A9B91C46F50096553C0B5716D2EA9C9E3D373C787783B50F28948EF96D21FB323CB69FBA26E8C869C745FF08AC0C71D2B656E42928D09AB4274C307FBB04AE41FE847721D95FDA55510893DF24F56522EE537F609FD54E4DAB4E98E9F3F8E8243C5D056B4CF6F2330408514C6CA22DBC79BE374E2B34B3E9A9B689B9375035F5E32013587C402C14997741654DF70FF5F74C0DC26D82AE7F036731AAE15D596E426EE2E7383EB540A48EF41FE2172F1565AD79202A016EF31255DBA5DE29C8C77B4704EF177C97DD507360FD01B44D612DCB18D7B5650032B1E768851C84EF794F833F9D5D198603224016D3FEA90F3C65DA465418750A69C43050A738A7EC4D415CC0B404B475936F8F675D49C67B875BD8BE2B2D65E05C49EDFE72163CF3F3BCAD87D8E956101964A1C1345F3978E144303FD1AEFA4675F521BBA59F0EF43DE19418993F444C1F75BEA24B295CDB73A51510B8B4B59DD20829466409444D4FF428B3B94164666A642FC2A187FDD7ADFE75E813BF64DE664B131F58B9CD825A19AC360F4F83E43FFBE0923494D978B1B2ECEEF07F2387E03B1D933008C0131A9ABB08DE1EADEF78291141D285EADFE1228554733CD927E9740D39EC9F539FAB960EA829552CFC36CD8BFD9092C821CE4FB4F29115BF533A56D7663CE9FAF2B9DA374B6E1CE5528A5B11ACB9FBE818BF4C41787F5E4FF4D517D46D2234B77F20ED3928BB38A32BBA350A66540E19B586C47EBB9EBF4E4A671CB41DA55BFBE5B39C025BF8F11A786D60C9DA6EE5299B17C0135689AC9D880B594EC51BB52398E78AC7DC2439D0C4BE7BBFB7F044661C9CD8D6D7EB16AFB943589C6210882557C65034BD7D044C6E957722C93537473E2EF1AF5A6D05D7404E274D2DA8B83F6D2AFF9EAA55D122F69F469927EB682977715FB1617B36368C22FD6A2A7B10412E9F202C6FC9BA1D7789311D0", + "18085D480B93B422C6BB24B09E05556F8298FCA307341877435D2D76B9DA1A1932F20D2903A63A0856D9C431FA3C4C591D606E0043B0C6BF277971588390BCAFFC01E14C6256290E1A01EB7BDC98611EB4E40BF72B04C21526D4139E3E75A13DC25C0691B67F24B195F57923684BAAF94C7E3CFF4830FB5E828B8F7A8692C1A0CFBB9FD3F021D3FCF12C7497021178A2AB8D3256E8606374D6D0E7FE11BB1F313BE2BDD4D977780C1A2053F6CB0F60F89671AE59C178FE33900FD11B4DEC25C698CE0FD4E451D6A3CEB4E41BDF08F05F556B4394858983D515266F25703C17B48B1AA13056ADB2AF9A865A0FD30BC4BAC0D7B1D185AA2903D1956DDA3D5541873EFE487E08E83613428B64D2A499BCF3783466079714FDC3D0B04ECDCED5C89F77F5E6E6F1141D47EE7A3C32382A89F512F9C9BD96AB24EBD4F77B911D8B8206CEE29ADC1E055B7BDFFEFF94AAFA750B857EC6FFCA693787C0E2817554717CE5DD5568DB1AE585B9BEED0C6E228FF47C43FD7565D3D5664BEBD73F97DCF73D8EBBA3FA092BF6EF21730EB909327313FE1493BFB44397567DFA30BDD7D090245057098AF775CE977528E91D9C3976A4D478A5695482E4EBC1FCB2F7FCF6E5F9B08BA8C7DF12E6F77C3B0362B1132F9209AC1D69579D5E9815535FF72820BE1414020694A3E2DE53BBE7DDB582C70455BCD18AA0A4E0A8BBD718217C616129F236487194B266F95E644D1FA79532D7AC13CD9C839BE14AD4BEC179923EFAC48965A8C915812C0F0886C11ABB0D2DD58FEE6AB2549AF9380B8699F3EBB0F96D295C22B940044819D7FBF2364610893457DDECED6113D1B14BDDDA8077BB32E70D19733CB795BC8964FD9788ED317B5E433CDFAC3CE3E0EA2A8359671F2ABF49946217358E92828AE32E6CE645C3C0E4D1CB64E5C8532DA7FC179CC7ACA241AE496D821EF7FB9E8D878B746C50DEB281604830360C8ABA336D1E8F444FD46A74F6B1A0F1F61EEC42C1DA2B6D88CD1AE94B3208866BD1757B1ACC09BC155DE4690A97D0244B819C0A66785EC764276BF39FCD6A1A172C777F2E9A44817D1B6B3C09AEB4436A3B115605A850AA9D11BE2E660F2B214C45B00134604EE395A77BAB321298ADE920BE3050CD2D7BAC4931C3E3687BC4FD7E2EFB536E26404E9950C928A3CFA8A11BE42D15EA8DB2037154F79C67860844D04DF51F5F21E90B8A16E7504947B90B655744758D97886E4860FBDF28FDE80B8F32C94D09F4F827F34E8FCE92B576A8809738D6227C9A31A43CEB3EDE56BF7306DC6F208D6229CC3E5C4B49AC54486ABA7F0079EDDBCA82C3C77F41C58A88C4ECF4DBEA754DFB3424BC3106A9FF280E8C6A7D086FA06C44ED23A82E23A03D3FD4CF62DE1AAF3A95747CB5CBCEEDA5B1929C13DF6CFDBA6A94A62AD3035C8CBEFA10AD9D37389B2EB90822E10B422BC165A3BA86F37C0A5B96D0EABCAA331FBF2806C65B376665A434A6D59B3BC9C339F4437F4598D0D6C62812A2083C32359B938D78390F9B4F86E42F297405069D350F86B089ADE021C1599FAA2460EF5904A6E25708032540A7747BB254679454A7B38C7491BDCC835033A76514869ADCFE268FE49CF38A9B844A97214E1E1ACE873FE051FAF282664552DC98618E35DBA4AD9B1FBE50700726091534091C631B54C944C28D97DA0961F8E4106408017CF1EC86456BCC1F4EE7118D0691F0F327A0436D3145E5FBF8FAC33E5179094FDB03D9DA0D9A2EEDDC221A21189B68EE1A94B13F062F21472DB5466B266562E2186FE01D028CD4AB5B6AC9F048D8", + "D50CD8EB871C5F371648DC07E20BE84263CD676282D56EA5374E21B52752DBE416DB787BCE232226568621ED792A9135A59849451A4A4D8A1DCF3C804AF966881FE5156FB761B3736F4282240FC0BBE72F51F0122D96B3755109E7CDFC70F9DD04C58B4A51C00B4FC0EF252B05ED76440C97DABA04079C121351CD43BCDDD4AA2D2495B49B908A9AF815DEE1405C3CE9CEC7D5BA9919621E8C4E920E08061D228038F73F8E5DD66BAB806D2DD953C6FA5360487957912249DE009655658BE8CACF00E6E0621739648A7A75EA06E93946987E62EDC270B266BBBCEF61D7CC63013AD797589A7CA62B65D4127E701BC95D45C74DBCBFF498D3F87CBD1B288D6012EC392B901A3DDFF16EF1E1685EA1F92B1F32DFED2F9076EF9CB1ADD8B04953E5509B24C48977FFEE6044B8C5B80F9DED6FA7110C3A2EA42EEE8A83F4A28FE78B27E84AAE7B3FABA56C1A4D2414E0341C69C40A43D65E16583A151826F7C7CC0CF0A5999A1016BE6912F067913AEFB525EE41F1B9C82881054E9624C03DECE74976228B119974BC546F823A597C7486DD594F1FEB2B6D0330918936DCBC12E3752A7072C5FD7B145571DC4A22C770E00F24B8C91E27F2C727FB049D04BCA813948D2F7B531C906F2018F51C9EF8B7642C0F1CC06AD338BEDE17683E0BD2A90D4D4746189F792952037E4918D2D6E61C1C8A8B6C437075ABC38913C250BBE6EDDA5CD24B630AB8FE9123B08D5E8FB8B71BC95BDA4AF1A71D5E54BE98B16D7D3083AB1649CBBBF44B3D5DC33B77DC1171A66F6F40E75EB86801EAA36E02D138093F28ECC6DA4CE4B128DAFB8D49A17C683FFAA8E6910B8BB7B832B3A3D0765DE2ECDA9D7BFF0A822F5FD389A04B660F832687CD67F7E1E1C3F5257C6FEB27B763AC7327DE8FDB989413B6D002FDFFB1DE5A80F1C5E39F06E6D716A69ABEF37B2DA9783FC494574689948DB51F78C8812E09367E6C8D70F5FC4139C64B96C71ED851D171AFA69D2A646ABA85279B7D3D31D268A2E8A272C91902F12C49D07D74E82728AD61BBABDA333DE7138A976A2267DCAB1A02E19B0685F64B608E3DA41108D54A07D4BDD24D79D293830C04209C98F037283BAEC00B1923CF404E1F21584F515F9D59B53FA9B4774FA8D3B34B7C66907BA127A095CD8CBB23375CB188CF9DF22CFB4CEC528C581DB63598DDD9A53438409D72507D2CEB5BD45DB5C760415A5E3B3A909EEDA73B7FE122DF04CB1E9F29E7A5A7385F632AEF63771A4CA2164B9B3FAC3C13911DBE9668D1127DB02A94CDCE2C8C7B66F0C21601781552B384DF0FA002DE08892D0881174CA1F6DE80B98BAE545237C5CEF9E1655F9EF8F8293D644CB47963734197F1976600CF2767A59FD56B9B67659168ECD57C485E5726C150DEC6C302456AFD4F12B2F2D1F36B03E100E109827726020BDBA970A6B768C580E34116DD0011299B4DEAAB8B04DE1DCC5FFCCBE57254CA79743D6B00D119CBB2C0B0BBB2FB8FB0B0EC97204E1720F99D16A3257846D09BF8EAE02DB21FCABF03CB0989FB4D99B6D71D5E64C6FCACCABDE63B223A91D1278D676839E1A5CE6C5EE05AB4F10EEC511C366DBFD7AA1E139AF671CBEDB3160A775E5214C862E95C3A7993E508D8F8B7ABD68213A531B5C648C537FA2674346FA0B3AB43A7B58B4F83B36D58C506C188DAF72381DE53F83AD4D9E6C6B1F5D689AE24CD158BB2898F06AA28C8FFAB1703871A6A6FE41ABB6B8B9188C90EEF88E7DA3338F119770B31167E3AB541371FF7F98A2D59D3557438DEAD71C96B97F3839F5E28DA6227E5B4", + "0447B9C85642F3F8BEBD1CC7AB0D0E4D07CAFA93A26C75970C8B40443506AF8BB671F30867FE4225F576026F79010AED56CE915AD9AC001447CDCB7CC3846B0E291DE0E9E443984E0ABF7C1C1D2F6D073B0B77116A21C3C0B7F360439D11D2DE370CFF8FF73FFFBABFE4D52BCE58CB32612870B0EA23CDA21E3B6E851B063BC76FBF7BC394A7D3805D45616C6A313C887D2FDC51F065F8F3C05ABCF70F31EA5746A513D2DB3F4F3C61006F19420AA82107AF855649EA5D90ED0A8540D0A2CEC685D18EC8F4508A7D092E52DB2117C233A7BB542B61C26BB92491A88942A506ED60354EC1963ACC189A248E37C9367F3F6FE065EDF6A1205BC80B267C1062BE20950617FE0EB59BF8F1E69982F3E89E7EF85F3319A22A22B8BAA491BE76AC7257A2DF631A98477544E3E57C7D63616D22789968CA5E929B507AC394B6772096CC70B69ACDBADF900D055881FDD209AEF54CE6966767C07EB7A2B40A3410C3417D114FC9E293DA7262171325D8179262B2BF041F5A977E2D648900295B14950EDF245C7EEB663F8292625F804BB839BE3A5510036F7A50288C69F94434A03466701BF1313020A4DC4F87D272FB9D1B7676C195C0B7B4D3C2CC6B20D5C2066C7DE5DFB5C9FAD43D80FA43BA917F200A73F258BF21ED8BF3E39F69E501AB3EB115C9414C82C52CE91F6CAEF4A163E288A6FBAD4FA83477909FBC972E2EE2A5379456105E8EA02F92B0D8F79588E2282D1970C3A033F738011BF273EA65912D3ED09398A7F851BA2D6141F97843E90F5C66B38D71D70DB9D93FAEB07FE1AF5783D71CF50931C282CA8B483D1F2E5DC5AD5FF2B06C4355E46768AE5014A22E7CA26267A1E6CBFAB24C8C436535F23D419819D6D458551EE78AEA4779574BF86DE7960969B0635F0B2996F955D863E078DBF8689C142736BD5177DBFEA3CA8C58871B1FCCBFDFD67BB12AF82C3B8F935CCC507D510CAB63B831721E0ED9C258BA7A3FE245D42DDA1AD8A962847D7C724DD2418F72508FAC194EC43D17533AE522187B44D71B6E993F2CEFC6349141094C8CF935D90F2F238728D29E1F5AA09B46FA7CB651F688A8A06AB97FD2363486F61D3F42B9C015652A53B3CD66372849FD2EBA05CFB5AA28520B01FCBD9C835F98D15FE01C84D7FFBBA4B2DB93E44E4341AE95B8AAA4D59CB88F7E192E89954E22B1B8157FB0B89E3E1E3862BD4C2799F2D8C621064EC9BA1EC30E0F7F5FFD7013A7E1C102DBF01698322992EB05978A5A2878756BEABEDC660DA2D5370A98CA2C0A4C65141EA273EB787B2E7AF646DEF7DA77A93E45C37E69B474D04FBDC3B5982D8492FFC37FDE42385DDFE97A73B8575C1305A0B9AC0B0CE061A423556B6FDADB67D0A5BBA7435929D658FB0869BFFBE5D2FEC96051FE03CB7B0D944304C2D433459A97C43268E43951D4C1708C702FB9C0A0C6D82876057F4D043B21A92FA6D034B1DF5C2B463107AAA814C79022D96D1BD9D33DE5A1FF9E435D9607575856CE4DF5F1E9E90FEF5ACC4AAFBDBE0F982DBFE78C5ABE1D9C85E0452AAD7836D39591411B382BCCE72CA1702A20C9DF384F5BD539F53CEE8B9977AFB705D1D28680D1733BAF5F298282846EFA26B0DD7514422C0EF9088F796B38C15EDF6C8D88009B10CD0D6B4B2FD93679712BEFFC4D1F7A3898AD0CDC61D2FCDC360C66FDFE0AFF0E8A7B26359606CD4F47D28DE115261E6F98F323FBDF3E3046BCC2ACA0831D2BB4DDF1EF443632A229CFE6BBA5179079DC7FA50C56BE7FE5FEA0C5AD09D891895508722861E9EE8568F59616890C6370", + "8DE87744B81A0E21A62CD72148FC3782AB560CE136DC3A07F2D2E143EA0DD2ADAB9FF8AB39B2A3E8858DA593B6EF6C46BB5CFD252F6DE446D9165406B3DD18CAFCCE3DC7A6E6200D8F7591169A6AB9DB6665FB72140A416EF30B75EBABB6C284E73809DE2A3A26C7F4F188FEE0B401E9EFF6DA22EF3DBE0FAA6DDFFB5D8C265D1A1855CF7019D8659062AD7A705362D1510ED5013B96D6EE803E7C6418B05828243496753E8616F4075A08346038E3F3549C0AB1E761790E818C2B531F06805D92FE53D45B9A6FA5E30E3D6A2F467AECA07D29E1E9123247C69220E2B9D4501EE42E5BDAD07F0D092B33A938B8FC0EB7E435713E3E428E87DB24AC570E4EF64840A1B4D43C5026C80F321E537755366B16FAFF2423908FB74E9A5B08F0C1064815472AF48240F1C374F2AAF8ADE55117E0FB1D08AA40C4D8AEF35CE6A91E54A89BBE55BF5E78ED5F66B2FA1E8936342656C63263D4E7ABD70F7899DAC9A315E9508AE65287C6660A7D7F3FF408CD06F3B19E1238E6D5EF040B3E54F4469BEC17198AF3F78F660C6753157603138BC98AA9F01FE79036D4564A7396725E57F875FCDA4EAF80C5E2815862AD52340571A571B331CC8122C13CC58403B22B61BD404C6D94C36FEF187C712B524BAE9EF150A71CE32366AE536B5B94ECFA351EF0DE77E729C42BBB32C7D35F9A5BB29D2D84BFC91F510F9A1C907540AE3A80CB7023AE0635EA5C2EA0548D9D14CE4BDE142436521ED1637C7B7CF6CC1DA5F826B800AC6FFFB83509A81ACE30FD969495313F9E18CE4D8A2E1D5F9C7DA14A0A9D4C4D49BF00B622B6AA07FEBFF0A8B274C297C0B4AD1CBD64BB4941543FB63D9E15059E0C0FD250753B2AA664A677780C39A013E1AA6B8F786D677755ADA03E51ED55F936FFA1ABD0430DA8750575C37D1EEADEC5E17148DB9FA202F8748B0611EBB5015F1D26C0D810F1AA5A40D73C32C269EBA5CDA134267231FC3783D3D4CC639E567681275F423439A29118C6A0C1B07D08416537D4707E9CA3FCD3494F64B69E2AE9EDD0079CD428CEB8A00BE0FC9A791FE2DCFC10D7F813315E964828A4DCC2A2D42EB313CCF192F32AA9A17C984E0D3CF3A0BD86E0B751B30C096F5F0B08A0BC439294D2BE2CB387648F8119D8820D39F17C6AEC976A0B8C89C76D12AFF73059B49EE856B2591E8D2E817DC43793F20B2AFBBD49FD9A05F5B4CB69165420AB96F26A46861AD9423F7DAE8829FD392799EF967E1270563BCF3D46025CDBBAFD15DC23F33EE5B621DF6A12263CC0A506A5E9AB191F896D13382B3BC2D536442A62B09F3C2C2252D0BE377CFBD59097259ED243EFB36C9AC0AB01B3AADD502DAACCE17A49CC82FC9ADF67B4EDE81D9355CD8295DE21468FAAA25036B2DB6E24A3AF3E5FE59324867658EAD5198C47D362EF64B71179D107DA748F00400F15167E84B62588F6D81FA4B68A59A24BB3D27167D0720718BD24EE556FB72113FCBD37831251DCD538F6815382E119355CF3490DF0AD552ECAE0D00462C10CBA4011E95C7FEC968AF6E39E1FD15D1026879202C57E2CF7AB02B08B15373C13435D8A55ED6B9BDD98FCD5B4539428D90A2C73D37DB112D2025EC8A4AC8EB82C51C46FACE88AC0E1F161705801C781EA07F6914122E5DD6BFFA3812EE44E314BC09B785B344584AA8522B63FB34BAD2122F9FEE1245E6DC837DB032387EFF5036A021C8112CDF03BEEFD89EEFE1BB88A132CAE9E1E9EED3A855B364F2A4A2F81086172FEBC64614BC04D11E74AF00F54AF6B5D85EE4773644C3FA768532B1821EC6E5C", + "0D1FA0561DE4DECF411AB73FF48D0810AA2149FE5F3C22E62E06C02F60189AB5690A991CB88DFA5C4FBED745FCFD63BE3ECD9CC599E35B5FA31AA11C62F3A33796A64EDD0B64F2E51E75C2481D3EC9DDF07DADB71448BB336C0DA9DBCD897F777E3C9DD97C7EBB08827C19316F61420D96F3D94EC395F8BF88F5927C71397F6C24901914826B1BE26E14FE93EED37141109CCD00C92772B96D9EFD74B3EAD3903854801B22DC3F98232023E1F9CDFD4B4C952A6D268DF9FD3FA83C707941F8F1ACDC195AD66E7AF48D7B06C62F3204E8D03D2C92920C589CC56A5C2B0A1F10401BBF747B60B9D2179BF9CD7DDF50B10823372CC4E24005D73B4C5AB918F22918B16D98F15C365FE69786C1ADE9FAD71516E389938D5D38420FC79F82C6C0AB1C6D93D1896FE8A2BEBA134C138EB1FB00115E50A8A676B9D9939E7375F4B7D62D449EB341B0C03EE3FB18564DA3CF64261055594E0F8D322EAA9B56B5328574AB323C4376464F3C27786DF7026BFD6C7757BAEDE7887217A2D3EA22AF7D6809BFE4985EDB32ED503C6034FECE55F4379920C73A515C7390B3405ABCC54F51F686903D5354468AC566D5A03C5AB536934A6CE698E06B9E2C815B15B4F8A1857FE7C0B5486759B150F48AE9745AFBCE856830078EFD7F4CB4A463587B7DDACC79FC9FBD9C2A0351D91DDF27A65CC79005DD24F1C26252BEB8C3F1D69DF79D386401EC5AD57BF2129D1E828D6D57CABEA84C7F77B16B919653C12AA7F770741E4AC11F0AD08507C3E7C4716F14F14C548A88DC4047EA96CF96BC0CF786EF7D02424314BC846682109A2F80044B51B12A0350DB9FE06E72581EE874665B9680EC118C86DB575F9E5F687CF35DB3CA83475051AFDABDC974B2991B47BEB4CB967E3CF20D2B7CA2BB50825EE33FBD7C6E87095DE8E36CA6143F673A8C18882D89F22C08971CC709F1518169123EE59EF50846C95C313F14F9472D4CCB8EB71301488901F27E895B5D44420F91D123E3EF5527121B9B0C9536CC3D4E5EA03F63BA8FED0FDF593AABC3E768962DA165CCACE066ED7D6E46DAE97EA08789C36BD3CA6888229D15714302A39EE4F39DB0751F0E99877237524ED8EAC5F7EE2CC40A69408DC43E2AD88A661D7E443D7E99A14484E3011A41912E2AD4F6B7D62D8D9F3332F79A5FE1E16E8064C91DE56B1F89A9A3A220165872128771745D086DD3F8DDB2C35AAF3DC6DA70684DF270ED50D188FAE62CE4C98B9019D308772EF036F9FB2775137377CE61529A40E03B388CFDA3BAD55FD62D7ECAC2A72FB68068BE08383CC36FB66CC252A0412CFB3C993803C038A1828E8893DB453D47C5727CF8BF80850346063AF4976610F984ACCA00BB5963D5DFD018E0790F4A6B14A9B5FB9517783EC1F16773C49A744D8576F7957D4CD4C4E35D1BD580FC76E2632D47661A6838344CCF6476BB793FB12F92143524E5A01DD5294B6528C5A18B24B0B75D017C4DB3663BCD561AA8F27E510A7C031ABD3708385B03294E3BD1A695C573701B9D4F60232DF767439E252B7DB10D4E3FACAC8C2E8D16F9500828826EA807C2C7C48C0EE8457E757854C1540EFE9BDCE7C09AF5BE09AEA54A4BB0D2A328092F3B8741A128D4BF588384A3848A5E4F55DACFA64F7FE081366330D16589991C52A1BB782364AE969E8A21260518662B00EDB117278170CA2C0D186B173F93879F6F702E03DE768CFEA1E39FF8453C7B3AB46E83FC90FC56D0EC0847DF16A4BF1ECBFE29D94CCBD49DABDCC5FB81B62A2CDE7D2DA3E67042944F33A007096DE5C79133C7F4", + "C9FCF7D2DCE0A2341FBEAAFA64F6A50A93F3FAE3B55EB70ABF51A4C001E15A8C78DE54E50CCAEFF8C2421079F7333541018D5EB8045C3AE0F0489D13C593EED560CDACDAEA39BB49FE2FD9C956197967830A0886182D98B5051080DE887638F2E3E626B8941A58D2206B46FB410C155B94FD7D15956EAEC9F855B96A8F1C7202EE600C12DBAFC6E3DE5F075B05AFC037847BB521D1D3638135591B6E1A0137CA74E27ADA3FD673684A8A1330DFA46D449F8B63FF90E36881C09FAEDF61672AC32CBBF71F34367E7547C13BF08C4B688A397DD4D00D8B19212F85EF11C0FEA19C890D73DCAE9B532CAB7BB5931B2F648072F35FAA31C6A77FAF3F72F9F57D5AE65BBC7DFF1C2A5A2A2721AD5B50DBDA2CEBA27A3864A6628F24B0D24FC2450890E278C4599C1015C2B4AE61F2DB2A3A85F02882DCB57A7A471B5F8E51DDC284E0C1869D41EF25E260EDC53AF55BE8217FEADE6C74B9C0EAE7C3417156D671577E05A63E03052663F420B70E99DE068971C5CB8D9055864460D6B2C269E4E5D2585BB7A08E28B15851C6E8438EBC1272D517A076C08631A9890F4FB627D05B91ED2164355D7F20B32498E4773FFFD17F3B15E7F2BAF5EBDC98E617A7437BCF94B0EA1B2FD6F98F8BE6D64F769FEA28A5FED9DBF4B3700BFA8C0495772A14254D7AD9525B6ECDC028C43EEEBF91D2B17C9ADDC071CCC83EFC6401A22846500E0CCD3D4E5184A05AECBD92808AD2DA42C57621C66142784692D4F28662A2B37DA4D3CAE332A97D465D3E492ACC964AED603058CB6BA6972C83C2906CFCC813C0603B775E2DE8BC946DAFA510532CEFF2B2FC5E1F25540FA07B577003D67F8A3C63E9BC2B89EC7AEDD8C2E91CA426398BEC4D98FB6233832BCAB8F10E5DE6668F7DF8FE10AC0EA63B7D46837EE4D1D203D54615042203552430DB97C24FE0088334BA154FB2157DD2D12715ABC6D329A819A1A664727F40CC26204949926E78B0BB8947FDA9026813FCF19795F8BFF2F56DB70DB7EA9280A6C504134A1B653D336101A9C166883599477DB557406FAD495BA31B488D9EDEB783759EDA32968AE4B4B96A14C9DA960ECEF511D4102E1EC27E17AF2746DFEA54F42D2133281ECA9F5CA87F8A2DE4C937B5F9526591A583DD3211F78871BBEDDE79206F946B9CEC6EBD0DA4A25AF259E4B3EC2195578C74B7DF87963BF561D7F4C6755D4DB0F288341D5E525B15F2BDA314DA38D2B2C7CD7D64F6DE35EE782A076333941FC3505AEB1FA5783C6C2553D73AFD6AF896A5C2E1C15EDDC408B6D9D7EE2E7E9F706C2A6CDE36A41BFF88960612C46996A9E7D43511302F925351240B5B77A7183C45A1B66C8FCD34EB6EBF5F5FFEAC8441BD1103D2151689BFCF8D4E29B9C39B1BE4972186B099C2C35572DB1BE2A28D751D6857B7E4EF181B786C2A6FFA30A5D6E2E1120E7B1F313302ADD1012E43EC24E5E5B5D03950E009272452ADEB9DB626FF38F335A520B12CD981636BCFB882FC06B440E348512E6ACF980A1ECF360E33DCADFFF5A2B413DD214D5AD1070E88B63FC9765295BBC92C557F3AAAB6AEB293249761F95EE4338243D35AF883AC33832155AC758ED05AA1BFFF0E9FD58E03384704DA5A9237F1AAF52E12C821BB0F54C0820AF8124AE6D0F4BFECDA6500995B2B61ECB0628BFE2A9E6A05DC94A781137522E85A3BEF28B76E49B27BD05C113C9B3A9AB1285BFD926D65BCCD5CC3837490B21527A1E94544C4ACED0352BC84D378625E3655F74B039CD681D98579A190AB2B89104C83F46235757D2D22FEEF59A250B564", + "48116D6CCE73D8BD1E1F45D9676B031D9B0E65684FB88A83D791CE8F5278D33EA9D3A6ADF04F29AE93123376D1CEF52F27E875EC0024A888E688EE2A21A4AAD0448103569C8A7CB2FB072E3D0D09115AD8A1C234F7765E77042156AACC4D4A8AC697E41B71F436ABA09C91E9E4F2C5B573CB1D0B291F915BF922FC75E6FC6AE332B42D7E51BA8EFB1CCA66EC849099834E48C7F79BC16C79B0C87A8EAC8F88D30EEE8FC0EEF8C89520E2602A7226BFAC0E8B30A117B718875687F81A6125D09EB3BD2B2F5209C386DEC5AFF7DA0FF5454FF0451F825E5AC55680EC7DEC56E72CAB953E5B822E0A1D95F3F948E95DA7078C850C43AF46B4EFEEAD6AF807CCFEB1B61CFCEFB770D1923B41BB354C81F340CFD851EDFD537C373CB9F29303A988635C5CD37AFA576D6E8A8C2B7C56DE2FD49E5DB970B50E04436B1F8B22A6DCEE3BC27EE1885CEEA23E12541554EB2EFE615A140831DE6C555804432CAC0A73DC2EE5CEC8ED139ABCA4D17B22BCBE60F05F5D7F526ECB29A51ED6ABB4DE4A2865AD1AEA64041EB0F505BE3CB8F351BA21A8D941902BA565039EFEEAFB87DC6DECEC1C091ACE228931A147C491C11169AC87884D5EE9DF128C98A084CC6EA0A50D494FF8E0B902A9EAA4B4F9D3BB2BA1FFD3DCC93C45133B9008E2B188F57A82B5DC01862D35F633CD6CC3FC12BD6F3A20C1EEE1F9018E41027788950DF09C4B482837677B33B15CE24EFE6797291C0DE291AC04F04AF975703BEFD3CB8E59C1496E547285E3F7A29F99C5F210327CB328B8A3094DB7C27CF7FA077791160A2287F44F92BA6F5346E48D4D4AE6C2C7185926526719537AAD530EEB3B0B4CD718C7BA38BDBA21671ECCE0AB4044B797B7D10797EB1BAA024B76D0B82BF25C94655545227B46DB2A038F87301BCBECE0C99A98AA5BCB648DE58B6CD59AC6471462BF5985C595B00A4DDF2948A84203890E2989D8DFC9864392E7E75262DF1CB78C1E2872CFCD22D561F8788F42A0323CDF3EE1588EFF2F7BEDACF5AF710CC7C6F9957D992A7FE39DB696DA414AC36CBDC99AF050023597734D94C2A8FCBF41D6004C21E4F4357C19ED09488797CA012F4BEF8F1743E396236E708D96A7DAAB07FE03D5483319241CB35F66F66D99D981DB4427C4C84A9EA24AEE4F7C4E023E0ED2FEDF59FEB6D8AC0FE87DD42580F7B0CC6339752230A69BE83AE13FC12AD4719D45CAEAC6E8695F6F403A0713ED37DC120B80DE82F7AC4991B4B9DADB31A304E16D03251CA140659CBF99E891DCBB764293A967DE1E96848B8F225D2F9D28EC2F428AFEBFB57AB79B126E6FC3D66102E3813347D7CDA5499F6AA5BA6AB5EA6F3A82D730EDF3FF74B9BC0F954BED21E77146A5591941962C49F6B2BEBD060A9C82D8FC780FB3AED527D40CC426988F042841250B4A85A3F3501FA3436103313C3C4CDEA772B6C840DB866B9730798B69D6AE12D24E4DDF31FA9B4C8DECF6CBCEA2E8A0F9CC67CCDCB64523725972D81ED2E6562283DE99297458452B94467B83F3111CBFF61006814CCB6550D19A1EC026996695D46C31BFA9BD371CCDF1B512C61CE7BDFBE419B477DAB1E7E1D012DA4BDB05F4C4CD39511D5071C0982F68D9C6F558D22940D541A3C67003D05306FFC070C2131832F737872114566ADF3074F7F6274AEF9B894D0AAD5ED60998A0363B92D841F4A441C39965FC1479E93C99B083CDE6CD6CB9E26D49E16B969A357E28A61B444AB0FA665B853FC89B64E02BB02C5273CC948B00041701459408C95E4BE49EDC7CB605BD2DF31C3C8BB2AA9FC780", + "840BCC55474C2F66B7E16C6F527695D367F70F570B13C1ACB546D8439A1AE06F362C224FBD86441D82430A345B8458EB666BC93739E3D679754117C95100E8F00879B891C9E03788543C415AA964C3F861916BD7C141777A93B374943CC4CEDF928AEA3EB72F412DD8256227D7D7244E876955B13FB2EAD1C3980AF6F8F36B3E71FE3B189F8DC22C55E3720DA11C6AC4328DCF670CF948123FC7280D6891EEB356C195D2A79326299A684F5D68DC0ACF00B780CDCEFCD7CBE4140FB5B6DF896883D3C6FFC42BAA41E6A75713F8861C18A833C688C2BF6EED7F0CE66242B8196C7C254F9D48FD56AE5ADA9105A5C4AF28D0042E059A90979C6439BF6D498991CF64C68080B9B5392CC9FCA4397647A9AAC42C3810FA33BCF31C89A641D1078A0822D93EB773F418B9B3B20D5FEEE1067766AC561525F88F8F097BED0CBFF5BC498CDFC9A5B9D20F4D4A03CA190563CE543B2EAFD8DC6E4A5885DEA120DA7D157D00EB1329E500D41C7E6BD603E95BFAE227A9B613A71C7BEFC8449B668C59147E1DD5411CBD967CBBD46A9DDD76C547506A54A8245532FF9AA5312607F1AB99F4F9BCF85D93B58D76C5583856595AF5CA1AAC07C945400B35885071802620855E18E0A3B1EE92BB95241EFCAD82B3435BBB8916C4866471BD5715882F6BE508C7648A59B2AA91A69F60C78482197C04B31759054FFDAA254A143021E37874DE407690B9ECF8DB99CC16B004116F51DC7853370BD3538E14A0F02E7BF74D66FF898AEE93BF0697EB6E8E62B95C6C525A03E1A89CC2F56BAC591FA81BF6A1B3B9F1259F13AB45F2E9B0D93DA7B4984A9C71272CA261CC4EE4A44FBA4CD03C75D216672C18A60183A52B28796B356EC498F4926D833D94007E92EC190E9713354C7506BEA6B7B5DB2BE659E2A5BA92D00C01611347F67971478F2C71648E33F99EF201367CA3AC8814DE0F83B0BAFF34A192349C5DE87453167820C0EB0AC8349ECA683111776980FEBDC993314278B37B289B528DB319CF59B09B83342C71FD5E9F13EDF4F18783FF328BC67A03F1F62FD1A4631AFD76363DB1A79CD1EA95FD43934955AE211E00EF5AFC114BE00EAE2A7AB63042992E086810E61AEE3CE5CB0FE75C04969485899D552AD4B006D543BEB93C1E8578168C66667D62CBCB56F98DFBA248EECD891F9936382087F2AAD6F83FFE25E77F8BAB9C62675D4024E9BDCA5581126BD1ED6035994029BB54615E593D4CA81B31A5AE8CBEF8E1A81C32698FB7B4A339A7E4E575460F79C4F4C5F57F9E8DB459177067869E03E2E1681004EBBF62B4F60A9EFFE47921AD22C7236F25438AF46885E120825509D1E28652361EAC64AF1806317416E5550A39AA8DAE2C6B970D44F4F38D571F67E304AA57BA435C4E06CC97C848422216BA778B2736C30200527960A66D63280AF7DC691F9D0540AA47F0D26416B46A6D53B0B93F1B7C3D4DA8BF8AD2FE410ADDE00B0372E9E830C09B206A08D968AF2F716DD04D220E619FDE28FE70286E7EB9C2068F7A37413BD9E65F1B59C331D45AE914731A564D33875A0939A2185348C197CD14DAC59C5E2BEF09876353FB16D849EE67A774B05C51AA2480F18DE40051654DD2C7B9E3B753FEE5696B10BE40BFFE89487DA1E8B1C2000D53B2A98B4DE6C9DAF07F0B4DB72834361E520E45F5E958FE0760F229C16CCFE0BDBF07E186B28AA69231DDA8378DD6338A94D23541B9D8B63B85962C6304E1ACE2B56A3E433F7E9B2A88FBAD5FC71703231D38DFA8C378E15B6503A3B9959E1759EECCBFF14AA09E6BB8F2CC", + "152004D3334E877FE21F773408369872718CDEE15BD489D97F606779A9A38398524E6560260980FABCF179ED91D699D52592AFB3269FFB8DED36AFE7DC79DB773DBA560E3ADF8E12FB8A08EB56BFC4692BEA05AA288012B580E43BE085CE583E9C9DC18A9D32567EA950D8165A2F8A443E7AB5E79F687690A8D8D92FBF877C5B84D26E6FCB3671073BD808A7E908130A845C95A2F5E360645611B4B55B03169CC1F50AE2FFFAAF50FED8CB782BF3C67775B613CF82A2D102199E49A329496C0FA24AAF6370A3636EAFEB992C663C308AD181DC308D81FFD713505916300732FB1F8DCE238CC4104D26C588F28FE7EE4F2B8C2024357D52C7AA29D339249086CB2202DC1C847210EAEBD3F06A39642711B4608638564B0DD2BFDF38CD79CC1CFCE1226CA835E6EE19E4089A6F18E7ECC3597CAD3FFFE13A5F77A58C2B079DA25B928396FFAEE81FBD9C6243CE0EB0872A187E6CF99F16B1511672821D11EF88884964BAC6686C2A7732035493FB9765B7A51E845C1C79FABD99438FD84C09642FBC7CF1740DEB012AD050F5E8FF03E859E85C51D2E87AC41185C67C33820EFFCF2D79D384B11B44A806ABB8247AF36E3972222C805EB9854D9FCCDC7E58A101A5239E60CF4836C38A6ADE67686E6487547933859D46D046BFC15AE95B8D0A42A57C401EBE78ABF495EB390B8922C97270C790C2FAB9849ADE48EA8F4F7C6996F6DB661500199BCFE1EAFA1ECCFAB1F674E0BEB1D03319E73126D7191A64A80FCBBB06B1CFB718275BDDB571E8F53FAF81DBBC0522263FCDFB537B3BE9078F2AD449423152BB9DCCEEE97003D1988540FAE39CAB62593A9EC909489415EEF4229358229BDDD45CC35EBDBA088C4BA097BB0E28814BF5048F4F64E6A587B0BDAAA8A1B3E3E69D3D7B6782FC42474773C61DE12B4C6F183F9E625E337EFDC97A79A5D2C0C939FA668F440688F7A3E0E28A33D36D331069294DBA8BF768010AD93A224E28964A780304F59B7994D972832728249934B5347580C16BCDBE9F84EB34EA7F7645635437B0F5422E3DA99EC2D53B22B1A55BC783CE86CC6B1BE7B11F837CF2BD09A514B12ED7CF0AFC2F70F1D6D08288524263B1129135D664A48B0596C4E880E4E01BA3889014C07ED1B7F172AB4F4A69FC8C04F0ACE8AD1329A4FB594E9EA30EFEF31BBE418CB5515CFF8A375CBE58515B32E799E8449101093A053EC99F9CF78122FA2D36DDFBD258EC81D7B4D18BF882663CBF24D2A35A93C00AE8EA81A3B0E8040C1E259515156D67DC76602924BA51507C4994221A3B1CAD674BECB11574212EBCCFDCAF6AFEE288BCE11B7FFF1D7191AB329B04A237F75B204634676932FB0842E2AB888E7D5A4A6B7F77EA04ABF4B9A567E5DA5267F35CBBC928B5F607E9C08359F0031A934152D77E65C937181C92EF4CF17F6EA45171DEBAB545755795097766318CB132ACD96CDD65777F41BA127CF251A4E9B3348927757A42AD8FA83F6CE7342D935CB54984E45886D888627F0228E50082B85E8E9DDBECAAF049C25C4D7B2EA919716271500D81EDF574C5AE91E5F0FAD7585EF69C5051473AF913F887B31BD730F67B4A44081BBD567B57C061AF465237374E0BF4753F3C6CA28D45220CCA3EE6F07F93A29982EB5AAD70763ACBFBE55015D1C52B64954D4855ABCC319DDCAEE75CDFE3B3C31C329A77C76131F18F3C3904B3EA4E691C03C32CA5E7A1F9460760231473115B5AB7E159013C96AE4885566065883CA3B9661C6773B77819BC68755D529FCE05E80E08A5097EB37BDDC1AF9BDFCD0A04", + "0D4897E7FB496EF0C6D62C034088E7E9B8DB52F232CDC9EA88429655ABE366C54CD534DC9038F45AC0D0362E31086CA2FC0FCAC3FE71B2D4EEE548F69CE4433601CD3431D01BA6F0C23D612807EB8E50BFCA736D917F67DD72631BEE8728006D2AE69D1A1BAEA8DE50852CEBF7491FFF989C37A54EAE31652230A0D3E4397B051222C4A22BF481BC52E2012188C7576A7ACE81185C85A2E841119B47B5429DF277A976F15D5652156445905EC797729A6647E1B593484ACF2724E81786A0C062DE87759E82202A561FD077D64FDD3226A1E290F660722040EC7AD4383431E195412DBAD0AE620BFE808D65D3937AC9C5AEFD6FA106C88A6B192D4FEC1FB1A06907B0796F724AAC6A5EFEBF50C168F990BDBD6B1D23E098858C07E8D2144532AFE040E45B25AD9AF7D92F9DCCBFF3DF25DF574A4B65A219289407EB63FF7152BF1E651C6F124BE32545B50E8E2CE37F1042A68A62AB70D9DB540D2B39293E008EBAA632B85EF1052FDA17A07B9B1D89A76FF7E7EDEB7090496855B29A9174780D504F7228F8B7436F4676F51975BCA614554FE6B3F946F5E0D1016371F9CEED4521477CE8E9CD0668643686D8482CEC0BB4D6A9E8678B1835F0952E2700FE0C85A8683DA91638D81A85231CA4C7B55C0C0DA57DE5E6553F22290CE7EE72867285D096C0FC16A60A664C6BAB048939FF9DA476024235DDDBF7F264C90ED44E953C4AC0FB50362FB2CB4C4FC2097F07B71772000D2C2A5DBDF0B6FB83B1BBD70CE9D6A8BF1F924AAC4DAEB6AADD891A8974C9BF46FC6038F6B77D6AC0D6107AE6AF5B93B186253AFFFD8CD21835097C4B764F3E0B2447776549D5045E4346FCD3B7880F1B3BA794ADD6B7F291D3534DF034F822D0A41DB2AF9F1E51F212D5631D2525B1804A75B50D8372B6A1C200B81AC1122AA3C13D7463C383FD123DF4029BDAF6C227B3C4B54F75C5315FE139F6A0A3E2E819D3062B3309E2630EE4A64D1E3DBF23B489B96E198BA98D8D3347217A5FDE4DE453012E8564BAEFBE3939E59C0A725A75CEDE373501F9103011FE0EAA40C583AC73C92F47BD528600C42E0029FB3A4F03A3CCE87E5AAF4FCCB47EA8BC62E0F542DBD455F7163A2A8803583896E3C803C0D01846EBD8BB1B3FD396A7C7BC3F72A9D0503C44FE30E5E77E0FC8B373EE931CBF4A9867406BC91972B946B9ADE62415CE2FFC71C2E64DEB7E6205D635977C778BC40C11E36BFC22A17FE641346C74DADD255D329AEFC2CE5B4AC5B195FE2DB453F1B41B3334D5C480BBF10FDE88C722091ABC85667F2B52A3505A142E4D1546CC41E154B345E8456B9CD0E241D70EB4876A70623DFF3FF43A8D66EF60488A7860485A8E518AF4A7056CD02C72E1BAEA3944781642A36932ABFAEE3B88B57B213F9B358CC3F05154DF8D2132A74DF27556DB6C5E45256481C09D18DA604CB91E6AB7AA29C0C1009A406F1B3AAE268564E04B07E4E9128FF02513AB8A8665BFE1E352F46DBDE7870EE027A6E84560014659888EB6AACF993D7C9F9FBC2974CAE290059802F5D224520CE445C404A2ECC57CE6FD5961EB20DC12D436F0B93614CFC844B476D449416F54459BAD09F886CE3C1C307A91E62FC736051E6F6F8F5AD3372398458299EFDC1809997FAAAFDE14B15566B381714E3522F629A5ED9DDA1EF4B9D4498DD55F8B0A48ABB2F9B1FCBD991B5465108147BB6125FFEA6B6D479DB6A9983A51C041375B39FE6546AB5B5E089DD7E228D5AB17127A3A1E3AE82A31E952E660F72A1F399ADEB4E1E11C390BB8652F2F7B6D05E9F4B6FC90", + "AF6D254288BF564C4663014C7A70EB3739D28F1F17B8627FDF714E85B48EEFEB1FD456546328BF2E2EED112992AF78911A89E1248AEBF1F79906EA91D41CAFC6E541D2BB40A7050C5AE4B66547C9DDA88590AB8B0A4B01B5F8216447A310D1E52C155F92659835F1086D381F1F2995138856DEC6FF59380FD6C1B6EEA6E4061930CEF7217701DDFE17742721794DE824377392AF3D949ED9B0455C58F7395DE0FDA5485E310E8457A4270D603BA5AD1854811530FB7178525F4BB1E5DFF89F6FFE0C83C3E47E244D8F3F8AAD8374E3FDF996060E18D2A5397192823681CE6DA561816C0EEC0C0600732A37731ED13948439E8961BE44D32A3097C1AA5E19876ACD21DF812265181774580A8C04ED4FD1DE2FD5A1DFF9DCDF4D97C448BF9A4DACC22D4A55F588C87CCF5C9E178A8FFA032A454908BBE41E13D829FA98C066A7736577CDEFC6D5441656D0AC95C872861BCE0A28C2ED6E9420D4D167F37F96087F9E761F38B882CD41521DE8E2C40564C0E001EDBC04982669B82F05CD0411A6BADDCB704B545FCB19A286BFFAF0FB6DC889BCE75C5763BE1D70DCAD1D39F395A75E637E0663F3D5A855F53F700AF5F82124E72CC2A4E41A4B43FCBA41E55298A1B799368BD5F9B507FB11E8BD2D80FE517A5FA935006064278CDDC5EED43B7C2D309BECCCBB2C0AE3B8D09509315933E2DF91304B1DD3777EC9FA2415F7D18A96CD08095A30F7EB9BC12F8739E409EE7DC062703CB3EA591531F47F5D1C0431E9F1883C3BA249492EE619719C8B3BDFC1DECF7E3C4CE4CE032FB2882247D1D54566E3819464837C248D35647D273A87F8BE667760D26A7EA1FFA682A931A4D35F7407FBBBAD725BEA62449623AADE97A2789F2F8642F1CE12A06C93861DE9D27C5ACE0E4ECE40B58664176113ED6437B8AC8B4059653EA30F71A023544BFFA685343E278129DA12EEAADBDD5AB0E2CCA0B840E87AF0D0E859449893276B9B5894EB0C57C3222E01E7538FF7E91807C10CDB465A12CCD358151D96856C6143C9F8D25AF8E8086C83D4CAE37BD660D15C0C0707691E8366C4AFE6DC0AE1BFECEF9BEF46CFEA3356A3155E027D1C921ECB852BA4B8FE8E0C8C00829CEE4049A21A1C3424D2BE532B735232D12B81C3C9E5B02294701E6BCBC8607F2AFCFB2DD9B1142B4D261418C1B239B0B22451D7D3AC64636B0C7F96B41D7E775C1CFA2E277C957F0D59BD1FB02226A462533850E99E917E310A684E81634F3876D6AB32CB5B8FAE9E82224BD2A17A7C72CDACDC6B3438A083A6B0DB9FD91E05BF4C83A36916EF35C5D4871E94B1671493FDBC497BFA30328DD24D340A07A960828A855FA95EE33FE4FCD15B14B7929D338611239AC34CFDA6503E4DD9570EC339CFDC8D1C3D3536F5176901D012BABB133EBB4560484344E044F86A77C21183C82BB2B6632CF69F5A661C98EFDE5529F8FB965DCC6AF185CA8CDB4D01C5E8902966B063B8D1724AD18DAE495AD47416B61321DEEBF782EF7A6ADE3CD0D5B9ECA84DB5D50C2E5C7D8B8DB9E0F398376CDE3D7E8DC46F0D77D38D6CF6055D6D074CBA92A27C6F9018CAE87C97F1B3ACCEE495ED9DCE46DF4FA5255DB2C7F2669F5201058E90F7567672162E17D5B6D028C6AD23F2AEBA32061E6B33EA86915FAFA2344CC58162C032CE837D5C32F5993013314BD261DE6EBB35B94B8F690C5624A8CF5509BF50D3AF5FDAD77311B6D6F9398213AC1A267CAA0F52A262DA4F85F5ADC79947D2C5128B8E0B0C41B9FDEEF6AEC228EF97762CDBDB78273C16C39E446576D54A4FD0", + "4B7593A9ED7897766CACD515D3A55959FF99C1CE28A745DEC1D8F2565F24F4A1E14E9083AFF510F106D982A2911197338499CBE38CDF3D99463B13EE26B47D26A62CE45EAAA04A3E70850D5F23470FB94C42D3235D5FF9E6C37CEE8C93591CB69E0735B03EB262CE6BE6F0144DFD66BC089B36D66287EA588C78E39D9B6907EFE85C1211612952CF13C369C2AB3D921E4630ACC75F2AE99014776B26CD1F296F736A4616FF662D5C6E18C4EDA6D1791A71BE969556FF11E1192D3941F8020D2C731403ACD856A3AEE6ED7F23023BAD7BF138C702B6449E2601042D7990ADB988B650AE202F3433CF26EE132A7CB13650E86A6DBA6F7FA53B2354DEBF1268734D7120F721E18FEED2F93C268A2D3EA012F3D7F68DB0B18A5CDEBE13CE4A05683947DD985D4AED1E192FBD2719755846C9B758FC8FF28B9999D07E634645064C2C9DB4CFE50BB8A030B60F43AFBD588EC17102F614D3029FA811457568D7726C651C062391A2EC2843A95A3A48AF58A898BB65FB852F73E9A82C6AA9D406D80C072A3B426D8EBF261BF7AE0E9DC0C6DE9F4BEE880D775783F910AF19DFD8EC2656213FB9B74EEBD8E1BF860E4650D446683B7794086ECE1E2AA723024C219E3DCB371624C6D721BB60C797003D89096BA0F489D1CA60C57AD907BFC8E97F4E057B6D709414FB0A302D3057FB4635F70BB6A32CFD842DCD8D9C9D45FE082B3746951A862EA870D903382C138425DF936A505120D93FABB8F523C1D3946B85425FB338CA7DC4B2FB6512F0C8A67FA47A416284EAA943E1A9C0607A02D27F55F1DF2EB6090F94B64076FC2D3D3B3694DA5C7EB2A180DEA14AEC21156E1110DF75616685FD53C72252FB87E7D19EF5AE8D9E129D0984A06520C789DE22CBF6E2271801691E0C3CC672F6865A41559910D0279AB9E0112E66B2A1C2B22B6679CF70E3FF870084562ADB36F532E64D44C7264E44D488076F7714A1089526118D4655FFE16B02D803AC2601493CEC3AB27878CE95ED3F321913217DE12B8E5E8FB75A85707EAF6F1FF08CC86B91632ABC7CDC42D1C5D0F2F49D5F412B4AD0C5C46CFA74643C9333C5F3558DC3ABDBCBE23A3573146D648D540116136F3F29E42FF07E26C1504E47FCAD1FDAE63357E421E46440424921404ED02FD4BFA2FDE68CBE6CE49E4E120C141013DF5C0BDF776EE36FD5899C0FC057DAE2C9DAEF6D37BF8E85258BB36B54ED8374BDDD49B6AC2C8BF3105A194F76DD512336EAAFC7BD2054AF6A9606517DE03AF445CCA5FA65307D2E116E42A3676EB6033AA17D76A87F52D144CE25E3A8DAFD3E044289C4600BFAA9CCD963D14A19C5911C3DE649439440D11A21154EF25649F7DA295E0FDAE8C48351BC005C011A10D201B3062492A7CC933AB5D854B26232B7091CD0B7AA3135F28E3AE75E267C223C5E03B60FAC1BF78123C5AF76719191CB6BA277A5BE81E64117AB344D92837B6D600F36702F4BB4532C5EB1C9BAD8A111C540F52A225DACFAB37641898B1FF770A523F8BC8BB0DADB59235DE055810396F1993539A9CAAB622389607DCDFDD51FB67CBE89F0F868DB4D27A7A38542A076D158919DCB621BD325F23AA0DF694C444206FD42192FE7F9A05743CD54D8F111676AC35A3230E372A5A6D7E213C4584EEA1A4993067FD28DF6690BE9D3E94AC06BCF89BF1AA47496F8F6A18524187BE80D59A4E80193CFD757B706AD483A916AFBE2A56E0A69F3B1BBF9F4B239D05C6C556A8D22B00E9BB1FDAA620D949ECDE86EAA299BE93A7884C99FA782F2BB3BEEE86046489B3B8A5930", + "71BB1B2E833793D854F8A9A81E6A6947057B9571F2BA99380DDB25D878D6B48F09ED7DBFACE92B6B82F413E038128F6128AF3BC467E9A4DF2861DAAC674B6D948A10F28F7D43657FEE26577AF438A2F4422186930702EBC6C9173E661D59CE7594DF95B861F9D12EB060FCD3BA43159C9A1BDC1EF13E04893E411267331588CF4831978469FF569C1A738C54001BB5CF4FABD289075A165EDE0A58F6CF6D215D306A7840CBECD0E87E3AD186F7A67A967373551E13D2956E5C578A7F5BD50E2D570F9B914848D46A640913EBED2E2ABFB86916BC34EEB3E8A671AD771F6D3780B6FEC143E26F53B02977255314BAE9A2CD9E5BA2B49C73226FDC724A859F8BAD3A9FACA1B0E5F2DFE7E1E45DB6D4BE2B76535A817F94594A4541C01BB62AA83A690B6D84FC13B632972C61D940F2C9D32837413AF8E42045ECA3072CD044B2183400CE63C418879D13FD281A8D0835256DDD2BC3C9750C1D44CF1037FD7264B7716398FCF1D31CFFD0B7C52C6370E4CE6FC163B40436490A757465B20B8890C3B5C0AFB971ABFD01796569E3BC73C13D1E4B1FBC1CDCE59D21B6B110272E5770C589603FE67779A49AD0EC66910A2BF4D8C8ECC18A32EF92F502126A5DC3DE618233B9914A9608B2F17E5161115D9A3BEF1D5701A9D465A1437DE24371C9179800CB5728A7F3D734A2A706BC64D356BDF591389970B6CC139AC510A98E3C75F20120450CE45373AAEA6A279BBD17221BCD32ECF82C11B4C1CEE0A44792CF56978D3D2399F7ECDE9F8D9217F8BA22770E210D0F1AA852178B872E296762873765A73DEC08873C04ED69C995C5751B97DEC23B94CA674FE3F66211317B074D8203EC530A20B6E6DD21AB55895BEE1CBD0876183D652F4A0D2EFC95749F8F192F860BEA534598FD709B396C209CEAE4D9190980733E7E98C8ABE52A53C68D86053B56BA6FCAB5C827292D729CB8BFD1FC8CAFCDE15E4527B604018F28AA16C1E913F55461AF87C9A7BE1A742002E52B3A14EC30B259DDE7BB892CEAF77D25B7670B339B334878F697C00CE6740117AE7C67DF3F8A7BEAC89D4872682C47F368F835AFD7ECF0D8471AD01468B7BBB0A974EC469A8F79ECF8D379DC13685D2A8F6F19CE102C3DE34B11422AFB42E894C8D00F606296DABA7123FCE039ED27324D60E853BA94DC638454088281335D437A954333FF1A8D08E2A4D25CB3BA0D08BF6625E25EAD3C1EBFA2666AA49550578D3763ECDCE81303B53F18B00C8900AF4E0532C5ECBC94513DD9F50BE511CFE4D3DDBB3F112AE148DB062B2EADDB901CDA6AB6BF59D37F356AB34AF97D3DAAAA417642E87C9B95AA546C682ED641214605F82A4F486C9C72576106F76D7152615EC8E77187D4485071CFC6B0AE44880442790696E057A3AE20C860691353B3F6BEC5F1C2DA07563B423BC01E0334099571158A432441256D7C409B7B6EF26442075ED17E2BE37F8EBC049CFBE0FA89CDA7A58DD32C417B34E899FBE86E2FAB8D30846DA17144A6A66AAE1C24FCFABDA5B573FD2D6337226B5E49BB031B4D2B455B6DB871076F67AC03C3A73CEC01BD0B1EC42ABD177127E62A66FE8E475B982B4490F0877466EEFC7317A703C5C07937340ED4B53E5DE5325197FA31B8C8E05AA2222064EE5D7C06D4A1EB53151F75C94A2E259688CA0716548465C5C255D81FF10BACC2C13098ED8CF7F5B15193EE14FB5D258E95EDCC93E9796FA823892C705A5771D561787C12592D269D657FBB71F021F365B7453D50C35F748FB2B7F36DF28769B81EF12A26A237FB0239C173559540", + "53DA0E7B84741AA9E225483630169ACBCC03EB8CDA28B7BDA685C756D66B14488A2D0AEF7E6CB2D80F2726327257B7284B93EA1B56AB80FAE668C04FA49FCD658D896A997685E1EDB4DDF85456B37F32FC8CDE50882EF0F09BE4ED4AB9A425806A49E8347A42A50B38FA8D1DA2FD2C9438618B6701DEE159060C186D50170F24F38E07B185E3272EAEA4A0A7CA41A69C69E9D95E271287D3AB8284146A58440EA131A7F47D73CB2BCF40FE3A58E1B998C2E5EF9CEEC8EA2F8467BB7757C03A99FC8F014EE933A7080CD46625A2A7A251B7A37E4208956A8C9BD35E6F8674BC06FCAA5DD04A2558C9665C7985014D3AD95ED256FAFA358962EF5BB26AE2FCE899392DF858F99303E2417BCA7672E991FEB891F5DFCA2D461148367C5C0DE1460BF557194533DAF01A5E8E0E43D57B825AF7EEFF163DAA23B9F95C063A26B3D213459D885AA96023715CD21DFA2A2250F7610B78A77123443BD06EFB7DC85D1F16D0019D2937C3DEC4DE6389485ABB21642B6E41ADD43CE96F228C08DF6288A647EC2FE96032B6DCD651FF950B72964EE08FC2030272E3F601DB7F7E770E655389CA6CFA2F9B87CE76FB0E0CDCA4EEE5E80FC756BE46CC09F84BDB34ADA2AFC024ABDE0066ED939F8EBC236CB3F577C1BFD741F9D101A038EC86AB0A85462BAFB2E484D6722499A6310FA449D979030B2A21206D44225800BE2228FA00AE6D92C8DA652E1B003BD2734D30557B735CC2A591E090394DB791245C22B4D29E706476593B6F90C694C5B87BBB0FA2C479E292A768A9687A713336A21D1199186F852C41F586E9BBC64004D8BB6814BFE739834C99923177AAF87B926D56A7AFC0879C027332A60951C84E9314380A5A78E1196D094F15D856AA36742825D2B397156BCAD8ABE7291FB41DB4365AAE49CA82CA066D3B4366D3122ABBC00F05559DAFEBA9F98361DDAEF068D60B18265E7184C4D6BC9C3619CFF5C758090FF6398CCCEB78176D2A8A2A4B9854C4ACF5CB614DC1CA0E15E7E85442241D48FD3D6E851A5D3947FA769560928948FA26FA16EFBD2159994BD92B3D6B0C62818C91D4724413A7F40B2A2D67F4FC97B5DF6A7E3CEC03158E201D6643F402D3DD6995A42900D46C2881198CAD28A27489F5116ECEC3E38D999B2020E0C381DB3B8230811270D75950D9BB61548802DBBCB68ED8C7BCCB50D606BE400BECF873498621E66ABD2AA179B3E90E055C3719CE2FE047F815B95B065BA086B467AF4124E276F8CEAD000BCA5499D36217B250009A7B43E81CB3F8B1A3238EE436FE61F2F942796DBCBE570BB4FC783B35C3CA31BDD432B33AD75B08107253E8F910EFE0D0B5453A8A055D884892278688B3ECA612452B590AF38DBDD9A7070C5610E7A3CA6C91D24438E7F45E7A2A330F164AEDFFF1789D5E875EEF121298DB79C77278ABFEC3FE3DF843C46F40E847272EB2669BABA808C38E31F13516D5066AF4DFCDE6EDB2FF0B0A4CE9FA9B4101F6F144B02384868617CD39175852E065473D6F566CD18D7403FFD24DD33ADDB52C7CC22167E49102C46DC369A92CE2D2FCB81B4D1F14B7CD2F80A65D8FBD20FDAA23219873ACB8CF934E68D6F8FED6B41193CFAB1F44CE4BFC7C67DE1E8804B47DFD7E8AE281E19846AEB6FF94AE7E7CF6FFAB46242843811E6C5BDB78157C76DF4F92FD3653D7FA5978316EB055059C6A2B6306C957418860A88F63355E76D96F4727128D9B3EB98501AF5B093F2C314F98EA2CDB89468E1BD51138CBF25E8B911C26B97DCCA47F1A1D6C1CD415A5079A756B8A8715DD3164", }; // Galileo E5a-I secondary code const std::string Galileo_E5a_I_SECONDARY_CODE = "10000100001011101001"; // Galileo E5a-Q secondary codes const std::string Galileo_E5a_Q_SECONDARY_CODE[Galileo_E5a_NUMBER_OF_CODES] = { - "1000001111110110111101101001110110001111011011100001010101000001000111111011100011001001101100011100", - "0110011001010101100010111101001111001110000011000111011110010010111010000011001101010000010100100101", - "0101100110100000001001011010100111000001101011110000011001010001101101110111100110101000001110000001", - "1101001110100011001001100100000001111000001011110111101100011000111001001101111101110101010010110111", - "1011100100011111110010101101011101110110000011000010000110001111101001011001001101001000101010010011", - "1011101011000111011111101001001100111010011101111001000101000000111100001001010011111011111110011000", - "0101001101110111100001011101111000101000000010010010011111000110101101011000101110100110011101110110", - "1110111111001010101101001011011001011111001110000101001100011110110010100010001000100101011111100010", - "0111100111111000110010101110100000111000010001110101111010100101010110000100101111101111110010011011", - "1100101001010001011100001111111010100011101010000001000011101100011000000110101101100110010010010100", - "0001111111000011001001000001000001100101001010100010110001001001101111011000010001011110010101100111", - "1111111000001010100110100111101011111101101011000100010011100100001011001011100101011101001001100001", - "1011000000110000011000101101110000101011011100011001100101011101010110101101100010110111110110111110", - "1111011011000011100110001001100100111111010110011000111000101101111101000010001101011101001111010101", - "0001101110110010111110111000101101011011111100100100001110010101110000101110111100111100010110100001", - "0010111110010010000001101000011111010010001110001100110001110000010001101110111101101010111111001001", - "0011010000010110001110001000011011111100010011101101011111110010101010010010111011111101101110111000", - "0110011010101000011100101100111001000111100000110011111110110010110111111101010101100010010110101101", - "1001100111010101101001110000000101100010110010010010000010100100101110111001110111100001110010101000", - "1000000111010111000110111101011011100000011010011010011110101100110010111110110111000110011011001010", - "1010011001010100010100100100000001110100101010011110011001111000000011011011100111010011111011000110", - "1100001100111001011010100001000000011011111011011010111101100010001111001111110001011011101100110111", - "1100001111010100101010110010000100011101111100110110111100100001000100011111001000010100000111001101", - "0011110111111111001001011110101011100111011000010111001110010010011001011010111100010100010111000001", - "1001100101001001000010011110000001110101011111010111000011001101111000111000100100010000001010110101", - "1011100100111000010100110101010100100010110100010001100111110100000011000010010111111101101011101100", - "1100011100011010101101010100100111000000010010010001010100110111000000100110101100111001000010110111", - "0000110011011011100011001001111001111011010100111111010101011111010110110000101000000101100101111011", - "0110000111000101111110100010010100101111000110101111100000010001010001000111011001100100100101001111", - "0110001001100000001001110111011110001111110100111100011010111011010010111010101001111010010110011101", - "1110011101000101010000010010111111110101001111011110101111010000001111110001110010011010011000110011", - "0011010110010010101011000000100000111111001100010111010111111010011100100100011000111001000010011000", - "0101001000101000010011011001010000011100001111011100101011110010011100100001110111011011000111111101", - "0111001110110011110110001111000010101101010101011101111101001111111010000001010011101101100010010000", - "1001010010111111000101101100100000111011110101110100011000101111011001001001100011100000001010000010", - "1010100011000011110111100001101011000110011010000000100010011011000010110100010110110011010101111001", - "0010001011010110111000101010011101101000111001011111001101011111111111001000111000000001011110010110", - "0010010100110001000010100000011001100111010111101011001001110001111100101010000010011110101000011101", - "1001111101111001100100111100011000100001110101001011111011001000000110100000010100110101011100000011", - "1101011000101001100110011110101011001111000111001001100100001000001111000000101101001010010000010111", - "1111011001100101101001111110101001000100000110111010101001001110101000001101000000010000011110001100", - "0100011011110011110100110000010000111111001001001100110111101010101111010110111101111001010101000011", - "1110001011100011111010000010010101000110000101101011110110010110110011101111110010100110010100011010", - "1110010101001000001000110001101010000010111110011010000000011010000110011101101101011110000110110010", - "0010011001011100011111111001000010100001011011110100100111101101111000101010101001110000011011001000", - "0011011001001010001110101001111010110000111100000100100000011101101000000001100110011101011111101010", - "1001100000010000101001111010100010011000100101100001001001100011101000001111011101001001111101010110", + "1000001111110110111101101001110110001111011011100001010101000001000111111011100011001001101100011100", + "0110011001010101100010111101001111001110000011000111011110010010111010000011001101010000010100100101", + "0101100110100000001001011010100111000001101011110000011001010001101101110111100110101000001110000001", + "1101001110100011001001100100000001111000001011110111101100011000111001001101111101110101010010110111", + "1011100100011111110010101101011101110110000011000010000110001111101001011001001101001000101010010011", + "1011101011000111011111101001001100111010011101111001000101000000111100001001010011111011111110011000", + "0101001101110111100001011101111000101000000010010010011111000110101101011000101110100110011101110110", + "1110111111001010101101001011011001011111001110000101001100011110110010100010001000100101011111100010", + "0111100111111000110010101110100000111000010001110101111010100101010110000100101111101111110010011011", + "1100101001010001011100001111111010100011101010000001000011101100011000000110101101100110010010010100", + "0001111111000011001001000001000001100101001010100010110001001001101111011000010001011110010101100111", + "1111111000001010100110100111101011111101101011000100010011100100001011001011100101011101001001100001", + "1011000000110000011000101101110000101011011100011001100101011101010110101101100010110111110110111110", + "1111011011000011100110001001100100111111010110011000111000101101111101000010001101011101001111010101", + "0001101110110010111110111000101101011011111100100100001110010101110000101110111100111100010110100001", + "0010111110010010000001101000011111010010001110001100110001110000010001101110111101101010111111001001", + "0011010000010110001110001000011011111100010011101101011111110010101010010010111011111101101110111000", + "0110011010101000011100101100111001000111100000110011111110110010110111111101010101100010010110101101", + "1001100111010101101001110000000101100010110010010010000010100100101110111001110111100001110010101000", + "1000000111010111000110111101011011100000011010011010011110101100110010111110110111000110011011001010", + "1010011001010100010100100100000001110100101010011110011001111000000011011011100111010011111011000110", + "1100001100111001011010100001000000011011111011011010111101100010001111001111110001011011101100110111", + "1100001111010100101010110010000100011101111100110110111100100001000100011111001000010100000111001101", + "0011110111111111001001011110101011100111011000010111001110010010011001011010111100010100010111000001", + "1001100101001001000010011110000001110101011111010111000011001101111000111000100100010000001010110101", + "1011100100111000010100110101010100100010110100010001100111110100000011000010010111111101101011101100", + "1100011100011010101101010100100111000000010010010001010100110111000000100110101100111001000010110111", + "0000110011011011100011001001111001111011010100111111010101011111010110110000101000000101100101111011", + "0110000111000101111110100010010100101111000110101111100000010001010001000111011001100100100101001111", + "0110001001100000001001110111011110001111110100111100011010111011010010111010101001111010010110011101", + "1110011101000101010000010010111111110101001111011110101111010000001111110001110010011010011000110011", + "0011010110010010101011000000100000111111001100010111010111111010011100100100011000111001000010011000", + "0101001000101000010011011001010000011100001111011100101011110010011100100001110111011011000111111101", + "0111001110110011110110001111000010101101010101011101111101001111111010000001010011101101100010010000", + "1001010010111111000101101100100000111011110101110100011000101111011001001001100011100000001010000010", + "1010100011000011110111100001101011000110011010000000100010011011000010110100010110110011010101111001", + "0010001011010110111000101010011101101000111001011111001101011111111111001000111000000001011110010110", + "0010010100110001000010100000011001100111010111101011001001110001111100101010000010011110101000011101", + "1001111101111001100100111100011000100001110101001011111011001000000110100000010100110101011100000011", + "1101011000101001100110011110101011001111000111001001100100001000001111000000101101001010010000010111", + "1111011001100101101001111110101001000100000110111010101001001110101000001101000000010000011110001100", + "0100011011110011110100110000010000111111001001001100110111101010101111010110111101111001010101000011", + "1110001011100011111010000010010101000110000101101011110110010110110011101111110010100110010100011010", + "1110010101001000001000110001101010000010111110011010000000011010000110011101101101011110000110110010", + "0010011001011100011111111001000010100001011011110100100111101101111000101010101001110000011011001000", + "0011011001001010001110101001111010110000111100000100100000011101101000000001100110011101011111101010", + "1001100000010000101001111010100010011000100101100001001001100011101000001111011101001001111101010110", }; diff --git a/src/core/system_parameters/MATH_CONSTANTS.h b/src/core/system_parameters/MATH_CONSTANTS.h index 8c8dfbbe5..70e7b5696 100644 --- a/src/core/system_parameters/MATH_CONSTANTS.h +++ b/src/core/system_parameters/MATH_CONSTANTS.h @@ -41,8 +41,8 @@ ONE_PI_TWO_PX = (1/Pi)*2^X */ -const double PI = 3.1415926535897932; //!< pi -const double PI_2 = 2.0 * PI; //!< 2 * pi +const double PI = 3.1415926535897932; //!< pi +const double PI_2 = 2.0 * PI; //!< 2 * pi const double TWO_P4 = (16); //!< 2^4 const double TWO_P11 = (2048); //!< 2^11 @@ -104,13 +104,13 @@ const double PI_TWO_N31 = (1.462918079267160e-009); //!< Pi*2^-31 const double PI_TWO_N38 = (1.142904749427469e-011); //!< Pi*2^-38 const double PI_TWO_N23 = (3.745070282923929e-007); //!< Pi*2^-23 -const double D2R = (PI/180.0); //!< deg to rad -const double R2D = (180.0/PI); //!< rad to deg +const double D2R = (PI / 180.0); //!< deg to rad +const double R2D = (180.0 / PI); //!< rad to deg const double SC2RAD = 3.1415926535898; //!< semi-circle to radian (IS-GPS) const double AS2R = (D2R / 3600.0); //!< arc sec to radian -const double DEFAULT_OMEGA_EARTH_DOT = 7.2921151467e-5; //!< Default Earth rotation rate, [rad/s] -const double SPEED_OF_LIGHT = 299792458.0; //!< [m/s] -const double AU = 149597870691.0; //!< 1 Astronomical Unit AU (m) distance from Earth to the Sun. +const double DEFAULT_OMEGA_EARTH_DOT = 7.2921151467e-5; //!< Default Earth rotation rate, [rad/s] +const double SPEED_OF_LIGHT = 299792458.0; //!< [m/s] +const double AU = 149597870691.0; //!< 1 Astronomical Unit AU (m) distance from Earth to the Sun. #endif /* GNSS_SDR_MATH_CONSTANTS_H_ */ diff --git a/src/core/system_parameters/galileo_almanac.cc b/src/core/system_parameters/galileo_almanac.cc index 9e387f04c..25f71e22f 100644 --- a/src/core/system_parameters/galileo_almanac.cc +++ b/src/core/system_parameters/galileo_almanac.cc @@ -93,4 +93,3 @@ Galileo_Almanac::Galileo_Almanac() t_0G_10 = 0.0; WN_0G_10 = 0.0; } - diff --git a/src/core/system_parameters/galileo_ephemeris.cc b/src/core/system_parameters/galileo_ephemeris.cc index 9403e7968..6a61807f5 100644 --- a/src/core/system_parameters/galileo_ephemeris.cc +++ b/src/core/system_parameters/galileo_ephemeris.cc @@ -39,27 +39,27 @@ Galileo_Ephemeris::Galileo_Ephemeris() IOD_ephemeris = 0; IOD_nav_1 = 0; SV_ID_PRN_4 = 0; - M0_1 = 0; // Mean anomaly at reference time [semi-circles] - delta_n_3 = 0; // Mean motion difference from computed value [semi-circles/sec] - e_1 = 0; // Eccentricity - A_1 = 0; // Square root of the semi-major axis [metres^1/2] - OMEGA_0_2 = 0; // Longitude of ascending node of orbital plane at weekly epoch [semi-circles] - i_0_2 = 0; // Inclination angle at reference time [semi-circles] - omega_2 = 0; // Argument of perigee [semi-circles] - OMEGA_dot_3 = 0; // Rate of right ascension [semi-circles/sec] - iDot_2 = 0; // Rate of inclination angle [semi-circles/sec] - C_uc_3 = 0; // Amplitude of the cosine harmonic correction term to the argument of latitude [radians] - C_us_3 = 0; // Amplitude of the sine harmonic correction term to the argument of latitude [radians] - C_rc_3 = 0; // Amplitude of the cosine harmonic correction term to the orbit radius [meters] - C_rs_3 = 0; // Amplitude of the sine harmonic correction term to the orbit radius [meters] - C_ic_4 = 0; // Amplitude of the cosine harmonic correction term to the angle of inclination [radians] - C_is_4 = 0; // Amplitude of the sine harmonic correction term to the angle of inclination [radians] - t0e_1 = 0; // Ephemeris reference time [s] + M0_1 = 0; // Mean anomaly at reference time [semi-circles] + delta_n_3 = 0; // Mean motion difference from computed value [semi-circles/sec] + e_1 = 0; // Eccentricity + A_1 = 0; // Square root of the semi-major axis [metres^1/2] + OMEGA_0_2 = 0; // Longitude of ascending node of orbital plane at weekly epoch [semi-circles] + i_0_2 = 0; // Inclination angle at reference time [semi-circles] + omega_2 = 0; // Argument of perigee [semi-circles] + OMEGA_dot_3 = 0; // Rate of right ascension [semi-circles/sec] + iDot_2 = 0; // Rate of inclination angle [semi-circles/sec] + C_uc_3 = 0; // Amplitude of the cosine harmonic correction term to the argument of latitude [radians] + C_us_3 = 0; // Amplitude of the sine harmonic correction term to the argument of latitude [radians] + C_rc_3 = 0; // Amplitude of the cosine harmonic correction term to the orbit radius [meters] + C_rs_3 = 0; // Amplitude of the sine harmonic correction term to the orbit radius [meters] + C_ic_4 = 0; // Amplitude of the cosine harmonic correction term to the angle of inclination [radians] + C_is_4 = 0; // Amplitude of the sine harmonic correction term to the angle of inclination [radians] + t0e_1 = 0; // Ephemeris reference time [s] /*Clock correction parameters*/ - t0c_4 = 0; // Clock correction data reference Time of Week [sec] - af0_4 = 0; // SV clock bias correction coefficient [s] - af1_4 = 0; // SV clock drift correction coefficient [s/s] - af2_4 = 0; // SV clock drift rate correction coefficient [s/s^2] + t0c_4 = 0; // Clock correction data reference Time of Week [sec] + af0_4 = 0; // SV clock bias correction coefficient [s] + af1_4 = 0; // SV clock drift correction coefficient [s/s] + af2_4 = 0; // SV clock drift rate correction coefficient [s/s^2] /*GST*/ WN_5 = 0; TOW_5 = 0; @@ -71,8 +71,8 @@ Galileo_Ephemeris::Galileo_Ephemeris() E5a_DVS = false; E5b_DVS_5 = 0; E1B_DVS_5 = 0; - BGD_E1E5a_5 = 0; // E1-E5a Broadcast Group Delay [s] - BGD_E1E5b_5 = 0; // E1-E5b Broadcast Group Delay [s] + BGD_E1E5a_5 = 0; // E1-E5a Broadcast Group Delay [s] + BGD_E1E5b_5 = 0; // E1-E5b Broadcast Group Delay [s] Galileo_satClkDrift = 0.0; Galileo_dtr = 0.0; @@ -121,24 +121,23 @@ double Galileo_Ephemeris::Galileo_System_Time(double WN, double TOW) double t = 0; double sec_in_day = 86400; double day_in_week = 7; - t = WN * sec_in_day * day_in_week + TOW; // second from the origin of the Galileo time + t = WN * sec_in_day * day_in_week + TOW; // second from the origin of the Galileo time return t; } - double Galileo_Ephemeris::sv_clock_drift(double transmitTime) { // Satellite Time Correction Algorithm, ICD 5.1.4 double dt; dt = transmitTime - t0c_4; - Galileo_satClkDrift = af0_4 + af1_4 * dt + af2_4 * (dt * dt) + sv_clock_relativistic_term(transmitTime); //+Galileo_dtr; + Galileo_satClkDrift = af0_4 + af1_4 * dt + af2_4 * (dt * dt) + sv_clock_relativistic_term(transmitTime); //+Galileo_dtr; return Galileo_satClkDrift; } // compute the relativistic correction term -double Galileo_Ephemeris::sv_clock_relativistic_term(double transmitTime) // Satellite Time Correction Algorithm, ICD 5.1.4 +double Galileo_Ephemeris::sv_clock_relativistic_term(double transmitTime) // Satellite Time Correction Algorithm, ICD 5.1.4 { double tk; double a; @@ -150,9 +149,9 @@ double Galileo_Ephemeris::sv_clock_relativistic_term(double transmitTime) // Sat double M; // Restore semi-major axis - a = A_1*A_1; + a = A_1 * A_1; - n0 = sqrt(GALILEO_GM / (a*a*a)); + n0 = sqrt(GALILEO_GM / (a * a * a)); // Time from ephemeris reference epoch //t = WN_5*86400*7 + TOW_5; //WN_5*86400*7 are the second from the origin of the Galileo time @@ -165,7 +164,7 @@ double Galileo_Ephemeris::sv_clock_relativistic_term(double transmitTime) // Sat M = M0_1 + n * tk; // Reduce mean anomaly to between 0 and 2pi - M = fmod((M + 2*GALILEO_PI), (2*GALILEO_PI)); + M = fmod((M + 2 * GALILEO_PI), (2 * GALILEO_PI)); // Initial guess of eccentric anomaly E = M; @@ -173,9 +172,9 @@ double Galileo_Ephemeris::sv_clock_relativistic_term(double transmitTime) // Sat // --- Iteratively compute eccentric anomaly ---------------------------- for (int ii = 1; ii < 20; ii++) { - E_old = E; - E = M + e_1 * sin(E); - dE = fmod(E - E_old, 2*GALILEO_PI); + E_old = E; + E = M + e_1 * sin(E); + dE = fmod(E - E_old, 2 * GALILEO_PI); if (fabs(dE) < 1e-12) { //Necessary precision is reached, exit from the loop @@ -184,21 +183,20 @@ double Galileo_Ephemeris::sv_clock_relativistic_term(double transmitTime) // Sat } // Compute relativistic correction term - Galileo_dtr = GALILEO_F * e_1* A_1 * sin(E); + Galileo_dtr = GALILEO_F * e_1 * A_1 * sin(E); return Galileo_dtr; } - void Galileo_Ephemeris::satellitePosition(double transmitTime) { // when this function in used, the input must be the transmitted time (t) in second computed by Galileo_System_Time (above function) - double tk; // Time from ephemeris reference epoch - double a; // Semi-major axis - double n; // Corrected mean motion - double n0; // Computed mean motion - double M; // Mean anomaly - double E; // Eccentric Anomaly (to be solved by iteration) + double tk; // Time from ephemeris reference epoch + double a; // Semi-major axis + double n; // Corrected mean motion + double n0; // Computed mean motion + double M; // Mean anomaly + double E; // Eccentric Anomaly (to be solved by iteration) double E_old; double dE; double nu; // True anomaly @@ -211,10 +209,10 @@ void Galileo_Ephemeris::satellitePosition(double transmitTime) // Find Galileo satellite's position ---------------------------------------------- // Restore semi-major axis - a = A_1*A_1; + a = A_1 * A_1; // Computed mean motion - n0 = sqrt(GALILEO_GM / (a*a*a)); + n0 = sqrt(GALILEO_GM / (a * a * a)); // Time from ephemeris reference epoch tk = transmitTime - t0e_1; @@ -226,17 +224,17 @@ void Galileo_Ephemeris::satellitePosition(double transmitTime) M = M0_1 + n * tk; // Reduce mean anomaly to between 0 and 2pi - M = fmod((M + 2* GALILEO_PI), (2* GALILEO_PI)); + M = fmod((M + 2 * GALILEO_PI), (2 * GALILEO_PI)); // Initial guess of eccentric anomaly E = M; // --- Iteratively compute eccentric anomaly ---------------------------- - for (int ii = 1; ii<20; ii++) + for (int ii = 1; ii < 20; ii++) { - E_old = E; - E = M + e_1 * sin(E); - dE = fmod(E - E_old, 2*GALILEO_PI); + E_old = E; + E = M + e_1 * sin(E); + dE = fmod(E - E_old, 2 * GALILEO_PI); if (fabs(dE) < 1e-12) { //Necessary precision is reached, exit from the loop @@ -254,32 +252,31 @@ void Galileo_Ephemeris::satellitePosition(double transmitTime) phi = nu + omega_2; // Reduce phi to between 0 and 2*pi rad - phi = fmod((phi), (2*GALILEO_PI)); + phi = fmod((phi), (2 * GALILEO_PI)); // Correct argument of latitude - u = phi + C_uc_3 * cos(2*phi) + C_us_3 * sin(2*phi); + u = phi + C_uc_3 * cos(2 * phi) + C_us_3 * sin(2 * phi); // Correct radius - r = a * (1 - e_1*cos(E)) + C_rc_3 * cos(2*phi) + C_rs_3 * sin(2*phi); + r = a * (1 - e_1 * cos(E)) + C_rc_3 * cos(2 * phi) + C_rs_3 * sin(2 * phi); // Correct inclination - i = i_0_2 + iDot_2 * tk + C_ic_4 * cos(2*phi) + C_is_4 * sin(2*phi); + i = i_0_2 + iDot_2 * tk + C_ic_4 * cos(2 * phi) + C_is_4 * sin(2 * phi); // Compute the angle between the ascending node and the Greenwich meridian - Omega = OMEGA_0_2 + (OMEGA_dot_3 - GALILEO_OMEGA_EARTH_DOT)*tk - GALILEO_OMEGA_EARTH_DOT * t0e_1; + Omega = OMEGA_0_2 + (OMEGA_dot_3 - GALILEO_OMEGA_EARTH_DOT) * tk - GALILEO_OMEGA_EARTH_DOT * t0e_1; // Reduce to between 0 and 2*pi rad - Omega = fmod((Omega + 2*GALILEO_PI), (2*GALILEO_PI)); + Omega = fmod((Omega + 2 * GALILEO_PI), (2 * GALILEO_PI)); // --- Compute satellite coordinates in Earth-fixed coordinates d_satpos_X = cos(u) * r * cos(Omega) - sin(u) * r * cos(i) * sin(Omega); - d_satpos_Y = cos(u) * r * sin(Omega) + sin(u) * r * cos(i) * cos(Omega); // ********NOTE: in GALILEO ICD this expression is not correct because it has minus (- sin(u) * r * cos(i) * cos(Omega)) instead of plus + d_satpos_Y = cos(u) * r * sin(Omega) + sin(u) * r * cos(i) * cos(Omega); // ********NOTE: in GALILEO ICD this expression is not correct because it has minus (- sin(u) * r * cos(i) * cos(Omega)) instead of plus d_satpos_Z = sin(u) * r * sin(i); // Satellite's velocity. Can be useful for Vector Tracking loops double Omega_dot = OMEGA_dot_3 - GALILEO_OMEGA_EARTH_DOT; - d_satvel_X = - Omega_dot * (cos(u) * r + sin(u) * r * cos(i)) + d_satpos_X * cos(Omega) - d_satpos_Y * cos(i) * sin(Omega); + d_satvel_X = -Omega_dot * (cos(u) * r + sin(u) * r * cos(i)) + d_satpos_X * cos(Omega) - d_satpos_Y * cos(i) * sin(Omega); d_satvel_Y = Omega_dot * (cos(u) * r * cos(Omega) - sin(u) * r * cos(i) * sin(Omega)) + d_satpos_X * sin(Omega) + d_satpos_Y * cos(i) * cos(Omega); d_satvel_Z = d_satpos_Y * sin(i); } - diff --git a/src/core/system_parameters/galileo_ephemeris.h b/src/core/system_parameters/galileo_ephemeris.h index c279fd649..a250e0dba 100644 --- a/src/core/system_parameters/galileo_ephemeris.h +++ b/src/core/system_parameters/galileo_ephemeris.h @@ -51,47 +51,47 @@ public: int IOD_ephemeris; int IOD_nav_1; int SV_ID_PRN_4; - double M0_1; //!< Mean anomaly at reference time [semi-circles] - double delta_n_3; //!< Mean motion difference from computed value [semi-circles/sec] - double e_1; //!< Eccentricity - double A_1; //!< Square root of the semi-major axis [metres^1/2] - double OMEGA_0_2; //!< Longitude of ascending node of orbital plane at weekly epoch [semi-circles] - double i_0_2; //!< Inclination angle at reference time [semi-circles] - double omega_2; //!< Argument of perigee [semi-circles] - double OMEGA_dot_3; //!< Rate of right ascension [semi-circles/sec] - double iDot_2; //!< Rate of inclination angle [semi-circles/sec] - double C_uc_3; //!< Amplitude of the cosine harmonic correction term to the argument of latitude [radians] - double C_us_3; //!< Amplitude of the sine harmonic correction term to the argument of latitude [radians] - double C_rc_3; //!< Amplitude of the cosine harmonic correction term to the orbit radius [meters] - double C_rs_3; //!< Amplitude of the sine harmonic correction term to the orbit radius [meters] - double C_ic_4; //!< Amplitude of the cosine harmonic correction term to the angle of inclination [radians] - double C_is_4; //!< Amplitude of the sine harmonic correction term to the angle of inclination [radians] - double t0e_1; //!< Ephemeris reference time [s] + double M0_1; //!< Mean anomaly at reference time [semi-circles] + double delta_n_3; //!< Mean motion difference from computed value [semi-circles/sec] + double e_1; //!< Eccentricity + double A_1; //!< Square root of the semi-major axis [metres^1/2] + double OMEGA_0_2; //!< Longitude of ascending node of orbital plane at weekly epoch [semi-circles] + double i_0_2; //!< Inclination angle at reference time [semi-circles] + double omega_2; //!< Argument of perigee [semi-circles] + double OMEGA_dot_3; //!< Rate of right ascension [semi-circles/sec] + double iDot_2; //!< Rate of inclination angle [semi-circles/sec] + double C_uc_3; //!< Amplitude of the cosine harmonic correction term to the argument of latitude [radians] + double C_us_3; //!< Amplitude of the sine harmonic correction term to the argument of latitude [radians] + double C_rc_3; //!< Amplitude of the cosine harmonic correction term to the orbit radius [meters] + double C_rs_3; //!< Amplitude of the sine harmonic correction term to the orbit radius [meters] + double C_ic_4; //!< Amplitude of the cosine harmonic correction term to the angle of inclination [radians] + double C_is_4; //!< Amplitude of the sine harmonic correction term to the angle of inclination [radians] + double t0e_1; //!< Ephemeris reference time [s] /*Clock correction parameters*/ - double t0c_4; //!< Clock correction data reference Time of Week [sec] - double af0_4; //!< SV clock bias correction coefficient [s] - double af1_4; //!< SV clock drift correction coefficient [s/s] - double af2_4; //!< SV clock drift rate correction coefficient [s/s^2] + double t0c_4; //!< Clock correction data reference Time of Week [sec] + double af0_4; //!< SV clock bias correction coefficient [s] + double af1_4; //!< SV clock drift correction coefficient [s/s] + double af2_4; //!< SV clock drift rate correction coefficient [s/s^2] /*GST*/ //Not belong to ephemeris set (page 1 to 4) - double WN_5; //!< Week number - double TOW_5; //!< Time of Week + double WN_5; //!< Week number + double TOW_5; //!< Time of Week double Galileo_satClkDrift; - double Galileo_dtr; //!< relativistic clock correction term + double Galileo_dtr; //!< relativistic clock correction term // SV status double SISA_3; - unsigned int E5a_HS; //!< E5a Signal Health Status - double E5b_HS_5; //!< E5b Signal Health Status - double E1B_HS_5; //!< E1B Signal Health Status - bool E5a_DVS; //!< E5a Data Validity Status - double E5b_DVS_5; //!< E5b Data Validity Status - double E1B_DVS_5; //!< E1B Data Validity Status + unsigned int E5a_HS; //!< E5a Signal Health Status + double E5b_HS_5; //!< E5b Signal Health Status + double E1B_HS_5; //!< E1B Signal Health Status + bool E5a_DVS; //!< E5a Data Validity Status + double E5b_DVS_5; //!< E5b Data Validity Status + double E1B_DVS_5; //!< E1B Data Validity Status - double BGD_E1E5a_5; //!< E1-E5a Broadcast Group Delay [s] - double BGD_E1E5b_5; //!< E1-E5b Broadcast Group Delay [s] + double BGD_E1E5a_5; //!< E1-E5a Broadcast Group Delay [s] + double BGD_E1E5b_5; //!< E1-E5b Broadcast Group Delay [s] // satellite positions double d_satpos_X; //!< Earth-fixed coordinate x of the satellite [m]. Intersection of the IERS Reference Meridian (IRM) and the plane passing through the origin and normal to the Z-axis. @@ -103,15 +103,15 @@ public: double d_satvel_Y; //!< Earth-fixed velocity coordinate y of the satellite [m] double d_satvel_Z; //!< Earth-fixed velocity coordinate z of the satellite [m] - unsigned int i_satellite_PRN; //!< SV PRN NUMBER + unsigned int i_satellite_PRN; //!< SV PRN NUMBER - void satellitePosition(double transmitTime); //!< Computes the ECEF SV coordinates and ECEF velocity - double Galileo_System_Time(double WN, double TOW); //!< Galileo System Time (GST), ICD paragraph 5.1.2 - double sv_clock_drift(double transmitTime); //!< Satellite Time Correction Algorithm, ICD 5.1.4 - double sv_clock_relativistic_term(double transmitTime); //!< Satellite Time Correction Algorithm, ICD 5.1.4 + void satellitePosition(double transmitTime); //!< Computes the ECEF SV coordinates and ECEF velocity + double Galileo_System_Time(double WN, double TOW); //!< Galileo System Time (GST), ICD paragraph 5.1.2 + double sv_clock_drift(double transmitTime); //!< Satellite Time Correction Algorithm, ICD 5.1.4 + double sv_clock_relativistic_term(double transmitTime); //!< Satellite Time Correction Algorithm, ICD 5.1.4 Galileo_Ephemeris(); - template + template /*! * \brief Serialize is a boost standard method to be called by the boost XML serialization. Here is used to save the ephemeris data on disk file. @@ -119,27 +119,29 @@ public: inline void serialize(Archive& archive, const unsigned int version) { using boost::serialization::make_nvp; - if(version){}; - archive & make_nvp("i_satellite_PRN",i_satellite_PRN); - archive & make_nvp("M0_1", M0_1); - archive & make_nvp("e_1", e_1); - archive & make_nvp("A_1", A_1); - archive & make_nvp("OMEGA_0_2", OMEGA_0_2); - archive & make_nvp("i_0_2", i_0_2); - archive & make_nvp("omega_2", omega_2); - archive & make_nvp("OMEGA_dot_3", OMEGA_dot_3); - archive & make_nvp("iDot_2", iDot_2); - archive & make_nvp("C_uc_3", C_uc_3); - archive & make_nvp("C_us_3", C_us_3); - archive & make_nvp("C_rc_3", C_rc_3); - archive & make_nvp("C_rs_3", C_rs_3); - archive & make_nvp("C_ic_4", C_ic_4); - archive & make_nvp("C_is_4", C_is_4); - archive & make_nvp("t0e_1", t0e_1); - archive & make_nvp("t0c_4", t0c_4); - archive & make_nvp("af0_4", af0_4); - archive & make_nvp("af1_4", af1_4); - archive & make_nvp("af2_4", af2_4); + if (version) + { + }; + archive& make_nvp("i_satellite_PRN", i_satellite_PRN); + archive& make_nvp("M0_1", M0_1); + archive& make_nvp("e_1", e_1); + archive& make_nvp("A_1", A_1); + archive& make_nvp("OMEGA_0_2", OMEGA_0_2); + archive& make_nvp("i_0_2", i_0_2); + archive& make_nvp("omega_2", omega_2); + archive& make_nvp("OMEGA_dot_3", OMEGA_dot_3); + archive& make_nvp("iDot_2", iDot_2); + archive& make_nvp("C_uc_3", C_uc_3); + archive& make_nvp("C_us_3", C_us_3); + archive& make_nvp("C_rc_3", C_rc_3); + archive& make_nvp("C_rs_3", C_rs_3); + archive& make_nvp("C_ic_4", C_ic_4); + archive& make_nvp("C_is_4", C_is_4); + archive& make_nvp("t0e_1", t0e_1); + archive& make_nvp("t0c_4", t0c_4); + archive& make_nvp("af0_4", af0_4); + archive& make_nvp("af1_4", af1_4); + archive& make_nvp("af2_4", af2_4); } }; diff --git a/src/core/system_parameters/galileo_fnav_message.cc b/src/core/system_parameters/galileo_fnav_message.cc index 209053fca..fd3c6c982 100644 --- a/src/core/system_parameters/galileo_fnav_message.cc +++ b/src/core/system_parameters/galileo_fnav_message.cc @@ -35,7 +35,7 @@ */ #include "galileo_fnav_message.h" -#include // for boost::crc_basic, boost::crc_optimal +#include // for boost::crc_basic, boost::crc_optimal #include #include #include @@ -51,17 +51,17 @@ void Galileo_Fnav_Message::reset() flag_ephemeris_2 = false; //!< Flag indicating that ephemeris 2/3 (word 3) have been received flag_ephemeris_3 = false; //!< Flag indicating that ephemeris 3/3 (word 4) have been received - flag_iono_and_GST = false; //!< Flag indicating that ionospheric and GST parameters (word 1) have been received + flag_iono_and_GST = false; //!< Flag indicating that ionospheric and GST parameters (word 1) have been received flag_TOW_1 = false; flag_TOW_2 = false; flag_TOW_3 = false; flag_TOW_4 = false; - flag_TOW_set = false; //!< it is true when page 1,2,3 or 4 arrives - flag_utc_model = false; //!< Flag indicating that utc model parameters (word 4) have been received + flag_TOW_set = false; //!< it is true when page 1,2,3 or 4 arrives + flag_utc_model = false; //!< Flag indicating that utc model parameters (word 4) have been received - flag_all_almanac = false; //!< Flag indicating that all almanac have been received - flag_almanac_1 = false; //!< Flag indicating that almanac 1/2 (word 5) have been received - flag_almanac_2 = false; //!< Flag indicating that almanac 2/2 (word 6) have been received + flag_all_almanac = false; //!< Flag indicating that all almanac have been received + flag_almanac_1 = false; //!< Flag indicating that almanac 1/2 (word 5) have been received + flag_almanac_2 = false; //!< Flag indicating that almanac 2/2 (word 6) have been received IOD_ephemeris = 0; @@ -228,7 +228,7 @@ bool Galileo_Fnav_Message::_CRC_test(std::bitset b boost::to_block_range(frame_bits, std::back_inserter(bytes)); std::reverse(bytes.begin(), bytes.end()); - CRC_Galileo.process_bytes( bytes.data(), GALILEO_FNAV_DATA_FRAME_BYTES ); + CRC_Galileo.process_bytes(bytes.data(), GALILEO_FNAV_DATA_FRAME_BYTES); crc_computed = CRC_Galileo.checksum(); if (checksum == crc_computed) @@ -246,222 +246,222 @@ void Galileo_Fnav_Message::decode_page(std::string data) { std::bitset data_bits(data); page_type = read_navigation_unsigned(data_bits, FNAV_PAGE_TYPE_bit); - switch(page_type) - { - case 1: // SVID, Clock correction, SISA, Ionospheric correction, BGD, GST, Signal health and Data validity status - FNAV_SV_ID_PRN_1 = static_cast(read_navigation_unsigned(data_bits, FNAV_SV_ID_PRN_1_bit)); - FNAV_IODnav_1 =static_cast(read_navigation_unsigned(data_bits, FNAV_IODnav_1_bit)); - FNAV_t0c_1 = static_cast(read_navigation_unsigned(data_bits, FNAV_t0c_1_bit)); - FNAV_t0c_1 *= FNAV_t0c_1_LSB; - FNAV_af0_1 = static_cast(read_navigation_signed(data_bits, FNAV_af0_1_bit)); - FNAV_af0_1 *= FNAV_af0_1_LSB; - FNAV_af1_1 = static_cast(read_navigation_signed(data_bits, FNAV_af1_1_bit)); - FNAV_af1_1 *= FNAV_af1_1_LSB; - FNAV_af2_1 = static_cast(read_navigation_signed(data_bits, FNAV_af2_1_bit)); - FNAV_af2_1 *= FNAV_af2_1_LSB; - FNAV_SISA_1 = static_cast(read_navigation_unsigned(data_bits, FNAV_SISA_1_bit)); - FNAV_ai0_1 = static_cast(read_navigation_unsigned(data_bits, FNAV_ai0_1_bit)); - FNAV_ai0_1 *= FNAV_ai0_1_LSB; - FNAV_ai1_1 = static_cast(read_navigation_signed(data_bits, FNAV_ai1_1_bit)); - FNAV_ai1_1 *= FNAV_ai1_1_LSB; - FNAV_ai2_1 = static_cast(read_navigation_signed(data_bits, FNAV_ai2_1_bit)); - FNAV_ai2_1 *= FNAV_ai2_1_LSB; - FNAV_region1_1 = static_cast(read_navigation_unsigned(data_bits, FNAV_region1_1_bit)); - FNAV_region2_1 = static_cast(read_navigation_unsigned(data_bits, FNAV_region2_1_bit)); - FNAV_region3_1 = static_cast(read_navigation_unsigned(data_bits, FNAV_region3_1_bit)); - FNAV_region4_1 = static_cast(read_navigation_unsigned(data_bits, FNAV_region4_1_bit)); - FNAV_region5_1 = static_cast(read_navigation_unsigned(data_bits, FNAV_region5_1_bit)); - FNAV_BGD_1 = static_cast(read_navigation_signed(data_bits, FNAV_BGD_1_bit)); - FNAV_BGD_1 *= FNAV_BGD_1_LSB; - FNAV_E5ahs_1 = static_cast(read_navigation_unsigned(data_bits, FNAV_E5ahs_1_bit)); - FNAV_WN_1 = static_cast(read_navigation_unsigned(data_bits, FNAV_WN_1_bit)); - FNAV_TOW_1 = static_cast(read_navigation_unsigned(data_bits, FNAV_TOW_1_bit)); - FNAV_E5advs_1 = static_cast(read_navigation_unsigned(data_bits, FNAV_E5advs_1_bit)); + switch (page_type) + { + case 1: // SVID, Clock correction, SISA, Ionospheric correction, BGD, GST, Signal health and Data validity status + FNAV_SV_ID_PRN_1 = static_cast(read_navigation_unsigned(data_bits, FNAV_SV_ID_PRN_1_bit)); + FNAV_IODnav_1 = static_cast(read_navigation_unsigned(data_bits, FNAV_IODnav_1_bit)); + FNAV_t0c_1 = static_cast(read_navigation_unsigned(data_bits, FNAV_t0c_1_bit)); + FNAV_t0c_1 *= FNAV_t0c_1_LSB; + FNAV_af0_1 = static_cast(read_navigation_signed(data_bits, FNAV_af0_1_bit)); + FNAV_af0_1 *= FNAV_af0_1_LSB; + FNAV_af1_1 = static_cast(read_navigation_signed(data_bits, FNAV_af1_1_bit)); + FNAV_af1_1 *= FNAV_af1_1_LSB; + FNAV_af2_1 = static_cast(read_navigation_signed(data_bits, FNAV_af2_1_bit)); + FNAV_af2_1 *= FNAV_af2_1_LSB; + FNAV_SISA_1 = static_cast(read_navigation_unsigned(data_bits, FNAV_SISA_1_bit)); + FNAV_ai0_1 = static_cast(read_navigation_unsigned(data_bits, FNAV_ai0_1_bit)); + FNAV_ai0_1 *= FNAV_ai0_1_LSB; + FNAV_ai1_1 = static_cast(read_navigation_signed(data_bits, FNAV_ai1_1_bit)); + FNAV_ai1_1 *= FNAV_ai1_1_LSB; + FNAV_ai2_1 = static_cast(read_navigation_signed(data_bits, FNAV_ai2_1_bit)); + FNAV_ai2_1 *= FNAV_ai2_1_LSB; + FNAV_region1_1 = static_cast(read_navigation_unsigned(data_bits, FNAV_region1_1_bit)); + FNAV_region2_1 = static_cast(read_navigation_unsigned(data_bits, FNAV_region2_1_bit)); + FNAV_region3_1 = static_cast(read_navigation_unsigned(data_bits, FNAV_region3_1_bit)); + FNAV_region4_1 = static_cast(read_navigation_unsigned(data_bits, FNAV_region4_1_bit)); + FNAV_region5_1 = static_cast(read_navigation_unsigned(data_bits, FNAV_region5_1_bit)); + FNAV_BGD_1 = static_cast(read_navigation_signed(data_bits, FNAV_BGD_1_bit)); + FNAV_BGD_1 *= FNAV_BGD_1_LSB; + FNAV_E5ahs_1 = static_cast(read_navigation_unsigned(data_bits, FNAV_E5ahs_1_bit)); + FNAV_WN_1 = static_cast(read_navigation_unsigned(data_bits, FNAV_WN_1_bit)); + FNAV_TOW_1 = static_cast(read_navigation_unsigned(data_bits, FNAV_TOW_1_bit)); + FNAV_E5advs_1 = static_cast(read_navigation_unsigned(data_bits, FNAV_E5advs_1_bit)); - flag_TOW_1 = true; - flag_TOW_set = true; - flag_iono_and_GST = true; //set to false externally - break; - case 2: // Ephemeris (1/3) and GST - FNAV_IODnav_2 = static_cast(read_navigation_unsigned(data_bits, FNAV_IODnav_2_bit)); - FNAV_M0_2 = static_cast(read_navigation_unsigned(data_bits, FNAV_M0_2_bit)); - FNAV_M0_2 *= FNAV_M0_2_LSB; - FNAV_omegadot_2 = static_cast(read_navigation_signed(data_bits, FNAV_omegadot_2_bit)); - FNAV_omegadot_2 *= FNAV_omegadot_2_LSB; - FNAV_e_2 = static_cast(read_navigation_unsigned(data_bits, FNAV_e_2_bit)); - FNAV_e_2 *= FNAV_e_2_LSB; - FNAV_a12_2 = static_cast(read_navigation_unsigned(data_bits, FNAV_a12_2_bit)); - FNAV_a12_2 *= FNAV_a12_2_LSB; - FNAV_omega0_2 = static_cast(read_navigation_signed(data_bits, FNAV_omega0_2_bit)); - FNAV_omega0_2 *= FNAV_omega0_2_LSB; - FNAV_idot_2 = static_cast(read_navigation_signed(data_bits, FNAV_idot_2_bit)); - FNAV_idot_2 *= FNAV_idot_2_LSB; - FNAV_WN_2 = static_cast(read_navigation_unsigned(data_bits, FNAV_WN_2_bit)); - FNAV_TOW_2 = static_cast(read_navigation_unsigned(data_bits, FNAV_TOW_2_bit)); + flag_TOW_1 = true; + flag_TOW_set = true; + flag_iono_and_GST = true; //set to false externally + break; + case 2: // Ephemeris (1/3) and GST + FNAV_IODnav_2 = static_cast(read_navigation_unsigned(data_bits, FNAV_IODnav_2_bit)); + FNAV_M0_2 = static_cast(read_navigation_unsigned(data_bits, FNAV_M0_2_bit)); + FNAV_M0_2 *= FNAV_M0_2_LSB; + FNAV_omegadot_2 = static_cast(read_navigation_signed(data_bits, FNAV_omegadot_2_bit)); + FNAV_omegadot_2 *= FNAV_omegadot_2_LSB; + FNAV_e_2 = static_cast(read_navigation_unsigned(data_bits, FNAV_e_2_bit)); + FNAV_e_2 *= FNAV_e_2_LSB; + FNAV_a12_2 = static_cast(read_navigation_unsigned(data_bits, FNAV_a12_2_bit)); + FNAV_a12_2 *= FNAV_a12_2_LSB; + FNAV_omega0_2 = static_cast(read_navigation_signed(data_bits, FNAV_omega0_2_bit)); + FNAV_omega0_2 *= FNAV_omega0_2_LSB; + FNAV_idot_2 = static_cast(read_navigation_signed(data_bits, FNAV_idot_2_bit)); + FNAV_idot_2 *= FNAV_idot_2_LSB; + FNAV_WN_2 = static_cast(read_navigation_unsigned(data_bits, FNAV_WN_2_bit)); + FNAV_TOW_2 = static_cast(read_navigation_unsigned(data_bits, FNAV_TOW_2_bit)); - flag_TOW_2 = true; - flag_TOW_set = true; - flag_ephemeris_1 = true; - break; - case 3: // Ephemeris (2/3) and GST - FNAV_IODnav_3 = static_cast(read_navigation_unsigned(data_bits, FNAV_IODnav_3_bit)); - FNAV_i0_3 = static_cast(read_navigation_signed(data_bits, FNAV_i0_3_bit)); - FNAV_i0_3 *= FNAV_i0_3_LSB; - FNAV_w_3=static_cast(read_navigation_signed(data_bits, FNAV_w_3_bit)); - FNAV_w_3 *= FNAV_w_3_LSB; - FNAV_deltan_3 = static_cast(read_navigation_unsigned(data_bits, FNAV_deltan_3_bit)); - FNAV_deltan_3 *= FNAV_deltan_3_LSB; - FNAV_Cuc_3 = static_cast(read_navigation_signed(data_bits, FNAV_Cuc_3_bit)); - FNAV_Cuc_3 *= FNAV_Cuc_3_LSB; - FNAV_Cus_3 = static_cast(read_navigation_signed(data_bits, FNAV_Cus_3_bit)); - FNAV_Cus_3 *= FNAV_Cus_3_LSB; - FNAV_Crc_3 = static_cast(read_navigation_signed(data_bits, FNAV_Crc_3_bit)); - FNAV_Crc_3 *= FNAV_Crc_3_LSB; - FNAV_Crs_3 = static_cast(read_navigation_signed(data_bits, FNAV_Crs_3_bit)); - FNAV_Crs_3 *= FNAV_Crs_3_LSB; - FNAV_t0e_3 = static_cast(read_navigation_unsigned(data_bits, FNAV_t0e_3_bit)); - FNAV_t0e_3 *= FNAV_t0e_3_LSB; - FNAV_WN_3 = static_cast(read_navigation_unsigned(data_bits, FNAV_WN_3_bit)); - FNAV_TOW_3 = static_cast(read_navigation_unsigned(data_bits, FNAV_TOW_3_bit)); + flag_TOW_2 = true; + flag_TOW_set = true; + flag_ephemeris_1 = true; + break; + case 3: // Ephemeris (2/3) and GST + FNAV_IODnav_3 = static_cast(read_navigation_unsigned(data_bits, FNAV_IODnav_3_bit)); + FNAV_i0_3 = static_cast(read_navigation_signed(data_bits, FNAV_i0_3_bit)); + FNAV_i0_3 *= FNAV_i0_3_LSB; + FNAV_w_3 = static_cast(read_navigation_signed(data_bits, FNAV_w_3_bit)); + FNAV_w_3 *= FNAV_w_3_LSB; + FNAV_deltan_3 = static_cast(read_navigation_unsigned(data_bits, FNAV_deltan_3_bit)); + FNAV_deltan_3 *= FNAV_deltan_3_LSB; + FNAV_Cuc_3 = static_cast(read_navigation_signed(data_bits, FNAV_Cuc_3_bit)); + FNAV_Cuc_3 *= FNAV_Cuc_3_LSB; + FNAV_Cus_3 = static_cast(read_navigation_signed(data_bits, FNAV_Cus_3_bit)); + FNAV_Cus_3 *= FNAV_Cus_3_LSB; + FNAV_Crc_3 = static_cast(read_navigation_signed(data_bits, FNAV_Crc_3_bit)); + FNAV_Crc_3 *= FNAV_Crc_3_LSB; + FNAV_Crs_3 = static_cast(read_navigation_signed(data_bits, FNAV_Crs_3_bit)); + FNAV_Crs_3 *= FNAV_Crs_3_LSB; + FNAV_t0e_3 = static_cast(read_navigation_unsigned(data_bits, FNAV_t0e_3_bit)); + FNAV_t0e_3 *= FNAV_t0e_3_LSB; + FNAV_WN_3 = static_cast(read_navigation_unsigned(data_bits, FNAV_WN_3_bit)); + FNAV_TOW_3 = static_cast(read_navigation_unsigned(data_bits, FNAV_TOW_3_bit)); - flag_TOW_3 = true; - flag_TOW_set = true; - flag_ephemeris_2 = true; - break; - case 4: // Ephemeris (3/3), GST-UTC conversion, GST-GPS conversion and TOW - FNAV_IODnav_4 = static_cast(read_navigation_unsigned(data_bits, FNAV_IODnav_4_bit)); - FNAV_Cic_4 = static_cast(read_navigation_unsigned(data_bits, FNAV_Cic_4_bit)); - FNAV_Cic_4 *= FNAV_Cic_4_LSB; - FNAV_Cis_4 = static_cast(read_navigation_unsigned(data_bits, FNAV_Cis_4_bit)); - FNAV_Cis_4 *= FNAV_Cis_4_LSB; - FNAV_A0_4 = static_cast(read_navigation_unsigned(data_bits, FNAV_A0_4_bit)); - FNAV_A0_4 *= FNAV_A0_4_LSB; - FNAV_A1_4 = static_cast(read_navigation_unsigned(data_bits, FNAV_A1_4_bit)); - FNAV_A1_4 *= FNAV_A1_4_LSB; - FNAV_deltatls_4 = static_cast(read_navigation_signed(data_bits, FNAV_deltatls_4_bit)); - FNAV_t0t_4 = static_cast(read_navigation_unsigned(data_bits, FNAV_t0t_4_bit)); - FNAV_t0t_4 *= FNAV_t0t_4_LSB; - FNAV_WNot_4 = static_cast(read_navigation_unsigned(data_bits, FNAV_WNot_4_bit)); - FNAV_WNlsf_4 = static_cast(read_navigation_unsigned(data_bits, FNAV_WNlsf_4_bit)); - FNAV_DN_4 = static_cast(read_navigation_unsigned(data_bits, FNAV_DN_4_bit)); - FNAV_deltatlsf_4 = static_cast(read_navigation_signed(data_bits, FNAV_deltatlsf_4_bit)); - FNAV_t0g_4 = static_cast(read_navigation_unsigned(data_bits, FNAV_t0g_4_bit)); - FNAV_t0g_4 *= FNAV_t0g_4_LSB; - FNAV_A0g_4 = static_cast(read_navigation_signed(data_bits, FNAV_A0g_4_bit)); - FNAV_A0g_4 *= FNAV_A0g_4_LSB; - FNAV_A1g_4 = static_cast(read_navigation_signed(data_bits, FNAV_A1g_4_bit)); - FNAV_A1g_4 *= FNAV_A1g_4_LSB; - FNAV_WN0g_4 = static_cast(read_navigation_unsigned(data_bits, FNAV_WN0g_4_bit)); - FNAV_TOW_4 = static_cast(read_navigation_unsigned(data_bits, FNAV_TOW_4_bit)); + flag_TOW_3 = true; + flag_TOW_set = true; + flag_ephemeris_2 = true; + break; + case 4: // Ephemeris (3/3), GST-UTC conversion, GST-GPS conversion and TOW + FNAV_IODnav_4 = static_cast(read_navigation_unsigned(data_bits, FNAV_IODnav_4_bit)); + FNAV_Cic_4 = static_cast(read_navigation_unsigned(data_bits, FNAV_Cic_4_bit)); + FNAV_Cic_4 *= FNAV_Cic_4_LSB; + FNAV_Cis_4 = static_cast(read_navigation_unsigned(data_bits, FNAV_Cis_4_bit)); + FNAV_Cis_4 *= FNAV_Cis_4_LSB; + FNAV_A0_4 = static_cast(read_navigation_unsigned(data_bits, FNAV_A0_4_bit)); + FNAV_A0_4 *= FNAV_A0_4_LSB; + FNAV_A1_4 = static_cast(read_navigation_unsigned(data_bits, FNAV_A1_4_bit)); + FNAV_A1_4 *= FNAV_A1_4_LSB; + FNAV_deltatls_4 = static_cast(read_navigation_signed(data_bits, FNAV_deltatls_4_bit)); + FNAV_t0t_4 = static_cast(read_navigation_unsigned(data_bits, FNAV_t0t_4_bit)); + FNAV_t0t_4 *= FNAV_t0t_4_LSB; + FNAV_WNot_4 = static_cast(read_navigation_unsigned(data_bits, FNAV_WNot_4_bit)); + FNAV_WNlsf_4 = static_cast(read_navigation_unsigned(data_bits, FNAV_WNlsf_4_bit)); + FNAV_DN_4 = static_cast(read_navigation_unsigned(data_bits, FNAV_DN_4_bit)); + FNAV_deltatlsf_4 = static_cast(read_navigation_signed(data_bits, FNAV_deltatlsf_4_bit)); + FNAV_t0g_4 = static_cast(read_navigation_unsigned(data_bits, FNAV_t0g_4_bit)); + FNAV_t0g_4 *= FNAV_t0g_4_LSB; + FNAV_A0g_4 = static_cast(read_navigation_signed(data_bits, FNAV_A0g_4_bit)); + FNAV_A0g_4 *= FNAV_A0g_4_LSB; + FNAV_A1g_4 = static_cast(read_navigation_signed(data_bits, FNAV_A1g_4_bit)); + FNAV_A1g_4 *= FNAV_A1g_4_LSB; + FNAV_WN0g_4 = static_cast(read_navigation_unsigned(data_bits, FNAV_WN0g_4_bit)); + FNAV_TOW_4 = static_cast(read_navigation_unsigned(data_bits, FNAV_TOW_4_bit)); - flag_TOW_4 = true; - flag_TOW_set = true; - flag_ephemeris_3 = true; - flag_utc_model = true; //set to false externally - break; - case 5: // Almanac (SVID1 and SVID2(1/2)), Week Number and almanac reference time - FNAV_IODa_5 = static_cast(read_navigation_unsigned(data_bits, FNAV_IODa_5_bit)); - FNAV_WNa_5 = static_cast(read_navigation_unsigned(data_bits, FNAV_WNa_5_bit)); - FNAV_t0a_5 = static_cast(read_navigation_unsigned(data_bits, FNAV_t0a_5_bit)); - FNAV_t0a_5 *= FNAV_t0a_5_LSB; - FNAV_SVID1_5 = static_cast(read_navigation_unsigned(data_bits, FNAV_SVID1_5_bit)); - FNAV_Deltaa12_1_5 = static_cast(read_navigation_signed(data_bits, FNAV_Deltaa12_1_5_bit)); - FNAV_Deltaa12_1_5 *= FNAV_Deltaa12_5_LSB; - FNAV_e_1_5 = static_cast(read_navigation_unsigned(data_bits, FNAV_e_1_5_bit)); - FNAV_e_1_5 *= FNAV_e_5_LSB; - FNAV_w_1_5 = static_cast(read_navigation_signed(data_bits, FNAV_w_1_5_bit)); - FNAV_w_1_5 *= FNAV_w_5_LSB; - FNAV_deltai_1_5 = static_cast(read_navigation_signed(data_bits, FNAV_deltai_1_5_bit)); - FNAV_deltai_1_5 *= FNAV_deltai_5_LSB; - FNAV_Omega0_1_5 = static_cast(read_navigation_signed(data_bits, FNAV_Omega0_1_5_bit)); - FNAV_Omega0_1_5 *= FNAV_Omega0_5_LSB; - FNAV_Omegadot_1_5 = static_cast(read_navigation_signed(data_bits, FNAV_Omegadot_1_5_bit)); - FNAV_Omegadot_1_5 *= FNAV_Omegadot_5_LSB; - FNAV_M0_1_5 = static_cast(read_navigation_signed(data_bits, FNAV_M0_1_5_bit)); - FNAV_M0_1_5 *= FNAV_M0_5_LSB; - FNAV_af0_1_5 = static_cast(read_navigation_signed(data_bits, FNAV_af0_1_5_bit)); - FNAV_af0_1_5 *= FNAV_af0_5_LSB; - FNAV_af1_1_5 = static_cast(read_navigation_signed(data_bits, FNAV_af1_1_5_bit)); - FNAV_af1_1_5 *= FNAV_af1_5_LSB; - FNAV_E5ahs_1_5 = static_cast(read_navigation_unsigned(data_bits, FNAV_E5ahs_1_5_bit)); - FNAV_SVID2_5 = static_cast(read_navigation_unsigned(data_bits, FNAV_SVID2_5_bit)); - FNAV_Deltaa12_2_5 = static_cast(read_navigation_signed(data_bits, FNAV_Deltaa12_2_5_bit)); - FNAV_Deltaa12_2_5 *= FNAV_Deltaa12_5_LSB; - FNAV_e_2_5 = static_cast(read_navigation_unsigned(data_bits, FNAV_e_2_5_bit)); - FNAV_e_2_5 *= FNAV_e_5_LSB; - FNAV_w_2_5 = static_cast(read_navigation_signed(data_bits, FNAV_w_2_5_bit)); - FNAV_w_2_5 *= FNAV_w_5_LSB; - FNAV_deltai_2_5 = static_cast(read_navigation_signed(data_bits, FNAV_deltai_2_5_bit)); - FNAV_deltai_2_5 *= FNAV_deltai_5_LSB; - //TODO check this - // Omega0_2 must be decoded when the two pieces are joined - omega0_1 = data.substr(210, 4); - //omega_flag=true; - // - //FNAV_Omega012_2_5=static_cast(read_navigation_signed(data_bits, FNAV_Omega012_2_5_bit); + flag_TOW_4 = true; + flag_TOW_set = true; + flag_ephemeris_3 = true; + flag_utc_model = true; //set to false externally + break; + case 5: // Almanac (SVID1 and SVID2(1/2)), Week Number and almanac reference time + FNAV_IODa_5 = static_cast(read_navigation_unsigned(data_bits, FNAV_IODa_5_bit)); + FNAV_WNa_5 = static_cast(read_navigation_unsigned(data_bits, FNAV_WNa_5_bit)); + FNAV_t0a_5 = static_cast(read_navigation_unsigned(data_bits, FNAV_t0a_5_bit)); + FNAV_t0a_5 *= FNAV_t0a_5_LSB; + FNAV_SVID1_5 = static_cast(read_navigation_unsigned(data_bits, FNAV_SVID1_5_bit)); + FNAV_Deltaa12_1_5 = static_cast(read_navigation_signed(data_bits, FNAV_Deltaa12_1_5_bit)); + FNAV_Deltaa12_1_5 *= FNAV_Deltaa12_5_LSB; + FNAV_e_1_5 = static_cast(read_navigation_unsigned(data_bits, FNAV_e_1_5_bit)); + FNAV_e_1_5 *= FNAV_e_5_LSB; + FNAV_w_1_5 = static_cast(read_navigation_signed(data_bits, FNAV_w_1_5_bit)); + FNAV_w_1_5 *= FNAV_w_5_LSB; + FNAV_deltai_1_5 = static_cast(read_navigation_signed(data_bits, FNAV_deltai_1_5_bit)); + FNAV_deltai_1_5 *= FNAV_deltai_5_LSB; + FNAV_Omega0_1_5 = static_cast(read_navigation_signed(data_bits, FNAV_Omega0_1_5_bit)); + FNAV_Omega0_1_5 *= FNAV_Omega0_5_LSB; + FNAV_Omegadot_1_5 = static_cast(read_navigation_signed(data_bits, FNAV_Omegadot_1_5_bit)); + FNAV_Omegadot_1_5 *= FNAV_Omegadot_5_LSB; + FNAV_M0_1_5 = static_cast(read_navigation_signed(data_bits, FNAV_M0_1_5_bit)); + FNAV_M0_1_5 *= FNAV_M0_5_LSB; + FNAV_af0_1_5 = static_cast(read_navigation_signed(data_bits, FNAV_af0_1_5_bit)); + FNAV_af0_1_5 *= FNAV_af0_5_LSB; + FNAV_af1_1_5 = static_cast(read_navigation_signed(data_bits, FNAV_af1_1_5_bit)); + FNAV_af1_1_5 *= FNAV_af1_5_LSB; + FNAV_E5ahs_1_5 = static_cast(read_navigation_unsigned(data_bits, FNAV_E5ahs_1_5_bit)); + FNAV_SVID2_5 = static_cast(read_navigation_unsigned(data_bits, FNAV_SVID2_5_bit)); + FNAV_Deltaa12_2_5 = static_cast(read_navigation_signed(data_bits, FNAV_Deltaa12_2_5_bit)); + FNAV_Deltaa12_2_5 *= FNAV_Deltaa12_5_LSB; + FNAV_e_2_5 = static_cast(read_navigation_unsigned(data_bits, FNAV_e_2_5_bit)); + FNAV_e_2_5 *= FNAV_e_5_LSB; + FNAV_w_2_5 = static_cast(read_navigation_signed(data_bits, FNAV_w_2_5_bit)); + FNAV_w_2_5 *= FNAV_w_5_LSB; + FNAV_deltai_2_5 = static_cast(read_navigation_signed(data_bits, FNAV_deltai_2_5_bit)); + FNAV_deltai_2_5 *= FNAV_deltai_5_LSB; + //TODO check this + // Omega0_2 must be decoded when the two pieces are joined + omega0_1 = data.substr(210, 4); + //omega_flag=true; + // + //FNAV_Omega012_2_5=static_cast(read_navigation_signed(data_bits, FNAV_Omega012_2_5_bit); - flag_almanac_1 = true; - break; - case 6: // Almanac (SVID2(2/2) and SVID3) - FNAV_IODa_6 = static_cast(read_navigation_unsigned(data_bits, FNAV_IODa_6_bit)); + flag_almanac_1 = true; + break; + case 6: // Almanac (SVID2(2/2) and SVID3) + FNAV_IODa_6 = static_cast(read_navigation_unsigned(data_bits, FNAV_IODa_6_bit)); - /* Don't worry about omega pieces. If page 5 has not been received, all_ephemeris + /* Don't worry about omega pieces. If page 5 has not been received, all_ephemeris * flag will be set to false and the data won't be recorded.*/ - std::string omega0_2 = data.substr(10, 12); - std::string Omega0 = omega0_1 + omega0_2; - std::bitset omega_bits(Omega0); - const std::vector> om_bit({{0, 12}}); - FNAV_Omega0_2_6 = static_cast(read_navigation_signed(omega_bits, om_bit)); - FNAV_Omega0_2_6 *= FNAV_Omega0_5_LSB; - // - FNAV_Omegadot_2_6 = static_cast(read_navigation_signed(data_bits, FNAV_Omegadot_2_6_bit)); - FNAV_Omegadot_2_6 *= FNAV_Omegadot_5_LSB; - FNAV_M0_2_6 = static_cast(read_navigation_signed(data_bits, FNAV_M0_2_6_bit)); - FNAV_M0_2_6 *= FNAV_M0_5_LSB; - FNAV_af0_2_6 = static_cast(read_navigation_signed(data_bits, FNAV_af0_2_6_bit)); - FNAV_af0_2_6 *= FNAV_af0_5_LSB; - FNAV_af1_2_6 = static_cast(read_navigation_signed(data_bits, FNAV_af1_2_6_bit)); - FNAV_af1_2_6 *= FNAV_af1_5_LSB; - FNAV_E5ahs_2_6 = static_cast(read_navigation_unsigned(data_bits, FNAV_E5ahs_2_6_bit)); - FNAV_SVID3_6 = static_cast(read_navigation_unsigned(data_bits, FNAV_SVID3_6_bit)); - FNAV_Deltaa12_3_6 = static_cast(read_navigation_signed(data_bits, FNAV_Deltaa12_3_6_bit)); - FNAV_Deltaa12_3_6 *= FNAV_Deltaa12_5_LSB; - FNAV_e_3_6 = static_cast(read_navigation_unsigned(data_bits, FNAV_e_3_6_bit)); - FNAV_e_3_6 *= FNAV_e_5_LSB; - FNAV_w_3_6 = static_cast(read_navigation_signed(data_bits, FNAV_w_3_6_bit)); - FNAV_w_3_6 *= FNAV_w_5_LSB; - FNAV_deltai_3_6 = static_cast(read_navigation_signed(data_bits, FNAV_deltai_3_6_bit)); - FNAV_deltai_3_6 *= FNAV_deltai_5_LSB; - FNAV_Omega0_3_6 = static_cast(read_navigation_signed(data_bits, FNAV_Omega0_3_6_bit)); - FNAV_Omega0_3_6 *= FNAV_Omega0_5_LSB; - FNAV_Omegadot_3_6 = static_cast(read_navigation_signed(data_bits, FNAV_Omegadot_3_6_bit)); - FNAV_Omegadot_3_6 *= FNAV_Omegadot_5_LSB; - FNAV_M0_3_6 = static_cast(read_navigation_signed(data_bits, FNAV_M0_3_6_bit)); - FNAV_M0_3_6 *= FNAV_M0_5_LSB; - FNAV_af0_3_6 = static_cast(read_navigation_signed(data_bits, FNAV_af0_3_6_bit)); - FNAV_af0_3_6 *= FNAV_af0_5_LSB; - FNAV_af1_3_6 = static_cast(read_navigation_signed(data_bits, FNAV_af1_3_6_bit)); - FNAV_af1_3_6 *= FNAV_af1_5_LSB; - FNAV_E5ahs_3_6 = static_cast(read_navigation_unsigned(data_bits, FNAV_E5ahs_3_6_bit)); + std::string omega0_2 = data.substr(10, 12); + std::string Omega0 = omega0_1 + omega0_2; + std::bitset omega_bits(Omega0); + const std::vector> om_bit({{0, 12}}); + FNAV_Omega0_2_6 = static_cast(read_navigation_signed(omega_bits, om_bit)); + FNAV_Omega0_2_6 *= FNAV_Omega0_5_LSB; + // + FNAV_Omegadot_2_6 = static_cast(read_navigation_signed(data_bits, FNAV_Omegadot_2_6_bit)); + FNAV_Omegadot_2_6 *= FNAV_Omegadot_5_LSB; + FNAV_M0_2_6 = static_cast(read_navigation_signed(data_bits, FNAV_M0_2_6_bit)); + FNAV_M0_2_6 *= FNAV_M0_5_LSB; + FNAV_af0_2_6 = static_cast(read_navigation_signed(data_bits, FNAV_af0_2_6_bit)); + FNAV_af0_2_6 *= FNAV_af0_5_LSB; + FNAV_af1_2_6 = static_cast(read_navigation_signed(data_bits, FNAV_af1_2_6_bit)); + FNAV_af1_2_6 *= FNAV_af1_5_LSB; + FNAV_E5ahs_2_6 = static_cast(read_navigation_unsigned(data_bits, FNAV_E5ahs_2_6_bit)); + FNAV_SVID3_6 = static_cast(read_navigation_unsigned(data_bits, FNAV_SVID3_6_bit)); + FNAV_Deltaa12_3_6 = static_cast(read_navigation_signed(data_bits, FNAV_Deltaa12_3_6_bit)); + FNAV_Deltaa12_3_6 *= FNAV_Deltaa12_5_LSB; + FNAV_e_3_6 = static_cast(read_navigation_unsigned(data_bits, FNAV_e_3_6_bit)); + FNAV_e_3_6 *= FNAV_e_5_LSB; + FNAV_w_3_6 = static_cast(read_navigation_signed(data_bits, FNAV_w_3_6_bit)); + FNAV_w_3_6 *= FNAV_w_5_LSB; + FNAV_deltai_3_6 = static_cast(read_navigation_signed(data_bits, FNAV_deltai_3_6_bit)); + FNAV_deltai_3_6 *= FNAV_deltai_5_LSB; + FNAV_Omega0_3_6 = static_cast(read_navigation_signed(data_bits, FNAV_Omega0_3_6_bit)); + FNAV_Omega0_3_6 *= FNAV_Omega0_5_LSB; + FNAV_Omegadot_3_6 = static_cast(read_navigation_signed(data_bits, FNAV_Omegadot_3_6_bit)); + FNAV_Omegadot_3_6 *= FNAV_Omegadot_5_LSB; + FNAV_M0_3_6 = static_cast(read_navigation_signed(data_bits, FNAV_M0_3_6_bit)); + FNAV_M0_3_6 *= FNAV_M0_5_LSB; + FNAV_af0_3_6 = static_cast(read_navigation_signed(data_bits, FNAV_af0_3_6_bit)); + FNAV_af0_3_6 *= FNAV_af0_5_LSB; + FNAV_af1_3_6 = static_cast(read_navigation_signed(data_bits, FNAV_af1_3_6_bit)); + FNAV_af1_3_6 *= FNAV_af1_5_LSB; + FNAV_E5ahs_3_6 = static_cast(read_navigation_unsigned(data_bits, FNAV_E5ahs_3_6_bit)); - flag_almanac_2 = true; - break; - } + flag_almanac_2 = true; + break; + } } -unsigned long int Galileo_Fnav_Message::read_navigation_unsigned(std::bitset bits, const std::vector> parameter) +unsigned long int Galileo_Fnav_Message::read_navigation_unsigned(std::bitset bits, const std::vector> parameter) { unsigned long int value = 0; int num_of_slices = parameter.size(); - for (int i=0; i bits, const std::vector> parameter) +signed long int Galileo_Fnav_Message::read_navigation_signed(std::bitset bits, const std::vector> parameter) { signed long int value = 0; int num_of_slices = parameter.size(); // Discriminate between 64 bits and 32 bits compiler int long_int_size_bytes = sizeof(signed long int); - if (long_int_size_bytes == 8) // if a long int takes 8 bytes, we are in a 64 bits system + if (long_int_size_bytes == 8) // if a long int takes 8 bytes, we are in a 64 bits system { // read the MSB and perform the sign extension if (bits[GALILEO_FNAV_DATA_FRAME_BITS - parameter[0].first] == 1) { - value ^= 0xFFFFFFFFFFFFFFFF; //64 bits variable + value ^= 0xFFFFFFFFFFFFFFFF; //64 bits variable } else { value &= 0; } - for (int i=0; i bits,boost::uint32_t checksum); + bool _CRC_test(std::bitset bits, boost::uint32_t checksum); void decode_page(std::string data); - unsigned long int read_navigation_unsigned(std::bitset bits, const std::vector> parameter); - signed long int read_navigation_signed(std::bitset bits, const std::vector> parameter); + unsigned long int read_navigation_unsigned(std::bitset bits, const std::vector> parameter); + signed long int read_navigation_signed(std::bitset bits, const std::vector> parameter); std::string omega0_1; //std::string omega0_2; diff --git a/src/core/system_parameters/galileo_iono.cc b/src/core/system_parameters/galileo_iono.cc index 6faad8897..e1dd820c5 100644 --- a/src/core/system_parameters/galileo_iono.cc +++ b/src/core/system_parameters/galileo_iono.cc @@ -34,18 +34,17 @@ Galileo_Iono::Galileo_Iono() { /* Ionospheric correction */ - ai0_5 = 0; // Effective Ionisation Level 1st order parameter [sfu] - ai1_5 = 0; // Effective Ionisation Level 2st order parameter [sfu/degree] - ai2_5 = 0; // Effective Ionisation Level 3st order parameter [sfu/degree] + ai0_5 = 0; // Effective Ionisation Level 1st order parameter [sfu] + ai1_5 = 0; // Effective Ionisation Level 2st order parameter [sfu/degree] + ai2_5 = 0; // Effective Ionisation Level 3st order parameter [sfu/degree] /* Ionospheric disturbance flag */ - Region1_flag_5 = false; // Ionospheric Disturbance Flag for region 1 - Region2_flag_5 = false; // Ionospheric Disturbance Flag for region 2 - Region3_flag_5 = false; // Ionospheric Disturbance Flag for region 3 - Region4_flag_5 = false; // Ionospheric Disturbance Flag for region 4 - Region5_flag_5 = false; // Ionospheric Disturbance Flag for region 5 + Region1_flag_5 = false; // Ionospheric Disturbance Flag for region 1 + Region2_flag_5 = false; // Ionospheric Disturbance Flag for region 2 + Region3_flag_5 = false; // Ionospheric Disturbance Flag for region 3 + Region4_flag_5 = false; // Ionospheric Disturbance Flag for region 4 + Region5_flag_5 = false; // Ionospheric Disturbance Flag for region 5 TOW_5 = 0; WN_5 = 0; } - diff --git a/src/core/system_parameters/galileo_iono.h b/src/core/system_parameters/galileo_iono.h index 15bed90e7..0bbc17d3d 100644 --- a/src/core/system_parameters/galileo_iono.h +++ b/src/core/system_parameters/galileo_iono.h @@ -42,20 +42,20 @@ class Galileo_Iono { public: /*Ionospheric correction*/ - double ai0_5; //!< Effective Ionisation Level 1st order parameter [sfu] - double ai1_5; //!< Effective Ionisation Level 2st order parameter [sfu/degree] - double ai2_5; //!< Effective Ionisation Level 3st order parameter [sfu/degree] + double ai0_5; //!< Effective Ionisation Level 1st order parameter [sfu] + double ai1_5; //!< Effective Ionisation Level 2st order parameter [sfu/degree] + double ai2_5; //!< Effective Ionisation Level 3st order parameter [sfu/degree] /*Ionospheric disturbance flag*/ - bool Region1_flag_5; //!< Ionospheric Disturbance Flag for region 1 - bool Region2_flag_5; //!< Ionospheric Disturbance Flag for region 2 - bool Region3_flag_5; //!< Ionospheric Disturbance Flag for region 3 - bool Region4_flag_5; //!< Ionospheric Disturbance Flag for region 4 - bool Region5_flag_5; //!< Ionospheric Disturbance Flag for region 5 + bool Region1_flag_5; //!< Ionospheric Disturbance Flag for region 1 + bool Region2_flag_5; //!< Ionospheric Disturbance Flag for region 2 + bool Region3_flag_5; //!< Ionospheric Disturbance Flag for region 3 + bool Region4_flag_5; //!< Ionospheric Disturbance Flag for region 4 + bool Region5_flag_5; //!< Ionospheric Disturbance Flag for region 5 /*from page 5 (UTC) to have a timestamp*/ - double TOW_5; //!< UTC data reference Time of Week [s] - double WN_5; //!< UTC data reference Week number [week] + double TOW_5; //!< UTC data reference Time of Week [s] + double WN_5; //!< UTC data reference Week number [week] /*! * Default constructor diff --git a/src/core/system_parameters/galileo_navigation_message.cc b/src/core/system_parameters/galileo_navigation_message.cc index f2a8b72ee..933680e3e 100644 --- a/src/core/system_parameters/galileo_navigation_message.cc +++ b/src/core/system_parameters/galileo_navigation_message.cc @@ -31,7 +31,7 @@ */ #include "galileo_navigation_message.h" -#include // for boost::crc_basic, boost::crc_optimal +#include // for boost::crc_basic, boost::crc_optimal #include #include #include @@ -52,14 +52,14 @@ void Galileo_Navigation_Message::reset() flag_ephemeris_3 = false; // flag indicating that ephemeris 3/4 (word 3) have been received flag_ephemeris_4 = false; // flag indicating that ephemeris 4/4 (word 4) have been received - flag_iono_and_GST = false; // flag indicating that ionospheric parameters (word 5) have been received - flag_utc_model = false; // flag indicating that utc model parameters (word 6) have been received + flag_iono_and_GST = false; // flag indicating that ionospheric parameters (word 5) have been received + flag_utc_model = false; // flag indicating that utc model parameters (word 6) have been received - flag_all_almanac = false; // flag indicating that all almanac have been received - flag_almanac_1 = false; // flag indicating that almanac 1/4 (word 7) have been received - flag_almanac_2 = false; // flag indicating that almanac 2/4 (word 8) have been received - flag_almanac_3 = false; // flag indicating that almanac 3/4 (word 9) have been received - flag_almanac_4 = false; // flag indicating that almanac 4/4 (word 10) have been received + flag_all_almanac = false; // flag indicating that all almanac have been received + flag_almanac_1 = false; // flag indicating that almanac 1/4 (word 7) have been received + flag_almanac_2 = false; // flag indicating that almanac 2/4 (word 8) have been received + flag_almanac_3 = false; // flag indicating that almanac 3/4 (word 9) have been received + flag_almanac_4 = false; // flag indicating that almanac 4/4 (word 10) have been received flag_TOW_5 = 0; flag_TOW_set = false; @@ -79,54 +79,54 @@ void Galileo_Navigation_Message::reset() A_1 = 0; /*Word type 2: Ephemeris (2/4)*/ - IOD_nav_2 = 0; // IOD_nav page 2 - OMEGA_0_2 = 0; // Longitude of ascending node of orbital plane at weekly epoch [semi-circles] - i_0_2 = 0; // Inclination angle at reference time [semi-circles] - omega_2 = 0; // Argument of perigee [semi-circles] - iDot_2 = 0; // Rate of inclination angle [semi-circles/sec] + IOD_nav_2 = 0; // IOD_nav page 2 + OMEGA_0_2 = 0; // Longitude of ascending node of orbital plane at weekly epoch [semi-circles] + i_0_2 = 0; // Inclination angle at reference time [semi-circles] + omega_2 = 0; // Argument of perigee [semi-circles] + iDot_2 = 0; // Rate of inclination angle [semi-circles/sec] /*Word type 3: Ephemeris (3/4) and SISA*/ - IOD_nav_3 = 0; // - OMEGA_dot_3 = 0; // Rate of right ascension [semi-circles/sec] - delta_n_3 = 0; // Mean motion difference from computed value [semi-circles/sec] - C_uc_3 = 0; // Amplitude of the cosine harmonic correction term to the argument of latitude [radians] - C_us_3 = 0; // Amplitude of the sine harmonic correction term to the argument of latitude [radians] - C_rc_3 = 0; // Amplitude of the cosine harmonic correction term to the orbit radius [meters] - C_rs_3 = 0; // Amplitude of the sine harmonic correction term to the orbit radius [meters] - SISA_3 = 0; // + IOD_nav_3 = 0; // + OMEGA_dot_3 = 0; // Rate of right ascension [semi-circles/sec] + delta_n_3 = 0; // Mean motion difference from computed value [semi-circles/sec] + C_uc_3 = 0; // Amplitude of the cosine harmonic correction term to the argument of latitude [radians] + C_us_3 = 0; // Amplitude of the sine harmonic correction term to the argument of latitude [radians] + C_rc_3 = 0; // Amplitude of the cosine harmonic correction term to the orbit radius [meters] + C_rs_3 = 0; // Amplitude of the sine harmonic correction term to the orbit radius [meters] + SISA_3 = 0; // /*Word type 4: Ephemeris (4/4) and Clock correction parameters*/ - IOD_nav_4 = 0; // - SV_ID_PRN_4 = 0; // - C_ic_4 = 0; // Amplitude of the cosine harmonic correction term to the angle of inclination [radians] - C_is_4 = 0; // Amplitude of the sine harmonic correction term to the angle of inclination [radians] + IOD_nav_4 = 0; // + SV_ID_PRN_4 = 0; // + C_ic_4 = 0; // Amplitude of the cosine harmonic correction term to the angle of inclination [radians] + C_is_4 = 0; // Amplitude of the sine harmonic correction term to the angle of inclination [radians] /*Clock correction parameters*/ - t0c_4 = 0; // - af0_4 = 0; // - af1_4 = 0; // - af2_4 = 0; // + t0c_4 = 0; // + af0_4 = 0; // + af1_4 = 0; // + af2_4 = 0; // spare_4 = 0; /*Word type 5: Ionospheric correction, BGD, signal health and data validity status and GST*/ /*Ionospheric correction*/ /*Az*/ - ai0_5 = 0; // - ai1_5 = 0; // - ai2_5 = 0; // + ai0_5 = 0; // + ai1_5 = 0; // + ai2_5 = 0; // /*Ionospheric disturbance flag*/ - Region1_flag_5 = 0; // Region1_flag_5; - Region2_flag_5 = 0; // - Region3_flag_5 = 0; // - Region4_flag_5 = 0; // - Region5_flag_5 = 0; // - BGD_E1E5a_5 = 0; // - BGD_E1E5b_5 = 0; // + Region1_flag_5 = 0; // Region1_flag_5; + Region2_flag_5 = 0; // + Region3_flag_5 = 0; // + Region4_flag_5 = 0; // + Region5_flag_5 = 0; // + BGD_E1E5a_5 = 0; // + BGD_E1E5b_5 = 0; // E5b_HS_5 = 0; E1B_HS_5 = 0; - E5b_DVS_5 = 0; // - E1B_DVS_5 = 0; // + E5b_DVS_5 = 0; // + E1B_DVS_5 = 0; // /*GST*/ WN_5 = 0; TOW_5 = 0; @@ -218,7 +218,6 @@ void Galileo_Navigation_Message::reset() galileo_satvel_X = 0.0; galileo_satvel_Y = 0.0; galileo_satvel_Z = 0.0; - } @@ -228,7 +227,7 @@ Galileo_Navigation_Message::Galileo_Navigation_Message() } -bool Galileo_Navigation_Message::CRC_test(std::bitset bits,boost::uint32_t checksum) +bool Galileo_Navigation_Message::CRC_test(std::bitset bits, boost::uint32_t checksum) { CRC_Galileo_INAV_type CRC_Galileo; @@ -243,9 +242,9 @@ bool Galileo_Navigation_Message::CRC_test(std::bitset b std::vector bytes; boost::to_block_range(frame_bits, std::back_inserter(bytes)); - std::reverse(bytes.begin(),bytes.end()); + std::reverse(bytes.begin(), bytes.end()); - CRC_Galileo.process_bytes( bytes.data(), GALILEO_DATA_FRAME_BYTES ); + CRC_Galileo.process_bytes(bytes.data(), GALILEO_DATA_FRAME_BYTES); crc_computed = CRC_Galileo.checksum(); if (checksum == crc_computed) @@ -259,7 +258,7 @@ bool Galileo_Navigation_Message::CRC_test(std::bitset b } -unsigned long int Galileo_Navigation_Message::read_navigation_unsigned(std::bitset bits, const std::vector > parameter) +unsigned long int Galileo_Navigation_Message::read_navigation_unsigned(std::bitset bits, const std::vector > parameter) { unsigned long int value = 0; int num_of_slices = parameter.size(); @@ -267,10 +266,10 @@ unsigned long int Galileo_Navigation_Message::read_navigation_unsigned(std::bits { for (int j = 0; j < parameter[i].second; j++) { - value <<= 1; //shift left + value <<= 1; //shift left if (bits[GALILEO_DATA_JK_BITS - parameter[i].first - j] == 1) { - value += 1; // insert the bit + value += 1; // insert the bit } } } @@ -278,8 +277,7 @@ unsigned long int Galileo_Navigation_Message::read_navigation_unsigned(std::bits } - -unsigned long int Galileo_Navigation_Message::read_page_type_unsigned(std::bitset bits, const std::vector > parameter) +unsigned long int Galileo_Navigation_Message::read_page_type_unsigned(std::bitset bits, const std::vector > parameter) { unsigned long int value = 0; int num_of_slices = parameter.size(); @@ -287,10 +285,10 @@ unsigned long int Galileo_Navigation_Message::read_page_type_unsigned(std::bitse { for (int j = 0; j < parameter[i].second; j++) { - value <<= 1; //shift left + value <<= 1; //shift left if (bits[GALILEO_PAGE_TYPE_BITS - parameter[i].first - j] == 1) { - value += 1; // insert the bit + value += 1; // insert the bit } } } @@ -298,19 +296,18 @@ unsigned long int Galileo_Navigation_Message::read_page_type_unsigned(std::bitse } - -signed long int Galileo_Navigation_Message::read_navigation_signed(std::bitset bits, const std::vector > parameter) +signed long int Galileo_Navigation_Message::read_navigation_signed(std::bitset bits, const std::vector > parameter) { signed long int value = 0; int num_of_slices = parameter.size(); // Discriminate between 64 bits and 32 bits compiler int long_int_size_bytes = sizeof(signed long int); - if (long_int_size_bytes == 8) // if a long int takes 8 bytes, we are in a 64 bits system + if (long_int_size_bytes == 8) // if a long int takes 8 bytes, we are in a 64 bits system { // read the MSB and perform the sign extension if (bits[GALILEO_DATA_JK_BITS - parameter[0].first] == 1) { - value ^= 0xFFFFFFFFFFFFFFFF; //64 bits variable + value ^= 0xFFFFFFFFFFFFFFFF; //64 bits variable } else { @@ -321,11 +318,11 @@ signed long int Galileo_Navigation_Message::read_navigation_signed(std::bitset bits, const std::vector > parameter) +bool Galileo_Navigation_Message::read_navigation_bool(std::bitset bits, const std::vector > parameter) { bool value; if (bits[GALILEO_DATA_JK_BITS - parameter[0].first] == 1) @@ -374,8 +371,6 @@ bool Galileo_Navigation_Message::read_navigation_bool(std::bitset page_type_bits (page_number_bits); // from string to bitset + std::string page_number_bits = Data_k.substr(0, 6); + std::bitset page_type_bits(page_number_bits); // from string to bitset Page_type = static_cast(read_page_type_unsigned(page_type_bits, type)); Page_type_time_stamp = Page_type; std::string Data_jk_ephemeris = Data_k + Data_j; @@ -443,12 +438,12 @@ void Galileo_Navigation_Message::split_page(std::string page_string, int flag_ev // Wrong CRC... discard frame flag_CRC_test = false; } - } // end of CRC checksum control - } // end if (page_string.at(0)=='1') + } // end of CRC checksum control + } // end if (page_string.at(0)=='1') else { - page_Even = page_string.substr (0,114); - std::string tail_Even = page_string.substr (114,6); + page_Even = page_string.substr(0, 114); + std::string tail_Even = page_string.substr(114, 6); //std::cout << "tail_even_string: " << tail_Even < data_jk_bits (data_jk_string); + std::bitset data_jk_bits(data_jk_string); //DLOG(INFO) << "Data_jk_bits (bitset) "<< endl << data_jk_bits << endl; page_number = static_cast(read_navigation_unsigned(data_jk_bits, PAGE_TYPE_bit)); LOG(INFO) << "Page number = " << page_number; switch (page_number) - { - case 1: /*Word type 1: Ephemeris (1/4)*/ - IOD_nav_1 = static_cast(read_navigation_unsigned(data_jk_bits, IOD_nav_1_bit)); - DLOG(INFO) << "IOD_nav_1= " << IOD_nav_1; - t0e_1 = static_cast(read_navigation_unsigned(data_jk_bits, T0E_1_bit)); - t0e_1 = t0e_1 * t0e_1_LSB; - DLOG(INFO) << "t0e_1= " << t0e_1; - M0_1 = static_cast(read_navigation_signed(data_jk_bits, M0_1_bit)); - M0_1 = M0_1 * M0_1_LSB; - DLOG(INFO) << "M0_1= " << M0_1; - e_1 = static_cast(read_navigation_unsigned(data_jk_bits, e_1_bit)); - e_1 = e_1 * e_1_LSB; - DLOG(INFO) << "e_1= " << e_1; - A_1 = static_cast(read_navigation_unsigned(data_jk_bits, A_1_bit)); - A_1 = A_1 * A_1_LSB_gal; - DLOG(INFO) << "A_1= " << A_1; - flag_ephemeris_1 = true; - DLOG(INFO) << "flag_tow_set" << flag_TOW_set; - break; + { + case 1: /*Word type 1: Ephemeris (1/4)*/ + IOD_nav_1 = static_cast(read_navigation_unsigned(data_jk_bits, IOD_nav_1_bit)); + DLOG(INFO) << "IOD_nav_1= " << IOD_nav_1; + t0e_1 = static_cast(read_navigation_unsigned(data_jk_bits, T0E_1_bit)); + t0e_1 = t0e_1 * t0e_1_LSB; + DLOG(INFO) << "t0e_1= " << t0e_1; + M0_1 = static_cast(read_navigation_signed(data_jk_bits, M0_1_bit)); + M0_1 = M0_1 * M0_1_LSB; + DLOG(INFO) << "M0_1= " << M0_1; + e_1 = static_cast(read_navigation_unsigned(data_jk_bits, e_1_bit)); + e_1 = e_1 * e_1_LSB; + DLOG(INFO) << "e_1= " << e_1; + A_1 = static_cast(read_navigation_unsigned(data_jk_bits, A_1_bit)); + A_1 = A_1 * A_1_LSB_gal; + DLOG(INFO) << "A_1= " << A_1; + flag_ephemeris_1 = true; + DLOG(INFO) << "flag_tow_set" << flag_TOW_set; + break; - case 2: /*Word type 2: Ephemeris (2/4)*/ - IOD_nav_2 = static_cast(read_navigation_unsigned(data_jk_bits, IOD_nav_2_bit)); - DLOG(INFO) << "IOD_nav_2= " << IOD_nav_2; - OMEGA_0_2 = static_cast(read_navigation_signed(data_jk_bits, OMEGA_0_2_bit)); - OMEGA_0_2 = OMEGA_0_2 * OMEGA_0_2_LSB; - DLOG(INFO) << "OMEGA_0_2= " << OMEGA_0_2 ; - i_0_2 = static_cast(read_navigation_signed(data_jk_bits, i_0_2_bit)); - i_0_2 = i_0_2 * i_0_2_LSB; - DLOG(INFO) << "i_0_2= " << i_0_2 ; - omega_2 = static_cast(read_navigation_signed(data_jk_bits, omega_2_bit)); - omega_2 = omega_2 * omega_2_LSB; - DLOG(INFO) << "omega_2= " << omega_2; - iDot_2 = static_cast(read_navigation_signed(data_jk_bits, iDot_2_bit)); - iDot_2 = iDot_2 * iDot_2_LSB; - DLOG(INFO) << "iDot_2= " << iDot_2; - flag_ephemeris_2 = true; - DLOG(INFO) << "flag_tow_set" << flag_TOW_set; - break; + case 2: /*Word type 2: Ephemeris (2/4)*/ + IOD_nav_2 = static_cast(read_navigation_unsigned(data_jk_bits, IOD_nav_2_bit)); + DLOG(INFO) << "IOD_nav_2= " << IOD_nav_2; + OMEGA_0_2 = static_cast(read_navigation_signed(data_jk_bits, OMEGA_0_2_bit)); + OMEGA_0_2 = OMEGA_0_2 * OMEGA_0_2_LSB; + DLOG(INFO) << "OMEGA_0_2= " << OMEGA_0_2; + i_0_2 = static_cast(read_navigation_signed(data_jk_bits, i_0_2_bit)); + i_0_2 = i_0_2 * i_0_2_LSB; + DLOG(INFO) << "i_0_2= " << i_0_2; + omega_2 = static_cast(read_navigation_signed(data_jk_bits, omega_2_bit)); + omega_2 = omega_2 * omega_2_LSB; + DLOG(INFO) << "omega_2= " << omega_2; + iDot_2 = static_cast(read_navigation_signed(data_jk_bits, iDot_2_bit)); + iDot_2 = iDot_2 * iDot_2_LSB; + DLOG(INFO) << "iDot_2= " << iDot_2; + flag_ephemeris_2 = true; + DLOG(INFO) << "flag_tow_set" << flag_TOW_set; + break; - case 3: /*Word type 3: Ephemeris (3/4) and SISA*/ - IOD_nav_3 = static_cast(read_navigation_unsigned(data_jk_bits, IOD_nav_3_bit)); - DLOG(INFO) << "IOD_nav_3= " << IOD_nav_3 ; - OMEGA_dot_3 = static_cast(read_navigation_signed(data_jk_bits, OMEGA_dot_3_bit)); - OMEGA_dot_3 = OMEGA_dot_3 * OMEGA_dot_3_LSB; - DLOG(INFO) <<"OMEGA_dot_3= " << OMEGA_dot_3 ; - delta_n_3 = static_cast(read_navigation_signed(data_jk_bits, delta_n_3_bit)); - delta_n_3 = delta_n_3 * delta_n_3_LSB; - DLOG(INFO) << "delta_n_3= " << delta_n_3 ; - C_uc_3 = static_cast(read_navigation_signed(data_jk_bits, C_uc_3_bit)); - C_uc_3 = C_uc_3 * C_uc_3_LSB; - DLOG(INFO) << "C_uc_3= " << C_uc_3; - C_us_3 = static_cast(read_navigation_signed(data_jk_bits, C_us_3_bit)); - C_us_3 = C_us_3 * C_us_3_LSB; - DLOG(INFO) << "C_us_3= " << C_us_3; - C_rc_3 = static_cast(read_navigation_signed(data_jk_bits, C_rc_3_bit)); - C_rc_3 = C_rc_3 * C_rc_3_LSB; - DLOG(INFO) << "C_rc_3= " << C_rc_3; - C_rs_3 = static_cast(read_navigation_signed(data_jk_bits, C_rs_3_bit)); - C_rs_3 = C_rs_3 * C_rs_3_LSB; - DLOG(INFO) << "C_rs_3= " << C_rs_3; - SISA_3 = static_cast(read_navigation_unsigned(data_jk_bits, SISA_3_bit)); - DLOG(INFO) << "SISA_3= " << SISA_3; - flag_ephemeris_3 = true; - DLOG(INFO) << "flag_tow_set" << flag_TOW_set; - break; + case 3: /*Word type 3: Ephemeris (3/4) and SISA*/ + IOD_nav_3 = static_cast(read_navigation_unsigned(data_jk_bits, IOD_nav_3_bit)); + DLOG(INFO) << "IOD_nav_3= " << IOD_nav_3; + OMEGA_dot_3 = static_cast(read_navigation_signed(data_jk_bits, OMEGA_dot_3_bit)); + OMEGA_dot_3 = OMEGA_dot_3 * OMEGA_dot_3_LSB; + DLOG(INFO) << "OMEGA_dot_3= " << OMEGA_dot_3; + delta_n_3 = static_cast(read_navigation_signed(data_jk_bits, delta_n_3_bit)); + delta_n_3 = delta_n_3 * delta_n_3_LSB; + DLOG(INFO) << "delta_n_3= " << delta_n_3; + C_uc_3 = static_cast(read_navigation_signed(data_jk_bits, C_uc_3_bit)); + C_uc_3 = C_uc_3 * C_uc_3_LSB; + DLOG(INFO) << "C_uc_3= " << C_uc_3; + C_us_3 = static_cast(read_navigation_signed(data_jk_bits, C_us_3_bit)); + C_us_3 = C_us_3 * C_us_3_LSB; + DLOG(INFO) << "C_us_3= " << C_us_3; + C_rc_3 = static_cast(read_navigation_signed(data_jk_bits, C_rc_3_bit)); + C_rc_3 = C_rc_3 * C_rc_3_LSB; + DLOG(INFO) << "C_rc_3= " << C_rc_3; + C_rs_3 = static_cast(read_navigation_signed(data_jk_bits, C_rs_3_bit)); + C_rs_3 = C_rs_3 * C_rs_3_LSB; + DLOG(INFO) << "C_rs_3= " << C_rs_3; + SISA_3 = static_cast(read_navigation_unsigned(data_jk_bits, SISA_3_bit)); + DLOG(INFO) << "SISA_3= " << SISA_3; + flag_ephemeris_3 = true; + DLOG(INFO) << "flag_tow_set" << flag_TOW_set; + break; - case 4: /* Word type 4: Ephemeris (4/4) and Clock correction parameters*/ - IOD_nav_4 = static_cast(read_navigation_unsigned(data_jk_bits, IOD_nav_4_bit)); - DLOG(INFO) << "IOD_nav_4= " << IOD_nav_4 ; - SV_ID_PRN_4 = static_cast(read_navigation_unsigned(data_jk_bits, SV_ID_PRN_4_bit)); - DLOG(INFO) << "SV_ID_PRN_4= " << SV_ID_PRN_4 ; - C_ic_4 = static_cast(read_navigation_signed(data_jk_bits, C_ic_4_bit)); - C_ic_4 = C_ic_4 * C_ic_4_LSB; - DLOG(INFO) << "C_ic_4= " << C_ic_4; - C_is_4 = static_cast(read_navigation_signed(data_jk_bits, C_is_4_bit)); - C_is_4 = C_is_4 * C_is_4_LSB; - DLOG(INFO) << "C_is_4= " << C_is_4; - /*Clock correction parameters*/ - t0c_4 = static_cast(read_navigation_unsigned(data_jk_bits, t0c_4_bit)); - t0c_4 = t0c_4 * t0c_4_LSB; - DLOG(INFO) << "t0c_4= " << t0c_4; - af0_4 = static_cast(read_navigation_signed(data_jk_bits, af0_4_bit)); - af0_4 = af0_4 * af0_4_LSB; - DLOG(INFO) << "af0_4 = " << af0_4; - af1_4 = static_cast(read_navigation_signed(data_jk_bits, af1_4_bit)); - af1_4 = af1_4 * af1_4_LSB; - DLOG(INFO) << "af1_4 = " << af1_4; - af2_4 = static_cast(read_navigation_signed(data_jk_bits, af2_4_bit)); - af2_4 = af2_4 * af2_4_LSB; - DLOG(INFO) << "af2_4 = " << af2_4; - spare_4 = static_cast(read_navigation_unsigned(data_jk_bits, spare_4_bit)); - DLOG(INFO) << "spare_4 = " << spare_4; - flag_ephemeris_4 = true; - DLOG(INFO) << "flag_tow_set" << flag_TOW_set; - break; + case 4: /* Word type 4: Ephemeris (4/4) and Clock correction parameters*/ + IOD_nav_4 = static_cast(read_navigation_unsigned(data_jk_bits, IOD_nav_4_bit)); + DLOG(INFO) << "IOD_nav_4= " << IOD_nav_4; + SV_ID_PRN_4 = static_cast(read_navigation_unsigned(data_jk_bits, SV_ID_PRN_4_bit)); + DLOG(INFO) << "SV_ID_PRN_4= " << SV_ID_PRN_4; + C_ic_4 = static_cast(read_navigation_signed(data_jk_bits, C_ic_4_bit)); + C_ic_4 = C_ic_4 * C_ic_4_LSB; + DLOG(INFO) << "C_ic_4= " << C_ic_4; + C_is_4 = static_cast(read_navigation_signed(data_jk_bits, C_is_4_bit)); + C_is_4 = C_is_4 * C_is_4_LSB; + DLOG(INFO) << "C_is_4= " << C_is_4; + /*Clock correction parameters*/ + t0c_4 = static_cast(read_navigation_unsigned(data_jk_bits, t0c_4_bit)); + t0c_4 = t0c_4 * t0c_4_LSB; + DLOG(INFO) << "t0c_4= " << t0c_4; + af0_4 = static_cast(read_navigation_signed(data_jk_bits, af0_4_bit)); + af0_4 = af0_4 * af0_4_LSB; + DLOG(INFO) << "af0_4 = " << af0_4; + af1_4 = static_cast(read_navigation_signed(data_jk_bits, af1_4_bit)); + af1_4 = af1_4 * af1_4_LSB; + DLOG(INFO) << "af1_4 = " << af1_4; + af2_4 = static_cast(read_navigation_signed(data_jk_bits, af2_4_bit)); + af2_4 = af2_4 * af2_4_LSB; + DLOG(INFO) << "af2_4 = " << af2_4; + spare_4 = static_cast(read_navigation_unsigned(data_jk_bits, spare_4_bit)); + DLOG(INFO) << "spare_4 = " << spare_4; + flag_ephemeris_4 = true; + DLOG(INFO) << "flag_tow_set" << flag_TOW_set; + break; - case 5: /*Word type 5: Ionospheric correction, BGD, signal health and data validity status and GST*/ - /*Ionospheric correction*/ - /*Az*/ - ai0_5 = static_cast(read_navigation_unsigned(data_jk_bits, ai0_5_bit)); - ai0_5 = ai0_5 * ai0_5_LSB; - DLOG(INFO) << "ai0_5= " << ai0_5; - ai1_5 = static_cast(read_navigation_signed(data_jk_bits, ai1_5_bit)); - ai1_5 = ai1_5 * ai1_5_LSB; - DLOG(INFO) << "ai1_5= " << ai1_5; - ai2_5 = static_cast(read_navigation_signed(data_jk_bits, ai2_5_bit)); - ai2_5 = ai2_5 * ai2_5_LSB; - DLOG(INFO) << "ai2_5= " << ai2_5; - /*Ionospheric disturbance flag*/ - Region1_flag_5 = static_cast(read_navigation_bool(data_jk_bits, Region1_5_bit)); - DLOG(INFO) << "Region1_flag_5= " << Region1_flag_5; - Region2_flag_5 = static_cast(read_navigation_bool(data_jk_bits, Region2_5_bit)); - DLOG(INFO) << "Region2_flag_5= " << Region2_flag_5; - Region3_flag_5 = static_cast(read_navigation_bool(data_jk_bits, Region3_5_bit)); - DLOG(INFO) << "Region3_flag_5= " << Region3_flag_5; - Region4_flag_5 = static_cast(read_navigation_bool(data_jk_bits, Region4_5_bit)); - DLOG(INFO) << "Region4_flag_5= " << Region4_flag_5; - Region5_flag_5 = static_cast(read_navigation_bool(data_jk_bits, Region5_5_bit)); - DLOG(INFO) << "Region5_flag_5= " << Region5_flag_5; - BGD_E1E5a_5 = static_cast(read_navigation_signed(data_jk_bits, BGD_E1E5a_5_bit)); - BGD_E1E5a_5 = BGD_E1E5a_5 * BGD_E1E5a_5_LSB; - DLOG(INFO) << "BGD_E1E5a_5= " << BGD_E1E5a_5; - BGD_E1E5b_5 = static_cast(read_navigation_signed(data_jk_bits, BGD_E1E5b_5_bit)); - BGD_E1E5b_5 = BGD_E1E5b_5 * BGD_E1E5b_5_LSB; - DLOG(INFO) << "BGD_E1E5b_5= " << BGD_E1E5b_5; - E5b_HS_5 = static_cast(read_navigation_unsigned(data_jk_bits, E5b_HS_5_bit)); - DLOG(INFO) << "E5b_HS_5= " << E5b_HS_5; - E1B_HS_5 = static_cast(read_navigation_unsigned(data_jk_bits, E1B_HS_5_bit)); - DLOG(INFO) << "E1B_HS_5= " << E1B_HS_5; - E5b_DVS_5 = static_cast(read_navigation_unsigned(data_jk_bits, E5b_DVS_5_bit)); - DLOG(INFO) << "E5b_DVS_5= " << E5b_DVS_5; - E1B_DVS_5 = static_cast(read_navigation_unsigned(data_jk_bits, E1B_DVS_5_bit)); - DLOG(INFO) << "E1B_DVS_5= " << E1B_DVS_5; - /*GST*/ - WN_5 = static_cast(read_navigation_unsigned(data_jk_bits, WN_5_bit)); - DLOG(INFO) << "WN_5= " << WN_5; - TOW_5 = static_cast(read_navigation_unsigned(data_jk_bits, TOW_5_bit)); - DLOG(INFO) << "TOW_5= " << TOW_5; - flag_TOW_5 = true; //set to false externally - spare_5 = static_cast(read_navigation_unsigned(data_jk_bits, spare_5_bit)); - DLOG(INFO) << "spare_5= " << spare_5; - flag_iono_and_GST = true; //set to false externally - flag_TOW_set = true; //set to false externally - DLOG(INFO) << "flag_tow_set" << flag_TOW_set; - break; + case 5: /*Word type 5: Ionospheric correction, BGD, signal health and data validity status and GST*/ + /*Ionospheric correction*/ + /*Az*/ + ai0_5 = static_cast(read_navigation_unsigned(data_jk_bits, ai0_5_bit)); + ai0_5 = ai0_5 * ai0_5_LSB; + DLOG(INFO) << "ai0_5= " << ai0_5; + ai1_5 = static_cast(read_navigation_signed(data_jk_bits, ai1_5_bit)); + ai1_5 = ai1_5 * ai1_5_LSB; + DLOG(INFO) << "ai1_5= " << ai1_5; + ai2_5 = static_cast(read_navigation_signed(data_jk_bits, ai2_5_bit)); + ai2_5 = ai2_5 * ai2_5_LSB; + DLOG(INFO) << "ai2_5= " << ai2_5; + /*Ionospheric disturbance flag*/ + Region1_flag_5 = static_cast(read_navigation_bool(data_jk_bits, Region1_5_bit)); + DLOG(INFO) << "Region1_flag_5= " << Region1_flag_5; + Region2_flag_5 = static_cast(read_navigation_bool(data_jk_bits, Region2_5_bit)); + DLOG(INFO) << "Region2_flag_5= " << Region2_flag_5; + Region3_flag_5 = static_cast(read_navigation_bool(data_jk_bits, Region3_5_bit)); + DLOG(INFO) << "Region3_flag_5= " << Region3_flag_5; + Region4_flag_5 = static_cast(read_navigation_bool(data_jk_bits, Region4_5_bit)); + DLOG(INFO) << "Region4_flag_5= " << Region4_flag_5; + Region5_flag_5 = static_cast(read_navigation_bool(data_jk_bits, Region5_5_bit)); + DLOG(INFO) << "Region5_flag_5= " << Region5_flag_5; + BGD_E1E5a_5 = static_cast(read_navigation_signed(data_jk_bits, BGD_E1E5a_5_bit)); + BGD_E1E5a_5 = BGD_E1E5a_5 * BGD_E1E5a_5_LSB; + DLOG(INFO) << "BGD_E1E5a_5= " << BGD_E1E5a_5; + BGD_E1E5b_5 = static_cast(read_navigation_signed(data_jk_bits, BGD_E1E5b_5_bit)); + BGD_E1E5b_5 = BGD_E1E5b_5 * BGD_E1E5b_5_LSB; + DLOG(INFO) << "BGD_E1E5b_5= " << BGD_E1E5b_5; + E5b_HS_5 = static_cast(read_navigation_unsigned(data_jk_bits, E5b_HS_5_bit)); + DLOG(INFO) << "E5b_HS_5= " << E5b_HS_5; + E1B_HS_5 = static_cast(read_navigation_unsigned(data_jk_bits, E1B_HS_5_bit)); + DLOG(INFO) << "E1B_HS_5= " << E1B_HS_5; + E5b_DVS_5 = static_cast(read_navigation_unsigned(data_jk_bits, E5b_DVS_5_bit)); + DLOG(INFO) << "E5b_DVS_5= " << E5b_DVS_5; + E1B_DVS_5 = static_cast(read_navigation_unsigned(data_jk_bits, E1B_DVS_5_bit)); + DLOG(INFO) << "E1B_DVS_5= " << E1B_DVS_5; + /*GST*/ + WN_5 = static_cast(read_navigation_unsigned(data_jk_bits, WN_5_bit)); + DLOG(INFO) << "WN_5= " << WN_5; + TOW_5 = static_cast(read_navigation_unsigned(data_jk_bits, TOW_5_bit)); + DLOG(INFO) << "TOW_5= " << TOW_5; + flag_TOW_5 = true; //set to false externally + spare_5 = static_cast(read_navigation_unsigned(data_jk_bits, spare_5_bit)); + DLOG(INFO) << "spare_5= " << spare_5; + flag_iono_and_GST = true; //set to false externally + flag_TOW_set = true; //set to false externally + DLOG(INFO) << "flag_tow_set" << flag_TOW_set; + break; - case 6: /*Word type 6: GST-UTC conversion parameters*/ - A0_6 = static_cast(read_navigation_signed(data_jk_bits, A0_6_bit)); - A0_6 = A0_6 * A0_6_LSB; - DLOG(INFO) << "A0_6= " << A0_6; - A1_6 = static_cast(read_navigation_signed(data_jk_bits, A1_6_bit)); - A1_6 = A1_6 * A1_6_LSB; - DLOG(INFO) << "A1_6= " << A1_6; - Delta_tLS_6 = static_cast(read_navigation_signed(data_jk_bits, Delta_tLS_6_bit)); - DLOG(INFO) << "Delta_tLS_6= " << Delta_tLS_6; - t0t_6 = static_cast(read_navigation_unsigned(data_jk_bits, t0t_6_bit)); - t0t_6 = t0t_6 * t0t_6_LSB; - DLOG(INFO) << "t0t_6= " << t0t_6; - WNot_6 = static_cast(read_navigation_unsigned(data_jk_bits, WNot_6_bit)); - DLOG(INFO) << "WNot_6= " << WNot_6; - WN_LSF_6 = static_cast(read_navigation_unsigned(data_jk_bits, WN_LSF_6_bit)); - DLOG(INFO) << "WN_LSF_6= " << WN_LSF_6; - DN_6 = static_cast(read_navigation_unsigned(data_jk_bits, DN_6_bit)); - DLOG(INFO) << "DN_6= " << DN_6; - Delta_tLSF_6 = static_cast(read_navigation_signed(data_jk_bits, Delta_tLSF_6_bit)); - DLOG(INFO) << "Delta_tLSF_6= " << Delta_tLSF_6; - TOW_6 = static_cast(read_navigation_unsigned(data_jk_bits, TOW_6_bit)); - DLOG(INFO) << "TOW_6= " << TOW_6; - flag_TOW_6 = true; //set to false externally - flag_utc_model = true; //set to false externally - flag_TOW_set = true; //set to false externally - DLOG(INFO) << "flag_tow_set" << flag_TOW_set; - break; + case 6: /*Word type 6: GST-UTC conversion parameters*/ + A0_6 = static_cast(read_navigation_signed(data_jk_bits, A0_6_bit)); + A0_6 = A0_6 * A0_6_LSB; + DLOG(INFO) << "A0_6= " << A0_6; + A1_6 = static_cast(read_navigation_signed(data_jk_bits, A1_6_bit)); + A1_6 = A1_6 * A1_6_LSB; + DLOG(INFO) << "A1_6= " << A1_6; + Delta_tLS_6 = static_cast(read_navigation_signed(data_jk_bits, Delta_tLS_6_bit)); + DLOG(INFO) << "Delta_tLS_6= " << Delta_tLS_6; + t0t_6 = static_cast(read_navigation_unsigned(data_jk_bits, t0t_6_bit)); + t0t_6 = t0t_6 * t0t_6_LSB; + DLOG(INFO) << "t0t_6= " << t0t_6; + WNot_6 = static_cast(read_navigation_unsigned(data_jk_bits, WNot_6_bit)); + DLOG(INFO) << "WNot_6= " << WNot_6; + WN_LSF_6 = static_cast(read_navigation_unsigned(data_jk_bits, WN_LSF_6_bit)); + DLOG(INFO) << "WN_LSF_6= " << WN_LSF_6; + DN_6 = static_cast(read_navigation_unsigned(data_jk_bits, DN_6_bit)); + DLOG(INFO) << "DN_6= " << DN_6; + Delta_tLSF_6 = static_cast(read_navigation_signed(data_jk_bits, Delta_tLSF_6_bit)); + DLOG(INFO) << "Delta_tLSF_6= " << Delta_tLSF_6; + TOW_6 = static_cast(read_navigation_unsigned(data_jk_bits, TOW_6_bit)); + DLOG(INFO) << "TOW_6= " << TOW_6; + flag_TOW_6 = true; //set to false externally + flag_utc_model = true; //set to false externally + flag_TOW_set = true; //set to false externally + DLOG(INFO) << "flag_tow_set" << flag_TOW_set; + break; - case 7: /*Word type 7: Almanac for SVID1 (1/2), almanac reference time and almanac reference week number*/ - IOD_a_7 = static_cast(read_navigation_unsigned(data_jk_bits, IOD_a_7_bit)); - DLOG(INFO) << "IOD_a_7= " << IOD_a_7; - WN_a_7 = static_cast(read_navigation_unsigned(data_jk_bits, WN_a_7_bit)); - DLOG(INFO) << "WN_a_7= " << WN_a_7; - t0a_7 = static_cast(read_navigation_unsigned(data_jk_bits, t0a_7_bit)); - t0a_7 = t0a_7 * t0a_7_LSB; - DLOG(INFO) << "t0a_7= " << t0a_7; - SVID1_7 = static_cast(read_navigation_unsigned(data_jk_bits, SVID1_7_bit)); - DLOG(INFO) << "SVID1_7= " << SVID1_7; - DELTA_A_7 = static_cast(read_navigation_signed(data_jk_bits, DELTA_A_7_bit)); - DELTA_A_7 = DELTA_A_7 * DELTA_A_7_LSB; - DLOG(INFO) << "DELTA_A_7= " << DELTA_A_7; - e_7 = static_cast(read_navigation_unsigned(data_jk_bits, e_7_bit)); - e_7 = e_7 * e_7_LSB; - DLOG(INFO) << "e_7= " << e_7; - omega_7 = static_cast(read_navigation_signed(data_jk_bits, omega_7_bit)); - omega_7 = omega_7 * omega_7_LSB; - DLOG(INFO) << "omega_7= " << omega_7; - delta_i_7 = static_cast(read_navigation_signed(data_jk_bits, delta_i_7_bit)); - delta_i_7 = delta_i_7 * delta_i_7_LSB; - DLOG(INFO) << "delta_i_7= " << delta_i_7; - Omega0_7 = static_cast(read_navigation_signed(data_jk_bits, Omega0_7_bit)); - Omega0_7 = Omega0_7 * Omega0_7_LSB; - DLOG(INFO) << "Omega0_7= " << Omega0_7; - Omega_dot_7 = static_cast(read_navigation_signed(data_jk_bits, Omega_dot_7_bit)); - Omega_dot_7 = Omega_dot_7 * Omega_dot_7_LSB; - DLOG(INFO) << "Omega_dot_7= " << Omega_dot_7; - M0_7 = static_cast(read_navigation_signed(data_jk_bits, M0_7_bit)); - M0_7 = M0_7 * M0_7_LSB; - DLOG(INFO) << "M0_7= " << M0_7; - flag_almanac_1 = true; - DLOG(INFO) << "flag_tow_set"<< flag_TOW_set; - break; + case 7: /*Word type 7: Almanac for SVID1 (1/2), almanac reference time and almanac reference week number*/ + IOD_a_7 = static_cast(read_navigation_unsigned(data_jk_bits, IOD_a_7_bit)); + DLOG(INFO) << "IOD_a_7= " << IOD_a_7; + WN_a_7 = static_cast(read_navigation_unsigned(data_jk_bits, WN_a_7_bit)); + DLOG(INFO) << "WN_a_7= " << WN_a_7; + t0a_7 = static_cast(read_navigation_unsigned(data_jk_bits, t0a_7_bit)); + t0a_7 = t0a_7 * t0a_7_LSB; + DLOG(INFO) << "t0a_7= " << t0a_7; + SVID1_7 = static_cast(read_navigation_unsigned(data_jk_bits, SVID1_7_bit)); + DLOG(INFO) << "SVID1_7= " << SVID1_7; + DELTA_A_7 = static_cast(read_navigation_signed(data_jk_bits, DELTA_A_7_bit)); + DELTA_A_7 = DELTA_A_7 * DELTA_A_7_LSB; + DLOG(INFO) << "DELTA_A_7= " << DELTA_A_7; + e_7 = static_cast(read_navigation_unsigned(data_jk_bits, e_7_bit)); + e_7 = e_7 * e_7_LSB; + DLOG(INFO) << "e_7= " << e_7; + omega_7 = static_cast(read_navigation_signed(data_jk_bits, omega_7_bit)); + omega_7 = omega_7 * omega_7_LSB; + DLOG(INFO) << "omega_7= " << omega_7; + delta_i_7 = static_cast(read_navigation_signed(data_jk_bits, delta_i_7_bit)); + delta_i_7 = delta_i_7 * delta_i_7_LSB; + DLOG(INFO) << "delta_i_7= " << delta_i_7; + Omega0_7 = static_cast(read_navigation_signed(data_jk_bits, Omega0_7_bit)); + Omega0_7 = Omega0_7 * Omega0_7_LSB; + DLOG(INFO) << "Omega0_7= " << Omega0_7; + Omega_dot_7 = static_cast(read_navigation_signed(data_jk_bits, Omega_dot_7_bit)); + Omega_dot_7 = Omega_dot_7 * Omega_dot_7_LSB; + DLOG(INFO) << "Omega_dot_7= " << Omega_dot_7; + M0_7 = static_cast(read_navigation_signed(data_jk_bits, M0_7_bit)); + M0_7 = M0_7 * M0_7_LSB; + DLOG(INFO) << "M0_7= " << M0_7; + flag_almanac_1 = true; + DLOG(INFO) << "flag_tow_set" << flag_TOW_set; + break; - case 8: /*Word type 8: Almanac for SVID1 (2/2) and SVID2 (1/2)*/ - IOD_a_8 = static_cast(read_navigation_unsigned(data_jk_bits, IOD_a_8_bit)); - DLOG(INFO) << "IOD_a_8= " << IOD_a_8; - af0_8 = static_cast(read_navigation_signed(data_jk_bits, af0_8_bit)); - af0_8 = af0_8 * af0_8_LSB; - DLOG(INFO) << "af0_8= " << af0_8; - af1_8 = static_cast(read_navigation_signed(data_jk_bits, af1_8_bit)); - af1_8 = af1_8 * af1_8_LSB; - DLOG(INFO) << "af1_8= " << af1_8; - E5b_HS_8 = static_cast(read_navigation_unsigned(data_jk_bits, E5b_HS_8_bit)); - DLOG(INFO) << "E5b_HS_8= " << E5b_HS_8; - E1B_HS_8 = static_cast(read_navigation_unsigned(data_jk_bits, E1B_HS_8_bit)); - DLOG(INFO) << "E1B_HS_8= " << E1B_HS_8; - SVID2_8 = static_cast(read_navigation_unsigned(data_jk_bits, SVID2_8_bit)); - DLOG(INFO) << "SVID2_8= " << SVID2_8; - DELTA_A_8 = static_cast(read_navigation_signed(data_jk_bits, DELTA_A_8_bit)); - DELTA_A_8 = DELTA_A_8 * DELTA_A_8_LSB; - DLOG(INFO) << "DELTA_A_8= " << DELTA_A_8; - e_8 = static_cast(read_navigation_unsigned(data_jk_bits, e_8_bit)); - e_8 = e_8 * e_8_LSB; - DLOG(INFO) << "e_8= " << e_8; - omega_8 = static_cast(read_navigation_signed(data_jk_bits, omega_8_bit)); - omega_8 = omega_8 * omega_8_LSB; - DLOG(INFO) << "omega_8= " << omega_8; - delta_i_8 = static_cast(read_navigation_signed(data_jk_bits, delta_i_8_bit)); - delta_i_8 = delta_i_8 * delta_i_8_LSB; - DLOG(INFO) << "delta_i_8= " << delta_i_8; - Omega0_8 = static_cast(read_navigation_signed(data_jk_bits, Omega0_8_bit)); - Omega0_8 = Omega0_8 * Omega0_8_LSB; - DLOG(INFO) << "Omega0_8= " << Omega0_8; - Omega_dot_8 = static_cast(read_navigation_signed(data_jk_bits, Omega_dot_8_bit)); - Omega_dot_8 = Omega_dot_8 * Omega_dot_8_LSB; - DLOG(INFO) << "Omega_dot_8= " << Omega_dot_8; - flag_almanac_2 = true; - DLOG(INFO) << "flag_tow_set" << flag_TOW_set; - break; + case 8: /*Word type 8: Almanac for SVID1 (2/2) and SVID2 (1/2)*/ + IOD_a_8 = static_cast(read_navigation_unsigned(data_jk_bits, IOD_a_8_bit)); + DLOG(INFO) << "IOD_a_8= " << IOD_a_8; + af0_8 = static_cast(read_navigation_signed(data_jk_bits, af0_8_bit)); + af0_8 = af0_8 * af0_8_LSB; + DLOG(INFO) << "af0_8= " << af0_8; + af1_8 = static_cast(read_navigation_signed(data_jk_bits, af1_8_bit)); + af1_8 = af1_8 * af1_8_LSB; + DLOG(INFO) << "af1_8= " << af1_8; + E5b_HS_8 = static_cast(read_navigation_unsigned(data_jk_bits, E5b_HS_8_bit)); + DLOG(INFO) << "E5b_HS_8= " << E5b_HS_8; + E1B_HS_8 = static_cast(read_navigation_unsigned(data_jk_bits, E1B_HS_8_bit)); + DLOG(INFO) << "E1B_HS_8= " << E1B_HS_8; + SVID2_8 = static_cast(read_navigation_unsigned(data_jk_bits, SVID2_8_bit)); + DLOG(INFO) << "SVID2_8= " << SVID2_8; + DELTA_A_8 = static_cast(read_navigation_signed(data_jk_bits, DELTA_A_8_bit)); + DELTA_A_8 = DELTA_A_8 * DELTA_A_8_LSB; + DLOG(INFO) << "DELTA_A_8= " << DELTA_A_8; + e_8 = static_cast(read_navigation_unsigned(data_jk_bits, e_8_bit)); + e_8 = e_8 * e_8_LSB; + DLOG(INFO) << "e_8= " << e_8; + omega_8 = static_cast(read_navigation_signed(data_jk_bits, omega_8_bit)); + omega_8 = omega_8 * omega_8_LSB; + DLOG(INFO) << "omega_8= " << omega_8; + delta_i_8 = static_cast(read_navigation_signed(data_jk_bits, delta_i_8_bit)); + delta_i_8 = delta_i_8 * delta_i_8_LSB; + DLOG(INFO) << "delta_i_8= " << delta_i_8; + Omega0_8 = static_cast(read_navigation_signed(data_jk_bits, Omega0_8_bit)); + Omega0_8 = Omega0_8 * Omega0_8_LSB; + DLOG(INFO) << "Omega0_8= " << Omega0_8; + Omega_dot_8 = static_cast(read_navigation_signed(data_jk_bits, Omega_dot_8_bit)); + Omega_dot_8 = Omega_dot_8 * Omega_dot_8_LSB; + DLOG(INFO) << "Omega_dot_8= " << Omega_dot_8; + flag_almanac_2 = true; + DLOG(INFO) << "flag_tow_set" << flag_TOW_set; + break; - case 9: /*Word type 9: Almanac for SVID2 (2/2) and SVID3 (1/2)*/ - IOD_a_9 = static_cast(read_navigation_unsigned(data_jk_bits, IOD_a_9_bit)); - DLOG(INFO) << "IOD_a_9= " << IOD_a_9; - WN_a_9 = static_cast(read_navigation_unsigned(data_jk_bits, WN_a_9_bit)); - DLOG(INFO) << "WN_a_9= " << WN_a_9; - t0a_9 = static_cast(read_navigation_unsigned(data_jk_bits, t0a_9_bit)); - t0a_9 = t0a_9 * t0a_9_LSB; - DLOG(INFO) << "t0a_9= " << t0a_9; - M0_9 = static_cast(read_navigation_signed(data_jk_bits, M0_9_bit)); - M0_9 = M0_9 * M0_9_LSB; - DLOG(INFO) << "M0_9= " << M0_9; - af0_9 = static_cast(read_navigation_signed(data_jk_bits, af0_9_bit)); - af0_9 = af0_9 * af0_9_LSB; - DLOG(INFO) << "af0_9= " << af0_9; - af1_9 = static_cast(read_navigation_signed(data_jk_bits, af1_9_bit)); - af1_9 = af1_9 * af1_9_LSB; - DLOG(INFO) << "af1_9= " << af1_9; - E5b_HS_9 = static_cast(read_navigation_unsigned(data_jk_bits, E5b_HS_9_bit)); - DLOG(INFO) << "E5b_HS_9= " << E5b_HS_9; - E1B_HS_9 = static_cast(read_navigation_unsigned(data_jk_bits, E1B_HS_9_bit)); - DLOG(INFO) << "E1B_HS_9= " << E1B_HS_9; - SVID3_9 = static_cast(read_navigation_unsigned(data_jk_bits, SVID3_9_bit)); - DLOG(INFO) << "SVID3_9= " << SVID3_9; - DELTA_A_9 = static_cast(read_navigation_signed(data_jk_bits, DELTA_A_9_bit)); - DELTA_A_9 = DELTA_A_9 * DELTA_A_9_LSB; - DLOG(INFO) << "DELTA_A_9= " << DELTA_A_9; - e_9 = static_cast(read_navigation_unsigned(data_jk_bits, e_9_bit)); - e_9 = e_9 * e_9_LSB; - DLOG(INFO) << "e_9= " << e_9; - omega_9 = static_cast(read_navigation_signed(data_jk_bits, omega_9_bit)); - omega_9 = omega_9 * omega_9_LSB; - DLOG(INFO) << "omega_9= " << omega_9; - delta_i_9 = static_cast(read_navigation_signed(data_jk_bits, delta_i_9_bit)); - delta_i_9 = delta_i_9 * delta_i_9_LSB; - DLOG(INFO) << "delta_i_9= " << delta_i_9; - flag_almanac_3 = true; - DLOG(INFO) << "flag_tow_set" << flag_TOW_set; - break; + case 9: /*Word type 9: Almanac for SVID2 (2/2) and SVID3 (1/2)*/ + IOD_a_9 = static_cast(read_navigation_unsigned(data_jk_bits, IOD_a_9_bit)); + DLOG(INFO) << "IOD_a_9= " << IOD_a_9; + WN_a_9 = static_cast(read_navigation_unsigned(data_jk_bits, WN_a_9_bit)); + DLOG(INFO) << "WN_a_9= " << WN_a_9; + t0a_9 = static_cast(read_navigation_unsigned(data_jk_bits, t0a_9_bit)); + t0a_9 = t0a_9 * t0a_9_LSB; + DLOG(INFO) << "t0a_9= " << t0a_9; + M0_9 = static_cast(read_navigation_signed(data_jk_bits, M0_9_bit)); + M0_9 = M0_9 * M0_9_LSB; + DLOG(INFO) << "M0_9= " << M0_9; + af0_9 = static_cast(read_navigation_signed(data_jk_bits, af0_9_bit)); + af0_9 = af0_9 * af0_9_LSB; + DLOG(INFO) << "af0_9= " << af0_9; + af1_9 = static_cast(read_navigation_signed(data_jk_bits, af1_9_bit)); + af1_9 = af1_9 * af1_9_LSB; + DLOG(INFO) << "af1_9= " << af1_9; + E5b_HS_9 = static_cast(read_navigation_unsigned(data_jk_bits, E5b_HS_9_bit)); + DLOG(INFO) << "E5b_HS_9= " << E5b_HS_9; + E1B_HS_9 = static_cast(read_navigation_unsigned(data_jk_bits, E1B_HS_9_bit)); + DLOG(INFO) << "E1B_HS_9= " << E1B_HS_9; + SVID3_9 = static_cast(read_navigation_unsigned(data_jk_bits, SVID3_9_bit)); + DLOG(INFO) << "SVID3_9= " << SVID3_9; + DELTA_A_9 = static_cast(read_navigation_signed(data_jk_bits, DELTA_A_9_bit)); + DELTA_A_9 = DELTA_A_9 * DELTA_A_9_LSB; + DLOG(INFO) << "DELTA_A_9= " << DELTA_A_9; + e_9 = static_cast(read_navigation_unsigned(data_jk_bits, e_9_bit)); + e_9 = e_9 * e_9_LSB; + DLOG(INFO) << "e_9= " << e_9; + omega_9 = static_cast(read_navigation_signed(data_jk_bits, omega_9_bit)); + omega_9 = omega_9 * omega_9_LSB; + DLOG(INFO) << "omega_9= " << omega_9; + delta_i_9 = static_cast(read_navigation_signed(data_jk_bits, delta_i_9_bit)); + delta_i_9 = delta_i_9 * delta_i_9_LSB; + DLOG(INFO) << "delta_i_9= " << delta_i_9; + flag_almanac_3 = true; + DLOG(INFO) << "flag_tow_set" << flag_TOW_set; + break; - case 10: /*Word type 10: Almanac for SVID3 (2/2) and GST-GPS conversion parameters*/ - IOD_a_10 = static_cast(read_navigation_unsigned(data_jk_bits, IOD_a_10_bit)); - DLOG(INFO) << "IOD_a_10= " << IOD_a_10; - Omega0_10 = static_cast(read_navigation_signed(data_jk_bits, Omega0_10_bit)); - Omega0_10 = Omega0_10 * Omega0_10_LSB; - DLOG(INFO) << "Omega0_10= " << Omega0_10; - Omega_dot_10 = static_cast(read_navigation_signed(data_jk_bits, Omega_dot_10_bit)); - Omega_dot_10 = Omega_dot_10 * Omega_dot_10_LSB; - DLOG(INFO) << "Omega_dot_10= " << Omega_dot_10 ; - M0_10 = static_cast(read_navigation_signed(data_jk_bits, M0_10_bit)); - M0_10 = M0_10 * M0_10_LSB; - DLOG(INFO) << "M0_10= " << M0_10; - af0_10 = static_cast(read_navigation_signed(data_jk_bits, af0_10_bit)); - af0_10 = af0_10 * af0_10_LSB; - DLOG(INFO) << "af0_10= " << af0_10; - af1_10 = static_cast(read_navigation_signed(data_jk_bits, af1_10_bit)); - af1_10 = af1_10 * af1_10_LSB; - DLOG(INFO) << "af1_10= " << af1_10; - E5b_HS_10 = static_cast(read_navigation_unsigned(data_jk_bits, E5b_HS_10_bit)); - DLOG(INFO) << "E5b_HS_10= " << E5b_HS_10; - E1B_HS_10 = static_cast(read_navigation_unsigned(data_jk_bits, E1B_HS_10_bit)); - DLOG(INFO) << "E1B_HS_10= " << E1B_HS_10; - A_0G_10 = static_cast(read_navigation_signed(data_jk_bits, A_0G_10_bit)); - A_0G_10 = A_0G_10 * A_0G_10_LSB; - flag_GGTO_1=true; - DLOG(INFO) << "A_0G_10= " << A_0G_10; - A_1G_10 = static_cast(read_navigation_signed(data_jk_bits, A_1G_10_bit)); - A_1G_10 = A_1G_10 * A_1G_10_LSB; - flag_GGTO_2=true; - DLOG(INFO) << "A_1G_10= " << A_1G_10; - t_0G_10 = static_cast(read_navigation_unsigned(data_jk_bits, t_0G_10_bit)); - t_0G_10 = t_0G_10 * t_0G_10_LSB; - flag_GGTO_3=true; - DLOG(INFO) << "t_0G_10= " << t_0G_10; - WN_0G_10 = static_cast(read_navigation_unsigned(data_jk_bits, WN_0G_10_bit)); - flag_GGTO_4=true; - DLOG(INFO) << "WN_0G_10= " << WN_0G_10; - flag_almanac_4 = true; - DLOG(INFO) << "flag_tow_set" << flag_TOW_set; - break; + case 10: /*Word type 10: Almanac for SVID3 (2/2) and GST-GPS conversion parameters*/ + IOD_a_10 = static_cast(read_navigation_unsigned(data_jk_bits, IOD_a_10_bit)); + DLOG(INFO) << "IOD_a_10= " << IOD_a_10; + Omega0_10 = static_cast(read_navigation_signed(data_jk_bits, Omega0_10_bit)); + Omega0_10 = Omega0_10 * Omega0_10_LSB; + DLOG(INFO) << "Omega0_10= " << Omega0_10; + Omega_dot_10 = static_cast(read_navigation_signed(data_jk_bits, Omega_dot_10_bit)); + Omega_dot_10 = Omega_dot_10 * Omega_dot_10_LSB; + DLOG(INFO) << "Omega_dot_10= " << Omega_dot_10; + M0_10 = static_cast(read_navigation_signed(data_jk_bits, M0_10_bit)); + M0_10 = M0_10 * M0_10_LSB; + DLOG(INFO) << "M0_10= " << M0_10; + af0_10 = static_cast(read_navigation_signed(data_jk_bits, af0_10_bit)); + af0_10 = af0_10 * af0_10_LSB; + DLOG(INFO) << "af0_10= " << af0_10; + af1_10 = static_cast(read_navigation_signed(data_jk_bits, af1_10_bit)); + af1_10 = af1_10 * af1_10_LSB; + DLOG(INFO) << "af1_10= " << af1_10; + E5b_HS_10 = static_cast(read_navigation_unsigned(data_jk_bits, E5b_HS_10_bit)); + DLOG(INFO) << "E5b_HS_10= " << E5b_HS_10; + E1B_HS_10 = static_cast(read_navigation_unsigned(data_jk_bits, E1B_HS_10_bit)); + DLOG(INFO) << "E1B_HS_10= " << E1B_HS_10; + A_0G_10 = static_cast(read_navigation_signed(data_jk_bits, A_0G_10_bit)); + A_0G_10 = A_0G_10 * A_0G_10_LSB; + flag_GGTO_1 = true; + DLOG(INFO) << "A_0G_10= " << A_0G_10; + A_1G_10 = static_cast(read_navigation_signed(data_jk_bits, A_1G_10_bit)); + A_1G_10 = A_1G_10 * A_1G_10_LSB; + flag_GGTO_2 = true; + DLOG(INFO) << "A_1G_10= " << A_1G_10; + t_0G_10 = static_cast(read_navigation_unsigned(data_jk_bits, t_0G_10_bit)); + t_0G_10 = t_0G_10 * t_0G_10_LSB; + flag_GGTO_3 = true; + DLOG(INFO) << "t_0G_10= " << t_0G_10; + WN_0G_10 = static_cast(read_navigation_unsigned(data_jk_bits, WN_0G_10_bit)); + flag_GGTO_4 = true; + DLOG(INFO) << "WN_0G_10= " << WN_0G_10; + flag_almanac_4 = true; + DLOG(INFO) << "flag_tow_set" << flag_TOW_set; + break; - case 0: /*Word type 0: I/NAV Spare Word*/ - Time_0 = static_cast(read_navigation_unsigned(data_jk_bits, Time_0_bit)); - DLOG(INFO) << "Time_0= " << Time_0; - WN_0 = static_cast(read_navigation_unsigned(data_jk_bits, WN_0_bit)); - DLOG(INFO) << "WN_0= " << WN_0; - TOW_0 = static_cast(read_navigation_unsigned(data_jk_bits, TOW_0_bit)); - DLOG(INFO) << "TOW_0= " << TOW_0; - DLOG(INFO) << "flag_tow_set" << flag_TOW_set; - break; - } + case 0: /*Word type 0: I/NAV Spare Word*/ + Time_0 = static_cast(read_navigation_unsigned(data_jk_bits, Time_0_bit)); + DLOG(INFO) << "Time_0= " << Time_0; + WN_0 = static_cast(read_navigation_unsigned(data_jk_bits, WN_0_bit)); + DLOG(INFO) << "WN_0= " << WN_0; + TOW_0 = static_cast(read_navigation_unsigned(data_jk_bits, TOW_0_bit)); + DLOG(INFO) << "TOW_0= " << TOW_0; + DLOG(INFO) << "flag_tow_set" << flag_TOW_set; + break; + } return page_number; } - - diff --git a/src/core/system_parameters/galileo_navigation_message.h b/src/core/system_parameters/galileo_navigation_message.h index d78a37d31..376db483e 100644 --- a/src/core/system_parameters/galileo_navigation_message.h +++ b/src/core/system_parameters/galileo_navigation_message.h @@ -55,11 +55,12 @@ class Galileo_Navigation_Message { private: bool CRC_test(std::bitset bits, boost::uint32_t checksum); - bool read_navigation_bool(std::bitset bits, const std::vector > parameter); + bool read_navigation_bool(std::bitset bits, const std::vector > parameter); //void print_galileo_word_bytes(unsigned int GPS_word); - unsigned long int read_navigation_unsigned(std::bitset bits, const std::vector< std::pair > parameter); - unsigned long int read_page_type_unsigned(std::bitset bits, const std::vector< std::pair > parameter); - signed long int read_navigation_signed(std::bitset bits, const std::vector > parameter); + unsigned long int read_navigation_unsigned(std::bitset bits, const std::vector > parameter); + unsigned long int read_page_type_unsigned(std::bitset bits, const std::vector > parameter); + signed long int read_navigation_signed(std::bitset bits, const std::vector > parameter); + public: int Page_type_time_stamp; int flag_even_word; @@ -71,17 +72,17 @@ public: bool flag_ephemeris_3; //!< Flag indicating that ephemeris 3/4 (word 3) have been received bool flag_ephemeris_4; //!< Flag indicating that ephemeris 4/4 (word 4) have been received - bool flag_iono_and_GST; //!< Flag indicating that ionospheric and GST parameters (word 5) have been received + bool flag_iono_and_GST; //!< Flag indicating that ionospheric and GST parameters (word 5) have been received bool flag_TOW_5; bool flag_TOW_6; - bool flag_TOW_set; //!< it is true when page 5 or page 6 arrives - bool flag_utc_model; //!< Flag indicating that utc model parameters (word 6) have been received + bool flag_TOW_set; //!< it is true when page 5 or page 6 arrives + bool flag_utc_model; //!< Flag indicating that utc model parameters (word 6) have been received - bool flag_all_almanac; //!< Flag indicating that all almanac have been received - bool flag_almanac_1; //!< Flag indicating that almanac 1/4 (word 7) have been received - bool flag_almanac_2; //!< Flag indicating that almanac 2/4 (word 8) have been received - bool flag_almanac_3; //!< Flag indicating that almanac 3/4 (word 9) have been received - bool flag_almanac_4; //!< Flag indicating that almanac 4/4 (word 10) have been received + bool flag_all_almanac; //!< Flag indicating that all almanac have been received + bool flag_almanac_1; //!< Flag indicating that almanac 1/4 (word 7) have been received + bool flag_almanac_2; //!< Flag indicating that almanac 2/4 (word 8) have been received + bool flag_almanac_3; //!< Flag indicating that almanac 3/4 (word 9) have been received + bool flag_almanac_4; //!< Flag indicating that almanac 4/4 (word 10) have been received int IOD_ephemeris; @@ -92,60 +93,60 @@ public: bool flag_GGTO_4; /*Word type 1: Ephemeris (1/4)*/ - int IOD_nav_1; //!< IOD_nav page 1 - double t0e_1; //!< Ephemeris reference time [s] - double M0_1; //!< Mean anomaly at reference time [semi-circles] - double e_1; //!< Eccentricity - double A_1; //!< Square root of the semi-major axis [metres^1/2] + int IOD_nav_1; //!< IOD_nav page 1 + double t0e_1; //!< Ephemeris reference time [s] + double M0_1; //!< Mean anomaly at reference time [semi-circles] + double e_1; //!< Eccentricity + double A_1; //!< Square root of the semi-major axis [metres^1/2] /*Word type 2: Ephemeris (2/4)*/ - int IOD_nav_2; //!< IOD_nav page 2 - double OMEGA_0_2; //!< Longitude of ascending node of orbital plane at weekly epoch [semi-circles] - double i_0_2; //!< Inclination angle at reference time [semi-circles] - double omega_2; //!< Argument of perigee [semi-circles] - double iDot_2; //!< Rate of inclination angle [semi-circles/sec] + int IOD_nav_2; //!< IOD_nav page 2 + double OMEGA_0_2; //!< Longitude of ascending node of orbital plane at weekly epoch [semi-circles] + double i_0_2; //!< Inclination angle at reference time [semi-circles] + double omega_2; //!< Argument of perigee [semi-circles] + double iDot_2; //!< Rate of inclination angle [semi-circles/sec] /*Word type 3: Ephemeris (3/4) and SISA*/ - int IOD_nav_3; // - double OMEGA_dot_3; //!< Rate of right ascension [semi-circles/sec] - double delta_n_3; //!< Mean motion difference from computed value [semi-circles/sec] - double C_uc_3; //!< Amplitude of the cosine harmonic correction term to the argument of latitude [radians] - double C_us_3; //!< Amplitude of the sine harmonic correction term to the argument of latitude [radians] - double C_rc_3; //!< Amplitude of the cosine harmonic correction term to the orbit radius [meters] - double C_rs_3; //!< Amplitude of the sine harmonic correction term to the orbit radius [meters] + int IOD_nav_3; // + double OMEGA_dot_3; //!< Rate of right ascension [semi-circles/sec] + double delta_n_3; //!< Mean motion difference from computed value [semi-circles/sec] + double C_uc_3; //!< Amplitude of the cosine harmonic correction term to the argument of latitude [radians] + double C_us_3; //!< Amplitude of the sine harmonic correction term to the argument of latitude [radians] + double C_rc_3; //!< Amplitude of the cosine harmonic correction term to the orbit radius [meters] + double C_rs_3; //!< Amplitude of the sine harmonic correction term to the orbit radius [meters] double SISA_3; /*Word type 4: Ephemeris (4/4) and Clock correction parameters*/ - int IOD_nav_4; // - int SV_ID_PRN_4; // - double C_ic_4; //!= 0) // is not in the past + if ((weeksToLeapSecondEvent) >= 0) // is not in the past { //Detect if the effectivity time and user's time is within six hours = 6 * 60 *60 = 21600 s int secondOfLeapSecondEvent = DN_6 * 24 * 60 * 60; - if (std::abs(t_e - secondOfLeapSecondEvent) > 21600) + if (std::abs(t_e - secondOfLeapSecondEvent) > 21600) { /* 5.1.7a GST->UTC case a * Whenever the leap second adjusted time indicated by the WN_LSF and the DN values @@ -67,7 +67,7 @@ double Galileo_Utc_Model::GST_to_UTC_time(double t_e, int WN) * to the effective time and ends at six hours after the effective time, * the GST/Utc relationship is given by */ - Delta_t_Utc = Delta_tLS_6 + A0_6 + A1_6 * (t_e - t0t_6 + 604800 * static_cast((WN % 256) - WNot_6)); + Delta_t_Utc = Delta_tLS_6 + A0_6 + A1_6 * (t_e - t0t_6 + 604800 * static_cast((WN % 256) - WNot_6)); t_Utc_daytime = fmod(t_e - Delta_t_Utc, 86400); } else @@ -77,13 +77,13 @@ double Galileo_Utc_Model::GST_to_UTC_time(double t_e, int WN) * prior to the leap second adjustment to six hours after the adjustment time, , * the effective time is computed according to the following equations: */ - Delta_t_Utc = Delta_tLS_6 + A0_6 + A1_6 * (t_e - t0t_6 + 604800 * static_cast((WN % 256) - WNot_6)); + Delta_t_Utc = Delta_tLS_6 + A0_6 + A1_6 * (t_e - t0t_6 + 604800 * static_cast((WN % 256) - WNot_6)); double W = fmod(t_e - Delta_t_Utc - 43200, 86400) + 43200; t_Utc_daytime = fmod(W, 86400 + Delta_tLSF_6 - Delta_tLS_6); //implement something to handle a leap second event! } } - else // the effectivity time is in the past + else // the effectivity time is in the past { /* 5.1.7c GST->UTC case c * Whenever the leap second adjustment time, as indicated by the WN_LSF and DN values, @@ -100,4 +100,3 @@ double Galileo_Utc_Model::GST_to_UTC_time(double t_e, int WN) t_Utc = secondsOfWeekBeforeToday + t_Utc_daytime; return t_Utc; } - diff --git a/src/core/system_parameters/galileo_utc_model.h b/src/core/system_parameters/galileo_utc_model.h index aa3ef8723..0f2c66d02 100644 --- a/src/core/system_parameters/galileo_utc_model.h +++ b/src/core/system_parameters/galileo_utc_model.h @@ -46,14 +46,14 @@ public: double A0_6; double A1_6; double Delta_tLS_6; - double t0t_6; //!< UTC data reference Time of Week [s] - double WNot_6; //!< UTC data reference Week number [week] + double t0t_6; //!< UTC data reference Time of Week [s] + double WNot_6; //!< UTC data reference Week number [week] double WN_LSF_6; double DN_6; double Delta_tLSF_6; bool flag_utc_model; //double TOW_6; - double GST_to_UTC_time(double t_e, int WN); //!< GST-UTC Conversion Algorithm and Parameters + double GST_to_UTC_time(double t_e, int WN); //!< GST-UTC Conversion Algorithm and Parameters /*! * Default constructor */ diff --git a/src/core/system_parameters/glonass_gnav_almanac.h b/src/core/system_parameters/glonass_gnav_almanac.h index 896c5cd62..09788b517 100644 --- a/src/core/system_parameters/glonass_gnav_almanac.h +++ b/src/core/system_parameters/glonass_gnav_almanac.h @@ -44,52 +44,54 @@ class Glonass_Gnav_Almanac { public: - double d_n_A; //!< Conventional number of satellite within GLONASS space segment [dimensionless] - double d_H_n_A; //!< Carrier frequency number of navigation RF signal transmitted by d_nA satellite as table 4.10 (0-31) [dimensionless] - double d_lambda_n_A; //!< Longitude of the first (within the d_NA day) ascending node of d_nA [radians] - double d_t_lambda_n_A; //!< Time of first ascending node passage [s] - double d_Delta_i_n_A; //!< Correction of the mean value of inclination of d_n_A satellite at instant t_lambda_n_A [radians] - double d_Delta_T_n_A; //!< Correction to the mean value of Draconian period of d_n_A satellite at instant t_lambda_n_A [s / orbital period] - double d_Delta_T_n_A_dot; //!< Rate of change of Draconian period of d_n_A satellite at instant t_lambda_n_A [s / orbital period^2] - double d_epsilon_n_A; //!< Eccentricity of d_n_A satellite at instant t_lambda_n_A [dimensionless] - double d_omega_n_A; //!< Argument of perigee of d_n_A satellite at instant t_lambdan_A [radians] - double d_M_n_A; //!< Type of satellite n_A [dimensionless] - double d_KP; //!< Notification on forthcoming leap second correction of UTC [dimensionless] - double d_tau_n_A; //!< Coarse value of d_n_A satellite time correction to GLONASS time at instant t_lambdan_A[s] - bool d_C_n; //!< Generalized “unhealthy flag” of n_A satellite at instant of almanac upload [dimensionless] - bool d_l_n; //!< Health flag for nth satellite; ln = 0 indicates the n-th satellite is helthy, ln = 1 indicates malfunction of this nth satellite [dimensionless] + double d_n_A; //!< Conventional number of satellite within GLONASS space segment [dimensionless] + double d_H_n_A; //!< Carrier frequency number of navigation RF signal transmitted by d_nA satellite as table 4.10 (0-31) [dimensionless] + double d_lambda_n_A; //!< Longitude of the first (within the d_NA day) ascending node of d_nA [radians] + double d_t_lambda_n_A; //!< Time of first ascending node passage [s] + double d_Delta_i_n_A; //!< Correction of the mean value of inclination of d_n_A satellite at instant t_lambda_n_A [radians] + double d_Delta_T_n_A; //!< Correction to the mean value of Draconian period of d_n_A satellite at instant t_lambda_n_A [s / orbital period] + double d_Delta_T_n_A_dot; //!< Rate of change of Draconian period of d_n_A satellite at instant t_lambda_n_A [s / orbital period^2] + double d_epsilon_n_A; //!< Eccentricity of d_n_A satellite at instant t_lambda_n_A [dimensionless] + double d_omega_n_A; //!< Argument of perigee of d_n_A satellite at instant t_lambdan_A [radians] + double d_M_n_A; //!< Type of satellite n_A [dimensionless] + double d_KP; //!< Notification on forthcoming leap second correction of UTC [dimensionless] + double d_tau_n_A; //!< Coarse value of d_n_A satellite time correction to GLONASS time at instant t_lambdan_A[s] + bool d_C_n; //!< Generalized “unhealthy flag” of n_A satellite at instant of almanac upload [dimensionless] + bool d_l_n; //!< Health flag for nth satellite; ln = 0 indicates the n-th satellite is helthy, ln = 1 indicates malfunction of this nth satellite [dimensionless] // Satellite Identification Information - int i_satellite_freq_channel; //!< SV Frequency Channel Number - unsigned int i_satellite_PRN; //!< SV PRN Number, equivalent to slot number for compatibility with GPS - unsigned int i_satellite_slot_number; //!< SV Slot Number + int i_satellite_freq_channel; //!< SV Frequency Channel Number + unsigned int i_satellite_PRN; //!< SV PRN Number, equivalent to slot number for compatibility with GPS + unsigned int i_satellite_slot_number; //!< SV Slot Number - template + template /*! * \brief Serialize is a boost standard method to be called by the boost XML serialization. Here is used to save the almanac data on disk file. */ void serialize(Archive& archive, const unsigned int version) { using boost::serialization::make_nvp; - if(version){}; + if (version) + { + }; - archive & make_nvp("i_satellite_freq_channel", i_satellite_freq_channel); - archive & make_nvp("i_satellite_PRN", i_satellite_PRN); - archive & make_nvp("i_satellite_slot_number", i_satellite_slot_number); - archive & make_nvp("d_n_A", d_n_A); - archive & make_nvp("d_H_n_A", d_H_n_A); - archive & make_nvp("d_lambda_n_A", d_lambda_n_A); - archive & make_nvp("d_t_lambda_n_A", d_t_lambda_n_A); - archive & make_nvp("d_Delta_i_n_A", d_Delta_i_n_A); - archive & make_nvp("d_Delta_T_n_A", d_Delta_T_n_A); - archive & make_nvp("d_Delta_T_n_A_dot", d_Delta_T_n_A_dot); - archive & make_nvp("d_epsilon_n_A", d_epsilon_n_A); - archive & make_nvp("d_omega_n_A", d_omega_n_A); - archive & make_nvp("d_M_n_A", d_M_n_A); - archive & make_nvp("d_KP", d_KP); - archive & make_nvp("d_tau_n_A", d_tau_n_A); - archive & make_nvp("d_C_n", d_C_n); - archive & make_nvp("d_l_n", d_l_n); + archive& make_nvp("i_satellite_freq_channel", i_satellite_freq_channel); + archive& make_nvp("i_satellite_PRN", i_satellite_PRN); + archive& make_nvp("i_satellite_slot_number", i_satellite_slot_number); + archive& make_nvp("d_n_A", d_n_A); + archive& make_nvp("d_H_n_A", d_H_n_A); + archive& make_nvp("d_lambda_n_A", d_lambda_n_A); + archive& make_nvp("d_t_lambda_n_A", d_t_lambda_n_A); + archive& make_nvp("d_Delta_i_n_A", d_Delta_i_n_A); + archive& make_nvp("d_Delta_T_n_A", d_Delta_T_n_A); + archive& make_nvp("d_Delta_T_n_A_dot", d_Delta_T_n_A_dot); + archive& make_nvp("d_epsilon_n_A", d_epsilon_n_A); + archive& make_nvp("d_omega_n_A", d_omega_n_A); + archive& make_nvp("d_M_n_A", d_M_n_A); + archive& make_nvp("d_KP", d_KP); + archive& make_nvp("d_tau_n_A", d_tau_n_A); + archive& make_nvp("d_C_n", d_C_n); + archive& make_nvp("d_l_n", d_l_n); } /*! diff --git a/src/core/system_parameters/glonass_gnav_ephemeris.cc b/src/core/system_parameters/glonass_gnav_ephemeris.cc index 8986cf52e..ab872226b 100644 --- a/src/core/system_parameters/glonass_gnav_ephemeris.cc +++ b/src/core/system_parameters/glonass_gnav_ephemeris.cc @@ -37,34 +37,34 @@ Glonass_Gnav_Ephemeris::Glonass_Gnav_Ephemeris() { - d_m = 0.0; //!< String number within frame [dimensionless] - d_t_k = 0.0; //!< GLONASS Time (UTC(SU) + 3 h) referenced to the beginning of the frame within the current day [s] - d_t_b = 0.0; //!< Reference ephemeris relative time in GLONASS Time (UTC(SU) + 3 h). Index of a time interval within current day according to UTC(SU) + 03 hours 00 min. [s] - d_M = 0.0; //!< Type of satellite transmitting navigation signal [dimensionless] - d_gamma_n = 0.0; //!< Relative deviation of predicted carrier frequency value of n- satellite from nominal value at the instant tb [dimensionless] - d_tau_n = 0.0; //!< Correction to the nth satellite time (tn) relative to GLONASS time (te), - d_Xn = 0.0; //!< Earth-fixed coordinate x of the satellite in PZ-90.02 coordinate system [km]. - d_Yn = 0.0; //!< Earth-fixed coordinate y of the satellite in PZ-90.02 coordinate system [km] - d_Zn = 0.0; //!< Earth-fixed coordinate z of the satellite in PZ-90.02 coordinate system [km] - d_VXn = 0.0; //!< Earth-fixed velocity coordinate x of the satellite in PZ-90.02 coordinate system [km/s] - d_VYn = 0.0; //!< Earth-fixed velocity coordinate y of the satellite in PZ-90.02 coordinate system [km/s] - d_VZn = 0.0; //!< Earth-fixed velocity coordinate z of the satellite in PZ-90.02 coordinate system [km/s] - d_AXn = 0.0; //!< Earth-fixed acceleration coordinate x of the satellite in PZ-90.02 coordinate system [km/s^2] - d_AYn = 0.0; //!< Earth-fixed acceleration coordinate y of the satellite in PZ-90.02 coordinate system [km/s^2] - d_AZn = 0.0; //!< Earth-fixed acceleration coordinate z of the satellite in PZ-90.02 coordinate system [km/s^2] - d_B_n = 0.0; //!< Health flag [dimensionless] - d_P = 0.0; //!< Technological parameter of control segment, indication the satellite operation mode in respect of time parameters [dimensionless] - d_N_T = 0.0; //!< Current date, calendar number of day within four-year interval starting from the 1-st of January in a leap year [days] - d_F_T = 0.0; //!< Parameter that provides the predicted satellite user range accuracy at time tb [dimensionless] - d_n = 0.0; //!< Index of the satellite transmitting given navigation signal. It corresponds to a slot number within GLONASS constellation - d_Delta_tau_n = 0.0; //!< Time difference between navigation RF signal transmitted in L2 sub- band and aviation RF signal transmitted in L1 sub-band by nth satellite. [dimensionless] - d_E_n = 0.0; //!< Characterises "age" of a current information [days] - d_P_1 = 0.0; //!< Flag of the immediate data updating [minutes] - d_P_2 = false; //!< Flag of oddness ("1") or evenness ("0") of the value of (tb) [dimensionless] - d_P_3 = false; //!< Flag indicating a number of satellites for which almanac is transmitted within given frame: "1" corresponds to 5 satellites and "0" corresponds to 4 satellites [dimensionless] - d_P_4 = false; //!< Flag to show that ephemeris parameters are present. "1" indicates that updated ephemeris or frequency/time parameters have been uploaded by the control segment [dimensionless] - d_l3rd_n = false; //!< Health flag for nth satellite; ln = 0 indicates the n-th satellite is helthy, ln = 1 indicates malfunction of this nth satellite [dimensionless] - d_l5th_n = false; //!< Health flag for nth satellite; ln = 0 indicates the n-th satellite is helthy, ln = 1 indicates malfunction of this nth satellite [dimensionless] + d_m = 0.0; //!< String number within frame [dimensionless] + d_t_k = 0.0; //!< GLONASS Time (UTC(SU) + 3 h) referenced to the beginning of the frame within the current day [s] + d_t_b = 0.0; //!< Reference ephemeris relative time in GLONASS Time (UTC(SU) + 3 h). Index of a time interval within current day according to UTC(SU) + 03 hours 00 min. [s] + d_M = 0.0; //!< Type of satellite transmitting navigation signal [dimensionless] + d_gamma_n = 0.0; //!< Relative deviation of predicted carrier frequency value of n- satellite from nominal value at the instant tb [dimensionless] + d_tau_n = 0.0; //!< Correction to the nth satellite time (tn) relative to GLONASS time (te), + d_Xn = 0.0; //!< Earth-fixed coordinate x of the satellite in PZ-90.02 coordinate system [km]. + d_Yn = 0.0; //!< Earth-fixed coordinate y of the satellite in PZ-90.02 coordinate system [km] + d_Zn = 0.0; //!< Earth-fixed coordinate z of the satellite in PZ-90.02 coordinate system [km] + d_VXn = 0.0; //!< Earth-fixed velocity coordinate x of the satellite in PZ-90.02 coordinate system [km/s] + d_VYn = 0.0; //!< Earth-fixed velocity coordinate y of the satellite in PZ-90.02 coordinate system [km/s] + d_VZn = 0.0; //!< Earth-fixed velocity coordinate z of the satellite in PZ-90.02 coordinate system [km/s] + d_AXn = 0.0; //!< Earth-fixed acceleration coordinate x of the satellite in PZ-90.02 coordinate system [km/s^2] + d_AYn = 0.0; //!< Earth-fixed acceleration coordinate y of the satellite in PZ-90.02 coordinate system [km/s^2] + d_AZn = 0.0; //!< Earth-fixed acceleration coordinate z of the satellite in PZ-90.02 coordinate system [km/s^2] + d_B_n = 0.0; //!< Health flag [dimensionless] + d_P = 0.0; //!< Technological parameter of control segment, indication the satellite operation mode in respect of time parameters [dimensionless] + d_N_T = 0.0; //!< Current date, calendar number of day within four-year interval starting from the 1-st of January in a leap year [days] + d_F_T = 0.0; //!< Parameter that provides the predicted satellite user range accuracy at time tb [dimensionless] + d_n = 0.0; //!< Index of the satellite transmitting given navigation signal. It corresponds to a slot number within GLONASS constellation + d_Delta_tau_n = 0.0; //!< Time difference between navigation RF signal transmitted in L2 sub- band and aviation RF signal transmitted in L1 sub-band by nth satellite. [dimensionless] + d_E_n = 0.0; //!< Characterises "age" of a current information [days] + d_P_1 = 0.0; //!< Flag of the immediate data updating [minutes] + d_P_2 = false; //!< Flag of oddness ("1") or evenness ("0") of the value of (tb) [dimensionless] + d_P_3 = false; //!< Flag indicating a number of satellites for which almanac is transmitted within given frame: "1" corresponds to 5 satellites and "0" corresponds to 4 satellites [dimensionless] + d_P_4 = false; //!< Flag to show that ephemeris parameters are present. "1" indicates that updated ephemeris or frequency/time parameters have been uploaded by the control segment [dimensionless] + d_l3rd_n = false; //!< Health flag for nth satellite; ln = 0 indicates the n-th satellite is helthy, ln = 1 indicates malfunction of this nth satellite [dimensionless] + d_l5th_n = false; //!< Health flag for nth satellite; ln = 0 indicates the n-th satellite is helthy, ln = 1 indicates malfunction of this nth satellite [dimensionless] // Satellite Identification Information i_satellite_freq_channel = 0; //!< SV Frequency Channel Number @@ -75,8 +75,8 @@ Glonass_Gnav_Ephemeris::Glonass_Gnav_Ephemeris() d_dtr = 0.0; //!< relativistic clock correction term d_iode = 0.0; //!< Issue of data, ephemeris (Bit 0-6 of tb) d_tau_c = 0.0; - d_TOW = 0.0; // tow of the start of frame - d_WN = 0.0; // week number of the start of frame + d_TOW = 0.0; // tow of the start of frame + d_WN = 0.0; // week number of the start of frame d_tod = 0.0; } @@ -86,7 +86,7 @@ boost::posix_time::ptime Glonass_Gnav_Ephemeris::compute_GLONASS_time(const doub boost::posix_time::time_duration t(0, 0, offset_time + d_tau_c + d_tau_n); boost::gregorian::date d1(d_yr, 1, 1); boost::gregorian::days d2(d_N_T - 1); - boost::posix_time::ptime glonass_time(d1+d2, t); + boost::posix_time::ptime glonass_time(d1 + d2, t); return glonass_time; } @@ -95,7 +95,7 @@ boost::posix_time::ptime Glonass_Gnav_Ephemeris::compute_GLONASS_time(const doub boost::posix_time::ptime Glonass_Gnav_Ephemeris::glot_to_utc(const double offset_time, const double glot2utc_corr) const { double tod = 0.0; - double glot2utc = 3*3600; + double glot2utc = 3 * 3600; tod = offset_time - glot2utc + glot2utc_corr + d_tau_n; boost::posix_time::time_duration t(0, 0, tod); @@ -107,29 +107,29 @@ boost::posix_time::ptime Glonass_Gnav_Ephemeris::glot_to_utc(const double offset } -void Glonass_Gnav_Ephemeris::glot_to_gpst(double tod_offset, double glot2utc_corr, double glot2gpst_corr, double * wn, double * tow) const +void Glonass_Gnav_Ephemeris::glot_to_gpst(double tod_offset, double glot2utc_corr, double glot2gpst_corr, double* wn, double* tow) const { double tod = 0.0; - double glot2utc = 3*3600; + double glot2utc = 3 * 3600; double days = 0.0; double total_sec = 0.0, sec_of_day = 0.0; int i = 0; - boost::gregorian::date gps_epoch { 1980, 1, 6 }; + boost::gregorian::date gps_epoch{1980, 1, 6}; // tk is relative to UTC(SU) + 3.00 hrs, so we need to convert to utc and add corrections // tk plus 10 sec is the true tod since get_TOW is called when in str5 - tod = tod_offset - glot2utc ; + tod = tod_offset - glot2utc; boost::posix_time::time_duration t(0, 0, tod); boost::gregorian::date d1(d_yr, 1, 1); - boost::gregorian::days d2(d_N_T-1); - boost::posix_time::ptime utc_time(d1+d2, t); + boost::gregorian::days d2(d_N_T - 1); + boost::posix_time::ptime utc_time(d1 + d2, t); boost::gregorian::date utc_date = utc_time.date(); boost::posix_time::ptime gps_time; // Adjust for leap second correction - for (i = 0; GLONASS_LEAP_SECONDS[i][0]>0; i++) + for (i = 0; GLONASS_LEAP_SECONDS[i][0] > 0; i++) { boost::posix_time::time_duration t3(GLONASS_LEAP_SECONDS[i][3], GLONASS_LEAP_SECONDS[i][4], GLONASS_LEAP_SECONDS[i][5]); boost::gregorian::date d3(GLONASS_LEAP_SECONDS[i][0], GLONASS_LEAP_SECONDS[i][1], GLONASS_LEAP_SECONDS[i][2]); @@ -137,24 +137,24 @@ void Glonass_Gnav_Ephemeris::glot_to_gpst(double tod_offset, double glot2utc_cor if (utc_time >= ls_time) { // We add the leap second when going from utc to gpst - gps_time = utc_time + boost::posix_time::time_duration(0,0,fabs(GLONASS_LEAP_SECONDS[i][6])); + gps_time = utc_time + boost::posix_time::time_duration(0, 0, fabs(GLONASS_LEAP_SECONDS[i][6])); break; } } // Total number of days std::string fdat = boost::posix_time::to_simple_string(gps_time); - days = static_cast((utc_date - gps_epoch).days()); + days = static_cast((utc_date - gps_epoch).days()); // Total number of seconds sec_of_day = static_cast((gps_time.time_of_day()).total_seconds()); - total_sec = days*86400 + sec_of_day; + total_sec = days * 86400 + sec_of_day; // Compute Week number - *wn = floor(total_sec/604800); + *wn = floor(total_sec / 604800); // Compute the arithmetic modules to wrap around range - *tow = total_sec - 604800*floor(total_sec/604800); + *tow = total_sec - 604800 * floor(total_sec / 604800); // Perform corrections from fractional seconds *tow += glot2utc_corr + glot2gpst_corr; } @@ -163,7 +163,7 @@ void Glonass_Gnav_Ephemeris::glot_to_gpst(double tod_offset, double glot2utc_cor double Glonass_Gnav_Ephemeris::check_t(double time) { double corrTime; - double half_day = 43200.0; // seconds + double half_day = 43200.0; // seconds corrTime = time; if (time > half_day) { diff --git a/src/core/system_parameters/glonass_gnav_ephemeris.h b/src/core/system_parameters/glonass_gnav_ephemeris.h index cf43566e2..ce9863f84 100644 --- a/src/core/system_parameters/glonass_gnav_ephemeris.h +++ b/src/core/system_parameters/glonass_gnav_ephemeris.h @@ -39,7 +39,6 @@ #include - /*! * \brief This class is a storage and orbital model functions for the GLONASS SV ephemeris data as described in GLONASS ICD (Edition 5.1) * \note Code added as part of GSoC 2017 program @@ -58,50 +57,50 @@ private: double check_t(double time); public: - double d_m; //!< String number within frame [dimensionless] - double d_t_k; //!< GLONASS Time (UTC(SU) + 3 h) referenced to the beginning of the frame within the current day [s] - double d_t_b; //!< Reference ephemeris relative time in GLONASS Time (UTC(SU) + 3 h). Index of a time interval within current day according to UTC(SU) + 03 hours 00 min. [s] - double d_M; //!< Type of satellite transmitting navigation signal [dimensionless] - double d_gamma_n; //!< Relative deviation of predicted carrier frequency value of n- satellite from nominal value at the instant tb [dimensionless] - double d_tau_n; //!< Correction to the nth satellite time (tn) relative to GLONASS time (te), - double d_Xn; //!< Earth-fixed coordinate x of the satellite in PZ-90.02 coordinate system [km]. - double d_Yn; //!< Earth-fixed coordinate y of the satellite in PZ-90.02 coordinate system [km] - double d_Zn; //!< Earth-fixed coordinate z of the satellite in PZ-90.02 coordinate system [km] - double d_VXn; //!< Earth-fixed velocity coordinate x of the satellite in PZ-90.02 coordinate system [km/s] - double d_VYn; //!< Earth-fixed velocity coordinate y of the satellite in PZ-90.02 coordinate system [km/s] - double d_VZn; //!< Earth-fixed velocity coordinate z of the satellite in PZ-90.02 coordinate system [km/s] - double d_AXn; //!< Earth-fixed acceleration coordinate x of the satellite in PZ-90.02 coordinate system [km/s^2] - double d_AYn; //!< Earth-fixed acceleration coordinate y of the satellite in PZ-90.02 coordinate system [km/s^2] - double d_AZn; //!< Earth-fixed acceleration coordinate z of the satellite in PZ-90.02 coordinate system [km/s^2] - double d_B_n; //!< Health flag [dimensionless] - double d_P; //!< Technological parameter of control segment, indication the satellite operation mode in respect of time parameters [dimensionless] - double d_N_T; //!< Current date, calendar number of day within four-year interval starting from the 1-st of January in a leap year [days] - double d_F_T; //!< Parameter that provides the predicted satellite user range accuracy at time tb [dimensionless] - double d_n; //!< Index of the satellite transmitting given navigation signal. It corresponds to a slot number within GLONASS constellation - double d_Delta_tau_n; //!< Time difference between navigation RF signal transmitted in L2 sub- band and aviation RF signal transmitted in L1 sub-band by nth satellite. [dimensionless] - double d_E_n; //!< Characterises "age" of a current information [days] - double d_P_1; //!< Flag of the immediate data updating [minutes] - bool d_P_2; //!< Flag of oddness ("1") or evenness ("0") of the value of (tb) [dimensionless] - bool d_P_3; //!< Flag indicating a number of satellites for which almanac is transmitted within given frame: "1" corresponds to 5 satellites and "0" corresponds to 4 satellites [dimensionless] - bool d_P_4; //!< Flag to show that ephemeris parameters are present. "1" indicates that updated ephemeris or frequency/time parameters have been uploaded by the control segment [dimensionless] - bool d_l3rd_n; //!< Health flag for nth satellite; ln = 0 indicates the n-th satellite is healthy, ln = 1 indicates malfunction of this nth satellite [dimensionless] - bool d_l5th_n; //!< Health flag for nth satellite; ln = 0 indicates the n-th satellite is healthy, ln = 1 indicates malfunction of this nth satellite [dimensionless] + double d_m; //!< String number within frame [dimensionless] + double d_t_k; //!< GLONASS Time (UTC(SU) + 3 h) referenced to the beginning of the frame within the current day [s] + double d_t_b; //!< Reference ephemeris relative time in GLONASS Time (UTC(SU) + 3 h). Index of a time interval within current day according to UTC(SU) + 03 hours 00 min. [s] + double d_M; //!< Type of satellite transmitting navigation signal [dimensionless] + double d_gamma_n; //!< Relative deviation of predicted carrier frequency value of n- satellite from nominal value at the instant tb [dimensionless] + double d_tau_n; //!< Correction to the nth satellite time (tn) relative to GLONASS time (te), + double d_Xn; //!< Earth-fixed coordinate x of the satellite in PZ-90.02 coordinate system [km]. + double d_Yn; //!< Earth-fixed coordinate y of the satellite in PZ-90.02 coordinate system [km] + double d_Zn; //!< Earth-fixed coordinate z of the satellite in PZ-90.02 coordinate system [km] + double d_VXn; //!< Earth-fixed velocity coordinate x of the satellite in PZ-90.02 coordinate system [km/s] + double d_VYn; //!< Earth-fixed velocity coordinate y of the satellite in PZ-90.02 coordinate system [km/s] + double d_VZn; //!< Earth-fixed velocity coordinate z of the satellite in PZ-90.02 coordinate system [km/s] + double d_AXn; //!< Earth-fixed acceleration coordinate x of the satellite in PZ-90.02 coordinate system [km/s^2] + double d_AYn; //!< Earth-fixed acceleration coordinate y of the satellite in PZ-90.02 coordinate system [km/s^2] + double d_AZn; //!< Earth-fixed acceleration coordinate z of the satellite in PZ-90.02 coordinate system [km/s^2] + double d_B_n; //!< Health flag [dimensionless] + double d_P; //!< Technological parameter of control segment, indication the satellite operation mode in respect of time parameters [dimensionless] + double d_N_T; //!< Current date, calendar number of day within four-year interval starting from the 1-st of January in a leap year [days] + double d_F_T; //!< Parameter that provides the predicted satellite user range accuracy at time tb [dimensionless] + double d_n; //!< Index of the satellite transmitting given navigation signal. It corresponds to a slot number within GLONASS constellation + double d_Delta_tau_n; //!< Time difference between navigation RF signal transmitted in L2 sub- band and aviation RF signal transmitted in L1 sub-band by nth satellite. [dimensionless] + double d_E_n; //!< Characterises "age" of a current information [days] + double d_P_1; //!< Flag of the immediate data updating [minutes] + bool d_P_2; //!< Flag of oddness ("1") or evenness ("0") of the value of (tb) [dimensionless] + bool d_P_3; //!< Flag indicating a number of satellites for which almanac is transmitted within given frame: "1" corresponds to 5 satellites and "0" corresponds to 4 satellites [dimensionless] + bool d_P_4; //!< Flag to show that ephemeris parameters are present. "1" indicates that updated ephemeris or frequency/time parameters have been uploaded by the control segment [dimensionless] + bool d_l3rd_n; //!< Health flag for nth satellite; ln = 0 indicates the n-th satellite is healthy, ln = 1 indicates malfunction of this nth satellite [dimensionless] + bool d_l5th_n; //!< Health flag for nth satellite; ln = 0 indicates the n-th satellite is healthy, ln = 1 indicates malfunction of this nth satellite [dimensionless] // Inmediate deliverables of ephemeris information // Satellite Identification Information - int i_satellite_freq_channel; //!< SV Frequency Channel Number - unsigned int i_satellite_PRN; //!< SV PRN Number, equivalent to slot number for compatibility with GPS - unsigned int i_satellite_slot_number; //!< SV Slot Number - double d_yr; //!< Current year - double d_satClkDrift; //!< GLONASS clock error - double d_dtr; //!< relativistic clock correction term - double d_iode; //!< Issue of data, ephemeris (Bit 0-6 of tb) - double d_tau_c; //!< GLONASST 2 UTC correction (todo) may be eliminated - double d_TOW; //!< GLONASST IN GPST seconds of week - double d_WN; //!< GLONASST IN GPST week number of the start of frame - double d_tod; //!< Time of Day since ephemeris where decoded + int i_satellite_freq_channel; //!< SV Frequency Channel Number + unsigned int i_satellite_PRN; //!< SV PRN Number, equivalent to slot number for compatibility with GPS + unsigned int i_satellite_slot_number; //!< SV Slot Number + double d_yr; //!< Current year + double d_satClkDrift; //!< GLONASS clock error + double d_dtr; //!< relativistic clock correction term + double d_iode; //!< Issue of data, ephemeris (Bit 0-6 of tb) + double d_tau_c; //!< GLONASST 2 UTC correction (todo) may be eliminated + double d_TOW; //!< GLONASST IN GPST seconds of week + double d_WN; //!< GLONASST IN GPST week number of the start of frame + double d_tod; //!< Time of Day since ephemeris where decoded - template + template /*! * \brief Serialize is a boost standard method to be called by the boost XML serialization. Here is used to save the ephemeris data on disk file. @@ -109,39 +108,41 @@ public: void serialize(Archive& archive, const unsigned int version) { using boost::serialization::make_nvp; - if(version){}; + if (version) + { + }; - archive & make_nvp("i_satellite_freq_channel", i_satellite_freq_channel); //!< SV PRN frequency channel number - archive & make_nvp("i_satellite_PRN", i_satellite_PRN); - archive & make_nvp("i_satellite_slot_number", i_satellite_slot_number); - archive & make_nvp("d_m", d_m); //!< String number within frame [dimensionless] - archive & make_nvp("d_t_k", d_t_k); //!< Time referenced to the beginning of the frame within the current day [hours, minutes, seconds] - archive & make_nvp("d_t_b", d_t_b); //!< Index of a time interval within current day according to UTC(SU) + 03 hours 00 min. [minutes] - archive & make_nvp("d_M", d_M); //!< Type of satellite transmitting navigation signal [dimensionless] - archive & make_nvp("d_gamma_n", d_gamma_n); //!< Relative deviation of predicted carrier frequency value of n- satellite from nominal value at the instant tb [dimensionless] - archive & make_nvp("d_tau_n", d_tau_n); //!< Correction to the nth satellite time (tn) relative to GLONASS time (te) - archive & make_nvp("d_Xn", d_Xn); //!< Earth-fixed coordinate x of the satellite in PZ-90.02 coordinate system [km]. - archive & make_nvp("d_Yn", d_Yn); //!< Earth-fixed coordinate y of the satellite in PZ-90.02 coordinate system [km] - archive & make_nvp("d_Zn", d_Zn); //!< Earth-fixed coordinate z of the satellite in PZ-90.02 coordinate system [km] - archive & make_nvp("d_VXn", d_VXn); //!< Earth-fixed velocity coordinate x of the satellite in PZ-90.02 coordinate system [km/s] - archive & make_nvp("d_VYn", d_VYn); //!< Earth-fixed velocity coordinate y of the satellite in PZ-90.02 coordinate system [km/s] - archive & make_nvp("d_VZn", d_VZn); //!< Earth-fixed velocity coordinate z of the satellite in PZ-90.02 coordinate system [km/s] - archive & make_nvp("d_AXn", d_AXn); //!< Earth-fixed acceleration coordinate x of the satellite in PZ-90.02 coordinate system [km/s^2] - archive & make_nvp("d_AYn", d_AYn); //!< Earth-fixed acceleration coordinate y of the satellite in PZ-90.02 coordinate system [km/s^2] - archive & make_nvp("d_AZn", d_AZn); //!< Earth-fixed acceleration coordinate z of the satellite in PZ-90.02 coordinate system [km/s^2] - archive & make_nvp("d_B_n", d_B_n); //!< Health flag [dimensionless] - archive & make_nvp("d_P", d_P); //!< Technological parameter of control segment, indication the satellite operation mode in respect of time parameters [dimensionless] - archive & make_nvp("d_N_T", d_N_T); //!< Current date, calendar number of day within four-year interval starting from the 1-st of January in a leap year [days] - archive & make_nvp("d_F_T", d_F_T); //!< Parameter that provides the predicted satellite user range accuracy at time tb [dimensionless] - archive & make_nvp("d_n", d_n); //!< Index of the satellite transmitting given navigation signal. It corresponds to a slot number within GLONASS constellation - archive & make_nvp("d_Delta_tau_n", d_Delta_tau_n); //!< Time difference between navigation RF signal transmitted in L2 sub- band and aviation RF signal transmitted in L1 sub-band by nth satellite. [dimensionless] - archive & make_nvp("d_E_n", d_E_n); //!< Characterises "age" of a current information [days] - archive & make_nvp("d_P_1", d_P_1); //!< Flag of the immediate data updating. - archive & make_nvp("d_P_2", d_P_2); //!< Flag of oddness ("1") or evenness ("0") of the value of (tb) [dimensionless] - archive & make_nvp("d_P_3", d_P_3); //!< Flag indicating a number of satellites for which almanac is transmitted within given frame: "1" corresponds to 5 satellites and "0" corresponds to 4 satellites [dimensionless] - archive & make_nvp("d_P_4", d_P_4); //!< Flag to show that ephemeris parameters are present. "1" indicates that updated ephemeris or frequency/time parameters have been uploaded by the control segment [dimensionless] - archive & make_nvp("d_l3rd_n", d_l3rd_n); //!< Health flag for nth satellite; ln = 0 indicates the n-th satellite is helthy, ln = 1 indicates malfunction of this nth satellite [dimensionless] - archive & make_nvp("d_l5th_n", d_l5th_n); //!< Health flag for nth satellite; ln = 0 indicates the n-th satellite is helthy, ln = 1 indicates malfunction of this nth satellite [dimensionless] + archive& make_nvp("i_satellite_freq_channel", i_satellite_freq_channel); //!< SV PRN frequency channel number + archive& make_nvp("i_satellite_PRN", i_satellite_PRN); + archive& make_nvp("i_satellite_slot_number", i_satellite_slot_number); + archive& make_nvp("d_m", d_m); //!< String number within frame [dimensionless] + archive& make_nvp("d_t_k", d_t_k); //!< Time referenced to the beginning of the frame within the current day [hours, minutes, seconds] + archive& make_nvp("d_t_b", d_t_b); //!< Index of a time interval within current day according to UTC(SU) + 03 hours 00 min. [minutes] + archive& make_nvp("d_M", d_M); //!< Type of satellite transmitting navigation signal [dimensionless] + archive& make_nvp("d_gamma_n", d_gamma_n); //!< Relative deviation of predicted carrier frequency value of n- satellite from nominal value at the instant tb [dimensionless] + archive& make_nvp("d_tau_n", d_tau_n); //!< Correction to the nth satellite time (tn) relative to GLONASS time (te) + archive& make_nvp("d_Xn", d_Xn); //!< Earth-fixed coordinate x of the satellite in PZ-90.02 coordinate system [km]. + archive& make_nvp("d_Yn", d_Yn); //!< Earth-fixed coordinate y of the satellite in PZ-90.02 coordinate system [km] + archive& make_nvp("d_Zn", d_Zn); //!< Earth-fixed coordinate z of the satellite in PZ-90.02 coordinate system [km] + archive& make_nvp("d_VXn", d_VXn); //!< Earth-fixed velocity coordinate x of the satellite in PZ-90.02 coordinate system [km/s] + archive& make_nvp("d_VYn", d_VYn); //!< Earth-fixed velocity coordinate y of the satellite in PZ-90.02 coordinate system [km/s] + archive& make_nvp("d_VZn", d_VZn); //!< Earth-fixed velocity coordinate z of the satellite in PZ-90.02 coordinate system [km/s] + archive& make_nvp("d_AXn", d_AXn); //!< Earth-fixed acceleration coordinate x of the satellite in PZ-90.02 coordinate system [km/s^2] + archive& make_nvp("d_AYn", d_AYn); //!< Earth-fixed acceleration coordinate y of the satellite in PZ-90.02 coordinate system [km/s^2] + archive& make_nvp("d_AZn", d_AZn); //!< Earth-fixed acceleration coordinate z of the satellite in PZ-90.02 coordinate system [km/s^2] + archive& make_nvp("d_B_n", d_B_n); //!< Health flag [dimensionless] + archive& make_nvp("d_P", d_P); //!< Technological parameter of control segment, indication the satellite operation mode in respect of time parameters [dimensionless] + archive& make_nvp("d_N_T", d_N_T); //!< Current date, calendar number of day within four-year interval starting from the 1-st of January in a leap year [days] + archive& make_nvp("d_F_T", d_F_T); //!< Parameter that provides the predicted satellite user range accuracy at time tb [dimensionless] + archive& make_nvp("d_n", d_n); //!< Index of the satellite transmitting given navigation signal. It corresponds to a slot number within GLONASS constellation + archive& make_nvp("d_Delta_tau_n", d_Delta_tau_n); //!< Time difference between navigation RF signal transmitted in L2 sub- band and aviation RF signal transmitted in L1 sub-band by nth satellite. [dimensionless] + archive& make_nvp("d_E_n", d_E_n); //!< Characterises "age" of a current information [days] + archive& make_nvp("d_P_1", d_P_1); //!< Flag of the immediate data updating. + archive& make_nvp("d_P_2", d_P_2); //!< Flag of oddness ("1") or evenness ("0") of the value of (tb) [dimensionless] + archive& make_nvp("d_P_3", d_P_3); //!< Flag indicating a number of satellites for which almanac is transmitted within given frame: "1" corresponds to 5 satellites and "0" corresponds to 4 satellites [dimensionless] + archive& make_nvp("d_P_4", d_P_4); //!< Flag to show that ephemeris parameters are present. "1" indicates that updated ephemeris or frequency/time parameters have been uploaded by the control segment [dimensionless] + archive& make_nvp("d_l3rd_n", d_l3rd_n); //!< Health flag for nth satellite; ln = 0 indicates the n-th satellite is helthy, ln = 1 indicates malfunction of this nth satellite [dimensionless] + archive& make_nvp("d_l5th_n", d_l5th_n); //!< Health flag for nth satellite; ln = 0 indicates the n-th satellite is helthy, ln = 1 indicates malfunction of this nth satellite [dimensionless] } /*! @@ -174,7 +175,7 @@ public: * \param[out] WN Week Number, not in mod(1024) format * \param[out] TOW Time of Week in seconds of week */ - void glot_to_gpst(double tod_offset, double glot2utc_corr, double glot2gpst_corr, double * WN, double * TOW) const; + void glot_to_gpst(double tod_offset, double glot2utc_corr, double glot2gpst_corr, double* WN, double* TOW) const; /*! * Default constructor diff --git a/src/core/system_parameters/glonass_gnav_navigation_message.cc b/src/core/system_parameters/glonass_gnav_navigation_message.cc index ef58d7f3a..9f99723ab 100644 --- a/src/core/system_parameters/glonass_gnav_navigation_message.cc +++ b/src/core/system_parameters/glonass_gnav_navigation_message.cc @@ -39,7 +39,7 @@ void Glonass_Gnav_Navigation_Message::reset() { // Satellite Identification i_satellite_PRN = 0; - i_alm_satellite_slot_number = 0; //!< SV Orbit Slot Number + i_alm_satellite_slot_number = 0; //!< SV Orbit Slot Number flag_update_slot_number = false; // Ephmeris Flags @@ -51,10 +51,10 @@ void Glonass_Gnav_Navigation_Message::reset() // Almanac Flags flag_all_almanac = false; - flag_almanac_str_6 = false; - flag_almanac_str_7 = false; - flag_almanac_str_8 = false; - flag_almanac_str_9 = false; + flag_almanac_str_6 = false; + flag_almanac_str_7 = false; + flag_almanac_str_8 = false; + flag_almanac_str_9 = false; flag_almanac_str_10 = false; flag_almanac_str_11 = false; flag_almanac_str_12 = false; @@ -63,9 +63,9 @@ void Glonass_Gnav_Navigation_Message::reset() flag_almanac_str_15 = false; // UTC and System Clocks Flags - flag_utc_model_valid = false; //!< If set, it indicates that the UTC model parameters are filled - flag_utc_model_str_5 = false; //!< Clock info send in string 5 of navigation data - flag_utc_model_str_15 = false; //!< Clock info send in string 15 of frame 5 of navigation data + flag_utc_model_valid = false; //!< If set, it indicates that the UTC model parameters are filled + flag_utc_model_str_5 = false; //!< Clock info send in string 5 of navigation data + flag_utc_model_str_15 = false; //!< Clock info send in string 15 of frame 5 of navigation data // broadcast orbit 1 flag_TOW_set = false; @@ -83,15 +83,15 @@ void Glonass_Gnav_Navigation_Message::reset() // Data update information d_previous_tb = 0.0; - for(unsigned int i = 0; i < GLONASS_L1_CA_NBR_SATS; i++) + for (unsigned int i = 0; i < GLONASS_L1_CA_NBR_SATS; i++) d_previous_Na[i] = 0.0; - std::map satelliteBlock; //!< Map that stores to which block the PRN belongs http://www.navcen.uscg.gov/?Do=constellationStatus + std::map satelliteBlock; //!< Map that stores to which block the PRN belongs http://www.navcen.uscg.gov/?Do=constellationStatus auto gnss_sat = Gnss_Satellite(); - std::string _system ("GLONASS"); + std::string _system("GLONASS"); //TODO SHould number of channels be hardcoded? - for(unsigned int i = 1; i < 14; i++) + for (unsigned int i = 1; i < 14; i++) { satelliteBlock[i] = gnss_sat.what_block(_system, i); } @@ -119,88 +119,88 @@ bool Glonass_Gnav_Navigation_Message::CRC_test(std::bitset string_bits(GLONASS_GNAV_STRING_BITS); //!< Populate data and hamming code vectors - for(int i = 0; i < static_cast(GLONASS_GNAV_STRING_BITS); i++) + for (int i = 0; i < static_cast(GLONASS_GNAV_STRING_BITS); i++) { string_bits[i] = static_cast(bits[i]); } //!< Compute C1 term sum_bits = 0; - for(int i = 0; i < static_cast(GLONASS_GNAV_CRC_I_INDEX.size()); i++) + for (int i = 0; i < static_cast(GLONASS_GNAV_CRC_I_INDEX.size()); i++) { - sum_bits += string_bits[GLONASS_GNAV_CRC_I_INDEX[i]-1]; + sum_bits += string_bits[GLONASS_GNAV_CRC_I_INDEX[i] - 1]; } - C1 = string_bits[0]^(sum_bits%2); + C1 = string_bits[0] ^ (sum_bits % 2); //!< Compute C2 term sum_bits = 0; - for(int j = 0; j < static_cast(GLONASS_GNAV_CRC_J_INDEX.size()); j++) + for (int j = 0; j < static_cast(GLONASS_GNAV_CRC_J_INDEX.size()); j++) { - sum_bits += string_bits[GLONASS_GNAV_CRC_J_INDEX[j]-1]; + sum_bits += string_bits[GLONASS_GNAV_CRC_J_INDEX[j] - 1]; } - C2 = (string_bits[1])^(sum_bits%2); + C2 = (string_bits[1]) ^ (sum_bits % 2); //!< Compute C3 term sum_bits = 0; - for(int k = 0; k < static_cast(GLONASS_GNAV_CRC_K_INDEX.size()); k++) + for (int k = 0; k < static_cast(GLONASS_GNAV_CRC_K_INDEX.size()); k++) { - sum_bits += string_bits[GLONASS_GNAV_CRC_K_INDEX[k]-1]; + sum_bits += string_bits[GLONASS_GNAV_CRC_K_INDEX[k] - 1]; } - C3 = string_bits[2]^(sum_bits%2); + C3 = string_bits[2] ^ (sum_bits % 2); //!< Compute C4 term sum_bits = 0; - for(int l = 0; l < static_cast(GLONASS_GNAV_CRC_L_INDEX.size()); l++) + for (int l = 0; l < static_cast(GLONASS_GNAV_CRC_L_INDEX.size()); l++) { - sum_bits += string_bits[GLONASS_GNAV_CRC_L_INDEX[l]-1]; + sum_bits += string_bits[GLONASS_GNAV_CRC_L_INDEX[l] - 1]; } - C4 = string_bits[3]^(sum_bits%2); + C4 = string_bits[3] ^ (sum_bits % 2); //!< Compute C5 term sum_bits = 0; - for(int m = 0; m < static_cast(GLONASS_GNAV_CRC_M_INDEX.size()); m++) + for (int m = 0; m < static_cast(GLONASS_GNAV_CRC_M_INDEX.size()); m++) { - sum_bits += string_bits[GLONASS_GNAV_CRC_M_INDEX[m]-1]; + sum_bits += string_bits[GLONASS_GNAV_CRC_M_INDEX[m] - 1]; } - C5 = string_bits[4]^(sum_bits%2); + C5 = string_bits[4] ^ (sum_bits % 2); //!< Compute C6 term sum_bits = 0; - for(int n = 0; n < static_cast(GLONASS_GNAV_CRC_N_INDEX.size()); n++) + for (int n = 0; n < static_cast(GLONASS_GNAV_CRC_N_INDEX.size()); n++) { - sum_bits += string_bits[GLONASS_GNAV_CRC_N_INDEX[n]-1]; + sum_bits += string_bits[GLONASS_GNAV_CRC_N_INDEX[n] - 1]; } - C6 = string_bits[5]^(sum_bits%2); + C6 = string_bits[5] ^ (sum_bits % 2); //!< Compute C7 term sum_bits = 0; - for(int p = 0; p < static_cast(GLONASS_GNAV_CRC_P_INDEX.size()); p++) + for (int p = 0; p < static_cast(GLONASS_GNAV_CRC_P_INDEX.size()); p++) { - sum_bits += string_bits[GLONASS_GNAV_CRC_P_INDEX[p]-1]; + sum_bits += string_bits[GLONASS_GNAV_CRC_P_INDEX[p] - 1]; } - C7 = string_bits[6]^(sum_bits%2); + C7 = string_bits[6] ^ (sum_bits % 2); //!< Compute C_Sigma term sum_bits = 0; sum_hamming = 0; - for(int q = 0; q < static_cast(GLONASS_GNAV_CRC_Q_INDEX.size()); q++) + for (int q = 0; q < static_cast(GLONASS_GNAV_CRC_Q_INDEX.size()); q++) { - sum_bits += string_bits[GLONASS_GNAV_CRC_Q_INDEX[q]-1]; + sum_bits += string_bits[GLONASS_GNAV_CRC_Q_INDEX[q] - 1]; } - for(int q = 0; q < 8; q++) + for (int q = 0; q < 8; q++) { sum_hamming += string_bits[q]; } - C_Sigma = (sum_hamming%2)^(sum_bits%2); + C_Sigma = (sum_hamming % 2) ^ (sum_bits % 2); //!< Verification of the data // (a-i) All checksums (C1,...,C7 and C_Sigma) are equal to zero - if((C1 + C2 + C3 + C4 + C5 + C6 + C7 + C_Sigma) == 0 ) + if ((C1 + C2 + C3 + C4 + C5 + C6 + C7 + C_Sigma) == 0) { return true; } // (a-ii) Only one of the checksums (C1,...,C7) is equal to zero but C_Sigma = 1 - else if(C_Sigma == 1 && C1+C2+C3+C4+C5+C6+C7 == 6) + else if (C_Sigma == 1 && C1 + C2 + C3 + C4 + C5 + C6 + C7 == 6) { return true; } @@ -212,7 +212,7 @@ bool Glonass_Gnav_Navigation_Message::CRC_test(std::bitset bits, const std::vector> parameter) +bool Glonass_Gnav_Navigation_Message::read_navigation_bool(std::bitset bits, const std::vector> parameter) { bool value; @@ -228,7 +228,7 @@ bool Glonass_Gnav_Navigation_Message::read_navigation_bool(std::bitset bits, const std::vector> parameter) +unsigned long int Glonass_Gnav_Navigation_Message::read_navigation_unsigned(std::bitset bits, const std::vector> parameter) { unsigned long int value = 0; int num_of_slices = parameter.size(); @@ -236,10 +236,10 @@ unsigned long int Glonass_Gnav_Navigation_Message::read_navigation_unsigned(std: { for (int j = 0; j < parameter[i].second; j++) { - value <<= 1; //shift left + value <<= 1; //shift left if (bits[GLONASS_GNAV_STRING_BITS - parameter[i].first - j] == 1) { - value += 1; // insert the bit + value += 1; // insert the bit } } } @@ -247,7 +247,7 @@ unsigned long int Glonass_Gnav_Navigation_Message::read_navigation_unsigned(std: } -signed long int Glonass_Gnav_Navigation_Message::read_navigation_signed(std::bitset bits, const std::vector> parameter) +signed long int Glonass_Gnav_Navigation_Message::read_navigation_signed(std::bitset bits, const std::vector> parameter) { signed long int value = 0; signed long int sign = 0; @@ -265,14 +265,14 @@ signed long int Glonass_Gnav_Navigation_Message::read_navigation_signed(std::bit { for (int j = 1; j < parameter[i].second; j++) { - value <<= 1; //shift left + value <<= 1; //shift left if (bits[GLONASS_GNAV_STRING_BITS - parameter[i].first - j] == 1) { - value += 1; // insert the bit + value += 1; // insert the bit } } } - return (sign*value); + return (sign * value); } @@ -280,23 +280,23 @@ unsigned int Glonass_Gnav_Navigation_Message::get_frame_number(unsigned int sate { unsigned int frame_ID = 0; - if(satellite_slot_number >= 1 and satellite_slot_number <= 5 ) + if (satellite_slot_number >= 1 and satellite_slot_number <= 5) { frame_ID = 1; } - else if(satellite_slot_number >= 6 and satellite_slot_number <= 10 ) + else if (satellite_slot_number >= 6 and satellite_slot_number <= 10) { frame_ID = 2; } - else if(satellite_slot_number >= 11 and satellite_slot_number <= 15 ) + else if (satellite_slot_number >= 11 and satellite_slot_number <= 15) { frame_ID = 3; } - else if(satellite_slot_number >= 16 and satellite_slot_number <= 20 ) + else if (satellite_slot_number >= 16 and satellite_slot_number <= 20) { frame_ID = 4; } - else if(satellite_slot_number >= 21 and satellite_slot_number <= 24 ) + else if (satellite_slot_number >= 21 and satellite_slot_number <= 24) { frame_ID = 5; } @@ -317,365 +317,366 @@ int Glonass_Gnav_Navigation_Message::string_decoder(std::string frame_string) d_frame_ID = 0; // Unpack bytes to bits - std::bitset string_bits (frame_string); + std::bitset string_bits(frame_string); // Perform data verification and exit code if error in bit sequence flag_CRC_test = CRC_test(string_bits); - if(flag_CRC_test == false) + if (flag_CRC_test == false) return 0; // Decode all 15 string messages d_string_ID = static_cast(read_navigation_unsigned(string_bits, STRING_ID)); switch (d_string_ID) - { - case 1: - //--- It is string 1 ----------------------------------------------- - gnav_ephemeris.d_P_1 = (static_cast(read_navigation_unsigned(string_bits, P1)) + 1) * 15; - gnav_ephemeris.d_t_k = static_cast(read_navigation_unsigned(string_bits, T_K_HR)) * 3600 + - static_cast(read_navigation_unsigned(string_bits, T_K_MIN)) * 60 + - static_cast(read_navigation_unsigned(string_bits, T_K_SEC)) * 30; - gnav_ephemeris.d_VXn = static_cast(read_navigation_signed(string_bits, X_N_DOT)) * TWO_N20; - gnav_ephemeris.d_AXn = static_cast(read_navigation_signed(string_bits, X_N_DOT_DOT)) * TWO_N30; - gnav_ephemeris.d_Xn = static_cast(read_navigation_signed(string_bits, X_N)) * TWO_N11; + { + case 1: + //--- It is string 1 ----------------------------------------------- + gnav_ephemeris.d_P_1 = (static_cast(read_navigation_unsigned(string_bits, P1)) + 1) * 15; + gnav_ephemeris.d_t_k = static_cast(read_navigation_unsigned(string_bits, T_K_HR)) * 3600 + + static_cast(read_navigation_unsigned(string_bits, T_K_MIN)) * 60 + + static_cast(read_navigation_unsigned(string_bits, T_K_SEC)) * 30; + gnav_ephemeris.d_VXn = static_cast(read_navigation_signed(string_bits, X_N_DOT)) * TWO_N20; + gnav_ephemeris.d_AXn = static_cast(read_navigation_signed(string_bits, X_N_DOT_DOT)) * TWO_N30; + gnav_ephemeris.d_Xn = static_cast(read_navigation_signed(string_bits, X_N)) * TWO_N11; - flag_ephemeris_str_1 = true; + flag_ephemeris_str_1 = true; - break; + break; - case 2: - //--- It is string 2 ----------------------------------------------- - if (flag_ephemeris_str_1 == true) - { - gnav_ephemeris.d_B_n = static_cast(read_navigation_unsigned(string_bits, B_N)); - gnav_ephemeris.d_P_2 = static_cast(read_navigation_bool(string_bits, P2)); - gnav_ephemeris.d_t_b = static_cast(read_navigation_unsigned(string_bits, T_B)) * 15 * 60; - gnav_ephemeris.d_VYn = static_cast(read_navigation_signed(string_bits, Y_N_DOT)) * TWO_N20; - gnav_ephemeris.d_AYn = static_cast(read_navigation_signed(string_bits, Y_N_DOT_DOT)) * TWO_N30; - gnav_ephemeris.d_Yn = static_cast(read_navigation_signed(string_bits, Y_N)) * TWO_N11; + case 2: + //--- It is string 2 ----------------------------------------------- + if (flag_ephemeris_str_1 == true) + { + gnav_ephemeris.d_B_n = static_cast(read_navigation_unsigned(string_bits, B_N)); + gnav_ephemeris.d_P_2 = static_cast(read_navigation_bool(string_bits, P2)); + gnav_ephemeris.d_t_b = static_cast(read_navigation_unsigned(string_bits, T_B)) * 15 * 60; + gnav_ephemeris.d_VYn = static_cast(read_navigation_signed(string_bits, Y_N_DOT)) * TWO_N20; + gnav_ephemeris.d_AYn = static_cast(read_navigation_signed(string_bits, Y_N_DOT_DOT)) * TWO_N30; + gnav_ephemeris.d_Yn = static_cast(read_navigation_signed(string_bits, Y_N)) * TWO_N11; - gnav_ephemeris.d_iode = read_navigation_unsigned(string_bits, T_B); - flag_ephemeris_str_2 = true; - } + gnav_ephemeris.d_iode = read_navigation_unsigned(string_bits, T_B); + flag_ephemeris_str_2 = true; + } - break; + break; - case 3: - // --- It is string 3 ---------------------------------------------- - if (flag_ephemeris_str_2 == true) - { - gnav_ephemeris.d_P_3 = static_cast(read_navigation_bool(string_bits, P3)); - gnav_ephemeris.d_gamma_n = static_cast(read_navigation_signed(string_bits, GAMMA_N)) * TWO_N40; - gnav_ephemeris.d_P = static_cast(read_navigation_unsigned(string_bits, P)); - gnav_ephemeris.d_l3rd_n = static_cast(read_navigation_bool(string_bits, EPH_L_N)); - gnav_ephemeris.d_VZn = static_cast(read_navigation_signed(string_bits, Z_N_DOT)) * TWO_N20; - gnav_ephemeris.d_AZn = static_cast(read_navigation_signed(string_bits, Z_N_DOT_DOT)) * TWO_N30; - gnav_ephemeris.d_Zn = static_cast(read_navigation_signed(string_bits, Z_N)) * TWO_N11; + case 3: + // --- It is string 3 ---------------------------------------------- + if (flag_ephemeris_str_2 == true) + { + gnav_ephemeris.d_P_3 = static_cast(read_navigation_bool(string_bits, P3)); + gnav_ephemeris.d_gamma_n = static_cast(read_navigation_signed(string_bits, GAMMA_N)) * TWO_N40; + gnav_ephemeris.d_P = static_cast(read_navigation_unsigned(string_bits, P)); + gnav_ephemeris.d_l3rd_n = static_cast(read_navigation_bool(string_bits, EPH_L_N)); + gnav_ephemeris.d_VZn = static_cast(read_navigation_signed(string_bits, Z_N_DOT)) * TWO_N20; + gnav_ephemeris.d_AZn = static_cast(read_navigation_signed(string_bits, Z_N_DOT_DOT)) * TWO_N30; + gnav_ephemeris.d_Zn = static_cast(read_navigation_signed(string_bits, Z_N)) * TWO_N11; - flag_ephemeris_str_3 = true; - } + flag_ephemeris_str_3 = true; + } - break; + break; - case 4: - // --- It is string 4 ---------------------------------------------- - if (flag_ephemeris_str_3 == true) - { - gnav_ephemeris.d_tau_n = static_cast(read_navigation_signed(string_bits, TAU_N)) * TWO_N30; - gnav_ephemeris.d_Delta_tau_n = static_cast(read_navigation_signed(string_bits, DELTA_TAU_N)) * TWO_N30; - gnav_ephemeris.d_E_n = static_cast(read_navigation_unsigned(string_bits, E_N)); - gnav_ephemeris.d_P_4 = static_cast(read_navigation_bool(string_bits, P4)); - gnav_ephemeris.d_F_T = static_cast(read_navigation_unsigned(string_bits, F_T)); - gnav_ephemeris.d_N_T = static_cast(read_navigation_unsigned(string_bits, N_T)); - gnav_ephemeris.d_n = static_cast(read_navigation_unsigned(string_bits, N)); - gnav_ephemeris.d_M = static_cast(read_navigation_unsigned(string_bits, M)); + case 4: + // --- It is string 4 ---------------------------------------------- + if (flag_ephemeris_str_3 == true) + { + gnav_ephemeris.d_tau_n = static_cast(read_navigation_signed(string_bits, TAU_N)) * TWO_N30; + gnav_ephemeris.d_Delta_tau_n = static_cast(read_navigation_signed(string_bits, DELTA_TAU_N)) * TWO_N30; + gnav_ephemeris.d_E_n = static_cast(read_navigation_unsigned(string_bits, E_N)); + gnav_ephemeris.d_P_4 = static_cast(read_navigation_bool(string_bits, P4)); + gnav_ephemeris.d_F_T = static_cast(read_navigation_unsigned(string_bits, F_T)); + gnav_ephemeris.d_N_T = static_cast(read_navigation_unsigned(string_bits, N_T)); + gnav_ephemeris.d_n = static_cast(read_navigation_unsigned(string_bits, N)); + gnav_ephemeris.d_M = static_cast(read_navigation_unsigned(string_bits, M)); - // Fill in ephemeris deliverables in the code - flag_update_slot_number = true; - gnav_ephemeris.i_satellite_slot_number = static_cast(gnav_ephemeris.d_n); - gnav_ephemeris.i_satellite_PRN = static_cast(gnav_ephemeris.d_n); + // Fill in ephemeris deliverables in the code + flag_update_slot_number = true; + gnav_ephemeris.i_satellite_slot_number = static_cast(gnav_ephemeris.d_n); + gnav_ephemeris.i_satellite_PRN = static_cast(gnav_ephemeris.d_n); - flag_ephemeris_str_4 = true; - } + flag_ephemeris_str_4 = true; + } - break; + break; - case 5: - // --- It is string 5 ---------------------------------------------- - if (flag_ephemeris_str_4 == true) - { - gnav_utc_model.d_N_A = static_cast(read_navigation_unsigned(string_bits, N_A)); - gnav_utc_model.d_tau_c = static_cast(read_navigation_signed(string_bits, TAU_C)) * TWO_N31; - gnav_utc_model.d_N_4 = static_cast(read_navigation_unsigned(string_bits, N_4)); - gnav_utc_model.d_tau_gps = static_cast(read_navigation_signed(string_bits, TAU_GPS)) * TWO_N30; - gnav_ephemeris.d_l5th_n = static_cast(read_navigation_bool(string_bits, ALM_L_N)); + case 5: + // --- It is string 5 ---------------------------------------------- + if (flag_ephemeris_str_4 == true) + { + gnav_utc_model.d_N_A = static_cast(read_navigation_unsigned(string_bits, N_A)); + gnav_utc_model.d_tau_c = static_cast(read_navigation_signed(string_bits, TAU_C)) * TWO_N31; + gnav_utc_model.d_N_4 = static_cast(read_navigation_unsigned(string_bits, N_4)); + gnav_utc_model.d_tau_gps = static_cast(read_navigation_signed(string_bits, TAU_GPS)) * TWO_N30; + gnav_ephemeris.d_l5th_n = static_cast(read_navigation_bool(string_bits, ALM_L_N)); - flag_utc_model_str_5 = true; + flag_utc_model_str_5 = true; - // Compute Year and DoY based on Algorithm A3.11 of GLONASS ICD - // 1). Current year number J in the four-year interval is calculated - if (gnav_ephemeris.d_N_T >= 1 && gnav_ephemeris.d_N_T <= 366) - { - J = 1; - } - else if (gnav_ephemeris.d_N_T >= 367 && gnav_ephemeris.d_N_T <= 731) - { - J = 2; - } - else if (gnav_ephemeris.d_N_T >= 732 && gnav_ephemeris.d_N_T <= 1096) - { - J = 3; - } - else if (gnav_ephemeris.d_N_T >= 1097 && gnav_ephemeris.d_N_T <= 1461) - { - J = 4; - } - // 2). Current year in common form is calculated by the following formula: - gnav_ephemeris.d_yr = 1996 + 4.0 * (gnav_utc_model.d_N_4 - 1.0) + (J - 1.0); - gnav_ephemeris.d_tau_c = gnav_utc_model.d_tau_c; + // Compute Year and DoY based on Algorithm A3.11 of GLONASS ICD + // 1). Current year number J in the four-year interval is calculated + if (gnav_ephemeris.d_N_T >= 1 && gnav_ephemeris.d_N_T <= 366) + { + J = 1; + } + else if (gnav_ephemeris.d_N_T >= 367 && gnav_ephemeris.d_N_T <= 731) + { + J = 2; + } + else if (gnav_ephemeris.d_N_T >= 732 && gnav_ephemeris.d_N_T <= 1096) + { + J = 3; + } + else if (gnav_ephemeris.d_N_T >= 1097 && gnav_ephemeris.d_N_T <= 1461) + { + J = 4; + } + // 2). Current year in common form is calculated by the following formula: + gnav_ephemeris.d_yr = 1996 + 4.0 * (gnav_utc_model.d_N_4 - 1.0) + (J - 1.0); + gnav_ephemeris.d_tau_c = gnav_utc_model.d_tau_c; - // 3). Set TOW once the year has been defined, it helps with leap second determination - if (flag_ephemeris_str_1 == true) - { - gnav_ephemeris.glot_to_gpst(gnav_ephemeris.d_t_k+10, gnav_utc_model.d_tau_c, gnav_utc_model.d_tau_gps, &gnav_ephemeris.d_WN, &gnav_ephemeris.d_TOW); - flag_TOW_set = true; - flag_TOW_new = true; - } + // 3). Set TOW once the year has been defined, it helps with leap second determination + if (flag_ephemeris_str_1 == true) + { + gnav_ephemeris.glot_to_gpst(gnav_ephemeris.d_t_k + 10, gnav_utc_model.d_tau_c, gnav_utc_model.d_tau_gps, &gnav_ephemeris.d_WN, &gnav_ephemeris.d_TOW); + flag_TOW_set = true; + flag_TOW_new = true; + } - // 4) Set time of day (tod) when ephemeris data is complety decoded - gnav_ephemeris.d_tod = gnav_ephemeris.d_t_k + 2*d_string_ID; - } + // 4) Set time of day (tod) when ephemeris data is complety decoded + gnav_ephemeris.d_tod = gnav_ephemeris.d_t_k + 2 * d_string_ID; + } - break; + break; - case 6: - // --- It is string 6 ---------------------------------------------- - i_alm_satellite_slot_number = static_cast(read_navigation_unsigned(string_bits, n_A)); - d_frame_ID = get_frame_number(i_alm_satellite_slot_number); - // Make sure a valid frame_ID or satellite slot number is returned - if(d_frame_ID == 0) - return 0; + case 6: + // --- It is string 6 ---------------------------------------------- + i_alm_satellite_slot_number = static_cast(read_navigation_unsigned(string_bits, n_A)); + d_frame_ID = get_frame_number(i_alm_satellite_slot_number); + // Make sure a valid frame_ID or satellite slot number is returned + if (d_frame_ID == 0) + return 0; - gnav_almanac[i_alm_satellite_slot_number - 1].d_C_n = static_cast(read_navigation_bool(string_bits, C_N)); - gnav_almanac[i_alm_satellite_slot_number - 1].d_M_n_A = static_cast(read_navigation_unsigned(string_bits, M_N_A)); - gnav_almanac[i_alm_satellite_slot_number - 1].d_n_A = static_cast(read_navigation_unsigned(string_bits, n_A)); - gnav_almanac[i_alm_satellite_slot_number - 1].d_tau_n_A = static_cast(read_navigation_unsigned(string_bits, TAU_N_A)) * TWO_N18; - gnav_almanac[i_alm_satellite_slot_number - 1].d_lambda_n_A = static_cast(read_navigation_signed(string_bits, LAMBDA_N_A)) * TWO_N20 * GLONASS_PI; - gnav_almanac[i_alm_satellite_slot_number - 1].d_Delta_i_n_A = static_cast(read_navigation_signed(string_bits, DELTA_I_N_A)) * TWO_N20 * GLONASS_PI; - gnav_almanac[i_alm_satellite_slot_number - 1].d_epsilon_n_A = static_cast(read_navigation_unsigned(string_bits, EPSILON_N_A)) * TWO_N20; + gnav_almanac[i_alm_satellite_slot_number - 1].d_C_n = static_cast(read_navigation_bool(string_bits, C_N)); + gnav_almanac[i_alm_satellite_slot_number - 1].d_M_n_A = static_cast(read_navigation_unsigned(string_bits, M_N_A)); + gnav_almanac[i_alm_satellite_slot_number - 1].d_n_A = static_cast(read_navigation_unsigned(string_bits, n_A)); + gnav_almanac[i_alm_satellite_slot_number - 1].d_tau_n_A = static_cast(read_navigation_unsigned(string_bits, TAU_N_A)) * TWO_N18; + gnav_almanac[i_alm_satellite_slot_number - 1].d_lambda_n_A = static_cast(read_navigation_signed(string_bits, LAMBDA_N_A)) * TWO_N20 * GLONASS_PI; + gnav_almanac[i_alm_satellite_slot_number - 1].d_Delta_i_n_A = static_cast(read_navigation_signed(string_bits, DELTA_I_N_A)) * TWO_N20 * GLONASS_PI; + gnav_almanac[i_alm_satellite_slot_number - 1].d_epsilon_n_A = static_cast(read_navigation_unsigned(string_bits, EPSILON_N_A)) * TWO_N20; - flag_almanac_str_6 = true; + flag_almanac_str_6 = true; - break; + break; - case 7: - // --- It is string 7 ---------------------------------------------- - if (flag_almanac_str_6 == true) - { - gnav_almanac[i_alm_satellite_slot_number - 1].d_omega_n_A = static_cast(read_navigation_signed(string_bits, OMEGA_N_A)) * TWO_N15 * GLONASS_PI; - gnav_almanac[i_alm_satellite_slot_number - 1].d_t_lambda_n_A = static_cast(read_navigation_unsigned(string_bits, T_LAMBDA_N_A)) * TWO_N5; - gnav_almanac[i_alm_satellite_slot_number - 1].d_Delta_T_n_A = static_cast(read_navigation_signed(string_bits, DELTA_T_N_A)) * TWO_N9; - gnav_almanac[i_alm_satellite_slot_number - 1].d_Delta_T_n_A_dot = static_cast(read_navigation_signed(string_bits, DELTA_T_DOT_N_A)) * TWO_N14; - gnav_almanac[i_alm_satellite_slot_number - 1].d_H_n_A = static_cast(read_navigation_unsigned(string_bits, H_N_A)); - gnav_almanac[i_alm_satellite_slot_number - 1].d_l_n = static_cast(read_navigation_bool(string_bits, ALM_L_N)); + case 7: + // --- It is string 7 ---------------------------------------------- + if (flag_almanac_str_6 == true) + { + gnav_almanac[i_alm_satellite_slot_number - 1].d_omega_n_A = static_cast(read_navigation_signed(string_bits, OMEGA_N_A)) * TWO_N15 * GLONASS_PI; + gnav_almanac[i_alm_satellite_slot_number - 1].d_t_lambda_n_A = static_cast(read_navigation_unsigned(string_bits, T_LAMBDA_N_A)) * TWO_N5; + gnav_almanac[i_alm_satellite_slot_number - 1].d_Delta_T_n_A = static_cast(read_navigation_signed(string_bits, DELTA_T_N_A)) * TWO_N9; + gnav_almanac[i_alm_satellite_slot_number - 1].d_Delta_T_n_A_dot = static_cast(read_navigation_signed(string_bits, DELTA_T_DOT_N_A)) * TWO_N14; + gnav_almanac[i_alm_satellite_slot_number - 1].d_H_n_A = static_cast(read_navigation_unsigned(string_bits, H_N_A)); + gnav_almanac[i_alm_satellite_slot_number - 1].d_l_n = static_cast(read_navigation_bool(string_bits, ALM_L_N)); - // Set satellite information for redundancy purposes - if (gnav_almanac[i_alm_satellite_slot_number - 1].d_H_n_A > 24) - { - gnav_almanac[i_alm_satellite_slot_number - 1].i_satellite_freq_channel = gnav_almanac[i_alm_satellite_slot_number - 1].d_H_n_A - 32.0; - } - gnav_almanac[i_alm_satellite_slot_number - 1].i_satellite_slot_number = gnav_almanac[i_alm_satellite_slot_number - 1].d_n_A; - gnav_almanac[i_alm_satellite_slot_number - 1].i_satellite_PRN = gnav_almanac[i_alm_satellite_slot_number - 1].d_n_A; + // Set satellite information for redundancy purposes + if (gnav_almanac[i_alm_satellite_slot_number - 1].d_H_n_A > 24) + { + gnav_almanac[i_alm_satellite_slot_number - 1].i_satellite_freq_channel = gnav_almanac[i_alm_satellite_slot_number - 1].d_H_n_A - 32.0; + } + gnav_almanac[i_alm_satellite_slot_number - 1].i_satellite_slot_number = gnav_almanac[i_alm_satellite_slot_number - 1].d_n_A; + gnav_almanac[i_alm_satellite_slot_number - 1].i_satellite_PRN = gnav_almanac[i_alm_satellite_slot_number - 1].d_n_A; - if (i_alm_satellite_slot_number == gnav_ephemeris.i_satellite_slot_number) - { - gnav_ephemeris.i_satellite_freq_channel = gnav_almanac[i_alm_satellite_slot_number - 1].i_satellite_freq_channel; - } - flag_almanac_str_7 = true; - } + if (i_alm_satellite_slot_number == gnav_ephemeris.i_satellite_slot_number) + { + gnav_ephemeris.i_satellite_freq_channel = gnav_almanac[i_alm_satellite_slot_number - 1].i_satellite_freq_channel; + } + flag_almanac_str_7 = true; + } - break; + break; - case 8: - // --- It is string 8 ---------------------------------------------- - i_alm_satellite_slot_number = static_cast(read_navigation_unsigned(string_bits, n_A)); - d_frame_ID = get_frame_number(i_alm_satellite_slot_number); - // Make sure a valid frame_ID or satellite slot number is returned - if(d_frame_ID == 0) - return 0; + case 8: + // --- It is string 8 ---------------------------------------------- + i_alm_satellite_slot_number = static_cast(read_navigation_unsigned(string_bits, n_A)); + d_frame_ID = get_frame_number(i_alm_satellite_slot_number); + // Make sure a valid frame_ID or satellite slot number is returned + if (d_frame_ID == 0) + return 0; - gnav_almanac[i_alm_satellite_slot_number - 1].d_C_n = static_cast(read_navigation_bool(string_bits, C_N)); - gnav_almanac[i_alm_satellite_slot_number - 1].d_M_n_A = static_cast(read_navigation_unsigned(string_bits, M_N_A)); - gnav_almanac[i_alm_satellite_slot_number - 1].d_n_A = static_cast(read_navigation_unsigned(string_bits, n_A)); - gnav_almanac[i_alm_satellite_slot_number - 1].d_tau_n_A = static_cast(read_navigation_unsigned(string_bits, TAU_N_A)) * TWO_N18; - gnav_almanac[i_alm_satellite_slot_number - 1].d_lambda_n_A = static_cast(read_navigation_signed(string_bits, LAMBDA_N_A)) * TWO_N20 * GLONASS_PI; - gnav_almanac[i_alm_satellite_slot_number - 1].d_Delta_i_n_A = static_cast(read_navigation_signed(string_bits, DELTA_I_N_A)) * TWO_N20 * GLONASS_PI; - gnav_almanac[i_alm_satellite_slot_number - 1].d_epsilon_n_A = static_cast(read_navigation_unsigned(string_bits, EPSILON_N_A)) * TWO_N20; + gnav_almanac[i_alm_satellite_slot_number - 1].d_C_n = static_cast(read_navigation_bool(string_bits, C_N)); + gnav_almanac[i_alm_satellite_slot_number - 1].d_M_n_A = static_cast(read_navigation_unsigned(string_bits, M_N_A)); + gnav_almanac[i_alm_satellite_slot_number - 1].d_n_A = static_cast(read_navigation_unsigned(string_bits, n_A)); + gnav_almanac[i_alm_satellite_slot_number - 1].d_tau_n_A = static_cast(read_navigation_unsigned(string_bits, TAU_N_A)) * TWO_N18; + gnav_almanac[i_alm_satellite_slot_number - 1].d_lambda_n_A = static_cast(read_navigation_signed(string_bits, LAMBDA_N_A)) * TWO_N20 * GLONASS_PI; + gnav_almanac[i_alm_satellite_slot_number - 1].d_Delta_i_n_A = static_cast(read_navigation_signed(string_bits, DELTA_I_N_A)) * TWO_N20 * GLONASS_PI; + gnav_almanac[i_alm_satellite_slot_number - 1].d_epsilon_n_A = static_cast(read_navigation_unsigned(string_bits, EPSILON_N_A)) * TWO_N20; - flag_almanac_str_8 = true; + flag_almanac_str_8 = true; - break; + break; - case 9: - // --- It is string 9 ---------------------------------------------- - if (flag_almanac_str_8 == true) - { - gnav_almanac[i_alm_satellite_slot_number - 1].d_omega_n_A = static_cast(read_navigation_signed(string_bits, OMEGA_N_A)) * TWO_N15 * GLONASS_PI; - gnav_almanac[i_alm_satellite_slot_number - 1].d_t_lambda_n_A = static_cast(read_navigation_unsigned(string_bits, T_LAMBDA_N_A)) * TWO_N5; - gnav_almanac[i_alm_satellite_slot_number - 1].d_Delta_T_n_A = static_cast(read_navigation_signed(string_bits, DELTA_T_N_A)) * TWO_N9; - gnav_almanac[i_alm_satellite_slot_number - 1].d_Delta_T_n_A_dot = static_cast(read_navigation_signed(string_bits, DELTA_T_DOT_N_A)) * TWO_N14; - gnav_almanac[i_alm_satellite_slot_number - 1].d_H_n_A = static_cast(read_navigation_unsigned(string_bits, H_N_A)); - gnav_almanac[i_alm_satellite_slot_number - 1].d_l_n = static_cast(read_navigation_bool(string_bits, ALM_L_N)); + case 9: + // --- It is string 9 ---------------------------------------------- + if (flag_almanac_str_8 == true) + { + gnav_almanac[i_alm_satellite_slot_number - 1].d_omega_n_A = static_cast(read_navigation_signed(string_bits, OMEGA_N_A)) * TWO_N15 * GLONASS_PI; + gnav_almanac[i_alm_satellite_slot_number - 1].d_t_lambda_n_A = static_cast(read_navigation_unsigned(string_bits, T_LAMBDA_N_A)) * TWO_N5; + gnav_almanac[i_alm_satellite_slot_number - 1].d_Delta_T_n_A = static_cast(read_navigation_signed(string_bits, DELTA_T_N_A)) * TWO_N9; + gnav_almanac[i_alm_satellite_slot_number - 1].d_Delta_T_n_A_dot = static_cast(read_navigation_signed(string_bits, DELTA_T_DOT_N_A)) * TWO_N14; + gnav_almanac[i_alm_satellite_slot_number - 1].d_H_n_A = static_cast(read_navigation_unsigned(string_bits, H_N_A)); + gnav_almanac[i_alm_satellite_slot_number - 1].d_l_n = static_cast(read_navigation_bool(string_bits, ALM_L_N)); - // Set satellite information for redundancy purposes - if (gnav_almanac[i_alm_satellite_slot_number - 1].d_H_n_A > 24) - { - gnav_almanac[i_alm_satellite_slot_number - 1].i_satellite_freq_channel = gnav_almanac[i_alm_satellite_slot_number - 1].d_H_n_A - 32.0; - } - gnav_almanac[i_alm_satellite_slot_number - 1].i_satellite_slot_number = gnav_almanac[i_alm_satellite_slot_number - 1].d_n_A; - gnav_almanac[i_alm_satellite_slot_number - 1].i_satellite_PRN = gnav_almanac[i_alm_satellite_slot_number - 1].d_n_A; + // Set satellite information for redundancy purposes + if (gnav_almanac[i_alm_satellite_slot_number - 1].d_H_n_A > 24) + { + gnav_almanac[i_alm_satellite_slot_number - 1].i_satellite_freq_channel = gnav_almanac[i_alm_satellite_slot_number - 1].d_H_n_A - 32.0; + } + gnav_almanac[i_alm_satellite_slot_number - 1].i_satellite_slot_number = gnav_almanac[i_alm_satellite_slot_number - 1].d_n_A; + gnav_almanac[i_alm_satellite_slot_number - 1].i_satellite_PRN = gnav_almanac[i_alm_satellite_slot_number - 1].d_n_A; - flag_almanac_str_9 = true; - } - break; + flag_almanac_str_9 = true; + } + break; - case 10: - // --- It is string 10 --------------------------------------------- - i_alm_satellite_slot_number = static_cast(read_navigation_unsigned(string_bits, n_A)); - d_frame_ID = get_frame_number(i_alm_satellite_slot_number); - // Make sure a valid frame_ID or satellite slot number is returned - if(d_frame_ID == 0) - return 0; + case 10: + // --- It is string 10 --------------------------------------------- + i_alm_satellite_slot_number = static_cast(read_navigation_unsigned(string_bits, n_A)); + d_frame_ID = get_frame_number(i_alm_satellite_slot_number); + // Make sure a valid frame_ID or satellite slot number is returned + if (d_frame_ID == 0) + return 0; - gnav_almanac[i_alm_satellite_slot_number - 1].d_C_n = static_cast(read_navigation_bool(string_bits, C_N)); - gnav_almanac[i_alm_satellite_slot_number - 1].d_M_n_A = static_cast(read_navigation_unsigned(string_bits, M_N_A)); - gnav_almanac[i_alm_satellite_slot_number - 1].d_n_A = static_cast(read_navigation_unsigned(string_bits, n_A)); - gnav_almanac[i_alm_satellite_slot_number - 1].d_tau_n_A = static_cast(read_navigation_unsigned(string_bits, TAU_N_A)) * TWO_N18; - gnav_almanac[i_alm_satellite_slot_number - 1].d_lambda_n_A = static_cast(read_navigation_signed(string_bits, LAMBDA_N_A)) * TWO_N20 * GLONASS_PI; - gnav_almanac[i_alm_satellite_slot_number - 1].d_Delta_i_n_A = static_cast(read_navigation_signed(string_bits, DELTA_I_N_A)) * TWO_N20 * GLONASS_PI; - gnav_almanac[i_alm_satellite_slot_number - 1].d_epsilon_n_A = static_cast(read_navigation_unsigned(string_bits, EPSILON_N_A)) * TWO_N20; + gnav_almanac[i_alm_satellite_slot_number - 1].d_C_n = static_cast(read_navigation_bool(string_bits, C_N)); + gnav_almanac[i_alm_satellite_slot_number - 1].d_M_n_A = static_cast(read_navigation_unsigned(string_bits, M_N_A)); + gnav_almanac[i_alm_satellite_slot_number - 1].d_n_A = static_cast(read_navigation_unsigned(string_bits, n_A)); + gnav_almanac[i_alm_satellite_slot_number - 1].d_tau_n_A = static_cast(read_navigation_unsigned(string_bits, TAU_N_A)) * TWO_N18; + gnav_almanac[i_alm_satellite_slot_number - 1].d_lambda_n_A = static_cast(read_navigation_signed(string_bits, LAMBDA_N_A)) * TWO_N20 * GLONASS_PI; + gnav_almanac[i_alm_satellite_slot_number - 1].d_Delta_i_n_A = static_cast(read_navigation_signed(string_bits, DELTA_I_N_A)) * TWO_N20 * GLONASS_PI; + gnav_almanac[i_alm_satellite_slot_number - 1].d_epsilon_n_A = static_cast(read_navigation_unsigned(string_bits, EPSILON_N_A)) * TWO_N20; - flag_almanac_str_10 = true; + flag_almanac_str_10 = true; - break; + break; - case 11: - // --- It is string 11 --------------------------------------------- - if (flag_almanac_str_10 == true) - { - gnav_almanac[i_alm_satellite_slot_number - 1].d_omega_n_A = static_cast(read_navigation_signed(string_bits, OMEGA_N_A)) * TWO_N15 * GLONASS_PI; - gnav_almanac[i_alm_satellite_slot_number - 1].d_t_lambda_n_A = static_cast(read_navigation_unsigned(string_bits, T_LAMBDA_N_A)) * TWO_N5; - gnav_almanac[i_alm_satellite_slot_number - 1].d_Delta_T_n_A = static_cast(read_navigation_signed(string_bits, DELTA_T_N_A)) * TWO_N9; - gnav_almanac[i_alm_satellite_slot_number - 1].d_Delta_T_n_A_dot = static_cast(read_navigation_signed(string_bits, DELTA_T_DOT_N_A)) * TWO_N14; - gnav_almanac[i_alm_satellite_slot_number - 1].d_H_n_A = static_cast(read_navigation_unsigned(string_bits, H_N_A)); - gnav_almanac[i_alm_satellite_slot_number - 1].d_l_n = static_cast(read_navigation_bool(string_bits, ALM_L_N)); + case 11: + // --- It is string 11 --------------------------------------------- + if (flag_almanac_str_10 == true) + { + gnav_almanac[i_alm_satellite_slot_number - 1].d_omega_n_A = static_cast(read_navigation_signed(string_bits, OMEGA_N_A)) * TWO_N15 * GLONASS_PI; + gnav_almanac[i_alm_satellite_slot_number - 1].d_t_lambda_n_A = static_cast(read_navigation_unsigned(string_bits, T_LAMBDA_N_A)) * TWO_N5; + gnav_almanac[i_alm_satellite_slot_number - 1].d_Delta_T_n_A = static_cast(read_navigation_signed(string_bits, DELTA_T_N_A)) * TWO_N9; + gnav_almanac[i_alm_satellite_slot_number - 1].d_Delta_T_n_A_dot = static_cast(read_navigation_signed(string_bits, DELTA_T_DOT_N_A)) * TWO_N14; + gnav_almanac[i_alm_satellite_slot_number - 1].d_H_n_A = static_cast(read_navigation_unsigned(string_bits, H_N_A)); + gnav_almanac[i_alm_satellite_slot_number - 1].d_l_n = static_cast(read_navigation_bool(string_bits, ALM_L_N)); - // Set satellite information for redundancy purposes - if (gnav_almanac[i_alm_satellite_slot_number - 1].d_H_n_A > 24) - { - gnav_almanac[i_alm_satellite_slot_number - 1].i_satellite_freq_channel = gnav_almanac[i_alm_satellite_slot_number - 1].d_H_n_A - 32.0; - } - gnav_almanac[i_alm_satellite_slot_number - 1].i_satellite_slot_number = gnav_almanac[i_alm_satellite_slot_number - 1].d_n_A; - gnav_almanac[i_alm_satellite_slot_number - 1].i_satellite_PRN = gnav_almanac[i_alm_satellite_slot_number - 1].d_n_A; + // Set satellite information for redundancy purposes + if (gnav_almanac[i_alm_satellite_slot_number - 1].d_H_n_A > 24) + { + gnav_almanac[i_alm_satellite_slot_number - 1].i_satellite_freq_channel = gnav_almanac[i_alm_satellite_slot_number - 1].d_H_n_A - 32.0; + } + gnav_almanac[i_alm_satellite_slot_number - 1].i_satellite_slot_number = gnav_almanac[i_alm_satellite_slot_number - 1].d_n_A; + gnav_almanac[i_alm_satellite_slot_number - 1].i_satellite_PRN = gnav_almanac[i_alm_satellite_slot_number - 1].d_n_A; - flag_almanac_str_11 = true; - } - break; + flag_almanac_str_11 = true; + } + break; - case 12: - // --- It is string 12 --------------------------------------------- - i_alm_satellite_slot_number = static_cast(read_navigation_unsigned(string_bits, n_A)); - d_frame_ID = get_frame_number(i_alm_satellite_slot_number); - // Make sure a valid frame_ID or satellite slot number is returned - if(d_frame_ID == 0) - return 0; - gnav_almanac[i_alm_satellite_slot_number - 1].d_C_n = static_cast(read_navigation_bool(string_bits, C_N)); - gnav_almanac[i_alm_satellite_slot_number - 1].d_M_n_A = static_cast(read_navigation_unsigned(string_bits, M_N_A)); - gnav_almanac[i_alm_satellite_slot_number - 1].d_n_A = static_cast(read_navigation_unsigned(string_bits, n_A)); - gnav_almanac[i_alm_satellite_slot_number - 1].d_tau_n_A = static_cast(read_navigation_unsigned(string_bits, TAU_N_A)) * TWO_N18; - gnav_almanac[i_alm_satellite_slot_number - 1].d_lambda_n_A = static_cast(read_navigation_signed(string_bits, LAMBDA_N_A)) * TWO_N20 * GLONASS_PI; - gnav_almanac[i_alm_satellite_slot_number - 1].d_Delta_i_n_A = static_cast(read_navigation_signed(string_bits, DELTA_I_N_A)) * TWO_N20 * GLONASS_PI; - gnav_almanac[i_alm_satellite_slot_number - 1].d_epsilon_n_A = static_cast(read_navigation_unsigned(string_bits, EPSILON_N_A)) * TWO_N20; + case 12: + // --- It is string 12 --------------------------------------------- + i_alm_satellite_slot_number = static_cast(read_navigation_unsigned(string_bits, n_A)); + d_frame_ID = get_frame_number(i_alm_satellite_slot_number); + // Make sure a valid frame_ID or satellite slot number is returned + if (d_frame_ID == 0) + return 0; + gnav_almanac[i_alm_satellite_slot_number - 1].d_C_n = static_cast(read_navigation_bool(string_bits, C_N)); + gnav_almanac[i_alm_satellite_slot_number - 1].d_M_n_A = static_cast(read_navigation_unsigned(string_bits, M_N_A)); + gnav_almanac[i_alm_satellite_slot_number - 1].d_n_A = static_cast(read_navigation_unsigned(string_bits, n_A)); + gnav_almanac[i_alm_satellite_slot_number - 1].d_tau_n_A = static_cast(read_navigation_unsigned(string_bits, TAU_N_A)) * TWO_N18; + gnav_almanac[i_alm_satellite_slot_number - 1].d_lambda_n_A = static_cast(read_navigation_signed(string_bits, LAMBDA_N_A)) * TWO_N20 * GLONASS_PI; + gnav_almanac[i_alm_satellite_slot_number - 1].d_Delta_i_n_A = static_cast(read_navigation_signed(string_bits, DELTA_I_N_A)) * TWO_N20 * GLONASS_PI; + gnav_almanac[i_alm_satellite_slot_number - 1].d_epsilon_n_A = static_cast(read_navigation_unsigned(string_bits, EPSILON_N_A)) * TWO_N20; - flag_almanac_str_12 = true; + flag_almanac_str_12 = true; - break; + break; - case 13: - // --- It is string 13 --------------------------------------------- - if (flag_almanac_str_12 == true) - { - gnav_almanac[i_alm_satellite_slot_number - 1].d_omega_n_A = static_cast(read_navigation_signed(string_bits, OMEGA_N_A)) * TWO_N15 * GLONASS_PI; - gnav_almanac[i_alm_satellite_slot_number - 1].d_t_lambda_n_A = static_cast(read_navigation_unsigned(string_bits, T_LAMBDA_N_A)) * TWO_N5; - gnav_almanac[i_alm_satellite_slot_number - 1].d_Delta_T_n_A = static_cast(read_navigation_signed(string_bits, DELTA_T_N_A)) * TWO_N9; - gnav_almanac[i_alm_satellite_slot_number - 1].d_Delta_T_n_A_dot = static_cast(read_navigation_signed(string_bits, DELTA_T_DOT_N_A)) * TWO_N14; - gnav_almanac[i_alm_satellite_slot_number - 1].d_H_n_A = static_cast(read_navigation_unsigned(string_bits, H_N_A)); - gnav_almanac[i_alm_satellite_slot_number - 1].d_l_n = static_cast(read_navigation_bool(string_bits, ALM_L_N)); + case 13: + // --- It is string 13 --------------------------------------------- + if (flag_almanac_str_12 == true) + { + gnav_almanac[i_alm_satellite_slot_number - 1].d_omega_n_A = static_cast(read_navigation_signed(string_bits, OMEGA_N_A)) * TWO_N15 * GLONASS_PI; + gnav_almanac[i_alm_satellite_slot_number - 1].d_t_lambda_n_A = static_cast(read_navigation_unsigned(string_bits, T_LAMBDA_N_A)) * TWO_N5; + gnav_almanac[i_alm_satellite_slot_number - 1].d_Delta_T_n_A = static_cast(read_navigation_signed(string_bits, DELTA_T_N_A)) * TWO_N9; + gnav_almanac[i_alm_satellite_slot_number - 1].d_Delta_T_n_A_dot = static_cast(read_navigation_signed(string_bits, DELTA_T_DOT_N_A)) * TWO_N14; + gnav_almanac[i_alm_satellite_slot_number - 1].d_H_n_A = static_cast(read_navigation_unsigned(string_bits, H_N_A)); + gnav_almanac[i_alm_satellite_slot_number - 1].d_l_n = static_cast(read_navigation_bool(string_bits, ALM_L_N)); - // Set satellite information for redundancy purposes - if (gnav_almanac[i_alm_satellite_slot_number - 1].d_H_n_A > 24) - { - gnav_almanac[i_alm_satellite_slot_number - 1].i_satellite_freq_channel = gnav_almanac[i_alm_satellite_slot_number - 1].d_H_n_A - 32.0; - } - gnav_almanac[i_alm_satellite_slot_number - 1].i_satellite_slot_number = gnav_almanac[i_alm_satellite_slot_number - 1].d_n_A; - gnav_almanac[i_alm_satellite_slot_number - 1].i_satellite_PRN = gnav_almanac[i_alm_satellite_slot_number - 1].d_n_A; + // Set satellite information for redundancy purposes + if (gnav_almanac[i_alm_satellite_slot_number - 1].d_H_n_A > 24) + { + gnav_almanac[i_alm_satellite_slot_number - 1].i_satellite_freq_channel = gnav_almanac[i_alm_satellite_slot_number - 1].d_H_n_A - 32.0; + } + gnav_almanac[i_alm_satellite_slot_number - 1].i_satellite_slot_number = gnav_almanac[i_alm_satellite_slot_number - 1].d_n_A; + gnav_almanac[i_alm_satellite_slot_number - 1].i_satellite_PRN = gnav_almanac[i_alm_satellite_slot_number - 1].d_n_A; - flag_almanac_str_13 = true; - } - break; + flag_almanac_str_13 = true; + } + break; - case 14: - // --- It is string 14 --------------------------------------------- - if (d_frame_ID == 5) - { - gnav_utc_model.d_B1 = static_cast(read_navigation_unsigned(string_bits, B1)); - gnav_utc_model.d_B2 = static_cast(read_navigation_unsigned(string_bits, B2)); - } - else - { - i_alm_satellite_slot_number = static_cast(read_navigation_unsigned(string_bits, n_A)); - d_frame_ID = get_frame_number(i_alm_satellite_slot_number); - // Make sure a valid frame_ID or satellite slot number is returned - if(d_frame_ID == 0) - return 0; - gnav_almanac[i_alm_satellite_slot_number - 1].d_C_n = static_cast(read_navigation_bool(string_bits, C_N)); - gnav_almanac[i_alm_satellite_slot_number - 1].d_M_n_A = static_cast(read_navigation_unsigned(string_bits, M_N_A)); - gnav_almanac[i_alm_satellite_slot_number - 1].d_n_A = static_cast(read_navigation_unsigned(string_bits, n_A)); - gnav_almanac[i_alm_satellite_slot_number - 1].d_tau_n_A = static_cast(read_navigation_unsigned(string_bits, TAU_N_A)) * TWO_N18; - gnav_almanac[i_alm_satellite_slot_number - 1].d_lambda_n_A = static_cast(read_navigation_signed(string_bits, LAMBDA_N_A)) * TWO_N20 * GLONASS_PI; - gnav_almanac[i_alm_satellite_slot_number - 1].d_Delta_i_n_A = static_cast(read_navigation_signed(string_bits, DELTA_I_N_A)) * TWO_N20 * GLONASS_PI; - gnav_almanac[i_alm_satellite_slot_number - 1].d_epsilon_n_A = static_cast(read_navigation_unsigned(string_bits, EPSILON_N_A)) * TWO_N20; + case 14: + // --- It is string 14 --------------------------------------------- + if (d_frame_ID == 5) + { + gnav_utc_model.d_B1 = static_cast(read_navigation_unsigned(string_bits, B1)); + gnav_utc_model.d_B2 = static_cast(read_navigation_unsigned(string_bits, B2)); + } + else + { + i_alm_satellite_slot_number = static_cast(read_navigation_unsigned(string_bits, n_A)); + d_frame_ID = get_frame_number(i_alm_satellite_slot_number); + // Make sure a valid frame_ID or satellite slot number is returned + if (d_frame_ID == 0) + return 0; + gnav_almanac[i_alm_satellite_slot_number - 1].d_C_n = static_cast(read_navigation_bool(string_bits, C_N)); + gnav_almanac[i_alm_satellite_slot_number - 1].d_M_n_A = static_cast(read_navigation_unsigned(string_bits, M_N_A)); + gnav_almanac[i_alm_satellite_slot_number - 1].d_n_A = static_cast(read_navigation_unsigned(string_bits, n_A)); + gnav_almanac[i_alm_satellite_slot_number - 1].d_tau_n_A = static_cast(read_navigation_unsigned(string_bits, TAU_N_A)) * TWO_N18; + gnav_almanac[i_alm_satellite_slot_number - 1].d_lambda_n_A = static_cast(read_navigation_signed(string_bits, LAMBDA_N_A)) * TWO_N20 * GLONASS_PI; + gnav_almanac[i_alm_satellite_slot_number - 1].d_Delta_i_n_A = static_cast(read_navigation_signed(string_bits, DELTA_I_N_A)) * TWO_N20 * GLONASS_PI; + gnav_almanac[i_alm_satellite_slot_number - 1].d_epsilon_n_A = static_cast(read_navigation_unsigned(string_bits, EPSILON_N_A)) * TWO_N20; - flag_almanac_str_14 = true; - } - break; + flag_almanac_str_14 = true; + } + break; - case 15: - // --- It is string 15 ---------------------------------------------- - if (d_frame_ID != 5 and flag_almanac_str_14 == true) { - gnav_almanac[i_alm_satellite_slot_number - 1].d_omega_n_A = static_cast(read_navigation_signed(string_bits, OMEGA_N_A)) * TWO_N15 * GLONASS_PI; - gnav_almanac[i_alm_satellite_slot_number - 1].d_t_lambda_n_A = static_cast(read_navigation_unsigned(string_bits, T_LAMBDA_N_A)) * TWO_N5; - gnav_almanac[i_alm_satellite_slot_number - 1].d_Delta_T_n_A = static_cast(read_navigation_signed(string_bits, DELTA_T_N_A)) * TWO_N9; - gnav_almanac[i_alm_satellite_slot_number - 1].d_Delta_T_n_A_dot = static_cast(read_navigation_signed(string_bits, DELTA_T_DOT_N_A)) * TWO_N14; - gnav_almanac[i_alm_satellite_slot_number - 1].d_H_n_A = static_cast(read_navigation_unsigned(string_bits, H_N_A)); - gnav_almanac[i_alm_satellite_slot_number - 1].d_l_n = static_cast(read_navigation_bool(string_bits, ALM_L_N)); + case 15: + // --- It is string 15 ---------------------------------------------- + if (d_frame_ID != 5 and flag_almanac_str_14 == true) + { + gnav_almanac[i_alm_satellite_slot_number - 1].d_omega_n_A = static_cast(read_navigation_signed(string_bits, OMEGA_N_A)) * TWO_N15 * GLONASS_PI; + gnav_almanac[i_alm_satellite_slot_number - 1].d_t_lambda_n_A = static_cast(read_navigation_unsigned(string_bits, T_LAMBDA_N_A)) * TWO_N5; + gnav_almanac[i_alm_satellite_slot_number - 1].d_Delta_T_n_A = static_cast(read_navigation_signed(string_bits, DELTA_T_N_A)) * TWO_N9; + gnav_almanac[i_alm_satellite_slot_number - 1].d_Delta_T_n_A_dot = static_cast(read_navigation_signed(string_bits, DELTA_T_DOT_N_A)) * TWO_N14; + gnav_almanac[i_alm_satellite_slot_number - 1].d_H_n_A = static_cast(read_navigation_unsigned(string_bits, H_N_A)); + gnav_almanac[i_alm_satellite_slot_number - 1].d_l_n = static_cast(read_navigation_bool(string_bits, ALM_L_N)); - // Set satellite information for redundancy purposes - if (gnav_almanac[i_alm_satellite_slot_number - 1].d_H_n_A > 24) - { - gnav_almanac[i_alm_satellite_slot_number - 1].i_satellite_freq_channel = gnav_almanac[i_alm_satellite_slot_number - 1].d_H_n_A - 32.0; - } - gnav_almanac[i_alm_satellite_slot_number - 1].i_satellite_slot_number = gnav_almanac[i_alm_satellite_slot_number - 1].d_n_A; - gnav_almanac[i_alm_satellite_slot_number - 1].i_satellite_PRN = gnav_almanac[i_alm_satellite_slot_number - 1].d_n_A; + // Set satellite information for redundancy purposes + if (gnav_almanac[i_alm_satellite_slot_number - 1].d_H_n_A > 24) + { + gnav_almanac[i_alm_satellite_slot_number - 1].i_satellite_freq_channel = gnav_almanac[i_alm_satellite_slot_number - 1].d_H_n_A - 32.0; + } + gnav_almanac[i_alm_satellite_slot_number - 1].i_satellite_slot_number = gnav_almanac[i_alm_satellite_slot_number - 1].d_n_A; + gnav_almanac[i_alm_satellite_slot_number - 1].i_satellite_PRN = gnav_almanac[i_alm_satellite_slot_number - 1].d_n_A; - flag_almanac_str_15 = true; - } - break; - default: - LOG(INFO) << "GLONASS GNAV: Invalid String ID of received. Received " << d_string_ID - << ", but acceptable range is from 1-15"; + flag_almanac_str_15 = true; + } + break; + default: + LOG(INFO) << "GLONASS GNAV: Invalid String ID of received. Received " << d_string_ID + << ", but acceptable range is from 1-15"; - break; - } // switch string ID + break; + } // switch string ID return d_string_ID; } @@ -699,20 +700,20 @@ Glonass_Gnav_Almanac Glonass_Gnav_Navigation_Message::get_almanac(unsigned int s } -bool Glonass_Gnav_Navigation_Message::have_new_ephemeris() //Check if we have a new ephemeris stored in the galileo navigation class +bool Glonass_Gnav_Navigation_Message::have_new_ephemeris() //Check if we have a new ephemeris stored in the galileo navigation class { bool new_eph = false; // We need to make sure we have received the ephemeris info plus the time info if ((flag_ephemeris_str_1 == true) and (flag_ephemeris_str_2 == true) and - (flag_ephemeris_str_3 == true) and (flag_ephemeris_str_4 == true) and - (flag_utc_model_str_5 == true)) + (flag_ephemeris_str_3 == true) and (flag_ephemeris_str_4 == true) and + (flag_utc_model_str_5 == true)) { - if(d_previous_tb != gnav_ephemeris.d_t_b) + if (d_previous_tb != gnav_ephemeris.d_t_b) { - flag_ephemeris_str_1 = false;// clear the flag - flag_ephemeris_str_2 = false;// clear the flag - flag_ephemeris_str_3 = false;// clear the flag - flag_ephemeris_str_4 = false;// clear the flag + flag_ephemeris_str_1 = false; // clear the flag + flag_ephemeris_str_2 = false; // clear the flag + flag_ephemeris_str_3 = false; // clear the flag + flag_ephemeris_str_4 = false; // clear the flag flag_all_ephemeris = true; // Update the time of ephemeris information d_previous_tb = gnav_ephemeris.d_t_b; @@ -725,11 +726,11 @@ bool Glonass_Gnav_Navigation_Message::have_new_ephemeris() //Check if we have a } -bool Glonass_Gnav_Navigation_Message::have_new_utc_model() // Check if we have a new utc data set stored in the galileo navigation class +bool Glonass_Gnav_Navigation_Message::have_new_utc_model() // Check if we have a new utc data set stored in the galileo navigation class { if (flag_utc_model_str_5 == true) { - flag_utc_model_str_5 = false; // clear the flag + flag_utc_model_str_5 = false; // clear the flag return true; } else @@ -737,7 +738,7 @@ bool Glonass_Gnav_Navigation_Message::have_new_utc_model() // Check if we have a } -bool Glonass_Gnav_Navigation_Message::have_new_almanac() //Check if we have a new almanac data set stored in the galileo navigation class +bool Glonass_Gnav_Navigation_Message::have_new_almanac() //Check if we have a new almanac data set stored in the galileo navigation class { bool new_alm = false; if ((flag_almanac_str_6 == true) and (flag_almanac_str_7 == true)) @@ -759,7 +760,7 @@ bool Glonass_Gnav_Navigation_Message::have_new_almanac() //Check if we have a ne new_alm = true; } } - if((flag_almanac_str_10 == true) and (flag_almanac_str_11 == true)) + if ((flag_almanac_str_10 == true) and (flag_almanac_str_11 == true)) { if (d_previous_Na[i_alm_satellite_slot_number] != gnav_utc_model.d_N_A) { @@ -768,7 +769,7 @@ bool Glonass_Gnav_Navigation_Message::have_new_almanac() //Check if we have a ne new_alm = true; } } - if((flag_almanac_str_12 == true) and (flag_almanac_str_13 == true)) + if ((flag_almanac_str_12 == true) and (flag_almanac_str_13 == true)) { if (d_previous_Na[i_alm_satellite_slot_number] != gnav_utc_model.d_N_A) { @@ -777,7 +778,7 @@ bool Glonass_Gnav_Navigation_Message::have_new_almanac() //Check if we have a ne new_alm = true; } } - if((flag_almanac_str_14 == true) and (flag_almanac_str_15 == true)) + if ((flag_almanac_str_14 == true) and (flag_almanac_str_15 == true)) { if (d_previous_Na[i_alm_satellite_slot_number] != gnav_utc_model.d_N_A) { diff --git a/src/core/system_parameters/glonass_gnav_navigation_message.h b/src/core/system_parameters/glonass_gnav_navigation_message.h index dda433983..1a932786b 100644 --- a/src/core/system_parameters/glonass_gnav_navigation_message.h +++ b/src/core/system_parameters/glonass_gnav_navigation_message.h @@ -50,9 +50,9 @@ class Glonass_Gnav_Navigation_Message { private: - unsigned long int read_navigation_unsigned(std::bitset bits, const std::vector> parameter); - signed long int read_navigation_signed(std::bitset bits, const std::vector> parameter); - bool read_navigation_bool(std::bitset bits, const std::vector> parameter); + unsigned long int read_navigation_unsigned(std::bitset bits, const std::vector> parameter); + signed long int read_navigation_signed(std::bitset bits, const std::vector> parameter); + bool read_navigation_bool(std::bitset bits, const std::vector> parameter); public: bool flag_CRC_test; @@ -63,45 +63,45 @@ public: int i_channel_ID; unsigned int i_satellite_PRN; - Glonass_Gnav_Ephemeris gnav_ephemeris; //!< Ephemeris information decoded - Glonass_Gnav_Utc_Model gnav_utc_model; //!< UTC model information + Glonass_Gnav_Ephemeris gnav_ephemeris; //!< Ephemeris information decoded + Glonass_Gnav_Utc_Model gnav_utc_model; //!< UTC model information Glonass_Gnav_Almanac gnav_almanac[GLONASS_L1_CA_NBR_SATS]; //!< Almanac information for all 24 satellites // Ephemeris Flags and control variables - bool flag_all_ephemeris; //!< Flag indicating that all strings containing ephemeris have been received - bool flag_ephemeris_str_1; //!< Flag indicating that ephemeris 1/4 (string 1) have been received - bool flag_ephemeris_str_2; //!< Flag indicating that ephemeris 2/4 (string 2) have been received - bool flag_ephemeris_str_3; //!< Flag indicating that ephemeris 3/4 (string 3) have been received - bool flag_ephemeris_str_4; //!< Flag indicating that ephemeris 4/4 (string 4) have been received + bool flag_all_ephemeris; //!< Flag indicating that all strings containing ephemeris have been received + bool flag_ephemeris_str_1; //!< Flag indicating that ephemeris 1/4 (string 1) have been received + bool flag_ephemeris_str_2; //!< Flag indicating that ephemeris 2/4 (string 2) have been received + bool flag_ephemeris_str_3; //!< Flag indicating that ephemeris 3/4 (string 3) have been received + bool flag_ephemeris_str_4; //!< Flag indicating that ephemeris 4/4 (string 4) have been received // Almanac Flags - bool flag_all_almanac; //!< Flag indicating that all almanac have been received - bool flag_almanac_str_6; //!< Flag indicating that almanac of string 6 have been received - bool flag_almanac_str_7; //!< Flag indicating that almanac of string 7 have been received - bool flag_almanac_str_8; //!< Flag indicating that almanac of string 8 have been received - bool flag_almanac_str_9; //!< Flag indicating that almanac of string 9 have been received - bool flag_almanac_str_10; //!< Flag indicating that almanac of string 10 have been received - bool flag_almanac_str_11; //!< Flag indicating that almanac of string 11 have been received - bool flag_almanac_str_12; //!< Flag indicating that almanac of string 12 have been received - bool flag_almanac_str_13; //!< Flag indicating that almanac of string 13 have been received - bool flag_almanac_str_14; //!< Flag indicating that almanac of string 14 have been received - bool flag_almanac_str_15; //!< Flag indicating that almanac of string 15 have been received - unsigned int i_alm_satellite_slot_number; //!< SV Orbit Slot Number + bool flag_all_almanac; //!< Flag indicating that all almanac have been received + bool flag_almanac_str_6; //!< Flag indicating that almanac of string 6 have been received + bool flag_almanac_str_7; //!< Flag indicating that almanac of string 7 have been received + bool flag_almanac_str_8; //!< Flag indicating that almanac of string 8 have been received + bool flag_almanac_str_9; //!< Flag indicating that almanac of string 9 have been received + bool flag_almanac_str_10; //!< Flag indicating that almanac of string 10 have been received + bool flag_almanac_str_11; //!< Flag indicating that almanac of string 11 have been received + bool flag_almanac_str_12; //!< Flag indicating that almanac of string 12 have been received + bool flag_almanac_str_13; //!< Flag indicating that almanac of string 13 have been received + bool flag_almanac_str_14; //!< Flag indicating that almanac of string 14 have been received + bool flag_almanac_str_15; //!< Flag indicating that almanac of string 15 have been received + unsigned int i_alm_satellite_slot_number; //!< SV Orbit Slot Number // UTC and System Clocks Flags - bool flag_utc_model_valid; //!< If set, it indicates that the UTC model parameters are filled - bool flag_utc_model_str_5; //!< Clock info send in string 5 of navigation data - bool flag_utc_model_str_15; //!< Clock info send in string 15 of frame 5 of navigation data + bool flag_utc_model_valid; //!< If set, it indicates that the UTC model parameters are filled + bool flag_utc_model_str_5; //!< Clock info send in string 5 of navigation data + bool flag_utc_model_str_15; //!< Clock info send in string 15 of frame 5 of navigation data - bool flag_TOW_set; //!< Flag indicating when the TOW has been set - bool flag_TOW_new; //!< Flag indicating when a new TOW has been computed + bool flag_TOW_set; //!< Flag indicating when the TOW has been set + bool flag_TOW_new; //!< Flag indicating when a new TOW has been computed - double d_satClkCorr; //!< Satellite clock error - double d_dtr; //!< Relativistic clock correction term - double d_satClkDrift; //!< Satellite clock drift + double d_satClkCorr; //!< Satellite clock error + double d_dtr; //!< Relativistic clock correction term + double d_satClkDrift; //!< Satellite clock drift - double d_previous_tb; //!< Previous iode for the Glonass_Gnav_Ephemeris object. Used to determine when new data arrives - double d_previous_Na[GLONASS_L1_CA_NBR_SATS]; //!< Previous time for almanac of the Glonass_Gnav_Almanac object + double d_previous_tb; //!< Previous iode for the Glonass_Gnav_Ephemeris object. Used to determine when new data arrives + double d_previous_Na[GLONASS_L1_CA_NBR_SATS]; //!< Previous time for almanac of the Glonass_Gnav_Almanac object /*! * \brief Compute CRC for GLONASS GNAV strings diff --git a/src/core/system_parameters/glonass_gnav_utc_model.cc b/src/core/system_parameters/glonass_gnav_utc_model.cc index 2dc7fd2b9..537c3227b 100644 --- a/src/core/system_parameters/glonass_gnav_utc_model.cc +++ b/src/core/system_parameters/glonass_gnav_utc_model.cc @@ -49,7 +49,7 @@ double Glonass_Gnav_Utc_Model::utc_time(double glonass_time_corrected) double t_utc; // GLONASS Time is relative to UTC Moscow, so we simply add its time difference - t_utc = glonass_time_corrected + 3*3600 + d_tau_c; + t_utc = glonass_time_corrected + 3 * 3600 + d_tau_c; return t_utc; } diff --git a/src/core/system_parameters/glonass_gnav_utc_model.h b/src/core/system_parameters/glonass_gnav_utc_model.h index 9712299a9..d4d86a812 100644 --- a/src/core/system_parameters/glonass_gnav_utc_model.h +++ b/src/core/system_parameters/glonass_gnav_utc_model.h @@ -47,28 +47,30 @@ class Glonass_Gnav_Utc_Model public: bool valid; // Clock Parameters - double d_tau_c; //!< GLONASS time scale correction to UTC(SU) time. [s] - double d_tau_gps; //!< Correction to GPS time to GLONASS time [day] - double d_N_4; //!< Four year interval number starting from 1996 [4 year interval] - double d_N_A; //!< Calendar day number within the four-year period beginning since the leap year for Almanac data [days] - double d_B1; //!< Coefficient to determine DeltaUT1 [s] - double d_B2; //!< Coefficient to determine DeltaUT1 [s/msd] + double d_tau_c; //!< GLONASS time scale correction to UTC(SU) time. [s] + double d_tau_gps; //!< Correction to GPS time to GLONASS time [day] + double d_N_4; //!< Four year interval number starting from 1996 [4 year interval] + double d_N_A; //!< Calendar day number within the four-year period beginning since the leap year for Almanac data [days] + double d_B1; //!< Coefficient to determine DeltaUT1 [s] + double d_B2; //!< Coefficient to determine DeltaUT1 [s/msd] - template + template /*! * \brief Serialize is a boost standard method to be called by the boost XML serialization. Here is used to save the almanac data on disk file. */ void serialize(Archive& archive, const unsigned int version) { using boost::serialization::make_nvp; - if(version){}; - archive & make_nvp("valid",valid); - archive & make_nvp("d_tau_c", d_tau_c); - archive & make_nvp("d_tau_gps", d_tau_gps); - archive & make_nvp("d_N_4", d_N_4); - archive & make_nvp("d_N_A", d_N_A); - archive & make_nvp("d_B1", d_B1); - archive & make_nvp("d_B2", d_B2); + if (version) + { + }; + archive& make_nvp("valid", valid); + archive& make_nvp("d_tau_c", d_tau_c); + archive& make_nvp("d_tau_gps", d_tau_gps); + archive& make_nvp("d_N_4", d_N_4); + archive& make_nvp("d_N_A", d_N_A); + archive& make_nvp("d_B1", d_B1); + archive& make_nvp("d_B2", d_B2); } /*! @@ -81,7 +83,6 @@ public: * returns it in [s] (GLONASS ICD (Edition 5.1) Section 3.3.3 GLONASS Time) */ double utc_time(double glonass_time_corrected); - }; #endif diff --git a/src/core/system_parameters/gnss_frequencies.h b/src/core/system_parameters/gnss_frequencies.h index bd85aa414..52487ef64 100644 --- a/src/core/system_parameters/gnss_frequencies.h +++ b/src/core/system_parameters/gnss_frequencies.h @@ -33,21 +33,20 @@ #ifndef GNSS_SDR_GNSS_FREQUENCIES_H_ #define GNSS_SDR_GNSS_FREQUENCIES_H_ -const double FREQ1 = 1.57542e9; //!< L1/E1 frequency (Hz) -const double FREQ2 = 1.22760e9; //!< L2 frequency (Hz) -const double FREQ5 = 1.17645e9; //!< L5/E5a frequency (Hz) -const double FREQ6 = 1.27875e9; //!< E6/LEX frequency (Hz) -const double FREQ7 = 1.20714e9; //!< E5b frequency (Hz) -const double FREQ8 = 1.191795e9; //!< E5a+b frequency (Hz) -const double FREQ9 = 2.492028e9; //!< S frequency (Hz) -const double FREQ1_GLO = 1.60200e9; //!< GLONASS G1 base frequency (Hz) -const double DFRQ1_GLO = 0.56250e6; //!< GLONASS G1 bias frequency (Hz/n) -const double FREQ2_GLO = 1.24600e9; //!< GLONASS G2 base frequency (Hz) -const double DFRQ2_GLO = 0.43750e6; //!< GLONASS G2 bias frequency (Hz/n) -const double FREQ3_GLO = 1.202025e9; //!< GLONASS G3 frequency (Hz) -const double FREQ1_BDS = 1.561098e9; //!< BeiDou B1 frequency (Hz) -const double FREQ2_BDS = 1.20714e9; //!< BeiDou B2 frequency (Hz) -const double FREQ3_BDS = 1.26852e9; //!< BeiDou B3 frequency (Hz) +const double FREQ1 = 1.57542e9; //!< L1/E1 frequency (Hz) +const double FREQ2 = 1.22760e9; //!< L2 frequency (Hz) +const double FREQ5 = 1.17645e9; //!< L5/E5a frequency (Hz) +const double FREQ6 = 1.27875e9; //!< E6/LEX frequency (Hz) +const double FREQ7 = 1.20714e9; //!< E5b frequency (Hz) +const double FREQ8 = 1.191795e9; //!< E5a+b frequency (Hz) +const double FREQ9 = 2.492028e9; //!< S frequency (Hz) +const double FREQ1_GLO = 1.60200e9; //!< GLONASS G1 base frequency (Hz) +const double DFRQ1_GLO = 0.56250e6; //!< GLONASS G1 bias frequency (Hz/n) +const double FREQ2_GLO = 1.24600e9; //!< GLONASS G2 base frequency (Hz) +const double DFRQ2_GLO = 0.43750e6; //!< GLONASS G2 bias frequency (Hz/n) +const double FREQ3_GLO = 1.202025e9; //!< GLONASS G3 frequency (Hz) +const double FREQ1_BDS = 1.561098e9; //!< BeiDou B1 frequency (Hz) +const double FREQ2_BDS = 1.20714e9; //!< BeiDou B2 frequency (Hz) +const double FREQ3_BDS = 1.26852e9; //!< BeiDou B3 frequency (Hz) #endif - diff --git a/src/core/system_parameters/gnss_obs_codes.h b/src/core/system_parameters/gnss_obs_codes.h index a8bbe3bf1..fd3f936ee 100644 --- a/src/core/system_parameters/gnss_obs_codes.h +++ b/src/core/system_parameters/gnss_obs_codes.h @@ -34,64 +34,63 @@ #define GNSS_SDR_GNSS_OBS_CODES_H_ - -const unsigned int CODE_NONE = 0; //!< obs code: none or unknown -const unsigned int CODE_L1C = 1; //!< obs code: L1C/A,G1C/A,E1C (GPS,GLO,GAL,QZS,SBS) -const unsigned int CODE_L1P = 2; //!< obs code: L1P,G1P (GPS,GLO) -const unsigned int CODE_L1W = 3; //!< obs code: L1 Z-track (GPS) -const unsigned int CODE_L1Y = 4; //!< obs code: L1Y (GPS) -const unsigned int CODE_L1M = 5; //!< obs code: L1M (GPS) -const unsigned int CODE_L1N = 6; //!< obs code: L1codeless (GPS) -const unsigned int CODE_L1S = 7; //!< obs code: L1C(D) (GPS,QZS) -const unsigned int CODE_L1L = 8; //!< obs code: L1C(P) (GPS,QZS) -const unsigned int CODE_L1E = 9; //!< (not used) -const unsigned int CODE_L1A = 10; //!< obs code: E1A (GAL) -const unsigned int CODE_L1B = 11; //!< obs code: E1B (GAL) -const unsigned int CODE_L1X = 12; //!< obs code: E1B+C,L1C(D+P) (GAL,QZS) -const unsigned int CODE_L1Z = 13; //!< obs code: E1A+B+C,L1SAIF (GAL,QZS) -const unsigned int CODE_L2C = 14; //!< obs code: L2C/A,G1C/A (GPS,GLO) -const unsigned int CODE_L2D = 15; //!< obs code: L2 L1C/A-(P2-P1) (GPS) -const unsigned int CODE_L2S = 16; //!< obs code: L2C(M) (GPS,QZS) -const unsigned int CODE_L2L = 17; //!< obs code: L2C(L) (GPS,QZS) -const unsigned int CODE_L2X = 18; //!< obs code: L2C(M+L),B1I+Q (GPS,QZS,BDS) -const unsigned int CODE_L2P = 19; //!< obs code: L2P,G2P (GPS,GLO) -const unsigned int CODE_L2W = 20; //!< obs code: L2 Z-track (GPS) -const unsigned int CODE_L2Y = 21; //!< obs code: L2Y (GPS) -const unsigned int CODE_L2M = 22; //!< obs code: L2M (GPS) -const unsigned int CODE_L2N = 23; //!< obs code: L2codeless (GPS) -const unsigned int CODE_L5I = 24; //!< obs code: L5/E5aI (GPS,GAL,QZS,SBS) -const unsigned int CODE_L5Q = 25; //!< obs code: L5/E5aQ (GPS,GAL,QZS,SBS) -const unsigned int CODE_L5X = 26; //!< obs code: L5/E5aI+Q/L5B+C (GPS,GAL,QZS,IRN,SBS) -const unsigned int CODE_L7I = 27; //!< obs code: E5bI,B2I (GAL,BDS) -const unsigned int CODE_L7Q = 28; //!< obs code: E5bQ,B2Q (GAL,BDS) -const unsigned int CODE_L7X = 29; //!< obs code: E5bI+Q,B2I+Q (GAL,BDS) -const unsigned int CODE_L6A = 30; //!< obs code: E6A (GAL) -const unsigned int CODE_L6B = 31; //!< obs code: E6B (GAL) -const unsigned int CODE_L6C = 32; //!< obs code: E6C (GAL) -const unsigned int CODE_L6X = 33; //!< obs code: E6B+C,LEXS+L,B3I+Q (GAL,QZS,BDS) -const unsigned int CODE_L6Z = 34; //!< obs code: E6A+B+C (GAL) -const unsigned int CODE_L6S = 35; //!< obs code: LEXS (QZS) -const unsigned int CODE_L6L = 36; //!< obs code: LEXL (QZS) -const unsigned int CODE_L8I = 37; //!< obs code: E5(a+b)I (GAL) -const unsigned int CODE_L8Q = 38; //!< obs code: E5(a+b)Q (GAL) -const unsigned int CODE_L8X = 39; //!< obs code: E5(a+b)I+Q (GAL) -const unsigned int CODE_L2I = 40; //!< obs code: B1I (BDS) -const unsigned int CODE_L2Q = 41; //!< obs code: B1Q (BDS) -const unsigned int CODE_L6I = 42; //!< obs code: B3I (BDS) -const unsigned int CODE_L6Q = 43; //!< obs code: B3Q (BDS) -const unsigned int CODE_L3I = 44; //!< obs code: G3I (GLO) -const unsigned int CODE_L3Q = 45; //!< obs code: G3Q (GLO) -const unsigned int CODE_L3X = 46; //!< obs code: G3I+Q (GLO) -const unsigned int CODE_L1I = 47; //!< obs code: B1I (BDS) -const unsigned int CODE_L1Q = 48; //!< obs code: B1Q (BDS) -const unsigned int CODE_L5A = 49; //!< obs code: L5A SPS (IRN) -const unsigned int CODE_L5B = 50; //!< obs code: L5B RS(D) (IRN) -const unsigned int CODE_L5C = 51; //!< obs code: L5C RS(P) (IRN) -const unsigned int CODE_L9A = 52; //!< obs code: SA SPS (IRN) -const unsigned int CODE_L9B = 53; //!< obs code: SB RS(D) (IRN) -const unsigned int CODE_L9C = 54; //!< obs code: SC RS(P) (IRN) -const unsigned int CODE_L9X = 55; //!< obs code: SB+C (IRN) -const int MAXCODE = 55; //!< max number of obs code +const unsigned int CODE_NONE = 0; //!< obs code: none or unknown +const unsigned int CODE_L1C = 1; //!< obs code: L1C/A,G1C/A,E1C (GPS,GLO,GAL,QZS,SBS) +const unsigned int CODE_L1P = 2; //!< obs code: L1P,G1P (GPS,GLO) +const unsigned int CODE_L1W = 3; //!< obs code: L1 Z-track (GPS) +const unsigned int CODE_L1Y = 4; //!< obs code: L1Y (GPS) +const unsigned int CODE_L1M = 5; //!< obs code: L1M (GPS) +const unsigned int CODE_L1N = 6; //!< obs code: L1codeless (GPS) +const unsigned int CODE_L1S = 7; //!< obs code: L1C(D) (GPS,QZS) +const unsigned int CODE_L1L = 8; //!< obs code: L1C(P) (GPS,QZS) +const unsigned int CODE_L1E = 9; //!< (not used) +const unsigned int CODE_L1A = 10; //!< obs code: E1A (GAL) +const unsigned int CODE_L1B = 11; //!< obs code: E1B (GAL) +const unsigned int CODE_L1X = 12; //!< obs code: E1B+C,L1C(D+P) (GAL,QZS) +const unsigned int CODE_L1Z = 13; //!< obs code: E1A+B+C,L1SAIF (GAL,QZS) +const unsigned int CODE_L2C = 14; //!< obs code: L2C/A,G1C/A (GPS,GLO) +const unsigned int CODE_L2D = 15; //!< obs code: L2 L1C/A-(P2-P1) (GPS) +const unsigned int CODE_L2S = 16; //!< obs code: L2C(M) (GPS,QZS) +const unsigned int CODE_L2L = 17; //!< obs code: L2C(L) (GPS,QZS) +const unsigned int CODE_L2X = 18; //!< obs code: L2C(M+L),B1I+Q (GPS,QZS,BDS) +const unsigned int CODE_L2P = 19; //!< obs code: L2P,G2P (GPS,GLO) +const unsigned int CODE_L2W = 20; //!< obs code: L2 Z-track (GPS) +const unsigned int CODE_L2Y = 21; //!< obs code: L2Y (GPS) +const unsigned int CODE_L2M = 22; //!< obs code: L2M (GPS) +const unsigned int CODE_L2N = 23; //!< obs code: L2codeless (GPS) +const unsigned int CODE_L5I = 24; //!< obs code: L5/E5aI (GPS,GAL,QZS,SBS) +const unsigned int CODE_L5Q = 25; //!< obs code: L5/E5aQ (GPS,GAL,QZS,SBS) +const unsigned int CODE_L5X = 26; //!< obs code: L5/E5aI+Q/L5B+C (GPS,GAL,QZS,IRN,SBS) +const unsigned int CODE_L7I = 27; //!< obs code: E5bI,B2I (GAL,BDS) +const unsigned int CODE_L7Q = 28; //!< obs code: E5bQ,B2Q (GAL,BDS) +const unsigned int CODE_L7X = 29; //!< obs code: E5bI+Q,B2I+Q (GAL,BDS) +const unsigned int CODE_L6A = 30; //!< obs code: E6A (GAL) +const unsigned int CODE_L6B = 31; //!< obs code: E6B (GAL) +const unsigned int CODE_L6C = 32; //!< obs code: E6C (GAL) +const unsigned int CODE_L6X = 33; //!< obs code: E6B+C,LEXS+L,B3I+Q (GAL,QZS,BDS) +const unsigned int CODE_L6Z = 34; //!< obs code: E6A+B+C (GAL) +const unsigned int CODE_L6S = 35; //!< obs code: LEXS (QZS) +const unsigned int CODE_L6L = 36; //!< obs code: LEXL (QZS) +const unsigned int CODE_L8I = 37; //!< obs code: E5(a+b)I (GAL) +const unsigned int CODE_L8Q = 38; //!< obs code: E5(a+b)Q (GAL) +const unsigned int CODE_L8X = 39; //!< obs code: E5(a+b)I+Q (GAL) +const unsigned int CODE_L2I = 40; //!< obs code: B1I (BDS) +const unsigned int CODE_L2Q = 41; //!< obs code: B1Q (BDS) +const unsigned int CODE_L6I = 42; //!< obs code: B3I (BDS) +const unsigned int CODE_L6Q = 43; //!< obs code: B3Q (BDS) +const unsigned int CODE_L3I = 44; //!< obs code: G3I (GLO) +const unsigned int CODE_L3Q = 45; //!< obs code: G3Q (GLO) +const unsigned int CODE_L3X = 46; //!< obs code: G3I+Q (GLO) +const unsigned int CODE_L1I = 47; //!< obs code: B1I (BDS) +const unsigned int CODE_L1Q = 48; //!< obs code: B1Q (BDS) +const unsigned int CODE_L5A = 49; //!< obs code: L5A SPS (IRN) +const unsigned int CODE_L5B = 50; //!< obs code: L5B RS(D) (IRN) +const unsigned int CODE_L5C = 51; //!< obs code: L5C RS(P) (IRN) +const unsigned int CODE_L9A = 52; //!< obs code: SA SPS (IRN) +const unsigned int CODE_L9B = 53; //!< obs code: SB RS(D) (IRN) +const unsigned int CODE_L9C = 54; //!< obs code: SC RS(P) (IRN) +const unsigned int CODE_L9X = 55; //!< obs code: SB+C (IRN) +const int MAXCODE = 55; //!< max number of obs code #endif diff --git a/src/core/system_parameters/gnss_satellite.cc b/src/core/system_parameters/gnss_satellite.cc index 629dcb878..0f6c5345a 100644 --- a/src/core/system_parameters/gnss_satellite.cc +++ b/src/core/system_parameters/gnss_satellite.cc @@ -32,7 +32,6 @@ #include - Gnss_Satellite::Gnss_Satellite() { Gnss_Satellite::reset(); @@ -49,7 +48,8 @@ Gnss_Satellite::Gnss_Satellite(const std::string& system_, unsigned int PRN_) Gnss_Satellite::~Gnss_Satellite() -{} +{ +} void Gnss_Satellite::reset() @@ -67,18 +67,18 @@ void Gnss_Satellite::reset() } -std::ostream& operator<<(std::ostream &out, const Gnss_Satellite &sat) // output +std::ostream& operator<<(std::ostream& out, const Gnss_Satellite& sat) // output { std::string tag(""); std::string tag2(""); - if(sat.get_system().compare("Galileo") == 0) tag = "E"; - if(sat.get_PRN() < 10) tag2 = "0"; + if (sat.get_system().compare("Galileo") == 0) tag = "E"; + if (sat.get_PRN() < 10) tag2 = "0"; out << sat.get_system() << " PRN " << tag << tag2 << sat.get_PRN() << " (Block " << sat.get_block() << ")"; return out; } -bool operator== (const Gnss_Satellite &sat1, const Gnss_Satellite &sat2) +bool operator==(const Gnss_Satellite& sat1, const Gnss_Satellite& sat2) { bool equal = false; if (sat1.get_system().compare(sat2.get_system()) == 0) @@ -115,14 +115,14 @@ void Gnss_Satellite::set_system(const std::string& system_) // Set the satellite system {"GPS", "Glonass", "SBAS", "Galileo", "Compass"} std::set::iterator it = system_set.find(system_); - if(it != system_set.cend()) + if (it != system_set.cend()) { system = system_; } else { DLOG(INFO) << "System " << system_ << " is not defined {GPS, Glonass, SBAS, Galileo, Beidou}. Initialization?"; - system = std::string(""); + system = std::string(""); } } @@ -184,11 +184,26 @@ void Gnss_Satellite::set_PRN(unsigned int PRN_) } else if (system.compare("SBAS") == 0) { - if (PRN_ == 122){ PRN = PRN_; } // WAAS Inmarsat 3F4 (AOR-W) - else if (PRN_ == 134){ PRN = PRN_; } // WAAS Inmarsat 3F3 (POR) - else if (PRN_ == 120){ PRN = PRN_; } // EGNOS AOR-E Broadcast satellite http://www.egnos-pro.esa.int/index.html - else if (PRN_ == 124){ PRN = PRN_; } // EGNOS ESA ARTEMIS used for EGNOS Operations - else if (PRN_ == 126){ PRN = PRN_; } // EGNOS IOR-W currently used by Industry to perform various tests on the system. + if (PRN_ == 122) + { + PRN = PRN_; + } // WAAS Inmarsat 3F4 (AOR-W) + else if (PRN_ == 134) + { + PRN = PRN_; + } // WAAS Inmarsat 3F3 (POR) + else if (PRN_ == 120) + { + PRN = PRN_; + } // EGNOS AOR-E Broadcast satellite http://www.egnos-pro.esa.int/index.html + else if (PRN_ == 124) + { + PRN = PRN_; + } // EGNOS ESA ARTEMIS used for EGNOS Operations + else if (PRN_ == 126) + { + PRN = PRN_; + } // EGNOS IOR-W currently used by Industry to perform various tests on the system. else { DLOG(INFO) << "This PRN is not defined"; @@ -264,312 +279,312 @@ std::string Gnss_Satellite::what_block(const std::string& system_, unsigned int if (system_.compare("GPS") == 0) { // info from https://www.navcen.uscg.gov/?Do=constellationStatus - switch ( PRN_ ) - { - case 1 : - block_ = std::string("IIF"); // Plane D - break; - case 2 : - block_ = std::string("IIR"); // Plane D - break; - case 3 : - block_ = std::string("IIF"); // Plane E - break; - case 4 : - block_ = std::string("Unknown"); - break; - case 5 : - block_ = std::string("IIR-M"); // Plane E - break; - case 6 : - block_ = std::string("IIF"); // Plane D - break; - case 7 : - block_ = std::string("IIR-M"); // Plane A - break; - case 8 : - block_ = std::string("IIF"); // Plane C - break; - case 9 : - block_ = std::string("IIF"); // Plane F - break; - case 10 : - block_ = std::string("IIF"); // Plane E - break; - case 11 : - block_ = std::string("IIR"); // Plane D - break; - case 12 : - block_ = std::string("IIR-M"); // Plane B - break; - case 13 : - block_ = std::string("IIR"); // Plane F - break; - case 14 : - block_ = std::string("IIR"); // Plane F - break; - case 15 : - block_ = std::string("IIR-M"); // Plane F - break; - case 16 : - block_ = std::string("IIR"); // Plane B - break; - case 17 : - block_ = std::string("IIR-M"); // Plane C - break; - case 18 : - block_ = std::string("IIR"); // Plane E - break; - case 19 : - block_ = std::string("IIR"); // Plane D - break; - case 20 : - block_ = std::string("IIR"); // Plane B - break; - case 21 : - block_ = std::string("IIR"); // Plane D - break; - case 22 : - block_ = std::string("IIR"); // Plane E - break; - case 23 : - block_ = std::string("IIR"); // Plane F - break; - case 24 : - block_ = std::string("IIF"); // Plane A - break; - case 25 : - block_ = std::string("IIF"); // Plane B - break; - case 26 : - block_ = std::string("IIF"); // Plane B - break; - case 27 : - block_ = std::string("IIF"); // Plane C - break; - case 28 : - block_ = std::string("IIR"); // Plane B - break; - case 29 : - block_ = std::string("IIR-M"); // Plane C - break; - case 30 : - block_ = std::string("IIF"); // Plane A - break; - case 31 : - block_ = std::string("IIR-M"); // Plane A - break; - case 32 : - block_ = std::string("IIF"); // Plane F - break; - default : - block_ = std::string("Unknown"); - } + switch (PRN_) + { + case 1: + block_ = std::string("IIF"); // Plane D + break; + case 2: + block_ = std::string("IIR"); // Plane D + break; + case 3: + block_ = std::string("IIF"); // Plane E + break; + case 4: + block_ = std::string("Unknown"); + break; + case 5: + block_ = std::string("IIR-M"); // Plane E + break; + case 6: + block_ = std::string("IIF"); // Plane D + break; + case 7: + block_ = std::string("IIR-M"); // Plane A + break; + case 8: + block_ = std::string("IIF"); // Plane C + break; + case 9: + block_ = std::string("IIF"); // Plane F + break; + case 10: + block_ = std::string("IIF"); // Plane E + break; + case 11: + block_ = std::string("IIR"); // Plane D + break; + case 12: + block_ = std::string("IIR-M"); // Plane B + break; + case 13: + block_ = std::string("IIR"); // Plane F + break; + case 14: + block_ = std::string("IIR"); // Plane F + break; + case 15: + block_ = std::string("IIR-M"); // Plane F + break; + case 16: + block_ = std::string("IIR"); // Plane B + break; + case 17: + block_ = std::string("IIR-M"); // Plane C + break; + case 18: + block_ = std::string("IIR"); // Plane E + break; + case 19: + block_ = std::string("IIR"); // Plane D + break; + case 20: + block_ = std::string("IIR"); // Plane B + break; + case 21: + block_ = std::string("IIR"); // Plane D + break; + case 22: + block_ = std::string("IIR"); // Plane E + break; + case 23: + block_ = std::string("IIR"); // Plane F + break; + case 24: + block_ = std::string("IIF"); // Plane A + break; + case 25: + block_ = std::string("IIF"); // Plane B + break; + case 26: + block_ = std::string("IIF"); // Plane B + break; + case 27: + block_ = std::string("IIF"); // Plane C + break; + case 28: + block_ = std::string("IIR"); // Plane B + break; + case 29: + block_ = std::string("IIR-M"); // Plane C + break; + case 30: + block_ = std::string("IIF"); // Plane A + break; + case 31: + block_ = std::string("IIR-M"); // Plane A + break; + case 32: + block_ = std::string("IIF"); // Plane F + break; + default: + block_ = std::string("Unknown"); + } } if (system_.compare("Glonass") == 0) { // Info from http://www.sdcm.ru/smglo/grupglo?version=eng&site=extern // See also http://www.glonass-center.ru/en/GLONASS/ - switch ( PRN_ ) - { - case 1 : - block_ = std::string("1"); // Plane 1 - rf_link = 1; - break; - case 2 : - block_ = std::string("-4"); // Plane 1 - rf_link = -4; - break; - case 3 : - block_ = std::string("5"); // Plane 1 - rf_link = 5; - break; - case 4 : - block_ = std::string("6"); // Plane 1 - rf_link = 6; - break; - case 5 : - block_ = std::string("1"); // Plane 1 - rf_link = 1; - break; - case 6 : - block_ = std::string("-4"); // Plane 1 - rf_link = -4; - break; - case 7 : - block_ = std::string("5"); // Plane 1 - rf_link = 5; - break; - case 8 : - block_ = std::string("6"); // Plane 1 - rf_link = 6; - break; - case 9 : - block_ = std::string("-2"); // Plane 2 - rf_link = -2; - break; - case 10 : - block_ = std::string("-7"); // Plane 2 - rf_link = -7; - break; - case 11 : - block_ = std::string("0"); // Plane 2 - rf_link = 0; - break; - case 12 : - block_ = std::string("-1"); // Plane 2 - rf_link = -1; - break; - case 13 : - block_ = std::string("-2"); // Plane 2 - rf_link = -2; - break; - case 14 : - block_ = std::string("-7"); // Plane 2 - rf_link = -7; - break; - case 15 : - block_ = std::string("0"); // Plane 2 - rf_link = 0; - break; - case 16 : - block_ = std::string("-1"); // Plane 2 - rf_link = -1; - break; - case 17 : - block_ = std::string("4"); // Plane 3 - rf_link = 4; - break; - case 18 : - block_ = std::string("-3"); // Plane 3 - rf_link = -3; - break; - case 19 : - block_ = std::string("3"); // Plane 3 - rf_link = 3; - break; - case 20 : - block_ = std::string("2"); // Plane 3 - rf_link = 2; - break; - case 21 : - block_ = std::string("4"); // Plane 3 - rf_link = 4; - break; - case 22 : - block_ = std::string("-3"); // Plane 3 - rf_link = -3; - break; - case 23 : - block_ = std::string("3"); // Plane 3 - rf_link = 3; - break; - case 24 : - block_ = std::string("2"); // Plane 3 - rf_link = 2; - break; - default : - block_ = std::string("Unknown"); - } + switch (PRN_) + { + case 1: + block_ = std::string("1"); // Plane 1 + rf_link = 1; + break; + case 2: + block_ = std::string("-4"); // Plane 1 + rf_link = -4; + break; + case 3: + block_ = std::string("5"); // Plane 1 + rf_link = 5; + break; + case 4: + block_ = std::string("6"); // Plane 1 + rf_link = 6; + break; + case 5: + block_ = std::string("1"); // Plane 1 + rf_link = 1; + break; + case 6: + block_ = std::string("-4"); // Plane 1 + rf_link = -4; + break; + case 7: + block_ = std::string("5"); // Plane 1 + rf_link = 5; + break; + case 8: + block_ = std::string("6"); // Plane 1 + rf_link = 6; + break; + case 9: + block_ = std::string("-2"); // Plane 2 + rf_link = -2; + break; + case 10: + block_ = std::string("-7"); // Plane 2 + rf_link = -7; + break; + case 11: + block_ = std::string("0"); // Plane 2 + rf_link = 0; + break; + case 12: + block_ = std::string("-1"); // Plane 2 + rf_link = -1; + break; + case 13: + block_ = std::string("-2"); // Plane 2 + rf_link = -2; + break; + case 14: + block_ = std::string("-7"); // Plane 2 + rf_link = -7; + break; + case 15: + block_ = std::string("0"); // Plane 2 + rf_link = 0; + break; + case 16: + block_ = std::string("-1"); // Plane 2 + rf_link = -1; + break; + case 17: + block_ = std::string("4"); // Plane 3 + rf_link = 4; + break; + case 18: + block_ = std::string("-3"); // Plane 3 + rf_link = -3; + break; + case 19: + block_ = std::string("3"); // Plane 3 + rf_link = 3; + break; + case 20: + block_ = std::string("2"); // Plane 3 + rf_link = 2; + break; + case 21: + block_ = std::string("4"); // Plane 3 + rf_link = 4; + break; + case 22: + block_ = std::string("-3"); // Plane 3 + rf_link = -3; + break; + case 23: + block_ = std::string("3"); // Plane 3 + rf_link = 3; + break; + case 24: + block_ = std::string("2"); // Plane 3 + rf_link = 2; + break; + default: + block_ = std::string("Unknown"); + } } if (system_.compare("SBAS") == 0) { - switch ( PRN_ ) - { - case 122 : - block_ = std::string("WAAS"); // WAAS Inmarsat 3F4 (AOR-W) - break; - case 134 : - block_ = std::string("WAAS"); // WAAS Inmarsat 3F3 (POR) - break; - case 120 : - block_ = std::string("EGNOS"); // EGNOS AOR-E Broadcast satellite http://www.egnos-pro.esa.int/index.html - break; - case 124 : - block_ = std::string("EGNOS"); // EGNOS ESA ARTEMIS used for EGNOS Operations - break; - case 126 : - block_ = std::string("EGNOS"); // EGNOS IOR-W currently used by Industry to perform various tests on the system. - break; - default: - block_ = std::string("Unknown"); - } + switch (PRN_) + { + case 122: + block_ = std::string("WAAS"); // WAAS Inmarsat 3F4 (AOR-W) + break; + case 134: + block_ = std::string("WAAS"); // WAAS Inmarsat 3F3 (POR) + break; + case 120: + block_ = std::string("EGNOS"); // EGNOS AOR-E Broadcast satellite http://www.egnos-pro.esa.int/index.html + break; + case 124: + block_ = std::string("EGNOS"); // EGNOS ESA ARTEMIS used for EGNOS Operations + break; + case 126: + block_ = std::string("EGNOS"); // EGNOS IOR-W currently used by Industry to perform various tests on the system. + break; + default: + block_ = std::string("Unknown"); + } } if (system_.compare("Galileo") == 0) { // Check http://en.wikipedia.org/wiki/List_of_Galileo_satellites and https://www.gsc-europa.eu/system-status/Constellation-Information - switch ( PRN_ ) - { - case 1: - block_ = std::string("FOC-FM10"); // Galileo Full Operational Capability (FOC) satellite FM10 / GSAT-0210, launched on May 24, 2016. - break; - case 2: - block_ = std::string("FOC-FM11"); // Galileo Full Operational Capability (FOC) satellite FM11 / GSAT-0211, launched on May 24, 2016. - break; - case 3: - block_ = std::string("FOC-FM12"); // Galileo Full Operational Capability (FOC) satellite FM12 / GSAT-0212, launched on November 17, 2016. - break; - case 4: - block_ = std::string("FOC-FM13"); // Galileo Full Operational Capability (FOC) satellite FM13 / GSAT-0213, launched on November 17, 2016. - break; - case 5: - block_ = std::string("FOC-FM14"); // Galileo Full Operational Capability (FOC) satellite FM14 / GSAT-0214, launched on November 17, 2016. - break; - case 7: - block_ = std::string("FOC-FM7"); // Galileo Full Operational Capability (FOC) satellite FM7 / GSAT-0207, launched on November 17, 2016. - break; - case 8: - block_ = std::string("FOC-FM8"); // Galileo Full Operational Capability (FOC) satellite FM8 / GSAT0208, launched on December 17, 2015. - break; - case 9: - block_ = std::string("FOC-FM9"); // Galileo Full Operational Capability (FOC) satellite FM9 / GSAT0209, launched on December 17, 2015. - break; - case 11 : - block_ = std::string("IOV-PFM"); // PFM, the ProtoFlight Model / GSAT0101, launched from French Guiana at 10:30 GMT on October 21, 2011. - break; - case 12 : - block_ = std::string("IOV-FM2"); // Galileo In-Orbit Validation (IOV) satellite FM2 (Flight Model 2) also known as GSAT0102, from French Guiana at 10:30 GMT on October 21, 2011. - break; - case 14 : - block_ = std::string("FOC-FM2*"); // Galileo Full Operational Capability (FOC) satellite FM2 / GSAT0202, launched into incorrect orbit on August 22, 2014. Moved to usable orbit in March, 2015. UNDER TESTING. - break; - case 18 : - block_ = std::string("FOC-FM1*"); // Galileo Full Operational Capability (FOC) satellite FM1 / GSAT0201, launched into incorrect orbit on August 22, 2014. Moved to usable orbit in December, 2014. UNDER TESTING. - break; - case 19 : - block_ = std::string("IOV-FM3"); // Galileo In-Orbit Validation (IOV) satellite FM3 (Flight Model 3) / GSAT0103, launched on October 12, 2012. - break; - case 20 : - block_ = std::string("IOV-FM4**"); // Galileo In-Orbit Validation (IOV) satellite FM4 (Flight Model 4) / GSAT0104, launched on October 12, 2012. Payload power problem beginning May 27, 2014 led to permanent loss of E5 and E6 transmissions, E1 transmission restored. UNAVAILABLE FROM 2014-05-27 UNTIL FURTHER NOTICE - break; - case 21 : - block_ = std::string("FOC-FM15"); // Galileo Full Operational Capability (FOC) satellite FM15 / GSAT0215, launched on Dec. 12, 2017. UNDER COMMISIONING. - break; - case 22 : - block_ = std::string("FOC-FM4**"); // Galileo Full Operational Capability (FOC) satellite FM4 / GSAT0204, launched on March 27, 2015. REMOVED FROM ACTIVE SERVICE ON 2017-12-08 UNTIL FURTHER NOTICE FOR CONSTELLATION MANAGEMENT PURPOSES. - break; - case 24 : - block_ = std::string("FOC-FM5"); // Galileo Full Operational Capability (FOC) satellite FM5 / GSAT0205, launched on Sept. 11, 2015. - break; - case 25 : - block_ = std::string("FOC-FM16"); // Galileo Full Operational Capability (FOC) satellite FM16 / GSAT0216, launched on Dec. 12, 2017. UNDER COMMISIONING. - break; - case 26 : - block_ = std::string("FOC-FM3"); // Galileo Full Operational Capability (FOC) satellite FM3 / GSAT0203, launched on March 27, 2015. - break; - case 27 : - block_ = std::string("FOC-FM17"); // Galileo Full Operational Capability (FOC) satellite FM17 / GSAT0217, launched on Dec. 12, 2017. UNDER COMMISIONING. - break; - case 30 : - block_ = std::string("FOC-FM6"); // Galileo Full Operational Capability (FOC) satellite FM6 / GSAT0206, launched on Sept. 11, 2015. - break; - case 31 : - block_ = std::string("FOC-FM18"); // Galileo Full Operational Capability (FOC) satellite FM18 / GSAT0218, launched on Dec. 12, 2017. UNDER COMMISIONING. - break; - default: - block_ = std::string("Unknown(Simulated)"); - } + switch (PRN_) + { + case 1: + block_ = std::string("FOC-FM10"); // Galileo Full Operational Capability (FOC) satellite FM10 / GSAT-0210, launched on May 24, 2016. + break; + case 2: + block_ = std::string("FOC-FM11"); // Galileo Full Operational Capability (FOC) satellite FM11 / GSAT-0211, launched on May 24, 2016. + break; + case 3: + block_ = std::string("FOC-FM12"); // Galileo Full Operational Capability (FOC) satellite FM12 / GSAT-0212, launched on November 17, 2016. + break; + case 4: + block_ = std::string("FOC-FM13"); // Galileo Full Operational Capability (FOC) satellite FM13 / GSAT-0213, launched on November 17, 2016. + break; + case 5: + block_ = std::string("FOC-FM14"); // Galileo Full Operational Capability (FOC) satellite FM14 / GSAT-0214, launched on November 17, 2016. + break; + case 7: + block_ = std::string("FOC-FM7"); // Galileo Full Operational Capability (FOC) satellite FM7 / GSAT-0207, launched on November 17, 2016. + break; + case 8: + block_ = std::string("FOC-FM8"); // Galileo Full Operational Capability (FOC) satellite FM8 / GSAT0208, launched on December 17, 2015. + break; + case 9: + block_ = std::string("FOC-FM9"); // Galileo Full Operational Capability (FOC) satellite FM9 / GSAT0209, launched on December 17, 2015. + break; + case 11: + block_ = std::string("IOV-PFM"); // PFM, the ProtoFlight Model / GSAT0101, launched from French Guiana at 10:30 GMT on October 21, 2011. + break; + case 12: + block_ = std::string("IOV-FM2"); // Galileo In-Orbit Validation (IOV) satellite FM2 (Flight Model 2) also known as GSAT0102, from French Guiana at 10:30 GMT on October 21, 2011. + break; + case 14: + block_ = std::string("FOC-FM2*"); // Galileo Full Operational Capability (FOC) satellite FM2 / GSAT0202, launched into incorrect orbit on August 22, 2014. Moved to usable orbit in March, 2015. UNDER TESTING. + break; + case 18: + block_ = std::string("FOC-FM1*"); // Galileo Full Operational Capability (FOC) satellite FM1 / GSAT0201, launched into incorrect orbit on August 22, 2014. Moved to usable orbit in December, 2014. UNDER TESTING. + break; + case 19: + block_ = std::string("IOV-FM3"); // Galileo In-Orbit Validation (IOV) satellite FM3 (Flight Model 3) / GSAT0103, launched on October 12, 2012. + break; + case 20: + block_ = std::string("IOV-FM4**"); // Galileo In-Orbit Validation (IOV) satellite FM4 (Flight Model 4) / GSAT0104, launched on October 12, 2012. Payload power problem beginning May 27, 2014 led to permanent loss of E5 and E6 transmissions, E1 transmission restored. UNAVAILABLE FROM 2014-05-27 UNTIL FURTHER NOTICE + break; + case 21: + block_ = std::string("FOC-FM15"); // Galileo Full Operational Capability (FOC) satellite FM15 / GSAT0215, launched on Dec. 12, 2017. UNDER COMMISIONING. + break; + case 22: + block_ = std::string("FOC-FM4**"); // Galileo Full Operational Capability (FOC) satellite FM4 / GSAT0204, launched on March 27, 2015. REMOVED FROM ACTIVE SERVICE ON 2017-12-08 UNTIL FURTHER NOTICE FOR CONSTELLATION MANAGEMENT PURPOSES. + break; + case 24: + block_ = std::string("FOC-FM5"); // Galileo Full Operational Capability (FOC) satellite FM5 / GSAT0205, launched on Sept. 11, 2015. + break; + case 25: + block_ = std::string("FOC-FM16"); // Galileo Full Operational Capability (FOC) satellite FM16 / GSAT0216, launched on Dec. 12, 2017. UNDER COMMISIONING. + break; + case 26: + block_ = std::string("FOC-FM3"); // Galileo Full Operational Capability (FOC) satellite FM3 / GSAT0203, launched on March 27, 2015. + break; + case 27: + block_ = std::string("FOC-FM17"); // Galileo Full Operational Capability (FOC) satellite FM17 / GSAT0217, launched on Dec. 12, 2017. UNDER COMMISIONING. + break; + case 30: + block_ = std::string("FOC-FM6"); // Galileo Full Operational Capability (FOC) satellite FM6 / GSAT0206, launched on Sept. 11, 2015. + break; + case 31: + block_ = std::string("FOC-FM18"); // Galileo Full Operational Capability (FOC) satellite FM18 / GSAT0218, launched on Dec. 12, 2017. UNDER COMMISIONING. + break; + default: + block_ = std::string("Unknown(Simulated)"); + } } return block_; } diff --git a/src/core/system_parameters/gnss_satellite.h b/src/core/system_parameters/gnss_satellite.h index 395303479..0e2e2eb52 100644 --- a/src/core/system_parameters/gnss_satellite.h +++ b/src/core/system_parameters/gnss_satellite.h @@ -46,29 +46,29 @@ class Gnss_Satellite { public: - Gnss_Satellite(); //!< Default Constructor. - Gnss_Satellite(const std::string& system_, unsigned int PRN_); //!< Concrete GNSS satellite Constructor. - ~Gnss_Satellite(); //!< Default Destructor. - void update_PRN(unsigned int PRN); //!< Updates the PRN Number when information is decoded, only applies to GLONASS GNAV messages - unsigned int get_PRN() const; //!< Gets satellite's PRN - signed int get_rf_link() const; //!< Gets the satellite's rf link - std::string get_system() const; //!< Gets the satellite system {"GPS", "GLONASS", "SBAS", "Galileo", "Beidou"} - std::string get_system_short() const; //!< Gets the satellite system {"G", "R", "SBAS", "E", "C"} - std::string get_block() const; //!< Gets the satellite block. If GPS, returns {"IIA", "IIR", "IIR-M", "IIF"} - std::string what_block(const std::string& system_, unsigned int PRN_); //!< Gets the block of a given satellite - friend bool operator== (const Gnss_Satellite &, const Gnss_Satellite &); //!< operator== for comparison - friend std::ostream& operator<<(std::ostream &, const Gnss_Satellite &); //!< operator<< for pretty printing + Gnss_Satellite(); //!< Default Constructor. + Gnss_Satellite(const std::string& system_, unsigned int PRN_); //!< Concrete GNSS satellite Constructor. + ~Gnss_Satellite(); //!< Default Destructor. + void update_PRN(unsigned int PRN); //!< Updates the PRN Number when information is decoded, only applies to GLONASS GNAV messages + unsigned int get_PRN() const; //!< Gets satellite's PRN + signed int get_rf_link() const; //!< Gets the satellite's rf link + std::string get_system() const; //!< Gets the satellite system {"GPS", "GLONASS", "SBAS", "Galileo", "Beidou"} + std::string get_system_short() const; //!< Gets the satellite system {"G", "R", "SBAS", "E", "C"} + std::string get_block() const; //!< Gets the satellite block. If GPS, returns {"IIA", "IIR", "IIR-M", "IIF"} + std::string what_block(const std::string& system_, unsigned int PRN_); //!< Gets the block of a given satellite + friend bool operator==(const Gnss_Satellite&, const Gnss_Satellite&); //!< operator== for comparison + friend std::ostream& operator<<(std::ostream&, const Gnss_Satellite&); //!< operator<< for pretty printing //Gnss_Satellite& operator=(const Gnss_Satellite &); private: unsigned int PRN; std::string system; - std::map satelliteSystem; + std::map satelliteSystem; std::string block; signed int rf_link; void set_system(const std::string& system); // Sets the satellite system {"GPS", "GLONASS", "SBAS", "Galileo", "Beidou"}. - void set_PRN(unsigned int PRN); // Sets satellite's PRN - void set_block(const std::string& system_, unsigned int PRN_ ); - std::set system_set; // = {"GPS", "GLONASS", "SBAS", "Galileo", "Compass"}; + void set_PRN(unsigned int PRN); // Sets satellite's PRN + void set_block(const std::string& system_, unsigned int PRN_); + std::set system_set; // = {"GPS", "GLONASS", "SBAS", "Galileo", "Compass"}; void reset(); }; #endif diff --git a/src/core/system_parameters/gnss_signal.cc b/src/core/system_parameters/gnss_signal.cc index aaeb1a71b..2c0668858 100644 --- a/src/core/system_parameters/gnss_signal.cc +++ b/src/core/system_parameters/gnss_signal.cc @@ -49,7 +49,8 @@ Gnss_Signal::Gnss_Signal(const Gnss_Satellite& satellite_, const std::string& si Gnss_Signal::~Gnss_Signal() -{} +{ +} std::string Gnss_Signal::get_signal_str() const @@ -64,14 +65,14 @@ Gnss_Satellite Gnss_Signal::get_satellite() const } -std::ostream& operator<<(std::ostream &out, const Gnss_Signal &sig) // output +std::ostream& operator<<(std::ostream& out, const Gnss_Signal& sig) // output { out << sig.get_satellite() << " Signal " << sig.get_signal_str(); return out; } -bool operator==(const Gnss_Signal &sig1, const Gnss_Signal &sig2) +bool operator==(const Gnss_Signal& sig1, const Gnss_Signal& sig2) { bool equal = false; @@ -84,4 +85,3 @@ bool operator==(const Gnss_Signal &sig1, const Gnss_Signal &sig2) } return equal; } - diff --git a/src/core/system_parameters/gnss_signal.h b/src/core/system_parameters/gnss_signal.h index 4645f17e9..0630c3782 100644 --- a/src/core/system_parameters/gnss_signal.h +++ b/src/core/system_parameters/gnss_signal.h @@ -46,15 +46,16 @@ class Gnss_Signal private: Gnss_Satellite satellite; std::string signal; + public: Gnss_Signal(); Gnss_Signal(const std::string& signal_); Gnss_Signal(const Gnss_Satellite& satellite_, const std::string& signal_); ~Gnss_Signal(); - std::string get_signal_str() const; //!< Get the satellite signal {"1C" for GPS L1 C/A, "2S" for GPS L2C (M), "L5" for GPS L5, "1G" for GLONASS L1 C/A, "1B" for Galileo E1B, "5X" for Galileo E5a. - Gnss_Satellite get_satellite() const; //!< Get the Gnss_Satellite associated to the signal - friend bool operator== (const Gnss_Signal &, const Gnss_Signal &); //!< operator== for comparison - friend std::ostream& operator<<(std::ostream &, const Gnss_Signal &); //!< operator<< for pretty printing + std::string get_signal_str() const; //!< Get the satellite signal {"1C" for GPS L1 C/A, "2S" for GPS L2C (M), "L5" for GPS L5, "1G" for GLONASS L1 C/A, "1B" for Galileo E1B, "5X" for Galileo E5a. + Gnss_Satellite get_satellite() const; //!< Get the Gnss_Satellite associated to the signal + friend bool operator==(const Gnss_Signal&, const Gnss_Signal&); //!< operator== for comparison + friend std::ostream& operator<<(std::ostream&, const Gnss_Signal&); //!< operator<< for pretty printing }; #endif diff --git a/src/core/system_parameters/gnss_synchro.h b/src/core/system_parameters/gnss_synchro.h index 16a2287cf..267df4557 100644 --- a/src/core/system_parameters/gnss_synchro.h +++ b/src/core/system_parameters/gnss_synchro.h @@ -38,42 +38,40 @@ * \brief This is the class that contains the information that is shared * by the processing blocks. */ -class Gnss_Synchro +class Gnss_Synchro { public: // Satellite and signal info - char System; //!< Set by Channel::set_signal(Gnss_Signal gnss_signal) - char Signal[3]; //!< Set by Channel::set_signal(Gnss_Signal gnss_signal) - unsigned int PRN; //!< Set by Channel::set_signal(Gnss_Signal gnss_signal) - int Channel_ID; //!< Set by Channel constructor + char System; //!< Set by Channel::set_signal(Gnss_Signal gnss_signal) + char Signal[3]; //!< Set by Channel::set_signal(Gnss_Signal gnss_signal) + unsigned int PRN; //!< Set by Channel::set_signal(Gnss_Signal gnss_signal) + int Channel_ID; //!< Set by Channel constructor // Acquisition - double Acq_delay_samples; //!< Set by Acquisition processing block - double Acq_doppler_hz; //!< Set by Acquisition processing block - unsigned long int Acq_samplestamp_samples; //!< Set by Acquisition processing block - bool Flag_valid_acquisition; //!< Set by Acquisition processing block + double Acq_delay_samples; //!< Set by Acquisition processing block + double Acq_doppler_hz; //!< Set by Acquisition processing block + unsigned long int Acq_samplestamp_samples; //!< Set by Acquisition processing block + bool Flag_valid_acquisition; //!< Set by Acquisition processing block //Tracking - long int fs; //!< Set by Tracking processing block - double Prompt_I; //!< Set by Tracking processing block - double Prompt_Q; //!< Set by Tracking processing block - double CN0_dB_hz; //!< Set by Tracking processing block - double Carrier_Doppler_hz; //!< Set by Tracking processing block - double Carrier_phase_rads; //!< Set by Tracking processing block - double Code_phase_samples; //!< Set by Tracking processing block - unsigned long int Tracking_sample_counter; //!< Set by Tracking processing block + long int fs; //!< Set by Tracking processing block + double Prompt_I; //!< Set by Tracking processing block + double Prompt_Q; //!< Set by Tracking processing block + double CN0_dB_hz; //!< Set by Tracking processing block + double Carrier_Doppler_hz; //!< Set by Tracking processing block + double Carrier_phase_rads; //!< Set by Tracking processing block + double Code_phase_samples; //!< Set by Tracking processing block + unsigned long int Tracking_sample_counter; //!< Set by Tracking processing block - bool Flag_valid_symbol_output; //!< Set by Tracking processing block - int correlation_length_ms; //!< Set by Tracking processing block + bool Flag_valid_symbol_output; //!< Set by Tracking processing block + int correlation_length_ms; //!< Set by Tracking processing block //Telemetry Decoder - bool Flag_valid_word; //!< Set by Telemetry Decoder processing block - double TOW_at_current_symbol_s; //!< Set by Telemetry Decoder processing block + bool Flag_valid_word; //!< Set by Telemetry Decoder processing block + double TOW_at_current_symbol_s; //!< Set by Telemetry Decoder processing block // Observables - double Pseudorange_m; //!< Set by Observables processing block - double RX_time; //!< Set by Observables processing block - bool Flag_valid_pseudorange; //!< Set by Observables processing block - + double Pseudorange_m; //!< Set by Observables processing block + double RX_time; //!< Set by Observables processing block + bool Flag_valid_pseudorange; //!< Set by Observables processing block }; #endif - diff --git a/src/core/system_parameters/gps_acq_assist.cc b/src/core/system_parameters/gps_acq_assist.cc index 67b800d2f..2ec5a4545 100644 --- a/src/core/system_parameters/gps_acq_assist.cc +++ b/src/core/system_parameters/gps_acq_assist.cc @@ -46,4 +46,3 @@ Gps_Acq_Assist::Gps_Acq_Assist() Azimuth = 0.0; Elevation = 0.0; } - diff --git a/src/core/system_parameters/gps_acq_assist.h b/src/core/system_parameters/gps_acq_assist.h index 5ccebae8c..4b9649f9c 100644 --- a/src/core/system_parameters/gps_acq_assist.h +++ b/src/core/system_parameters/gps_acq_assist.h @@ -33,7 +33,6 @@ #define GNSS_SDR_GPS_ACQ_ASSIST_H_ - /*! * \brief This class is a storage for the GPS GSM RRLL acquisition assistance data as described in * Digital cellular telecommunications system (Phase 2+); @@ -45,17 +44,17 @@ class Gps_Acq_Assist { public: - unsigned int i_satellite_PRN; //!< SV PRN NUMBER - double d_TOW; //!< Time Of Week assigned to the acquisition data - double d_Doppler0; //!< Doppler (0 order term) [Hz] - double d_Doppler1; //!< Doppler (1 order term) [Hz] - double dopplerUncertainty; //!< Doppler Uncertainty [Hz] - double Code_Phase; //!< Code phase [chips] - double Code_Phase_int; //!< Integer Code Phase [1 C/A code period] - double GPS_Bit_Number; //!< GPS Bit Number - double Code_Phase_window; //!< Code Phase search window [chips] - double Azimuth; //!< Satellite Azimuth [deg] - double Elevation; //!< Satellite Elevation [deg] + unsigned int i_satellite_PRN; //!< SV PRN NUMBER + double d_TOW; //!< Time Of Week assigned to the acquisition data + double d_Doppler0; //!< Doppler (0 order term) [Hz] + double d_Doppler1; //!< Doppler (1 order term) [Hz] + double dopplerUncertainty; //!< Doppler Uncertainty [Hz] + double Code_Phase; //!< Code phase [chips] + double Code_Phase_int; //!< Integer Code Phase [1 C/A code period] + double GPS_Bit_Number; //!< GPS Bit Number + double Code_Phase_window; //!< Code Phase search window [chips] + double Azimuth; //!< Satellite Azimuth [deg] + double Elevation; //!< Satellite Elevation [deg] /*! * Default constructor diff --git a/src/core/system_parameters/gps_almanac.cc b/src/core/system_parameters/gps_almanac.cc index 805b262bc..258aa5da6 100644 --- a/src/core/system_parameters/gps_almanac.cc +++ b/src/core/system_parameters/gps_almanac.cc @@ -32,9 +32,9 @@ #include "gps_almanac.h" -Gps_Almanac::Gps_Almanac() +Gps_Almanac::Gps_Almanac() { - i_satellite_PRN = 0; + i_satellite_PRN = 0; d_Delta_i = 0.0; d_Toa = 0.0; d_M_0 = 0.0; @@ -47,4 +47,3 @@ Gps_Almanac::Gps_Almanac() d_A_f0 = 0.0; d_A_f1 = 0.0; } - diff --git a/src/core/system_parameters/gps_almanac.h b/src/core/system_parameters/gps_almanac.h index 47dec1eec..ce58495ce 100644 --- a/src/core/system_parameters/gps_almanac.h +++ b/src/core/system_parameters/gps_almanac.h @@ -41,18 +41,18 @@ class Gps_Almanac { public: - unsigned int i_satellite_PRN; //!< SV PRN NUMBER + unsigned int i_satellite_PRN; //!< SV PRN NUMBER double d_Delta_i; - double d_Toa; //!< Almanac data reference time of week (Ref. 20.3.3.4.3 IS-GPS-200E) [s] - double d_M_0; //!< Mean Anomaly at Reference Time [semi-circles] - double d_e_eccentricity; //!< Eccentricity [dimensionless] - double d_sqrt_A; //!< Square Root of the Semi-Major Axis [sqrt(m)] - double d_OMEGA0; //!< Longitude of Ascending Node of Orbit Plane at Weekly Epoch [semi-circles] - double d_OMEGA; //!< Argument of Perigee [semi-cicles] - double d_OMEGA_DOT; //!< Rate of Right Ascension [semi-circles/s] - int i_SV_health; // SV Health - double d_A_f0; //!< Coefficient 0 of code phase offset model [s] - double d_A_f1; //!< Coefficient 1 of code phase offset model [s/s] + double d_Toa; //!< Almanac data reference time of week (Ref. 20.3.3.4.3 IS-GPS-200E) [s] + double d_M_0; //!< Mean Anomaly at Reference Time [semi-circles] + double d_e_eccentricity; //!< Eccentricity [dimensionless] + double d_sqrt_A; //!< Square Root of the Semi-Major Axis [sqrt(m)] + double d_OMEGA0; //!< Longitude of Ascending Node of Orbit Plane at Weekly Epoch [semi-circles] + double d_OMEGA; //!< Argument of Perigee [semi-cicles] + double d_OMEGA_DOT; //!< Rate of Right Ascension [semi-circles/s] + int i_SV_health; // SV Health + double d_A_f0; //!< Coefficient 0 of code phase offset model [s] + double d_A_f1; //!< Coefficient 1 of code phase offset model [s/s] /*! * Default constructor diff --git a/src/core/system_parameters/gps_cnav_ephemeris.cc b/src/core/system_parameters/gps_cnav_ephemeris.cc index 852462c68..eec8f9703 100644 --- a/src/core/system_parameters/gps_cnav_ephemeris.cc +++ b/src/core/system_parameters/gps_cnav_ephemeris.cc @@ -58,11 +58,11 @@ Gps_CNAV_Ephemeris::Gps_CNAV_Ephemeris() i_GPS_week = 0; - d_TGD = 0; // Estimated Group Delay Differential: L1-L2 correction term only for the benefit of "L1 P(Y)" or "L2 P(Y)" s users [s] + d_TGD = 0; // Estimated Group Delay Differential: L1-L2 correction term only for the benefit of "L1 P(Y)" or "L2 P(Y)" s users [s] - d_A_f0 = 0; // Coefficient 0 of code phase offset model [s] - d_A_f1 = 0; // Coefficient 1 of code phase offset model [s/s] - d_A_f2 = 0; // Coefficient 2 of code phase offset model [s/s^2] + d_A_f0 = 0; // Coefficient 0 of code phase offset model [s] + d_A_f1 = 0; // Coefficient 1 of code phase offset model [s/s] + d_A_f2 = 0; // Coefficient 2 of code phase offset model [s/s^2] b_integrity_status_flag = false; b_alert_flag = false; // If true, indicates that the SV URA may be worse than indicated in d_SV_accuracy, use that SV at our own risk. @@ -98,7 +98,7 @@ Gps_CNAV_Ephemeris::Gps_CNAV_Ephemeris() double Gps_CNAV_Ephemeris::check_t(double time) { double corrTime; - double half_week = 302400.0; // seconds + double half_week = 302400.0; // seconds corrTime = time; if (time > half_week) { @@ -138,8 +138,8 @@ double Gps_CNAV_Ephemeris::sv_clock_relativistic_term(double transmitTime) double dE; double M; const double GM = 3.986005e14; //!< Universal gravitational constant times the mass of the Earth, [m^3/s^2] - const double F = -4.442807633e-10; //!< Constant, [s/(m)^(1/2)] - const double A_REF = 26559710.0; // See IS-GPS-200H, pp. 163 + const double F = -4.442807633e-10; //!< Constant, [s/(m)^(1/2)] + const double A_REF = 26559710.0; // See IS-GPS-200H, pp. 163 double d_sqrt_A = sqrt(A_REF + d_DELTA_A); // Restore semi-major axis @@ -164,9 +164,9 @@ double Gps_CNAV_Ephemeris::sv_clock_relativistic_term(double transmitTime) // --- Iteratively compute eccentric anomaly ---------------------------- for (int ii = 1; ii < 20; ii++) { - E_old = E; - E = M + d_e_eccentricity * sin(E); - dE = fmod(E - E_old, 2.0 * PI); + E_old = E; + E = M + d_e_eccentricity * sin(E); + dE = fmod(E - E_old, 2.0 * PI); if (fabs(dE) < 1e-12) { //Necessary precision is reached, exit from the loop @@ -197,22 +197,22 @@ double Gps_CNAV_Ephemeris::satellitePosition(double transmitTime) double i; double Omega; - const double A_REF = 26559710.0; // See IS-GPS-200H, pp. 170 + const double A_REF = 26559710.0; // See IS-GPS-200H, pp. 170 double d_sqrt_A = sqrt(A_REF + d_DELTA_A); - const double GM = 3.986005e14; //!< Universal gravitational constant times the mass of the Earth, [m^3/s^2] - const double OMEGA_DOT_REF = -2.6e-9; // semicircles / s, see IS-GPS-200H pp. 164 + const double GM = 3.986005e14; //!< Universal gravitational constant times the mass of the Earth, [m^3/s^2] + const double OMEGA_DOT_REF = -2.6e-9; // semicircles / s, see IS-GPS-200H pp. 164 const double OMEGA_EARTH_DOT = 7.2921151467e-5; //!< Earth rotation rate, [rad/s] // Find satellite's position ---------------------------------------------- // Restore semi-major axis - a = d_sqrt_A*d_sqrt_A; + a = d_sqrt_A * d_sqrt_A; // Time from ephemeris reference epoch tk = check_t(transmitTime - d_Toe1); // Computed mean motion - n0 = sqrt(GM / (a*a*a)); + n0 = sqrt(GM / (a * a * a)); // Mean motion difference from computed value @@ -234,9 +234,9 @@ double Gps_CNAV_Ephemeris::satellitePosition(double transmitTime) // --- Iteratively compute eccentric anomaly ---------------------------- for (int ii = 1; ii < 20; ii++) { - E_old = E; - E = M + d_e_eccentricity * sin(E); - dE = fmod(E - E_old, 2 * PI); + E_old = E; + E = M + d_e_eccentricity * sin(E); + dE = fmod(E - E_old, 2 * PI); if (fabs(dE) < 1e-12) { //Necessary precision is reached, exit from the loop @@ -256,17 +256,17 @@ double Gps_CNAV_Ephemeris::satellitePosition(double transmitTime) //phi = fmod((phi), (2*GPS_L2_PI)); // Correct argument of latitude - u = phi + d_Cuc * cos(2*phi) + d_Cus * sin(2*phi); + u = phi + d_Cuc * cos(2 * phi) + d_Cus * sin(2 * phi); // Correct radius - r = a * (1 - d_e_eccentricity*cos(E)) + d_Crc * cos(2*phi) + d_Crs * sin(2*phi); + r = a * (1 - d_e_eccentricity * cos(E)) + d_Crc * cos(2 * phi) + d_Crs * sin(2 * phi); // Correct inclination - i = d_i_0 + d_IDOT * tk + d_Cic * cos(2*phi) + d_Cis * sin(2*phi); + i = d_i_0 + d_IDOT * tk + d_Cic * cos(2 * phi) + d_Cis * sin(2 * phi); // Compute the angle between the ascending node and the Greenwich meridian - double d_OMEGA_DOT = OMEGA_DOT_REF*PI + d_DELTA_OMEGA_DOT; - Omega = d_OMEGA0 + (d_OMEGA_DOT - OMEGA_EARTH_DOT)*tk - OMEGA_EARTH_DOT * d_Toe1; + double d_OMEGA_DOT = OMEGA_DOT_REF * PI + d_DELTA_OMEGA_DOT; + Omega = d_OMEGA0 + (d_OMEGA_DOT - OMEGA_EARTH_DOT) * tk - OMEGA_EARTH_DOT * d_Toe1; // Reduce to between 0 and 2*pi rad //Omega = fmod((Omega + 2*GPS_L2_PI), (2*GPS_L2_PI)); @@ -278,7 +278,7 @@ double Gps_CNAV_Ephemeris::satellitePosition(double transmitTime) // Satellite's velocity. Can be useful for Vector Tracking loops double Omega_dot = d_OMEGA_DOT - OMEGA_EARTH_DOT; - d_satvel_X = - Omega_dot * (cos(u) * r + sin(u) * r * cos(i)) + d_satpos_X * cos(Omega) - d_satpos_Y * cos(i) * sin(Omega); + d_satvel_X = -Omega_dot * (cos(u) * r + sin(u) * r * cos(i)) + d_satpos_X * cos(Omega) - d_satpos_Y * cos(i) * sin(Omega); d_satvel_Y = Omega_dot * (cos(u) * r * cos(Omega) - sin(u) * r * cos(i) * sin(Omega)) + d_satpos_X * sin(Omega) + d_satpos_Y * cos(i) * cos(Omega); d_satvel_Z = d_satpos_Y * sin(i); diff --git a/src/core/system_parameters/gps_cnav_ephemeris.h b/src/core/system_parameters/gps_cnav_ephemeris.h index a5678d7cd..d10c2d8c6 100644 --- a/src/core/system_parameters/gps_cnav_ephemeris.h +++ b/src/core/system_parameters/gps_cnav_ephemeris.h @@ -46,53 +46,54 @@ class Gps_CNAV_Ephemeris { private: double check_t(double time); + public: - unsigned int i_satellite_PRN; // SV PRN NUMBER + unsigned int i_satellite_PRN; // SV PRN NUMBER //Message Types 10 and 11 Parameters (1 of 2) - int i_GPS_week; //!< GPS week number, aka WN [week] - int i_URA; //!< ED Accuracy Index - int i_signal_health; //!< Signal health (L1/L2/L5) - double d_Top; //!< Data predict time of week - double d_DELTA_A; //!< Semi-major axis difference at reference time - double d_A_DOT; //!< Change rate in semi-major axis - double d_Delta_n; //!< Mean Motion Difference From Computed Value [semi-circles/s] - double d_DELTA_DOT_N; //!< Rate of mean motion difference from computed value - double d_M_0; //!< Mean Anomaly at Reference Time [semi-circles] - double d_e_eccentricity; //!< Eccentricity - double d_OMEGA; //!< Argument of Perigee [semi-cicles] - double d_OMEGA0; //!< Longitude of Ascending Node of Orbit Plane at Weekly Epoch [semi-cicles] - double d_Toe1; //!< Ephemeris data reference time of week (Ref. 20.3.3.4.3 IS-GPS-200E) [s] - double d_Toe2; //!< Ephemeris data reference time of week (Ref. 20.3.3.4.3 IS-GPS-200E) [s] - double d_DELTA_OMEGA_DOT; //!< Rate of Right Ascension difference [semi-circles/s] - double d_i_0; //!< Inclination Angle at Reference Time [semi-circles] - double d_IDOT; //!< Rate of Inclination Angle [semi-circles/s] - double d_Cis; //!< Amplitude of the Sine Harmonic Correction Term to the Angle of Inclination [rad] - double d_Cic; //!< Amplitude of the Cosine Harmonic Correction Term to the Angle of Inclination [rad] - double d_Crs; //!< Amplitude of the Sine Harmonic Correction Term to the Orbit Radius [m] - double d_Crc; //!< Amplitude of the Cosine Harmonic Correction Term to the Orbit Radius [m] - double d_Cus; //!< Amplitude of the Sine Harmonic Correction Term to the Argument of Latitude [rad] - double d_Cuc; //!< Amplitude of the Cosine Harmonic Correction Term to the Argument of Latitude [rad] + int i_GPS_week; //!< GPS week number, aka WN [week] + int i_URA; //!< ED Accuracy Index + int i_signal_health; //!< Signal health (L1/L2/L5) + double d_Top; //!< Data predict time of week + double d_DELTA_A; //!< Semi-major axis difference at reference time + double d_A_DOT; //!< Change rate in semi-major axis + double d_Delta_n; //!< Mean Motion Difference From Computed Value [semi-circles/s] + double d_DELTA_DOT_N; //!< Rate of mean motion difference from computed value + double d_M_0; //!< Mean Anomaly at Reference Time [semi-circles] + double d_e_eccentricity; //!< Eccentricity + double d_OMEGA; //!< Argument of Perigee [semi-cicles] + double d_OMEGA0; //!< Longitude of Ascending Node of Orbit Plane at Weekly Epoch [semi-cicles] + double d_Toe1; //!< Ephemeris data reference time of week (Ref. 20.3.3.4.3 IS-GPS-200E) [s] + double d_Toe2; //!< Ephemeris data reference time of week (Ref. 20.3.3.4.3 IS-GPS-200E) [s] + double d_DELTA_OMEGA_DOT; //!< Rate of Right Ascension difference [semi-circles/s] + double d_i_0; //!< Inclination Angle at Reference Time [semi-circles] + double d_IDOT; //!< Rate of Inclination Angle [semi-circles/s] + double d_Cis; //!< Amplitude of the Sine Harmonic Correction Term to the Angle of Inclination [rad] + double d_Cic; //!< Amplitude of the Cosine Harmonic Correction Term to the Angle of Inclination [rad] + double d_Crs; //!< Amplitude of the Sine Harmonic Correction Term to the Orbit Radius [m] + double d_Crc; //!< Amplitude of the Cosine Harmonic Correction Term to the Orbit Radius [m] + double d_Cus; //!< Amplitude of the Sine Harmonic Correction Term to the Argument of Latitude [rad] + double d_Cuc; //!< Amplitude of the Cosine Harmonic Correction Term to the Argument of Latitude [rad] //Clock Correction and Accuracy Parameters - double d_Toc; //!< clock data reference time (Ref. 20.3.3.3.3.1 IS-GPS-200E) [s] - double d_A_f0; //!< Coefficient 0 of code phase offset model [s] - double d_A_f1; //!< Coefficient 1 of code phase offset model [s/s] - double d_A_f2; //!< Coefficient 2 of code phase offset model [s/s^2] + double d_Toc; //!< clock data reference time (Ref. 20.3.3.3.3.1 IS-GPS-200E) [s] + double d_A_f0; //!< Coefficient 0 of code phase offset model [s] + double d_A_f1; //!< Coefficient 1 of code phase offset model [s/s] + double d_A_f2; //!< Coefficient 2 of code phase offset model [s/s^2] - double d_URA0; //! + template /*! * \brief Serialize is a boost standard method to be called by the boost XML serialization. Here is used to save the ephemeris data on disk file. @@ -133,37 +134,39 @@ public: inline void serialize(Archive& archive, const unsigned int version) { using boost::serialization::make_nvp; - if(version){}; + if (version) + { + }; - archive & make_nvp("i_satellite_PRN", i_satellite_PRN); // SV PRN NUMBER - archive & make_nvp("d_TOW", d_TOW); //!< Time of GPS Week of the ephemeris set (taken from subframes TOW) [s] - archive & make_nvp("d_Crs", d_Crs); //!< Amplitude of the Sine Harmonic Correction Term to the Orbit Radius [m] - archive & make_nvp("d_M_0", d_M_0); //!< Mean Anomaly at Reference Time [semi-circles] - archive & make_nvp("d_Cuc", d_Cuc); //!< Amplitude of the Cosine Harmonic Correction Term to the Argument of Latitude [rad] - archive & make_nvp("d_e_eccentricity", d_e_eccentricity); //!< Eccentricity [dimensionless] - archive & make_nvp("d_Cus", d_Cus); //!< Amplitude of the Sine Harmonic Correction Term to the Argument of Latitude [rad] - archive & make_nvp("d_Toe1", d_Toe1); //!< Ephemeris data reference time of week (Ref. 20.3.3.4.3 IS-GPS-200E) [s] - archive & make_nvp("d_Toe2", d_Toe2); //!< Ephemeris data reference time of week (Ref. 20.3.3.4.3 IS-GPS-200E) [s] - archive & make_nvp("d_Toc", d_Toc); //!< clock data reference time (Ref. 20.3.3.3.3.1 IS-GPS-200E) [s] - archive & make_nvp("d_Cic", d_Cic); //!< Amplitude of the Cosine Harmonic Correction Term to the Angle of Inclination [rad] - archive & make_nvp("d_OMEGA0", d_OMEGA0); //!< Longitude of Ascending Node of Orbit Plane at Weekly Epoch [semi-circles] - archive & make_nvp("d_Cis", d_Cis); //!< Amplitude of the Sine Harmonic Correction Term to the Angle of Inclination [rad] - archive & make_nvp("d_i_0", d_i_0); //!< Inclination Angle at Reference Time [semi-circles] - archive & make_nvp("d_Crc", d_Crc); //!< Amplitude of the Cosine Harmonic Correction Term to the Orbit Radius [m] - archive & make_nvp("d_OMEGA", d_OMEGA); //!< Argument of Perigee [semi-cicles] - archive & make_nvp("d_IDOT", d_IDOT); //!< Rate of Inclination Angle [semi-circles/s] - archive & make_nvp("i_GPS_week", i_GPS_week); //!< GPS week number, aka WN [week] - archive & make_nvp("d_TGD", d_TGD); //!< Estimated Group Delay Differential: L1-L2 correction term only for the benefit of "L1 P(Y)" or "L2 P(Y)" s users [s] - archive & make_nvp("d_DELTA_A", d_DELTA_A); //!< Semi-major axis difference at reference time [m] - archive & make_nvp("d_A_DOT", d_A_DOT); //!< Change rate in semi-major axis [m/s] - archive & make_nvp("d_DELTA_OMEGA_DOT", d_DELTA_OMEGA_DOT); //!< Rate of Right Ascension difference [semi-circles/s] - archive & make_nvp("d_A_f0", d_A_f0); //!< Coefficient 0 of code phase offset model [s] - archive & make_nvp("d_A_f1", d_A_f1); //!< Coefficient 1 of code phase offset model [s/s] - archive & make_nvp("d_A_f2", d_A_f2); //!< Coefficient 2 of code phase offset model [s/s^2] + archive& make_nvp("i_satellite_PRN", i_satellite_PRN); // SV PRN NUMBER + archive& make_nvp("d_TOW", d_TOW); //!< Time of GPS Week of the ephemeris set (taken from subframes TOW) [s] + archive& make_nvp("d_Crs", d_Crs); //!< Amplitude of the Sine Harmonic Correction Term to the Orbit Radius [m] + archive& make_nvp("d_M_0", d_M_0); //!< Mean Anomaly at Reference Time [semi-circles] + archive& make_nvp("d_Cuc", d_Cuc); //!< Amplitude of the Cosine Harmonic Correction Term to the Argument of Latitude [rad] + archive& make_nvp("d_e_eccentricity", d_e_eccentricity); //!< Eccentricity [dimensionless] + archive& make_nvp("d_Cus", d_Cus); //!< Amplitude of the Sine Harmonic Correction Term to the Argument of Latitude [rad] + archive& make_nvp("d_Toe1", d_Toe1); //!< Ephemeris data reference time of week (Ref. 20.3.3.4.3 IS-GPS-200E) [s] + archive& make_nvp("d_Toe2", d_Toe2); //!< Ephemeris data reference time of week (Ref. 20.3.3.4.3 IS-GPS-200E) [s] + archive& make_nvp("d_Toc", d_Toc); //!< clock data reference time (Ref. 20.3.3.3.3.1 IS-GPS-200E) [s] + archive& make_nvp("d_Cic", d_Cic); //!< Amplitude of the Cosine Harmonic Correction Term to the Angle of Inclination [rad] + archive& make_nvp("d_OMEGA0", d_OMEGA0); //!< Longitude of Ascending Node of Orbit Plane at Weekly Epoch [semi-circles] + archive& make_nvp("d_Cis", d_Cis); //!< Amplitude of the Sine Harmonic Correction Term to the Angle of Inclination [rad] + archive& make_nvp("d_i_0", d_i_0); //!< Inclination Angle at Reference Time [semi-circles] + archive& make_nvp("d_Crc", d_Crc); //!< Amplitude of the Cosine Harmonic Correction Term to the Orbit Radius [m] + archive& make_nvp("d_OMEGA", d_OMEGA); //!< Argument of Perigee [semi-cicles] + archive& make_nvp("d_IDOT", d_IDOT); //!< Rate of Inclination Angle [semi-circles/s] + archive& make_nvp("i_GPS_week", i_GPS_week); //!< GPS week number, aka WN [week] + archive& make_nvp("d_TGD", d_TGD); //!< Estimated Group Delay Differential: L1-L2 correction term only for the benefit of "L1 P(Y)" or "L2 P(Y)" s users [s] + archive& make_nvp("d_DELTA_A", d_DELTA_A); //!< Semi-major axis difference at reference time [m] + archive& make_nvp("d_A_DOT", d_A_DOT); //!< Change rate in semi-major axis [m/s] + archive& make_nvp("d_DELTA_OMEGA_DOT", d_DELTA_OMEGA_DOT); //!< Rate of Right Ascension difference [semi-circles/s] + archive& make_nvp("d_A_f0", d_A_f0); //!< Coefficient 0 of code phase offset model [s] + archive& make_nvp("d_A_f1", d_A_f1); //!< Coefficient 1 of code phase offset model [s/s] + archive& make_nvp("d_A_f2", d_A_f2); //!< Coefficient 2 of code phase offset model [s/s^2] - archive & make_nvp("b_integrity_status_flag", b_integrity_status_flag); - archive & make_nvp("b_alert_flag", b_alert_flag); //!< If true, indicates that the SV URA may be worse than indicated in d_SV_accuracy, use that SV at our own risk. - archive & make_nvp("b_antispoofing_flag", b_antispoofing_flag); //!< If true, the AntiSpoofing mode is ON in that SV + archive& make_nvp("b_integrity_status_flag", b_integrity_status_flag); + archive& make_nvp("b_alert_flag", b_alert_flag); //!< If true, indicates that the SV URA may be worse than indicated in d_SV_accuracy, use that SV at our own risk. + archive& make_nvp("b_antispoofing_flag", b_antispoofing_flag); //!< If true, the AntiSpoofing mode is ON in that SV } /*! diff --git a/src/core/system_parameters/gps_cnav_iono.cc b/src/core/system_parameters/gps_cnav_iono.cc index 8a7e3fd03..26973e8bf 100644 --- a/src/core/system_parameters/gps_cnav_iono.cc +++ b/src/core/system_parameters/gps_cnav_iono.cc @@ -44,4 +44,3 @@ Gps_CNAV_Iono::Gps_CNAV_Iono() d_beta2 = 0.0; d_beta3 = 0.0; } - diff --git a/src/core/system_parameters/gps_cnav_iono.h b/src/core/system_parameters/gps_cnav_iono.h index 6f7332c0b..9fac4fa7b 100644 --- a/src/core/system_parameters/gps_cnav_iono.h +++ b/src/core/system_parameters/gps_cnav_iono.h @@ -45,20 +45,20 @@ class Gps_CNAV_Iono { public: - bool valid; //!< Valid flag + bool valid; //!< Valid flag // Ionospheric parameters - double d_alpha0; //!< Coefficient 0 of a cubic equation representing the amplitude of the vertical delay [s] - double d_alpha1; //!< Coefficient 1 of a cubic equation representing the amplitude of the vertical delay [s/semi-circle] - double d_alpha2; //!< Coefficient 2 of a cubic equation representing the amplitude of the vertical delay [s(semi-circle)^2] - double d_alpha3; //!< Coefficient 3 of a cubic equation representing the amplitude of the vertical delay [s(semi-circle)^3] - double d_beta0; //!< Coefficient 0 of a cubic equation representing the period of the model [s] - double d_beta1; //!< Coefficient 1 of a cubic equation representing the period of the model [s/semi-circle] - double d_beta2; //!< Coefficient 2 of a cubic equation representing the period of the model [s(semi-circle)^2] - double d_beta3; //!< Coefficient 3 of a cubic equation representing the period of the model [s(semi-circle)^3] + double d_alpha0; //!< Coefficient 0 of a cubic equation representing the amplitude of the vertical delay [s] + double d_alpha1; //!< Coefficient 1 of a cubic equation representing the amplitude of the vertical delay [s/semi-circle] + double d_alpha2; //!< Coefficient 2 of a cubic equation representing the amplitude of the vertical delay [s(semi-circle)^2] + double d_alpha3; //!< Coefficient 3 of a cubic equation representing the amplitude of the vertical delay [s(semi-circle)^3] + double d_beta0; //!< Coefficient 0 of a cubic equation representing the period of the model [s] + double d_beta1; //!< Coefficient 1 of a cubic equation representing the period of the model [s/semi-circle] + double d_beta2; //!< Coefficient 2 of a cubic equation representing the period of the model [s(semi-circle)^2] + double d_beta3; //!< Coefficient 3 of a cubic equation representing the period of the model [s(semi-circle)^3] - Gps_CNAV_Iono(); //!< Default constructor + Gps_CNAV_Iono(); //!< Default constructor - template + template /*! * \brief Serialize is a boost standard method to be called by the boost XML serialization. Here is used to save the ephemeris data on disk file. @@ -66,15 +66,17 @@ public: inline void serialize(Archive& archive, const unsigned int version) const { using boost::serialization::make_nvp; - if(version){}; - archive & make_nvp("d_alpha0",d_alpha0); - archive & make_nvp("d_alpha1",d_alpha1); - archive & make_nvp("d_alpha2",d_alpha2); - archive & make_nvp("d_alpha3",d_alpha3); - archive & make_nvp("d_beta0",d_beta0); - archive & make_nvp("d_beta1",d_beta1); - archive & make_nvp("d_beta2",d_beta2); - archive & make_nvp("d_beta3",d_beta3); + if (version) + { + }; + archive& make_nvp("d_alpha0", d_alpha0); + archive& make_nvp("d_alpha1", d_alpha1); + archive& make_nvp("d_alpha2", d_alpha2); + archive& make_nvp("d_alpha3", d_alpha3); + archive& make_nvp("d_beta0", d_beta0); + archive& make_nvp("d_beta1", d_beta1); + archive& make_nvp("d_beta2", d_beta2); + archive& make_nvp("d_beta3", d_beta3); } }; diff --git a/src/core/system_parameters/gps_cnav_navigation_message.cc b/src/core/system_parameters/gps_cnav_navigation_message.cc index 1bdc48360..20a0dd5e7 100644 --- a/src/core/system_parameters/gps_cnav_navigation_message.cc +++ b/src/core/system_parameters/gps_cnav_navigation_message.cc @@ -63,7 +63,7 @@ Gps_CNAV_Navigation_Message::Gps_CNAV_Navigation_Message() { reset(); Gnss_Satellite gnss_satellite_ = Gnss_Satellite(); - for(unsigned int prn_ = 1; prn_ < 33; prn_++) + for (unsigned int prn_ = 1; prn_ < 33; prn_++) { satelliteBlock[prn_] = gnss_satellite_.what_block("GPS", prn_); } @@ -72,8 +72,7 @@ Gps_CNAV_Navigation_Message::Gps_CNAV_Navigation_Message() } - -bool Gps_CNAV_Navigation_Message::read_navigation_bool(std::bitset bits, const std::vector> parameter) +bool Gps_CNAV_Navigation_Message::read_navigation_bool(std::bitset bits, const std::vector> parameter) { bool value; @@ -89,7 +88,7 @@ bool Gps_CNAV_Navigation_Message::read_navigation_bool(std::bitset bits, const std::vector> parameter) +unsigned long int Gps_CNAV_Navigation_Message::read_navigation_unsigned(std::bitset bits, const std::vector> parameter) { unsigned long int value = 0; int num_of_slices = parameter.size(); @@ -97,10 +96,10 @@ unsigned long int Gps_CNAV_Navigation_Message::read_navigation_unsigned(std::bit { for (int j = 0; j < parameter[i].second; j++) { - value <<= 1; //shift left + value <<= 1; //shift left if (bits[GPS_CNAV_DATA_PAGE_BITS - parameter[i].first - j] == 1) { - value += 1; // insert the bit + value += 1; // insert the bit } } } @@ -108,18 +107,18 @@ unsigned long int Gps_CNAV_Navigation_Message::read_navigation_unsigned(std::bit } -signed long int Gps_CNAV_Navigation_Message::read_navigation_signed(std::bitset bits, const std::vector> parameter) +signed long int Gps_CNAV_Navigation_Message::read_navigation_signed(std::bitset bits, const std::vector> parameter) { signed long int value = 0; int num_of_slices = parameter.size(); // Discriminate between 64 bits and 32 bits compiler int long_int_size_bytes = sizeof(signed long int); - if (long_int_size_bytes == 8) // if a long int takes 8 bytes, we are in a 64 bits system + if (long_int_size_bytes == 8) // if a long int takes 8 bytes, we are in a 64 bits system { // read the MSB and perform the sign extension if (bits[GPS_CNAV_DATA_PAGE_BITS - parameter[0].first] == 1) { - value ^= 0xFFFFFFFFFFFFFFFF; //64 bits variable + value ^= 0xFFFFFFFFFFFFFFFF; //64 bits variable } else { @@ -130,11 +129,11 @@ signed long int Gps_CNAV_Navigation_Message::read_navigation_signed(std::bitset< { for (int j = 0; j < parameter[i].second; j++) { - value <<= 1; //shift left - value &= 0xFFFFFFFFFFFFFFFE; //reset the corresponding bit (for the 64 bits variable) + value <<= 1; //shift left + value &= 0xFFFFFFFFFFFFFFFE; //reset the corresponding bit (for the 64 bits variable) if (bits[GPS_CNAV_DATA_PAGE_BITS - parameter[i].first - j] == 1) { - value += 1; // insert the bit + value += 1; // insert the bit } } } @@ -155,11 +154,11 @@ signed long int Gps_CNAV_Navigation_Message::read_navigation_signed(std::bitset< { for (int j = 0; j < parameter[i].second; j++) { - value <<= 1; //shift left - value &= 0xFFFFFFFE; //reset the corresponding bit + value <<= 1; //shift left + value &= 0xFFFFFFFE; //reset the corresponding bit if (bits[GPS_CNAV_DATA_PAGE_BITS - parameter[i].first - j] == 1) { - value += 1; // insert the bit + value += 1; // insert the bit } } } @@ -188,160 +187,160 @@ void Gps_CNAV_Navigation_Message::decode_page(std::bitset(read_navigation_unsigned(data_bits, CNAV_MSG_TYPE)); - switch(page_type) - { - case 10: // Ephemeris 1/2 - ephemeris_record.i_GPS_week = static_cast(read_navigation_unsigned(data_bits, CNAV_WN)); - ephemeris_record.i_signal_health = static_cast(read_navigation_unsigned(data_bits, CNAV_HEALTH)); - ephemeris_record.d_Top = static_cast(read_navigation_unsigned(data_bits, CNAV_TOP1)); - ephemeris_record.d_Top = ephemeris_record.d_Top * CNAV_TOP1_LSB; - ephemeris_record.d_URA0 = static_cast(read_navigation_signed(data_bits, CNAV_URA)); - ephemeris_record.d_Toe1 = static_cast(read_navigation_unsigned(data_bits, CNAV_TOE1)); - ephemeris_record.d_Toe1 = ephemeris_record.d_Toe1 * CNAV_TOE1_LSB; - ephemeris_record.d_DELTA_A = static_cast(read_navigation_signed(data_bits, CNAV_DELTA_A)); - ephemeris_record.d_DELTA_A = ephemeris_record.d_DELTA_A * CNAV_DELTA_A_LSB; - ephemeris_record.d_A_DOT = static_cast(read_navigation_signed(data_bits, CNAV_A_DOT)); - ephemeris_record.d_A_DOT = ephemeris_record.d_A_DOT * CNAV_A_DOT_LSB; - ephemeris_record.d_Delta_n = static_cast(read_navigation_signed(data_bits, CNAV_DELTA_N0)); - ephemeris_record.d_Delta_n = ephemeris_record.d_Delta_n * CNAV_DELTA_N0_LSB; - ephemeris_record.d_DELTA_DOT_N = static_cast(read_navigation_signed(data_bits, CNAV_DELTA_N0_DOT)); - ephemeris_record.d_DELTA_DOT_N = ephemeris_record.d_DELTA_DOT_N * CNAV_DELTA_N0_DOT_LSB; - ephemeris_record.d_M_0 = static_cast(read_navigation_signed(data_bits, CNAV_M0)); - ephemeris_record.d_M_0 = ephemeris_record.d_M_0 * CNAV_M0_LSB; - ephemeris_record.d_e_eccentricity = static_cast(read_navigation_unsigned(data_bits, CNAV_E_ECCENTRICITY)); - ephemeris_record.d_e_eccentricity = ephemeris_record.d_e_eccentricity * CNAV_E_ECCENTRICITY_LSB; - ephemeris_record.d_OMEGA = static_cast(read_navigation_signed(data_bits, CNAV_OMEGA)); - ephemeris_record.d_OMEGA = ephemeris_record.d_OMEGA * CNAV_OMEGA_LSB; + switch (page_type) + { + case 10: // Ephemeris 1/2 + ephemeris_record.i_GPS_week = static_cast(read_navigation_unsigned(data_bits, CNAV_WN)); + ephemeris_record.i_signal_health = static_cast(read_navigation_unsigned(data_bits, CNAV_HEALTH)); + ephemeris_record.d_Top = static_cast(read_navigation_unsigned(data_bits, CNAV_TOP1)); + ephemeris_record.d_Top = ephemeris_record.d_Top * CNAV_TOP1_LSB; + ephemeris_record.d_URA0 = static_cast(read_navigation_signed(data_bits, CNAV_URA)); + ephemeris_record.d_Toe1 = static_cast(read_navigation_unsigned(data_bits, CNAV_TOE1)); + ephemeris_record.d_Toe1 = ephemeris_record.d_Toe1 * CNAV_TOE1_LSB; + ephemeris_record.d_DELTA_A = static_cast(read_navigation_signed(data_bits, CNAV_DELTA_A)); + ephemeris_record.d_DELTA_A = ephemeris_record.d_DELTA_A * CNAV_DELTA_A_LSB; + ephemeris_record.d_A_DOT = static_cast(read_navigation_signed(data_bits, CNAV_A_DOT)); + ephemeris_record.d_A_DOT = ephemeris_record.d_A_DOT * CNAV_A_DOT_LSB; + ephemeris_record.d_Delta_n = static_cast(read_navigation_signed(data_bits, CNAV_DELTA_N0)); + ephemeris_record.d_Delta_n = ephemeris_record.d_Delta_n * CNAV_DELTA_N0_LSB; + ephemeris_record.d_DELTA_DOT_N = static_cast(read_navigation_signed(data_bits, CNAV_DELTA_N0_DOT)); + ephemeris_record.d_DELTA_DOT_N = ephemeris_record.d_DELTA_DOT_N * CNAV_DELTA_N0_DOT_LSB; + ephemeris_record.d_M_0 = static_cast(read_navigation_signed(data_bits, CNAV_M0)); + ephemeris_record.d_M_0 = ephemeris_record.d_M_0 * CNAV_M0_LSB; + ephemeris_record.d_e_eccentricity = static_cast(read_navigation_unsigned(data_bits, CNAV_E_ECCENTRICITY)); + ephemeris_record.d_e_eccentricity = ephemeris_record.d_e_eccentricity * CNAV_E_ECCENTRICITY_LSB; + ephemeris_record.d_OMEGA = static_cast(read_navigation_signed(data_bits, CNAV_OMEGA)); + ephemeris_record.d_OMEGA = ephemeris_record.d_OMEGA * CNAV_OMEGA_LSB; - ephemeris_record.b_integrity_status_flag = static_cast(read_navigation_bool(data_bits, CNAV_INTEGRITY_FLAG)); - ephemeris_record.b_l2c_phasing_flag = static_cast(read_navigation_bool(data_bits, CNAV_L2_PHASING_FLAG)); + ephemeris_record.b_integrity_status_flag = static_cast(read_navigation_bool(data_bits, CNAV_INTEGRITY_FLAG)); + ephemeris_record.b_l2c_phasing_flag = static_cast(read_navigation_bool(data_bits, CNAV_L2_PHASING_FLAG)); - b_flag_ephemeris_1 = true; - break; - case 11: // Ephemeris 2/2 - ephemeris_record.d_Toe2 = static_cast(read_navigation_unsigned(data_bits, CNAV_TOE2)); - ephemeris_record.d_Toe2 = ephemeris_record.d_Toe2 * CNAV_TOE2_LSB; - ephemeris_record.d_OMEGA0 = static_cast(read_navigation_signed(data_bits, CNAV_OMEGA0)); - ephemeris_record.d_OMEGA0 = ephemeris_record.d_OMEGA0 * CNAV_OMEGA0_LSB; - ephemeris_record.d_DELTA_OMEGA_DOT = static_cast(read_navigation_signed(data_bits, CNAV_DELTA_OMEGA_DOT)); - ephemeris_record.d_DELTA_OMEGA_DOT = ephemeris_record.d_DELTA_OMEGA_DOT * CNAV_DELTA_OMEGA_DOT_LSB; - ephemeris_record.d_i_0 = static_cast(read_navigation_signed(data_bits, CNAV_I0)); - ephemeris_record.d_i_0 = ephemeris_record.d_i_0 * CNAV_I0_LSB; - ephemeris_record.d_IDOT = static_cast(read_navigation_signed(data_bits, CNAV_I0_DOT)); - ephemeris_record.d_IDOT = ephemeris_record.d_IDOT * CNAV_I0_DOT_LSB; - ephemeris_record.d_Cis = static_cast(read_navigation_signed(data_bits, CNAV_CIS)); - ephemeris_record.d_Cis = ephemeris_record.d_Cis * CNAV_CIS_LSB; - ephemeris_record.d_Cic = static_cast(read_navigation_signed(data_bits, CNAV_CIC)); - ephemeris_record.d_Cic = ephemeris_record.d_Cic * CNAV_CIC_LSB; - ephemeris_record.d_Crs = static_cast(read_navigation_signed(data_bits, CNAV_CRS)); - ephemeris_record.d_Crs = ephemeris_record.d_Crs * CNAV_CRS_LSB; - ephemeris_record.d_Crc = static_cast(read_navigation_signed(data_bits, CNAV_CRC)); - ephemeris_record.d_Cic = ephemeris_record.d_Cic * CNAV_CRC_LSB; - ephemeris_record.d_Cus = static_cast(read_navigation_signed(data_bits, CNAV_CUS)); - ephemeris_record.d_Cus = ephemeris_record.d_Cus * CNAV_CUS_LSB; - ephemeris_record.d_Cuc = static_cast(read_navigation_signed(data_bits, CNAV_CUC)); - ephemeris_record.d_Cuc = ephemeris_record.d_Cuc * CNAV_CUS_LSB; - b_flag_ephemeris_2 = true; - break; - case 30: // (CLOCK, IONO, GRUP DELAY) - //clock - ephemeris_record.d_Toc = static_cast(read_navigation_unsigned(data_bits, CNAV_TOC)); - ephemeris_record.d_Toc = ephemeris_record.d_Toc * CNAV_TOC_LSB; - ephemeris_record.d_URA0 = static_cast(read_navigation_signed(data_bits, CNAV_URA_NED0)); - ephemeris_record.d_URA1 = static_cast(read_navigation_unsigned(data_bits, CNAV_URA_NED1)); - ephemeris_record.d_URA2 = static_cast(read_navigation_unsigned(data_bits, CNAV_URA_NED2)); - ephemeris_record.d_A_f0 = static_cast(read_navigation_signed(data_bits, CNAV_AF0)); - ephemeris_record.d_A_f0 = ephemeris_record.d_A_f0 * CNAV_AF0_LSB; - ephemeris_record.d_A_f1 = static_cast(read_navigation_signed(data_bits, CNAV_AF1)); - ephemeris_record.d_A_f1 = ephemeris_record.d_A_f1 * CNAV_AF1_LSB; - ephemeris_record.d_A_f2 = static_cast(read_navigation_signed(data_bits, CNAV_AF2)); - ephemeris_record.d_A_f2 = ephemeris_record.d_A_f2 * CNAV_AF2_LSB; - //group delays - ephemeris_record.d_TGD = static_cast(read_navigation_signed(data_bits, CNAV_TGD)); - ephemeris_record.d_TGD = ephemeris_record.d_TGD * CNAV_TGD_LSB; - ephemeris_record.d_ISCL1 = static_cast(read_navigation_signed(data_bits, CNAV_ISCL1)); - ephemeris_record.d_ISCL1 = ephemeris_record.d_ISCL1 * CNAV_ISCL1_LSB; - ephemeris_record.d_ISCL2 = static_cast(read_navigation_signed(data_bits, CNAV_ISCL2)); - ephemeris_record.d_ISCL2 = ephemeris_record.d_ISCL2 * CNAV_ISCL2_LSB; - ephemeris_record.d_ISCL5I = static_cast(read_navigation_signed(data_bits, CNAV_ISCL5I)); - ephemeris_record.d_ISCL5I = ephemeris_record.d_ISCL5I * CNAV_ISCL5I_LSB; - ephemeris_record.d_ISCL5Q = static_cast(read_navigation_signed(data_bits, CNAV_ISCL5Q)); - ephemeris_record.d_ISCL5Q = ephemeris_record.d_ISCL5Q * CNAV_ISCL5Q_LSB; - //iono - iono_record.d_alpha0 = static_cast(read_navigation_signed(data_bits, CNAV_ALPHA0)); - iono_record.d_alpha0 = iono_record.d_alpha0 * CNAV_ALPHA0_LSB; - iono_record.d_alpha1 = static_cast(read_navigation_signed(data_bits, CNAV_ALPHA1)); - iono_record.d_alpha1 = iono_record.d_alpha1 * CNAV_ALPHA1_LSB; - iono_record.d_alpha2 = static_cast(read_navigation_signed(data_bits, CNAV_ALPHA2)); - iono_record.d_alpha2 = iono_record.d_alpha2 * CNAV_ALPHA2_LSB; - iono_record.d_alpha3 = static_cast(read_navigation_signed(data_bits, CNAV_ALPHA3)); - iono_record.d_alpha3 = iono_record.d_alpha3 * CNAV_ALPHA3_LSB; - iono_record.d_beta0 = static_cast(read_navigation_signed(data_bits, CNAV_BETA0)); - iono_record.d_beta0 = iono_record.d_beta0 * CNAV_BETA0_LSB; - iono_record.d_beta1 = static_cast(read_navigation_signed(data_bits, CNAV_BETA1)); - iono_record.d_beta1 = iono_record.d_beta1 * CNAV_BETA1_LSB; - iono_record.d_beta2 = static_cast(read_navigation_signed(data_bits, CNAV_BETA2)); - iono_record.d_beta2 = iono_record.d_beta2 * CNAV_BETA2_LSB; - iono_record.d_beta3 = static_cast(read_navigation_signed(data_bits, CNAV_BETA3)); - iono_record.d_beta3 = iono_record.d_beta3 * CNAV_BETA3_LSB; - b_flag_iono_valid = true; - break; - case 33: // (CLOCK & UTC) - ephemeris_record.d_Top = static_cast(read_navigation_unsigned(data_bits, CNAV_TOP1)); - ephemeris_record.d_Top = ephemeris_record.d_Top * CNAV_TOP1_LSB; - ephemeris_record.d_Toc = static_cast(read_navigation_unsigned(data_bits, CNAV_TOC)); - ephemeris_record.d_Toc = ephemeris_record.d_Toc * CNAV_TOC_LSB; - ephemeris_record.d_A_f0 = static_cast(read_navigation_signed(data_bits, CNAV_AF0)); - ephemeris_record.d_A_f0 = ephemeris_record.d_A_f0 * CNAV_AF0_LSB; - ephemeris_record.d_A_f1 = static_cast(read_navigation_signed(data_bits, CNAV_AF1)); - ephemeris_record.d_A_f1 = ephemeris_record.d_A_f1 * CNAV_AF1_LSB; - ephemeris_record.d_A_f2 = static_cast(read_navigation_signed(data_bits, CNAV_AF2)); - ephemeris_record.d_A_f2 = ephemeris_record.d_A_f2 * CNAV_AF2_LSB; + b_flag_ephemeris_1 = true; + break; + case 11: // Ephemeris 2/2 + ephemeris_record.d_Toe2 = static_cast(read_navigation_unsigned(data_bits, CNAV_TOE2)); + ephemeris_record.d_Toe2 = ephemeris_record.d_Toe2 * CNAV_TOE2_LSB; + ephemeris_record.d_OMEGA0 = static_cast(read_navigation_signed(data_bits, CNAV_OMEGA0)); + ephemeris_record.d_OMEGA0 = ephemeris_record.d_OMEGA0 * CNAV_OMEGA0_LSB; + ephemeris_record.d_DELTA_OMEGA_DOT = static_cast(read_navigation_signed(data_bits, CNAV_DELTA_OMEGA_DOT)); + ephemeris_record.d_DELTA_OMEGA_DOT = ephemeris_record.d_DELTA_OMEGA_DOT * CNAV_DELTA_OMEGA_DOT_LSB; + ephemeris_record.d_i_0 = static_cast(read_navigation_signed(data_bits, CNAV_I0)); + ephemeris_record.d_i_0 = ephemeris_record.d_i_0 * CNAV_I0_LSB; + ephemeris_record.d_IDOT = static_cast(read_navigation_signed(data_bits, CNAV_I0_DOT)); + ephemeris_record.d_IDOT = ephemeris_record.d_IDOT * CNAV_I0_DOT_LSB; + ephemeris_record.d_Cis = static_cast(read_navigation_signed(data_bits, CNAV_CIS)); + ephemeris_record.d_Cis = ephemeris_record.d_Cis * CNAV_CIS_LSB; + ephemeris_record.d_Cic = static_cast(read_navigation_signed(data_bits, CNAV_CIC)); + ephemeris_record.d_Cic = ephemeris_record.d_Cic * CNAV_CIC_LSB; + ephemeris_record.d_Crs = static_cast(read_navigation_signed(data_bits, CNAV_CRS)); + ephemeris_record.d_Crs = ephemeris_record.d_Crs * CNAV_CRS_LSB; + ephemeris_record.d_Crc = static_cast(read_navigation_signed(data_bits, CNAV_CRC)); + ephemeris_record.d_Cic = ephemeris_record.d_Cic * CNAV_CRC_LSB; + ephemeris_record.d_Cus = static_cast(read_navigation_signed(data_bits, CNAV_CUS)); + ephemeris_record.d_Cus = ephemeris_record.d_Cus * CNAV_CUS_LSB; + ephemeris_record.d_Cuc = static_cast(read_navigation_signed(data_bits, CNAV_CUC)); + ephemeris_record.d_Cuc = ephemeris_record.d_Cuc * CNAV_CUS_LSB; + b_flag_ephemeris_2 = true; + break; + case 30: // (CLOCK, IONO, GRUP DELAY) + //clock + ephemeris_record.d_Toc = static_cast(read_navigation_unsigned(data_bits, CNAV_TOC)); + ephemeris_record.d_Toc = ephemeris_record.d_Toc * CNAV_TOC_LSB; + ephemeris_record.d_URA0 = static_cast(read_navigation_signed(data_bits, CNAV_URA_NED0)); + ephemeris_record.d_URA1 = static_cast(read_navigation_unsigned(data_bits, CNAV_URA_NED1)); + ephemeris_record.d_URA2 = static_cast(read_navigation_unsigned(data_bits, CNAV_URA_NED2)); + ephemeris_record.d_A_f0 = static_cast(read_navigation_signed(data_bits, CNAV_AF0)); + ephemeris_record.d_A_f0 = ephemeris_record.d_A_f0 * CNAV_AF0_LSB; + ephemeris_record.d_A_f1 = static_cast(read_navigation_signed(data_bits, CNAV_AF1)); + ephemeris_record.d_A_f1 = ephemeris_record.d_A_f1 * CNAV_AF1_LSB; + ephemeris_record.d_A_f2 = static_cast(read_navigation_signed(data_bits, CNAV_AF2)); + ephemeris_record.d_A_f2 = ephemeris_record.d_A_f2 * CNAV_AF2_LSB; + //group delays + ephemeris_record.d_TGD = static_cast(read_navigation_signed(data_bits, CNAV_TGD)); + ephemeris_record.d_TGD = ephemeris_record.d_TGD * CNAV_TGD_LSB; + ephemeris_record.d_ISCL1 = static_cast(read_navigation_signed(data_bits, CNAV_ISCL1)); + ephemeris_record.d_ISCL1 = ephemeris_record.d_ISCL1 * CNAV_ISCL1_LSB; + ephemeris_record.d_ISCL2 = static_cast(read_navigation_signed(data_bits, CNAV_ISCL2)); + ephemeris_record.d_ISCL2 = ephemeris_record.d_ISCL2 * CNAV_ISCL2_LSB; + ephemeris_record.d_ISCL5I = static_cast(read_navigation_signed(data_bits, CNAV_ISCL5I)); + ephemeris_record.d_ISCL5I = ephemeris_record.d_ISCL5I * CNAV_ISCL5I_LSB; + ephemeris_record.d_ISCL5Q = static_cast(read_navigation_signed(data_bits, CNAV_ISCL5Q)); + ephemeris_record.d_ISCL5Q = ephemeris_record.d_ISCL5Q * CNAV_ISCL5Q_LSB; + //iono + iono_record.d_alpha0 = static_cast(read_navigation_signed(data_bits, CNAV_ALPHA0)); + iono_record.d_alpha0 = iono_record.d_alpha0 * CNAV_ALPHA0_LSB; + iono_record.d_alpha1 = static_cast(read_navigation_signed(data_bits, CNAV_ALPHA1)); + iono_record.d_alpha1 = iono_record.d_alpha1 * CNAV_ALPHA1_LSB; + iono_record.d_alpha2 = static_cast(read_navigation_signed(data_bits, CNAV_ALPHA2)); + iono_record.d_alpha2 = iono_record.d_alpha2 * CNAV_ALPHA2_LSB; + iono_record.d_alpha3 = static_cast(read_navigation_signed(data_bits, CNAV_ALPHA3)); + iono_record.d_alpha3 = iono_record.d_alpha3 * CNAV_ALPHA3_LSB; + iono_record.d_beta0 = static_cast(read_navigation_signed(data_bits, CNAV_BETA0)); + iono_record.d_beta0 = iono_record.d_beta0 * CNAV_BETA0_LSB; + iono_record.d_beta1 = static_cast(read_navigation_signed(data_bits, CNAV_BETA1)); + iono_record.d_beta1 = iono_record.d_beta1 * CNAV_BETA1_LSB; + iono_record.d_beta2 = static_cast(read_navigation_signed(data_bits, CNAV_BETA2)); + iono_record.d_beta2 = iono_record.d_beta2 * CNAV_BETA2_LSB; + iono_record.d_beta3 = static_cast(read_navigation_signed(data_bits, CNAV_BETA3)); + iono_record.d_beta3 = iono_record.d_beta3 * CNAV_BETA3_LSB; + b_flag_iono_valid = true; + break; + case 33: // (CLOCK & UTC) + ephemeris_record.d_Top = static_cast(read_navigation_unsigned(data_bits, CNAV_TOP1)); + ephemeris_record.d_Top = ephemeris_record.d_Top * CNAV_TOP1_LSB; + ephemeris_record.d_Toc = static_cast(read_navigation_unsigned(data_bits, CNAV_TOC)); + ephemeris_record.d_Toc = ephemeris_record.d_Toc * CNAV_TOC_LSB; + ephemeris_record.d_A_f0 = static_cast(read_navigation_signed(data_bits, CNAV_AF0)); + ephemeris_record.d_A_f0 = ephemeris_record.d_A_f0 * CNAV_AF0_LSB; + ephemeris_record.d_A_f1 = static_cast(read_navigation_signed(data_bits, CNAV_AF1)); + ephemeris_record.d_A_f1 = ephemeris_record.d_A_f1 * CNAV_AF1_LSB; + ephemeris_record.d_A_f2 = static_cast(read_navigation_signed(data_bits, CNAV_AF2)); + ephemeris_record.d_A_f2 = ephemeris_record.d_A_f2 * CNAV_AF2_LSB; - utc_model_record.d_A0 = static_cast(read_navigation_signed(data_bits, CNAV_A0)); - utc_model_record.d_A0 = utc_model_record.d_A0 * CNAV_A0_LSB; - utc_model_record.d_A1 = static_cast(read_navigation_signed(data_bits, CNAV_A1)); - utc_model_record.d_A1 = utc_model_record.d_A1 * CNAV_A1_LSB; - utc_model_record.d_A2 = static_cast(read_navigation_signed(data_bits, CNAV_A2)); - utc_model_record.d_A2 = utc_model_record.d_A2 * CNAV_A2_LSB; + utc_model_record.d_A0 = static_cast(read_navigation_signed(data_bits, CNAV_A0)); + utc_model_record.d_A0 = utc_model_record.d_A0 * CNAV_A0_LSB; + utc_model_record.d_A1 = static_cast(read_navigation_signed(data_bits, CNAV_A1)); + utc_model_record.d_A1 = utc_model_record.d_A1 * CNAV_A1_LSB; + utc_model_record.d_A2 = static_cast(read_navigation_signed(data_bits, CNAV_A2)); + utc_model_record.d_A2 = utc_model_record.d_A2 * CNAV_A2_LSB; - utc_model_record.d_DeltaT_LS = static_cast(read_navigation_signed(data_bits, CNAV_DELTA_TLS)); - utc_model_record.d_DeltaT_LS = utc_model_record.d_DeltaT_LS * CNAV_DELTA_TLS_LSB; + utc_model_record.d_DeltaT_LS = static_cast(read_navigation_signed(data_bits, CNAV_DELTA_TLS)); + utc_model_record.d_DeltaT_LS = utc_model_record.d_DeltaT_LS * CNAV_DELTA_TLS_LSB; - utc_model_record.d_t_OT = static_cast(read_navigation_signed(data_bits, CNAV_TOT)); - utc_model_record.d_t_OT = utc_model_record.d_t_OT * CNAV_TOT_LSB; + utc_model_record.d_t_OT = static_cast(read_navigation_signed(data_bits, CNAV_TOT)); + utc_model_record.d_t_OT = utc_model_record.d_t_OT * CNAV_TOT_LSB; - utc_model_record.i_WN_T = static_cast(read_navigation_signed(data_bits, CNAV_WN_OT)); - utc_model_record.i_WN_T = utc_model_record.i_WN_T * CNAV_WN_OT_LSB; + utc_model_record.i_WN_T = static_cast(read_navigation_signed(data_bits, CNAV_WN_OT)); + utc_model_record.i_WN_T = utc_model_record.i_WN_T * CNAV_WN_OT_LSB; - utc_model_record.i_WN_LSF = static_cast(read_navigation_signed(data_bits, CNAV_WN_LSF)); - utc_model_record.i_WN_LSF = utc_model_record.i_WN_LSF * CNAV_WN_LSF_LSB; + utc_model_record.i_WN_LSF = static_cast(read_navigation_signed(data_bits, CNAV_WN_LSF)); + utc_model_record.i_WN_LSF = utc_model_record.i_WN_LSF * CNAV_WN_LSF_LSB; - utc_model_record.i_DN = static_cast(read_navigation_signed(data_bits, CNAV_DN)); - utc_model_record.i_DN = utc_model_record.i_DN * CNAV_DN_LSB; + utc_model_record.i_DN = static_cast(read_navigation_signed(data_bits, CNAV_DN)); + utc_model_record.i_DN = utc_model_record.i_DN * CNAV_DN_LSB; - utc_model_record.d_DeltaT_LSF = static_cast(read_navigation_signed(data_bits, CNAV_DELTA_TLSF)); - utc_model_record.d_DeltaT_LSF = utc_model_record.d_DeltaT_LSF * CNAV_DELTA_TLSF_LSB; - b_flag_utc_valid = true; - break; - default: - break; - } + utc_model_record.d_DeltaT_LSF = static_cast(read_navigation_signed(data_bits, CNAV_DELTA_TLSF)); + utc_model_record.d_DeltaT_LSF = utc_model_record.d_DeltaT_LSF * CNAV_DELTA_TLSF_LSB; + b_flag_utc_valid = true; + break; + default: + break; + } } -bool Gps_CNAV_Navigation_Message::have_new_ephemeris() //Check if we have a new ephemeris stored in the galileo navigation class +bool Gps_CNAV_Navigation_Message::have_new_ephemeris() //Check if we have a new ephemeris stored in the galileo navigation class { if (b_flag_ephemeris_1 == true and b_flag_ephemeris_2 == true) { - if (ephemeris_record.d_Toe1 == ephemeris_record.d_Toe2)// and ephemeris_record.d_Toe1==ephemeris_record.d_Toc) + if (ephemeris_record.d_Toe1 == ephemeris_record.d_Toe2) // and ephemeris_record.d_Toe1==ephemeris_record.d_Toc) { //if all ephemeris pages have the same TOE, then they belong to the same block // std::cout << "Ephemeris (1, 2) have been received and belong to the same batch" << std::endl; - b_flag_ephemeris_1 = false;// clear the flag - b_flag_ephemeris_2 = false;// clear the flag + b_flag_ephemeris_1 = false; // clear the flag + b_flag_ephemeris_2 = false; // clear the flag return true; } else @@ -362,11 +361,11 @@ Gps_CNAV_Ephemeris Gps_CNAV_Navigation_Message::get_ephemeris() } -bool Gps_CNAV_Navigation_Message::have_new_iono() //Check if we have a new iono data stored in the galileo navigation class +bool Gps_CNAV_Navigation_Message::have_new_iono() //Check if we have a new iono data stored in the galileo navigation class { if (b_flag_iono_valid == true) { - b_flag_iono_valid = false;// clear the flag + b_flag_iono_valid = false; // clear the flag return true; } else @@ -382,11 +381,11 @@ Gps_CNAV_Iono Gps_CNAV_Navigation_Message::get_iono() } -bool Gps_CNAV_Navigation_Message::have_new_utc_model() //Check if we have a new iono data stored in the galileo navigation class +bool Gps_CNAV_Navigation_Message::have_new_utc_model() //Check if we have a new iono data stored in the galileo navigation class { if (b_flag_utc_valid == true) { - b_flag_utc_valid = false;// clear the flag + b_flag_utc_valid = false; // clear the flag return true; } else diff --git a/src/core/system_parameters/gps_cnav_navigation_message.h b/src/core/system_parameters/gps_cnav_navigation_message.h index 8439f61a2..6128403ca 100644 --- a/src/core/system_parameters/gps_cnav_navigation_message.h +++ b/src/core/system_parameters/gps_cnav_navigation_message.h @@ -47,7 +47,6 @@ //#include "gps_almanac.h" - /*! * \brief This class decodes a GPS CNAV Data message as described in IS-GPS-200H * @@ -56,9 +55,9 @@ class Gps_CNAV_Navigation_Message { private: - unsigned long int read_navigation_unsigned(std::bitset bits, const std::vector> parameter); - signed long int read_navigation_signed(std::bitset bits, const std::vector> parameter); - bool read_navigation_bool(std::bitset bits, const std::vector> parameter); + unsigned long int read_navigation_unsigned(std::bitset bits, const std::vector> parameter); + signed long int read_navigation_signed(std::bitset bits, const std::vector> parameter); + bool read_navigation_bool(std::bitset bits, const std::vector> parameter); Gps_CNAV_Ephemeris ephemeris_record; Gps_CNAV_Iono iono_record; @@ -68,24 +67,24 @@ public: double d_TOW; bool b_flag_ephemeris_1; bool b_flag_ephemeris_2; - bool b_flag_iono_valid; //!< If set, it indicates that the ionospheric parameters are filled and are not yet readed by the get_iono - bool b_flag_utc_valid; //!< If set, it indicates that the utc parameters are filled and are not yet readed by the get_utc_model + bool b_flag_iono_valid; //!< If set, it indicates that the ionospheric parameters are filled and are not yet readed by the get_iono + bool b_flag_utc_valid; //!< If set, it indicates that the utc parameters are filled and are not yet readed by the get_utc_model - std::map satelliteBlock; //!< Map that stores to which block the PRN belongs http://www.navcen.uscg.gov/?Do=constellationStatus + std::map satelliteBlock; //!< Map that stores to which block the PRN belongs http://www.navcen.uscg.gov/?Do=constellationStatus // satellite positions - double d_satpos_X; //!< Earth-fixed coordinate x of the satellite [m]. Intersection of the IERS Reference Meridian (IRM) and the plane passing through the origin and normal to the Z-axis. - double d_satpos_Y; //!< Earth-fixed coordinate y of the satellite [m]. Completes a right-handed, Earth-Centered, Earth-Fixed orthogonal coordinate system. - double d_satpos_Z; //!< Earth-fixed coordinate z of the satellite [m]. The direction of the IERS (International Earth Rotation and Reference Systems Service) Reference Pole (IRP). + double d_satpos_X; //!< Earth-fixed coordinate x of the satellite [m]. Intersection of the IERS Reference Meridian (IRM) and the plane passing through the origin and normal to the Z-axis. + double d_satpos_Y; //!< Earth-fixed coordinate y of the satellite [m]. Completes a right-handed, Earth-Centered, Earth-Fixed orthogonal coordinate system. + double d_satpos_Z; //!< Earth-fixed coordinate z of the satellite [m]. The direction of the IERS (International Earth Rotation and Reference Systems Service) Reference Pole (IRP). // satellite identification info int i_channel_ID; unsigned int i_satellite_PRN; // Satellite velocity - double d_satvel_X; //!< Earth-fixed velocity coordinate x of the satellite [m] - double d_satvel_Y; //!< Earth-fixed velocity coordinate y of the satellite [m] - double d_satvel_Z; //!< Earth-fixed velocity coordinate z of the satellite [m] + double d_satvel_X; //!< Earth-fixed velocity coordinate x of the satellite [m] + double d_satvel_Y; //!< Earth-fixed velocity coordinate y of the satellite [m] + double d_satvel_Z; //!< Earth-fixed velocity coordinate z of the satellite [m] // public functions void reset(); diff --git a/src/core/system_parameters/gps_cnav_utc_model.cc b/src/core/system_parameters/gps_cnav_utc_model.cc index 9159935f3..627e56433 100644 --- a/src/core/system_parameters/gps_cnav_utc_model.cc +++ b/src/core/system_parameters/gps_cnav_utc_model.cc @@ -52,9 +52,9 @@ double Gps_CNAV_Utc_Model::utc_time(double gpstime_corrected, int i_GPS_week) double Delta_t_UTC = d_DeltaT_LS + d_A0 + d_A1 * (gpstime_corrected - d_t_OT + 604800 * static_cast(i_GPS_week - i_WN_T)); // Determine if the effectivity time of the leap second event is in the past - int weeksToLeapSecondEvent = i_WN_LSF - i_GPS_week; + int weeksToLeapSecondEvent = i_WN_LSF - i_GPS_week; - if (weeksToLeapSecondEvent >= 0) // is not in the past + if (weeksToLeapSecondEvent >= 0) // is not in the past { //Detect if the effectivity time and user's time is within six hours = 6 * 60 *60 = 21600 s int secondOfLeapSecondEvent = i_DN * 24 * 60 * 60; @@ -62,9 +62,9 @@ double Gps_CNAV_Utc_Model::utc_time(double gpstime_corrected, int i_GPS_week) { t_utc_daytime = fmod(gpstime_corrected - Delta_t_UTC, 86400); } - else //we are in the same week than the leap second event + else //we are in the same week than the leap second event { - if (std::abs(gpstime_corrected - secondOfLeapSecondEvent) > 21600) + if (std::abs(gpstime_corrected - secondOfLeapSecondEvent) > 21600) { /* 20.3.3.5.2.4a * Whenever the effectivity time indicated by the WN_LSF and the DN values @@ -87,14 +87,14 @@ double Gps_CNAV_Utc_Model::utc_time(double gpstime_corrected, int i_GPS_week) t_utc_daytime = fmod(W, 86400 + d_DeltaT_LSF - d_DeltaT_LS); //implement something to handle a leap second event! } - if ( (gpstime_corrected - secondOfLeapSecondEvent) > 21600) + if ((gpstime_corrected - secondOfLeapSecondEvent) > 21600) { Delta_t_UTC = d_DeltaT_LSF + d_A0 + d_A1 * (gpstime_corrected - d_t_OT + 604800 * static_cast(i_GPS_week - i_WN_T)); t_utc_daytime = fmod(gpstime_corrected - Delta_t_UTC, 86400); } } } - else // the effectivity time is in the past + else // the effectivity time is in the past { /* 20.3.3.5.2.4c * Whenever the effectivity time of the leap second event, as indicated by the @@ -103,7 +103,7 @@ double Gps_CNAV_Utc_Model::utc_time(double gpstime_corrected, int i_GPS_week) * in 20.3.3.5.2.4b,*/ /* FOR CNAV: Replace the 20.3.3.5.2.4c with 30.3.3.6.2 UTC and GPS Time as follows */ double tmp_d = (gpstime_corrected - d_t_OT + 604800 * static_cast(i_GPS_week - i_WN_T)); - Delta_t_UTC = d_DeltaT_LSF + d_A0 + d_A1 * tmp_d + d_A2*tmp_d*tmp_d; + Delta_t_UTC = d_DeltaT_LSF + d_A0 + d_A1 * tmp_d + d_A2 * tmp_d * tmp_d; t_utc_daytime = fmod(gpstime_corrected - Delta_t_UTC, 86400); } diff --git a/src/core/system_parameters/gps_cnav_utc_model.h b/src/core/system_parameters/gps_cnav_utc_model.h index 62e6fd0c0..2208a7b9b 100644 --- a/src/core/system_parameters/gps_cnav_utc_model.h +++ b/src/core/system_parameters/gps_cnav_utc_model.h @@ -67,25 +67,26 @@ public: */ double utc_time(double gpstime_corrected, int i_GPS_week); - template + template /* * \brief Serialize is a boost standard method to be called by the boost XML serialization. Here is used to save the ephemeris data on disk file. */ inline void serialize(Archive& archive, const unsigned int version) { using boost::serialization::make_nvp; - if(version){}; - archive & make_nvp("valid",valid); - archive & make_nvp("d_A1",d_A1); - archive & make_nvp("d_A0",d_A0); - archive & make_nvp("d_t_OT",d_t_OT); - archive & make_nvp("i_WN_T",i_WN_T); - archive & make_nvp("d_DeltaT_LS",d_DeltaT_LS); - archive & make_nvp("i_WN_LSF",i_WN_LSF); - archive & make_nvp("i_DN",i_DN); - archive & make_nvp("d_DeltaT_LSF",d_DeltaT_LSF); + if (version) + { + }; + archive& make_nvp("valid", valid); + archive& make_nvp("d_A1", d_A1); + archive& make_nvp("d_A0", d_A0); + archive& make_nvp("d_t_OT", d_t_OT); + archive& make_nvp("i_WN_T", i_WN_T); + archive& make_nvp("d_DeltaT_LS", d_DeltaT_LS); + archive& make_nvp("i_WN_LSF", i_WN_LSF); + archive& make_nvp("i_DN", i_DN); + archive& make_nvp("d_DeltaT_LSF", d_DeltaT_LSF); } - }; #endif diff --git a/src/core/system_parameters/gps_ephemeris.cc b/src/core/system_parameters/gps_ephemeris.cc index d876f477e..9f0e0ba1a 100644 --- a/src/core/system_parameters/gps_ephemeris.cc +++ b/src/core/system_parameters/gps_ephemeris.cc @@ -63,25 +63,25 @@ Gps_Ephemeris::Gps_Ephemeris() i_SV_health = 0; d_IODE_SF2 = 0; d_IODE_SF3 = 0; - d_TGD = 0; // Estimated Group Delay Differential: L1-L2 correction term only for the benefit of "L1 P(Y)" or "L2 P(Y)" s users [s] - d_IODC = 0; // Issue of Data, Clock - i_AODO = 0; // Age of Data Offset (AODO) term for the navigation message correction table (NMCT) contained in subframe 4 (reference paragraph 20.3.3.5.1.9) [s] + d_TGD = 0; // Estimated Group Delay Differential: L1-L2 correction term only for the benefit of "L1 P(Y)" or "L2 P(Y)" s users [s] + d_IODC = 0; // Issue of Data, Clock + i_AODO = 0; // Age of Data Offset (AODO) term for the navigation message correction table (NMCT) contained in subframe 4 (reference paragraph 20.3.3.5.1.9) [s] - b_fit_interval_flag = false; // indicates the curve-fit interval used by the CS (Block II/IIA/IIR/IIR-M/IIF) and SS (Block IIIA) in determining the ephemeris parameters, as follows: 0 = 4 hours, 1 = greater than 4 hours. + b_fit_interval_flag = false; // indicates the curve-fit interval used by the CS (Block II/IIA/IIR/IIR-M/IIF) and SS (Block IIIA) in determining the ephemeris parameters, as follows: 0 = 4 hours, 1 = greater than 4 hours. d_spare1 = 0; d_spare2 = 0; - d_A_f0 = 0; // Coefficient 0 of code phase offset model [s] - d_A_f1 = 0; // Coefficient 1 of code phase offset model [s/s] - d_A_f2 = 0; // Coefficient 2 of code phase offset model [s/s^2] + d_A_f0 = 0; // Coefficient 0 of code phase offset model [s] + d_A_f1 = 0; // Coefficient 1 of code phase offset model [s/s] + d_A_f2 = 0; // Coefficient 2 of code phase offset model [s/s^2] b_integrity_status_flag = false; b_alert_flag = false; // If true, indicates that the SV URA may be worse than indicated in d_SV_accuracy, use that SV at our own risk. b_antispoofing_flag = false; // If true, the AntiSpoofing mode is ON in that SV auto gnss_sat = Gnss_Satellite(); - std::string _system ("GPS"); - for(unsigned int i = 1; i < 33; i++) + std::string _system("GPS"); + for (unsigned int i = 1; i < 33; i++) { satelliteBlock[i] = gnss_sat.what_block(_system, i); } @@ -100,7 +100,7 @@ Gps_Ephemeris::Gps_Ephemeris() double Gps_Ephemeris::check_t(double time) { double corrTime; - double half_week = 302400.0; // seconds + double half_week = 302400.0; // seconds corrTime = time; if (time > half_week) { @@ -117,21 +117,21 @@ double Gps_Ephemeris::check_t(double time) // 20.3.3.3.3.1 User Algorithm for SV Clock Correction. double Gps_Ephemeris::sv_clock_drift(double transmitTime) { -// double dt; -// dt = check_t(transmitTime - d_Toc); -// -// for (int i = 0; i < 2; i++) -// { -// dt -= d_A_f0 + d_A_f1 * dt + d_A_f2 * (dt * dt); -// } -// d_satClkDrift = d_A_f0 + d_A_f1 * dt + d_A_f2 * (dt * dt); + // double dt; + // dt = check_t(transmitTime - d_Toc); + // + // for (int i = 0; i < 2; i++) + // { + // dt -= d_A_f0 + d_A_f1 * dt + d_A_f2 * (dt * dt); + // } + // d_satClkDrift = d_A_f0 + d_A_f1 * dt + d_A_f2 * (dt * dt); double dt; dt = check_t(transmitTime - d_Toc); d_satClkDrift = d_A_f0 + d_A_f1 * dt + d_A_f2 * (dt * dt) + sv_clock_relativistic_term(transmitTime); //Correct satellite group delay - d_satClkDrift-=d_TGD; + d_satClkDrift -= d_TGD; return d_satClkDrift; } @@ -171,9 +171,9 @@ double Gps_Ephemeris::sv_clock_relativistic_term(double transmitTime) // --- Iteratively compute eccentric anomaly ---------------------------- for (int ii = 1; ii < 20; ii++) { - E_old = E; - E = M + d_e_eccentricity * sin(E); - dE = fmod(E - E_old, 2.0 * GPS_PI); + E_old = E; + E = M + d_e_eccentricity * sin(E); + dE = fmod(E - E_old, 2.0 * GPS_PI); if (fabs(dE) < 1e-12) { //Necessary precision is reached, exit from the loop @@ -230,9 +230,9 @@ double Gps_Ephemeris::satellitePosition(double transmitTime) // --- Iteratively compute eccentric anomaly ---------------------------- for (int ii = 1; ii < 20; ii++) { - E_old = E; - E = M + d_e_eccentricity * sin(E); - dE = fmod(E - E_old, 2.0 * GPS_PI); + E_old = E; + E = M + d_e_eccentricity * sin(E); + dE = fmod(E - E_old, 2.0 * GPS_PI); if (fabs(dE) < 1e-12) { //Necessary precision is reached, exit from the loop @@ -252,16 +252,16 @@ double Gps_Ephemeris::satellitePosition(double transmitTime) //phi = fmod((phi), (2.0 * GPS_PI)); // Correct argument of latitude - u = phi + d_Cuc * cos(2.0 * phi) + d_Cus * sin(2.0 * phi); + u = phi + d_Cuc * cos(2.0 * phi) + d_Cus * sin(2.0 * phi); // Correct radius - r = a * (1.0 - d_e_eccentricity*cos(E)) + d_Crc * cos(2.0 * phi) + d_Crs * sin(2.0 * phi); + r = a * (1.0 - d_e_eccentricity * cos(E)) + d_Crc * cos(2.0 * phi) + d_Crs * sin(2.0 * phi); // Correct inclination i = d_i_0 + d_IDOT * tk + d_Cic * cos(2.0 * phi) + d_Cis * sin(2.0 * phi); // Compute the angle between the ascending node and the Greenwich meridian - Omega = d_OMEGA0 + (d_OMEGA_DOT - OMEGA_EARTH_DOT)*tk - OMEGA_EARTH_DOT * d_Toe; + Omega = d_OMEGA0 + (d_OMEGA_DOT - OMEGA_EARTH_DOT) * tk - OMEGA_EARTH_DOT * d_Toe; // Reduce to between 0 and 2*pi rad //Omega = fmod((Omega + 2.0 * GPS_PI), (2.0 * GPS_PI)); @@ -273,7 +273,7 @@ double Gps_Ephemeris::satellitePosition(double transmitTime) // Satellite's velocity. Can be useful for Vector Tracking loops double Omega_dot = d_OMEGA_DOT - OMEGA_EARTH_DOT; - d_satvel_X = - Omega_dot * (cos(u) * r + sin(u) * r * cos(i)) + d_satpos_X * cos(Omega) - d_satpos_Y * cos(i) * sin(Omega); + d_satvel_X = -Omega_dot * (cos(u) * r + sin(u) * r * cos(i)) + d_satpos_X * cos(Omega) - d_satpos_Y * cos(i) * sin(Omega); d_satvel_Y = Omega_dot * (cos(u) * r * cos(Omega) - sin(u) * r * cos(i) * sin(Omega)) + d_satpos_X * sin(Omega) + d_satpos_Y * cos(i) * cos(Omega); d_satvel_Z = d_satpos_Y * sin(i); diff --git a/src/core/system_parameters/gps_ephemeris.h b/src/core/system_parameters/gps_ephemeris.h index eec5779ce..7dbaa4d3e 100644 --- a/src/core/system_parameters/gps_ephemeris.h +++ b/src/core/system_parameters/gps_ephemeris.h @@ -56,44 +56,45 @@ private: * \param[out] - corrected time, in seconds */ double check_t(double time); -public: - unsigned int i_satellite_PRN; // SV PRN NUMBER - double d_TOW; //!< Time of GPS Week of the ephemeris set (taken from subframes TOW) [s] - double d_Crs; //!< Amplitude of the Sine Harmonic Correction Term to the Orbit Radius [m] - double d_Delta_n; //!< Mean Motion Difference From Computed Value [semi-circles/s] - double d_M_0; //!< Mean Anomaly at Reference Time [semi-circles] - double d_Cuc; //!< Amplitude of the Cosine Harmonic Correction Term to the Argument of Latitude [rad] - double d_e_eccentricity; //!< Eccentricity [dimensionless] - double d_Cus; //!< Amplitude of the Sine Harmonic Correction Term to the Argument of Latitude [rad] - double d_sqrt_A; //!< Square Root of the Semi-Major Axis [sqrt(m)] - double d_Toe; //!< Ephemeris data reference time of week (Ref. 20.3.3.4.3 IS-GPS-200E) [s] - double d_Toc; //!< clock data reference time (Ref. 20.3.3.3.3.1 IS-GPS-200E) [s] - double d_Cic; //!< Amplitude of the Cosine Harmonic Correction Term to the Angle of Inclination [rad] - double d_OMEGA0; //!< Longitude of Ascending Node of Orbit Plane at Weekly Epoch [semi-circles] - double d_Cis; //!< Amplitude of the Sine Harmonic Correction Term to the Angle of Inclination [rad] - double d_i_0; //!< Inclination Angle at Reference Time [semi-circles] - double d_Crc; //!< Amplitude of the Cosine Harmonic Correction Term to the Orbit Radius [m] - double d_OMEGA; //!< Argument of Perigee [semi-cicles] - double d_OMEGA_DOT; //!< Rate of Right Ascension [semi-circles/s] - double d_IDOT; //!< Rate of Inclination Angle [semi-circles/s] - int i_code_on_L2; //!< If 1, P code ON in L2; if 2, C/A code ON in L2; - int i_GPS_week; //!< GPS week number, aka WN [week] - bool b_L2_P_data_flag; //!< When true, indicates that the NAV data stream was commanded OFF on the P-code of the L2 channel - int i_SV_accuracy; //!< User Range Accuracy (URA) index of the SV (reference paragraph 6.2.1) for the standard positioning service user (Ref 20.3.3.3.1.3 IS-GPS-200E) - int i_SV_health; - double d_TGD; //!< Estimated Group Delay Differential: L1-L2 correction term only for the benefit of "L1 P(Y)" or "L2 P(Y)" s users [s] - double d_IODC; //!< Issue of Data, Clock - double d_IODE_SF2; //!< Issue of Data, Ephemeris (IODE), subframe 2 - double d_IODE_SF3; //!< Issue of Data, Ephemeris(IODE), subframe 3 - int i_AODO; //!< Age of Data Offset (AODO) term for the navigation message correction table (NMCT) contained in subframe 4 (reference paragraph 20.3.3.5.1.9) [s] - bool b_fit_interval_flag;//!< indicates the curve-fit interval used by the CS (Block II/IIA/IIR/IIR-M/IIF) and SS (Block IIIA) in determining the ephemeris parameters, as follows: 0 = 4 hours, 1 = greater than 4 hours. +public: + unsigned int i_satellite_PRN; // SV PRN NUMBER + double d_TOW; //!< Time of GPS Week of the ephemeris set (taken from subframes TOW) [s] + double d_Crs; //!< Amplitude of the Sine Harmonic Correction Term to the Orbit Radius [m] + double d_Delta_n; //!< Mean Motion Difference From Computed Value [semi-circles/s] + double d_M_0; //!< Mean Anomaly at Reference Time [semi-circles] + double d_Cuc; //!< Amplitude of the Cosine Harmonic Correction Term to the Argument of Latitude [rad] + double d_e_eccentricity; //!< Eccentricity [dimensionless] + double d_Cus; //!< Amplitude of the Sine Harmonic Correction Term to the Argument of Latitude [rad] + double d_sqrt_A; //!< Square Root of the Semi-Major Axis [sqrt(m)] + double d_Toe; //!< Ephemeris data reference time of week (Ref. 20.3.3.4.3 IS-GPS-200E) [s] + double d_Toc; //!< clock data reference time (Ref. 20.3.3.3.3.1 IS-GPS-200E) [s] + double d_Cic; //!< Amplitude of the Cosine Harmonic Correction Term to the Angle of Inclination [rad] + double d_OMEGA0; //!< Longitude of Ascending Node of Orbit Plane at Weekly Epoch [semi-circles] + double d_Cis; //!< Amplitude of the Sine Harmonic Correction Term to the Angle of Inclination [rad] + double d_i_0; //!< Inclination Angle at Reference Time [semi-circles] + double d_Crc; //!< Amplitude of the Cosine Harmonic Correction Term to the Orbit Radius [m] + double d_OMEGA; //!< Argument of Perigee [semi-cicles] + double d_OMEGA_DOT; //!< Rate of Right Ascension [semi-circles/s] + double d_IDOT; //!< Rate of Inclination Angle [semi-circles/s] + int i_code_on_L2; //!< If 1, P code ON in L2; if 2, C/A code ON in L2; + int i_GPS_week; //!< GPS week number, aka WN [week] + bool b_L2_P_data_flag; //!< When true, indicates that the NAV data stream was commanded OFF on the P-code of the L2 channel + int i_SV_accuracy; //!< User Range Accuracy (URA) index of the SV (reference paragraph 6.2.1) for the standard positioning service user (Ref 20.3.3.3.1.3 IS-GPS-200E) + int i_SV_health; + double d_TGD; //!< Estimated Group Delay Differential: L1-L2 correction term only for the benefit of "L1 P(Y)" or "L2 P(Y)" s users [s] + double d_IODC; //!< Issue of Data, Clock + double d_IODE_SF2; //!< Issue of Data, Ephemeris (IODE), subframe 2 + double d_IODE_SF3; //!< Issue of Data, Ephemeris(IODE), subframe 3 + int i_AODO; //!< Age of Data Offset (AODO) term for the navigation message correction table (NMCT) contained in subframe 4 (reference paragraph 20.3.3.5.1.9) [s] + + bool b_fit_interval_flag; //!< indicates the curve-fit interval used by the CS (Block II/IIA/IIR/IIR-M/IIF) and SS (Block IIIA) in determining the ephemeris parameters, as follows: 0 = 4 hours, 1 = greater than 4 hours. double d_spare1; double d_spare2; - double d_A_f0; //!< Coefficient 0 of code phase offset model [s] - double d_A_f1; //!< Coefficient 1 of code phase offset model [s/s] - double d_A_f2; //!< Coefficient 2 of code phase offset model [s/s^2] + double d_A_f0; //!< Coefficient 0 of code phase offset model [s] + double d_A_f1; //!< Coefficient 1 of code phase offset model [s/s] + double d_A_f2; //!< Coefficient 2 of code phase offset model [s/s^2] // Flags @@ -112,22 +113,22 @@ public: bool b_antispoofing_flag; //!< If true, the AntiSpoofing mode is ON in that SV // clock terms derived from ephemeris data - double d_satClkDrift; //!< GPS clock error - double d_dtr; //!< relativistic clock correction term + double d_satClkDrift; //!< GPS clock error + double d_dtr; //!< relativistic clock correction term // satellite positions - double d_satpos_X; //!< Earth-fixed coordinate x of the satellite [m]. Intersection of the IERS Reference Meridian (IRM) and the plane passing through the origin and normal to the Z-axis. - double d_satpos_Y; //!< Earth-fixed coordinate y of the satellite [m]. Completes a right-handed, Earth-Centered, Earth-Fixed orthogonal coordinate system. - double d_satpos_Z; //!< Earth-fixed coordinate z of the satellite [m]. The direction of the IERS (International Earth Rotation and Reference Systems Service) Reference Pole (IRP). + double d_satpos_X; //!< Earth-fixed coordinate x of the satellite [m]. Intersection of the IERS Reference Meridian (IRM) and the plane passing through the origin and normal to the Z-axis. + double d_satpos_Y; //!< Earth-fixed coordinate y of the satellite [m]. Completes a right-handed, Earth-Centered, Earth-Fixed orthogonal coordinate system. + double d_satpos_Z; //!< Earth-fixed coordinate z of the satellite [m]. The direction of the IERS (International Earth Rotation and Reference Systems Service) Reference Pole (IRP). // Satellite velocity - double d_satvel_X; //!< Earth-fixed velocity coordinate x of the satellite [m] - double d_satvel_Y; //!< Earth-fixed velocity coordinate y of the satellite [m] - double d_satvel_Z; //!< Earth-fixed velocity coordinate z of the satellite [m] + double d_satvel_X; //!< Earth-fixed velocity coordinate x of the satellite [m] + double d_satvel_Y; //!< Earth-fixed velocity coordinate y of the satellite [m] + double d_satvel_Z; //!< Earth-fixed velocity coordinate z of the satellite [m] - std::map satelliteBlock; //!< Map that stores to which block the PRN belongs http://www.navcen.uscg.gov/?Do=constellationStatus + std::map satelliteBlock; //!< Map that stores to which block the PRN belongs http://www.navcen.uscg.gov/?Do=constellationStatus - template + template /*! * \brief Serialize is a boost standard method to be called by the boost XML serialization. Here is used to save the ephemeris data on disk file. @@ -135,49 +136,51 @@ public: inline void serialize(Archive& archive, const unsigned int version) { using boost::serialization::make_nvp; - if(version){}; + if (version) + { + }; - archive & make_nvp("i_satellite_PRN", i_satellite_PRN); // SV PRN NUMBER - archive & make_nvp("d_TOW", d_TOW); //!< Time of GPS Week of the ephemeris set (taken from subframes TOW) [s] - archive & make_nvp("d_IODE_SF2", d_IODE_SF2); - archive & make_nvp("d_IODE_SF3", d_IODE_SF3); - archive & make_nvp("d_Crs", d_Crs); //!< Amplitude of the Sine Harmonic Correction Term to the Orbit Radius [m] - archive & make_nvp("d_Delta_n", d_Delta_n); //!< Mean Motion Difference From Computed Value [semi-circles/s] - archive & make_nvp("d_M_0", d_M_0); //!< Mean Anomaly at Reference Time [semi-circles] - archive & make_nvp("d_Cuc", d_Cuc); //!< Amplitude of the Cosine Harmonic Correction Term to the Argument of Latitude [rad] - archive & make_nvp("d_e_eccentricity", d_e_eccentricity); //!< Eccentricity [dimensionless] - archive & make_nvp("d_Cus", d_Cus); //!< Amplitude of the Sine Harmonic Correction Term to the Argument of Latitude [rad] - archive & make_nvp("d_sqrt_A", d_sqrt_A); //!< Square Root of the Semi-Major Axis [sqrt(m)] - archive & make_nvp("d_Toe", d_Toe); //!< Ephemeris data reference time of week (Ref. 20.3.3.4.3 IS-GPS-200E) [s] - archive & make_nvp("d_Toc", d_Toe); //!< clock data reference time (Ref. 20.3.3.3.3.1 IS-GPS-200E) [s] - archive & make_nvp("d_Cic", d_Cic); //!< Amplitude of the Cosine Harmonic Correction Term to the Angle of Inclination [rad] - archive & make_nvp("d_OMEGA0", d_OMEGA0); //!< Longitude of Ascending Node of Orbit Plane at Weekly Epoch [semi-circles] - archive & make_nvp("d_Cis", d_Cis); //!< Amplitude of the Sine Harmonic Correction Term to the Angle of Inclination [rad] - archive & make_nvp("d_i_0", d_i_0); //!< Inclination Angle at Reference Time [semi-circles] - archive & make_nvp("d_Crc", d_Crc); //!< Amplitude of the Cosine Harmonic Correction Term to the Orbit Radius [m] - archive & make_nvp("d_OMEGA", d_OMEGA); //!< Argument of Perigee [semi-cicles] - archive & make_nvp("d_OMEGA_DOT", d_OMEGA_DOT); //!< Rate of Right Ascension [semi-circles/s] - archive & make_nvp("d_IDOT", d_IDOT); //!< Rate of Inclination Angle [semi-circles/s] - archive & make_nvp("i_code_on_L2", i_code_on_L2); //!< If 1, P code ON in L2; if 2, C/A code ON in L2; - archive & make_nvp("i_GPS_week", i_GPS_week); //!< GPS week number, aka WN [week] - archive & make_nvp("b_L2_P_data_flag", b_L2_P_data_flag); //!< When true, indicates that the NAV data stream was commanded OFF on the P-code of the L2 channel - archive & make_nvp("i_SV_accuracy", i_SV_accuracy); //!< User Range Accuracy (URA) index of the SV (reference paragraph 6.2.1) for the standard positioning service user (Ref 20.3.3.3.1.3 IS-GPS-200E) - archive & make_nvp("i_SV_health", i_SV_health); - archive & make_nvp("d_TGD", d_TGD); //!< Estimated Group Delay Differential: L1-L2 correction term only for the benefit of "L1 P(Y)" or "L2 P(Y)" s users [s] - archive & make_nvp("d_IODC", d_IODC); //!< Issue of Data, Clock - archive & make_nvp("i_AODO", i_AODO); //!< Age of Data Offset (AODO) term for the navigation message correction table (NMCT) contained in subframe 4 (reference paragraph 20.3.3.5.1.9) [s] + archive& make_nvp("i_satellite_PRN", i_satellite_PRN); // SV PRN NUMBER + archive& make_nvp("d_TOW", d_TOW); //!< Time of GPS Week of the ephemeris set (taken from subframes TOW) [s] + archive& make_nvp("d_IODE_SF2", d_IODE_SF2); + archive& make_nvp("d_IODE_SF3", d_IODE_SF3); + archive& make_nvp("d_Crs", d_Crs); //!< Amplitude of the Sine Harmonic Correction Term to the Orbit Radius [m] + archive& make_nvp("d_Delta_n", d_Delta_n); //!< Mean Motion Difference From Computed Value [semi-circles/s] + archive& make_nvp("d_M_0", d_M_0); //!< Mean Anomaly at Reference Time [semi-circles] + archive& make_nvp("d_Cuc", d_Cuc); //!< Amplitude of the Cosine Harmonic Correction Term to the Argument of Latitude [rad] + archive& make_nvp("d_e_eccentricity", d_e_eccentricity); //!< Eccentricity [dimensionless] + archive& make_nvp("d_Cus", d_Cus); //!< Amplitude of the Sine Harmonic Correction Term to the Argument of Latitude [rad] + archive& make_nvp("d_sqrt_A", d_sqrt_A); //!< Square Root of the Semi-Major Axis [sqrt(m)] + archive& make_nvp("d_Toe", d_Toe); //!< Ephemeris data reference time of week (Ref. 20.3.3.4.3 IS-GPS-200E) [s] + archive& make_nvp("d_Toc", d_Toe); //!< clock data reference time (Ref. 20.3.3.3.3.1 IS-GPS-200E) [s] + archive& make_nvp("d_Cic", d_Cic); //!< Amplitude of the Cosine Harmonic Correction Term to the Angle of Inclination [rad] + archive& make_nvp("d_OMEGA0", d_OMEGA0); //!< Longitude of Ascending Node of Orbit Plane at Weekly Epoch [semi-circles] + archive& make_nvp("d_Cis", d_Cis); //!< Amplitude of the Sine Harmonic Correction Term to the Angle of Inclination [rad] + archive& make_nvp("d_i_0", d_i_0); //!< Inclination Angle at Reference Time [semi-circles] + archive& make_nvp("d_Crc", d_Crc); //!< Amplitude of the Cosine Harmonic Correction Term to the Orbit Radius [m] + archive& make_nvp("d_OMEGA", d_OMEGA); //!< Argument of Perigee [semi-cicles] + archive& make_nvp("d_OMEGA_DOT", d_OMEGA_DOT); //!< Rate of Right Ascension [semi-circles/s] + archive& make_nvp("d_IDOT", d_IDOT); //!< Rate of Inclination Angle [semi-circles/s] + archive& make_nvp("i_code_on_L2", i_code_on_L2); //!< If 1, P code ON in L2; if 2, C/A code ON in L2; + archive& make_nvp("i_GPS_week", i_GPS_week); //!< GPS week number, aka WN [week] + archive& make_nvp("b_L2_P_data_flag", b_L2_P_data_flag); //!< When true, indicates that the NAV data stream was commanded OFF on the P-code of the L2 channel + archive& make_nvp("i_SV_accuracy", i_SV_accuracy); //!< User Range Accuracy (URA) index of the SV (reference paragraph 6.2.1) for the standard positioning service user (Ref 20.3.3.3.1.3 IS-GPS-200E) + archive& make_nvp("i_SV_health", i_SV_health); + archive& make_nvp("d_TGD", d_TGD); //!< Estimated Group Delay Differential: L1-L2 correction term only for the benefit of "L1 P(Y)" or "L2 P(Y)" s users [s] + archive& make_nvp("d_IODC", d_IODC); //!< Issue of Data, Clock + archive& make_nvp("i_AODO", i_AODO); //!< Age of Data Offset (AODO) term for the navigation message correction table (NMCT) contained in subframe 4 (reference paragraph 20.3.3.5.1.9) [s] - archive & make_nvp("b_fit_interval_flag", b_fit_interval_flag);//!< indicates the curve-fit interval used by the CS (Block II/IIA/IIR/IIR-M/IIF) and SS (Block IIIA) in determining the ephemeris parameters, as follows: 0 = 4 hours, 1 = greater than 4 hours. - archive & make_nvp("d_spare1", d_spare1); - archive & make_nvp("d_spare2", d_spare2); + archive& make_nvp("b_fit_interval_flag", b_fit_interval_flag); //!< indicates the curve-fit interval used by the CS (Block II/IIA/IIR/IIR-M/IIF) and SS (Block IIIA) in determining the ephemeris parameters, as follows: 0 = 4 hours, 1 = greater than 4 hours. + archive& make_nvp("d_spare1", d_spare1); + archive& make_nvp("d_spare2", d_spare2); - archive & make_nvp("d_A_f0", d_A_f0); //!< Coefficient 0 of code phase offset model [s] - archive & make_nvp("d_A_f1", d_A_f1); //!< Coefficient 1 of code phase offset model [s/s] - archive & make_nvp("d_A_f2", d_A_f2); //!< Coefficient 2 of code phase offset model [s/s^2] + archive& make_nvp("d_A_f0", d_A_f0); //!< Coefficient 0 of code phase offset model [s] + archive& make_nvp("d_A_f1", d_A_f1); //!< Coefficient 1 of code phase offset model [s/s] + archive& make_nvp("d_A_f2", d_A_f2); //!< Coefficient 2 of code phase offset model [s/s^2] - archive & make_nvp("b_integrity_status_flag", b_integrity_status_flag); - archive & make_nvp("b_alert_flag", b_alert_flag); //!< If true, indicates that the SV URA may be worse than indicated in d_SV_accuracy, use that SV at our own risk. - archive & make_nvp("b_antispoofing_flag", b_antispoofing_flag); //!< If true, the AntiSpoofing mode is ON in that SV + archive& make_nvp("b_integrity_status_flag", b_integrity_status_flag); + archive& make_nvp("b_alert_flag", b_alert_flag); //!< If true, indicates that the SV URA may be worse than indicated in d_SV_accuracy, use that SV at our own risk. + archive& make_nvp("b_antispoofing_flag", b_antispoofing_flag); //!< If true, the AntiSpoofing mode is ON in that SV } /*! diff --git a/src/core/system_parameters/gps_iono.cc b/src/core/system_parameters/gps_iono.cc index 48b2b127a..f15183847 100644 --- a/src/core/system_parameters/gps_iono.cc +++ b/src/core/system_parameters/gps_iono.cc @@ -44,4 +44,3 @@ Gps_Iono::Gps_Iono() d_beta2 = 0.0; d_beta3 = 0.0; } - diff --git a/src/core/system_parameters/gps_iono.h b/src/core/system_parameters/gps_iono.h index d13120617..01b28c780 100644 --- a/src/core/system_parameters/gps_iono.h +++ b/src/core/system_parameters/gps_iono.h @@ -45,20 +45,20 @@ class Gps_Iono { public: - bool valid; //!< Valid flag + bool valid; //!< Valid flag // Ionospheric parameters - double d_alpha0; //!< Coefficient 0 of a cubic equation representing the amplitude of the vertical delay [s] - double d_alpha1; //!< Coefficient 1 of a cubic equation representing the amplitude of the vertical delay [s/semi-circle] - double d_alpha2; //!< Coefficient 2 of a cubic equation representing the amplitude of the vertical delay [s(semi-circle)^2] - double d_alpha3; //!< Coefficient 3 of a cubic equation representing the amplitude of the vertical delay [s(semi-circle)^3] - double d_beta0; //!< Coefficient 0 of a cubic equation representing the period of the model [s] - double d_beta1; //!< Coefficient 1 of a cubic equation representing the period of the model [s/semi-circle] - double d_beta2; //!< Coefficient 2 of a cubic equation representing the period of the model [s(semi-circle)^2] - double d_beta3; //!< Coefficient 3 of a cubic equation representing the period of the model [s(semi-circle)^3] + double d_alpha0; //!< Coefficient 0 of a cubic equation representing the amplitude of the vertical delay [s] + double d_alpha1; //!< Coefficient 1 of a cubic equation representing the amplitude of the vertical delay [s/semi-circle] + double d_alpha2; //!< Coefficient 2 of a cubic equation representing the amplitude of the vertical delay [s(semi-circle)^2] + double d_alpha3; //!< Coefficient 3 of a cubic equation representing the amplitude of the vertical delay [s(semi-circle)^3] + double d_beta0; //!< Coefficient 0 of a cubic equation representing the period of the model [s] + double d_beta1; //!< Coefficient 1 of a cubic equation representing the period of the model [s/semi-circle] + double d_beta2; //!< Coefficient 2 of a cubic equation representing the period of the model [s(semi-circle)^2] + double d_beta3; //!< Coefficient 3 of a cubic equation representing the period of the model [s(semi-circle)^3] - Gps_Iono(); //!< Default constructor + Gps_Iono(); //!< Default constructor - template + template /*! * \brief Serialize is a boost standard method to be called by the boost XML serialization. Here is used to save the ephemeris data on disk file. @@ -66,15 +66,17 @@ public: inline void serialize(Archive& archive, const unsigned int version) { using boost::serialization::make_nvp; - if(version){}; - archive & make_nvp("d_alpha0",d_alpha0); - archive & make_nvp("d_alpha1",d_alpha1); - archive & make_nvp("d_alpha2",d_alpha2); - archive & make_nvp("d_alpha3",d_alpha3); - archive & make_nvp("d_beta0",d_beta0); - archive & make_nvp("d_beta1",d_beta1); - archive & make_nvp("d_beta2",d_beta2); - archive & make_nvp("d_beta3",d_beta3); + if (version) + { + }; + archive& make_nvp("d_alpha0", d_alpha0); + archive& make_nvp("d_alpha1", d_alpha1); + archive& make_nvp("d_alpha2", d_alpha2); + archive& make_nvp("d_alpha3", d_alpha3); + archive& make_nvp("d_beta0", d_beta0); + archive& make_nvp("d_beta1", d_beta1); + archive& make_nvp("d_beta2", d_beta2); + archive& make_nvp("d_beta3", d_beta3); } }; diff --git a/src/core/system_parameters/gps_navigation_message.cc b/src/core/system_parameters/gps_navigation_message.cc index 27a4e26c7..4e5263e0b 100644 --- a/src/core/system_parameters/gps_navigation_message.cc +++ b/src/core/system_parameters/gps_navigation_message.cc @@ -122,12 +122,12 @@ void Gps_Navigation_Message::reset() d_DeltaT_LS = 0; i_WN_LSF = 0; i_DN = 0; - d_DeltaT_LSF= 0; + d_DeltaT_LSF = 0; //Almanac d_Toa = 0; i_WN_A = 0; - for (int i=1; i < 32; i++ ) + for (int i = 1; i < 32; i++) { almanacHealth[i] = 0; } @@ -138,22 +138,20 @@ void Gps_Navigation_Message::reset() d_satvel_Z = 0; auto gnss_sat = Gnss_Satellite(); - std::string _system ("GPS"); - for(unsigned int i = 1; i < 33; i++) + std::string _system("GPS"); + for (unsigned int i = 1; i < 33; i++) { satelliteBlock[i] = gnss_sat.what_block(_system, i); } } - Gps_Navigation_Message::Gps_Navigation_Message() { reset(); } - void Gps_Navigation_Message::print_gps_word_bytes(unsigned int GPS_word) { std::cout << " Word ="; @@ -162,8 +160,7 @@ void Gps_Navigation_Message::print_gps_word_bytes(unsigned int GPS_word) } - -bool Gps_Navigation_Message::read_navigation_bool(std::bitset bits, const std::vector> parameter) +bool Gps_Navigation_Message::read_navigation_bool(std::bitset bits, const std::vector> parameter) { bool value; @@ -179,9 +176,7 @@ bool Gps_Navigation_Message::read_navigation_bool(std::bitset } - - -unsigned long int Gps_Navigation_Message::read_navigation_unsigned(std::bitset bits, const std::vector> parameter) +unsigned long int Gps_Navigation_Message::read_navigation_unsigned(std::bitset bits, const std::vector> parameter) { unsigned long int value = 0; int num_of_slices = parameter.size(); @@ -189,10 +184,10 @@ unsigned long int Gps_Navigation_Message::read_navigation_unsigned(std::bitset bits, const std::vector> parameter) +signed long int Gps_Navigation_Message::read_navigation_signed(std::bitset bits, const std::vector> parameter) { signed long int value = 0; int num_of_slices = parameter.size(); // Discriminate between 64 bits and 32 bits compiler int long_int_size_bytes = sizeof(signed long int); - if (long_int_size_bytes == 8) // if a long int takes 8 bytes, we are in a 64 bits system + if (long_int_size_bytes == 8) // if a long int takes 8 bytes, we are in a 64 bits system { // read the MSB and perform the sign extension if (bits[GPS_SUBFRAME_BITS - parameter[0].first] == 1) { - value ^= 0xFFFFFFFFFFFFFFFF; //64 bits variable + value ^= 0xFFFFFFFFFFFFFFFF; //64 bits variable } else { @@ -225,11 +217,11 @@ signed long int Gps_Navigation_Message::read_navigation_signed(std::bitset (gps_word); + word_bits = std::bitset<(GPS_WORD_BITS + 2)>(gps_word); for (int j = 0; j < GPS_WORD_BITS; j++) { subframe_bits[GPS_WORD_BITS * (9 - i) + j] = word_bits[j]; @@ -287,242 +279,244 @@ int Gps_Navigation_Message::subframe_decoder(char *subframe) // Decode all 5 sub-frames switch (subframe_ID) - { - //--- Decode the sub-frame id ------------------------------------------ - // ICD (IS-GPS-200E Appendix II). http://www.losangeles.af.mil/shared/media/document/AFD-100813-045.pdf - case 1: - //--- It is subframe 1 ------------------------------------- - // Compute the time of week (TOW) of the first sub-frames in the array ==== - // The transmitted TOW is actual TOW of the next subframe - // (the variable subframe at this point contains bits of the last subframe). - //TOW = bin2dec(subframe(31:47)) * 6; - d_TOW_SF1 = static_cast(read_navigation_unsigned(subframe_bits, TOW)); - //we are in the first subframe (the transmitted TOW is the start time of the next subframe) ! - d_TOW_SF1 = d_TOW_SF1 * 6; - d_TOW = d_TOW_SF1; // Set transmission time - b_integrity_status_flag = read_navigation_bool(subframe_bits, INTEGRITY_STATUS_FLAG); - b_alert_flag = read_navigation_bool(subframe_bits, ALERT_FLAG); - b_antispoofing_flag = read_navigation_bool(subframe_bits, ANTI_SPOOFING_FLAG); - i_GPS_week = static_cast(read_navigation_unsigned(subframe_bits, GPS_WEEK)); - i_SV_accuracy = static_cast(read_navigation_unsigned(subframe_bits, SV_ACCURACY)); // (20.3.3.3.1.3) - i_SV_health = static_cast(read_navigation_unsigned(subframe_bits, SV_HEALTH)); - b_L2_P_data_flag = read_navigation_bool(subframe_bits, L2_P_DATA_FLAG); // - i_code_on_L2 = static_cast(read_navigation_unsigned(subframe_bits, CA_OR_P_ON_L2)); - d_TGD = static_cast(read_navigation_signed(subframe_bits, T_GD)); - d_TGD = d_TGD * T_GD_LSB; - d_IODC = static_cast(read_navigation_unsigned(subframe_bits, IODC)); - d_Toc = static_cast(read_navigation_unsigned(subframe_bits, T_OC)); - d_Toc = d_Toc * T_OC_LSB; - d_A_f0 = static_cast(read_navigation_signed(subframe_bits, A_F0)); - d_A_f0 = d_A_f0 * A_F0_LSB; - d_A_f1 = static_cast(read_navigation_signed(subframe_bits, A_F1)); - d_A_f1 = d_A_f1 * A_F1_LSB; - d_A_f2 = static_cast(read_navigation_signed(subframe_bits, A_F2)); - d_A_f2 = d_A_f2 * A_F2_LSB; + { + //--- Decode the sub-frame id ------------------------------------------ + // ICD (IS-GPS-200E Appendix II). http://www.losangeles.af.mil/shared/media/document/AFD-100813-045.pdf + case 1: + //--- It is subframe 1 ------------------------------------- + // Compute the time of week (TOW) of the first sub-frames in the array ==== + // The transmitted TOW is actual TOW of the next subframe + // (the variable subframe at this point contains bits of the last subframe). + //TOW = bin2dec(subframe(31:47)) * 6; + d_TOW_SF1 = static_cast(read_navigation_unsigned(subframe_bits, TOW)); + //we are in the first subframe (the transmitted TOW is the start time of the next subframe) ! + d_TOW_SF1 = d_TOW_SF1 * 6; + d_TOW = d_TOW_SF1; // Set transmission time + b_integrity_status_flag = read_navigation_bool(subframe_bits, INTEGRITY_STATUS_FLAG); + b_alert_flag = read_navigation_bool(subframe_bits, ALERT_FLAG); + b_antispoofing_flag = read_navigation_bool(subframe_bits, ANTI_SPOOFING_FLAG); + i_GPS_week = static_cast(read_navigation_unsigned(subframe_bits, GPS_WEEK)); + i_SV_accuracy = static_cast(read_navigation_unsigned(subframe_bits, SV_ACCURACY)); // (20.3.3.3.1.3) + i_SV_health = static_cast(read_navigation_unsigned(subframe_bits, SV_HEALTH)); + b_L2_P_data_flag = read_navigation_bool(subframe_bits, L2_P_DATA_FLAG); // + i_code_on_L2 = static_cast(read_navigation_unsigned(subframe_bits, CA_OR_P_ON_L2)); + d_TGD = static_cast(read_navigation_signed(subframe_bits, T_GD)); + d_TGD = d_TGD * T_GD_LSB; + d_IODC = static_cast(read_navigation_unsigned(subframe_bits, IODC)); + d_Toc = static_cast(read_navigation_unsigned(subframe_bits, T_OC)); + d_Toc = d_Toc * T_OC_LSB; + d_A_f0 = static_cast(read_navigation_signed(subframe_bits, A_F0)); + d_A_f0 = d_A_f0 * A_F0_LSB; + d_A_f1 = static_cast(read_navigation_signed(subframe_bits, A_F1)); + d_A_f1 = d_A_f1 * A_F1_LSB; + d_A_f2 = static_cast(read_navigation_signed(subframe_bits, A_F2)); + d_A_f2 = d_A_f2 * A_F2_LSB; - break; + break; - case 2: //--- It is subframe 2 ------------------- - d_TOW_SF2 = static_cast(read_navigation_unsigned(subframe_bits, TOW)); - d_TOW_SF2 = d_TOW_SF2 * 6; - d_TOW = d_TOW_SF2; // Set transmission time - b_integrity_status_flag = read_navigation_bool(subframe_bits, INTEGRITY_STATUS_FLAG); - b_alert_flag = read_navigation_bool(subframe_bits, ALERT_FLAG); - b_antispoofing_flag = read_navigation_bool(subframe_bits, ANTI_SPOOFING_FLAG); - d_IODE_SF2 = static_cast(read_navigation_unsigned(subframe_bits, IODE_SF2)); - d_Crs = static_cast(read_navigation_signed(subframe_bits, C_RS)); - d_Crs = d_Crs * C_RS_LSB; - d_Delta_n = static_cast(read_navigation_signed(subframe_bits, DELTA_N)); - d_Delta_n = d_Delta_n * DELTA_N_LSB; - d_M_0 = static_cast(read_navigation_signed(subframe_bits, M_0)); - d_M_0 = d_M_0 * M_0_LSB; - d_Cuc = static_cast(read_navigation_signed(subframe_bits, C_UC)); - d_Cuc = d_Cuc * C_UC_LSB; - d_e_eccentricity = static_cast(read_navigation_unsigned(subframe_bits, E)); - d_e_eccentricity = d_e_eccentricity * E_LSB; - d_Cus = static_cast(read_navigation_signed(subframe_bits, C_US)); - d_Cus = d_Cus * C_US_LSB; - d_sqrt_A = static_cast(read_navigation_unsigned(subframe_bits, SQRT_A)); - d_sqrt_A = d_sqrt_A * SQRT_A_LSB; - d_Toe = static_cast(read_navigation_unsigned(subframe_bits, T_OE)); - d_Toe = d_Toe * T_OE_LSB; - b_fit_interval_flag = read_navigation_bool(subframe_bits, FIT_INTERVAL_FLAG); - i_AODO = static_cast(read_navigation_unsigned(subframe_bits, AODO)); - i_AODO = i_AODO * AODO_LSB; + case 2: //--- It is subframe 2 ------------------- + d_TOW_SF2 = static_cast(read_navigation_unsigned(subframe_bits, TOW)); + d_TOW_SF2 = d_TOW_SF2 * 6; + d_TOW = d_TOW_SF2; // Set transmission time + b_integrity_status_flag = read_navigation_bool(subframe_bits, INTEGRITY_STATUS_FLAG); + b_alert_flag = read_navigation_bool(subframe_bits, ALERT_FLAG); + b_antispoofing_flag = read_navigation_bool(subframe_bits, ANTI_SPOOFING_FLAG); + d_IODE_SF2 = static_cast(read_navigation_unsigned(subframe_bits, IODE_SF2)); + d_Crs = static_cast(read_navigation_signed(subframe_bits, C_RS)); + d_Crs = d_Crs * C_RS_LSB; + d_Delta_n = static_cast(read_navigation_signed(subframe_bits, DELTA_N)); + d_Delta_n = d_Delta_n * DELTA_N_LSB; + d_M_0 = static_cast(read_navigation_signed(subframe_bits, M_0)); + d_M_0 = d_M_0 * M_0_LSB; + d_Cuc = static_cast(read_navigation_signed(subframe_bits, C_UC)); + d_Cuc = d_Cuc * C_UC_LSB; + d_e_eccentricity = static_cast(read_navigation_unsigned(subframe_bits, E)); + d_e_eccentricity = d_e_eccentricity * E_LSB; + d_Cus = static_cast(read_navigation_signed(subframe_bits, C_US)); + d_Cus = d_Cus * C_US_LSB; + d_sqrt_A = static_cast(read_navigation_unsigned(subframe_bits, SQRT_A)); + d_sqrt_A = d_sqrt_A * SQRT_A_LSB; + d_Toe = static_cast(read_navigation_unsigned(subframe_bits, T_OE)); + d_Toe = d_Toe * T_OE_LSB; + b_fit_interval_flag = read_navigation_bool(subframe_bits, FIT_INTERVAL_FLAG); + i_AODO = static_cast(read_navigation_unsigned(subframe_bits, AODO)); + i_AODO = i_AODO * AODO_LSB; - break; + break; - case 3: // --- It is subframe 3 ------------------------------------- - d_TOW_SF3 = static_cast(read_navigation_unsigned(subframe_bits, TOW)); - d_TOW_SF3 = d_TOW_SF3 * 6; - d_TOW = d_TOW_SF3; // Set transmission time - b_integrity_status_flag = read_navigation_bool(subframe_bits, INTEGRITY_STATUS_FLAG); - b_alert_flag = read_navigation_bool(subframe_bits, ALERT_FLAG); - b_antispoofing_flag = read_navigation_bool(subframe_bits, ANTI_SPOOFING_FLAG); - d_Cic = static_cast(read_navigation_signed(subframe_bits, C_IC)); - d_Cic = d_Cic * C_IC_LSB; - d_OMEGA0 = static_cast(read_navigation_signed(subframe_bits, OMEGA_0)); - d_OMEGA0 = d_OMEGA0 * OMEGA_0_LSB; - d_Cis = static_cast(read_navigation_signed(subframe_bits, C_IS)); - d_Cis = d_Cis * C_IS_LSB; - d_i_0 = static_cast(read_navigation_signed(subframe_bits, I_0)); - d_i_0 = d_i_0 * I_0_LSB; - d_Crc = static_cast(read_navigation_signed(subframe_bits, C_RC)); - d_Crc = d_Crc * C_RC_LSB; - d_OMEGA = static_cast(read_navigation_signed(subframe_bits, OMEGA)); - d_OMEGA = d_OMEGA * OMEGA_LSB; - d_OMEGA_DOT = static_cast(read_navigation_signed(subframe_bits, OMEGA_DOT)); - d_OMEGA_DOT = d_OMEGA_DOT * OMEGA_DOT_LSB; - d_IODE_SF3 = static_cast(read_navigation_unsigned(subframe_bits, IODE_SF3)); - d_IDOT = static_cast(read_navigation_signed(subframe_bits, I_DOT)); - d_IDOT = d_IDOT * I_DOT_LSB; + case 3: // --- It is subframe 3 ------------------------------------- + d_TOW_SF3 = static_cast(read_navigation_unsigned(subframe_bits, TOW)); + d_TOW_SF3 = d_TOW_SF3 * 6; + d_TOW = d_TOW_SF3; // Set transmission time + b_integrity_status_flag = read_navigation_bool(subframe_bits, INTEGRITY_STATUS_FLAG); + b_alert_flag = read_navigation_bool(subframe_bits, ALERT_FLAG); + b_antispoofing_flag = read_navigation_bool(subframe_bits, ANTI_SPOOFING_FLAG); + d_Cic = static_cast(read_navigation_signed(subframe_bits, C_IC)); + d_Cic = d_Cic * C_IC_LSB; + d_OMEGA0 = static_cast(read_navigation_signed(subframe_bits, OMEGA_0)); + d_OMEGA0 = d_OMEGA0 * OMEGA_0_LSB; + d_Cis = static_cast(read_navigation_signed(subframe_bits, C_IS)); + d_Cis = d_Cis * C_IS_LSB; + d_i_0 = static_cast(read_navigation_signed(subframe_bits, I_0)); + d_i_0 = d_i_0 * I_0_LSB; + d_Crc = static_cast(read_navigation_signed(subframe_bits, C_RC)); + d_Crc = d_Crc * C_RC_LSB; + d_OMEGA = static_cast(read_navigation_signed(subframe_bits, OMEGA)); + d_OMEGA = d_OMEGA * OMEGA_LSB; + d_OMEGA_DOT = static_cast(read_navigation_signed(subframe_bits, OMEGA_DOT)); + d_OMEGA_DOT = d_OMEGA_DOT * OMEGA_DOT_LSB; + d_IODE_SF3 = static_cast(read_navigation_unsigned(subframe_bits, IODE_SF3)); + d_IDOT = static_cast(read_navigation_signed(subframe_bits, I_DOT)); + d_IDOT = d_IDOT * I_DOT_LSB; - break; + break; - case 4: // --- It is subframe 4 ---------- Almanac, ionospheric model, UTC parameters, SV health (PRN: 25-32) - int SV_data_ID; - int SV_page; - d_TOW_SF4 = static_cast(read_navigation_unsigned(subframe_bits, TOW)); - d_TOW_SF4 = d_TOW_SF4 * 6; - d_TOW = d_TOW_SF4; // Set transmission time - b_integrity_status_flag = read_navigation_bool(subframe_bits, INTEGRITY_STATUS_FLAG); - b_alert_flag = read_navigation_bool(subframe_bits, ALERT_FLAG); - b_antispoofing_flag = read_navigation_bool(subframe_bits, ANTI_SPOOFING_FLAG); - SV_data_ID = static_cast(read_navigation_unsigned(subframe_bits, SV_DATA_ID)); - SV_page = static_cast(read_navigation_unsigned(subframe_bits, SV_PAGE)); - if (SV_page > 24 && SV_page < 33) // Page 4 (from Table 20-V. Data IDs and SV IDs in Subframes 4 and 5, IS-GPS-200H, page 110) - { - //! \TODO read almanac - if(SV_data_ID){} - } + case 4: // --- It is subframe 4 ---------- Almanac, ionospheric model, UTC parameters, SV health (PRN: 25-32) + int SV_data_ID; + int SV_page; + d_TOW_SF4 = static_cast(read_navigation_unsigned(subframe_bits, TOW)); + d_TOW_SF4 = d_TOW_SF4 * 6; + d_TOW = d_TOW_SF4; // Set transmission time + b_integrity_status_flag = read_navigation_bool(subframe_bits, INTEGRITY_STATUS_FLAG); + b_alert_flag = read_navigation_bool(subframe_bits, ALERT_FLAG); + b_antispoofing_flag = read_navigation_bool(subframe_bits, ANTI_SPOOFING_FLAG); + SV_data_ID = static_cast(read_navigation_unsigned(subframe_bits, SV_DATA_ID)); + SV_page = static_cast(read_navigation_unsigned(subframe_bits, SV_PAGE)); + if (SV_page > 24 && SV_page < 33) // Page 4 (from Table 20-V. Data IDs and SV IDs in Subframes 4 and 5, IS-GPS-200H, page 110) + { + //! \TODO read almanac + if (SV_data_ID) + { + } + } - if (SV_page == 52) // Page 13 (from Table 20-V. Data IDs and SV IDs in Subframes 4 and 5, IS-GPS-200H, page 110) - { - //! \TODO read Estimated Range Deviation (ERD) values - } + if (SV_page == 52) // Page 13 (from Table 20-V. Data IDs and SV IDs in Subframes 4 and 5, IS-GPS-200H, page 110) + { + //! \TODO read Estimated Range Deviation (ERD) values + } - if (SV_page == 56) // Page 18 (from Table 20-V. Data IDs and SV IDs in Subframes 4 and 5, IS-GPS-200H, page 110) - { - // Page 18 - Ionospheric and UTC data - d_alpha0 = static_cast(read_navigation_signed(subframe_bits, ALPHA_0)); - d_alpha0 = d_alpha0 * ALPHA_0_LSB; - d_alpha1 = static_cast(read_navigation_signed(subframe_bits, ALPHA_1)); - d_alpha1 = d_alpha1 * ALPHA_1_LSB; - d_alpha2 = static_cast(read_navigation_signed(subframe_bits, ALPHA_2)); - d_alpha2 = d_alpha2 * ALPHA_2_LSB; - d_alpha3 = static_cast(read_navigation_signed(subframe_bits, ALPHA_3)); - d_alpha3 = d_alpha3 * ALPHA_3_LSB; - d_beta0 = static_cast(read_navigation_signed(subframe_bits, BETA_0)); - d_beta0 = d_beta0 * BETA_0_LSB; - d_beta1 = static_cast(read_navigation_signed(subframe_bits, BETA_1)); - d_beta1 = d_beta1 * BETA_1_LSB; - d_beta2 = static_cast(read_navigation_signed(subframe_bits, BETA_2)); - d_beta2 = d_beta2 * BETA_2_LSB; - d_beta3 = static_cast(read_navigation_signed(subframe_bits, BETA_3)); - d_beta3 = d_beta3 * BETA_3_LSB; - d_A1 = static_cast(read_navigation_signed(subframe_bits, A_1)); - d_A1 = d_A1 * A_1_LSB; - d_A0 = static_cast(read_navigation_signed(subframe_bits, A_0)); - d_A0 = d_A0 * A_0_LSB; - d_t_OT = static_cast(read_navigation_unsigned(subframe_bits, T_OT)); - d_t_OT = d_t_OT * T_OT_LSB; - i_WN_T = static_cast(read_navigation_unsigned(subframe_bits, WN_T)); - d_DeltaT_LS = static_cast(read_navigation_signed(subframe_bits, DELTAT_LS)); - i_WN_LSF = static_cast(read_navigation_unsigned(subframe_bits, WN_LSF)); - i_DN = static_cast(read_navigation_unsigned(subframe_bits, DN)); // Right-justified ? - d_DeltaT_LSF = static_cast(read_navigation_signed(subframe_bits, DELTAT_LSF)); - flag_iono_valid = true; - flag_utc_model_valid = true; - } - if (SV_page == 57) - { - // Reserved - } + if (SV_page == 56) // Page 18 (from Table 20-V. Data IDs and SV IDs in Subframes 4 and 5, IS-GPS-200H, page 110) + { + // Page 18 - Ionospheric and UTC data + d_alpha0 = static_cast(read_navigation_signed(subframe_bits, ALPHA_0)); + d_alpha0 = d_alpha0 * ALPHA_0_LSB; + d_alpha1 = static_cast(read_navigation_signed(subframe_bits, ALPHA_1)); + d_alpha1 = d_alpha1 * ALPHA_1_LSB; + d_alpha2 = static_cast(read_navigation_signed(subframe_bits, ALPHA_2)); + d_alpha2 = d_alpha2 * ALPHA_2_LSB; + d_alpha3 = static_cast(read_navigation_signed(subframe_bits, ALPHA_3)); + d_alpha3 = d_alpha3 * ALPHA_3_LSB; + d_beta0 = static_cast(read_navigation_signed(subframe_bits, BETA_0)); + d_beta0 = d_beta0 * BETA_0_LSB; + d_beta1 = static_cast(read_navigation_signed(subframe_bits, BETA_1)); + d_beta1 = d_beta1 * BETA_1_LSB; + d_beta2 = static_cast(read_navigation_signed(subframe_bits, BETA_2)); + d_beta2 = d_beta2 * BETA_2_LSB; + d_beta3 = static_cast(read_navigation_signed(subframe_bits, BETA_3)); + d_beta3 = d_beta3 * BETA_3_LSB; + d_A1 = static_cast(read_navigation_signed(subframe_bits, A_1)); + d_A1 = d_A1 * A_1_LSB; + d_A0 = static_cast(read_navigation_signed(subframe_bits, A_0)); + d_A0 = d_A0 * A_0_LSB; + d_t_OT = static_cast(read_navigation_unsigned(subframe_bits, T_OT)); + d_t_OT = d_t_OT * T_OT_LSB; + i_WN_T = static_cast(read_navigation_unsigned(subframe_bits, WN_T)); + d_DeltaT_LS = static_cast(read_navigation_signed(subframe_bits, DELTAT_LS)); + i_WN_LSF = static_cast(read_navigation_unsigned(subframe_bits, WN_LSF)); + i_DN = static_cast(read_navigation_unsigned(subframe_bits, DN)); // Right-justified ? + d_DeltaT_LSF = static_cast(read_navigation_signed(subframe_bits, DELTAT_LSF)); + flag_iono_valid = true; + flag_utc_model_valid = true; + } + if (SV_page == 57) + { + // Reserved + } - if (SV_page == 63) // Page 25 (from Table 20-V. Data IDs and SV IDs in Subframes 4 and 5, IS-GPS-200H, page 110) - { - // Page 25 Anti-Spoofing, SV config and almanac health (PRN: 25-32) - //! \TODO Read Anti-Spoofing, SV config - almanacHealth[25] = static_cast(read_navigation_unsigned(subframe_bits, HEALTH_SV25)); - almanacHealth[26] = static_cast(read_navigation_unsigned(subframe_bits, HEALTH_SV26)); - almanacHealth[27] = static_cast(read_navigation_unsigned(subframe_bits, HEALTH_SV27)); - almanacHealth[28] = static_cast(read_navigation_unsigned(subframe_bits, HEALTH_SV28)); - almanacHealth[29] = static_cast(read_navigation_unsigned(subframe_bits, HEALTH_SV29)); - almanacHealth[30] = static_cast(read_navigation_unsigned(subframe_bits, HEALTH_SV30)); - almanacHealth[31] = static_cast(read_navigation_unsigned(subframe_bits, HEALTH_SV31)); - almanacHealth[32] = static_cast(read_navigation_unsigned(subframe_bits, HEALTH_SV32)); - } + if (SV_page == 63) // Page 25 (from Table 20-V. Data IDs and SV IDs in Subframes 4 and 5, IS-GPS-200H, page 110) + { + // Page 25 Anti-Spoofing, SV config and almanac health (PRN: 25-32) + //! \TODO Read Anti-Spoofing, SV config + almanacHealth[25] = static_cast(read_navigation_unsigned(subframe_bits, HEALTH_SV25)); + almanacHealth[26] = static_cast(read_navigation_unsigned(subframe_bits, HEALTH_SV26)); + almanacHealth[27] = static_cast(read_navigation_unsigned(subframe_bits, HEALTH_SV27)); + almanacHealth[28] = static_cast(read_navigation_unsigned(subframe_bits, HEALTH_SV28)); + almanacHealth[29] = static_cast(read_navigation_unsigned(subframe_bits, HEALTH_SV29)); + almanacHealth[30] = static_cast(read_navigation_unsigned(subframe_bits, HEALTH_SV30)); + almanacHealth[31] = static_cast(read_navigation_unsigned(subframe_bits, HEALTH_SV31)); + almanacHealth[32] = static_cast(read_navigation_unsigned(subframe_bits, HEALTH_SV32)); + } - break; + break; - case 5://--- It is subframe 5 -----------------almanac health (PRN: 1-24) and Almanac reference week number and time. - int SV_data_ID_5; - int SV_page_5; - d_TOW_SF5 = static_cast(read_navigation_unsigned(subframe_bits, TOW)); - d_TOW_SF5 = d_TOW_SF5 * 6; - d_TOW = d_TOW_SF5; // Set transmission time - b_integrity_status_flag = read_navigation_bool(subframe_bits, INTEGRITY_STATUS_FLAG); - b_alert_flag = read_navigation_bool(subframe_bits, ALERT_FLAG); - b_antispoofing_flag = read_navigation_bool(subframe_bits, ANTI_SPOOFING_FLAG); - SV_data_ID_5 = static_cast(read_navigation_unsigned(subframe_bits, SV_DATA_ID)); - SV_page_5 = static_cast(read_navigation_unsigned(subframe_bits, SV_PAGE)); - if (SV_page_5 < 25) - { - //! \TODO read almanac - if(SV_data_ID_5){} - } - if (SV_page_5 == 51) // Page 25 (from Table 20-V. Data IDs and SV IDs in Subframes 4 and 5, IS-GPS-200H, page 110) - { - d_Toa = static_cast(read_navigation_unsigned(subframe_bits, T_OA)); - d_Toa = d_Toa * T_OA_LSB; - i_WN_A = static_cast(read_navigation_unsigned(subframe_bits, WN_A)); - almanacHealth[1] = static_cast(read_navigation_unsigned(subframe_bits, HEALTH_SV1)); - almanacHealth[2] = static_cast(read_navigation_unsigned(subframe_bits, HEALTH_SV2)); - almanacHealth[3] = static_cast(read_navigation_unsigned(subframe_bits, HEALTH_SV3)); - almanacHealth[4] = static_cast(read_navigation_unsigned(subframe_bits, HEALTH_SV4)); - almanacHealth[5] = static_cast(read_navigation_unsigned(subframe_bits, HEALTH_SV5)); - almanacHealth[6] = static_cast(read_navigation_unsigned(subframe_bits, HEALTH_SV6)); - almanacHealth[7] = static_cast(read_navigation_unsigned(subframe_bits, HEALTH_SV7)); - almanacHealth[8] = static_cast(read_navigation_unsigned(subframe_bits, HEALTH_SV8)); - almanacHealth[9] = static_cast(read_navigation_unsigned(subframe_bits, HEALTH_SV9)); - almanacHealth[10] = static_cast(read_navigation_unsigned(subframe_bits, HEALTH_SV10)); - almanacHealth[11] = static_cast(read_navigation_unsigned(subframe_bits, HEALTH_SV11)); - almanacHealth[12] = static_cast(read_navigation_unsigned(subframe_bits, HEALTH_SV12)); - almanacHealth[13] = static_cast(read_navigation_unsigned(subframe_bits, HEALTH_SV13)); - almanacHealth[14] = static_cast(read_navigation_unsigned(subframe_bits, HEALTH_SV14)); - almanacHealth[15] = static_cast(read_navigation_unsigned(subframe_bits, HEALTH_SV15)); - almanacHealth[16] = static_cast(read_navigation_unsigned(subframe_bits, HEALTH_SV16)); - almanacHealth[17] = static_cast(read_navigation_unsigned(subframe_bits, HEALTH_SV17)); - almanacHealth[18] = static_cast(read_navigation_unsigned(subframe_bits, HEALTH_SV18)); - almanacHealth[19] = static_cast(read_navigation_unsigned(subframe_bits, HEALTH_SV19)); - almanacHealth[20] = static_cast(read_navigation_unsigned(subframe_bits, HEALTH_SV20)); - almanacHealth[21] = static_cast(read_navigation_unsigned(subframe_bits, HEALTH_SV21)); - almanacHealth[22] = static_cast(read_navigation_unsigned(subframe_bits, HEALTH_SV22)); - almanacHealth[23] = static_cast(read_navigation_unsigned(subframe_bits, HEALTH_SV23)); - almanacHealth[24] = static_cast(read_navigation_unsigned(subframe_bits, HEALTH_SV24)); - } - break; + case 5: //--- It is subframe 5 -----------------almanac health (PRN: 1-24) and Almanac reference week number and time. + int SV_data_ID_5; + int SV_page_5; + d_TOW_SF5 = static_cast(read_navigation_unsigned(subframe_bits, TOW)); + d_TOW_SF5 = d_TOW_SF5 * 6; + d_TOW = d_TOW_SF5; // Set transmission time + b_integrity_status_flag = read_navigation_bool(subframe_bits, INTEGRITY_STATUS_FLAG); + b_alert_flag = read_navigation_bool(subframe_bits, ALERT_FLAG); + b_antispoofing_flag = read_navigation_bool(subframe_bits, ANTI_SPOOFING_FLAG); + SV_data_ID_5 = static_cast(read_navigation_unsigned(subframe_bits, SV_DATA_ID)); + SV_page_5 = static_cast(read_navigation_unsigned(subframe_bits, SV_PAGE)); + if (SV_page_5 < 25) + { + //! \TODO read almanac + if (SV_data_ID_5) + { + } + } + if (SV_page_5 == 51) // Page 25 (from Table 20-V. Data IDs and SV IDs in Subframes 4 and 5, IS-GPS-200H, page 110) + { + d_Toa = static_cast(read_navigation_unsigned(subframe_bits, T_OA)); + d_Toa = d_Toa * T_OA_LSB; + i_WN_A = static_cast(read_navigation_unsigned(subframe_bits, WN_A)); + almanacHealth[1] = static_cast(read_navigation_unsigned(subframe_bits, HEALTH_SV1)); + almanacHealth[2] = static_cast(read_navigation_unsigned(subframe_bits, HEALTH_SV2)); + almanacHealth[3] = static_cast(read_navigation_unsigned(subframe_bits, HEALTH_SV3)); + almanacHealth[4] = static_cast(read_navigation_unsigned(subframe_bits, HEALTH_SV4)); + almanacHealth[5] = static_cast(read_navigation_unsigned(subframe_bits, HEALTH_SV5)); + almanacHealth[6] = static_cast(read_navigation_unsigned(subframe_bits, HEALTH_SV6)); + almanacHealth[7] = static_cast(read_navigation_unsigned(subframe_bits, HEALTH_SV7)); + almanacHealth[8] = static_cast(read_navigation_unsigned(subframe_bits, HEALTH_SV8)); + almanacHealth[9] = static_cast(read_navigation_unsigned(subframe_bits, HEALTH_SV9)); + almanacHealth[10] = static_cast(read_navigation_unsigned(subframe_bits, HEALTH_SV10)); + almanacHealth[11] = static_cast(read_navigation_unsigned(subframe_bits, HEALTH_SV11)); + almanacHealth[12] = static_cast(read_navigation_unsigned(subframe_bits, HEALTH_SV12)); + almanacHealth[13] = static_cast(read_navigation_unsigned(subframe_bits, HEALTH_SV13)); + almanacHealth[14] = static_cast(read_navigation_unsigned(subframe_bits, HEALTH_SV14)); + almanacHealth[15] = static_cast(read_navigation_unsigned(subframe_bits, HEALTH_SV15)); + almanacHealth[16] = static_cast(read_navigation_unsigned(subframe_bits, HEALTH_SV16)); + almanacHealth[17] = static_cast(read_navigation_unsigned(subframe_bits, HEALTH_SV17)); + almanacHealth[18] = static_cast(read_navigation_unsigned(subframe_bits, HEALTH_SV18)); + almanacHealth[19] = static_cast(read_navigation_unsigned(subframe_bits, HEALTH_SV19)); + almanacHealth[20] = static_cast(read_navigation_unsigned(subframe_bits, HEALTH_SV20)); + almanacHealth[21] = static_cast(read_navigation_unsigned(subframe_bits, HEALTH_SV21)); + almanacHealth[22] = static_cast(read_navigation_unsigned(subframe_bits, HEALTH_SV22)); + almanacHealth[23] = static_cast(read_navigation_unsigned(subframe_bits, HEALTH_SV23)); + almanacHealth[24] = static_cast(read_navigation_unsigned(subframe_bits, HEALTH_SV24)); + } + break; - default: - break; - } // switch subframeID ... + default: + break; + } // switch subframeID ... return subframe_ID; } - - double Gps_Navigation_Message::utc_time(const double gpstime_corrected) const { double t_utc; double t_utc_daytime; - double Delta_t_UTC = d_DeltaT_LS + d_A0 + d_A1 * (gpstime_corrected - d_t_OT + 604800 * static_cast((i_GPS_week - i_WN_T))); + double Delta_t_UTC = d_DeltaT_LS + d_A0 + d_A1 * (gpstime_corrected - d_t_OT + 604800 * static_cast((i_GPS_week - i_WN_T))); // Determine if the effectivity time of the leap second event is in the past - int weeksToLeapSecondEvent = i_WN_LSF - i_GPS_week; + int weeksToLeapSecondEvent = i_WN_LSF - i_GPS_week; - if ((weeksToLeapSecondEvent) >= 0) // is not in the past + if ((weeksToLeapSecondEvent) >= 0) // is not in the past { //Detect if the effectivity time and user's time is within six hours = 6 * 60 *60 = 21600 s int secondOfLeapSecondEvent = i_DN * 24 * 60 * 60; @@ -530,9 +524,9 @@ double Gps_Navigation_Message::utc_time(const double gpstime_corrected) const { t_utc_daytime = fmod(gpstime_corrected - Delta_t_UTC, 86400); } - else //we are in the same week than the leap second event + else //we are in the same week than the leap second event { - if (std::abs(gpstime_corrected - secondOfLeapSecondEvent) > 21600) + if (std::abs(gpstime_corrected - secondOfLeapSecondEvent) > 21600) { /* 20.3.3.5.2.4a * Whenever the effectivity time indicated by the WN_LSF and the DN values @@ -555,14 +549,14 @@ double Gps_Navigation_Message::utc_time(const double gpstime_corrected) const t_utc_daytime = fmod(W, 86400 + d_DeltaT_LSF - d_DeltaT_LS); //implement something to handle a leap second event! } - if ( (gpstime_corrected - secondOfLeapSecondEvent) > 21600) + if ((gpstime_corrected - secondOfLeapSecondEvent) > 21600) { Delta_t_UTC = d_DeltaT_LSF + d_A0 + d_A1 * (gpstime_corrected - d_t_OT + 604800 * static_cast((i_GPS_week - i_WN_T))); t_utc_daytime = fmod(gpstime_corrected - Delta_t_UTC, 86400); } } } - else // the effectivity time is in the past + else // the effectivity time is in the past { /* 20.3.3.5.2.4c * Whenever the effectivity time of the leap second event, as indicated by the @@ -579,7 +573,6 @@ double Gps_Navigation_Message::utc_time(const double gpstime_corrected) const } - Gps_Ephemeris Gps_Navigation_Message::get_ephemeris() { Gps_Ephemeris ephemeris; @@ -681,7 +674,7 @@ bool Gps_Navigation_Message::satellite_validation() // and check if the data have been filled (!=0) if (d_TOW_SF1 != 0 and d_TOW_SF2 != 0 and d_TOW_SF3 != 0) { - if (d_IODE_SF2 == d_IODE_SF3 and d_IODC == d_IODE_SF2 and d_IODC!= -1) + if (d_IODE_SF2 == d_IODE_SF3 and d_IODC == d_IODE_SF2 and d_IODC != -1) { flag_data_valid = true; b_valid_ephemeris_set_flag = true; diff --git a/src/core/system_parameters/gps_navigation_message.h b/src/core/system_parameters/gps_navigation_message.h index 3f9e2866f..bd913c860 100644 --- a/src/core/system_parameters/gps_navigation_message.h +++ b/src/core/system_parameters/gps_navigation_message.h @@ -53,69 +53,70 @@ class Gps_Navigation_Message { private: - unsigned long int read_navigation_unsigned(std::bitset bits, const std::vector> parameter); - signed long int read_navigation_signed(std::bitset bits, const std::vector> parameter); - bool read_navigation_bool(std::bitset bits, const std::vector> parameter); + unsigned long int read_navigation_unsigned(std::bitset bits, const std::vector> parameter); + signed long int read_navigation_signed(std::bitset bits, const std::vector> parameter); + bool read_navigation_bool(std::bitset bits, const std::vector> parameter); void print_gps_word_bytes(unsigned int GPS_word); + public: - bool b_valid_ephemeris_set_flag; // flag indicating that this ephemeris set have passed the validation check + bool b_valid_ephemeris_set_flag; // flag indicating that this ephemeris set have passed the validation check //broadcast orbit 1 - double d_TOW; //!< Time of GPS Week of the ephemeris set (taken from subframes TOW) [s] - double d_TOW_SF1; //!< Time of GPS Week from HOW word of Subframe 1 [s] - double d_TOW_SF2; //!< Time of GPS Week from HOW word of Subframe 2 [s] - double d_TOW_SF3; //!< Time of GPS Week from HOW word of Subframe 3 [s] - double d_TOW_SF4; //!< Time of GPS Week from HOW word of Subframe 4 [s] - double d_TOW_SF5; //!< Time of GPS Week from HOW word of Subframe 5 [s] + double d_TOW; //!< Time of GPS Week of the ephemeris set (taken from subframes TOW) [s] + double d_TOW_SF1; //!< Time of GPS Week from HOW word of Subframe 1 [s] + double d_TOW_SF2; //!< Time of GPS Week from HOW word of Subframe 2 [s] + double d_TOW_SF3; //!< Time of GPS Week from HOW word of Subframe 3 [s] + double d_TOW_SF4; //!< Time of GPS Week from HOW word of Subframe 4 [s] + double d_TOW_SF5; //!< Time of GPS Week from HOW word of Subframe 5 [s] double d_IODE_SF2; double d_IODE_SF3; - double d_Crs; //!< Amplitude of the Sine Harmonic Correction Term to the Orbit Radius [m] - double d_Delta_n; //!< Mean Motion Difference From Computed Value [semi-circles/s] - double d_M_0; //!< Mean Anomaly at Reference Time [semi-circles] + double d_Crs; //!< Amplitude of the Sine Harmonic Correction Term to the Orbit Radius [m] + double d_Delta_n; //!< Mean Motion Difference From Computed Value [semi-circles/s] + double d_M_0; //!< Mean Anomaly at Reference Time [semi-circles] //broadcast orbit 2 - double d_Cuc; //!< Amplitude of the Cosine Harmonic Correction Term to the Argument of Latitude [rad] - double d_e_eccentricity; //!< Eccentricity [dimensionless] - double d_Cus; //!< Amplitude of the Sine Harmonic Correction Term to the Argument of Latitude [rad] - double d_sqrt_A; //!< Square Root of the Semi-Major Axis [sqrt(m)] + double d_Cuc; //!< Amplitude of the Cosine Harmonic Correction Term to the Argument of Latitude [rad] + double d_e_eccentricity; //!< Eccentricity [dimensionless] + double d_Cus; //!< Amplitude of the Sine Harmonic Correction Term to the Argument of Latitude [rad] + double d_sqrt_A; //!< Square Root of the Semi-Major Axis [sqrt(m)] //broadcast orbit 3 - double d_Toe; //!< Ephemeris data reference time of week (Ref. 20.3.3.4.3 IS-GPS-200E) [s] - double d_Toc; //!< clock data reference time (Ref. 20.3.3.3.3.1 IS-GPS-200E) [s] - double d_Cic; //!< Amplitude of the Cosine Harmonic Correction Term to the Angle of Inclination [rad] - double d_OMEGA0; //!< Longitude of Ascending Node of Orbit Plane at Weekly Epoch [semi-circles] - double d_Cis; //!< Amplitude of the Sine Harmonic Correction Term to the Angle of Inclination [rad] + double d_Toe; //!< Ephemeris data reference time of week (Ref. 20.3.3.4.3 IS-GPS-200E) [s] + double d_Toc; //!< clock data reference time (Ref. 20.3.3.3.3.1 IS-GPS-200E) [s] + double d_Cic; //!< Amplitude of the Cosine Harmonic Correction Term to the Angle of Inclination [rad] + double d_OMEGA0; //!< Longitude of Ascending Node of Orbit Plane at Weekly Epoch [semi-circles] + double d_Cis; //!< Amplitude of the Sine Harmonic Correction Term to the Angle of Inclination [rad] //broadcast orbit 4 - double d_i_0; //!< Inclination Angle at Reference Time [semi-circles] - double d_Crc; //!< Amplitude of the Cosine Harmonic Correction Term to the Orbit Radius [m] - double d_OMEGA; //!< Argument of Perigee [semi-cicles] - double d_OMEGA_DOT; //!< Rate of Right Ascension [semi-circles/s] + double d_i_0; //!< Inclination Angle at Reference Time [semi-circles] + double d_Crc; //!< Amplitude of the Cosine Harmonic Correction Term to the Orbit Radius [m] + double d_OMEGA; //!< Argument of Perigee [semi-cicles] + double d_OMEGA_DOT; //!< Rate of Right Ascension [semi-circles/s] //broadcast orbit 5 - double d_IDOT; //!< Rate of Inclination Angle [semi-circles/s] - int i_code_on_L2; //!< If 1, P code ON in L2; if 2, C/A code ON in L2; - int i_GPS_week; //!< GPS week number, aka WN [week] - bool b_L2_P_data_flag; //!< When true, indicates that the NAV data stream was commanded OFF on the P-code of the L2 channel + double d_IDOT; //!< Rate of Inclination Angle [semi-circles/s] + int i_code_on_L2; //!< If 1, P code ON in L2; if 2, C/A code ON in L2; + int i_GPS_week; //!< GPS week number, aka WN [week] + bool b_L2_P_data_flag; //!< When true, indicates that the NAV data stream was commanded OFF on the P-code of the L2 channel //broadcast orbit 6 - int i_SV_accuracy; //!< User Range Accuracy (URA) index of the SV (reference paragraph 6.2.1) for the standard positioning service user (Ref 20.3.3.3.1.3 IS-GPS-200E) + int i_SV_accuracy; //!< User Range Accuracy (URA) index of the SV (reference paragraph 6.2.1) for the standard positioning service user (Ref 20.3.3.3.1.3 IS-GPS-200E) int i_SV_health; - double d_TGD; //!< Estimated Group Delay Differential: L1-L2 correction term only for the benefit of "L1 P(Y)" or "L2 P(Y)" s users [s] - double d_IODC; //!< Issue of Data, Clock + double d_TGD; //!< Estimated Group Delay Differential: L1-L2 correction term only for the benefit of "L1 P(Y)" or "L2 P(Y)" s users [s] + double d_IODC; //!< Issue of Data, Clock //broadcast orbit 7 - int i_AODO; //!< Age of Data Offset (AODO) term for the navigation message correction table (NMCT) contained in subframe 4 (reference paragraph 20.3.3.5.1.9) [s] + int i_AODO; //!< Age of Data Offset (AODO) term for the navigation message correction table (NMCT) contained in subframe 4 (reference paragraph 20.3.3.5.1.9) [s] - bool b_fit_interval_flag;//!< indicates the curve-fit interval used by the CS (Block II/IIA/IIR/IIR-M/IIF) and SS (Block IIIA) in determining the ephemeris parameters, as follows: 0 = 4 hours, 1 = greater than 4 hours. + bool b_fit_interval_flag; //!< indicates the curve-fit interval used by the CS (Block II/IIA/IIR/IIR-M/IIF) and SS (Block IIIA) in determining the ephemeris parameters, as follows: 0 = 4 hours, 1 = greater than 4 hours. double d_spare1; double d_spare2; - double d_A_f0; //!< Coefficient 0 of code phase offset model [s] - double d_A_f1; //!< Coefficient 1 of code phase offset model [s/s] - double d_A_f2; //!< Coefficient 2 of code phase offset model [s/s^2] + double d_A_f0; //!< Coefficient 0 of code phase offset model [s] + double d_A_f1; //!< Coefficient 1 of code phase offset model [s/s] + double d_A_f2; //!< Coefficient 2 of code phase offset model [s/s^2] // Almanac - double d_Toa; //!< Almanac reference time [s] - int i_WN_A; //!< Modulo 256 of the GPS week number to which the almanac reference time (d_Toa) is referenced - std::map almanacHealth; //!< Map that stores the health information stored in the almanac + double d_Toa; //!< Almanac reference time [s] + int i_WN_A; //!< Modulo 256 of the GPS week number to which the almanac reference time (d_Toa) is referenced + std::map almanacHealth; //!< Map that stores the health information stored in the almanac - std::map satelliteBlock; //!< Map that stores to which block the PRN belongs http://www.navcen.uscg.gov/?Do=constellationStatus + std::map satelliteBlock; //!< Map that stores to which block the PRN belongs http://www.navcen.uscg.gov/?Do=constellationStatus // Flags @@ -130,53 +131,53 @@ public: * accompanying alert, is less than 1E-8 per hour. */ bool b_integrity_status_flag; - bool b_alert_flag; //!< If true, indicates that the SV URA may be worse than indicated in d_SV_accuracy, use that SV at our own risk. + bool b_alert_flag; //!< If true, indicates that the SV URA may be worse than indicated in d_SV_accuracy, use that SV at our own risk. bool b_antispoofing_flag; //!< If true, the AntiSpoofing mode is ON in that SV // clock terms //double d_master_clock; // GPS transmission time - double d_satClkCorr; // GPS clock error - double d_dtr; // relativistic clock correction term + double d_satClkCorr; // GPS clock error + double d_dtr; // relativistic clock correction term double d_satClkDrift; // satellite positions - double d_satpos_X; //!< Earth-fixed coordinate x of the satellite [m]. Intersection of the IERS Reference Meridian (IRM) and the plane passing through the origin and normal to the Z-axis. - double d_satpos_Y; //!< Earth-fixed coordinate y of the satellite [m]. Completes a right-handed, Earth-Centered, Earth-Fixed orthogonal coordinate system. - double d_satpos_Z; //!< Earth-fixed coordinate z of the satellite [m]. The direction of the IERS (International Earth Rotation and Reference Systems Service) Reference Pole (IRP). + double d_satpos_X; //!< Earth-fixed coordinate x of the satellite [m]. Intersection of the IERS Reference Meridian (IRM) and the plane passing through the origin and normal to the Z-axis. + double d_satpos_Y; //!< Earth-fixed coordinate y of the satellite [m]. Completes a right-handed, Earth-Centered, Earth-Fixed orthogonal coordinate system. + double d_satpos_Z; //!< Earth-fixed coordinate z of the satellite [m]. The direction of the IERS (International Earth Rotation and Reference Systems Service) Reference Pole (IRP). // satellite identification info int i_channel_ID; unsigned int i_satellite_PRN; // time synchro - double d_subframe_timestamp_ms; //[ms] + double d_subframe_timestamp_ms; //[ms] // Ionospheric parameters - bool flag_iono_valid; //!< If set, it indicates that the ionospheric parameters are filled (page 18 has arrived and decoded) - double d_alpha0; //!< Coefficient 0 of a cubic equation representing the amplitude of the vertical delay [s] - double d_alpha1; //!< Coefficient 1 of a cubic equation representing the amplitude of the vertical delay [s/semi-circle] - double d_alpha2; //!< Coefficient 2 of a cubic equation representing the amplitude of the vertical delay [s(semi-circle)^2] - double d_alpha3; //!< Coefficient 3 of a cubic equation representing the amplitude of the vertical delay [s(semi-circle)^3] - double d_beta0; //!< Coefficient 0 of a cubic equation representing the period of the model [s] - double d_beta1; //!< Coefficient 1 of a cubic equation representing the period of the model [s/semi-circle] - double d_beta2; //!< Coefficient 2 of a cubic equation representing the period of the model [s(semi-circle)^2] - double d_beta3; //!< Coefficient 3 of a cubic equation representing the period of the model [s(semi-circle)^3] + bool flag_iono_valid; //!< If set, it indicates that the ionospheric parameters are filled (page 18 has arrived and decoded) + double d_alpha0; //!< Coefficient 0 of a cubic equation representing the amplitude of the vertical delay [s] + double d_alpha1; //!< Coefficient 1 of a cubic equation representing the amplitude of the vertical delay [s/semi-circle] + double d_alpha2; //!< Coefficient 2 of a cubic equation representing the amplitude of the vertical delay [s(semi-circle)^2] + double d_alpha3; //!< Coefficient 3 of a cubic equation representing the amplitude of the vertical delay [s(semi-circle)^3] + double d_beta0; //!< Coefficient 0 of a cubic equation representing the period of the model [s] + double d_beta1; //!< Coefficient 1 of a cubic equation representing the period of the model [s/semi-circle] + double d_beta2; //!< Coefficient 2 of a cubic equation representing the period of the model [s(semi-circle)^2] + double d_beta3; //!< Coefficient 3 of a cubic equation representing the period of the model [s(semi-circle)^3] // UTC parameters - bool flag_utc_model_valid; //!< If set, it indicates that the UTC model parameters are filled - double d_A1; //!< 1st order term of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200E) [s/s] - double d_A0; //!< Constant of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200E) [s] - double d_t_OT; //!< Reference time for UTC data (reference 20.3.4.5 and 20.3.3.5.2.4 IS-GPS-200E) [s] - int i_WN_T; //!< UTC reference week number [weeks] - double d_DeltaT_LS; //!< delta time due to leap seconds [s]. Number of leap seconds since 6-Jan-1980 as transmitted by the GPS almanac. - int i_WN_LSF; //!< Week number at the end of which the leap second becomes effective [weeks] - int i_DN; //!< Day number (DN) at the end of which the leap second becomes effective [days] - double d_DeltaT_LSF; //!< Scheduled future or recent past (relative to NAV message upload) value of the delta time due to leap seconds [s] + bool flag_utc_model_valid; //!< If set, it indicates that the UTC model parameters are filled + double d_A1; //!< 1st order term of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200E) [s/s] + double d_A0; //!< Constant of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200E) [s] + double d_t_OT; //!< Reference time for UTC data (reference 20.3.4.5 and 20.3.3.5.2.4 IS-GPS-200E) [s] + int i_WN_T; //!< UTC reference week number [weeks] + double d_DeltaT_LS; //!< delta time due to leap seconds [s]. Number of leap seconds since 6-Jan-1980 as transmitted by the GPS almanac. + int i_WN_LSF; //!< Week number at the end of which the leap second becomes effective [weeks] + int i_DN; //!< Day number (DN) at the end of which the leap second becomes effective [days] + double d_DeltaT_LSF; //!< Scheduled future or recent past (relative to NAV message upload) value of the delta time due to leap seconds [s] // Satellite velocity - double d_satvel_X; //!< Earth-fixed velocity coordinate x of the satellite [m] - double d_satvel_Y; //!< Earth-fixed velocity coordinate y of the satellite [m] - double d_satvel_Z; //!< Earth-fixed velocity coordinate z of the satellite [m] + double d_satvel_X; //!< Earth-fixed velocity coordinate x of the satellite [m] + double d_satvel_Y; //!< Earth-fixed velocity coordinate y of the satellite [m] + double d_satvel_Z; //!< Earth-fixed velocity coordinate z of the satellite [m] // public functions void reset(); diff --git a/src/core/system_parameters/gps_ref_location.cc b/src/core/system_parameters/gps_ref_location.cc index 38f510aef..5270d53f2 100644 --- a/src/core/system_parameters/gps_ref_location.cc +++ b/src/core/system_parameters/gps_ref_location.cc @@ -38,4 +38,3 @@ Gps_Ref_Location::Gps_Ref_Location() lon = 0.0; uncertainty = 0.0; } - diff --git a/src/core/system_parameters/gps_ref_location.h b/src/core/system_parameters/gps_ref_location.h index 9491ccbf9..998603b83 100644 --- a/src/core/system_parameters/gps_ref_location.h +++ b/src/core/system_parameters/gps_ref_location.h @@ -52,20 +52,22 @@ public: */ Gps_Ref_Location(); - template + template /*! * \brief Serialize is a boost standard method to be called by the boost XML serialization. Here is used to save the Ref location on disk file. */ inline void serialize(Archive& archive, const unsigned int version) - { - using boost::serialization::make_nvp; - if(version){}; - archive & make_nvp("valid", valid); - archive & make_nvp("lat", lat); - archive & make_nvp("lon", lon); - archive & make_nvp("uncertainty", uncertainty); - } + { + using boost::serialization::make_nvp; + if (version) + { + }; + archive& make_nvp("valid", valid); + archive& make_nvp("lat", lat); + archive& make_nvp("lon", lon); + archive& make_nvp("uncertainty", uncertainty); + } }; #endif diff --git a/src/core/system_parameters/gps_ref_time.cc b/src/core/system_parameters/gps_ref_time.cc index 9524f40c8..318cc0b80 100644 --- a/src/core/system_parameters/gps_ref_time.cc +++ b/src/core/system_parameters/gps_ref_time.cc @@ -39,4 +39,3 @@ Gps_Ref_Time::Gps_Ref_Time() d_tv_sec = 0.0; d_tv_usec = 0.0; } - diff --git a/src/core/system_parameters/gps_ref_time.h b/src/core/system_parameters/gps_ref_time.h index b65a18edd..7edcd83e1 100644 --- a/src/core/system_parameters/gps_ref_time.h +++ b/src/core/system_parameters/gps_ref_time.h @@ -53,7 +53,7 @@ public: */ Gps_Ref_Time(); - template + template /*! * \brief Serialize is a boost standard method to be called by the boost XML serialization. Here is used to save the ref time data on disk file. @@ -61,12 +61,14 @@ public: inline void serialize(Archive& archive, const unsigned int version) { using boost::serialization::make_nvp; - if(version){}; - archive & make_nvp("valid", valid); - archive & make_nvp("d_TOW", d_TOW); - archive & make_nvp("d_Week", d_Week); - archive & make_nvp("d_tv_sec", d_tv_sec); - archive & make_nvp("d_tv_usec", d_tv_usec); + if (version) + { + }; + archive& make_nvp("valid", valid); + archive& make_nvp("d_TOW", d_TOW); + archive& make_nvp("d_Week", d_Week); + archive& make_nvp("d_tv_sec", d_tv_sec); + archive& make_nvp("d_tv_usec", d_tv_usec); } }; diff --git a/src/core/system_parameters/gps_utc_model.cc b/src/core/system_parameters/gps_utc_model.cc index f52428bf4..d117195fb 100644 --- a/src/core/system_parameters/gps_utc_model.cc +++ b/src/core/system_parameters/gps_utc_model.cc @@ -49,12 +49,12 @@ double Gps_Utc_Model::utc_time(double gpstime_corrected, int i_GPS_week) { double t_utc; double t_utc_daytime; - double Delta_t_UTC = d_DeltaT_LS + d_A0 + d_A1 * (gpstime_corrected - d_t_OT + 604800 * static_cast(i_GPS_week - i_WN_T)); + double Delta_t_UTC = d_DeltaT_LS + d_A0 + d_A1 * (gpstime_corrected - d_t_OT + 604800 * static_cast(i_GPS_week - i_WN_T)); // Determine if the effectivity time of the leap second event is in the past - int weeksToLeapSecondEvent = i_WN_LSF - i_GPS_week; + int weeksToLeapSecondEvent = i_WN_LSF - i_GPS_week; - if (weeksToLeapSecondEvent >= 0) // is not in the past + if (weeksToLeapSecondEvent >= 0) // is not in the past { //Detect if the effectivity time and user's time is within six hours = 6 * 60 *60 = 21600 s int secondOfLeapSecondEvent = i_DN * 24 * 60 * 60; @@ -62,9 +62,9 @@ double Gps_Utc_Model::utc_time(double gpstime_corrected, int i_GPS_week) { t_utc_daytime = fmod(gpstime_corrected - Delta_t_UTC, 86400); } - else //we are in the same week than the leap second event + else //we are in the same week than the leap second event { - if (std::abs(gpstime_corrected - secondOfLeapSecondEvent) > 21600) + if (std::abs(gpstime_corrected - secondOfLeapSecondEvent) > 21600) { /* 20.3.3.5.2.4a * Whenever the effectivity time indicated by the WN_LSF and the DN values @@ -87,14 +87,14 @@ double Gps_Utc_Model::utc_time(double gpstime_corrected, int i_GPS_week) t_utc_daytime = fmod(W, 86400 + d_DeltaT_LSF - d_DeltaT_LS); //implement something to handle a leap second event! } - if ( (gpstime_corrected - secondOfLeapSecondEvent) > 21600) + if ((gpstime_corrected - secondOfLeapSecondEvent) > 21600) { Delta_t_UTC = d_DeltaT_LSF + d_A0 + d_A1 * (gpstime_corrected - d_t_OT + 604800 * static_cast(i_GPS_week - i_WN_T)); t_utc_daytime = fmod(gpstime_corrected - Delta_t_UTC, 86400); } } } - else // the effectivity time is in the past + else // the effectivity time is in the past { /* 20.3.3.5.2.4c * Whenever the effectivity time of the leap second event, as indicated by the @@ -109,4 +109,3 @@ double Gps_Utc_Model::utc_time(double gpstime_corrected, int i_GPS_week) t_utc = secondsOfWeekBeforeToday + t_utc_daytime; return t_utc; } - diff --git a/src/core/system_parameters/gps_utc_model.h b/src/core/system_parameters/gps_utc_model.h index 1a8938828..b45b86a0c 100644 --- a/src/core/system_parameters/gps_utc_model.h +++ b/src/core/system_parameters/gps_utc_model.h @@ -60,23 +60,25 @@ public: */ Gps_Utc_Model(); - template + template /* * \brief Serialize is a boost standard method to be called by the boost XML serialization. Here is used to save the ephemeris data on disk file. */ inline void serialize(Archive& archive, const unsigned int version) { using boost::serialization::make_nvp; - if(version){}; - archive & make_nvp("valid",valid); - archive & make_nvp("d_A1",d_A1); - archive & make_nvp("d_A0",d_A0); - archive & make_nvp("d_t_OT",d_t_OT); - archive & make_nvp("i_WN_T",i_WN_T); - archive & make_nvp("d_DeltaT_LS",d_DeltaT_LS); - archive & make_nvp("i_WN_LSF",i_WN_LSF); - archive & make_nvp("i_DN",i_DN); - archive & make_nvp("d_DeltaT_LSF",d_DeltaT_LSF); + if (version) + { + }; + archive& make_nvp("valid", valid); + archive& make_nvp("d_A1", d_A1); + archive& make_nvp("d_A0", d_A0); + archive& make_nvp("d_t_OT", d_t_OT); + archive& make_nvp("i_WN_T", i_WN_T); + archive& make_nvp("d_DeltaT_LS", d_DeltaT_LS); + archive& make_nvp("i_WN_LSF", i_WN_LSF); + archive& make_nvp("i_DN", i_DN); + archive& make_nvp("d_DeltaT_LSF", d_DeltaT_LSF); } /*! diff --git a/src/core/system_parameters/rtcm.cc b/src/core/system_parameters/rtcm.cc index f87223ae3..9cd546aed 100644 --- a/src/core/system_parameters/rtcm.cc +++ b/src/core/system_parameters/rtcm.cc @@ -51,7 +51,7 @@ Rtcm::Rtcm(unsigned short port) RTCM_port = port; preamble = std::bitset<8>("11010011"); reserved_field = std::bitset<6>("000000"); - rtcm_message_queue = std::make_shared< concurrent_queue >(); + rtcm_message_queue = std::make_shared >(); boost::asio::ip::tcp::endpoint endpoint(boost::asio::ip::tcp::v4(), RTCM_port); servers.emplace_back(io_service, endpoint); server_is_running = false; @@ -60,25 +60,24 @@ Rtcm::Rtcm(unsigned short port) Rtcm::~Rtcm() { - if(server_is_running) + if (server_is_running) { try - { + { stop_server(); - } - catch(const boost::exception & e) - { + } + catch (const boost::exception& e) + { LOG(WARNING) << "Boost exception: " << boost::diagnostic_information(e); - } - catch(const std::exception & ex) - { + } + catch (const std::exception& ex) + { LOG(WARNING) << "STD exception: " << ex.what(); - } + } } } - // ***************************************************************************************************** // // TCP Server helper classes @@ -88,18 +87,18 @@ void Rtcm::run_server() { std::cout << "Starting a TCP Server on port " << RTCM_port << std::endl; try - { - std::thread tq([&]{ std::make_shared(io_service, rtcm_message_queue, RTCM_port)->do_read_queue(); }); + { + std::thread tq([&] { std::make_shared(io_service, rtcm_message_queue, RTCM_port)->do_read_queue(); }); tq.detach(); - std::thread t([&]{ io_service.run(); }); + std::thread t([&] { io_service.run(); }); server_is_running = true; t.detach(); - } - catch (const std::exception & e) - { + } + catch (const std::exception& e) + { std::cerr << "Exception: " << e.what() << "\n"; - } + } } @@ -112,7 +111,7 @@ void Rtcm::stop_service() void Rtcm::stop_server() { std::cout << "Stopping TCP Server on port " << RTCM_port << std::endl; - rtcm_message_queue->push("Goodbye"); // this terminates tq + rtcm_message_queue->push("Goodbye"); // this terminates tq Rtcm::stop_service(); servers.front().close_server(); std::this_thread::sleep_for(std::chrono::seconds(1)); @@ -120,7 +119,7 @@ void Rtcm::stop_server() } -void Rtcm::send_message(const std::string & msg) +void Rtcm::send_message(const std::string& msg) { rtcm_message_queue->push(msg); } @@ -138,7 +137,7 @@ bool Rtcm::is_server_running() const // // ***************************************************************************************************** -std::string Rtcm::add_CRC (const std::string & message_without_crc) const +std::string Rtcm::add_CRC(const std::string& message_without_crc) const { // ****** Computes Qualcomm CRC-24Q ****** boost::crc_optimal<24, 0x1864CFBu, 0x0, 0x0, false, false> CRC_RTCM; @@ -158,14 +157,14 @@ std::string Rtcm::add_CRC (const std::string & message_without_crc) const } -bool Rtcm::check_CRC(const std::string & message) const +bool Rtcm::check_CRC(const std::string& message) const { boost::crc_optimal<24, 0x1864CFBu, 0x0, 0x0, false, false> CRC_RTCM_CHECK; // Convert message to binary std::string message_bin = Rtcm::binary_data_to_bin(message); // Check CRC std::string crc = message_bin.substr(message_bin.length() - 24, 24); - std::bitset<24> read_crc = std::bitset<24>(crc); + std::bitset<24> read_crc = std::bitset<24>(crc); std::string msg_without_crc = message_bin.substr(0, message_bin.length() - 24); boost::dynamic_bitset frame_bits(msg_without_crc); @@ -175,7 +174,7 @@ bool Rtcm::check_CRC(const std::string & message) const CRC_RTCM_CHECK.process_bytes(bytes.data(), bytes.size()); std::bitset<24> computed_crc = std::bitset<24>(CRC_RTCM_CHECK.checksum()); - if(read_crc == computed_crc) + if (read_crc == computed_crc) { return true; } @@ -194,7 +193,7 @@ std::string Rtcm::bin_to_binary_data(const std::string& s) const unsigned int k = 0; if (remainder != 0) { - s_aux.assign(s, 0 , remainder); + s_aux.assign(s, 0, remainder); boost::dynamic_bitset<> rembits(s_aux); unsigned long int n = rembits.to_ulong(); c[0] = static_cast(n); @@ -202,12 +201,12 @@ std::string Rtcm::bin_to_binary_data(const std::string& s) const } unsigned int start = std::max(remainder, 0); - for(unsigned int i = start; i < s.length() - 1; i = i + 8) + for (unsigned int i = start; i < s.length() - 1; i = i + 8) { s_aux.assign(s, i, 4); std::bitset<4> bs(s_aux); unsigned n = bs.to_ulong(); - s_aux.assign(s, i + 4 , 4); + s_aux.assign(s, i + 4, 4); std::bitset<4> bs2(s_aux); unsigned n2 = bs2.to_ulong(); c[k] = static_cast(n * 16) + static_cast(n2); @@ -224,7 +223,7 @@ std::string Rtcm::binary_data_to_bin(const std::string& s) const std::string s_aux; std::stringstream ss; - for(unsigned int i = 0; i < s.length(); i++) + for (unsigned int i = 0; i < s.length(); i++) { unsigned char val = static_cast(s.at(i)); std::bitset<8> bs(val); @@ -244,14 +243,14 @@ std::string Rtcm::bin_to_hex(const std::string& s) const if (remainder != 0) { - s_aux.assign(s, 0 , remainder); + s_aux.assign(s, 0, remainder); boost::dynamic_bitset<> rembits(s_aux); unsigned n = rembits.to_ulong(); ss << std::hex << n; } unsigned int start = std::max(remainder, 0); - for(unsigned int i = start; i < s.length() - 1; i = i + 4) + for (unsigned int i = start; i < s.length() - 1; i = i + 4) { s_aux.assign(s, i, 4); std::bitset<4> bs(s_aux); @@ -269,10 +268,10 @@ std::string Rtcm::hex_to_bin(const std::string& s) const std::stringstream ss; ss << s; std::string s_lower = boost::to_upper_copy(ss.str()); - for(unsigned int i = 0; i < s.length(); i++) + for (unsigned int i = 0; i < s.length(); i++) { unsigned long int n; - std::istringstream(s_lower.substr(i,1)) >> std::hex >> n; + std::istringstream(s_lower.substr(i, 1)) >> std::hex >> n; std::bitset<4> bs(n); s_aux += bs.to_string(); } @@ -282,7 +281,7 @@ std::string Rtcm::hex_to_bin(const std::string& s) const unsigned long int Rtcm::bin_to_uint(const std::string& s) const { - if(s.length() > 32) + if (s.length() > 32) { LOG(WARNING) << "Cannot convert to a unsigned long int"; return 0; @@ -294,7 +293,7 @@ unsigned long int Rtcm::bin_to_uint(const std::string& s) const long int Rtcm::bin_to_int(const std::string& s) const { - if(s.length() > 32) + if (s.length() > 32) { LOG(WARNING) << "Cannot convert to a long int"; return 0; @@ -302,12 +301,12 @@ long int Rtcm::bin_to_int(const std::string& s) const long int reading; // Handle negative numbers - if(s.substr(0,1).compare("0")) + if (s.substr(0, 1).compare("0")) { // Computing two's complement boost::dynamic_bitset<> original_bitset(s); original_bitset.flip(); - reading = - (original_bitset.to_ulong() + 1); + reading = -(original_bitset.to_ulong() + 1); } else { @@ -319,7 +318,7 @@ long int Rtcm::bin_to_int(const std::string& s) const long int Rtcm::bin_to_sint(const std::string& s) const { - if(s.length() > 32) + if (s.length() > 32) { LOG(WARNING) << "Cannot convert to a long int"; return 0; @@ -328,26 +327,26 @@ long int Rtcm::bin_to_sint(const std::string& s) const long int sign; // Check for sign bit as defined RTCM doc - if(s.substr(0,1).compare("0") == 0) + if (s.substr(0, 1).compare("0") == 0) { sign = 1; // Get the magnitude of the value - reading = strtol((s.substr (1)).c_str(), NULL, 2); + reading = strtol((s.substr(1)).c_str(), NULL, 2); } else { sign = -1; // Get the magnitude of the value - reading = strtol((s.substr (1)).c_str(), NULL, 2); + reading = strtol((s.substr(1)).c_str(), NULL, 2); } - return sign*reading; + return sign * reading; } // Find the sign for glonass data fields (neg = 1, pos = 0) static inline unsigned long glo_sgn(double val) { - if (val < 0) return 1; // If value is negative return 1 - if (val==0) return 0; // Positive or equal to zero return 0 + if (val < 0) return 1; // If value is negative return 1 + if (val == 0) return 0; // Positive or equal to zero return 0 return 0; } @@ -355,7 +354,7 @@ static inline unsigned long glo_sgn(double val) double Rtcm::bin_to_double(const std::string& s) const { double reading; - if(s.length() > 64) + if (s.length() > 64) { LOG(WARNING) << "Cannot convert to a double"; return 0; @@ -364,14 +363,14 @@ double Rtcm::bin_to_double(const std::string& s) const long long int reading_int; // Handle negative numbers - if(s.substr(0,1).compare("0")) + if (s.substr(0, 1).compare("0")) { // Computing two's complement boost::dynamic_bitset<> original_bitset(s); original_bitset.flip(); std::string aux; to_string(original_bitset, aux); - reading_int = - (strtoll(aux.c_str(), NULL, 2) + 1); + reading_int = -(strtoll(aux.c_str(), NULL, 2) + 1); } else { @@ -385,7 +384,7 @@ double Rtcm::bin_to_double(const std::string& s) const unsigned long int Rtcm::hex_to_uint(const std::string& s) const { - if(s.length() > 32) + if (s.length() > 32) { LOG(WARNING) << "Cannot convert to a unsigned long int"; return 0; @@ -397,7 +396,7 @@ unsigned long int Rtcm::hex_to_uint(const std::string& s) const long int Rtcm::hex_to_int(const std::string& s) const { - if(s.length() > 32) + if (s.length() > 32) { LOG(WARNING) << "Cannot convert to a long int"; return 0; @@ -407,23 +406,22 @@ long int Rtcm::hex_to_int(const std::string& s) const } -std::string Rtcm::build_message(const std::string & data) const +std::string Rtcm::build_message(const std::string& data) const { unsigned int msg_length_bits = data.length(); unsigned int msg_length_bytes = std::ceil(static_cast(msg_length_bits) / 8.0); std::bitset<10> message_length = std::bitset<10>(msg_length_bytes); - unsigned int zeros_to_fill = 8 * msg_length_bytes - msg_length_bits; + unsigned int zeros_to_fill = 8 * msg_length_bytes - msg_length_bits; std::string b(zeros_to_fill, '0'); std::string msg_content = data + b; std::string msg_without_crc = preamble.to_string() + - reserved_field.to_string() + - message_length.to_string() + - msg_content; + reserved_field.to_string() + + message_length.to_string() + + msg_content; return Rtcm::add_CRC(msg_without_crc); } - // ***************************************************************************************************** // // MESSAGES AS DEFINED AT RTCM STANDARD 10403.2 @@ -431,17 +429,16 @@ std::string Rtcm::build_message(const std::string & data) const // ***************************************************************************************************** - // ******************************************************** // // MESSAGE TYPE 1001 (GPS L1 OBSERVATIONS) // // ******************************************************** -std::bitset<64> Rtcm::get_MT1001_4_header(unsigned int msg_number, double obs_time, const std::map & observables, - unsigned int ref_id, unsigned int smooth_int, bool sync_flag, bool divergence_free) +std::bitset<64> Rtcm::get_MT1001_4_header(unsigned int msg_number, double obs_time, const std::map& observables, + unsigned int ref_id, unsigned int smooth_int, bool sync_flag, bool divergence_free) { - unsigned int reference_station_id = ref_id; // Max: 4095 + unsigned int reference_station_id = ref_id; // Max: 4095 const std::map observables_ = observables; bool synchronous_GNSS_flag = sync_flag; bool divergence_free_smoothing_indicator = divergence_free; @@ -455,39 +452,39 @@ std::bitset<64> Rtcm::get_MT1001_4_header(unsigned int msg_number, double obs_ti Rtcm::set_DF008(smoothing_interval); std::string header = DF002.to_string() + - DF003.to_string() + - DF004.to_string() + - DF005.to_string() + - DF006.to_string() + - DF007.to_string() + - DF008.to_string(); + DF003.to_string() + + DF004.to_string() + + DF005.to_string() + + DF006.to_string() + + DF007.to_string() + + DF008.to_string(); std::bitset<64> header_msg(header); return header_msg; } -std::bitset<58> Rtcm::get_MT1001_sat_content(const Gps_Ephemeris & eph, double obs_time, const Gnss_Synchro & gnss_synchro) +std::bitset<58> Rtcm::get_MT1001_sat_content(const Gps_Ephemeris& eph, double obs_time, const Gnss_Synchro& gnss_synchro) { - bool code_indicator = false; // code indicator 0: C/A code 1: P(Y) code direct + bool code_indicator = false; // code indicator 0: C/A code 1: P(Y) code direct Rtcm::set_DF009(gnss_synchro); - Rtcm::set_DF010(code_indicator); // code indicator 0: C/A code 1: P(Y) code direct + Rtcm::set_DF010(code_indicator); // code indicator 0: C/A code 1: P(Y) code direct Rtcm::set_DF011(gnss_synchro); Rtcm::set_DF012(gnss_synchro); Rtcm::set_DF013(eph, obs_time, gnss_synchro); std::string content = DF009.to_string() + - DF010.to_string() + - DF011.to_string() + - DF012.to_string() + - DF013.to_string(); + DF010.to_string() + + DF011.to_string() + + DF012.to_string() + + DF013.to_string(); std::bitset<58> content_msg(content); return content_msg; } -std::string Rtcm::print_MT1001(const Gps_Ephemeris & gps_eph, double obs_time, const std::map & observables, unsigned short station_id) +std::string Rtcm::print_MT1001(const Gps_Ephemeris& gps_eph, double obs_time, const std::map& observables, unsigned short station_id) { unsigned int ref_id = static_cast(station_id); unsigned int smooth_int = 0; @@ -498,13 +495,13 @@ std::string Rtcm::print_MT1001(const Gps_Ephemeris & gps_eph, double obs_time, c std::map observablesL1; std::map::const_iterator observables_iter; - for(observables_iter = observables.cbegin(); - observables_iter != observables.cend(); - observables_iter++) + for (observables_iter = observables.cbegin(); + observables_iter != observables.cend(); + observables_iter++) { std::string system_(&observables_iter->second.System, 1); std::string sig_(observables_iter->second.Signal); - if((system_.compare("G") == 0) && (sig_.compare("1C") == 0)) + if ((system_.compare("G") == 0) && (sig_.compare("1C") == 0)) { observablesL1.insert(std::pair(observables_iter->first, observables_iter->second)); } @@ -513,16 +510,16 @@ std::string Rtcm::print_MT1001(const Gps_Ephemeris & gps_eph, double obs_time, c std::bitset<64> header = Rtcm::get_MT1001_4_header(1001, obs_time, observablesL1, ref_id, smooth_int, sync_flag, divergence_free); std::string data = header.to_string(); - for(observables_iter = observablesL1.cbegin(); - observables_iter != observablesL1.cend(); - observables_iter++) + for (observables_iter = observablesL1.cbegin(); + observables_iter != observablesL1.cend(); + observables_iter++) { std::bitset<58> content = Rtcm::get_MT1001_sat_content(gps_eph, obs_time, observables_iter->second); data += content.to_string(); } std::string msg = build_message(data); - if(server_is_running) + if (server_is_running) { rtcm_message_queue->push(msg); } @@ -530,14 +527,13 @@ std::string Rtcm::print_MT1001(const Gps_Ephemeris & gps_eph, double obs_time, c } - // ******************************************************** // // MESSAGE TYPE 1002 (EXTENDED GPS L1 OBSERVATIONS) // // ******************************************************** -std::string Rtcm::print_MT1002(const Gps_Ephemeris & gps_eph, double obs_time, const std::map & observables, unsigned short station_id) +std::string Rtcm::print_MT1002(const Gps_Ephemeris& gps_eph, double obs_time, const std::map& observables, unsigned short station_id) { unsigned int ref_id = static_cast(station_id); unsigned int smooth_int = 0; @@ -548,13 +544,13 @@ std::string Rtcm::print_MT1002(const Gps_Ephemeris & gps_eph, double obs_time, c std::map observablesL1; std::map::const_iterator observables_iter; - for(observables_iter = observables.cbegin(); - observables_iter != observables.cend(); - observables_iter++) + for (observables_iter = observables.cbegin(); + observables_iter != observables.cend(); + observables_iter++) { std::string system_(&observables_iter->second.System, 1); std::string sig_(observables_iter->second.Signal); - if((system_.compare("G") == 0) && (sig_.compare("1C") == 0)) + if ((system_.compare("G") == 0) && (sig_.compare("1C") == 0)) { observablesL1.insert(std::pair(observables_iter->first, observables_iter->second)); } @@ -563,16 +559,16 @@ std::string Rtcm::print_MT1002(const Gps_Ephemeris & gps_eph, double obs_time, c std::bitset<64> header = Rtcm::get_MT1001_4_header(1002, obs_time, observablesL1, ref_id, smooth_int, sync_flag, divergence_free); std::string data = header.to_string(); - for(observables_iter = observablesL1.cbegin(); - observables_iter != observablesL1.cend(); - observables_iter++) + for (observables_iter = observablesL1.cbegin(); + observables_iter != observablesL1.cend(); + observables_iter++) { std::bitset<74> content = Rtcm::get_MT1002_sat_content(gps_eph, obs_time, observables_iter->second); data += content.to_string(); } std::string msg = build_message(data); - if(server_is_running) + if (server_is_running) { rtcm_message_queue->push(msg); } @@ -580,36 +576,35 @@ std::string Rtcm::print_MT1002(const Gps_Ephemeris & gps_eph, double obs_time, c } -std::bitset<74> Rtcm::get_MT1002_sat_content(const Gps_Ephemeris & eph, double obs_time, const Gnss_Synchro & gnss_synchro) +std::bitset<74> Rtcm::get_MT1002_sat_content(const Gps_Ephemeris& eph, double obs_time, const Gnss_Synchro& gnss_synchro) { - bool code_indicator = false; // code indicator 0: C/A code 1: P(Y) code direct + bool code_indicator = false; // code indicator 0: C/A code 1: P(Y) code direct Rtcm::set_DF009(gnss_synchro); - Rtcm::set_DF010(code_indicator); // code indicator 0: C/A code 1: P(Y) code direct + Rtcm::set_DF010(code_indicator); // code indicator 0: C/A code 1: P(Y) code direct Rtcm::set_DF011(gnss_synchro); Rtcm::set_DF012(gnss_synchro); Rtcm::set_DF013(eph, obs_time, gnss_synchro); std::string content = DF009.to_string() + - DF010.to_string() + - DF011.to_string() + - DF012.to_string() + - DF013.to_string() + - DF014.to_string() + - DF015.to_string(); + DF010.to_string() + + DF011.to_string() + + DF012.to_string() + + DF013.to_string() + + DF014.to_string() + + DF015.to_string(); std::bitset<74> content_msg(content); return content_msg; } - // ******************************************************** // // MESSAGE TYPE 1003 (GPS L1 & L2 OBSERVATIONS) // // ******************************************************** -std::string Rtcm::print_MT1003(const Gps_Ephemeris & ephL1, const Gps_CNAV_Ephemeris & ephL2, double obs_time, const std::map & observables, unsigned short station_id) +std::string Rtcm::print_MT1003(const Gps_Ephemeris& ephL1, const Gps_CNAV_Ephemeris& ephL2, double obs_time, const std::map& observables, unsigned short station_id) { unsigned int ref_id = static_cast(station_id); unsigned int smooth_int = 0; @@ -622,37 +617,37 @@ std::string Rtcm::print_MT1003(const Gps_Ephemeris & ephL1, const Gps_CNAV_Ephem std::map::const_iterator observables_iter; std::map::const_iterator observables_iter2; - for(observables_iter = observables.cbegin(); - observables_iter != observables.cend(); - observables_iter++) + for (observables_iter = observables.cbegin(); + observables_iter != observables.cend(); + observables_iter++) { std::string system_(&observables_iter->second.System, 1); std::string sig_(observables_iter->second.Signal); - if((system_.compare("G") == 0) && (sig_.compare("1C") == 0)) + if ((system_.compare("G") == 0) && (sig_.compare("1C") == 0)) { observablesL1.insert(std::pair(observables_iter->first, observables_iter->second)); } - if((system_.compare("G") == 0) && (sig_.compare("2S") == 0)) + if ((system_.compare("G") == 0) && (sig_.compare("2S") == 0)) { observablesL2.insert(std::pair(observables_iter->first, observables_iter->second)); } } // Get common observables - std::vector< std::pair< Gnss_Synchro, Gnss_Synchro > > common_observables; - std::vector< std::pair< Gnss_Synchro, Gnss_Synchro > >::const_iterator common_observables_iter; + std::vector > common_observables; + std::vector >::const_iterator common_observables_iter; std::map observablesL1_with_L2; - for(observables_iter = observablesL1.cbegin(); - observables_iter != observablesL1.cend(); - observables_iter++) + for (observables_iter = observablesL1.cbegin(); + observables_iter != observablesL1.cend(); + observables_iter++) { unsigned int prn_ = observables_iter->second.PRN; - for(observables_iter2 = observablesL2.cbegin(); - observables_iter2 != observablesL2.cend(); - observables_iter2++) + for (observables_iter2 = observablesL2.cbegin(); + observables_iter2 != observablesL2.cend(); + observables_iter2++) { - if(observables_iter2->second.PRN == prn_) + if (observables_iter2->second.PRN == prn_) { std::pair p; Gnss_Synchro pr1 = observables_iter->second; @@ -667,16 +662,16 @@ std::string Rtcm::print_MT1003(const Gps_Ephemeris & ephL1, const Gps_CNAV_Ephem std::bitset<64> header = Rtcm::get_MT1001_4_header(1003, obs_time, observablesL1_with_L2, ref_id, smooth_int, sync_flag, divergence_free); std::string data = header.to_string(); - for(common_observables_iter = common_observables.cbegin(); - common_observables_iter != common_observables.cend(); - common_observables_iter++) + for (common_observables_iter = common_observables.cbegin(); + common_observables_iter != common_observables.cend(); + common_observables_iter++) { std::bitset<101> content = Rtcm::get_MT1003_sat_content(ephL1, ephL2, obs_time, common_observables_iter->first, common_observables_iter->second); data += content.to_string(); } std::string msg = build_message(data); - if(server_is_running) + if (server_is_running) { rtcm_message_queue->push(msg); } @@ -684,42 +679,41 @@ std::string Rtcm::print_MT1003(const Gps_Ephemeris & ephL1, const Gps_CNAV_Ephem } -std::bitset<101> Rtcm::get_MT1003_sat_content(const Gps_Ephemeris & ephL1, const Gps_CNAV_Ephemeris & ephL2, double obs_time, const Gnss_Synchro & gnss_synchroL1, const Gnss_Synchro & gnss_synchroL2) +std::bitset<101> Rtcm::get_MT1003_sat_content(const Gps_Ephemeris& ephL1, const Gps_CNAV_Ephemeris& ephL2, double obs_time, const Gnss_Synchro& gnss_synchroL1, const Gnss_Synchro& gnss_synchroL2) { - bool code_indicator = false; // code indicator 0: C/A code 1: P(Y) code direct + bool code_indicator = false; // code indicator 0: C/A code 1: P(Y) code direct Rtcm::set_DF009(gnss_synchroL1); - Rtcm::set_DF010(code_indicator); // code indicator 0: C/A code 1: P(Y) code direct + Rtcm::set_DF010(code_indicator); // code indicator 0: C/A code 1: P(Y) code direct Rtcm::set_DF011(gnss_synchroL1); Rtcm::set_DF012(gnss_synchroL1); Rtcm::set_DF013(ephL1, obs_time, gnss_synchroL1); - std::bitset<2> DF016_ = std::bitset<2>(0); // code indicator 0: C/A or L2C code 1: P(Y) code direct 2:P(Y) code cross-correlated 3: Correlated P/Y + std::bitset<2> DF016_ = std::bitset<2>(0); // code indicator 0: C/A or L2C code 1: P(Y) code direct 2:P(Y) code cross-correlated 3: Correlated P/Y Rtcm::set_DF017(gnss_synchroL1, gnss_synchroL2); Rtcm::set_DF018(gnss_synchroL1, gnss_synchroL2); Rtcm::set_DF019(ephL2, obs_time, gnss_synchroL2); std::string content = DF009.to_string() + - DF010.to_string() + - DF011.to_string() + - DF012.to_string() + - DF013.to_string() + - DF016_.to_string() + - DF017.to_string() + - DF018.to_string() + - DF019.to_string(); + DF010.to_string() + + DF011.to_string() + + DF012.to_string() + + DF013.to_string() + + DF016_.to_string() + + DF017.to_string() + + DF018.to_string() + + DF019.to_string(); std::bitset<101> content_msg(content); return content_msg; } - // ****************************************************************** // // MESSAGE TYPE 1004 (EXTENDED GPS L1 & L2 OBSERVATIONS) // // ****************************************************************** -std::string Rtcm::print_MT1004(const Gps_Ephemeris & ephL1, const Gps_CNAV_Ephemeris & ephL2, double obs_time, const std::map & observables, unsigned short station_id) +std::string Rtcm::print_MT1004(const Gps_Ephemeris& ephL1, const Gps_CNAV_Ephemeris& ephL2, double obs_time, const std::map& observables, unsigned short station_id) { unsigned int ref_id = static_cast(station_id); unsigned int smooth_int = 0; @@ -732,37 +726,37 @@ std::string Rtcm::print_MT1004(const Gps_Ephemeris & ephL1, const Gps_CNAV_Ephem std::map::const_iterator observables_iter; std::map::const_iterator observables_iter2; - for(observables_iter = observables.cbegin(); - observables_iter != observables.cend(); - observables_iter++) + for (observables_iter = observables.cbegin(); + observables_iter != observables.cend(); + observables_iter++) { std::string system_(&observables_iter->second.System, 1); std::string sig_(observables_iter->second.Signal); - if((system_.compare("G") == 0) && (sig_.compare("1C") == 0)) + if ((system_.compare("G") == 0) && (sig_.compare("1C") == 0)) { observablesL1.insert(std::pair(observables_iter->first, observables_iter->second)); } - if((system_.compare("G") == 0) && (sig_.compare("2S") == 0)) + if ((system_.compare("G") == 0) && (sig_.compare("2S") == 0)) { observablesL2.insert(std::pair(observables_iter->first, observables_iter->second)); } } // Get common observables - std::vector< std::pair< Gnss_Synchro, Gnss_Synchro > > common_observables; - std::vector< std::pair< Gnss_Synchro, Gnss_Synchro > >::const_iterator common_observables_iter; + std::vector > common_observables; + std::vector >::const_iterator common_observables_iter; std::map observablesL1_with_L2; - for(observables_iter = observablesL1.cbegin(); - observables_iter != observablesL1.cend(); - observables_iter++) + for (observables_iter = observablesL1.cbegin(); + observables_iter != observablesL1.cend(); + observables_iter++) { unsigned int prn_ = observables_iter->second.PRN; - for(observables_iter2 = observablesL2.cbegin(); - observables_iter2 != observablesL2.cend(); - observables_iter2++) + for (observables_iter2 = observablesL2.cbegin(); + observables_iter2 != observablesL2.cend(); + observables_iter2++) { - if(observables_iter2->second.PRN == prn_) + if (observables_iter2->second.PRN == prn_) { std::pair p; Gnss_Synchro pr1 = observables_iter->second; @@ -777,16 +771,16 @@ std::string Rtcm::print_MT1004(const Gps_Ephemeris & ephL1, const Gps_CNAV_Ephem std::bitset<64> header = Rtcm::get_MT1001_4_header(1004, obs_time, observablesL1_with_L2, ref_id, smooth_int, sync_flag, divergence_free); std::string data = header.to_string(); - for(common_observables_iter = common_observables.cbegin(); - common_observables_iter != common_observables.cend(); - common_observables_iter++) + for (common_observables_iter = common_observables.cbegin(); + common_observables_iter != common_observables.cend(); + common_observables_iter++) { std::bitset<125> content = Rtcm::get_MT1004_sat_content(ephL1, ephL2, obs_time, common_observables_iter->first, common_observables_iter->second); data += content.to_string(); } std::string msg = build_message(data); - if(server_is_running) + if (server_is_running) { rtcm_message_queue->push(msg); } @@ -794,41 +788,40 @@ std::string Rtcm::print_MT1004(const Gps_Ephemeris & ephL1, const Gps_CNAV_Ephem } -std::bitset<125> Rtcm::get_MT1004_sat_content(const Gps_Ephemeris & ephL1, const Gps_CNAV_Ephemeris & ephL2, double obs_time, const Gnss_Synchro & gnss_synchroL1, const Gnss_Synchro & gnss_synchroL2) +std::bitset<125> Rtcm::get_MT1004_sat_content(const Gps_Ephemeris& ephL1, const Gps_CNAV_Ephemeris& ephL2, double obs_time, const Gnss_Synchro& gnss_synchroL1, const Gnss_Synchro& gnss_synchroL2) { - bool code_indicator = false; // code indicator 0: C/A code 1: P(Y) code direct + bool code_indicator = false; // code indicator 0: C/A code 1: P(Y) code direct Rtcm::set_DF009(gnss_synchroL1); - Rtcm::set_DF010(code_indicator); // code indicator 0: C/A code 1: P(Y) code direct + Rtcm::set_DF010(code_indicator); // code indicator 0: C/A code 1: P(Y) code direct Rtcm::set_DF011(gnss_synchroL1); Rtcm::set_DF012(gnss_synchroL1); Rtcm::set_DF013(ephL1, obs_time, gnss_synchroL1); Rtcm::set_DF014(gnss_synchroL1); Rtcm::set_DF015(gnss_synchroL1); - std::bitset<2> DF016_ = std::bitset<2>(0); // code indicator 0: C/A or L2C code 1: P(Y) code direct 2:P(Y) code cross-correlated 3: Correlated P/Y + std::bitset<2> DF016_ = std::bitset<2>(0); // code indicator 0: C/A or L2C code 1: P(Y) code direct 2:P(Y) code cross-correlated 3: Correlated P/Y Rtcm::set_DF017(gnss_synchroL1, gnss_synchroL2); Rtcm::set_DF018(gnss_synchroL1, gnss_synchroL2); Rtcm::set_DF019(ephL2, obs_time, gnss_synchroL2); Rtcm::set_DF020(gnss_synchroL2); std::string content = DF009.to_string() + - DF010.to_string() + - DF011.to_string() + - DF012.to_string() + - DF013.to_string() + - DF014.to_string() + - DF015.to_string() + - DF016_.to_string() + - DF017.to_string() + - DF018.to_string() + - DF019.to_string() + - DF020.to_string(); + DF010.to_string() + + DF011.to_string() + + DF012.to_string() + + DF013.to_string() + + DF014.to_string() + + DF015.to_string() + + DF016_.to_string() + + DF017.to_string() + + DF018.to_string() + + DF019.to_string() + + DF020.to_string(); std::bitset<125> content_msg(content); return content_msg; } - // ******************************************************** // // MESSAGE TYPE 1005 (STATION DESCRIPTION) @@ -845,50 +838,50 @@ std::bitset<125> Rtcm::get_MT1004_sat_content(const Gps_Ephemeris & ephL1, const Expected output: D3 00 13 3E D7 D3 02 02 98 0E DE EF 34 B4 BD 62 AC 09 41 98 6F 33 36 0B 98 */ -std::bitset<152> Rtcm::get_MT1005_test () +std::bitset<152> Rtcm::get_MT1005_test() { unsigned int mt1005 = 1005; - unsigned int reference_station_id = 2003; // Max: 4095 - double ECEF_X = 1114104.5999; // units: m - double ECEF_Y = -4850729.7108; // units: m - double ECEF_Z = 3975521.4643; // units: m + unsigned int reference_station_id = 2003; // Max: 4095 + double ECEF_X = 1114104.5999; // units: m + double ECEF_Y = -4850729.7108; // units: m + double ECEF_Z = 3975521.4643; // units: m std::bitset<1> DF001_; Rtcm::set_DF002(mt1005); Rtcm::set_DF003(reference_station_id); Rtcm::set_DF021(); - Rtcm::set_DF022(true); // GPS - Rtcm::set_DF023(false); // Glonass - Rtcm::set_DF024(false); // Galileo - DF141 = std::bitset<1>("0"); // 0: Real, physical reference station - DF001_ = std::bitset<1>("0"); // Reserved, set to 0 + Rtcm::set_DF022(true); // GPS + Rtcm::set_DF023(false); // Glonass + Rtcm::set_DF024(false); // Galileo + DF141 = std::bitset<1>("0"); // 0: Real, physical reference station + DF001_ = std::bitset<1>("0"); // Reserved, set to 0 Rtcm::set_DF025(ECEF_X); - DF142 = std::bitset<1>("0"); // Single Receiver Oscillator Indicator + DF142 = std::bitset<1>("0"); // Single Receiver Oscillator Indicator Rtcm::set_DF026(ECEF_Y); - DF364 = std::bitset<2>("00"); // Quarter Cycle Indicator + DF364 = std::bitset<2>("00"); // Quarter Cycle Indicator Rtcm::set_DF027(ECEF_Z); std::string message = DF002.to_string() + - DF003.to_string() + - DF021.to_string() + - DF022.to_string() + - DF023.to_string() + - DF024.to_string() + - DF141.to_string() + - DF025.to_string() + - DF142.to_string() + - DF001_.to_string() + - DF026.to_string() + - DF364.to_string() + - DF027.to_string() ; + DF003.to_string() + + DF021.to_string() + + DF022.to_string() + + DF023.to_string() + + DF024.to_string() + + DF141.to_string() + + DF025.to_string() + + DF142.to_string() + + DF001_.to_string() + + DF026.to_string() + + DF364.to_string() + + DF027.to_string(); std::bitset<152> test_msg(message); return test_msg; } -std::string Rtcm::print_MT1005( unsigned int ref_id, double ecef_x, double ecef_y, double ecef_z, bool gps, bool glonass, bool galileo, bool non_physical, bool single_oscillator, unsigned int quarter_cycle_indicator) +std::string Rtcm::print_MT1005(unsigned int ref_id, double ecef_x, double ecef_y, double ecef_z, bool gps, bool glonass, bool galileo, bool non_physical, bool single_oscillator, unsigned int quarter_cycle_indicator) { unsigned int msg_number = 1005; std::bitset<1> DF001_; @@ -908,21 +901,21 @@ std::string Rtcm::print_MT1005( unsigned int ref_id, double ecef_x, double ecef_ Rtcm::set_DF027(ecef_z); std::string data = DF002.to_string() + - DF003.to_string() + - DF021.to_string() + - DF022.to_string() + - DF023.to_string() + - DF024.to_string() + - DF141.to_string() + - DF025.to_string() + - DF142.to_string() + - DF001_.to_string() + - DF026.to_string() + - DF364.to_string() + - DF027.to_string() ; + DF003.to_string() + + DF021.to_string() + + DF022.to_string() + + DF023.to_string() + + DF024.to_string() + + DF141.to_string() + + DF025.to_string() + + DF142.to_string() + + DF001_.to_string() + + DF026.to_string() + + DF364.to_string() + + DF027.to_string(); std::string msg = build_message(data); - if(server_is_running) + if (server_is_running) { rtcm_message_queue->push(msg); } @@ -930,12 +923,12 @@ std::string Rtcm::print_MT1005( unsigned int ref_id, double ecef_x, double ecef_ } -int Rtcm::read_MT1005(const std::string & message, unsigned int & ref_id, double & ecef_x, double & ecef_y, double & ecef_z, bool & gps, bool & glonass, bool & galileo) +int Rtcm::read_MT1005(const std::string& message, unsigned int& ref_id, double& ecef_x, double& ecef_y, double& ecef_z, bool& gps, bool& glonass, bool& galileo) { // Convert message to binary std::string message_bin = Rtcm::binary_data_to_bin(message); - if(!Rtcm::check_CRC(message) ) + if (!Rtcm::check_CRC(message)) { LOG(WARNING) << " Bad CRC detected in RTCM message MT1005"; return 1; @@ -969,7 +962,7 @@ int Rtcm::read_MT1005(const std::string & message, unsigned int & ref_id, double ref_id = Rtcm::bin_to_uint(message_bin.substr(index, 12)); index += 12; - index += 6; // ITRF year + index += 6; // ITRF year gps = static_cast(Rtcm::bin_to_uint(message_bin.substr(index, 1))); index += 1; @@ -979,18 +972,18 @@ int Rtcm::read_MT1005(const std::string & message, unsigned int & ref_id, double galileo = static_cast(Rtcm::bin_to_uint(message_bin.substr(index, 1))); index += 1; - index += 1; // ref_station_indicator + index += 1; // ref_station_indicator ecef_x = Rtcm::bin_to_double(message_bin.substr(index, 38)) / 10000.0; index += 38; - index += 1; // single rx oscillator - index += 1; // reserved + index += 1; // single rx oscillator + index += 1; // reserved ecef_y = Rtcm::bin_to_double(message_bin.substr(index, 38)) / 10000.0; index += 38; - index += 2; // quarter cycle indicator + index += 2; // quarter cycle indicator ecef_z = Rtcm::bin_to_double(message_bin.substr(index, 38)) / 10000.0; return 0; @@ -1030,22 +1023,22 @@ std::string Rtcm::print_MT1006(unsigned int ref_id, double ecef_x, double ecef_y Rtcm::set_DF028(height); std::string data = DF002.to_string() + - DF003.to_string() + - DF021.to_string() + - DF022.to_string() + - DF023.to_string() + - DF024.to_string() + - DF141.to_string() + - DF025.to_string() + - DF142.to_string() + - DF001_.to_string() + - DF026.to_string() + - DF364.to_string() + - DF027.to_string() + - DF028.to_string(); + DF003.to_string() + + DF021.to_string() + + DF022.to_string() + + DF023.to_string() + + DF024.to_string() + + DF141.to_string() + + DF025.to_string() + + DF142.to_string() + + DF001_.to_string() + + DF026.to_string() + + DF364.to_string() + + DF027.to_string() + + DF028.to_string(); std::string msg = build_message(data); - if(server_is_running) + if (server_is_running) { rtcm_message_queue->push(msg); } @@ -1058,7 +1051,7 @@ std::string Rtcm::print_MT1006(unsigned int ref_id, double ecef_x, double ecef_y // MESSAGE TYPE 1008 (ANTENNA DESCRIPTOR & SERIAL NUMBER) // // ******************************************************** -std::string Rtcm::print_MT1008(unsigned int ref_id, const std::string & antenna_descriptor, unsigned int antenna_setup_id, const std::string & antenna_serial_number) +std::string Rtcm::print_MT1008(unsigned int ref_id, const std::string& antenna_descriptor, unsigned int antenna_setup_id, const std::string& antenna_serial_number) { unsigned int msg_number = 1008; std::bitset<12> DF002_ = std::bitset<12>(msg_number); @@ -1073,7 +1066,7 @@ std::string Rtcm::print_MT1008(unsigned int ref_id, const std::string & antenna_ DF029 = std::bitset<8>(len); std::string DF030_str_; - for(auto it = ant_descriptor.cbegin(); it != ant_descriptor.cend(); it++) + for (auto it = ant_descriptor.cbegin(); it != ant_descriptor.cend(); it++) { char c = *it; std::bitset<8> character = std::bitset<8>(c); @@ -1092,7 +1085,7 @@ std::string Rtcm::print_MT1008(unsigned int ref_id, const std::string & antenna_ DF032 = std::bitset<8>(len2); std::string DF033_str_; - for(auto it = ant_sn.cbegin(); it != ant_sn.cend(); it++) + for (auto it = ant_sn.cbegin(); it != ant_sn.cend(); it++) { char c = *it; std::bitset<8> character = std::bitset<8>(c); @@ -1100,15 +1093,15 @@ std::string Rtcm::print_MT1008(unsigned int ref_id, const std::string & antenna_ } std::string data = DF002_.to_string() + - DF003.to_string() + - DF029.to_string() + - DF030_str_ + - DF031.to_string() + - DF032.to_string() + - DF033_str_; + DF003.to_string() + + DF029.to_string() + + DF030_str_ + + DF031.to_string() + + DF032.to_string() + + DF033_str_; std::string msg = build_message(data); - if(server_is_running) + if (server_is_running) { rtcm_message_queue->push(msg); } @@ -1121,10 +1114,10 @@ std::string Rtcm::print_MT1008(unsigned int ref_id, const std::string & antenna_ // MESSAGE TYPE 1009 (GLONASS L1 Basic RTK Observables) // // ******************************************************** -std::bitset<61> Rtcm::get_MT1009_12_header(unsigned int msg_number, double obs_time, const std::map & observables, - unsigned int ref_id, unsigned int smooth_int, bool sync_flag, bool divergence_free) +std::bitset<61> Rtcm::get_MT1009_12_header(unsigned int msg_number, double obs_time, const std::map& observables, + unsigned int ref_id, unsigned int smooth_int, bool sync_flag, bool divergence_free) { - unsigned int reference_station_id = ref_id; // Max: 4095 + unsigned int reference_station_id = ref_id; // Max: 4095 const std::map observables_ = observables; bool synchronous_GNSS_flag = sync_flag; bool divergence_free_smoothing_indicator = divergence_free; @@ -1138,21 +1131,21 @@ std::bitset<61> Rtcm::get_MT1009_12_header(unsigned int msg_number, double obs_t Rtcm::set_DF037(smoothing_interval); std::string header = DF002.to_string() + - DF003.to_string() + - DF034.to_string() + - DF005.to_string() + - DF035.to_string() + - DF036.to_string() + - DF037.to_string(); + DF003.to_string() + + DF034.to_string() + + DF005.to_string() + + DF035.to_string() + + DF036.to_string() + + DF037.to_string(); std::bitset<61> header_msg(header); return header_msg; } -std::bitset<64> Rtcm::get_MT1009_sat_content(const Glonass_Gnav_Ephemeris & eph, double obs_time, const Gnss_Synchro & gnss_synchro) +std::bitset<64> Rtcm::get_MT1009_sat_content(const Glonass_Gnav_Ephemeris& eph, double obs_time, const Gnss_Synchro& gnss_synchro) { - bool code_indicator = false; // code indicator 0: C/A code 1: P(Y) code direct + bool code_indicator = false; // code indicator 0: C/A code 1: P(Y) code direct Rtcm::set_DF038(gnss_synchro); Rtcm::set_DF039(code_indicator); Rtcm::set_DF040(eph.i_satellite_freq_channel); @@ -1161,18 +1154,18 @@ std::bitset<64> Rtcm::get_MT1009_sat_content(const Glonass_Gnav_Ephemeris & eph, Rtcm::set_DF043(eph, obs_time, gnss_synchro); std::string content = DF038.to_string() + - DF039.to_string() + - DF040.to_string() + - DF041.to_string() + - DF042.to_string() + - DF043.to_string(); + DF039.to_string() + + DF040.to_string() + + DF041.to_string() + + DF042.to_string() + + DF043.to_string(); std::bitset<64> content_msg(content); return content_msg; } -std::string Rtcm::print_MT1009(const Glonass_Gnav_Ephemeris & glonass_gnav_eph, double obs_time, const std::map & observables, unsigned short station_id) +std::string Rtcm::print_MT1009(const Glonass_Gnav_Ephemeris& glonass_gnav_eph, double obs_time, const std::map& observables, unsigned short station_id) { unsigned int ref_id = static_cast(station_id); unsigned int smooth_int = 0; @@ -1183,13 +1176,13 @@ std::string Rtcm::print_MT1009(const Glonass_Gnav_Ephemeris & glonass_gnav_eph, std::map observablesL1; std::map::const_iterator observables_iter; - for(observables_iter = observables.begin(); - observables_iter != observables.end(); - observables_iter++) + for (observables_iter = observables.begin(); + observables_iter != observables.end(); + observables_iter++) { std::string system_(&observables_iter->second.System, 1); std::string sig_(observables_iter->second.Signal); - if((system_.compare("R") == 0) && (sig_.compare("1C") == 0)) + if ((system_.compare("R") == 0) && (sig_.compare("1C") == 0)) { observablesL1.insert(std::pair(observables_iter->first, observables_iter->second)); } @@ -1198,16 +1191,16 @@ std::string Rtcm::print_MT1009(const Glonass_Gnav_Ephemeris & glonass_gnav_eph, std::bitset<61> header = Rtcm::get_MT1009_12_header(1009, obs_time, observablesL1, ref_id, smooth_int, sync_flag, divergence_free); std::string data = header.to_string(); - for(observables_iter = observablesL1.begin(); - observables_iter != observablesL1.end(); - observables_iter++) + for (observables_iter = observablesL1.begin(); + observables_iter != observablesL1.end(); + observables_iter++) { std::bitset<64> content = Rtcm::get_MT1009_sat_content(glonass_gnav_eph, obs_time, observables_iter->second); data += content.to_string(); } std::string msg = build_message(data); - if(server_is_running) + if (server_is_running) { rtcm_message_queue->push(msg); } @@ -1221,7 +1214,7 @@ std::string Rtcm::print_MT1009(const Glonass_Gnav_Ephemeris & glonass_gnav_eph, // // ******************************************************** -std::string Rtcm::print_MT1010(const Glonass_Gnav_Ephemeris & glonass_gnav_eph, double obs_time, const std::map & observables, unsigned short station_id) +std::string Rtcm::print_MT1010(const Glonass_Gnav_Ephemeris& glonass_gnav_eph, double obs_time, const std::map& observables, unsigned short station_id) { unsigned int ref_id = static_cast(station_id); unsigned int smooth_int = 0; @@ -1232,13 +1225,13 @@ std::string Rtcm::print_MT1010(const Glonass_Gnav_Ephemeris & glonass_gnav_eph, std::map observablesL1; std::map::const_iterator observables_iter; - for(observables_iter = observables.begin(); - observables_iter != observables.end(); - observables_iter++) + for (observables_iter = observables.begin(); + observables_iter != observables.end(); + observables_iter++) { std::string system_(&observables_iter->second.System, 1); std::string sig_(observables_iter->second.Signal); - if((system_.compare("R") == 0) && (sig_.compare("1C") == 0)) + if ((system_.compare("R") == 0) && (sig_.compare("1C") == 0)) { observablesL1.insert(std::pair(observables_iter->first, observables_iter->second)); } @@ -1247,16 +1240,16 @@ std::string Rtcm::print_MT1010(const Glonass_Gnav_Ephemeris & glonass_gnav_eph, std::bitset<61> header = Rtcm::get_MT1009_12_header(1010, obs_time, observablesL1, ref_id, smooth_int, sync_flag, divergence_free); std::string data = header.to_string(); - for(observables_iter = observablesL1.begin(); - observables_iter != observablesL1.end(); - observables_iter++) + for (observables_iter = observablesL1.begin(); + observables_iter != observablesL1.end(); + observables_iter++) { std::bitset<79> content = Rtcm::get_MT1010_sat_content(glonass_gnav_eph, obs_time, observables_iter->second); data += content.to_string(); } std::string msg = build_message(data); - if(server_is_running) + if (server_is_running) { rtcm_message_queue->push(msg); } @@ -1264,9 +1257,9 @@ std::string Rtcm::print_MT1010(const Glonass_Gnav_Ephemeris & glonass_gnav_eph, } -std::bitset<79> Rtcm::get_MT1010_sat_content(const Glonass_Gnav_Ephemeris & eph, double obs_time, const Gnss_Synchro & gnss_synchro) +std::bitset<79> Rtcm::get_MT1010_sat_content(const Glonass_Gnav_Ephemeris& eph, double obs_time, const Gnss_Synchro& gnss_synchro) { - bool code_indicator = false; // code indicator 0: C/A code 1: P(Y) code direct + bool code_indicator = false; // code indicator 0: C/A code 1: P(Y) code direct Rtcm::set_DF038(gnss_synchro); Rtcm::set_DF039(code_indicator); Rtcm::set_DF040(eph.i_satellite_freq_channel); @@ -1277,27 +1270,26 @@ std::bitset<79> Rtcm::get_MT1010_sat_content(const Glonass_Gnav_Ephemeris & eph, Rtcm::set_DF045(gnss_synchro); std::string content = DF038.to_string() + - DF039.to_string() + - DF040.to_string() + - DF041.to_string() + - DF042.to_string() + - DF043.to_string() + - DF044.to_string() + - DF045.to_string(); + DF039.to_string() + + DF040.to_string() + + DF041.to_string() + + DF042.to_string() + + DF043.to_string() + + DF044.to_string() + + DF045.to_string(); std::bitset<79> content_msg(content); return content_msg; } - // ******************************************************** // // MESSAGE TYPE 1011 (GLONASS L1 & L2 OBSERVATIONS) // // ******************************************************** -std::string Rtcm::print_MT1011(const Glonass_Gnav_Ephemeris & ephL1, const Glonass_Gnav_Ephemeris & ephL2, double obs_time, const std::map & observables, unsigned short station_id) +std::string Rtcm::print_MT1011(const Glonass_Gnav_Ephemeris& ephL1, const Glonass_Gnav_Ephemeris& ephL2, double obs_time, const std::map& observables, unsigned short station_id) { unsigned int ref_id = static_cast(station_id); unsigned int smooth_int = 0; @@ -1310,37 +1302,37 @@ std::string Rtcm::print_MT1011(const Glonass_Gnav_Ephemeris & ephL1, const Glona std::map::const_iterator observables_iter; std::map::const_iterator observables_iter2; - for(observables_iter = observables.begin(); - observables_iter != observables.end(); - observables_iter++) + for (observables_iter = observables.begin(); + observables_iter != observables.end(); + observables_iter++) { std::string system_(&observables_iter->second.System, 1); std::string sig_(observables_iter->second.Signal); - if((system_.compare("R") == 0) && (sig_.compare("1C") == 0)) + if ((system_.compare("R") == 0) && (sig_.compare("1C") == 0)) { observablesL1.insert(std::pair(observables_iter->first, observables_iter->second)); } - if((system_.compare("R") == 0) && (sig_.compare("2C") == 0)) + if ((system_.compare("R") == 0) && (sig_.compare("2C") == 0)) { observablesL2.insert(std::pair(observables_iter->first, observables_iter->second)); } } // Get common observables - std::vector< std::pair< Gnss_Synchro, Gnss_Synchro > > common_observables; - std::vector< std::pair< Gnss_Synchro, Gnss_Synchro > >::const_iterator common_observables_iter; + std::vector > common_observables; + std::vector >::const_iterator common_observables_iter; std::map observablesL1_with_L2; - for(observables_iter = observablesL1.begin(); - observables_iter != observablesL1.end(); - observables_iter++) + for (observables_iter = observablesL1.begin(); + observables_iter != observablesL1.end(); + observables_iter++) { unsigned int prn_ = observables_iter->second.PRN; - for(observables_iter2 = observablesL2.begin(); - observables_iter2 != observablesL2.end(); - observables_iter2++) + for (observables_iter2 = observablesL2.begin(); + observables_iter2 != observablesL2.end(); + observables_iter2++) { - if(observables_iter2->second.PRN == prn_) + if (observables_iter2->second.PRN == prn_) { std::pair p; Gnss_Synchro pr1 = observables_iter->second; @@ -1355,16 +1347,16 @@ std::string Rtcm::print_MT1011(const Glonass_Gnav_Ephemeris & ephL1, const Glona std::bitset<61> header = Rtcm::get_MT1009_12_header(1011, obs_time, observablesL1_with_L2, ref_id, smooth_int, sync_flag, divergence_free); std::string data = header.to_string(); - for(common_observables_iter = common_observables.begin(); - common_observables_iter != common_observables.end(); - common_observables_iter++) + for (common_observables_iter = common_observables.begin(); + common_observables_iter != common_observables.end(); + common_observables_iter++) { std::bitset<107> content = Rtcm::get_MT1011_sat_content(ephL1, ephL2, obs_time, common_observables_iter->first, common_observables_iter->second); data += content.to_string(); } std::string msg = build_message(data); - if(server_is_running) + if (server_is_running) { rtcm_message_queue->push(msg); } @@ -1372,44 +1364,43 @@ std::string Rtcm::print_MT1011(const Glonass_Gnav_Ephemeris & ephL1, const Glona } -std::bitset<107> Rtcm::get_MT1011_sat_content(const Glonass_Gnav_Ephemeris & ephL1, const Glonass_Gnav_Ephemeris & ephL2, double obs_time, const Gnss_Synchro & gnss_synchroL1, const Gnss_Synchro & gnss_synchroL2) +std::bitset<107> Rtcm::get_MT1011_sat_content(const Glonass_Gnav_Ephemeris& ephL1, const Glonass_Gnav_Ephemeris& ephL2, double obs_time, const Gnss_Synchro& gnss_synchroL1, const Gnss_Synchro& gnss_synchroL2) { - bool code_indicator = false; // code indicator 0: C/A code 1: P(Y) code direct + bool code_indicator = false; // code indicator 0: C/A code 1: P(Y) code direct Rtcm::set_DF038(gnss_synchroL1); Rtcm::set_DF039(code_indicator); Rtcm::set_DF040(ephL1.i_satellite_freq_channel); Rtcm::set_DF041(gnss_synchroL1); Rtcm::set_DF042(gnss_synchroL1); Rtcm::set_DF043(ephL1, obs_time, gnss_synchroL1); - std::bitset<2> DF046_ = std::bitset<2>(0); // code indicator 0: C/A or L2C code 1: P(Y) code direct 2:P(Y) code cross-correlated 3: Correlated P/Y + std::bitset<2> DF046_ = std::bitset<2>(0); // code indicator 0: C/A or L2C code 1: P(Y) code direct 2:P(Y) code cross-correlated 3: Correlated P/Y Rtcm::set_DF047(gnss_synchroL1, gnss_synchroL2); Rtcm::set_DF048(gnss_synchroL1, gnss_synchroL2); Rtcm::set_DF049(ephL2, obs_time, gnss_synchroL2); std::string content = DF038.to_string() + - DF039.to_string() + - DF040.to_string() + - DF041.to_string() + - DF042.to_string() + - DF043.to_string() + - DF046_.to_string() + - DF047.to_string() + - DF048.to_string() + - DF049.to_string(); + DF039.to_string() + + DF040.to_string() + + DF041.to_string() + + DF042.to_string() + + DF043.to_string() + + DF046_.to_string() + + DF047.to_string() + + DF048.to_string() + + DF049.to_string(); std::bitset<107> content_msg(content); return content_msg; } - // ****************************************************************** // // MESSAGE TYPE 1004 (EXTENDED GLONASS L1 & L2 OBSERVATIONS) // // ****************************************************************** -std::string Rtcm::print_MT1012(const Glonass_Gnav_Ephemeris & ephL1, const Glonass_Gnav_Ephemeris & ephL2, double obs_time, const std::map & observables, unsigned short station_id) +std::string Rtcm::print_MT1012(const Glonass_Gnav_Ephemeris& ephL1, const Glonass_Gnav_Ephemeris& ephL2, double obs_time, const std::map& observables, unsigned short station_id) { unsigned int ref_id = static_cast(station_id); unsigned int smooth_int = 0; @@ -1422,37 +1413,37 @@ std::string Rtcm::print_MT1012(const Glonass_Gnav_Ephemeris & ephL1, const Glona std::map::const_iterator observables_iter; std::map::const_iterator observables_iter2; - for(observables_iter = observables.begin(); - observables_iter != observables.end(); - observables_iter++) + for (observables_iter = observables.begin(); + observables_iter != observables.end(); + observables_iter++) { std::string system_(&observables_iter->second.System, 1); std::string sig_(observables_iter->second.Signal); - if((system_.compare("R") == 0) && (sig_.compare("1C") == 0)) + if ((system_.compare("R") == 0) && (sig_.compare("1C") == 0)) { observablesL1.insert(std::pair(observables_iter->first, observables_iter->second)); } - if((system_.compare("R") == 0) && (sig_.compare("2C") == 0)) + if ((system_.compare("R") == 0) && (sig_.compare("2C") == 0)) { observablesL2.insert(std::pair(observables_iter->first, observables_iter->second)); } } // Get common observables - std::vector< std::pair< Gnss_Synchro, Gnss_Synchro > > common_observables; - std::vector< std::pair< Gnss_Synchro, Gnss_Synchro > >::const_iterator common_observables_iter; + std::vector > common_observables; + std::vector >::const_iterator common_observables_iter; std::map observablesL1_with_L2; - for(observables_iter = observablesL1.begin(); - observables_iter != observablesL1.end(); - observables_iter++) + for (observables_iter = observablesL1.begin(); + observables_iter != observablesL1.end(); + observables_iter++) { unsigned int prn_ = observables_iter->second.PRN; - for(observables_iter2 = observablesL2.begin(); - observables_iter2 != observablesL2.end(); - observables_iter2++) + for (observables_iter2 = observablesL2.begin(); + observables_iter2 != observablesL2.end(); + observables_iter2++) { - if(observables_iter2->second.PRN == prn_) + if (observables_iter2->second.PRN == prn_) { std::pair p; Gnss_Synchro pr1 = observables_iter->second; @@ -1467,16 +1458,16 @@ std::string Rtcm::print_MT1012(const Glonass_Gnav_Ephemeris & ephL1, const Glona std::bitset<61> header = Rtcm::get_MT1009_12_header(1012, obs_time, observablesL1_with_L2, ref_id, smooth_int, sync_flag, divergence_free); std::string data = header.to_string(); - for(common_observables_iter = common_observables.begin(); - common_observables_iter != common_observables.end(); - common_observables_iter++) + for (common_observables_iter = common_observables.begin(); + common_observables_iter != common_observables.end(); + common_observables_iter++) { std::bitset<130> content = Rtcm::get_MT1012_sat_content(ephL1, ephL2, obs_time, common_observables_iter->first, common_observables_iter->second); data += content.to_string(); } std::string msg = build_message(data); - if(server_is_running) + if (server_is_running) { rtcm_message_queue->push(msg); } @@ -1484,9 +1475,9 @@ std::string Rtcm::print_MT1012(const Glonass_Gnav_Ephemeris & ephL1, const Glona } -std::bitset<130> Rtcm::get_MT1012_sat_content(const Glonass_Gnav_Ephemeris & ephL1, const Glonass_Gnav_Ephemeris & ephL2, double obs_time, const Gnss_Synchro & gnss_synchroL1, const Gnss_Synchro & gnss_synchroL2) +std::bitset<130> Rtcm::get_MT1012_sat_content(const Glonass_Gnav_Ephemeris& ephL1, const Glonass_Gnav_Ephemeris& ephL2, double obs_time, const Gnss_Synchro& gnss_synchroL1, const Gnss_Synchro& gnss_synchroL2) { - bool code_indicator = false; // code indicator 0: C/A code 1: P(Y) code direct + bool code_indicator = false; // code indicator 0: C/A code 1: P(Y) code direct Rtcm::set_DF038(gnss_synchroL1); Rtcm::set_DF039(code_indicator); Rtcm::set_DF040(ephL1.i_satellite_freq_channel); @@ -1495,25 +1486,25 @@ std::bitset<130> Rtcm::get_MT1012_sat_content(const Glonass_Gnav_Ephemeris & eph Rtcm::set_DF043(ephL1, obs_time, gnss_synchroL1); Rtcm::set_DF044(gnss_synchroL1); Rtcm::set_DF045(gnss_synchroL1); - std::bitset<2> DF046_ = std::bitset<2>(0); // code indicator 0: C/A or L2C code 1: P(Y) code direct 2:P(Y) code cross-correlated 3: Correlated P/Y + std::bitset<2> DF046_ = std::bitset<2>(0); // code indicator 0: C/A or L2C code 1: P(Y) code direct 2:P(Y) code cross-correlated 3: Correlated P/Y Rtcm::set_DF047(gnss_synchroL1, gnss_synchroL2); Rtcm::set_DF048(gnss_synchroL1, gnss_synchroL2); Rtcm::set_DF049(ephL2, obs_time, gnss_synchroL2); Rtcm::set_DF050(gnss_synchroL2); std::string content = DF038.to_string() + - DF039.to_string() + - DF040.to_string() + - DF041.to_string() + - DF042.to_string() + - DF043.to_string() + - DF044.to_string() + - DF045.to_string() + - DF046_.to_string() + - DF047.to_string() + - DF048.to_string() + - DF049.to_string() + - DF050.to_string(); + DF039.to_string() + + DF040.to_string() + + DF041.to_string() + + DF042.to_string() + + DF043.to_string() + + DF044.to_string() + + DF045.to_string() + + DF046_.to_string() + + DF047.to_string() + + DF048.to_string() + + DF049.to_string() + + DF050.to_string(); std::bitset<130> content_msg(content); return content_msg; @@ -1526,7 +1517,7 @@ std::bitset<130> Rtcm::get_MT1012_sat_content(const Glonass_Gnav_Ephemeris & eph // // ******************************************************** -std::string Rtcm::print_MT1019(const Gps_Ephemeris & gps_eph) +std::string Rtcm::print_MT1019(const Gps_Ephemeris& gps_eph) { unsigned int msg_number = 1019; @@ -1565,44 +1556,44 @@ std::string Rtcm::print_MT1019(const Gps_Ephemeris & gps_eph) std::string data; data.clear(); data = DF002.to_string() + - DF009.to_string() + - DF076.to_string() + - DF077.to_string() + - DF078.to_string() + - DF079.to_string() + - DF071.to_string() + - DF081.to_string() + - DF082.to_string() + - DF083.to_string() + - DF084.to_string() + - DF085.to_string() + - DF086.to_string() + - DF087.to_string() + - DF088.to_string() + - DF089.to_string() + - DF090.to_string() + - DF091.to_string() + - DF092.to_string() + - DF093.to_string() + - DF094.to_string() + - DF095.to_string() + - DF096.to_string() + - DF097.to_string() + - DF098.to_string() + - DF099.to_string() + - DF100.to_string() + - DF101.to_string() + - DF102.to_string() + - DF103.to_string() + - DF137.to_string(); + DF009.to_string() + + DF076.to_string() + + DF077.to_string() + + DF078.to_string() + + DF079.to_string() + + DF071.to_string() + + DF081.to_string() + + DF082.to_string() + + DF083.to_string() + + DF084.to_string() + + DF085.to_string() + + DF086.to_string() + + DF087.to_string() + + DF088.to_string() + + DF089.to_string() + + DF090.to_string() + + DF091.to_string() + + DF092.to_string() + + DF093.to_string() + + DF094.to_string() + + DF095.to_string() + + DF096.to_string() + + DF097.to_string() + + DF098.to_string() + + DF099.to_string() + + DF100.to_string() + + DF101.to_string() + + DF102.to_string() + + DF103.to_string() + + DF137.to_string(); if (data.length() != 488) { - LOG(WARNING) << "Bad-formatted RTCM MT1019 (488 bits expected, found " << data.length() << ")"; + LOG(WARNING) << "Bad-formatted RTCM MT1019 (488 bits expected, found " << data.length() << ")"; } std::string msg = build_message(data); - if(server_is_running) + if (server_is_running) { rtcm_message_queue->push(msg); } @@ -1610,12 +1601,12 @@ std::string Rtcm::print_MT1019(const Gps_Ephemeris & gps_eph) } -int Rtcm::read_MT1019(const std::string & message, Gps_Ephemeris & gps_eph) +int Rtcm::read_MT1019(const std::string& message, Gps_Ephemeris& gps_eph) { // Convert message to binary std::string message_bin = Rtcm::binary_data_to_bin(message); - if(!Rtcm::check_CRC(message) ) + if (!Rtcm::check_CRC(message)) { LOG(WARNING) << " Bad CRC detected in RTCM message MT1019"; return 1; @@ -1745,7 +1736,7 @@ int Rtcm::read_MT1019(const std::string & message, Gps_Ephemeris & gps_eph) // // ******************************************************** -std::string Rtcm::print_MT1020(const Glonass_Gnav_Ephemeris & glonass_gnav_eph, const Glonass_Gnav_Utc_Model & glonass_gnav_utc_model) +std::string Rtcm::print_MT1020(const Glonass_Gnav_Ephemeris& glonass_gnav_eph, const Glonass_Gnav_Utc_Model& glonass_gnav_utc_model) { unsigned int msg_number = 1020; unsigned int glonass_gnav_alm_health = 0; @@ -1791,51 +1782,51 @@ std::string Rtcm::print_MT1020(const Glonass_Gnav_Ephemeris & glonass_gnav_eph, std::string data; data.clear(); - data = DF002.to_string() + - DF038.to_string() + - DF040.to_string() + - DF104.to_string() + - DF105.to_string() + - DF106.to_string() + - DF107.to_string() + - DF108.to_string() + - DF109.to_string() + - DF110.to_string() + - DF111.to_string() + - DF112.to_string() + - DF113.to_string() + - DF114.to_string() + - DF115.to_string() + - DF116.to_string() + - DF117.to_string() + - DF118.to_string() + - DF119.to_string() + - DF120.to_string() + - DF121.to_string() + - DF122.to_string() + - DF123.to_string() + - DF124.to_string() + - DF125.to_string() + - DF126.to_string() + - DF127.to_string() + - DF128.to_string() + - DF129.to_string() + - DF130.to_string() + - DF131.to_string() + - DF132.to_string() + - DF133.to_string() + - DF134.to_string() + - DF135.to_string() + - DF136.to_string() + - std::bitset<7>().to_string(); // Reserved bits + data = DF002.to_string() + + DF038.to_string() + + DF040.to_string() + + DF104.to_string() + + DF105.to_string() + + DF106.to_string() + + DF107.to_string() + + DF108.to_string() + + DF109.to_string() + + DF110.to_string() + + DF111.to_string() + + DF112.to_string() + + DF113.to_string() + + DF114.to_string() + + DF115.to_string() + + DF116.to_string() + + DF117.to_string() + + DF118.to_string() + + DF119.to_string() + + DF120.to_string() + + DF121.to_string() + + DF122.to_string() + + DF123.to_string() + + DF124.to_string() + + DF125.to_string() + + DF126.to_string() + + DF127.to_string() + + DF128.to_string() + + DF129.to_string() + + DF130.to_string() + + DF131.to_string() + + DF132.to_string() + + DF133.to_string() + + DF134.to_string() + + DF135.to_string() + + DF136.to_string() + + std::bitset<7>().to_string(); // Reserved bits if (data.length() != 360) { - LOG(WARNING) << "Bad-formatted RTCM MT1020 (360 bits expected, found " << data.length() << ")"; + LOG(WARNING) << "Bad-formatted RTCM MT1020 (360 bits expected, found " << data.length() << ")"; } std::string msg = build_message(data); - if(server_is_running) + if (server_is_running) { rtcm_message_queue->push(msg); } @@ -1843,7 +1834,7 @@ std::string Rtcm::print_MT1020(const Glonass_Gnav_Ephemeris & glonass_gnav_eph, } -int Rtcm::read_MT1020(const std::string & message, Glonass_Gnav_Ephemeris & glonass_gnav_eph, Glonass_Gnav_Utc_Model & glonass_gnav_utc_model) +int Rtcm::read_MT1020(const std::string& message, Glonass_Gnav_Ephemeris& glonass_gnav_eph, Glonass_Gnav_Utc_Model& glonass_gnav_utc_model) { // Convert message to binary std::string message_bin = Rtcm::binary_data_to_bin(message); @@ -1851,7 +1842,7 @@ int Rtcm::read_MT1020(const std::string & message, Glonass_Gnav_Ephemeris & glon int glonass_gnav_alm_health_ind = 0; int fifth_str_additional_data_ind = 0; - if(!Rtcm::check_CRC(message) ) + if (!Rtcm::check_CRC(message)) { LOG(WARNING) << " Bad CRC detected in RTCM message MT1020"; return 1; @@ -1864,7 +1855,7 @@ int Rtcm::read_MT1020(const std::string & message, Glonass_Gnav_Ephemeris & glon unsigned int read_message_length = static_cast(Rtcm::bin_to_uint(message_bin.substr(index, 10))); index += 10; - if (read_message_length != 45) // 360 bits = 45 bytes + if (read_message_length != 45) // 360 bits = 45 bytes { LOG(WARNING) << " Message MT1020 seems too long (61 bytes expected, " << read_message_length << " received)"; return 1; @@ -1889,21 +1880,25 @@ int Rtcm::read_MT1020(const std::string & message, Glonass_Gnav_Ephemeris & glon glonass_gnav_alm_health = static_cast(Rtcm::bin_to_uint(message_bin.substr(index, 1))); index += 1; - if(glonass_gnav_alm_health){} //Avoid comiler warning + if (glonass_gnav_alm_health) + { + } //Avoid comiler warning glonass_gnav_alm_health_ind = static_cast(Rtcm::bin_to_uint(message_bin.substr(index, 1))); index += 1; - if(glonass_gnav_alm_health_ind){} //Avoid comiler warning + if (glonass_gnav_alm_health_ind) + { + } //Avoid comiler warning glonass_gnav_eph.d_P_1 = static_cast(Rtcm::bin_to_uint(message_bin.substr(index, 2))); - glonass_gnav_eph.d_P_1 = (glonass_gnav_eph.d_P_1+1)*15; + glonass_gnav_eph.d_P_1 = (glonass_gnav_eph.d_P_1 + 1) * 15; index += 2; - glonass_gnav_eph.d_t_k += static_cast(Rtcm::bin_to_int(message_bin.substr(index, 5)))*3600; + glonass_gnav_eph.d_t_k += static_cast(Rtcm::bin_to_int(message_bin.substr(index, 5))) * 3600; index += 5; - glonass_gnav_eph.d_t_k += static_cast(Rtcm::bin_to_int(message_bin.substr(index, 6)))*60; + glonass_gnav_eph.d_t_k += static_cast(Rtcm::bin_to_int(message_bin.substr(index, 6))) * 60; index += 6; - glonass_gnav_eph.d_t_k += static_cast(Rtcm::bin_to_int(message_bin.substr(index, 1)))*30; + glonass_gnav_eph.d_t_k += static_cast(Rtcm::bin_to_int(message_bin.substr(index, 1))) * 30; index += 1; glonass_gnav_eph.d_B_n = static_cast(Rtcm::bin_to_uint(message_bin.substr(index, 1))); @@ -1912,41 +1907,41 @@ int Rtcm::read_MT1020(const std::string & message, Glonass_Gnav_Ephemeris & glon glonass_gnav_eph.d_P_2 = static_cast(Rtcm::bin_to_uint(message_bin.substr(index, 1))); index += 1; - glonass_gnav_eph.d_t_b = static_cast(Rtcm::bin_to_uint(message_bin.substr(index, 7)))*15*60.0; + glonass_gnav_eph.d_t_b = static_cast(Rtcm::bin_to_uint(message_bin.substr(index, 7))) * 15 * 60.0; index += 7; // TODO Check for type spec for intS24 - glonass_gnav_eph.d_VXn = static_cast(Rtcm::bin_to_sint(message_bin.substr(index, 24)))*TWO_N20; + glonass_gnav_eph.d_VXn = static_cast(Rtcm::bin_to_sint(message_bin.substr(index, 24))) * TWO_N20; index += 24; - glonass_gnav_eph.d_Xn = static_cast(Rtcm::bin_to_sint(message_bin.substr(index, 27)))*TWO_N11; + glonass_gnav_eph.d_Xn = static_cast(Rtcm::bin_to_sint(message_bin.substr(index, 27))) * TWO_N11; index += 27; - glonass_gnav_eph.d_AXn = static_cast(Rtcm::bin_to_sint(message_bin.substr(index, 5)))*TWO_N30; + glonass_gnav_eph.d_AXn = static_cast(Rtcm::bin_to_sint(message_bin.substr(index, 5))) * TWO_N30; index += 5; - glonass_gnav_eph.d_VYn = static_cast(Rtcm::bin_to_sint(message_bin.substr(index, 24)))*TWO_N20; + glonass_gnav_eph.d_VYn = static_cast(Rtcm::bin_to_sint(message_bin.substr(index, 24))) * TWO_N20; index += 24; - glonass_gnav_eph.d_Yn = static_cast(Rtcm::bin_to_sint(message_bin.substr(index, 27)))*TWO_N11; + glonass_gnav_eph.d_Yn = static_cast(Rtcm::bin_to_sint(message_bin.substr(index, 27))) * TWO_N11; index += 27; - glonass_gnav_eph.d_AYn = static_cast(Rtcm::bin_to_sint(message_bin.substr(index, 5)))*TWO_N30; + glonass_gnav_eph.d_AYn = static_cast(Rtcm::bin_to_sint(message_bin.substr(index, 5))) * TWO_N30; index += 5; - glonass_gnav_eph.d_VZn = static_cast(Rtcm::bin_to_sint(message_bin.substr(index, 24)))*TWO_N20; + glonass_gnav_eph.d_VZn = static_cast(Rtcm::bin_to_sint(message_bin.substr(index, 24))) * TWO_N20; index += 24; - glonass_gnav_eph.d_Zn = static_cast(Rtcm::bin_to_sint(message_bin.substr(index, 27)))*TWO_N11; + glonass_gnav_eph.d_Zn = static_cast(Rtcm::bin_to_sint(message_bin.substr(index, 27))) * TWO_N11; index += 27; - glonass_gnav_eph.d_AZn = static_cast(Rtcm::bin_to_sint(message_bin.substr(index, 5)))*TWO_N30; + glonass_gnav_eph.d_AZn = static_cast(Rtcm::bin_to_sint(message_bin.substr(index, 5))) * TWO_N30; index += 5; glonass_gnav_eph.d_P_3 = static_cast(Rtcm::bin_to_uint(message_bin.substr(index, 1))); index += 1; - glonass_gnav_eph.d_gamma_n = static_cast(Rtcm::bin_to_sint(message_bin.substr(index, 11)))*TWO_N30; + glonass_gnav_eph.d_gamma_n = static_cast(Rtcm::bin_to_sint(message_bin.substr(index, 11))) * TWO_N30; index += 11; glonass_gnav_eph.d_P = static_cast(Rtcm::bin_to_uint(message_bin.substr(index, 2))); @@ -1955,10 +1950,10 @@ int Rtcm::read_MT1020(const std::string & message, Glonass_Gnav_Ephemeris & glon glonass_gnav_eph.d_l3rd_n = static_cast(Rtcm::bin_to_uint(message_bin.substr(index, 1))); index += 1; - glonass_gnav_eph.d_tau_n = static_cast(Rtcm::bin_to_sint(message_bin.substr(index, 22)))* TWO_N30; + glonass_gnav_eph.d_tau_n = static_cast(Rtcm::bin_to_sint(message_bin.substr(index, 22))) * TWO_N30; index += 22; - glonass_gnav_eph.d_Delta_tau_n = static_cast(Rtcm::bin_to_sint(message_bin.substr(index, 5)))* TWO_N30; + glonass_gnav_eph.d_Delta_tau_n = static_cast(Rtcm::bin_to_sint(message_bin.substr(index, 5))) * TWO_N30; index += 5; glonass_gnav_eph.d_E_n = static_cast(Rtcm::bin_to_uint(message_bin.substr(index, 5))); @@ -1979,18 +1974,18 @@ int Rtcm::read_MT1020(const std::string & message, Glonass_Gnav_Ephemeris & glon fifth_str_additional_data_ind = static_cast(Rtcm::bin_to_uint(message_bin.substr(index, 1))); index += 1; - if(fifth_str_additional_data_ind == true) + if (fifth_str_additional_data_ind == true) { glonass_gnav_utc_model.d_N_A = static_cast(Rtcm::bin_to_uint(message_bin.substr(index, 11))); index += 11; - glonass_gnav_utc_model.d_tau_c = static_cast(Rtcm::bin_to_sint(message_bin.substr(index, 32)))* TWO_N31; + glonass_gnav_utc_model.d_tau_c = static_cast(Rtcm::bin_to_sint(message_bin.substr(index, 32))) * TWO_N31; index += 32; glonass_gnav_utc_model.d_N_4 = static_cast(Rtcm::bin_to_uint(message_bin.substr(index, 5))); index += 5; - glonass_gnav_utc_model.d_tau_gps = static_cast(Rtcm::bin_to_sint(message_bin.substr(index, 22)))* TWO_N30; + glonass_gnav_utc_model.d_tau_gps = static_cast(Rtcm::bin_to_sint(message_bin.substr(index, 22))) * TWO_N30; index += 22; glonass_gnav_eph.d_l5th_n = static_cast(Rtcm::bin_to_uint(message_bin.substr(index, 1))); @@ -2006,7 +2001,7 @@ int Rtcm::read_MT1020(const std::string & message, Glonass_Gnav_Ephemeris & glon // // ******************************************************** -std::string Rtcm::print_MT1029(unsigned int ref_id, const Gps_Ephemeris & gps_eph, double obs_time, const std::string & message) +std::string Rtcm::print_MT1029(unsigned int ref_id, const Gps_Ephemeris& gps_eph, double obs_time, const std::string& message) { unsigned int msg_number = 1029; @@ -2018,22 +2013,22 @@ std::string Rtcm::print_MT1029(unsigned int ref_id, const Gps_Ephemeris & gps_ep unsigned int i = 0; bool first = true; std::string text_binary; - for(auto it = message.cbegin(); it != message.cend(); it++) + for (auto it = message.cbegin(); it != message.cend(); it++) { char c = *it; - if(isgraph(c)) + if (isgraph(c)) { i++; first = true; } - else if(c == ' ') + else if (c == ' ') { i++; first = true; } else { - if(!first) + if (!first) { i++; first = true; @@ -2051,15 +2046,15 @@ std::string Rtcm::print_MT1029(unsigned int ref_id, const Gps_Ephemeris & gps_ep std::bitset<8> DF139_ = std::bitset<8>(message.length()); std::string data = DF002.to_string() + - DF003.to_string() + - DF051.to_string() + - DF052.to_string() + - DF138_.to_string() + - DF139_.to_string() + - text_binary; + DF003.to_string() + + DF051.to_string() + + DF052.to_string() + + DF138_.to_string() + + DF139_.to_string() + + text_binary; std::string msg = build_message(data); - if(server_is_running) + if (server_is_running) { rtcm_message_queue->push(msg); } @@ -2073,7 +2068,7 @@ std::string Rtcm::print_MT1029(unsigned int ref_id, const Gps_Ephemeris & gps_ep // // ******************************************************** -std::string Rtcm::print_MT1045(const Galileo_Ephemeris & gal_eph) +std::string Rtcm::print_MT1045(const Galileo_Ephemeris& gal_eph) { unsigned int msg_number = 1045; @@ -2110,42 +2105,42 @@ std::string Rtcm::print_MT1045(const Galileo_Ephemeris & gal_eph) std::string data; data.clear(); data = DF002.to_string() + - DF252.to_string() + - DF289.to_string() + - DF290.to_string() + - DF291.to_string() + - DF292.to_string() + - DF293.to_string() + - DF294.to_string() + - DF295.to_string() + - DF296.to_string() + - DF297.to_string() + - DF298.to_string() + - DF299.to_string() + - DF300.to_string() + - DF301.to_string() + - DF302.to_string() + - DF303.to_string() + - DF304.to_string() + - DF305.to_string() + - DF306.to_string() + - DF307.to_string() + - DF308.to_string() + - DF309.to_string() + - DF310.to_string() + - DF311.to_string() + - DF312.to_string() + - DF314.to_string() + - DF315.to_string() + - DF001_.to_string(); + DF252.to_string() + + DF289.to_string() + + DF290.to_string() + + DF291.to_string() + + DF292.to_string() + + DF293.to_string() + + DF294.to_string() + + DF295.to_string() + + DF296.to_string() + + DF297.to_string() + + DF298.to_string() + + DF299.to_string() + + DF300.to_string() + + DF301.to_string() + + DF302.to_string() + + DF303.to_string() + + DF304.to_string() + + DF305.to_string() + + DF306.to_string() + + DF307.to_string() + + DF308.to_string() + + DF309.to_string() + + DF310.to_string() + + DF311.to_string() + + DF312.to_string() + + DF314.to_string() + + DF315.to_string() + + DF001_.to_string(); if (data.length() != 496) { - LOG(WARNING) << "Bad-formatted RTCM MT1045 (496 bits expected, found " << data.length() << ")"; + LOG(WARNING) << "Bad-formatted RTCM MT1045 (496 bits expected, found " << data.length() << ")"; } std::string msg = build_message(data); - if(server_is_running) + if (server_is_running) { rtcm_message_queue->push(msg); } @@ -2153,12 +2148,12 @@ std::string Rtcm::print_MT1045(const Galileo_Ephemeris & gal_eph) } -int Rtcm::read_MT1045(const std::string & message, Galileo_Ephemeris & gal_eph) +int Rtcm::read_MT1045(const std::string& message, Galileo_Ephemeris& gal_eph) { // Convert message to binary std::string message_bin = Rtcm::binary_data_to_bin(message); - if(!Rtcm::check_CRC(message) ) + if (!Rtcm::check_CRC(message)) { LOG(WARNING) << " Bad CRC detected in RTCM message MT1045"; return 1; @@ -2194,10 +2189,10 @@ int Rtcm::read_MT1045(const std::string & message, Galileo_Ephemeris & gal_eph) gal_eph.WN_5 = static_cast(Rtcm::bin_to_uint(message_bin.substr(index, 12))); index += 12; - gal_eph.IOD_nav_1 = static_cast(Rtcm::bin_to_uint(message_bin.substr(index, 10))); + gal_eph.IOD_nav_1 = static_cast(Rtcm::bin_to_uint(message_bin.substr(index, 10))); index += 10; - gal_eph.SISA_3 = static_cast(Rtcm::bin_to_uint(message_bin.substr(index, 8))); + gal_eph.SISA_3 = static_cast(Rtcm::bin_to_uint(message_bin.substr(index, 8))); index += 8; gal_eph.iDot_2 = static_cast(Rtcm::bin_to_int(message_bin.substr(index, 14))) * iDot_2_LSB; @@ -2245,7 +2240,7 @@ int Rtcm::read_MT1045(const std::string & message, Galileo_Ephemeris & gal_eph) gal_eph.OMEGA_0_2 = static_cast(Rtcm::bin_to_int(message_bin.substr(index, 32))) * OMEGA_0_2_LSB; index += 32; - gal_eph.C_is_4 = static_cast(Rtcm::bin_to_int(message_bin.substr(index, 16))) * C_is_4_LSB; + gal_eph.C_is_4 = static_cast(Rtcm::bin_to_int(message_bin.substr(index, 16))) * C_is_4_LSB; index += 16; gal_eph.i_0_2 = static_cast(Rtcm::bin_to_int(message_bin.substr(index, 32))) * i_0_2_LSB; @@ -2272,51 +2267,49 @@ int Rtcm::read_MT1045(const std::string & message, Galileo_Ephemeris & gal_eph) } - - // ********************************************************************************************** // // MESSAGE TYPE MSM1 (COMPACT observables) // // ********************************************************************************************** -std::string Rtcm::print_MSM_1( const Gps_Ephemeris & gps_eph, - const Gps_CNAV_Ephemeris & gps_cnav_eph, - const Galileo_Ephemeris & gal_eph, - const Glonass_Gnav_Ephemeris & glo_gnav_eph, - double obs_time, - const std::map & observables, - unsigned int ref_id, - unsigned int clock_steering_indicator, - unsigned int external_clock_indicator, - int smooth_int, - bool divergence_free, - bool more_messages) +std::string Rtcm::print_MSM_1(const Gps_Ephemeris& gps_eph, + const Gps_CNAV_Ephemeris& gps_cnav_eph, + const Galileo_Ephemeris& gal_eph, + const Glonass_Gnav_Ephemeris& glo_gnav_eph, + double obs_time, + const std::map& observables, + unsigned int ref_id, + unsigned int clock_steering_indicator, + unsigned int external_clock_indicator, + int smooth_int, + bool divergence_free, + bool more_messages) { unsigned int msg_number = 0; - if(gps_eph.i_satellite_PRN != 0) msg_number = 1071; - if(gps_cnav_eph.i_satellite_PRN != 0) msg_number = 1071; - if(glo_gnav_eph.i_satellite_PRN != 0) msg_number = 1081; - if(gal_eph.i_satellite_PRN != 0) msg_number = 1091; - if(((gps_eph.i_satellite_PRN != 0) ||(gps_cnav_eph.i_satellite_PRN != 0) ) && (gal_eph.i_satellite_PRN != 0) && (glo_gnav_eph.i_satellite_PRN != 0)) + if (gps_eph.i_satellite_PRN != 0) msg_number = 1071; + if (gps_cnav_eph.i_satellite_PRN != 0) msg_number = 1071; + if (glo_gnav_eph.i_satellite_PRN != 0) msg_number = 1081; + if (gal_eph.i_satellite_PRN != 0) msg_number = 1091; + if (((gps_eph.i_satellite_PRN != 0) || (gps_cnav_eph.i_satellite_PRN != 0)) && (gal_eph.i_satellite_PRN != 0) && (glo_gnav_eph.i_satellite_PRN != 0)) { - LOG(WARNING) << "MSM messages for observables from different systems are not defined"; //print two messages? + LOG(WARNING) << "MSM messages for observables from different systems are not defined"; //print two messages? } - if(msg_number == 0) + if (msg_number == 0) { LOG(WARNING) << "Invalid ephemeris provided"; msg_number = 1071; } std::string header = Rtcm::get_MSM_header(msg_number, - obs_time, - observables, - ref_id, - clock_steering_indicator, - external_clock_indicator, - smooth_int, - divergence_free, - more_messages); + obs_time, + observables, + ref_id, + clock_steering_indicator, + external_clock_indicator, + smooth_int, + divergence_free, + more_messages); std::string sat_data = Rtcm::get_MSM_1_content_sat_data(observables); @@ -2324,7 +2317,7 @@ std::string Rtcm::print_MSM_1( const Gps_Ephemeris & gps_eph, std::string message = build_message(header + sat_data + signal_data); - if(server_is_running) + if (server_is_running) { rtcm_message_queue->push(message); } @@ -2334,23 +2327,23 @@ std::string Rtcm::print_MSM_1( const Gps_Ephemeris & gps_eph, std::string Rtcm::get_MSM_header(unsigned int msg_number, - double obs_time, - const std::map & observables, - unsigned int ref_id, - unsigned int clock_steering_indicator, - unsigned int external_clock_indicator, - int smooth_int, - bool divergence_free, - bool more_messages) + double obs_time, + const std::map& observables, + unsigned int ref_id, + unsigned int clock_steering_indicator, + unsigned int external_clock_indicator, + int smooth_int, + bool divergence_free, + bool more_messages) { - // Find first element in observables block and define type of message - std::map::const_iterator observables_iter = observables.begin(); + // Find first element in observables block and define type of message + std::map::const_iterator observables_iter = observables.begin(); std::string sys(observables_iter->second.System, 1); Rtcm::set_DF002(msg_number); Rtcm::set_DF003(ref_id); Rtcm::set_DF393(more_messages); - Rtcm::set_DF409(0); // Issue of Data Station. 0: not utilized + Rtcm::set_DF409(0); // Issue of Data Station. 0: not utilized std::bitset<7> DF001_ = std::bitset<7>("0000000"); Rtcm::set_DF411(clock_steering_indicator); Rtcm::set_DF412(external_clock_indicator); @@ -2362,35 +2355,35 @@ std::string Rtcm::get_MSM_header(unsigned int msg_number, std::string header = DF002.to_string() + DF003.to_string(); // GNSS Epoch Time Specific to each constellation - if((sys.compare("R") == 0 )) - { - // GLONASS Epoch Time - Rtcm::set_DF034(obs_time); - header += DF034.to_string(); - } + if ((sys.compare("R") == 0)) + { + // GLONASS Epoch Time + Rtcm::set_DF034(obs_time); + header += DF034.to_string(); + } else - { - // GPS, Galileo Epoch Time - Rtcm::set_DF004(obs_time); - header += DF004.to_string(); - } + { + // GPS, Galileo Epoch Time + Rtcm::set_DF004(obs_time); + header += DF004.to_string(); + } header = header + DF393.to_string() + - DF409.to_string() + - DF001_.to_string() + - DF411.to_string() + - DF417.to_string() + - DF412.to_string() + - DF418.to_string() + - DF394.to_string() + - DF395.to_string() + - Rtcm::set_DF396(observables); + DF409.to_string() + + DF001_.to_string() + + DF411.to_string() + + DF417.to_string() + + DF412.to_string() + + DF418.to_string() + + DF394.to_string() + + DF395.to_string() + + Rtcm::set_DF396(observables); return header; } -std::string Rtcm::get_MSM_1_content_sat_data(const std::map & observables) +std::string Rtcm::get_MSM_1_content_sat_data(const std::map& observables) { std::string sat_data; sat_data.clear(); @@ -2403,12 +2396,12 @@ std::string Rtcm::get_MSM_1_content_sat_data(const std::map & std::vector pos; std::vector::iterator it; - for(gnss_synchro_iter = observables.cbegin(); - gnss_synchro_iter != observables.cend(); - gnss_synchro_iter++) + for (gnss_synchro_iter = observables.cbegin(); + gnss_synchro_iter != observables.cend(); + gnss_synchro_iter++) { it = std::find(pos.begin(), pos.end(), 65 - gnss_synchro_iter->second.PRN); - if(it == pos.end()) + if (it == pos.end()) { pos.push_back(65 - gnss_synchro_iter->second.PRN); observables_vector.push_back(*gnss_synchro_iter); @@ -2417,9 +2410,9 @@ std::string Rtcm::get_MSM_1_content_sat_data(const std::map & std::vector > ordered_by_PRN_pos = Rtcm::sort_by_PRN_mask(observables_vector); - for(unsigned int nsat = 0; nsat < num_satellites; nsat++) + for (unsigned int nsat = 0; nsat < num_satellites; nsat++) { - Rtcm::set_DF398( ordered_by_PRN_pos.at(nsat).second ); + Rtcm::set_DF398(ordered_by_PRN_pos.at(nsat).second); sat_data += DF398.to_string(); } @@ -2427,7 +2420,7 @@ std::string Rtcm::get_MSM_1_content_sat_data(const std::map & } -std::string Rtcm::get_MSM_1_content_signal_data(const std::map & observables) +std::string Rtcm::get_MSM_1_content_signal_data(const std::map& observables) { std::string signal_data; signal_data.clear(); @@ -2436,9 +2429,9 @@ std::string Rtcm::get_MSM_1_content_signal_data(const std::map > observables_vector; std::map::const_iterator map_iter; - for(map_iter = observables.cbegin(); - map_iter != observables.cend(); - map_iter++) + for (map_iter = observables.cbegin(); + map_iter != observables.cend(); + map_iter++) { observables_vector.push_back(*map_iter); } @@ -2447,11 +2440,11 @@ std::string Rtcm::get_MSM_1_content_signal_data(const std::map > ordered_by_PRN_pos = Rtcm::sort_by_PRN_mask(ordered_by_signal); - for(unsigned int cell = 0; cell < Ncells ; cell++) - { - Rtcm::set_DF400(ordered_by_PRN_pos.at( cell ).second); - signal_data += DF400.to_string(); - } + for (unsigned int cell = 0; cell < Ncells; cell++) + { + Rtcm::set_DF400(ordered_by_PRN_pos.at(cell).second); + signal_data += DF400.to_string(); + } return signal_data; } @@ -2463,50 +2456,50 @@ std::string Rtcm::get_MSM_1_content_signal_data(const std::map & observables, - unsigned int ref_id, - unsigned int clock_steering_indicator, - unsigned int external_clock_indicator, - int smooth_int, - bool divergence_free, - bool more_messages) +std::string Rtcm::print_MSM_2(const Gps_Ephemeris& gps_eph, + const Gps_CNAV_Ephemeris& gps_cnav_eph, + const Galileo_Ephemeris& gal_eph, + const Glonass_Gnav_Ephemeris& glo_gnav_eph, + double obs_time, + const std::map& observables, + unsigned int ref_id, + unsigned int clock_steering_indicator, + unsigned int external_clock_indicator, + int smooth_int, + bool divergence_free, + bool more_messages) { unsigned int msg_number = 0; - if(gps_eph.i_satellite_PRN != 0) msg_number = 1072; - if(gps_cnav_eph.i_satellite_PRN != 0) msg_number = 1072; - if(glo_gnav_eph.i_satellite_PRN != 0) msg_number = 1082; - if(gal_eph.i_satellite_PRN != 0) msg_number = 1092; - if(((gps_eph.i_satellite_PRN != 0) ||(gps_cnav_eph.i_satellite_PRN != 0) ) && (gal_eph.i_satellite_PRN != 0) && (glo_gnav_eph.i_satellite_PRN != 0)) + if (gps_eph.i_satellite_PRN != 0) msg_number = 1072; + if (gps_cnav_eph.i_satellite_PRN != 0) msg_number = 1072; + if (glo_gnav_eph.i_satellite_PRN != 0) msg_number = 1082; + if (gal_eph.i_satellite_PRN != 0) msg_number = 1092; + if (((gps_eph.i_satellite_PRN != 0) || (gps_cnav_eph.i_satellite_PRN != 0)) && (gal_eph.i_satellite_PRN != 0) && (glo_gnav_eph.i_satellite_PRN != 0)) { - LOG(WARNING) << "MSM messages for observables from different systems are not defined"; //print two messages? + LOG(WARNING) << "MSM messages for observables from different systems are not defined"; //print two messages? } - if(msg_number == 0) + if (msg_number == 0) { LOG(WARNING) << "Invalid ephemeris provided"; msg_number = 1072; } std::string header = Rtcm::get_MSM_header(msg_number, - obs_time, - observables, - ref_id, - clock_steering_indicator, - external_clock_indicator, - smooth_int, - divergence_free, - more_messages); + obs_time, + observables, + ref_id, + clock_steering_indicator, + external_clock_indicator, + smooth_int, + divergence_free, + more_messages); std::string sat_data = Rtcm::get_MSM_1_content_sat_data(observables); std::string signal_data = Rtcm::get_MSM_2_content_signal_data(gps_eph, gps_cnav_eph, gal_eph, glo_gnav_eph, obs_time, observables); std::string message = build_message(header + sat_data + signal_data); - if(server_is_running) + if (server_is_running) { rtcm_message_queue->push(message); } @@ -2515,12 +2508,12 @@ std::string Rtcm::print_MSM_2( const Gps_Ephemeris & gps_eph, } -std::string Rtcm::get_MSM_2_content_signal_data(const Gps_Ephemeris & ephNAV, - const Gps_CNAV_Ephemeris & ephCNAV, - const Galileo_Ephemeris & ephFNAV, - const Glonass_Gnav_Ephemeris & ephGNAV, - double obs_time, - const std::map & observables) +std::string Rtcm::get_MSM_2_content_signal_data(const Gps_Ephemeris& ephNAV, + const Gps_CNAV_Ephemeris& ephCNAV, + const Galileo_Ephemeris& ephFNAV, + const Glonass_Gnav_Ephemeris& ephGNAV, + double obs_time, + const std::map& observables) { std::string signal_data; std::string first_data_type; @@ -2532,9 +2525,9 @@ std::string Rtcm::get_MSM_2_content_signal_data(const Gps_Ephemeris & ephNAV, std::vector > observables_vector; std::map::const_iterator map_iter; - for(map_iter = observables.cbegin(); - map_iter != observables.cend(); - map_iter++) + for (map_iter = observables.cbegin(); + map_iter != observables.cend(); + map_iter++) { observables_vector.push_back(*map_iter); } @@ -2543,11 +2536,11 @@ std::string Rtcm::get_MSM_2_content_signal_data(const Gps_Ephemeris & ephNAV, std::reverse(ordered_by_signal.begin(), ordered_by_signal.end()); std::vector > ordered_by_PRN_pos = Rtcm::sort_by_PRN_mask(ordered_by_signal); - for(unsigned int cell = 0; cell < Ncells ; cell++) + for (unsigned int cell = 0; cell < Ncells; cell++) { - Rtcm::set_DF401(ordered_by_PRN_pos.at( cell ).second); - Rtcm::set_DF402(ephNAV, ephCNAV, ephFNAV, ephGNAV, obs_time, ordered_by_PRN_pos.at( cell ).second); - Rtcm::set_DF420(ordered_by_PRN_pos.at( cell ).second); + Rtcm::set_DF401(ordered_by_PRN_pos.at(cell).second); + Rtcm::set_DF402(ephNAV, ephCNAV, ephFNAV, ephGNAV, obs_time, ordered_by_PRN_pos.at(cell).second); + Rtcm::set_DF420(ordered_by_PRN_pos.at(cell).second); first_data_type += DF401.to_string(); second_data_type += DF402.to_string(); third_data_type += DF420.to_string(); @@ -2558,57 +2551,56 @@ std::string Rtcm::get_MSM_2_content_signal_data(const Gps_Ephemeris & ephNAV, } - // ********************************************************************************************** // // MESSAGE TYPE MSM3 (COMPACT PSEUDORANGES AND PHASERANGES) // // ********************************************************************************************** -std::string Rtcm::print_MSM_3( const Gps_Ephemeris & gps_eph, - const Gps_CNAV_Ephemeris & gps_cnav_eph, - const Galileo_Ephemeris & gal_eph, - const Glonass_Gnav_Ephemeris & glo_gnav_eph, - double obs_time, - const std::map & observables, - unsigned int ref_id, - unsigned int clock_steering_indicator, - unsigned int external_clock_indicator, - int smooth_int, - bool divergence_free, - bool more_messages) +std::string Rtcm::print_MSM_3(const Gps_Ephemeris& gps_eph, + const Gps_CNAV_Ephemeris& gps_cnav_eph, + const Galileo_Ephemeris& gal_eph, + const Glonass_Gnav_Ephemeris& glo_gnav_eph, + double obs_time, + const std::map& observables, + unsigned int ref_id, + unsigned int clock_steering_indicator, + unsigned int external_clock_indicator, + int smooth_int, + bool divergence_free, + bool more_messages) { unsigned int msg_number = 0; - if(gps_eph.i_satellite_PRN != 0) msg_number = 1073; - if(gps_cnav_eph.i_satellite_PRN != 0) msg_number = 1073; - if(glo_gnav_eph.i_satellite_PRN != 0) msg_number = 1083; - if(gal_eph.i_satellite_PRN != 0) msg_number = 1093; - if(((gps_eph.i_satellite_PRN != 0) ||(gps_cnav_eph.i_satellite_PRN != 0) ) && (gal_eph.i_satellite_PRN != 0) && (glo_gnav_eph.i_satellite_PRN != 0)) + if (gps_eph.i_satellite_PRN != 0) msg_number = 1073; + if (gps_cnav_eph.i_satellite_PRN != 0) msg_number = 1073; + if (glo_gnav_eph.i_satellite_PRN != 0) msg_number = 1083; + if (gal_eph.i_satellite_PRN != 0) msg_number = 1093; + if (((gps_eph.i_satellite_PRN != 0) || (gps_cnav_eph.i_satellite_PRN != 0)) && (gal_eph.i_satellite_PRN != 0) && (glo_gnav_eph.i_satellite_PRN != 0)) { - LOG(WARNING) << "MSM messages for observables from different systems are not defined"; //print two messages? + LOG(WARNING) << "MSM messages for observables from different systems are not defined"; //print two messages? } - if(msg_number == 0) + if (msg_number == 0) { LOG(WARNING) << "Invalid ephemeris provided"; msg_number = 1073; } std::string header = Rtcm::get_MSM_header(msg_number, - obs_time, - observables, - ref_id, - clock_steering_indicator, - external_clock_indicator, - smooth_int, - divergence_free, - more_messages); + obs_time, + observables, + ref_id, + clock_steering_indicator, + external_clock_indicator, + smooth_int, + divergence_free, + more_messages); std::string sat_data = Rtcm::get_MSM_1_content_sat_data(observables); std::string signal_data = Rtcm::get_MSM_3_content_signal_data(gps_eph, gps_cnav_eph, gal_eph, glo_gnav_eph, obs_time, observables); std::string message = build_message(header + sat_data + signal_data); - if(server_is_running) + if (server_is_running) { rtcm_message_queue->push(message); } @@ -2617,12 +2609,12 @@ std::string Rtcm::print_MSM_3( const Gps_Ephemeris & gps_eph, } -std::string Rtcm::get_MSM_3_content_signal_data(const Gps_Ephemeris & ephNAV, - const Gps_CNAV_Ephemeris & ephCNAV, - const Galileo_Ephemeris & ephFNAV, - const Glonass_Gnav_Ephemeris & ephGNAV, - double obs_time, - const std::map & observables) +std::string Rtcm::get_MSM_3_content_signal_data(const Gps_Ephemeris& ephNAV, + const Gps_CNAV_Ephemeris& ephCNAV, + const Galileo_Ephemeris& ephFNAV, + const Glonass_Gnav_Ephemeris& ephGNAV, + double obs_time, + const std::map& observables) { std::string signal_data; std::string first_data_type; @@ -2635,9 +2627,9 @@ std::string Rtcm::get_MSM_3_content_signal_data(const Gps_Ephemeris & ephNAV, std::vector > observables_vector; std::map::const_iterator map_iter; - for(map_iter = observables.cbegin(); - map_iter != observables.cend(); - map_iter++) + for (map_iter = observables.cbegin(); + map_iter != observables.cend(); + map_iter++) { observables_vector.push_back(*map_iter); } @@ -2646,12 +2638,12 @@ std::string Rtcm::get_MSM_3_content_signal_data(const Gps_Ephemeris & ephNAV, std::reverse(ordered_by_signal.begin(), ordered_by_signal.end()); std::vector > ordered_by_PRN_pos = Rtcm::sort_by_PRN_mask(ordered_by_signal); - for(unsigned int cell = 0; cell < Ncells ; cell++) + for (unsigned int cell = 0; cell < Ncells; cell++) { - Rtcm::set_DF400(ordered_by_PRN_pos.at( cell ).second); - Rtcm::set_DF401(ordered_by_PRN_pos.at( cell ).second); - Rtcm::set_DF402(ephNAV, ephCNAV, ephFNAV, ephGNAV, obs_time, ordered_by_PRN_pos.at( cell ).second); - Rtcm::set_DF420(ordered_by_PRN_pos.at( cell ).second); + Rtcm::set_DF400(ordered_by_PRN_pos.at(cell).second); + Rtcm::set_DF401(ordered_by_PRN_pos.at(cell).second); + Rtcm::set_DF402(ephNAV, ephCNAV, ephFNAV, ephGNAV, obs_time, ordered_by_PRN_pos.at(cell).second); + Rtcm::set_DF420(ordered_by_PRN_pos.at(cell).second); first_data_type += DF400.to_string(); second_data_type += DF401.to_string(); third_data_type += DF402.to_string(); @@ -2669,50 +2661,50 @@ std::string Rtcm::get_MSM_3_content_signal_data(const Gps_Ephemeris & ephNAV, // // ********************************************************************************************** -std::string Rtcm::print_MSM_4( const Gps_Ephemeris & gps_eph, - const Gps_CNAV_Ephemeris & gps_cnav_eph, - const Galileo_Ephemeris & gal_eph, - const Glonass_Gnav_Ephemeris & glo_gnav_eph, - double obs_time, - const std::map & observables, - unsigned int ref_id, - unsigned int clock_steering_indicator, - unsigned int external_clock_indicator, - int smooth_int, - bool divergence_free, - bool more_messages) +std::string Rtcm::print_MSM_4(const Gps_Ephemeris& gps_eph, + const Gps_CNAV_Ephemeris& gps_cnav_eph, + const Galileo_Ephemeris& gal_eph, + const Glonass_Gnav_Ephemeris& glo_gnav_eph, + double obs_time, + const std::map& observables, + unsigned int ref_id, + unsigned int clock_steering_indicator, + unsigned int external_clock_indicator, + int smooth_int, + bool divergence_free, + bool more_messages) { unsigned int msg_number = 0; - if(gps_eph.i_satellite_PRN != 0) msg_number = 1074; - if(gps_cnav_eph.i_satellite_PRN != 0) msg_number = 1074; - if(glo_gnav_eph.i_satellite_PRN != 0) msg_number = 1084; - if(gal_eph.i_satellite_PRN != 0) msg_number = 1094; - if(((gps_eph.i_satellite_PRN != 0) ||(gps_cnav_eph.i_satellite_PRN != 0) ) && (gal_eph.i_satellite_PRN != 0) && (glo_gnav_eph.i_satellite_PRN != 0)) + if (gps_eph.i_satellite_PRN != 0) msg_number = 1074; + if (gps_cnav_eph.i_satellite_PRN != 0) msg_number = 1074; + if (glo_gnav_eph.i_satellite_PRN != 0) msg_number = 1084; + if (gal_eph.i_satellite_PRN != 0) msg_number = 1094; + if (((gps_eph.i_satellite_PRN != 0) || (gps_cnav_eph.i_satellite_PRN != 0)) && (gal_eph.i_satellite_PRN != 0) && (glo_gnav_eph.i_satellite_PRN != 0)) { - LOG(WARNING) << "MSM messages for observables from different systems are not defined"; //print two messages? + LOG(WARNING) << "MSM messages for observables from different systems are not defined"; //print two messages? } - if(msg_number == 0) + if (msg_number == 0) { LOG(WARNING) << "Invalid ephemeris provided"; msg_number = 1074; } std::string header = Rtcm::get_MSM_header(msg_number, - obs_time, - observables, - ref_id, - clock_steering_indicator, - external_clock_indicator, - smooth_int, - divergence_free, - more_messages); + obs_time, + observables, + ref_id, + clock_steering_indicator, + external_clock_indicator, + smooth_int, + divergence_free, + more_messages); std::string sat_data = Rtcm::get_MSM_4_content_sat_data(observables); std::string signal_data = Rtcm::get_MSM_4_content_signal_data(gps_eph, gps_cnav_eph, gal_eph, glo_gnav_eph, obs_time, observables); std::string message = build_message(header + sat_data + signal_data); - if(server_is_running) + if (server_is_running) { rtcm_message_queue->push(message); } @@ -2721,7 +2713,7 @@ std::string Rtcm::print_MSM_4( const Gps_Ephemeris & gps_eph, } -std::string Rtcm::get_MSM_4_content_sat_data(const std::map & observables) +std::string Rtcm::get_MSM_4_content_sat_data(const std::map& observables) { std::string sat_data; std::string first_data_type; @@ -2735,12 +2727,12 @@ std::string Rtcm::get_MSM_4_content_sat_data(const std::map & std::vector pos; std::vector::iterator it; - for(gnss_synchro_iter = observables.cbegin(); - gnss_synchro_iter != observables.cend(); - gnss_synchro_iter++) + for (gnss_synchro_iter = observables.cbegin(); + gnss_synchro_iter != observables.cend(); + gnss_synchro_iter++) { it = std::find(pos.begin(), pos.end(), 65 - gnss_synchro_iter->second.PRN); - if(it == pos.end()) + if (it == pos.end()) { pos.push_back(65 - gnss_synchro_iter->second.PRN); observables_vector.push_back(*gnss_synchro_iter); @@ -2749,10 +2741,10 @@ std::string Rtcm::get_MSM_4_content_sat_data(const std::map & std::vector > ordered_by_PRN_pos = Rtcm::sort_by_PRN_mask(observables_vector); - for(unsigned int nsat = 0; nsat < num_satellites; nsat++) + for (unsigned int nsat = 0; nsat < num_satellites; nsat++) { - Rtcm::set_DF397( ordered_by_PRN_pos.at(nsat).second ); - Rtcm::set_DF398( ordered_by_PRN_pos.at(nsat).second ); + Rtcm::set_DF397(ordered_by_PRN_pos.at(nsat).second); + Rtcm::set_DF398(ordered_by_PRN_pos.at(nsat).second); first_data_type += DF397.to_string(); second_data_type += DF398.to_string(); } @@ -2761,12 +2753,12 @@ std::string Rtcm::get_MSM_4_content_sat_data(const std::map & } -std::string Rtcm::get_MSM_4_content_signal_data(const Gps_Ephemeris & ephNAV, - const Gps_CNAV_Ephemeris & ephCNAV, - const Galileo_Ephemeris & ephFNAV, - const Glonass_Gnav_Ephemeris & ephGNAV, - double obs_time, - const std::map & observables) +std::string Rtcm::get_MSM_4_content_signal_data(const Gps_Ephemeris& ephNAV, + const Gps_CNAV_Ephemeris& ephCNAV, + const Galileo_Ephemeris& ephFNAV, + const Glonass_Gnav_Ephemeris& ephGNAV, + double obs_time, + const std::map& observables) { std::string signal_data; std::string first_data_type; @@ -2780,9 +2772,9 @@ std::string Rtcm::get_MSM_4_content_signal_data(const Gps_Ephemeris & ephNAV, std::vector > observables_vector; std::map::const_iterator map_iter; - for(map_iter = observables.cbegin(); - map_iter != observables.cend(); - map_iter++) + for (map_iter = observables.cbegin(); + map_iter != observables.cend(); + map_iter++) { observables_vector.push_back(*map_iter); } @@ -2791,13 +2783,13 @@ std::string Rtcm::get_MSM_4_content_signal_data(const Gps_Ephemeris & ephNAV, std::reverse(ordered_by_signal.begin(), ordered_by_signal.end()); std::vector > ordered_by_PRN_pos = Rtcm::sort_by_PRN_mask(ordered_by_signal); - for(unsigned int cell = 0; cell < Ncells ; cell++) + for (unsigned int cell = 0; cell < Ncells; cell++) { - Rtcm::set_DF400(ordered_by_PRN_pos.at( cell ).second); - Rtcm::set_DF401(ordered_by_PRN_pos.at( cell ).second); - Rtcm::set_DF402(ephNAV, ephCNAV, ephFNAV, ephGNAV, obs_time, ordered_by_PRN_pos.at( cell ).second); - Rtcm::set_DF420(ordered_by_PRN_pos.at( cell ).second); - Rtcm::set_DF403(ordered_by_PRN_pos.at( cell ).second); + Rtcm::set_DF400(ordered_by_PRN_pos.at(cell).second); + Rtcm::set_DF401(ordered_by_PRN_pos.at(cell).second); + Rtcm::set_DF402(ephNAV, ephCNAV, ephFNAV, ephGNAV, obs_time, ordered_by_PRN_pos.at(cell).second); + Rtcm::set_DF420(ordered_by_PRN_pos.at(cell).second); + Rtcm::set_DF403(ordered_by_PRN_pos.at(cell).second); first_data_type += DF400.to_string(); second_data_type += DF401.to_string(); third_data_type += DF402.to_string(); @@ -2816,50 +2808,50 @@ std::string Rtcm::get_MSM_4_content_signal_data(const Gps_Ephemeris & ephNAV, // // ********************************************************************************************** -std::string Rtcm::print_MSM_5( const Gps_Ephemeris & gps_eph, - const Gps_CNAV_Ephemeris & gps_cnav_eph, - const Galileo_Ephemeris & gal_eph, - const Glonass_Gnav_Ephemeris & glo_gnav_eph, - double obs_time, - const std::map & observables, - unsigned int ref_id, - unsigned int clock_steering_indicator, - unsigned int external_clock_indicator, - int smooth_int, - bool divergence_free, - bool more_messages) +std::string Rtcm::print_MSM_5(const Gps_Ephemeris& gps_eph, + const Gps_CNAV_Ephemeris& gps_cnav_eph, + const Galileo_Ephemeris& gal_eph, + const Glonass_Gnav_Ephemeris& glo_gnav_eph, + double obs_time, + const std::map& observables, + unsigned int ref_id, + unsigned int clock_steering_indicator, + unsigned int external_clock_indicator, + int smooth_int, + bool divergence_free, + bool more_messages) { unsigned int msg_number = 0; - if(gps_eph.i_satellite_PRN != 0) msg_number = 1075; - if(gps_cnav_eph.i_satellite_PRN != 0) msg_number = 1075; - if(glo_gnav_eph.i_satellite_PRN != 0) msg_number = 1085; - if(gal_eph.i_satellite_PRN != 0) msg_number = 1095; - if(((gps_eph.i_satellite_PRN != 0) ||(gps_cnav_eph.i_satellite_PRN != 0) ) && (gal_eph.i_satellite_PRN != 0) && (glo_gnav_eph.i_satellite_PRN != 0)) + if (gps_eph.i_satellite_PRN != 0) msg_number = 1075; + if (gps_cnav_eph.i_satellite_PRN != 0) msg_number = 1075; + if (glo_gnav_eph.i_satellite_PRN != 0) msg_number = 1085; + if (gal_eph.i_satellite_PRN != 0) msg_number = 1095; + if (((gps_eph.i_satellite_PRN != 0) || (gps_cnav_eph.i_satellite_PRN != 0)) && (gal_eph.i_satellite_PRN != 0) && (glo_gnav_eph.i_satellite_PRN != 0)) { - LOG(WARNING) << "MSM messages for observables from different systems are not defined"; //print two messages? + LOG(WARNING) << "MSM messages for observables from different systems are not defined"; //print two messages? } - if(msg_number == 0) + if (msg_number == 0) { LOG(WARNING) << "Invalid ephemeris provided"; msg_number = 1075; } std::string header = Rtcm::get_MSM_header(msg_number, - obs_time, - observables, - ref_id, - clock_steering_indicator, - external_clock_indicator, - smooth_int, - divergence_free, - more_messages); + obs_time, + observables, + ref_id, + clock_steering_indicator, + external_clock_indicator, + smooth_int, + divergence_free, + more_messages); std::string sat_data = Rtcm::get_MSM_5_content_sat_data(observables); std::string signal_data = Rtcm::get_MSM_5_content_signal_data(gps_eph, gps_cnav_eph, gal_eph, glo_gnav_eph, obs_time, observables); std::string message = build_message(header + sat_data + signal_data); - if(server_is_running) + if (server_is_running) { rtcm_message_queue->push(message); } @@ -2868,7 +2860,7 @@ std::string Rtcm::print_MSM_5( const Gps_Ephemeris & gps_eph, } -std::string Rtcm::get_MSM_5_content_sat_data(const std::map & observables) +std::string Rtcm::get_MSM_5_content_sat_data(const std::map& observables) { std::string sat_data; std::string first_data_type; @@ -2884,12 +2876,12 @@ std::string Rtcm::get_MSM_5_content_sat_data(const std::map & std::vector pos; std::vector::iterator it; - for(gnss_synchro_iter = observables.cbegin(); - gnss_synchro_iter != observables.cend(); - gnss_synchro_iter++) + for (gnss_synchro_iter = observables.cbegin(); + gnss_synchro_iter != observables.cend(); + gnss_synchro_iter++) { it = std::find(pos.begin(), pos.end(), 65 - gnss_synchro_iter->second.PRN); - if(it == pos.end()) + if (it == pos.end()) { pos.push_back(65 - gnss_synchro_iter->second.PRN); observables_vector.push_back(*gnss_synchro_iter); @@ -2898,11 +2890,11 @@ std::string Rtcm::get_MSM_5_content_sat_data(const std::map & std::vector > ordered_by_PRN_pos = Rtcm::sort_by_PRN_mask(observables_vector); - for(unsigned int nsat = 0; nsat < num_satellites; nsat++) + for (unsigned int nsat = 0; nsat < num_satellites; nsat++) { - Rtcm::set_DF397( ordered_by_PRN_pos.at(nsat).second ); - Rtcm::set_DF398( ordered_by_PRN_pos.at(nsat).second ); - Rtcm::set_DF399( ordered_by_PRN_pos.at(nsat).second ); + Rtcm::set_DF397(ordered_by_PRN_pos.at(nsat).second); + Rtcm::set_DF398(ordered_by_PRN_pos.at(nsat).second); + Rtcm::set_DF399(ordered_by_PRN_pos.at(nsat).second); std::bitset<4> reserved = std::bitset<4>("0000"); first_data_type += DF397.to_string(); second_data_type += reserved.to_string(); @@ -2914,12 +2906,12 @@ std::string Rtcm::get_MSM_5_content_sat_data(const std::map & } -std::string Rtcm::get_MSM_5_content_signal_data(const Gps_Ephemeris & ephNAV, - const Gps_CNAV_Ephemeris & ephCNAV, - const Galileo_Ephemeris & ephFNAV, - const Glonass_Gnav_Ephemeris & ephGNAV, - double obs_time, - const std::map & observables) +std::string Rtcm::get_MSM_5_content_signal_data(const Gps_Ephemeris& ephNAV, + const Gps_CNAV_Ephemeris& ephCNAV, + const Galileo_Ephemeris& ephFNAV, + const Glonass_Gnav_Ephemeris& ephGNAV, + double obs_time, + const std::map& observables) { std::string signal_data; std::string first_data_type; @@ -2934,9 +2926,9 @@ std::string Rtcm::get_MSM_5_content_signal_data(const Gps_Ephemeris & ephNAV, std::vector > observables_vector; std::map::const_iterator map_iter; - for(map_iter = observables.cbegin(); - map_iter != observables.cend(); - map_iter++) + for (map_iter = observables.cbegin(); + map_iter != observables.cend(); + map_iter++) { observables_vector.push_back(*map_iter); } @@ -2945,14 +2937,14 @@ std::string Rtcm::get_MSM_5_content_signal_data(const Gps_Ephemeris & ephNAV, std::reverse(ordered_by_signal.begin(), ordered_by_signal.end()); std::vector > ordered_by_PRN_pos = Rtcm::sort_by_PRN_mask(ordered_by_signal); - for(unsigned int cell = 0; cell < Ncells ; cell++) + for (unsigned int cell = 0; cell < Ncells; cell++) { - Rtcm::set_DF400(ordered_by_PRN_pos.at( cell ).second); - Rtcm::set_DF401(ordered_by_PRN_pos.at( cell ).second); - Rtcm::set_DF402(ephNAV, ephCNAV, ephFNAV, ephGNAV, obs_time, ordered_by_PRN_pos.at( cell ).second); - Rtcm::set_DF420(ordered_by_PRN_pos.at( cell ).second); - Rtcm::set_DF403(ordered_by_PRN_pos.at( cell ).second); - Rtcm::set_DF404(ordered_by_PRN_pos.at( cell ).second); + Rtcm::set_DF400(ordered_by_PRN_pos.at(cell).second); + Rtcm::set_DF401(ordered_by_PRN_pos.at(cell).second); + Rtcm::set_DF402(ephNAV, ephCNAV, ephFNAV, ephGNAV, obs_time, ordered_by_PRN_pos.at(cell).second); + Rtcm::set_DF420(ordered_by_PRN_pos.at(cell).second); + Rtcm::set_DF403(ordered_by_PRN_pos.at(cell).second); + Rtcm::set_DF404(ordered_by_PRN_pos.at(cell).second); first_data_type += DF400.to_string(); second_data_type += DF401.to_string(); third_data_type += DF402.to_string(); @@ -2966,57 +2958,56 @@ std::string Rtcm::get_MSM_5_content_signal_data(const Gps_Ephemeris & ephNAV, } - // ********************************************************************************************** // // MESSAGE TYPE MSM6 (FULL PSEUDORANGES AND PHASERANGES PLUS CNR, HIGH RESOLUTION) // // ********************************************************************************************** -std::string Rtcm::print_MSM_6( const Gps_Ephemeris & gps_eph, - const Gps_CNAV_Ephemeris & gps_cnav_eph, - const Galileo_Ephemeris & gal_eph, - const Glonass_Gnav_Ephemeris & glo_gnav_eph, - double obs_time, - const std::map & observables, - unsigned int ref_id, - unsigned int clock_steering_indicator, - unsigned int external_clock_indicator, - int smooth_int, - bool divergence_free, - bool more_messages) +std::string Rtcm::print_MSM_6(const Gps_Ephemeris& gps_eph, + const Gps_CNAV_Ephemeris& gps_cnav_eph, + const Galileo_Ephemeris& gal_eph, + const Glonass_Gnav_Ephemeris& glo_gnav_eph, + double obs_time, + const std::map& observables, + unsigned int ref_id, + unsigned int clock_steering_indicator, + unsigned int external_clock_indicator, + int smooth_int, + bool divergence_free, + bool more_messages) { unsigned int msg_number = 0; - if(gps_eph.i_satellite_PRN != 0) msg_number = 1076; - if(gps_cnav_eph.i_satellite_PRN != 0) msg_number = 1076; - if(glo_gnav_eph.i_satellite_PRN != 0) msg_number = 1086; - if(gal_eph.i_satellite_PRN != 0) msg_number = 1096; - if(((gps_eph.i_satellite_PRN != 0) ||(gps_cnav_eph.i_satellite_PRN != 0) ) && (gal_eph.i_satellite_PRN != 0) && (glo_gnav_eph.i_satellite_PRN != 0)) + if (gps_eph.i_satellite_PRN != 0) msg_number = 1076; + if (gps_cnav_eph.i_satellite_PRN != 0) msg_number = 1076; + if (glo_gnav_eph.i_satellite_PRN != 0) msg_number = 1086; + if (gal_eph.i_satellite_PRN != 0) msg_number = 1096; + if (((gps_eph.i_satellite_PRN != 0) || (gps_cnav_eph.i_satellite_PRN != 0)) && (gal_eph.i_satellite_PRN != 0) && (glo_gnav_eph.i_satellite_PRN != 0)) { - LOG(WARNING) << "MSM messages for observables from different systems are not defined"; //print two messages? + LOG(WARNING) << "MSM messages for observables from different systems are not defined"; //print two messages? } - if(msg_number == 0) + if (msg_number == 0) { LOG(WARNING) << "Invalid ephemeris provided"; msg_number = 1076; } std::string header = Rtcm::get_MSM_header(msg_number, - obs_time, - observables, - ref_id, - clock_steering_indicator, - external_clock_indicator, - smooth_int, - divergence_free, - more_messages); + obs_time, + observables, + ref_id, + clock_steering_indicator, + external_clock_indicator, + smooth_int, + divergence_free, + more_messages); std::string sat_data = Rtcm::get_MSM_4_content_sat_data(observables); std::string signal_data = Rtcm::get_MSM_6_content_signal_data(gps_eph, gps_cnav_eph, gal_eph, glo_gnav_eph, obs_time, observables); std::string message = build_message(header + sat_data + signal_data); - if(server_is_running) + if (server_is_running) { rtcm_message_queue->push(message); } @@ -3025,12 +3016,12 @@ std::string Rtcm::print_MSM_6( const Gps_Ephemeris & gps_eph, } -std::string Rtcm::get_MSM_6_content_signal_data(const Gps_Ephemeris & ephNAV, - const Gps_CNAV_Ephemeris & ephCNAV, - const Galileo_Ephemeris & ephFNAV, - const Glonass_Gnav_Ephemeris & ephGNAV, - double obs_time, - const std::map & observables) +std::string Rtcm::get_MSM_6_content_signal_data(const Gps_Ephemeris& ephNAV, + const Gps_CNAV_Ephemeris& ephCNAV, + const Galileo_Ephemeris& ephFNAV, + const Glonass_Gnav_Ephemeris& ephGNAV, + double obs_time, + const std::map& observables) { std::string signal_data; std::string first_data_type; @@ -3044,9 +3035,9 @@ std::string Rtcm::get_MSM_6_content_signal_data(const Gps_Ephemeris & ephNAV, std::vector > observables_vector; std::map::const_iterator map_iter; - for(map_iter = observables.cbegin(); - map_iter != observables.cend(); - map_iter++) + for (map_iter = observables.cbegin(); + map_iter != observables.cend(); + map_iter++) { observables_vector.push_back(*map_iter); } @@ -3055,13 +3046,13 @@ std::string Rtcm::get_MSM_6_content_signal_data(const Gps_Ephemeris & ephNAV, std::reverse(ordered_by_signal.begin(), ordered_by_signal.end()); std::vector > ordered_by_PRN_pos = Rtcm::sort_by_PRN_mask(ordered_by_signal); - for(unsigned int cell = 0; cell < Ncells ; cell++) + for (unsigned int cell = 0; cell < Ncells; cell++) { - Rtcm::set_DF405(ordered_by_PRN_pos.at( cell ).second); - Rtcm::set_DF406(ordered_by_PRN_pos.at( cell ).second); - Rtcm::set_DF407(ephNAV, ephCNAV, ephFNAV, ephGNAV, obs_time, ordered_by_PRN_pos.at( cell ).second); - Rtcm::set_DF420(ordered_by_PRN_pos.at( cell ).second); - Rtcm::set_DF408(ordered_by_PRN_pos.at( cell ).second); + Rtcm::set_DF405(ordered_by_PRN_pos.at(cell).second); + Rtcm::set_DF406(ordered_by_PRN_pos.at(cell).second); + Rtcm::set_DF407(ephNAV, ephCNAV, ephFNAV, ephGNAV, obs_time, ordered_by_PRN_pos.at(cell).second); + Rtcm::set_DF420(ordered_by_PRN_pos.at(cell).second); + Rtcm::set_DF408(ordered_by_PRN_pos.at(cell).second); first_data_type += DF405.to_string(); second_data_type += DF406.to_string(); third_data_type += DF407.to_string(); @@ -3074,57 +3065,56 @@ std::string Rtcm::get_MSM_6_content_signal_data(const Gps_Ephemeris & ephNAV, } - // ********************************************************************************************** // // MESSAGE TYPE MSM7 (FULL PSEUDORANGES, PHASERANGES, PHASERANGERATE AND CNR, HIGH RESOLUTION) // // ********************************************************************************************** -std::string Rtcm::print_MSM_7( const Gps_Ephemeris & gps_eph, - const Gps_CNAV_Ephemeris & gps_cnav_eph, - const Galileo_Ephemeris & gal_eph, - const Glonass_Gnav_Ephemeris & glo_gnav_eph, - double obs_time, - const std::map & observables, - unsigned int ref_id, - unsigned int clock_steering_indicator, - unsigned int external_clock_indicator, - int smooth_int, - bool divergence_free, - bool more_messages) +std::string Rtcm::print_MSM_7(const Gps_Ephemeris& gps_eph, + const Gps_CNAV_Ephemeris& gps_cnav_eph, + const Galileo_Ephemeris& gal_eph, + const Glonass_Gnav_Ephemeris& glo_gnav_eph, + double obs_time, + const std::map& observables, + unsigned int ref_id, + unsigned int clock_steering_indicator, + unsigned int external_clock_indicator, + int smooth_int, + bool divergence_free, + bool more_messages) { unsigned int msg_number = 0; - if(gps_eph.i_satellite_PRN != 0) msg_number = 1077; - if(gps_cnav_eph.i_satellite_PRN != 0) msg_number = 1077; - if(glo_gnav_eph.i_satellite_PRN != 0) msg_number = 1087; - if(gal_eph.i_satellite_PRN != 0) msg_number = 1097; - if(((gps_eph.i_satellite_PRN != 0) || (gps_cnav_eph.i_satellite_PRN != 0) ) && (glo_gnav_eph.i_satellite_PRN != 0) && (gal_eph.i_satellite_PRN != 0)) + if (gps_eph.i_satellite_PRN != 0) msg_number = 1077; + if (gps_cnav_eph.i_satellite_PRN != 0) msg_number = 1077; + if (glo_gnav_eph.i_satellite_PRN != 0) msg_number = 1087; + if (gal_eph.i_satellite_PRN != 0) msg_number = 1097; + if (((gps_eph.i_satellite_PRN != 0) || (gps_cnav_eph.i_satellite_PRN != 0)) && (glo_gnav_eph.i_satellite_PRN != 0) && (gal_eph.i_satellite_PRN != 0)) { - LOG(WARNING) << "MSM messages for observables from different systems are not defined"; //print two messages? + LOG(WARNING) << "MSM messages for observables from different systems are not defined"; //print two messages? } - if(msg_number == 0) + if (msg_number == 0) { LOG(WARNING) << "Invalid ephemeris provided"; msg_number = 1076; } std::string header = Rtcm::get_MSM_header(msg_number, - obs_time, - observables, - ref_id, - clock_steering_indicator, - external_clock_indicator, - smooth_int, - divergence_free, - more_messages); + obs_time, + observables, + ref_id, + clock_steering_indicator, + external_clock_indicator, + smooth_int, + divergence_free, + more_messages); std::string sat_data = Rtcm::get_MSM_5_content_sat_data(observables); std::string signal_data = Rtcm::get_MSM_7_content_signal_data(gps_eph, gps_cnav_eph, gal_eph, glo_gnav_eph, obs_time, observables); std::string message = build_message(header + sat_data + signal_data); - if(server_is_running) + if (server_is_running) { rtcm_message_queue->push(message); } @@ -3133,12 +3123,12 @@ std::string Rtcm::print_MSM_7( const Gps_Ephemeris & gps_eph, } -std::string Rtcm::get_MSM_7_content_signal_data(const Gps_Ephemeris & ephNAV, - const Gps_CNAV_Ephemeris & ephCNAV, - const Galileo_Ephemeris & ephFNAV, - const Glonass_Gnav_Ephemeris & ephGNAV, - double obs_time, - const std::map & observables) +std::string Rtcm::get_MSM_7_content_signal_data(const Gps_Ephemeris& ephNAV, + const Gps_CNAV_Ephemeris& ephCNAV, + const Galileo_Ephemeris& ephFNAV, + const Glonass_Gnav_Ephemeris& ephGNAV, + double obs_time, + const std::map& observables) { std::string signal_data; std::string first_data_type; @@ -3153,9 +3143,9 @@ std::string Rtcm::get_MSM_7_content_signal_data(const Gps_Ephemeris & ephNAV, std::vector > observables_vector; std::map::const_iterator map_iter; - for(map_iter = observables.cbegin(); - map_iter != observables.cend(); - map_iter++) + for (map_iter = observables.cbegin(); + map_iter != observables.cend(); + map_iter++) { observables_vector.push_back(*map_iter); } @@ -3164,14 +3154,14 @@ std::string Rtcm::get_MSM_7_content_signal_data(const Gps_Ephemeris & ephNAV, std::reverse(ordered_by_signal.begin(), ordered_by_signal.end()); std::vector > ordered_by_PRN_pos = Rtcm::sort_by_PRN_mask(ordered_by_signal); - for(unsigned int cell = 0; cell < Ncells ; cell++) + for (unsigned int cell = 0; cell < Ncells; cell++) { - Rtcm::set_DF405(ordered_by_PRN_pos.at( cell ).second); - Rtcm::set_DF406(ordered_by_PRN_pos.at( cell ).second); - Rtcm::set_DF407(ephNAV, ephCNAV, ephFNAV, ephGNAV, obs_time, ordered_by_PRN_pos.at( cell ).second); - Rtcm::set_DF420(ordered_by_PRN_pos.at( cell ).second); - Rtcm::set_DF408(ordered_by_PRN_pos.at( cell ).second); - Rtcm::set_DF404(ordered_by_PRN_pos.at( cell ).second); + Rtcm::set_DF405(ordered_by_PRN_pos.at(cell).second); + Rtcm::set_DF406(ordered_by_PRN_pos.at(cell).second); + Rtcm::set_DF407(ephNAV, ephCNAV, ephFNAV, ephGNAV, obs_time, ordered_by_PRN_pos.at(cell).second); + Rtcm::set_DF420(ordered_by_PRN_pos.at(cell).second); + Rtcm::set_DF408(ordered_by_PRN_pos.at(cell).second); + Rtcm::set_DF404(ordered_by_PRN_pos.at(cell).second); first_data_type += DF405.to_string(); second_data_type += DF406.to_string(); third_data_type += DF407.to_string(); @@ -3185,17 +3175,17 @@ std::string Rtcm::get_MSM_7_content_signal_data(const Gps_Ephemeris & ephNAV, } - // ***************************************************************************************************** // Some utilities // ***************************************************************************************************** -std::vector > Rtcm::sort_by_PRN_mask(const std::vector > & synchro_map) const +std::vector > Rtcm::sort_by_PRN_mask(const std::vector >& synchro_map) const { std::vector >::const_iterator synchro_map_iter; std::vector > my_vec; - struct { - bool operator()(const std::pair & a, const std::pair & b) + struct + { + bool operator()(const std::pair& a, const std::pair& b) { unsigned int value_a = 64 - a.second.PRN; unsigned int value_b = 64 - b.second.PRN; @@ -3203,9 +3193,9 @@ std::vector > Rtcm::sort_by_PRN_mask(const std::vec } } has_lower_pos; - for(synchro_map_iter = synchro_map.cbegin(); - synchro_map_iter != synchro_map.cend(); - synchro_map_iter++) + for (synchro_map_iter = synchro_map.cbegin(); + synchro_map_iter != synchro_map.cend(); + synchro_map_iter++) { std::pair p(synchro_map_iter->first, synchro_map_iter->second); @@ -3218,39 +3208,40 @@ std::vector > Rtcm::sort_by_PRN_mask(const std::vec } -std::vector > Rtcm::sort_by_signal(const std::vector > & synchro_map) const +std::vector > Rtcm::sort_by_signal(const std::vector >& synchro_map) const { std::vector >::const_iterator synchro_map_iter; std::vector > my_vec; - struct { - bool operator()(const std::pair & a, const std::pair & b) + struct + { + bool operator()(const std::pair& a, const std::pair& b) { unsigned int value_a = 0; unsigned int value_b = 0; std::string system_a(&a.second.System, 1); std::string system_b(&b.second.System, 1); std::string sig_a_(a.second.Signal); - std::string sig_a = sig_a_.substr(0,2); + std::string sig_a = sig_a_.substr(0, 2); std::string sig_b_(b.second.Signal); - std::string sig_b = sig_b_.substr(0,2); + std::string sig_b = sig_b_.substr(0, 2); - if(system_a.compare("G") == 0) + if (system_a.compare("G") == 0) { value_a = gps_signal_map.at(sig_a); } - if(system_a.compare("E") == 0) + if (system_a.compare("E") == 0) { value_a = galileo_signal_map.at(sig_a); } - if(system_b.compare("G") == 0) + if (system_b.compare("G") == 0) { value_b = gps_signal_map.at(sig_b); } - if(system_b.compare("E") == 0) + if (system_b.compare("E") == 0) { value_b = galileo_signal_map.at(sig_b); } @@ -3260,9 +3251,9 @@ std::vector > Rtcm::sort_by_signal(const std::vecto } has_lower_signalID; - for(synchro_map_iter = synchro_map.cbegin(); - synchro_map_iter != synchro_map.cend(); - synchro_map_iter++) + for (synchro_map_iter = synchro_map.cbegin(); + synchro_map_iter != synchro_map.cend(); + synchro_map_iter++) { std::pair p(synchro_map_iter->first, synchro_map_iter->second); @@ -3274,8 +3265,7 @@ std::vector > Rtcm::sort_by_signal(const std::vecto } -std::map Rtcm::gps_signal_map = [] -{ +std::map Rtcm::gps_signal_map = [] { std::map gps_signal_map_; // Table 3.5-91 gps_signal_map_["1C"] = 2; @@ -3294,8 +3284,7 @@ std::map Rtcm::gps_signal_map = [] }(); -std::map Rtcm::galileo_signal_map = [] -{ +std::map Rtcm::galileo_signal_map = [] { std::map galileo_signal_map_; // Table 3.5-100 galileo_signal_map_["1C"] = 2; @@ -3321,7 +3310,7 @@ std::map Rtcm::galileo_signal_map = [] }(); -boost::posix_time::ptime Rtcm::compute_GPS_time(const Gps_Ephemeris & eph, double obs_time) const +boost::posix_time::ptime Rtcm::compute_GPS_time(const Gps_Ephemeris& eph, double obs_time) const { const double gps_t = obs_time; boost::posix_time::time_duration t = boost::posix_time::millisec((gps_t + 604800 * static_cast(eph.i_GPS_week % 1024)) * 1000); @@ -3330,7 +3319,7 @@ boost::posix_time::ptime Rtcm::compute_GPS_time(const Gps_Ephemeris & eph, doubl } -boost::posix_time::ptime Rtcm::compute_GPS_time(const Gps_CNAV_Ephemeris & eph, double obs_time) const +boost::posix_time::ptime Rtcm::compute_GPS_time(const Gps_CNAV_Ephemeris& eph, double obs_time) const { const double gps_t = obs_time; boost::posix_time::time_duration t = boost::posix_time::millisec((gps_t + 604800 * static_cast(eph.i_GPS_week % 1024)) * 1000); @@ -3339,7 +3328,7 @@ boost::posix_time::ptime Rtcm::compute_GPS_time(const Gps_CNAV_Ephemeris & eph, } -boost::posix_time::ptime Rtcm::compute_Galileo_time(const Galileo_Ephemeris & eph, double obs_time) const +boost::posix_time::ptime Rtcm::compute_Galileo_time(const Galileo_Ephemeris& eph, double obs_time) const { double galileo_t = obs_time; boost::posix_time::time_duration t = boost::posix_time::millisec((galileo_t + 604800 * static_cast(eph.WN_5)) * 1000); @@ -3348,19 +3337,19 @@ boost::posix_time::ptime Rtcm::compute_Galileo_time(const Galileo_Ephemeris & ep } -boost::posix_time::ptime Rtcm::compute_GLONASS_time(const Glonass_Gnav_Ephemeris & eph, double obs_time) const +boost::posix_time::ptime Rtcm::compute_GLONASS_time(const Glonass_Gnav_Ephemeris& eph, double obs_time) const { boost::posix_time::ptime p_time = eph.compute_GLONASS_time(obs_time); return p_time; } -unsigned int Rtcm::lock_time(const Gps_Ephemeris & eph, double obs_time, const Gnss_Synchro & gnss_synchro) +unsigned int Rtcm::lock_time(const Gps_Ephemeris& eph, double obs_time, const Gnss_Synchro& gnss_synchro) { unsigned int lock_time_in_seconds; boost::posix_time::ptime current_time = Rtcm::compute_GPS_time(eph, obs_time); boost::posix_time::ptime last_lock_time = Rtcm::gps_L1_last_lock_time[65 - gnss_synchro.PRN]; - if(last_lock_time.is_not_a_date_time() )// || CHECK LLI!!......) + if (last_lock_time.is_not_a_date_time()) // || CHECK LLI!!......) { Rtcm::gps_L1_last_lock_time[65 - gnss_synchro.PRN] = current_time; } @@ -3372,12 +3361,12 @@ unsigned int Rtcm::lock_time(const Gps_Ephemeris & eph, double obs_time, const G } -unsigned int Rtcm::lock_time(const Gps_CNAV_Ephemeris & eph, double obs_time, const Gnss_Synchro & gnss_synchro) +unsigned int Rtcm::lock_time(const Gps_CNAV_Ephemeris& eph, double obs_time, const Gnss_Synchro& gnss_synchro) { unsigned int lock_time_in_seconds; boost::posix_time::ptime current_time = Rtcm::compute_GPS_time(eph, obs_time); boost::posix_time::ptime last_lock_time = Rtcm::gps_L2_last_lock_time[65 - gnss_synchro.PRN]; - if(last_lock_time.is_not_a_date_time() )// || CHECK LLI!!......) + if (last_lock_time.is_not_a_date_time()) // || CHECK LLI!!......) { Rtcm::gps_L2_last_lock_time[65 - gnss_synchro.PRN] = current_time; } @@ -3387,40 +3376,40 @@ unsigned int Rtcm::lock_time(const Gps_CNAV_Ephemeris & eph, double obs_time, co } -unsigned int Rtcm::lock_time(const Galileo_Ephemeris & eph, double obs_time, const Gnss_Synchro & gnss_synchro) +unsigned int Rtcm::lock_time(const Galileo_Ephemeris& eph, double obs_time, const Gnss_Synchro& gnss_synchro) { unsigned int lock_time_in_seconds; boost::posix_time::ptime current_time = Rtcm::compute_Galileo_time(eph, obs_time); boost::posix_time::ptime last_lock_time; std::string sig_(gnss_synchro.Signal); - if(sig_.compare("1B") == 0) + if (sig_.compare("1B") == 0) { last_lock_time = Rtcm::gal_E1_last_lock_time[65 - gnss_synchro.PRN]; } - if((sig_.compare("5X") == 0) || (sig_.compare("8X") == 0) || (sig_.compare("7X") == 0) ) + if ((sig_.compare("5X") == 0) || (sig_.compare("8X") == 0) || (sig_.compare("7X") == 0)) { last_lock_time = Rtcm::gal_E5_last_lock_time[65 - gnss_synchro.PRN]; } - if(last_lock_time.is_not_a_date_time() )// || CHECK LLI!!......) + if (last_lock_time.is_not_a_date_time()) // || CHECK LLI!!......) { - if(sig_.compare("1B") == 0) + if (sig_.compare("1B") == 0) { Rtcm::gal_E1_last_lock_time[65 - gnss_synchro.PRN] = current_time; } - if((sig_.compare("5X") == 0) || (sig_.compare("8X") == 0) || (sig_.compare("7X") == 0) ) + if ((sig_.compare("5X") == 0) || (sig_.compare("8X") == 0) || (sig_.compare("7X") == 0)) { Rtcm::gal_E5_last_lock_time[65 - gnss_synchro.PRN] = current_time; } } boost::posix_time::time_duration lock_duration = current_time - current_time; - if(sig_.compare("1B") == 0) + if (sig_.compare("1B") == 0) { lock_duration = current_time - Rtcm::gal_E1_last_lock_time[65 - gnss_synchro.PRN]; } - if((sig_.compare("5X") == 0) || (sig_.compare("8X") == 0) || (sig_.compare("7X") == 0) ) + if ((sig_.compare("5X") == 0) || (sig_.compare("8X") == 0) || (sig_.compare("7X") == 0)) { lock_duration = current_time - Rtcm::gal_E5_last_lock_time[65 - gnss_synchro.PRN]; } @@ -3430,40 +3419,40 @@ unsigned int Rtcm::lock_time(const Galileo_Ephemeris & eph, double obs_time, con } -unsigned int Rtcm::lock_time(const Glonass_Gnav_Ephemeris & eph, double obs_time, const Gnss_Synchro & gnss_synchro) +unsigned int Rtcm::lock_time(const Glonass_Gnav_Ephemeris& eph, double obs_time, const Gnss_Synchro& gnss_synchro) { unsigned int lock_time_in_seconds; boost::posix_time::ptime current_time = Rtcm::compute_GLONASS_time(eph, obs_time); boost::posix_time::ptime last_lock_time; std::string sig_(gnss_synchro.Signal); - if(sig_.compare("1C") == 0) + if (sig_.compare("1C") == 0) { last_lock_time = Rtcm::glo_L1_last_lock_time[65 - gnss_synchro.PRN]; } - if(sig_.compare("2C") == 0) + if (sig_.compare("2C") == 0) { last_lock_time = Rtcm::glo_L2_last_lock_time[65 - gnss_synchro.PRN]; } - if(last_lock_time.is_not_a_date_time() )// || CHECK LLI!!......) + if (last_lock_time.is_not_a_date_time()) // || CHECK LLI!!......) { - if(sig_.compare("1C") == 0) + if (sig_.compare("1C") == 0) { Rtcm::glo_L1_last_lock_time[65 - gnss_synchro.PRN] = current_time; } - if(sig_.compare("2C") == 0) + if (sig_.compare("2C") == 0) { Rtcm::glo_L2_last_lock_time[65 - gnss_synchro.PRN] = current_time; } } boost::posix_time::time_duration lock_duration = current_time - current_time; - if(sig_.compare("1C") == 0) + if (sig_.compare("1C") == 0) { lock_duration = current_time - Rtcm::glo_L1_last_lock_time[65 - gnss_synchro.PRN]; } - if(sig_.compare("2C") == 0) + if (sig_.compare("2C") == 0) { lock_duration = current_time - Rtcm::glo_L2_last_lock_time[65 - gnss_synchro.PRN]; } @@ -3476,13 +3465,13 @@ unsigned int Rtcm::lock_time(const Glonass_Gnav_Ephemeris & eph, double obs_time unsigned int Rtcm::lock_time_indicator(unsigned int lock_time_period_s) { // Table 3.4-2 - if(lock_time_period_s <= 0 ) return 0; - if(lock_time_period_s < 24 ) return lock_time_period_s; - if(lock_time_period_s < 72 ) return (lock_time_period_s + 24 ) / 2; - if(lock_time_period_s < 168) return (lock_time_period_s + 120 ) / 4; - if(lock_time_period_s < 360) return (lock_time_period_s + 408 ) / 8; - if(lock_time_period_s < 744) return (lock_time_period_s + 1176) / 16; - if(lock_time_period_s < 937) return (lock_time_period_s + 3096) / 32; + if (lock_time_period_s <= 0) return 0; + if (lock_time_period_s < 24) return lock_time_period_s; + if (lock_time_period_s < 72) return (lock_time_period_s + 24) / 2; + if (lock_time_period_s < 168) return (lock_time_period_s + 120) / 4; + if (lock_time_period_s < 360) return (lock_time_period_s + 408) / 8; + if (lock_time_period_s < 744) return (lock_time_period_s + 1176) / 16; + if (lock_time_period_s < 937) return (lock_time_period_s + 3096) / 32; return 127; } @@ -3490,25 +3479,26 @@ unsigned int Rtcm::lock_time_indicator(unsigned int lock_time_period_s) unsigned int Rtcm::msm_lock_time_indicator(unsigned int lock_time_period_s) { // Table 3.5-74 - if(lock_time_period_s < 32 ) return 0; - if(lock_time_period_s < 64 ) return 1; - if(lock_time_period_s < 128 ) return 2; - if(lock_time_period_s < 256 ) return 3; - if(lock_time_period_s < 512 ) return 4; - if(lock_time_period_s < 1024 ) return 5; - if(lock_time_period_s < 2048 ) return 6; - if(lock_time_period_s < 4096 ) return 7; - if(lock_time_period_s < 8192 ) return 8; - if(lock_time_period_s < 16384 ) return 9; - if(lock_time_period_s < 32768 ) return 10; - if(lock_time_period_s < 65536 ) return 11; - if(lock_time_period_s < 131072) return 12; - if(lock_time_period_s < 262144) return 13; - if(lock_time_period_s < 524288) return 14; + if (lock_time_period_s < 32) return 0; + if (lock_time_period_s < 64) return 1; + if (lock_time_period_s < 128) return 2; + if (lock_time_period_s < 256) return 3; + if (lock_time_period_s < 512) return 4; + if (lock_time_period_s < 1024) return 5; + if (lock_time_period_s < 2048) return 6; + if (lock_time_period_s < 4096) return 7; + if (lock_time_period_s < 8192) return 8; + if (lock_time_period_s < 16384) return 9; + if (lock_time_period_s < 32768) return 10; + if (lock_time_period_s < 65536) return 11; + if (lock_time_period_s < 131072) return 12; + if (lock_time_period_s < 262144) return 13; + if (lock_time_period_s < 524288) return 14; return 15; } +// clang-format off unsigned int Rtcm::msm_extended_lock_time_indicator(unsigned int lock_time_period_s) { // Table 3.5-75 @@ -3536,7 +3526,7 @@ unsigned int Rtcm::msm_extended_lock_time_indicator(unsigned int lock_time_perio if( 67108864 <= lock_time_period_s ) return (704 ); return 1023; // will never happen } - +// clang-format on // ***************************************************************************************************** // @@ -3571,7 +3561,7 @@ int Rtcm::set_DF004(double obs_time) { // TOW in milliseconds from the beginning of the GPS week, measured in GPS time unsigned long int tow = static_cast(std::round(obs_time * 1000)); - if(tow > 604799999) + if (tow > 604799999) { LOG(WARNING) << "To large TOW! Set to the last millisecond of the week"; tow = 604799999; @@ -3591,14 +3581,14 @@ int Rtcm::set_DF005(bool sync_flag) } -int Rtcm::set_DF006(const std::map & observables) +int Rtcm::set_DF006(const std::map& observables) { //Number of satellites observed in current epoch unsigned short int nsats = 0; std::map::const_iterator observables_iter; - for(observables_iter = observables.cbegin(); - observables_iter != observables.cend(); - observables_iter++) + for (observables_iter = observables.cbegin(); + observables_iter != observables.cend(); + observables_iter++) { nsats++; } @@ -3627,10 +3617,10 @@ int Rtcm::set_DF008(short int smoothing_interval) } -int Rtcm::set_DF009(const Gnss_Synchro & gnss_synchro) +int Rtcm::set_DF009(const Gnss_Synchro& gnss_synchro) { unsigned int prn_ = gnss_synchro.PRN; - if(prn_ > 32) + if (prn_ > 32) { LOG(WARNING) << "GPS satellite ID must be between 1 and 32, but PRN " << prn_ << " was found"; } @@ -3639,10 +3629,10 @@ int Rtcm::set_DF009(const Gnss_Synchro & gnss_synchro) } -int Rtcm::set_DF009(const Gps_Ephemeris & gps_eph) +int Rtcm::set_DF009(const Gps_Ephemeris& gps_eph) { unsigned int prn_ = gps_eph.i_satellite_PRN; - if(prn_ > 32) + if (prn_ > 32) { LOG(WARNING) << "GPS satellite ID must be between 1 and 32, but PRN " << prn_ << " was found"; } @@ -3658,30 +3648,30 @@ int Rtcm::set_DF010(bool code_indicator) } -int Rtcm::set_DF011(const Gnss_Synchro & gnss_synchro) +int Rtcm::set_DF011(const Gnss_Synchro& gnss_synchro) { - double ambiguity = std::floor( gnss_synchro.Pseudorange_m / 299792.458 ); - unsigned long int gps_L1_pseudorange = static_cast(std::round(( gnss_synchro.Pseudorange_m - ambiguity * 299792.458) / 0.02 )); + double ambiguity = std::floor(gnss_synchro.Pseudorange_m / 299792.458); + unsigned long int gps_L1_pseudorange = static_cast(std::round((gnss_synchro.Pseudorange_m - ambiguity * 299792.458) / 0.02)); DF011 = std::bitset<24>(gps_L1_pseudorange); return 0; } -int Rtcm::set_DF012(const Gnss_Synchro & gnss_synchro) +int Rtcm::set_DF012(const Gnss_Synchro& gnss_synchro) { const double lambda = GPS_C_m_s / GPS_L1_FREQ_HZ; - double ambiguity = std::floor( gnss_synchro.Pseudorange_m / 299792.458 ); - double gps_L1_pseudorange = std::round(( gnss_synchro.Pseudorange_m - ambiguity * 299792.458) / 0.02 ); + double ambiguity = std::floor(gnss_synchro.Pseudorange_m / 299792.458); + double gps_L1_pseudorange = std::round((gnss_synchro.Pseudorange_m - ambiguity * 299792.458) / 0.02); double gps_L1_pseudorange_c = gps_L1_pseudorange * 0.02 + ambiguity * 299792.458; double L1_phaserange_c = gnss_synchro.Carrier_phase_rads / GPS_TWO_PI; double L1_phaserange_c_r = std::fmod(L1_phaserange_c - gps_L1_pseudorange_c / lambda + 1500.0, 3000.0) - 1500.0; - long int gps_L1_phaserange_minus_L1_pseudorange = static_cast(std::round(L1_phaserange_c_r * lambda / 0.0005 )); + long int gps_L1_phaserange_minus_L1_pseudorange = static_cast(std::round(L1_phaserange_c_r * lambda / 0.0005)); DF012 = std::bitset<20>(gps_L1_phaserange_minus_L1_pseudorange); return 0; } -int Rtcm::set_DF013(const Gps_Ephemeris & eph, double obs_time, const Gnss_Synchro & gnss_synchro) +int Rtcm::set_DF013(const Gps_Ephemeris& eph, double obs_time, const Gnss_Synchro& gnss_synchro) { unsigned int lock_time_indicator; unsigned int lock_time_period_s = Rtcm::lock_time(eph, obs_time, gnss_synchro); @@ -3691,7 +3681,7 @@ int Rtcm::set_DF013(const Gps_Ephemeris & eph, double obs_time, const Gnss_Synch } -int Rtcm::set_DF014(const Gnss_Synchro & gnss_synchro) +int Rtcm::set_DF014(const Gnss_Synchro& gnss_synchro) { unsigned int gps_L1_pseudorange_ambiguity = static_cast(std::floor(gnss_synchro.Pseudorange_m / 299792.458)); DF014 = std::bitset<8>(gps_L1_pseudorange_ambiguity); @@ -3699,28 +3689,28 @@ int Rtcm::set_DF014(const Gnss_Synchro & gnss_synchro) } -int Rtcm::set_DF015(const Gnss_Synchro & gnss_synchro) +int Rtcm::set_DF015(const Gnss_Synchro& gnss_synchro) { double CN0_dB_Hz_est = gnss_synchro.CN0_dB_hz; if (CN0_dB_Hz_est > 63.75) { CN0_dB_Hz_est = 63.75; } - unsigned int CN0_dB_Hz = static_cast(std::round(CN0_dB_Hz_est / 0.25 )); + unsigned int CN0_dB_Hz = static_cast(std::round(CN0_dB_Hz_est / 0.25)); DF015 = std::bitset<8>(CN0_dB_Hz); return 0; } -int Rtcm::set_DF017(const Gnss_Synchro & gnss_synchroL1, const Gnss_Synchro & gnss_synchroL2) +int Rtcm::set_DF017(const Gnss_Synchro& gnss_synchroL1, const Gnss_Synchro& gnss_synchroL2) { - double ambiguity = std::floor( gnss_synchroL1.Pseudorange_m / 299792.458 ); - double gps_L1_pseudorange = std::round(( gnss_synchroL1.Pseudorange_m - ambiguity * 299792.458) / 0.02 ); + double ambiguity = std::floor(gnss_synchroL1.Pseudorange_m / 299792.458); + double gps_L1_pseudorange = std::round((gnss_synchroL1.Pseudorange_m - ambiguity * 299792.458) / 0.02); double gps_L1_pseudorange_c = gps_L1_pseudorange * 0.02 + ambiguity * 299792.458; double l2_l1_pseudorange = gnss_synchroL2.Pseudorange_m - gps_L1_pseudorange_c; - int pseudorange_difference = 0xFFFFE000; // invalid value; - if(std::fabs(l2_l1_pseudorange) <= 163.82) + int pseudorange_difference = 0xFFFFE000; // invalid value; + if (std::fabs(l2_l1_pseudorange) <= 163.82) { pseudorange_difference = static_cast(std::round(l2_l1_pseudorange / 0.02)); } @@ -3729,17 +3719,17 @@ int Rtcm::set_DF017(const Gnss_Synchro & gnss_synchroL1, const Gnss_Synchro & gn } -int Rtcm::set_DF018(const Gnss_Synchro & gnss_synchroL1, const Gnss_Synchro & gnss_synchroL2) +int Rtcm::set_DF018(const Gnss_Synchro& gnss_synchroL1, const Gnss_Synchro& gnss_synchroL2) { const double lambda2 = GPS_C_m_s / GPS_L2_FREQ_HZ; int l2_phaserange_minus_l1_pseudorange = 0xFFF80000; - double ambiguity = std::floor( gnss_synchroL1.Pseudorange_m / 299792.458 ); - double gps_L1_pseudorange = std::round(( gnss_synchroL1.Pseudorange_m - ambiguity * 299792.458) / 0.02 ); + double ambiguity = std::floor(gnss_synchroL1.Pseudorange_m / 299792.458); + double gps_L1_pseudorange = std::round((gnss_synchroL1.Pseudorange_m - ambiguity * 299792.458) / 0.02); double gps_L1_pseudorange_c = gps_L1_pseudorange * 0.02 + ambiguity * 299792.458; double L2_phaserange_c = gnss_synchroL2.Carrier_phase_rads / GPS_TWO_PI; double L1_phaserange_c_r = std::fmod(L2_phaserange_c - gps_L1_pseudorange_c / lambda2 + 1500.0, 3000.0) - 1500.0; - if (std::fabs(L1_phaserange_c_r * lambda2) <= 262.1435 ) + if (std::fabs(L1_phaserange_c_r * lambda2) <= 262.1435) { l2_phaserange_minus_l1_pseudorange = static_cast(std::round(L1_phaserange_c_r * lambda2 / 0.0005)); } @@ -3749,7 +3739,7 @@ int Rtcm::set_DF018(const Gnss_Synchro & gnss_synchroL1, const Gnss_Synchro & gn } -int Rtcm::set_DF019(const Gps_CNAV_Ephemeris & eph, double obs_time, const Gnss_Synchro & gnss_synchro) +int Rtcm::set_DF019(const Gps_CNAV_Ephemeris& eph, double obs_time, const Gnss_Synchro& gnss_synchro) { unsigned int lock_time_indicator; unsigned int lock_time_period_s = Rtcm::lock_time(eph, obs_time, gnss_synchro); @@ -3759,14 +3749,14 @@ int Rtcm::set_DF019(const Gps_CNAV_Ephemeris & eph, double obs_time, const Gnss_ } -int Rtcm::set_DF020(const Gnss_Synchro & gnss_synchro) +int Rtcm::set_DF020(const Gnss_Synchro& gnss_synchro) { double CN0_dB_Hz_est = gnss_synchro.CN0_dB_hz; if (CN0_dB_Hz_est > 63.75) { CN0_dB_Hz_est = 63.75; } - unsigned int CN0_dB_Hz = static_cast(std::round(CN0_dB_Hz_est / 0.25 )); + unsigned int CN0_dB_Hz = static_cast(std::round(CN0_dB_Hz_est / 0.25)); DF020 = std::bitset<8>(CN0_dB_Hz); return 0; } @@ -3802,7 +3792,7 @@ int Rtcm::set_DF024(bool galileo_indicator) int Rtcm::set_DF025(double antenna_ECEF_X_m) { - long long int ant_ref_x = static_cast(std::round( antenna_ECEF_X_m * 10000)); + long long int ant_ref_x = static_cast(std::round(antenna_ECEF_X_m * 10000)); DF025 = std::bitset<38>(ant_ref_x); return 0; } @@ -3810,7 +3800,7 @@ int Rtcm::set_DF025(double antenna_ECEF_X_m) int Rtcm::set_DF026(double antenna_ECEF_Y_m) { - long long int ant_ref_y = static_cast(std::round( antenna_ECEF_Y_m * 10000)); + long long int ant_ref_y = static_cast(std::round(antenna_ECEF_Y_m * 10000)); DF026 = std::bitset<38>(ant_ref_y); return 0; } @@ -3818,7 +3808,7 @@ int Rtcm::set_DF026(double antenna_ECEF_Y_m) int Rtcm::set_DF027(double antenna_ECEF_Z_m) { - long long int ant_ref_z = static_cast(std::round( antenna_ECEF_Z_m * 10000)); + long long int ant_ref_z = static_cast(std::round(antenna_ECEF_Z_m * 10000)); DF027 = std::bitset<38>(ant_ref_z); return 0; } @@ -3826,7 +3816,7 @@ int Rtcm::set_DF027(double antenna_ECEF_Z_m) int Rtcm::set_DF028(double height) { - unsigned int h_ = static_cast(std::round( height * 10000)); + unsigned int h_ = static_cast(std::round(height * 10000)); DF028 = std::bitset<16>(h_); return 0; } @@ -3843,7 +3833,7 @@ int Rtcm::set_DF034(double obs_time) { // TOW in milliseconds from the beginning of the GLONASS day, measured in GLONASS time unsigned long int tk = static_cast(std::round(obs_time * 1000)); - if(tk > 86400999) + if (tk > 86400999) { LOG(WARNING) << "To large GLONASS Epoch Time (tk)! Set to the last millisecond of the day"; tk = 86400999; @@ -3853,14 +3843,14 @@ int Rtcm::set_DF034(double obs_time) } -int Rtcm::set_DF035(const std::map & observables) +int Rtcm::set_DF035(const std::map& observables) { //Number of satellites observed in current epoch unsigned short int nsats = 0; std::map::const_iterator observables_iter; - for(observables_iter = observables.begin(); - observables_iter != observables.end(); - observables_iter++) + for (observables_iter = observables.begin(); + observables_iter != observables.end(); + observables_iter++) { nsats++; } @@ -3889,10 +3879,10 @@ int Rtcm::set_DF037(short int smoothing_interval) } -int Rtcm::set_DF038(const Gnss_Synchro & gnss_synchro) +int Rtcm::set_DF038(const Gnss_Synchro& gnss_synchro) { unsigned int prn_ = gnss_synchro.PRN; - if(prn_ > 24) + if (prn_ > 24) { LOG(WARNING) << "GLONASS satellite ID (Slot Number) must be between 1 and 24, but PRN " << prn_ << " was found"; } @@ -3901,10 +3891,10 @@ int Rtcm::set_DF038(const Gnss_Synchro & gnss_synchro) } -int Rtcm::set_DF038(const Glonass_Gnav_Ephemeris & glonass_gnav_eph) +int Rtcm::set_DF038(const Glonass_Gnav_Ephemeris& glonass_gnav_eph) { unsigned int prn_ = glonass_gnav_eph.i_satellite_slot_number; - if(prn_ > 24) + if (prn_ > 24) { LOG(WARNING) << "GLONASS satellite ID (Slot Number) must be between 0 and 24, but PRN " << prn_ << " was found"; } @@ -3923,7 +3913,7 @@ int Rtcm::set_DF039(bool code_indicator) int Rtcm::set_DF040(int frequency_channel_number) { unsigned int freq_ = frequency_channel_number + 7; - if(freq_ > 20) + if (freq_ > 20) { LOG(WARNING) << "GLONASS Satellite Frequency Number Conversion Error." << "Value must be between 0 and 20, but converted channel" @@ -3935,10 +3925,10 @@ int Rtcm::set_DF040(int frequency_channel_number) } -int Rtcm::set_DF040(const Glonass_Gnav_Ephemeris & glonass_gnav_eph) +int Rtcm::set_DF040(const Glonass_Gnav_Ephemeris& glonass_gnav_eph) { unsigned int freq_ = glonass_gnav_eph.i_satellite_freq_channel + 7; - if(freq_ > 20) + if (freq_ > 20) { LOG(WARNING) << "GLONASS Satellite Frequency Number Conversion Error." << "Value must be between 0 and 20, but converted channel" @@ -3950,30 +3940,30 @@ int Rtcm::set_DF040(const Glonass_Gnav_Ephemeris & glonass_gnav_eph) } -int Rtcm::set_DF041(const Gnss_Synchro & gnss_synchro) +int Rtcm::set_DF041(const Gnss_Synchro& gnss_synchro) { - double ambiguity = std::floor( gnss_synchro.Pseudorange_m / 599584.92 ); - unsigned long int glonass_L1_pseudorange = static_cast(std::round(( gnss_synchro.Pseudorange_m - ambiguity * 599584.92) / 0.02 )); + double ambiguity = std::floor(gnss_synchro.Pseudorange_m / 599584.92); + unsigned long int glonass_L1_pseudorange = static_cast(std::round((gnss_synchro.Pseudorange_m - ambiguity * 599584.92) / 0.02)); DF041 = std::bitset<25>(glonass_L1_pseudorange); return 0; } -int Rtcm::set_DF042(const Gnss_Synchro & gnss_synchro) +int Rtcm::set_DF042(const Gnss_Synchro& gnss_synchro) { - const double lambda = GLONASS_C_m_s / (GLONASS_L1_CA_FREQ_HZ + (GLONASS_L1_CA_DFREQ_HZ * GLONASS_PRN.at(gnss_synchro.PRN))); - double ambiguity = std::floor( gnss_synchro.Pseudorange_m / 599584.92 ); - double glonass_L1_pseudorange = std::round(( gnss_synchro.Pseudorange_m - ambiguity * 599584.92) / 0.02 ); + const double lambda = GLONASS_C_m_s / (GLONASS_L1_CA_FREQ_HZ + (GLONASS_L1_CA_DFREQ_HZ * GLONASS_PRN.at(gnss_synchro.PRN))); + double ambiguity = std::floor(gnss_synchro.Pseudorange_m / 599584.92); + double glonass_L1_pseudorange = std::round((gnss_synchro.Pseudorange_m - ambiguity * 599584.92) / 0.02); double glonass_L1_pseudorange_c = glonass_L1_pseudorange * 0.02 + ambiguity * 299792.458; double L1_phaserange_c = gnss_synchro.Carrier_phase_rads / GLONASS_TWO_PI; double L1_phaserange_c_r = std::fmod(L1_phaserange_c - glonass_L1_pseudorange_c / lambda + 1500.0, 3000.0) - 1500.0; - long int glonass_L1_phaserange_minus_L1_pseudorange = static_cast(std::round(L1_phaserange_c_r * lambda / 0.0005 )); + long int glonass_L1_phaserange_minus_L1_pseudorange = static_cast(std::round(L1_phaserange_c_r * lambda / 0.0005)); DF042 = std::bitset<20>(glonass_L1_phaserange_minus_L1_pseudorange); return 0; } -int Rtcm::set_DF043(const Glonass_Gnav_Ephemeris & eph, double obs_time, const Gnss_Synchro & gnss_synchro) +int Rtcm::set_DF043(const Glonass_Gnav_Ephemeris& eph, double obs_time, const Gnss_Synchro& gnss_synchro) { unsigned int lock_time_indicator; unsigned int lock_time_period_s = Rtcm::lock_time(eph, obs_time, gnss_synchro); @@ -3983,7 +3973,7 @@ int Rtcm::set_DF043(const Glonass_Gnav_Ephemeris & eph, double obs_time, const G } -int Rtcm::set_DF044(const Gnss_Synchro & gnss_synchro) +int Rtcm::set_DF044(const Gnss_Synchro& gnss_synchro) { unsigned int glonass_L1_pseudorange_ambiguity = static_cast(std::floor(gnss_synchro.Pseudorange_m / 599584.916)); DF044 = std::bitset<7>(glonass_L1_pseudorange_ambiguity); @@ -3991,7 +3981,7 @@ int Rtcm::set_DF044(const Gnss_Synchro & gnss_synchro) } -int Rtcm::set_DF045(const Gnss_Synchro & gnss_synchro) +int Rtcm::set_DF045(const Gnss_Synchro& gnss_synchro) { double CN0_dB_Hz_est = gnss_synchro.CN0_dB_hz; if (CN0_dB_Hz_est > 63.75) @@ -3999,21 +3989,21 @@ int Rtcm::set_DF045(const Gnss_Synchro & gnss_synchro) LOG(WARNING) << "GLONASS L1 CNR must be between 0 and 63.75, but CNR " << CN0_dB_Hz_est << " was found. Setting to 63.75 dB-Hz"; CN0_dB_Hz_est = 63.75; } - unsigned int CN0_dB_Hz = static_cast(std::round(CN0_dB_Hz_est / 0.25 )); + unsigned int CN0_dB_Hz = static_cast(std::round(CN0_dB_Hz_est / 0.25)); DF045 = std::bitset<8>(CN0_dB_Hz); return 0; } -int Rtcm::set_DF047(const Gnss_Synchro & gnss_synchroL1, const Gnss_Synchro & gnss_synchroL2) +int Rtcm::set_DF047(const Gnss_Synchro& gnss_synchroL1, const Gnss_Synchro& gnss_synchroL2) { - double ambiguity = std::floor( gnss_synchroL1.Pseudorange_m / 599584.92 ); - double glonass_L1_pseudorange = std::round(( gnss_synchroL1.Pseudorange_m - ambiguity * 599584.92) / 0.02 ); + double ambiguity = std::floor(gnss_synchroL1.Pseudorange_m / 599584.92); + double glonass_L1_pseudorange = std::round((gnss_synchroL1.Pseudorange_m - ambiguity * 599584.92) / 0.02); double glonass_L1_pseudorange_c = glonass_L1_pseudorange * 0.02 + ambiguity * 599584.92; double l2_l1_pseudorange = gnss_synchroL2.Pseudorange_m - glonass_L1_pseudorange_c; - int pseudorange_difference = 0xFFFFE000; // invalid value; - if(std::fabs(l2_l1_pseudorange) <= 163.82) + int pseudorange_difference = 0xFFFFE000; // invalid value; + if (std::fabs(l2_l1_pseudorange) <= 163.82) { pseudorange_difference = static_cast(std::round(l2_l1_pseudorange / 0.02)); } @@ -4022,17 +4012,17 @@ int Rtcm::set_DF047(const Gnss_Synchro & gnss_synchroL1, const Gnss_Synchro & gn } //TODO Need to consider frequency channel in this fields -int Rtcm::set_DF048(const Gnss_Synchro & gnss_synchroL1, const Gnss_Synchro & gnss_synchroL2) +int Rtcm::set_DF048(const Gnss_Synchro& gnss_synchroL1, const Gnss_Synchro& gnss_synchroL2) { const double lambda2 = GLONASS_C_m_s / GLONASS_L2_FREQ_HZ; int l2_phaserange_minus_l1_pseudorange = 0xFFF80000; - double ambiguity = std::floor( gnss_synchroL1.Pseudorange_m / 599584.92 ); - double glonass_L1_pseudorange = std::round(( gnss_synchroL1.Pseudorange_m - ambiguity * 599584.92) / 0.02 ); + double ambiguity = std::floor(gnss_synchroL1.Pseudorange_m / 599584.92); + double glonass_L1_pseudorange = std::round((gnss_synchroL1.Pseudorange_m - ambiguity * 599584.92) / 0.02); double glonass_L1_pseudorange_c = glonass_L1_pseudorange * 0.02 + ambiguity * 599584.92; double L2_phaserange_c = gnss_synchroL2.Carrier_phase_rads / GLONASS_TWO_PI; double L1_phaserange_c_r = std::fmod(L2_phaserange_c - glonass_L1_pseudorange_c / lambda2 + 1500.0, 3000.0) - 1500.0; - if (std::fabs(L1_phaserange_c_r * lambda2) <= 262.1435 ) + if (std::fabs(L1_phaserange_c_r * lambda2) <= 262.1435) { l2_phaserange_minus_l1_pseudorange = static_cast(std::round(L1_phaserange_c_r * lambda2 / 0.0005)); } @@ -4042,7 +4032,7 @@ int Rtcm::set_DF048(const Gnss_Synchro & gnss_synchroL1, const Gnss_Synchro & gn } -int Rtcm::set_DF049(const Glonass_Gnav_Ephemeris & eph, double obs_time, const Gnss_Synchro & gnss_synchro) +int Rtcm::set_DF049(const Glonass_Gnav_Ephemeris& eph, double obs_time, const Gnss_Synchro& gnss_synchro) { unsigned int lock_time_indicator; unsigned int lock_time_period_s = Rtcm::lock_time(eph, obs_time, gnss_synchro); @@ -4052,20 +4042,20 @@ int Rtcm::set_DF049(const Glonass_Gnav_Ephemeris & eph, double obs_time, const G } -int Rtcm::set_DF050(const Gnss_Synchro & gnss_synchro) +int Rtcm::set_DF050(const Gnss_Synchro& gnss_synchro) { double CN0_dB_Hz_est = gnss_synchro.CN0_dB_hz; if (CN0_dB_Hz_est > 63.75) { CN0_dB_Hz_est = 63.75; } - unsigned int CN0_dB_Hz = static_cast(std::round(CN0_dB_Hz_est / 0.25 )); + unsigned int CN0_dB_Hz = static_cast(std::round(CN0_dB_Hz_est / 0.25)); DF050 = std::bitset<8>(CN0_dB_Hz); return 0; } -int Rtcm::set_DF051(const Gps_Ephemeris & gps_eph, double obs_time) +int Rtcm::set_DF051(const Gps_Ephemeris& gps_eph, double obs_time) { const double gps_t = obs_time; boost::posix_time::time_duration t = boost::posix_time::millisec((gps_t + 604800 * static_cast(gps_eph.i_GPS_week % 1024)) * 1000); @@ -4079,7 +4069,7 @@ int Rtcm::set_DF051(const Gps_Ephemeris & gps_eph, double obs_time) } -int Rtcm::set_DF052(const Gps_Ephemeris & gps_eph, double obs_time) +int Rtcm::set_DF052(const Gps_Ephemeris& gps_eph, double obs_time) { const double gps_t = obs_time; boost::posix_time::time_duration t = boost::posix_time::millisec((gps_t + 604800 * static_cast(gps_eph.i_GPS_week % 1024)) * 1000); @@ -4095,7 +4085,7 @@ int Rtcm::set_DF052(const Gps_Ephemeris & gps_eph, double obs_time) } -int Rtcm::set_DF071(const Gps_Ephemeris & gps_eph) +int Rtcm::set_DF071(const Gps_Ephemeris& gps_eph) { unsigned int iode = static_cast(gps_eph.d_IODE_SF2); DF071 = std::bitset<8>(iode); @@ -4103,7 +4093,7 @@ int Rtcm::set_DF071(const Gps_Ephemeris & gps_eph) } -int Rtcm::set_DF076(const Gps_Ephemeris & gps_eph) +int Rtcm::set_DF076(const Gps_Ephemeris& gps_eph) { unsigned int week_number = static_cast(gps_eph.i_GPS_week); DF076 = std::bitset<10>(week_number); @@ -4111,7 +4101,7 @@ int Rtcm::set_DF076(const Gps_Ephemeris & gps_eph) } -int Rtcm::set_DF077(const Gps_Ephemeris & gps_eph) +int Rtcm::set_DF077(const Gps_Ephemeris& gps_eph) { unsigned short int ura = static_cast(gps_eph.i_SV_accuracy); DF077 = std::bitset<4>(ura); @@ -4119,7 +4109,7 @@ int Rtcm::set_DF077(const Gps_Ephemeris & gps_eph) } -int Rtcm::set_DF078(const Gps_Ephemeris & gps_eph) +int Rtcm::set_DF078(const Gps_Ephemeris& gps_eph) { unsigned short int code_on_L2 = static_cast(gps_eph.i_code_on_L2); DF078 = std::bitset<2>(code_on_L2); @@ -4127,15 +4117,15 @@ int Rtcm::set_DF078(const Gps_Ephemeris & gps_eph) } -int Rtcm::set_DF079(const Gps_Ephemeris & gps_eph) +int Rtcm::set_DF079(const Gps_Ephemeris& gps_eph) { - unsigned int idot = static_cast(std::round(gps_eph.d_IDOT / I_DOT_LSB )); + unsigned int idot = static_cast(std::round(gps_eph.d_IDOT / I_DOT_LSB)); DF079 = std::bitset<14>(idot); return 0; } -int Rtcm::set_DF080(const Gps_Ephemeris & gps_eph) +int Rtcm::set_DF080(const Gps_Ephemeris& gps_eph) { unsigned short int iode = static_cast(gps_eph.d_IODE_SF2); DF080 = std::bitset<8>(iode); @@ -4143,39 +4133,39 @@ int Rtcm::set_DF080(const Gps_Ephemeris & gps_eph) } -int Rtcm::set_DF081(const Gps_Ephemeris & gps_eph) +int Rtcm::set_DF081(const Gps_Ephemeris& gps_eph) { - unsigned int toc = static_cast(std::round(gps_eph.d_Toc / T_OC_LSB )); + unsigned int toc = static_cast(std::round(gps_eph.d_Toc / T_OC_LSB)); DF081 = std::bitset<16>(toc); return 0; } -int Rtcm::set_DF082(const Gps_Ephemeris & gps_eph) +int Rtcm::set_DF082(const Gps_Ephemeris& gps_eph) { - short int af2 = static_cast(std::round(gps_eph.d_A_f2 / A_F2_LSB )); + short int af2 = static_cast(std::round(gps_eph.d_A_f2 / A_F2_LSB)); DF082 = std::bitset<8>(af2); return 0; } -int Rtcm::set_DF083(const Gps_Ephemeris & gps_eph) +int Rtcm::set_DF083(const Gps_Ephemeris& gps_eph) { - int af1 = static_cast(std::round(gps_eph.d_A_f1 / A_F1_LSB )); + int af1 = static_cast(std::round(gps_eph.d_A_f1 / A_F1_LSB)); DF083 = std::bitset<16>(af1); return 0; } -int Rtcm::set_DF084(const Gps_Ephemeris & gps_eph) +int Rtcm::set_DF084(const Gps_Ephemeris& gps_eph) { - long int af0 = static_cast(std::round(gps_eph.d_A_f0 / A_F0_LSB )); + long int af0 = static_cast(std::round(gps_eph.d_A_f0 / A_F0_LSB)); DF084 = std::bitset<22>(af0); return 0; } -int Rtcm::set_DF085(const Gps_Ephemeris & gps_eph) +int Rtcm::set_DF085(const Gps_Ephemeris& gps_eph) { unsigned int iodc = static_cast(gps_eph.d_IODC); DF085 = std::bitset<10>(iodc); @@ -4183,134 +4173,134 @@ int Rtcm::set_DF085(const Gps_Ephemeris & gps_eph) } -int Rtcm::set_DF086(const Gps_Ephemeris & gps_eph) +int Rtcm::set_DF086(const Gps_Ephemeris& gps_eph) { - int crs = static_cast(std::round(gps_eph.d_Crs / C_RS_LSB )); + int crs = static_cast(std::round(gps_eph.d_Crs / C_RS_LSB)); DF086 = std::bitset<16>(crs); return 0; } -int Rtcm::set_DF087(const Gps_Ephemeris & gps_eph) +int Rtcm::set_DF087(const Gps_Ephemeris& gps_eph) { - int delta_n = static_cast(std::round(gps_eph.d_Delta_n / DELTA_N_LSB )); + int delta_n = static_cast(std::round(gps_eph.d_Delta_n / DELTA_N_LSB)); DF087 = std::bitset<16>(delta_n); return 0; } -int Rtcm::set_DF088(const Gps_Ephemeris & gps_eph) +int Rtcm::set_DF088(const Gps_Ephemeris& gps_eph) { - long int m0 = static_cast(std::round(gps_eph.d_M_0 / M_0_LSB )); + long int m0 = static_cast(std::round(gps_eph.d_M_0 / M_0_LSB)); DF088 = std::bitset<32>(m0); return 0; } -int Rtcm::set_DF089(const Gps_Ephemeris & gps_eph) +int Rtcm::set_DF089(const Gps_Ephemeris& gps_eph) { - int cuc = static_cast(std::round(gps_eph.d_Cuc / C_UC_LSB )); + int cuc = static_cast(std::round(gps_eph.d_Cuc / C_UC_LSB)); DF089 = std::bitset<16>(cuc); return 0; } -int Rtcm::set_DF090(const Gps_Ephemeris & gps_eph) +int Rtcm::set_DF090(const Gps_Ephemeris& gps_eph) { - unsigned long int ecc = static_cast(std::round(gps_eph.d_e_eccentricity / E_LSB )); + unsigned long int ecc = static_cast(std::round(gps_eph.d_e_eccentricity / E_LSB)); DF090 = std::bitset<32>(ecc); return 0; } -int Rtcm::set_DF091(const Gps_Ephemeris & gps_eph) +int Rtcm::set_DF091(const Gps_Ephemeris& gps_eph) { - int cus = static_cast(std::round(gps_eph.d_Cus / C_US_LSB )); + int cus = static_cast(std::round(gps_eph.d_Cus / C_US_LSB)); DF091 = std::bitset<16>(cus); return 0; } -int Rtcm::set_DF092(const Gps_Ephemeris & gps_eph) +int Rtcm::set_DF092(const Gps_Ephemeris& gps_eph) { - unsigned long int sqr_a = static_cast(std::round(gps_eph.d_sqrt_A / SQRT_A_LSB )); + unsigned long int sqr_a = static_cast(std::round(gps_eph.d_sqrt_A / SQRT_A_LSB)); DF092 = std::bitset<32>(sqr_a); return 0; } -int Rtcm::set_DF093(const Gps_Ephemeris & gps_eph) +int Rtcm::set_DF093(const Gps_Ephemeris& gps_eph) { - unsigned int toe = static_cast(std::round(gps_eph.d_Toe / T_OE_LSB )); + unsigned int toe = static_cast(std::round(gps_eph.d_Toe / T_OE_LSB)); DF093 = std::bitset<16>(toe); return 0; } -int Rtcm::set_DF094(const Gps_Ephemeris & gps_eph) +int Rtcm::set_DF094(const Gps_Ephemeris& gps_eph) { - int cic = static_cast(std::round(gps_eph.d_Cic / C_IC_LSB )); + int cic = static_cast(std::round(gps_eph.d_Cic / C_IC_LSB)); DF094 = std::bitset<16>(cic); return 0; } -int Rtcm::set_DF095(const Gps_Ephemeris & gps_eph) +int Rtcm::set_DF095(const Gps_Ephemeris& gps_eph) { - long int Omega0 = static_cast(std::round(gps_eph.d_OMEGA0 / OMEGA_0_LSB )); + long int Omega0 = static_cast(std::round(gps_eph.d_OMEGA0 / OMEGA_0_LSB)); DF095 = std::bitset<32>(Omega0); return 0; } -int Rtcm::set_DF096(const Gps_Ephemeris & gps_eph) +int Rtcm::set_DF096(const Gps_Ephemeris& gps_eph) { - int cis = static_cast(std::round(gps_eph.d_Cis / C_IS_LSB )); + int cis = static_cast(std::round(gps_eph.d_Cis / C_IS_LSB)); DF096 = std::bitset<16>(cis); return 0; } -int Rtcm::set_DF097(const Gps_Ephemeris & gps_eph) +int Rtcm::set_DF097(const Gps_Ephemeris& gps_eph) { - long int i0 = static_cast(std::round(gps_eph.d_i_0 / I_0_LSB )); + long int i0 = static_cast(std::round(gps_eph.d_i_0 / I_0_LSB)); DF097 = std::bitset<32>(i0); return 0; } -int Rtcm::set_DF098(const Gps_Ephemeris & gps_eph) +int Rtcm::set_DF098(const Gps_Ephemeris& gps_eph) { - int crc = static_cast(std::round(gps_eph.d_Crc / C_RC_LSB )); + int crc = static_cast(std::round(gps_eph.d_Crc / C_RC_LSB)); DF098 = std::bitset<16>(crc); return 0; } -int Rtcm::set_DF099(const Gps_Ephemeris & gps_eph) +int Rtcm::set_DF099(const Gps_Ephemeris& gps_eph) { - long int omega = static_cast(std::round(gps_eph.d_OMEGA / OMEGA_LSB )); + long int omega = static_cast(std::round(gps_eph.d_OMEGA / OMEGA_LSB)); DF099 = std::bitset<32>(omega); return 0; } -int Rtcm::set_DF100(const Gps_Ephemeris & gps_eph) +int Rtcm::set_DF100(const Gps_Ephemeris& gps_eph) { - long int omegadot = static_cast(std::round(gps_eph.d_OMEGA_DOT / OMEGA_DOT_LSB )); + long int omegadot = static_cast(std::round(gps_eph.d_OMEGA_DOT / OMEGA_DOT_LSB)); DF100 = std::bitset<24>(omegadot); return 0; } -int Rtcm::set_DF101(const Gps_Ephemeris & gps_eph) +int Rtcm::set_DF101(const Gps_Ephemeris& gps_eph) { - short int tgd = static_cast(std::round(gps_eph.d_TGD / T_GD_LSB )); + short int tgd = static_cast(std::round(gps_eph.d_TGD / T_GD_LSB)); DF101 = std::bitset<8>(tgd); return 0; } -int Rtcm::set_DF102(const Gps_Ephemeris & gps_eph) +int Rtcm::set_DF102(const Gps_Ephemeris& gps_eph) { unsigned short int sv_heath = static_cast(gps_eph.i_SV_health); DF102 = std::bitset<6>(sv_heath); @@ -4318,7 +4308,7 @@ int Rtcm::set_DF102(const Gps_Ephemeris & gps_eph) } -int Rtcm::set_DF103(const Gps_Ephemeris & gps_eph) +int Rtcm::set_DF103(const Gps_Ephemeris& gps_eph) { DF103 = std::bitset<1>(gps_eph.b_L2_P_data_flag); return 0; @@ -4339,162 +4329,159 @@ int Rtcm::set_DF105(unsigned int glonass_gnav_alm_health_ind) } -int Rtcm::set_DF106(const Glonass_Gnav_Ephemeris & glonass_gnav_eph) +int Rtcm::set_DF106(const Glonass_Gnav_Ephemeris& glonass_gnav_eph) { // Convert the value from (15, 30, 45, 60) to (00, 01, 10, 11) - unsigned int P_1 = static_cast(std::round(glonass_gnav_eph.d_P_1/15.0 -1.0)); + unsigned int P_1 = static_cast(std::round(glonass_gnav_eph.d_P_1 / 15.0 - 1.0)); DF106 = std::bitset<2>(P_1); return 0; } -int Rtcm::set_DF107(const Glonass_Gnav_Ephemeris & glonass_gnav_eph) +int Rtcm::set_DF107(const Glonass_Gnav_Ephemeris& glonass_gnav_eph) { - unsigned int hrs = 0; - unsigned int min = 0; - unsigned int sec = 0; - unsigned int tk = 0; - tk = static_cast(glonass_gnav_eph.d_t_k); - hrs = tk/3600; - min = (tk - hrs*3600)/60; - sec = (tk - hrs*3600 -min*60)/60; + unsigned int hrs = 0; + unsigned int min = 0; + unsigned int sec = 0; + unsigned int tk = 0; + tk = static_cast(glonass_gnav_eph.d_t_k); + hrs = tk / 3600; + min = (tk - hrs * 3600) / 60; + sec = (tk - hrs * 3600 - min * 60) / 60; - std::string _hrs = std::bitset< 5 >( hrs ).to_string(); // string conversion - std::string _min = std::bitset< 6 >( min ).to_string(); // string conversion - std::string _sec = std::bitset< 1 >( sec ).to_string(); // string conversion + std::string _hrs = std::bitset<5>(hrs).to_string(); // string conversion + std::string _min = std::bitset<6>(min).to_string(); // string conversion + std::string _sec = std::bitset<1>(sec).to_string(); // string conversion - // Set hrs, min, sec in designed bit positions - DF107 = std::bitset<12>(_hrs + _min + _sec); + // Set hrs, min, sec in designed bit positions + DF107 = std::bitset<12>(_hrs + _min + _sec); return 0; } -int Rtcm::set_DF108(const Glonass_Gnav_Ephemeris & glonass_gnav_eph) +int Rtcm::set_DF108(const Glonass_Gnav_Ephemeris& glonass_gnav_eph) { DF108 = std::bitset<1>(glonass_gnav_eph.d_B_n); return 0; } -int Rtcm::set_DF109(const Glonass_Gnav_Ephemeris & glonass_gnav_eph) +int Rtcm::set_DF109(const Glonass_Gnav_Ephemeris& glonass_gnav_eph) { DF109 = std::bitset<1>(glonass_gnav_eph.d_P_2); return 0; } -int Rtcm::set_DF110(const Glonass_Gnav_Ephemeris & glonass_gnav_eph) +int Rtcm::set_DF110(const Glonass_Gnav_Ephemeris& glonass_gnav_eph) { - unsigned int t_b = static_cast(std::round(glonass_gnav_eph.d_t_b/(15*60))); + unsigned int t_b = static_cast(std::round(glonass_gnav_eph.d_t_b / (15 * 60))); DF110 = std::bitset<7>(t_b); return 0; } -int Rtcm::set_DF111(const Glonass_Gnav_Ephemeris & glonass_gnav_eph) +int Rtcm::set_DF111(const Glonass_Gnav_Ephemeris& glonass_gnav_eph) { - int VXn_mag = static_cast(std::round(fabs(glonass_gnav_eph.d_VXn/TWO_N20))); + int VXn_mag = static_cast(std::round(fabs(glonass_gnav_eph.d_VXn / TWO_N20))); unsigned int VXn_sgn = glo_sgn(glonass_gnav_eph.d_VXn); DF111 = std::bitset<24>(VXn_mag); - DF111.set(23,VXn_sgn); + DF111.set(23, VXn_sgn); return 0; } -int Rtcm::set_DF112(const Glonass_Gnav_Ephemeris & glonass_gnav_eph) +int Rtcm::set_DF112(const Glonass_Gnav_Ephemeris& glonass_gnav_eph) { - int Xn_mag = static_cast(std::round(fabs(glonass_gnav_eph.d_Xn/TWO_N11))); + int Xn_mag = static_cast(std::round(fabs(glonass_gnav_eph.d_Xn / TWO_N11))); unsigned int Xn_sgn = glo_sgn(glonass_gnav_eph.d_Xn); DF112 = std::bitset<27>(Xn_mag); - DF112.set(26,Xn_sgn); + DF112.set(26, Xn_sgn); return 0; } -int Rtcm::set_DF113(const Glonass_Gnav_Ephemeris & glonass_gnav_eph) +int Rtcm::set_DF113(const Glonass_Gnav_Ephemeris& glonass_gnav_eph) { - int AXn_mag = static_cast(std::round(fabs(glonass_gnav_eph.d_AXn/TWO_N30))); + int AXn_mag = static_cast(std::round(fabs(glonass_gnav_eph.d_AXn / TWO_N30))); unsigned int AXn_sgn = glo_sgn(glonass_gnav_eph.d_AXn); DF113 = std::bitset<5>(AXn_mag); - DF113.set(4,AXn_sgn); + DF113.set(4, AXn_sgn); return 0; } -int Rtcm::set_DF114(const Glonass_Gnav_Ephemeris & glonass_gnav_eph) +int Rtcm::set_DF114(const Glonass_Gnav_Ephemeris& glonass_gnav_eph) { - int VYn_mag = static_cast(std::round(fabs(glonass_gnav_eph.d_VYn/TWO_N20))); + int VYn_mag = static_cast(std::round(fabs(glonass_gnav_eph.d_VYn / TWO_N20))); unsigned int VYn_sgn = glo_sgn(glonass_gnav_eph.d_VYn); DF114 = std::bitset<24>(VYn_mag); - DF114.set(23,VYn_sgn); + DF114.set(23, VYn_sgn); return 0; } -int Rtcm::set_DF115(const Glonass_Gnav_Ephemeris & glonass_gnav_eph) +int Rtcm::set_DF115(const Glonass_Gnav_Ephemeris& glonass_gnav_eph) { - int Yn_mag = static_cast(std::round(fabs(glonass_gnav_eph.d_Yn/TWO_N11))); + int Yn_mag = static_cast(std::round(fabs(glonass_gnav_eph.d_Yn / TWO_N11))); unsigned int Yn_sgn = glo_sgn(glonass_gnav_eph.d_Yn); DF115 = std::bitset<27>(Yn_mag); - DF115.set(26,Yn_sgn); + DF115.set(26, Yn_sgn); return 0; } -int Rtcm::set_DF116(const Glonass_Gnav_Ephemeris & glonass_gnav_eph) +int Rtcm::set_DF116(const Glonass_Gnav_Ephemeris& glonass_gnav_eph) { - int AYn_mag = static_cast(std::round(fabs(glonass_gnav_eph.d_AYn/TWO_N30))); + int AYn_mag = static_cast(std::round(fabs(glonass_gnav_eph.d_AYn / TWO_N30))); unsigned int AYn_sgn = glo_sgn(glonass_gnav_eph.d_AYn); DF116 = std::bitset<5>(AYn_mag); - DF116.set(4,AYn_sgn); + DF116.set(4, AYn_sgn); return 0; } - -int Rtcm::set_DF117(const Glonass_Gnav_Ephemeris & glonass_gnav_eph) +int Rtcm::set_DF117(const Glonass_Gnav_Ephemeris& glonass_gnav_eph) { - int VZn_mag = static_cast(std::round(fabs(glonass_gnav_eph.d_VZn/TWO_N20))); + int VZn_mag = static_cast(std::round(fabs(glonass_gnav_eph.d_VZn / TWO_N20))); unsigned int VZn_sgn = glo_sgn(glonass_gnav_eph.d_VZn); DF117 = std::bitset<24>(VZn_mag); - DF117.set(23,VZn_sgn); + DF117.set(23, VZn_sgn); return 0; } - -int Rtcm::set_DF118(const Glonass_Gnav_Ephemeris & glonass_gnav_eph) +int Rtcm::set_DF118(const Glonass_Gnav_Ephemeris& glonass_gnav_eph) { - int Zn_mag = static_cast(std::round(fabs(glonass_gnav_eph.d_Zn/TWO_N11))); + int Zn_mag = static_cast(std::round(fabs(glonass_gnav_eph.d_Zn / TWO_N11))); unsigned int Zn_sgn = glo_sgn(glonass_gnav_eph.d_Zn); DF118 = std::bitset<27>(Zn_mag); - DF118.set(26,Zn_sgn); + DF118.set(26, Zn_sgn); return 0; } - -int Rtcm::set_DF119(const Glonass_Gnav_Ephemeris & glonass_gnav_eph) +int Rtcm::set_DF119(const Glonass_Gnav_Ephemeris& glonass_gnav_eph) { - int AZn_mag = static_cast(std::round(fabs(glonass_gnav_eph.d_AZn/TWO_N30))); + int AZn_mag = static_cast(std::round(fabs(glonass_gnav_eph.d_AZn / TWO_N30))); unsigned int AZn_sgn = glo_sgn(glonass_gnav_eph.d_AZn); DF119 = std::bitset<5>(AZn_mag); - DF119.set(4,AZn_sgn); + DF119.set(4, AZn_sgn); return 0; } -int Rtcm::set_DF120(const Glonass_Gnav_Ephemeris & glonass_gnav_eph) +int Rtcm::set_DF120(const Glonass_Gnav_Ephemeris& glonass_gnav_eph) { unsigned int P3 = static_cast(std::round(glonass_gnav_eph.d_P_3)); DF120 = std::bitset<1>(P3); @@ -4502,18 +4489,18 @@ int Rtcm::set_DF120(const Glonass_Gnav_Ephemeris & glonass_gnav_eph) } -int Rtcm::set_DF121(const Glonass_Gnav_Ephemeris & glonass_gnav_eph) +int Rtcm::set_DF121(const Glonass_Gnav_Ephemeris& glonass_gnav_eph) { - int gamma_mag = static_cast(std::round(fabs(glonass_gnav_eph.d_gamma_n/TWO_N40))); + int gamma_mag = static_cast(std::round(fabs(glonass_gnav_eph.d_gamma_n / TWO_N40))); unsigned int gamma_sgn = glo_sgn(glonass_gnav_eph.d_gamma_n); DF121 = std::bitset<11>(gamma_mag); - DF121.set(10,gamma_sgn); + DF121.set(10, gamma_sgn); return 0; } -int Rtcm::set_DF122(const Glonass_Gnav_Ephemeris & glonass_gnav_eph) +int Rtcm::set_DF122(const Glonass_Gnav_Ephemeris& glonass_gnav_eph) { unsigned int P = static_cast(std::round(glonass_gnav_eph.d_P)); DF122 = std::bitset<2>(P); @@ -4521,7 +4508,7 @@ int Rtcm::set_DF122(const Glonass_Gnav_Ephemeris & glonass_gnav_eph) } -int Rtcm::set_DF123(const Glonass_Gnav_Ephemeris & glonass_gnav_eph) +int Rtcm::set_DF123(const Glonass_Gnav_Ephemeris& glonass_gnav_eph) { unsigned int ln = static_cast((glonass_gnav_eph.d_l3rd_n)); DF123 = std::bitset<1>(ln); @@ -4529,29 +4516,29 @@ int Rtcm::set_DF123(const Glonass_Gnav_Ephemeris & glonass_gnav_eph) } -int Rtcm::set_DF124(const Glonass_Gnav_Ephemeris & glonass_gnav_eph) +int Rtcm::set_DF124(const Glonass_Gnav_Ephemeris& glonass_gnav_eph) { - int tau_mag = static_cast(std::round(fabs(glonass_gnav_eph.d_tau_n/TWO_N30))); + int tau_mag = static_cast(std::round(fabs(glonass_gnav_eph.d_tau_n / TWO_N30))); unsigned int tau_sgn = glo_sgn(glonass_gnav_eph.d_tau_n); DF124 = std::bitset<22>(tau_mag); - DF124.set(21,tau_sgn); + DF124.set(21, tau_sgn); return 0; } -int Rtcm::set_DF125(const Glonass_Gnav_Ephemeris & glonass_gnav_eph) +int Rtcm::set_DF125(const Glonass_Gnav_Ephemeris& glonass_gnav_eph) { - int delta_tau_mag = static_cast(std::round(fabs(glonass_gnav_eph.d_Delta_tau_n/TWO_N30))); + int delta_tau_mag = static_cast(std::round(fabs(glonass_gnav_eph.d_Delta_tau_n / TWO_N30))); unsigned int delta_tau_sgn = glo_sgn(glonass_gnav_eph.d_Delta_tau_n); DF125 = std::bitset<5>(delta_tau_mag); - DF125.set(4,delta_tau_sgn); + DF125.set(4, delta_tau_sgn); return 0; } -int Rtcm::set_DF126(const Glonass_Gnav_Ephemeris & glonass_gnav_eph) +int Rtcm::set_DF126(const Glonass_Gnav_Ephemeris& glonass_gnav_eph) { unsigned int ecc = static_cast(std::round(glonass_gnav_eph.d_E_n)); DF126 = std::bitset<5>(ecc); @@ -4559,15 +4546,15 @@ int Rtcm::set_DF126(const Glonass_Gnav_Ephemeris & glonass_gnav_eph) } -int Rtcm::set_DF127(const Glonass_Gnav_Ephemeris & glonass_gnav_eph) +int Rtcm::set_DF127(const Glonass_Gnav_Ephemeris& glonass_gnav_eph) { - unsigned int P4= static_cast(std::round(glonass_gnav_eph.d_P_4)); + unsigned int P4 = static_cast(std::round(glonass_gnav_eph.d_P_4)); DF127 = std::bitset<1>(P4); return 0; } -int Rtcm::set_DF128(const Glonass_Gnav_Ephemeris & glonass_gnav_eph) +int Rtcm::set_DF128(const Glonass_Gnav_Ephemeris& glonass_gnav_eph) { unsigned int F_t = static_cast(std::round(glonass_gnav_eph.d_F_T)); DF128 = std::bitset<4>(F_t); @@ -4575,7 +4562,7 @@ int Rtcm::set_DF128(const Glonass_Gnav_Ephemeris & glonass_gnav_eph) } -int Rtcm::set_DF129(const Glonass_Gnav_Ephemeris & glonass_gnav_eph) +int Rtcm::set_DF129(const Glonass_Gnav_Ephemeris& glonass_gnav_eph) { unsigned int N_t = static_cast(std::round(glonass_gnav_eph.d_N_T)); DF129 = std::bitset<11>(N_t); @@ -4583,7 +4570,7 @@ int Rtcm::set_DF129(const Glonass_Gnav_Ephemeris & glonass_gnav_eph) } -int Rtcm::set_DF130(const Glonass_Gnav_Ephemeris & glonass_gnav_eph) +int Rtcm::set_DF130(const Glonass_Gnav_Ephemeris& glonass_gnav_eph) { unsigned int M = static_cast(std::round(glonass_gnav_eph.d_M)); DF130 = std::bitset<2>(M); @@ -4599,7 +4586,7 @@ int Rtcm::set_DF131(unsigned int fifth_str_additional_data_ind) } -int Rtcm::set_DF132(const Glonass_Gnav_Utc_Model & glonass_gnav_utc_model) +int Rtcm::set_DF132(const Glonass_Gnav_Utc_Model& glonass_gnav_utc_model) { unsigned int N_A = static_cast(std::round(glonass_gnav_utc_model.d_N_A)); DF132 = std::bitset<11>(N_A); @@ -4607,15 +4594,15 @@ int Rtcm::set_DF132(const Glonass_Gnav_Utc_Model & glonass_gnav_utc_model) } -int Rtcm::set_DF133(const Glonass_Gnav_Utc_Model & glonass_gnav_utc_model) +int Rtcm::set_DF133(const Glonass_Gnav_Utc_Model& glonass_gnav_utc_model) { - int tau_c = static_cast(std::round(glonass_gnav_utc_model.d_tau_c/TWO_N31)); + int tau_c = static_cast(std::round(glonass_gnav_utc_model.d_tau_c / TWO_N31)); DF133 = std::bitset<32>(tau_c); return 0; } -int Rtcm::set_DF134(const Glonass_Gnav_Utc_Model & glonass_gnav_utc_model) +int Rtcm::set_DF134(const Glonass_Gnav_Utc_Model& glonass_gnav_utc_model) { unsigned int N_4 = static_cast(std::round(glonass_gnav_utc_model.d_N_4)); DF134 = std::bitset<5>(N_4); @@ -4623,15 +4610,15 @@ int Rtcm::set_DF134(const Glonass_Gnav_Utc_Model & glonass_gnav_utc_model) } -int Rtcm::set_DF135(const Glonass_Gnav_Utc_Model & glonass_gnav_utc_model) +int Rtcm::set_DF135(const Glonass_Gnav_Utc_Model& glonass_gnav_utc_model) { - int tau_gps = static_cast(std::round(glonass_gnav_utc_model.d_tau_gps)/TWO_N30); + int tau_gps = static_cast(std::round(glonass_gnav_utc_model.d_tau_gps) / TWO_N30); DF135 = std::bitset<22>(tau_gps); return 0; } -int Rtcm::set_DF136(const Glonass_Gnav_Ephemeris & glonass_gnav_eph) +int Rtcm::set_DF136(const Glonass_Gnav_Ephemeris& glonass_gnav_eph) { unsigned int l_n = static_cast(std::round(glonass_gnav_eph.d_l5th_n)); DF136 = std::bitset<1>(l_n); @@ -4639,7 +4626,7 @@ int Rtcm::set_DF136(const Glonass_Gnav_Ephemeris & glonass_gnav_eph) } -int Rtcm::set_DF137(const Gps_Ephemeris & gps_eph) +int Rtcm::set_DF137(const Gps_Ephemeris& gps_eph) { DF137 = std::bitset<1>(gps_eph.b_fit_interval_flag); return 0; @@ -4650,7 +4637,7 @@ int Rtcm::set_DF248(double obs_time) { // TOW in milliseconds from the beginning of the Galileo week, measured in Galileo time unsigned long int tow = static_cast(std::round(obs_time * 1000)); - if(tow > 604799999) + if (tow > 604799999) { LOG(WARNING) << "To large TOW! Set to the last millisecond of the week"; tow = 604799999; @@ -4660,10 +4647,10 @@ int Rtcm::set_DF248(double obs_time) } -int Rtcm::set_DF252(const Galileo_Ephemeris & gal_eph) +int Rtcm::set_DF252(const Galileo_Ephemeris& gal_eph) { unsigned int prn_ = gal_eph.i_satellite_PRN; - if(prn_ > 63) + if (prn_ > 63) { LOG(WARNING) << "Galileo satellite ID must be between 0 and 63, but PRN " << prn_ << " was found"; } @@ -4672,10 +4659,10 @@ int Rtcm::set_DF252(const Galileo_Ephemeris & gal_eph) } -int Rtcm::set_DF289(const Galileo_Ephemeris & gal_eph) +int Rtcm::set_DF289(const Galileo_Ephemeris& gal_eph) { unsigned int galileo_week_number = static_cast(gal_eph.WN_5); - if(galileo_week_number > 4095) + if (galileo_week_number > 4095) { LOG(WARNING) << "Error decoding Galileo week number (it has a 4096 roll-off, but " << galileo_week_number << " was detected)"; } @@ -4684,10 +4671,10 @@ int Rtcm::set_DF289(const Galileo_Ephemeris & gal_eph) } -int Rtcm::set_DF290(const Galileo_Ephemeris & gal_eph) +int Rtcm::set_DF290(const Galileo_Ephemeris& gal_eph) { unsigned int iod_nav = static_cast(gal_eph.IOD_nav_1); - if(iod_nav > 1023) + if (iod_nav > 1023) { LOG(WARNING) << "Error decoding Galileo IODnav (it has a max of 1023, but " << iod_nav << " was detected)"; } @@ -4696,7 +4683,7 @@ int Rtcm::set_DF290(const Galileo_Ephemeris & gal_eph) } -int Rtcm::set_DF291(const Galileo_Ephemeris & gal_eph) +int Rtcm::set_DF291(const Galileo_Ephemeris& gal_eph) { unsigned short int SISA = static_cast(gal_eph.SISA_3); //SISA = 0; // SIS Accuracy, data content definition not given in Galileo OS SIS ICD, Issue 1.1, Sept 2010 @@ -4705,20 +4692,18 @@ int Rtcm::set_DF291(const Galileo_Ephemeris & gal_eph) } -int Rtcm::set_DF292(const Galileo_Ephemeris & gal_eph) +int Rtcm::set_DF292(const Galileo_Ephemeris& gal_eph) { - int idot = static_cast(std::round(gal_eph.iDot_2 / FNAV_idot_2_LSB)); DF292 = std::bitset<14>(idot); return 0; } -int Rtcm::set_DF293(const Galileo_Ephemeris & gal_eph) +int Rtcm::set_DF293(const Galileo_Ephemeris& gal_eph) { - unsigned int toc = static_cast(gal_eph.t0c_4); - if(toc > 604740) + if (toc > 604740) { LOG(WARNING) << "Error decoding Galileo ephemeris time (max of 604740, but " << toc << " was detected)"; } @@ -4727,7 +4712,7 @@ int Rtcm::set_DF293(const Galileo_Ephemeris & gal_eph) } -int Rtcm::set_DF294(const Galileo_Ephemeris & gal_eph) +int Rtcm::set_DF294(const Galileo_Ephemeris& gal_eph) { short int af2 = static_cast(std::round(gal_eph.af2_4 / FNAV_af2_1_LSB)); DF294 = std::bitset<6>(af2); @@ -4735,7 +4720,7 @@ int Rtcm::set_DF294(const Galileo_Ephemeris & gal_eph) } -int Rtcm::set_DF295(const Galileo_Ephemeris & gal_eph) +int Rtcm::set_DF295(const Galileo_Ephemeris& gal_eph) { long int af1 = static_cast(std::round(gal_eph.af1_4 / FNAV_af1_1_LSB)); DF295 = std::bitset<21>(af1); @@ -4743,7 +4728,7 @@ int Rtcm::set_DF295(const Galileo_Ephemeris & gal_eph) } -int Rtcm::set_DF296(const Galileo_Ephemeris & gal_eph) +int Rtcm::set_DF296(const Galileo_Ephemeris& gal_eph) { long int af0 = static_cast(std::round(gal_eph.af0_4 / FNAV_af0_1_LSB)); DF296 = std::bitset<31>(af0); @@ -4751,7 +4736,7 @@ int Rtcm::set_DF296(const Galileo_Ephemeris & gal_eph) } -int Rtcm::set_DF297(const Galileo_Ephemeris & gal_eph) +int Rtcm::set_DF297(const Galileo_Ephemeris& gal_eph) { int crs = static_cast(std::round(gal_eph.C_rs_3 / FNAV_Crs_3_LSB)); DF297 = std::bitset<16>(crs); @@ -4759,7 +4744,7 @@ int Rtcm::set_DF297(const Galileo_Ephemeris & gal_eph) } -int Rtcm::set_DF298(const Galileo_Ephemeris & gal_eph) +int Rtcm::set_DF298(const Galileo_Ephemeris& gal_eph) { int delta_n = static_cast(std::round(gal_eph.delta_n_3 / FNAV_deltan_3_LSB)); DF298 = std::bitset<16>(delta_n); @@ -4767,7 +4752,7 @@ int Rtcm::set_DF298(const Galileo_Ephemeris & gal_eph) } -int Rtcm::set_DF299(const Galileo_Ephemeris & gal_eph) +int Rtcm::set_DF299(const Galileo_Ephemeris& gal_eph) { long int m0 = static_cast(std::round(gal_eph.M0_1 / FNAV_M0_2_LSB)); DF299 = std::bitset<32>(m0); @@ -4775,7 +4760,7 @@ int Rtcm::set_DF299(const Galileo_Ephemeris & gal_eph) } -int Rtcm::set_DF300(const Galileo_Ephemeris & gal_eph) +int Rtcm::set_DF300(const Galileo_Ephemeris& gal_eph) { int cuc = static_cast(std::round(gal_eph.C_uc_3 / FNAV_Cuc_3_LSB)); DF300 = std::bitset<16>(cuc); @@ -4783,7 +4768,7 @@ int Rtcm::set_DF300(const Galileo_Ephemeris & gal_eph) } -int Rtcm::set_DF301(const Galileo_Ephemeris & gal_eph) +int Rtcm::set_DF301(const Galileo_Ephemeris& gal_eph) { unsigned long int ecc = static_cast(std::round(gal_eph.e_1 / FNAV_e_2_LSB)); DF301 = std::bitset<32>(ecc); @@ -4791,7 +4776,7 @@ int Rtcm::set_DF301(const Galileo_Ephemeris & gal_eph) } -int Rtcm::set_DF302(const Galileo_Ephemeris & gal_eph) +int Rtcm::set_DF302(const Galileo_Ephemeris& gal_eph) { int cus = static_cast(std::round(gal_eph.C_us_3 / FNAV_Cus_3_LSB)); DF302 = std::bitset<16>(cus); @@ -4799,7 +4784,7 @@ int Rtcm::set_DF302(const Galileo_Ephemeris & gal_eph) } -int Rtcm::set_DF303(const Galileo_Ephemeris & gal_eph) +int Rtcm::set_DF303(const Galileo_Ephemeris& gal_eph) { unsigned long int sqr_a = static_cast(std::round(gal_eph.A_1 / FNAV_a12_2_LSB)); DF303 = std::bitset<32>(sqr_a); @@ -4807,7 +4792,7 @@ int Rtcm::set_DF303(const Galileo_Ephemeris & gal_eph) } -int Rtcm::set_DF304(const Galileo_Ephemeris & gal_eph) +int Rtcm::set_DF304(const Galileo_Ephemeris& gal_eph) { unsigned int toe = static_cast(std::round(gal_eph.t0e_1 / FNAV_t0e_3_LSB)); DF304 = std::bitset<14>(toe); @@ -4815,7 +4800,7 @@ int Rtcm::set_DF304(const Galileo_Ephemeris & gal_eph) } -int Rtcm::set_DF305(const Galileo_Ephemeris & gal_eph) +int Rtcm::set_DF305(const Galileo_Ephemeris& gal_eph) { int cic = static_cast(std::round(gal_eph.C_ic_4 / FNAV_Cic_4_LSB)); DF305 = std::bitset<16>(cic); @@ -4823,7 +4808,7 @@ int Rtcm::set_DF305(const Galileo_Ephemeris & gal_eph) } -int Rtcm::set_DF306(const Galileo_Ephemeris & gal_eph) +int Rtcm::set_DF306(const Galileo_Ephemeris& gal_eph) { long int Omega0 = static_cast(std::round(gal_eph.OMEGA_0_2 / FNAV_omega0_2_LSB)); DF306 = std::bitset<32>(Omega0); @@ -4831,7 +4816,7 @@ int Rtcm::set_DF306(const Galileo_Ephemeris & gal_eph) } -int Rtcm::set_DF307(const Galileo_Ephemeris & gal_eph) +int Rtcm::set_DF307(const Galileo_Ephemeris& gal_eph) { int cis = static_cast(std::round(gal_eph.C_is_4 / FNAV_Cis_4_LSB)); DF307 = std::bitset<16>(cis); @@ -4839,7 +4824,7 @@ int Rtcm::set_DF307(const Galileo_Ephemeris & gal_eph) } -int Rtcm::set_DF308(const Galileo_Ephemeris & gal_eph) +int Rtcm::set_DF308(const Galileo_Ephemeris& gal_eph) { long int i0 = static_cast(std::round(gal_eph.i_0_2 / FNAV_i0_3_LSB)); DF308 = std::bitset<32>(i0); @@ -4847,7 +4832,7 @@ int Rtcm::set_DF308(const Galileo_Ephemeris & gal_eph) } -int Rtcm::set_DF309(const Galileo_Ephemeris & gal_eph) +int Rtcm::set_DF309(const Galileo_Ephemeris& gal_eph) { int crc = static_cast(std::round(gal_eph.C_rc_3 / FNAV_Crc_3_LSB)); DF309 = std::bitset<16>(crc); @@ -4855,7 +4840,7 @@ int Rtcm::set_DF309(const Galileo_Ephemeris & gal_eph) } -int Rtcm::set_DF310(const Galileo_Ephemeris & gal_eph) +int Rtcm::set_DF310(const Galileo_Ephemeris& gal_eph) { int omega = static_cast(std::round(gal_eph.omega_2 / FNAV_omega0_2_LSB)); DF310 = std::bitset<32>(omega); @@ -4863,7 +4848,7 @@ int Rtcm::set_DF310(const Galileo_Ephemeris & gal_eph) } -int Rtcm::set_DF311(const Galileo_Ephemeris & gal_eph) +int Rtcm::set_DF311(const Galileo_Ephemeris& gal_eph) { long int Omegadot = static_cast(std::round(gal_eph.OMEGA_dot_3 / FNAV_omegadot_2_LSB)); DF311 = std::bitset<24>(Omegadot); @@ -4871,7 +4856,7 @@ int Rtcm::set_DF311(const Galileo_Ephemeris & gal_eph) } -int Rtcm::set_DF312(const Galileo_Ephemeris & gal_eph) +int Rtcm::set_DF312(const Galileo_Ephemeris& gal_eph) { int bdg_E1_E5a = static_cast(std::round(gal_eph.BGD_E1E5a_5 / FNAV_BGD_1_LSB)); DF312 = std::bitset<10>(bdg_E1_E5a); @@ -4879,30 +4864,29 @@ int Rtcm::set_DF312(const Galileo_Ephemeris & gal_eph) } -int Rtcm::set_DF313(const Galileo_Ephemeris & gal_eph) +int Rtcm::set_DF313(const Galileo_Ephemeris& gal_eph) { - unsigned int bdg_E5b_E1 = static_cast(std::round(gal_eph.BGD_E1E5b_5 )); + unsigned int bdg_E5b_E1 = static_cast(std::round(gal_eph.BGD_E1E5b_5)); //bdg_E5b_E1 = 0; //reserved DF313 = std::bitset<10>(bdg_E5b_E1); return 0; } -int Rtcm::set_DF314(const Galileo_Ephemeris & gal_eph) +int Rtcm::set_DF314(const Galileo_Ephemeris& gal_eph) { DF314 = std::bitset<2>(gal_eph.E5a_HS); return 0; } -int Rtcm::set_DF315(const Galileo_Ephemeris & gal_eph) +int Rtcm::set_DF315(const Galileo_Ephemeris& gal_eph) { DF315 = std::bitset<1>(gal_eph.E5a_DVS); return 0; } - int Rtcm::set_DF393(bool more_messages) { DF393 = std::bitset<1>(more_messages); @@ -4910,14 +4894,14 @@ int Rtcm::set_DF393(bool more_messages) } -int Rtcm::set_DF394(const std::map & gnss_synchro) +int Rtcm::set_DF394(const std::map& gnss_synchro) { DF394.reset(); std::map::const_iterator gnss_synchro_iter; unsigned int mask_position; - for(gnss_synchro_iter = gnss_synchro.cbegin(); - gnss_synchro_iter != gnss_synchro.cend(); - gnss_synchro_iter++) + for (gnss_synchro_iter = gnss_synchro.cbegin(); + gnss_synchro_iter != gnss_synchro.cend(); + gnss_synchro_iter++) { mask_position = 64 - gnss_synchro_iter->second.PRN; DF394.set(mask_position, true); @@ -4926,63 +4910,63 @@ int Rtcm::set_DF394(const std::map & gnss_synchro) } -int Rtcm::set_DF395(const std::map & gnss_synchro) +int Rtcm::set_DF395(const std::map& gnss_synchro) { DF395.reset(); - if(gnss_synchro.size() == 0) + if (gnss_synchro.size() == 0) { return 1; } std::map::const_iterator gnss_synchro_iter; std::string sig; unsigned int mask_position; - for(gnss_synchro_iter = gnss_synchro.cbegin(); - gnss_synchro_iter != gnss_synchro.cend(); - gnss_synchro_iter++) + for (gnss_synchro_iter = gnss_synchro.cbegin(); + gnss_synchro_iter != gnss_synchro.cend(); + gnss_synchro_iter++) { std::string sig_(gnss_synchro_iter->second.Signal); - sig = sig_.substr(0,2); + sig = sig_.substr(0, 2); std::string sys(&gnss_synchro_iter->second.System, 1); - if ((sig.compare("1C") == 0) && (sys.compare("G") == 0 ) ) + if ((sig.compare("1C") == 0) && (sys.compare("G") == 0)) { mask_position = 32 - 2; DF395.set(mask_position, true); } - if ((sig.compare("2S") == 0) && (sys.compare("G") == 0 ) ) + if ((sig.compare("2S") == 0) && (sys.compare("G") == 0)) { mask_position = 32 - 15; DF395.set(mask_position, true); } - if ((sig.compare("5X") == 0) && (sys.compare("G") == 0 ) ) + if ((sig.compare("5X") == 0) && (sys.compare("G") == 0)) { mask_position = 32 - 24; DF395.set(mask_position, true); } - if ((sig.compare("1B") == 0) && (sys.compare("E") == 0 ) ) + if ((sig.compare("1B") == 0) && (sys.compare("E") == 0)) { mask_position = 32 - 4; DF395.set(mask_position, true); } - if ((sig.compare("5X") == 0) && (sys.compare("E") == 0 ) ) + if ((sig.compare("5X") == 0) && (sys.compare("E") == 0)) { mask_position = 32 - 24; DF395.set(mask_position, true); } - if ((sig.compare("7X") == 0) && (sys.compare("E") == 0 ) ) + if ((sig.compare("7X") == 0) && (sys.compare("E") == 0)) { mask_position = 32 - 16; DF395.set(mask_position, true); } - if ((sig.compare("1C") == 0) && (sys.compare("R") == 0 ) ) + if ((sig.compare("1C") == 0) && (sys.compare("R") == 0)) { mask_position = 32 - 2; DF395.set(mask_position, true); } - if ((sig.compare("2C") == 0) && (sys.compare("R") == 0 ) ) + if ((sig.compare("2C") == 0) && (sys.compare("R") == 0)) { mask_position = 32 - 8; DF395.set(mask_position, true); @@ -4993,7 +4977,7 @@ int Rtcm::set_DF395(const std::map & gnss_synchro) } -std::string Rtcm::set_DF396(const std::map & observables) +std::string Rtcm::set_DF396(const std::map& observables) { std::string DF396; std::map::const_iterator observables_iter; @@ -5013,94 +4997,94 @@ std::string Rtcm::set_DF396(const std::map & observables) std::vector list_of_sats; std::vector list_of_signals; - for(observables_iter = observables.cbegin(); - observables_iter != observables.cend(); - observables_iter++) + for (observables_iter = observables.cbegin(); + observables_iter != observables.cend(); + observables_iter++) { list_of_sats.push_back(observables_iter->second.PRN); std::string sig_(observables_iter->second.Signal); - sig = sig_.substr(0,2); + sig = sig_.substr(0, 2); std::string sys(&observables_iter->second.System, 1); - if ((sig.compare("1C") == 0) && (sys.compare("G") == 0 ) ) + if ((sig.compare("1C") == 0) && (sys.compare("G") == 0)) { list_of_signals.push_back(32 - 2); } - if ((sig.compare("2S") == 0) && (sys.compare("G") == 0 ) ) + if ((sig.compare("2S") == 0) && (sys.compare("G") == 0)) { list_of_signals.push_back(32 - 15); } - if ((sig.compare("5X") == 0) && (sys.compare("G") == 0 ) ) + if ((sig.compare("5X") == 0) && (sys.compare("G") == 0)) { list_of_signals.push_back(32 - 24); } - if ((sig.compare("1B") == 0) && (sys.compare("E") == 0 ) ) + if ((sig.compare("1B") == 0) && (sys.compare("E") == 0)) { list_of_signals.push_back(32 - 4); } - if ((sig.compare("5X") == 0) && (sys.compare("E") == 0 ) ) + if ((sig.compare("5X") == 0) && (sys.compare("E") == 0)) { list_of_signals.push_back(32 - 24); } - if ((sig.compare("7X") == 0) && (sys.compare("E") == 0 ) ) + if ((sig.compare("7X") == 0) && (sys.compare("E") == 0)) { list_of_signals.push_back(32 - 16); } } - std::sort( list_of_sats.begin(), list_of_sats.end() ); - list_of_sats.erase( std::unique( list_of_sats.begin(), list_of_sats.end() ), list_of_sats.end() ); + std::sort(list_of_sats.begin(), list_of_sats.end()); + list_of_sats.erase(std::unique(list_of_sats.begin(), list_of_sats.end()), list_of_sats.end()); - std::sort( list_of_signals.begin(), list_of_signals.end() ); + std::sort(list_of_signals.begin(), list_of_signals.end()); std::reverse(list_of_signals.begin(), list_of_signals.end()); - list_of_signals.erase( std::unique( list_of_signals.begin(), list_of_signals.end() ), list_of_signals.end() ); + list_of_signals.erase(std::unique(list_of_signals.begin(), list_of_signals.end()), list_of_signals.end()); // fill the matrix bool value; - for(unsigned int row = 0; row < num_signals; row++) + for (unsigned int row = 0; row < num_signals; row++) { - for(unsigned int sat = 0; sat < num_satellites; sat++) + for (unsigned int sat = 0; sat < num_satellites; sat++) { value = false; - for(observables_iter = observables.cbegin(); - observables_iter != observables.cend(); - observables_iter++) + for (observables_iter = observables.cbegin(); + observables_iter != observables.cend(); + observables_iter++) { std::string sig_(observables_iter->second.Signal); - sig = sig_.substr(0,2); + sig = sig_.substr(0, 2); std::string sys(&observables_iter->second.System, 1); - if ((sig.compare("1C") == 0) && (sys.compare("G") == 0 ) && (list_of_signals.at(row) == 32 - 2) && (observables_iter->second.PRN == list_of_sats.at(sat) ) ) + if ((sig.compare("1C") == 0) && (sys.compare("G") == 0) && (list_of_signals.at(row) == 32 - 2) && (observables_iter->second.PRN == list_of_sats.at(sat))) { value = true; } - if ((sig.compare("2S") == 0) && (sys.compare("G") == 0 ) && (list_of_signals.at(row) == 32 - 15) && (observables_iter->second.PRN == list_of_sats.at(sat) ) ) + if ((sig.compare("2S") == 0) && (sys.compare("G") == 0) && (list_of_signals.at(row) == 32 - 15) && (observables_iter->second.PRN == list_of_sats.at(sat))) { value = true; } - if ((sig.compare("5X") == 0) && (sys.compare("G") == 0 ) && (list_of_signals.at(row) == 32 - 24) && (observables_iter->second.PRN == list_of_sats.at(sat) ) ) + if ((sig.compare("5X") == 0) && (sys.compare("G") == 0) && (list_of_signals.at(row) == 32 - 24) && (observables_iter->second.PRN == list_of_sats.at(sat))) { value = true; } - if ((sig.compare("1B") == 0) && (sys.compare("E") == 0 ) && (list_of_signals.at(row) == 32 - 4) && (observables_iter->second.PRN == list_of_sats.at(sat) ) ) + if ((sig.compare("1B") == 0) && (sys.compare("E") == 0) && (list_of_signals.at(row) == 32 - 4) && (observables_iter->second.PRN == list_of_sats.at(sat))) { value = true; } - if ((sig.compare("5X") == 0) && (sys.compare("E") == 0 ) && (list_of_signals.at(row) == 32 - 24) && (observables_iter->second.PRN == list_of_sats.at(sat) ) ) + if ((sig.compare("5X") == 0) && (sys.compare("E") == 0) && (list_of_signals.at(row) == 32 - 24) && (observables_iter->second.PRN == list_of_sats.at(sat))) { value = true; } - if ((sig.compare("7X") == 0) && (sys.compare("E") == 0 ) && (list_of_signals.at(row) == 32 - 16) && (observables_iter->second.PRN == list_of_sats.at(sat) ) ) + if ((sig.compare("7X") == 0) && (sys.compare("E") == 0) && (list_of_signals.at(row) == 32 - 16) && (observables_iter->second.PRN == list_of_sats.at(sat))) { value = true; } @@ -5111,12 +5095,12 @@ std::string Rtcm::set_DF396(const std::map & observables) // write the matrix column-wise DF396.clear(); - for(unsigned int col = 0; col < num_satellites; col++) + for (unsigned int col = 0; col < num_satellites; col++) { - for(unsigned int row = 0; row < num_signals; row++) + for (unsigned int row = 0; row < num_signals; row++) { std::string ss; - if(matrix[row].at(col)) + if (matrix[row].at(col)) { ss = "1"; } @@ -5131,7 +5115,7 @@ std::string Rtcm::set_DF396(const std::map & observables) } -int Rtcm::set_DF397(const Gnss_Synchro & gnss_synchro) +int Rtcm::set_DF397(const Gnss_Synchro& gnss_synchro) { double meters_to_miliseconds = GPS_C_m_s * 0.001; double rough_range_s = std::round(gnss_synchro.Pseudorange_m / meters_to_miliseconds / TWO_N10) * meters_to_miliseconds * TWO_N10; @@ -5142,7 +5126,7 @@ int Rtcm::set_DF397(const Gnss_Synchro & gnss_synchro) { int_ms = 255; } - else if((rough_range_s < 0.0) || (rough_range_s > meters_to_miliseconds * 255.0)) + else if ((rough_range_s < 0.0) || (rough_range_s > meters_to_miliseconds * 255.0)) { int_ms = 255; } @@ -5156,12 +5140,12 @@ int Rtcm::set_DF397(const Gnss_Synchro & gnss_synchro) } -int Rtcm::set_DF398(const Gnss_Synchro & gnss_synchro) +int Rtcm::set_DF398(const Gnss_Synchro& gnss_synchro) { double meters_to_miliseconds = GPS_C_m_s * 0.001; double rough_range_m = std::round(gnss_synchro.Pseudorange_m / meters_to_miliseconds / TWO_N10) * meters_to_miliseconds * TWO_N10; unsigned int rr_mod_ms; - if((rough_range_m <= 0.0) || (rough_range_m > meters_to_miliseconds * 255.0)) + if ((rough_range_m <= 0.0) || (rough_range_m > meters_to_miliseconds * 255.0)) { rr_mod_ms = 0; } @@ -5174,43 +5158,43 @@ int Rtcm::set_DF398(const Gnss_Synchro & gnss_synchro) } -int Rtcm::set_DF399(const Gnss_Synchro & gnss_synchro) +int Rtcm::set_DF399(const Gnss_Synchro& gnss_synchro) { double lambda = 0.0; std::string sig_(gnss_synchro.Signal); - std::string sig = sig_.substr(0,2); + std::string sig = sig_.substr(0, 2); - if (sig.compare("1C") == 0 ) + if (sig.compare("1C") == 0) { lambda = GPS_C_m_s / GPS_L1_FREQ_HZ; } - if (sig.compare("2S") == 0 ) + if (sig.compare("2S") == 0) { lambda = GPS_C_m_s / GPS_L2_FREQ_HZ; } - if (sig.compare("5X") == 0 ) + if (sig.compare("5X") == 0) { lambda = GPS_C_m_s / Galileo_E5a_FREQ_HZ; } - if (sig.compare("1B") == 0 ) + if (sig.compare("1B") == 0) { lambda = GPS_C_m_s / Galileo_E1_FREQ_HZ; } - if (sig.compare("7X") == 0 ) + if (sig.compare("7X") == 0) { - lambda = GPS_C_m_s / 1.207140e9; // Galileo_E1b_FREQ_HZ; + lambda = GPS_C_m_s / 1.207140e9; // Galileo_E1b_FREQ_HZ; } - double rough_phase_range_rate_ms = std::round(- gnss_synchro.Carrier_Doppler_hz * lambda ); - if(rough_phase_range_rate_ms < - 8191) rough_phase_range_rate_ms = -8192; - if(rough_phase_range_rate_ms > 8191) rough_phase_range_rate_ms = -8192; + double rough_phase_range_rate_ms = std::round(-gnss_synchro.Carrier_Doppler_hz * lambda); + if (rough_phase_range_rate_ms < -8191) rough_phase_range_rate_ms = -8192; + if (rough_phase_range_rate_ms > 8191) rough_phase_range_rate_ms = -8192; DF399 = std::bitset<14>(static_cast(rough_phase_range_rate_ms)); return 0; } -int Rtcm::set_DF400(const Gnss_Synchro & gnss_synchro) +int Rtcm::set_DF400(const Gnss_Synchro& gnss_synchro) { double meters_to_miliseconds = GPS_C_m_s * 0.001; double rough_range_m = std::round(gnss_synchro.Pseudorange_m / meters_to_miliseconds / TWO_N10) * meters_to_miliseconds * TWO_N10; @@ -5223,9 +5207,9 @@ int Rtcm::set_DF400(const Gnss_Synchro & gnss_synchro) { fine_pseudorange = -16384; } - else if(std::fabs(psrng_s) > 292.7) + else if (std::fabs(psrng_s) > 292.7) { - fine_pseudorange = -16384; // 4000h: invalid value + fine_pseudorange = -16384; // 4000h: invalid value } else { @@ -5237,7 +5221,7 @@ int Rtcm::set_DF400(const Gnss_Synchro & gnss_synchro) } -int Rtcm::set_DF401(const Gnss_Synchro & gnss_synchro) +int Rtcm::set_DF401(const Gnss_Synchro& gnss_synchro) { double meters_to_miliseconds = GPS_C_m_s * 0.001; double rough_range_m = std::round(gnss_synchro.Pseudorange_m / meters_to_miliseconds / TWO_N10) * meters_to_miliseconds * TWO_N10; @@ -5246,57 +5230,57 @@ int Rtcm::set_DF401(const Gnss_Synchro & gnss_synchro) double lambda = 0.0; std::string sig_(gnss_synchro.Signal); - std::string sig = sig_.substr(0,2); + std::string sig = sig_.substr(0, 2); std::string sys(&gnss_synchro.System, 1); - if ((sig.compare("1C") == 0) && (sys.compare("G") == 0 )) + if ((sig.compare("1C") == 0) && (sys.compare("G") == 0)) { lambda = GPS_C_m_s / GPS_L1_FREQ_HZ; } - if ((sig.compare("2S")) == 0 && (sys.compare("G") == 0 )) + if ((sig.compare("2S")) == 0 && (sys.compare("G") == 0)) { lambda = GPS_C_m_s / GPS_L2_FREQ_HZ; } - if ((sig.compare("5X")) == 0 && (sys.compare("E") == 0 )) + if ((sig.compare("5X")) == 0 && (sys.compare("E") == 0)) { lambda = GPS_C_m_s / Galileo_E5a_FREQ_HZ; } - if ((sig.compare("1B")) == 0 && (sys.compare("E") == 0 )) + if ((sig.compare("1B")) == 0 && (sys.compare("E") == 0)) { lambda = GPS_C_m_s / Galileo_E1_FREQ_HZ; } - if ((sig.compare("7X")) == 0 && (sys.compare("E") == 0 )) + if ((sig.compare("7X")) == 0 && (sys.compare("E") == 0)) { - lambda = GPS_C_m_s / 1.207140e9; // Galileo_E1b_FREQ_HZ; + lambda = GPS_C_m_s / 1.207140e9; // Galileo_E1b_FREQ_HZ; + } + if ((sig.compare("1C") == 0) && (sys.compare("R") == 0)) + { + lambda = GLONASS_C_m_s / ((GLONASS_L1_CA_FREQ_HZ + (GLONASS_L1_CA_DFREQ_HZ * GLONASS_PRN.at(gnss_synchro.PRN)))); + } + if ((sig.compare("2C") == 0) && (sys.compare("R") == 0)) + { + // TODO Need to add slot number and freq number to gnss_syncro + lambda = GLONASS_C_m_s / (GLONASS_L2_FREQ_HZ); } - if ((sig.compare("1C") == 0) && (sys.compare("R") == 0 )) - { - lambda = GLONASS_C_m_s / ((GLONASS_L1_CA_FREQ_HZ + (GLONASS_L1_CA_DFREQ_HZ * GLONASS_PRN.at(gnss_synchro.PRN)))); - } - if ((sig.compare("2C") == 0) && (sys.compare("R") == 0 )) - { - // TODO Need to add slot number and freq number to gnss_syncro - lambda = GLONASS_C_m_s / (GLONASS_L2_FREQ_HZ); - } - phrng_m = (gnss_synchro.Carrier_phase_rads / GPS_TWO_PI ) * lambda - rough_range_m; + phrng_m = (gnss_synchro.Carrier_phase_rads / GPS_TWO_PI) * lambda - rough_range_m; /* Substract phase - pseudorange integer cycle offset */ /* TODO: check LLI! */ - double cp = gnss_synchro.Carrier_phase_rads / GPS_TWO_PI; // ? - if(std::fabs(phrng_m - cp) > 1171.0) + double cp = gnss_synchro.Carrier_phase_rads / GPS_TWO_PI; // ? + if (std::fabs(phrng_m - cp) > 1171.0) { cp = std::round(phrng_m / lambda) * lambda; } phrng_m -= cp; - if(phrng_m == 0.0) + if (phrng_m == 0.0) { - fine_phaserange = - 2097152; + fine_phaserange = -2097152; } - else if(std::fabs(phrng_m) > 1171.0) + else if (std::fabs(phrng_m) > 1171.0) { - fine_phaserange = - 2097152; + fine_phaserange = -2097152; } else { @@ -5308,30 +5292,30 @@ int Rtcm::set_DF401(const Gnss_Synchro & gnss_synchro) } -int Rtcm::set_DF402(const Gps_Ephemeris & ephNAV, const Gps_CNAV_Ephemeris & ephCNAV, const Galileo_Ephemeris & ephFNAV, const Glonass_Gnav_Ephemeris & ephGNAV, double obs_time, const Gnss_Synchro & gnss_synchro) +int Rtcm::set_DF402(const Gps_Ephemeris& ephNAV, const Gps_CNAV_Ephemeris& ephCNAV, const Galileo_Ephemeris& ephFNAV, const Glonass_Gnav_Ephemeris& ephGNAV, double obs_time, const Gnss_Synchro& gnss_synchro) { unsigned int lock_time_period_s = 0; unsigned int lock_time_indicator; std::string sig_(gnss_synchro.Signal); std::string sys(&gnss_synchro.System, 1); - if ((sig_.compare("1C") == 0) && (sys.compare("G") == 0 )) + if ((sig_.compare("1C") == 0) && (sys.compare("G") == 0)) { lock_time_period_s = Rtcm::lock_time(ephNAV, obs_time, gnss_synchro); } - if ((sig_.compare("2S") == 0) && (sys.compare("G") == 0 )) + if ((sig_.compare("2S") == 0) && (sys.compare("G") == 0)) { lock_time_period_s = Rtcm::lock_time(ephCNAV, obs_time, gnss_synchro); } // TODO Should add system for galileo satellites - if(sig_.compare("1B") || sig_.compare("5X") || sig_.compare("7X") || sig_.compare("8X")) + if (sig_.compare("1B") || sig_.compare("5X") || sig_.compare("7X") || sig_.compare("8X")) { lock_time_period_s = Rtcm::lock_time(ephFNAV, obs_time, gnss_synchro); } - if ((sig_.compare("1C") == 0) && (sys.compare("R") == 0 )) + if ((sig_.compare("1C") == 0) && (sys.compare("R") == 0)) { lock_time_period_s = Rtcm::lock_time(ephGNAV, obs_time, gnss_synchro); } - if ((sig_.compare("2C") == 0) && (sys.compare("R") == 0 )) + if ((sig_.compare("2C") == 0) && (sys.compare("R") == 0)) { lock_time_period_s = Rtcm::lock_time(ephGNAV, obs_time, gnss_synchro); } @@ -5341,7 +5325,7 @@ int Rtcm::set_DF402(const Gps_Ephemeris & ephNAV, const Gps_CNAV_Ephemeris & eph } -int Rtcm::set_DF403(const Gnss_Synchro & gnss_synchro) +int Rtcm::set_DF403(const Gnss_Synchro& gnss_synchro) { unsigned int cnr_dB_Hz; cnr_dB_Hz = static_cast(std::round(gnss_synchro.CN0_dB_hz)); @@ -5350,65 +5334,65 @@ int Rtcm::set_DF403(const Gnss_Synchro & gnss_synchro) } -int Rtcm::set_DF404(const Gnss_Synchro & gnss_synchro) +int Rtcm::set_DF404(const Gnss_Synchro& gnss_synchro) { double lambda = 0.0; std::string sig_(gnss_synchro.Signal); - std::string sig = sig_.substr(0,2); + std::string sig = sig_.substr(0, 2); int fine_phaserange_rate; std::string sys_(&gnss_synchro.System, 1); - if ((sig_.compare("1C") == 0) && (sys_.compare("G") == 0 )) + if ((sig_.compare("1C") == 0) && (sys_.compare("G") == 0)) { lambda = GPS_C_m_s / GPS_L1_FREQ_HZ; } - if ((sig_.compare("2S") == 0) && (sys_.compare("G") == 0 )) + if ((sig_.compare("2S") == 0) && (sys_.compare("G") == 0)) { lambda = GPS_C_m_s / GPS_L2_FREQ_HZ; } - if ((sig_.compare("5X") == 0) && (sys_.compare("E") == 0 )) + if ((sig_.compare("5X") == 0) && (sys_.compare("E") == 0)) { lambda = GPS_C_m_s / Galileo_E5a_FREQ_HZ; } - if ((sig_.compare("1B") == 0) && (sys_.compare("E") == 0 )) + if ((sig_.compare("1B") == 0) && (sys_.compare("E") == 0)) { lambda = GPS_C_m_s / Galileo_E1_FREQ_HZ; } - if ((sig_.compare("7X") == 0 ) && (sys_.compare("E") == 0 )) + if ((sig_.compare("7X") == 0) && (sys_.compare("E") == 0)) { - lambda = GPS_C_m_s / 1.207140e9; // Galileo_E1b_FREQ_HZ; + lambda = GPS_C_m_s / 1.207140e9; // Galileo_E1b_FREQ_HZ; } - if ((sig_.compare("1C") == 0) && (sys_.compare("R") == 0 )) + if ((sig_.compare("1C") == 0) && (sys_.compare("R") == 0)) { - lambda = GLONASS_C_m_s / (GLONASS_L1_CA_FREQ_HZ + (GLONASS_L1_CA_DFREQ_HZ * GLONASS_PRN.at(gnss_synchro.PRN))); + lambda = GLONASS_C_m_s / (GLONASS_L1_CA_FREQ_HZ + (GLONASS_L1_CA_DFREQ_HZ * GLONASS_PRN.at(gnss_synchro.PRN))); } - if ((sig_.compare("2C") == 0) && (sys_.compare("R") == 0 )) + if ((sig_.compare("2C") == 0) && (sys_.compare("R") == 0)) { //TODO Need to add slot number and freq number to gnss syncro lambda = GLONASS_C_m_s / (GLONASS_L2_FREQ_HZ); } - double rough_phase_range_rate = std::round(- gnss_synchro.Carrier_Doppler_hz * lambda ); - double phrr = (- gnss_synchro.Carrier_Doppler_hz * lambda - rough_phase_range_rate); + double rough_phase_range_rate = std::round(-gnss_synchro.Carrier_Doppler_hz * lambda); + double phrr = (-gnss_synchro.Carrier_Doppler_hz * lambda - rough_phase_range_rate); - if(phrr == 0.0) - { - fine_phaserange_rate = -16384; - } - else if(std::fabs(phrr) > 1.6384) - { - fine_phaserange_rate = -16384; - } - else - { - fine_phaserange_rate = static_cast(std::round(phrr / 0.0001)); - } + if (phrr == 0.0) + { + fine_phaserange_rate = -16384; + } + else if (std::fabs(phrr) > 1.6384) + { + fine_phaserange_rate = -16384; + } + else + { + fine_phaserange_rate = static_cast(std::round(phrr / 0.0001)); + } DF404 = std::bitset<15>(fine_phaserange_rate); return 0; } -int Rtcm::set_DF405(const Gnss_Synchro & gnss_synchro) +int Rtcm::set_DF405(const Gnss_Synchro& gnss_synchro) { double meters_to_miliseconds = GPS_C_m_s * 0.001; double rough_range_m = std::round(gnss_synchro.Pseudorange_m / meters_to_miliseconds / TWO_N10) * meters_to_miliseconds * TWO_N10; @@ -5417,13 +5401,13 @@ int Rtcm::set_DF405(const Gnss_Synchro & gnss_synchro) psrng_s = gnss_synchro.Pseudorange_m - rough_range_m; - if(psrng_s == 0.0) + if (psrng_s == 0.0) { - fine_pseudorange = - 524288; + fine_pseudorange = -524288; } - else if(std::fabs(psrng_s) > 292.7) + else if (std::fabs(psrng_s) > 292.7) { - fine_pseudorange = - 524288; + fine_pseudorange = -524288; } else { @@ -5431,11 +5415,10 @@ int Rtcm::set_DF405(const Gnss_Synchro & gnss_synchro) } DF405 = std::bitset<20>(fine_pseudorange); return 0; - } -int Rtcm::set_DF406(const Gnss_Synchro & gnss_synchro) +int Rtcm::set_DF406(const Gnss_Synchro& gnss_synchro) { long int fine_phaserange_ex; double meters_to_miliseconds = GPS_C_m_s * 0.001; @@ -5443,56 +5426,56 @@ int Rtcm::set_DF406(const Gnss_Synchro & gnss_synchro) double phrng_m; double lambda = 0.0; std::string sig_(gnss_synchro.Signal); - sig_ = sig_.substr(0,2); + sig_ = sig_.substr(0, 2); std::string sys_(&gnss_synchro.System, 1); - if ((sig_.compare("1C") == 0) && (sys_.compare("G") == 0 ) ) + if ((sig_.compare("1C") == 0) && (sys_.compare("G") == 0)) { lambda = GPS_C_m_s / GPS_L1_FREQ_HZ; } - if ((sig_.compare("2S") == 0) && (sys_.compare("G") == 0 ) ) + if ((sig_.compare("2S") == 0) && (sys_.compare("G") == 0)) { lambda = GPS_C_m_s / GPS_L2_FREQ_HZ; } - if ((sig_.compare("5X") == 0) && (sys_.compare("E") == 0 ) ) + if ((sig_.compare("5X") == 0) && (sys_.compare("E") == 0)) { lambda = GPS_C_m_s / Galileo_E5a_FREQ_HZ; } - if ((sig_.compare("1B") == 0) && (sys_.compare("E") == 0 ) ) + if ((sig_.compare("1B") == 0) && (sys_.compare("E") == 0)) { lambda = GPS_C_m_s / Galileo_E1_FREQ_HZ; } - if ((sig_.compare("7X") == 0 ) && (sys_.compare("E") == 0 ) ) + if ((sig_.compare("7X") == 0) && (sys_.compare("E") == 0)) { - lambda = GPS_C_m_s / 1.207140e9; // Galileo_E1b_FREQ_HZ; + lambda = GPS_C_m_s / 1.207140e9; // Galileo_E1b_FREQ_HZ; } - if ((sig_.compare("1C") == 0) && (sys_.compare("R") == 0 )) + if ((sig_.compare("1C") == 0) && (sys_.compare("R") == 0)) { - lambda = GLONASS_C_m_s / (GLONASS_L1_CA_FREQ_HZ + (GLONASS_L1_CA_DFREQ_HZ * GLONASS_PRN.at(gnss_synchro.PRN))); + lambda = GLONASS_C_m_s / (GLONASS_L1_CA_FREQ_HZ + (GLONASS_L1_CA_DFREQ_HZ * GLONASS_PRN.at(gnss_synchro.PRN))); } - if ((sig_.compare("2C") == 0) && (sys_.compare("R") == 0 )) + if ((sig_.compare("2C") == 0) && (sys_.compare("R") == 0)) { //TODO Need to add slot number and freq number to gnss syncro lambda = GLONASS_C_m_s / (GLONASS_L2_FREQ_HZ); } - phrng_m = (gnss_synchro.Carrier_phase_rads / GPS_TWO_PI ) * lambda - rough_range_m; + phrng_m = (gnss_synchro.Carrier_phase_rads / GPS_TWO_PI) * lambda - rough_range_m; /* Substract phase - pseudorange integer cycle offset */ /* TODO: check LLI! */ - double cp = gnss_synchro.Carrier_phase_rads / GPS_TWO_PI; // ? - if(std::fabs(phrng_m - cp) > 1171.0) + double cp = gnss_synchro.Carrier_phase_rads / GPS_TWO_PI; // ? + if (std::fabs(phrng_m - cp) > 1171.0) { cp = std::round(phrng_m / lambda) * lambda; } phrng_m -= cp; - if(phrng_m == 0.0) + if (phrng_m == 0.0) { - fine_phaserange_ex = - 8388608; + fine_phaserange_ex = -8388608; } - else if(std::fabs(phrng_m) > 1171.0) + else if (std::fabs(phrng_m) > 1171.0) { - fine_phaserange_ex = - 8388608; + fine_phaserange_ex = -8388608; } else { @@ -5504,30 +5487,30 @@ int Rtcm::set_DF406(const Gnss_Synchro & gnss_synchro) } -int Rtcm::set_DF407(const Gps_Ephemeris & ephNAV, const Gps_CNAV_Ephemeris & ephCNAV, const Galileo_Ephemeris & ephFNAV, const Glonass_Gnav_Ephemeris & ephGNAV, double obs_time, const Gnss_Synchro & gnss_synchro) +int Rtcm::set_DF407(const Gps_Ephemeris& ephNAV, const Gps_CNAV_Ephemeris& ephCNAV, const Galileo_Ephemeris& ephFNAV, const Glonass_Gnav_Ephemeris& ephGNAV, double obs_time, const Gnss_Synchro& gnss_synchro) { unsigned int lock_time_indicator; unsigned int lock_time_period_s = 0; std::string sig_(gnss_synchro.Signal); std::string sys_(&gnss_synchro.System, 1); - if((sig_.compare("1C")) && (sys_.compare("G") == 0 )) + if ((sig_.compare("1C")) && (sys_.compare("G") == 0)) { lock_time_period_s = Rtcm::lock_time(ephNAV, obs_time, gnss_synchro); } - if((sig_.compare("2S")) && (sys_.compare("G") == 0 )) + if ((sig_.compare("2S")) && (sys_.compare("G") == 0)) { lock_time_period_s = Rtcm::lock_time(ephCNAV, obs_time, gnss_synchro); } - if((sig_.compare("1B") || sig_.compare("5X") || sig_.compare("7X") || sig_.compare("8X") ) && (sys_.compare("E") == 0 )) + if ((sig_.compare("1B") || sig_.compare("5X") || sig_.compare("7X") || sig_.compare("8X")) && (sys_.compare("E") == 0)) { lock_time_period_s = Rtcm::lock_time(ephFNAV, obs_time, gnss_synchro); } - if ((sig_.compare("1C") == 0) && (sys_.compare("R") == 0 )) + if ((sig_.compare("1C") == 0) && (sys_.compare("R") == 0)) { lock_time_period_s = Rtcm::lock_time(ephGNAV, obs_time, gnss_synchro); } - if ((sig_.compare("2C") == 0) && (sys_.compare("R") == 0 )) + if ((sig_.compare("2C") == 0) && (sys_.compare("R") == 0)) { lock_time_period_s = Rtcm::lock_time(ephGNAV, obs_time, gnss_synchro); } @@ -5537,7 +5520,7 @@ int Rtcm::set_DF407(const Gps_Ephemeris & ephNAV, const Gps_CNAV_Ephemeris & eph } -int Rtcm::set_DF408(const Gnss_Synchro & gnss_synchro) +int Rtcm::set_DF408(const Gnss_Synchro& gnss_synchro) { unsigned int cnr_dB_Hz; cnr_dB_Hz = static_cast(std::round(gnss_synchro.CN0_dB_hz / 0.0625)); @@ -5576,33 +5559,33 @@ int Rtcm::set_DF417(bool using_divergence_free_smoothing) int Rtcm::set_DF418(int carrier_smoothing_interval_s) { - if(carrier_smoothing_interval_s < 0) + if (carrier_smoothing_interval_s < 0) { DF418 = std::bitset<3>("111"); } else { - if(carrier_smoothing_interval_s == 0) + if (carrier_smoothing_interval_s == 0) { DF418 = std::bitset<3>("000"); } - else if(carrier_smoothing_interval_s < 30) + else if (carrier_smoothing_interval_s < 30) { DF418 = std::bitset<3>("001"); } - else if(carrier_smoothing_interval_s < 60) + else if (carrier_smoothing_interval_s < 60) { DF418 = std::bitset<3>("010"); } - else if(carrier_smoothing_interval_s < 120) + else if (carrier_smoothing_interval_s < 120) { DF418 = std::bitset<3>("011"); } - else if(carrier_smoothing_interval_s < 240) + else if (carrier_smoothing_interval_s < 240) { DF418 = std::bitset<3>("100"); } - else if(carrier_smoothing_interval_s < 480) + else if (carrier_smoothing_interval_s < 480) { DF418 = std::bitset<3>("101"); } @@ -5615,7 +5598,7 @@ int Rtcm::set_DF418(int carrier_smoothing_interval_s) } -int Rtcm::set_DF420(const Gnss_Synchro & gnss_synchro __attribute__((unused))) +int Rtcm::set_DF420(const Gnss_Synchro& gnss_synchro __attribute__((unused))) { // todo: read the value from gnss_synchro bool half_cycle_ambiguity_indicator = true; diff --git a/src/core/system_parameters/rtcm.h b/src/core/system_parameters/rtcm.h index 6ec935228..d4ac17460 100644 --- a/src/core/system_parameters/rtcm.h +++ b/src/core/system_parameters/rtcm.h @@ -84,28 +84,28 @@ class Rtcm { public: - Rtcm(unsigned short port = 2101); // & observables, unsigned short station_id); + std::string print_MT1001(const Gps_Ephemeris& gps_eph, double obs_time, const std::map& observables, unsigned short station_id); /*! * \brief Prints message type 1002 (Extended L1-Only GPS RTK Observables) */ - std::string print_MT1002(const Gps_Ephemeris & gps_eph, double obs_time, const std::map & observables, unsigned short station_id); + std::string print_MT1002(const Gps_Ephemeris& gps_eph, double obs_time, const std::map& observables, unsigned short station_id); /*! * \brief Prints message type 1003 (L1 & L2 GPS RTK Observables) */ - std::string print_MT1003(const Gps_Ephemeris & ephL1, const Gps_CNAV_Ephemeris & ephL2, double obs_time, const std::map & observables, unsigned short station_id); + std::string print_MT1003(const Gps_Ephemeris& ephL1, const Gps_CNAV_Ephemeris& ephL2, double obs_time, const std::map& observables, unsigned short station_id); /*! * \brief Prints message type 1004 (Extended L1 & L2 GPS RTK Observables) */ - std::string print_MT1004(const Gps_Ephemeris & ephL1, const Gps_CNAV_Ephemeris & ephL2, double obs_time, const std::map & observables, unsigned short station_id); + std::string print_MT1004(const Gps_Ephemeris& ephL1, const Gps_CNAV_Ephemeris& ephL2, double obs_time, const std::map& observables, unsigned short station_id); /*! * \brief Prints message type 1005 (Stationary Antenna Reference Point) @@ -115,7 +115,7 @@ public: /*! * \brief Verifies and reads messages of type 1005 (Stationary Antenna Reference Point). Returns 1 if anything goes wrong, 0 otherwise. */ - int read_MT1005(const std::string & message, unsigned int & ref_id, double & ecef_x, double & ecef_y, double & ecef_z, bool & gps, bool & glonass, bool & galileo); + int read_MT1005(const std::string& message, unsigned int& ref_id, double& ecef_x, double& ecef_y, double& ecef_z, bool& gps, bool& glonass, bool& galileo); /*! * \brief Prints message type 1006 (Stationary Antenna Reference Point, with Height Information) @@ -127,7 +127,7 @@ public: /*! * \brief Prints message type 1008 (Antenna Descriptor & Serial Number) */ - std::string print_MT1008(unsigned int ref_id, const std::string & antenna_descriptor, unsigned int antenna_setup_id, const std::string & antenna_serial_number); + std::string print_MT1008(unsigned int ref_id, const std::string& antenna_descriptor, unsigned int antenna_setup_id, const std::string& antenna_serial_number); /*! * \brief Prints L1-Only GLONASS RTK Observables @@ -138,7 +138,7 @@ public: * \param observables Set of observables as defined by the platform * \return string with message contents */ - std::string print_MT1009(const Glonass_Gnav_Ephemeris& glonass_gnav_eph, double obs_time, const std::map & observables, unsigned short station_id); + std::string print_MT1009(const Glonass_Gnav_Ephemeris& glonass_gnav_eph, double obs_time, const std::map& observables, unsigned short station_id); /*! * \brief Prints Extended L1-Only GLONASS RTK Observables * \details This GLONASS message type is used when only L1 data is present and bandwidth is very tight, often 1012 is used in such cases. @@ -148,7 +148,7 @@ public: * \param observables Set of observables as defined by the platform * \return string with message contents */ - std::string print_MT1010(const Glonass_Gnav_Ephemeris& glonass_gnav_eph, double obs_time, const std::map & observables, unsigned short station_id); + std::string print_MT1010(const Glonass_Gnav_Ephemeris& glonass_gnav_eph, double obs_time, const std::map& observables, unsigned short station_id); /*! * \brief Prints L1&L2 GLONASS RTK Observables * \details This GLONASS message type is not generally used or supported; type 1012 is to be preferred @@ -158,7 +158,7 @@ public: * \param observables Set of observables as defined by the platform * \return string with message contents */ - std::string print_MT1011(const Glonass_Gnav_Ephemeris& glonass_gnav_ephL1, const Glonass_Gnav_Ephemeris& glonass_gnav_ephL2, double obs_time, const std::map & observables, unsigned short station_id); + std::string print_MT1011(const Glonass_Gnav_Ephemeris& glonass_gnav_ephL1, const Glonass_Gnav_Ephemeris& glonass_gnav_ephL2, double obs_time, const std::map& observables, unsigned short station_id); /*! * \brief Prints Extended L1&L2 GLONASS RTK Observables * \details This GLONASS message type is the most common observational message type, with L1/L2/SNR content. This is one of the most common messages found. @@ -168,27 +168,27 @@ public: * \param observables Set of observables as defined by the platform * \return string with message contents */ - std::string print_MT1012(const Glonass_Gnav_Ephemeris& glonass_gnav_ephL1, const Glonass_Gnav_Ephemeris& glonass_gnav_ephL2, double obs_time, const std::map & observables, unsigned short station_id); + std::string print_MT1012(const Glonass_Gnav_Ephemeris& glonass_gnav_ephL1, const Glonass_Gnav_Ephemeris& glonass_gnav_ephL2, double obs_time, const std::map& observables, unsigned short station_id); /*! * \brief Prints message type 1019 (GPS Ephemeris), should be broadcast in the event that * the IODC does not match the IODE, and every 2 minutes. */ - std::string print_MT1019(const Gps_Ephemeris & gps_eph); + std::string print_MT1019(const Gps_Ephemeris& gps_eph); /*! * \brief Verifies and reads messages of type 1019 (GPS Ephemeris). Returns 1 if anything goes wrong, 0 otherwise. */ - int read_MT1019(const std::string & message, Gps_Ephemeris & gps_eph); + int read_MT1019(const std::string& message, Gps_Ephemeris& gps_eph); - /*! + /*! * \brief Prints message type 1020 (GLONASS Ephemeris). * \note Code added as part of GSoC 2017 program * \param glonass_gnav_eph GLONASS GNAV Broadcast Ephemeris * \param glonass_gnav_utc_model GLONASS GNAV Clock Information * \return Returns message type as a string type */ - std::string print_MT1020(const Glonass_Gnav_Ephemeris & glonass_gnav_eph, const Glonass_Gnav_Utc_Model & glonass_gnav_utc_model); + std::string print_MT1020(const Glonass_Gnav_Ephemeris& glonass_gnav_eph, const Glonass_Gnav_Utc_Model& glonass_gnav_utc_model); /*! * \brief Verifies and reads messages of type 1020 (GLONASS Ephemeris). @@ -198,138 +198,138 @@ public: * \param glonass_gnav_utc_model GLONASS GNAV Clock Information * \return Returns 1 if anything goes wrong, 0 otherwise. */ - int read_MT1020(const std::string & message, Glonass_Gnav_Ephemeris & glonass_gnav_eph, Glonass_Gnav_Utc_Model & glonass_gnav_utc_model); + int read_MT1020(const std::string& message, Glonass_Gnav_Ephemeris& glonass_gnav_eph, Glonass_Gnav_Utc_Model& glonass_gnav_utc_model); /*! * \brief Prints message type 1029 (Unicode Text String) */ - std::string print_MT1029(unsigned int ref_id, const Gps_Ephemeris & gps_eph, double obs_time, const std::string & message); + std::string print_MT1029(unsigned int ref_id, const Gps_Ephemeris& gps_eph, double obs_time, const std::string& message); /*! * \brief Prints message type 1045 (Galileo Ephemeris), should be broadcast every 2 minutes */ - std::string print_MT1045(const Galileo_Ephemeris & gal_eph); + std::string print_MT1045(const Galileo_Ephemeris& gal_eph); /*! * \brief Verifies and reads messages of type 1045 (Galileo Ephemeris). Returns 1 if anything goes wrong, 0 otherwise. */ - int read_MT1045(const std::string & message, Galileo_Ephemeris & gal_eph); + int read_MT1045(const std::string& message, Galileo_Ephemeris& gal_eph); /*! * \brief Prints messages of type MSM1 (Compact GNSS observables) */ - std::string print_MSM_1( const Gps_Ephemeris & gps_eph, - const Gps_CNAV_Ephemeris & gps_cnav_eph, - const Galileo_Ephemeris & gal_eph, - const Glonass_Gnav_Ephemeris & glo_gnav_eph, - double obs_time, - const std::map & observables, - unsigned int ref_id, - unsigned int clock_steering_indicator, - unsigned int external_clock_indicator, - int smooth_int, - bool divergence_free, - bool more_messages); + std::string print_MSM_1(const Gps_Ephemeris& gps_eph, + const Gps_CNAV_Ephemeris& gps_cnav_eph, + const Galileo_Ephemeris& gal_eph, + const Glonass_Gnav_Ephemeris& glo_gnav_eph, + double obs_time, + const std::map& observables, + unsigned int ref_id, + unsigned int clock_steering_indicator, + unsigned int external_clock_indicator, + int smooth_int, + bool divergence_free, + bool more_messages); /*! * \brief Prints messages of type MSM2 (Compact GNSS phaseranges) */ - std::string print_MSM_2( const Gps_Ephemeris & gps_eph, - const Gps_CNAV_Ephemeris & gps_cnav_eph, - const Galileo_Ephemeris & gal_eph, - const Glonass_Gnav_Ephemeris & glo_gnav_eph, - double obs_time, - const std::map & observables, - unsigned int ref_id, - unsigned int clock_steering_indicator, - unsigned int external_clock_indicator, - int smooth_int, - bool divergence_free, - bool more_messages); + std::string print_MSM_2(const Gps_Ephemeris& gps_eph, + const Gps_CNAV_Ephemeris& gps_cnav_eph, + const Galileo_Ephemeris& gal_eph, + const Glonass_Gnav_Ephemeris& glo_gnav_eph, + double obs_time, + const std::map& observables, + unsigned int ref_id, + unsigned int clock_steering_indicator, + unsigned int external_clock_indicator, + int smooth_int, + bool divergence_free, + bool more_messages); /*! * \brief Prints messages of type MSM3 (Compact GNSS pseudoranges and phaseranges) */ - std::string print_MSM_3( const Gps_Ephemeris & gps_eph, - const Gps_CNAV_Ephemeris & gps_cnav_eph, - const Galileo_Ephemeris & gal_eph, - const Glonass_Gnav_Ephemeris & glo_gnav_eph, - double obs_time, - const std::map & observables, - unsigned int ref_id, - unsigned int clock_steering_indicator, - unsigned int external_clock_indicator, - int smooth_int, - bool divergence_free, - bool more_messages); + std::string print_MSM_3(const Gps_Ephemeris& gps_eph, + const Gps_CNAV_Ephemeris& gps_cnav_eph, + const Galileo_Ephemeris& gal_eph, + const Glonass_Gnav_Ephemeris& glo_gnav_eph, + double obs_time, + const std::map& observables, + unsigned int ref_id, + unsigned int clock_steering_indicator, + unsigned int external_clock_indicator, + int smooth_int, + bool divergence_free, + bool more_messages); /*! * \brief Prints messages of type MSM4 (Full GNSS pseudoranges and phaseranges plus CNR) */ - std::string print_MSM_4( const Gps_Ephemeris & gps_eph, - const Gps_CNAV_Ephemeris & gps_cnav_eph, - const Galileo_Ephemeris & gal_eph, - const Glonass_Gnav_Ephemeris & glo_gnav_eph, - double obs_time, - const std::map & observables, - unsigned int ref_id, - unsigned int clock_steering_indicator, - unsigned int external_clock_indicator, - int smooth_int, - bool divergence_free, - bool more_messages); + std::string print_MSM_4(const Gps_Ephemeris& gps_eph, + const Gps_CNAV_Ephemeris& gps_cnav_eph, + const Galileo_Ephemeris& gal_eph, + const Glonass_Gnav_Ephemeris& glo_gnav_eph, + double obs_time, + const std::map& observables, + unsigned int ref_id, + unsigned int clock_steering_indicator, + unsigned int external_clock_indicator, + int smooth_int, + bool divergence_free, + bool more_messages); /*! * \brief Prints messages of type MSM5 (Full GNSS pseudoranges, phaseranges, phaserange rate and CNR) */ - std::string print_MSM_5( const Gps_Ephemeris & gps_eph, - const Gps_CNAV_Ephemeris & gps_cnav_eph, - const Galileo_Ephemeris & gal_eph, - const Glonass_Gnav_Ephemeris & glo_gnav_eph, - double obs_time, - const std::map & observables, - unsigned int ref_id, - unsigned int clock_steering_indicator, - unsigned int external_clock_indicator, - int smooth_int, - bool divergence_free, - bool more_messages); + std::string print_MSM_5(const Gps_Ephemeris& gps_eph, + const Gps_CNAV_Ephemeris& gps_cnav_eph, + const Galileo_Ephemeris& gal_eph, + const Glonass_Gnav_Ephemeris& glo_gnav_eph, + double obs_time, + const std::map& observables, + unsigned int ref_id, + unsigned int clock_steering_indicator, + unsigned int external_clock_indicator, + int smooth_int, + bool divergence_free, + bool more_messages); /*! * \brief Prints messages of type MSM6 (Full GNSS pseudoranges and phaseranges plus CNR, high resolution) */ - std::string print_MSM_6( const Gps_Ephemeris & gps_eph, - const Gps_CNAV_Ephemeris & gps_cnav_eph, - const Galileo_Ephemeris & gal_eph, - const Glonass_Gnav_Ephemeris & glo_gnav_eph, - double obs_time, - const std::map & observables, - unsigned int ref_id, - unsigned int clock_steering_indicator, - unsigned int external_clock_indicator, - int smooth_int, - bool divergence_free, - bool more_messages); + std::string print_MSM_6(const Gps_Ephemeris& gps_eph, + const Gps_CNAV_Ephemeris& gps_cnav_eph, + const Galileo_Ephemeris& gal_eph, + const Glonass_Gnav_Ephemeris& glo_gnav_eph, + double obs_time, + const std::map& observables, + unsigned int ref_id, + unsigned int clock_steering_indicator, + unsigned int external_clock_indicator, + int smooth_int, + bool divergence_free, + bool more_messages); /*! * \brief Prints messages of type MSM7 (Full GNSS pseudoranges, phaseranges, phaserange rate and CNR, high resolution) */ - std::string print_MSM_7( const Gps_Ephemeris & gps_eph, - const Gps_CNAV_Ephemeris & gps_cnav_eph, - const Galileo_Ephemeris & gal_eph, - const Glonass_Gnav_Ephemeris & glo_gnav_eph, - double obs_time, - const std::map & observables, - unsigned int ref_id, - unsigned int clock_steering_indicator, - unsigned int external_clock_indicator, - int smooth_int, - bool divergence_free, - bool more_messages); + std::string print_MSM_7(const Gps_Ephemeris& gps_eph, + const Gps_CNAV_Ephemeris& gps_cnav_eph, + const Galileo_Ephemeris& gal_eph, + const Glonass_Gnav_Ephemeris& glo_gnav_eph, + double obs_time, + const std::map& observables, + unsigned int ref_id, + unsigned int clock_steering_indicator, + unsigned int external_clock_indicator, + int smooth_int, + bool divergence_free, + bool more_messages); - unsigned int lock_time(const Gps_Ephemeris & eph, double obs_time, const Gnss_Synchro & gnss_synchro); // get_MT1001_4_header(unsigned int msg_number, - double obs_time, - const std::map & observables, - unsigned int ref_id, - unsigned int smooth_int, - bool sync_flag, - bool divergence_free); + double obs_time, + const std::map& observables, + unsigned int ref_id, + unsigned int smooth_int, + bool sync_flag, + bool divergence_free); - std::bitset<58> get_MT1001_sat_content(const Gps_Ephemeris & eph, double obs_time, const Gnss_Synchro & gnss_synchro); - std::bitset<74> get_MT1002_sat_content(const Gps_Ephemeris & eph, double obs_time, const Gnss_Synchro & gnss_synchro); - std::bitset<101> get_MT1003_sat_content(const Gps_Ephemeris & ephL1, const Gps_CNAV_Ephemeris & ephL2, double obs_time, const Gnss_Synchro & gnss_synchroL1, const Gnss_Synchro & gnss_synchroL2); - std::bitset<125> get_MT1004_sat_content(const Gps_Ephemeris & ephL1, const Gps_CNAV_Ephemeris & ephL2, double obs_time, const Gnss_Synchro & gnss_synchroL1, const Gnss_Synchro & gnss_synchroL2); + std::bitset<58> get_MT1001_sat_content(const Gps_Ephemeris& eph, double obs_time, const Gnss_Synchro& gnss_synchro); + std::bitset<74> get_MT1002_sat_content(const Gps_Ephemeris& eph, double obs_time, const Gnss_Synchro& gnss_synchro); + std::bitset<101> get_MT1003_sat_content(const Gps_Ephemeris& ephL1, const Gps_CNAV_Ephemeris& ephL2, double obs_time, const Gnss_Synchro& gnss_synchroL1, const Gnss_Synchro& gnss_synchroL2); + std::bitset<125> get_MT1004_sat_content(const Gps_Ephemeris& ephL1, const Gps_CNAV_Ephemeris& ephL2, double obs_time, const Gnss_Synchro& gnss_synchroL1, const Gnss_Synchro& gnss_synchroL2); std::bitset<152> get_MT1005_test(); @@ -400,12 +400,12 @@ private: * \return Returns the message header content as set of bits */ std::bitset<61> get_MT1009_12_header(unsigned int msg_number, - double obs_time, - const std::map & observables, - unsigned int ref_id, - unsigned int smooth_int, - bool sync_flag, - bool divergence_free); + double obs_time, + const std::map& observables, + unsigned int ref_id, + unsigned int smooth_int, + bool sync_flag, + bool divergence_free); /*! * \brief Get the contents of the satellite specific portion of a type 1009 Message (GLONASS Basic RTK, L1 Only) @@ -416,7 +416,7 @@ private: * \param gnss_synchro Information generated by channels while processing the satellite * \return Returns the message content as set of bits */ - std::bitset<64> get_MT1009_sat_content(const Glonass_Gnav_Ephemeris & ephGNAV, double obs_time, const Gnss_Synchro & gnss_synchro); + std::bitset<64> get_MT1009_sat_content(const Glonass_Gnav_Ephemeris& ephGNAV, double obs_time, const Gnss_Synchro& gnss_synchro); /*! * \brief Get the contents of the satellite specific portion of a type 1010 Message (GLONASS Extended RTK, L1 Only) * \details Contents generated for each satellite. See table 3.5-12 @@ -426,7 +426,7 @@ private: * \param gnss_synchro Information generated by channels while processing the satellite * \return Returns the message content as set of bits */ - std::bitset<79> get_MT1010_sat_content(const Glonass_Gnav_Ephemeris & ephGNAV, double obs_time, const Gnss_Synchro & gnss_synchro); + std::bitset<79> get_MT1010_sat_content(const Glonass_Gnav_Ephemeris& ephGNAV, double obs_time, const Gnss_Synchro& gnss_synchro); /*! * \brief Get the contents of the satellite specific portion of a type 1011 Message (GLONASS Basic RTK, L1 & L2) * \details Contents generated for each satellite. See table 3.5-13 @@ -438,7 +438,7 @@ private: * \param gnss_synchroL2 Information generated by channels while processing the GLONASS GNAV L2 satellite * \return Returns the message content as set of bits */ - std::bitset<107> get_MT1011_sat_content(const Glonass_Gnav_Ephemeris & ephGNAVL1, const Glonass_Gnav_Ephemeris & ephGNAVL2, double obs_time, const Gnss_Synchro & gnss_synchroL1, const Gnss_Synchro & gnss_synchroL2); + std::bitset<107> get_MT1011_sat_content(const Glonass_Gnav_Ephemeris& ephGNAVL1, const Glonass_Gnav_Ephemeris& ephGNAVL2, double obs_time, const Gnss_Synchro& gnss_synchroL1, const Gnss_Synchro& gnss_synchroL2); /*! * \brief Get the contents of the satellite specific portion of a type 1012 Message (GLONASS Extended RTK, L1 & L2) * \details Contents generated for each satellite. See table 3.5-14 @@ -450,39 +450,39 @@ private: * \param gnss_synchroL2 Information generated by channels while processing the GLONASS GNAV L2 satellite * \return Returns the message content as set of bits */ - std::bitset<130> get_MT1012_sat_content(const Glonass_Gnav_Ephemeris & ephGNAVL1, const Glonass_Gnav_Ephemeris & ephGNAVL2, double obs_time, const Gnss_Synchro & gnss_synchroL1, const Gnss_Synchro & gnss_synchroL2); + std::bitset<130> get_MT1012_sat_content(const Glonass_Gnav_Ephemeris& ephGNAVL1, const Glonass_Gnav_Ephemeris& ephGNAVL2, double obs_time, const Gnss_Synchro& gnss_synchroL1, const Gnss_Synchro& gnss_synchroL2); std::string get_MSM_header(unsigned int msg_number, - double obs_time, - const std::map & observables, - unsigned int ref_id, - unsigned int clock_steering_indicator, - unsigned int external_clock_indicator, - int smooth_int, - bool divergence_free, - bool more_messages); + double obs_time, + const std::map& observables, + unsigned int ref_id, + unsigned int clock_steering_indicator, + unsigned int external_clock_indicator, + int smooth_int, + bool divergence_free, + bool more_messages); - std::string get_MSM_1_content_sat_data(const std::map & observables); - std::string get_MSM_4_content_sat_data(const std::map & observables); - std::string get_MSM_5_content_sat_data(const std::map & observables); + std::string get_MSM_1_content_sat_data(const std::map& observables); + std::string get_MSM_4_content_sat_data(const std::map& observables); + std::string get_MSM_5_content_sat_data(const std::map& observables); - std::string get_MSM_1_content_signal_data(const std::map & observables); - std::string get_MSM_2_content_signal_data(const Gps_Ephemeris & ephNAV, const Gps_CNAV_Ephemeris & ephCNAV, const Galileo_Ephemeris & ephFNAV, const Glonass_Gnav_Ephemeris & ephGNAV, double obs_time, const std::map & observables); - std::string get_MSM_3_content_signal_data(const Gps_Ephemeris & ephNAV, const Gps_CNAV_Ephemeris & ephCNAV, const Galileo_Ephemeris & ephFNAV, const Glonass_Gnav_Ephemeris & ephGNAV, double obs_time, const std::map & observables); - std::string get_MSM_4_content_signal_data(const Gps_Ephemeris & ephNAV, const Gps_CNAV_Ephemeris & ephCNAV, const Galileo_Ephemeris & ephFNAV, const Glonass_Gnav_Ephemeris & ephGNAV, double obs_time, const std::map & observables); - std::string get_MSM_5_content_signal_data(const Gps_Ephemeris & ephNAV, const Gps_CNAV_Ephemeris & ephCNAV, const Galileo_Ephemeris & ephFNAV, const Glonass_Gnav_Ephemeris & ephGNAV, double obs_time, const std::map & observables); - std::string get_MSM_6_content_signal_data(const Gps_Ephemeris & ephNAV, const Gps_CNAV_Ephemeris & ephCNAV, const Galileo_Ephemeris & ephFNAV, const Glonass_Gnav_Ephemeris & ephGNAV, double obs_time, const std::map & observables); - std::string get_MSM_7_content_signal_data(const Gps_Ephemeris & ephNAV, const Gps_CNAV_Ephemeris & ephCNAV, const Galileo_Ephemeris & ephFNAV, const Glonass_Gnav_Ephemeris & ephGNAV, double obs_time, const std::map & observables); + std::string get_MSM_1_content_signal_data(const std::map& observables); + std::string get_MSM_2_content_signal_data(const Gps_Ephemeris& ephNAV, const Gps_CNAV_Ephemeris& ephCNAV, const Galileo_Ephemeris& ephFNAV, const Glonass_Gnav_Ephemeris& ephGNAV, double obs_time, const std::map& observables); + std::string get_MSM_3_content_signal_data(const Gps_Ephemeris& ephNAV, const Gps_CNAV_Ephemeris& ephCNAV, const Galileo_Ephemeris& ephFNAV, const Glonass_Gnav_Ephemeris& ephGNAV, double obs_time, const std::map& observables); + std::string get_MSM_4_content_signal_data(const Gps_Ephemeris& ephNAV, const Gps_CNAV_Ephemeris& ephCNAV, const Galileo_Ephemeris& ephFNAV, const Glonass_Gnav_Ephemeris& ephGNAV, double obs_time, const std::map& observables); + std::string get_MSM_5_content_signal_data(const Gps_Ephemeris& ephNAV, const Gps_CNAV_Ephemeris& ephCNAV, const Galileo_Ephemeris& ephFNAV, const Glonass_Gnav_Ephemeris& ephGNAV, double obs_time, const std::map& observables); + std::string get_MSM_6_content_signal_data(const Gps_Ephemeris& ephNAV, const Gps_CNAV_Ephemeris& ephCNAV, const Galileo_Ephemeris& ephFNAV, const Glonass_Gnav_Ephemeris& ephGNAV, double obs_time, const std::map& observables); + std::string get_MSM_7_content_signal_data(const Gps_Ephemeris& ephNAV, const Gps_CNAV_Ephemeris& ephCNAV, const Galileo_Ephemeris& ephFNAV, const Glonass_Gnav_Ephemeris& ephGNAV, double obs_time, const std::map& observables); // // Utilities // static std::map galileo_signal_map; static std::map gps_signal_map; - std::vector > sort_by_signal(const std::vector > & synchro_map) const; - std::vector > sort_by_PRN_mask(const std::vector > & synchro_map) const; + std::vector > sort_by_signal(const std::vector >& synchro_map) const; + std::vector > sort_by_PRN_mask(const std::vector >& synchro_map) const; boost::posix_time::ptime compute_GPS_time(const Gps_Ephemeris& eph, double obs_time) const; - boost::posix_time::ptime compute_GPS_time(const Gps_CNAV_Ephemeris & eph, double obs_time) const; + boost::posix_time::ptime compute_GPS_time(const Gps_CNAV_Ephemeris& eph, double obs_time) const; boost::posix_time::ptime compute_Galileo_time(const Galileo_Ephemeris& eph, double obs_time) const; boost::posix_time::ptime compute_GLONASS_time(const Glonass_Gnav_Ephemeris& eph, double obs_time) const; boost::posix_time::ptime gps_L1_last_lock_time[64]; @@ -503,12 +503,19 @@ private: class Rtcm_Message { public: - enum { header_length = 6 }; - enum { max_body_length = 1029 }; + enum + { + header_length = 6 + }; + enum + { + max_body_length = 1029 + }; Rtcm_Message() - : body_length_(0) - { } + : body_length_(0) + { + } const char* data() const { @@ -551,15 +558,15 @@ private: { char header[header_length + 1] = ""; std::strncat(header, data_, header_length); - if(header[0] != 'G' || header[1] != 'S') + if (header[0] != 'G' || header[1] != 'S') { return false; } char header2_[header_length - 1] = ""; - std::strncat(header2_, data_ + 2 , header_length - 2); + std::strncat(header2_, data_ + 2, header_length - 2); body_length_ = std::atoi(header2_); - if(body_length_ == 0) + if (body_length_ == 0) { return false; } @@ -589,7 +596,7 @@ private: { public: virtual ~Rtcm_Listener() {} - virtual void deliver(const Rtcm_Message & msg) = 0; + virtual void deliver(const Rtcm_Message& msg) = 0; }; @@ -599,7 +606,7 @@ private: inline void join(std::shared_ptr participant) { participants_.insert(participant); - for (auto msg: recent_msgs_) + for (auto msg : recent_msgs_) participant->deliver(msg); } @@ -608,29 +615,32 @@ private: participants_.erase(participant); } - inline void deliver(const Rtcm_Message & msg) + inline void deliver(const Rtcm_Message& msg) { recent_msgs_.push_back(msg); while (recent_msgs_.size() > max_recent_msgs) recent_msgs_.pop_front(); - for (auto participant: participants_) + for (auto participant : participants_) participant->deliver(msg); } private: std::set > participants_; - enum { max_recent_msgs = 1 }; + enum + { + max_recent_msgs = 1 + }; std::deque recent_msgs_; }; class Rtcm_Session - : public Rtcm_Listener, - public std::enable_shared_from_this + : public Rtcm_Listener, + public std::enable_shared_from_this { public: - Rtcm_Session(boost::asio::ip::tcp::socket socket, Rtcm_Listener_Room & room) : socket_(std::move(socket)), room_(room) { } + Rtcm_Session(boost::asio::ip::tcp::socket socket, Rtcm_Listener_Room& room) : socket_(std::move(socket)), room_(room) {} inline void start() { @@ -638,7 +648,7 @@ private: do_read_message_header(); } - inline void deliver(const Rtcm_Message & msg) + inline void deliver(const Rtcm_Message& msg) { bool write_in_progress = !write_msgs_.empty(); write_msgs_.push_back(msg); @@ -653,85 +663,83 @@ private: { auto self(shared_from_this()); boost::asio::async_read(socket_, - boost::asio::buffer(read_msg_.data(), Rtcm_Message::header_length), - [this, self](boost::system::error_code ec, std::size_t /*length*/) - { - if (!ec && read_msg_.decode_header()) - { - do_read_message_body(); - } - else if(!ec && !read_msg_.decode_header()) - { - client_says += read_msg_.data(); - bool first = true; - while(client_says.length() >= 80) - { - if(first == true) - { - std::cout << "Client from " << socket_.remote_endpoint().address() << " says "; - first = false; - } - std::cout << client_says.substr(0, 80) << std::endl; - client_says = client_says.substr(80, client_says.length() - 80); - } - do_read_message_header(); - } - else - { - std::cout << "Closing connection with client from " << socket_.remote_endpoint().address() << std::endl; - room_.leave(shared_from_this()); - } - }); + boost::asio::buffer(read_msg_.data(), Rtcm_Message::header_length), + [this, self](boost::system::error_code ec, std::size_t /*length*/) { + if (!ec && read_msg_.decode_header()) + { + do_read_message_body(); + } + else if (!ec && !read_msg_.decode_header()) + { + client_says += read_msg_.data(); + bool first = true; + while (client_says.length() >= 80) + { + if (first == true) + { + std::cout << "Client from " << socket_.remote_endpoint().address() << " says "; + first = false; + } + std::cout << client_says.substr(0, 80) << std::endl; + client_says = client_says.substr(80, client_says.length() - 80); + } + do_read_message_header(); + } + else + { + std::cout << "Closing connection with client from " << socket_.remote_endpoint().address() << std::endl; + room_.leave(shared_from_this()); + } + }); } inline void do_read_message_body() { auto self(shared_from_this()); boost::asio::async_read(socket_, - boost::asio::buffer(read_msg_.body(), read_msg_.body_length()), - [this, self](boost::system::error_code ec, std::size_t /*length*/) - { - if (!ec) - { - room_.deliver(read_msg_); - //std::cout << "Delivered message (session): "; - //std::cout.write(read_msg_.body(), read_msg_.body_length()); - //std::cout << std::endl; - do_read_message_header(); - } - else - { - std::cout << "Closing connection with client from " << socket_.remote_endpoint().address() << std::endl; - room_.leave(shared_from_this()); - } - }); + boost::asio::buffer(read_msg_.body(), read_msg_.body_length()), + [this, self](boost::system::error_code ec, std::size_t /*length*/) { + if (!ec) + { + room_.deliver(read_msg_); + //std::cout << "Delivered message (session): "; + //std::cout.write(read_msg_.body(), read_msg_.body_length()); + //std::cout << std::endl; + do_read_message_header(); + } + else + { + std::cout << "Closing connection with client from " << socket_.remote_endpoint().address() << std::endl; + room_.leave(shared_from_this()); + } + }); } inline void do_write() { auto self(shared_from_this()); boost::asio::async_write(socket_, - boost::asio::buffer(write_msgs_.front().body(), - write_msgs_.front().body_length()), [this, self](boost::system::error_code ec, std::size_t /*length*/) - { - if(!ec) - { - write_msgs_.pop_front(); - if(!write_msgs_.empty()) - { - do_write(); - } - } - else - { - std::cout << "Closing connection with client from " << socket_.remote_endpoint().address() << std::endl; - room_.leave(shared_from_this()); - } - }); + boost::asio::buffer(write_msgs_.front().body(), + write_msgs_.front().body_length()), + [this, self](boost::system::error_code ec, std::size_t /*length*/) { + if (!ec) + { + write_msgs_.pop_front(); + if (!write_msgs_.empty()) + { + do_write(); + } + } + else + { + std::cout << "Closing connection with client from " << socket_.remote_endpoint().address() << std::endl; + room_.leave(shared_from_this()); + } + }); } boost::asio::ip::tcp::socket socket_; - Rtcm_Listener_Room & room_; + Rtcm_Listener_Room& room_; Rtcm_Message read_msg_; std::deque write_msgs_; std::string client_says; @@ -739,89 +747,85 @@ private: class Tcp_Internal_Client - : public std::enable_shared_from_this + : public std::enable_shared_from_this { public: Tcp_Internal_Client(boost::asio::io_service& io_service, - boost::asio::ip::tcp::resolver::iterator endpoint_iterator) - : io_service_(io_service), socket_(io_service) - { + boost::asio::ip::tcp::resolver::iterator endpoint_iterator) + : io_service_(io_service), socket_(io_service) + { do_connect(endpoint_iterator); - } + } inline void close() { io_service_.post([this]() { socket_.close(); }); } - inline void write(const Rtcm_Message & msg) + inline void write(const Rtcm_Message& msg) { io_service_.post( - [this, msg]() - { - bool write_in_progress = !write_msgs_.empty(); - write_msgs_.push_back(msg); - if (!write_in_progress) - { - do_write(); - } - }); + [this, msg]() { + bool write_in_progress = !write_msgs_.empty(); + write_msgs_.push_back(msg); + if (!write_in_progress) + { + do_write(); + } + }); } private: inline void do_connect(boost::asio::ip::tcp::resolver::iterator endpoint_iterator) { boost::asio::async_connect(socket_, endpoint_iterator, - [this](boost::system::error_code ec, boost::asio::ip::tcp::resolver::iterator) - { - if (!ec) - { - do_read_message(); - } - else - { - std::cout << "Server is down." << std::endl; - } - }); + [this](boost::system::error_code ec, boost::asio::ip::tcp::resolver::iterator) { + if (!ec) + { + do_read_message(); + } + else + { + std::cout << "Server is down." << std::endl; + } + }); } inline void do_read_message() { boost::asio::async_read(socket_, - boost::asio::buffer(read_msg_.data(), 1029), - [this](boost::system::error_code ec, std::size_t /*length*/) - { - if (!ec ) - { - do_read_message(); - } - else - { - std::cout << "Error in client" << std::endl; - socket_.close(); - } - }); + boost::asio::buffer(read_msg_.data(), 1029), + [this](boost::system::error_code ec, std::size_t /*length*/) { + if (!ec) + { + do_read_message(); + } + else + { + std::cout << "Error in client" << std::endl; + socket_.close(); + } + }); } inline void do_write() { boost::asio::async_write(socket_, - boost::asio::buffer(write_msgs_.front().data(), write_msgs_.front().length()), - [this](boost::system::error_code ec, std::size_t /*length*/) - { - if (!ec) - { - write_msgs_.pop_front(); - if (!write_msgs_.empty()) - { - do_write(); - } - } - else - { - socket_.close(); - } - }); + boost::asio::buffer(write_msgs_.front().data(), write_msgs_.front().length()), + [this](boost::system::error_code ec, std::size_t /*length*/) { + if (!ec) + { + write_msgs_.pop_front(); + if (!write_msgs_.empty()) + { + do_write(); + } + } + else + { + socket_.close(); + } + }); } boost::asio::io_service& io_service_; @@ -834,33 +838,34 @@ private: class Queue_Reader { public: - Queue_Reader(boost::asio::io_service& io_service, std::shared_ptr< concurrent_queue > & queue, int port) : queue_(queue) - { + Queue_Reader(boost::asio::io_service& io_service, std::shared_ptr >& queue, int port) : queue_(queue) + { boost::asio::ip::tcp::resolver resolver(io_service); std::string host("localhost"); std::string port_str = std::to_string(port); - auto queue_endpoint_iterator = resolver.resolve({ host.c_str(), port_str.c_str() }); + auto queue_endpoint_iterator = resolver.resolve({host.c_str(), port_str.c_str()}); c = std::make_shared(io_service, queue_endpoint_iterator); - } + } inline void do_read_queue() { - for(;;) + for (;;) { std::string message; Rtcm_Message msg; - queue_->wait_and_pop(message); //message += '\n'; - if(message.compare("Goodbye") == 0) break; - const char *char_msg = message.c_str(); + queue_->wait_and_pop(message); //message += '\n'; + if (message.compare("Goodbye") == 0) break; + const char* char_msg = message.c_str(); msg.body_length(message.length()); std::memcpy(msg.body(), char_msg, msg.body_length()); msg.encode_header(); c->write(msg); } } + private: std::shared_ptr c; - std::shared_ptr< concurrent_queue > & queue_; + std::shared_ptr >& queue_; }; @@ -868,14 +873,14 @@ private: { public: Tcp_Server(boost::asio::io_service& io_service, const boost::asio::ip::tcp::endpoint& endpoint) - : io_service_(io_service), acceptor_(io_service), socket_(io_service) - { + : io_service_(io_service), acceptor_(io_service), socket_(io_service) + { acceptor_.open(endpoint.protocol()); acceptor_.set_option(boost::asio::ip::tcp::acceptor::reuse_address(true)); acceptor_.bind(endpoint); acceptor_.listen(); do_accept(); - } + } inline void close_server() { @@ -886,11 +891,10 @@ private: private: inline void do_accept() { - acceptor_.async_accept(socket_, [this](boost::system::error_code ec) - { + acceptor_.async_accept(socket_, [this](boost::system::error_code ec) { if (!ec) { - if(first_client) + if (first_client) { std::cout << "The TCP Server is up and running. Accepting connections ..." << std::endl; first_client = false; @@ -907,7 +911,7 @@ private: std::cout << "Error when invoking a RTCM session. " << ec << std::endl; } do_accept(); - }); + }); } boost::asio::io_service& io_service_; @@ -918,7 +922,7 @@ private: }; boost::asio::io_service io_service; - std::shared_ptr< concurrent_queue > rtcm_message_queue; + std::shared_ptr > rtcm_message_queue; std::thread t; std::thread tq; std::list servers; @@ -930,8 +934,8 @@ private: // std::bitset<8> preamble; std::bitset<6> reserved_field; - std::string add_CRC(const std::string & m) const; - std::string build_message(const std::string & data) const; // adds 0s to complete a byte and adds the CRC + std::string add_CRC(const std::string& m) const; + std::string build_message(const std::string& data) const; // adds 0s to complete a byte and adds the CRC // // Data Fields @@ -949,47 +953,47 @@ private: int set_DF005(bool sync_flag); std::bitset<5> DF006; - int set_DF006(const std::map & observables); + int set_DF006(const std::map& observables); std::bitset<1> DF007; - int set_DF007(bool divergence_free_smoothing_indicator); // 0 - Divergence-free smoothing not used 1 - Divergence-free smoothing used + int set_DF007(bool divergence_free_smoothing_indicator); // 0 - Divergence-free smoothing not used 1 - Divergence-free smoothing used std::bitset<3> DF008; int set_DF008(short int smoothing_interval); std::bitset<6> DF009; - int set_DF009(const Gnss_Synchro & gnss_synchro); - int set_DF009(const Gps_Ephemeris & gps_eph); + int set_DF009(const Gnss_Synchro& gnss_synchro); + int set_DF009(const Gps_Ephemeris& gps_eph); std::bitset<1> DF010; int set_DF010(bool code_indicator); std::bitset<24> DF011; - int set_DF011(const Gnss_Synchro & gnss_synchro); + int set_DF011(const Gnss_Synchro& gnss_synchro); std::bitset<20> DF012; - int set_DF012(const Gnss_Synchro & gnss_synchro); + int set_DF012(const Gnss_Synchro& gnss_synchro); std::bitset<7> DF013; - int set_DF013(const Gps_Ephemeris & eph, double obs_time, const Gnss_Synchro & gnss_synchro); + int set_DF013(const Gps_Ephemeris& eph, double obs_time, const Gnss_Synchro& gnss_synchro); std::bitset<8> DF014; - int set_DF014(const Gnss_Synchro & gnss_synchro); + int set_DF014(const Gnss_Synchro& gnss_synchro); std::bitset<8> DF015; - int set_DF015(const Gnss_Synchro & gnss_synchro); + int set_DF015(const Gnss_Synchro& gnss_synchro); std::bitset<14> DF017; - int set_DF017(const Gnss_Synchro & gnss_synchroL1, const Gnss_Synchro & gnss_synchroL2); + int set_DF017(const Gnss_Synchro& gnss_synchroL1, const Gnss_Synchro& gnss_synchroL2); std::bitset<20> DF018; - int set_DF018(const Gnss_Synchro & gnss_synchroL1, const Gnss_Synchro & gnss_synchroL2); + int set_DF018(const Gnss_Synchro& gnss_synchroL1, const Gnss_Synchro& gnss_synchroL2); std::bitset<7> DF019; - int set_DF019(const Gps_CNAV_Ephemeris & eph, double obs_time, const Gnss_Synchro & gnss_synchro); + int set_DF019(const Gps_CNAV_Ephemeris& eph, double obs_time, const Gnss_Synchro& gnss_synchro); std::bitset<8> DF020; - int set_DF020(const Gnss_Synchro & gnss_synchro); + int set_DF020(const Gnss_Synchro& gnss_synchro); std::bitset<6> DF021; int set_DF021(); @@ -1029,398 +1033,398 @@ private: * \return returns 0 upon success */ int set_DF034(double obs_time); - std::bitset<27> DF034; //!< GLONASS Epoch Time (tk) + std::bitset<27> DF034; //!< GLONASS Epoch Time (tk) - std::bitset<5> DF035; //!< No. of GLONASS Satellite Signals Processed - int set_DF035(const std::map & observables); + std::bitset<5> DF035; //!< No. of GLONASS Satellite Signals Processed + int set_DF035(const std::map& observables); - std::bitset<1> DF036; //!< GLONASS Divergence-free Smoothing Indicator + std::bitset<1> DF036; //!< GLONASS Divergence-free Smoothing Indicator int set_DF036(bool divergence_free_smoothing_indicator); - std::bitset<3> DF037; //!< GLONASS Smoothing Interval + std::bitset<3> DF037; //!< GLONASS Smoothing Interval int set_DF037(short int smoothing_interval); - std::bitset<6> DF038; //!< GLONASS Satellite ID (Satellite Slot Number) - int set_DF038(const Gnss_Synchro & gnss_synchro); - int set_DF038(const Glonass_Gnav_Ephemeris & glonass_gnav_eph); + std::bitset<6> DF038; //!< GLONASS Satellite ID (Satellite Slot Number) + int set_DF038(const Gnss_Synchro& gnss_synchro); + int set_DF038(const Glonass_Gnav_Ephemeris& glonass_gnav_eph); - std::bitset<1> DF039; //!< GLONASS L1 Code Indicator + std::bitset<1> DF039; //!< GLONASS L1 Code Indicator int set_DF039(bool code_indicator); - std::bitset<5> DF040; //!< GLONASS Satellite Frequency Number + std::bitset<5> DF040; //!< GLONASS Satellite Frequency Number int set_DF040(int frequency_channel_number); - int set_DF040(const Glonass_Gnav_Ephemeris & glonass_gnav_eph); + int set_DF040(const Glonass_Gnav_Ephemeris& glonass_gnav_eph); - std::bitset<25> DF041; //!< GLONASS L1 Pseudorange - int set_DF041(const Gnss_Synchro & gnss_synchro); + std::bitset<25> DF041; //!< GLONASS L1 Pseudorange + int set_DF041(const Gnss_Synchro& gnss_synchro); - std::bitset<20> DF042; //!< GLONASS L1 PhaseRange - L1 Pseudorange - int set_DF042(const Gnss_Synchro & gnss_synchro); + std::bitset<20> DF042; //!< GLONASS L1 PhaseRange - L1 Pseudorange + int set_DF042(const Gnss_Synchro& gnss_synchro); - std::bitset<7> DF043; //!< GLONASS L1 Lock Time Indicator - int set_DF043(const Glonass_Gnav_Ephemeris & eph, double obs_time, const Gnss_Synchro & gnss_synchro); + std::bitset<7> DF043; //!< GLONASS L1 Lock Time Indicator + int set_DF043(const Glonass_Gnav_Ephemeris& eph, double obs_time, const Gnss_Synchro& gnss_synchro); - std::bitset<7> DF044; //!< GLONASS Integer L1 Pseudorange Modulus Ambiguity - int set_DF044(const Gnss_Synchro & gnss_synchro); + std::bitset<7> DF044; //!< GLONASS Integer L1 Pseudorange Modulus Ambiguity + int set_DF044(const Gnss_Synchro& gnss_synchro); - std::bitset<8> DF045; //!< GLONASS L1 CNR - int set_DF045(const Gnss_Synchro & gnss_synchro); + std::bitset<8> DF045; //!< GLONASS L1 CNR + int set_DF045(const Gnss_Synchro& gnss_synchro); - std::bitset<2> DF046; //!< GLONASS L2 code indicator + std::bitset<2> DF046; //!< GLONASS L2 code indicator int set_DF046(unsigned short code_indicator); - std::bitset<14> DF047; //!< GLONASS L2 - L1 Pseudorange Difference - int set_DF047(const Gnss_Synchro & gnss_synchroL1, const Gnss_Synchro & gnss_synchroL2); + std::bitset<14> DF047; //!< GLONASS L2 - L1 Pseudorange Difference + int set_DF047(const Gnss_Synchro& gnss_synchroL1, const Gnss_Synchro& gnss_synchroL2); - std::bitset<20> DF048; //!< GLONASS L2 PhaseRange - L1 Pseudorange - int set_DF048(const Gnss_Synchro & gnss_synchroL1, const Gnss_Synchro & gnss_synchroL2); + std::bitset<20> DF048; //!< GLONASS L2 PhaseRange - L1 Pseudorange + int set_DF048(const Gnss_Synchro& gnss_synchroL1, const Gnss_Synchro& gnss_synchroL2); - std::bitset<7> DF049; //!< GLONASS L2 Lock Time Indicator - int set_DF049(const Glonass_Gnav_Ephemeris & eph, double obs_time, const Gnss_Synchro & gnss_synchro); + std::bitset<7> DF049; //!< GLONASS L2 Lock Time Indicator + int set_DF049(const Glonass_Gnav_Ephemeris& eph, double obs_time, const Gnss_Synchro& gnss_synchro); - std::bitset<8> DF050; //!< GLONASS L2 CNR - int set_DF050(const Gnss_Synchro & gnss_synchro); + std::bitset<8> DF050; //!< GLONASS L2 CNR + int set_DF050(const Gnss_Synchro& gnss_synchro); std::bitset<16> DF051; - int set_DF051(const Gps_Ephemeris & gps_eph, double obs_time); + int set_DF051(const Gps_Ephemeris& gps_eph, double obs_time); std::bitset<17> DF052; - int set_DF052(const Gps_Ephemeris & gps_eph, double obs_time); + int set_DF052(const Gps_Ephemeris& gps_eph, double obs_time); // Contents of GPS Satellite Ephemeris Data, Message Type 1019 std::bitset<8> DF071; - int set_DF071(const Gps_Ephemeris & gps_eph); + int set_DF071(const Gps_Ephemeris& gps_eph); std::bitset<10> DF076; - int set_DF076(const Gps_Ephemeris & gps_eph); + int set_DF076(const Gps_Ephemeris& gps_eph); std::bitset<4> DF077; - int set_DF077(const Gps_Ephemeris & gps_eph); + int set_DF077(const Gps_Ephemeris& gps_eph); std::bitset<2> DF078; - int set_DF078(const Gps_Ephemeris & gps_eph); + int set_DF078(const Gps_Ephemeris& gps_eph); std::bitset<14> DF079; - int set_DF079(const Gps_Ephemeris & gps_eph); + int set_DF079(const Gps_Ephemeris& gps_eph); std::bitset<8> DF080; - int set_DF080(const Gps_Ephemeris & gps_eph); + int set_DF080(const Gps_Ephemeris& gps_eph); std::bitset<16> DF081; - int set_DF081(const Gps_Ephemeris & gps_eph); + int set_DF081(const Gps_Ephemeris& gps_eph); std::bitset<8> DF082; - int set_DF082(const Gps_Ephemeris & gps_eph); + int set_DF082(const Gps_Ephemeris& gps_eph); std::bitset<16> DF083; - int set_DF083(const Gps_Ephemeris & gps_eph); + int set_DF083(const Gps_Ephemeris& gps_eph); std::bitset<22> DF084; - int set_DF084(const Gps_Ephemeris & gps_eph); + int set_DF084(const Gps_Ephemeris& gps_eph); std::bitset<10> DF085; - int set_DF085(const Gps_Ephemeris & gps_eph); + int set_DF085(const Gps_Ephemeris& gps_eph); std::bitset<16> DF086; - int set_DF086(const Gps_Ephemeris & gps_eph); + int set_DF086(const Gps_Ephemeris& gps_eph); std::bitset<16> DF087; - int set_DF087(const Gps_Ephemeris & gps_eph); + int set_DF087(const Gps_Ephemeris& gps_eph); std::bitset<32> DF088; - int set_DF088(const Gps_Ephemeris & gps_eph); + int set_DF088(const Gps_Ephemeris& gps_eph); std::bitset<16> DF089; - int set_DF089(const Gps_Ephemeris & gps_eph); + int set_DF089(const Gps_Ephemeris& gps_eph); std::bitset<32> DF090; - int set_DF090(const Gps_Ephemeris & gps_eph); + int set_DF090(const Gps_Ephemeris& gps_eph); std::bitset<16> DF091; - int set_DF091(const Gps_Ephemeris & gps_eph); + int set_DF091(const Gps_Ephemeris& gps_eph); std::bitset<32> DF092; - int set_DF092(const Gps_Ephemeris & gps_eph); + int set_DF092(const Gps_Ephemeris& gps_eph); std::bitset<16> DF093; - int set_DF093(const Gps_Ephemeris & gps_eph); + int set_DF093(const Gps_Ephemeris& gps_eph); std::bitset<16> DF094; - int set_DF094(const Gps_Ephemeris & gps_eph); + int set_DF094(const Gps_Ephemeris& gps_eph); std::bitset<32> DF095; - int set_DF095(const Gps_Ephemeris & gps_eph); + int set_DF095(const Gps_Ephemeris& gps_eph); std::bitset<16> DF096; - int set_DF096(const Gps_Ephemeris & gps_eph); + int set_DF096(const Gps_Ephemeris& gps_eph); std::bitset<32> DF097; - int set_DF097(const Gps_Ephemeris & gps_eph); + int set_DF097(const Gps_Ephemeris& gps_eph); std::bitset<16> DF098; - int set_DF098(const Gps_Ephemeris & gps_eph); + int set_DF098(const Gps_Ephemeris& gps_eph); std::bitset<32> DF099; - int set_DF099(const Gps_Ephemeris & gps_eph); + int set_DF099(const Gps_Ephemeris& gps_eph); std::bitset<24> DF100; - int set_DF100(const Gps_Ephemeris & gps_eph); + int set_DF100(const Gps_Ephemeris& gps_eph); std::bitset<8> DF101; - int set_DF101(const Gps_Ephemeris & gps_eph); + int set_DF101(const Gps_Ephemeris& gps_eph); std::bitset<6> DF102; - int set_DF102(const Gps_Ephemeris & gps_eph); + int set_DF102(const Gps_Ephemeris& gps_eph); std::bitset<1> DF103; - int set_DF103(const Gps_Ephemeris & gps_eph); + int set_DF103(const Gps_Ephemeris& gps_eph); - std::bitset<1> DF104; //!< GLONASS Almanac Health + std::bitset<1> DF104; //!< GLONASS Almanac Health int set_DF104(unsigned int glonass_gnav_alm_health); - std::bitset<1> DF105; //!< GLONASS Almanac Health Availability Indicator + std::bitset<1> DF105; //!< GLONASS Almanac Health Availability Indicator int set_DF105(unsigned int glonass_gnav_alm_health_ind); - std::bitset<2> DF106; //!< GLONASS P1 Word - int set_DF106(const Glonass_Gnav_Ephemeris & glonass_gnav_eph); + std::bitset<2> DF106; //!< GLONASS P1 Word + int set_DF106(const Glonass_Gnav_Ephemeris& glonass_gnav_eph); - std::bitset<12> DF107; //!< GLONASS Epoch (tk) - int set_DF107(const Glonass_Gnav_Ephemeris & glonass_gnav_eph); + std::bitset<12> DF107; //!< GLONASS Epoch (tk) + int set_DF107(const Glonass_Gnav_Ephemeris& glonass_gnav_eph); - std::bitset<1> DF108; //!< GLONASS MSB of Bn Word - int set_DF108(const Glonass_Gnav_Ephemeris & glonass_gnav_eph); + std::bitset<1> DF108; //!< GLONASS MSB of Bn Word + int set_DF108(const Glonass_Gnav_Ephemeris& glonass_gnav_eph); - std::bitset<1> DF109; //!< GLONASS P2 Word - int set_DF109(const Glonass_Gnav_Ephemeris & glonass_gnav_eph); + std::bitset<1> DF109; //!< GLONASS P2 Word + int set_DF109(const Glonass_Gnav_Ephemeris& glonass_gnav_eph); - std::bitset<7> DF110; //!< GLONASS Ephmeris Epoch (tb) - int set_DF110(const Glonass_Gnav_Ephemeris & glonass_gnav_eph); + std::bitset<7> DF110; //!< GLONASS Ephmeris Epoch (tb) + int set_DF110(const Glonass_Gnav_Ephemeris& glonass_gnav_eph); - std::bitset<24> DF111; //!< GLONASS Xn first derivative - int set_DF111(const Glonass_Gnav_Ephemeris & glonass_gnav_eph); + std::bitset<24> DF111; //!< GLONASS Xn first derivative + int set_DF111(const Glonass_Gnav_Ephemeris& glonass_gnav_eph); - std::bitset<27> DF112; //!< GLONASS Xn - int set_DF112(const Glonass_Gnav_Ephemeris & glonass_gnav_eph); + std::bitset<27> DF112; //!< GLONASS Xn + int set_DF112(const Glonass_Gnav_Ephemeris& glonass_gnav_eph); - std::bitset<5> DF113; //!< GLONASS Xn second derivative - int set_DF113(const Glonass_Gnav_Ephemeris & glonass_gnav_eph); + std::bitset<5> DF113; //!< GLONASS Xn second derivative + int set_DF113(const Glonass_Gnav_Ephemeris& glonass_gnav_eph); - std::bitset<24> DF114; //!< GLONASS Yn first derivative - int set_DF114(const Glonass_Gnav_Ephemeris & glonass_gnav_eph); + std::bitset<24> DF114; //!< GLONASS Yn first derivative + int set_DF114(const Glonass_Gnav_Ephemeris& glonass_gnav_eph); - std::bitset<27> DF115; //!< GLONASS Yn - int set_DF115(const Glonass_Gnav_Ephemeris & glonass_gnav_eph); + std::bitset<27> DF115; //!< GLONASS Yn + int set_DF115(const Glonass_Gnav_Ephemeris& glonass_gnav_eph); - std::bitset<5> DF116; //!< GLONASS Yn second derivative - int set_DF116(const Glonass_Gnav_Ephemeris & glonass_gnav_eph); + std::bitset<5> DF116; //!< GLONASS Yn second derivative + int set_DF116(const Glonass_Gnav_Ephemeris& glonass_gnav_eph); - std::bitset<24> DF117; //!< GLONASS Zn first derivative - int set_DF117(const Glonass_Gnav_Ephemeris & glonass_gnav_eph); + std::bitset<24> DF117; //!< GLONASS Zn first derivative + int set_DF117(const Glonass_Gnav_Ephemeris& glonass_gnav_eph); - std::bitset<27> DF118; //!< GLONASS Zn - int set_DF118(const Glonass_Gnav_Ephemeris & glonass_gnav_eph); + std::bitset<27> DF118; //!< GLONASS Zn + int set_DF118(const Glonass_Gnav_Ephemeris& glonass_gnav_eph); - std::bitset<5> DF119; //!< GLONASS Zn second derivative - int set_DF119(const Glonass_Gnav_Ephemeris & glonass_gnav_eph); + std::bitset<5> DF119; //!< GLONASS Zn second derivative + int set_DF119(const Glonass_Gnav_Ephemeris& glonass_gnav_eph); - std::bitset<1> DF120; //!< GLONASS P3 - int set_DF120(const Glonass_Gnav_Ephemeris & glonass_gnav_eph); + std::bitset<1> DF120; //!< GLONASS P3 + int set_DF120(const Glonass_Gnav_Ephemeris& glonass_gnav_eph); - std::bitset<11> DF121; //!< GLONASS GAMMA_N - int set_DF121(const Glonass_Gnav_Ephemeris & glonass_gnav_eph); + std::bitset<11> DF121; //!< GLONASS GAMMA_N + int set_DF121(const Glonass_Gnav_Ephemeris& glonass_gnav_eph); - std::bitset<2> DF122; //!< GLONASS P - int set_DF122(const Glonass_Gnav_Ephemeris & glonass_gnav_eph); + std::bitset<2> DF122; //!< GLONASS P + int set_DF122(const Glonass_Gnav_Ephemeris& glonass_gnav_eph); - std::bitset<1> DF123; //!< GLONASS ln (third string) - int set_DF123(const Glonass_Gnav_Ephemeris & glonass_gnav_eph); + std::bitset<1> DF123; //!< GLONASS ln (third string) + int set_DF123(const Glonass_Gnav_Ephemeris& glonass_gnav_eph); - std::bitset<22> DF124; //!< GLONASS TAU_N - int set_DF124(const Glonass_Gnav_Ephemeris & glonass_gnav_eph); + std::bitset<22> DF124; //!< GLONASS TAU_N + int set_DF124(const Glonass_Gnav_Ephemeris& glonass_gnav_eph); - std::bitset<5> DF125; //!< GLONASS DELTA_TAU_N - int set_DF125(const Glonass_Gnav_Ephemeris & glonass_gnav_eph); + std::bitset<5> DF125; //!< GLONASS DELTA_TAU_N + int set_DF125(const Glonass_Gnav_Ephemeris& glonass_gnav_eph); - std::bitset<5> DF126; //!< GLONASS Eccentricity - int set_DF126(const Glonass_Gnav_Ephemeris & glonass_gnav_eph); + std::bitset<5> DF126; //!< GLONASS Eccentricity + int set_DF126(const Glonass_Gnav_Ephemeris& glonass_gnav_eph); - std::bitset<1> DF127; //!< GLONASS P4 - int set_DF127(const Glonass_Gnav_Ephemeris & glonass_gnav_eph); + std::bitset<1> DF127; //!< GLONASS P4 + int set_DF127(const Glonass_Gnav_Ephemeris& glonass_gnav_eph); - std::bitset<4> DF128; //!< GLONASS F_T - int set_DF128(const Glonass_Gnav_Ephemeris & glonass_gnav_eph); + std::bitset<4> DF128; //!< GLONASS F_T + int set_DF128(const Glonass_Gnav_Ephemeris& glonass_gnav_eph); - std::bitset<11> DF129; //!< GLONASS N_T - int set_DF129(const Glonass_Gnav_Ephemeris & glonass_gnav_eph); + std::bitset<11> DF129; //!< GLONASS N_T + int set_DF129(const Glonass_Gnav_Ephemeris& glonass_gnav_eph); - std::bitset<2> DF130; //!< GLONASS M - int set_DF130(const Glonass_Gnav_Ephemeris & glonass_gnav_eph); + std::bitset<2> DF130; //!< GLONASS M + int set_DF130(const Glonass_Gnav_Ephemeris& glonass_gnav_eph); - std::bitset<1> DF131; //!< GLONASS Availability of additional data + std::bitset<1> DF131; //!< GLONASS Availability of additional data int set_DF131(unsigned int fifth_str_additional_data_ind); - std::bitset<11> DF132; //!< GLONASS N_A - int set_DF132(const Glonass_Gnav_Utc_Model & glonass_gnav_utc_model); + std::bitset<11> DF132; //!< GLONASS N_A + int set_DF132(const Glonass_Gnav_Utc_Model& glonass_gnav_utc_model); - std::bitset<32> DF133; //!< GLONASS TAU_C - int set_DF133(const Glonass_Gnav_Utc_Model & glonass_gnav_utc_model); + std::bitset<32> DF133; //!< GLONASS TAU_C + int set_DF133(const Glonass_Gnav_Utc_Model& glonass_gnav_utc_model); - std::bitset<5> DF134; //!< GLONASS N_4 - int set_DF134(const Glonass_Gnav_Utc_Model & glonass_gnav_utc_model); + std::bitset<5> DF134; //!< GLONASS N_4 + int set_DF134(const Glonass_Gnav_Utc_Model& glonass_gnav_utc_model); - std::bitset<22> DF135; //!< GLONASS TAU_GPS - int set_DF135(const Glonass_Gnav_Utc_Model & glonass_gnav_utc_model); + std::bitset<22> DF135; //!< GLONASS TAU_GPS + int set_DF135(const Glonass_Gnav_Utc_Model& glonass_gnav_utc_model); - std::bitset<1> DF136; //!< GLONASS L_N (FIFTH STRING) - int set_DF136(const Glonass_Gnav_Ephemeris & glonass_gnav_eph); + std::bitset<1> DF136; //!< GLONASS L_N (FIFTH STRING) + int set_DF136(const Glonass_Gnav_Ephemeris& glonass_gnav_eph); std::bitset<1> DF137; - int set_DF137(const Gps_Ephemeris & gps_eph); + int set_DF137(const Gps_Ephemeris& gps_eph); std::bitset<1> DF141; - int set_DF141(const Gps_Ephemeris & gps_eph); + int set_DF141(const Gps_Ephemeris& gps_eph); std::bitset<1> DF142; - int set_DF142(const Gps_Ephemeris & gps_eph); + int set_DF142(const Gps_Ephemeris& gps_eph); std::bitset<30> DF248; int set_DF248(double obs_time); // Contents of Galileo F/NAV Satellite Ephemeris Data, Message Type 1045 std::bitset<6> DF252; - int set_DF252(const Galileo_Ephemeris & gal_eph); + int set_DF252(const Galileo_Ephemeris& gal_eph); std::bitset<12> DF289; - int set_DF289(const Galileo_Ephemeris & gal_eph); + int set_DF289(const Galileo_Ephemeris& gal_eph); std::bitset<10> DF290; - int set_DF290(const Galileo_Ephemeris & gal_eph); + int set_DF290(const Galileo_Ephemeris& gal_eph); std::bitset<8> DF291; - int set_DF291(const Galileo_Ephemeris & gal_eph); + int set_DF291(const Galileo_Ephemeris& gal_eph); std::bitset<14> DF292; - int set_DF292(const Galileo_Ephemeris & gal_eph); + int set_DF292(const Galileo_Ephemeris& gal_eph); std::bitset<14> DF293; - int set_DF293(const Galileo_Ephemeris & gal_eph); + int set_DF293(const Galileo_Ephemeris& gal_eph); std::bitset<6> DF294; - int set_DF294(const Galileo_Ephemeris & gal_eph); + int set_DF294(const Galileo_Ephemeris& gal_eph); std::bitset<21> DF295; - int set_DF295(const Galileo_Ephemeris & gal_eph); + int set_DF295(const Galileo_Ephemeris& gal_eph); std::bitset<31> DF296; - int set_DF296(const Galileo_Ephemeris & gal_eph); + int set_DF296(const Galileo_Ephemeris& gal_eph); std::bitset<16> DF297; - int set_DF297(const Galileo_Ephemeris & gal_eph); + int set_DF297(const Galileo_Ephemeris& gal_eph); std::bitset<16> DF298; - int set_DF298(const Galileo_Ephemeris & gal_eph); + int set_DF298(const Galileo_Ephemeris& gal_eph); std::bitset<32> DF299; - int set_DF299(const Galileo_Ephemeris & gal_eph); + int set_DF299(const Galileo_Ephemeris& gal_eph); std::bitset<16> DF300; - int set_DF300(const Galileo_Ephemeris & gal_eph); + int set_DF300(const Galileo_Ephemeris& gal_eph); std::bitset<32> DF301; - int set_DF301(const Galileo_Ephemeris & gal_eph); + int set_DF301(const Galileo_Ephemeris& gal_eph); std::bitset<16> DF302; - int set_DF302(const Galileo_Ephemeris & gal_eph); + int set_DF302(const Galileo_Ephemeris& gal_eph); std::bitset<32> DF303; - int set_DF303(const Galileo_Ephemeris & gal_eph); + int set_DF303(const Galileo_Ephemeris& gal_eph); std::bitset<14> DF304; - int set_DF304(const Galileo_Ephemeris & gal_eph); + int set_DF304(const Galileo_Ephemeris& gal_eph); std::bitset<16> DF305; - int set_DF305(const Galileo_Ephemeris & gal_eph); + int set_DF305(const Galileo_Ephemeris& gal_eph); std::bitset<32> DF306; - int set_DF306(const Galileo_Ephemeris & gal_eph); + int set_DF306(const Galileo_Ephemeris& gal_eph); std::bitset<16> DF307; - int set_DF307(const Galileo_Ephemeris & gal_eph); + int set_DF307(const Galileo_Ephemeris& gal_eph); std::bitset<32> DF308; - int set_DF308(const Galileo_Ephemeris & gal_eph); + int set_DF308(const Galileo_Ephemeris& gal_eph); std::bitset<16> DF309; - int set_DF309(const Galileo_Ephemeris & gal_eph); + int set_DF309(const Galileo_Ephemeris& gal_eph); std::bitset<32> DF310; - int set_DF310(const Galileo_Ephemeris & gal_eph); + int set_DF310(const Galileo_Ephemeris& gal_eph); std::bitset<24> DF311; - int set_DF311(const Galileo_Ephemeris & gal_eph); + int set_DF311(const Galileo_Ephemeris& gal_eph); std::bitset<10> DF312; - int set_DF312(const Galileo_Ephemeris & gal_eph); + int set_DF312(const Galileo_Ephemeris& gal_eph); std::bitset<10> DF313; - int set_DF313(const Galileo_Ephemeris & gal_eph); + int set_DF313(const Galileo_Ephemeris& gal_eph); std::bitset<2> DF314; - int set_DF314(const Galileo_Ephemeris & gal_eph); + int set_DF314(const Galileo_Ephemeris& gal_eph); std::bitset<1> DF315; - int set_DF315(const Galileo_Ephemeris & gal_eph); + int set_DF315(const Galileo_Ephemeris& gal_eph); std::bitset<2> DF364; // Content of message header for MSM1, MSM2, MSM3, MSM4, MSM5, MSM6 and MSM7 std::bitset<1> DF393; - int set_DF393(bool more_messages); //1 indicates that more MSMs follow for given physical time and reference station ID + int set_DF393(bool more_messages); //1 indicates that more MSMs follow for given physical time and reference station ID std::bitset<64> DF394; - int set_DF394(const std::map & observables); + int set_DF394(const std::map& observables); std::bitset<32> DF395; - int set_DF395(const std::map & observables); + int set_DF395(const std::map& observables); - std::string set_DF396(const std::map & observables); + std::string set_DF396(const std::map& observables); std::bitset<8> DF397; - int set_DF397(const Gnss_Synchro & gnss_synchro); + int set_DF397(const Gnss_Synchro& gnss_synchro); std::bitset<10> DF398; - int set_DF398(const Gnss_Synchro & gnss_synchro); + int set_DF398(const Gnss_Synchro& gnss_synchro); std::bitset<14> DF399; - int set_DF399(const Gnss_Synchro & gnss_synchro); + int set_DF399(const Gnss_Synchro& gnss_synchro); std::bitset<15> DF400; - int set_DF400(const Gnss_Synchro & gnss_synchro); + int set_DF400(const Gnss_Synchro& gnss_synchro); std::bitset<22> DF401; - int set_DF401(const Gnss_Synchro & gnss_synchro); + int set_DF401(const Gnss_Synchro& gnss_synchro); std::bitset<4> DF402; - int set_DF402(const Gps_Ephemeris & ephNAV, const Gps_CNAV_Ephemeris & ephCNAV, const Galileo_Ephemeris & ephFNAV, const Glonass_Gnav_Ephemeris & ephGNAV, double obs_time, const Gnss_Synchro & gnss_synchro); + int set_DF402(const Gps_Ephemeris& ephNAV, const Gps_CNAV_Ephemeris& ephCNAV, const Galileo_Ephemeris& ephFNAV, const Glonass_Gnav_Ephemeris& ephGNAV, double obs_time, const Gnss_Synchro& gnss_synchro); std::bitset<6> DF403; - int set_DF403(const Gnss_Synchro & gnss_synchro); + int set_DF403(const Gnss_Synchro& gnss_synchro); std::bitset<15> DF404; - int set_DF404(const Gnss_Synchro & gnss_synchro); + int set_DF404(const Gnss_Synchro& gnss_synchro); std::bitset<20> DF405; - int set_DF405(const Gnss_Synchro & gnss_synchro); + int set_DF405(const Gnss_Synchro& gnss_synchro); std::bitset<24> DF406; - int set_DF406(const Gnss_Synchro & gnss_synchro); + int set_DF406(const Gnss_Synchro& gnss_synchro); std::bitset<10> DF407; - int set_DF407(const Gps_Ephemeris & ephNAV, const Gps_CNAV_Ephemeris & ephCNAV, const Galileo_Ephemeris & ephFNAV, const Glonass_Gnav_Ephemeris & ephGNAV, double obs_time, const Gnss_Synchro & gnss_synchro); + int set_DF407(const Gps_Ephemeris& ephNAV, const Gps_CNAV_Ephemeris& ephCNAV, const Galileo_Ephemeris& ephFNAV, const Glonass_Gnav_Ephemeris& ephGNAV, double obs_time, const Gnss_Synchro& gnss_synchro); std::bitset<10> DF408; - int set_DF408(const Gnss_Synchro & gnss_synchro); + int set_DF408(const Gnss_Synchro& gnss_synchro); std::bitset<3> DF409; int set_DF409(unsigned int iods); @@ -1438,7 +1442,7 @@ private: int set_DF418(int carrier_smoothing_interval_s); std::bitset<1> DF420; - int set_DF420(const Gnss_Synchro & gnss_synchro); + int set_DF420(const Gnss_Synchro& gnss_synchro); }; #endif diff --git a/src/core/system_parameters/sbas_ephemeris.cc b/src/core/system_parameters/sbas_ephemeris.cc index b093ea3c7..0c717ac61 100644 --- a/src/core/system_parameters/sbas_ephemeris.cc +++ b/src/core/system_parameters/sbas_ephemeris.cc @@ -35,13 +35,13 @@ void Sbas_Ephemeris::print(std::ostream &out) { out << "<> PRN" << i_prn << ":"; - out << " d_t0=" << i_t0; - out << " d_tof=" << d_tof; - out << " i_sv_ura=" << i_sv_ura; - out << " b_sv_do_not_use=" << b_sv_do_not_use; + out << " d_t0=" << i_t0; + out << " d_tof=" << d_tof; + out << " i_sv_ura=" << i_sv_ura; + out << " b_sv_do_not_use=" << b_sv_do_not_use; out << " d_pos=(x=" << d_pos[0] << ", y=" << d_pos[1] << ", z=" << d_pos[2] << ")"; out << " d_vel=(x=" << d_vel[0] << ", y=" << d_vel[1] << ", z=" << d_vel[2] << ")"; out << " d_acc=(x=" << d_acc[0] << ", y=" << d_acc[1] << ", z=" << d_acc[2] << ")"; - out << " d_af0=" << d_af0; - out << " d_af1=" << d_af1; + out << " d_af0=" << d_af0; + out << " d_af1=" << d_af1; } diff --git a/src/core/system_parameters/sbas_ephemeris.h b/src/core/system_parameters/sbas_ephemeris.h index 62c63b38e..13743c846 100644 --- a/src/core/system_parameters/sbas_ephemeris.h +++ b/src/core/system_parameters/sbas_ephemeris.h @@ -42,18 +42,18 @@ class Sbas_Ephemeris { public: void print(std::ostream &out); - int i_prn; //!< PRN number + int i_prn; //!< PRN number //gtime_t t0; // reference epoch time (GPST) int i_t0; //gtime_t tof; // time of message frame (GPST) double d_tof; - int i_sv_ura; //!< SV accuracy (URA index), not standardized - bool b_sv_do_not_use; //!< Health status (false:do not use / true:usable) - double d_pos[3]; //!< Satellite position (m) (ECEF) - double d_vel[3]; //!< Satellite velocity (m/s) (ECEF) - double d_acc[3]; //!< Satellite acceleration (m/s^2) (ECEF) - double d_af0; //!< Satellite clock-offset (s) - double d_af1; //!< Satellite drift (s/s) + int i_sv_ura; //!< SV accuracy (URA index), not standardized + bool b_sv_do_not_use; //!< Health status (false:do not use / true:usable) + double d_pos[3]; //!< Satellite position (m) (ECEF) + double d_vel[3]; //!< Satellite velocity (m/s) (ECEF) + double d_acc[3]; //!< Satellite acceleration (m/s^2) (ECEF) + double d_af0; //!< Satellite clock-offset (s) + double d_af1; //!< Satellite drift (s/s) }; diff --git a/src/main/main.cc b/src/main/main.cc index 89634a6ec..f50f2b0dd 100644 --- a/src/main/main.cc +++ b/src/main/main.cc @@ -45,9 +45,9 @@ #include "gnss_sdr_flags.h" #include #include -#include // for create_directories, exists -#include // for path, operator<< -#include // for filesystem +#include // for create_directories, exists +#include // for path, operator<< +#include // for filesystem #include #include #include @@ -55,8 +55,8 @@ #if CUDA_GPU_ACCEL - // For the CUDA runtime routines (prefixed with "cuda_") - #include +// For the CUDA runtime routines (prefixed with "cuda_") +#include #endif @@ -75,13 +75,10 @@ concurrent_map global_gps_acq_assist_map; int main(int argc, char** argv) { const std::string intro_help( - std::string("\nGNSS-SDR is an Open Source GNSS Software Defined Receiver\n") - + - "Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors)\n" - + - "This program comes with ABSOLUTELY NO WARRANTY;\n" - + - "See COPYING file to see a copy of the General Public License\n \n"); + std::string("\nGNSS-SDR is an Open Source GNSS Software Defined Receiver\n") + + "Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors)\n" + + "This program comes with ABSOLUTELY NO WARRANTY;\n" + + "See COPYING file to see a copy of the General Public License\n \n"); const std::string gnss_sdr_version(GNSS_SDR_VERSION); google::SetUsageMessage(intro_help); @@ -89,18 +86,18 @@ int main(int argc, char** argv) google::ParseCommandLineFlags(&argc, &argv, true); std::cout << "Initializing GNSS-SDR v" << gnss_sdr_version << " ... Please wait." << std::endl; - #if CUDA_GPU_ACCEL - // Reset the device - // cudaDeviceReset causes the driver to clean up all state. While - // not mandatory in normal operation, it is good practice. It is also - // needed to ensure correct operation when the application is being - // profiled. Calling cudaDeviceReset causes all profile data to be - // flushed before the application exits - cudaDeviceReset(); - std::cout << "Reset CUDA device done " << std::endl; - #endif +#if CUDA_GPU_ACCEL + // Reset the device + // cudaDeviceReset causes the driver to clean up all state. While + // not mandatory in normal operation, it is good practice. It is also + // needed to ensure correct operation when the application is being + // profiled. Calling cudaDeviceReset causes all profile data to be + // flushed before the application exits + cudaDeviceReset(); + std::cout << "Reset CUDA device done " << std::endl; +#endif - if(GOOGLE_STRIP_LOG == 0) + if (GOOGLE_STRIP_LOG == 0) { google::InitGoogleLogging(argv[0]); if (FLAGS_log_dir.empty()) @@ -113,7 +110,7 @@ int main(int argc, char** argv) } else { - const boost::filesystem::path p (FLAGS_log_dir); + const boost::filesystem::path p(FLAGS_log_dir); if (!boost::filesystem::exists(p)) { std::cout << "The path " @@ -121,7 +118,7 @@ int main(int argc, char** argv) << " does not exist, attempting to create it." << std::endl; boost::system::error_code ec; - if(!boost::filesystem::create_directory(p, ec)) + if (!boost::filesystem::create_directory(p, ec)) { std::cout << "Could not create the " << FLAGS_log_dir << " folder. GNSS-SDR program ended." << std::endl; google::ShutDownCommandLineFlags(); @@ -139,12 +136,12 @@ int main(int argc, char** argv) start = std::chrono::system_clock::now(); try - { + { control_thread->run(); - } - catch(const boost::exception & e) - { - if(GOOGLE_STRIP_LOG == 0) + } + catch (const boost::exception& e) + { + if (GOOGLE_STRIP_LOG == 0) { LOG(WARNING) << "Boost exception: " << boost::diagnostic_information(e); } @@ -154,10 +151,10 @@ int main(int argc, char** argv) } google::ShutDownCommandLineFlags(); return 1; - } - catch(const std::exception & ex) - { - if(GOOGLE_STRIP_LOG == 0) + } + catch (const std::exception& ex) + { + if (GOOGLE_STRIP_LOG == 0) { LOG(WARNING) << "C++ Standard Library exception: " << ex.what(); } @@ -167,10 +164,10 @@ int main(int argc, char** argv) } google::ShutDownCommandLineFlags(); return 1; - } - catch(...) - { - if(GOOGLE_STRIP_LOG == 0) + } + catch (...) + { + if (GOOGLE_STRIP_LOG == 0) { LOG(WARNING) << "Unexpected catch. This should not happen."; } @@ -180,7 +177,7 @@ int main(int argc, char** argv) } google::ShutDownCommandLineFlags(); return 1; - } + } // report the elapsed time end = std::chrono::system_clock::now(); diff --git a/src/tests/common-files/gnuplot_i.h b/src/tests/common-files/gnuplot_i.h index 1f4a5cafb..ef0f6cecb 100644 --- a/src/tests/common-files/gnuplot_i.h +++ b/src/tests/common-files/gnuplot_i.h @@ -52,24 +52,24 @@ #include #include #include -#include // for std::ostringstream +#include // for std::ostringstream #include #include -#include // for getenv() +#include // for getenv() #include -#include // for std::list +#include // for std::list #if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__TOS_WIN__) //defined for 32 and 64-bit environments - #include // for _access(), _mktemp() - #define GP_MAX_TMP_FILES 27 // 27 temporary files it's Microsoft restriction +#include // for _access(), _mktemp() +#define GP_MAX_TMP_FILES 27 // 27 temporary files it's Microsoft restriction #elif defined(unix) || defined(__unix) || defined(__unix__) || defined(__APPLE__) //all UNIX-like OSs (Linux, *BSD, MacOSX, Solaris, ...) - #include // for access(), mkstemp() - #define GP_MAX_TMP_FILES 64 +#include // for access(), mkstemp() +#define GP_MAX_TMP_FILES 64 #else - #error unsupported or unknown operating system +#error unsupported or unknown operating system #endif //declare classes in global namespace @@ -78,41 +78,40 @@ class GnuplotException : public std::runtime_error { public: - GnuplotException(const std::string &msg) : std::runtime_error(msg){} + GnuplotException(const std::string &msg) : std::runtime_error(msg) {} }; - class Gnuplot { private: //---------------------------------------------------------------------------------- // member data ///\brief pointer to the stream that can be used to write to the pipe - FILE *gnucmd; + FILE *gnucmd; ///\brief validation of gnuplot session - bool valid; + bool valid; ///\brief true = 2d, false = 3d - bool two_dim; + bool two_dim; ///\brief number of plots in session - int nplots; + int nplots; ///\brief functions and data are displayed in a defined styles - std::string pstyle; + std::string pstyle; ///\brief interpolate and approximate data in defined styles (e.g. spline) - std::string smooth; + std::string smooth; ///\brief list of created tmpfiles std::vector tmpfile_list; //---------------------------------------------------------------------------------- // static data ///\brief number of all tmpfiles (number of tmpfiles restricted) - static int tmpfile_num; + static int tmpfile_num; ///\brief name of executed GNUPlot file - static std::string m_sGNUPlotFileName; + static std::string m_sGNUPlotFileName; ///\brief gnuplot path - static std::string m_sGNUPlotPath; + static std::string m_sGNUPlotPath; ///\brief standart terminal, used by showonscreen - static std::string terminal_std; + static std::string terminal_std; //---------------------------------------------------------------------------------- // member functions (auxiliary functions) @@ -161,7 +160,7 @@ private: /// /// \return file exists (yes == true, no == false) // --------------------------------------------------------------------------------- - static bool file_exists(const std::string &filename, int mode=0); + static bool file_exists(const std::string &filename, int mode = 0); public: // ---------------------------------------------------------------------------- @@ -193,28 +192,28 @@ public: /// plot a single std::vector at one go Gnuplot(const std::vector &x, - const std::string &title = "", - const std::string &style = "points", - const std::string &labelx = "x", - const std::string &labely = "y"); + const std::string &title = "", + const std::string &style = "points", + const std::string &labelx = "x", + const std::string &labely = "y"); /// plot pairs std::vector at one go Gnuplot(const std::vector &x, - const std::vector &y, - const std::string &title = "", - const std::string &style = "points", - const std::string &labelx = "x", - const std::string &labely = "y"); + const std::vector &y, + const std::string &title = "", + const std::string &style = "points", + const std::string &labelx = "x", + const std::string &labely = "y"); /// plot triples std::vector at one go Gnuplot(const std::vector &x, - const std::vector &y, - const std::vector &z, - const std::string &title = "", - const std::string &style = "points", - const std::string &labelx = "x", - const std::string &labely = "y", - const std::string &labelz = "z"); + const std::vector &y, + const std::vector &z, + const std::string &title = "", + const std::string &style = "points", + const std::string &labelx = "x", + const std::string &labely = "y", + const std::string &labelz = "z"); /// destructor: needed to delete temporary files ~Gnuplot(); @@ -222,7 +221,7 @@ public: //---------------------------------------------------------------------------------- /// send a command to gnuplot - Gnuplot& cmd(const std::string &cmdstr); + Gnuplot &cmd(const std::string &cmdstr); // --------------------------------------------------------------------------------- ///\brief Sends a command to an active gnuplot session, identical to cmd() @@ -232,23 +231,23 @@ public: /// /// \return <-- a reference to the gnuplot object // --------------------------------------------------------------------------------- - inline Gnuplot& operator<<(const std::string &cmdstr) + inline Gnuplot &operator<<(const std::string &cmdstr) { cmd(cmdstr); - return(*this); + return (*this); } //---------------------------------------------------------------------------------- // show on screen or write to file /// sets terminal type to terminal_std - Gnuplot& showonscreen(); // window output is set by default (win/x11/aqua) + Gnuplot &showonscreen(); // window output is set by default (win/x11/aqua) /// saves a gnuplot session to a postscript file, filename without extension - Gnuplot& savetops(const std::string &filename = "gnuplot_output"); + Gnuplot &savetops(const std::string &filename = "gnuplot_output"); /// saves a gnuplot session to a pdf file, filename without extension - Gnuplot& savetopdf(const std::string &filename = "gnuplot_output", unsigned int font_size = 12); + Gnuplot &savetopdf(const std::string &filename = "gnuplot_output", unsigned int font_size = 12); //---------------------------------------------------------------------------------- // set and unset @@ -256,13 +255,13 @@ public: /// set line style (some of these styles require additional information): /// lines, points, linespoints, impulses, dots, steps, fsteps, histeps, /// boxes, histograms, filledcurves - Gnuplot& set_style(const std::string &stylestr = "points"); + Gnuplot &set_style(const std::string &stylestr = "points"); /// interpolation and approximation of data, arguments: /// csplines, bezier, acsplines (for data values > 0), sbezier, unique, frequency /// (works only with plot_x, plot_xy, plotfile_x, plotfile_xy /// (if smooth is set, set_style has no effekt on data plotting) - Gnuplot& set_smooth(const std::string &stylestr = "csplines"); + Gnuplot &set_smooth(const std::string &stylestr = "csplines"); // ---------------------------------------------------------------------- /// \brief unset smooth @@ -272,15 +271,27 @@ public: /// /// \return <-- a reference to a gnuplot object // ---------------------------------------------------------------------- - inline Gnuplot& unset_smooth(){ smooth = ""; return *this;}; + inline Gnuplot &unset_smooth() + { + smooth = ""; + return *this; + }; /// scales the size of the points used in plots - Gnuplot& set_pointsize(const double pointsize = 1.0); + Gnuplot &set_pointsize(const double pointsize = 1.0); /// turns grid on/off - inline Gnuplot& set_grid() {cmd("set grid"); return *this;}; + inline Gnuplot &set_grid() + { + cmd("set grid"); + return *this; + }; /// grid is not set by default - inline Gnuplot& unset_grid(){cmd("unset grid"); return *this;}; + inline Gnuplot &unset_grid() + { + cmd("unset grid"); + return *this; + }; // ----------------------------------------------- /// set the mulitplot mode @@ -289,7 +300,11 @@ public: /// /// \return <-- reference to the gnuplot object // ----------------------------------------------- - inline Gnuplot& set_multiplot(){cmd("set multiplot") ; return *this;}; + inline Gnuplot &set_multiplot() + { + cmd("set multiplot"); + return *this; + }; // ----------------------------------------------- /// unsets the mulitplot mode @@ -298,12 +313,16 @@ public: /// /// \return <-- reference to the gnuplot object // ----------------------------------------------- - inline Gnuplot& unset_multiplot(){cmd("unset multiplot"); return *this;}; + inline Gnuplot &unset_multiplot() + { + cmd("unset multiplot"); + return *this; + }; /// set sampling rate of functions, or for interpolating data - Gnuplot& set_samples(const int samples = 100); + Gnuplot &set_samples(const int samples = 100); /// set isoline density (grid) for plotting functions as surfaces (for 3d plots) - Gnuplot& set_isosamples(const int isolines = 10); + Gnuplot &set_isosamples(const int isolines = 10); // -------------------------------------------------------------------------- /// enables/disables hidden line removal for surface plotting (for 3d plot) @@ -312,7 +331,11 @@ public: /// /// \return <-- reference to the gnuplot object // -------------------------------------------------------------------------- - Gnuplot& set_hidden3d(){cmd("set hidden3d"); return *this;}; + Gnuplot &set_hidden3d() + { + cmd("set hidden3d"); + return *this; + }; // --------------------------------------------------------------------------- /// hidden3d is not set by default @@ -321,11 +344,15 @@ public: /// /// \return <-- reference to the gnuplot object // --------------------------------------------------------------------------- - inline Gnuplot& unset_hidden3d(){cmd("unset hidden3d"); return *this;}; + inline Gnuplot &unset_hidden3d() + { + cmd("unset hidden3d"); + return *this; + }; /// enables/disables contour drawing for surfaces (for 3d plot) /// base, surface, both - Gnuplot& set_contour(const std::string &position = "base"); + Gnuplot &set_contour(const std::string &position = "base"); // -------------------------------------------------------------------------- /// contour is not set by default, it disables contour drawing for surfaces /// @@ -333,7 +360,11 @@ public: /// /// \return <-- reference to the gnuplot object // ------------------------------------------------------------------ - inline Gnuplot& unset_contour(){cmd("unset contour"); return *this;}; + inline Gnuplot &unset_contour() + { + cmd("unset contour"); + return *this; + }; // ------------------------------------------------------------ /// enables/disables the display of surfaces (for 3d plot) @@ -342,7 +373,11 @@ public: /// /// \return <-- reference to the gnuplot object // ------------------------------------------------------------------ - inline Gnuplot& set_surface(){cmd("set surface"); return *this;}; + inline Gnuplot &set_surface() + { + cmd("set surface"); + return *this; + }; // ---------------------------------------------------------- /// surface is set by default, @@ -352,12 +387,16 @@ public: /// /// \return <-- reference to the gnuplot object // ------------------------------------------------------------------ - inline Gnuplot& unset_surface(){cmd("unset surface"); return *this;} + inline Gnuplot &unset_surface() + { + cmd("unset surface"); + return *this; + } /// switches legend on/off /// position: inside/outside, left/center/right, top/center/bottom, nobox/box - Gnuplot& set_legend(const std::string &position = "default"); + Gnuplot &set_legend(const std::string &position = "default"); // ------------------------------------------------------------------ /// \brief Switches legend off @@ -367,7 +406,11 @@ public: /// /// \return <-- reference to the gnuplot object // ------------------------------------------------------------------ - inline Gnuplot& unset_legend(){cmd("unset key"); return *this;} + inline Gnuplot &unset_legend() + { + cmd("unset key"); + return *this; + } // ----------------------------------------------------------------------- /// \brief sets and clears the title of a gnuplot session @@ -376,13 +419,13 @@ public: /// /// \return <-- reference to the gnuplot object // ----------------------------------------------------------------------- - inline Gnuplot& set_title(const std::string &title = "") + inline Gnuplot &set_title(const std::string &title = "") { std::string cmdstr; cmdstr = "set title \""; - cmdstr+=title; - cmdstr+="\""; - *this<set_title(); return *this;} + inline Gnuplot &unset_title() + { + this->set_title(); + return *this; + } /// set x axis label - Gnuplot& set_ylabel(const std::string &label = "x"); + Gnuplot &set_ylabel(const std::string &label = "x"); /// set y axis label - Gnuplot& set_xlabel(const std::string &label = "y"); + Gnuplot &set_xlabel(const std::string &label = "y"); /// set z axis label - Gnuplot& set_zlabel(const std::string &label = "z"); + Gnuplot &set_zlabel(const std::string &label = "z"); /// set axis - ranges - Gnuplot& set_xrange(const double iFrom, const double iTo); + Gnuplot &set_xrange(const double iFrom, const double iTo); /// set y-axis - ranges - Gnuplot& set_yrange(const double iFrom, const double iTo); + Gnuplot &set_yrange(const double iFrom, const double iTo); /// set z-axis - ranges - Gnuplot& set_zrange(const double iFrom, const double iTo); + Gnuplot &set_zrange(const double iFrom, const double iTo); /// autoscale axis (set by default) of xaxis /// @@ -416,7 +463,12 @@ public: /// /// \return <-- reference to the gnuplot object // ----------------------------------------------- - inline Gnuplot& set_xautoscale(){cmd("set xrange restore"); cmd("set autoscale x"); return *this;}; + inline Gnuplot &set_xautoscale() + { + cmd("set xrange restore"); + cmd("set autoscale x"); + return *this; + }; // ----------------------------------------------- /// autoscale axis (set by default) of yaxis @@ -425,7 +477,12 @@ public: /// /// \return <-- reference to the gnuplot object // ----------------------------------------------- - inline Gnuplot& set_yautoscale(){cmd("set yrange restore"); cmd("set autoscale y"); return *this;}; + inline Gnuplot &set_yautoscale() + { + cmd("set yrange restore"); + cmd("set autoscale y"); + return *this; + }; // ----------------------------------------------- /// autoscale axis (set by default) of zaxis @@ -434,14 +491,19 @@ public: /// /// \return <-- reference to the gnuplot object // ----------------------------------------------- - inline Gnuplot& set_zautoscale(){cmd("set zrange restore"); cmd("set autoscale z"); return *this;}; + inline Gnuplot &set_zautoscale() + { + cmd("set zrange restore"); + cmd("set autoscale z"); + return *this; + }; /// turns on/off log scaling for the specified xaxis (logscale is not set by default) - Gnuplot& set_xlogscale(const double base = 10); + Gnuplot &set_xlogscale(const double base = 10); /// turns on/off log scaling for the specified yaxis (logscale is not set by default) - Gnuplot& set_ylogscale(const double base = 10); + Gnuplot &set_ylogscale(const double base = 10); /// turns on/off log scaling for the specified zaxis (logscale is not set by default) - Gnuplot& set_zlogscale(const double base = 10); + Gnuplot &set_zlogscale(const double base = 10); // ----------------------------------------------- /// turns off log scaling for the x axis @@ -450,7 +512,11 @@ public: /// /// \return <-- reference to the gnuplot object // ----------------------------------------------- - inline Gnuplot& unset_xlogscale(){cmd("unset logscale x"); return *this;}; + inline Gnuplot &unset_xlogscale() + { + cmd("unset logscale x"); + return *this; + }; // ----------------------------------------------- /// turns off log scaling for the y axis @@ -459,7 +525,11 @@ public: /// /// \return <-- reference to the gnuplot object // ----------------------------------------------- - inline Gnuplot& unset_ylogscale(){cmd("unset logscale y"); return *this;}; + inline Gnuplot &unset_ylogscale() + { + cmd("unset logscale y"); + return *this; + }; // ----------------------------------------------- /// turns off log scaling for the z axis @@ -468,71 +538,75 @@ public: /// /// \return <-- reference to the gnuplot object // ----------------------------------------------- - inline Gnuplot& unset_zlogscale(){cmd("unset logscale z"); return *this;}; + inline Gnuplot &unset_zlogscale() + { + cmd("unset logscale z"); + return *this; + }; /// set palette range (autoscale by default) - Gnuplot& set_cbrange(const double iFrom, const double iTo); + Gnuplot &set_cbrange(const double iFrom, const double iTo); //---------------------------------------------------------------------------------- // plot /// plot a single std::vector: x /// from file - Gnuplot& plotfile_x(const std::string &filename, - const unsigned int column = 1, - const std::string &title = ""); + Gnuplot &plotfile_x(const std::string &filename, + const unsigned int column = 1, + const std::string &title = ""); /// from std::vector - template - Gnuplot& plot_x(const X& x, const std::string &title = ""); + template + Gnuplot &plot_x(const X &x, const std::string &title = ""); /// plot x,y pairs: x y /// from file - Gnuplot& plotfile_xy(const std::string &filename, - const unsigned int column_x = 1, - const unsigned int column_y = 2, - const std::string &title = "", - const unsigned int decimate = 1); + Gnuplot &plotfile_xy(const std::string &filename, + const unsigned int column_x = 1, + const unsigned int column_y = 2, + const std::string &title = "", + const unsigned int decimate = 1); /// from data - template - Gnuplot& plot_xy(const X& x, const Y& y, - const std::string &title = "", - const unsigned int decimate = 1); + template + Gnuplot &plot_xy(const X &x, const Y &y, + const std::string &title = "", + const unsigned int decimate = 1); /// plot x,y pairs with dy errorbars: x y dy /// from file - Gnuplot& plotfile_xy_err(const std::string &filename, - const unsigned int column_x = 1, - const unsigned int column_y = 2, - const unsigned int column_dy = 3, - const std::string &title = ""); + Gnuplot &plotfile_xy_err(const std::string &filename, + const unsigned int column_x = 1, + const unsigned int column_y = 2, + const unsigned int column_dy = 3, + const std::string &title = ""); /// from data - template - Gnuplot& plot_xy_err(const X &x, const Y &y, const E &dy, - const std::string &title = ""); + template + Gnuplot &plot_xy_err(const X &x, const Y &y, const E &dy, + const std::string &title = ""); - template - Gnuplot& plot_grid3d(const X &x, const Y &y, const E &mag, - const std::string &title = ""); + template + Gnuplot &plot_grid3d(const X &x, const Y &y, const E &mag, + const std::string &title = ""); /// plot x,y,z triples: x y z /// from file - Gnuplot& plotfile_xyz(const std::string &filename, - const unsigned int column_x = 1, - const unsigned int column_y = 2, - const unsigned int column_z = 3, - const std::string &title = ""); + Gnuplot &plotfile_xyz(const std::string &filename, + const unsigned int column_x = 1, + const unsigned int column_y = 2, + const unsigned int column_z = 3, + const std::string &title = ""); /// from std::vector - template - Gnuplot& plot_xyz(const X &x, - const Y &y, - const Z &z, - const std::string &title = ""); + template + Gnuplot &plot_xyz(const X &x, + const Y &y, + const Z &z, + const std::string &title = ""); /// plot an equation of the form: y = ax + b, you supply a and b - Gnuplot& plot_slope(const double a, - const double b, - const std::string &title = ""); + Gnuplot &plot_slope(const double a, + const double b, + const std::string &title = ""); /// plot an equation supplied as a std::string y=f(x), write only the function f(x) not y= /// the independent variable has to be x @@ -544,20 +618,20 @@ public: /// special functions: erf(x), erfc(x), inverf(x), gamma(x), igamma(a,x), lgamma(x), ibeta(p,q,x), /// besj0(x), besj1(x), besy0(x), besy1(x), lambertw(x) /// statistical fuctions: norm(x), invnorm(x) - Gnuplot& plot_equation(const std::string &equation, const std::string &title = ""); + Gnuplot &plot_equation(const std::string &equation, const std::string &title = ""); /// plot an equation supplied as a std::string z=f(x,y), write only the function f(x,y) not z= /// the independent variables have to be x and y - Gnuplot& plot_equation3d(const std::string &equation, const std::string &title = ""); + Gnuplot &plot_equation3d(const std::string &equation, const std::string &title = ""); /// plot image - Gnuplot& plot_image(const unsigned char *ucPicBuf, - const unsigned int iWidth, - const unsigned int iHeight, - const std::string &title = ""); + Gnuplot &plot_image(const unsigned char *ucPicBuf, + const unsigned int iWidth, + const unsigned int iHeight, + const std::string &title = ""); /// plot circle - Gnuplot& plot_circle(double east, double north, double radius, const std::string &label = ""); + Gnuplot &plot_circle(double east, double north, double radius, const std::string &label = ""); //---------------------------------------------------------------------------------- ///\brief replot repeats the last plot or splot command. @@ -568,13 +642,17 @@ public: /// /// \return --- //---------------------------------------------------------------------------------- - inline Gnuplot& replot(void){if (nplots > 0) cmd("replot"); return *this;}; + inline Gnuplot &replot(void) + { + if (nplots > 0) cmd("replot"); + return *this; + }; /// resets a gnuplot session (next plot will erase previous ones) - Gnuplot& reset_plot(); + Gnuplot &reset_plot(); /// resets a gnuplot session and sets all variables to default - Gnuplot& reset_all(); + Gnuplot &reset_all(); /// deletes temporary files void remove_tmpfiles(); @@ -587,7 +665,7 @@ public: /// /// \return true if valid, false if not // ------------------------------------------------------------------- - inline bool is_valid(){return(valid);}; + inline bool is_valid() { return (valid); }; }; @@ -607,7 +685,7 @@ std::string Gnuplot::m_sGNUPlotPath = "/usr/local/bin/"; #if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__TOS_WIN__) std::string Gnuplot::terminal_std = "windows"; -#elif ( defined(unix) || defined(__unix) || defined(__unix__) ) && !defined(__APPLE__) +#elif (defined(unix) || defined(__unix) || defined(__unix__)) && !defined(__APPLE__) std::string Gnuplot::terminal_std = "x11"; #elif defined(__APPLE__) std::string Gnuplot::terminal_std = "aqua"; @@ -618,7 +696,7 @@ std::string Gnuplot::terminal_std = "aqua"; // constructor: set a style during construction // inline Gnuplot::Gnuplot(const std::string &style) -:gnucmd(NULL), valid(false), two_dim(false), nplots(0) + : gnucmd(NULL), valid(false), two_dim(false), nplots(0) { init(); @@ -631,11 +709,11 @@ inline Gnuplot::Gnuplot(const std::string &style) // constructor: open a new session, plot a signal (x) // inline Gnuplot::Gnuplot(const std::vector &x, - const std::string &title, - const std::string &style, - const std::string &labelx, - const std::string &labely) -:gnucmd(NULL), valid(false), two_dim(false), nplots(0) + const std::string &title, + const std::string &style, + const std::string &labelx, + const std::string &labely) + : gnucmd(NULL), valid(false), two_dim(false), nplots(0) { init(); @@ -643,7 +721,7 @@ inline Gnuplot::Gnuplot(const std::vector &x, set_xlabel(labelx); set_ylabel(labely); - plot_x(x,title); + plot_x(x, title); } @@ -652,12 +730,12 @@ inline Gnuplot::Gnuplot(const std::vector &x, // constructor: open a new session, plot a signal (x,y) // inline Gnuplot::Gnuplot(const std::vector &x, - const std::vector &y, - const std::string &title, - const std::string &style, - const std::string &labelx, - const std::string &labely) -:gnucmd(NULL), valid(false), two_dim(false), nplots(0) + const std::vector &y, + const std::string &title, + const std::string &style, + const std::string &labelx, + const std::string &labely) + : gnucmd(NULL), valid(false), two_dim(false), nplots(0) { init(); @@ -665,7 +743,7 @@ inline Gnuplot::Gnuplot(const std::vector &x, set_xlabel(labelx); set_ylabel(labely); - plot_xy(x,y,title); + plot_xy(x, y, title); } @@ -674,14 +752,14 @@ inline Gnuplot::Gnuplot(const std::vector &x, // constructor: open a new session, plot a signal (x,y,z) // inline Gnuplot::Gnuplot(const std::vector &x, - const std::vector &y, - const std::vector &z, - const std::string &title, - const std::string &style, - const std::string &labelx, - const std::string &labely, - const std::string &labelz) -:gnucmd(NULL), valid(false), two_dim(false), nplots(0) + const std::vector &y, + const std::vector &z, + const std::string &title, + const std::string &style, + const std::string &labelx, + const std::string &labely, + const std::string &labelz) + : gnucmd(NULL), valid(false), two_dim(false), nplots(0) { init(); @@ -690,7 +768,7 @@ inline Gnuplot::Gnuplot(const std::vector &x, set_ylabel(labely); set_zlabel(labelz); - plot_xyz(x,y,z,title); + plot_xyz(x, y, z, title); } @@ -698,8 +776,8 @@ inline Gnuplot::Gnuplot(const std::vector &x, // /// Plots a 2d graph from a list of doubles: x // -template -Gnuplot& Gnuplot::plot_x(const X& x, const std::string &title) +template +Gnuplot &Gnuplot::plot_x(const X &x, const std::string &title) { if (x.size() == 0) { @@ -731,8 +809,8 @@ Gnuplot& Gnuplot::plot_x(const X& x, const std::string &title) // /// Plots a 2d graph from a list of doubles: x y // -template -Gnuplot& Gnuplot::plot_xy(const X& x, const Y& y, const std::string &title, const unsigned int decimate) +template +Gnuplot &Gnuplot::plot_xy(const X &x, const Y &y, const std::string &title, const unsigned int decimate) { if (x.size() == 0 || y.size() == 0) { @@ -770,11 +848,11 @@ Gnuplot& Gnuplot::plot_xy(const X& x, const Y& y, const std::string &title, cons /// /// plot x,y pairs with dy errorbars /// -template -Gnuplot& Gnuplot::plot_xy_err(const X &x, - const Y &y, - const E &dy, - const std::string &title) +template +Gnuplot &Gnuplot::plot_xy_err(const X &x, + const Y &y, + const E &dy, + const std::string &title) { if (x.size() == 0 || y.size() == 0 || dy.size() == 0) { @@ -813,13 +891,13 @@ Gnuplot& Gnuplot::plot_xy_err(const X &x, // // Plots a 3d grid // -template -Gnuplot& Gnuplot::plot_grid3d(const X &x, - const Y &y, - const E &mag, - const std::string &title) +template +Gnuplot &Gnuplot::plot_grid3d(const X &x, + const Y &y, + const E &mag, + const std::string &title) { - if (x.size() == 0 || y.size() == 0 ) + if (x.size() == 0 || y.size() == 0) { throw GnuplotException("std::vectors too small"); return *this; @@ -870,11 +948,11 @@ Gnuplot& Gnuplot::plot_grid3d(const X &x, // // Plots a 3d graph from a list of doubles: x y z // -template -Gnuplot& Gnuplot::plot_xyz(const X &x, - const Y &y, - const Z &z, - const std::string &title) +template +Gnuplot &Gnuplot::plot_xyz(const X &x, + const Y &y, + const Z &z, + const std::string &title) { if (x.size() == 0 || y.size() == 0 || z.size() == 0) { @@ -897,7 +975,7 @@ Gnuplot& Gnuplot::plot_xyz(const X &x, // write the data to file // for (unsigned int i = 0; i < x.size(); i++) - tmp << x[i] << " " << y[i] << " " << z[i] < -void stringtok (Container &container, - std::string const &in, - const char * const delimiters = " \t\n") +void stringtok(Container &container, + std::string const &in, + const char *const delimiters = " \t\n") { const std::string::size_type len = in.length(); std::string::size_type i = 0; - while ( i < len ) + while (i < len) { // eat leading whitespace - i = in.find_first_not_of (delimiters, i); + i = in.find_first_not_of(delimiters, i); if (i == std::string::npos) - return; // nothing left but white space + return; // nothing left but white space // find the end of the token - std::string::size_type j = in.find_first_of (delimiters, i); + std::string::size_type j = in.find_first_of(delimiters, i); // push token if (j == std::string::npos) { - container.push_back (in.substr(i)); + container.push_back(in.substr(i)); return; } else - container.push_back (in.substr(i, j-i)); + container.push_back(in.substr(i, j - i)); // set up for next loop i = j + 1; @@ -1000,16 +1078,16 @@ void stringtok (Container &container, // Gnuplot::~Gnuplot() { - // remove_tmpfiles(); +// remove_tmpfiles(); - // A stream opened by popen() should be closed by pclose() +// A stream opened by popen() should be closed by pclose() #if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__TOS_WIN__) if (_pclose(gnucmd) == -1) #elif defined(unix) || defined(__unix) || defined(__unix__) || defined(__APPLE__) - if (pclose(gnucmd) == -1) + if (pclose(gnucmd) == -1) #endif - // throw GnuplotException("Problem closing communication to gnuplot"); - std::cout << "Gnuplot window left open." << std::endl; + // throw GnuplotException("Problem closing communication to gnuplot"); + std::cout << "Gnuplot window left open." << std::endl; } @@ -1017,7 +1095,7 @@ Gnuplot::~Gnuplot() // // Resets a gnuplot session (next plot will erase previous ones) // -Gnuplot& Gnuplot::reset_plot() +Gnuplot &Gnuplot::reset_plot() { // remove_tmpfiles(); nplots = 0; @@ -1030,7 +1108,7 @@ Gnuplot& Gnuplot::reset_plot() // // resets a gnuplot session and sets all varibles to default // -Gnuplot& Gnuplot::reset_all() +Gnuplot &Gnuplot::reset_all() { // remove_tmpfiles(); nplots = 0; @@ -1048,19 +1126,19 @@ Gnuplot& Gnuplot::reset_all() // // Change the plotting style of a gnuplot session // -Gnuplot& Gnuplot::set_style(const std::string &stylestr) +Gnuplot &Gnuplot::set_style(const std::string &stylestr) { - if (stylestr.find("lines") == std::string::npos && - stylestr.find("points") == std::string::npos && - stylestr.find("linespoints") == std::string::npos && - stylestr.find("impulses") == std::string::npos && - stylestr.find("dots") == std::string::npos && - stylestr.find("steps") == std::string::npos && - stylestr.find("fsteps") == std::string::npos && - stylestr.find("histeps") == std::string::npos && - stylestr.find("boxes") == std::string::npos && // 1-4 columns of data are required - stylestr.find("filledcurves") == std::string::npos && - stylestr.find("histograms") == std::string::npos ) //only for one data column + if (stylestr.find("lines") == std::string::npos && + stylestr.find("points") == std::string::npos && + stylestr.find("linespoints") == std::string::npos && + stylestr.find("impulses") == std::string::npos && + stylestr.find("dots") == std::string::npos && + stylestr.find("steps") == std::string::npos && + stylestr.find("fsteps") == std::string::npos && + stylestr.find("histeps") == std::string::npos && + stylestr.find("boxes") == std::string::npos && // 1-4 columns of data are required + stylestr.find("filledcurves") == std::string::npos && + stylestr.find("histograms") == std::string::npos) //only for one data column // stylestr.find("labels") == std::string::npos && // 3 columns of data are required // stylestr.find("xerrorbars") == std::string::npos && // 3-4 columns of data are required // stylestr.find("xerrorlines") == std::string::npos && // 3-4 columns of data are required @@ -1094,14 +1172,14 @@ Gnuplot& Gnuplot::set_style(const std::string &stylestr) // // smooth: interpolation and approximation of data // -Gnuplot& Gnuplot::set_smooth(const std::string &stylestr) +Gnuplot &Gnuplot::set_smooth(const std::string &stylestr) { - if (stylestr.find("unique") == std::string::npos && - stylestr.find("frequency") == std::string::npos && - stylestr.find("csplines") == std::string::npos && - stylestr.find("acsplines") == std::string::npos && - stylestr.find("bezier") == std::string::npos && - stylestr.find("sbezier") == std::string::npos ) + if (stylestr.find("unique") == std::string::npos && + stylestr.find("frequency") == std::string::npos && + stylestr.find("csplines") == std::string::npos && + stylestr.find("acsplines") == std::string::npos && + stylestr.find("bezier") == std::string::npos && + stylestr.find("sbezier") == std::string::npos) { smooth = ""; } @@ -1118,7 +1196,7 @@ Gnuplot& Gnuplot::set_smooth(const std::string &stylestr) // // sets terminal type to windows / x11 // -Gnuplot& Gnuplot::showonscreen() +Gnuplot &Gnuplot::showonscreen() { std::string persist(" persist"); #ifdef __APPLE__ @@ -1135,7 +1213,7 @@ Gnuplot& Gnuplot::showonscreen() // // saves a gnuplot session to a pdf file // -Gnuplot& Gnuplot::savetopdf(const std::string &filename, unsigned int font_size) +Gnuplot &Gnuplot::savetopdf(const std::string &filename, unsigned int font_size) { std::ostringstream cmdstr; cmdstr << "set term pdfcairo enhanced color font \"Times-New-Roman," + std::to_string(font_size) + "\"\n"; @@ -1151,7 +1229,7 @@ Gnuplot& Gnuplot::savetopdf(const std::string &filename, unsigned int font_size) // // saves a gnuplot session to a postscript file // -Gnuplot& Gnuplot::savetops(const std::string &filename) +Gnuplot &Gnuplot::savetops(const std::string &filename) { std::ostringstream cmdstr; cmdstr << "set term postscript landscape enhanced color dashed \"Times-Roman\" 18\n"; @@ -1167,7 +1245,7 @@ Gnuplot& Gnuplot::savetops(const std::string &filename) // // Switches legend on // -Gnuplot& Gnuplot::set_legend(const std::string &position) +Gnuplot &Gnuplot::set_legend(const std::string &position) { std::ostringstream cmdstr; cmdstr << "set key " << position; @@ -1182,7 +1260,7 @@ Gnuplot& Gnuplot::set_legend(const std::string &position) // // turns on log scaling for the x axis // -Gnuplot& Gnuplot::set_xlogscale(const double base) +Gnuplot &Gnuplot::set_xlogscale(const double base) { std::ostringstream cmdstr; @@ -1197,7 +1275,7 @@ Gnuplot& Gnuplot::set_xlogscale(const double base) // // turns on log scaling for the y axis // -Gnuplot& Gnuplot::set_ylogscale(const double base) +Gnuplot &Gnuplot::set_ylogscale(const double base) { std::ostringstream cmdstr; @@ -1212,7 +1290,7 @@ Gnuplot& Gnuplot::set_ylogscale(const double base) // // turns on log scaling for the z axis // -Gnuplot& Gnuplot::set_zlogscale(const double base) +Gnuplot &Gnuplot::set_zlogscale(const double base) { std::ostringstream cmdstr; @@ -1227,7 +1305,7 @@ Gnuplot& Gnuplot::set_zlogscale(const double base) // // scales the size of the points used in plots // -Gnuplot& Gnuplot::set_pointsize(const double pointsize) +Gnuplot &Gnuplot::set_pointsize(const double pointsize) { std::ostringstream cmdstr; cmdstr << "set pointsize " << pointsize; @@ -1241,7 +1319,7 @@ Gnuplot& Gnuplot::set_pointsize(const double pointsize) // // set isoline density (grid) for plotting functions as surfaces // -Gnuplot& Gnuplot::set_samples(const int samples) +Gnuplot &Gnuplot::set_samples(const int samples) { std::ostringstream cmdstr; cmdstr << "set samples " << samples; @@ -1255,7 +1333,7 @@ Gnuplot& Gnuplot::set_samples(const int samples) // // set isoline density (grid) for plotting functions as surfaces // -Gnuplot& Gnuplot::set_isosamples(const int isolines) +Gnuplot &Gnuplot::set_isosamples(const int isolines) { std::ostringstream cmdstr; cmdstr << "set isosamples " << isolines; @@ -1269,11 +1347,11 @@ Gnuplot& Gnuplot::set_isosamples(const int isolines) // // enables contour drawing for surfaces set contour {base | surface | both} // -Gnuplot& Gnuplot::set_contour(const std::string &position) +Gnuplot &Gnuplot::set_contour(const std::string &position) { - if (position.find("base") == std::string::npos && - position.find("surface") == std::string::npos && - position.find("both") == std::string::npos ) + if (position.find("base") == std::string::npos && + position.find("surface") == std::string::npos && + position.find("both") == std::string::npos) { cmd("set contour base"); } @@ -1291,7 +1369,7 @@ Gnuplot& Gnuplot::set_contour(const std::string &position) // set labels // // set the xlabel -Gnuplot& Gnuplot::set_xlabel(const std::string &label) +Gnuplot &Gnuplot::set_xlabel(const std::string &label) { std::ostringstream cmdstr; @@ -1305,7 +1383,7 @@ Gnuplot& Gnuplot::set_xlabel(const std::string &label) //------------------------------------------------------------------------------ // set the ylabel // -Gnuplot& Gnuplot::set_ylabel(const std::string &label) +Gnuplot &Gnuplot::set_ylabel(const std::string &label) { std::ostringstream cmdstr; @@ -1319,7 +1397,7 @@ Gnuplot& Gnuplot::set_ylabel(const std::string &label) //------------------------------------------------------------------------------ // set the zlabel // -Gnuplot& Gnuplot::set_zlabel(const std::string &label) +Gnuplot &Gnuplot::set_zlabel(const std::string &label) { std::ostringstream cmdstr; @@ -1335,8 +1413,8 @@ Gnuplot& Gnuplot::set_zlabel(const std::string &label) // set range // // set the xrange -Gnuplot& Gnuplot::set_xrange(const double iFrom, - const double iTo) +Gnuplot &Gnuplot::set_xrange(const double iFrom, + const double iTo) { std::ostringstream cmdstr; @@ -1350,8 +1428,8 @@ Gnuplot& Gnuplot::set_xrange(const double iFrom, //------------------------------------------------------------------------------ // set the yrange // -Gnuplot& Gnuplot::set_yrange(const double iFrom, - const double iTo) +Gnuplot &Gnuplot::set_yrange(const double iFrom, + const double iTo) { std::ostringstream cmdstr; @@ -1365,8 +1443,8 @@ Gnuplot& Gnuplot::set_yrange(const double iFrom, //------------------------------------------------------------------------------ // set the zrange // -Gnuplot& Gnuplot::set_zrange(const double iFrom, - const double iTo) +Gnuplot &Gnuplot::set_zrange(const double iFrom, + const double iTo) { std::ostringstream cmdstr; @@ -1381,8 +1459,8 @@ Gnuplot& Gnuplot::set_zrange(const double iFrom, // // set the palette range // -Gnuplot& Gnuplot::set_cbrange(const double iFrom, - const double iTo) +Gnuplot &Gnuplot::set_cbrange(const double iFrom, + const double iTo) { std::ostringstream cmdstr; @@ -1398,15 +1476,15 @@ Gnuplot& Gnuplot::set_cbrange(const double iFrom, // Plots a linear equation y=ax+b (where you supply the // slope a and intercept b) // -Gnuplot& Gnuplot::plot_slope(const double a, - const double b, - const std::string &title) +Gnuplot &Gnuplot::plot_slope(const double a, + const double b, + const std::string &title) { std::ostringstream cmdstr; // // command to be sent to gnuplot // - if (nplots > 0 && two_dim == true) + if (nplots > 0 && two_dim == true) cmdstr << "replot "; else cmdstr << "plot "; @@ -1433,14 +1511,14 @@ Gnuplot& Gnuplot::plot_slope(const double a, // // Plot an equation supplied as a std::string y=f(x) (only f(x) expected) // -Gnuplot& Gnuplot::plot_equation(const std::string &equation, - const std::string &title) +Gnuplot &Gnuplot::plot_equation(const std::string &equation, + const std::string &title) { std::ostringstream cmdstr; // // command to be sent to gnuplot // - if (nplots > 0 && two_dim == true) + if (nplots > 0 && two_dim == true) cmdstr << "replot "; else cmdstr << "plot "; @@ -1467,14 +1545,14 @@ Gnuplot& Gnuplot::plot_equation(const std::string &equation, // // plot an equation supplied as a std::string y=(x) // -Gnuplot& Gnuplot::plot_equation3d(const std::string &equation, - const std::string &title) +Gnuplot &Gnuplot::plot_equation3d(const std::string &equation, + const std::string &title) { std::ostringstream cmdstr; // // command to be sent to gnuplot // - if (nplots > 0 && two_dim == false) + if (nplots > 0 && two_dim == false) cmdstr << "replot "; else cmdstr << "splot "; @@ -1501,9 +1579,9 @@ Gnuplot& Gnuplot::plot_equation3d(const std::string &equation, // // Plots a 2d graph from a list of doubles (x) saved in a file // -Gnuplot& Gnuplot::plotfile_x(const std::string &filename, - const unsigned int column, - const std::string &title) +Gnuplot &Gnuplot::plotfile_x(const std::string &filename, + const unsigned int column, + const std::string &title) { // // check if file exists @@ -1514,7 +1592,7 @@ Gnuplot& Gnuplot::plotfile_x(const std::string &filename, // // command to be sent to gnuplot // - if (nplots > 0 && two_dim == true) + if (nplots > 0 && two_dim == true) cmdstr << "replot "; else cmdstr << "plot "; @@ -1526,7 +1604,7 @@ Gnuplot& Gnuplot::plotfile_x(const std::string &filename, else cmdstr << " title \"" << title << "\" "; - if(smooth == "") + if (smooth == "") cmdstr << "with " << pstyle; else cmdstr << "smooth " << smooth; @@ -1534,22 +1612,21 @@ Gnuplot& Gnuplot::plotfile_x(const std::string &filename, // // Do the actual plot // - cmd(cmdstr.str()); //nplots++; two_dim = true; already in cmd(); + cmd(cmdstr.str()); //nplots++; two_dim = true; already in cmd(); return *this; } - //------------------------------------------------------------------------------ // // Plots a 2d graph from a list of doubles (x y) saved in a file // -Gnuplot& Gnuplot::plotfile_xy(const std::string &filename, - const unsigned int column_x, - const unsigned int column_y, - const std::string &title, - const unsigned int decimate) +Gnuplot &Gnuplot::plotfile_xy(const std::string &filename, + const unsigned int column_x, + const unsigned int column_y, + const std::string &title, + const unsigned int decimate) { // // check if file exists @@ -1560,7 +1637,7 @@ Gnuplot& Gnuplot::plotfile_xy(const std::string &filename, // // command to be sent to gnuplot // - if (nplots > 0 && two_dim == true) + if (nplots > 0 && two_dim == true) cmdstr << "replot "; else cmdstr << "plot "; @@ -1572,7 +1649,7 @@ Gnuplot& Gnuplot::plotfile_xy(const std::string &filename, else cmdstr << " title \"" << title << "\" "; - if(smooth == "") + if (smooth == "") cmdstr << "with " << pstyle; else cmdstr << "smooth " << smooth; @@ -1590,11 +1667,11 @@ Gnuplot& Gnuplot::plotfile_xy(const std::string &filename, // // Plots a 2d graph with errorbars from a list of doubles (x y dy) in a file // -Gnuplot& Gnuplot::plotfile_xy_err(const std::string &filename, - const unsigned int column_x, - const unsigned int column_y, - const unsigned int column_dy, - const std::string &title) +Gnuplot &Gnuplot::plotfile_xy_err(const std::string &filename, + const unsigned int column_x, + const unsigned int column_y, + const unsigned int column_dy, + const std::string &title) { // // check if file exists @@ -1605,14 +1682,14 @@ Gnuplot& Gnuplot::plotfile_xy_err(const std::string &filename, // // command to be sent to gnuplot // - if (nplots > 0 && two_dim == true) + if (nplots > 0 && two_dim == true) cmdstr << "replot "; else cmdstr << "plot "; cmdstr << "\"" << filename << "\" using " - << column_x << ":" << column_y << ":" << column_dy - << " with errorbars "; + << column_x << ":" << column_y << ":" << column_dy + << " with errorbars "; if (title == "") cmdstr << " notitle "; @@ -1632,11 +1709,11 @@ Gnuplot& Gnuplot::plotfile_xy_err(const std::string &filename, // // Plots a 3d graph from a list of doubles (x y z) saved in a file // -Gnuplot& Gnuplot::plotfile_xyz(const std::string &filename, - const unsigned int column_x, - const unsigned int column_y, - const unsigned int column_z, - const std::string &title) +Gnuplot &Gnuplot::plotfile_xyz(const std::string &filename, + const unsigned int column_x, + const unsigned int column_y, + const unsigned int column_z, + const std::string &title) { // // check if file exists @@ -1647,13 +1724,13 @@ Gnuplot& Gnuplot::plotfile_xyz(const std::string &filename, // // command to be sent to gnuplot // - if (nplots > 0 && two_dim == false) + if (nplots > 0 && two_dim == false) cmdstr << "replot "; else cmdstr << "splot "; cmdstr << "\"" << filename << "\" using " << column_x << ":" << column_y - << ":" << column_z; + << ":" << column_z; if (title == "") cmdstr << " notitle with " << pstyle; @@ -1669,15 +1746,14 @@ Gnuplot& Gnuplot::plotfile_xyz(const std::string &filename, } - //------------------------------------------------------------------------------ // /// * note that this function is not valid for versions of GNUPlot below 4.2 // -Gnuplot& Gnuplot::plot_image(const unsigned char * ucPicBuf, - const unsigned int iWidth, - const unsigned int iHeight, - const std::string &title) +Gnuplot &Gnuplot::plot_image(const unsigned char *ucPicBuf, + const unsigned int iWidth, + const unsigned int iHeight, + const std::string &title) { std::ofstream tmp; std::string name = create_tmpfile(tmp); @@ -1688,12 +1764,12 @@ Gnuplot& Gnuplot::plot_image(const unsigned char * ucPicBuf, // write the data to file // int iIndex = 0; - for(unsigned int iRow = 0; iRow < iHeight; iRow++) + for (unsigned int iRow = 0; iRow < iHeight; iRow++) { - for(unsigned int iColumn = 0; iColumn < iWidth; iColumn++) + for (unsigned int iColumn = 0; iColumn < iWidth; iColumn++) { - tmp << iColumn << " " << iRow << " " - << static_cast(ucPicBuf[iIndex++]) << std::endl; + tmp << iColumn << " " << iRow << " " + << static_cast(ucPicBuf[iIndex++]) << std::endl; } } @@ -1704,7 +1780,7 @@ Gnuplot& Gnuplot::plot_image(const unsigned char * ucPicBuf, // // command to be sent to gnuplot // - if (nplots > 0 && two_dim == true) + if (nplots > 0 && two_dim == true) cmdstr << "replot "; else cmdstr << "plot "; @@ -1723,26 +1799,26 @@ Gnuplot& Gnuplot::plot_image(const unsigned char * ucPicBuf, } -Gnuplot& Gnuplot::plot_circle(double east, double north, double radius, const std::string &label) +Gnuplot &Gnuplot::plot_circle(double east, double north, double radius, const std::string &label) { std::ostringstream cmdstr; // // command to be sent to gnuplot // cmdstr << "set object circle at " + std::to_string(east) + "," + std::to_string(north) + " size " + - std::to_string(radius) + " back\n"; + std::to_string(radius) + " back\n"; if (label != "") { double east_label = (std::cos(M_PI / 3.0) * radius) * 1.1 + east; double north_label = (std::sin(M_PI / 3.0) * radius) * 1.1 + north; cmdstr << "set label \"" + label + "\" at first " + std::to_string(east_label) + - ", " + std::to_string(north_label) + " norotate back nopoint offset 0,0\n"; + ", " + std::to_string(north_label) + " norotate back nopoint offset 0,0\n"; } if (nplots > 0) - cmdstr << "replot "; - else - cmdstr << "plot "; + cmdstr << "replot "; + else + cmdstr << "plot "; // // Do the actual plot @@ -1753,14 +1829,13 @@ Gnuplot& Gnuplot::plot_circle(double east, double north, double radius, const st } - //------------------------------------------------------------------------------ // // Sends a command to an active gnuplot session // -Gnuplot& Gnuplot::cmd(const std::string &cmdstr) +Gnuplot &Gnuplot::cmd(const std::string &cmdstr) { - if( !(valid) ) + if (!(valid)) { return *this; } @@ -1770,7 +1845,7 @@ Gnuplot& Gnuplot::cmd(const std::string &cmdstr) // The function begins copying from the address specified (str) until it // reaches the terminating null character ('\0'). This final // null-character is not copied to the stream. - fputs( (cmdstr+"\n").c_str(), gnucmd ); + fputs((cmdstr + "\n").c_str(), gnucmd); // int fflush ( FILE * stream ); // If the given stream was open for writing and the last i/o operation was @@ -1779,16 +1854,16 @@ Gnuplot& Gnuplot::cmd(const std::string &cmdstr) // flushed. The stream remains open after this call. fflush(gnucmd); - if( cmdstr.find("replot") != std::string::npos ) + if (cmdstr.find("replot") != std::string::npos) { return *this; } - else if( cmdstr.find("splot") != std::string::npos ) + else if (cmdstr.find("splot") != std::string::npos) { two_dim = false; nplots++; } - else if( cmdstr.find("plot") != std::string::npos ) + else if (cmdstr.find("plot") != std::string::npos) { two_dim = true; nplots++; @@ -1804,11 +1879,11 @@ Gnuplot& Gnuplot::cmd(const std::string &cmdstr) // void Gnuplot::init() { - // char * getenv ( const char * name ); get value of environment variable - // Retrieves a C string containing the value of the environment variable - // whose name is specified as argument. If the requested variable is not - // part of the environment list, the function returns a NULL pointer. -#if ( defined(unix) || defined(__unix) || defined(__unix__) ) && !defined(__APPLE__) +// char * getenv ( const char * name ); get value of environment variable +// Retrieves a C string containing the value of the environment variable +// whose name is specified as argument. If the requested variable is not +// part of the environment list, the function returns a NULL pointer. +#if (defined(unix) || defined(__unix) || defined(__unix__)) && !defined(__APPLE__) if (std::getenv("DISPLAY") == NULL) { valid = false; @@ -1827,7 +1902,7 @@ void Gnuplot::init() // open pipe // std::string tmp = Gnuplot::m_sGNUPlotPath + "/" + - Gnuplot::m_sGNUPlotFileName; + Gnuplot::m_sGNUPlotFileName; // FILE *popen(const char *command, const char *mode); // The popen() function shall execute the command specified by the string @@ -1835,9 +1910,9 @@ void Gnuplot::init() // command, and return a pointer to a stream that can be used to either read // from or write to the pipe. #if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__TOS_WIN__) - gnucmd = _popen(tmp.c_str(),"w"); + gnucmd = _popen(tmp.c_str(), "w"); #elif defined(unix) || defined(__unix) || defined(__unix__) || defined(__APPLE__) - gnucmd = popen(tmp.c_str(),"w"); + gnucmd = popen(tmp.c_str(), "w"); #endif // popen() shall return a pointer to an open stream that can be used to read @@ -1870,16 +1945,16 @@ bool Gnuplot::get_program_path() // first look in m_sGNUPlotPath for Gnuplot // std::string tmp = Gnuplot::m_sGNUPlotPath + "/" + - Gnuplot::m_sGNUPlotFileName; + Gnuplot::m_sGNUPlotFileName; #if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__TOS_WIN__) - if ( Gnuplot::file_exists(tmp,0) ) // check existence + if (Gnuplot::file_exists(tmp, 0)) // check existence #elif defined(unix) || defined(__unix) || defined(__unix__) || defined(__APPLE__) - if ( Gnuplot::file_exists(tmp,1) ) // check existence and execution permission + if (Gnuplot::file_exists(tmp, 1)) // check existence and execution permission #endif - { - return true; - } + { + return true; + } // // second look in PATH for Gnuplot @@ -1899,96 +1974,96 @@ bool Gnuplot::get_program_path() //split path (one long string) into list ls of strings #if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__TOS_WIN__) - stringtok(ls,path_str,";"); + stringtok(ls, path_str, ";"); #elif defined(unix) || defined(__unix) || defined(__unix__) || defined(__APPLE__) - stringtok(ls,path_str,":"); + stringtok(ls, path_str, ":"); #endif // scan list for Gnuplot program files for (std::list::const_iterator i = ls.begin(); - i != ls.end(); ++i) + i != ls.end(); ++i) { tmp = (*i) + "/" + Gnuplot::m_sGNUPlotFileName; #if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__TOS_WIN__) - if ( Gnuplot::file_exists(tmp,0) ) // check existence + if (Gnuplot::file_exists(tmp, 0)) // check existence #elif defined(unix) || defined(__unix) || defined(__unix__) || defined(__APPLE__) - if ( Gnuplot::file_exists(tmp,1) ) // check existence and execution permission + if (Gnuplot::file_exists(tmp, 1)) // check existence and execution permission #endif - { - Gnuplot::m_sGNUPlotPath = *i; // set m_sGNUPlotPath - return true; - } + { + Gnuplot::m_sGNUPlotPath = *i; // set m_sGNUPlotPath + return true; + } } tmp = "Can't find gnuplot neither in PATH nor in \"" + - Gnuplot::m_sGNUPlotPath + "\""; + Gnuplot::m_sGNUPlotPath + "\""; Gnuplot::m_sGNUPlotPath = ""; throw GnuplotException(tmp); } } - //------------------------------------------------------------------------------ // // check if file exists // bool Gnuplot::file_exists(const std::string &filename, int mode) { - if ( mode < 0 || mode > 7) + if (mode < 0 || mode > 7) { - throw std::runtime_error("In function \"Gnuplot::file_exists\": mode\ + throw std::runtime_error( + "In function \"Gnuplot::file_exists\": mode\ has to be an integer between 0 and 7"); return false; } - // int _access(const char *path, int mode); - // returns 0 if the file has the given mode, - // it returns -1 if the named file does not exist or is not accessible in - // the given mode - // mode = 0 (F_OK) (default): checks file for existence only - // mode = 1 (X_OK): execution permission - // mode = 2 (W_OK): write permission - // mode = 4 (R_OK): read permission - // mode = 6 : read and write permission - // mode = 7 : read, write and execution permission + // int _access(const char *path, int mode); + // returns 0 if the file has the given mode, + // it returns -1 if the named file does not exist or is not accessible in + // the given mode + // mode = 0 (F_OK) (default): checks file for existence only + // mode = 1 (X_OK): execution permission + // mode = 2 (W_OK): write permission + // mode = 4 (R_OK): read permission + // mode = 6 : read and write permission + // mode = 7 : read, write and execution permission #if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__TOS_WIN__) if (_access(filename.c_str(), mode) == 0) #elif defined(unix) || defined(__unix) || defined(__unix__) || defined(__APPLE__) - if (access(filename.c_str(), mode) == 0) + if (access(filename.c_str(), mode) == 0) #endif - { - return true; - } - else - { - return false; - } + { + return true; + } + else + { + return false; + } } bool Gnuplot::file_available(const std::string &filename) { std::ostringstream except; - if( Gnuplot::file_exists(filename,0) ) // check existence + if (Gnuplot::file_exists(filename, 0)) // check existence { - if( !(Gnuplot::file_exists(filename,4)) ){// check read permission + if (!(Gnuplot::file_exists(filename, 4))) + { // check read permission except << "No read permission for File \"" << filename << "\""; - throw GnuplotException( except.str() ); + throw GnuplotException(except.str()); return false; - } + } } else { except << "File \"" << filename << "\" does not exist"; - throw GnuplotException( except.str() ); + throw GnuplotException(except.str()); return false; } return true; } - //------------------------------------------------------------------------------ // // Opens a temporary file @@ -1996,9 +2071,9 @@ bool Gnuplot::file_available(const std::string &filename) std::string Gnuplot::create_tmpfile(std::ofstream &tmp) { #if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__TOS_WIN__) - char name[] = "gnuplotiXXXXXX"; //tmp file in working directory + char name[] = "gnuplotiXXXXXX"; //tmp file in working directory #elif defined(unix) || defined(__unix) || defined(__unix__) || defined(__APPLE__) - char name[] = "/tmp/gnuplotiXXXXXX"; // tmp file in /tmp + char name[] = "/tmp/gnuplotiXXXXXX"; // tmp file in /tmp #endif // @@ -2010,32 +2085,32 @@ std::string Gnuplot::create_tmpfile(std::ofstream &tmp) except << "Maximum number of temporary files reached (" << GP_MAX_TMP_FILES << "): cannot open more files" << std::endl; - throw GnuplotException( except.str() ); + throw GnuplotException(except.str()); } - // int mkstemp(char *name); - // shall replace the contents of the string pointed to by "name" by a unique - // filename, and return a file descriptor for the file open for reading and - // writing. Otherwise, -1 shall be returned if no suitable file could be - // created. The string in template should look like a filename with six - // trailing 'X' s; mkstemp() replaces each 'X' with a character from the - // portable filename character set. The characters are chosen such that the - // resulting name does not duplicate the name of an existing file at the - // time of a call to mkstemp() + // int mkstemp(char *name); + // shall replace the contents of the string pointed to by "name" by a unique + // filename, and return a file descriptor for the file open for reading and + // writing. Otherwise, -1 shall be returned if no suitable file could be + // created. The string in template should look like a filename with six + // trailing 'X' s; mkstemp() replaces each 'X' with a character from the + // portable filename character set. The characters are chosen such that the + // resulting name does not duplicate the name of an existing file at the + // time of a call to mkstemp() - // - // open temporary files for output - // + // + // open temporary files for output + // #if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__TOS_WIN__) if (_mktemp(name) == NULL) #elif defined(unix) || defined(__unix) || defined(__unix__) || defined(__APPLE__) - if (mkstemp(name) == -1) + if (mkstemp(name) == -1) #endif - { - std::ostringstream except; - except << "Cannot create temporary file \"" << name << "\""; - throw GnuplotException(except.str()); - } + { + std::ostringstream except; + except << "Cannot create temporary file \"" << name << "\""; + throw GnuplotException(except.str()); + } tmp.open(name); if (tmp.bad()) @@ -2060,7 +2135,7 @@ void Gnuplot::remove_tmpfiles() if ((tmpfile_list).size() > 0) { for (unsigned int i = 0; i < tmpfile_list.size(); i++) - if(remove( tmpfile_list[i].c_str() ) != 0) + if (remove(tmpfile_list[i].c_str()) != 0) std::cout << "Problem closing files" << std::endl; Gnuplot::tmpfile_num -= tmpfile_list.size(); diff --git a/src/tests/common-files/test_flags.h b/src/tests/common-files/test_flags.h index a8bac06a6..139c3a3e8 100644 --- a/src/tests/common-files/test_flags.h +++ b/src/tests/common-files/test_flags.h @@ -34,9 +34,9 @@ #include #if defined GNUPLOT_EXECUTABLE - DEFINE_string(gnuplot_executable, std::string(GNUPLOT_EXECUTABLE), "Gnuplot binary path"); +DEFINE_string(gnuplot_executable, std::string(GNUPLOT_EXECUTABLE), "Gnuplot binary path"); #elif !defined GNUPLOT_EXECUTABLE - DEFINE_string(gnuplot_executable, "", "Gnuplot binary path"); +DEFINE_string(gnuplot_executable, "", "Gnuplot binary path"); #endif DEFINE_bool(plot_acq_grid, false, "Plots acquisition grid with gnuplot"); diff --git a/src/tests/single_test_main.cc b/src/tests/single_test_main.cc index fe9b1007b..5be30f534 100644 --- a/src/tests/single_test_main.cc +++ b/src/tests/single_test_main.cc @@ -50,8 +50,6 @@ #include - - concurrent_queue global_gps_acq_assist_queue; concurrent_map global_gps_acq_assist_map; @@ -64,20 +62,22 @@ int main(int argc, char **argv) { google::ParseCommandLineFlags(&argc, &argv, true); try - { + { testing::InitGoogleTest(&argc, argv); - } - catch(...) {} // catch the "testing::internal::::ClassUniqueToAlwaysTrue" from gtest + } + catch (...) + { + } // catch the "testing::internal::::ClassUniqueToAlwaysTrue" from gtest google::InitGoogleLogging(argv[0]); int res = 0; try - { + { res = RUN_ALL_TESTS(); - } - catch(...) - { + } + catch (...) + { LOG(WARNING) << "Unexpected catch"; - } + } google::ShutDownCommandLineFlags(); return res; } diff --git a/src/tests/system-tests/obs_gps_l1_system_test.cc b/src/tests/system-tests/obs_gps_l1_system_test.cc index 8594913d6..5627e1fea 100644 --- a/src/tests/system-tests/obs_gps_l1_system_test.cc +++ b/src/tests/system-tests/obs_gps_l1_system_test.cc @@ -58,7 +58,7 @@ concurrent_queue global_gps_acq_assist_queue; concurrent_map global_gps_acq_assist_map; -class ObsGpsL1SystemTest: public ::testing::Test +class ObsGpsL1SystemTest : public ::testing::Test { public: std::string generator_binary; @@ -80,7 +80,7 @@ public: void check_results(); bool check_valid_rinex_nav(std::string filename); // return true if the file is a valid Rinex navigation file. bool check_valid_rinex_obs(std::string filename); // return true if the file is a valid Rinex observation file. - double compute_stdev(const std::vector & vec); + double compute_stdev(const std::vector& vec); std::shared_ptr config; }; @@ -94,12 +94,12 @@ bool ObsGpsL1SystemTest::check_valid_rinex_nav(std::string filename) } -double ObsGpsL1SystemTest::compute_stdev(const std::vector & vec) +double ObsGpsL1SystemTest::compute_stdev(const std::vector& vec) { double sum__ = std::accumulate(vec.begin(), vec.end(), 0.0); double mean__ = sum__ / vec.size(); double accum__ = 0.0; - std::for_each (std::begin(vec), std::end(vec), [&](const double d) { + std::for_each(std::begin(vec), std::end(vec), [&](const double d) { accum__ += (d - mean__) * (d - mean__); }); double stdev__ = std::sqrt(accum__ / (vec.size() - 1)); @@ -121,18 +121,18 @@ int ObsGpsL1SystemTest::configure_generator() generator_binary = FLAGS_generator_binary; p1 = std::string("-rinex_nav_file=") + FLAGS_rinex_nav_file; - if(FLAGS_dynamic_position.empty()) + if (FLAGS_dynamic_position.empty()) { p2 = std::string("-static_position=") + FLAGS_static_position + std::string(",") + std::to_string(std::min(FLAGS_duration * 10, 3000)); - if(FLAGS_duration > 300) std::cout << "WARNING: Duration has been set to its maximum value of 300 s" << std::endl; + if (FLAGS_duration > 300) std::cout << "WARNING: Duration has been set to its maximum value of 300 s" << std::endl; } else { p2 = std::string("-obs_pos_file=") + std::string(FLAGS_dynamic_position); } - p3 = std::string("-rinex_obs_file=") + FLAGS_filename_rinex_obs; // RINEX 2.10 observation file output - p4 = std::string("-sig_out_file=") + FLAGS_filename_raw_data; // Baseband signal output file. Will be stored in int8_t IQ multiplexed samples - p5 = std::string("-sampling_freq=") + std::to_string(baseband_sampling_freq); //Baseband sampling frequency [MSps] + p3 = std::string("-rinex_obs_file=") + FLAGS_filename_rinex_obs; // RINEX 2.10 observation file output + p4 = std::string("-sig_out_file=") + FLAGS_filename_raw_data; // Baseband signal output file. Will be stored in int8_t IQ multiplexed samples + p5 = std::string("-sampling_freq=") + std::to_string(baseband_sampling_freq); //Baseband sampling frequency [MSps] return 0; } @@ -142,7 +142,7 @@ int ObsGpsL1SystemTest::generate_signal() pid_t wait_result; int child_status; - char *const parmList[] = { &generator_binary[0], &generator_binary[0], &p1[0], &p2[0], &p3[0], &p4[0], &p5[0], NULL }; + char* const parmList[] = {&generator_binary[0], &generator_binary[0], &p1[0], &p2[0], &p3[0], &p4[0], &p5[0], NULL}; int pid; if ((pid = fork()) == -1) @@ -157,7 +157,7 @@ int ObsGpsL1SystemTest::generate_signal() wait_result = waitpid(pid, &child_status, 0); if (wait_result == -1) perror("waitpid error"); EXPECT_EQ(true, check_valid_rinex_obs(filename_rinex_obs)); - std::cout << "Signal and Observables RINEX files created." << std::endl; + std::cout << "Signal and Observables RINEX files created." << std::endl; return 0; } @@ -204,7 +204,7 @@ int ObsGpsL1SystemTest::configure_receiver() const int extend_correlation_ms = 1; const int display_rate_ms = 500; - const int output_rate_ms = 100; + const int output_rate_ms = 100; config->set_property("GNSS-SDR.internal_fs_sps", std::to_string(sampling_rate_internal)); @@ -326,20 +326,20 @@ int ObsGpsL1SystemTest::run_receiver() control_thread = std::make_shared(config); // start receiver try - { + { control_thread->run(); - } - catch(const boost::exception & e) - { + } + catch (const boost::exception& e) + { std::cout << "Boost exception: " << boost::diagnostic_information(e); - } - catch(const std::exception & ex) - { - std::cout << "STD exception: " << ex.what(); - } + } + catch (const std::exception& ex) + { + std::cout << "STD exception: " << ex.what(); + } // Get the name of the RINEX obs file generated by the receiver std::this_thread::sleep_for(std::chrono::milliseconds(2000)); - FILE *fp; + FILE* fp; std::string argum2 = std::string("/bin/ls *O | grep GSDR | tail -1"); char buffer[1035]; fp = popen(&argum2[0], "r"); @@ -360,17 +360,17 @@ int ObsGpsL1SystemTest::run_receiver() void ObsGpsL1SystemTest::check_results() { - std::vector> > pseudorange_ref(33); - std::vector> > carrierphase_ref(33); - std::vector> > doppler_ref(33); + std::vector>> pseudorange_ref(33); + std::vector>> carrierphase_ref(33); + std::vector>> doppler_ref(33); - std::vector> > pseudorange_meas(33); - std::vector> > carrierphase_meas(33); - std::vector> > doppler_meas(33); + std::vector>> pseudorange_meas(33); + std::vector>> carrierphase_meas(33); + std::vector>> doppler_meas(33); // Open and read reference RINEX observables file try - { + { gpstk::Rinex3ObsStream r_ref(FLAGS_filename_rinex_obs); r_ref.exceptions(std::ios::failbit); gpstk::Rinex3ObsData r_ref_data; @@ -384,53 +384,53 @@ void ObsGpsL1SystemTest::check_results() { for (int myprn = 1; myprn < 33; myprn++) { - gpstk::SatID prn( myprn, gpstk::SatID::systemGPS ); + gpstk::SatID prn(myprn, gpstk::SatID::systemGPS); gpstk::CommonTime time = r_ref_data.time; double sow(static_cast(time).sow); gpstk::Rinex3ObsData::DataMap::iterator pointer = r_ref_data.obs.find(prn); - if( pointer == r_ref_data.obs.end() ) + if (pointer == r_ref_data.obs.end()) { // PRN not present; do nothing } else { - dataobj = r_ref_data.getObs(prn, "C1C", r_ref_header); + dataobj = r_ref_data.getObs(prn, "C1C", r_ref_header); double P1 = dataobj.data; - std::pair pseudo(sow,P1); + std::pair pseudo(sow, P1); pseudorange_ref.at(myprn).push_back(pseudo); - dataobj = r_ref_data.getObs(prn, "L1C", r_ref_header); + dataobj = r_ref_data.getObs(prn, "L1C", r_ref_header); double L1 = dataobj.data; std::pair carrier(sow, L1); carrierphase_ref.at(myprn).push_back(carrier); - dataobj = r_ref_data.getObs(prn, "D1C", r_ref_header); + dataobj = r_ref_data.getObs(prn, "D1C", r_ref_header); double D1 = dataobj.data; std::pair doppler(sow, D1); doppler_ref.at(myprn).push_back(doppler); } // End of 'if( pointer == roe.obs.end() )' - } // end for - } // end while - } // End of 'try' block - catch(const gpstk::FFStreamError& e) - { + } // end for + } // end while + } // End of 'try' block + catch (const gpstk::FFStreamError& e) + { std::cout << e; exit(1); - } - catch(const gpstk::Exception& e) - { + } + catch (const gpstk::Exception& e) + { std::cout << e; exit(1); - } + } catch (...) - { + { std::cout << "unknown error. I don't feel so well..." << std::endl; exit(1); - } + } try - { + { std::string arg2_gen = std::string("./") + ObsGpsL1SystemTest::generated_rinex_obs; gpstk::Rinex3ObsStream r_meas(arg2_gen); r_meas.exceptions(std::ios::failbit); @@ -444,57 +444,57 @@ void ObsGpsL1SystemTest::check_results() { for (int myprn = 1; myprn < 33; myprn++) { - gpstk::SatID prn( myprn, gpstk::SatID::systemGPS ); + gpstk::SatID prn(myprn, gpstk::SatID::systemGPS); gpstk::CommonTime time = r_meas_data.time; double sow(static_cast(time).sow); gpstk::Rinex3ObsData::DataMap::iterator pointer = r_meas_data.obs.find(prn); - if( pointer == r_meas_data.obs.end() ) + if (pointer == r_meas_data.obs.end()) { // PRN not present; do nothing } else { - dataobj = r_meas_data.getObs(prn, "C1C", r_meas_header); + dataobj = r_meas_data.getObs(prn, "C1C", r_meas_header); double P1 = dataobj.data; std::pair pseudo(sow, P1); pseudorange_meas.at(myprn).push_back(pseudo); - dataobj = r_meas_data.getObs(prn, "L1C", r_meas_header); + dataobj = r_meas_data.getObs(prn, "L1C", r_meas_header); double L1 = dataobj.data; std::pair carrier(sow, L1); carrierphase_meas.at(myprn).push_back(carrier); - dataobj = r_meas_data.getObs(prn, "D1C", r_meas_header); + dataobj = r_meas_data.getObs(prn, "D1C", r_meas_header); double D1 = dataobj.data; std::pair doppler(sow, D1); doppler_meas.at(myprn).push_back(doppler); } // End of 'if( pointer == roe.obs.end() )' - } // end for - } // end while - } // End of 'try' block - catch(const gpstk::FFStreamError& e) - { + } // end for + } // end while + } // End of 'try' block + catch (const gpstk::FFStreamError& e) + { std::cout << e; exit(1); - } - catch(const gpstk::Exception& e) - { + } + catch (const gpstk::Exception& e) + { std::cout << e; exit(1); - } + } catch (...) - { + { std::cout << "unknown error. I don't feel so well..." << std::endl; exit(1); - } + } // Time alignment - std::vector> > pseudorange_ref_aligned(33); - std::vector> > carrierphase_ref_aligned(33); - std::vector> > doppler_ref_aligned(33); + std::vector>> pseudorange_ref_aligned(33); + std::vector>> carrierphase_ref_aligned(33); + std::vector>> doppler_ref_aligned(33); - std::vector> >::iterator iter; + std::vector>>::iterator iter; std::vector>::iterator it; std::vector>::iterator it2; @@ -506,17 +506,17 @@ void ObsGpsL1SystemTest::check_results() std::vector::iterator iter_v; int prn_id = 0; - for(iter = pseudorange_ref.begin(); iter != pseudorange_ref.end(); iter++) + for (iter = pseudorange_ref.begin(); iter != pseudorange_ref.end(); iter++) { - for(it = iter->begin(); it != iter->end(); it++) + for (it = iter->begin(); it != iter->end(); it++) { // If a measure exists for this sow, store it - for(it2 = pseudorange_meas.at(prn_id).begin(); it2 != pseudorange_meas.at(prn_id).end(); it2++) + for (it2 = pseudorange_meas.at(prn_id).begin(); it2 != pseudorange_meas.at(prn_id).end(); it2++) { - if(std::abs(it->first - it2->first) < 0.1) // store measures closer than 10 ms. + if (std::abs(it->first - it2->first) < 0.1) // store measures closer than 10 ms. { pseudorange_ref_aligned.at(prn_id).push_back(*it); - pr_diff.at(prn_id).push_back(it->second - it2->second ); + pr_diff.at(prn_id).push_back(it->second - it2->second); //std::cout << "Sat " << prn_id << ": " << "PR_ref=" << it->second << " PR_meas=" << it2->second << " Diff:" << it->second - it2->second << std::endl; } } @@ -525,17 +525,17 @@ void ObsGpsL1SystemTest::check_results() } prn_id = 0; - for(iter = carrierphase_ref.begin(); iter != carrierphase_ref.end(); iter++) + for (iter = carrierphase_ref.begin(); iter != carrierphase_ref.end(); iter++) { - for(it = iter->begin(); it != iter->end(); it++) + for (it = iter->begin(); it != iter->end(); it++) { // If a measure exists for this sow, store it - for(it2 = carrierphase_meas.at(prn_id).begin(); it2 != carrierphase_meas.at(prn_id).end(); it2++) + for (it2 = carrierphase_meas.at(prn_id).begin(); it2 != carrierphase_meas.at(prn_id).end(); it2++) { - if(std::abs(it->first - it2->first) < 0.1) // store measures closer than 10 ms. + if (std::abs(it->first - it2->first) < 0.1) // store measures closer than 10 ms. { carrierphase_ref_aligned.at(prn_id).push_back(*it); - cp_diff.at(prn_id).push_back(it->second - it2->second ); + cp_diff.at(prn_id).push_back(it->second - it2->second); // std::cout << "Sat " << prn_id << ": " << "Carrier_ref=" << it->second << " Carrier_meas=" << it2->second << " Diff:" << it->second - it2->second << std::endl; } } @@ -543,17 +543,17 @@ void ObsGpsL1SystemTest::check_results() prn_id++; } prn_id = 0; - for(iter = doppler_ref.begin(); iter != doppler_ref.end(); iter++) + for (iter = doppler_ref.begin(); iter != doppler_ref.end(); iter++) { - for(it = iter->begin(); it != iter->end(); it++) + for (it = iter->begin(); it != iter->end(); it++) { // If a measure exists for this sow, store it - for(it2 = doppler_meas.at(prn_id).begin(); it2 != doppler_meas.at(prn_id).end(); it2++) + for (it2 = doppler_meas.at(prn_id).begin(); it2 != doppler_meas.at(prn_id).end(); it2++) { - if(std::abs(it->first - it2->first) < 0.01) // store measures closer than 10 ms. + if (std::abs(it->first - it2->first) < 0.01) // store measures closer than 10 ms. { doppler_ref_aligned.at(prn_id).push_back(*it); - doppler_diff.at(prn_id).push_back(it->second - it2->second ); + doppler_diff.at(prn_id).push_back(it->second - it2->second); } } } @@ -563,23 +563,23 @@ void ObsGpsL1SystemTest::check_results() // Compute pseudorange error prn_id = 0; std::vector mean_pr_diff_v; - for(iter_diff = pr_diff.begin(); iter_diff != pr_diff.end(); iter_diff++) + for (iter_diff = pr_diff.begin(); iter_diff != pr_diff.end(); iter_diff++) { // For each satellite with reference and measurements aligned in time int number_obs = 0; double mean_diff = 0.0; - for(iter_v = iter_diff->begin(); iter_v != iter_diff->end(); iter_v++) + for (iter_v = iter_diff->begin(); iter_v != iter_diff->end(); iter_v++) { mean_diff = mean_diff + *iter_v; number_obs = number_obs + 1; } - if(number_obs > 0) + if (number_obs > 0) { mean_diff = mean_diff / number_obs; mean_pr_diff_v.push_back(mean_diff); std::cout << "-- Mean pseudorange difference for sat " << prn_id << ": " << mean_diff; double stdev_ = compute_stdev(*iter_diff); - std::cout << " +/- " << stdev_ ; + std::cout << " +/- " << stdev_; std::cout << " [m]" << std::endl; } else @@ -596,17 +596,17 @@ void ObsGpsL1SystemTest::check_results() // Compute carrier phase error prn_id = 0; std::vector mean_cp_diff_v; - for(iter_diff = cp_diff.begin(); iter_diff != cp_diff.end(); iter_diff++) + for (iter_diff = cp_diff.begin(); iter_diff != cp_diff.end(); iter_diff++) { // For each satellite with reference and measurements aligned in time int number_obs = 0; double mean_diff = 0.0; - for(iter_v = iter_diff->begin(); iter_v != iter_diff->end(); iter_v++) + for (iter_v = iter_diff->begin(); iter_v != iter_diff->end(); iter_v++) { mean_diff = mean_diff + *iter_v; number_obs = number_obs + 1; } - if(number_obs > 0) + if (number_obs > 0) { mean_diff = mean_diff / number_obs; mean_cp_diff_v.push_back(mean_diff); @@ -625,18 +625,18 @@ void ObsGpsL1SystemTest::check_results() // Compute Doppler error prn_id = 0; std::vector mean_doppler_v; - for(iter_diff = doppler_diff.begin(); iter_diff != doppler_diff.end(); iter_diff++) + for (iter_diff = doppler_diff.begin(); iter_diff != doppler_diff.end(); iter_diff++) { // For each satellite with reference and measurements aligned in time int number_obs = 0; double mean_diff = 0.0; - for(iter_v = iter_diff->begin(); iter_v != iter_diff->end(); iter_v++) + for (iter_v = iter_diff->begin(); iter_v != iter_diff->end(); iter_v++) { //std::cout << *iter_v << std::endl; mean_diff = mean_diff + *iter_v; number_obs = number_obs + 1; } - if(number_obs > 0) + if (number_obs > 0) { mean_diff = mean_diff / number_obs; mean_doppler_v.push_back(mean_diff); @@ -667,13 +667,13 @@ TEST_F(ObsGpsL1SystemTest, Observables_system_test) configure_generator(); // Generate signal raw signal samples and observations RINEX file - if(!FLAGS_disable_generator) + if (!FLAGS_disable_generator) { generate_signal(); } std::cout << "Validating generated reference RINEX obs file: " << FLAGS_filename_rinex_obs << " ..." << std::endl; - bool is_gen_rinex_obs_valid = check_valid_rinex_obs( "./" + FLAGS_filename_rinex_obs); + bool is_gen_rinex_obs_valid = check_valid_rinex_obs("./" + FLAGS_filename_rinex_obs); EXPECT_EQ(true, is_gen_rinex_obs_valid) << "The RINEX observation file " << FLAGS_filename_rinex_obs << ", generated by gnss-sim, is not well formed."; std::cout << "The file is valid." << std::endl; @@ -681,10 +681,10 @@ TEST_F(ObsGpsL1SystemTest, Observables_system_test) configure_receiver(); // Run the receiver - EXPECT_EQ( run_receiver(), 0) << "Problem executing the software-defined signal generator"; + EXPECT_EQ(run_receiver(), 0) << "Problem executing the software-defined signal generator"; std::cout << "Validating RINEX obs file obtained by GNSS-SDR: " << ObsGpsL1SystemTest::generated_rinex_obs << " ..." << std::endl; - is_gen_rinex_obs_valid = check_valid_rinex_obs( "./" + ObsGpsL1SystemTest::generated_rinex_obs); + is_gen_rinex_obs_valid = check_valid_rinex_obs("./" + ObsGpsL1SystemTest::generated_rinex_obs); EXPECT_EQ(true, is_gen_rinex_obs_valid) << "The RINEX observation file " << ObsGpsL1SystemTest::generated_rinex_obs << ", generated by GNSS-SDR, is not well formed."; std::cout << "The file is valid." << std::endl; @@ -693,28 +693,30 @@ TEST_F(ObsGpsL1SystemTest, Observables_system_test) } -int main(int argc, char **argv) +int main(int argc, char** argv) { std::cout << "Running Observables validation test..." << std::endl; int res = 0; try - { + { testing::InitGoogleTest(&argc, argv); - } - catch(...) {} // catch the "testing::internal::::ClassUniqueToAlwaysTrue" from gtest + } + catch (...) + { + } // catch the "testing::internal::::ClassUniqueToAlwaysTrue" from gtest google::ParseCommandLineFlags(&argc, &argv, true); google::InitGoogleLogging(argv[0]); // Run the Tests try - { + { res = RUN_ALL_TESTS(); - } - catch(...) - { + } + catch (...) + { LOG(WARNING) << "Unexpected catch"; - } + } google::ShutDownCommandLineFlags(); return res; } diff --git a/src/tests/system-tests/obs_system_test.cc b/src/tests/system-tests/obs_system_test.cc index afef8fcbb..52c726991 100644 --- a/src/tests/system-tests/obs_system_test.cc +++ b/src/tests/system-tests/obs_system_test.cc @@ -71,7 +71,7 @@ DEFINE_double(dp_error_mean_max, 75.0, "Maximum mean error in Doppler frequency" DEFINE_double(dp_error_std_max, 25.0, "Maximum standard deviation in Doppler frequency"); DEFINE_bool(plot_obs_sys_test, false, "Plots results of ObsSystemTest with gnuplot"); -class ObsSystemTest: public ::testing::Test +class ObsSystemTest : public ::testing::Test { public: int configure_receiver(); @@ -79,38 +79,38 @@ public: void check_results(); bool check_valid_rinex_obs(std::string filename, int rinex_ver); // return true if the file is a valid Rinex observation file. void read_rinex_files( - std::vector& pseudorange_ref, - std::vector& carrierphase_ref, - std::vector& doppler_ref, - std::vector& pseudorange_meas, - std::vector& carrierphase_meas, - std::vector& doppler_meas, - arma::mat& sow_prn_ref, - int signal_type); + std::vector& pseudorange_ref, + std::vector& carrierphase_ref, + std::vector& doppler_ref, + std::vector& pseudorange_meas, + std::vector& carrierphase_meas, + std::vector& doppler_meas, + arma::mat& sow_prn_ref, + int signal_type); void time_alignment_diff( - std::vector& ref, - std::vector& meas, - std::vector& diff); + std::vector& ref, + std::vector& meas, + std::vector& diff); void time_alignment_diff_cp( - std::vector& ref, - std::vector& meas, - std::vector& diff); + std::vector& ref, + std::vector& meas, + std::vector& diff); void time_alignment_diff_pr( - std::vector& ref, - std::vector& meas, - std::vector& diff, - arma::mat& sow_prn_ref); + std::vector& ref, + std::vector& meas, + std::vector& diff, + arma::mat& sow_prn_ref); void compute_pseudorange_error(std::vector& diff, - double error_th_mean, double error_th_std, - std::string signal_name); + double error_th_mean, double error_th_std, + std::string signal_name); void compute_carrierphase_error( - std::vector& diff, - double error_th_mean, double error_th_std, - std::string signal_name); + std::vector& diff, + double error_th_mean, double error_th_std, + std::string signal_name); void compute_doppler_error( - std::vector& diff, - double error_th_mean, double error_th_std, - std::string signal_name); + std::vector& diff, + double error_th_mean, double error_th_std, + std::string signal_name); std::string filename_rinex_obs = FLAGS_filename_rinex_true; std::string generated_rinex_obs = FLAGS_filename_rinex_obs; std::string configuration_file_ = FLAGS_configuration_file; @@ -126,7 +126,7 @@ public: const int num_prn_gal = 31; double pseudorange_error_th_mean = FLAGS_pr_error_mean_max; - double pseudorange_error_th_std= FLAGS_pr_error_std_max; + double pseudorange_error_th_std = FLAGS_pr_error_std_max; double carrierphase_error_th_mean = FLAGS_cp_error_mean_max; double carrierphase_error_th_std = FLAGS_cp_error_std_max; double doppler_error_th_mean = FLAGS_dp_error_mean_max; @@ -137,11 +137,11 @@ public: bool ObsSystemTest::check_valid_rinex_obs(std::string filename, int rinex_ver) { bool res = false; - if(rinex_ver == 2) + if (rinex_ver == 2) { res = gpstk::isRinexObsFile(filename); } - if(rinex_ver == 3) + if (rinex_ver == 3) { res = gpstk::isRinex3ObsFile(filename); } @@ -150,14 +150,14 @@ bool ObsSystemTest::check_valid_rinex_obs(std::string filename, int rinex_ver) void ObsSystemTest::read_rinex_files( - std::vector& pseudorange_ref, - std::vector& carrierphase_ref, - std::vector& doppler_ref, - std::vector& pseudorange_meas, - std::vector& carrierphase_meas, - std::vector& doppler_meas, - arma::mat& sow_prn_ref, - int signal_type) + std::vector& pseudorange_ref, + std::vector& carrierphase_ref, + std::vector& doppler_ref, + std::vector& pseudorange_meas, + std::vector& carrierphase_meas, + std::vector& doppler_meas, + arma::mat& sow_prn_ref, + int signal_type) { bool ref_exist = false; bool meas_exist = false; @@ -169,53 +169,53 @@ void ObsSystemTest::read_rinex_files( std::string signal_type_string; sow_prn_ref.reset(); - switch(signal_type) - { - case 0: //GPS L1 + switch (signal_type) + { + case 0: //GPS L1 - sat_type = gpstk::SatID::systemGPS; - max_prn = num_prn_gps; - pr_string = "C1C"; - cp_string = "L1C"; - dp_string = "D1C"; - signal_type_string = "GPS L1 C/A"; - break; + sat_type = gpstk::SatID::systemGPS; + max_prn = num_prn_gps; + pr_string = "C1C"; + cp_string = "L1C"; + dp_string = "D1C"; + signal_type_string = "GPS L1 C/A"; + break; - case 1: //Galileo E1B + case 1: //Galileo E1B - sat_type = gpstk::SatID::systemGalileo; - max_prn = num_prn_gal; - pr_string = "C1B"; - cp_string = "L1B"; - dp_string = "D1B"; - signal_type_string = "Galileo E1B"; - break; + sat_type = gpstk::SatID::systemGalileo; + max_prn = num_prn_gal; + pr_string = "C1B"; + cp_string = "L1B"; + dp_string = "D1B"; + signal_type_string = "Galileo E1B"; + break; - case 2: //GPS L5 + case 2: //GPS L5 - sat_type = gpstk::SatID::systemGPS; - max_prn = num_prn_gps; - pr_string = "C5X"; - cp_string = "L5X"; - dp_string = "D5X"; - signal_type_string = "GPS L5"; - break; + sat_type = gpstk::SatID::systemGPS; + max_prn = num_prn_gps; + pr_string = "C5X"; + cp_string = "L5X"; + dp_string = "D5X"; + signal_type_string = "GPS L5"; + break; - case 3: //Galileo E5a + case 3: //Galileo E5a - sat_type = gpstk::SatID::systemGalileo; - max_prn = num_prn_gal; - pr_string = "C5X"; - cp_string = "L5X"; - dp_string = "D5X"; - signal_type_string = "Galileo E5a"; - break; - } + sat_type = gpstk::SatID::systemGalileo; + max_prn = num_prn_gal; + pr_string = "C5X"; + cp_string = "L5X"; + dp_string = "D5X"; + signal_type_string = "Galileo E5a"; + break; + } // Open and read reference RINEX observables file std::cout << "Read: RINEX " << signal_type_string << " True" << std::endl; try - { + { gpstk::Rinex3ObsStream r_ref(filename_rinex_obs); r_ref.exceptions(std::ios::failbit); gpstk::Rinex3ObsData r_ref_data; @@ -227,55 +227,55 @@ void ObsSystemTest::read_rinex_files( { for (int myprn = 1; myprn < max_prn; myprn++) { - gpstk::SatID prn( myprn, sat_type); + gpstk::SatID prn(myprn, sat_type); gpstk::CommonTime time = r_ref_data.time; double sow(static_cast(time).sow); gpstk::Rinex3ObsData::DataMap::iterator pointer = r_ref_data.obs.find(prn); - if( pointer == r_ref_data.obs.end() ) + if (pointer == r_ref_data.obs.end()) { // PRN not present; do nothing } else { - dataobj = r_ref_data.getObs(prn, pr_string, r_ref_header); + dataobj = r_ref_data.getObs(prn, pr_string, r_ref_header); double P1 = dataobj.data; pseudorange_ref.at(myprn).insert_rows(pseudorange_ref.at(myprn).n_rows, arma::rowvec({sow, P1})); - dataobj = r_ref_data.getObs(prn, cp_string, r_ref_header); + dataobj = r_ref_data.getObs(prn, cp_string, r_ref_header); double L1 = dataobj.data; carrierphase_ref.at(myprn).insert_rows(carrierphase_ref.at(myprn).n_rows, arma::rowvec({sow, L1})); - dataobj = r_ref_data.getObs(prn, dp_string, r_ref_header); + dataobj = r_ref_data.getObs(prn, dp_string, r_ref_header); double D1 = dataobj.data; doppler_ref.at(myprn).insert_rows(doppler_ref.at(myprn).n_rows, arma::rowvec({sow, D1})); ref_exist = true; } // End of 'if( pointer == roe.obs.end() )' - } // end for - } // end while - } // End of 'try' block - catch(const gpstk::FFStreamError& e) - { + } // end for + } // end while + } // End of 'try' block + catch (const gpstk::FFStreamError& e) + { std::cout << e; exit(1); - } - catch(const gpstk::Exception& e) - { + } + catch (const gpstk::Exception& e) + { std::cout << e; exit(1); - } + } catch (...) - { + { std::cout << "unknown error. I don't feel so well..." << std::endl; exit(1); - } + } // Open and read measured RINEX observables file - std::cout << "Read: RINEX "<< signal_type_string << " measures" << std::endl; + std::cout << "Read: RINEX " << signal_type_string << " measures" << std::endl; try - { + { std::string arg2_gen; - if(internal_rinex_generation) + if (internal_rinex_generation) { arg2_gen = std::string("./") + generated_rinex_obs; } @@ -298,20 +298,20 @@ void ObsSystemTest::read_rinex_files( bool set_pr_min = true; for (int myprn = 1; myprn < max_prn; myprn++) { - gpstk::SatID prn( myprn, sat_type); + gpstk::SatID prn(myprn, sat_type); gpstk::CommonTime time = r_meas_data.time; double sow(static_cast(time).sow); gpstk::Rinex3ObsData::DataMap::iterator pointer = r_meas_data.obs.find(prn); - if( pointer == r_meas_data.obs.end() ) + if (pointer == r_meas_data.obs.end()) { // PRN not present; do nothing } else { - dataobj = r_meas_data.getObs(prn, pr_string, r_meas_header); + dataobj = r_meas_data.getObs(prn, pr_string, r_meas_header); double P1 = dataobj.data; pseudorange_meas.at(myprn).insert_rows(pseudorange_meas.at(myprn).n_rows, arma::rowvec({sow, P1})); - if(set_pr_min || (P1 < pr_min)) + if (set_pr_min || (P1 < pr_min)) { set_pr_min = false; pr_min = P1; @@ -319,47 +319,47 @@ void ObsSystemTest::read_rinex_files( prn_min = static_cast(myprn); } - dataobj = r_meas_data.getObs(prn, cp_string, r_meas_header); + dataobj = r_meas_data.getObs(prn, cp_string, r_meas_header); double L1 = dataobj.data; carrierphase_meas.at(myprn).insert_rows(carrierphase_meas.at(myprn).n_rows, arma::rowvec({sow, L1})); - dataobj = r_meas_data.getObs(prn, dp_string, r_meas_header); + dataobj = r_meas_data.getObs(prn, dp_string, r_meas_header); double D1 = dataobj.data; doppler_meas.at(myprn).insert_rows(doppler_meas.at(myprn).n_rows, arma::rowvec({sow, D1})); meas_exist = true; } // End of 'if( pointer == roe.obs.end() )' - } // end for + } // end for if (!set_pr_min) { - sow_prn_ref.insert_rows(sow_prn_ref.n_rows, arma::rowvec({sow_insert, pr_min, prn_min})); + sow_prn_ref.insert_rows(sow_prn_ref.n_rows, arma::rowvec({sow_insert, pr_min, prn_min})); } - } // end while - } // End of 'try' block - catch(const gpstk::FFStreamError& e) - { + } // end while + } // End of 'try' block + catch (const gpstk::FFStreamError& e) + { std::cout << e; exit(1); - } - catch(const gpstk::Exception& e) - { + } + catch (const gpstk::Exception& e) + { std::cout << e; exit(1); - } + } catch (...) - { + { std::cout << "unknown error. I don't feel so well..." << std::endl; exit(1); - } + } EXPECT_TRUE(ref_exist) << "RINEX reference file does not contain " << signal_type_string << " information"; EXPECT_TRUE(meas_exist) << "RINEX generated file does not contain " << signal_type_string << " information"; } void ObsSystemTest::time_alignment_diff( - std::vector& ref, - std::vector& meas, - std::vector& diff) + std::vector& ref, + std::vector& meas, + std::vector& diff) { std::vector::iterator iter_ref; std::vector::iterator iter_meas; @@ -368,9 +368,9 @@ void ObsSystemTest::time_alignment_diff( iter_ref = ref.begin(); iter_diff = diff.begin(); - for(iter_meas = meas.begin(); iter_meas != meas.end(); iter_meas++) + for (iter_meas = meas.begin(); iter_meas != meas.end(); iter_meas++) { - if( !iter_meas->is_empty() && !iter_ref->is_empty() ) + if (!iter_meas->is_empty() && !iter_ref->is_empty()) { arma::uvec index_ = arma::find(iter_meas->col(0) > iter_ref->at(0, 0)); arma::uword index_min = arma::min(index_); @@ -388,9 +388,9 @@ void ObsSystemTest::time_alignment_diff( void ObsSystemTest::time_alignment_diff_cp( - std::vector& ref, - std::vector& meas, - std::vector& diff) + std::vector& ref, + std::vector& meas, + std::vector& diff) { std::vector::iterator iter_ref; std::vector::iterator iter_meas; @@ -399,9 +399,9 @@ void ObsSystemTest::time_alignment_diff_cp( iter_ref = ref.begin(); iter_diff = diff.begin(); - for(iter_meas = meas.begin(); iter_meas != meas.end(); iter_meas++) + for (iter_meas = meas.begin(); iter_meas != meas.end(); iter_meas++) { - if( !iter_meas->is_empty() && !iter_ref->is_empty() ) + if (!iter_meas->is_empty() && !iter_ref->is_empty()) { arma::uvec index_ = arma::find(iter_meas->col(0) > iter_ref->at(0, 0)); arma::uword index_min = arma::min(index_); @@ -421,10 +421,10 @@ void ObsSystemTest::time_alignment_diff_cp( void ObsSystemTest::time_alignment_diff_pr( - std::vector& ref, - std::vector& meas, - std::vector& diff, - arma::mat& sow_prn_ref) + std::vector& ref, + std::vector& meas, + std::vector& diff, + arma::mat& sow_prn_ref) { std::vector::iterator iter_ref; std::vector::iterator iter_meas; @@ -438,14 +438,14 @@ void ObsSystemTest::time_alignment_diff_pr( arma::vec::iterator iter_vec1 = subtraction_pr_ref.begin_col(1); arma::vec::iterator iter_vec2 = subtraction_pr_ref.begin_col(2); - for(iter_vec1 = subtraction_pr_ref.begin_col(1); iter_vec1 != subtraction_pr_ref.end_col(1); iter_vec1++) + for (iter_vec1 = subtraction_pr_ref.begin_col(1); iter_vec1 != subtraction_pr_ref.end_col(1); iter_vec1++) { - arma::vec aux_pr; //vector with only 1 element - arma::vec aux_sow = {*iter_vec0}; //vector with only 1 element + arma::vec aux_pr; //vector with only 1 element + arma::vec aux_sow = {*iter_vec0}; //vector with only 1 element arma::interp1(ref.at(static_cast(*iter_vec2)).col(0), - ref.at(static_cast(*iter_vec2)).col(1), - aux_sow, - aux_pr); + ref.at(static_cast(*iter_vec2)).col(1), + aux_sow, + aux_pr); *iter_vec1 = aux_pr(0); iter_vec0++; iter_vec2++; @@ -453,9 +453,9 @@ void ObsSystemTest::time_alignment_diff_pr( iter_ref = ref.begin(); iter_diff = diff.begin(); - for(iter_meas = meas.begin(); iter_meas != meas.end(); iter_meas++) + for (iter_meas = meas.begin(); iter_meas != meas.end(); iter_meas++) { - if( !iter_meas->is_empty() && !iter_ref->is_empty() ) + if (!iter_meas->is_empty() && !iter_ref->is_empty()) { arma::uvec index_ = arma::find(iter_meas->col(0) > iter_ref->at(0, 0)); arma::uword index_min = arma::min(index_); @@ -480,14 +480,22 @@ int ObsSystemTest::configure_receiver() { config = std::make_shared(configuration_file_); - if( config->property("Channels_1C.count", 0) > 0 ) - {gps_1C = true;} - if( config->property("Channels_1B.count", 0) > 0 ) - {gal_1B = true;} - if( config->property("Channels_5X.count", 0) > 0 ) - {gal_E5a = true;} - if( config->property("Channels_7X.count", 0) > 0 ) //NOT DEFINITIVE!!!!! - {gps_L5 = true;} + if (config->property("Channels_1C.count", 0) > 0) + { + gps_1C = true; + } + if (config->property("Channels_1B.count", 0) > 0) + { + gal_1B = true; + } + if (config->property("Channels_5X.count", 0) > 0) + { + gal_E5a = true; + } + if (config->property("Channels_7X.count", 0) > 0) //NOT DEFINITIVE!!!!! + { + gps_L5 = true; + } return 0; } @@ -499,20 +507,20 @@ int ObsSystemTest::run_receiver() control_thread = std::make_shared(config); // start receiver try - { + { control_thread->run(); - } - catch(const boost::exception & e) - { + } + catch (const boost::exception& e) + { std::cout << "Boost exception: " << boost::diagnostic_information(e); - } - catch(const std::exception & ex) - { - std::cout << "STD exception: " << ex.what(); - } + } + catch (const std::exception& ex) + { + std::cout << "STD exception: " << ex.what(); + } // Get the name of the RINEX obs file generated by the receiver std::this_thread::sleep_for(std::chrono::milliseconds(2000)); - FILE *fp; + FILE* fp; std::string argum2 = std::string("/bin/ls *O | grep GSDR | tail -1"); char buffer[1035]; fp = popen(&argum2[0], "r"); @@ -533,33 +541,33 @@ int ObsSystemTest::run_receiver() void ObsSystemTest::compute_pseudorange_error( - std::vector& diff, - double error_th_mean, double error_th_std, - std::string signal_name) + std::vector& diff, + double error_th_mean, double error_th_std, + std::string signal_name) { int prn_id = 0; std::vector::iterator iter_diff; std::vector means; std::vector stddevs; std::vector prns; - for(iter_diff = diff.begin(); iter_diff != diff.end(); iter_diff++) + for (iter_diff = diff.begin(); iter_diff != diff.end(); iter_diff++) { - if(!iter_diff->is_empty()) + if (!iter_diff->is_empty()) { - while(iter_diff->has_nan()) + while (iter_diff->has_nan()) { bool nan_found = false; int k_aux = 0; - while(!nan_found) + while (!nan_found) { - if(!iter_diff->row(k_aux).is_finite()) + if (!iter_diff->row(k_aux).is_finite()) { - nan_found = true; - iter_diff->shed_row(k_aux); + nan_found = true; + iter_diff->shed_row(k_aux); } k_aux++; } - } + } double d_mean = std::sqrt(arma::mean(arma::square(*iter_diff))); means.push_back(d_mean); double d_stddev = arma::stddev(*iter_diff); @@ -573,10 +581,10 @@ void ObsSystemTest::compute_pseudorange_error( } prn_id++; } - if(FLAGS_plot_obs_sys_test == true) + if (FLAGS_plot_obs_sys_test == true) { const std::string gnuplot_executable(FLAGS_gnuplot_executable); - if(gnuplot_executable.empty()) + if (gnuplot_executable.empty()) { std::cout << "WARNING: Although the flag plot_obs_sys_test has been set to TRUE," << std::endl; std::cout << "gnuplot has not been found in your system." << std::endl; @@ -585,7 +593,7 @@ void ObsSystemTest::compute_pseudorange_error( else { try - { + { boost::filesystem::path p(gnuplot_executable); boost::filesystem::path dir = p.parent_path(); std::string gnuplot_path = dir.native(); @@ -599,58 +607,58 @@ void ObsSystemTest::compute_pseudorange_error( g1.plot_xy(prns, means, "RMS error"); g1.plot_xy(prns, stddevs, "Standard deviation"); size_t char_pos = signal_name.find(" "); - while(char_pos != std::string::npos) + while (char_pos != std::string::npos) { signal_name.replace(char_pos, 1, "_"); char_pos = signal_name.find(" "); } char_pos = signal_name.find("/"); - while(char_pos != std::string::npos) + while (char_pos != std::string::npos) { signal_name.replace(char_pos, 1, "_"); char_pos = signal_name.find("/"); } g1.savetops("Pseudorange_error_" + signal_name); g1.savetopdf("Pseudorange_error_" + signal_name, 18); - g1.showonscreen(); // window output - } - catch (const GnuplotException & ge) - { + g1.showonscreen(); // window output + } + catch (const GnuplotException& ge) + { std::cout << ge.what() << std::endl; - } + } } } } void ObsSystemTest::compute_carrierphase_error( - std::vector& diff, - double error_th_mean, double error_th_std, - std::string signal_name) + std::vector& diff, + double error_th_mean, double error_th_std, + std::string signal_name) { int prn_id = 0; std::vector means; std::vector stddevs; std::vector prns; std::vector::iterator iter_diff; - for(iter_diff = diff.begin(); iter_diff != diff.end(); iter_diff++) + for (iter_diff = diff.begin(); iter_diff != diff.end(); iter_diff++) { - if(!iter_diff->is_empty()) + if (!iter_diff->is_empty()) { - while(iter_diff->has_nan()) + while (iter_diff->has_nan()) { bool nan_found = false; int k_aux = 0; - while(!nan_found) + while (!nan_found) { - if(!iter_diff->row(k_aux).is_finite()) + if (!iter_diff->row(k_aux).is_finite()) { - nan_found = true; - iter_diff->shed_row(k_aux); + nan_found = true; + iter_diff->shed_row(k_aux); } k_aux++; } - } + } double d_mean = std::sqrt(arma::mean(arma::square(*iter_diff))); means.push_back(d_mean); double d_stddev = arma::stddev(*iter_diff); @@ -664,10 +672,10 @@ void ObsSystemTest::compute_carrierphase_error( } prn_id++; } - if(FLAGS_plot_obs_sys_test == true) + if (FLAGS_plot_obs_sys_test == true) { const std::string gnuplot_executable(FLAGS_gnuplot_executable); - if(gnuplot_executable.empty()) + if (gnuplot_executable.empty()) { std::cout << "WARNING: Although the flag plot_obs_sys_test has been set to TRUE," << std::endl; std::cout << "gnuplot has not been found in your system." << std::endl; @@ -676,7 +684,7 @@ void ObsSystemTest::compute_carrierphase_error( else { try - { + { boost::filesystem::path p(gnuplot_executable); boost::filesystem::path dir = p.parent_path(); std::string gnuplot_path = dir.native(); @@ -690,58 +698,58 @@ void ObsSystemTest::compute_carrierphase_error( g1.plot_xy(prns, means, "RMS error"); g1.plot_xy(prns, stddevs, "Standard deviation"); size_t char_pos = signal_name.find(" "); - while(char_pos != std::string::npos) + while (char_pos != std::string::npos) { signal_name.replace(char_pos, 1, "_"); char_pos = signal_name.find(" "); } char_pos = signal_name.find("/"); - while(char_pos != std::string::npos) + while (char_pos != std::string::npos) { signal_name.replace(char_pos, 1, "_"); char_pos = signal_name.find("/"); } g1.savetops("Carrier_phase_error_" + signal_name); g1.savetopdf("Carrier_phase_error_" + signal_name, 18); - g1.showonscreen(); // window output - } - catch (const GnuplotException & ge) - { + g1.showonscreen(); // window output + } + catch (const GnuplotException& ge) + { std::cout << ge.what() << std::endl; - } + } } } } void ObsSystemTest::compute_doppler_error( - std::vector& diff, - double error_th_mean, double error_th_std, - std::string signal_name) + std::vector& diff, + double error_th_mean, double error_th_std, + std::string signal_name) { int prn_id = 0; std::vector means; std::vector stddevs; std::vector prns; std::vector::iterator iter_diff; - for(iter_diff = diff.begin(); iter_diff != diff.end(); iter_diff++) + for (iter_diff = diff.begin(); iter_diff != diff.end(); iter_diff++) { - if(!iter_diff->is_empty()) + if (!iter_diff->is_empty()) { - while(iter_diff->has_nan()) + while (iter_diff->has_nan()) { bool nan_found = false; int k_aux = 0; - while(!nan_found) + while (!nan_found) { - if(!iter_diff->row(k_aux).is_finite()) + if (!iter_diff->row(k_aux).is_finite()) { - nan_found = true; - iter_diff->shed_row(k_aux); + nan_found = true; + iter_diff->shed_row(k_aux); } k_aux++; } - } + } double d_mean = std::sqrt(arma::mean(arma::square(*iter_diff))); means.push_back(d_mean); double d_stddev = arma::stddev(*iter_diff); @@ -755,10 +763,10 @@ void ObsSystemTest::compute_doppler_error( } prn_id++; } - if(FLAGS_plot_obs_sys_test == true) + if (FLAGS_plot_obs_sys_test == true) { const std::string gnuplot_executable(FLAGS_gnuplot_executable); - if(gnuplot_executable.empty()) + if (gnuplot_executable.empty()) { std::cout << "WARNING: Although the flag plot_obs_sys_test has been set to TRUE," << std::endl; std::cout << "gnuplot has not been found in your system." << std::endl; @@ -767,7 +775,7 @@ void ObsSystemTest::compute_doppler_error( else { try - { + { boost::filesystem::path p(gnuplot_executable); boost::filesystem::path dir = p.parent_path(); std::string gnuplot_path = dir.native(); @@ -781,25 +789,25 @@ void ObsSystemTest::compute_doppler_error( g1.plot_xy(prns, means, "RMS error"); g1.plot_xy(prns, stddevs, "Standard deviation"); size_t char_pos = signal_name.find(" "); - while(char_pos != std::string::npos) + while (char_pos != std::string::npos) { signal_name.replace(char_pos, 1, "_"); char_pos = signal_name.find(" "); } char_pos = signal_name.find("/"); - while(char_pos != std::string::npos) + while (char_pos != std::string::npos) { signal_name.replace(char_pos, 1, "_"); char_pos = signal_name.find("/"); } g1.savetops("Doppler_error_" + signal_name); g1.savetopdf("Doppler_error_" + signal_name, 18); - g1.showonscreen(); // window output - } - catch (const GnuplotException & ge) - { + g1.showonscreen(); // window output + } + catch (const GnuplotException& ge) + { std::cout << ge.what() << std::endl; - } + } } } } @@ -808,7 +816,7 @@ void ObsSystemTest::compute_doppler_error( void ObsSystemTest::check_results() { arma::mat sow_prn_ref; - if(gps_1C) + if (gps_1C) { std::vector pseudorange_ref(num_prn_gps); std::vector carrierphase_ref(num_prn_gps); @@ -846,7 +854,7 @@ void ObsSystemTest::check_results() compute_doppler_error(dp_diff, doppler_error_th_mean, doppler_error_th_std, "GPS L1 C/A"); } - if(gps_L5) + if (gps_L5) { std::vector pseudorange_ref(num_prn_gps); std::vector carrierphase_ref(num_prn_gps); @@ -884,7 +892,7 @@ void ObsSystemTest::check_results() compute_doppler_error(dp_diff, doppler_error_th_mean, doppler_error_th_std, "GPS L5"); } - if(gal_1B) + if (gal_1B) { std::vector pseudorange_ref(num_prn_gal); std::vector carrierphase_ref(num_prn_gal); @@ -922,7 +930,7 @@ void ObsSystemTest::check_results() compute_doppler_error(dp_diff, doppler_error_th_mean, doppler_error_th_std, "Galileo E1B"); } - if(gal_E5a) + if (gal_E5a) { std::vector pseudorange_ref(num_prn_gal); std::vector carrierphase_ref(num_prn_gal); @@ -971,16 +979,16 @@ TEST_F(ObsSystemTest, Observables_system_test) std::cout << "The file is valid." << std::endl; // Configure receiver configure_receiver(); - if(generated_rinex_obs.compare("default_string") == 0) + if (generated_rinex_obs.compare("default_string") == 0) { // Run the receiver - ASSERT_EQ( run_receiver(), 0) << "Problem executing the software-defined signal generator"; + ASSERT_EQ(run_receiver(), 0) << "Problem executing the software-defined signal generator"; } std::cout << "Validating RINEX obs file obtained by GNSS-SDR: " << generated_rinex_obs << " ..." << std::endl; bool is_gen_rinex_obs_valid = false; - if(internal_rinex_generation) + if (internal_rinex_generation) { - is_gen_rinex_obs_valid = check_valid_rinex_obs( "./" + generated_rinex_obs, config->property("PVT.rinex_version", 3)); + is_gen_rinex_obs_valid = check_valid_rinex_obs("./" + generated_rinex_obs, config->property("PVT.rinex_version", 3)); } else { @@ -993,28 +1001,30 @@ TEST_F(ObsSystemTest, Observables_system_test) } -int main(int argc, char **argv) +int main(int argc, char** argv) { std::cout << "Running GNSS-SDR in Space Observables validation test..." << std::endl; int res = 0; try - { + { testing::InitGoogleTest(&argc, argv); - } - catch(...) {} // catch the "testing::internal::::ClassUniqueToAlwaysTrue" from gtest + } + catch (...) + { + } // catch the "testing::internal::::ClassUniqueToAlwaysTrue" from gtest google::ParseCommandLineFlags(&argc, &argv, true); google::InitGoogleLogging(argv[0]); // Run the Tests try - { + { res = RUN_ALL_TESTS(); - } - catch(...) - { + } + catch (...) + { LOG(WARNING) << "Unexpected catch"; - } + } google::ShutDownCommandLineFlags(); return res; } diff --git a/src/tests/system-tests/position_test.cc b/src/tests/system-tests/position_test.cc index 5b1a9cb4f..350055d2f 100644 --- a/src/tests/system-tests/position_test.cc +++ b/src/tests/system-tests/position_test.cc @@ -56,7 +56,7 @@ DEFINE_bool(plot_position_test, false, "Plots results of FFTLengthTest with gnup concurrent_queue global_gps_acq_assist_queue; concurrent_map global_gps_acq_assist_map; -class StaticPositionSystemTest: public ::testing::Test +class StaticPositionSystemTest : public ::testing::Test { public: int configure_generator(); @@ -78,18 +78,18 @@ private: std::string filename_rinex_obs = FLAGS_filename_rinex_obs; std::string filename_raw_data = FLAGS_filename_raw_data; - void print_results(const std::vector & east, - const std::vector & north, - const std::vector & up); + void print_results(const std::vector& east, + const std::vector& north, + const std::vector& up); - double compute_stdev_precision(const std::vector & vec); - double compute_stdev_accuracy(const std::vector & vec, double ref); + double compute_stdev_precision(const std::vector& vec); + double compute_stdev_accuracy(const std::vector& vec, double ref); void geodetic2Enu(const double latitude, const double longitude, const double altitude, - double* east, double* north, double* up); + double* east, double* north, double* up); void geodetic2Ecef(const double latitude, const double longitude, const double altitude, - double* x, double* y, double* z); + double* x, double* y, double* z); std::shared_ptr config; std::shared_ptr config_f; @@ -97,12 +97,11 @@ private: }; - void StaticPositionSystemTest::geodetic2Ecef(const double latitude, const double longitude, const double altitude, - double* x, double* y, double* z) + double* x, double* y, double* z) { - const double a = 6378137.0; // WGS84 - const double b = 6356752.314245; // WGS84 + const double a = 6378137.0; // WGS84 + const double b = 6356752.314245; // WGS84 double aux_x, aux_y, aux_z; @@ -124,7 +123,7 @@ void StaticPositionSystemTest::geodetic2Ecef(const double latitude, const double void StaticPositionSystemTest::geodetic2Enu(double latitude, double longitude, double altitude, - double* east, double* north, double* up) + double* east, double* north, double* up) { double x, y, z; const double d2r = PI / 180.0; @@ -166,12 +165,12 @@ void StaticPositionSystemTest::geodetic2Enu(double latitude, double longitude, d } -double StaticPositionSystemTest::compute_stdev_precision(const std::vector & vec) +double StaticPositionSystemTest::compute_stdev_precision(const std::vector& vec) { double sum__ = std::accumulate(vec.begin(), vec.end(), 0.0); double mean__ = sum__ / vec.size(); double accum__ = 0.0; - std::for_each (std::begin(vec), std::end(vec), [&](const double d) { + std::for_each(std::begin(vec), std::end(vec), [&](const double d) { accum__ += (d - mean__) * (d - mean__); }); double stdev__ = std::sqrt(accum__ / (vec.size() - 1)); @@ -179,11 +178,11 @@ double StaticPositionSystemTest::compute_stdev_precision(const std::vector & vec, const double ref) +double StaticPositionSystemTest::compute_stdev_accuracy(const std::vector& vec, const double ref) { const double mean__ = ref; double accum__ = 0.0; - std::for_each (std::begin(vec), std::end(vec), [&](const double d) { + std::for_each(std::begin(vec), std::end(vec), [&](const double d) { accum__ += (d - mean__) * (d - mean__); }); double stdev__ = std::sqrt(accum__ / (vec.size() - 1)); @@ -197,18 +196,18 @@ int StaticPositionSystemTest::configure_generator() generator_binary = FLAGS_generator_binary; p1 = std::string("-rinex_nav_file=") + FLAGS_rinex_nav_file; - if(FLAGS_dynamic_position.empty()) + if (FLAGS_dynamic_position.empty()) { p2 = std::string("-static_position=") + FLAGS_static_position + std::string(",") + std::to_string(std::min(FLAGS_duration * 10, 3000)); - if(FLAGS_duration > 300) std::cout << "WARNING: Duration has been set to its maximum value of 300 s" << std::endl; + if (FLAGS_duration > 300) std::cout << "WARNING: Duration has been set to its maximum value of 300 s" << std::endl; } else { p2 = std::string("-obs_pos_file=") + std::string(FLAGS_dynamic_position); } - p3 = std::string("-rinex_obs_file=") + FLAGS_filename_rinex_obs; // RINEX 2.10 observation file output - p4 = std::string("-sig_out_file=") + FLAGS_filename_raw_data; // Baseband signal output file. Will be stored in int8_t IQ multiplexed samples - p5 = std::string("-sampling_freq=") + std::to_string(baseband_sampling_freq); //Baseband sampling frequency [MSps] + p3 = std::string("-rinex_obs_file=") + FLAGS_filename_rinex_obs; // RINEX 2.10 observation file output + p4 = std::string("-sig_out_file=") + FLAGS_filename_raw_data; // Baseband signal output file. Will be stored in int8_t IQ multiplexed samples + p5 = std::string("-sampling_freq=") + std::to_string(baseband_sampling_freq); //Baseband sampling frequency [MSps] return 0; } @@ -218,7 +217,7 @@ int StaticPositionSystemTest::generate_signal() pid_t wait_result; int child_status; - char *const parmList[] = { &generator_binary[0], &generator_binary[0], &p1[0], &p2[0], &p3[0], &p4[0], &p5[0], NULL }; + char* const parmList[] = {&generator_binary[0], &generator_binary[0], &p1[0], &p2[0], &p3[0], &p4[0], &p5[0], NULL}; int pid; if ((pid = fork()) == -1) @@ -238,7 +237,7 @@ int StaticPositionSystemTest::generate_signal() int StaticPositionSystemTest::configure_receiver() { - if(FLAGS_config_file_ptest.empty()) + if (FLAGS_config_file_ptest.empty()) { config = std::make_shared(); const int sampling_rate_internal = baseband_sampling_freq; @@ -406,7 +405,7 @@ int StaticPositionSystemTest::configure_receiver() int StaticPositionSystemTest::run_receiver() { std::shared_ptr control_thread; - if(FLAGS_config_file_ptest.empty()) + if (FLAGS_config_file_ptest.empty()) { control_thread = std::make_shared(config); } @@ -417,21 +416,21 @@ int StaticPositionSystemTest::run_receiver() // start receiver try - { + { control_thread->run(); - } - catch(const boost::exception & e) - { + } + catch (const boost::exception& e) + { std::cout << "Boost exception: " << boost::diagnostic_information(e); - } - catch(const std::exception & ex) - { - std::cout << "STD exception: " << ex.what(); - } + } + catch (const std::exception& ex) + { + std::cout << "STD exception: " << ex.what(); + } // Get the name of the KML file generated by the receiver std::this_thread::sleep_for(std::chrono::milliseconds(2000)); - FILE *fp; + FILE* fp; std::string argum2 = std::string("/bin/ls *kml | tail -1"); char buffer[1035]; fp = popen(&argum2[0], "r"); @@ -464,7 +463,7 @@ void StaticPositionSystemTest::check_results() // Skip header std::getline(myfile, line); bool is_header = true; - while(is_header) + while (is_header) { std::getline(myfile, line); std::size_t found = line.find(""); @@ -473,11 +472,12 @@ void StaticPositionSystemTest::check_results() bool is_data = true; //read data - while(is_data) + while (is_data) { std::getline(myfile, line); std::size_t found = line.find(""); - if (found != std::string::npos) is_data = false; + if (found != std::string::npos) + is_data = false; else { std::string str2; @@ -490,9 +490,9 @@ void StaticPositionSystemTest::check_results() { std::getline(iss, str2, ','); value = std::stod(str2); - if(i == 0) lat = value; - if(i == 1) longitude = value; - if(i == 2) h = value; + if (i == 0) lat = value; + if (i == 1) longitude = value; + if (i == 2) h = value; } double north, east, up; @@ -523,7 +523,7 @@ void StaticPositionSystemTest::check_results() std::stringstream stm; std::ofstream position_test_file; - if(FLAGS_config_file_ptest.empty()) + if (FLAGS_config_file_ptest.empty()) { stm << "---- ACCURACY ----" << std::endl; stm << "2DRMS = " << 2 * sqrt(sigma_E_2_accuracy + sigma_N_2_accuracy) << " [m]" << std::endl; @@ -548,31 +548,31 @@ void StaticPositionSystemTest::check_results() stm << "SEP = " << 0.51 * (sigma_E_2_precision + sigma_N_2_precision + sigma_U_2_precision) << " [m]" << std::endl; std::cout << stm.rdbuf(); - std::string output_filename = "position_test_output_" + StaticPositionSystemTest::generated_kml_file.erase(StaticPositionSystemTest::generated_kml_file.length() - 3,3) + "txt"; + std::string output_filename = "position_test_output_" + StaticPositionSystemTest::generated_kml_file.erase(StaticPositionSystemTest::generated_kml_file.length() - 3, 3) + "txt"; position_test_file.open(output_filename.c_str()); - if(position_test_file.is_open()) + if (position_test_file.is_open()) { position_test_file << stm.str(); position_test_file.close(); } // Sanity Check - double precision_SEP = 0.51 * (sigma_E_2_precision + sigma_N_2_precision + sigma_U_2_precision); + double precision_SEP = 0.51 * (sigma_E_2_precision + sigma_N_2_precision + sigma_U_2_precision); ASSERT_LT(precision_SEP, 20.0); - if(FLAGS_plot_position_test == true) + if (FLAGS_plot_position_test == true) { print_results(pos_e, pos_n, pos_u); } } -void StaticPositionSystemTest::print_results(const std::vector & east, - const std::vector & north, - const std::vector & up) +void StaticPositionSystemTest::print_results(const std::vector& east, + const std::vector& north, + const std::vector& up) { const std::string gnuplot_executable(FLAGS_gnuplot_executable); - if(gnuplot_executable.empty()) + if (gnuplot_executable.empty()) { std::cout << "WARNING: Although the flag plot_position_test has been set to TRUE," << std::endl; std::cout << "gnuplot has not been found in your system." << std::endl; @@ -604,7 +604,7 @@ void StaticPositionSystemTest::print_results(const std::vector & east, double two_drms = 2 * sqrt(sigma_E_2_precision + sigma_N_2_precision); double ninty_sas = 0.833 * (sigma_E_2_precision + sigma_N_2_precision + sigma_U_2_precision); try - { + { boost::filesystem::path p(gnuplot_executable); boost::filesystem::path dir = p.parent_path(); std::string gnuplot_path = dir.native(); @@ -627,7 +627,7 @@ void StaticPositionSystemTest::print_results(const std::vector & east, g1.savetops("Position_test_2D"); g1.savetopdf("Position_test_2D", 18); - g1.showonscreen(); // window output + g1.showonscreen(); // window output Gnuplot g2("points"); g2.set_title("3D precision"); @@ -642,31 +642,30 @@ void StaticPositionSystemTest::print_results(const std::vector & east, g2.cmd("set ticslevel 0"); g2.cmd("set style fill transparent solid 0.30 border\n set parametric\n set urange [0:2.0*pi]\n set vrange [-pi/2:pi/2]\n r = " + - std::to_string(ninty_sas) + - "\n fx(v,u) = r*cos(v)*cos(u)\n fy(v,u) = r*cos(v)*sin(u)\n fz(v) = r*sin(v) \n splot fx(v,u),fy(v,u),fz(v) title \"90\%-SAS\" lt rgb \"gray\"\n"); + std::to_string(ninty_sas) + + "\n fx(v,u) = r*cos(v)*cos(u)\n fy(v,u) = r*cos(v)*sin(u)\n fz(v) = r*sin(v) \n splot fx(v,u),fy(v,u),fz(v) title \"90\%-SAS\" lt rgb \"gray\"\n"); g2.plot_xyz(east, north, up, "3D Position Fixes"); g2.savetops("Position_test_3D"); g2.savetopdf("Position_test_3D"); - g2.showonscreen(); // window output - } - catch (const GnuplotException & ge) - { + g2.showonscreen(); // window output + } + catch (const GnuplotException& ge) + { std::cout << ge.what() << std::endl; - } + } } - } TEST_F(StaticPositionSystemTest, Position_system_test) { - if(FLAGS_config_file_ptest.empty()) + if (FLAGS_config_file_ptest.empty()) { // Configure the signal generator configure_generator(); // Generate signal raw signal samples and observations RINEX file - if(!FLAGS_disable_generator) + if (!FLAGS_disable_generator) { generate_signal(); } @@ -676,35 +675,37 @@ TEST_F(StaticPositionSystemTest, Position_system_test) configure_receiver(); // Run the receiver - EXPECT_EQ( run_receiver(), 0) << "Problem executing the software-defined signal generator"; + EXPECT_EQ(run_receiver(), 0) << "Problem executing the software-defined signal generator"; // Check results check_results(); } -int main(int argc, char **argv) +int main(int argc, char** argv) { std::cout << "Running Position precision test..." << std::endl; int res = 0; try - { + { testing::InitGoogleTest(&argc, argv); - } - catch(...) {} // catch the "testing::internal::::ClassUniqueToAlwaysTrue" from gtest + } + catch (...) + { + } // catch the "testing::internal::::ClassUniqueToAlwaysTrue" from gtest google::ParseCommandLineFlags(&argc, &argv, true); google::InitGoogleLogging(argv[0]); // Run the Tests try - { + { res = RUN_ALL_TESTS(); - } - catch(...) - { + } + catch (...) + { LOG(WARNING) << "Unexpected catch"; - } + } google::ShutDownCommandLineFlags(); return res; } diff --git a/src/tests/system-tests/ttff_gps_l1.cc b/src/tests/system-tests/ttff_gps_l1.cc index 931e20ea7..cf177f268 100644 --- a/src/tests/system-tests/ttff_gps_l1.cc +++ b/src/tests/system-tests/ttff_gps_l1.cc @@ -68,18 +68,19 @@ concurrent_map global_gps_acq_assist_map; std::vector TTFF_v; const int decimation_factor = 1; -typedef struct { - long mtype; // required by SysV message +typedef struct +{ + long mtype; // required by SysV message double ttff; } ttff_msgbuf; -class TfttGpsL1CATest: public ::testing::Test +class TfttGpsL1CATest : public ::testing::Test { public: void config_1(); void config_2(); - void print_TTFF_report(const std::vector & ttff_v, std::shared_ptr config_); + void print_TTFF_report(const std::vector &ttff_v, std::shared_ptr config_); std::shared_ptr config; std::shared_ptr config2; @@ -236,7 +237,7 @@ void TfttGpsL1CATest::config_1() void TfttGpsL1CATest::config_2() { - if(FLAGS_config_file_ttff.empty()) + if (FLAGS_config_file_ttff.empty()) { std::string path = std::string(TEST_PATH); std::string filename = path + "../../conf/gnss-sdr_GPS_L1_USRP_X300_realtime.conf"; @@ -267,25 +268,29 @@ void receive_msg() key_t key_stop = 1102; bool leave = false; - while(!leave) + while (!leave) { // wait for the queue to be created - while((msqid = msgget(key, 0644)) == -1){} + while ((msqid = msgget(key, 0644)) == -1) + { + } if (msgrcv(msqid, &msg, msgrcv_size, 1, 0) != -1) { ttff_msg = msg.ttff; - if( (ttff_msg != 0) && (ttff_msg != -1)) + if ((ttff_msg != 0) && (ttff_msg != -1)) { TTFF_v.push_back(ttff_msg); LOG(INFO) << "Valid Time-To-First-Fix: " << ttff_msg << "[s]"; // Stop the receiver - while(((msqid_stop = msgget(key_stop, 0644))) == -1){} + while (((msqid_stop = msgget(key_stop, 0644))) == -1) + { + } double msgsend_size = sizeof(msg_stop.ttff); msgsnd(msqid_stop, &msg_stop, msgsend_size, IPC_NOWAIT); } - if( std::abs(ttff_msg - (-1.0) ) < 10 * std::numeric_limits::epsilon() ) + if (std::abs(ttff_msg - (-1.0)) < 10 * std::numeric_limits::epsilon()) { leave = true; } @@ -295,7 +300,7 @@ void receive_msg() } -void TfttGpsL1CATest::print_TTFF_report(const std::vector & ttff_v, std::shared_ptr config_) +void TfttGpsL1CATest::print_TTFF_report(const std::vector &ttff_v, std::shared_ptr config_) { std::ofstream ttff_report_file; std::string filename = "ttff_report"; @@ -308,38 +313,38 @@ void TfttGpsL1CATest::print_TTFF_report(const std::vector & ttff_v, std: const int year = timeinfo.tm_year - 100; strm0 << year; const int month = timeinfo.tm_mon + 1; - if(month < 10) + if (month < 10) { strm0 << "0"; } strm0 << month; const int day = timeinfo.tm_mday; - if(day < 10) + if (day < 10) { strm0 << "0"; } strm0 << day << "_"; const int hour = timeinfo.tm_hour; - if(hour < 10) - { + if (hour < 10) + { strm0 << "0"; } strm0 << hour; const int min = timeinfo.tm_min; - if(min < 10) + if (min < 10) { strm0 << "0"; } strm0 << min; const int sec = timeinfo.tm_sec; - if(sec < 10) + if (sec < 10) { strm0 << "0"; } strm0 << sec; - filename_ = filename + "_" + strm0.str() + ".txt"; + filename_ = filename + "_" + strm0.str() + ".txt"; ttff_report_file.open(filename_.c_str()); @@ -363,7 +368,7 @@ void TfttGpsL1CATest::print_TTFF_report(const std::vector & ttff_v, std: stm << "---------------------------" << std::endl; stm << " Time-To-First-Fix Report" << std::endl; - stm << "---------------------------" << std::endl; + stm << "---------------------------" << std::endl; stm << "Initial receiver status: "; if (read_ephemeris) { @@ -383,7 +388,7 @@ void TfttGpsL1CATest::print_TTFF_report(const std::vector & ttff_v, std: stm << "Disabled." << std::endl; } stm << "Valid measurements (" << ttff.size() << "/" << FLAGS_num_measurements << "): "; - for(double ttff_ : ttff) stm << ttff_ << " "; + for (double ttff_ : ttff) stm << ttff_ << " "; stm << std::endl; stm << "TTFF mean: " << mean << " [s]" << std::endl; if (ttff.size() > 0) @@ -393,9 +398,10 @@ void TfttGpsL1CATest::print_TTFF_report(const std::vector & ttff_v, std: } stm << "TTFF stdev: " << stdev << " [s]" << std::endl; stm << "Operating System: " << std::string(HOST_SYSTEM) << std::endl; - stm << "Navigation mode: " << "3D" << std::endl; + stm << "Navigation mode: " + << "3D" << std::endl; - if(source.compare("UHD_Signal_Source")) + if (source.compare("UHD_Signal_Source")) { stm << "Source: File" << std::endl; } @@ -429,11 +435,11 @@ TEST_F(TfttGpsL1CATest, ColdStart) config2->set_property("GNSS-SDR.SUPL_read_gps_assistance_xml", "false"); config2->set_property("PVT.flag_rtcm_server", "false"); - for(int n = 0; n < FLAGS_num_measurements; n++) + for (int n = 0; n < FLAGS_num_measurements; n++) { // Create a new ControlThread object with a smart pointer std::shared_ptr control_thread; - if(FLAGS_config_file_ttff.empty()) + if (FLAGS_config_file_ttff.empty()) { control_thread = std::make_shared(config); } @@ -448,17 +454,17 @@ TEST_F(TfttGpsL1CATest, ColdStart) start = std::chrono::system_clock::now(); // start receiver try - { + { control_thread->run(); - } - catch(const boost::exception & e) - { + } + catch (const boost::exception &e) + { std::cout << "Boost exception: " << boost::diagnostic_information(e); - } - catch(const std::exception & ex) - { - std::cout << "STD exception: " << ex.what(); - } + } + catch (const std::exception &ex) + { + std::cout << "STD exception: " << ex.what(); + } // stop clock end = std::chrono::system_clock::now(); @@ -470,7 +476,7 @@ TEST_F(TfttGpsL1CATest, ColdStart) num_measurements = num_measurements + 1; std::cout << "Just finished measurement " << num_measurements << ", which took " << ttff << " seconds." << std::endl; - if(n < FLAGS_num_measurements - 1) + if (n < FLAGS_num_measurements - 1) { std::random_device r; std::default_random_engine e1(r()); @@ -478,13 +484,14 @@ TEST_F(TfttGpsL1CATest, ColdStart) float random_variable_0_1 = uniform_dist(e1); int random_delay_s = static_cast(random_variable_0_1 * 25.0); std::cout << "Waiting a random amount of time (from 5 to 30 s) to start a new measurement... " << std::endl; - std::cout << "This time will wait " << random_delay_s + 5 << " s." << std::endl << std::endl; + std::cout << "This time will wait " << random_delay_s + 5 << " s." << std::endl + << std::endl; std::this_thread::sleep_until(std::chrono::system_clock::now() + std::chrono::seconds(5) + std::chrono::seconds(random_delay_s)); } } // Print TTFF report - if(FLAGS_config_file_ttff.empty()) + if (FLAGS_config_file_ttff.empty()) { print_TTFF_report(TTFF_v, config); } @@ -492,7 +499,7 @@ TEST_F(TfttGpsL1CATest, ColdStart) { print_TTFF_report(TTFF_v, config2); } - std::this_thread::sleep_until(std::chrono::system_clock::now() + std::chrono::seconds(5)); //let the USRP some time to rest before the next test + std::this_thread::sleep_until(std::chrono::system_clock::now() + std::chrono::seconds(5)); //let the USRP some time to rest before the next test } @@ -512,11 +519,11 @@ TEST_F(TfttGpsL1CATest, HotStart) config2->set_property("GNSS-SDR.SUPL_read_gps_assistance_xml", "true"); config2->set_property("PVT.flag_rtcm_server", "false"); - for(int n = 0; n < FLAGS_num_measurements; n++) + for (int n = 0; n < FLAGS_num_measurements; n++) { // Create a new ControlThread object with a smart pointer std::shared_ptr control_thread; - if(FLAGS_config_file_ttff.empty()) + if (FLAGS_config_file_ttff.empty()) { control_thread = std::make_shared(config); } @@ -531,17 +538,17 @@ TEST_F(TfttGpsL1CATest, HotStart) // start receiver try - { + { control_thread->run(); - } - catch(const boost::exception & e) - { + } + catch (const boost::exception &e) + { std::cout << "Boost exception: " << boost::diagnostic_information(e); - } - catch(const std::exception & ex) - { - std::cout << "STD exception: " << ex.what(); - } + } + catch (const std::exception &ex) + { + std::cout << "STD exception: " << ex.what(); + } // stop clock end = std::chrono::system_clock::now(); @@ -553,7 +560,7 @@ TEST_F(TfttGpsL1CATest, HotStart) num_measurements = num_measurements + 1; std::cout << "Just finished measurement " << num_measurements << ", which took " << ttff << " seconds." << std::endl; - if(n < FLAGS_num_measurements - 1) + if (n < FLAGS_num_measurements - 1) { std::random_device r; std::default_random_engine e1(r()); @@ -561,13 +568,14 @@ TEST_F(TfttGpsL1CATest, HotStart) float random_variable_0_1 = uniform_dist(e1); int random_delay_s = static_cast(random_variable_0_1 * 25.0); std::cout << "Waiting a random amount of time (from 5 to 30 s) to start new measurement... " << std::endl; - std::cout << "This time will wait " << random_delay_s + 5 << " s." << std::endl << std::endl; + std::cout << "This time will wait " << random_delay_s + 5 << " s." << std::endl + << std::endl; std::this_thread::sleep_until(std::chrono::system_clock::now() + std::chrono::seconds(5) + std::chrono::seconds(random_delay_s)); } } // Print TTFF report - if(FLAGS_config_file_ttff.empty()) + if (FLAGS_config_file_ttff.empty()) { print_TTFF_report(TTFF_v, config); } @@ -584,10 +592,12 @@ int main(int argc, char **argv) int res = 0; TTFF_v.clear(); try - { + { testing::InitGoogleTest(&argc, argv); - } - catch(...) {} // catch the "testing::internal::::ClassUniqueToAlwaysTrue" from gtest + } + catch (...) + { + } // catch the "testing::internal::::ClassUniqueToAlwaysTrue" from gtest google::ParseCommandLineFlags(&argc, &argv, true); google::InitGoogleLogging(argv[0]); @@ -597,24 +607,24 @@ int main(int argc, char **argv) // Run the Tests try - { + { res = RUN_ALL_TESTS(); - } - catch(...) - { + } + catch (...) + { LOG(WARNING) << "Unexpected catch"; - } + } // Terminate the queue thread key_t sysv_msg_key; int sysv_msqid; sysv_msg_key = 1101; int msgflg = IPC_CREAT | 0666; - if ((sysv_msqid = msgget(sysv_msg_key, msgflg )) == -1) - { - std::cout << "GNSS-SDR can not create message queues!" << std::endl; - return 1; - } + if ((sysv_msqid = msgget(sysv_msg_key, msgflg)) == -1) + { + std::cout << "GNSS-SDR can not create message queues!" << std::endl; + return 1; + } ttff_msgbuf msg; msg.mtype = 1; msg.ttff = -1; diff --git a/src/tests/test_main.cc b/src/tests/test_main.cc index 344f0d694..6fdffbfc2 100644 --- a/src/tests/test_main.cc +++ b/src/tests/test_main.cc @@ -164,20 +164,22 @@ int main(int argc, char **argv) std::cout << "Running GNSS-SDR Tests..." << std::endl; int res = 0; try - { + { testing::InitGoogleTest(&argc, argv); - } - catch(...) {} // catch the "testing::internal::::ClassUniqueToAlwaysTrue" from gtest + } + catch (...) + { + } // catch the "testing::internal::::ClassUniqueToAlwaysTrue" from gtest google::ParseCommandLineFlags(&argc, &argv, true); google::InitGoogleLogging(argv[0]); try - { + { res = RUN_ALL_TESTS(); - } - catch(...) - { + } + catch (...) + { LOG(WARNING) << "Unexpected catch"; - } + } google::ShutDownCommandLineFlags(); return res; } diff --git a/src/tests/unit-tests/arithmetic/code_generation_test.cc b/src/tests/unit-tests/arithmetic/code_generation_test.cc index a29c14e18..a2fe71942 100644 --- a/src/tests/unit-tests/arithmetic/code_generation_test.cc +++ b/src/tests/unit-tests/arithmetic/code_generation_test.cc @@ -35,7 +35,6 @@ #include "gnss_signal_processing.h" - TEST(CodeGenerationTest, CodeGenGPSL1Test) { std::complex* _dest = new std::complex[1023]; @@ -47,9 +46,9 @@ TEST(CodeGenerationTest, CodeGenGPSL1Test) std::chrono::time_point start, end; start = std::chrono::system_clock::now(); - for(int i = 0; i < iterations; i++) + for (int i = 0; i < iterations; i++) { - gps_l1_ca_code_gen_complex( _dest, _prn, _chip_shift); + gps_l1_ca_code_gen_complex(_dest, _prn, _chip_shift); } end = std::chrono::system_clock::now(); @@ -66,7 +65,7 @@ TEST(CodeGenerationTest, CodeGenGPSL1SampledTest) signed int _prn = 1; unsigned int _chip_shift = 4; double _fs = 8000000.0; - const signed int _codeFreqBasis = 1023000; //Hz + const signed int _codeFreqBasis = 1023000; //Hz const signed int _codeLength = 1023; int _samplesPerCode = round(_fs / static_cast(_codeFreqBasis / _codeLength)); std::complex* _dest = new std::complex[_samplesPerCode]; @@ -76,9 +75,9 @@ TEST(CodeGenerationTest, CodeGenGPSL1SampledTest) std::chrono::time_point start, end; start = std::chrono::system_clock::now(); - for(int i = 0; i < iterations; i++) + for (int i = 0; i < iterations; i++) { - gps_l1_ca_code_gen_complex_sampled( _dest, _prn, _fs, _chip_shift); + gps_l1_ca_code_gen_complex_sampled(_dest, _prn, _fs, _chip_shift); } end = std::chrono::system_clock::now(); @@ -94,7 +93,7 @@ TEST(CodeGenerationTest, ComplexConjugateTest) { double _fs = 8000000.0; double _f = 4000.0; - const signed int _codeFreqBasis = 1023000; //Hz + const signed int _codeFreqBasis = 1023000; //Hz const signed int _codeLength = 1023; int _samplesPerCode = round(_fs / static_cast(_codeFreqBasis / _codeLength)); std::complex* _dest = new std::complex[_samplesPerCode]; @@ -104,9 +103,9 @@ TEST(CodeGenerationTest, ComplexConjugateTest) std::chrono::time_point start, end; start = std::chrono::system_clock::now(); - for(int i = 0; i < iterations; i++) + for (int i = 0; i < iterations; i++) { - complex_exp_gen_conj( _dest, _f, _fs, _samplesPerCode); + complex_exp_gen_conj(_dest, _f, _fs, _samplesPerCode); } end = std::chrono::system_clock::now(); diff --git a/src/tests/unit-tests/arithmetic/complex_carrier_test.cc b/src/tests/unit-tests/arithmetic/complex_carrier_test.cc index 69123ea8d..c95c9179a 100644 --- a/src/tests/unit-tests/arithmetic/complex_carrier_test.cc +++ b/src/tests/unit-tests/arithmetic/complex_carrier_test.cc @@ -50,26 +50,26 @@ TEST(ComplexCarrierTest, StandardComplexImplementation) std::chrono::time_point start, end; start = std::chrono::system_clock::now(); - for(int i = 0; i < FLAGS_size_carrier_test; i++) - { - output[i] = std::complex(cos(phase), sin(phase)); - phase += phase_step; - } + for (int i = 0; i < FLAGS_size_carrier_test; i++) + { + output[i] = std::complex(cos(phase), sin(phase)); + phase += phase_step; + } end = std::chrono::system_clock::now(); std::chrono::duration elapsed_seconds = end - start; std::cout << "A " << FLAGS_size_carrier_test - << "-length complex carrier in standard C++ (dynamic allocation) generated in " << elapsed_seconds.count() * 1e6 + << "-length complex carrier in standard C++ (dynamic allocation) generated in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; - std::complex expected(1,0); + std::complex expected(1, 0); std::vector> mag(FLAGS_size_carrier_test); - for(int i = 0; i < FLAGS_size_carrier_test; i++) + for (int i = 0; i < FLAGS_size_carrier_test; i++) { mag[i] = output[i] * std::conj(output[i]); } delete[] output; - for(int i = 0; i < FLAGS_size_carrier_test; i++) + for (int i = 0; i < FLAGS_size_carrier_test; i++) { ASSERT_FLOAT_EQ(std::norm(expected), std::norm(mag[i])); } @@ -101,9 +101,9 @@ TEST(ComplexCarrierTest, C11ComplexImplementation) << "-length complex carrier in standard C++ (declaration) generated in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; ASSERT_LE(0, elapsed_seconds.count() * 1e6); - std::complex expected(1,0); + std::complex expected(1, 0); std::vector> mag(FLAGS_size_carrier_test); - for(int i = 0; i < FLAGS_size_carrier_test; i++) + for (int i = 0; i < FLAGS_size_carrier_test; i++) { mag[i] = output[i] * std::conj(output[i]); ASSERT_FLOAT_EQ(std::norm(expected), std::norm(mag[i])); @@ -111,8 +111,6 @@ TEST(ComplexCarrierTest, C11ComplexImplementation) } - - TEST(ComplexCarrierTest, OwnComplexImplementation) { std::complex* output = new std::complex[FLAGS_size_carrier_test]; @@ -129,14 +127,14 @@ TEST(ComplexCarrierTest, OwnComplexImplementation) << "-length complex carrier using fixed point generated in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; - std::complex expected(1,0); + std::complex expected(1, 0); std::vector> mag(FLAGS_size_carrier_test); - for(int i = 0; i < FLAGS_size_carrier_test; i++) + for (int i = 0; i < FLAGS_size_carrier_test; i++) { mag[i] = output[i] * std::conj(output[i]); } delete[] output; - for(int i = 0; i < FLAGS_size_carrier_test; i++) + for (int i = 0; i < FLAGS_size_carrier_test; i++) { ASSERT_NEAR(std::norm(expected), std::norm(mag[i]), 0.0001); } diff --git a/src/tests/unit-tests/arithmetic/conjugate_test.cc b/src/tests/unit-tests/arithmetic/conjugate_test.cc index 9867b5584..ab9fa64bc 100644 --- a/src/tests/unit-tests/arithmetic/conjugate_test.cc +++ b/src/tests/unit-tests/arithmetic/conjugate_test.cc @@ -39,7 +39,6 @@ DEFINE_int32(size_conjugate_test, 100000, "Size of the arrays used for conjugate testing"); - TEST(ConjugateTest, StandardCComplexImplementation) { std::complex* input = new std::complex[FLAGS_size_conjugate_test]; @@ -49,7 +48,7 @@ TEST(ConjugateTest, StandardCComplexImplementation) std::chrono::time_point start, end; start = std::chrono::system_clock::now(); - for(int i = 0; i < FLAGS_size_conjugate_test; i++) + for (int i = 0; i < FLAGS_size_conjugate_test; i++) { output[i] = std::conj(input[i]); } @@ -63,7 +62,6 @@ TEST(ConjugateTest, StandardCComplexImplementation) delete[] input; delete[] output; ASSERT_LE(0, elapsed_seconds.count() * 1e6); - } @@ -74,7 +72,7 @@ TEST(ConjugateTest, C11ComplexImplementation) std::chrono::time_point start, end; start = std::chrono::system_clock::now(); int pos = 0; - for (const auto &item : input) + for (const auto& item : input) { output[pos++] = std::conj(item); } @@ -85,9 +83,9 @@ TEST(ConjugateTest, C11ComplexImplementation) << " microseconds" << std::endl; ASSERT_LE(0, elapsed_seconds.count() * 1e6); - std::complex expected(0,0); - std::complex result(0,0); - for (const auto &item : output) + std::complex expected(0, 0); + std::complex result(0, 0); + for (const auto& item : output) { result += item; } @@ -127,7 +125,7 @@ TEST(ConjugateTest, VolkComplexImplementation) end = std::chrono::system_clock::now(); std::chrono::duration elapsed_seconds = end - start; - std::cout << "Conjugate of a "<< FLAGS_size_conjugate_test + std::cout << "Conjugate of a " << FLAGS_size_conjugate_test << "-length complex float vector using VOLK finished in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; ASSERT_LE(0, elapsed_seconds.count() * 1e6); diff --git a/src/tests/unit-tests/arithmetic/fft_length_test.cc b/src/tests/unit-tests/arithmetic/fft_length_test.cc index 27f076dc4..b183656da 100644 --- a/src/tests/unit-tests/arithmetic/fft_length_test.cc +++ b/src/tests/unit-tests/arithmetic/fft_length_test.cc @@ -47,9 +47,9 @@ DEFINE_bool(plot_fft_length_test, false, "Plots results of FFTLengthTest with gn TEST(FFTLengthTest, MeasureExecutionTime) { - unsigned int fft_sizes [] = { 512, 1000, 1024, 1100, 1297, 1400, 1500, 1960, 2000, 2048, 2221, 2500, 3000, 3500, 4000, - 4096, 4200, 4500, 4725, 5000, 5500, 6000, 6500, 7000, 7500, 8000, 8192, 8500, 9000, 9500, 10000, 10368, 11000, - 12000, 15000, 16000, 16384, 27000, 32768, 50000, 65536 }; + unsigned int fft_sizes[] = {512, 1000, 1024, 1100, 1297, 1400, 1500, 1960, 2000, 2048, 2221, 2500, 3000, 3500, 4000, + 4096, 4200, 4500, 4725, 5000, 5500, 6000, 6500, 7000, 7500, 8000, 8192, 8500, 9000, 9500, 10000, 10368, 11000, + 12000, 15000, 16000, 16384, 27000, 32768, 50000, 65536}; std::chrono::time_point start, end; @@ -57,12 +57,12 @@ TEST(FFTLengthTest, MeasureExecutionTime) std::default_random_engine e1(r()); std::default_random_engine e2(r()); std::uniform_real_distribution uniform_dist(-1, 1); - auto func = [] (float a, float b) { return gr_complex(a, b); }; // Helper lambda function that returns a gr_complex + auto func = [](float a, float b) { return gr_complex(a, b); }; // Helper lambda function that returns a gr_complex auto random_number1 = std::bind(uniform_dist, e1); auto random_number2 = std::bind(uniform_dist, e2); - auto gen = std::bind(func, random_number1, random_number2); // Function that returns a random gr_complex + auto gen = std::bind(func, random_number1, random_number2); // Function that returns a random gr_complex - std::vector fft_sizes_v(fft_sizes, fft_sizes + sizeof(fft_sizes) / sizeof(unsigned int) ); + std::vector fft_sizes_v(fft_sizes, fft_sizes + sizeof(fft_sizes) / sizeof(unsigned int)); std::sort(fft_sizes_v.begin(), fft_sizes_v.end()); std::vector::const_iterator it; unsigned int d_fft_size; @@ -71,38 +71,36 @@ TEST(FFTLengthTest, MeasureExecutionTime) std::vector execution_times_powers_of_two; EXPECT_NO_THROW( - for(it = fft_sizes_v.cbegin(); it != fft_sizes_v.cend(); ++it) + for (it = fft_sizes_v.cbegin(); it != fft_sizes_v.cend(); ++it) { + gr::fft::fft_complex* d_fft; + d_fft_size = *it; + d_fft = new gr::fft::fft_complex(d_fft_size, true); + + std::generate_n(d_fft->get_inbuf(), d_fft_size, gen); + + start = std::chrono::system_clock::now(); + for (int k = 0; k < FLAGS_fft_iterations_test; k++) { - gr::fft::fft_complex* d_fft; - d_fft_size = *it; - d_fft = new gr::fft::fft_complex(d_fft_size, true); - - std::generate_n( d_fft->get_inbuf(), d_fft_size, gen ); - - start = std::chrono::system_clock::now(); - for(int k = 0; k < FLAGS_fft_iterations_test; k++) - { - d_fft->execute(); - } - end = std::chrono::system_clock::now(); - std::chrono::duration elapsed_seconds = end - start; - double exec_time = elapsed_seconds.count() / static_cast(FLAGS_fft_iterations_test); - execution_times.push_back(exec_time * 1e3); - std::cout << "FFT execution time for length=" << d_fft_size << " : " << exec_time << " [s]" << std::endl; - delete d_fft; - - if( (d_fft_size & (d_fft_size - 1)) == 0 ) // if it is a power of two - { - powers_of_two.push_back(d_fft_size); - execution_times_powers_of_two.push_back(exec_time / 1e-3); - } + d_fft->execute(); } - ); + end = std::chrono::system_clock::now(); + std::chrono::duration elapsed_seconds = end - start; + double exec_time = elapsed_seconds.count() / static_cast(FLAGS_fft_iterations_test); + execution_times.push_back(exec_time * 1e3); + std::cout << "FFT execution time for length=" << d_fft_size << " : " << exec_time << " [s]" << std::endl; + delete d_fft; - if(FLAGS_plot_fft_length_test == true) + if ((d_fft_size & (d_fft_size - 1)) == 0) // if it is a power of two + { + powers_of_two.push_back(d_fft_size); + execution_times_powers_of_two.push_back(exec_time / 1e-3); + } + }); + + if (FLAGS_plot_fft_length_test == true) { const std::string gnuplot_executable(FLAGS_gnuplot_executable); - if(gnuplot_executable.empty()) + if (gnuplot_executable.empty()) { std::cout << "WARNING: Although the flag plot_fft_length_test has been set to TRUE," << std::endl; std::cout << "gnuplot has not been found in your system." << std::endl; @@ -111,7 +109,7 @@ TEST(FFTLengthTest, MeasureExecutionTime) else { try - { + { boost::filesystem::path p(gnuplot_executable); boost::filesystem::path dir = p.parent_path(); std::string gnuplot_path = dir.native(); @@ -126,7 +124,7 @@ TEST(FFTLengthTest, MeasureExecutionTime) g1.set_style("points").plot_xy(powers_of_two, execution_times_powers_of_two, "Power of 2"); g1.savetops("FFT_execution_times_extended"); g1.savetopdf("FFT_execution_times_extended", 18); - g1.showonscreen(); // window output + g1.showonscreen(); // window output Gnuplot g2("linespoints"); g2.set_title("FFT execution times for different lengths (up to 2^{14}=16384)"); @@ -138,12 +136,12 @@ TEST(FFTLengthTest, MeasureExecutionTime) g2.set_style("points").plot_xy(powers_of_two, execution_times_powers_of_two, "Power of 2"); g2.savetops("FFT_execution_times"); g2.savetopdf("FFT_execution_times", 18); - g2.showonscreen(); // window output - } - catch (const GnuplotException & ge) - { + g2.showonscreen(); // window output + } + catch (const GnuplotException& ge) + { std::cout << ge.what() << std::endl; - } + } } } } diff --git a/src/tests/unit-tests/arithmetic/fft_speed_test.cc b/src/tests/unit-tests/arithmetic/fft_speed_test.cc index fa1fd2826..2197e4227 100644 --- a/src/tests/unit-tests/arithmetic/fft_speed_test.cc +++ b/src/tests/unit-tests/arithmetic/fft_speed_test.cc @@ -43,39 +43,37 @@ TEST(FFTSpeedTest, ArmadilloVSGNURadioExecutionTime) std::chrono::time_point start, end; std::chrono::duration elapsed_seconds; - unsigned int fft_sizes [19] = { 16, 25, 32, 45, 64, 95, 128, 195, 256, 325, 512, 785, 1024, 1503, 2048, 3127, 4096, 6349, 8192 }; + unsigned int fft_sizes[19] = {16, 25, 32, 45, 64, 95, 128, 195, 256, 325, 512, 785, 1024, 1503, 2048, 3127, 4096, 6349, 8192}; double d_execution_time; EXPECT_NO_THROW( - for(int i = 0; i < 19; i++) - { - d_fft_size = fft_sizes[i]; - gr::fft::fft_complex* d_gr_fft; - d_gr_fft = new gr::fft::fft_complex(d_fft_size, true); - arma::arma_rng::set_seed_random(); - arma::cx_fvec d_arma_fft = arma::cx_fvec(d_fft_size).randn() + gr_complex(0.0, 1.0) * arma::cx_fvec(d_fft_size).randn(); - arma::cx_fvec d_arma_fft_result(d_fft_size); - memcpy(d_gr_fft->get_inbuf(), d_arma_fft.memptr(), sizeof(gr_complex) * d_fft_size); - - start = std::chrono::system_clock::now(); - for(int k = 0; k < FLAGS_fft_speed_iterations_test; k++) - { - d_gr_fft->execute(); - } - end = std::chrono::system_clock::now(); - elapsed_seconds = end - start; - d_execution_time = elapsed_seconds.count() / static_cast(FLAGS_fft_speed_iterations_test); - std::cout << "GNU Radio FFT execution time for length = " << d_fft_size << " : " << d_execution_time * 1e6 << " [us]" << std::endl; - delete d_gr_fft; + for (int i = 0; i < 19; i++) { + d_fft_size = fft_sizes[i]; + gr::fft::fft_complex* d_gr_fft; + d_gr_fft = new gr::fft::fft_complex(d_fft_size, true); + arma::arma_rng::set_seed_random(); + arma::cx_fvec d_arma_fft = arma::cx_fvec(d_fft_size).randn() + gr_complex(0.0, 1.0) * arma::cx_fvec(d_fft_size).randn(); + arma::cx_fvec d_arma_fft_result(d_fft_size); + memcpy(d_gr_fft->get_inbuf(), d_arma_fft.memptr(), sizeof(gr_complex) * d_fft_size); - start = std::chrono::system_clock::now(); - for(int k = 0; k < FLAGS_fft_speed_iterations_test; k++) - { - d_arma_fft_result = arma::fft(d_arma_fft); - } - end = std::chrono::system_clock::now(); - elapsed_seconds = end - start; - d_execution_time = elapsed_seconds.count() / static_cast(FLAGS_fft_speed_iterations_test); - std::cout << "Armadillo FFT execution time for length = " << d_fft_size << " : " << d_execution_time * 1e6 << " [us]" << std::endl; + start = std::chrono::system_clock::now(); + for (int k = 0; k < FLAGS_fft_speed_iterations_test; k++) + { + d_gr_fft->execute(); } - ); + end = std::chrono::system_clock::now(); + elapsed_seconds = end - start; + d_execution_time = elapsed_seconds.count() / static_cast(FLAGS_fft_speed_iterations_test); + std::cout << "GNU Radio FFT execution time for length = " << d_fft_size << " : " << d_execution_time * 1e6 << " [us]" << std::endl; + delete d_gr_fft; + + start = std::chrono::system_clock::now(); + for (int k = 0; k < FLAGS_fft_speed_iterations_test; k++) + { + d_arma_fft_result = arma::fft(d_arma_fft); + } + end = std::chrono::system_clock::now(); + elapsed_seconds = end - start; + d_execution_time = elapsed_seconds.count() / static_cast(FLAGS_fft_speed_iterations_test); + std::cout << "Armadillo FFT execution time for length = " << d_fft_size << " : " << d_execution_time * 1e6 << " [us]" << std::endl; + }); } diff --git a/src/tests/unit-tests/arithmetic/magnitude_squared_test.cc b/src/tests/unit-tests/arithmetic/magnitude_squared_test.cc index cefa52e21..546a184a2 100644 --- a/src/tests/unit-tests/arithmetic/magnitude_squared_test.cc +++ b/src/tests/unit-tests/arithmetic/magnitude_squared_test.cc @@ -48,7 +48,7 @@ TEST(MagnitudeSquaredTest, StandardCComplexImplementation) std::chrono::time_point start, end; start = std::chrono::system_clock::now(); - for(number = 0; number < static_cast(FLAGS_size_magnitude_test); number++) + for (number = 0; number < static_cast(FLAGS_size_magnitude_test); number++) { output[number] = (input[number].real() * input[number].real()) + (input[number].imag() * input[number].imag()); } @@ -72,7 +72,7 @@ TEST(MagnitudeSquaredTest, C11ComplexImplementation) std::chrono::time_point start, end; start = std::chrono::system_clock::now(); - for (const auto &item : input) + for (const auto& item : input) { output[pos++] = std::norm(item); } @@ -84,9 +84,9 @@ TEST(MagnitudeSquaredTest, C11ComplexImplementation) << " microseconds" << std::endl; ASSERT_LE(0, elapsed_seconds.count() * 1e6); - std::complex expected(0,0); - std::complex result(0,0); - for (const auto &item : output) + std::complex expected(0, 0); + std::complex result(0, 0); + for (const auto& item : output) { result += item; } @@ -105,7 +105,7 @@ TEST(MagnitudeSquaredTest, ArmadilloComplexImplementation) end = std::chrono::system_clock::now(); std::chrono::duration elapsed_seconds = end - start; - std::cout << "The squared magnitude of a " << FLAGS_size_magnitude_test + std::cout << "The squared magnitude of a " << FLAGS_size_magnitude_test << "-length vector using Armadillo computed in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; ASSERT_LE(0, elapsed_seconds.count() * 1e6); @@ -124,7 +124,7 @@ TEST(MagnitudeSquaredTest, VolkComplexImplementation) end = std::chrono::system_clock::now(); std::chrono::duration elapsed_seconds = end - start; - std::cout << "The squared magnitude of a " << FLAGS_size_magnitude_test + std::cout << "The squared magnitude of a " << FLAGS_size_magnitude_test << "-length vector using VOLK computed in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; volk_gnsssdr_free(input); @@ -133,4 +133,3 @@ TEST(MagnitudeSquaredTest, VolkComplexImplementation) } // volk_32f_accumulator_s32f(&d_input_power, d_magnitude, d_fft_size); - diff --git a/src/tests/unit-tests/arithmetic/matio_test.cc b/src/tests/unit-tests/arithmetic/matio_test.cc index 5784a2428..fcdb76b68 100644 --- a/src/tests/unit-tests/arithmetic/matio_test.cc +++ b/src/tests/unit-tests/arithmetic/matio_test.cc @@ -42,14 +42,14 @@ TEST(MatioTest, WriteAndReadDoubles) matvar_t *matvar; std::string filename = "./test.mat"; matfp = Mat_CreateVer(filename.c_str(), NULL, MAT_FT_MAT73); - ASSERT_FALSE(reinterpret_cast(matfp) == NULL) << "Error creating .mat file"; + ASSERT_FALSE(reinterpret_cast(matfp) == NULL) << "Error creating .mat file"; - double x[10] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; + double x[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; size_t dims[2] = {10, 1}; matvar = Mat_VarCreate("x", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, x, 0); - ASSERT_FALSE(reinterpret_cast(matvar) == NULL) << "Error creating variable for ’x’"; + ASSERT_FALSE(reinterpret_cast(matvar) == NULL) << "Error creating variable for ’x’"; - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); Mat_Close(matfp); @@ -59,16 +59,16 @@ TEST(MatioTest, WriteAndReadDoubles) matvar_t *matvar_read; matfp_read = Mat_Open(filename.c_str(), MAT_ACC_RDONLY); - ASSERT_FALSE(reinterpret_cast(matfp_read) == NULL) << "Error reading .mat file"; + ASSERT_FALSE(reinterpret_cast(matfp_read) == NULL) << "Error reading .mat file"; matvar_read = Mat_VarReadInfo(matfp_read, "x"); - ASSERT_FALSE(reinterpret_cast(matvar_read) == NULL) << "Error reading variable in .mat file"; + ASSERT_FALSE(reinterpret_cast(matvar_read) == NULL) << "Error reading variable in .mat file"; matvar_read = Mat_VarRead(matfp_read, "x"); - double *x_read = reinterpret_cast(matvar_read->data); + double *x_read = reinterpret_cast(matvar_read->data); Mat_Close(matfp_read); - for(int i = 0; i < 10; i++) + for (int i = 0; i < 10; i++) { EXPECT_DOUBLE_EQ(x[i], x_read[i]); } @@ -84,9 +84,9 @@ TEST(MatioTest, WriteAndReadGrComplex) matvar_t *matvar1; std::string filename = "./test3.mat"; matfp = Mat_CreateVer(filename.c_str(), NULL, MAT_FT_MAT73); - ASSERT_FALSE(reinterpret_cast(matfp) == NULL) << "Error creating .mat file"; + ASSERT_FALSE(reinterpret_cast(matfp) == NULL) << "Error creating .mat file"; - std::vector x_v = { {1, 10}, {2, 9}, {3, 8}, {4, 7}, {5, 6}, {6, -5}, {7, -4}, {8, 3}, {9, 2}, {10, 1}}; + std::vector x_v = {{1, 10}, {2, 9}, {3, 8}, {4, 7}, {5, 6}, {6, -5}, {7, -4}, {8, 3}, {9, 2}, {10, 1}}; const unsigned int size = x_v.size(); float x_real[size]; float x_imag[size]; @@ -101,9 +101,9 @@ TEST(MatioTest, WriteAndReadGrComplex) struct mat_complex_split_t x = {x_real, x_imag}; size_t dims[2] = {static_cast(size), 1}; matvar1 = Mat_VarCreate("x", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, &x, MAT_F_COMPLEX); - ASSERT_FALSE(reinterpret_cast(matvar1) == NULL) << "Error creating variable for ’x’"; + ASSERT_FALSE(reinterpret_cast(matvar1) == NULL) << "Error creating variable for ’x’"; - std::vector x2 = { {1.1, -10}, {2, -9}, {3, -8}, {4, -7}, {5, 6}, {6, -5}, {7, -4}, {8, 3}, {9, 2}, {10, 1}}; + std::vector x2 = {{1.1, -10}, {2, -9}, {3, -8}, {4, -7}, {5, 6}, {6, -5}, {7, -4}, {8, 3}, {9, 2}, {10, 1}}; const unsigned int size_y = x2.size(); float y_real[size_y]; float y_imag[size_y]; @@ -119,10 +119,10 @@ TEST(MatioTest, WriteAndReadGrComplex) size_t dims_y[2] = {static_cast(size_y), 1}; matvar_t *matvar2; matvar2 = Mat_VarCreate("y", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims_y, &y, MAT_F_COMPLEX); - ASSERT_FALSE(reinterpret_cast(matvar2) == NULL) << "Error creating variable for ’y’"; + ASSERT_FALSE(reinterpret_cast(matvar2) == NULL) << "Error creating variable for ’y’"; - Mat_VarWrite(matfp, matvar1, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE - Mat_VarWrite(matfp, matvar2, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar1, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarWrite(matfp, matvar2, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar1); Mat_VarFree(matvar2); @@ -133,17 +133,17 @@ TEST(MatioTest, WriteAndReadGrComplex) matvar_t *matvar_read; matfp_read = Mat_Open(filename.c_str(), MAT_ACC_RDONLY); - ASSERT_FALSE(reinterpret_cast(matfp_read) == NULL) << "Error reading .mat file"; + ASSERT_FALSE(reinterpret_cast(matfp_read) == NULL) << "Error reading .mat file"; matvar_read = Mat_VarReadInfo(matfp_read, "x"); - ASSERT_FALSE(reinterpret_cast(matvar_read) == NULL) << "Error reading variable in .mat file"; + ASSERT_FALSE(reinterpret_cast(matvar_read) == NULL) << "Error reading variable in .mat file"; matvar_read = Mat_VarRead(matfp_read, "x"); - mat_complex_split_t *x_read_st = reinterpret_cast(matvar_read->data); - float * x_read_real = reinterpret_cast(x_read_st->Re); - float * x_read_imag = reinterpret_cast(x_read_st->Im); + mat_complex_split_t *x_read_st = reinterpret_cast(matvar_read->data); + float *x_read_real = reinterpret_cast(x_read_st->Re); + float *x_read_imag = reinterpret_cast(x_read_st->Im); std::vector x_v_read; - for(unsigned int i = 0; i < size; i++) + for (unsigned int i = 0; i < size; i++) { x_v_read.push_back(gr_complex(x_read_real[i], x_read_imag[i])); } @@ -151,7 +151,7 @@ TEST(MatioTest, WriteAndReadGrComplex) Mat_Close(matfp_read); Mat_VarFree(matvar_read); - for(unsigned int i = 0; i < size; i++) + for (unsigned int i = 0; i < size; i++) { EXPECT_FLOAT_EQ(x_v[i].real(), x_v_read[i].real()); EXPECT_FLOAT_EQ(x_v[i].imag(), x_v_read[i].imag()); diff --git a/src/tests/unit-tests/arithmetic/multiply_test.cc b/src/tests/unit-tests/arithmetic/multiply_test.cc index 809ff8d11..4fc383ee9 100644 --- a/src/tests/unit-tests/arithmetic/multiply_test.cc +++ b/src/tests/unit-tests/arithmetic/multiply_test.cc @@ -49,7 +49,7 @@ TEST(MultiplyTest, StandardCDoubleImplementation) std::chrono::time_point start, end; start = std::chrono::system_clock::now(); - for(int i = 0; i < FLAGS_size_multiply_test; i++) + for (int i = 0; i < FLAGS_size_multiply_test; i++) { output[i] = input[i] * input[i]; } @@ -62,7 +62,7 @@ TEST(MultiplyTest, StandardCDoubleImplementation) double acc = 0; double expected = 0; - for(int i = 0; i < FLAGS_size_multiply_test; i++) + for (int i = 0; i < FLAGS_size_multiply_test; i++) { acc += output[i]; } @@ -89,11 +89,10 @@ TEST(MultiplyTest, ArmadilloImplementation) << "-length double Armadillo vectors finished in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; ASSERT_LE(0, elapsed_seconds.count() * 1e6); - ASSERT_EQ(0, arma::norm(output,2)); + ASSERT_EQ(0, arma::norm(output, 2)); } - TEST(MultiplyTest, StandardCComplexImplementation) { std::complex* input = new std::complex[FLAGS_size_multiply_test]; @@ -102,7 +101,7 @@ TEST(MultiplyTest, StandardCComplexImplementation) std::chrono::time_point start, end; start = std::chrono::system_clock::now(); - for(int i = 0; i < FLAGS_size_multiply_test; i++) + for (int i = 0; i < FLAGS_size_multiply_test; i++) { output[i] = input[i] * input[i]; } @@ -113,12 +112,12 @@ TEST(MultiplyTest, StandardCComplexImplementation) << " complex in standard C finished in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; - std::complex expected(0,0); - std::complex result(0,0); - for(int i = 0; i < FLAGS_size_multiply_test; i++) - { - result += output[i]; - } + std::complex expected(0, 0); + std::complex result(0, 0); + for (int i = 0; i < FLAGS_size_multiply_test; i++) + { + result += output[i]; + } delete[] input; delete[] output; ASSERT_LE(0, elapsed_seconds.count() * 1e6); @@ -126,7 +125,6 @@ TEST(MultiplyTest, StandardCComplexImplementation) } - TEST(MultiplyTest, C11ComplexImplementation) { const std::vector> input(FLAGS_size_multiply_test); @@ -136,7 +134,7 @@ TEST(MultiplyTest, C11ComplexImplementation) start = std::chrono::system_clock::now(); // Trying a range-based for - for (const auto &item : input) + for (const auto& item : input) { output[pos++] = item * item; } @@ -148,7 +146,7 @@ TEST(MultiplyTest, C11ComplexImplementation) << " microseconds" << std::endl; ASSERT_LE(0, elapsed_seconds.count() * 1e6); - std::complex expected(0,0); + std::complex expected(0, 0); auto result = std::inner_product(output.begin(), output.end(), output.begin(), expected); ASSERT_EQ(expected, result); } @@ -170,12 +168,10 @@ TEST(MultiplyTest, ArmadilloComplexImplementation) << "-length complex float Armadillo vectors finished in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; ASSERT_LE(0, elapsed_seconds.count() * 1e6); - ASSERT_EQ(0, arma::norm(output,2)); + ASSERT_EQ(0, arma::norm(output, 2)); } - - TEST(MultiplyTest, VolkComplexImplementation) { std::complex* input = static_cast*>(volk_gnsssdr_malloc(FLAGS_size_multiply_test * sizeof(std::complex), volk_gnsssdr_get_alignment())); @@ -208,4 +204,3 @@ TEST(MultiplyTest, VolkComplexImplementation) volk_gnsssdr_free(output); volk_gnsssdr_free(mag); } - diff --git a/src/tests/unit-tests/control-plane/control_message_factory_test.cc b/src/tests/unit-tests/control-plane/control_message_factory_test.cc index ebbaac176..6fce6a506 100644 --- a/src/tests/unit-tests/control-plane/control_message_factory_test.cc +++ b/src/tests/unit-tests/control-plane/control_message_factory_test.cc @@ -36,8 +36,6 @@ #include "control_message_factory.h" - - TEST(ControlMessageFactoryTest, GetQueueMessage) { std::shared_ptr factory = std::make_shared(); @@ -51,8 +49,6 @@ TEST(ControlMessageFactoryTest, GetQueueMessage) } - - TEST(ControlMessageFactoryTest, GetControlMessages) { std::shared_ptr factory = std::make_shared(); diff --git a/src/tests/unit-tests/control-plane/control_thread_test.cc b/src/tests/unit-tests/control-plane/control_thread_test.cc index ac3f00bff..ca22a8797 100644 --- a/src/tests/unit-tests/control-plane/control_thread_test.cc +++ b/src/tests/unit-tests/control-plane/control_thread_test.cc @@ -52,12 +52,13 @@ #include "control_message_factory.h" -class ControlThreadTest: public ::testing::Test +class ControlThreadTest : public ::testing::Test { public: static int stop_receiver(); - typedef struct { - long mtype; // required by SysV message + typedef struct + { + long mtype; // required by SysV message double message; } message_buffer; }; @@ -73,7 +74,9 @@ int ControlThreadTest::stop_receiver() key_t key_stop = 1102; // wait for the receiver control queue to be created - while(((msqid_stop = msgget(key_stop, 0644))) == -1){ } + while (((msqid_stop = msgget(key_stop, 0644))) == -1) + { + } // wait for a couple of seconds std::this_thread::sleep_for(std::chrono::seconds(2)); @@ -92,7 +95,7 @@ TEST_F(ControlThreadTest, InstantiateRunControlMessages) config->set_property("SignalSource.implementation", "File_Signal_Source"); std::string path = std::string(TEST_PATH); std::string file = path + "signal_samples/GSoC_CTTC_capture_2012_07_26_4Msps_4ms.dat"; - const char * file_name = file.c_str(); + const char* file_name = file.c_str(); config->set_property("SignalSource.filename", file_name); config->set_property("SignalSource.item_type", "gr_complex"); config->set_property("SignalSource.sampling_frequency", "4000000"); @@ -121,23 +124,23 @@ TEST_F(ControlThreadTest, InstantiateRunControlMessages) std::unique_ptr control_msg_factory(new ControlMessageFactory()); - control_queue->handle(control_msg_factory->GetQueueMessage(0,0)); - control_queue->handle(control_msg_factory->GetQueueMessage(1,0)); - control_queue->handle(control_msg_factory->GetQueueMessage(200,0)); + control_queue->handle(control_msg_factory->GetQueueMessage(0, 0)); + control_queue->handle(control_msg_factory->GetQueueMessage(1, 0)); + control_queue->handle(control_msg_factory->GetQueueMessage(200, 0)); control_thread->set_control_queue(control_queue); try - { + { control_thread->run(); - } - catch(const boost::exception & e) - { + } + catch (const boost::exception& e) + { std::cout << "Boost exception: " << boost::diagnostic_information(e); - } - catch(const std::exception & ex) - { - std::cout << "STD exception: " << ex.what(); - } + } + catch (const std::exception& ex) + { + std::cout << "STD exception: " << ex.what(); + } unsigned int expected3 = 3; unsigned int expected1 = 1; @@ -152,7 +155,7 @@ TEST_F(ControlThreadTest, InstantiateRunControlMessages2) config->set_property("SignalSource.implementation", "File_Signal_Source"); std::string path = std::string(TEST_PATH); std::string file = path + "signal_samples/GSoC_CTTC_capture_2012_07_26_4Msps_4ms.dat"; - const char * file_name = file.c_str(); + const char* file_name = file.c_str(); config->set_property("SignalSource.filename", file_name); config->set_property("SignalSource.item_type", "gr_complex"); config->set_property("SignalSource.sampling_frequency", "4000000"); @@ -181,26 +184,26 @@ TEST_F(ControlThreadTest, InstantiateRunControlMessages2) std::unique_ptr control_msg_factory2(new ControlMessageFactory()); - control_queue2->handle(control_msg_factory2->GetQueueMessage(0,0)); - control_queue2->handle(control_msg_factory2->GetQueueMessage(2,0)); - control_queue2->handle(control_msg_factory2->GetQueueMessage(1,0)); - control_queue2->handle(control_msg_factory2->GetQueueMessage(3,0)); - control_queue2->handle(control_msg_factory2->GetQueueMessage(200,0)); + control_queue2->handle(control_msg_factory2->GetQueueMessage(0, 0)); + control_queue2->handle(control_msg_factory2->GetQueueMessage(2, 0)); + control_queue2->handle(control_msg_factory2->GetQueueMessage(1, 0)); + control_queue2->handle(control_msg_factory2->GetQueueMessage(3, 0)); + control_queue2->handle(control_msg_factory2->GetQueueMessage(200, 0)); control_thread2->set_control_queue(control_queue2); try - { + { control_thread2->run(); - } - catch(const boost::exception & e) - { + } + catch (const boost::exception& e) + { std::cout << "Boost exception: " << boost::diagnostic_information(e); - } - catch(const std::exception & ex) - { - std::cout << "STD exception: " << ex.what(); - } + } + catch (const std::exception& ex) + { + std::cout << "STD exception: " << ex.what(); + } unsigned int expected5 = 5; unsigned int expected1 = 1; @@ -209,14 +212,13 @@ TEST_F(ControlThreadTest, InstantiateRunControlMessages2) } - TEST_F(ControlThreadTest, StopReceiverProgrammatically) { std::shared_ptr config = std::make_shared(); config->set_property("SignalSource.implementation", "File_Signal_Source"); std::string path = std::string(TEST_PATH); std::string file = path + "signal_samples/GSoC_CTTC_capture_2012_07_26_4Msps_4ms.dat"; - const char * file_name = file.c_str(); + const char* file_name = file.c_str(); config->set_property("SignalSource.filename", file_name); config->set_property("SignalSource.item_type", "gr_complex"); config->set_property("SignalSource.sampling_frequency", "4000000"); @@ -246,17 +248,17 @@ TEST_F(ControlThreadTest, StopReceiverProgrammatically) std::thread stop_receiver_thread(stop_receiver); try - { + { control_thread->run(); - } - catch(const boost::exception & e) - { + } + catch (const boost::exception& e) + { std::cout << "Boost exception: " << boost::diagnostic_information(e); - } - catch(const std::exception & ex) - { - std::cout << "STD exception: " << ex.what(); - } + } + catch (const std::exception& ex) + { + std::cout << "STD exception: " << ex.what(); + } stop_receiver_thread.join(); } diff --git a/src/tests/unit-tests/control-plane/file_configuration_test.cc b/src/tests/unit-tests/control-plane/file_configuration_test.cc index 0165cb2a6..052d1373f 100644 --- a/src/tests/unit-tests/control-plane/file_configuration_test.cc +++ b/src/tests/unit-tests/control-plane/file_configuration_test.cc @@ -34,7 +34,6 @@ #include "file_configuration.h" - TEST(FileConfigurationTest, OverridedProperties) { std::string path = std::string(TEST_PATH); @@ -50,7 +49,6 @@ TEST(FileConfigurationTest, OverridedProperties) } - TEST(FileConfigurationTest, LoadFromNonExistentFile) { std::unique_ptr configuration(new FileConfiguration("./i_dont_exist.conf")); @@ -60,7 +58,6 @@ TEST(FileConfigurationTest, LoadFromNonExistentFile) } - TEST(FileConfigurationTest, PropertyDoesNotExist) { std::string path = std::string(TEST_PATH); diff --git a/src/tests/unit-tests/control-plane/gnss_block_factory_test.cc b/src/tests/unit-tests/control-plane/gnss_block_factory_test.cc index 8979ea402..e4ecb00ef 100644 --- a/src/tests/unit-tests/control-plane/gnss_block_factory_test.cc +++ b/src/tests/unit-tests/control-plane/gnss_block_factory_test.cc @@ -146,8 +146,8 @@ TEST(GNSSBlockFactoryTest, InstantiateFreqXlatingFIRFilter) configuration->set_property("InputFilter.filter_type", "bandpass"); configuration->set_property("InputFilter.grid_density", "16"); - configuration->set_property("InputFilter.sampling_frequency","4000000"); - configuration->set_property("InputFilter.IF","34000"); + configuration->set_property("InputFilter.sampling_frequency", "4000000"); + configuration->set_property("InputFilter.IF", "34000"); std::unique_ptr factory; std::unique_ptr input_filter = factory->GetBlock(configuration, "InputFilter", "Freq_Xlating_Fir_Filter", 1, 1); @@ -316,8 +316,8 @@ TEST(GNSSBlockFactoryTest, InstantiateChannels) configuration->set_property("Channels_1C.count", "2"); configuration->set_property("Channels_1E.count", "0"); configuration->set_property("Channels.in_acquisition", "2"); - configuration->set_property("Tracking_1C.implementation","GPS_L1_CA_DLL_PLL_C_Aid_Tracking"); - configuration->set_property("TelemetryDecoder_1C.implementation","GPS_L1_CA_Telemetry_Decoder"); + configuration->set_property("Tracking_1C.implementation", "GPS_L1_CA_DLL_PLL_C_Aid_Tracking"); + configuration->set_property("TelemetryDecoder_1C.implementation", "GPS_L1_CA_Telemetry_Decoder"); configuration->set_property("Channel0.item_type", "gr_complex"); configuration->set_property("Acquisition_1C.implementation", "GPS_L1_CA_PCPS_Acquisition"); configuration->set_property("Channel1.item_type", "gr_complex"); diff --git a/src/tests/unit-tests/control-plane/gnss_flowgraph_test.cc b/src/tests/unit-tests/control-plane/gnss_flowgraph_test.cc index 8c31aaca2..5a99cd62d 100644 --- a/src/tests/unit-tests/control-plane/gnss_flowgraph_test.cc +++ b/src/tests/unit-tests/control-plane/gnss_flowgraph_test.cc @@ -278,4 +278,3 @@ TEST(GNSSFlowgraph, InstantiateConnectStartStopHybrid) flowgraph->stop(); EXPECT_FALSE(flowgraph->running()); } - diff --git a/src/tests/unit-tests/control-plane/string_converter_test.cc b/src/tests/unit-tests/control-plane/string_converter_test.cc index 8393e3248..68091d5bc 100644 --- a/src/tests/unit-tests/control-plane/string_converter_test.cc +++ b/src/tests/unit-tests/control-plane/string_converter_test.cc @@ -33,7 +33,6 @@ #include "string_converter.h" - TEST(StringConverterTest, StringToBool) { std::unique_ptr converter(new StringConverter()); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_8ms_ambiguous_acquisition_gsoc2013_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_8ms_ambiguous_acquisition_gsoc2013_test.cc index e405a49f6..dc3d83331 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_8ms_ambiguous_acquisition_gsoc2013_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_8ms_ambiguous_acquisition_gsoc2013_test.cc @@ -63,9 +63,10 @@ private: void msg_handler_events(pmt::pmt_t msg); GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test_msg_rx(concurrent_queue& queue); concurrent_queue& channel_internal_queue; + public: int rx_message; - ~GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test_msg_rx(); //!< Default destructor + ~GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test_msg_rx(); //!< Default destructor }; @@ -78,21 +79,20 @@ GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test_msg_rx_sptr GalileoE1Pcps8msAmb void GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test_msg_rx::msg_handler_events(pmt::pmt_t msg) { try - { + { long int message = pmt::to_long(msg); rx_message = message; channel_internal_queue.push(rx_message); - } - catch(boost::bad_any_cast& e) - { + } + catch (boost::bad_any_cast& e) + { LOG(WARNING) << "msg_handler_telemetry Bad any cast!"; rx_message = 0; - } + } } -GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test_msg_rx::GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test_msg_rx(concurrent_queue& queue) : - gr::block("GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0)), channel_internal_queue(queue) +GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test_msg_rx::GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test_msg_rx(concurrent_queue& queue) : gr::block("GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0)), channel_internal_queue(queue) { this->message_port_register_in(pmt::mp("events")); this->set_msg_handler(pmt::mp("events"), boost::bind(&GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test_msg_rx::msg_handler_events, this, _1)); @@ -100,12 +100,13 @@ GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test_msg_rx::GalileoE1Pcps8msAmbiguo } GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test_msg_rx::~GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test_msg_rx() -{} +{ +} // ########################################################### -class GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test: public ::testing::Test +class GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test : public ::testing::Test { protected: GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test() @@ -119,7 +120,8 @@ protected: } ~GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test() - {} + { + } void init(); void config_1(); @@ -193,7 +195,7 @@ void GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test::config_1() expected_delay_chips = 600; expected_doppler_hz = 750; - max_doppler_error_hz = 2/(3*integration_time_ms*1e-3); + max_doppler_error_hz = 2 / (3 * integration_time_ms * 1e-3); max_delay_error_chips = 0.50; num_of_realizations = 1; @@ -260,7 +262,7 @@ void GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test::config_2() expected_delay_chips = 600; expected_doppler_hz = 750; - max_doppler_error_hz = 2/(3*integration_time_ms*1e-3); + max_doppler_error_hz = 2 / (3 * integration_time_ms * 1e-3); max_delay_error_chips = 0.50; num_of_realizations = 100; @@ -351,13 +353,13 @@ void GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test::wait_message() start = std::chrono::system_clock::now(); try - { + { channel_internal_queue.wait_and_pop(message); - } - catch( const boost::exception & e ) - { + } + catch (const boost::exception& e) + { LOG(WARNING) << "Boost exception: " << boost::diagnostic_information(e); - } + } end = std::chrono::system_clock::now(); std::chrono::duration elapsed_seconds = end - start; @@ -376,7 +378,7 @@ void GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test::process_message() detection_counter++; // The term -5 is here to correct the additional delay introduced by the FIR filter - double delay_error_chips = std::abs(static_cast(expected_delay_chips) - (static_cast(gnss_synchro.Acq_delay_samples) - 5) * 1023.0 / (static_cast(fs_in)*1e-3)); + double delay_error_chips = std::abs(static_cast(expected_delay_chips) - (static_cast(gnss_synchro.Acq_delay_samples) - 5) * 1023.0 / (static_cast(fs_in) * 1e-3)); double doppler_error_hz = std::abs(expected_doppler_hz - gnss_synchro.Acq_doppler_hz); mse_delay += std::pow(delay_error_chips, 2); @@ -436,27 +438,27 @@ TEST_F(GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test, ConnectAndRun) acquisition = std::dynamic_pointer_cast(acq_); boost::shared_ptr msg_rx = GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test_msg_rx_make(channel_internal_queue); - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_channel(1); }) << "Failure setting channel."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_gnss_synchro(&gnss_synchro); }) << "Failure setting gnss_synchro."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_doppler_max(config->property("Acquisition_1B.doppler_max", 10000)); }) << "Failure setting doppler_max."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_doppler_step(config->property("Acquisition_1B.doppler_step", 500)); }) << "Failure setting doppler_step."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_threshold(config->property("Acquisition_1B.threshold", 0.0)); }) << "Failure setting threshold."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->connect(top_block); boost::shared_ptr source = gr::analog::sig_source_c::make(fs_in, gr::analog::GR_SIN_WAVE, 1000, 1, gr_complex(0)); boost::shared_ptr valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue); @@ -465,14 +467,14 @@ TEST_F(GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test, ConnectAndRun) top_block->msg_connect(acquisition->get_right_block(), pmt::mp("events"), msg_rx, pmt::mp("events")); }) << "Failure connecting the blocks of acquisition test."; - EXPECT_NO_THROW( { + EXPECT_NO_THROW({ start = std::chrono::system_clock::now(); - top_block->run(); // Start threads and wait + top_block->run(); // Start threads and wait end = std::chrono::system_clock::now(); elapsed_seconds = end - start; }) << "Failure running the top_block."; - std::cout << "Processed " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; + std::cout << "Processed " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; } @@ -486,33 +488,33 @@ TEST_F(GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test, ValidationOfResults) acquisition = std::dynamic_pointer_cast(acq_); boost::shared_ptr msg_rx = GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test_msg_rx_make(channel_internal_queue); - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_channel(1); }) << "Failure setting channel."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_gnss_synchro(&gnss_synchro); }) << "Failure setting gnss_synchro."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_doppler_max(config->property("Acquisition_1B.doppler_max", 10000)); }) << "Failure setting doppler_max."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_doppler_step(config->property("Acquisition_1B.doppler_step", 500)); }) << "Failure setting doppler_step."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_threshold(config->property("Acquisition_1B.threshold", 0.0)); }) << "Failure setting threshold."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->connect(top_block); }) << "Failure connecting acquisition to the top_block."; acquisition->init(); - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ boost::shared_ptr signal_source; SignalGenerator* signal_generator = new SignalGenerator(config.get(), "SignalSource", 0, 1, queue); FirFilter* filter = new FirFilter(config.get(), "InputFilter", 1, 1); @@ -530,19 +532,19 @@ TEST_F(GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test, ValidationOfResults) if (i == 0) { - gnss_synchro.PRN = 10; // This satellite is visible + gnss_synchro.PRN = 10; // This satellite is visible } else if (i == 1) { - gnss_synchro.PRN = 20; // This satellite is not visible + gnss_synchro.PRN = 20; // This satellite is not visible } acquisition->set_local_code(); //acquisition->set_state(1); start_queue(); - EXPECT_NO_THROW( { - top_block->run(); // Start threads and wait + EXPECT_NO_THROW({ + top_block->run(); // Start threads and wait }) << "Failure running the top_block."; stop_queue(); @@ -554,7 +556,6 @@ TEST_F(GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test, ValidationOfResults) { EXPECT_EQ(static_cast(1), correct_estimation_counter) << "Acquisition failure. Incorrect parameters estimation."; } - } else if (i == 1) { @@ -575,33 +576,33 @@ TEST_F(GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test, ValidationOfResultsProb acquisition = std::dynamic_pointer_cast(acq_); boost::shared_ptr msg_rx = GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test_msg_rx_make(channel_internal_queue); - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_channel(1); }) << "Failure setting channel."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_gnss_synchro(&gnss_synchro); }) << "Failure setting gnss_synchro."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_doppler_max(config->property("Acquisition_1B.doppler_max", 10000)); }) << "Failure setting doppler_max."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_doppler_step(config->property("Acquisition_1B.doppler_step", 500)); }) << "Failure setting doppler_step."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_threshold(config->property("Acquisition_1B.threshold", 0.0)); }) << "Failure setting threshold."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->connect(top_block); }) << "Failure connecting acquisition to the top_block."; acquisition->init(); - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ boost::shared_ptr signal_source; SignalGenerator* signal_generator = new SignalGenerator(config.get(), "SignalSource", 0, 1, queue); FirFilter* filter = new FirFilter(config.get(), "InputFilter", 1, 1); @@ -621,19 +622,19 @@ TEST_F(GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test, ValidationOfResultsProb if (i == 0) { - gnss_synchro.PRN = 10; // This satellite is visible + gnss_synchro.PRN = 10; // This satellite is visible } else if (i == 1) { - gnss_synchro.PRN = 20; // This satellite is not visible + gnss_synchro.PRN = 20; // This satellite is not visible } acquisition->set_local_code(); //acquisition->set_state(1); start_queue(); - EXPECT_NO_THROW( { - top_block->run(); // Start threads and wait + EXPECT_NO_THROW({ + top_block->run(); // Start threads and wait }) << "Failure running the top_block."; stop_queue(); if (i == 0) diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_gsoc2013_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_gsoc2013_test.cc index 51624006d..7f287ec51 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_gsoc2013_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_gsoc2013_test.cc @@ -60,13 +60,14 @@ GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx_sptr GalileoE1PcpsAmbiguous class GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx : public gr::block { private: - friend GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx_sptr GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx_make(concurrent_queue& queue ); + friend GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx_sptr GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx_make(concurrent_queue& queue); void msg_handler_events(pmt::pmt_t msg); GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx(concurrent_queue& queue); concurrent_queue& channel_internal_queue; + public: int rx_message; - ~GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx(); //!< Default destructor + ~GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx(); //!< Default destructor }; @@ -79,21 +80,20 @@ GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx_sptr GalileoE1PcpsAmbiguous void GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx::msg_handler_events(pmt::pmt_t msg) { try - { + { long int message = pmt::to_long(msg); rx_message = message; channel_internal_queue.push(rx_message); - } - catch(boost::bad_any_cast& e) - { + } + catch (boost::bad_any_cast& e) + { LOG(WARNING) << "msg_handler_telemetry Bad any cast!"; rx_message = 0; - } + } } -GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx::GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx(concurrent_queue& queue) : - gr::block("GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0)), channel_internal_queue(queue) +GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx::GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx(concurrent_queue& queue) : gr::block("GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0)), channel_internal_queue(queue) { this->message_port_register_in(pmt::mp("events")); this->set_msg_handler(pmt::mp("events"), boost::bind(&GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx::msg_handler_events, this, _1)); @@ -101,13 +101,14 @@ GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx::GalileoE1PcpsAmbiguousAcqu } GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx::~GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx() -{} +{ +} // ########################################################### -class GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test: public ::testing::Test +class GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test : public ::testing::Test { protected: GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test() @@ -120,7 +121,8 @@ protected: } ~GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test() - {} + { + } void init(); void config_1(); @@ -194,7 +196,7 @@ void GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test::config_1() expected_delay_chips = 600; expected_doppler_hz = 750; - max_doppler_error_hz = 2/(3*integration_time_ms*1e-3); + max_doppler_error_hz = 2 / (3 * integration_time_ms * 1e-3); max_delay_error_chips = 0.50; num_of_realizations = 1; @@ -213,9 +215,9 @@ void GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test::config_1() config->set_property("SignalSource.PRN_0", "10"); config->set_property("SignalSource.CN0_dB_0", "44"); config->set_property("SignalSource.doppler_Hz_0", - std::to_string(expected_doppler_hz)); + std::to_string(expected_doppler_hz)); config->set_property("SignalSource.delay_chips_0", - std::to_string(expected_delay_chips)); + std::to_string(expected_delay_chips)); config->set_property("SignalSource.noise_flag", "false"); config->set_property("SignalSource.data_flag", "false"); @@ -243,9 +245,9 @@ void GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test::config_1() config->set_property("Acquisition_1B.implementation", "Galileo_E1_PCPS_Ambiguous_Acquisition"); config->set_property("Acquisition_1B.item_type", "gr_complex"); config->set_property("Acquisition_1B.coherent_integration_time_ms", - std::to_string(integration_time_ms)); + std::to_string(integration_time_ms)); config->set_property("Acquisition_1B.max_dwells", "1"); - config->set_property("Acquisition_1B.bit_transition_flag","false"); + config->set_property("Acquisition_1B.bit_transition_flag", "false"); config->set_property("Acquisition_1B.threshold", "0.1"); config->set_property("Acquisition_1B.doppler_max", "10000"); config->set_property("Acquisition_1B.doppler_step", "250"); @@ -284,9 +286,9 @@ void GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test::config_2() config->set_property("SignalSource.PRN_0", "10"); config->set_property("SignalSource.CN0_dB_0", "44"); config->set_property("SignalSource.doppler_Hz_0", - std::to_string(expected_doppler_hz)); + std::to_string(expected_doppler_hz)); config->set_property("SignalSource.delay_chips_0", - std::to_string(expected_delay_chips)); + std::to_string(expected_delay_chips)); config->set_property("SignalSource.system_1", "E"); config->set_property("SignalSource.PRN_1", "15"); @@ -332,9 +334,9 @@ void GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test::config_2() config->set_property("Acquisition_1B.implementation", "Galileo_E1_PCPS_Ambiguous_Acquisition"); config->set_property("Acquisition_1B.item_type", "gr_complex"); config->set_property("Acquisition_1B.coherent_integration_time_ms", - std::to_string(integration_time_ms)); + std::to_string(integration_time_ms)); config->set_property("Acquisition_1B.max_dwells", "1"); - config->set_property("Acquisition_1B.bit_transition_flag","false"); + config->set_property("Acquisition_1B.bit_transition_flag", "false"); config->set_property("Acquisition_1B.pfa", "0.1"); config->set_property("Acquisition_1B.doppler_max", "10000"); config->set_property("Acquisition_1B.doppler_step", "250"); @@ -379,7 +381,7 @@ void GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test::process_message() detection_counter++; // The term -5 is here to correct the additional delay introduced by the FIR filter - double delay_error_chips = std::abs(static_cast(expected_delay_chips) - (static_cast(gnss_synchro.Acq_delay_samples)- 5 ) * 1023.0 / static_cast(fs_in*1e-3)); + double delay_error_chips = std::abs(static_cast(expected_delay_chips) - (static_cast(gnss_synchro.Acq_delay_samples) - 5) * 1023.0 / static_cast(fs_in * 1e-3)); double doppler_error_hz = std::abs(expected_doppler_hz - gnss_synchro.Acq_doppler_hz); mse_delay += std::pow(delay_error_chips, 2); @@ -402,7 +404,7 @@ void GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test::process_message() Pd = static_cast(correct_estimation_counter) / static_cast(num_of_realizations); Pfa_a = static_cast(detection_counter) / static_cast(num_of_realizations); - Pfa_p = static_cast(detection_counter-correct_estimation_counter) / static_cast(num_of_realizations); + Pfa_p = static_cast(detection_counter - correct_estimation_counter) / static_cast(num_of_realizations); mean_acq_time_us /= static_cast(num_of_realizations); @@ -428,7 +430,7 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test, Instantiate) TEST_F(GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test, ConnectAndRun) { - int nsamples = floor(fs_in*integration_time_ms*1e-3); + int nsamples = floor(fs_in * integration_time_ms * 1e-3); std::chrono::time_point start, end; std::chrono::duration elapsed_seconds(0); top_block = gr::make_top_block("Acquisition test"); @@ -439,7 +441,7 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test, ConnectAndRun) acquisition = std::dynamic_pointer_cast(acq_); boost::shared_ptr msg_rx = GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx_make(channel_internal_queue); - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->connect(top_block); boost::shared_ptr source = gr::analog::sig_source_c::make(fs_in, gr::analog::GR_SIN_WAVE, 1000, 1, gr_complex(0)); boost::shared_ptr valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue); @@ -448,14 +450,14 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test, ConnectAndRun) top_block->msg_connect(acquisition->get_right_block(), pmt::mp("events"), msg_rx, pmt::mp("events")); }) << "Failure connecting the blocks of acquisition test."; - EXPECT_NO_THROW( { + EXPECT_NO_THROW({ start = std::chrono::system_clock::now(); - top_block->run(); // Start threads and wait + top_block->run(); // Start threads and wait end = std::chrono::system_clock::now(); elapsed_seconds = end - start; }) << "Failure running the top_block."; - std::cout << "Processed " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; + std::cout << "Processed " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; } @@ -468,33 +470,33 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test, ValidationOfResults) acquisition = std::dynamic_pointer_cast(acq_); boost::shared_ptr msg_rx = GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx_make(channel_internal_queue); - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_channel(1); }) << "Failure setting channel."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_gnss_synchro(&gnss_synchro); }) << "Failure setting gnss_synchro."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_doppler_max(config->property("Acquisition_1B.doppler_max", 10000)); }) << "Failure setting doppler_max."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_doppler_step(config->property("Acquisition_1B.doppler_step", 500)); }) << "Failure setting doppler_step."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_threshold(config->property("Acquisition_1B.threshold", 0.0)); }) << "Failure setting threshold."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->connect(top_block); }) << "Failure connecting acquisition to the top_block."; acquisition->init(); - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ boost::shared_ptr signal_source; SignalGenerator* signal_generator = new SignalGenerator(config.get(), "SignalSource", 0, 1, queue); FirFilter* filter = new FirFilter(config.get(), "InputFilter", 1, 1); @@ -512,39 +514,38 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test, ValidationOfResults) if (i == 0) { - gnss_synchro.PRN = 10; // This satellite is visible + gnss_synchro.PRN = 10; // This satellite is visible } else if (i == 1) { - gnss_synchro.PRN = 20; // This satellite is not visible + gnss_synchro.PRN = 20; // This satellite is not visible } acquisition->set_local_code(); acquisition->set_state(1); start_queue(); - EXPECT_NO_THROW( { - top_block->run(); // Start threads and wait + EXPECT_NO_THROW({ + top_block->run(); // Start threads and wait }) << "Failure running the top_block."; stop_queue(); if (i == 0) - { - EXPECT_EQ(1, message) << "Acquisition failure. Expected message: 1=ACQ SUCCESS."; - if (message == 1) - { - EXPECT_EQ(static_cast(1), correct_estimation_counter) << "Acquisition failure. Incorrect parameters estimation."; - } - } + { + EXPECT_EQ(1, message) << "Acquisition failure. Expected message: 1=ACQ SUCCESS."; + if (message == 1) + { + EXPECT_EQ(static_cast(1), correct_estimation_counter) << "Acquisition failure. Incorrect parameters estimation."; + } + } else if (i == 1) - { - EXPECT_EQ(2, message) << "Acquisition failure. Expected message: 2=ACQ FAIL."; - } + { + EXPECT_EQ(2, message) << "Acquisition failure. Expected message: 2=ACQ FAIL."; + } ch_thread.join(); } } - TEST_F(GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test, ValidationOfResultsProbabilities) { config_2(); @@ -554,33 +555,33 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test, ValidationOfResultsProbabi acquisition = std::dynamic_pointer_cast(acq_); boost::shared_ptr msg_rx = GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx_make(channel_internal_queue); - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_channel(1); }) << "Failure setting channel."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_gnss_synchro(&gnss_synchro); }) << "Failure setting gnss_synchro."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_doppler_max(config->property("Acquisition_1B.doppler_max", 10000)); }) << "Failure setting doppler_max."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_doppler_step(config->property("Acquisition_1B.doppler_step", 500)); }) << "Failure setting doppler_step."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_threshold(config->property("Acquisition_1B.threshold", 0.0)); }) << "Failure setting threshold."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->connect(top_block); }) << "Failure connecting acquisition to the top_block."; acquisition->init(); - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ boost::shared_ptr signal_source; SignalGenerator* signal_generator = new SignalGenerator(config.get(), "SignalSource", 0, 1, queue); FirFilter* filter = new FirFilter(config.get(), "InputFilter", 1, 1); @@ -600,34 +601,34 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test, ValidationOfResultsProbabi if (i == 0) { - gnss_synchro.PRN = 10; // This satellite is visible + gnss_synchro.PRN = 10; // This satellite is visible } else if (i == 1) { - gnss_synchro.PRN = 20; // This satellite is not visible + gnss_synchro.PRN = 20; // This satellite is not visible } acquisition->set_local_code(); acquisition->set_state(1); start_queue(); - EXPECT_NO_THROW( { - top_block->run(); // Start threads and wait + EXPECT_NO_THROW({ + top_block->run(); // Start threads and wait }) << "Failure running the top_block."; stop_queue(); if (i == 0) - { - std::cout << "Estimated probability of detection = " << Pd << std::endl; - std::cout << "Estimated probability of false alarm (satellite present) = " << Pfa_p << std::endl; - std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds." << std::endl; - } + { + std::cout << "Estimated probability of detection = " << Pd << std::endl; + std::cout << "Estimated probability of false alarm (satellite present) = " << Pfa_p << std::endl; + std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds." << std::endl; + } else if (i == 1) - { - std::cout << "Estimated probability of false alarm (satellite absent) = " << Pfa_a << std::endl; - std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds." << std::endl; - } + { + std::cout << "Estimated probability of false alarm (satellite absent) = " << Pfa_a << std::endl; + std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds." << std::endl; + } ch_thread.join(); } } diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_gsoc_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_gsoc_test.cc index 8f69f3c1d..b684355cf 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_gsoc_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_gsoc_test.cc @@ -72,9 +72,10 @@ private: void msg_handler_events(pmt::pmt_t msg); GalileoE1PcpsAmbiguousAcquisitionGSoCTest_msg_rx(concurrent_queue& queue); concurrent_queue& channel_internal_queue; + public: int rx_message; - ~GalileoE1PcpsAmbiguousAcquisitionGSoCTest_msg_rx(); //!< Default destructor + ~GalileoE1PcpsAmbiguousAcquisitionGSoCTest_msg_rx(); //!< Default destructor }; @@ -87,21 +88,20 @@ GalileoE1PcpsAmbiguousAcquisitionGSoCTest_msg_rx_sptr GalileoE1PcpsAmbiguousAcqu void GalileoE1PcpsAmbiguousAcquisitionGSoCTest_msg_rx::msg_handler_events(pmt::pmt_t msg) { try - { + { long int message = pmt::to_long(msg); rx_message = message; channel_internal_queue.push(rx_message); - } - catch(boost::bad_any_cast& e) - { + } + catch (boost::bad_any_cast& e) + { LOG(WARNING) << "msg_handler_telemetry Bad any cast!"; rx_message = 0; - } + } } -GalileoE1PcpsAmbiguousAcquisitionGSoCTest_msg_rx::GalileoE1PcpsAmbiguousAcquisitionGSoCTest_msg_rx(concurrent_queue& queue) : - gr::block("GalileoE1PcpsAmbiguousAcquisitionGSoCTest_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0)), channel_internal_queue(queue) +GalileoE1PcpsAmbiguousAcquisitionGSoCTest_msg_rx::GalileoE1PcpsAmbiguousAcquisitionGSoCTest_msg_rx(concurrent_queue& queue) : gr::block("GalileoE1PcpsAmbiguousAcquisitionGSoCTest_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0)), channel_internal_queue(queue) { this->message_port_register_in(pmt::mp("events")); this->set_msg_handler(pmt::mp("events"), boost::bind(&GalileoE1PcpsAmbiguousAcquisitionGSoCTest_msg_rx::msg_handler_events, this, _1)); @@ -109,13 +109,14 @@ GalileoE1PcpsAmbiguousAcquisitionGSoCTest_msg_rx::GalileoE1PcpsAmbiguousAcquisit } GalileoE1PcpsAmbiguousAcquisitionGSoCTest_msg_rx::~GalileoE1PcpsAmbiguousAcquisitionGSoCTest_msg_rx() -{} +{ +} // ########################################################### -class GalileoE1PcpsAmbiguousAcquisitionGSoCTest: public ::testing::Test +class GalileoE1PcpsAmbiguousAcquisitionGSoCTest : public ::testing::Test { protected: GalileoE1PcpsAmbiguousAcquisitionGSoCTest() @@ -129,7 +130,8 @@ protected: } ~GalileoE1PcpsAmbiguousAcquisitionGSoCTest() - {} + { + } void init(); void start_queue(); @@ -181,15 +183,14 @@ void GalileoE1PcpsAmbiguousAcquisitionGSoCTest::wait_message() while (!stop) { try - { + { channel_internal_queue.wait_and_pop(message); stop_queue(); - } - catch( const boost::exception & e ) - { + } + catch (const boost::exception& e) + { DLOG(WARNING) << "Boost exception: " << boost::diagnostic_information(e); - } - + } } } @@ -212,7 +213,7 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionGSoCTest, Instantiate) TEST_F(GalileoE1PcpsAmbiguousAcquisitionGSoCTest, ConnectAndRun) { int fs_in = 4000000; - int nsamples = 4*fs_in; + int nsamples = 4 * fs_in; std::chrono::time_point start, end; std::chrono::duration elapsed_seconds(0); queue = gr::msg_queue::make(0); @@ -223,7 +224,7 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionGSoCTest, ConnectAndRun) std::shared_ptr acquisition = std::dynamic_pointer_cast(acq_); boost::shared_ptr msg_rx = GalileoE1PcpsAmbiguousAcquisitionGSoCTest_msg_rx_make(channel_internal_queue); - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->connect(top_block); boost::shared_ptr source = gr::analog::sig_source_c::make(fs_in, gr::analog::GR_SIN_WAVE, 1000, 1, gr_complex(0)); boost::shared_ptr valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue); @@ -232,13 +233,13 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionGSoCTest, ConnectAndRun) top_block->msg_connect(acquisition->get_right_block(), pmt::mp("events"), msg_rx, pmt::mp("events")); }) << "Failure connecting the blocks of acquisition test."; - EXPECT_NO_THROW( { + EXPECT_NO_THROW({ start = std::chrono::system_clock::now(); - top_block->run(); // Start threads and wait + top_block->run(); // Start threads and wait end = std::chrono::system_clock::now(); elapsed_seconds = end - start; }) << "Failure running the top_block."; - std::cout << "Processed " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; + std::cout << "Processed " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; } @@ -254,41 +255,41 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionGSoCTest, ValidationOfResults) std::shared_ptr acquisition = std::dynamic_pointer_cast(acq_); boost::shared_ptr msg_rx = GalileoE1PcpsAmbiguousAcquisitionGSoCTest_msg_rx_make(channel_internal_queue); - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_channel(gnss_synchro.Channel_ID); }) << "Failure setting channel."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_gnss_synchro(&gnss_synchro); }) << "Failure setting gnss_synchro."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_threshold(config->property("Acquisition_1B.threshold", 0.00001)); }) << "Failure setting threshold."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_doppler_max(config->property("Acquisition_1B.doppler_max", 10000)); }) << "Failure setting doppler_max."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_doppler_step(config->property("Acquisition_1B.doppler_step", 250)); }) << "Failure setting doppler_step."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->connect(top_block); }) << "Failure connecting acquisition to the top_block."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ std::string path = std::string(TEST_PATH); //std::string file = path + "signal_samples/GSoC_CTTC_capture_2012_07_26_4Msps_4ms.dat"; std::string file = path + "signal_samples/Galileo_E1_ID_1_Fs_4Msps_8ms.dat"; - const char * file_name = file.c_str(); + const char* file_name = file.c_str(); gr::blocks::file_source::sptr file_source = gr::blocks::file_source::make(sizeof(gr_complex), file_name, false); top_block->connect(file_source, 0, acquisition->get_left_block(), 0); top_block->msg_connect(acquisition->get_right_block(), pmt::mp("events"), msg_rx, pmt::mp("events")); }) << "Failure connecting the blocks of acquisition test."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ start_queue(); acquisition->set_local_code(); acquisition->init(); @@ -296,9 +297,9 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionGSoCTest, ValidationOfResults) acquisition->set_state(1); }) << "Failure starting acquisition"; - EXPECT_NO_THROW( { + EXPECT_NO_THROW({ start = std::chrono::system_clock::now(); - top_block->run(); // Start threads and wait + top_block->run(); // Start threads and wait end = std::chrono::system_clock::now(); elapsed_seconds = end - start; }) << "Failure running the top_block."; @@ -306,7 +307,7 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionGSoCTest, ValidationOfResults) stop_queue(); unsigned long int nsamples = gnss_synchro.Acq_samplestamp_samples; - std::cout << "Acquired " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; + std::cout << "Acquired " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; EXPECT_EQ(2, message) << "Acquisition failure. Expected message: 0=ACQ STOP."; diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_test.cc index 4a257bbec..9946638d1 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_test.cc @@ -69,7 +69,7 @@ private: public: int rx_message; - ~GalileoE1PcpsAmbiguousAcquisitionTest_msg_rx(); //!< Default destructor + ~GalileoE1PcpsAmbiguousAcquisitionTest_msg_rx(); //!< Default destructor }; @@ -82,20 +82,19 @@ GalileoE1PcpsAmbiguousAcquisitionTest_msg_rx_sptr GalileoE1PcpsAmbiguousAcquisit void GalileoE1PcpsAmbiguousAcquisitionTest_msg_rx::msg_handler_events(pmt::pmt_t msg) { try - { + { long int message = pmt::to_long(msg); rx_message = message; - } - catch(boost::bad_any_cast& e) - { + } + catch (boost::bad_any_cast& e) + { LOG(WARNING) << "msg_handler_telemetry Bad any cast!"; rx_message = 0; - } + } } -GalileoE1PcpsAmbiguousAcquisitionTest_msg_rx::GalileoE1PcpsAmbiguousAcquisitionTest_msg_rx() : - gr::block("GalileoE1PcpsAmbiguousAcquisitionTest_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0)) +GalileoE1PcpsAmbiguousAcquisitionTest_msg_rx::GalileoE1PcpsAmbiguousAcquisitionTest_msg_rx() : gr::block("GalileoE1PcpsAmbiguousAcquisitionTest_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0)) { this->message_port_register_in(pmt::mp("events")); this->set_msg_handler(pmt::mp("events"), boost::bind(&GalileoE1PcpsAmbiguousAcquisitionTest_msg_rx::msg_handler_events, this, _1)); @@ -104,26 +103,28 @@ GalileoE1PcpsAmbiguousAcquisitionTest_msg_rx::GalileoE1PcpsAmbiguousAcquisitionT GalileoE1PcpsAmbiguousAcquisitionTest_msg_rx::~GalileoE1PcpsAmbiguousAcquisitionTest_msg_rx() -{} +{ +} // ########################################################### -class GalileoE1PcpsAmbiguousAcquisitionTest: public ::testing::Test +class GalileoE1PcpsAmbiguousAcquisitionTest : public ::testing::Test { protected: GalileoE1PcpsAmbiguousAcquisitionTest() -{ + { factory = std::make_shared(); config = std::make_shared(); item_size = sizeof(gr_complex); gnss_synchro = Gnss_Synchro(); doppler_max = 10000; doppler_step = 250; -} + } ~GalileoE1PcpsAmbiguousAcquisitionTest() - {} + { + } void init(); void plot_grid(); @@ -150,7 +151,7 @@ void GalileoE1PcpsAmbiguousAcquisitionTest::init() config->set_property("GNSS-SDR.internal_fs_sps", "4000000"); config->set_property("Acquisition_1B.item_type", "gr_complex"); config->set_property("Acquisition_1B.coherent_integration_time_ms", "4"); - if(FLAGS_plot_acq_grid == true) + if (FLAGS_plot_acq_grid == true) { config->set_property("Acquisition_1B.dump", "true"); } @@ -173,17 +174,17 @@ void GalileoE1PcpsAmbiguousAcquisitionTest::plot_grid() std::string basename = "./tmp-acq-gal1/acquisition_E_1B"; unsigned int sat = static_cast(gnss_synchro.PRN); - unsigned int samples_per_code = static_cast(round(4000000 / (Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS))); // !! + unsigned int samples_per_code = static_cast(round(4000000 / (Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS))); // !! acquisition_dump_reader acq_dump(basename, sat, doppler_max, doppler_step, samples_per_code); - if(!acq_dump.read_binary_acq()) std::cout << "Error reading files" << std::endl; + if (!acq_dump.read_binary_acq()) std::cout << "Error reading files" << std::endl; - std::vector * doppler = &acq_dump.doppler; - std::vector * samples = &acq_dump.samples; - std::vector > * mag = &acq_dump.mag; + std::vector* doppler = &acq_dump.doppler; + std::vector* samples = &acq_dump.samples; + std::vector >* mag = &acq_dump.mag; const std::string gnuplot_executable(FLAGS_gnuplot_executable); - if(gnuplot_executable.empty()) + if (gnuplot_executable.empty()) { std::cout << "WARNING: Although the flag plot_acq_grid has been set to TRUE," << std::endl; std::cout << "gnuplot has not been found in your system." << std::endl; @@ -193,7 +194,7 @@ void GalileoE1PcpsAmbiguousAcquisitionTest::plot_grid() { std::cout << "Plotting the acquisition grid. This can take a while..." << std::endl; try - { + { boost::filesystem::path p(gnuplot_executable); boost::filesystem::path dir = p.parent_path(); std::string gnuplot_path = dir.native(); @@ -209,11 +210,11 @@ void GalileoE1PcpsAmbiguousAcquisitionTest::plot_grid() g1.savetops("Galileo_E1_acq_grid"); g1.savetopdf("Galileo_E1_acq_grid"); g1.showonscreen(); - } - catch (const GnuplotException & ge) - { + } + catch (const GnuplotException& ge) + { std::cout << ge.what() << std::endl; - } + } } std::string data_str = "./tmp-acq-gal1"; if (boost::filesystem::exists(data_str)) @@ -223,7 +224,6 @@ void GalileoE1PcpsAmbiguousAcquisitionTest::plot_grid() } - TEST_F(GalileoE1PcpsAmbiguousAcquisitionTest, Instantiate) { init(); @@ -235,7 +235,7 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionTest, Instantiate) TEST_F(GalileoE1PcpsAmbiguousAcquisitionTest, ConnectAndRun) { int fs_in = 4000000; - int nsamples = 4*fs_in; + int nsamples = 4 * fs_in; std::chrono::time_point start, end; std::chrono::duration elapsed_seconds(0); top_block = gr::make_top_block("Acquisition test"); @@ -245,22 +245,22 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionTest, ConnectAndRun) std::shared_ptr acquisition = std::dynamic_pointer_cast(acq_); boost::shared_ptr msg_rx = GalileoE1PcpsAmbiguousAcquisitionTest_msg_rx_make(); - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->connect(top_block); boost::shared_ptr source = gr::analog::sig_source_c::make(fs_in, gr::analog::GR_SIN_WAVE, 1000, 1, gr_complex(0)); boost::shared_ptr valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue); top_block->connect(source, 0, valve, 0); top_block->connect(valve, 0, acquisition->get_left_block(), 0); - top_block->msg_connect(acquisition->get_right_block(),pmt::mp("events"), msg_rx,pmt::mp("events")); + top_block->msg_connect(acquisition->get_right_block(), pmt::mp("events"), msg_rx, pmt::mp("events")); }) << "Failure connecting the blocks of acquisition test."; - EXPECT_NO_THROW( { + EXPECT_NO_THROW({ start = std::chrono::system_clock::now(); - top_block->run(); // Start threads and wait + top_block->run(); // Start threads and wait end = std::chrono::system_clock::now(); elapsed_seconds = end - start; }) << "Failure running the top_block."; - std::cout << "Processed " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; + std::cout << "Processed " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; } @@ -269,7 +269,7 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionTest, ValidationOfResults) std::chrono::time_point start, end; std::chrono::duration elapsed_seconds(0); - if(FLAGS_plot_acq_grid == true) + if (FLAGS_plot_acq_grid == true) { std::string data_str = "./tmp-acq-gal1"; if (boost::filesystem::exists(data_str)) @@ -279,7 +279,7 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionTest, ValidationOfResults) boost::filesystem::create_directory(data_str); } - double expected_delay_samples = 2920; //18250; + double expected_delay_samples = 2920; //18250; double expected_doppler_hz = -632; init(); top_block = gr::make_top_block("Acquisition test"); @@ -287,34 +287,34 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionTest, ValidationOfResults) std::shared_ptr acquisition = std::dynamic_pointer_cast(acq_); boost::shared_ptr msg_rx = GalileoE1PcpsAmbiguousAcquisitionTest_msg_rx_make(); - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_channel(gnss_synchro.Channel_ID); }) << "Failure setting channel."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_gnss_synchro(&gnss_synchro); }) << "Failure setting gnss_synchro."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_threshold(config->property("Acquisition_1B.threshold", 1e-9)); }) << "Failure setting threshold."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_doppler_max(config->property("Acquisition_1B.doppler_max", doppler_max)); }) << "Failure setting doppler_max."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_doppler_step(config->property("Acquisition_1B.doppler_step", doppler_step)); }) << "Failure setting doppler_step."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->connect(top_block); }) << "Failure connecting acquisition to the top_block."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ std::string path = std::string(TEST_PATH); std::string file = path + "signal_samples/Galileo_E1_ID_1_Fs_4Msps_8ms.dat"; - const char * file_name = file.c_str(); + const char* file_name = file.c_str(); gr::blocks::file_source::sptr file_source = gr::blocks::file_source::make(sizeof(gr_complex), file_name, false); top_block->connect(file_source, 0, acquisition->get_left_block(), 0); top_block->msg_connect(acquisition->get_right_block(), pmt::mp("events"), msg_rx, pmt::mp("events")); @@ -325,15 +325,15 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionTest, ValidationOfResults) acquisition->reset(); acquisition->set_state(1); - EXPECT_NO_THROW( { + EXPECT_NO_THROW({ start = std::chrono::system_clock::now(); - top_block->run(); // Start threads and wait + top_block->run(); // Start threads and wait end = std::chrono::system_clock::now(); elapsed_seconds = end - start; }) << "Failure running the top_block."; unsigned long int nsamples = gnss_synchro.Acq_samplestamp_samples; - std::cout << "Acquired " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; + std::cout << "Acquired " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; ASSERT_EQ(1, msg_rx->rx_message) << "Acquisition failure. Expected message: 1=ACQ SUCCESS."; std::cout << "Delay: " << gnss_synchro.Acq_delay_samples << std::endl; @@ -346,9 +346,8 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionTest, ValidationOfResults) EXPECT_LE(doppler_error_hz, 166) << "Doppler error exceeds the expected value: 166 Hz = 2/(3*integration period)"; EXPECT_LT(delay_error_chips, 0.175) << "Delay error exceeds the expected value: 0.175 chips"; - if(FLAGS_plot_acq_grid == true) + if (FLAGS_plot_acq_grid == true) { plot_grid(); } } - diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_cccwsr_ambiguous_acquisition_gsoc2013_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_cccwsr_ambiguous_acquisition_gsoc2013_test.cc index b5b4e2b86..1a8774c77 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_cccwsr_ambiguous_acquisition_gsoc2013_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_cccwsr_ambiguous_acquisition_gsoc2013_test.cc @@ -60,13 +60,14 @@ GalileoE1PcpsCccwsrAmbiguousAcquisitionTest_msg_rx_sptr GalileoE1PcpsCccwsrAmbig class GalileoE1PcpsCccwsrAmbiguousAcquisitionTest_msg_rx : public gr::block { private: - friend GalileoE1PcpsCccwsrAmbiguousAcquisitionTest_msg_rx_sptr GalileoE1PcpsCccwsrAmbiguousAcquisitionTest_msg_rx_make(concurrent_queue& queue ); + friend GalileoE1PcpsCccwsrAmbiguousAcquisitionTest_msg_rx_sptr GalileoE1PcpsCccwsrAmbiguousAcquisitionTest_msg_rx_make(concurrent_queue& queue); void msg_handler_events(pmt::pmt_t msg); GalileoE1PcpsCccwsrAmbiguousAcquisitionTest_msg_rx(concurrent_queue& queue); concurrent_queue& channel_internal_queue; + public: int rx_message; - ~GalileoE1PcpsCccwsrAmbiguousAcquisitionTest_msg_rx(); //!< Default destructor + ~GalileoE1PcpsCccwsrAmbiguousAcquisitionTest_msg_rx(); //!< Default destructor }; @@ -79,21 +80,20 @@ GalileoE1PcpsCccwsrAmbiguousAcquisitionTest_msg_rx_sptr GalileoE1PcpsCccwsrAmbig void GalileoE1PcpsCccwsrAmbiguousAcquisitionTest_msg_rx::msg_handler_events(pmt::pmt_t msg) { try - { + { long int message = pmt::to_long(msg); rx_message = message; channel_internal_queue.push(rx_message); - } - catch(boost::bad_any_cast& e) - { + } + catch (boost::bad_any_cast& e) + { LOG(WARNING) << "msg_handler_telemetry Bad any cast!"; rx_message = 0; - } + } } -GalileoE1PcpsCccwsrAmbiguousAcquisitionTest_msg_rx::GalileoE1PcpsCccwsrAmbiguousAcquisitionTest_msg_rx(concurrent_queue& queue) : - gr::block("GalileoE1PcpsCccwsrAmbiguousAcquisitionTest_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0)), channel_internal_queue(queue) +GalileoE1PcpsCccwsrAmbiguousAcquisitionTest_msg_rx::GalileoE1PcpsCccwsrAmbiguousAcquisitionTest_msg_rx(concurrent_queue& queue) : gr::block("GalileoE1PcpsCccwsrAmbiguousAcquisitionTest_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0)), channel_internal_queue(queue) { this->message_port_register_in(pmt::mp("events")); this->set_msg_handler(pmt::mp("events"), boost::bind(&GalileoE1PcpsCccwsrAmbiguousAcquisitionTest_msg_rx::msg_handler_events, this, _1)); @@ -101,12 +101,13 @@ GalileoE1PcpsCccwsrAmbiguousAcquisitionTest_msg_rx::GalileoE1PcpsCccwsrAmbiguous } GalileoE1PcpsCccwsrAmbiguousAcquisitionTest_msg_rx::~GalileoE1PcpsCccwsrAmbiguousAcquisitionTest_msg_rx() -{} +{ +} // ########################################################### -class GalileoE1PcpsCccwsrAmbiguousAcquisitionTest: public ::testing::Test +class GalileoE1PcpsCccwsrAmbiguousAcquisitionTest : public ::testing::Test { protected: GalileoE1PcpsCccwsrAmbiguousAcquisitionTest() @@ -188,14 +189,14 @@ void GalileoE1PcpsCccwsrAmbiguousAcquisitionTest::config_1() gnss_synchro.Channel_ID = 0; gnss_synchro.System = 'E'; std::string signal = "1C"; - signal.copy(gnss_synchro.Signal,2,0); + signal.copy(gnss_synchro.Signal, 2, 0); integration_time_ms = 4; fs_in = 4e6; expected_delay_chips = 600; expected_doppler_hz = 750; - max_doppler_error_hz = 2/(3*integration_time_ms*1e-3); + max_doppler_error_hz = 2 / (3 * integration_time_ms * 1e-3); max_delay_error_chips = 0.50; num_of_realizations = 1; @@ -214,9 +215,9 @@ void GalileoE1PcpsCccwsrAmbiguousAcquisitionTest::config_1() config->set_property("SignalSource.PRN_0", "10"); config->set_property("SignalSource.CN0_dB_0", "44"); config->set_property("SignalSource.doppler_Hz_0", - std::to_string(expected_doppler_hz)); + std::to_string(expected_doppler_hz)); config->set_property("SignalSource.delay_chips_0", - std::to_string(expected_delay_chips)); + std::to_string(expected_delay_chips)); config->set_property("SignalSource.noise_flag", "false"); config->set_property("SignalSource.data_flag", "false"); @@ -244,7 +245,7 @@ void GalileoE1PcpsCccwsrAmbiguousAcquisitionTest::config_1() config->set_property("Acquisition_1B.item_type", "gr_complex"); config->set_property("Acquisition_1B.if", "0"); config->set_property("Acquisition_1B.coherent_integration_time_ms", - std::to_string(integration_time_ms)); + std::to_string(integration_time_ms)); config->set_property("Acquisition_1B.max_dwells", "1"); config->set_property("Acquisition_1B.implementation", "Galileo_E1_PCPS_CCCWSR_Ambiguous_Acquisition"); config->set_property("Acquisition_1B.threshold", "0.7"); @@ -266,7 +267,7 @@ void GalileoE1PcpsCccwsrAmbiguousAcquisitionTest::config_2() expected_delay_chips = 600; expected_doppler_hz = 750; - max_doppler_error_hz = 2/(3*integration_time_ms*1e-3); + max_doppler_error_hz = 2 / (3 * integration_time_ms * 1e-3); max_delay_error_chips = 0.50; num_of_realizations = 100; @@ -285,9 +286,9 @@ void GalileoE1PcpsCccwsrAmbiguousAcquisitionTest::config_2() config->set_property("SignalSource.PRN_0", "10"); config->set_property("SignalSource.CN0_dB_0", "44"); config->set_property("SignalSource.doppler_Hz_0", - std::to_string(expected_doppler_hz)); + std::to_string(expected_doppler_hz)); config->set_property("SignalSource.delay_chips_0", - std::to_string(expected_delay_chips)); + std::to_string(expected_delay_chips)); config->set_property("SignalSource.system_1", "E"); config->set_property("SignalSource.PRN_1", "15"); @@ -333,9 +334,9 @@ void GalileoE1PcpsCccwsrAmbiguousAcquisitionTest::config_2() config->set_property("Acquisition_1B.implementation", "Galileo_E1_PCPS_CCCWSR_Ambiguous_Acquisition"); config->set_property("Acquisition_1B.item_type", "gr_complex"); config->set_property("Acquisition_1B.coherent_integration_time_ms", - std::to_string(integration_time_ms)); + std::to_string(integration_time_ms)); config->set_property("Acquisition_1B.max_dwells", "1"); - config->set_property("Acquisition_1B.threshold", "0.00215"); // Pfa,a = 0.1 + config->set_property("Acquisition_1B.threshold", "0.00215"); // Pfa,a = 0.1 config->set_property("Acquisition_1B.doppler_max", "10000"); config->set_property("Acquisition_1B.doppler_step", "250"); config->set_property("Acquisition_1B.dump", "false"); @@ -402,7 +403,7 @@ void GalileoE1PcpsCccwsrAmbiguousAcquisitionTest::process_message() Pd = static_cast(correct_estimation_counter) / static_cast(num_of_realizations); Pfa_a = static_cast(detection_counter) / static_cast(num_of_realizations); - Pfa_p = static_cast(detection_counter-correct_estimation_counter) / static_cast(num_of_realizations); + Pfa_p = static_cast(detection_counter - correct_estimation_counter) / static_cast(num_of_realizations); mean_acq_time_us /= num_of_realizations; @@ -430,7 +431,7 @@ TEST_F(GalileoE1PcpsCccwsrAmbiguousAcquisitionTest, Instantiate) TEST_F(GalileoE1PcpsCccwsrAmbiguousAcquisitionTest, ConnectAndRun) { - int nsamples = floor(fs_in*integration_time_ms*1e-3); + int nsamples = floor(fs_in * integration_time_ms * 1e-3); std::chrono::time_point start, end; std::chrono::duration elapsed_seconds(0); @@ -442,7 +443,7 @@ TEST_F(GalileoE1PcpsCccwsrAmbiguousAcquisitionTest, ConnectAndRun) acquisition = std::dynamic_pointer_cast(acq_); boost::shared_ptr msg_rx = GalileoE1PcpsCccwsrAmbiguousAcquisitionTest_msg_rx_make(channel_internal_queue); - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->connect(top_block); boost::shared_ptr source = gr::analog::sig_source_c::make(fs_in, gr::analog::GR_SIN_WAVE, 1000, 1, gr_complex(0)); boost::shared_ptr valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue); @@ -451,14 +452,14 @@ TEST_F(GalileoE1PcpsCccwsrAmbiguousAcquisitionTest, ConnectAndRun) top_block->msg_connect(acquisition->get_right_block(), pmt::mp("events"), msg_rx, pmt::mp("events")); }) << "Failure connecting the blocks of acquisition test."; - EXPECT_NO_THROW( { + EXPECT_NO_THROW({ start = std::chrono::system_clock::now(); - top_block->run(); // Start threads and wait + top_block->run(); // Start threads and wait end = std::chrono::system_clock::now(); elapsed_seconds = end - start; }) << "Failure running the top_block."; - std::cout << "Processed " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; + std::cout << "Processed " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; } @@ -471,34 +472,34 @@ TEST_F(GalileoE1PcpsCccwsrAmbiguousAcquisitionTest, ValidationOfResults) acquisition = std::dynamic_pointer_cast(acq_); boost::shared_ptr msg_rx = GalileoE1PcpsCccwsrAmbiguousAcquisitionTest_msg_rx_make(channel_internal_queue); - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_channel(1); }) << "Failure setting channel."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_gnss_synchro(&gnss_synchro); }) << "Failure setting gnss_synchro."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_doppler_max(config->property("Acquisition_1B.doppler_max", 10000)); }) << "Failure setting doppler_max."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_doppler_step(config->property("Acquisition_1B.doppler_step", 500)); }) << "Failure setting doppler_step."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_threshold(config->property("Acquisition_1B.threshold", 0.00001)); }) << "Failure setting threshold."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->connect(top_block); }) << "Failure connecting acquisition to the top_block."; acquisition->init(); acquisition->reset(); - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ boost::shared_ptr signal_source; SignalGenerator* signal_generator = new SignalGenerator(config.get(), "SignalSource", 0, 1, queue); FirFilter* filter = new FirFilter(config.get(), "InputFilter", 1, 1); @@ -516,11 +517,11 @@ TEST_F(GalileoE1PcpsCccwsrAmbiguousAcquisitionTest, ValidationOfResults) if (i == 0) { - gnss_synchro.PRN = 10; // This satellite is visible + gnss_synchro.PRN = 10; // This satellite is visible } else if (i == 1) { - gnss_synchro.PRN = 20; // This satellite is not visible + gnss_synchro.PRN = 20; // This satellite is not visible } acquisition->set_gnss_synchro(&gnss_synchro); acquisition->set_local_code(); @@ -528,32 +529,32 @@ TEST_F(GalileoE1PcpsCccwsrAmbiguousAcquisitionTest, ValidationOfResults) acquisition->set_state(1); start_queue(); - EXPECT_NO_THROW( { - top_block->run(); // Start threads and wait + EXPECT_NO_THROW({ + top_block->run(); // Start threads and wait }) << "Failure running the top_block."; stop_queue(); if (i == 0) - { - EXPECT_EQ(1, message) << "Acquisition failure. Expected message: 1=ACQ SUCCESS."; - //EXPECT_EQ(2, message) << "Acquisition failure. Expected message: 1=ACQ SUCCESS."; - if (message == 1) - { - EXPECT_EQ(static_cast(1), correct_estimation_counter) << "Acquisition failure. Incorrect parameters estimation."; - } - } + { + EXPECT_EQ(1, message) << "Acquisition failure. Expected message: 1=ACQ SUCCESS."; + //EXPECT_EQ(2, message) << "Acquisition failure. Expected message: 1=ACQ SUCCESS."; + if (message == 1) + { + EXPECT_EQ(static_cast(1), correct_estimation_counter) << "Acquisition failure. Incorrect parameters estimation."; + } + } else if (i == 1) - { - EXPECT_EQ(2, message) << "Acquisition failure. Expected message: 2=ACQ FAIL."; - } + { + EXPECT_EQ(2, message) << "Acquisition failure. Expected message: 2=ACQ FAIL."; + } #ifdef OLD_BOOST - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ ch_thread.timed_join(boost::posix_time::seconds(1)); }) << "Failure while waiting the queue to stop"; #endif #ifndef OLD_BOOST - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ ch_thread.try_join_until(boost::chrono::steady_clock::now() + boost::chrono::milliseconds(50)); }) << "Failure while waiting the queue to stop"; #endif @@ -570,34 +571,34 @@ TEST_F(GalileoE1PcpsCccwsrAmbiguousAcquisitionTest, ValidationOfResultsProbabili acquisition = std::dynamic_pointer_cast(acq_); boost::shared_ptr msg_rx = GalileoE1PcpsCccwsrAmbiguousAcquisitionTest_msg_rx_make(channel_internal_queue); - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_channel(1); }) << "Failure setting channel."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_gnss_synchro(&gnss_synchro); }) << "Failure setting gnss_synchro."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_doppler_max(config->property("Acquisition_1B.doppler_max", 10000)); }) << "Failure setting doppler_max."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_doppler_step(config->property("Acquisition_1B.doppler_step", 500)); }) << "Failure setting doppler_step."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_threshold(config->property("Acquisition_1B.threshold", 0.00215)); }) << "Failure setting threshold."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->connect(top_block); }) << "Failure connecting acquisition to the top_block."; acquisition->init(); acquisition->reset(); - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ boost::shared_ptr signal_source; SignalGenerator* signal_generator = new SignalGenerator(config.get(), "SignalSource", 0, 1, queue); FirFilter* filter = new FirFilter(config.get(), "InputFilter", 1, 1); @@ -617,11 +618,11 @@ TEST_F(GalileoE1PcpsCccwsrAmbiguousAcquisitionTest, ValidationOfResultsProbabili if (i == 0) { - gnss_synchro.PRN = 10; // This satellite is visible + gnss_synchro.PRN = 10; // This satellite is visible } else if (i == 1) { - gnss_synchro.PRN = 20; // This satellite is not visible + gnss_synchro.PRN = 20; // This satellite is not visible } acquisition->set_gnss_synchro(&gnss_synchro); @@ -631,23 +632,23 @@ TEST_F(GalileoE1PcpsCccwsrAmbiguousAcquisitionTest, ValidationOfResultsProbabili acquisition->set_state(1); start_queue(); - EXPECT_NO_THROW( { - top_block->run(); // Start threads and wait + EXPECT_NO_THROW({ + top_block->run(); // Start threads and wait }) << "Failure running the top_block."; stop_queue(); if (i == 0) - { - std::cout << "Estimated probability of detection = " << Pd << std::endl; - std::cout << "Estimated probability of false alarm (satellite present) = " << Pfa_p << std::endl; - std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds." << std::endl; - } + { + std::cout << "Estimated probability of detection = " << Pd << std::endl; + std::cout << "Estimated probability of false alarm (satellite present) = " << Pfa_p << std::endl; + std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds." << std::endl; + } else if (i == 1) - { - std::cout << "Probability of false alarm (satellite absent) = " << Pfa_a << std::endl; - std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds." << std::endl; - } + { + std::cout << "Probability of false alarm (satellite absent) = " << Pfa_a << std::endl; + std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds." << std::endl; + } ch_thread.join(); } } diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_quicksync_ambiguous_acquisition_gsoc2014_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_quicksync_ambiguous_acquisition_gsoc2014_test.cc index 0cb5c50cf..5405007fd 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_quicksync_ambiguous_acquisition_gsoc2014_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_quicksync_ambiguous_acquisition_gsoc2014_test.cc @@ -72,9 +72,10 @@ private: void msg_handler_events(pmt::pmt_t msg); GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test_msg_rx(concurrent_queue& queue); concurrent_queue& channel_internal_queue; + public: int rx_message; - ~GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test_msg_rx(); //!< Default destructor + ~GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test_msg_rx(); //!< Default destructor }; @@ -87,21 +88,20 @@ GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test_msg_rx_sptr GalileoE1Pcps void GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test_msg_rx::msg_handler_events(pmt::pmt_t msg) { try - { + { long int message = pmt::to_long(msg); rx_message = message; channel_internal_queue.push(rx_message); - } - catch(boost::bad_any_cast& e) - { + } + catch (boost::bad_any_cast& e) + { LOG(WARNING) << "msg_handler_telemetry Bad any cast!"; rx_message = 0; - } + } } -GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test_msg_rx::GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test_msg_rx(concurrent_queue& queue) : - gr::block("GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0)), channel_internal_queue(queue) +GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test_msg_rx::GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test_msg_rx(concurrent_queue& queue) : gr::block("GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0)), channel_internal_queue(queue) { this->message_port_register_in(pmt::mp("events")); this->set_msg_handler(pmt::mp("events"), boost::bind(&GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test_msg_rx::msg_handler_events, this, _1)); @@ -110,23 +110,24 @@ GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test_msg_rx::GalileoE1PcpsQuic GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test_msg_rx::~GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test_msg_rx() -{} +{ +} // ########################################################### -class GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test: public ::testing::Test +class GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test : public ::testing::Test { protected: GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test() -{ + { factory = std::make_shared(); item_size = sizeof(gr_complex); stop = false; message = 0; gnss_synchro = Gnss_Synchro(); init(); -} + } ~GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test() { } @@ -171,10 +172,10 @@ protected: double mse_doppler; double mse_delay; - double Pd; // Probability of detection - double Pfa_p; // Probability of false alarm on present satellite - double Pfa_a; // Probability of false alarm on absent satellite - double Pmd; // Probability of miss detection + double Pd; // Probability of detection + double Pfa_p; // Probability of false alarm on present satellite + double Pfa_a; // Probability of false alarm on absent satellite + double Pmd; // Probability of miss detection std::ofstream pdpfafile; unsigned int miss_detection_counter; @@ -213,7 +214,7 @@ void GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test::config_1() expected_delay_chips = 600; expected_doppler_hz = 750; - max_doppler_error_hz = 2/(3*integration_time_ms*1e-3); + max_doppler_error_hz = 2 / (3 * integration_time_ms * 1e-3); max_delay_error_chips = 0.50; num_of_realizations = 1; @@ -232,9 +233,9 @@ void GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test::config_1() config->set_property("SignalSource.PRN_0", "10"); config->set_property("SignalSource.CN0_dB_0", "44"); config->set_property("SignalSource.doppler_Hz_0", - std::to_string(expected_doppler_hz)); + std::to_string(expected_doppler_hz)); config->set_property("SignalSource.delay_chips_0", - std::to_string(expected_delay_chips)); + std::to_string(expected_delay_chips)); config->set_property("SignalSource.noise_flag", "false"); config->set_property("SignalSource.data_flag", "false"); @@ -262,9 +263,9 @@ void GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test::config_1() config->set_property("Acquisition_1B.implementation", "Galileo_E1_PCPS_QuickSync_Ambiguous_Acquisition"); config->set_property("Acquisition_1B.item_type", "gr_complex"); config->set_property("Acquisition_1B.coherent_integration_time_ms", - std::to_string(integration_time_ms)); + std::to_string(integration_time_ms)); config->set_property("Acquisition_1B.max_dwells", "1"); - config->set_property("Acquisition_1B.bit_transition_flag","false"); + config->set_property("Acquisition_1B.bit_transition_flag", "false"); config->set_property("Acquisition_1B.threshold", "1"); config->set_property("Acquisition_1Bdoppler_max", "10000"); config->set_property("Acquisition_1B.doppler_step", "250"); @@ -308,9 +309,9 @@ void GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test::config_2() config->set_property("SignalSource.PRN_0", "10"); config->set_property("SignalSource.CN0_dB_0", std::to_string(FLAGS_e1_value_CN0_dB_0)); config->set_property("SignalSource.doppler_Hz_0", - std::to_string(expected_doppler_hz)); + std::to_string(expected_doppler_hz)); config->set_property("SignalSource.delay_chips_0", - std::to_string(expected_delay_chips)); + std::to_string(expected_delay_chips)); config->set_property("SignalSource.system_1", "E"); config->set_property("SignalSource.PRN_1", "15"); @@ -356,9 +357,9 @@ void GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test::config_2() config->set_property("Acquisition_1B.implementation", "Galileo_E1_PCPS_QuickSync_Ambiguous_Acquisition"); config->set_property("Acquisition_1B.item_type", "gr_complex"); config->set_property("Acquisition_1B.coherent_integration_time_ms", - std::to_string(integration_time_ms)); + std::to_string(integration_time_ms)); config->set_property("Acquisition_1B.max_dwells", "1"); - config->set_property("Acquisition_1B.bit_transition_flag","false"); + config->set_property("Acquisition_1B.bit_transition_flag", "false"); config->set_property("Acquisition_1B.threshold", std::to_string(FLAGS_e1_value_threshold)); config->set_property("Acquisition_1B.doppler_max", "10000"); config->set_property("Acquisition_1B.doppler_step", "125"); @@ -398,9 +399,9 @@ void GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test::config_3() config->set_property("SignalSource.PRN_0", "10"); config->set_property("SignalSource.CN0_dB_0", std::to_string(FLAGS_e1_value_CN0_dB_0)); config->set_property("SignalSource.doppler_Hz_0", - std::to_string(expected_doppler_hz)); + std::to_string(expected_doppler_hz)); config->set_property("SignalSource.delay_chips_0", - std::to_string(expected_delay_chips)); + std::to_string(expected_delay_chips)); config->set_property("SignalSource.system_1", "E"); config->set_property("SignalSource.PRN_1", "15"); @@ -420,8 +421,8 @@ void GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test::config_3() config->set_property("SignalSource.doppler_Hz_3", "3000"); config->set_property("SignalSource.delay_chips_3", "300"); - config->set_property("SignalSource.noise_flag", "false");// - config->set_property("SignalSource.data_flag", "false");// + config->set_property("SignalSource.noise_flag", "false"); // + config->set_property("SignalSource.data_flag", "false"); // config->set_property("SignalSource.BW_BB", "0.97"); config->set_property("InputFilter.implementation", "Fir_Filter"); @@ -446,9 +447,9 @@ void GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test::config_3() config->set_property("Acquisition_1B.implementation", "Galileo_E1_PCPS_QuickSync_Ambiguous_Acquisition"); config->set_property("Acquisition_1B.item_type", "gr_complex"); config->set_property("Acquisition_1B.coherent_integration_time_ms", - std::to_string(integration_time_ms)); + std::to_string(integration_time_ms)); config->set_property("Acquisition_1B.max_dwells", "1"); - config->set_property("Acquisition_1B.bit_transition_flag","false"); + config->set_property("Acquisition_1B.bit_transition_flag", "false"); config->set_property("Acquisition_1B.threshold", "0.2"); config->set_property("Acquisition_1B.doppler_max", "10000"); config->set_property("Acquisition_1B.doppler_step", "125"); @@ -505,7 +506,7 @@ void GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test::process_message() correct_estimation_counter++; } } - else if(message == 2 && gnss_synchro.PRN == 10) + else if (message == 2 && gnss_synchro.PRN == 10) { /* if ((delay_error_chips < max_delay_error_chips) && (doppler_error_hz < max_doppler_error_hz)) @@ -555,7 +556,7 @@ TEST_F(GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test, Instantiate) TEST_F(GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test, ConnectAndRun) { LOG(INFO) << "**Start connect and run test"; - int nsamples = floor(fs_in*integration_time_ms*1e-3); + int nsamples = floor(fs_in * integration_time_ms * 1e-3); std::chrono::time_point begin, end; std::chrono::duration elapsed_seconds(0); top_block = gr::make_top_block("Acquisition test"); @@ -567,20 +568,20 @@ TEST_F(GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test, ConnectAndRun) acquisition = std::dynamic_pointer_cast(acq_); boost::shared_ptr msg_rx = GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test_msg_rx_make(channel_internal_queue); - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->connect(top_block); boost::shared_ptr source = - gr::analog::sig_source_c::make(fs_in, gr::analog::GR_SIN_WAVE, 1000, 1, gr_complex(0)); + gr::analog::sig_source_c::make(fs_in, gr::analog::GR_SIN_WAVE, 1000, 1, gr_complex(0)); boost::shared_ptr valve = - gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue); + gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue); top_block->connect(source, 0, valve, 0); top_block->connect(valve, 0, acquisition->get_left_block(), 0); top_block->msg_connect(acquisition->get_right_block(), pmt::mp("events"), msg_rx, pmt::mp("events")); }) << "Failure connecting the blocks of acquisition test."; - EXPECT_NO_THROW( { + EXPECT_NO_THROW({ begin = std::chrono::system_clock::now(); - top_block->run(); // Start threads and wait + top_block->run(); // Start threads and wait end = std::chrono::system_clock::now(); elapsed_seconds = end - begin; }) << "Failure running the top_block."; @@ -602,34 +603,34 @@ TEST_F(GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test, ValidationOfResul acquisition = std::dynamic_pointer_cast(acq_); boost::shared_ptr msg_rx = GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test_msg_rx_make(channel_internal_queue); - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_channel(0); }) << "Failure setting channel."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_gnss_synchro(&gnss_synchro); }) << "Failure setting gnss_synchro."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_doppler_max(config->property("Acquisition_1B.doppler_max", 10000)); }) << "Failure setting doppler_max."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_doppler_step(config->property("Acquisition_1B.doppler_step", 125)); }) << "Failure setting doppler_step."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_threshold(1); }) << "Failure setting threshold."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->connect(top_block); }) << "Failure connecting acquisition to the top_block."; acquisition->init(); acquisition->reset(); - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ boost::shared_ptr signal_source; SignalGenerator* signal_generator = new SignalGenerator(config.get(), "SignalSource", 0, 1, queue); FirFilter* filter = new FirFilter(config.get(), "InputFilter", 1, 1); @@ -648,11 +649,11 @@ TEST_F(GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test, ValidationOfResul if (i == 0) { - gnss_synchro.PRN = 10; // This satellite is visible + gnss_synchro.PRN = 10; // This satellite is visible } else if (i == 1) { - gnss_synchro.PRN = 20; // This satellite is not visible + gnss_synchro.PRN = 20; // This satellite is not visible } acquisition->set_gnss_synchro(&gnss_synchro); acquisition->set_local_code(); @@ -660,8 +661,8 @@ TEST_F(GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test, ValidationOfResul acquisition->set_state(1); start_queue(); - EXPECT_NO_THROW( { - top_block->run(); // Start threads and wait + EXPECT_NO_THROW({ + top_block->run(); // Start threads and wait }) << "Failure running the top_block."; stop_queue(); @@ -693,34 +694,34 @@ TEST_F(GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test, ValidationOfResul acquisition = std::dynamic_pointer_cast(acq_); boost::shared_ptr msg_rx = GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test_msg_rx_make(channel_internal_queue); - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_channel(1); }) << "Failure setting channel."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_gnss_synchro(&gnss_synchro); }) << "Failure setting gnss_synchro."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_doppler_max(config->property("Acquisition_1B.doppler_max", 10000)); }) << "Failure setting doppler_max."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_doppler_step(50); }) << "Failure setting doppler_step."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_threshold(5); }) << "Failure setting threshold."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->connect(top_block); }) << "Failure connecting acquisition to the top_block."; acquisition->init(); acquisition->reset(); - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ boost::shared_ptr signal_source; SignalGenerator* signal_generator = new SignalGenerator(config.get(), "SignalSource", 0, 1, queue); FirFilter* filter = new FirFilter(config.get(), "InputFilter", 1, 1); @@ -738,11 +739,11 @@ TEST_F(GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test, ValidationOfResul if (i == 0) { - gnss_synchro.PRN = 10; // This satellite is visible + gnss_synchro.PRN = 10; // This satellite is visible } else if (i == 1) { - gnss_synchro.PRN = 20; // This satellite is not visible + gnss_synchro.PRN = 20; // This satellite is not visible } acquisition->set_gnss_synchro(&gnss_synchro); @@ -751,8 +752,8 @@ TEST_F(GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test, ValidationOfResul acquisition->set_state(1); start_queue(); - EXPECT_NO_THROW( { - top_block->run(); // Start threads and wait + EXPECT_NO_THROW({ + top_block->run(); // Start threads and wait }) << "Failure running the top_block."; stop_queue(); @@ -781,33 +782,33 @@ TEST_F(GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test, ValidationOfResul acquisition = std::dynamic_pointer_cast(acq_); boost::shared_ptr msg_rx = GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test_msg_rx_make(channel_internal_queue); - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_channel(1); }) << "Failure setting channel."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_gnss_synchro(&gnss_synchro); }) << "Failure setting gnss_synchro."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_doppler_max(config->property("Acquisition_1B.doppler_max", 10000)); }) << "Failure setting doppler_max."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_doppler_step(config->property("Acquisition_1B.doppler_step", 500)); }) << "Failure setting doppler_step."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_threshold(config->property("Acquisition_1B.threshold", 0.0)); }) << "Failure setting threshold."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->connect(top_block); }) << "Failure connecting acquisition to the top_block."; acquisition->init(); - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ boost::shared_ptr signal_source; SignalGenerator* signal_generator = new SignalGenerator(config.get(), "SignalSource", 0, 1, queue); FirFilter* filter = new FirFilter(config.get(), "InputFilter", 1, 1); @@ -827,11 +828,11 @@ TEST_F(GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test, ValidationOfResul if (i == 0) { - gnss_synchro.PRN = 10; // This satellite is visible + gnss_synchro.PRN = 10; // This satellite is visible } else if (i == 1) { - gnss_synchro.PRN = 20; // This satellite is not visible + gnss_synchro.PRN = 20; // This satellite is not visible } acquisition->set_gnss_synchro(&gnss_synchro); @@ -840,8 +841,8 @@ TEST_F(GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test, ValidationOfResul acquisition->set_state(1); start_queue(); - EXPECT_NO_THROW( { - top_block->run(); // Start threads and wait + EXPECT_NO_THROW({ + top_block->run(); // Start threads and wait }) << "Failure running the top_block."; stop_queue(); @@ -853,13 +854,13 @@ TEST_F(GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test, ValidationOfResul std::cout << "Estimated probability of miss detection (satellite present) = " << Pmd << std::endl; std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds." << std::endl; - if(dump_test_results) + if (dump_test_results) { std::stringstream filenamepd; filenamepd.str(""); filenamepd << "../data/test_statistics_" << gnss_synchro.System - << "_" << gnss_synchro.Signal << "_sat_" - << gnss_synchro.PRN << "CN0_dB_0_" << FLAGS_e1_value_CN0_dB_0 << "_dBHz.csv"; + << "_" << gnss_synchro.Signal << "_sat_" + << gnss_synchro.PRN << "CN0_dB_0_" << FLAGS_e1_value_CN0_dB_0 << "_dBHz.csv"; pdpfafile.open(filenamepd.str().c_str(), std::ios::app | std::ios::out); pdpfafile << FLAGS_e1_value_threshold << "," << Pd << "," << Pfa_p << "," << Pmd << std::endl; @@ -871,13 +872,13 @@ TEST_F(GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test, ValidationOfResul std::cout << "Estimated probability of false alarm (satellite absent) = " << Pfa_a << std::endl; std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds." << std::endl; - if(dump_test_results) + if (dump_test_results) { std::stringstream filenamepf; filenamepf.str(""); filenamepf << "../data/test_statistics_" << gnss_synchro.System - << "_" << gnss_synchro.Signal << "_sat_" - << gnss_synchro.PRN << "CN0_dB_0_" << FLAGS_e1_value_CN0_dB_0 << "_dBHz.csv"; + << "_" << gnss_synchro.Signal << "_sat_" + << gnss_synchro.PRN << "CN0_dB_0_" << FLAGS_e1_value_CN0_dB_0 << "_dBHz.csv"; pdpfafile.open(filenamepf.str().c_str(), std::ios::app | std::ios::out); pdpfafile << FLAGS_e1_value_threshold << "," << Pfa_a << std::endl; diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_tong_ambiguous_acquisition_gsoc2013_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_tong_ambiguous_acquisition_gsoc2013_test.cc index 6e526f998..6969bfd22 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_tong_ambiguous_acquisition_gsoc2013_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_tong_ambiguous_acquisition_gsoc2013_test.cc @@ -66,9 +66,10 @@ private: void msg_handler_events(pmt::pmt_t msg); GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test_msg_rx(concurrent_queue& queue); concurrent_queue& channel_internal_queue; + public: int rx_message; - ~GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test_msg_rx(); //!< Default destructor + ~GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test_msg_rx(); //!< Default destructor }; @@ -81,21 +82,20 @@ GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test_msg_rx_sptr GalileoE1PcpsTongA void GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test_msg_rx::msg_handler_events(pmt::pmt_t msg) { try - { + { long int message = pmt::to_long(msg); rx_message = message; channel_internal_queue.push(rx_message); - } - catch(boost::bad_any_cast& e) - { + } + catch (boost::bad_any_cast& e) + { LOG(WARNING) << "msg_handler_telemetry Bad any cast!"; rx_message = 0; - } + } } -GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test_msg_rx::GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test_msg_rx(concurrent_queue& queue) : - gr::block("GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0)), channel_internal_queue(queue) +GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test_msg_rx::GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test_msg_rx(concurrent_queue& queue) : gr::block("GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0)), channel_internal_queue(queue) { this->message_port_register_in(pmt::mp("events")); this->set_msg_handler(pmt::mp("events"), boost::bind(&GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test_msg_rx::msg_handler_events, this, _1)); @@ -104,10 +104,11 @@ GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test_msg_rx::GalileoE1PcpsTongAmbig GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test_msg_rx::~GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test_msg_rx() -{} +{ +} -class GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test: public ::testing::Test +class GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test : public ::testing::Test { protected: GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test() @@ -196,7 +197,7 @@ void GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test::config_1() expected_delay_chips = 600; expected_doppler_hz = 750; - max_doppler_error_hz = 2/(3*integration_time_ms*1e-3); + max_doppler_error_hz = 2 / (3 * integration_time_ms * 1e-3); max_delay_error_chips = 0.50; num_of_realizations = 1; @@ -215,9 +216,9 @@ void GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test::config_1() config->set_property("SignalSource.PRN_0", "10"); config->set_property("SignalSource.CN0_dB_0", "44"); config->set_property("SignalSource.doppler_Hz_0", - std::to_string(expected_doppler_hz)); + std::to_string(expected_doppler_hz)); config->set_property("SignalSource.delay_chips_0", - std::to_string(expected_delay_chips)); + std::to_string(expected_delay_chips)); config->set_property("SignalSource.noise_flag", "false"); config->set_property("SignalSource.data_flag", "false"); @@ -245,7 +246,7 @@ void GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test::config_1() config->set_property("Acquisition_1B.implementation", "Galileo_E1_PCPS_Tong_Ambiguous_Acquisition"); config->set_property("Acquisition_1B.item_type", "gr_complex"); config->set_property("Acquisition_1B.coherent_integration_time_ms", - std::to_string(integration_time_ms)); + std::to_string(integration_time_ms)); config->set_property("Acquisition_1B.tong_init_val", "1"); config->set_property("Acquisition_1B.tong_max_val", "8"); config->set_property("Acquisition_1B.threshold", "0.3"); @@ -267,7 +268,7 @@ void GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test::config_2() expected_delay_chips = 600; expected_doppler_hz = 750; - max_doppler_error_hz = 2/(3*integration_time_ms*1e-3); + max_doppler_error_hz = 2 / (3 * integration_time_ms * 1e-3); max_delay_error_chips = 0.50; num_of_realizations = 100; @@ -286,9 +287,9 @@ void GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test::config_2() config->set_property("SignalSource.PRN_0", "10"); config->set_property("SignalSource.CN0_dB_0", "50"); config->set_property("SignalSource.doppler_Hz_0", - std::to_string(expected_doppler_hz)); + std::to_string(expected_doppler_hz)); config->set_property("SignalSource.delay_chips_0", - std::to_string(expected_delay_chips)); + std::to_string(expected_delay_chips)); config->set_property("SignalSource.system_1", "E"); config->set_property("SignalSource.PRN_1", "15"); @@ -334,10 +335,10 @@ void GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test::config_2() config->set_property("Acquisition_1B.implementation", "Galileo_E1_PCPS_Tong_Ambiguous_Acquisition"); config->set_property("Acquisition_1B.item_type", "gr_complex"); config->set_property("Acquisition_1B.coherent_integration_time_ms", - std::to_string(integration_time_ms)); + std::to_string(integration_time_ms)); config->set_property("Acquisition_1B.tong_init_val", "1"); config->set_property("Acquisition_1B.tong_max_val", "8"); - config->set_property("Acquisition_1B.threshold", "0.00028"); // Pfa,a = 0.1 + config->set_property("Acquisition_1B.threshold", "0.00028"); // Pfa,a = 0.1 config->set_property("Acquisition_1B.doppler_max", "10000"); config->set_property("Acquisition_1B.doppler_step", "250"); config->set_property("Acquisition_1B.dump", "false"); @@ -381,7 +382,7 @@ void GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test::process_message() detection_counter++; // The term -5 is here to correct the additional delay introduced by the FIR filter - double delay_error_chips = std::abs(static_cast(expected_delay_chips) - static_cast(gnss_synchro.Acq_delay_samples - 5) * 1023.0 / (static_cast(fs_in) * 1e-3)); + double delay_error_chips = std::abs(static_cast(expected_delay_chips) - static_cast(gnss_synchro.Acq_delay_samples - 5) * 1023.0 / (static_cast(fs_in) * 1e-3)); double doppler_error_hz = std::abs(expected_doppler_hz - gnss_synchro.Acq_doppler_hz); mse_delay += std::pow(delay_error_chips, 2); @@ -432,7 +433,7 @@ TEST_F(GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test, Instantiate) TEST_F(GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test, ConnectAndRun) { - int nsamples = floor(fs_in*integration_time_ms*1e-3); + int nsamples = floor(fs_in * integration_time_ms * 1e-3); std::chrono::time_point start, end; std::chrono::duration elapsed_seconds(0.0); top_block = gr::make_top_block("Acquisition test"); @@ -441,7 +442,7 @@ TEST_F(GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test, ConnectAndRun) std::shared_ptr acq_ = factory->GetBlock(config, "Acquisition_1B", "Galileo_E1_PCPS_Tong_Ambiguous_Acquisition", 1, 1); acquisition = std::dynamic_pointer_cast(acq_); - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->connect(top_block); boost::shared_ptr source = gr::analog::sig_source_c::make(fs_in, gr::analog::GR_SIN_WAVE, 1000, 1, gr_complex(0)); boost::shared_ptr valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue); @@ -449,14 +450,14 @@ TEST_F(GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test, ConnectAndRun) top_block->connect(valve, 0, acquisition->get_left_block(), 0); }) << "Failure connecting the blocks of acquisition test."; - EXPECT_NO_THROW( { + EXPECT_NO_THROW({ start = std::chrono::system_clock::now(); - top_block->run(); // Start threads and wait + top_block->run(); // Start threads and wait end = std::chrono::system_clock::now(); elapsed_seconds = end - start; }) << "Failure running the top_block."; - std::cout << "Processed " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; + std::cout << "Processed " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; } @@ -469,34 +470,34 @@ TEST_F(GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test, ValidationOfResults) acquisition = std::dynamic_pointer_cast(acq_); boost::shared_ptr msg_rx = GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test_msg_rx_make(channel_internal_queue); - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_channel(1); }) << "Failure setting channel."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_gnss_synchro(&gnss_synchro); }) << "Failure setting gnss_synchro."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_doppler_max(5000); }) << "Failure setting doppler_max."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_doppler_step(100); }) << "Failure setting doppler_step."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_threshold(0.01); }) << "Failure setting threshold."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->connect(top_block); }) << "Failure connecting acquisition to the top_block."; acquisition->reset(); acquisition->init(); - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ boost::shared_ptr signal_source; SignalGenerator* signal_generator = new SignalGenerator(config.get(), "SignalSource", 0, 1, queue); FirFilter* filter = new FirFilter(config.get(), "InputFilter", 1, 1); @@ -514,11 +515,11 @@ TEST_F(GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test, ValidationOfResults) if (i == 0) { - gnss_synchro.PRN = 10; // This satellite is visible + gnss_synchro.PRN = 10; // This satellite is visible } else if (i == 1) { - gnss_synchro.PRN = 20; // This satellite is not visible + gnss_synchro.PRN = 20; // This satellite is not visible } acquisition->reset(); acquisition->set_gnss_synchro(&gnss_synchro); @@ -526,21 +527,21 @@ TEST_F(GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test, ValidationOfResults) acquisition->set_state(1); start_queue(); - EXPECT_NO_THROW( { - top_block->run(); // Start threads and wait + EXPECT_NO_THROW({ + top_block->run(); // Start threads and wait }) << "Failure running the top_block."; stop_queue(); if (i == 0) - { - EXPECT_EQ(1, message) << "Acquisition failure. Expected message: 1=ACQ SUCCESS."; - EXPECT_EQ(static_cast(1), correct_estimation_counter) << "Acquisition failure. Incorrect parameters estimation."; - } + { + EXPECT_EQ(1, message) << "Acquisition failure. Expected message: 1=ACQ SUCCESS."; + EXPECT_EQ(static_cast(1), correct_estimation_counter) << "Acquisition failure. Incorrect parameters estimation."; + } else if (i == 1) - { - EXPECT_EQ(2, message) << "Acquisition failure. Expected message: 2=ACQ FAIL."; - } + { + EXPECT_EQ(2, message) << "Acquisition failure. Expected message: 2=ACQ FAIL."; + } //std::cout << "Delay: " << gnss_synchro.Acq_delay_samples << std::endl; //std::cout << "Doppler: " << gnss_synchro.Acq_doppler_hz << std::endl; @@ -558,33 +559,33 @@ TEST_F(GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test, ValidationOfResultsPro acquisition = std::dynamic_pointer_cast(acq_); boost::shared_ptr msg_rx = GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test_msg_rx_make(channel_internal_queue); - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_channel(1); }) << "Failure setting channel."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_gnss_synchro(&gnss_synchro); }) << "Failure setting gnss_synchro."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_doppler_max(config->property("Acquisition_1B.doppler_max", 10000)); }) << "Failure setting doppler_max."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_doppler_step(config->property("Acquisition_1B.doppler_step", 500)); }) << "Failure setting doppler_step."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_threshold(config->property("Acquisition_1B.threshold", 0.00028)); }) << "Failure setting threshold."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->connect(top_block); }) << "Failure connecting acquisition to the top_block."; acquisition->init(); - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ boost::shared_ptr signal_source; SignalGenerator* signal_generator = new SignalGenerator(config.get(), "SignalSource", 0, 1, queue); FirFilter* filter = new FirFilter(config.get(), "InputFilter", 1, 1); @@ -604,34 +605,34 @@ TEST_F(GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test, ValidationOfResultsPro if (i == 0) { - gnss_synchro.PRN = 10; // This satellite is visible + gnss_synchro.PRN = 10; // This satellite is visible } else if (i == 1) { - gnss_synchro.PRN = 20; // This satellite is not visible + gnss_synchro.PRN = 20; // This satellite is not visible } acquisition->set_local_code(); acquisition->set_state(1); start_queue(); - EXPECT_NO_THROW( { - top_block->run(); // Start threads and wait + EXPECT_NO_THROW({ + top_block->run(); // Start threads and wait }) << "Failure running the top_block."; stop_queue(); if (i == 0) - { - std::cout << "Estimated probability of detection = " << Pd << std::endl; - std::cout << "Estimated probability of false alarm (satellite present) = " << Pfa_p << std::endl; - std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds." << std::endl; - } + { + std::cout << "Estimated probability of detection = " << Pd << std::endl; + std::cout << "Estimated probability of false alarm (satellite present) = " << Pfa_p << std::endl; + std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds." << std::endl; + } else if (i == 1) - { - std::cout << "Estimated probability of false alarm (satellite absent) = " << Pfa_a << std::endl; - std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds." << std::endl; - } + { + std::cout << "Estimated probability of false alarm (satellite absent) = " << Pfa_a << std::endl; + std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds." << std::endl; + } ch_thread.join(); } } diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e5a_pcps_acquisition_gsoc2014_gensource_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e5a_pcps_acquisition_gsoc2014_gensource_test.cc index 8b9819ae0..a27d4531b 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e5a_pcps_acquisition_gsoc2014_gensource_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e5a_pcps_acquisition_gsoc2014_gensource_test.cc @@ -63,9 +63,10 @@ private: void msg_handler_events(pmt::pmt_t msg); GalileoE5aPcpsAcquisitionGSoC2014GensourceTest_msg_rx(concurrent_queue& queue); concurrent_queue& channel_internal_queue; + public: int rx_message; - ~GalileoE5aPcpsAcquisitionGSoC2014GensourceTest_msg_rx(); //!< Default destructor + ~GalileoE5aPcpsAcquisitionGSoC2014GensourceTest_msg_rx(); //!< Default destructor }; @@ -78,21 +79,20 @@ GalileoE5aPcpsAcquisitionGSoC2014GensourceTest_msg_rx_sptr GalileoE5aPcpsAcquisi void GalileoE5aPcpsAcquisitionGSoC2014GensourceTest_msg_rx::msg_handler_events(pmt::pmt_t msg) { try - { + { long int message = pmt::to_long(msg); rx_message = message; channel_internal_queue.push(rx_message); - } - catch(boost::bad_any_cast& e) - { + } + catch (boost::bad_any_cast& e) + { LOG(WARNING) << "msg_handler_telemetry Bad any cast!"; rx_message = 0; - } + } } -GalileoE5aPcpsAcquisitionGSoC2014GensourceTest_msg_rx::GalileoE5aPcpsAcquisitionGSoC2014GensourceTest_msg_rx(concurrent_queue& queue) : - gr::block("GalileoE5aPcpsAcquisitionGSoC2014GensourceTest_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0)), channel_internal_queue(queue) +GalileoE5aPcpsAcquisitionGSoC2014GensourceTest_msg_rx::GalileoE5aPcpsAcquisitionGSoC2014GensourceTest_msg_rx(concurrent_queue& queue) : gr::block("GalileoE5aPcpsAcquisitionGSoC2014GensourceTest_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0)), channel_internal_queue(queue) { this->message_port_register_in(pmt::mp("events")); this->set_msg_handler(pmt::mp("events"), boost::bind(&GalileoE5aPcpsAcquisitionGSoC2014GensourceTest_msg_rx::msg_handler_events, this, _1)); @@ -101,10 +101,11 @@ GalileoE5aPcpsAcquisitionGSoC2014GensourceTest_msg_rx::GalileoE5aPcpsAcquisition GalileoE5aPcpsAcquisitionGSoC2014GensourceTest_msg_rx::~GalileoE5aPcpsAcquisitionGSoC2014GensourceTest_msg_rx() -{} +{ +} -class GalileoE5aPcpsAcquisitionGSoC2014GensourceTest: public ::testing::Test +class GalileoE5aPcpsAcquisitionGSoC2014GensourceTest : public ::testing::Test { protected: GalileoE5aPcpsAcquisitionGSoC2014GensourceTest() @@ -117,7 +118,8 @@ protected: } ~GalileoE5aPcpsAcquisitionGSoC2014GensourceTest() - {} + { + } void init(); void config_1(); @@ -199,7 +201,7 @@ void GalileoE5aPcpsAcquisitionGSoC2014GensourceTest::config_1() gnss_synchro.Channel_ID = 0; gnss_synchro.System = 'E'; std::string signal = "5X"; - signal.copy(gnss_synchro.Signal,2,0); + signal.copy(gnss_synchro.Signal, 2, 0); integration_time_ms = 1; fs_in = 32e6; @@ -210,14 +212,14 @@ void GalileoE5aPcpsAcquisitionGSoC2014GensourceTest::config_1() CAF_window_hz = 0; Zero_padding = 0; - max_doppler_error_hz = 2/(3*integration_time_ms*1e-3); + max_doppler_error_hz = 2 / (3 * integration_time_ms * 1e-3); max_delay_error_chips = 0.50; num_of_realizations = 1; config = std::make_shared(); - config->set_property("Channel.signal",signal); + config->set_property("Channel.signal", signal); config->set_property("GNSS-SDR.internal_fs_sps", std::to_string(fs_in)); config->set_property("SignalSource.fs_hz", std::to_string(fs_in)); config->set_property("SignalSource.item_type", "gr_complex"); @@ -259,11 +261,11 @@ void GalileoE5aPcpsAcquisitionGSoC2014GensourceTest::config_1() config->set_property("Acquisition_5X.implementation", "Galileo_E5a_Noncoherent_IQ_Acquisition_CAF"); config->set_property("Acquisition_5X.item_type", "gr_complex"); config->set_property("Acquisition_5X.coherent_integration_time_ms", - std::to_string(integration_time_ms)); + std::to_string(integration_time_ms)); config->set_property("Acquisition_5X.max_dwells", "1"); - config->set_property("Acquisition_5X.CAF_window_hz",std::to_string(CAF_window_hz)); - config->set_property("Acquisition_5X.Zero_padding",std::to_string(Zero_padding)); - config->set_property("Acquisition_5X.pfa","0.003"); + config->set_property("Acquisition_5X.CAF_window_hz", std::to_string(CAF_window_hz)); + config->set_property("Acquisition_5X.Zero_padding", std::to_string(Zero_padding)); + config->set_property("Acquisition_5X.pfa", "0.003"); // config->set_property("Acquisition_5X.threshold", "0.01"); config->set_property("Acquisition_5X.doppler_max", "10000"); config->set_property("Acquisition_5X.doppler_step", "250"); @@ -278,7 +280,7 @@ void GalileoE5aPcpsAcquisitionGSoC2014GensourceTest::config_2() gnss_synchro.Channel_ID = 0; gnss_synchro.System = 'E'; std::string signal = "5X"; - signal.copy(gnss_synchro.Signal,2,0); + signal.copy(gnss_synchro.Signal, 2, 0); integration_time_ms = 3; @@ -286,7 +288,7 @@ void GalileoE5aPcpsAcquisitionGSoC2014GensourceTest::config_2() expected_delay_chips = 1000; expected_doppler_hz = 250; - max_doppler_error_hz = 2/(3*integration_time_ms*1e-3); + max_doppler_error_hz = 2 / (3 * integration_time_ms * 1e-3); max_delay_error_chips = 0.50; num_of_realizations = 1; @@ -298,7 +300,7 @@ void GalileoE5aPcpsAcquisitionGSoC2014GensourceTest::config_2() config->set_property("Acquisition_5X.implementation", "Galileo_E5a_PCPS_Acquisition"); config->set_property("Acquisition_5X.item_type", "gr_complex"); config->set_property("Acquisition_5X.coherent_integration_time_ms", - std::to_string(integration_time_ms)); + std::to_string(integration_time_ms)); config->set_property("Acquisition_5X.max_dwells", "1"); config->set_property("Acquisition_5X.threshold", "0.1"); config->set_property("Acquisition_5X.doppler_max", "10000"); @@ -315,7 +317,7 @@ void GalileoE5aPcpsAcquisitionGSoC2014GensourceTest::config_3() gnss_synchro.System = 'E'; //std::string signal = "5Q"; std::string signal = "5X"; - signal.copy(gnss_synchro.Signal,2,0); + signal.copy(gnss_synchro.Signal, 2, 0); integration_time_ms = 3; fs_in = 12e6; @@ -333,7 +335,7 @@ void GalileoE5aPcpsAcquisitionGSoC2014GensourceTest::config_3() expected_delay_sec3 = 77; expected_doppler_hz3 = 5000; - max_doppler_error_hz = 2/(3*integration_time_ms*1e-3); + max_doppler_error_hz = 2 / (3 * integration_time_ms * 1e-3); max_delay_error_chips = 0.50; num_of_realizations = 10; @@ -409,7 +411,7 @@ void GalileoE5aPcpsAcquisitionGSoC2014GensourceTest::config_3() config->set_property("Acquisition_5X.item_type", "gr_complex"); config->set_property("Acquisition_5X.if", "0"); config->set_property("Acquisition_5X.coherent_integration_time_ms", - std::to_string(integration_time_ms)); + std::to_string(integration_time_ms)); config->set_property("Acquisition_5X.max_dwells", "1"); config->set_property("Acquisition_5X.implementation", "Galileo_E5a_PCPS_Acquisition"); config->set_property("Acquisition_5X.threshold", "0.5"); @@ -458,27 +460,27 @@ void GalileoE5aPcpsAcquisitionGSoC2014GensourceTest::process_message() double delay_error_chips = 0.0; double doppler_error_hz = 0.0; switch (sat) - { - case 0: - delay_error_chips = std::abs(static_cast(expected_delay_chips) - static_cast(gnss_synchro.Acq_delay_samples - 5) * 10230.0 / (static_cast(fs_in) * 1e-3)); - doppler_error_hz = std::abs(expected_doppler_hz - gnss_synchro.Acq_doppler_hz); - break; - case 1: - delay_error_chips = std::abs(static_cast(expected_delay_chips1) - static_cast(gnss_synchro.Acq_delay_samples - 5) * 10230.0 / (static_cast(fs_in) * 1e-3)); - doppler_error_hz = std::abs(expected_doppler_hz1 - gnss_synchro.Acq_doppler_hz); - break; - case 2: - delay_error_chips = std::abs(static_cast(expected_delay_chips2) - static_cast(gnss_synchro.Acq_delay_samples - 5) * 10230.0 / (static_cast(fs_in) * 1e-3)); - doppler_error_hz = std::abs(expected_doppler_hz2 - gnss_synchro.Acq_doppler_hz); - break; - case 3: - delay_error_chips = std::abs(static_cast(expected_delay_chips3) - static_cast(gnss_synchro.Acq_delay_samples - 5) * 10230.0 / (static_cast(fs_in) * 1e-3)); - doppler_error_hz = std::abs(expected_doppler_hz3 - gnss_synchro.Acq_doppler_hz); - break; - default: // case 3 - std::cout << "Error: message from unexpected acquisition channel" << std::endl; - break; - } + { + case 0: + delay_error_chips = std::abs(static_cast(expected_delay_chips) - static_cast(gnss_synchro.Acq_delay_samples - 5) * 10230.0 / (static_cast(fs_in) * 1e-3)); + doppler_error_hz = std::abs(expected_doppler_hz - gnss_synchro.Acq_doppler_hz); + break; + case 1: + delay_error_chips = std::abs(static_cast(expected_delay_chips1) - static_cast(gnss_synchro.Acq_delay_samples - 5) * 10230.0 / (static_cast(fs_in) * 1e-3)); + doppler_error_hz = std::abs(expected_doppler_hz1 - gnss_synchro.Acq_doppler_hz); + break; + case 2: + delay_error_chips = std::abs(static_cast(expected_delay_chips2) - static_cast(gnss_synchro.Acq_delay_samples - 5) * 10230.0 / (static_cast(fs_in) * 1e-3)); + doppler_error_hz = std::abs(expected_doppler_hz2 - gnss_synchro.Acq_doppler_hz); + break; + case 3: + delay_error_chips = std::abs(static_cast(expected_delay_chips3) - static_cast(gnss_synchro.Acq_delay_samples - 5) * 10230.0 / (static_cast(fs_in) * 1e-3)); + doppler_error_hz = std::abs(expected_doppler_hz3 - gnss_synchro.Acq_doppler_hz); + break; + default: // case 3 + std::cout << "Error: message from unexpected acquisition channel" << std::endl; + break; + } detection_counter++; // The term -5 is here to correct the additional delay introduced by the FIR filter @@ -534,7 +536,7 @@ TEST_F(GalileoE5aPcpsAcquisitionGSoC2014GensourceTest, ConnectAndRun) { config_1(); //int nsamples = floor(5*fs_in*integration_time_ms*1e-3); - int nsamples = 21000*3; + int nsamples = 21000 * 3; std::chrono::time_point start, end; std::chrono::duration elapsed_seconds(0); acquisition = std::make_shared(config.get(), "Acquisition_5X", 1, 1); @@ -542,7 +544,7 @@ TEST_F(GalileoE5aPcpsAcquisitionGSoC2014GensourceTest, ConnectAndRun) queue = gr::msg_queue::make(0); top_block = gr::make_top_block("Acquisition test"); - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->connect(top_block); boost::shared_ptr source = gr::analog::sig_source_c::make(fs_in, gr::analog::GR_SIN_WAVE, 1000, 1, gr_complex(0)); boost::shared_ptr valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue); @@ -551,14 +553,14 @@ TEST_F(GalileoE5aPcpsAcquisitionGSoC2014GensourceTest, ConnectAndRun) top_block->msg_connect(acquisition->get_right_block(), pmt::mp("events"), msg_rx, pmt::mp("events")); }) << "Failure connecting the blocks of acquisition test."; - EXPECT_NO_THROW( { + EXPECT_NO_THROW({ start = std::chrono::system_clock::now(); - top_block->run(); // Start threads and wait + top_block->run(); // Start threads and wait end = std::chrono::system_clock::now(); elapsed_seconds = end - start; }) << "Failure running the top_block."; - std::cout << "Processed " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; + std::cout << "Processed " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; } @@ -570,33 +572,33 @@ TEST_F(GalileoE5aPcpsAcquisitionGSoC2014GensourceTest, ValidationOfSIM) acquisition = std::make_shared(config.get(), "Acquisition_5X", 1, 1); boost::shared_ptr msg_rx = GalileoE5aPcpsAcquisitionGSoC2014GensourceTest_msg_rx_make(channel_internal_queue); - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_channel(0); }) << "Failure setting channel."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_gnss_synchro(&gnss_synchro); }) << "Failure setting gnss_synchro."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_doppler_max(config->property("Acquisition_5X.doppler_max", 5000)); }) << "Failure setting doppler_max."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_doppler_step(config->property("Acquisition_5X.doppler_step", 100)); }) << "Failure setting doppler_step."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_threshold(config->property("Acquisition_5X.threshold", 0.0001)); }) << "Failure setting threshold."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->connect(top_block); }) << "Failure connecting acquisition to the top_block."; // USING THE SIGNAL GENERATOR - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ boost::shared_ptr signal_source; SignalGenerator* signal_generator = new SignalGenerator(config.get(), "SignalSource", 0, 1, queue); FirFilter* filter = new FirFilter(config.get(), "InputFilter", 1, 1); @@ -617,26 +619,26 @@ TEST_F(GalileoE5aPcpsAcquisitionGSoC2014GensourceTest, ValidationOfSIM) init(); switch (i) - { - case 0: { - gnss_synchro.PRN = 11; // present - break; + case 0: + { + gnss_synchro.PRN = 11; // present + break; + } + case 1: + { + gnss_synchro.PRN = 19; // not present + break; + } } - case 1: - { - gnss_synchro.PRN = 19; // not present - break; - } - } acquisition->set_gnss_synchro(&gnss_synchro); acquisition->set_local_code(); acquisition->set_state(1); start_queue(); - EXPECT_NO_THROW( { - top_block->run(); // Start threads and wait + EXPECT_NO_THROW({ + top_block->run(); // Start threads and wait }) << "Failure running the top_block."; stop_queue(); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l1_ca_pcps_acquisition_gsoc2017_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l1_ca_pcps_acquisition_gsoc2017_test.cc index ff09100a1..0a1035165 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l1_ca_pcps_acquisition_gsoc2017_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l1_ca_pcps_acquisition_gsoc2017_test.cc @@ -68,9 +68,10 @@ private: void msg_handler_events(pmt::pmt_t msg); GlonassL1CaPcpsAcquisitionGSoC2017Test_msg_rx(concurrent_queue& queue); concurrent_queue& channel_internal_queue; + public: int rx_message; - ~GlonassL1CaPcpsAcquisitionGSoC2017Test_msg_rx(); //!< Default destructor + ~GlonassL1CaPcpsAcquisitionGSoC2017Test_msg_rx(); //!< Default destructor }; @@ -83,21 +84,20 @@ GlonassL1CaPcpsAcquisitionGSoC2017Test_msg_rx_sptr GlonassL1CaPcpsAcquisitionGSo void GlonassL1CaPcpsAcquisitionGSoC2017Test_msg_rx::msg_handler_events(pmt::pmt_t msg) { try - { + { long int message = pmt::to_long(msg); rx_message = message; channel_internal_queue.push(rx_message); - } - catch(boost::bad_any_cast& e) - { + } + catch (boost::bad_any_cast& e) + { LOG(WARNING) << "msg_handler_telemetry Bad any cast!"; rx_message = 0; - } + } } -GlonassL1CaPcpsAcquisitionGSoC2017Test_msg_rx::GlonassL1CaPcpsAcquisitionGSoC2017Test_msg_rx(concurrent_queue& queue) : - gr::block("GlonassL1CaPcpsAcquisitionGSoC2017Test_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0)), channel_internal_queue(queue) +GlonassL1CaPcpsAcquisitionGSoC2017Test_msg_rx::GlonassL1CaPcpsAcquisitionGSoC2017Test_msg_rx(concurrent_queue& queue) : gr::block("GlonassL1CaPcpsAcquisitionGSoC2017Test_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0)), channel_internal_queue(queue) { this->message_port_register_in(pmt::mp("events")); this->set_msg_handler(pmt::mp("events"), boost::bind(&GlonassL1CaPcpsAcquisitionGSoC2017Test_msg_rx::msg_handler_events, this, _1)); @@ -106,12 +106,13 @@ GlonassL1CaPcpsAcquisitionGSoC2017Test_msg_rx::GlonassL1CaPcpsAcquisitionGSoC201 GlonassL1CaPcpsAcquisitionGSoC2017Test_msg_rx::~GlonassL1CaPcpsAcquisitionGSoC2017Test_msg_rx() -{} +{ +} // ########################################################### -class GlonassL1CaPcpsAcquisitionGSoC2017Test: public ::testing::Test +class GlonassL1CaPcpsAcquisitionGSoC2017Test : public ::testing::Test { protected: GlonassL1CaPcpsAcquisitionGSoC2017Test() @@ -140,7 +141,7 @@ protected: gr::msg_queue::sptr queue; gr::top_block_sptr top_block; - GlonassL1CaPcpsAcquisition *acquisition; + GlonassL1CaPcpsAcquisition* acquisition; std::shared_ptr config; Gnss_Synchro gnss_synchro; size_t item_size; @@ -193,14 +194,14 @@ void GlonassL1CaPcpsAcquisitionGSoC2017Test::config_1() gnss_synchro.Channel_ID = 0; gnss_synchro.System = 'R'; std::string signal = "1G"; - signal.copy(gnss_synchro.Signal,2,0); + signal.copy(gnss_synchro.Signal, 2, 0); integration_time_ms = 1; fs_in = 31.75e6; expected_delay_chips = 255; expected_doppler_hz = -1500; - max_doppler_error_hz = 2/(3*integration_time_ms*1e-3); + max_doppler_error_hz = 2 / (3 * integration_time_ms * 1e-3); max_delay_error_chips = 0.50; num_of_realizations = 1; @@ -247,7 +248,7 @@ void GlonassL1CaPcpsAcquisitionGSoC2017Test::config_1() config->set_property("Acquisition.item_type", "gr_complex"); config->set_property("Acquisition.if", "4000000"); config->set_property("Acquisition.coherent_integration_time_ms", - std::to_string(integration_time_ms)); + std::to_string(integration_time_ms)); config->set_property("Acquisition.max_dwells", "1"); config->set_property("Acquisition.implementation", "GLONASS_L1_CA_PCPS_Acquisition"); config->set_property("Acquisition.threshold", "0.8"); @@ -263,14 +264,14 @@ void GlonassL1CaPcpsAcquisitionGSoC2017Test::config_2() gnss_synchro.Channel_ID = 0; gnss_synchro.System = 'R'; std::string signal = "1G"; - signal.copy(gnss_synchro.Signal,2,0); + signal.copy(gnss_synchro.Signal, 2, 0); integration_time_ms = 1; fs_in = 31.75e6; expected_delay_chips = 374; expected_doppler_hz = -2000; - max_doppler_error_hz = 2/(3*integration_time_ms*1e-3); + max_doppler_error_hz = 2 / (3 * integration_time_ms * 1e-3); max_delay_error_chips = 0.50; num_of_realizations = 100; @@ -335,7 +336,7 @@ void GlonassL1CaPcpsAcquisitionGSoC2017Test::config_2() config->set_property("Acquisition.item_type", "gr_complex"); config->set_property("Acquisition.if", "4000000"); config->set_property("Acquisition.coherent_integration_time_ms", - std::to_string(integration_time_ms)); + std::to_string(integration_time_ms)); config->set_property("Acquisition.max_dwells", "1"); config->set_property("Acquisition.implementation", "GLONASS_L1_CA_PCPS_Acquisition"); config->set_property("Acquisition.pfa", "0.1"); @@ -364,14 +365,14 @@ void GlonassL1CaPcpsAcquisitionGSoC2017Test::wait_message() acquisition->reset(); gettimeofday(&tv, NULL); - begin = tv.tv_sec *1e6 + tv.tv_usec; + begin = tv.tv_sec * 1e6 + tv.tv_usec; channel_internal_queue.wait_and_pop(message); gettimeofday(&tv, NULL); - end = tv.tv_sec *1e6 + tv.tv_usec; + end = tv.tv_sec * 1e6 + tv.tv_usec; - mean_acq_time_us += (end-begin); + mean_acq_time_us += (end - begin); process_message(); } @@ -386,7 +387,7 @@ void GlonassL1CaPcpsAcquisitionGSoC2017Test::process_message() // The term -5 is here to correct the additional delay introduced by the FIR filter // The value 511.0 must be a variable, chips/length - double delay_error_chips = std::abs(static_cast(expected_delay_chips) - (static_cast(gnss_synchro.Acq_delay_samples) - 5.0 ) * 511.0 / (static_cast(fs_in) * 1e-3)); + double delay_error_chips = std::abs(static_cast(expected_delay_chips) - (static_cast(gnss_synchro.Acq_delay_samples) - 5.0) * 511.0 / (static_cast(fs_in) * 1e-3)); double doppler_error_hz = std::abs(expected_doppler_hz - gnss_synchro.Acq_doppler_hz); mse_delay += std::pow(delay_error_chips, 2); @@ -409,7 +410,7 @@ void GlonassL1CaPcpsAcquisitionGSoC2017Test::process_message() Pd = static_cast(correct_estimation_counter) / static_cast(num_of_realizations); Pfa_a = static_cast(detection_counter) / static_cast(num_of_realizations); - Pfa_p = (static_cast(detection_counter) - static_cast( correct_estimation_counter)) / static_cast(num_of_realizations); + Pfa_p = (static_cast(detection_counter) - static_cast(correct_estimation_counter)) / static_cast(num_of_realizations); mean_acq_time_us /= num_of_realizations; @@ -445,7 +446,7 @@ TEST_F(GlonassL1CaPcpsAcquisitionGSoC2017Test, ConnectAndRun) acquisition = new GlonassL1CaPcpsAcquisition(config.get(), "Acquisition", 1, 1); boost::shared_ptr msg_rx = GlonassL1CaPcpsAcquisitionGSoC2017Test_msg_rx_make(channel_internal_queue); - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->connect(top_block); boost::shared_ptr source = gr::analog::sig_source_c::make(fs_in, gr::analog::GR_SIN_WAVE, 1000, 1, gr_complex(0)); boost::shared_ptr valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue); @@ -454,14 +455,14 @@ TEST_F(GlonassL1CaPcpsAcquisitionGSoC2017Test, ConnectAndRun) top_block->msg_connect(acquisition->get_right_block(), pmt::mp("events"), msg_rx, pmt::mp("events")); }) << "Failure connecting the blocks of acquisition test."; - EXPECT_NO_THROW( { + EXPECT_NO_THROW({ begin = std::chrono::system_clock::now(); - top_block->run(); // Start threads and wait + top_block->run(); // Start threads and wait end = std::chrono::system_clock::now(); elapsed_seconds = end - begin; }) << "Failure running the top_block."; - std::cout << "Processed " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; + std::cout << "Processed " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; delete acquisition; } @@ -476,34 +477,34 @@ TEST_F(GlonassL1CaPcpsAcquisitionGSoC2017Test, ValidationOfResults) acquisition = new GlonassL1CaPcpsAcquisition(config.get(), "Acquisition", 1, 1); boost::shared_ptr msg_rx = GlonassL1CaPcpsAcquisitionGSoC2017Test_msg_rx_make(channel_internal_queue); - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_channel(1); }) << "Failure setting channel."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_gnss_synchro(&gnss_synchro); }) << "Failure setting gnss_synchro."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_doppler_max(10000); }) << "Failure setting doppler_max."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_doppler_step(500); }) << "Failure setting doppler_step."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_threshold(0.5); }) << "Failure setting threshold."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->connect(top_block); top_block->msg_connect(acquisition->get_right_block(), pmt::mp("events"), msg_rx, pmt::mp("events")); }) << "Failure connecting acquisition to the top_block."; acquisition->init(); - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ boost::shared_ptr signal_source; SignalGenerator* signal_generator = new SignalGenerator(config.get(), "SignalSource", 0, 1, queue); FirFilter* filter = new FirFilter(config.get(), "InputFilter", 1, 1); @@ -520,19 +521,19 @@ TEST_F(GlonassL1CaPcpsAcquisitionGSoC2017Test, ValidationOfResults) if (i == 0) { - gnss_synchro.PRN = 10; // This satellite is visible + gnss_synchro.PRN = 10; // This satellite is visible } else if (i == 1) { - gnss_synchro.PRN = 20; // This satellite is not visible + gnss_synchro.PRN = 20; // This satellite is not visible } acquisition->set_local_code(); - acquisition->set_state(1); // Ensure that acquisition starts at the first sample + acquisition->set_state(1); // Ensure that acquisition starts at the first sample start_queue(); - EXPECT_NO_THROW( { - top_block->run(); // Start threads and wait + EXPECT_NO_THROW({ + top_block->run(); // Start threads and wait }) << "Failure running the top_block."; if (i == 0) @@ -542,19 +543,18 @@ TEST_F(GlonassL1CaPcpsAcquisitionGSoC2017Test, ValidationOfResults) { EXPECT_EQ(static_cast(1), correct_estimation_counter) << "Acquisition failure. Incorrect parameters estimation."; } - } else if (i == 1) { EXPECT_EQ(2, message) << "Acquisition failure. Expected message: 2=ACQ FAIL."; } #ifdef OLD_BOOST - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ ch_thread.timed_join(boost::posix_time::seconds(1)); }) << "Failure while waiting the queue to stop."; #endif #ifndef OLD_BOOST - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ ch_thread.try_join_until(boost::chrono::steady_clock::now() + boost::chrono::milliseconds(50)); }) << "Failure while waiting the queue to stop"; #endif @@ -572,41 +572,48 @@ TEST_F(GlonassL1CaPcpsAcquisitionGSoC2017Test, ValidationOfResultsProbabilities) acquisition = new GlonassL1CaPcpsAcquisition(config.get(), "Acquisition", 1, 1); boost::shared_ptr msg_rx = GlonassL1CaPcpsAcquisitionGSoC2017Test_msg_rx_make(channel_internal_queue); - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_channel(1); - }) << "Failure setting channel."<< std::endl; + }) << "Failure setting channel." + << std::endl; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_gnss_synchro(&gnss_synchro); - }) << "Failure setting gnss_synchro."<< std::endl; + }) << "Failure setting gnss_synchro." + << std::endl; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_doppler_max(config->property("Acquisition.doppler_max", 10000)); - }) << "Failure setting doppler_max."<< std::endl; + }) << "Failure setting doppler_max." + << std::endl; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_doppler_step(config->property("Acquisition.doppler_step", 500)); - }) << "Failure setting doppler_step."<< std::endl; + }) << "Failure setting doppler_step." + << std::endl; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_threshold(config->property("Acquisition.threshold", 0.0)); - }) << "Failure setting threshold."<< std::endl; + }) << "Failure setting threshold." + << std::endl; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->connect(top_block); top_block->msg_connect(acquisition->get_right_block(), pmt::mp("events"), msg_rx, pmt::mp("events")); - }) << "Failure connecting acquisition to the top_block."<< std::endl; + }) << "Failure connecting acquisition to the top_block." + << std::endl; acquisition->init(); - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ boost::shared_ptr signal_source; SignalGenerator* signal_generator = new SignalGenerator(config.get(), "SignalSource", 0, 1, queue); FirFilter* filter = new FirFilter(config.get(), "InputFilter", 1, 1); signal_source.reset(new GenSignalSource(signal_generator, filter, "SignalSource", queue)); signal_source->connect(top_block); top_block->connect(signal_source->get_right_block(), 0, acquisition->get_left_block(), 0); - }) << "Failure connecting the blocks of acquisition test." << std::endl; + }) << "Failure connecting the blocks of acquisition test." + << std::endl; std::cout << "Probability of false alarm (target) = " << 0.1 << std::endl; @@ -618,43 +625,46 @@ TEST_F(GlonassL1CaPcpsAcquisitionGSoC2017Test, ValidationOfResultsProbabilities) if (i == 0) { - gnss_synchro.PRN = 10; // This satellite is visible + gnss_synchro.PRN = 10; // This satellite is visible } else if (i == 1) { - gnss_synchro.PRN = 1; // This satellite is not visible + gnss_synchro.PRN = 1; // This satellite is not visible } acquisition->set_local_code(); start_queue(); - EXPECT_NO_THROW( { - top_block->run(); // Start threads and wait - }) << "Failure running the top_block."<< std::endl; + EXPECT_NO_THROW({ + top_block->run(); // Start threads and wait + }) << "Failure running the top_block." + << std::endl; if (i == 0) { std::cout << "Estimated probability of detection = " << Pd << std::endl; std::cout << "Estimated probability of false alarm (satellite present) = " << Pfa_p << std::endl; - std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds." << std::endl; } + std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds." << std::endl; + } else if (i == 1) { std::cout << "Estimated probability of false alarm (satellite absent) = " << Pfa_a << std::endl; std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds." << std::endl; } #ifdef OLD_BOOST - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ ch_thread.timed_join(boost::posix_time::seconds(1)); - }) << "Failure while waiting the queue to stop" << std::endl; + }) << "Failure while waiting the queue to stop" + << std::endl; #endif #ifndef OLD_BOOST - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ ch_thread.try_join_until(boost::chrono::steady_clock::now() + boost::chrono::milliseconds(50)); - }) << "Failure while waiting the queue to stop" << std::endl; + }) << "Failure while waiting the queue to stop" + << std::endl; #endif } delete acquisition; } - diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l1_ca_pcps_acquisition_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l1_ca_pcps_acquisition_test.cc index b7755482e..f1b97112f 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l1_ca_pcps_acquisition_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l1_ca_pcps_acquisition_test.cc @@ -62,9 +62,10 @@ private: friend GlonassL1CaPcpsAcquisitionTest_msg_rx_sptr GlonassL1CaPcpsAcquisitionTest_msg_rx_make(); void msg_handler_events(pmt::pmt_t msg); GlonassL1CaPcpsAcquisitionTest_msg_rx(); + public: int rx_message; - ~GlonassL1CaPcpsAcquisitionTest_msg_rx(); //!< Default destructor + ~GlonassL1CaPcpsAcquisitionTest_msg_rx(); //!< Default destructor }; @@ -77,20 +78,19 @@ GlonassL1CaPcpsAcquisitionTest_msg_rx_sptr GlonassL1CaPcpsAcquisitionTest_msg_rx void GlonassL1CaPcpsAcquisitionTest_msg_rx::msg_handler_events(pmt::pmt_t msg) { try - { + { long int message = pmt::to_long(msg); rx_message = message; - } - catch(boost::bad_any_cast& e) - { + } + catch (boost::bad_any_cast& e) + { std::cout << "msg_handler_telemetry Bad any cast!" << std::endl; rx_message = 0; - } + } } -GlonassL1CaPcpsAcquisitionTest_msg_rx::GlonassL1CaPcpsAcquisitionTest_msg_rx() : - gr::block("GlonassL1CaPcpsAcquisitionTest_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0)) +GlonassL1CaPcpsAcquisitionTest_msg_rx::GlonassL1CaPcpsAcquisitionTest_msg_rx() : gr::block("GlonassL1CaPcpsAcquisitionTest_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0)) { this->message_port_register_in(pmt::mp("events")); this->set_msg_handler(pmt::mp("events"), boost::bind(&GlonassL1CaPcpsAcquisitionTest_msg_rx::msg_handler_events, this, _1)); @@ -99,12 +99,13 @@ GlonassL1CaPcpsAcquisitionTest_msg_rx::GlonassL1CaPcpsAcquisitionTest_msg_rx() : GlonassL1CaPcpsAcquisitionTest_msg_rx::~GlonassL1CaPcpsAcquisitionTest_msg_rx() -{} +{ +} // ########################################################### -class GlonassL1CaPcpsAcquisitionTest: public ::testing::Test +class GlonassL1CaPcpsAcquisitionTest : public ::testing::Test { protected: GlonassL1CaPcpsAcquisitionTest() @@ -116,7 +117,8 @@ protected: } ~GlonassL1CaPcpsAcquisitionTest() - {} + { + } void init(); @@ -170,7 +172,7 @@ TEST_F(GlonassL1CaPcpsAcquisitionTest, ConnectAndRun) boost::shared_ptr acquisition = boost::make_shared(config.get(), "Acquisition_1G", 1, 1); boost::shared_ptr msg_rx = GlonassL1CaPcpsAcquisitionTest_msg_rx_make(); - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->connect(top_block); boost::shared_ptr source = gr::analog::sig_source_c::make(fs_in, gr::analog::GR_SIN_WAVE, 1000, 1, gr_complex(0)); boost::shared_ptr valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue); @@ -179,14 +181,14 @@ TEST_F(GlonassL1CaPcpsAcquisitionTest, ConnectAndRun) top_block->msg_connect(acquisition->get_right_block(), pmt::mp("events"), msg_rx, pmt::mp("events")); }) << "Failure connecting the blocks of acquisition test."; - EXPECT_NO_THROW( { + EXPECT_NO_THROW({ begin = std::chrono::system_clock::now(); - top_block->run(); // Start threads and wait + top_block->run(); // Start threads and wait end = std::chrono::system_clock::now(); elapsed_seconds = end - begin; }) << "Failure running the top_block."; - std::cout << "Processed " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; + std::cout << "Processed " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; } @@ -203,52 +205,52 @@ TEST_F(GlonassL1CaPcpsAcquisitionTest, ValidationOfResults) boost::shared_ptr msg_rx = GlonassL1CaPcpsAcquisitionTest_msg_rx_make(); - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_channel(1); }) << "Failure setting channel."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_gnss_synchro(&gnss_synchro); }) << "Failure setting gnss_synchro."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_threshold(0.005); }) << "Failure setting threshold."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_doppler_max(10000); }) << "Failure setting doppler_max."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_doppler_step(500); }) << "Failure setting doppler_step."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->connect(top_block); }) << "Failure connecting acquisition to the top_block."; acquisition->set_local_code(); - acquisition->set_state(1); // Ensure that acquisition starts at the first sample + acquisition->set_state(1); // Ensure that acquisition starts at the first sample acquisition->init(); - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ std::string path = std::string(TEST_PATH); std::string file = path + "signal_samples/Glonass_L1_CA_SIM_Fs_62Msps_4ms.dat"; - const char * file_name = file.c_str(); + const char* file_name = file.c_str(); gr::blocks::file_source::sptr file_source = gr::blocks::file_source::make(sizeof(gr_complex), file_name, false); top_block->connect(file_source, 0, acquisition->get_left_block(), 0); top_block->msg_connect(acquisition->get_right_block(), pmt::mp("events"), msg_rx, pmt::mp("events")); }) << "Failure connecting the blocks of acquisition test."; - EXPECT_NO_THROW( { + EXPECT_NO_THROW({ begin = std::chrono::system_clock::now(); - top_block->run(); // Start threads and wait + top_block->run(); // Start threads and wait end = std::chrono::system_clock::now(); elapsed_seconds = end - begin; }) << "Failure running the top_block."; unsigned long int nsamples = gnss_synchro.Acq_samplestamp_samples; - std::cout << "Acquired " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; + std::cout << "Acquired " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; ASSERT_EQ(1, msg_rx->rx_message) << "Acquisition failure. Expected message: 1=ACQ SUCCESS."; diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_gsoc2013_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_gsoc2013_test.cc index 70f7394e0..9d7e84360 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_gsoc2013_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_gsoc2013_test.cc @@ -68,9 +68,10 @@ private: void msg_handler_events(pmt::pmt_t msg); GpsL1CaPcpsAcquisitionGSoC2013Test_msg_rx(concurrent_queue& queue); concurrent_queue& channel_internal_queue; + public: int rx_message; - ~GpsL1CaPcpsAcquisitionGSoC2013Test_msg_rx(); //!< Default destructor + ~GpsL1CaPcpsAcquisitionGSoC2013Test_msg_rx(); //!< Default destructor }; @@ -83,21 +84,20 @@ GpsL1CaPcpsAcquisitionGSoC2013Test_msg_rx_sptr GpsL1CaPcpsAcquisitionGSoC2013Tes void GpsL1CaPcpsAcquisitionGSoC2013Test_msg_rx::msg_handler_events(pmt::pmt_t msg) { try - { + { long int message = pmt::to_long(msg); rx_message = message; channel_internal_queue.push(rx_message); - } - catch(boost::bad_any_cast& e) - { + } + catch (boost::bad_any_cast& e) + { LOG(WARNING) << "msg_handler_telemetry Bad any cast!"; rx_message = 0; - } + } } -GpsL1CaPcpsAcquisitionGSoC2013Test_msg_rx::GpsL1CaPcpsAcquisitionGSoC2013Test_msg_rx(concurrent_queue& queue) : - gr::block("GpsL1CaPcpsAcquisitionGSoC2013Test_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0)), channel_internal_queue(queue) +GpsL1CaPcpsAcquisitionGSoC2013Test_msg_rx::GpsL1CaPcpsAcquisitionGSoC2013Test_msg_rx(concurrent_queue& queue) : gr::block("GpsL1CaPcpsAcquisitionGSoC2013Test_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0)), channel_internal_queue(queue) { this->message_port_register_in(pmt::mp("events")); this->set_msg_handler(pmt::mp("events"), boost::bind(&GpsL1CaPcpsAcquisitionGSoC2013Test_msg_rx::msg_handler_events, this, _1)); @@ -105,12 +105,13 @@ GpsL1CaPcpsAcquisitionGSoC2013Test_msg_rx::GpsL1CaPcpsAcquisitionGSoC2013Test_ms } GpsL1CaPcpsAcquisitionGSoC2013Test_msg_rx::~GpsL1CaPcpsAcquisitionGSoC2013Test_msg_rx() -{} +{ +} // ########################################################### -class GpsL1CaPcpsAcquisitionGSoC2013Test: public ::testing::Test +class GpsL1CaPcpsAcquisitionGSoC2013Test : public ::testing::Test { protected: GpsL1CaPcpsAcquisitionGSoC2013Test() @@ -139,7 +140,7 @@ protected: gr::msg_queue::sptr queue; gr::top_block_sptr top_block; - GpsL1CaPcpsAcquisition *acquisition; + GpsL1CaPcpsAcquisition* acquisition; std::shared_ptr config; Gnss_Synchro gnss_synchro; size_t item_size; @@ -192,14 +193,14 @@ void GpsL1CaPcpsAcquisitionGSoC2013Test::config_1() gnss_synchro.Channel_ID = 0; gnss_synchro.System = 'G'; std::string signal = "1C"; - signal.copy(gnss_synchro.Signal,2,0); + signal.copy(gnss_synchro.Signal, 2, 0); integration_time_ms = 1; fs_in = 4e6; expected_delay_chips = 600; expected_doppler_hz = 750; - max_doppler_error_hz = 2/(3*integration_time_ms*1e-3); + max_doppler_error_hz = 2 / (3 * integration_time_ms * 1e-3); max_delay_error_chips = 0.50; num_of_realizations = 1; @@ -246,7 +247,7 @@ void GpsL1CaPcpsAcquisitionGSoC2013Test::config_1() config->set_property("Acquisition_1C.implementation", "GPS_L1_CA_PCPS_Acquisition"); config->set_property("Acquisition_1C.item_type", "gr_complex"); config->set_property("Acquisition_1C.coherent_integration_time_ms", - std::to_string(integration_time_ms)); + std::to_string(integration_time_ms)); config->set_property("Acquisition_1C.max_dwells", "1"); config->set_property("Acquisition_1C.threshold", "0.8"); config->set_property("Acquisition_1C.doppler_max", "10000"); @@ -261,14 +262,14 @@ void GpsL1CaPcpsAcquisitionGSoC2013Test::config_2() gnss_synchro.Channel_ID = 0; gnss_synchro.System = 'G'; std::string signal = "1C"; - signal.copy(gnss_synchro.Signal,2,0); + signal.copy(gnss_synchro.Signal, 2, 0); integration_time_ms = 1; fs_in = 4e6; expected_delay_chips = 600; expected_doppler_hz = 750; - max_doppler_error_hz = 2/(3*integration_time_ms*1e-3); + max_doppler_error_hz = 2 / (3 * integration_time_ms * 1e-3); max_delay_error_chips = 0.50; num_of_realizations = 100; @@ -333,7 +334,7 @@ void GpsL1CaPcpsAcquisitionGSoC2013Test::config_2() config->set_property("Acquisition_1C.implementation", "GPS_L1_CA_PCPS_Acquisition"); config->set_property("Acquisition_1C.item_type", "gr_complex"); config->set_property("Acquisition_1C.coherent_integration_time_ms", - std::to_string(integration_time_ms)); + std::to_string(integration_time_ms)); config->set_property("Acquisition_1C.max_dwells", "1"); config->set_property("Acquisition_1C.pfa", "0.1"); config->set_property("Acquisition_1C.doppler_max", "10000"); @@ -380,7 +381,7 @@ void GpsL1CaPcpsAcquisitionGSoC2013Test::process_message() detection_counter++; // The term -5 is here to correct the additional delay introduced by the FIR filter - double delay_error_chips = std::abs(static_cast(expected_delay_chips) - static_cast(gnss_synchro.Acq_delay_samples - 5) *1023.0 / (static_cast(fs_in) * 1e-3)); + double delay_error_chips = std::abs(static_cast(expected_delay_chips) - static_cast(gnss_synchro.Acq_delay_samples - 5) * 1023.0 / (static_cast(fs_in) * 1e-3)); double doppler_error_hz = std::abs(expected_doppler_hz - gnss_synchro.Acq_doppler_hz); mse_delay += std::pow(delay_error_chips, 2); @@ -429,7 +430,7 @@ TEST_F(GpsL1CaPcpsAcquisitionGSoC2013Test, Instantiate) TEST_F(GpsL1CaPcpsAcquisitionGSoC2013Test, ConnectAndRun) { - int nsamples = floor(fs_in*integration_time_ms*1e-3); + int nsamples = floor(fs_in * integration_time_ms * 1e-3); std::chrono::time_point start, end; std::chrono::duration elapsed_seconds(0); queue = gr::msg_queue::make(0); @@ -439,7 +440,7 @@ TEST_F(GpsL1CaPcpsAcquisitionGSoC2013Test, ConnectAndRun) acquisition = new GpsL1CaPcpsAcquisition(config.get(), "Acquisition_1C", 1, 1); boost::shared_ptr msg_rx = GpsL1CaPcpsAcquisitionGSoC2013Test_msg_rx_make(channel_internal_queue); - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->connect(top_block); boost::shared_ptr source = gr::analog::sig_source_c::make(fs_in, gr::analog::GR_SIN_WAVE, 1000, 1, gr_complex(0)); boost::shared_ptr valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue); @@ -448,14 +449,14 @@ TEST_F(GpsL1CaPcpsAcquisitionGSoC2013Test, ConnectAndRun) top_block->msg_connect(acquisition->get_right_block(), pmt::mp("events"), msg_rx, pmt::mp("events")); }) << "Failure connecting the blocks of acquisition test."; - EXPECT_NO_THROW( { + EXPECT_NO_THROW({ start = std::chrono::system_clock::now(); - top_block->run(); // Start threads and wait + top_block->run(); // Start threads and wait end = std::chrono::system_clock::now(); elapsed_seconds = end - start; }) << "Failure running the top_block."; - std::cout << "Processed " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; + std::cout << "Processed " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; delete acquisition; } @@ -470,34 +471,34 @@ TEST_F(GpsL1CaPcpsAcquisitionGSoC2013Test, ValidationOfResults) acquisition = new GpsL1CaPcpsAcquisition(config.get(), "Acquisition_1C", 1, 1); boost::shared_ptr msg_rx = GpsL1CaPcpsAcquisitionGSoC2013Test_msg_rx_make(channel_internal_queue); - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_channel(1); }) << "Failure setting channel."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_gnss_synchro(&gnss_synchro); }) << "Failure setting gnss_synchro."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_doppler_max(10000); }) << "Failure setting doppler_max."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_doppler_step(500); }) << "Failure setting doppler_step."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_threshold(0.5); }) << "Failure setting threshold."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->connect(top_block); top_block->msg_connect(acquisition->get_right_block(), pmt::mp("events"), msg_rx, pmt::mp("events")); }) << "Failure connecting acquisition to the top_block."; acquisition->init(); - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ boost::shared_ptr signal_source; SignalGenerator* signal_generator = new SignalGenerator(config.get(), "SignalSource", 0, 1, queue); FirFilter* filter = new FirFilter(config.get(), "InputFilter", 1, 1); @@ -514,41 +515,40 @@ TEST_F(GpsL1CaPcpsAcquisitionGSoC2013Test, ValidationOfResults) if (i == 0) { - gnss_synchro.PRN = 10; // This satellite is visible + gnss_synchro.PRN = 10; // This satellite is visible } else if (i == 1) { - gnss_synchro.PRN = 20; // This satellite is not visible + gnss_synchro.PRN = 20; // This satellite is not visible } acquisition->set_local_code(); - acquisition->set_state(1); // Ensure that acquisition starts at the first sample + acquisition->set_state(1); // Ensure that acquisition starts at the first sample start_queue(); - EXPECT_NO_THROW( { - top_block->run(); // Start threads and wait + EXPECT_NO_THROW({ + top_block->run(); // Start threads and wait }) << "Failure running the top_block."; if (i == 0) - { - EXPECT_EQ(1, message) << "Acquisition failure. Expected message: 1=ACQ SUCCESS."; - if (message == 1) - { - EXPECT_EQ(static_cast(1), correct_estimation_counter) << "Acquisition failure. Incorrect parameters estimation."; - } - - } + { + EXPECT_EQ(1, message) << "Acquisition failure. Expected message: 1=ACQ SUCCESS."; + if (message == 1) + { + EXPECT_EQ(static_cast(1), correct_estimation_counter) << "Acquisition failure. Incorrect parameters estimation."; + } + } else if (i == 1) - { - EXPECT_EQ(2, message) << "Acquisition failure. Expected message: 2=ACQ FAIL."; - } + { + EXPECT_EQ(2, message) << "Acquisition failure. Expected message: 2=ACQ FAIL."; + } #ifdef OLD_BOOST - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ ch_thread.timed_join(boost::posix_time::seconds(1)); }) << "Failure while waiting the queue to stop"; #endif #ifndef OLD_BOOST - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ ch_thread.try_join_until(boost::chrono::steady_clock::now() + boost::chrono::milliseconds(50)); }) << "Failure while waiting the queue to stop"; #endif @@ -566,41 +566,41 @@ TEST_F(GpsL1CaPcpsAcquisitionGSoC2013Test, ValidationOfResultsProbabilities) acquisition = new GpsL1CaPcpsAcquisition(config.get(), "Acquisition_1C", 1, 1); boost::shared_ptr msg_rx = GpsL1CaPcpsAcquisitionGSoC2013Test_msg_rx_make(channel_internal_queue); - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_channel(1); }) << "Failure setting channel."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_gnss_synchro(&gnss_synchro); }) << "Failure setting gnss_synchro."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_doppler_max(config->property("Acquisition_1C.doppler_max", 10000)); }) << "Failure setting doppler_max."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_doppler_step(config->property("Acquisition_1C.doppler_step", 500)); }) << "Failure setting doppler_step."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_threshold(config->property("Acquisition_1C.threshold", 0.0)); }) << "Failure setting threshold."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->connect(top_block); top_block->msg_connect(acquisition->get_right_block(), pmt::mp("events"), msg_rx, pmt::mp("events")); }) << "Failure connecting acquisition to the top_block."; acquisition->init(); - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ boost::shared_ptr signal_source; SignalGenerator* signal_generator = new SignalGenerator(config.get(), "SignalSource", 0, 1, queue); FirFilter* filter = new FirFilter(config.get(), "InputFilter", 1, 1); signal_source.reset(new GenSignalSource(signal_generator, filter, "SignalSource", queue)); signal_source->connect(top_block); top_block->connect(signal_source->get_right_block(), 0, acquisition->get_left_block(), 0); - }) << "Failure connecting the blocks of acquisition test." ; + }) << "Failure connecting the blocks of acquisition test."; std::cout << "Probability of false alarm (target) = " << 0.1 << std::endl; @@ -612,38 +612,39 @@ TEST_F(GpsL1CaPcpsAcquisitionGSoC2013Test, ValidationOfResultsProbabilities) if (i == 0) { - gnss_synchro.PRN = 10; // This satellite is visible + gnss_synchro.PRN = 10; // This satellite is visible } else if (i == 1) { - gnss_synchro.PRN = 20; // This satellite is not visible + gnss_synchro.PRN = 20; // This satellite is not visible } acquisition->set_local_code(); start_queue(); - EXPECT_NO_THROW( { - top_block->run(); // Start threads and wait + EXPECT_NO_THROW({ + top_block->run(); // Start threads and wait }) << "Failure running the top_block."; if (i == 0) - { - std::cout << "Estimated probability of detection = " << Pd << std::endl; - std::cout << "Estimated probability of false alarm (satellite present) = " << Pfa_p << std::endl; - std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds." << std::endl; } + { + std::cout << "Estimated probability of detection = " << Pd << std::endl; + std::cout << "Estimated probability of false alarm (satellite present) = " << Pfa_p << std::endl; + std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds." << std::endl; + } else if (i == 1) - { - std::cout << "Estimated probability of false alarm (satellite absent) = " << Pfa_a << std::endl; - std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds." << std::endl; - } + { + std::cout << "Estimated probability of false alarm (satellite absent) = " << Pfa_a << std::endl; + std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds." << std::endl; + } #ifdef OLD_BOOST - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ ch_thread.timed_join(boost::posix_time::seconds(1)); }) << "Failure while waiting the queue to stop"; #endif #ifndef OLD_BOOST - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ ch_thread.try_join_until(boost::chrono::steady_clock::now() + boost::chrono::milliseconds(50)); }) << "Failure while waiting the queue to stop"; #endif diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_test.cc index f9de000d1..aba931623 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_test.cc @@ -31,7 +31,6 @@ */ - #include #include #include @@ -68,9 +67,10 @@ private: friend GpsL1CaPcpsAcquisitionTest_msg_rx_sptr GpsL1CaPcpsAcquisitionTest_msg_rx_make(); void msg_handler_events(pmt::pmt_t msg); GpsL1CaPcpsAcquisitionTest_msg_rx(); + public: int rx_message; - ~GpsL1CaPcpsAcquisitionTest_msg_rx(); //!< Default destructor + ~GpsL1CaPcpsAcquisitionTest_msg_rx(); //!< Default destructor }; @@ -83,20 +83,19 @@ GpsL1CaPcpsAcquisitionTest_msg_rx_sptr GpsL1CaPcpsAcquisitionTest_msg_rx_make() void GpsL1CaPcpsAcquisitionTest_msg_rx::msg_handler_events(pmt::pmt_t msg) { try - { + { long int message = pmt::to_long(msg); rx_message = message; - } - catch(boost::bad_any_cast& e) - { + } + catch (boost::bad_any_cast &e) + { LOG(WARNING) << "msg_handler_telemetry Bad any cast!"; rx_message = 0; - } + } } -GpsL1CaPcpsAcquisitionTest_msg_rx::GpsL1CaPcpsAcquisitionTest_msg_rx() : - gr::block("GpsL1CaPcpsAcquisitionTest_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0)) +GpsL1CaPcpsAcquisitionTest_msg_rx::GpsL1CaPcpsAcquisitionTest_msg_rx() : gr::block("GpsL1CaPcpsAcquisitionTest_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0)) { this->message_port_register_in(pmt::mp("events")); this->set_msg_handler(pmt::mp("events"), boost::bind(&GpsL1CaPcpsAcquisitionTest_msg_rx::msg_handler_events, this, _1)); @@ -105,12 +104,13 @@ GpsL1CaPcpsAcquisitionTest_msg_rx::GpsL1CaPcpsAcquisitionTest_msg_rx() : GpsL1CaPcpsAcquisitionTest_msg_rx::~GpsL1CaPcpsAcquisitionTest_msg_rx() -{} +{ +} // ########################################################### -class GpsL1CaPcpsAcquisitionTest: public ::testing::Test +class GpsL1CaPcpsAcquisitionTest : public ::testing::Test { protected: GpsL1CaPcpsAcquisitionTest() @@ -124,7 +124,8 @@ protected: } ~GpsL1CaPcpsAcquisitionTest() - {} + { + } void init(); void plot_grid(); @@ -150,7 +151,7 @@ void GpsL1CaPcpsAcquisitionTest::init() config->set_property("Acquisition_1C.implementation", "GPS_L1_CA_PCPS_Acquisition"); config->set_property("Acquisition_1C.item_type", "gr_complex"); config->set_property("Acquisition_1C.coherent_integration_time_ms", "1"); - if(FLAGS_plot_acq_grid == true) + if (FLAGS_plot_acq_grid == true) { config->set_property("Acquisition_1C.dump", "true"); } @@ -173,17 +174,17 @@ void GpsL1CaPcpsAcquisitionTest::plot_grid() std::string basename = "./tmp-acq-gps1/acquisition_G_1C"; unsigned int sat = static_cast(gnss_synchro.PRN); - unsigned int samples_per_code = static_cast(round(4000000 / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS))); // !! + unsigned int samples_per_code = static_cast(round(4000000 / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS))); // !! acquisition_dump_reader acq_dump(basename, sat, doppler_max, doppler_step, samples_per_code); - if(!acq_dump.read_binary_acq()) std::cout << "Error reading files" << std::endl; + if (!acq_dump.read_binary_acq()) std::cout << "Error reading files" << std::endl; std::vector *doppler = &acq_dump.doppler; std::vector *samples = &acq_dump.samples; std::vector > *mag = &acq_dump.mag; const std::string gnuplot_executable(FLAGS_gnuplot_executable); - if(gnuplot_executable.empty()) + if (gnuplot_executable.empty()) { std::cout << "WARNING: Although the flag plot_acq_grid has been set to TRUE," << std::endl; std::cout << "gnuplot has not been found in your system." << std::endl; @@ -193,7 +194,7 @@ void GpsL1CaPcpsAcquisitionTest::plot_grid() { std::cout << "Plotting the acquisition grid. This can take a while..." << std::endl; try - { + { boost::filesystem::path p(gnuplot_executable); boost::filesystem::path dir = p.parent_path(); std::string gnuplot_path = dir.native(); @@ -209,11 +210,11 @@ void GpsL1CaPcpsAcquisitionTest::plot_grid() g1.savetops("GPS_L1_acq_grid"); g1.savetopdf("GPS_L1_acq_grid"); g1.showonscreen(); - } - catch (const GnuplotException & ge) - { + } + catch (const GnuplotException &ge) + { std::cout << ge.what() << std::endl; - } + } } std::string data_str = "./tmp-acq-gps1"; if (boost::filesystem::exists(data_str)) @@ -243,24 +244,23 @@ TEST_F(GpsL1CaPcpsAcquisitionTest, ConnectAndRun) boost::shared_ptr acquisition = boost::make_shared(config.get(), "Acquisition_1C", 1, 1); boost::shared_ptr msg_rx = GpsL1CaPcpsAcquisitionTest_msg_rx_make(); - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->connect(top_block); boost::shared_ptr source = gr::analog::sig_source_c::make(fs_in, gr::analog::GR_SIN_WAVE, 1000, 1, gr_complex(0)); boost::shared_ptr valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue); top_block->connect(source, 0, valve, 0); top_block->connect(valve, 0, acquisition->get_left_block(), 0); top_block->msg_connect(acquisition->get_right_block(), pmt::mp("events"), msg_rx, pmt::mp("events")); - }) << "Failure connecting the blocks of acquisition test."; - EXPECT_NO_THROW( { + EXPECT_NO_THROW({ start = std::chrono::system_clock::now(); - top_block->run(); // Start threads and wait + top_block->run(); // Start threads and wait end = std::chrono::system_clock::now(); elapsed_seconds = end - start; }) << "Failure running the top_block."; - std::cout << "Processed " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; + std::cout << "Processed " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; } @@ -275,7 +275,7 @@ TEST_F(GpsL1CaPcpsAcquisitionTest, ValidationOfResults) init(); - if(FLAGS_plot_acq_grid == true) + if (FLAGS_plot_acq_grid == true) { std::string data_str = "./tmp-acq-gps1"; if (boost::filesystem::exists(data_str)) @@ -288,52 +288,52 @@ TEST_F(GpsL1CaPcpsAcquisitionTest, ValidationOfResults) std::shared_ptr acquisition = std::make_shared(config.get(), "Acquisition_1C", 1, 1); boost::shared_ptr msg_rx = GpsL1CaPcpsAcquisitionTest_msg_rx_make(); - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_channel(1); }) << "Failure setting channel."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_gnss_synchro(&gnss_synchro); }) << "Failure setting gnss_synchro."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_threshold(0.001); }) << "Failure setting threshold."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_doppler_max(doppler_max); }) << "Failure setting doppler_max."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_doppler_step(doppler_step); }) << "Failure setting doppler_step."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->connect(top_block); }) << "Failure connecting acquisition to the top_block."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ std::string path = std::string(TEST_PATH); std::string file = path + "signal_samples/GPS_L1_CA_ID_1_Fs_4Msps_2ms.dat"; - const char * file_name = file.c_str(); + const char *file_name = file.c_str(); gr::blocks::file_source::sptr file_source = gr::blocks::file_source::make(sizeof(gr_complex), file_name, false); top_block->connect(file_source, 0, acquisition->get_left_block(), 0); top_block->msg_connect(acquisition->get_right_block(), pmt::mp("events"), msg_rx, pmt::mp("events")); }) << "Failure connecting the blocks of acquisition test."; acquisition->set_local_code(); - acquisition->set_state(1); // Ensure that acquisition starts at the first sample + acquisition->set_state(1); // Ensure that acquisition starts at the first sample acquisition->init(); - EXPECT_NO_THROW( { + EXPECT_NO_THROW({ start = std::chrono::system_clock::now(); - top_block->run(); // Start threads and wait + top_block->run(); // Start threads and wait end = std::chrono::system_clock::now(); elapsed_seconds = end - start; }) << "Failure running the top_block."; unsigned long int nsamples = gnss_synchro.Acq_samplestamp_samples; - std::cout << "Acquired " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; + std::cout << "Acquired " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; ASSERT_EQ(1, msg_rx->rx_message) << "Acquisition failure. Expected message: 1=ACQ SUCCESS."; double delay_error_samples = std::abs(expected_delay_samples - gnss_synchro.Acq_delay_samples); @@ -343,7 +343,7 @@ TEST_F(GpsL1CaPcpsAcquisitionTest, ValidationOfResults) EXPECT_LE(doppler_error_hz, 666) << "Doppler error exceeds the expected value: 666 Hz = 2/(3*integration period)"; EXPECT_LT(delay_error_chips, 0.5) << "Delay error exceeds the expected value: 0.5 chips"; - if(FLAGS_plot_acq_grid == true) + if (FLAGS_plot_acq_grid == true) { plot_grid(); } diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_test_fpga.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_test_fpga.cc index bae5e5735..10f6d958e 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_test_fpga.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_test_fpga.cc @@ -50,20 +50,20 @@ #include -#define DMA_ACQ_TRANSFER_SIZE 2046 // DMA transfer size for the acquisition -#define RX_SIGNAL_MAX_VALUE 127 // 2^7 - 1 for 8-bit signed values -#define NTIMES_CYCLE_THROUGH_RX_SAMPLES_FILE 50 // number of times we cycle through the file containing the received samples -#define ONE_SECOND 1000000 // one second in microseconds -#define FLOAT_SIZE (sizeof(float)) // size of the float variable in characters +#define DMA_ACQ_TRANSFER_SIZE 2046 // DMA transfer size for the acquisition +#define RX_SIGNAL_MAX_VALUE 127 // 2^7 - 1 for 8-bit signed values +#define NTIMES_CYCLE_THROUGH_RX_SAMPLES_FILE 50 // number of times we cycle through the file containing the received samples +#define ONE_SECOND 1000000 // one second in microseconds +#define FLOAT_SIZE (sizeof(float)) // size of the float variable in characters // thread that reads the file containing the received samples, scales the samples to the dynamic range of the fixed point values, sends // the samples to the DMA and finally it stops the top block void thread_acquisition_send_rx_samples(gr::top_block_sptr top_block, - const char * file_name) + const char *file_name) { - FILE *rx_signal_file; // file descriptor - int file_length; // length of the file containing the received samples - int dma_descr; // DMA descriptor + FILE *rx_signal_file; // file descriptor + int file_length; // length of the file containing the received samples + int dma_descr; // DMA descriptor // sleep for 1 second to give some time to GNSS-SDR to activate the acquisition module. // the acquisition module does not block the RX buffer before activation. @@ -72,15 +72,15 @@ void thread_acquisition_send_rx_samples(gr::top_block_sptr top_block, // we want for the test usleep(ONE_SECOND); - char *buffer_float; // temporary buffer to convert from binary char to float and from float to char - signed char *buffer_DMA; // temporary buffer to store the samples to be sent to the DMA - buffer_float = (char *) malloc(FLOAT_SIZE); // allocate space for the temporary buffer + char *buffer_float; // temporary buffer to convert from binary char to float and from float to char + signed char *buffer_DMA; // temporary buffer to store the samples to be sent to the DMA + buffer_float = (char *)malloc(FLOAT_SIZE); // allocate space for the temporary buffer if (!buffer_float) { fprintf(stderr, "Memory error!"); } - rx_signal_file = fopen(file_name, "rb"); // file containing the received signal + rx_signal_file = fopen(file_name, "rb"); // file containing the received signal if (!rx_signal_file) { printf("Unable to open file!"); @@ -95,7 +95,7 @@ void thread_acquisition_send_rx_samples(gr::top_block_sptr top_block, float max = 0; float *pointer_float; - pointer_float = (float *) &buffer_float[0]; + pointer_float = (float *)&buffer_float[0]; for (int k = 0; k < file_length; k = k + FLOAT_SIZE) { fread(buffer_float, FLOAT_SIZE, 1, rx_signal_file); @@ -111,7 +111,7 @@ void thread_acquisition_send_rx_samples(gr::top_block_sptr top_block, // allocate memory for the samples to be transferred to the DMA - buffer_DMA = (signed char *) malloc(DMA_ACQ_TRANSFER_SIZE); + buffer_DMA = (signed char *)malloc(DMA_ACQ_TRANSFER_SIZE); if (!buffer_DMA) { fprintf(stderr, "Memory error!"); @@ -182,16 +182,17 @@ private: friend GpsL1CaPcpsAcquisitionTest_msg_fpga_rx_sptr GpsL1CaPcpsAcquisitionTestFpga_msg_rx_make(); void msg_handler_events(pmt::pmt_t msg); GpsL1CaPcpsAcquisitionTestFpga_msg_rx(); + public: int rx_message; - ~GpsL1CaPcpsAcquisitionTestFpga_msg_rx(); //!< Default destructor + ~GpsL1CaPcpsAcquisitionTestFpga_msg_rx(); //!< Default destructor }; GpsL1CaPcpsAcquisitionTest_msg_fpga_rx_sptr GpsL1CaPcpsAcquisitionTestFpga_msg_rx_make() { return GpsL1CaPcpsAcquisitionTest_msg_fpga_rx_sptr( - new GpsL1CaPcpsAcquisitionTestFpga_msg_rx()); + new GpsL1CaPcpsAcquisitionTestFpga_msg_rx()); } @@ -202,7 +203,7 @@ void GpsL1CaPcpsAcquisitionTestFpga_msg_rx::msg_handler_events(pmt::pmt_t msg) long int message = pmt::to_long(msg); rx_message = message; } - catch (boost::bad_any_cast& e) + catch (boost::bad_any_cast &e) { LOG(WARNING) << "msg_handler_telemetry Bad any cast!"; rx_message = 0; @@ -210,20 +211,20 @@ void GpsL1CaPcpsAcquisitionTestFpga_msg_rx::msg_handler_events(pmt::pmt_t msg) } -GpsL1CaPcpsAcquisitionTestFpga_msg_rx::GpsL1CaPcpsAcquisitionTestFpga_msg_rx() : - gr::block("GpsL1CaPcpsAcquisitionTestFpga_msg_rx", - gr::io_signature::make(0, 0, 0), - gr::io_signature::make(0, 0, 0)) +GpsL1CaPcpsAcquisitionTestFpga_msg_rx::GpsL1CaPcpsAcquisitionTestFpga_msg_rx() : gr::block("GpsL1CaPcpsAcquisitionTestFpga_msg_rx", + gr::io_signature::make(0, 0, 0), + gr::io_signature::make(0, 0, 0)) { this->message_port_register_in(pmt::mp("events")); this->set_msg_handler(pmt::mp("events"), - boost::bind( &GpsL1CaPcpsAcquisitionTestFpga_msg_rx::msg_handler_events, this, _1)); + boost::bind(&GpsL1CaPcpsAcquisitionTestFpga_msg_rx::msg_handler_events, this, _1)); rx_message = 0; } GpsL1CaPcpsAcquisitionTestFpga_msg_rx::~GpsL1CaPcpsAcquisitionTestFpga_msg_rx() -{} +{ +} class GpsL1CaPcpsAcquisitionTestFpga : public ::testing::Test @@ -238,7 +239,8 @@ protected: } ~GpsL1CaPcpsAcquisitionTestFpga() - {} + { + } void init(); @@ -276,7 +278,7 @@ TEST_F(GpsL1CaPcpsAcquisitionTestFpga, Instantiate) { init(); boost::shared_ptr acquisition = - boost::make_shared(config.get(), "Acquisition_1C", 0, 1); + boost::make_shared(config.get(), "Acquisition_1C", 0, 1); } @@ -290,40 +292,46 @@ TEST_F(GpsL1CaPcpsAcquisitionTestFpga, ValidationOfResults) double expected_doppler_hz = 1680; init(); - std::shared_ptr < GpsL1CaPcpsAcquisitionFpga > acquisition = - std::make_shared < GpsL1CaPcpsAcquisitionFpga > (config.get(), "Acquisition_1C", 0, 1); + std::shared_ptr acquisition = + std::make_shared(config.get(), "Acquisition_1C", 0, 1); boost::shared_ptr msg_rx = GpsL1CaPcpsAcquisitionTestFpga_msg_rx_make(); ASSERT_NO_THROW( - { - acquisition->set_channel(1); - })<< "Failure setting channel."; + { + acquisition->set_channel(1); + }) + << "Failure setting channel."; ASSERT_NO_THROW( - { - acquisition->set_gnss_synchro(&gnss_synchro); - })<< "Failure setting gnss_synchro."; + { + acquisition->set_gnss_synchro(&gnss_synchro); + }) + << "Failure setting gnss_synchro."; ASSERT_NO_THROW( - { - acquisition->set_threshold(0.1); - })<< "Failure setting threshold."; + { + acquisition->set_threshold(0.1); + }) + << "Failure setting threshold."; ASSERT_NO_THROW( - { - acquisition->set_doppler_max(10000); - })<< "Failure setting doppler_max."; + { + acquisition->set_doppler_max(10000); + }) + << "Failure setting doppler_max."; ASSERT_NO_THROW( - { - acquisition->set_doppler_step(250); - })<< "Failure setting doppler_step."; + { + acquisition->set_doppler_step(250); + }) + << "Failure setting doppler_step."; ASSERT_NO_THROW( - { - acquisition->connect(top_block); - })<< "Failure connecting acquisition to the top_block."; + { + acquisition->connect(top_block); + }) + << "Failure connecting acquisition to the top_block."; // uncomment the next line to load the file from the current directory std::string file = "./GPS_L1_CA_ID_1_Fs_4Msps_2ms.dat"; @@ -332,38 +340,39 @@ TEST_F(GpsL1CaPcpsAcquisitionTestFpga, ValidationOfResults) //std::string path = std::string(TEST_PATH); //std::string file = path + "signal_samples/GPS_L1_CA_ID_1_Fs_4Msps_2ms.dat"; - const char * file_name = file.c_str(); + const char *file_name = file.c_str(); ASSERT_NO_THROW( - { - // for the unit test use dummy blocks to make the flowgraph work and allow the acquisition message to be sent. - // in the actual system there is a flowchart running in parallel so this is not needed + { + // for the unit test use dummy blocks to make the flowgraph work and allow the acquisition message to be sent. + // in the actual system there is a flowchart running in parallel so this is not needed - gr::blocks::file_source::sptr file_source = gr::blocks::file_source::make(sizeof(gr_complex), file_name, false); - gr::blocks::null_sink::sptr null_sink = gr::blocks::null_sink::make(sizeof(gr_complex)); - gr::blocks::throttle::sptr throttle_block = gr::blocks::throttle::make(sizeof(gr_complex),1000); + gr::blocks::file_source::sptr file_source = gr::blocks::file_source::make(sizeof(gr_complex), file_name, false); + gr::blocks::null_sink::sptr null_sink = gr::blocks::null_sink::make(sizeof(gr_complex)); + gr::blocks::throttle::sptr throttle_block = gr::blocks::throttle::make(sizeof(gr_complex), 1000); - top_block->connect(file_source, 0, throttle_block, 0); - top_block->connect(throttle_block, 0, null_sink, 0); - top_block->msg_connect(acquisition->get_right_block(), pmt::mp("events"), msg_rx, pmt::mp("events")); - })<< "Failure connecting the blocks of acquisition test." ; + top_block->connect(file_source, 0, throttle_block, 0); + top_block->connect(throttle_block, 0, null_sink, 0); + top_block->msg_connect(acquisition->get_right_block(), pmt::mp("events"), msg_rx, pmt::mp("events")); + }) + << "Failure connecting the blocks of acquisition test."; - acquisition->set_state(1); // Ensure that acquisition starts at the first state + acquisition->set_state(1); // Ensure that acquisition starts at the first state acquisition->init(); - top_block->start(); // Start the top block + top_block->start(); // Start the top block // start thread that sends the DMA samples to the FPGA - boost::thread t3 - { thread_acquisition_send_rx_samples, top_block, file_name }; + boost::thread t3{thread_acquisition_send_rx_samples, top_block, file_name}; EXPECT_NO_THROW( - { - start = std::chrono::system_clock::now(); - acquisition->reset(); // launch the tracking process - top_block->wait(); - end = std::chrono::system_clock::now(); - elapsed_seconds = end - start; - })<< "Failure running the top_block."; + { + start = std::chrono::system_clock::now(); + acquisition->reset(); // launch the tracking process + top_block->wait(); + end = std::chrono::system_clock::now(); + elapsed_seconds = end - start; + }) + << "Failure running the top_block."; t3.join(); @@ -379,4 +388,3 @@ TEST_F(GpsL1CaPcpsAcquisitionTestFpga, ValidationOfResults) EXPECT_LE(doppler_error_hz, 666) << "Doppler error exceeds the expected value: 666 Hz = 2/(3*integration period)"; EXPECT_LT(delay_error_chips, 0.5) << "Delay error exceeds the expected value: 0.5 chips"; } - diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_opencl_acquisition_gsoc2013_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_opencl_acquisition_gsoc2013_test.cc index 7c73877aa..999da2c7e 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_opencl_acquisition_gsoc2013_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_opencl_acquisition_gsoc2013_test.cc @@ -65,9 +65,10 @@ private: void msg_handler_events(pmt::pmt_t msg); GpsL1CaPcpsOpenClAcquisitionGSoC2013Test_msg_rx(concurrent_queue& queue); concurrent_queue& channel_internal_queue; + public: int rx_message; - ~GpsL1CaPcpsOpenClAcquisitionGSoC2013Test_msg_rx(); //!< Default destructor + ~GpsL1CaPcpsOpenClAcquisitionGSoC2013Test_msg_rx(); //!< Default destructor }; @@ -80,21 +81,20 @@ GpsL1CaPcpsOpenClAcquisitionGSoC2013Test_msg_rx_sptr GpsL1CaPcpsOpenClAcquisitio void GpsL1CaPcpsOpenClAcquisitionGSoC2013Test_msg_rx::msg_handler_events(pmt::pmt_t msg) { try - { + { long int message = pmt::to_long(msg); rx_message = message; channel_internal_queue.push(rx_message); - } - catch(boost::bad_any_cast& e) - { + } + catch (boost::bad_any_cast& e) + { LOG(WARNING) << "msg_handler_telemetry Bad any cast!"; rx_message = 0; - } + } } -GpsL1CaPcpsOpenClAcquisitionGSoC2013Test_msg_rx::GpsL1CaPcpsOpenClAcquisitionGSoC2013Test_msg_rx(concurrent_queue& queue) : - gr::block("GpsL1CaPcpsOpenClAcquisitionGSoC2013Test_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0)), channel_internal_queue(queue) +GpsL1CaPcpsOpenClAcquisitionGSoC2013Test_msg_rx::GpsL1CaPcpsOpenClAcquisitionGSoC2013Test_msg_rx(concurrent_queue& queue) : gr::block("GpsL1CaPcpsOpenClAcquisitionGSoC2013Test_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0)), channel_internal_queue(queue) { this->message_port_register_in(pmt::mp("events")); this->set_msg_handler(pmt::mp("events"), boost::bind(&GpsL1CaPcpsOpenClAcquisitionGSoC2013Test_msg_rx::msg_handler_events, this, _1)); @@ -102,12 +102,13 @@ GpsL1CaPcpsOpenClAcquisitionGSoC2013Test_msg_rx::GpsL1CaPcpsOpenClAcquisitionGSo } GpsL1CaPcpsOpenClAcquisitionGSoC2013Test_msg_rx::~GpsL1CaPcpsOpenClAcquisitionGSoC2013Test_msg_rx() -{} +{ +} // ########################################################### -class GpsL1CaPcpsOpenClAcquisitionGSoC2013Test: public ::testing::Test +class GpsL1CaPcpsOpenClAcquisitionGSoC2013Test : public ::testing::Test { protected: GpsL1CaPcpsOpenClAcquisitionGSoC2013Test() @@ -122,7 +123,8 @@ protected: } ~GpsL1CaPcpsOpenClAcquisitionGSoC2013Test() - {} + { + } void init(); void config_1(); @@ -188,14 +190,14 @@ void GpsL1CaPcpsOpenClAcquisitionGSoC2013Test::config_1() gnss_synchro.Channel_ID = 0; gnss_synchro.System = 'G'; std::string signal = "1C"; - signal.copy(gnss_synchro.Signal,2,0); + signal.copy(gnss_synchro.Signal, 2, 0); integration_time_ms = 1; fs_in = 4e6; expected_delay_chips = 600; expected_doppler_hz = 750; - max_doppler_error_hz = 2/(3*integration_time_ms*1e-3); + max_doppler_error_hz = 2 / (3 * integration_time_ms * 1e-3); max_delay_error_chips = 0.50; num_of_realizations = 1; @@ -242,7 +244,7 @@ void GpsL1CaPcpsOpenClAcquisitionGSoC2013Test::config_1() config->set_property("Acquisition_1C.implementation", "GPS_L1_CA_PCPS_OpenCl_Acquisition"); config->set_property("Acquisition_1C.item_type", "gr_complex"); config->set_property("Acquisition_1C.coherent_integration_time_ms", - std::to_string(integration_time_ms)); + std::to_string(integration_time_ms)); config->set_property("Acquisition_1C.max_dwells", "1"); config->set_property("Acquisition_1C.threshold", "0.8"); config->set_property("Acquisition_1C.doppler_max", "10000"); @@ -264,10 +266,10 @@ void GpsL1CaPcpsOpenClAcquisitionGSoC2013Test::config_2() expected_delay_chips = 600; expected_doppler_hz = 750; - max_doppler_error_hz = 2/(3*integration_time_ms*1e-3); + max_doppler_error_hz = 2 / (3 * integration_time_ms * 1e-3); max_delay_error_chips = 0.50; - num_of_realizations = 10; // Change here the number of realizations + num_of_realizations = 10; // Change here the number of realizations config = std::make_shared(); @@ -329,7 +331,7 @@ void GpsL1CaPcpsOpenClAcquisitionGSoC2013Test::config_2() config->set_property("Acquisition_1C.implementation", "GPS_L1_CA_PCPS_OpenCl_Acquisition"); config->set_property("Acquisition_1C.item_type", "gr_complex"); config->set_property("Acquisition.coherent_integration_time_ms", - std::to_string(integration_time_ms)); + std::to_string(integration_time_ms)); config->set_property("Acquisition_1C.max_dwells", "1"); config->set_property("Acquisition_1C.pfa", "0.1"); config->set_property("Acquisition_1C.doppler_max", "10000"); @@ -426,7 +428,7 @@ TEST_F(GpsL1CaPcpsOpenClAcquisitionGSoC2013Test, Instantiate) TEST_F(GpsL1CaPcpsOpenClAcquisitionGSoC2013Test, ConnectAndRun) { - int nsamples = floor(fs_in*integration_time_ms*1e-3); + int nsamples = floor(fs_in * integration_time_ms * 1e-3); std::chrono::time_point start, end; std::chrono::duration elapsed_seconds(0); @@ -434,7 +436,7 @@ TEST_F(GpsL1CaPcpsOpenClAcquisitionGSoC2013Test, ConnectAndRun) acquisition = std::make_shared(config.get(), "Acquisition_1C", 1, 1); boost::shared_ptr msg_rx = GpsL1CaPcpsOpenClAcquisitionGSoC2013Test_msg_rx_make(channel_internal_queue); - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->connect(top_block); boost::shared_ptr source = gr::analog::sig_source_c::make(fs_in, gr::analog::GR_SIN_WAVE, 1000, 1, gr_complex(0)); boost::shared_ptr valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue); @@ -443,14 +445,14 @@ TEST_F(GpsL1CaPcpsOpenClAcquisitionGSoC2013Test, ConnectAndRun) top_block->msg_connect(acquisition->get_right_block(), pmt::mp("events"), msg_rx, pmt::mp("events")); }) << "Failure connecting the blocks of acquisition test."; - EXPECT_NO_THROW( { + EXPECT_NO_THROW({ start = std::chrono::system_clock::now(); - top_block->run(); // Start threads and wait + top_block->run(); // Start threads and wait end = std::chrono::system_clock::now(); elapsed_seconds = end - start; }) << "Failure running the top_block."; - std::cout << "Processed " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; + std::cout << "Processed " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; } @@ -461,33 +463,33 @@ TEST_F(GpsL1CaPcpsOpenClAcquisitionGSoC2013Test, ValidationOfResults) acquisition = std::make_shared(config.get(), "Acquisition", 1, 1); boost::shared_ptr msg_rx = GpsL1CaPcpsOpenClAcquisitionGSoC2013Test_msg_rx_make(channel_internal_queue); - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_channel(1); }) << "Failure setting channel."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_gnss_synchro(&gnss_synchro); }) << "Failure setting gnss_synchro."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_doppler_max(config->property("Acquisition_1C.doppler_max", 10000)); }) << "Failure setting doppler_max."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_doppler_step(config->property("Acquisition_1C.doppler_step", 500)); }) << "Failure setting doppler_step."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_threshold(config->property("Acquisition_1C.threshold", 0.0)); }) << "Failure setting threshold."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->connect(top_block); }) << "Failure connecting acquisition to the top_block."; acquisition->init(); - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ boost::shared_ptr signal_source; SignalGenerator* signal_generator = new SignalGenerator(config.get(), "SignalSource", 0, 1, queue); FirFilter* filter = new FirFilter(config.get(), "InputFilter", 1, 1); @@ -505,34 +507,33 @@ TEST_F(GpsL1CaPcpsOpenClAcquisitionGSoC2013Test, ValidationOfResults) if (i == 0) { - gnss_synchro.PRN = 10; // This satellite is visible + gnss_synchro.PRN = 10; // This satellite is visible } else if (i == 1) { - gnss_synchro.PRN = 20; // This satellite is not visible + gnss_synchro.PRN = 20; // This satellite is not visible } acquisition->set_local_code(); start_queue(); - EXPECT_NO_THROW( { - top_block->run(); // Start threads and wait + EXPECT_NO_THROW({ + top_block->run(); // Start threads and wait }) << "Failure running the top_block."; if (i == 0) - { - EXPECT_EQ(1, message) << "Acquisition failure. Expected message: 1=ACQ SUCCESS."; - if (message == 1) - { - EXPECT_EQ((static_cast(1), correct_estimation_counter) << "Acquisition failure. Incorrect parameters estimation."; - } - - } + { + EXPECT_EQ(1, message) << "Acquisition failure. Expected message: 1=ACQ SUCCESS."; + if (message == 1) + { + EXPECT_EQ(static_cast(1), correct_estimation_counter) << "Acquisition failure. Incorrect parameters estimation."; + } + } else if (i == 1) - { - EXPECT_EQ(2, message) << "Acquisition failure. Expected message: 2=ACQ FAIL."; - } + { + EXPECT_EQ(2, message) << "Acquisition failure. Expected message: 2=ACQ FAIL."; + } } } @@ -544,33 +545,33 @@ TEST_F(GpsL1CaPcpsOpenClAcquisitionGSoC2013Test, ValidationOfResultsProbabilitie acquisition = std::make_shared(config.get(), "Acquisition_1C", 1, 1); boost::shared_ptr msg_rx = GpsL1CaPcpsOpenClAcquisitionGSoC2013Test_msg_rx_make(channel_internal_queue); - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_channel(1); }) << "Failure setting channel."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_gnss_synchro(&gnss_synchro); }) << "Failure setting gnss_synchro."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_doppler_max(config->property("Acquisition_1C.doppler_max", 10000)); }) << "Failure setting doppler_max."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_doppler_step(config->property("Acquisition_1C.doppler_step", 500)); }) << "Failure setting doppler_step."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_threshold(config->property("Acquisition_1C.threshold", 0.0)); }) << "Failure setting threshold."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->connect(top_block); }) << "Failure connecting acquisition to the top_block."; acquisition->init(); - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ boost::shared_ptr signal_source; SignalGenerator* signal_generator = new SignalGenerator(config.get(), "SignalSource", 0, 1, queue); FirFilter* filter = new FirFilter(config.get(), "InputFilter", 1, 1); @@ -590,31 +591,31 @@ TEST_F(GpsL1CaPcpsOpenClAcquisitionGSoC2013Test, ValidationOfResultsProbabilitie if (i == 0) { - gnss_synchro.PRN = 10; // This satellite is visible + gnss_synchro.PRN = 10; // This satellite is visible } else if (i == 1) { - gnss_synchro.PRN = 20; // This satellite is not visible + gnss_synchro.PRN = 20; // This satellite is not visible } acquisition->set_local_code(); start_queue(); - EXPECT_NO_THROW( { - top_block->run(); // Start threads and wait + EXPECT_NO_THROW({ + top_block->run(); // Start threads and wait }) << "Failure running the top_block."; if (i == 0) - { - std::cout << "Estimated probability of detection = " << Pd << std::endl; - std::cout << "Estimated probability of false alarm (satellite present) = " << Pfa_p << std::endl; - std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds." << std::endl; - } + { + std::cout << "Estimated probability of detection = " << Pd << std::endl; + std::cout << "Estimated probability of false alarm (satellite present) = " << Pfa_p << std::endl; + std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds." << std::endl; + } else if (i == 1) - { - std::cout << "Estimated probability of false alarm (satellite absent) = " << Pfa_a << std::endl; - std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds." << std::endl; - } + { + std::cout << "Estimated probability of false alarm (satellite absent) = " << Pfa_a << std::endl; + std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds." << std::endl; + } } } diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_quicksync_acquisition_gsoc2014_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_quicksync_acquisition_gsoc2014_test.cc index 761b8b2fa..271554a3a 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_quicksync_acquisition_gsoc2014_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_quicksync_acquisition_gsoc2014_test.cc @@ -31,7 +31,6 @@ */ - #include #include #include @@ -71,9 +70,10 @@ private: void msg_handler_events(pmt::pmt_t msg); GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test_msg_rx(concurrent_queue& queue); concurrent_queue& channel_internal_queue; + public: int rx_message; - ~GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test_msg_rx(); //!< Default destructor + ~GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test_msg_rx(); //!< Default destructor }; @@ -86,21 +86,20 @@ GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test_msg_rx_sptr GpsL1CaPcpsQuickSyncAcqu void GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test_msg_rx::msg_handler_events(pmt::pmt_t msg) { try - { + { long int message = pmt::to_long(msg); rx_message = message; channel_internal_queue.push(rx_message); - } - catch(boost::bad_any_cast& e) - { + } + catch (boost::bad_any_cast& e) + { LOG(WARNING) << "msg_handler_telemetry Bad any cast!"; rx_message = 0; - } + } } -GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test_msg_rx::GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test_msg_rx(concurrent_queue& queue) : - gr::block("GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0)), channel_internal_queue(queue) +GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test_msg_rx::GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test_msg_rx(concurrent_queue& queue) : gr::block("GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0)), channel_internal_queue(queue) { this->message_port_register_in(pmt::mp("events")); this->set_msg_handler(pmt::mp("events"), boost::bind(&GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test_msg_rx::msg_handler_events, this, _1)); @@ -109,25 +108,27 @@ GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test_msg_rx::GpsL1CaPcpsQuickSyncAcquisit GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test_msg_rx::~GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test_msg_rx() -{} +{ +} // ########################################################### -class GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test: public ::testing::Test +class GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test : public ::testing::Test { protected: GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test() -{ + { factory = std::make_shared(); item_size = sizeof(gr_complex); stop = false; message = 0; gnss_synchro = Gnss_Synchro(); -} + } ~GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test() - {} + { + } void init(); void config_1(); @@ -204,14 +205,14 @@ void GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test::config_1() gnss_synchro.Channel_ID = 0; gnss_synchro.System = 'G'; std::string signal = "1C"; - signal.copy(gnss_synchro.Signal,2,0); + signal.copy(gnss_synchro.Signal, 2, 0); integration_time_ms = 4; fs_in = 8e6; expected_delay_chips = 600; expected_doppler_hz = 750; - max_doppler_error_hz = 2/(3*integration_time_ms*1e-3); + max_doppler_error_hz = 2 / (3 * integration_time_ms * 1e-3); max_delay_error_chips = 0.50; num_of_realizations = 1; @@ -257,7 +258,7 @@ void GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test::config_1() config->set_property("Acquisition_1C.implementation", "GPS_L1_CA_PCPS_QuickSync_Acquisition"); config->set_property("Acquisition_1C.item_type", "gr_complex"); config->set_property("Acquisition_1C.coherent_integration_time_ms", - std::to_string(integration_time_ms)); + std::to_string(integration_time_ms)); config->set_property("Acquisition_1C.max_dwells", "1"); config->set_property("Acquisition_1C.threshold", "250"); config->set_property("Acquisition_1C.doppler_max", "10000"); @@ -272,20 +273,20 @@ void GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test::config_2() gnss_synchro.Channel_ID = 0; gnss_synchro.System = 'G'; std::string signal = "1C"; - signal.copy(gnss_synchro.Signal,2,0); + signal.copy(gnss_synchro.Signal, 2, 0); integration_time_ms = 4; fs_in = 8e6; expected_delay_chips = 600; expected_doppler_hz = 750; - max_doppler_error_hz = 2/(3*integration_time_ms*1e-3); + max_doppler_error_hz = 2 / (3 * integration_time_ms * 1e-3); max_delay_error_chips = 0.50; - + /*Unset this flag to eliminates data logging for the Validation of results probabilities test*/ dump_test_results = false; - + num_of_realizations = 100; config = std::make_shared(); @@ -348,7 +349,7 @@ void GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test::config_2() config->set_property("Acquisition_1C.implementation", "GPS_L1_CA_PCPS_QuickSync_Acquisition"); config->set_property("Acquisition_1C.item_type", "gr_complex"); config->set_property("Acquisition_1C.coherent_integration_time_ms", - std::to_string(integration_time_ms)); + std::to_string(integration_time_ms)); config->set_property("Acquisition_1C.max_dwells", "1"); config->set_property("Acquisition_1C.threshold", std::to_string(FLAGS_value_threshold)); config->set_property("Acquisition_1C.doppler_max", "10000"); @@ -363,20 +364,20 @@ void GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test::config_3() gnss_synchro.Channel_ID = 0; gnss_synchro.System = 'G'; std::string signal = "1C"; - signal.copy(gnss_synchro.Signal,2,0); + signal.copy(gnss_synchro.Signal, 2, 0); integration_time_ms = 4; fs_in = 4e6; expected_delay_chips = 600; expected_doppler_hz = 750; - max_doppler_error_hz = 2/(3*integration_time_ms*1e-3); + max_doppler_error_hz = 2 / (3 * integration_time_ms * 1e-3); max_delay_error_chips = 0.50; - + /*Unset this flag to eliminates data logging for the Validation of results probabilities test*/ dump_test_results = true; - + num_of_realizations = 1; config = std::make_shared(); @@ -439,7 +440,7 @@ void GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test::config_3() config->set_property("Acquisition_1C.implementation", "GPS_L1_CA_PCPS_QuickSync_Acquisition"); config->set_property("Acquisition_1C.item_type", "gr_complex"); config->set_property("Acquisition_1C.coherent_integration_time_ms", - std::to_string(integration_time_ms)); + std::to_string(integration_time_ms)); config->set_property("Acquisition_1C.max_dwells", "2"); config->set_property("Acquisition_1C.threshold", "0.01"); config->set_property("Acquisition_1C.doppler_max", "10000"); @@ -497,7 +498,7 @@ void GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test::process_message() correct_estimation_counter++; } } - else if(message == 2 && gnss_synchro.PRN == 10) + else if (message == 2 && gnss_synchro.PRN == 10) { miss_detection_counter++; } @@ -549,7 +550,7 @@ TEST_F(GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test, ConnectAndRun) config_1(); acquisition = std::make_shared(config.get(), "Acquisition_1C", 1, 1); - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->connect(top_block); boost::shared_ptr source = gr::analog::sig_source_c::make(fs_in, gr::analog::GR_SIN_WAVE, 1000, 1, gr_complex(0)); boost::shared_ptr valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue); @@ -558,14 +559,14 @@ TEST_F(GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test, ConnectAndRun) top_block->msg_connect(acquisition->get_right_block(), pmt::mp("events"), msg_rx, pmt::mp("events")); }) << "Failure connecting the blocks of acquisition test."; - EXPECT_NO_THROW( { + EXPECT_NO_THROW({ start = std::chrono::system_clock::now(); - top_block->run(); // Start threads and wait + top_block->run(); // Start threads and wait end = std::chrono::system_clock::now(); elapsed_seconds = end - start; }) << "Failure running the top_block."; - std::cout << "Processed " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; + std::cout << "Processed " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; } @@ -577,34 +578,34 @@ TEST_F(GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test, ValidationOfResults) acquisition = std::make_shared(config.get(), "Acquisition_1C", 1, 1); boost::shared_ptr msg_rx = GpsL1CaPcpsAcquisitionGSoC2013Test_msg_rx_make(channel_internal_queue); - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_channel(1); }) << "Failure setting channel."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_gnss_synchro(&gnss_synchro); }) << "Failure setting gnss_synchro."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_doppler_max(10000); }) << "Failure setting doppler_max."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_doppler_step(250); }) << "Failure setting doppler_step."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_threshold(100); }) << "Failure setting threshold."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->connect(top_block); }) << "Failure connecting acquisition to the top_block."; acquisition->init(); acquisition->reset(); - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ boost::shared_ptr signal_source; SignalGenerator* signal_generator = new SignalGenerator(config.get(), "SignalSource", 0, 1, queue); FirFilter* filter = new FirFilter(config.get(), "InputFilter", 1, 1); @@ -623,11 +624,11 @@ TEST_F(GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test, ValidationOfResults) if (i == 0) { - gnss_synchro.PRN = 10; // This satellite is visible + gnss_synchro.PRN = 10; // This satellite is visible } else if (i == 1) { - gnss_synchro.PRN = 20; // This satellite is not visible + gnss_synchro.PRN = 20; // This satellite is not visible } acquisition->reset(); @@ -636,8 +637,8 @@ TEST_F(GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test, ValidationOfResults) acquisition->set_state(1); start_queue(); - EXPECT_NO_THROW( { - top_block->run(); // Start threads and wait + EXPECT_NO_THROW({ + top_block->run(); // Start threads and wait }) << "Failure running the top_block."; stop_queue(); @@ -671,34 +672,34 @@ TEST_F(GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test, ValidationOfResultsWithNoise acquisition = std::make_shared(config.get(), "Acquisition_1C", 1, 1); boost::shared_ptr msg_rx = GpsL1CaPcpsAcquisitionGSoC2013Test_msg_rx_make(channel_internal_queue); - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_channel(1); }) << "Failure setting channel."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_gnss_synchro(&gnss_synchro); }) << "Failure setting gnss_synchro."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_doppler_max(10000); }) << "Failure setting doppler_max."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_doppler_step(250); }) << "Failure setting doppler_step."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_threshold(100); }) << "Failure setting threshold."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->connect(top_block); }) << "Failure connecting acquisition to the top_block."; acquisition->init(); acquisition->reset(); - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ boost::shared_ptr signal_source; SignalGenerator* signal_generator = new SignalGenerator(config.get(), "SignalSource", 0, 1, queue); FirFilter* filter = new FirFilter(config.get(), "InputFilter", 1, 1); @@ -717,11 +718,11 @@ TEST_F(GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test, ValidationOfResultsWithNoise if (i == 0) { - gnss_synchro.PRN = 10; // This satellite is visible + gnss_synchro.PRN = 10; // This satellite is visible } else if (i == 1) { - gnss_synchro.PRN = 20; // This satellite is not visible + gnss_synchro.PRN = 20; // This satellite is not visible } //acquisition->set_local_code(); acquisition->reset(); @@ -730,8 +731,8 @@ TEST_F(GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test, ValidationOfResultsWithNoise acquisition->set_state(1); start_queue(); - EXPECT_NO_THROW( { - top_block->run(); // Start threads and wait + EXPECT_NO_THROW({ + top_block->run(); // Start threads and wait }) << "Failure running the top_block."; stop_queue(); @@ -741,9 +742,8 @@ TEST_F(GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test, ValidationOfResultsWithNoise EXPECT_EQ(1, message) << "Acquisition failure. Expected message: 1=ACQ SUCCESS."; if (message == 1) { - EXPECT_EQ(static_cast(1), correct_estimation_counter) << "Acquisition failure. Incorrect parameters estimation."; + EXPECT_EQ(static_cast(1), correct_estimation_counter) << "Acquisition failure. Incorrect parameters estimation."; } - } else if (i == 1) { @@ -763,22 +763,22 @@ TEST_F(GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test, ValidationOfResultsProbabili acquisition = std::make_shared(config.get(), "Acquisition_1C", 1, 1); boost::shared_ptr msg_rx = GpsL1CaPcpsAcquisitionGSoC2013Test_msg_rx_make(channel_internal_queue); - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_channel(1); }) << "Failure setting channel."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_gnss_synchro(&gnss_synchro); }) << "Failure setting gnss_synchro."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->connect(top_block); }) << "Failure connecting acquisition to the top_block."; acquisition->init(); acquisition->reset(); - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ boost::shared_ptr signal_source; SignalGenerator* signal_generator = new SignalGenerator(config.get(), "SignalSource", 0, 1, queue); FirFilter* filter = new FirFilter(config.get(), "InputFilter", 1, 1); @@ -798,11 +798,11 @@ TEST_F(GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test, ValidationOfResultsProbabili if (i == 0) { - gnss_synchro.PRN = 10; // This satellite is visible + gnss_synchro.PRN = 10; // This satellite is visible } else if (i == 1) { - gnss_synchro.PRN = 20; // This satellite is not visible + gnss_synchro.PRN = 20; // This satellite is not visible } acquisition->reset(); @@ -811,8 +811,8 @@ TEST_F(GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test, ValidationOfResultsProbabili acquisition->set_state(1); start_queue(); - EXPECT_NO_THROW( { - top_block->run(); // Start threads and wait + EXPECT_NO_THROW({ + top_block->run(); // Start threads and wait }) << "Failure running the top_block."; stop_queue(); @@ -824,13 +824,13 @@ TEST_F(GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test, ValidationOfResultsProbabili std::cout << "Estimated probability of miss detection (satellite present) = " << Pmd << std::endl; std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds." << std::endl; - if(dump_test_results) + if (dump_test_results) { std::stringstream filenamepd; filenamepd.str(""); filenamepd << "../data/test_statistics_" << gnss_synchro.System << "_" << gnss_synchro.Signal << "_sat_" - << gnss_synchro.PRN << "CN0_dB_0_" << FLAGS_value_CN0_dB_0 << "_dBHz.csv"; + << gnss_synchro.PRN << "CN0_dB_0_" << FLAGS_value_CN0_dB_0 << "_dBHz.csv"; pdpfafile.open(filenamepd.str().c_str(), std::ios::app | std::ios::out); pdpfafile << FLAGS_value_threshold << "," << Pd << "," << Pfa_p << "," << Pmd << std::endl; @@ -842,13 +842,13 @@ TEST_F(GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test, ValidationOfResultsProbabili std::cout << "Estimated probability of false alarm (satellite absent) = " << Pfa_a << std::endl; std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds." << std::endl; - if(dump_test_results) + if (dump_test_results) { std::stringstream filenamepf; filenamepf.str(""); filenamepf << "../data/test_statistics_" << gnss_synchro.System << "_" << gnss_synchro.Signal << "_sat_" - << gnss_synchro.PRN << "CN0_dB_0_" << FLAGS_value_CN0_dB_0 << "_dBHz.csv"; + << gnss_synchro.PRN << "CN0_dB_0_" << FLAGS_value_CN0_dB_0 << "_dBHz.csv"; pdpfafile.open(filenamepf.str().c_str(), std::ios::app | std::ios::out); pdpfafile << FLAGS_value_threshold << "," << Pfa_a << std::endl; diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_tong_acquisition_gsoc2013_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_tong_acquisition_gsoc2013_test.cc index 6ecc2da52..d61961d9e 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_tong_acquisition_gsoc2013_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_tong_acquisition_gsoc2013_test.cc @@ -31,7 +31,6 @@ */ - #include #include #include @@ -67,9 +66,10 @@ private: void msg_handler_events(pmt::pmt_t msg); GpsL1CaPcpsTongAcquisitionGSoC2013Test_msg_rx(concurrent_queue& queue); concurrent_queue& channel_internal_queue; + public: int rx_message; - ~GpsL1CaPcpsTongAcquisitionGSoC2013Test_msg_rx(); //!< Default destructor + ~GpsL1CaPcpsTongAcquisitionGSoC2013Test_msg_rx(); //!< Default destructor }; @@ -82,21 +82,20 @@ GpsL1CaPcpsTongAcquisitionGSoC2013Test_msg_rx_sptr GpsL1CaPcpsTongAcquisitionGSo void GpsL1CaPcpsTongAcquisitionGSoC2013Test_msg_rx::msg_handler_events(pmt::pmt_t msg) { try - { + { long int message = pmt::to_long(msg); rx_message = message; channel_internal_queue.push(rx_message); - } - catch(boost::bad_any_cast& e) - { + } + catch (boost::bad_any_cast& e) + { LOG(WARNING) << "msg_handler_telemetry Bad any cast!"; rx_message = 0; - } + } } -GpsL1CaPcpsTongAcquisitionGSoC2013Test_msg_rx::GpsL1CaPcpsTongAcquisitionGSoC2013Test_msg_rx(concurrent_queue& queue) : - gr::block("GpsL1CaPcpsTongAcquisitionGSoC2013Test_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0)), channel_internal_queue(queue) +GpsL1CaPcpsTongAcquisitionGSoC2013Test_msg_rx::GpsL1CaPcpsTongAcquisitionGSoC2013Test_msg_rx(concurrent_queue& queue) : gr::block("GpsL1CaPcpsTongAcquisitionGSoC2013Test_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0)), channel_internal_queue(queue) { this->message_port_register_in(pmt::mp("events")); this->set_msg_handler(pmt::mp("events"), boost::bind(&GpsL1CaPcpsTongAcquisitionGSoC2013Test_msg_rx::msg_handler_events, this, _1)); @@ -104,12 +103,13 @@ GpsL1CaPcpsTongAcquisitionGSoC2013Test_msg_rx::GpsL1CaPcpsTongAcquisitionGSoC201 } GpsL1CaPcpsTongAcquisitionGSoC2013Test_msg_rx::~GpsL1CaPcpsTongAcquisitionGSoC2013Test_msg_rx() -{} +{ +} // ########################################################### -class GpsL1CaPcpsTongAcquisitionGSoC2013Test: public ::testing::Test +class GpsL1CaPcpsTongAcquisitionGSoC2013Test : public ::testing::Test { protected: GpsL1CaPcpsTongAcquisitionGSoC2013Test() @@ -188,14 +188,14 @@ void GpsL1CaPcpsTongAcquisitionGSoC2013Test::config_1() gnss_synchro.Channel_ID = 0; gnss_synchro.System = 'G'; std::string signal = "1C"; - signal.copy(gnss_synchro.Signal,2,0); + signal.copy(gnss_synchro.Signal, 2, 0); integration_time_ms = 1; fs_in = 4e6; expected_delay_chips = 600; expected_doppler_hz = 750; - max_doppler_error_hz = 2/(3*integration_time_ms*1e-3); + max_doppler_error_hz = 2 / (3 * integration_time_ms * 1e-3); max_delay_error_chips = 0.50; num_of_realizations = 1; @@ -242,7 +242,7 @@ void GpsL1CaPcpsTongAcquisitionGSoC2013Test::config_1() config->set_property("Acquisition_1C.implementation", "GPS_L1_CA_PCPS_Tong_Acquisition"); config->set_property("Acquisition_1C.item_type", "gr_complex"); config->set_property("Acquisition_1C.coherent_integration_time_ms", - std::to_string(integration_time_ms)); + std::to_string(integration_time_ms)); config->set_property("Acquisition_1C.threshold", "0.8"); config->set_property("Acquisition_1C.tong_init_val", "1"); config->set_property("Acquisition_1C.tong_max_val", "8"); @@ -257,14 +257,14 @@ void GpsL1CaPcpsTongAcquisitionGSoC2013Test::config_2() gnss_synchro.Channel_ID = 0; gnss_synchro.System = 'G'; std::string signal = "1C"; - signal.copy(gnss_synchro.Signal,2,0); + signal.copy(gnss_synchro.Signal, 2, 0); integration_time_ms = 1; fs_in = 4e6; expected_delay_chips = 600; expected_doppler_hz = 750; - max_doppler_error_hz = 2/(3*integration_time_ms*1e-3); + max_doppler_error_hz = 2 / (3 * integration_time_ms * 1e-3); max_delay_error_chips = 0.50; num_of_realizations = 100; @@ -329,8 +329,8 @@ void GpsL1CaPcpsTongAcquisitionGSoC2013Test::config_2() config->set_property("Acquisition_1C.implementation", "GPS_L1_CA_PCPS_Tong_Acquisition"); config->set_property("Acquisition_1C.item_type", "gr_complex"); config->set_property("Acquisition_1C.coherent_integration_time_ms", - std::to_string(integration_time_ms)); - config->set_property("Acquisition_1C.threshold", "0.00108"); // Pfa,a = 0.1 + std::to_string(integration_time_ms)); + config->set_property("Acquisition_1C.threshold", "0.00108"); // Pfa,a = 0.1 config->set_property("Acquisition_1C.tong_init_val", "1"); config->set_property("Acquisition_1C.tong_max_val", "8"); config->set_property("Acquisition_1C.doppler_max", "10000"); @@ -425,7 +425,7 @@ TEST_F(GpsL1CaPcpsTongAcquisitionGSoC2013Test, Instantiate) TEST_F(GpsL1CaPcpsTongAcquisitionGSoC2013Test, ConnectAndRun) { - int nsamples = floor(fs_in*integration_time_ms*1e-3); + int nsamples = floor(fs_in * integration_time_ms * 1e-3); std::chrono::time_point start, end; std::chrono::duration elapsed_seconds(0); top_block = gr::make_top_block("Acquisition test"); @@ -435,7 +435,7 @@ TEST_F(GpsL1CaPcpsTongAcquisitionGSoC2013Test, ConnectAndRun) acquisition = std::make_shared(config.get(), "Acquisition_1C", 1, 1); boost::shared_ptr msg_rx = GpsL1CaPcpsTongAcquisitionGSoC2013Test_msg_rx_make(channel_internal_queue); - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->connect(top_block); boost::shared_ptr source = gr::analog::sig_source_c::make(fs_in, gr::analog::GR_SIN_WAVE, 1000, 1, gr_complex(0)); boost::shared_ptr valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue); @@ -444,14 +444,14 @@ TEST_F(GpsL1CaPcpsTongAcquisitionGSoC2013Test, ConnectAndRun) top_block->msg_connect(acquisition->get_right_block(), pmt::mp("events"), msg_rx, pmt::mp("events")); }) << "Failure connecting the blocks of acquisition test."; - EXPECT_NO_THROW( { + EXPECT_NO_THROW({ start = std::chrono::system_clock::now(); - top_block->run(); // Start threads and wait + top_block->run(); // Start threads and wait end = std::chrono::system_clock::now(); elapsed_seconds = end - start; }) << "Failure running the top_block."; - std::cout << "Processed " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; + std::cout << "Processed " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; } @@ -464,33 +464,33 @@ TEST_F(GpsL1CaPcpsTongAcquisitionGSoC2013Test, ValidationOfResults) acquisition = std::make_shared(config.get(), "Acquisition_1C", 1, 1); boost::shared_ptr msg_rx = GpsL1CaPcpsTongAcquisitionGSoC2013Test_msg_rx_make(channel_internal_queue); - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_channel(1); }) << "Failure setting channel."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_gnss_synchro(&gnss_synchro); }) << "Failure setting gnss_synchro."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_doppler_max(config->property("Acquisition_1C.doppler_max", 10000)); }) << "Failure setting doppler_max."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_doppler_step(config->property("Acquisition_1C.doppler_step", 500)); }) << "Failure setting doppler_step."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_threshold(config->property("Acquisition_1C.threshold", 0.0)); }) << "Failure setting threshold."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->connect(top_block); }) << "Failure connecting acquisition to the top_block."; acquisition->init(); - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ boost::shared_ptr signal_source; SignalGenerator* signal_generator = new SignalGenerator(config.get(), "SignalSource", 0, 1, queue); FirFilter* filter = new FirFilter(config.get(), "InputFilter", 1, 1); @@ -508,11 +508,11 @@ TEST_F(GpsL1CaPcpsTongAcquisitionGSoC2013Test, ValidationOfResults) if (i == 0) { - gnss_synchro.PRN = 10; // This satellite is visible + gnss_synchro.PRN = 10; // This satellite is visible } else if (i == 1) { - gnss_synchro.PRN = 20; // This satellite is not visible + gnss_synchro.PRN = 20; // This satellite is not visible } acquisition->set_local_code(); @@ -520,24 +520,24 @@ TEST_F(GpsL1CaPcpsTongAcquisitionGSoC2013Test, ValidationOfResults) start_queue(); - EXPECT_NO_THROW( { - top_block->run(); // Start threads and wait + EXPECT_NO_THROW({ + top_block->run(); // Start threads and wait }) << "Failure running the top_block."; stop_queue(); if (i == 0) - { - EXPECT_EQ(1, message) << "Acquisition failure. Expected message: 1=ACQ SUCCESS."; - if (message == 1) - { - EXPECT_EQ(static_cast(1), correct_estimation_counter) << "Acquisition failure. Incorrect parameters estimation."; - } - } + { + EXPECT_EQ(1, message) << "Acquisition failure. Expected message: 1=ACQ SUCCESS."; + if (message == 1) + { + EXPECT_EQ(static_cast(1), correct_estimation_counter) << "Acquisition failure. Incorrect parameters estimation."; + } + } else if (i == 1) - { - EXPECT_EQ(2, message) << "Acquisition failure. Expected message: 2=ACQ FAIL."; - } + { + EXPECT_EQ(2, message) << "Acquisition failure. Expected message: 2=ACQ FAIL."; + } ch_thread.join(); } @@ -552,33 +552,33 @@ TEST_F(GpsL1CaPcpsTongAcquisitionGSoC2013Test, ValidationOfResultsProbabilities) acquisition = std::make_shared(config.get(), "Acquisition_1C", 1, 1); boost::shared_ptr msg_rx = GpsL1CaPcpsTongAcquisitionGSoC2013Test_msg_rx_make(channel_internal_queue); - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_channel(1); }) << "Failure setting channel."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_gnss_synchro(&gnss_synchro); }) << "Failure setting gnss_synchro."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_doppler_max(config->property("Acquisition_1C.doppler_max", 10000)); }) << "Failure setting doppler_max."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_doppler_step(config->property("Acquisition_1C.doppler_step", 500)); }) << "Failure setting doppler_step."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_threshold(config->property("Acquisition_1C.threshold", 0.0)); }) << "Failure setting threshold."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->connect(top_block); }) << "Failure connecting acquisition to the top_block."; acquisition->init(); - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ boost::shared_ptr signal_source; SignalGenerator* signal_generator = new SignalGenerator(config.get(), "SignalSource", 0, 1, queue); FirFilter* filter = new FirFilter(config.get(), "InputFilter", 1, 1); @@ -598,34 +598,34 @@ TEST_F(GpsL1CaPcpsTongAcquisitionGSoC2013Test, ValidationOfResultsProbabilities) if (i == 0) { - gnss_synchro.PRN = 10; // This satellite is visible + gnss_synchro.PRN = 10; // This satellite is visible } else if (i == 1) { - gnss_synchro.PRN = 20; // This satellite is not visible + gnss_synchro.PRN = 20; // This satellite is not visible } acquisition->set_local_code(); acquisition->set_state(1); start_queue(); - EXPECT_NO_THROW( { - top_block->run(); // Start threads and wait + EXPECT_NO_THROW({ + top_block->run(); // Start threads and wait }) << "Failure running the top_block."; stop_queue(); if (i == 0) - { - std::cout << "Estimated probability of detection = " << Pd << std::endl; - std::cout << "Estimated probability of false alarm (satellite present) = " << Pfa_p << std::endl; - std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds." << std::endl; - } + { + std::cout << "Estimated probability of detection = " << Pd << std::endl; + std::cout << "Estimated probability of false alarm (satellite present) = " << Pfa_p << std::endl; + std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds." << std::endl; + } else if (i == 1) - { - std::cout << "Estimated probability of false alarm (satellite absent) = " << Pfa_a << std::endl; - std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds." << std::endl; - } + { + std::cout << "Estimated probability of false alarm (satellite absent) = " << Pfa_a << std::endl; + std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds." << std::endl; + } ch_thread.join(); } } diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l2_m_pcps_acquisition_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l2_m_pcps_acquisition_test.cc index 7062f8e17..c5b14fd0c 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l2_m_pcps_acquisition_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l2_m_pcps_acquisition_test.cc @@ -31,7 +31,6 @@ */ - #include #include #include @@ -72,7 +71,7 @@ private: public: int rx_message; - ~GpsL2MPcpsAcquisitionTest_msg_rx(); //!< Default destructor + ~GpsL2MPcpsAcquisitionTest_msg_rx(); //!< Default destructor }; GpsL2MPcpsAcquisitionTest_msg_rx_sptr GpsL2MPcpsAcquisitionTest_msg_rx_make() @@ -83,19 +82,18 @@ GpsL2MPcpsAcquisitionTest_msg_rx_sptr GpsL2MPcpsAcquisitionTest_msg_rx_make() void GpsL2MPcpsAcquisitionTest_msg_rx::msg_handler_events(pmt::pmt_t msg) { try - { + { long int message = pmt::to_long(msg); rx_message = message; - } - catch(boost::bad_any_cast& e) - { + } + catch (boost::bad_any_cast &e) + { LOG(WARNING) << "msg_handler_telemetry Bad any cast!"; rx_message = 0; - } + } } -GpsL2MPcpsAcquisitionTest_msg_rx::GpsL2MPcpsAcquisitionTest_msg_rx() : - gr::block("GpsL2MPcpsAcquisitionTest_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0)) +GpsL2MPcpsAcquisitionTest_msg_rx::GpsL2MPcpsAcquisitionTest_msg_rx() : gr::block("GpsL2MPcpsAcquisitionTest_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0)) { this->message_port_register_in(pmt::mp("events")); this->set_msg_handler(pmt::mp("events"), boost::bind(&GpsL2MPcpsAcquisitionTest_msg_rx::msg_handler_events, this, _1)); @@ -103,12 +101,13 @@ GpsL2MPcpsAcquisitionTest_msg_rx::GpsL2MPcpsAcquisitionTest_msg_rx() : } GpsL2MPcpsAcquisitionTest_msg_rx::~GpsL2MPcpsAcquisitionTest_msg_rx() -{} +{ +} // ########################################################### -class GpsL2MPcpsAcquisitionTest: public ::testing::Test +class GpsL2MPcpsAcquisitionTest : public ::testing::Test { protected: GpsL2MPcpsAcquisitionTest() @@ -124,7 +123,8 @@ protected: } ~GpsL2MPcpsAcquisitionTest() - {} + { + } void init(); void plot_grid(); @@ -147,15 +147,15 @@ void GpsL2MPcpsAcquisitionTest::init() gnss_synchro.Channel_ID = 0; gnss_synchro.System = 'G'; std::string signal = "2S"; - std::memcpy(static_cast(gnss_synchro.Signal), signal.c_str(), 3); // copy string into synchro char array: 2 char + null - gnss_synchro.Signal[2] = 0; // make sure that string length is only two characters + std::memcpy(static_cast(gnss_synchro.Signal), signal.c_str(), 3); // copy string into synchro char array: 2 char + null + gnss_synchro.Signal[2] = 0; // make sure that string length is only two characters gnss_synchro.PRN = 7; nsamples = round(static_cast(sampling_frequency_hz) * GPS_L2_M_PERIOD) * 2; config->set_property("GNSS-SDR.internal_fs_sps", std::to_string(sampling_frequency_hz)); config->set_property("Acquisition_2S.implementation", "GPS_L2_M_PCPS_Acquisition"); config->set_property("Acquisition_2S.item_type", "gr_complex"); - if(FLAGS_plot_acq_grid == true) + if (FLAGS_plot_acq_grid == true) { config->set_property("Acquisition_2S.dump", "true"); } @@ -177,16 +177,16 @@ void GpsL2MPcpsAcquisitionTest::plot_grid() std::string basename = "./tmp-acq-gps2/acquisition_G_2S"; unsigned int sat = static_cast(gnss_synchro.PRN); - unsigned int samples_per_code = static_cast(floor(static_cast(sampling_frequency_hz) / (GPS_L2_M_CODE_RATE_HZ / static_cast(GPS_L2_M_CODE_LENGTH_CHIPS)))); + unsigned int samples_per_code = static_cast(floor(static_cast(sampling_frequency_hz) / (GPS_L2_M_CODE_RATE_HZ / static_cast(GPS_L2_M_CODE_LENGTH_CHIPS)))); acquisition_dump_reader acq_dump(basename, sat, doppler_max, doppler_step, samples_per_code); - if(!acq_dump.read_binary_acq()) std::cout << "Error reading files" << std::endl; + if (!acq_dump.read_binary_acq()) std::cout << "Error reading files" << std::endl; std::vector *doppler = &acq_dump.doppler; std::vector *samples = &acq_dump.samples; std::vector > *mag = &acq_dump.mag; const std::string gnuplot_executable(FLAGS_gnuplot_executable); - if(gnuplot_executable.empty()) + if (gnuplot_executable.empty()) { std::cout << "WARNING: Although the flag plot_acq_grid has been set to TRUE," << std::endl; std::cout << "gnuplot has not been found in your system." << std::endl; @@ -196,7 +196,7 @@ void GpsL2MPcpsAcquisitionTest::plot_grid() { std::cout << "Plotting the acquisition grid. This can take a while..." << std::endl; try - { + { boost::filesystem::path p(gnuplot_executable); boost::filesystem::path dir = p.parent_path(); std::string gnuplot_path = dir.native(); @@ -212,11 +212,11 @@ void GpsL2MPcpsAcquisitionTest::plot_grid() g1.savetops("GPS_L2CM_acq_grid"); g1.savetopdf("GPS_L2CM_acq_grid"); g1.showonscreen(); - } - catch (const GnuplotException & ge) - { + } + catch (const GnuplotException &ge) + { std::cout << ge.what() << std::endl; - } + } } std::string data_str = "./tmp-acq-gps2"; if (boost::filesystem::exists(data_str)) @@ -244,7 +244,7 @@ TEST_F(GpsL2MPcpsAcquisitionTest, ConnectAndRun) init(); std::shared_ptr acquisition = std::make_shared(config.get(), "Acquisition_2S", 1, 1); - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->connect(top_block); boost::shared_ptr source = gr::analog::sig_source_c::make(sampling_frequency_hz, gr::analog::GR_SIN_WAVE, 2000, 1, gr_complex(0)); boost::shared_ptr valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue); @@ -253,14 +253,14 @@ TEST_F(GpsL2MPcpsAcquisitionTest, ConnectAndRun) boost::shared_ptr msg_rx = GpsL2MPcpsAcquisitionTest_msg_rx_make(); }) << "Failure connecting the blocks of acquisition test."; - EXPECT_NO_THROW( { + EXPECT_NO_THROW({ start = std::chrono::system_clock::now(); - top_block->run(); // Start threads and wait + top_block->run(); // Start threads and wait end = std::chrono::system_clock::now(); elapsed_seconds = end - start; }) << "Failure running the top_block."; - std::cout << "Processed " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; + std::cout << "Processed " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; } @@ -270,10 +270,10 @@ TEST_F(GpsL2MPcpsAcquisitionTest, ValidationOfResults) std::chrono::duration elapsed_seconds(0); top_block = gr::make_top_block("Acquisition test"); queue = gr::msg_queue::make(0); - double expected_delay_samples = 1;//2004; - double expected_doppler_hz = 1200;//3000; + double expected_delay_samples = 1; //2004; + double expected_doppler_hz = 1200; //3000; - if(FLAGS_plot_acq_grid == true) + if (FLAGS_plot_acq_grid == true) { std::string data_str = "./tmp-acq-gps2"; if (boost::filesystem::exists(data_str)) @@ -287,64 +287,64 @@ TEST_F(GpsL2MPcpsAcquisitionTest, ValidationOfResults) std::shared_ptr acquisition = std::make_shared(config.get(), "Acquisition_2S", 1, 1); boost::shared_ptr msg_rx = GpsL2MPcpsAcquisitionTest_msg_rx_make(); - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_channel(1); }) << "Failure setting channel."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_gnss_synchro(&gnss_synchro); }) << "Failure setting gnss_synchro."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_threshold(0.001); }) << "Failure setting threshold."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_doppler_max(doppler_max); }) << "Failure setting doppler_max."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_doppler_step(doppler_step); }) << "Failure setting doppler_step."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->connect(top_block); }) << "Failure connecting acquisition to the top_block."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ std::string path = std::string(TEST_PATH); //std::string file = path + "signal_samples/GSoC_CTTC_capture_2012_07_26_4Msps_4ms.dat"; std::string file = path + "signal_samples/gps_l2c_m_prn7_5msps.dat"; //std::string file = "/datalogger/signals/Fraunhofer/L125_III1b_210s_L2_resampled.bin"; - const char * file_name = file.c_str(); + const char *file_name = file.c_str(); gr::blocks::file_source::sptr file_source = gr::blocks::file_source::make(sizeof(gr_complex), file_name, false); //gr::blocks::interleaved_short_to_complex::sptr gr_interleaved_short_to_complex_ = gr::blocks::interleaved_short_to_complex::make(); //gr::blocks::char_to_short::sptr gr_char_to_short_ = gr::blocks::char_to_short::make(); boost::shared_ptr valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue); //top_block->connect(file_source, 0, gr_char_to_short_, 0); //top_block->connect(gr_char_to_short_, 0, gr_interleaved_short_to_complex_ , 0); - top_block->connect(file_source, 0, valve , 0); + top_block->connect(file_source, 0, valve, 0); top_block->connect(valve, 0, acquisition->get_left_block(), 0); top_block->msg_connect(acquisition->get_right_block(), pmt::mp("events"), msg_rx, pmt::mp("events")); }) << "Failure connecting the blocks of acquisition test."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ acquisition->set_local_code(); - acquisition->set_state(1); // Ensure that acquisition starts at the first sample + acquisition->set_state(1); // Ensure that acquisition starts at the first sample acquisition->init(); }) << "Failure set_state and init acquisition test"; - EXPECT_NO_THROW( { + EXPECT_NO_THROW({ start = std::chrono::system_clock::now(); - top_block->run(); // Start threads and wait + top_block->run(); // Start threads and wait end = std::chrono::system_clock::now(); elapsed_seconds = end - start; }) << "Failure running the top_block."; - std::cout << "Acquisition process runtime duration: " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; + std::cout << "Acquisition process runtime duration: " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; - std::cout << "gnss_synchro.Acq_doppler_hz = " << gnss_synchro.Acq_doppler_hz << " Hz" << std::endl; - std::cout << "gnss_synchro.Acq_delay_samples = " << gnss_synchro.Acq_delay_samples << " Samples" << std::endl; + std::cout << "gnss_synchro.Acq_doppler_hz = " << gnss_synchro.Acq_doppler_hz << " Hz" << std::endl; + std::cout << "gnss_synchro.Acq_delay_samples = " << gnss_synchro.Acq_delay_samples << " Samples" << std::endl; ASSERT_EQ(1, msg_rx->rx_message) << "Acquisition failure. Expected message: 1=ACQ SUCCESS."; @@ -355,7 +355,7 @@ TEST_F(GpsL2MPcpsAcquisitionTest, ValidationOfResults) EXPECT_LE(doppler_error_hz, 200) << "Doppler error exceeds the expected value: 2/(3*integration period)"; EXPECT_LT(delay_error_chips, 0.5) << "Delay error exceeds the expected value: 0.5 chips"; - if(FLAGS_plot_acq_grid == true) + if (FLAGS_plot_acq_grid == true) { plot_grid(); } diff --git a/src/tests/unit-tests/signal-processing-blocks/adapter/adapter_test.cc b/src/tests/unit-tests/signal-processing-blocks/adapter/adapter_test.cc index a24f1a7e8..aca03ab54 100644 --- a/src/tests/unit-tests/signal-processing-blocks/adapter/adapter_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/adapter/adapter_test.cc @@ -47,7 +47,7 @@ #include "in_memory_configuration.h" -class DataTypeAdapter: public ::testing::Test +class DataTypeAdapter : public ::testing::Test { public: DataTypeAdapter(); @@ -81,7 +81,8 @@ DataTypeAdapter::DataTypeAdapter() DataTypeAdapter::~DataTypeAdapter() -{} +{ +} int DataTypeAdapter::run_ishort_to_cshort_block() @@ -93,7 +94,7 @@ int DataTypeAdapter::run_ishort_to_cshort_block() EXPECT_EQ(expected_implementation, ishort_to_cshort->implementation()); std::ofstream ofs(file_name_input.c_str(), std::ofstream::binary); - for(std::vector::const_iterator i = input_data_shorts.cbegin(); i != input_data_shorts.cend(); ++i) + for (std::vector::const_iterator i = input_data_shorts.cbegin(); i != input_data_shorts.cend(); ++i) { short aux = *i; ofs.write(reinterpret_cast(&aux), sizeof(short)); @@ -104,7 +105,7 @@ int DataTypeAdapter::run_ishort_to_cshort_block() auto file_source = gr::blocks::file_source::make(sizeof(short), file_name_input.c_str()); auto sink = gr::blocks::file_sink::make(sizeof(lv_16sc_t), file_name_output.c_str(), false); - EXPECT_NO_THROW( { + EXPECT_NO_THROW({ top_block->connect(file_source, 0, ishort_to_cshort->get_left_block(), 0); top_block->connect(ishort_to_cshort->get_right_block(), 0, sink, 0); top_block->run(); @@ -122,7 +123,7 @@ int DataTypeAdapter::run_ishort_to_complex_block() EXPECT_EQ(expected_implementation, ishort_to_complex->implementation()); std::ofstream ofs(file_name_input.c_str(), std::ofstream::binary); - for(std::vector::const_iterator i = input_data_shorts.cbegin(); i != input_data_shorts.cend(); ++i) + for (std::vector::const_iterator i = input_data_shorts.cbegin(); i != input_data_shorts.cend(); ++i) { short aux = *i; ofs.write(reinterpret_cast(&aux), sizeof(short)); @@ -133,7 +134,7 @@ int DataTypeAdapter::run_ishort_to_complex_block() auto file_source = gr::blocks::file_source::make(sizeof(short), file_name_input.c_str()); auto sink = gr::blocks::file_sink::make(sizeof(gr_complex), file_name_output.c_str(), false); - EXPECT_NO_THROW( { + EXPECT_NO_THROW({ top_block->connect(file_source, 0, ishort_to_complex->get_left_block(), 0); top_block->connect(ishort_to_complex->get_right_block(), 0, sink, 0); top_block->run(); @@ -151,7 +152,7 @@ int DataTypeAdapter::run_ibyte_to_cshort_block() EXPECT_EQ(expected_implementation, ibyte_to_cshort->implementation()); std::ofstream ofs(file_name_input.c_str()); - for(std::vector::const_iterator i = input_data_bytes.cbegin(); i != input_data_bytes.cend(); ++i) + for (std::vector::const_iterator i = input_data_bytes.cbegin(); i != input_data_bytes.cend(); ++i) { ofs << *i; } @@ -161,7 +162,7 @@ int DataTypeAdapter::run_ibyte_to_cshort_block() auto file_source = gr::blocks::file_source::make(sizeof(int8_t), file_name_input.c_str()); auto sink = gr::blocks::file_sink::make(sizeof(lv_16sc_t), file_name_output.c_str(), false); - EXPECT_NO_THROW( { + EXPECT_NO_THROW({ top_block->connect(file_source, 0, ibyte_to_cshort->get_left_block(), 0); top_block->connect(ibyte_to_cshort->get_right_block(), 0, sink, 0); top_block->run(); @@ -178,8 +179,8 @@ int DataTypeAdapter::run_ibyte_to_complex_block() std::string expected_implementation = "Ibyte_To_Complex"; EXPECT_EQ(expected_implementation, ibyte_to_complex->implementation()); - std::ofstream ofs(file_name_input.c_str() ); - for(std::vector::const_iterator i = input_data_bytes.cbegin(); i != input_data_bytes.cend(); ++i) + std::ofstream ofs(file_name_input.c_str()); + for (std::vector::const_iterator i = input_data_bytes.cbegin(); i != input_data_bytes.cend(); ++i) { ofs << *i; } @@ -189,7 +190,7 @@ int DataTypeAdapter::run_ibyte_to_complex_block() auto file_source = gr::blocks::file_source::make(sizeof(int8_t), file_name_input.c_str()); auto sink = gr::blocks::file_sink::make(sizeof(gr_complex), file_name_output.c_str(), false); - EXPECT_NO_THROW( { + EXPECT_NO_THROW({ top_block->connect(file_source, 0, ibyte_to_complex->get_left_block(), 0); top_block->connect(ibyte_to_complex->get_right_block(), 0, sink, 0); top_block->run(); @@ -207,7 +208,7 @@ int DataTypeAdapter::run_ibyte_to_cbyte_block() EXPECT_EQ(expected_implementation, ibyte_to_cbyte->implementation()); std::ofstream ofs(file_name_input.c_str()); - for(std::vector::const_iterator i = input_data_bytes.cbegin(); i != input_data_bytes.cend(); ++i) + for (std::vector::const_iterator i = input_data_bytes.cbegin(); i != input_data_bytes.cend(); ++i) { ofs << *i; } @@ -217,7 +218,7 @@ int DataTypeAdapter::run_ibyte_to_cbyte_block() auto file_source = gr::blocks::file_source::make(sizeof(int8_t), file_name_input.c_str()); auto sink = gr::blocks::file_sink::make(sizeof(short), file_name_output.c_str(), false); - EXPECT_NO_THROW( { + EXPECT_NO_THROW({ top_block->connect(file_source, 0, ibyte_to_cbyte->get_left_block(), 0); top_block->connect(ibyte_to_cbyte->get_right_block(), 0, sink, 0); top_block->run(); @@ -235,7 +236,7 @@ int DataTypeAdapter::run_byte_to_short_block() EXPECT_EQ(expected_implementation, byte_to_short->implementation()); std::ofstream ofs(file_name_input.c_str()); - for(std::vector::const_iterator i = input_data_bytes.cbegin(); i != input_data_bytes.cend(); ++i) + for (std::vector::const_iterator i = input_data_bytes.cbegin(); i != input_data_bytes.cend(); ++i) { ofs << *i; } @@ -245,7 +246,7 @@ int DataTypeAdapter::run_byte_to_short_block() auto file_source = gr::blocks::file_source::make(sizeof(int8_t), file_name_input.c_str()); auto sink = gr::blocks::file_sink::make(sizeof(int16_t), file_name_output.c_str(), false); - EXPECT_NO_THROW( { + EXPECT_NO_THROW({ top_block->connect(file_source, 0, byte_to_short->get_left_block(), 0); top_block->connect(byte_to_short->get_right_block(), 0, sink, 0); top_block->run(); @@ -257,22 +258,22 @@ int DataTypeAdapter::run_byte_to_short_block() TEST_F(DataTypeAdapter, ByteToShortValidationOfResults) { run_byte_to_short_block(); - std::ifstream ifs(file_name_output.data(), std::ifstream::binary | std::ifstream::in ); + std::ifstream ifs(file_name_output.data(), std::ifstream::binary | std::ifstream::in); int16_t iSample; int i = 0; try - { - while(ifs.read(reinterpret_cast(&iSample), sizeof(int16_t))) + { + while (ifs.read(reinterpret_cast(&iSample), sizeof(int16_t))) { - EXPECT_EQ(input_data_bytes.at(i), static_cast(iSample / 256)); // Scale down! + EXPECT_EQ(input_data_bytes.at(i), static_cast(iSample / 256)); // Scale down! i++; } - } - catch(std::system_error& e) - { + } + catch (std::system_error& e) + { std::cerr << e.code().message() << std::endl; - } + } ifs.close(); ASSERT_EQ(remove(file_name_input.c_str()), 0) << "Problem deleting temporary file"; ASSERT_EQ(remove(file_name_output.c_str()), 0) << "Problem deleting temporary file"; @@ -282,23 +283,23 @@ TEST_F(DataTypeAdapter, ByteToShortValidationOfResults) TEST_F(DataTypeAdapter, IbyteToCbyteValidationOfResults) { run_ibyte_to_cbyte_block(); - std::ifstream ifs(file_name_output.data(), std::ifstream::binary | std::ifstream::in ); + std::ifstream ifs(file_name_output.data(), std::ifstream::binary | std::ifstream::in); lv_8sc_t iSample; int i = 0; try - { - while(ifs.read(reinterpret_cast(&iSample), sizeof(lv_8sc_t))) + { + while (ifs.read(reinterpret_cast(&iSample), sizeof(lv_8sc_t))) { EXPECT_EQ(input_data_bytes.at(i), iSample.real()); i++; EXPECT_EQ(input_data_bytes.at(i), iSample.imag()); i++; } - } - catch(std::system_error& e) - { + } + catch (std::system_error& e) + { std::cerr << e.code().message() << std::endl; - } + } ifs.close(); ASSERT_EQ(remove(file_name_input.c_str()), 0) << "Problem deleting temporary file"; ASSERT_EQ(remove(file_name_output.c_str()), 0) << "Problem deleting temporary file"; @@ -308,23 +309,23 @@ TEST_F(DataTypeAdapter, IbyteToCbyteValidationOfResults) TEST_F(DataTypeAdapter, IbyteToComplexValidationOfResults) { run_ibyte_to_cbyte_block(); - std::ifstream ifs(file_name_output.data(), std::ifstream::binary | std::ifstream::in ); + std::ifstream ifs(file_name_output.data(), std::ifstream::binary | std::ifstream::in); gr_complex iSample; int i = 0; try - { - while(ifs.read(reinterpret_cast(&iSample), sizeof(gr_complex))) + { + while (ifs.read(reinterpret_cast(&iSample), sizeof(gr_complex))) { EXPECT_EQ(input_data_bytes.at(i), static_cast(iSample.real())); i++; - EXPECT_EQ(input_data_bytes.at(i), static_cast(iSample.imag())); + EXPECT_EQ(input_data_bytes.at(i), static_cast(iSample.imag())); i++; } - } - catch(std::system_error& e) - { + } + catch (std::system_error& e) + { std::cerr << e.code().message() << std::endl; - } + } ifs.close(); ASSERT_EQ(remove(file_name_input.c_str()), 0) << "Problem deleting temporary file"; ASSERT_EQ(remove(file_name_output.c_str()), 0) << "Problem deleting temporary file"; @@ -334,23 +335,23 @@ TEST_F(DataTypeAdapter, IbyteToComplexValidationOfResults) TEST_F(DataTypeAdapter, IbyteToCshortValidationOfResults) { run_ibyte_to_cshort_block(); - std::ifstream ifs(file_name_output.data(), std::ifstream::binary | std::ifstream::in ); + std::ifstream ifs(file_name_output.data(), std::ifstream::binary | std::ifstream::in); lv_16sc_t iSample; int i = 0; try - { - while(ifs.read(reinterpret_cast(&iSample), sizeof(lv_16sc_t))) + { + while (ifs.read(reinterpret_cast(&iSample), sizeof(lv_16sc_t))) { EXPECT_EQ(input_data_bytes.at(i), static_cast(iSample.real())); i++; - EXPECT_EQ(input_data_bytes.at(i), static_cast(iSample.imag())); + EXPECT_EQ(input_data_bytes.at(i), static_cast(iSample.imag())); i++; } - } - catch(std::system_error& e) - { + } + catch (std::system_error& e) + { std::cerr << e.code().message() << std::endl; - } + } ifs.close(); ASSERT_EQ(remove(file_name_input.c_str()), 0) << "Problem deleting temporary file"; ASSERT_EQ(remove(file_name_output.c_str()), 0) << "Problem deleting temporary file"; @@ -360,23 +361,23 @@ TEST_F(DataTypeAdapter, IbyteToCshortValidationOfResults) TEST_F(DataTypeAdapter, IshortToComplexValidationOfResults) { run_ishort_to_complex_block(); - std::ifstream ifs(file_name_output.data(), std::ifstream::binary | std::ifstream::in ); + std::ifstream ifs(file_name_output.data(), std::ifstream::binary | std::ifstream::in); gr_complex iSample; int i = 0; try - { - while(ifs.read(reinterpret_cast(&iSample), sizeof(gr_complex))) + { + while (ifs.read(reinterpret_cast(&iSample), sizeof(gr_complex))) { EXPECT_EQ(input_data_shorts.at(i), static_cast(iSample.real())); i++; - EXPECT_EQ(input_data_shorts.at(i), static_cast(iSample.imag())); + EXPECT_EQ(input_data_shorts.at(i), static_cast(iSample.imag())); i++; } - } - catch(std::system_error& e) - { + } + catch (std::system_error& e) + { std::cerr << e.code().message() << std::endl; - } + } ifs.close(); ASSERT_EQ(remove(file_name_input.c_str()), 0) << "Problem deleting temporary file"; ASSERT_EQ(remove(file_name_output.c_str()), 0) << "Problem deleting temporary file"; @@ -386,23 +387,23 @@ TEST_F(DataTypeAdapter, IshortToComplexValidationOfResults) TEST_F(DataTypeAdapter, IshortToCshortValidationOfResults) { run_ishort_to_cshort_block(); - std::ifstream ifs(file_name_output.data(), std::ifstream::binary | std::ifstream::in ); + std::ifstream ifs(file_name_output.data(), std::ifstream::binary | std::ifstream::in); lv_16sc_t iSample; int i = 0; try - { - while(ifs.read(reinterpret_cast(&iSample), sizeof(lv_16sc_t))) + { + while (ifs.read(reinterpret_cast(&iSample), sizeof(lv_16sc_t))) { EXPECT_EQ(input_data_shorts.at(i), static_cast(iSample.real())); i++; - EXPECT_EQ(input_data_shorts.at(i), static_cast(iSample.imag())); + EXPECT_EQ(input_data_shorts.at(i), static_cast(iSample.imag())); i++; } - } - catch(std::system_error& e) - { + } + catch (std::system_error& e) + { std::cerr << e.code().message() << std::endl; - } + } ifs.close(); ASSERT_EQ(remove(file_name_input.c_str()), 0) << "Problem deleting temporary file"; ASSERT_EQ(remove(file_name_output.c_str()), 0) << "Problem deleting temporary file"; diff --git a/src/tests/unit-tests/signal-processing-blocks/adapter/pass_through_test.cc b/src/tests/unit-tests/signal-processing-blocks/adapter/pass_through_test.cc index 070196fe6..1064f7fc6 100644 --- a/src/tests/unit-tests/signal-processing-blocks/adapter/pass_through_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/adapter/pass_through_test.cc @@ -36,7 +36,6 @@ #include "in_memory_configuration.h" - TEST(PassThroughTest, Instantiate) { std::shared_ptr config = std::make_shared(); diff --git a/src/tests/unit-tests/signal-processing-blocks/filter/fir_filter_test.cc b/src/tests/unit-tests/signal-processing-blocks/filter/fir_filter_test.cc index 9fa38e4a5..a79a3ab8e 100644 --- a/src/tests/unit-tests/signal-processing-blocks/filter/fir_filter_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/filter/fir_filter_test.cc @@ -48,9 +48,9 @@ #include "file_signal_source.h" -DEFINE_int32(filter_test_nsamples, 1000000 , "Number of samples to filter in the tests (max: 2147483647)"); +DEFINE_int32(filter_test_nsamples, 1000000, "Number of samples to filter in the tests (max: 2147483647)"); -class FirFilterTest: public ::testing::Test +class FirFilterTest : public ::testing::Test { protected: FirFilterTest() @@ -60,7 +60,8 @@ protected: config = std::make_shared(); } ~FirFilterTest() - {} + { + } void init(); void configure_cbyte_cbyte(); @@ -182,7 +183,7 @@ TEST_F(FirFilterTest, ConnectAndRun) configure_gr_complex_gr_complex(); std::shared_ptr filter = std::make_shared(config.get(), "InputFilter", 1, 1); item_size = sizeof(gr_complex); - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ filter->connect(top_block); boost::shared_ptr source = gr::analog::sig_source_c::make(fs_in, gr::analog::GR_SIN_WAVE, 1000, 1, gr_complex(0)); boost::shared_ptr valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue); @@ -193,13 +194,13 @@ TEST_F(FirFilterTest, ConnectAndRun) top_block->connect(filter->get_right_block(), 0, null_sink, 0); }) << "Failure connecting the top_block."; - EXPECT_NO_THROW( { + EXPECT_NO_THROW({ start = std::chrono::system_clock::now(); - top_block->run(); // Start threads and wait + top_block->run(); // Start threads and wait end = std::chrono::system_clock::now(); elapsed_seconds = end - start; }) << "Failure running the top_block."; - std::cout << "Filtered " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; + std::cout << "Filtered " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; } @@ -223,7 +224,7 @@ TEST_F(FirFilterTest, ConnectAndRunGrcomplex) config2->set_property("Test_Source.repeat", "true"); item_size = sizeof(gr_complex); - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ filter->connect(top_block); boost::shared_ptr source(new FileSignalSource(config2.get(), "Test_Source", 1, 1, queue)); @@ -235,13 +236,13 @@ TEST_F(FirFilterTest, ConnectAndRunGrcomplex) top_block->connect(filter->get_right_block(), 0, null_sink, 0); }) << "Failure connecting the top_block."; - EXPECT_NO_THROW( { + EXPECT_NO_THROW({ start = std::chrono::system_clock::now(); - top_block->run(); // Start threads and wait + top_block->run(); // Start threads and wait end = std::chrono::system_clock::now(); elapsed_seconds = end - start; }) << "Failure running the top_block."; - std::cout << "Filtered " << nsamples << " gr_complex samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; + std::cout << "Filtered " << nsamples << " gr_complex samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; } TEST_F(FirFilterTest, ConnectAndRunCshorts) @@ -264,7 +265,7 @@ TEST_F(FirFilterTest, ConnectAndRunCshorts) config2->set_property("Test_Source.repeat", "true"); item_size = sizeof(std::complex); - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ filter->connect(top_block); boost::shared_ptr source(new FileSignalSource(config2.get(), "Test_Source", 1, 1, queue)); @@ -278,17 +279,16 @@ TEST_F(FirFilterTest, ConnectAndRunCshorts) top_block->connect(filter->get_right_block(), 0, null_sink, 0); }) << "Failure connecting the top_block."; - EXPECT_NO_THROW( { + EXPECT_NO_THROW({ start = std::chrono::system_clock::now(); - top_block->run(); // Start threads and wait + top_block->run(); // Start threads and wait end = std::chrono::system_clock::now(); elapsed_seconds = end - start; }) << "Failure running the top_block."; - std::cout << "Filtered " << nsamples << " std::complex samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; + std::cout << "Filtered " << nsamples << " std::complex samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; } - TEST_F(FirFilterTest, ConnectAndRunCbytes) { std::chrono::time_point start, end; @@ -309,7 +309,7 @@ TEST_F(FirFilterTest, ConnectAndRunCbytes) config2->set_property("Test_Source.repeat", "true"); item_size = sizeof(std::complex); - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ filter->connect(top_block); boost::shared_ptr source(new FileSignalSource(config2.get(), "Test_Source", 1, 1, queue)); @@ -323,13 +323,13 @@ TEST_F(FirFilterTest, ConnectAndRunCbytes) top_block->connect(filter->get_right_block(), 0, null_sink, 0); }) << "Failure connecting the top_block."; - EXPECT_NO_THROW( { + EXPECT_NO_THROW({ start = std::chrono::system_clock::now(); - top_block->run(); // Start threads and wait + top_block->run(); // Start threads and wait end = std::chrono::system_clock::now(); elapsed_seconds = end - start; }) << "Failure running the top_block."; - std::cout << "Filtered " << nsamples << " std::complex samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; + std::cout << "Filtered " << nsamples << " std::complex samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; } @@ -353,7 +353,7 @@ TEST_F(FirFilterTest, ConnectAndRunCbyteGrcomplex) config2->set_property("Test_Source.repeat", "true"); item_size = sizeof(gr_complex); - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ filter->connect(top_block); boost::shared_ptr source(new FileSignalSource(config2.get(), "Test_Source", 1, 1, queue)); @@ -367,11 +367,11 @@ TEST_F(FirFilterTest, ConnectAndRunCbyteGrcomplex) top_block->connect(filter->get_right_block(), 0, null_sink, 0); }) << "Failure connecting the top_block."; - EXPECT_NO_THROW( { + EXPECT_NO_THROW({ start = std::chrono::system_clock::now(); - top_block->run(); // Start threads and wait + top_block->run(); // Start threads and wait end = std::chrono::system_clock::now(); elapsed_seconds = end - start; }) << "Failure running the top_block."; - std::cout << "Filtered " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; + std::cout << "Filtered " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; } diff --git a/src/tests/unit-tests/signal-processing-blocks/filter/notch_filter_lite_test.cc b/src/tests/unit-tests/signal-processing-blocks/filter/notch_filter_lite_test.cc index c01768db2..cf6db8921 100644 --- a/src/tests/unit-tests/signal-processing-blocks/filter/notch_filter_lite_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/filter/notch_filter_lite_test.cc @@ -46,9 +46,9 @@ #include "file_signal_source.h" -DEFINE_int32(notch_filter_lite_test_nsamples, 1000000 , "Number of samples to filter in the tests (max: 2147483647)"); +DEFINE_int32(notch_filter_lite_test_nsamples, 1000000, "Number of samples to filter in the tests (max: 2147483647)"); -class NotchFilterLiteTest: public ::testing::Test +class NotchFilterLiteTest : public ::testing::Test { protected: NotchFilterLiteTest() @@ -59,7 +59,8 @@ protected: nsamples = FLAGS_notch_filter_lite_test_nsamples; } ~NotchFilterLiteTest() - {} + { + } void init(); void configure_gr_complex_gr_complex(); @@ -106,7 +107,7 @@ TEST_F(NotchFilterLiteTest, ConnectAndRun) configure_gr_complex_gr_complex(); std::shared_ptr filter = std::make_shared(config.get(), "InputFilter", 1, 1); item_size = sizeof(gr_complex); - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ filter->connect(top_block); boost::shared_ptr source = gr::analog::sig_source_c::make(fs_in, gr::analog::GR_SIN_WAVE, 1000.0, 1.0, gr_complex(0.0)); boost::shared_ptr valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue); @@ -116,14 +117,14 @@ TEST_F(NotchFilterLiteTest, ConnectAndRun) top_block->connect(valve, 0, filter->get_left_block(), 0); top_block->connect(filter->get_right_block(), 0, null_sink, 0); }) << "Failure connecting the top_block."; - - EXPECT_NO_THROW( { + + EXPECT_NO_THROW({ start = std::chrono::system_clock::now(); - top_block->run(); // Start threads and wait + top_block->run(); // Start threads and wait end = std::chrono::system_clock::now(); elapsed_seconds = end - start; }) << "Failure running the top_block."; - std::cout << "Filtered " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; + std::cout << "Filtered " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; } @@ -146,9 +147,9 @@ TEST_F(NotchFilterLiteTest, ConnectAndRunGrcomplex) config2->set_property("Test_Source.repeat", "true"); item_size = sizeof(gr_complex); - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ filter->connect(top_block); - + boost::shared_ptr source(new FileSignalSource(config2.get(), "Test_Source", 1, 1, queue)); source->connect(top_block); @@ -158,11 +159,11 @@ TEST_F(NotchFilterLiteTest, ConnectAndRunGrcomplex) top_block->connect(filter->get_right_block(), 0, null_sink, 0); }) << "Failure connecting the top_block."; - EXPECT_NO_THROW( { + EXPECT_NO_THROW({ start = std::chrono::system_clock::now(); - top_block->run(); // Start threads and wait + top_block->run(); // Start threads and wait end = std::chrono::system_clock::now(); elapsed_seconds = end - start; }) << "Failure running the top_block."; - std::cout << "Filtered " << nsamples << " gr_complex samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; + std::cout << "Filtered " << nsamples << " gr_complex samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; } diff --git a/src/tests/unit-tests/signal-processing-blocks/filter/notch_filter_test.cc b/src/tests/unit-tests/signal-processing-blocks/filter/notch_filter_test.cc index cc180b7fd..c01fa0806 100644 --- a/src/tests/unit-tests/signal-processing-blocks/filter/notch_filter_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/filter/notch_filter_test.cc @@ -46,9 +46,9 @@ #include "file_signal_source.h" -DEFINE_int32(notch_filter_test_nsamples, 1000000 , "Number of samples to filter in the tests (max: 2147483647)"); +DEFINE_int32(notch_filter_test_nsamples, 1000000, "Number of samples to filter in the tests (max: 2147483647)"); -class NotchFilterTest: public ::testing::Test +class NotchFilterTest : public ::testing::Test { protected: NotchFilterTest() @@ -59,7 +59,8 @@ protected: nsamples = FLAGS_notch_filter_test_nsamples; } ~NotchFilterTest() - {} + { + } void init(); void configure_gr_complex_gr_complex(); @@ -106,7 +107,7 @@ TEST_F(NotchFilterTest, ConnectAndRun) configure_gr_complex_gr_complex(); std::shared_ptr filter = std::make_shared(config.get(), "InputFilter", 1, 1); item_size = sizeof(gr_complex); - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ filter->connect(top_block); boost::shared_ptr source = gr::analog::sig_source_c::make(fs_in, gr::analog::GR_SIN_WAVE, 1000.0, 1.0, gr_complex(0.0)); boost::shared_ptr valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue); @@ -116,14 +117,14 @@ TEST_F(NotchFilterTest, ConnectAndRun) top_block->connect(valve, 0, filter->get_left_block(), 0); top_block->connect(filter->get_right_block(), 0, null_sink, 0); }) << "Failure connecting the top_block."; - - EXPECT_NO_THROW( { + + EXPECT_NO_THROW({ start = std::chrono::system_clock::now(); - top_block->run(); // Start threads and wait + top_block->run(); // Start threads and wait end = std::chrono::system_clock::now(); elapsed_seconds = end - start; }) << "Failure running the top_block."; - std::cout << "Filtered " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; + std::cout << "Filtered " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; } @@ -146,9 +147,9 @@ TEST_F(NotchFilterTest, ConnectAndRunGrcomplex) config2->set_property("Test_Source.repeat", "true"); item_size = sizeof(gr_complex); - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ filter->connect(top_block); - + boost::shared_ptr source(new FileSignalSource(config2.get(), "Test_Source", 1, 1, queue)); source->connect(top_block); @@ -158,11 +159,11 @@ TEST_F(NotchFilterTest, ConnectAndRunGrcomplex) top_block->connect(filter->get_right_block(), 0, null_sink, 0); }) << "Failure connecting the top_block."; - EXPECT_NO_THROW( { + EXPECT_NO_THROW({ start = std::chrono::system_clock::now(); - top_block->run(); // Start threads and wait + top_block->run(); // Start threads and wait end = std::chrono::system_clock::now(); elapsed_seconds = end - start; }) << "Failure running the top_block."; - std::cout << "Filtered " << nsamples << " gr_complex samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; + std::cout << "Filtered " << nsamples << " gr_complex samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; } diff --git a/src/tests/unit-tests/signal-processing-blocks/filter/pulse_blanking_filter_test.cc b/src/tests/unit-tests/signal-processing-blocks/filter/pulse_blanking_filter_test.cc index ec07cf68b..f0afac18c 100644 --- a/src/tests/unit-tests/signal-processing-blocks/filter/pulse_blanking_filter_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/filter/pulse_blanking_filter_test.cc @@ -46,9 +46,9 @@ #include "file_signal_source.h" -DEFINE_int32(pb_filter_test_nsamples, 1000000 , "Number of samples to filter in the tests (max: 2147483647)"); +DEFINE_int32(pb_filter_test_nsamples, 1000000, "Number of samples to filter in the tests (max: 2147483647)"); -class PulseBlankingFilterTest: public ::testing::Test +class PulseBlankingFilterTest : public ::testing::Test { protected: PulseBlankingFilterTest() @@ -59,7 +59,8 @@ protected: nsamples = FLAGS_pb_filter_test_nsamples; } ~PulseBlankingFilterTest() - {} + { + } void init(); void configure_gr_complex_gr_complex(); @@ -105,7 +106,7 @@ TEST_F(PulseBlankingFilterTest, ConnectAndRun) configure_gr_complex_gr_complex(); std::shared_ptr filter = std::make_shared(config.get(), "InputFilter", 1, 1); item_size = sizeof(gr_complex); - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ filter->connect(top_block); boost::shared_ptr source = gr::analog::sig_source_c::make(fs_in, gr::analog::GR_SIN_WAVE, 1000.0, 1.0, gr_complex(0.0)); boost::shared_ptr valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue); @@ -115,14 +116,14 @@ TEST_F(PulseBlankingFilterTest, ConnectAndRun) top_block->connect(valve, 0, filter->get_left_block(), 0); top_block->connect(filter->get_right_block(), 0, null_sink, 0); }) << "Failure connecting the top_block."; - - EXPECT_NO_THROW( { + + EXPECT_NO_THROW({ start = std::chrono::system_clock::now(); - top_block->run(); // Start threads and wait + top_block->run(); // Start threads and wait end = std::chrono::system_clock::now(); elapsed_seconds = end - start; }) << "Failure running the top_block."; - std::cout << "Filtered " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; + std::cout << "Filtered " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; } @@ -145,9 +146,9 @@ TEST_F(PulseBlankingFilterTest, ConnectAndRunGrcomplex) config2->set_property("Test_Source.repeat", "true"); item_size = sizeof(gr_complex); - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ filter->connect(top_block); - + boost::shared_ptr source(new FileSignalSource(config2.get(), "Test_Source", 1, 1, queue)); source->connect(top_block); @@ -157,11 +158,11 @@ TEST_F(PulseBlankingFilterTest, ConnectAndRunGrcomplex) top_block->connect(filter->get_right_block(), 0, null_sink, 0); }) << "Failure connecting the top_block."; - EXPECT_NO_THROW( { + EXPECT_NO_THROW({ start = std::chrono::system_clock::now(); - top_block->run(); // Start threads and wait + top_block->run(); // Start threads and wait end = std::chrono::system_clock::now(); elapsed_seconds = end - start; }) << "Failure running the top_block."; - std::cout << "Filtered " << nsamples << " gr_complex samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; + std::cout << "Filtered " << nsamples << " gr_complex samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; } diff --git a/src/tests/unit-tests/signal-processing-blocks/libs/acquisition_dump_reader.cc b/src/tests/unit-tests/signal-processing-blocks/libs/acquisition_dump_reader.cc index 7f9b6c888..38a9ff280 100644 --- a/src/tests/unit-tests/signal-processing-blocks/libs/acquisition_dump_reader.cc +++ b/src/tests/unit-tests/signal-processing-blocks/libs/acquisition_dump_reader.cc @@ -38,35 +38,35 @@ bool acquisition_dump_reader::read_binary_acq() { mat_t* matfile = Mat_Open(d_dump_filename.c_str(), MAT_ACC_RDONLY); - if( matfile == NULL) + if (matfile == NULL) { std::cout << "¡¡¡Unreachable Acquisition dump file!!!" << std::endl; return false; } - matvar_t* var_= Mat_VarRead(matfile, "grid"); - if( var_ == NULL) + matvar_t* var_ = Mat_VarRead(matfile, "grid"); + if (var_ == NULL) { std::cout << "¡¡¡Unreachable grid variable into Acquisition dump file!!!" << std::endl; Mat_Close(matfile); return false; } - if(var_->rank != 2) + if (var_->rank != 2) { std::cout << "Invalid Acquisition dump file: rank error" << std::endl; Mat_VarFree(var_); Mat_Close(matfile); return false; } - if((var_->dims[0] != d_samples_per_code) or (var_->dims[1] != d_num_doppler_bins)) + if ((var_->dims[0] != d_samples_per_code) or (var_->dims[1] != d_num_doppler_bins)) { std::cout << "Invalid Acquisition dump file: dimension matrix error" << std::endl; - if(var_->dims[0] != d_samples_per_code) std::cout << "Expected " << d_samples_per_code << " samples per code. Obtained " << var_->dims[0] << std::endl; - if(var_->dims[1] != d_num_doppler_bins) std::cout << "Expected " << d_num_doppler_bins << " Doppler bins. Obtained " << var_->dims[1] << std::endl; + if (var_->dims[0] != d_samples_per_code) std::cout << "Expected " << d_samples_per_code << " samples per code. Obtained " << var_->dims[0] << std::endl; + if (var_->dims[1] != d_num_doppler_bins) std::cout << "Expected " << d_num_doppler_bins << " Doppler bins. Obtained " << var_->dims[1] << std::endl; Mat_VarFree(var_); Mat_Close(matfile); return false; } - if(var_->data_type != MAT_T_SINGLE) + if (var_->data_type != MAT_T_SINGLE) { std::cout << "Invalid Acquisition dump file: data type error" << std::endl; Mat_VarFree(var_); @@ -78,9 +78,9 @@ bool acquisition_dump_reader::read_binary_acq() float* aux = static_cast(var_->data); int k = 0; float normalization_factor = std::pow(d_samples_per_code, 2); - for(it1 = mag.begin(); it1 != mag.end(); it1++) + for (it1 = mag.begin(); it1 != mag.end(); it1++) { - for(it2 = it1->begin(); it2 != it1->end(); it2++) + for (it2 = it1->begin(); it2 != it1->end(); it2++) { *it2 = static_cast(std::sqrt(aux[k])) / normalization_factor; k++; @@ -93,14 +93,14 @@ bool acquisition_dump_reader::read_binary_acq() } -acquisition_dump_reader::acquisition_dump_reader(const std::string & basename, unsigned int sat, unsigned int doppler_max, unsigned int doppler_step, unsigned int samples_per_code) +acquisition_dump_reader::acquisition_dump_reader(const std::string& basename, unsigned int sat, unsigned int doppler_max, unsigned int doppler_step, unsigned int samples_per_code) { d_basename = basename; d_sat = sat; d_doppler_max = doppler_max; d_doppler_step = doppler_step; d_samples_per_code = samples_per_code; - d_num_doppler_bins = static_cast(ceil( static_cast(static_cast(d_doppler_max) - static_cast(-d_doppler_max)) / static_cast(d_doppler_step))); + d_num_doppler_bins = static_cast(ceil(static_cast(static_cast(d_doppler_max) - static_cast(-d_doppler_max)) / static_cast(d_doppler_step))); std::vector > mag_aux(d_num_doppler_bins, std::vector(d_samples_per_code)); mag = mag_aux; d_dump_filename = d_basename + "_sat_" + std::to_string(d_sat) + ".mat"; @@ -116,4 +116,5 @@ acquisition_dump_reader::acquisition_dump_reader(const std::string & basename, u acquisition_dump_reader::~acquisition_dump_reader() -{} +{ +} diff --git a/src/tests/unit-tests/signal-processing-blocks/libs/acquisition_dump_reader.h b/src/tests/unit-tests/signal-processing-blocks/libs/acquisition_dump_reader.h index ba973dbe4..684cb7baf 100644 --- a/src/tests/unit-tests/signal-processing-blocks/libs/acquisition_dump_reader.h +++ b/src/tests/unit-tests/signal-processing-blocks/libs/acquisition_dump_reader.h @@ -38,7 +38,7 @@ class acquisition_dump_reader { public: - acquisition_dump_reader(const std::string & basename, unsigned int sat, unsigned int doppler_max, unsigned int doppler_step, unsigned int samples_per_code); + acquisition_dump_reader(const std::string& basename, unsigned int sat, unsigned int doppler_max, unsigned int doppler_step, unsigned int samples_per_code); ~acquisition_dump_reader(); bool read_binary_acq(); @@ -56,4 +56,4 @@ private: std::string d_dump_filename; }; -#endif // GNSS_SDR_ACQUISITION_DUMP_READER_H +#endif // GNSS_SDR_ACQUISITION_DUMP_READER_H diff --git a/src/tests/unit-tests/signal-processing-blocks/libs/observables_dump_reader.cc b/src/tests/unit-tests/signal-processing-blocks/libs/observables_dump_reader.cc index d3b8ef1b8..2f1f95abe 100644 --- a/src/tests/unit-tests/signal-processing-blocks/libs/observables_dump_reader.cc +++ b/src/tests/unit-tests/signal-processing-blocks/libs/observables_dump_reader.cc @@ -34,8 +34,8 @@ bool observables_dump_reader::read_binary_obs() { try - { - for(int i = 0; i < n_channels; i++) + { + for (int i = 0; i < n_channels; i++) { d_dump_file.read(reinterpret_cast(&RX_time[i]), sizeof(double)); d_dump_file.read(reinterpret_cast(&TOW_at_current_symbol_s[i]), sizeof(double)); @@ -45,11 +45,11 @@ bool observables_dump_reader::read_binary_obs() d_dump_file.read(reinterpret_cast(&PRN[i]), sizeof(double)); d_dump_file.read(reinterpret_cast(&valid[i]), sizeof(double)); } - } + } catch (const std::ifstream::failure &e) - { + { return false; - } + } return true; } @@ -74,7 +74,7 @@ long int observables_dump_reader::num_epochs() std::ifstream::pos_type size; int number_of_vars_in_epoch = n_channels * 7; int epoch_size_bytes = sizeof(double) * number_of_vars_in_epoch; - std::ifstream tmpfile( d_dump_filename.c_str(), std::ios::binary | std::ios::ate); + std::ifstream tmpfile(d_dump_filename.c_str(), std::ios::binary | std::ios::ate); if (tmpfile.is_open()) { size = tmpfile.tellg(); @@ -93,18 +93,18 @@ bool observables_dump_reader::open_obs_file(std::string out_file) if (d_dump_file.is_open() == false) { try - { + { d_dump_filename = out_file; - d_dump_file.exceptions( std::ifstream::failbit | std::ifstream::badbit ); + d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); d_dump_file.open(d_dump_filename.c_str(), std::ios::in | std::ios::binary); std::cout << "Observables sum file opened, Log file: " << d_dump_filename.c_str() << std::endl; return true; - } - catch (const std::ifstream::failure & e) - { + } + catch (const std::ifstream::failure &e) + { std::cout << "Problem opening TLM dump Log file: " << d_dump_filename.c_str() << std::endl; return false; - } + } } else { diff --git a/src/tests/unit-tests/signal-processing-blocks/libs/observables_dump_reader.h b/src/tests/unit-tests/signal-processing-blocks/libs/observables_dump_reader.h index dc2cc2eb8..8f049f147 100644 --- a/src/tests/unit-tests/signal-processing-blocks/libs/observables_dump_reader.h +++ b/src/tests/unit-tests/signal-processing-blocks/libs/observables_dump_reader.h @@ -62,4 +62,4 @@ private: std::ifstream d_dump_file; }; -#endif //GNSS_SDR_OBSERVABLES_DUMP_READER_H +#endif //GNSS_SDR_OBSERVABLES_DUMP_READER_H diff --git a/src/tests/unit-tests/signal-processing-blocks/libs/tlm_dump_reader.cc b/src/tests/unit-tests/signal-processing-blocks/libs/tlm_dump_reader.cc index 645b82ab5..68163d7f3 100644 --- a/src/tests/unit-tests/signal-processing-blocks/libs/tlm_dump_reader.cc +++ b/src/tests/unit-tests/signal-processing-blocks/libs/tlm_dump_reader.cc @@ -34,15 +34,15 @@ bool tlm_dump_reader::read_binary_obs() { try - { + { d_dump_file.read(reinterpret_cast(&TOW_at_current_symbol), sizeof(double)); d_dump_file.read(reinterpret_cast(&Tracking_sample_counter), sizeof(unsigned long int)); d_dump_file.read(reinterpret_cast(&d_TOW_at_Preamble), sizeof(double)); - } + } catch (const std::ifstream::failure &e) - { + { return false; - } + } return true; } @@ -67,7 +67,7 @@ long int tlm_dump_reader::num_epochs() std::ifstream::pos_type size; int number_of_vars_in_epoch = 2; int epoch_size_bytes = sizeof(double) * number_of_vars_in_epoch + sizeof(unsigned long int); - std::ifstream tmpfile( d_dump_filename.c_str(), std::ios::binary | std::ios::ate); + std::ifstream tmpfile(d_dump_filename.c_str(), std::ios::binary | std::ios::ate); if (tmpfile.is_open()) { size = tmpfile.tellg(); @@ -86,18 +86,18 @@ bool tlm_dump_reader::open_obs_file(std::string out_file) if (d_dump_file.is_open() == false) { try - { + { d_dump_filename = out_file; - d_dump_file.exceptions( std::ifstream::failbit | std::ifstream::badbit ); + d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); d_dump_file.open(d_dump_filename.c_str(), std::ios::in | std::ios::binary); std::cout << "TLM dump enabled, Log file: " << d_dump_filename.c_str() << std::endl; return true; - } - catch (const std::ifstream::failure & e) - { + } + catch (const std::ifstream::failure &e) + { std::cout << "Problem opening TLM dump Log file: " << d_dump_filename.c_str() << std::endl; return false; - } + } } else { diff --git a/src/tests/unit-tests/signal-processing-blocks/libs/tlm_dump_reader.h b/src/tests/unit-tests/signal-processing-blocks/libs/tlm_dump_reader.h index ff0f3d5c1..be3c1b754 100644 --- a/src/tests/unit-tests/signal-processing-blocks/libs/tlm_dump_reader.h +++ b/src/tests/unit-tests/signal-processing-blocks/libs/tlm_dump_reader.h @@ -54,4 +54,4 @@ private: std::ifstream d_dump_file; }; -#endif //GNSS_SDR_TLM_DUMP_READER_H +#endif //GNSS_SDR_TLM_DUMP_READER_H diff --git a/src/tests/unit-tests/signal-processing-blocks/libs/tracking_dump_reader.cc b/src/tests/unit-tests/signal-processing-blocks/libs/tracking_dump_reader.cc index f23048c18..b8f259501 100644 --- a/src/tests/unit-tests/signal-processing-blocks/libs/tracking_dump_reader.cc +++ b/src/tests/unit-tests/signal-processing-blocks/libs/tracking_dump_reader.cc @@ -34,7 +34,7 @@ bool tracking_dump_reader::read_binary_obs() { try - { + { d_dump_file.read(reinterpret_cast(&abs_E), sizeof(float)); d_dump_file.read(reinterpret_cast(&abs_P), sizeof(float)); d_dump_file.read(reinterpret_cast(&abs_L), sizeof(float)); @@ -55,11 +55,11 @@ bool tracking_dump_reader::read_binary_obs() d_dump_file.read(reinterpret_cast(&aux1), sizeof(double)); d_dump_file.read(reinterpret_cast(&aux2), sizeof(double)); d_dump_file.read(reinterpret_cast(&PRN), sizeof(unsigned int)); - } + } catch (const std::ifstream::failure &e) - { + { return false; - } + } return true; } @@ -85,7 +85,7 @@ long int tracking_dump_reader::num_epochs() int number_of_double_vars = 11; int number_of_float_vars = 5; int epoch_size_bytes = sizeof(unsigned long int) + sizeof(double) * number_of_double_vars + - sizeof(float) * number_of_float_vars + sizeof(unsigned int); + sizeof(float) * number_of_float_vars + sizeof(unsigned int); std::ifstream tmpfile(d_dump_filename.c_str(), std::ios::binary | std::ios::ate); if (tmpfile.is_open()) { @@ -105,18 +105,18 @@ bool tracking_dump_reader::open_obs_file(std::string out_file) if (d_dump_file.is_open() == false) { try - { + { d_dump_filename = out_file; - d_dump_file.exceptions( std::ifstream::failbit | std::ifstream::badbit ); + d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); d_dump_file.open(d_dump_filename.c_str(), std::ios::in | std::ios::binary); std::cout << "Tracking dump enabled, Log file: " << d_dump_filename.c_str() << std::endl; return true; - } - catch (const std::ifstream::failure & e) - { + } + catch (const std::ifstream::failure &e) + { std::cout << "Problem opening Tracking dump Log file: " << d_dump_filename.c_str() << std::endl; return false; - } + } } else { diff --git a/src/tests/unit-tests/signal-processing-blocks/libs/tracking_dump_reader.h b/src/tests/unit-tests/signal-processing-blocks/libs/tracking_dump_reader.h index f30802ba5..2a56fdd1c 100644 --- a/src/tests/unit-tests/signal-processing-blocks/libs/tracking_dump_reader.h +++ b/src/tests/unit-tests/signal-processing-blocks/libs/tracking_dump_reader.h @@ -85,4 +85,4 @@ private: std::ifstream d_dump_file; }; -#endif //GNSS_SDR_TRACKING_DUMP_READER_H +#endif //GNSS_SDR_TRACKING_DUMP_READER_H diff --git a/src/tests/unit-tests/signal-processing-blocks/libs/tracking_true_obs_reader.cc b/src/tests/unit-tests/signal-processing-blocks/libs/tracking_true_obs_reader.cc index 7aadfc94f..1ada53442 100644 --- a/src/tests/unit-tests/signal-processing-blocks/libs/tracking_true_obs_reader.cc +++ b/src/tests/unit-tests/signal-processing-blocks/libs/tracking_true_obs_reader.cc @@ -34,17 +34,17 @@ bool tracking_true_obs_reader::read_binary_obs() { try - { + { d_dump_file.read(reinterpret_cast(&signal_timestamp_s), sizeof(double)); d_dump_file.read(reinterpret_cast(&acc_carrier_phase_cycles), sizeof(double)); d_dump_file.read(reinterpret_cast(&doppler_l1_hz), sizeof(double)); d_dump_file.read(reinterpret_cast(&prn_delay_chips), sizeof(double)); d_dump_file.read(reinterpret_cast(&tow), sizeof(double)); - } + } catch (const std::ifstream::failure &e) - { + { return false; - } + } return true; } @@ -69,11 +69,11 @@ long int tracking_true_obs_reader::num_epochs() std::ifstream::pos_type size; int number_of_vars_in_epoch = 5; int epoch_size_bytes = sizeof(double) * number_of_vars_in_epoch; - std::ifstream tmpfile( d_dump_filename.c_str(), std::ios::binary | std::ios::ate); + std::ifstream tmpfile(d_dump_filename.c_str(), std::ios::binary | std::ios::ate); if (tmpfile.is_open()) { size = tmpfile.tellg(); - long int nepoch = size / epoch_size_bytes; + long int nepoch = size / epoch_size_bytes; return nepoch; } else @@ -88,18 +88,18 @@ bool tracking_true_obs_reader::open_obs_file(std::string out_file) if (d_dump_file.is_open() == false) { try - { + { d_dump_filename = out_file; - d_dump_file.exceptions( std::ifstream::failbit | std::ifstream::badbit ); + d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); d_dump_file.open(d_dump_filename.c_str(), std::ios::in | std::ios::binary); std::cout << "Observables dump enabled, Log file: " << d_dump_filename.c_str() << std::endl; return true; - } - catch (const std::ifstream::failure & e) - { + } + catch (const std::ifstream::failure &e) + { std::cout << "Problem opening Observables dump Log file: " << d_dump_filename.c_str() << std::endl; return false; - } + } } else { diff --git a/src/tests/unit-tests/signal-processing-blocks/libs/tracking_true_obs_reader.h b/src/tests/unit-tests/signal-processing-blocks/libs/tracking_true_obs_reader.h index 4b57df24a..2b0d9e1f9 100644 --- a/src/tests/unit-tests/signal-processing-blocks/libs/tracking_true_obs_reader.h +++ b/src/tests/unit-tests/signal-processing-blocks/libs/tracking_true_obs_reader.h @@ -56,4 +56,4 @@ private: std::ifstream d_dump_file; }; -#endif //GNSS_SDR_RACKING_TRUE_OBS_READER_H +#endif //GNSS_SDR_RACKING_TRUE_OBS_READER_H diff --git a/src/tests/unit-tests/signal-processing-blocks/libs/true_observables_reader.cc b/src/tests/unit-tests/signal-processing-blocks/libs/true_observables_reader.cc index afb6626ef..33a368ee1 100644 --- a/src/tests/unit-tests/signal-processing-blocks/libs/true_observables_reader.cc +++ b/src/tests/unit-tests/signal-processing-blocks/libs/true_observables_reader.cc @@ -34,8 +34,8 @@ bool true_observables_reader::read_binary_obs() { try - { - for(int i = 0; i < 12; i++) + { + for (int i = 0; i < 12; i++) { d_dump_file.read(reinterpret_cast(&gps_time_sec[i]), sizeof(double)); d_dump_file.read(reinterpret_cast(&doppler_l1_hz), sizeof(double)); @@ -45,11 +45,11 @@ bool true_observables_reader::read_binary_obs() d_dump_file.read(reinterpret_cast(&carrier_phase_l1_cycles[i]), sizeof(double)); d_dump_file.read(reinterpret_cast(&prn[i]), sizeof(double)); } - } + } catch (const std::ifstream::failure &e) - { + { return false; - } + } return true; } @@ -72,9 +72,9 @@ bool true_observables_reader::restart() long int true_observables_reader::num_epochs() { std::ifstream::pos_type size; - int number_of_vars_in_epoch = 6*12; + int number_of_vars_in_epoch = 6 * 12; int epoch_size_bytes = sizeof(double) * number_of_vars_in_epoch; - std::ifstream tmpfile( d_dump_filename.c_str(), std::ios::binary | std::ios::ate); + std::ifstream tmpfile(d_dump_filename.c_str(), std::ios::binary | std::ios::ate); if (tmpfile.is_open()) { size = tmpfile.tellg(); @@ -93,18 +93,18 @@ bool true_observables_reader::open_obs_file(std::string out_file) if (d_dump_file.is_open() == false) { try - { + { d_dump_filename = out_file; - d_dump_file.exceptions( std::ifstream::failbit | std::ifstream::badbit ); + d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); d_dump_file.open(d_dump_filename.c_str(), std::ios::in | std::ios::binary); std::cout << "True observables Log file opened: " << d_dump_filename.c_str() << std::endl; return true; - } - catch (const std::ifstream::failure & e) - { + } + catch (const std::ifstream::failure &e) + { std::cout << "Problem opening True observables Log file: " << d_dump_filename.c_str() << std::endl; return false; - } + } } else { diff --git a/src/tests/unit-tests/signal-processing-blocks/libs/true_observables_reader.h b/src/tests/unit-tests/signal-processing-blocks/libs/true_observables_reader.h index acdcda139..864e1fe3a 100644 --- a/src/tests/unit-tests/signal-processing-blocks/libs/true_observables_reader.h +++ b/src/tests/unit-tests/signal-processing-blocks/libs/true_observables_reader.h @@ -57,4 +57,4 @@ private: std::ifstream d_dump_file; }; -#endif //GNSS_SDR_TRUE_OBSERVABLES_READER_H +#endif //GNSS_SDR_TRUE_OBSERVABLES_READER_H diff --git a/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test.cc b/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test.cc index 3f5923460..af29edce9 100644 --- a/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test.cc @@ -78,8 +78,7 @@ private: public: int rx_message; - ~HybridObservablesTest_msg_rx(); //!< Default destructor - + ~HybridObservablesTest_msg_rx(); //!< Default destructor }; HybridObservablesTest_msg_rx_sptr HybridObservablesTest_msg_rx_make() @@ -90,19 +89,18 @@ HybridObservablesTest_msg_rx_sptr HybridObservablesTest_msg_rx_make() void HybridObservablesTest_msg_rx::msg_handler_events(pmt::pmt_t msg) { try - { + { long int message = pmt::to_long(msg); rx_message = message; - } - catch(boost::bad_any_cast& e) - { + } + catch (boost::bad_any_cast& e) + { LOG(WARNING) << "msg_handler_telemetry Bad any cast!"; rx_message = 0; - } + } } -HybridObservablesTest_msg_rx::HybridObservablesTest_msg_rx() : - gr::block("HybridObservablesTest_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0)) +HybridObservablesTest_msg_rx::HybridObservablesTest_msg_rx() : gr::block("HybridObservablesTest_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0)) { this->message_port_register_in(pmt::mp("events")); this->set_msg_handler(pmt::mp("events"), boost::bind(&HybridObservablesTest_msg_rx::msg_handler_events, this, _1)); @@ -110,7 +108,8 @@ HybridObservablesTest_msg_rx::HybridObservablesTest_msg_rx() : } HybridObservablesTest_msg_rx::~HybridObservablesTest_msg_rx() -{} +{ +} // ########################################################### @@ -132,8 +131,7 @@ private: public: int rx_message; - ~HybridObservablesTest_tlm_msg_rx(); //!< Default destructor - + ~HybridObservablesTest_tlm_msg_rx(); //!< Default destructor }; HybridObservablesTest_tlm_msg_rx_sptr HybridObservablesTest_tlm_msg_rx_make() @@ -144,19 +142,18 @@ HybridObservablesTest_tlm_msg_rx_sptr HybridObservablesTest_tlm_msg_rx_make() void HybridObservablesTest_tlm_msg_rx::msg_handler_events(pmt::pmt_t msg) { try - { + { long int message = pmt::to_long(msg); rx_message = message; - } - catch(boost::bad_any_cast& e) - { + } + catch (boost::bad_any_cast& e) + { LOG(WARNING) << "msg_handler_telemetry Bad any cast!"; rx_message = 0; - } + } } -HybridObservablesTest_tlm_msg_rx::HybridObservablesTest_tlm_msg_rx() : - gr::block("HybridObservablesTest_tlm_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0)) +HybridObservablesTest_tlm_msg_rx::HybridObservablesTest_tlm_msg_rx() : gr::block("HybridObservablesTest_tlm_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0)) { this->message_port_register_in(pmt::mp("events")); this->set_msg_handler(pmt::mp("events"), boost::bind(&HybridObservablesTest_tlm_msg_rx::msg_handler_events, this, _1)); @@ -164,15 +161,15 @@ HybridObservablesTest_tlm_msg_rx::HybridObservablesTest_tlm_msg_rx() : } HybridObservablesTest_tlm_msg_rx::~HybridObservablesTest_tlm_msg_rx() -{} +{ +} // ########################################################### -class HybridObservablesTest: public ::testing::Test +class HybridObservablesTest : public ::testing::Test { - public: std::string generator_binary; std::string p1; @@ -189,18 +186,18 @@ public: int configure_generator(); int generate_signal(); void check_results_carrier_phase( - arma::vec & true_ch0_phase_cycles, - arma::vec & true_ch1_phase_cycles, - arma::vec & true_ch0_tow_s, - arma::vec & measuded_ch0_phase_cycles, - arma::vec & measuded_ch1_phase_cycles, - arma::vec & measuded_ch0_RX_time_s); + arma::vec& true_ch0_phase_cycles, + arma::vec& true_ch1_phase_cycles, + arma::vec& true_ch0_tow_s, + arma::vec& measuded_ch0_phase_cycles, + arma::vec& measuded_ch1_phase_cycles, + arma::vec& measuded_ch0_RX_time_s); void check_results_code_psudorange( - arma::vec & true_ch0_dist_m, arma::vec & true_ch1_dist_m, - arma::vec & true_ch0_tow_s, - arma::vec & measuded_ch0_Pseudorange_m, - arma::vec & measuded_ch1_Pseudorange_m, - arma::vec & measuded_ch0_RX_time_s); + arma::vec& true_ch0_dist_m, arma::vec& true_ch1_dist_m, + arma::vec& true_ch0_tow_s, + arma::vec& measuded_ch0_Pseudorange_m, + arma::vec& measuded_ch1_Pseudorange_m, + arma::vec& measuded_ch0_RX_time_s); HybridObservablesTest() { @@ -212,7 +209,8 @@ public: } ~HybridObservablesTest() - {} + { + } void configure_receiver(); @@ -230,7 +228,7 @@ int HybridObservablesTest::configure_generator() generator_binary = FLAGS_generator_binary; p1 = std::string("-rinex_nav_file=") + FLAGS_rinex_nav_file; - if(FLAGS_dynamic_position.empty()) + if (FLAGS_dynamic_position.empty()) { p2 = std::string("-static_position=") + FLAGS_static_position + std::string(",") + std::to_string(FLAGS_duration * 10); } @@ -238,9 +236,9 @@ int HybridObservablesTest::configure_generator() { p2 = std::string("-obs_pos_file=") + std::string(FLAGS_dynamic_position); } - p3 = std::string("-rinex_obs_file=") + FLAGS_filename_rinex_obs; // RINEX 2.10 observation file output - p4 = std::string("-sig_out_file=") + FLAGS_filename_raw_data; // Baseband signal output file. Will be stored in int8_t IQ multiplexed samples - p5 = std::string("-sampling_freq=") + std::to_string(baseband_sampling_freq); //Baseband sampling frequency [MSps] + p3 = std::string("-rinex_obs_file=") + FLAGS_filename_rinex_obs; // RINEX 2.10 observation file output + p4 = std::string("-sig_out_file=") + FLAGS_filename_raw_data; // Baseband signal output file. Will be stored in int8_t IQ multiplexed samples + p5 = std::string("-sampling_freq=") + std::to_string(baseband_sampling_freq); //Baseband sampling frequency [MSps] return 0; } @@ -249,7 +247,7 @@ int HybridObservablesTest::generate_signal() { int child_status; - char *const parmList[] = { &generator_binary[0], &generator_binary[0], &p1[0], &p2[0], &p3[0], &p4[0], &p5[0], NULL }; + char* const parmList[] = {&generator_binary[0], &generator_binary[0], &p1[0], &p2[0], &p3[0], &p4[0], &p5[0], NULL}; int pid; if ((pid = fork()) == -1) @@ -263,7 +261,7 @@ int HybridObservablesTest::generate_signal() waitpid(pid, &child_status, 0); - std::cout << "Signal and Observables RINEX and RAW files created." << std::endl; + std::cout << "Signal and Observables RINEX and RAW files created." << std::endl; return 0; } @@ -293,19 +291,17 @@ void HybridObservablesTest::configure_receiver() config->set_property("Tracking_1C.dll_bw_hz", "0.5"); config->set_property("Tracking_1C.early_late_space_chips", "0.5"); - config->set_property("TelemetryDecoder_1C.dump","true"); - config->set_property("Observables.dump","true"); - - + config->set_property("TelemetryDecoder_1C.dump", "true"); + config->set_property("Observables.dump", "true"); } void HybridObservablesTest::check_results_carrier_phase( - arma::vec & true_ch0_phase_cycles, - arma::vec & true_ch1_phase_cycles, - arma::vec & true_ch0_tow_s, - arma::vec & measuded_ch0_phase_cycles, - arma::vec & measuded_ch1_phase_cycles, - arma::vec & measuded_ch0_RX_time_s) + arma::vec& true_ch0_phase_cycles, + arma::vec& true_ch1_phase_cycles, + arma::vec& true_ch0_tow_s, + arma::vec& measuded_ch0_phase_cycles, + arma::vec& measuded_ch1_phase_cycles, + arma::vec& measuded_ch0_RX_time_s) { //1. True value interpolation to match the measurement times @@ -353,7 +349,7 @@ void HybridObservablesTest::check_results_carrier_phase( << " (max,min)=" << max_error_ch0 << "," << min_error_ch0 << " [cycles]" << std::endl; - std::cout.precision (ss); + std::cout.precision(ss); ASSERT_LT(rmse_ch0, 1e-2); ASSERT_LT(error_mean_ch0, 1e-2); @@ -370,7 +366,7 @@ void HybridObservablesTest::check_results_carrier_phase( << " (max,min)=" << max_error_ch1 << "," << min_error_ch1 << " [cycles]" << std::endl; - std::cout.precision (ss); + std::cout.precision(ss); ASSERT_LT(rmse_ch1, 1e-2); ASSERT_LT(error_mean_ch1, 1e-2); @@ -382,12 +378,12 @@ void HybridObservablesTest::check_results_carrier_phase( void HybridObservablesTest::check_results_code_psudorange( - arma::vec & true_ch0_dist_m, - arma::vec & true_ch1_dist_m, - arma::vec & true_ch0_tow_s, - arma::vec & measuded_ch0_Pseudorange_m, - arma::vec & measuded_ch1_Pseudorange_m, - arma::vec & measuded_ch0_RX_time_s) + arma::vec& true_ch0_dist_m, + arma::vec& true_ch1_dist_m, + arma::vec& true_ch0_tow_s, + arma::vec& measuded_ch0_Pseudorange_m, + arma::vec& measuded_ch1_Pseudorange_m, + arma::vec& measuded_ch0_RX_time_s) { //1. True value interpolation to match the measurement times @@ -397,8 +393,8 @@ void HybridObservablesTest::check_results_code_psudorange( arma::interp1(true_ch0_tow_s, true_ch1_dist_m, measuded_ch0_RX_time_s, true_ch1_dist_interp); // generate delta pseudoranges - arma::vec delta_true_dist_m = true_ch0_dist_interp-true_ch1_dist_interp; - arma::vec delta_measured_dist_m = measuded_ch0_Pseudorange_m-measuded_ch1_Pseudorange_m; + arma::vec delta_true_dist_m = true_ch0_dist_interp - true_ch1_dist_interp; + arma::vec delta_measured_dist_m = measuded_ch0_Pseudorange_m - measuded_ch1_Pseudorange_m; //2. RMSE arma::vec err; @@ -423,7 +419,7 @@ void HybridObservablesTest::check_results_code_psudorange( << " (max,min)=" << max_error << "," << min_error << " [meters]" << std::endl; - std::cout.precision (ss); + std::cout.precision(ss); ASSERT_LT(rmse, 0.5); ASSERT_LT(error_mean, 0.5); @@ -440,7 +436,7 @@ TEST_F(HybridObservablesTest, ValidationOfResults) configure_generator(); // Generate signal raw signal samples and observations RINEX file - if (FLAGS_disable_generator==false) + if (FLAGS_disable_generator == false) { generate_signal(); } @@ -455,7 +451,7 @@ TEST_F(HybridObservablesTest, ValidationOfResults) tracking_true_obs_reader true_obs_data_ch1; int test_satellite_PRN = FLAGS_test_satellite_PRN; int test_satellite_PRN2 = FLAGS_test_satellite_PRN2; - std::cout << "Testing satellite PRNs " << test_satellite_PRN <<","< tlm_ch0(new GpsL1CaTelemetryDecoder(config.get(), "TelemetryDecoder_1C",1, 1)); - std::shared_ptr tlm_ch1(new GpsL1CaTelemetryDecoder(config.get(), "TelemetryDecoder_1C",1, 1)); + std::shared_ptr tlm_ch0(new GpsL1CaTelemetryDecoder(config.get(), "TelemetryDecoder_1C", 1, 1)); + std::shared_ptr tlm_ch1(new GpsL1CaTelemetryDecoder(config.get(), "TelemetryDecoder_1C", 1, 1)); - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ tlm_ch0->set_channel(0); tlm_ch1->set_channel(1); - tlm_ch0->set_satellite(Gnss_Satellite(std::string("GPS"),gnss_synchro_ch0.PRN)); - tlm_ch1->set_satellite(Gnss_Satellite(std::string("GPS"),gnss_synchro_ch1.PRN)); + tlm_ch0->set_satellite(Gnss_Satellite(std::string("GPS"), gnss_synchro_ch0.PRN)); + tlm_ch1->set_satellite(Gnss_Satellite(std::string("GPS"), gnss_synchro_ch1.PRN)); }) << "Failure setting gnss_synchro."; boost::shared_ptr tlm_msg_rx_ch1 = HybridObservablesTest_tlm_msg_rx_make(); boost::shared_ptr tlm_msg_rx_ch2 = HybridObservablesTest_tlm_msg_rx_make(); //Observables - std::shared_ptr observables(new HybridObservables(config.get(), "Observables",2, 2)); + std::shared_ptr observables(new HybridObservables(config.get(), "Observables", 2, 2)); - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ tracking_ch0->set_channel(gnss_synchro_ch0.Channel_ID); tracking_ch1->set_channel(gnss_synchro_ch1.Channel_ID); }) << "Failure setting channel."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ tracking_ch0->set_gnss_synchro(&gnss_synchro_ch0); tracking_ch1->set_gnss_synchro(&gnss_synchro_ch1); }) << "Failure setting gnss_synchro."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ tracking_ch0->connect(top_block); tracking_ch1->connect(top_block); }) << "Failure connecting tracking to the top_block."; - ASSERT_NO_THROW( { - std::string file = "./" + filename_raw_data; - const char * file_name = file.c_str(); + ASSERT_NO_THROW({ + std::string file = "./" + filename_raw_data; + const char* file_name = file.c_str(); gr::blocks::file_source::sptr file_source = gr::blocks::file_source::make(sizeof(int8_t), file_name, false); - gr::blocks::interleaved_char_to_complex::sptr gr_interleaved_char_to_complex = gr::blocks::interleaved_char_to_complex::make(); + gr::blocks::interleaved_char_to_complex::sptr gr_interleaved_char_to_complex = gr::blocks::interleaved_char_to_complex::make(); gr::blocks::null_sink::sptr sink_ch0 = gr::blocks::null_sink::make(sizeof(Gnss_Synchro)); gr::blocks::null_sink::sptr sink_ch1 = gr::blocks::null_sink::make(sizeof(Gnss_Synchro)); top_block->connect(file_source, 0, gr_interleaved_char_to_complex, 0); @@ -570,15 +566,14 @@ TEST_F(HybridObservablesTest, ValidationOfResults) top_block->connect(observables->get_right_block(), 0, sink_ch0, 0); top_block->connect(observables->get_right_block(), 1, sink_ch1, 0); - }) << "Failure connecting the blocks."; tracking_ch0->start_tracking(); tracking_ch1->start_tracking(); - EXPECT_NO_THROW( { + EXPECT_NO_THROW({ start = std::chrono::system_clock::now(); - top_block->run(); // Start threads and wait + top_block->run(); // Start threads and wait end = std::chrono::system_clock::now(); elapsed_seconds = end - start; }) << "Failure running the top_block."; @@ -589,7 +584,7 @@ TEST_F(HybridObservablesTest, ValidationOfResults) true_observables_reader true_observables; ASSERT_NO_THROW({ - if ( true_observables.open_obs_file(std::string("./obs_out.bin")) == false) + if (true_observables.open_obs_file(std::string("./obs_out.bin")) == false) { throw std::exception(); }; @@ -610,34 +605,34 @@ TEST_F(HybridObservablesTest, ValidationOfResults) true_observables.restart(); long int epoch_counter = 0; ASSERT_NO_THROW({ - while(true_observables.read_binary_obs()) - { - if (round(true_observables.prn[0])!=gnss_synchro_ch0.PRN) - { - std::cout<<"True observables SV PRN do not match"<= true_ch0_tow_s(0), 1, "first"); @@ -697,29 +692,28 @@ TEST_F(HybridObservablesTest, ValidationOfResults) //find the reference satellite and compute the receiver time offset at obsevable level arma::vec receiver_time_offset_s; - if (measuded_ch0_Pseudorange_m(0) pvt_solution = std::make_shared(); boost::posix_time::ptime pt(boost::gregorian::date(1994, boost::date_time::Nov, 19), - boost::posix_time::hours(22) + boost::posix_time::minutes(54) + boost::posix_time::seconds(46)); // example from http://aprs.gids.nl/nmea/#rmc + boost::posix_time::hours(22) + boost::posix_time::minutes(54) + boost::posix_time::seconds(46)); // example from http://aprs.gids.nl/nmea/#rmc pvt_solution->set_position_UTC_time(pt); arma::vec pos = {49.27416667, -123.18533333, 0}; @@ -50,17 +50,17 @@ TEST(NmeaPrinterTest, PrintLine) pvt_solution->set_valid_position(true); - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ std::shared_ptr nmea_printer = std::make_shared(filename, false, ""); nmea_printer->Print_Nmea_Line(pvt_solution, false); - } ) << "Failure printing NMEA messages."; + }) << "Failure printing NMEA messages."; std::ifstream test_file(filename); std::string line; std::string GPRMC("$GPRMC"); - if(test_file.is_open()) + if (test_file.is_open()) { - while(getline (test_file,line)) + while (getline(test_file, line)) { std::size_t found = line.find(GPRMC); if (found != std::string::npos) @@ -74,7 +74,6 @@ TEST(NmeaPrinterTest, PrintLine) } - TEST(NmeaPrinterTest, PrintLineLessthan10min) { std::string filename("nmea_test.nmea"); @@ -82,7 +81,7 @@ TEST(NmeaPrinterTest, PrintLineLessthan10min) std::shared_ptr pvt_solution = std::make_shared(); boost::posix_time::ptime pt(boost::gregorian::date(1994, boost::date_time::Nov, 19), - boost::posix_time::hours(22) + boost::posix_time::minutes(54) + boost::posix_time::seconds(46)); // example from http://aprs.gids.nl/nmea/#rmc + boost::posix_time::hours(22) + boost::posix_time::minutes(54) + boost::posix_time::seconds(46)); // example from http://aprs.gids.nl/nmea/#rmc pvt_solution->set_position_UTC_time(pt); arma::vec pos = {49.07416667, -123.02527778, 0}; @@ -90,17 +89,17 @@ TEST(NmeaPrinterTest, PrintLineLessthan10min) pvt_solution->set_valid_position(true); - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ std::shared_ptr nmea_printer = std::make_shared(filename, false, ""); nmea_printer->Print_Nmea_Line(pvt_solution, false); - } ) << "Failure printing NMEA messages."; + }) << "Failure printing NMEA messages."; std::ifstream test_file(filename); std::string line; std::string GPRMC("$GPRMC"); - if(test_file.is_open()) + if (test_file.is_open()) { - while(getline (test_file,line)) + while (getline(test_file, line)) { std::size_t found = line.find(GPRMC); if (found != std::string::npos) diff --git a/src/tests/unit-tests/signal-processing-blocks/pvt/rinex_printer_test.cc b/src/tests/unit-tests/signal-processing-blocks/pvt/rinex_printer_test.cc index 0652249e0..605f606c0 100644 --- a/src/tests/unit-tests/signal-processing-blocks/pvt/rinex_printer_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/pvt/rinex_printer_test.cc @@ -44,10 +44,10 @@ TEST(RinexPrinterTest, GalileoObsHeader) rp1->rinex_obs_header(rp1->obsFile, eph, 0.0); rp1->obsFile.seekp(0); - while(!rp1->obsFile.eof()) + while (!rp1->obsFile.eof()) { std::getline(rp1->obsFile, line_str); - if(!no_more_finds) + if (!no_more_finds) { if (line_str.find("SYS / # / OBS TYPES", 59) != std::string::npos) { @@ -58,7 +58,7 @@ TEST(RinexPrinterTest, GalileoObsHeader) } std::string expected_str("E 4 C1B L1B D1B S1B SYS / # / OBS TYPES "); EXPECT_EQ(0, expected_str.compare(line_aux)); - if(remove(rp1->obsfilename.c_str()) != 0) LOG(INFO) << "Error deleting temporary file"; + if (remove(rp1->obsfilename.c_str()) != 0) LOG(INFO) << "Error deleting temporary file"; line_aux.clear(); std::shared_ptr rp2; @@ -67,10 +67,10 @@ TEST(RinexPrinterTest, GalileoObsHeader) rp2->rinex_obs_header(rp2->obsFile, eph, 0.0, bands); rp2->obsFile.seekp(0); no_more_finds = false; - while(!rp2->obsFile.eof()) + while (!rp2->obsFile.eof()) { std::getline(rp2->obsFile, line_str); - if(!no_more_finds) + if (!no_more_finds) { if (line_str.find("SYS / # / OBS TYPES", 59) != std::string::npos) { @@ -82,7 +82,7 @@ TEST(RinexPrinterTest, GalileoObsHeader) std::string expected_str2("E 12 C1B L1B D1B S1B C5X L5X D5X S5X C7X L7X D7X S7X SYS / # / OBS TYPES "); EXPECT_EQ(0, expected_str2.compare(line_aux)); - if(remove(rp2->obsfilename.c_str()) != 0) LOG(INFO) << "Error deleting temporary file"; + if (remove(rp2->obsfilename.c_str()) != 0) LOG(INFO) << "Error deleting temporary file"; } @@ -99,10 +99,10 @@ TEST(RinexPrinterTest, GlonassObsHeader) rp1->rinex_obs_header(rp1->obsFile, eph, 0.0, bands); rp1->obsFile.seekp(0); - while(!rp1->obsFile.eof()) + while (!rp1->obsFile.eof()) { std::getline(rp1->obsFile, line_str); - if(!no_more_finds) + if (!no_more_finds) { if (line_str.find("SYS / # / OBS TYPES", 59) != std::string::npos) { @@ -113,7 +113,7 @@ TEST(RinexPrinterTest, GlonassObsHeader) } std::string expected_str("R 4 C1C L1C D1C S1C SYS / # / OBS TYPES "); EXPECT_EQ(0, expected_str.compare(line_aux)); - if(remove(rp1->obsfilename.c_str()) != 0) LOG(INFO) << "Error deleting temporary file"; + if (remove(rp1->obsfilename.c_str()) != 0) LOG(INFO) << "Error deleting temporary file"; line_aux.clear(); } @@ -133,19 +133,19 @@ TEST(RinexPrinterTest, MixedObsHeader) rp1->obsFile.seekp(0); int systems_found = 0; - while(!rp1->obsFile.eof()) + while (!rp1->obsFile.eof()) { std::getline(rp1->obsFile, line_str); - if(!no_more_finds) + if (!no_more_finds) { if (line_str.find("SYS / # / OBS TYPES", 59) != std::string::npos) { systems_found++; - if(systems_found == 1) + if (systems_found == 1) { line_aux = std::string(line_str); } - if(systems_found == 2) + if (systems_found == 2) { line_aux2 = std::string(line_str); no_more_finds = true; @@ -158,7 +158,7 @@ TEST(RinexPrinterTest, MixedObsHeader) std::string expected_str2("E 8 C1B L1B D1B S1B C5X L5X D5X S5X SYS / # / OBS TYPES "); EXPECT_EQ(0, expected_str.compare(line_aux)); EXPECT_EQ(0, expected_str2.compare(line_aux2)); - if(remove(rp1->obsfilename.c_str()) != 0) LOG(INFO) << "Error deleting temporary file"; + if (remove(rp1->obsfilename.c_str()) != 0) LOG(INFO) << "Error deleting temporary file"; } @@ -177,19 +177,19 @@ TEST(RinexPrinterTest, MixedObsHeaderGpsGlo) rp1->obsFile.seekp(0); int systems_found = 0; - while(!rp1->obsFile.eof()) + while (!rp1->obsFile.eof()) { std::getline(rp1->obsFile, line_str); - if(!no_more_finds) + if (!no_more_finds) { if (line_str.find("SYS / # / OBS TYPES", 59) != std::string::npos) { systems_found++; - if(systems_found == 1) + if (systems_found == 1) { line_aux = std::string(line_str); } - if(systems_found == 2) + if (systems_found == 2) { line_aux2 = std::string(line_str); no_more_finds = true; @@ -202,7 +202,7 @@ TEST(RinexPrinterTest, MixedObsHeaderGpsGlo) std::string expected_str2("R 4 C1C L1C D1C S1C SYS / # / OBS TYPES "); EXPECT_EQ(0, expected_str.compare(line_aux)); EXPECT_EQ(0, expected_str2.compare(line_aux2)); - if(remove(rp1->obsfilename.c_str()) != 0) LOG(INFO) << "Error deleting temporary file"; + if (remove(rp1->obsfilename.c_str()) != 0) LOG(INFO) << "Error deleting temporary file"; } @@ -217,7 +217,7 @@ TEST(RinexPrinterTest, GalileoObsLog) rp = std::make_shared(); rp->rinex_obs_header(rp->obsFile, eph, 0.0); - std::map gnss_pseudoranges_map; + std::map gnss_pseudoranges_map; Gnss_Synchro gs1 = Gnss_Synchro(); Gnss_Synchro gs2 = Gnss_Synchro(); @@ -246,18 +246,18 @@ TEST(RinexPrinterTest, GalileoObsLog) gs4.Carrier_Doppler_hz = 1534; gs4.CN0_dB_hz = 42; - gnss_pseudoranges_map.insert( std::pair(1,gs1) ); - gnss_pseudoranges_map.insert( std::pair(2,gs2) ); - gnss_pseudoranges_map.insert( std::pair(3,gs3) ); - gnss_pseudoranges_map.insert( std::pair(4,gs4) ); + gnss_pseudoranges_map.insert(std::pair(1, gs1)); + gnss_pseudoranges_map.insert(std::pair(2, gs2)); + gnss_pseudoranges_map.insert(std::pair(3, gs3)); + gnss_pseudoranges_map.insert(std::pair(4, gs4)); rp->log_rinex_obs(rp->obsFile, eph, 0.0, gnss_pseudoranges_map); rp->obsFile.seekp(0); - while(!rp->obsFile.eof()) + while (!rp->obsFile.eof()) { std::getline(rp->obsFile, line_str); - if(!no_more_finds) + if (!no_more_finds) { if (line_str.find("E22", 0) != std::string::npos) { @@ -270,7 +270,7 @@ TEST(RinexPrinterTest, GalileoObsLog) std::string expected_str("E22 22000000.000 7 3.724 7 1534.000 7 42.000 "); EXPECT_EQ(0, expected_str.compare(line_aux)); - if(remove(rp->obsfilename.c_str()) != 0) LOG(INFO) << "Error deleting temporary file"; + if (remove(rp->obsfilename.c_str()) != 0) LOG(INFO) << "Error deleting temporary file"; } @@ -285,7 +285,7 @@ TEST(RinexPrinterTest, GlonassObsLog) rp = std::make_shared(); rp->rinex_obs_header(rp->obsFile, eph, 0.0); - std::map gnss_pseudoranges_map; + std::map gnss_pseudoranges_map; Gnss_Synchro gs1 = Gnss_Synchro(); Gnss_Synchro gs2 = Gnss_Synchro(); @@ -314,18 +314,18 @@ TEST(RinexPrinterTest, GlonassObsLog) gs4.Carrier_Doppler_hz = 1534; gs4.CN0_dB_hz = 42; - gnss_pseudoranges_map.insert( std::pair(1,gs1) ); - gnss_pseudoranges_map.insert( std::pair(2,gs2) ); - gnss_pseudoranges_map.insert( std::pair(3,gs3) ); - gnss_pseudoranges_map.insert( std::pair(4,gs4) ); + gnss_pseudoranges_map.insert(std::pair(1, gs1)); + gnss_pseudoranges_map.insert(std::pair(2, gs2)); + gnss_pseudoranges_map.insert(std::pair(3, gs3)); + gnss_pseudoranges_map.insert(std::pair(4, gs4)); rp->log_rinex_obs(rp->obsFile, eph, 0.0, gnss_pseudoranges_map); rp->obsFile.seekp(0); - while(!rp->obsFile.eof()) + while (!rp->obsFile.eof()) { std::getline(rp->obsFile, line_str); - if(!no_more_finds) + if (!no_more_finds) { if (line_str.find("R22", 0) != std::string::npos) { @@ -338,7 +338,7 @@ TEST(RinexPrinterTest, GlonassObsLog) std::string expected_str("R22 22000000.000 7 3.724 7 1534.000 7 42.000 "); EXPECT_EQ(0, expected_str.compare(line_aux)); - if(remove(rp->obsfilename.c_str()) != 0) LOG(INFO) << "Error deleting temporary file"; + if (remove(rp->obsfilename.c_str()) != 0) LOG(INFO) << "Error deleting temporary file"; } @@ -354,7 +354,7 @@ TEST(RinexPrinterTest, GpsObsLogDualBand) rp = std::make_shared(); rp->rinex_obs_header(rp->obsFile, eph_gps, eph_cnav, 0.0); - std::map gnss_pseudoranges_map; + std::map gnss_pseudoranges_map; Gnss_Synchro gs1 = Gnss_Synchro(); Gnss_Synchro gs2 = Gnss_Synchro(); @@ -395,18 +395,18 @@ TEST(RinexPrinterTest, GpsObsLogDualBand) gs3.Carrier_Doppler_hz = -1534; gs3.CN0_dB_hz = 47; - gnss_pseudoranges_map.insert( std::pair(1,gs1) ); - gnss_pseudoranges_map.insert( std::pair(2,gs2) ); - gnss_pseudoranges_map.insert( std::pair(3,gs3) ); - gnss_pseudoranges_map.insert( std::pair(4,gs4) ); + gnss_pseudoranges_map.insert(std::pair(1, gs1)); + gnss_pseudoranges_map.insert(std::pair(2, gs2)); + gnss_pseudoranges_map.insert(std::pair(3, gs3)); + gnss_pseudoranges_map.insert(std::pair(4, gs4)); rp->log_rinex_obs(rp->obsFile, eph_gps, eph_cnav, 0.0, gnss_pseudoranges_map); rp->obsFile.seekp(0); - while(!rp->obsFile.eof()) + while (!rp->obsFile.eof()) { std::getline(rp->obsFile, line_str); - if(!no_more_finds) + if (!no_more_finds) { if (line_str.find("G08", 0) != std::string::npos) { @@ -419,8 +419,7 @@ TEST(RinexPrinterTest, GpsObsLogDualBand) std::string expected_str("G08 22000002.100 6 7.226 6 321.000 6 39.000 22000000.000 7 3.724 7 1534.000 7 42.000"); EXPECT_EQ(0, expected_str.compare(line_aux)); - if(remove(rp->obsfilename.c_str()) != 0) LOG(INFO) << "Error deleting temporary file"; - + if (remove(rp->obsfilename.c_str()) != 0) LOG(INFO) << "Error deleting temporary file"; } @@ -436,7 +435,7 @@ TEST(RinexPrinterTest, GalileoObsLogDualBand) std::string bands("1B 5X"); rp->rinex_obs_header(rp->obsFile, eph, 0.0, bands); - std::map gnss_pseudoranges_map; + std::map gnss_pseudoranges_map; Gnss_Synchro gs1 = Gnss_Synchro(); Gnss_Synchro gs2 = Gnss_Synchro(); @@ -477,18 +476,18 @@ TEST(RinexPrinterTest, GalileoObsLogDualBand) gs4.Carrier_Doppler_hz = 1534; gs4.CN0_dB_hz = 42; - gnss_pseudoranges_map.insert( std::pair(1,gs1) ); - gnss_pseudoranges_map.insert( std::pair(2,gs2) ); - gnss_pseudoranges_map.insert( std::pair(3,gs3) ); - gnss_pseudoranges_map.insert( std::pair(4,gs4) ); + gnss_pseudoranges_map.insert(std::pair(1, gs1)); + gnss_pseudoranges_map.insert(std::pair(2, gs2)); + gnss_pseudoranges_map.insert(std::pair(3, gs3)); + gnss_pseudoranges_map.insert(std::pair(4, gs4)); rp->log_rinex_obs(rp->obsFile, eph, 0.0, gnss_pseudoranges_map, bands); rp->obsFile.seekp(0); - while(!rp->obsFile.eof()) + while (!rp->obsFile.eof()) { std::getline(rp->obsFile, line_str); - if(!no_more_finds) + if (!no_more_finds) { if (line_str.find("E08", 0) != std::string::npos) { @@ -501,11 +500,10 @@ TEST(RinexPrinterTest, GalileoObsLogDualBand) std::string expected_str("E08 22000002.100 6 7.226 6 321.000 6 39.000 22000000.000 7 3.724 7 1534.000 7 42.000"); EXPECT_EQ(0, expected_str.compare(line_aux)); - if(remove(rp->obsfilename.c_str()) != 0) LOG(INFO) << "Error deleting temporary file"; + if (remove(rp->obsfilename.c_str()) != 0) LOG(INFO) << "Error deleting temporary file"; } - TEST(RinexPrinterTest, MixedObsLog) { std::string line_aux; @@ -518,7 +516,7 @@ TEST(RinexPrinterTest, MixedObsLog) rp = std::make_shared(); rp->rinex_obs_header(rp->obsFile, eph_gps, eph_gal, 0.0, "1B 5X"); - std::map gnss_pseudoranges_map; + std::map gnss_pseudoranges_map; Gnss_Synchro gs1 = Gnss_Synchro(); Gnss_Synchro gs2 = Gnss_Synchro(); @@ -584,23 +582,23 @@ TEST(RinexPrinterTest, MixedObsLog) gs8.Carrier_Doppler_hz = -20; gs8.CN0_dB_hz = 42; - gnss_pseudoranges_map.insert( std::pair(1,gs1) ); - gnss_pseudoranges_map.insert( std::pair(2,gs2) ); - gnss_pseudoranges_map.insert( std::pair(3,gs3) ); - gnss_pseudoranges_map.insert( std::pair(4,gs4) ); - gnss_pseudoranges_map.insert( std::pair(5,gs5) ); - gnss_pseudoranges_map.insert( std::pair(6,gs6) ); - gnss_pseudoranges_map.insert( std::pair(7,gs7) ); - gnss_pseudoranges_map.insert( std::pair(8,gs8) ); + gnss_pseudoranges_map.insert(std::pair(1, gs1)); + gnss_pseudoranges_map.insert(std::pair(2, gs2)); + gnss_pseudoranges_map.insert(std::pair(3, gs3)); + gnss_pseudoranges_map.insert(std::pair(4, gs4)); + gnss_pseudoranges_map.insert(std::pair(5, gs5)); + gnss_pseudoranges_map.insert(std::pair(6, gs6)); + gnss_pseudoranges_map.insert(std::pair(7, gs7)); + gnss_pseudoranges_map.insert(std::pair(8, gs8)); rp->log_rinex_obs(rp->obsFile, eph_gps, eph_gal, 0.0, gnss_pseudoranges_map); rp->obsFile.seekp(0); - while(!rp->obsFile.eof()) + while (!rp->obsFile.eof()) { std::getline(rp->obsFile, line_str); - if(!no_more_finds) + if (!no_more_finds) { if (line_str.find("E16", 0) != std::string::npos) { @@ -612,7 +610,7 @@ TEST(RinexPrinterTest, MixedObsLog) std::string expected_str("E16 22000000.000 7 0.127 7 -20.000 7 42.000 22000000.000 6 8.292 6 1534.000 6 41.000"); EXPECT_EQ(0, expected_str.compare(line_aux)); - if(remove(rp->obsfilename.c_str()) != 0) LOG(INFO) << "Error deleting temporary file"; + if (remove(rp->obsfilename.c_str()) != 0) LOG(INFO) << "Error deleting temporary file"; } @@ -628,7 +626,7 @@ TEST(RinexPrinterTest, MixedObsLogGpsGlo) rp = std::make_shared(); rp->rinex_obs_header(rp->obsFile, eph_gps, eph_glo, 0.0, "1G"); - std::map gnss_pseudoranges_map; + std::map gnss_pseudoranges_map; Gnss_Synchro gs1 = Gnss_Synchro(); Gnss_Synchro gs2 = Gnss_Synchro(); @@ -692,23 +690,23 @@ TEST(RinexPrinterTest, MixedObsLogGpsGlo) gs8.Carrier_Doppler_hz = -20; gs8.CN0_dB_hz = 42; - gnss_pseudoranges_map.insert( std::pair(1,gs1) ); - gnss_pseudoranges_map.insert( std::pair(2,gs2) ); - gnss_pseudoranges_map.insert( std::pair(3,gs3) ); - gnss_pseudoranges_map.insert( std::pair(4,gs4) ); - gnss_pseudoranges_map.insert( std::pair(5,gs5) ); - gnss_pseudoranges_map.insert( std::pair(6,gs6) ); - gnss_pseudoranges_map.insert( std::pair(7,gs7) ); - gnss_pseudoranges_map.insert( std::pair(8,gs8) ); + gnss_pseudoranges_map.insert(std::pair(1, gs1)); + gnss_pseudoranges_map.insert(std::pair(2, gs2)); + gnss_pseudoranges_map.insert(std::pair(3, gs3)); + gnss_pseudoranges_map.insert(std::pair(4, gs4)); + gnss_pseudoranges_map.insert(std::pair(5, gs5)); + gnss_pseudoranges_map.insert(std::pair(6, gs6)); + gnss_pseudoranges_map.insert(std::pair(7, gs7)); + gnss_pseudoranges_map.insert(std::pair(8, gs8)); rp->log_rinex_obs(rp->obsFile, eph_gps, eph_glo, 0.0, gnss_pseudoranges_map); rp->obsFile.seekp(0); - while(!rp->obsFile.eof()) + while (!rp->obsFile.eof()) { std::getline(rp->obsFile, line_str); - if(!no_more_finds) + if (!no_more_finds) { if (line_str.find("R16", 0) != std::string::npos) { @@ -721,5 +719,5 @@ TEST(RinexPrinterTest, MixedObsLogGpsGlo) std::string expected_str("R16 22000000.000 6 8.292 6 1534.000 6 41.000 22000000.000 7 0.127 7 -20.000 7 42.000"); EXPECT_EQ(0, expected_str.compare(line_aux)); - if(remove(rp->obsfilename.c_str()) != 0) LOG(INFO) << "Error deleting temporary file"; + if (remove(rp->obsfilename.c_str()) != 0) LOG(INFO) << "Error deleting temporary file"; } diff --git a/src/tests/unit-tests/signal-processing-blocks/pvt/rtcm_printer_test.cc b/src/tests/unit-tests/signal-processing-blocks/pvt/rtcm_printer_test.cc index 672474b6b..c3a0717bd 100644 --- a/src/tests/unit-tests/signal-processing-blocks/pvt/rtcm_printer_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/pvt/rtcm_printer_test.cc @@ -61,13 +61,13 @@ TEST(RtcmPrinterTest, Run) /* Convert the reference message to binary data */ std::string reference_msg_binary; unsigned char c[1]; - for(unsigned int i = 0; i < reference_msg.length(); i = i + 2) + for (unsigned int i = 0; i < reference_msg.length(); i = i + 2) { unsigned long int n, n2; - std::istringstream(reference_msg.substr(i,1)) >> std::hex >> n; + std::istringstream(reference_msg.substr(i, 1)) >> std::hex >> n; std::istringstream(reference_msg.substr(i + 1, 1)) >> std::hex >> n2; - c[0] = static_cast(n * 16) + static_cast(n2); - std::string ret(c, c+1); + c[0] = static_cast(n * 16) + static_cast(n2); + std::string ret(c, c + 1); reference_msg_binary += ret; } @@ -75,6 +75,3 @@ TEST(RtcmPrinterTest, Run) EXPECT_EQ(0, reference_msg_binary.compare(testing_msg)); } - - - diff --git a/src/tests/unit-tests/signal-processing-blocks/pvt/rtcm_test.cc b/src/tests/unit-tests/signal-processing-blocks/pvt/rtcm_test.cc index fdc7084a4..44832da9f 100644 --- a/src/tests/unit-tests/signal-processing-blocks/pvt/rtcm_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/pvt/rtcm_test.cc @@ -98,7 +98,6 @@ TEST(RtcmTest, BinToHex) } - TEST(RtcmTest, HexToInt) { auto rtcm = std::make_shared(); @@ -114,7 +113,7 @@ TEST(RtcmTest, HexToUint) { auto rtcm = std::make_shared(); long unsigned int expected1 = 42; - EXPECT_EQ(expected1, rtcm->hex_to_uint(rtcm->bin_to_hex("00101010"))); + EXPECT_EQ(expected1, rtcm->hex_to_uint(rtcm->bin_to_hex("00101010"))); } @@ -161,7 +160,7 @@ TEST(RtcmTest, BinToBinaryData) std::string bin_str("1101101011010110"); std::string data_str = rtcm->bin_to_binary_data(bin_str); - std::string test_binary = data_str.substr(0,1); + std::string test_binary = data_str.substr(0, 1); std::string test_bin = rtcm->binary_data_to_bin(test_binary); std::string test_hex = rtcm->bin_to_hex(test_bin); EXPECT_EQ(0, test_hex.compare("DA")); @@ -253,7 +252,6 @@ TEST(RtcmTest, MT1005) } - TEST(RtcmTest, MT1019) { auto rtcm = std::make_shared(); @@ -271,7 +269,7 @@ TEST(RtcmTest, MT1019) EXPECT_EQ(0, rtcm->read_MT1019(tx_msg, gps_eph_read)); EXPECT_EQ(static_cast(3), gps_eph_read.i_satellite_PRN); EXPECT_DOUBLE_EQ(4, gps_eph_read.d_IODC); - EXPECT_DOUBLE_EQ( 2.0 * E_LSB, gps_eph_read.d_e_eccentricity); + EXPECT_DOUBLE_EQ(2.0 * E_LSB, gps_eph_read.d_e_eccentricity); EXPECT_EQ(expected_true, gps_eph_read.b_fit_interval_flag); EXPECT_EQ(1, rtcm->read_MT1019(rtcm->bin_to_binary_data(rtcm->hex_to_bin("FFFFFFFFFFF")), gps_eph_read)); } @@ -289,23 +287,23 @@ TEST(RtcmTest, MT1020) Glonass_Gnav_Utc_Model gnav_utc_model_read = Glonass_Gnav_Utc_Model(); // Perform data read and print of special values types - gnav_ephemeris.d_P_1 = 15; + gnav_ephemeris.d_P_1 = 15; // Bit distribution per fields - gnav_ephemeris.d_t_k = 7560; + gnav_ephemeris.d_t_k = 7560; // Glonass signed values - gnav_ephemeris.d_VXn = -0.490900039672852; + gnav_ephemeris.d_VXn = -0.490900039672852; // Bit distribution per fields dependant on other factors - gnav_ephemeris.d_t_b = 8100; + gnav_ephemeris.d_t_b = 8100; // Binary flag representation - gnav_ephemeris.d_P_3 = 1; + gnav_ephemeris.d_P_3 = 1; std::string tx_msg = rtcm->print_MT1020(gnav_ephemeris, gnav_utc_model); EXPECT_EQ(0, rtcm->read_MT1020(tx_msg, gnav_ephemeris_read, gnav_utc_model_read)); EXPECT_EQ(gnav_ephemeris.d_P_1, gnav_ephemeris_read.d_P_1); EXPECT_TRUE(gnav_ephemeris.d_t_b - gnav_ephemeris_read.d_t_b < FLT_EPSILON); - EXPECT_TRUE( gnav_ephemeris.d_VXn - gnav_ephemeris_read.d_VXn < FLT_EPSILON); - EXPECT_TRUE( gnav_ephemeris.d_t_k - gnav_ephemeris.d_t_k < FLT_EPSILON); + EXPECT_TRUE(gnav_ephemeris.d_VXn - gnav_ephemeris_read.d_VXn < FLT_EPSILON); + EXPECT_TRUE(gnav_ephemeris.d_t_k - gnav_ephemeris.d_t_k < FLT_EPSILON); EXPECT_EQ(gnav_ephemeris.d_P_3, gnav_ephemeris_read.d_P_3); EXPECT_EQ(1, rtcm->read_MT1020(rtcm->bin_to_binary_data(rtcm->hex_to_bin("FFFFFFFFFFF")), gnav_ephemeris_read, gnav_utc_model_read)); } @@ -318,7 +316,7 @@ TEST(RtcmTest, MT1029) unsigned int ref_id = 23; double obs_time = 0; Gps_Ephemeris gps_eph = Gps_Ephemeris(); - std::string m1029 = rtcm->bin_to_hex(rtcm->binary_data_to_bin(rtcm->print_MT1029(ref_id, gps_eph, obs_time, s_test))); + std::string m1029 = rtcm->bin_to_hex(rtcm->binary_data_to_bin(rtcm->print_MT1029(ref_id, gps_eph, obs_time, s_test))); std::string encoded_text = m1029.substr(24, 60); std::string expected_encoded_text("5554462D3820D0BFD180D0BED0B2D0B5D180D0BAD0B02077C3B672746572"); EXPECT_EQ(0, expected_encoded_text.compare(encoded_text)); @@ -345,7 +343,7 @@ TEST(RtcmTest, MT1045) EXPECT_EQ(0, rtcm->read_MT1045(tx_msg, gal_eph_read)); EXPECT_EQ(expected_true, gal_eph_read.E5a_DVS); - EXPECT_DOUBLE_EQ( 53.0 * OMEGA_dot_3_LSB, gal_eph_read.OMEGA_dot_3); + EXPECT_DOUBLE_EQ(53.0 * OMEGA_dot_3_LSB, gal_eph_read.OMEGA_dot_3); EXPECT_EQ(static_cast(5), gal_eph_read.i_satellite_PRN); EXPECT_EQ(1, rtcm->read_MT1045(rtcm->bin_to_binary_data(rtcm->hex_to_bin("FFFFFFFFFFF")), gal_eph_read)); } @@ -422,24 +420,24 @@ TEST(RtcmTest, MSMCell) //glo_gnav_eph.i_satellite_PRN = gnss_synchro.PRN; std::string MSM1 = rtcm->print_MSM_1(gps_eph, - {}, - gal_eph, - {}, - obs_time, - pseudoranges, - ref_id, - clock_steering_indicator, - external_clock_indicator, - smooth_int, - divergence_free, - more_messages); + {}, + gal_eph, + {}, + obs_time, + pseudoranges, + ref_id, + clock_steering_indicator, + external_clock_indicator, + smooth_int, + divergence_free, + more_messages); std::string MSM1_bin = rtcm->binary_data_to_bin(MSM1); unsigned int Nsat = 4; unsigned int Nsig = 3; unsigned int size_header = 14; unsigned int size_msg_length = 10; - EXPECT_EQ(0, MSM1_bin.substr(size_header + size_msg_length + 169, Nsat * Nsig).compare("001010101100")); // check cell mask + EXPECT_EQ(0, MSM1_bin.substr(size_header + size_msg_length + 169, Nsat * Nsig).compare("001010101100")); // check cell mask std::map pseudoranges2; pseudoranges2.insert(std::pair(1, gnss_synchro6)); @@ -450,19 +448,19 @@ TEST(RtcmTest, MSMCell) pseudoranges2.insert(std::pair(5, gnss_synchro)); pseudoranges2.insert(std::pair(6, gnss_synchro)); std::string MSM1_2 = rtcm->print_MSM_1(gps_eph, - {}, - gal_eph, - {}, - obs_time, - pseudoranges2, - ref_id, - clock_steering_indicator, - external_clock_indicator, - smooth_int, - divergence_free, - more_messages); + {}, + gal_eph, + {}, + obs_time, + pseudoranges2, + ref_id, + clock_steering_indicator, + external_clock_indicator, + smooth_int, + divergence_free, + more_messages); std::string MSM1_bin_2 = rtcm->binary_data_to_bin(MSM1_2); - EXPECT_EQ(0, MSM1_bin_2.substr(size_header + size_msg_length + 169, Nsat * Nsig).compare("001010001100")); // check cell mask + EXPECT_EQ(0, MSM1_bin_2.substr(size_header + size_msg_length + 169, Nsat * Nsig).compare("001010001100")); // check cell mask Gnss_Synchro gnss_synchro7; gnss_synchro7.PRN = 10; @@ -478,19 +476,19 @@ TEST(RtcmTest, MSMCell) pseudoranges3.insert(std::pair(5, gnss_synchro5)); std::string MSM1_3 = rtcm->print_MSM_1(gps_eph, - {}, - gal_eph, - {}, - obs_time, - pseudoranges3, - ref_id, - clock_steering_indicator, - external_clock_indicator, - smooth_int, - divergence_free, - more_messages); + {}, + gal_eph, + {}, + obs_time, + pseudoranges3, + ref_id, + clock_steering_indicator, + external_clock_indicator, + smooth_int, + divergence_free, + more_messages); std::string MSM1_bin_3 = rtcm->binary_data_to_bin(MSM1_3); - EXPECT_EQ(0, MSM1_bin_3.substr(size_header + size_msg_length + 169, (Nsat-1) * Nsig).compare("001010111")); // check cell mask + EXPECT_EQ(0, MSM1_bin_3.substr(size_header + size_msg_length + 169, (Nsat - 1) * Nsig).compare("001010111")); // check cell mask } @@ -547,15 +545,15 @@ TEST(RtcmTest, MSM1) gps_eph.i_satellite_PRN = gnss_synchro.PRN; std::string MSM1 = rtcm->print_MSM_1(gps_eph, - {}, {}, {}, - obs_time, - pseudoranges, - ref_id, - clock_steering_indicator, - external_clock_indicator, - smooth_int, - divergence_free, - more_messages); + {}, {}, {}, + obs_time, + pseudoranges, + ref_id, + clock_steering_indicator, + external_clock_indicator, + smooth_int, + divergence_free, + more_messages); EXPECT_EQ(expected_true, rtcm->check_CRC(MSM1)); @@ -569,23 +567,23 @@ TEST(RtcmTest, MSM1) unsigned int data_size = MSM1_bin.length() - size_header - size_msg_length - size_crc; EXPECT_EQ(expected_true, upper_bound >= data_size); EXPECT_EQ(0, MSM1_bin.substr(0, size_header).compare("11010011000000")); - EXPECT_EQ(ref_id, rtcm->bin_to_uint( MSM1_bin.substr(size_header + size_msg_length + 12, 12))); - EXPECT_EQ(0, MSM1_bin.substr(size_header + size_msg_length + 169, Nsat * Nsig).compare("101101")); // check cell mask + EXPECT_EQ(ref_id, rtcm->bin_to_uint(MSM1_bin.substr(size_header + size_msg_length + 12, 12))); + EXPECT_EQ(0, MSM1_bin.substr(size_header + size_msg_length + 169, Nsat * Nsig).compare("101101")); // check cell mask double meters_to_miliseconds = GPS_C_m_s * 0.001; unsigned int rough_range_1 = static_cast(std::floor(std::round(gnss_synchro.Pseudorange_m / meters_to_miliseconds / TWO_N10)) + 0.5) & 0x3FFu; unsigned int rough_range_2 = static_cast(std::floor(std::round(gnss_synchro2.Pseudorange_m / meters_to_miliseconds / TWO_N10)) + 0.5) & 0x3FFu; unsigned int rough_range_4 = static_cast(std::floor(std::round(gnss_synchro3.Pseudorange_m / meters_to_miliseconds / TWO_N10)) + 0.5) & 0x3FFu; - unsigned int read_pseudorange_1 = rtcm->bin_to_uint( MSM1_bin.substr(size_header + size_msg_length + 169 + Nsat * Nsig , 10)); - unsigned int read_pseudorange_2 = rtcm->bin_to_uint( MSM1_bin.substr(size_header + size_msg_length + 169 + Nsat * Nsig + 10, 10)); - unsigned int read_pseudorange_4 = rtcm->bin_to_uint( MSM1_bin.substr(size_header + size_msg_length + 169 + Nsat * Nsig + 20, 10)); + unsigned int read_pseudorange_1 = rtcm->bin_to_uint(MSM1_bin.substr(size_header + size_msg_length + 169 + Nsat * Nsig, 10)); + unsigned int read_pseudorange_2 = rtcm->bin_to_uint(MSM1_bin.substr(size_header + size_msg_length + 169 + Nsat * Nsig + 10, 10)); + unsigned int read_pseudorange_4 = rtcm->bin_to_uint(MSM1_bin.substr(size_header + size_msg_length + 169 + Nsat * Nsig + 20, 10)); EXPECT_EQ(rough_range_1, read_pseudorange_1); EXPECT_EQ(rough_range_2, read_pseudorange_2); EXPECT_EQ(rough_range_4, read_pseudorange_4); - int psrng4_s = static_cast(std::round( (gnss_synchro3.Pseudorange_m - std::round(gnss_synchro3.Pseudorange_m / meters_to_miliseconds / TWO_N10) * meters_to_miliseconds * TWO_N10)/ meters_to_miliseconds / TWO_N24)); - int read_psrng4_s = rtcm->bin_to_int( MSM1_bin.substr(size_header + size_msg_length + 169 + (Nsat * Nsig) + 30 + 15 * 3, 15)); + int psrng4_s = static_cast(std::round((gnss_synchro3.Pseudorange_m - std::round(gnss_synchro3.Pseudorange_m / meters_to_miliseconds / TWO_N10) * meters_to_miliseconds * TWO_N10) / meters_to_miliseconds / TWO_N24)); + int read_psrng4_s = rtcm->bin_to_int(MSM1_bin.substr(size_header + size_msg_length + 169 + (Nsat * Nsig) + 30 + 15 * 3, 15)); EXPECT_EQ(psrng4_s, read_psrng4_s); std::map pseudoranges2; @@ -594,17 +592,17 @@ TEST(RtcmTest, MSM1) pseudoranges2.insert(std::pair(3, gnss_synchro2)); pseudoranges2.insert(std::pair(4, gnss_synchro)); std::string MSM1_2 = rtcm->print_MSM_1(gps_eph, - {}, {}, {}, - obs_time, - pseudoranges2, - ref_id, - clock_steering_indicator, - external_clock_indicator, - smooth_int, - divergence_free, - more_messages); + {}, {}, {}, + obs_time, + pseudoranges2, + ref_id, + clock_steering_indicator, + external_clock_indicator, + smooth_int, + divergence_free, + more_messages); std::string MSM1_bin2 = rtcm->binary_data_to_bin(MSM1_2); - int read_psrng4_s_2 = rtcm->bin_to_int( MSM1_bin2.substr(size_header + size_msg_length + 169 + (Nsat * Nsig) + 30 + 15 * 3, 15)); + int read_psrng4_s_2 = rtcm->bin_to_int(MSM1_bin2.substr(size_header + size_msg_length + 169 + (Nsat * Nsig) + 30 + 15 * 3, 15)); EXPECT_EQ(psrng4_s, read_psrng4_s_2); } @@ -643,7 +641,3 @@ TEST(RtcmTest, InstantiateServerWithoutClosing) std::string test3_bin = rtcm->hex_to_bin(test3); EXPECT_EQ(0, test3_bin.compare("11111111")); } - - - - diff --git a/src/tests/unit-tests/signal-processing-blocks/resampler/direct_resampler_conditioner_cc_test.cc b/src/tests/unit-tests/signal-processing-blocks/resampler/direct_resampler_conditioner_cc_test.cc index f0b3ac238..070023152 100644 --- a/src/tests/unit-tests/signal-processing-blocks/resampler/direct_resampler_conditioner_cc_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/resampler/direct_resampler_conditioner_cc_test.cc @@ -43,11 +43,11 @@ TEST(DirectResamplerConditionerCcTest, InstantiationAndRunTest) { - double fs_in = 8000000.0; // Input sampling frequency in Hz - double fs_out = 4000000.0; // sampling freuqncy of the resampled signal in Hz + double fs_in = 8000000.0; // Input sampling frequency in Hz + double fs_out = 4000000.0; // sampling freuqncy of the resampled signal in Hz std::chrono::time_point start, end; std::chrono::duration elapsed_seconds(0); - int nsamples = 1000000; //Number of samples to be computed + int nsamples = 1000000; //Number of samples to be computed gr::msg_queue::sptr queue = gr::msg_queue::make(0); gr::top_block_sptr top_block = gr::make_top_block("direct_resampler_conditioner_cc_test"); boost::shared_ptr source = gr::analog::sig_source_c::make(fs_in, gr::analog::GR_SIN_WAVE, 1000.0, 1.0, gr_complex(0.0)); @@ -60,19 +60,19 @@ TEST(DirectResamplerConditionerCcTest, InstantiationAndRunTest) direct_resampler_conditioner_cc_sptr resampler = direct_resampler_make_conditioner_cc(fs_in, fs_out); gr::blocks::null_sink::sptr sink = gr::blocks::null_sink::make(sizeof(gr_complex)); - EXPECT_NO_THROW( { + EXPECT_NO_THROW({ top_block->connect(source, 0, valve, 0); top_block->connect(valve, 0, resampler, 0); top_block->connect(resampler, 0, sink, 0); }) << "Connection failure of direct_resampler_conditioner."; - EXPECT_NO_THROW( { + EXPECT_NO_THROW({ start = std::chrono::system_clock::now(); - top_block->run(); // Start threads and wait + top_block->run(); // Start threads and wait end = std::chrono::system_clock::now(); elapsed_seconds = end - start; top_block->stop(); }) << "Failure running direct_resampler_conditioner."; - std::cout << "Resampled " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; + std::cout << "Resampled " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; } diff --git a/src/tests/unit-tests/signal-processing-blocks/resampler/mmse_resampler_test.cc b/src/tests/unit-tests/signal-processing-blocks/resampler/mmse_resampler_test.cc index b2a723991..4532c3fb0 100644 --- a/src/tests/unit-tests/signal-processing-blocks/resampler/mmse_resampler_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/resampler/mmse_resampler_test.cc @@ -40,11 +40,11 @@ TEST(MmseResamplerTest, InstantiationAndRunTestWarning) { - double fs_in = 8000000.0; // Input sampling frequency in Hz - double fs_out = 4000000.0; // sampling freuqncy of the resampled signal in Hz + double fs_in = 8000000.0; // Input sampling frequency in Hz + double fs_out = 4000000.0; // sampling freuqncy of the resampled signal in Hz std::chrono::time_point start, end; std::chrono::duration elapsed_seconds(0); - int nsamples = 1000000; //Number of samples to be computed + int nsamples = 1000000; //Number of samples to be computed gr::msg_queue::sptr queue = gr::msg_queue::make(0); gr::top_block_sptr top_block = gr::make_top_block("mmse_resampler_conditioner_cc_test"); boost::shared_ptr source = gr::analog::sig_source_c::make(fs_in, gr::analog::GR_SIN_WAVE, 1000.0, 1.0, gr_complex(0.0)); @@ -60,32 +60,32 @@ TEST(MmseResamplerTest, InstantiationAndRunTestWarning) gr::blocks::null_sink::sptr sink = gr::blocks::null_sink::make(sizeof(gr_complex)); - EXPECT_NO_THROW( { + EXPECT_NO_THROW({ resampler->connect(top_block); top_block->connect(source, 0, valve, 0); top_block->connect(valve, 0, resampler->get_left_block(), 0); top_block->connect(resampler->get_right_block(), 0, sink, 0); }) << "Connection failure of direct_resampler_conditioner."; - EXPECT_NO_THROW( { + EXPECT_NO_THROW({ start = std::chrono::system_clock::now(); - top_block->run(); // Start threads and wait + top_block->run(); // Start threads and wait end = std::chrono::system_clock::now(); elapsed_seconds = end - start; top_block->stop(); }) << "Failure running direct_resampler_conditioner."; - std::cout << "Resampled " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; + std::cout << "Resampled " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; } TEST(MmseResamplerTest, InstantiationAndRunTest2) { - double fs_in = 8000000.0; // Input sampling frequency in Hz - double fs_out = 4000000.0; // sampling freuqncy of the resampled signal in Hz + double fs_in = 8000000.0; // Input sampling frequency in Hz + double fs_out = 4000000.0; // sampling freuqncy of the resampled signal in Hz std::chrono::time_point start, end; std::chrono::duration elapsed_seconds(0); - int nsamples = 1000000; //Number of samples to be computed + int nsamples = 1000000; //Number of samples to be computed gr::msg_queue::sptr queue = gr::msg_queue::make(0); gr::top_block_sptr top_block = gr::make_top_block("mmse_resampler_conditioner_cc_test"); boost::shared_ptr source = gr::analog::sig_source_c::make(fs_in, gr::analog::GR_SIN_WAVE, 1000.0, 1.0, gr_complex(0.0)); @@ -101,21 +101,20 @@ TEST(MmseResamplerTest, InstantiationAndRunTest2) gr::blocks::null_sink::sptr sink = gr::blocks::null_sink::make(sizeof(gr_complex)); - EXPECT_NO_THROW( { + EXPECT_NO_THROW({ resampler->connect(top_block); top_block->connect(source, 0, valve, 0); top_block->connect(valve, 0, resampler->get_left_block(), 0); top_block->connect(resampler->get_right_block(), 0, sink, 0); }) << "Connection failure of direct_resampler_conditioner."; - EXPECT_NO_THROW( { + EXPECT_NO_THROW({ start = std::chrono::system_clock::now(); - top_block->run(); // Start threads and wait + top_block->run(); // Start threads and wait end = std::chrono::system_clock::now(); elapsed_seconds = end - start; top_block->stop(); }) << "Failure running direct_resampler_conditioner."; - std::cout << "Resampled " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; + std::cout << "Resampled " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; } - diff --git a/src/tests/unit-tests/signal-processing-blocks/sources/file_signal_source_test.cc b/src/tests/unit-tests/signal-processing-blocks/sources/file_signal_source_test.cc index 90171f1e5..81a7508b5 100644 --- a/src/tests/unit-tests/signal-processing-blocks/sources/file_signal_source_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/sources/file_signal_source_test.cc @@ -67,5 +67,5 @@ TEST(FileSignalSource, InstantiateFileNotExists) config->set_property("Test.item_type", "gr_complex"); config->set_property("Test.repeat", "false"); - EXPECT_THROW({auto uptr = std::make_shared(config.get(), "Test", 1, 1, queue);}, std::exception); + EXPECT_THROW({ auto uptr = std::make_shared(config.get(), "Test", 1, 1, queue); }, std::exception); } diff --git a/src/tests/unit-tests/signal-processing-blocks/sources/unpack_2bit_samples_test.cc b/src/tests/unit-tests/signal-processing-blocks/sources/unpack_2bit_samples_test.cc index 683388e25..bbedcc9d2 100644 --- a/src/tests/unit-tests/signal-processing-blocks/sources/unpack_2bit_samples_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/sources/unpack_2bit_samples_test.cc @@ -39,44 +39,41 @@ #include #include "unpack_2bit_samples.h" -std::vector< uint8_t > packData( std::vector< int8_t > const & raw_data, - bool big_endian ) +std::vector packData(std::vector const &raw_data, + bool big_endian) { - std::vector< uint8_t > packed_data( raw_data.size()/4 ); + std::vector packed_data(raw_data.size() / 4); - int shift = ( big_endian ? 6 : 0 ); + int shift = (big_endian ? 6 : 0); unsigned int j = 0; - for( unsigned int i = 0; i < raw_data.size(); ++i ) - { - unsigned val = static_cast< unsigned >( (raw_data[i] - 1 )/2 & 0x03 ); - - packed_data[j] |= val << shift; - - if( big_endian ) + for (unsigned int i = 0; i < raw_data.size(); ++i) { - shift -= 2; - if( shift < 0 ) - { - shift = 6; - j++; - } - } - else - { - shift += 2; - if( shift > 6 ) - { - shift = 0; - j++; - } + unsigned val = static_cast((raw_data[i] - 1) / 2 & 0x03); - } + packed_data[j] |= val << shift; - } + if (big_endian) + { + shift -= 2; + if (shift < 0) + { + shift = 6; + j++; + } + } + else + { + shift += 2; + if (shift > 6) + { + shift = 0; + j++; + } + } + } return packed_data; - } TEST(Unpack2bitSamplesTest, CheckBigEndianByte) @@ -86,30 +83,30 @@ TEST(Unpack2bitSamplesTest, CheckBigEndianByte) bool big_endian_items = false; - std::vector< int8_t > raw_data = { -1, 3, 1, -1, -3, 1, 3, 1 }; - std::vector< uint8_t > packed_data = packData( raw_data, big_endian_bytes ); - std::vector< uint8_t > unpacked_data; + std::vector raw_data = {-1, 3, 1, -1, -3, 1, 3, 1}; + std::vector packed_data = packData(raw_data, big_endian_bytes); + std::vector unpacked_data; gr::top_block_sptr top_block = gr::make_top_block("Unpack2bitSamplesTest"); gr::blocks::vector_source_b::sptr source = - gr::blocks::vector_source_b::make( packed_data ); + gr::blocks::vector_source_b::make(packed_data); boost::shared_ptr unpacker = make_unpack_2bit_samples(big_endian_bytes, - item_size, - big_endian_items ); + item_size, + big_endian_items); gr::blocks::stream_to_vector::sptr stov = - gr::blocks::stream_to_vector::make( item_size, raw_data.size() ); + gr::blocks::stream_to_vector::make(item_size, raw_data.size()); gr::blocks::vector_sink_b::sptr sink = - gr::blocks::vector_sink_b::make( raw_data.size() ); + gr::blocks::vector_sink_b::make(raw_data.size()); top_block->connect(source, 0, unpacker, 0); - top_block->connect(unpacker, 0, stov, 0 ); + top_block->connect(unpacker, 0, stov, 0); top_block->connect(stov, 0, sink, 0); top_block->run(); @@ -117,13 +114,12 @@ TEST(Unpack2bitSamplesTest, CheckBigEndianByte) unpacked_data = sink->data(); - EXPECT_EQ( raw_data.size(), unpacked_data.size() ); - - for( unsigned int i = 0; i < raw_data.size(); ++i ) - { - EXPECT_EQ( raw_data[i], static_cast< int8_t >( unpacked_data[i] ) ); - } + EXPECT_EQ(raw_data.size(), unpacked_data.size()); + for (unsigned int i = 0; i < raw_data.size(); ++i) + { + EXPECT_EQ(raw_data[i], static_cast(unpacked_data[i])); + } } TEST(Unpack2bitSamplesTest, CheckLittleEndianByte) @@ -133,30 +129,30 @@ TEST(Unpack2bitSamplesTest, CheckLittleEndianByte) bool big_endian_items = false; - std::vector< int8_t > raw_data = { -1, 3, 1, -1, -3, 1, 3, 1 }; - std::vector< uint8_t > packed_data = packData( raw_data, big_endian_bytes ); - std::vector< uint8_t > unpacked_data; + std::vector raw_data = {-1, 3, 1, -1, -3, 1, 3, 1}; + std::vector packed_data = packData(raw_data, big_endian_bytes); + std::vector unpacked_data; gr::top_block_sptr top_block = gr::make_top_block("Unpack2bitSamplesTest"); gr::blocks::vector_source_b::sptr source = - gr::blocks::vector_source_b::make( packed_data ); + gr::blocks::vector_source_b::make(packed_data); boost::shared_ptr unpacker = make_unpack_2bit_samples(big_endian_bytes, - item_size, - big_endian_items ); + item_size, + big_endian_items); gr::blocks::stream_to_vector::sptr stov = - gr::blocks::stream_to_vector::make( item_size, raw_data.size() ); + gr::blocks::stream_to_vector::make(item_size, raw_data.size()); gr::blocks::vector_sink_b::sptr sink = - gr::blocks::vector_sink_b::make( raw_data.size() ); + gr::blocks::vector_sink_b::make(raw_data.size()); top_block->connect(source, 0, unpacker, 0); - top_block->connect(unpacker, 0, stov, 0 ); + top_block->connect(unpacker, 0, stov, 0); top_block->connect(stov, 0, sink, 0); top_block->run(); @@ -164,13 +160,12 @@ TEST(Unpack2bitSamplesTest, CheckLittleEndianByte) unpacked_data = sink->data(); - EXPECT_EQ( raw_data.size(), unpacked_data.size() ); - - for( unsigned int i = 0; i < raw_data.size(); ++i ) - { - EXPECT_EQ( raw_data[i], static_cast< int8_t >( unpacked_data[i] ) ); - } + EXPECT_EQ(raw_data.size(), unpacked_data.size()); + for (unsigned int i = 0; i < raw_data.size(); ++i) + { + EXPECT_EQ(raw_data[i], static_cast(unpacked_data[i])); + } } TEST(Unpack2bitSamplesTest, CheckBigEndianShortBigEndianByte) @@ -180,51 +175,50 @@ TEST(Unpack2bitSamplesTest, CheckBigEndianShortBigEndianByte) bool big_endian_items = true; - std::vector< int8_t > raw_data = { -1, 3, 1, -1, -3, 1, 3, 1 }; - std::vector< uint8_t > packed_data = packData( raw_data, big_endian_bytes ); + std::vector raw_data = {-1, 3, 1, -1, -3, 1, 3, 1}; + std::vector packed_data = packData(raw_data, big_endian_bytes); // change the order of each pair of bytes: - for( unsigned int ii = 0; ii < packed_data.size(); ii+=item_size ) - { - unsigned int kk = ii + item_size - 1; - unsigned int jj = ii; - while( kk > jj ) + for (unsigned int ii = 0; ii < packed_data.size(); ii += item_size) { - uint8_t tmp = packed_data[jj]; - packed_data[jj] = packed_data[kk]; - packed_data[kk] = tmp; - --kk; - ++jj; + unsigned int kk = ii + item_size - 1; + unsigned int jj = ii; + while (kk > jj) + { + uint8_t tmp = packed_data[jj]; + packed_data[jj] = packed_data[kk]; + packed_data[kk] = tmp; + --kk; + ++jj; + } } - } // Now create a new big endian buffer: - std::vector< int16_t > packed_data_short( - reinterpret_cast< int16_t *>( &packed_data[0] ), - reinterpret_cast< int16_t * >( &packed_data[0] ) - + packed_data.size()/item_size); + std::vector packed_data_short( + reinterpret_cast(&packed_data[0]), + reinterpret_cast(&packed_data[0]) + packed_data.size() / item_size); - std::vector< uint8_t > unpacked_data; + std::vector unpacked_data; gr::top_block_sptr top_block = gr::make_top_block("Unpack2bitSamplesTest"); gr::blocks::vector_source_s::sptr source = - gr::blocks::vector_source_s::make( packed_data_short ); + gr::blocks::vector_source_s::make(packed_data_short); boost::shared_ptr unpacker = make_unpack_2bit_samples(big_endian_bytes, - item_size, - big_endian_items ); + item_size, + big_endian_items); gr::blocks::stream_to_vector::sptr stov = - gr::blocks::stream_to_vector::make( 1, raw_data.size() ); + gr::blocks::stream_to_vector::make(1, raw_data.size()); gr::blocks::vector_sink_b::sptr sink = - gr::blocks::vector_sink_b::make( raw_data.size() ); + gr::blocks::vector_sink_b::make(raw_data.size()); top_block->connect(source, 0, unpacker, 0); - top_block->connect(unpacker, 0, stov, 0 ); + top_block->connect(unpacker, 0, stov, 0); top_block->connect(stov, 0, sink, 0); top_block->run(); @@ -232,13 +226,12 @@ TEST(Unpack2bitSamplesTest, CheckBigEndianShortBigEndianByte) unpacked_data = sink->data(); - EXPECT_EQ( raw_data.size(), unpacked_data.size() ); - - for( unsigned int i = 0; i < raw_data.size(); ++i ) - { - EXPECT_EQ( raw_data[i], static_cast< int8_t >( unpacked_data[i] ) ); - } + EXPECT_EQ(raw_data.size(), unpacked_data.size()); + for (unsigned int i = 0; i < raw_data.size(); ++i) + { + EXPECT_EQ(raw_data[i], static_cast(unpacked_data[i])); + } } TEST(Unpack2bitSamplesTest, CheckBigEndianShortLittleEndianByte) @@ -248,51 +241,50 @@ TEST(Unpack2bitSamplesTest, CheckBigEndianShortLittleEndianByte) bool big_endian_items = true; - std::vector< int8_t > raw_data = { -1, 3, 1, -1, -3, 1, 3, 1 }; - std::vector< uint8_t > packed_data = packData( raw_data, big_endian_bytes ); + std::vector raw_data = {-1, 3, 1, -1, -3, 1, 3, 1}; + std::vector packed_data = packData(raw_data, big_endian_bytes); // change the order of each pair of bytes: - for( unsigned int ii = 0; ii < packed_data.size(); ii+=item_size ) - { - unsigned int kk = ii + item_size - 1; - unsigned int jj = ii; - while( kk > jj ) + for (unsigned int ii = 0; ii < packed_data.size(); ii += item_size) { - uint8_t tmp = packed_data[jj]; - packed_data[jj] = packed_data[kk]; - packed_data[kk] = tmp; - --kk; - ++jj; + unsigned int kk = ii + item_size - 1; + unsigned int jj = ii; + while (kk > jj) + { + uint8_t tmp = packed_data[jj]; + packed_data[jj] = packed_data[kk]; + packed_data[kk] = tmp; + --kk; + ++jj; + } } - } // Now create a new big endian buffer: - std::vector< int16_t > packed_data_short( - reinterpret_cast< int16_t *>( &packed_data[0] ), - reinterpret_cast< int16_t * >( &packed_data[0] ) - + packed_data.size()/item_size); + std::vector packed_data_short( + reinterpret_cast(&packed_data[0]), + reinterpret_cast(&packed_data[0]) + packed_data.size() / item_size); - std::vector< uint8_t > unpacked_data; + std::vector unpacked_data; gr::top_block_sptr top_block = gr::make_top_block("Unpack2bitSamplesTest"); gr::blocks::vector_source_s::sptr source = - gr::blocks::vector_source_s::make( packed_data_short ); + gr::blocks::vector_source_s::make(packed_data_short); boost::shared_ptr unpacker = make_unpack_2bit_samples(big_endian_bytes, - item_size, - big_endian_items ); + item_size, + big_endian_items); gr::blocks::stream_to_vector::sptr stov = - gr::blocks::stream_to_vector::make( 1, raw_data.size() ); + gr::blocks::stream_to_vector::make(1, raw_data.size()); gr::blocks::vector_sink_b::sptr sink = - gr::blocks::vector_sink_b::make( raw_data.size() ); + gr::blocks::vector_sink_b::make(raw_data.size()); top_block->connect(source, 0, unpacker, 0); - top_block->connect(unpacker, 0, stov, 0 ); + top_block->connect(unpacker, 0, stov, 0); top_block->connect(stov, 0, sink, 0); top_block->run(); @@ -300,11 +292,10 @@ TEST(Unpack2bitSamplesTest, CheckBigEndianShortLittleEndianByte) unpacked_data = sink->data(); - EXPECT_EQ( raw_data.size(), unpacked_data.size() ); - - for( unsigned int i = 0; i < raw_data.size(); ++i ) - { - EXPECT_EQ( raw_data[i], static_cast< int8_t >( unpacked_data[i] ) ); - } + EXPECT_EQ(raw_data.size(), unpacked_data.size()); + for (unsigned int i = 0; i < raw_data.size(); ++i) + { + EXPECT_EQ(raw_data[i], static_cast(unpacked_data[i])); + } } diff --git a/src/tests/unit-tests/signal-processing-blocks/telemetry_decoder/gps_l1_ca_telemetry_decoder_test.cc b/src/tests/unit-tests/signal-processing-blocks/telemetry_decoder/gps_l1_ca_telemetry_decoder_test.cc index d0982266c..340e472e5 100644 --- a/src/tests/unit-tests/signal-processing-blocks/telemetry_decoder/gps_l1_ca_telemetry_decoder_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/telemetry_decoder/gps_l1_ca_telemetry_decoder_test.cc @@ -75,8 +75,7 @@ private: public: int rx_message; - ~GpsL1CADllPllTelemetryDecoderTest_msg_rx(); //!< Default destructor - + ~GpsL1CADllPllTelemetryDecoderTest_msg_rx(); //!< Default destructor }; GpsL1CADllPllTelemetryDecoderTest_msg_rx_sptr GpsL1CADllPllTelemetryDecoderTest_msg_rx_make() @@ -87,19 +86,18 @@ GpsL1CADllPllTelemetryDecoderTest_msg_rx_sptr GpsL1CADllPllTelemetryDecoderTest_ void GpsL1CADllPllTelemetryDecoderTest_msg_rx::msg_handler_events(pmt::pmt_t msg) { try - { + { long int message = pmt::to_long(msg); rx_message = message; - } - catch(boost::bad_any_cast& e) - { + } + catch (boost::bad_any_cast& e) + { LOG(WARNING) << "msg_handler_telemetry Bad any cast!"; rx_message = 0; - } + } } -GpsL1CADllPllTelemetryDecoderTest_msg_rx::GpsL1CADllPllTelemetryDecoderTest_msg_rx() : - gr::block("GpsL1CADllPllTelemetryDecoderTest_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0)) +GpsL1CADllPllTelemetryDecoderTest_msg_rx::GpsL1CADllPllTelemetryDecoderTest_msg_rx() : gr::block("GpsL1CADllPllTelemetryDecoderTest_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0)) { this->message_port_register_in(pmt::mp("events")); this->set_msg_handler(pmt::mp("events"), boost::bind(&GpsL1CADllPllTelemetryDecoderTest_msg_rx::msg_handler_events, this, _1)); @@ -107,7 +105,8 @@ GpsL1CADllPllTelemetryDecoderTest_msg_rx::GpsL1CADllPllTelemetryDecoderTest_msg_ } GpsL1CADllPllTelemetryDecoderTest_msg_rx::~GpsL1CADllPllTelemetryDecoderTest_msg_rx() -{} +{ +} // ########################################################### @@ -129,8 +128,7 @@ private: public: int rx_message; - ~GpsL1CADllPllTelemetryDecoderTest_tlm_msg_rx(); //!< Default destructor - + ~GpsL1CADllPllTelemetryDecoderTest_tlm_msg_rx(); //!< Default destructor }; GpsL1CADllPllTelemetryDecoderTest_tlm_msg_rx_sptr GpsL1CADllPllTelemetryDecoderTest_tlm_msg_rx_make() @@ -141,19 +139,18 @@ GpsL1CADllPllTelemetryDecoderTest_tlm_msg_rx_sptr GpsL1CADllPllTelemetryDecoderT void GpsL1CADllPllTelemetryDecoderTest_tlm_msg_rx::msg_handler_events(pmt::pmt_t msg) { try - { + { long int message = pmt::to_long(msg); rx_message = message; - } - catch(boost::bad_any_cast& e) - { + } + catch (boost::bad_any_cast& e) + { LOG(WARNING) << "msg_handler_telemetry Bad any cast!"; rx_message = 0; - } + } } -GpsL1CADllPllTelemetryDecoderTest_tlm_msg_rx::GpsL1CADllPllTelemetryDecoderTest_tlm_msg_rx() : - gr::block("GpsL1CADllPllTelemetryDecoderTest_tlm_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0)) +GpsL1CADllPllTelemetryDecoderTest_tlm_msg_rx::GpsL1CADllPllTelemetryDecoderTest_tlm_msg_rx() : gr::block("GpsL1CADllPllTelemetryDecoderTest_tlm_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0)) { this->message_port_register_in(pmt::mp("events")); this->set_msg_handler(pmt::mp("events"), boost::bind(&GpsL1CADllPllTelemetryDecoderTest_tlm_msg_rx::msg_handler_events, this, _1)); @@ -161,13 +158,14 @@ GpsL1CADllPllTelemetryDecoderTest_tlm_msg_rx::GpsL1CADllPllTelemetryDecoderTest_ } GpsL1CADllPllTelemetryDecoderTest_tlm_msg_rx::~GpsL1CADllPllTelemetryDecoderTest_tlm_msg_rx() -{} +{ +} // ########################################################### -class GpsL1CATelemetryDecoderTest: public ::testing::Test +class GpsL1CATelemetryDecoderTest : public ::testing::Test { public: std::string generator_binary; @@ -184,10 +182,10 @@ public: int configure_generator(); int generate_signal(); - void check_results(arma::vec & true_time_s, - arma::vec & true_value, - arma::vec & meas_time_s, - arma::vec & meas_value); + void check_results(arma::vec& true_time_s, + arma::vec& true_value, + arma::vec& meas_time_s, + arma::vec& meas_value); GpsL1CATelemetryDecoderTest() { @@ -198,7 +196,8 @@ public: } ~GpsL1CATelemetryDecoderTest() - {} + { + } void configure_receiver(); @@ -216,7 +215,7 @@ int GpsL1CATelemetryDecoderTest::configure_generator() generator_binary = FLAGS_generator_binary; p1 = std::string("-rinex_nav_file=") + FLAGS_rinex_nav_file; - if(FLAGS_dynamic_position.empty()) + if (FLAGS_dynamic_position.empty()) { p2 = std::string("-static_position=") + FLAGS_static_position + std::string(",") + std::to_string(FLAGS_duration * 10); } @@ -224,9 +223,9 @@ int GpsL1CATelemetryDecoderTest::configure_generator() { p2 = std::string("-obs_pos_file=") + std::string(FLAGS_dynamic_position); } - p3 = std::string("-rinex_obs_file=") + FLAGS_filename_rinex_obs; // RINEX 2.10 observation file output - p4 = std::string("-sig_out_file=") + FLAGS_filename_raw_data; // Baseband signal output file. Will be stored in int8_t IQ multiplexed samples - p5 = std::string("-sampling_freq=") + std::to_string(baseband_sampling_freq); //Baseband sampling frequency [MSps] + p3 = std::string("-rinex_obs_file=") + FLAGS_filename_rinex_obs; // RINEX 2.10 observation file output + p4 = std::string("-sig_out_file=") + FLAGS_filename_raw_data; // Baseband signal output file. Will be stored in int8_t IQ multiplexed samples + p5 = std::string("-sampling_freq=") + std::to_string(baseband_sampling_freq); //Baseband sampling frequency [MSps] return 0; } @@ -235,7 +234,7 @@ int GpsL1CATelemetryDecoderTest::generate_signal() { int child_status; - char *const parmList[] = { &generator_binary[0], &generator_binary[0], &p1[0], &p2[0], &p3[0], &p4[0], &p5[0], NULL }; + char* const parmList[] = {&generator_binary[0], &generator_binary[0], &p1[0], &p2[0], &p3[0], &p4[0], &p5[0], NULL}; int pid; if ((pid = fork()) == -1) @@ -249,7 +248,7 @@ int GpsL1CATelemetryDecoderTest::generate_signal() waitpid(pid, &child_status, 0); - std::cout << "Signal and Observables RINEX and RAW files created." << std::endl; + std::cout << "Signal and Observables RINEX and RAW files created." << std::endl; return 0; } @@ -273,14 +272,14 @@ void GpsL1CATelemetryDecoderTest::configure_receiver() config->set_property("Tracking_1C.dll_bw_hz", "1.5"); config->set_property("Tracking_1C.early_late_space_chips", "0.5"); - config->set_property("TelemetryDecoder_1C.dump","true"); + config->set_property("TelemetryDecoder_1C.dump", "true"); } -void GpsL1CATelemetryDecoderTest::check_results(arma::vec & true_time_s, - arma::vec & true_value, - arma::vec & meas_time_s, - arma::vec & meas_value) +void GpsL1CATelemetryDecoderTest::check_results(arma::vec& true_time_s, + arma::vec& true_value, + arma::vec& meas_time_s, + arma::vec& meas_value) { //1. True value interpolation to match the measurement times arma::vec true_value_interp; @@ -316,7 +315,7 @@ void GpsL1CATelemetryDecoderTest::check_results(arma::vec & true_time_s, << " (max,min)=" << max_error << "," << min_error << " [Seconds]" << std::endl; - std::cout.precision (ss); + std::cout.precision(ss); ASSERT_LT(rmse, 0.2E-6); ASSERT_LT(error_mean, 0.2E-6); @@ -366,9 +365,9 @@ TEST_F(GpsL1CATelemetryDecoderTest, ValidationOfResults) // load acquisition data based on the first epoch of the true observations ASSERT_NO_THROW({ if (true_obs_data.read_binary_obs() == false) - { - throw std::exception(); - }; + { + throw std::exception(); + }; }) << "Failure reading true observables file"; //restart the epoch counter @@ -379,28 +378,28 @@ TEST_F(GpsL1CATelemetryDecoderTest, ValidationOfResults) gnss_synchro.Acq_doppler_hz = true_obs_data.doppler_l1_hz; gnss_synchro.Acq_samplestamp_samples = 0; - std::shared_ptr tlm(new GpsL1CaTelemetryDecoder(config.get(), "TelemetryDecoder_1C",1, 1)); + std::shared_ptr tlm(new GpsL1CaTelemetryDecoder(config.get(), "TelemetryDecoder_1C", 1, 1)); tlm->set_channel(0); boost::shared_ptr tlm_msg_rx = GpsL1CADllPllTelemetryDecoderTest_tlm_msg_rx_make(); - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ tracking->set_channel(gnss_synchro.Channel_ID); }) << "Failure setting channel."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ tracking->set_gnss_synchro(&gnss_synchro); }) << "Failure setting gnss_synchro."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ tracking->connect(top_block); }) << "Failure connecting tracking to the top_block."; - ASSERT_NO_THROW( { - std::string file = "./" + filename_raw_data; - const char * file_name = file.c_str(); + ASSERT_NO_THROW({ + std::string file = "./" + filename_raw_data; + const char* file_name = file.c_str(); gr::blocks::file_source::sptr file_source = gr::blocks::file_source::make(sizeof(int8_t), file_name, false); - gr::blocks::interleaved_char_to_complex::sptr gr_interleaved_char_to_complex = gr::blocks::interleaved_char_to_complex::make(); + gr::blocks::interleaved_char_to_complex::sptr gr_interleaved_char_to_complex = gr::blocks::interleaved_char_to_complex::make(); gr::blocks::null_sink::sptr sink = gr::blocks::null_sink::make(sizeof(Gnss_Synchro)); top_block->connect(file_source, 0, gr_interleaved_char_to_complex, 0); top_block->connect(gr_interleaved_char_to_complex, 0, tracking->get_left_block(), 0); @@ -411,9 +410,9 @@ TEST_F(GpsL1CATelemetryDecoderTest, ValidationOfResults) tracking->start_tracking(); - EXPECT_NO_THROW( { + EXPECT_NO_THROW({ start = std::chrono::system_clock::now(); - top_block->run(); // Start threads and wait + top_block->run(); // Start threads and wait end = std::chrono::system_clock::now(); elapsed_seconds = end - start; }) << "Failure running the top_block."; @@ -430,15 +429,15 @@ TEST_F(GpsL1CATelemetryDecoderTest, ValidationOfResults) arma::vec true_tow_s = arma::zeros(nepoch, 1); long int epoch_counter = 0; - while(true_obs_data.read_binary_obs()) - { - true_timestamp_s(epoch_counter) = true_obs_data.signal_timestamp_s; - true_acc_carrier_phase_cycles(epoch_counter) = true_obs_data.acc_carrier_phase_cycles; - true_Doppler_Hz(epoch_counter) = true_obs_data.doppler_l1_hz; - true_prn_delay_chips(epoch_counter) = true_obs_data.prn_delay_chips; - true_tow_s(epoch_counter) = true_obs_data.tow; - epoch_counter++; - } + while (true_obs_data.read_binary_obs()) + { + true_timestamp_s(epoch_counter) = true_obs_data.signal_timestamp_s; + true_acc_carrier_phase_cycles(epoch_counter) = true_obs_data.acc_carrier_phase_cycles; + true_Doppler_Hz(epoch_counter) = true_obs_data.doppler_l1_hz; + true_prn_delay_chips(epoch_counter) = true_obs_data.prn_delay_chips; + true_tow_s(epoch_counter) = true_obs_data.tow; + epoch_counter++; + } //load the measured values tlm_dump_reader tlm_dump; @@ -457,13 +456,13 @@ TEST_F(GpsL1CATelemetryDecoderTest, ValidationOfResults) arma::vec tlm_tow_s = arma::zeros(nepoch, 1); epoch_counter = 0; - while(tlm_dump.read_binary_obs()) - { - tlm_timestamp_s(epoch_counter) = static_cast(tlm_dump.Tracking_sample_counter) / static_cast(baseband_sampling_freq); - tlm_TOW_at_Preamble(epoch_counter) = tlm_dump.d_TOW_at_Preamble; - tlm_tow_s(epoch_counter) = tlm_dump.TOW_at_current_symbol; - epoch_counter++; - } + while (tlm_dump.read_binary_obs()) + { + tlm_timestamp_s(epoch_counter) = static_cast(tlm_dump.Tracking_sample_counter) / static_cast(baseband_sampling_freq); + tlm_TOW_at_Preamble(epoch_counter) = tlm_dump.d_TOW_at_Preamble; + tlm_tow_s(epoch_counter) = tlm_dump.TOW_at_current_symbol; + epoch_counter++; + } //Cut measurement initial transitory of the measurements arma::uvec initial_meas_point = arma::find(tlm_tow_s >= true_tow_s(0), 1, "first"); @@ -473,5 +472,5 @@ TEST_F(GpsL1CATelemetryDecoderTest, ValidationOfResults) check_results(true_timestamp_s, true_tow_s, tlm_timestamp_s, tlm_tow_s); - std::cout << "Test completed in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; + std::cout << "Test completed in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; } diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/cpu_multicorrelator_real_codes_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/cpu_multicorrelator_real_codes_test.cc index f2e666fb2..1f9f0f1e3 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/cpu_multicorrelator_real_codes_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/cpu_multicorrelator_real_codes_test.cc @@ -46,19 +46,19 @@ DEFINE_int32(cpu_multicorrelator_real_codes_iterations_test, 100, "Number of ave DEFINE_int32(cpu_multicorrelator_real_codes_max_threads_test, 12, "Number of maximum concurrent correlators in CPU multicorrelator test timing test"); void run_correlator_cpu_real_codes(cpu_multicorrelator_real_codes* correlator, - float d_rem_carrier_phase_rad, - float d_carrier_phase_step_rad, - float d_code_phase_step_chips, - float d_rem_code_phase_chips, - int correlation_size) + float d_rem_carrier_phase_rad, + float d_carrier_phase_step_rad, + float d_code_phase_step_chips, + float d_rem_code_phase_chips, + int correlation_size) { - for(int k = 0; k < FLAGS_cpu_multicorrelator_real_codes_iterations_test; k++) + for (int k = 0; k < FLAGS_cpu_multicorrelator_real_codes_iterations_test; k++) { correlator->Carrier_wipeoff_multicorrelator_resampler(d_rem_carrier_phase_rad, - d_carrier_phase_step_rad, - d_code_phase_step_chips, - d_rem_code_phase_chips, - correlation_size); + d_carrier_phase_step_rad, + d_code_phase_step_chips, + d_rem_code_phase_chips, + correlation_size); } } @@ -70,15 +70,15 @@ TEST(CpuMulticorrelatorRealCodesTest, MeasureExecutionTime) int max_threads = FLAGS_cpu_multicorrelator_real_codes_max_threads_test; std::vector thread_pool; cpu_multicorrelator_real_codes* correlator_pool[max_threads]; - unsigned int correlation_sizes [3] = { 2048, 4096, 8192}; - double execution_times [3]; + unsigned int correlation_sizes[3] = {2048, 4096, 8192}; + double execution_times[3]; float* d_ca_code; gr_complex* in_cpu; gr_complex* d_correlator_outs; int d_n_correlator_taps = 3; - int d_vector_length = correlation_sizes[2]; //max correlation size to allocate all the necessary memory + int d_vector_length = correlation_sizes[2]; //max correlation size to allocate all the necessary memory float* d_local_code_shift_chips; //allocate host memory @@ -87,16 +87,16 @@ TEST(CpuMulticorrelatorRealCodesTest, MeasureExecutionTime) in_cpu = static_cast(volk_gnsssdr_malloc(2 * d_vector_length * sizeof(gr_complex), volk_gnsssdr_get_alignment())); // correlator outputs (scalar) - d_n_correlator_taps = 3; // Early, Prompt, and Late - d_correlator_outs = static_cast(volk_gnsssdr_malloc(d_n_correlator_taps*sizeof(gr_complex), volk_gnsssdr_get_alignment())); + d_n_correlator_taps = 3; // Early, Prompt, and Late + d_correlator_outs = static_cast(volk_gnsssdr_malloc(d_n_correlator_taps * sizeof(gr_complex), volk_gnsssdr_get_alignment())); for (int n = 0; n < d_n_correlator_taps; n++) { - d_correlator_outs[n] = gr_complex(0,0); + d_correlator_outs[n] = gr_complex(0, 0); } - d_local_code_shift_chips = static_cast(volk_gnsssdr_malloc(d_n_correlator_taps*sizeof(float), volk_gnsssdr_get_alignment())); + d_local_code_shift_chips = static_cast(volk_gnsssdr_malloc(d_n_correlator_taps * sizeof(float), volk_gnsssdr_get_alignment())); // Set TAPs delay values [chips] float d_early_late_spc_chips = 0.5; - d_local_code_shift_chips[0] = - d_early_late_spc_chips; + d_local_code_shift_chips[0] = -d_early_late_spc_chips; d_local_code_shift_chips[1] = 0.0; d_local_code_shift_chips[2] = d_early_late_spc_chips; @@ -128,37 +128,35 @@ TEST(CpuMulticorrelatorRealCodesTest, MeasureExecutionTime) float d_rem_code_phase_chips = 0.4; EXPECT_NO_THROW( - for(int correlation_sizes_idx = 0; correlation_sizes_idx < 3; correlation_sizes_idx++) + for (int correlation_sizes_idx = 0; correlation_sizes_idx < 3; correlation_sizes_idx++) { + for (int current_max_threads = 1; current_max_threads < (max_threads + 1); current_max_threads++) { - for(int current_max_threads = 1; current_max_threads < (max_threads+1); current_max_threads++) + std::cout << "Running " << current_max_threads << " concurrent correlators" << std::endl; + start = std::chrono::system_clock::now(); + //create the concurrent correlator threads + for (int current_thread = 0; current_thread < current_max_threads; current_thread++) { - std::cout << "Running " << current_max_threads << " concurrent correlators" << std::endl; - start = std::chrono::system_clock::now(); - //create the concurrent correlator threads - for (int current_thread = 0; current_thread < current_max_threads; current_thread++) - { - thread_pool.push_back(std::thread(run_correlator_cpu_real_codes, - correlator_pool[current_thread], - d_rem_carrier_phase_rad, - d_carrier_phase_step_rad, - d_code_phase_step_chips, - d_rem_code_phase_chips, - correlation_sizes[correlation_sizes_idx])); - } - //wait the threads to finish they work and destroy the thread objects - for(auto &t : thread_pool) - { - t.join(); - } - thread_pool.clear(); - end = std::chrono::system_clock::now(); - elapsed_seconds = end - start; - execution_times[correlation_sizes_idx] = elapsed_seconds.count() / static_cast(FLAGS_cpu_multicorrelator_real_codes_iterations_test); - std::cout << "CPU Multicorrelator (real codes) execution time for length=" << correlation_sizes[correlation_sizes_idx] - << " : " << execution_times[correlation_sizes_idx] << " [s]" << std::endl; + thread_pool.push_back(std::thread(run_correlator_cpu_real_codes, + correlator_pool[current_thread], + d_rem_carrier_phase_rad, + d_carrier_phase_step_rad, + d_code_phase_step_chips, + d_rem_code_phase_chips, + correlation_sizes[correlation_sizes_idx])); } + //wait the threads to finish they work and destroy the thread objects + for (auto& t : thread_pool) + { + t.join(); + } + thread_pool.clear(); + end = std::chrono::system_clock::now(); + elapsed_seconds = end - start; + execution_times[correlation_sizes_idx] = elapsed_seconds.count() / static_cast(FLAGS_cpu_multicorrelator_real_codes_iterations_test); + std::cout << "CPU Multicorrelator (real codes) execution time for length=" << correlation_sizes[correlation_sizes_idx] + << " : " << execution_times[correlation_sizes_idx] << " [s]" << std::endl; } - ); + }); volk_gnsssdr_free(d_local_code_shift_chips); volk_gnsssdr_free(d_correlator_outs); @@ -170,4 +168,3 @@ TEST(CpuMulticorrelatorRealCodesTest, MeasureExecutionTime) correlator_pool[n]->free(); } } - diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/cpu_multicorrelator_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/cpu_multicorrelator_test.cc index b4f06be3b..e405c04bc 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/cpu_multicorrelator_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/cpu_multicorrelator_test.cc @@ -46,19 +46,19 @@ DEFINE_int32(cpu_multicorrelator_iterations_test, 100, "Number of averaged itera DEFINE_int32(cpu_multicorrelator_max_threads_test, 12, "Number of maximum concurrent correlators in CPU multicorrelator test timing test"); void run_correlator_cpu(cpu_multicorrelator* correlator, - float d_rem_carrier_phase_rad, - float d_carrier_phase_step_rad, - float d_code_phase_step_chips, - float d_rem_code_phase_chips, - int correlation_size) + float d_rem_carrier_phase_rad, + float d_carrier_phase_step_rad, + float d_code_phase_step_chips, + float d_rem_code_phase_chips, + int correlation_size) { - for(int k = 0; k < FLAGS_cpu_multicorrelator_iterations_test; k++) + for (int k = 0; k < FLAGS_cpu_multicorrelator_iterations_test; k++) { correlator->Carrier_wipeoff_multicorrelator_resampler(d_rem_carrier_phase_rad, - d_carrier_phase_step_rad, - d_code_phase_step_chips, - d_rem_code_phase_chips, - correlation_size); + d_carrier_phase_step_rad, + d_code_phase_step_chips, + d_rem_code_phase_chips, + correlation_size); } } @@ -70,15 +70,15 @@ TEST(CpuMulticorrelatorTest, MeasureExecutionTime) int max_threads = FLAGS_cpu_multicorrelator_max_threads_test; std::vector thread_pool; cpu_multicorrelator* correlator_pool[max_threads]; - unsigned int correlation_sizes [3] = { 2048, 4096, 8192}; - double execution_times [3]; + unsigned int correlation_sizes[3] = {2048, 4096, 8192}; + double execution_times[3]; gr_complex* d_ca_code; gr_complex* in_cpu; gr_complex* d_correlator_outs; int d_n_correlator_taps = 3; - int d_vector_length = correlation_sizes[2]; //max correlation size to allocate all the necessary memory + int d_vector_length = correlation_sizes[2]; //max correlation size to allocate all the necessary memory float* d_local_code_shift_chips; //allocate host memory @@ -87,16 +87,16 @@ TEST(CpuMulticorrelatorTest, MeasureExecutionTime) in_cpu = static_cast(volk_gnsssdr_malloc(2 * d_vector_length * sizeof(gr_complex), volk_gnsssdr_get_alignment())); // correlator outputs (scalar) - d_n_correlator_taps = 3; // Early, Prompt, and Late - d_correlator_outs = static_cast(volk_gnsssdr_malloc(d_n_correlator_taps*sizeof(gr_complex), volk_gnsssdr_get_alignment())); + d_n_correlator_taps = 3; // Early, Prompt, and Late + d_correlator_outs = static_cast(volk_gnsssdr_malloc(d_n_correlator_taps * sizeof(gr_complex), volk_gnsssdr_get_alignment())); for (int n = 0; n < d_n_correlator_taps; n++) { - d_correlator_outs[n] = gr_complex(0,0); + d_correlator_outs[n] = gr_complex(0, 0); } - d_local_code_shift_chips = static_cast(volk_gnsssdr_malloc(d_n_correlator_taps*sizeof(float), volk_gnsssdr_get_alignment())); + d_local_code_shift_chips = static_cast(volk_gnsssdr_malloc(d_n_correlator_taps * sizeof(float), volk_gnsssdr_get_alignment())); // Set TAPs delay values [chips] float d_early_late_spc_chips = 0.5; - d_local_code_shift_chips[0] = - d_early_late_spc_chips; + d_local_code_shift_chips[0] = -d_early_late_spc_chips; d_local_code_shift_chips[1] = 0.0; d_local_code_shift_chips[2] = d_early_late_spc_chips; @@ -128,45 +128,42 @@ TEST(CpuMulticorrelatorTest, MeasureExecutionTime) float d_rem_code_phase_chips = 0.4; EXPECT_NO_THROW( - for(int correlation_sizes_idx = 0; correlation_sizes_idx < 3; correlation_sizes_idx++) + for (int correlation_sizes_idx = 0; correlation_sizes_idx < 3; correlation_sizes_idx++) { + for (int current_max_threads = 1; current_max_threads < (max_threads + 1); current_max_threads++) { - for(int current_max_threads = 1; current_max_threads < (max_threads+1); current_max_threads++) + std::cout << "Running " << current_max_threads << " concurrent correlators" << std::endl; + start = std::chrono::system_clock::now(); + //create the concurrent correlator threads + for (int current_thread = 0; current_thread < current_max_threads; current_thread++) { - std::cout << "Running " << current_max_threads << " concurrent correlators" << std::endl; - start = std::chrono::system_clock::now(); - //create the concurrent correlator threads - for (int current_thread = 0; current_thread < current_max_threads; current_thread++) - { - thread_pool.push_back(std::thread(run_correlator_cpu, - correlator_pool[current_thread], - d_rem_carrier_phase_rad, - d_carrier_phase_step_rad, - d_code_phase_step_chips, - d_rem_code_phase_chips, - correlation_sizes[correlation_sizes_idx])); - } - //wait the threads to finish they work and destroy the thread objects - for(auto &t : thread_pool) - { - t.join(); - } - thread_pool.clear(); - end = std::chrono::system_clock::now(); - elapsed_seconds = end - start; - execution_times[correlation_sizes_idx] = elapsed_seconds.count() / static_cast(FLAGS_cpu_multicorrelator_iterations_test); - std::cout << "CPU Multicorrelator execution time for length=" << correlation_sizes[correlation_sizes_idx] - << " : " << execution_times[correlation_sizes_idx] << " [s]" << std::endl; - + thread_pool.push_back(std::thread(run_correlator_cpu, + correlator_pool[current_thread], + d_rem_carrier_phase_rad, + d_carrier_phase_step_rad, + d_code_phase_step_chips, + d_rem_code_phase_chips, + correlation_sizes[correlation_sizes_idx])); } + //wait the threads to finish they work and destroy the thread objects + for (auto& t : thread_pool) + { + t.join(); + } + thread_pool.clear(); + end = std::chrono::system_clock::now(); + elapsed_seconds = end - start; + execution_times[correlation_sizes_idx] = elapsed_seconds.count() / static_cast(FLAGS_cpu_multicorrelator_iterations_test); + std::cout << "CPU Multicorrelator execution time for length=" << correlation_sizes[correlation_sizes_idx] + << " : " << execution_times[correlation_sizes_idx] << " [s]" << std::endl; } - ); + }); volk_gnsssdr_free(d_local_code_shift_chips); volk_gnsssdr_free(d_correlator_outs); volk_gnsssdr_free(d_ca_code); volk_gnsssdr_free(in_cpu); - for (int n = 0; n< max_threads; n++) + for (int n = 0; n < max_threads; n++) { correlator_pool[n]->free(); } diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/galileo_e1_dll_pll_veml_tracking_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/galileo_e1_dll_pll_veml_tracking_test.cc index b9b72729f..680395b1d 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/galileo_e1_dll_pll_veml_tracking_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/galileo_e1_dll_pll_veml_tracking_test.cc @@ -48,7 +48,7 @@ #include "galileo_e1_dll_pll_veml_tracking.h" -class GalileoE1DllPllVemlTrackingInternalTest: public ::testing::Test +class GalileoE1DllPllVemlTrackingInternalTest : public ::testing::Test { protected: GalileoE1DllPllVemlTrackingInternalTest() @@ -62,7 +62,8 @@ protected: } ~GalileoE1DllPllVemlTrackingInternalTest() - {} + { + } void init(); @@ -119,15 +120,15 @@ TEST_F(GalileoE1DllPllVemlTrackingInternalTest, ConnectAndRun) std::shared_ptr trk_ = factory->GetBlock(config, "Tracking_1B", "Galileo_E1_DLL_PLL_VEML_Tracking", 1, 1); std::shared_ptr tracking = std::dynamic_pointer_cast(trk_); - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ tracking->set_channel(gnss_synchro.Channel_ID); }) << "Failure setting channel."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ tracking->set_gnss_synchro(&gnss_synchro); }) << "Failure setting gnss_synchro."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ tracking->connect(top_block); gr::analog::sig_source_c::sptr source = gr::analog::sig_source_c::make(fs_in, gr::analog::GR_SIN_WAVE, 1000, 1, gr_complex(0)); boost::shared_ptr valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue); @@ -139,14 +140,14 @@ TEST_F(GalileoE1DllPllVemlTrackingInternalTest, ConnectAndRun) tracking->start_tracking(); - EXPECT_NO_THROW( { + EXPECT_NO_THROW({ start = std::chrono::system_clock::now(); - top_block->run(); //Start threads and wait + top_block->run(); //Start threads and wait end = std::chrono::system_clock::now(); elapsed_seconds = end - start; }) << "Failure running the top_block."; - std::cout << "Processed " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; + std::cout << "Processed " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; } @@ -156,8 +157,8 @@ TEST_F(GalileoE1DllPllVemlTrackingInternalTest, ValidationOfResults) std::chrono::duration elapsed_seconds(0); // int num_samples = 40000000; // 4 Msps // unsigned int skiphead_sps = 24000000; // 4 Msps - int num_samples = 80000000; // 8 Msps - unsigned int skiphead_sps = 8000000; // 8 Msps + int num_samples = 80000000; // 8 Msps + unsigned int skiphead_sps = 8000000; // 8 Msps init(); queue = gr::msg_queue::make(0); top_block = gr::make_top_block("Tracking test"); @@ -168,27 +169,27 @@ TEST_F(GalileoE1DllPllVemlTrackingInternalTest, ValidationOfResults) // gnss_synchro.Acq_delay_samples = 1753; // 4 Msps // gnss_synchro.Acq_doppler_hz = -9500; // 4 Msps - gnss_synchro.Acq_delay_samples = 17256; // 8 Msps - gnss_synchro.Acq_doppler_hz = -8750; // 8 Msps + gnss_synchro.Acq_delay_samples = 17256; // 8 Msps + gnss_synchro.Acq_doppler_hz = -8750; // 8 Msps gnss_synchro.Acq_samplestamp_samples = 0; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ tracking->set_channel(gnss_synchro.Channel_ID); }) << "Failure setting channel."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ tracking->set_gnss_synchro(&gnss_synchro); }) << "Failure setting gnss_synchro."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ tracking->connect(top_block); }) << "Failure connecting tracking to the top_block."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ std::string path = std::string(TEST_PATH); std::string file = path + "signal_samples/GSoC_CTTC_capture_2012_07_26_4Msps_4ms.dat"; - const char * file_name = file.c_str(); - gr::blocks::file_source::sptr file_source = gr::blocks::file_source::make(sizeof(gr_complex),file_name,false); + const char* file_name = file.c_str(); + gr::blocks::file_source::sptr file_source = gr::blocks::file_source::make(sizeof(gr_complex), file_name, false); gr::blocks::skiphead::sptr skip_head = gr::blocks::skiphead::make(sizeof(gr_complex), skiphead_sps); boost::shared_ptr valve = gnss_sdr_make_valve(sizeof(gr_complex), num_samples, queue); gr::blocks::null_sink::sptr sink = gr::blocks::null_sink::make(sizeof(Gnss_Synchro)); @@ -200,12 +201,12 @@ TEST_F(GalileoE1DllPllVemlTrackingInternalTest, ValidationOfResults) tracking->start_tracking(); - EXPECT_NO_THROW( { + EXPECT_NO_THROW({ start = std::chrono::system_clock::now(); - top_block->run(); // Start threads and wait + top_block->run(); // Start threads and wait end = std::chrono::system_clock::now(); elapsed_seconds = end - start; }) << "Failure running the top_block."; - std::cout << "Tracked " << num_samples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; + std::cout << "Tracked " << num_samples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; } diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/galileo_e5a_tracking_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/galileo_e5a_tracking_test.cc index 887158baa..c1eded696 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/galileo_e5a_tracking_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/galileo_e5a_tracking_test.cc @@ -47,7 +47,7 @@ #include "galileo_e5a_dll_pll_tracking.h" -class GalileoE5aTrackingTest: public ::testing::Test +class GalileoE5aTrackingTest : public ::testing::Test { protected: GalileoE5aTrackingTest() @@ -61,7 +61,8 @@ protected: } ~GalileoE5aTrackingTest() - {} + { + } void init(); @@ -91,9 +92,9 @@ void GalileoE5aTrackingTest::init() config->set_property("Tracking_5X.dump_filename", "../data/e5a_tracking_ch_"); config->set_property("Tracking_5X.early_late_space_chips", "0.5"); config->set_property("Tracking_5X.order", "2"); - config->set_property("Tracking_5X.pll_bw_hz","20.0"); + config->set_property("Tracking_5X.pll_bw_hz", "20.0"); config->set_property("Tracking_5X.dll_bw_hz", "5.0"); - config->set_property("Tracking_5X.pll_bw_narrow_hz","2.0"); + config->set_property("Tracking_5X.pll_bw_narrow_hz", "2.0"); config->set_property("Tracking_5X.pll_bw_narrow_hz", "2.0"); config->set_property("Tracking_5X.ti_ms", "1"); } @@ -114,25 +115,25 @@ TEST_F(GalileoE5aTrackingTest, ValidationOfResults) std::shared_ptr tracking = std::dynamic_pointer_cast(trk_); //REAL - gnss_synchro.Acq_delay_samples = 10; // 32 Msps + gnss_synchro.Acq_delay_samples = 10; // 32 Msps // gnss_synchro.Acq_doppler_hz = 3500; // 32 Msps - gnss_synchro.Acq_doppler_hz = 2000; // 500 Hz resolution + gnss_synchro.Acq_doppler_hz = 2000; // 500 Hz resolution // gnss_synchro.Acq_samplestamp_samples = 98000; gnss_synchro.Acq_samplestamp_samples = 0; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ tracking->set_channel(gnss_synchro.Channel_ID); }) << "Failure setting channel."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ tracking->set_gnss_synchro(&gnss_synchro); }) << "Failure setting gnss_synchro."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ tracking->connect(top_block); }) << "Failure connecting tracking to the top_block."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ gr::analog::sig_source_c::sptr source = gr::analog::sig_source_c::make(fs_in, gr::analog::GR_SIN_WAVE, 1000, 1, gr_complex(0)); boost::shared_ptr valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue); gr::blocks::null_sink::sptr sink = gr::blocks::null_sink::make(sizeof(Gnss_Synchro)); @@ -143,13 +144,12 @@ TEST_F(GalileoE5aTrackingTest, ValidationOfResults) tracking->start_tracking(); - EXPECT_NO_THROW( { + EXPECT_NO_THROW({ start = std::chrono::system_clock::now(); - top_block->run(); // Start threads and wait + top_block->run(); // Start threads and wait end = std::chrono::system_clock::now(); elapsed_seconds = end - start; }) << "Failure running the top_block."; - std::cout << "Tracked " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; + std::cout << "Tracked " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; } - diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/glonass_l1_ca_dll_pll_c_aid_tracking_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/glonass_l1_ca_dll_pll_c_aid_tracking_test.cc index 00d77a6be..c0c7649c8 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/glonass_l1_ca_dll_pll_c_aid_tracking_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/glonass_l1_ca_dll_pll_c_aid_tracking_test.cc @@ -65,8 +65,7 @@ private: public: int rx_message; - ~GlonassL1CaDllPllCAidTrackingTest_msg_rx(); //!< Default destructor - + ~GlonassL1CaDllPllCAidTrackingTest_msg_rx(); //!< Default destructor }; GlonassL1CaDllPllCAidTrackingTest_msg_rx_sptr GlonassL1CaDllPllCAidTrackingTest_msg_rx_make() @@ -77,19 +76,18 @@ GlonassL1CaDllPllCAidTrackingTest_msg_rx_sptr GlonassL1CaDllPllCAidTrackingTest_ void GlonassL1CaDllPllCAidTrackingTest_msg_rx::msg_handler_events(pmt::pmt_t msg) { try - { + { long int message = pmt::to_long(msg); rx_message = message; - } - catch(boost::bad_any_cast& e) - { + } + catch (boost::bad_any_cast& e) + { LOG(WARNING) << "msg_handler_telemetry Bad any cast!"; rx_message = 0; - } + } } -GlonassL1CaDllPllCAidTrackingTest_msg_rx::GlonassL1CaDllPllCAidTrackingTest_msg_rx() : - gr::block("GlonassL1CaDllPllCAidTrackingTest_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0)) +GlonassL1CaDllPllCAidTrackingTest_msg_rx::GlonassL1CaDllPllCAidTrackingTest_msg_rx() : gr::block("GlonassL1CaDllPllCAidTrackingTest_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0)) { this->message_port_register_in(pmt::mp("events")); this->set_msg_handler(pmt::mp("events"), boost::bind(&GlonassL1CaDllPllCAidTrackingTest_msg_rx::msg_handler_events, this, _1)); @@ -97,13 +95,14 @@ GlonassL1CaDllPllCAidTrackingTest_msg_rx::GlonassL1CaDllPllCAidTrackingTest_msg_ } GlonassL1CaDllPllCAidTrackingTest_msg_rx::~GlonassL1CaDllPllCAidTrackingTest_msg_rx() -{} +{ +} // ########################################################### -class GlonassL1CaDllPllCAidTrackingTest: public ::testing::Test +class GlonassL1CaDllPllCAidTrackingTest : public ::testing::Test { protected: GlonassL1CaDllPllCAidTrackingTest() @@ -115,7 +114,8 @@ protected: } ~GlonassL1CaDllPllCAidTrackingTest() - {} + { + } void init(); @@ -154,7 +154,7 @@ TEST_F(GlonassL1CaDllPllCAidTrackingTest, ValidationOfResults) std::chrono::time_point start, end; std::chrono::duration elapsed_seconds(0); int fs_in = 6625000; - int nsamples = fs_in*4e-3*2; + int nsamples = fs_in * 4e-3 * 2; init(); queue = gr::msg_queue::make(0); @@ -167,23 +167,23 @@ TEST_F(GlonassL1CaDllPllCAidTrackingTest, ValidationOfResults) // gnss_synchro.Acq_doppler_hz = -2750; gnss_synchro.Acq_samplestamp_samples = 0; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ tracking->set_channel(gnss_synchro.Channel_ID); }) << "Failure setting channel."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ tracking->set_gnss_synchro(&gnss_synchro); }) << "Failure setting gnss_synchro."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ tracking->connect(top_block); }) << "Failure connecting tracking to the top_block."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ gr::analog::sig_source_c::sptr sin_source = gr::analog::sig_source_c::make(fs_in, gr::analog::GR_SIN_WAVE, 1000, 1, gr_complex(0)); std::string path = std::string(TEST_PATH); - std::string file = path + "signal_samples/NT1065_GLONASS_L1_20160831_fs6625e6_if0e3_4ms.bin"; - const char * file_name = file.c_str(); + std::string file = path + "signal_samples/NT1065_GLONASS_L1_20160831_fs6625e6_if0e3_4ms.bin"; + const char* file_name = file.c_str(); gr::blocks::file_source::sptr file_source = gr::blocks::file_source::make(sizeof(gr_complex), file_name, false); boost::shared_ptr valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue); gr::blocks::null_sink::sptr sink = gr::blocks::null_sink::make(sizeof(Gnss_Synchro)); @@ -195,13 +195,13 @@ TEST_F(GlonassL1CaDllPllCAidTrackingTest, ValidationOfResults) tracking->start_tracking(); - EXPECT_NO_THROW( { + EXPECT_NO_THROW({ start = std::chrono::system_clock::now(); - top_block->run(); // Start threads and wait + top_block->run(); // Start threads and wait end = std::chrono::system_clock::now(); elapsed_seconds = end - start; }) << "Failure running the top_block."; // TODO: Verify tracking results - std::cout << "Tracked " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; + std::cout << "Tracked " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; } diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/glonass_l1_ca_dll_pll_tracking_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/glonass_l1_ca_dll_pll_tracking_test.cc index 69e9ba4c7..f0deb0d4f 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/glonass_l1_ca_dll_pll_tracking_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/glonass_l1_ca_dll_pll_tracking_test.cc @@ -65,8 +65,7 @@ private: public: int rx_message; - ~GlonassL1CaDllPllTrackingTest_msg_rx(); //!< Default destructor - + ~GlonassL1CaDllPllTrackingTest_msg_rx(); //!< Default destructor }; GlonassL1CaDllPllTrackingTest_msg_rx_sptr GlonassL1CaDllPllTrackingTest_msg_rx_make() @@ -77,19 +76,18 @@ GlonassL1CaDllPllTrackingTest_msg_rx_sptr GlonassL1CaDllPllTrackingTest_msg_rx_m void GlonassL1CaDllPllTrackingTest_msg_rx::msg_handler_events(pmt::pmt_t msg) { try - { + { long int message = pmt::to_long(msg); rx_message = message; - } - catch(boost::bad_any_cast& e) - { + } + catch (boost::bad_any_cast& e) + { LOG(WARNING) << "msg_handler_telemetry Bad any cast!"; rx_message = 0; - } + } } -GlonassL1CaDllPllTrackingTest_msg_rx::GlonassL1CaDllPllTrackingTest_msg_rx() : - gr::block("GlonassL1CaDllPllTrackingTest_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0)) +GlonassL1CaDllPllTrackingTest_msg_rx::GlonassL1CaDllPllTrackingTest_msg_rx() : gr::block("GlonassL1CaDllPllTrackingTest_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0)) { this->message_port_register_in(pmt::mp("events")); this->set_msg_handler(pmt::mp("events"), boost::bind(&GlonassL1CaDllPllTrackingTest_msg_rx::msg_handler_events, this, _1)); @@ -97,13 +95,14 @@ GlonassL1CaDllPllTrackingTest_msg_rx::GlonassL1CaDllPllTrackingTest_msg_rx() : } GlonassL1CaDllPllTrackingTest_msg_rx::~GlonassL1CaDllPllTrackingTest_msg_rx() -{} +{ +} // ########################################################### -class GlonassL1CaDllPllTrackingTest: public ::testing::Test +class GlonassL1CaDllPllTrackingTest : public ::testing::Test { protected: GlonassL1CaDllPllTrackingTest() @@ -115,7 +114,8 @@ protected: } ~GlonassL1CaDllPllTrackingTest() - {} + { + } void init(); @@ -153,7 +153,7 @@ TEST_F(GlonassL1CaDllPllTrackingTest, ValidationOfResults) std::chrono::time_point start, end; std::chrono::duration elapsed_seconds(0); int fs_in = 6625000; - int nsamples = fs_in*4e-3*2; + int nsamples = fs_in * 4e-3 * 2; init(); queue = gr::msg_queue::make(0); @@ -166,23 +166,23 @@ TEST_F(GlonassL1CaDllPllTrackingTest, ValidationOfResults) // gnss_synchro.Acq_doppler_hz = -2750; gnss_synchro.Acq_samplestamp_samples = 0; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ tracking->set_channel(gnss_synchro.Channel_ID); }) << "Failure setting channel."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ tracking->set_gnss_synchro(&gnss_synchro); }) << "Failure setting gnss_synchro."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ tracking->connect(top_block); }) << "Failure connecting tracking to the top_block."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ gr::analog::sig_source_c::sptr sin_source = gr::analog::sig_source_c::make(fs_in, gr::analog::GR_SIN_WAVE, 1000, 1, gr_complex(0)); std::string path = std::string(TEST_PATH); - std::string file = path + "signal_samples/NT1065_GLONASS_L1_20160831_fs6625e6_if0e3_4ms.bin"; - const char * file_name = file.c_str(); + std::string file = path + "signal_samples/NT1065_GLONASS_L1_20160831_fs6625e6_if0e3_4ms.bin"; + const char* file_name = file.c_str(); gr::blocks::file_source::sptr file_source = gr::blocks::file_source::make(sizeof(gr_complex), file_name, false); boost::shared_ptr valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue); gr::blocks::null_sink::sptr sink = gr::blocks::null_sink::make(sizeof(Gnss_Synchro)); @@ -194,13 +194,13 @@ TEST_F(GlonassL1CaDllPllTrackingTest, ValidationOfResults) tracking->start_tracking(); - EXPECT_NO_THROW( { + EXPECT_NO_THROW({ start = std::chrono::system_clock::now(); - top_block->run(); // Start threads and wait + top_block->run(); // Start threads and wait end = std::chrono::system_clock::now(); elapsed_seconds = end - start; }) << "Failure running the top_block."; // TODO: Verify tracking results - std::cout << "Tracked " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; + std::cout << "Tracked " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; } diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test.cc index ce7c52fb2..d0ff41697 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test.cc @@ -72,7 +72,7 @@ private: public: int rx_message; - ~GpsL1CADllPllTrackingTest_msg_rx(); //!< Default destructor + ~GpsL1CADllPllTrackingTest_msg_rx(); //!< Default destructor }; @@ -85,20 +85,19 @@ GpsL1CADllPllTrackingTest_msg_rx_sptr GpsL1CADllPllTrackingTest_msg_rx_make() void GpsL1CADllPllTrackingTest_msg_rx::msg_handler_events(pmt::pmt_t msg) { try - { + { long int message = pmt::to_long(msg); rx_message = message; - } - catch(boost::bad_any_cast& e) - { + } + catch (boost::bad_any_cast& e) + { LOG(WARNING) << "msg_handler_telemetry Bad any cast!"; rx_message = 0; - } + } } -GpsL1CADllPllTrackingTest_msg_rx::GpsL1CADllPllTrackingTest_msg_rx() : - gr::block("GpsL1CADllPllTrackingTest_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0)) +GpsL1CADllPllTrackingTest_msg_rx::GpsL1CADllPllTrackingTest_msg_rx() : gr::block("GpsL1CADllPllTrackingTest_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0)) { this->message_port_register_in(pmt::mp("events")); this->set_msg_handler(pmt::mp("events"), boost::bind(&GpsL1CADllPllTrackingTest_msg_rx::msg_handler_events, this, _1)); @@ -107,12 +106,13 @@ GpsL1CADllPllTrackingTest_msg_rx::GpsL1CADllPllTrackingTest_msg_rx() : GpsL1CADllPllTrackingTest_msg_rx::~GpsL1CADllPllTrackingTest_msg_rx() -{} +{ +} // ########################################################### -class GpsL1CADllPllTrackingTest: public ::testing::Test +class GpsL1CADllPllTrackingTest : public ::testing::Test { public: std::string generator_binary; @@ -122,7 +122,7 @@ public: std::string p4; std::string p5; - std::string implementation = "GPS_L1_CA_DLL_PLL_Tracking"; //"GPS_L1_CA_DLL_PLL_C_Aid_Tracking"; + std::string implementation = "GPS_L1_CA_DLL_PLL_Tracking"; //"GPS_L1_CA_DLL_PLL_C_Aid_Tracking"; const int baseband_sampling_freq = FLAGS_fs_gen_sps; @@ -131,18 +131,18 @@ public: int configure_generator(); int generate_signal(); - void check_results_doppler(arma::vec & true_time_s, - arma::vec & true_value, - arma::vec & meas_time_s, - arma::vec & meas_value); - void check_results_acc_carrier_phase(arma::vec & true_time_s, - arma::vec & true_value, - arma::vec & meas_time_s, - arma::vec & meas_value); - void check_results_codephase(arma::vec & true_time_s, - arma::vec & true_value, - arma::vec & meas_time_s, - arma::vec & meas_value); + void check_results_doppler(arma::vec& true_time_s, + arma::vec& true_value, + arma::vec& meas_time_s, + arma::vec& meas_value); + void check_results_acc_carrier_phase(arma::vec& true_time_s, + arma::vec& true_value, + arma::vec& meas_time_s, + arma::vec& meas_value); + void check_results_codephase(arma::vec& true_time_s, + arma::vec& true_value, + arma::vec& meas_time_s, + arma::vec& meas_value); GpsL1CADllPllTrackingTest() { @@ -153,7 +153,8 @@ public: } ~GpsL1CADllPllTrackingTest() - {} + { + } void configure_receiver(); @@ -171,7 +172,7 @@ int GpsL1CADllPllTrackingTest::configure_generator() generator_binary = FLAGS_generator_binary; p1 = std::string("-rinex_nav_file=") + FLAGS_rinex_nav_file; - if(FLAGS_dynamic_position.empty()) + if (FLAGS_dynamic_position.empty()) { p2 = std::string("-static_position=") + FLAGS_static_position + std::string(",") + std::to_string(FLAGS_duration * 10); } @@ -179,9 +180,9 @@ int GpsL1CADllPllTrackingTest::configure_generator() { p2 = std::string("-obs_pos_file=") + std::string(FLAGS_dynamic_position); } - p3 = std::string("-rinex_obs_file=") + FLAGS_filename_rinex_obs; // RINEX 2.10 observation file output - p4 = std::string("-sig_out_file=") + FLAGS_filename_raw_data; // Baseband signal output file. Will be stored in int8_t IQ multiplexed samples - p5 = std::string("-sampling_freq=") + std::to_string(baseband_sampling_freq); //Baseband sampling frequency [MSps] + p3 = std::string("-rinex_obs_file=") + FLAGS_filename_rinex_obs; // RINEX 2.10 observation file output + p4 = std::string("-sig_out_file=") + FLAGS_filename_raw_data; // Baseband signal output file. Will be stored in int8_t IQ multiplexed samples + p5 = std::string("-sampling_freq=") + std::to_string(baseband_sampling_freq); //Baseband sampling frequency [MSps] return 0; } @@ -190,7 +191,7 @@ int GpsL1CADllPllTrackingTest::generate_signal() { int child_status; - char *const parmList[] = { &generator_binary[0], &generator_binary[0], &p1[0], &p2[0], &p3[0], &p4[0], &p5[0], NULL }; + char* const parmList[] = {&generator_binary[0], &generator_binary[0], &p1[0], &p2[0], &p3[0], &p4[0], &p5[0], NULL}; int pid; if ((pid = fork()) == -1) @@ -204,7 +205,7 @@ int GpsL1CADllPllTrackingTest::generate_signal() waitpid(pid, &child_status, 0); - std::cout << "Signal and Observables RINEX and RAW files created." << std::endl; + std::cout << "Signal and Observables RINEX and RAW files created." << std::endl; return 0; } @@ -230,10 +231,10 @@ void GpsL1CADllPllTrackingTest::configure_receiver() } -void GpsL1CADllPllTrackingTest::check_results_doppler(arma::vec & true_time_s, - arma::vec & true_value, - arma::vec & meas_time_s, - arma::vec & meas_value) +void GpsL1CADllPllTrackingTest::check_results_doppler(arma::vec& true_time_s, + arma::vec& true_value, + arma::vec& meas_time_s, + arma::vec& meas_value) { // 1. True value interpolation to match the measurement times arma::vec true_value_interp; @@ -266,14 +267,14 @@ void GpsL1CADllPllTrackingTest::check_results_doppler(arma::vec & true_time_s, std::cout << std::setprecision(10) << "TRK Doppler RMSE=" << rmse << ", mean=" << error_mean << ", stdev=" << sqrt(error_var) << " (max,min)=" << max_error << "," << min_error << " [Hz]" << std::endl; - std::cout.precision (ss); + std::cout.precision(ss); } -void GpsL1CADllPllTrackingTest::check_results_acc_carrier_phase(arma::vec & true_time_s, - arma::vec & true_value, - arma::vec & meas_time_s, - arma::vec & meas_value) +void GpsL1CADllPllTrackingTest::check_results_acc_carrier_phase(arma::vec& true_time_s, + arma::vec& true_value, + arma::vec& meas_time_s, + arma::vec& meas_value) { // 1. True value interpolation to match the measurement times arma::vec true_value_interp; @@ -305,14 +306,14 @@ void GpsL1CADllPllTrackingTest::check_results_acc_carrier_phase(arma::vec & true std::cout << std::setprecision(10) << "TRK acc carrier phase RMSE=" << rmse << ", mean=" << error_mean << ", stdev=" << sqrt(error_var) << " (max,min)=" << max_error << "," << min_error << " [Hz]" << std::endl; - std::cout.precision (ss); + std::cout.precision(ss); } -void GpsL1CADllPllTrackingTest::check_results_codephase(arma::vec & true_time_s, - arma::vec & true_value, - arma::vec & meas_time_s, - arma::vec & meas_value) +void GpsL1CADllPllTrackingTest::check_results_codephase(arma::vec& true_time_s, + arma::vec& true_value, + arma::vec& meas_time_s, + arma::vec& meas_value) { // 1. True value interpolation to match the measurement times arma::vec true_value_interp; @@ -345,7 +346,7 @@ void GpsL1CADllPllTrackingTest::check_results_codephase(arma::vec & true_time_s, std::cout << std::setprecision(10) << "TRK code phase RMSE=" << rmse << ", mean=" << error_mean << ", stdev=" << sqrt(error_var) << " (max,min)=" << max_error << "," << min_error << " [Chips]" << std::endl; - std::cout.precision (ss); + std::cout.precision(ss); } @@ -376,7 +377,7 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults) top_block = gr::make_top_block("Tracking test"); std::shared_ptr trk_ = factory->GetBlock(config, "Tracking_1C", implementation, 1, 1); - std::shared_ptr tracking = std::dynamic_pointer_cast(trk_);//std::make_shared(config.get(), "Tracking_1C", 1, 1); + std::shared_ptr tracking = std::dynamic_pointer_cast(trk_); //std::make_shared(config.get(), "Tracking_1C", 1, 1); boost::shared_ptr msg_rx = GpsL1CADllPllTrackingTest_msg_rx_make(); @@ -384,7 +385,7 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults) ASSERT_EQ(true_obs_data.read_binary_obs(), true) << "Failure reading true tracking dump file." << std::endl << "Maybe sat PRN #" + std::to_string(FLAGS_test_satellite_PRN) + - " is not available?"; + " is not available?"; // restart the epoch counter true_obs_data.restart(); @@ -394,23 +395,23 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults) gnss_synchro.Acq_doppler_hz = true_obs_data.doppler_l1_hz; gnss_synchro.Acq_samplestamp_samples = 0; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ tracking->set_channel(gnss_synchro.Channel_ID); }) << "Failure setting channel."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ tracking->set_gnss_synchro(&gnss_synchro); }) << "Failure setting gnss_synchro."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ tracking->connect(top_block); }) << "Failure connecting tracking to the top_block."; - ASSERT_NO_THROW( { - std::string file = "./" + filename_raw_data; - const char * file_name = file.c_str(); + ASSERT_NO_THROW({ + std::string file = "./" + filename_raw_data; + const char* file_name = file.c_str(); gr::blocks::file_source::sptr file_source = gr::blocks::file_source::make(sizeof(int8_t), file_name, false); - gr::blocks::interleaved_char_to_complex::sptr gr_interleaved_char_to_complex = gr::blocks::interleaved_char_to_complex::make(); + gr::blocks::interleaved_char_to_complex::sptr gr_interleaved_char_to_complex = gr::blocks::interleaved_char_to_complex::make(); gr::blocks::null_sink::sptr sink = gr::blocks::null_sink::make(sizeof(Gnss_Synchro)); top_block->connect(file_source, 0, gr_interleaved_char_to_complex, 0); top_block->connect(gr_interleaved_char_to_complex, 0, tracking->get_left_block(), 0); @@ -420,9 +421,9 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults) tracking->start_tracking(); - EXPECT_NO_THROW( { + EXPECT_NO_THROW({ start = std::chrono::system_clock::now(); - top_block->run(); // Start threads and wait + top_block->run(); // Start threads and wait end = std::chrono::system_clock::now(); }) << "Failure running the top_block."; @@ -438,7 +439,7 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults) arma::vec true_tow_s = arma::zeros(nepoch, 1); long int epoch_counter = 0; - while(true_obs_data.read_binary_obs()) + while (true_obs_data.read_binary_obs()) { true_timestamp_s(epoch_counter) = true_obs_data.signal_timestamp_s; true_acc_carrier_phase_cycles(epoch_counter) = true_obs_data.acc_carrier_phase_cycles; @@ -452,7 +453,7 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults) tracking_dump_reader trk_dump; ASSERT_EQ(trk_dump.open_obs_file(std::string("./tracking_ch_0.dat")), true) - << "Failure opening tracking dump file"; + << "Failure opening tracking dump file"; nepoch = trk_dump.num_epochs(); std::cout << "Measured observation epochs=" << nepoch << std::endl; @@ -469,14 +470,13 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults) std::vector promptQ; epoch_counter = 0; - while(trk_dump.read_binary_obs()) + while (trk_dump.read_binary_obs()) { trk_timestamp_s(epoch_counter) = static_cast(trk_dump.PRN_start_sample_count) / static_cast(baseband_sampling_freq); trk_acc_carrier_phase_cycles(epoch_counter) = trk_dump.acc_carrier_phase_rad / GPS_TWO_PI; trk_Doppler_Hz(epoch_counter) = trk_dump.carrier_doppler_hz; - double delay_chips = GPS_L1_CA_CODE_LENGTH_CHIPS - GPS_L1_CA_CODE_LENGTH_CHIPS - * (fmod((static_cast(trk_dump.PRN_start_sample_count) + trk_dump.aux1) / static_cast(baseband_sampling_freq), 1.0e-3) / 1.0e-3); + double delay_chips = GPS_L1_CA_CODE_LENGTH_CHIPS - GPS_L1_CA_CODE_LENGTH_CHIPS * (fmod((static_cast(trk_dump.PRN_start_sample_count) + trk_dump.aux1) / static_cast(baseband_sampling_freq), 1.0e-3) / 1.0e-3); trk_prn_delay_chips(epoch_counter) = delay_chips; epoch_counter++; @@ -503,10 +503,10 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults) std::chrono::duration elapsed_seconds = end - start; std::cout << "Signal tracking completed in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; - if(FLAGS_plot_gps_l1_tracking_test == true) + if (FLAGS_plot_gps_l1_tracking_test == true) { const std::string gnuplot_executable(FLAGS_gnuplot_executable); - if(gnuplot_executable.empty()) + if (gnuplot_executable.empty()) { std::cout << "WARNING: Although the flag plot_gps_l1_tracking_test has been set to TRUE," << std::endl; std::cout << "gnuplot has not been found in your system." << std::endl; @@ -515,7 +515,7 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults) else { try - { + { boost::filesystem::path p(gnuplot_executable); boost::filesystem::path dir = p.parent_path(); std::string gnuplot_path = dir.native(); @@ -535,12 +535,12 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults) g1.set_ylabel("Correlators' output"); g1.cmd("set key box opaque"); unsigned int decimate = static_cast(FLAGS_plot_decimate); - g1.plot_xy( timevec, prompt, "Prompt", decimate); - g1.plot_xy( timevec, early, "Early", decimate); - g1.plot_xy( timevec, late, "Late", decimate); + g1.plot_xy(timevec, prompt, "Prompt", decimate); + g1.plot_xy(timevec, early, "Early", decimate); + g1.plot_xy(timevec, late, "Late", decimate); g1.savetops("Correlators_outputs"); g1.savetopdf("Correlators_outputs", 18); - g1.showonscreen(); // window output + g1.showonscreen(); // window output Gnuplot g2("points"); g2.set_title("Constellation diagram (satellite PRN #" + std::to_string(FLAGS_test_satellite_PRN) + ")"); @@ -548,16 +548,15 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults) g2.set_xlabel("Inphase"); g2.set_ylabel("Quadrature"); g2.cmd("set size ratio -1"); - g2.plot_xy( promptI, promptQ); + g2.plot_xy(promptI, promptQ); g2.savetops("Constellation"); g2.savetopdf("Constellation", 18); - g2.showonscreen(); // window output - - } - catch (const GnuplotException & ge) - { + g2.showonscreen(); // window output + } + catch (const GnuplotException& ge) + { std::cout << ge.what() << std::endl; - } + } } } } diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l2_m_dll_pll_tracking_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l2_m_dll_pll_tracking_test.cc index 8a2f31281..131fc1e4c 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l2_m_dll_pll_tracking_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l2_m_dll_pll_tracking_test.cc @@ -65,8 +65,7 @@ private: public: int rx_message; - ~GpsL2MDllPllTrackingTest_msg_rx(); //!< Default destructor - + ~GpsL2MDllPllTrackingTest_msg_rx(); //!< Default destructor }; @@ -79,20 +78,19 @@ GpsL2MDllPllTrackingTest_msg_rx_sptr GpsL2MDllPllTrackingTest_msg_rx_make() void GpsL2MDllPllTrackingTest_msg_rx::msg_handler_events(pmt::pmt_t msg) { try - { + { long int message = pmt::to_long(msg); rx_message = message; - } - catch(boost::bad_any_cast& e) - { + } + catch (boost::bad_any_cast& e) + { LOG(WARNING) << "msg_handler_telemetry Bad any cast!"; rx_message = 0; - } + } } -GpsL2MDllPllTrackingTest_msg_rx::GpsL2MDllPllTrackingTest_msg_rx() : - gr::block("GpsL2MDllPllTrackingTest_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0)) +GpsL2MDllPllTrackingTest_msg_rx::GpsL2MDllPllTrackingTest_msg_rx() : gr::block("GpsL2MDllPllTrackingTest_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0)) { this->message_port_register_in(pmt::mp("events")); this->set_msg_handler(pmt::mp("events"), boost::bind(&GpsL2MDllPllTrackingTest_msg_rx::msg_handler_events, this, _1)); @@ -101,12 +99,13 @@ GpsL2MDllPllTrackingTest_msg_rx::GpsL2MDllPllTrackingTest_msg_rx() : GpsL2MDllPllTrackingTest_msg_rx::~GpsL2MDllPllTrackingTest_msg_rx() -{} +{ +} // ########################################################### -class GpsL2MDllPllTrackingTest: public ::testing::Test +class GpsL2MDllPllTrackingTest : public ::testing::Test { protected: GpsL2MDllPllTrackingTest() @@ -118,7 +117,8 @@ protected: } ~GpsL2MDllPllTrackingTest() - {} + { + } void init(); @@ -168,23 +168,23 @@ TEST_F(GpsL2MDllPllTrackingTest, ValidationOfResults) gnss_synchro.Acq_doppler_hz = 1200; gnss_synchro.Acq_samplestamp_samples = 0; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ tracking->set_channel(gnss_synchro.Channel_ID); }) << "Failure setting channel."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ tracking->set_gnss_synchro(&gnss_synchro); }) << "Failure setting gnss_synchro."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ tracking->connect(top_block); }) << "Failure connecting tracking to the top_block."; - ASSERT_NO_THROW( { + ASSERT_NO_THROW({ //gr::analog::sig_source_c::sptr source = gr::analog::sig_source_c::make(fs_in, gr::analog::GR_SIN_WAVE, 1000, 1, gr_complex(0)); std::string path = std::string(TEST_PATH); - std::string file = path + "signal_samples/gps_l2c_m_prn7_5msps.dat"; - const char * file_name = file.c_str(); + std::string file = path + "signal_samples/gps_l2c_m_prn7_5msps.dat"; + const char* file_name = file.c_str(); gr::blocks::file_source::sptr file_source = gr::blocks::file_source::make(sizeof(gr_complex), file_name, false); boost::shared_ptr valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue); gr::blocks::null_sink::sptr sink = gr::blocks::null_sink::make(sizeof(Gnss_Synchro)); @@ -196,14 +196,13 @@ TEST_F(GpsL2MDllPllTrackingTest, ValidationOfResults) tracking->start_tracking(); - EXPECT_NO_THROW( { + EXPECT_NO_THROW({ start = std::chrono::system_clock::now(); - top_block->run(); // Start threads and wait + top_block->run(); // Start threads and wait end = std::chrono::system_clock::now(); elapsed_seconds = end - start; }) << "Failure running the top_block."; // TODO: Verify tracking results - std::cout << "Tracked " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; + std::cout << "Tracked " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; } - diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/gpu_multicorrelator_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/gpu_multicorrelator_test.cc index 432dcaa45..1e5604e87 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/gpu_multicorrelator_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/gpu_multicorrelator_test.cc @@ -44,21 +44,21 @@ DEFINE_int32(gpu_multicorrelator_iterations_test, 1000, "Number of averaged iter DEFINE_int32(gpu_multicorrelator_max_threads_test, 12, "Number of maximum concurrent correlators in GPU multicorrelator test timing test"); void run_correlator_gpu(cuda_multicorrelator* correlator, - float d_rem_carrier_phase_rad, - float d_carrier_phase_step_rad, - float d_code_phase_step_chips, - float d_rem_code_phase_chips, - int correlation_size, - int d_n_correlator_taps) + float d_rem_carrier_phase_rad, + float d_carrier_phase_step_rad, + float d_code_phase_step_chips, + float d_rem_code_phase_chips, + int correlation_size, + int d_n_correlator_taps) { - for(int k = 0; k < FLAGS_cpu_multicorrelator_iterations_test; k++) + for (int k = 0; k < FLAGS_cpu_multicorrelator_iterations_test; k++) { correlator->Carrier_wipeoff_multicorrelator_resampler_cuda(d_rem_carrier_phase_rad, - d_carrier_phase_step_rad, - d_code_phase_step_chips, - d_rem_code_phase_chips, - correlation_size, - d_n_correlator_taps); + d_carrier_phase_step_rad, + d_code_phase_step_chips, + d_rem_code_phase_chips, + correlation_size, + d_n_correlator_taps); } } @@ -70,28 +70,28 @@ TEST(GpuMulticorrelatorTest, MeasureExecutionTime) int max_threads = FLAGS_gpu_multicorrelator_max_threads_test; std::vector thread_pool; cuda_multicorrelator* correlator_pool[max_threads]; - unsigned int correlation_sizes [3] = { 2048, 4096, 8192}; - double execution_times [3]; + unsigned int correlation_sizes[3] = {2048, 4096, 8192}; + double execution_times[3]; gr_complex* d_ca_code; gr_complex* in_gpu; gr_complex* d_correlator_outs; int d_n_correlator_taps = 3; - int d_vector_length = correlation_sizes[2]; //max correlation size to allocate all the necessary memory + int d_vector_length = correlation_sizes[2]; //max correlation size to allocate all the necessary memory float* d_local_code_shift_chips; // Set GPU flags cudaSetDeviceFlags(cudaDeviceMapHost); //allocate host memory //pinned memory mode - use special function to get OS-pinned memory - d_n_correlator_taps = 3; // Early, Prompt, and Late + d_n_correlator_taps = 3; // Early, Prompt, and Late // Get space for a vector with the C/A code replica sampled 1x/chip - cudaHostAlloc((void**)&d_ca_code, (static_cast(GPS_L1_CA_CODE_LENGTH_CHIPS)* sizeof(gr_complex)), cudaHostAllocMapped | cudaHostAllocWriteCombined); + cudaHostAlloc((void**)&d_ca_code, (static_cast(GPS_L1_CA_CODE_LENGTH_CHIPS) * sizeof(gr_complex)), cudaHostAllocMapped | cudaHostAllocWriteCombined); // Get space for the resampled early / prompt / late local replicas - cudaHostAlloc((void**)&d_local_code_shift_chips, d_n_correlator_taps * sizeof(float), cudaHostAllocMapped | cudaHostAllocWriteCombined); + cudaHostAlloc((void**)&d_local_code_shift_chips, d_n_correlator_taps * sizeof(float), cudaHostAllocMapped | cudaHostAllocWriteCombined); cudaHostAlloc((void**)&in_gpu, 2 * d_vector_length * sizeof(gr_complex), cudaHostAllocMapped | cudaHostAllocWriteCombined); // correlator outputs (scalar) - cudaHostAlloc((void**)&d_correlator_outs ,sizeof(gr_complex)*d_n_correlator_taps, cudaHostAllocMapped | cudaHostAllocWriteCombined ); + cudaHostAlloc((void**)&d_correlator_outs, sizeof(gr_complex) * d_n_correlator_taps, cudaHostAllocMapped | cudaHostAllocWriteCombined); //--- Perform initializations ------------------------------ //local code resampler on GPU @@ -104,7 +104,7 @@ TEST(GpuMulticorrelatorTest, MeasureExecutionTime) } // Set TAPs delay values [chips] float d_early_late_spc_chips = 0.5; - d_local_code_shift_chips[0] = - d_early_late_spc_chips; + d_local_code_shift_chips[0] = -d_early_late_spc_chips; d_local_code_shift_chips[1] = 0.0; d_local_code_shift_chips[2] = d_early_late_spc_chips; for (int n = 0; n < max_threads; n++) @@ -120,39 +120,37 @@ TEST(GpuMulticorrelatorTest, MeasureExecutionTime) float d_rem_code_phase_chips = 0.4; EXPECT_NO_THROW( - for(int correlation_sizes_idx = 0; correlation_sizes_idx < 3; correlation_sizes_idx++) + for (int correlation_sizes_idx = 0; correlation_sizes_idx < 3; correlation_sizes_idx++) { + for (int current_max_threads = 1; current_max_threads < (max_threads + 1); current_max_threads++) { - for(int current_max_threads = 1; current_max_threads < (max_threads+1); current_max_threads++) + std::cout << "Running " << current_max_threads << " concurrent correlators" << std::endl; + start = std::chrono::system_clock::now(); + //create the concurrent correlator threads + for (int current_thread = 0; current_thread < current_max_threads; current_thread++) { - std::cout << "Running " << current_max_threads << " concurrent correlators" << std::endl; - start = std::chrono::system_clock::now(); - //create the concurrent correlator threads - for (int current_thread = 0; current_thread < current_max_threads; current_thread++) - { - //cudaProfilerStart(); - thread_pool.push_back(std::thread(run_correlator_gpu, - correlator_pool[current_thread], - d_rem_carrier_phase_rad, - d_carrier_phase_step_rad, - d_code_phase_step_chips, - d_rem_code_phase_chips, - correlation_sizes[correlation_sizes_idx], - d_n_correlator_taps)); - //cudaProfilerStop(); - } - //wait the threads to finish they work and destroy the thread objects - for(auto &t : thread_pool) - { - t.join(); - } - thread_pool.clear(); - end = std::chrono::system_clock::now(); - elapsed_seconds = end - start; - execution_times[correlation_sizes_idx] = elapsed_seconds.count() / static_cast(FLAGS_gpu_multicorrelator_iterations_test); - std::cout << "GPU Multicorrelator execution time for length=" << correlation_sizes[correlation_sizes_idx] << " : " << execution_times[correlation_sizes_idx] << " [s]" << std::endl; + //cudaProfilerStart(); + thread_pool.push_back(std::thread(run_correlator_gpu, + correlator_pool[current_thread], + d_rem_carrier_phase_rad, + d_carrier_phase_step_rad, + d_code_phase_step_chips, + d_rem_code_phase_chips, + correlation_sizes[correlation_sizes_idx], + d_n_correlator_taps)); + //cudaProfilerStop(); } + //wait the threads to finish they work and destroy the thread objects + for (auto& t : thread_pool) + { + t.join(); + } + thread_pool.clear(); + end = std::chrono::system_clock::now(); + elapsed_seconds = end - start; + execution_times[correlation_sizes_idx] = elapsed_seconds.count() / static_cast(FLAGS_gpu_multicorrelator_iterations_test); + std::cout << "GPU Multicorrelator execution time for length=" << correlation_sizes[correlation_sizes_idx] << " : " << execution_times[correlation_sizes_idx] << " [s]" << std::endl; } - ); + }); cudaFreeHost(in_gpu); cudaFreeHost(d_correlator_outs); diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_loop_filter_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_loop_filter_test.cc index a1c904b02..52a31a954 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_loop_filter_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_loop_filter_test.cc @@ -39,27 +39,27 @@ TEST(TrackingLoopFilterTest, FirstOrderLoop) float update_interval = 0.001; bool include_last_integrator = false; - Tracking_loop_filter theFilter( update_interval, - noise_bandwidth, - loop_order, - include_last_integrator ); + Tracking_loop_filter theFilter(update_interval, + noise_bandwidth, + loop_order, + include_last_integrator); - EXPECT_EQ( theFilter.get_noise_bandwidth(), noise_bandwidth ); - EXPECT_EQ( theFilter.get_update_interval(), update_interval ); - EXPECT_EQ( theFilter.get_include_last_integrator(), include_last_integrator ); - EXPECT_EQ( theFilter.get_order(), loop_order ); + EXPECT_EQ(theFilter.get_noise_bandwidth(), noise_bandwidth); + EXPECT_EQ(theFilter.get_update_interval(), update_interval); + EXPECT_EQ(theFilter.get_include_last_integrator(), include_last_integrator); + EXPECT_EQ(theFilter.get_order(), loop_order); - std::vector< float > sample_data = { 0.0, 0.0, 1.0, 0.0, 0.0, 0.0 }; + std::vector sample_data = {0.0, 0.0, 1.0, 0.0, 0.0, 0.0}; - theFilter.initialize( 0.0 ); + theFilter.initialize(0.0); float g1 = noise_bandwidth * 4.0; float result = 0.0; - for( unsigned int i = 0; i < sample_data.size(); ++i ) + for (unsigned int i = 0; i < sample_data.size(); ++i) { - result = theFilter.apply( sample_data[i] ); - EXPECT_FLOAT_EQ( result, sample_data[i]*g1 ); + result = theFilter.apply(sample_data[i]); + EXPECT_FLOAT_EQ(result, sample_data[i] * g1); } } @@ -71,31 +71,30 @@ TEST(TrackingLoopFilterTest, FirstOrderLoopWithLastIntegrator) float update_interval = 0.001; bool include_last_integrator = true; - Tracking_loop_filter theFilter( update_interval, - noise_bandwidth, - loop_order, - include_last_integrator ); + Tracking_loop_filter theFilter(update_interval, + noise_bandwidth, + loop_order, + include_last_integrator); - EXPECT_EQ( theFilter.get_noise_bandwidth(), noise_bandwidth ); - EXPECT_EQ( theFilter.get_update_interval(), update_interval ); - EXPECT_EQ( theFilter.get_include_last_integrator(), include_last_integrator ); - EXPECT_EQ( theFilter.get_order(), loop_order ); + EXPECT_EQ(theFilter.get_noise_bandwidth(), noise_bandwidth); + EXPECT_EQ(theFilter.get_update_interval(), update_interval); + EXPECT_EQ(theFilter.get_include_last_integrator(), include_last_integrator); + EXPECT_EQ(theFilter.get_order(), loop_order); - std::vector< float > sample_data = { 0.0, 0.0, 1.0, 0.0, 0.0, 0.0 }; - std::vector< float > expected_out = { 0.0, 0.0, 0.01, 0.02, 0.02, 0.02 }; + std::vector sample_data = {0.0, 0.0, 1.0, 0.0, 0.0, 0.0}; + std::vector expected_out = {0.0, 0.0, 0.01, 0.02, 0.02, 0.02}; - theFilter.initialize( 0.0 ); + theFilter.initialize(0.0); float result = 0.0; - for( unsigned int i = 0; i < sample_data.size(); ++i ) + for (unsigned int i = 0; i < sample_data.size(); ++i) { - result = theFilter.apply( sample_data[i] ); - EXPECT_NEAR( result, expected_out[i], 1e-4 ); + result = theFilter.apply(sample_data[i]); + EXPECT_NEAR(result, expected_out[i], 1e-4); } } - TEST(TrackingLoopFilterTest, SecondOrderLoop) { int loop_order = 2; @@ -103,26 +102,26 @@ TEST(TrackingLoopFilterTest, SecondOrderLoop) float update_interval = 0.001; bool include_last_integrator = false; - Tracking_loop_filter theFilter( update_interval, - noise_bandwidth, - loop_order, - include_last_integrator ); + Tracking_loop_filter theFilter(update_interval, + noise_bandwidth, + loop_order, + include_last_integrator); - EXPECT_EQ( theFilter.get_noise_bandwidth(), noise_bandwidth ); - EXPECT_EQ( theFilter.get_update_interval(), update_interval ); - EXPECT_EQ( theFilter.get_include_last_integrator(), include_last_integrator ); - EXPECT_EQ( theFilter.get_order(), loop_order ); + EXPECT_EQ(theFilter.get_noise_bandwidth(), noise_bandwidth); + EXPECT_EQ(theFilter.get_update_interval(), update_interval); + EXPECT_EQ(theFilter.get_include_last_integrator(), include_last_integrator); + EXPECT_EQ(theFilter.get_order(), loop_order); - std::vector< float > sample_data = { 0.0, 0.0, 1.0, 0.0, 0.0, 0.0 }; - std::vector< float > expected_out = { 0.0, 0.0, 13.37778, 0.0889, 0.0889, 0.0889 }; + std::vector sample_data = {0.0, 0.0, 1.0, 0.0, 0.0, 0.0}; + std::vector expected_out = {0.0, 0.0, 13.37778, 0.0889, 0.0889, 0.0889}; - theFilter.initialize( 0.0 ); + theFilter.initialize(0.0); float result = 0.0; - for( unsigned int i = 0; i < sample_data.size(); ++i ) + for (unsigned int i = 0; i < sample_data.size(); ++i) { - result = theFilter.apply( sample_data[i] ); - EXPECT_NEAR( result, expected_out[i], 1e-4 ); + result = theFilter.apply(sample_data[i]); + EXPECT_NEAR(result, expected_out[i], 1e-4); } } @@ -134,26 +133,26 @@ TEST(TrackingLoopFilterTest, SecondOrderLoopWithLastIntegrator) float update_interval = 0.001; bool include_last_integrator = true; - Tracking_loop_filter theFilter( update_interval, - noise_bandwidth, - loop_order, - include_last_integrator ); + Tracking_loop_filter theFilter(update_interval, + noise_bandwidth, + loop_order, + include_last_integrator); - EXPECT_EQ( theFilter.get_noise_bandwidth(), noise_bandwidth ); - EXPECT_EQ( theFilter.get_update_interval(), update_interval ); - EXPECT_EQ( theFilter.get_include_last_integrator(), include_last_integrator ); - EXPECT_EQ( theFilter.get_order(), loop_order ); + EXPECT_EQ(theFilter.get_noise_bandwidth(), noise_bandwidth); + EXPECT_EQ(theFilter.get_update_interval(), update_interval); + EXPECT_EQ(theFilter.get_include_last_integrator(), include_last_integrator); + EXPECT_EQ(theFilter.get_order(), loop_order); - std::vector< float > sample_data = { 0.0, 0.0, 1.0, 0.0, 0.0, 0.0 }; - std::vector< float > expected_out = { 0.0, 0.0, 0.006689, 0.013422, 0.013511, 0.013600 }; + std::vector sample_data = {0.0, 0.0, 1.0, 0.0, 0.0, 0.0}; + std::vector expected_out = {0.0, 0.0, 0.006689, 0.013422, 0.013511, 0.013600}; - theFilter.initialize( 0.0 ); + theFilter.initialize(0.0); float result = 0.0; - for( unsigned int i = 0; i < sample_data.size(); ++i ) + for (unsigned int i = 0; i < sample_data.size(); ++i) { - result = theFilter.apply( sample_data[i] ); - EXPECT_NEAR( result, expected_out[i], 1e-4 ); + result = theFilter.apply(sample_data[i]); + EXPECT_NEAR(result, expected_out[i], 1e-4); } } @@ -165,26 +164,26 @@ TEST(TrackingLoopFilterTest, ThirdOrderLoop) float update_interval = 0.001; bool include_last_integrator = false; - Tracking_loop_filter theFilter( update_interval, - noise_bandwidth, - loop_order, - include_last_integrator ); + Tracking_loop_filter theFilter(update_interval, + noise_bandwidth, + loop_order, + include_last_integrator); - EXPECT_EQ( theFilter.get_noise_bandwidth(), noise_bandwidth ); - EXPECT_EQ( theFilter.get_update_interval(), update_interval ); - EXPECT_EQ( theFilter.get_include_last_integrator(), include_last_integrator ); - EXPECT_EQ( theFilter.get_order(), loop_order ); + EXPECT_EQ(theFilter.get_noise_bandwidth(), noise_bandwidth); + EXPECT_EQ(theFilter.get_update_interval(), update_interval); + EXPECT_EQ(theFilter.get_include_last_integrator(), include_last_integrator); + EXPECT_EQ(theFilter.get_order(), loop_order); - std::vector< float > sample_data = { 0.0, 0.0, 1.0, 0.0, 0.0, 0.0 }; - std::vector< float > expected_out = { 0.0, 0.0, 15.31877, 0.04494, 0.04520, 0.04546}; + std::vector sample_data = {0.0, 0.0, 1.0, 0.0, 0.0, 0.0}; + std::vector expected_out = {0.0, 0.0, 15.31877, 0.04494, 0.04520, 0.04546}; - theFilter.initialize( 0.0 ); + theFilter.initialize(0.0); float result = 0.0; - for( unsigned int i = 0; i < sample_data.size(); ++i ) + for (unsigned int i = 0; i < sample_data.size(); ++i) { - result = theFilter.apply( sample_data[i] ); - EXPECT_NEAR( result, expected_out[i], 1e-4 ); + result = theFilter.apply(sample_data[i]); + EXPECT_NEAR(result, expected_out[i], 1e-4); } } @@ -196,27 +195,25 @@ TEST(TrackingLoopFilterTest, ThirdOrderLoopWithLastIntegrator) float update_interval = 0.001; bool include_last_integrator = true; - Tracking_loop_filter theFilter( update_interval, - noise_bandwidth, - loop_order, - include_last_integrator ); + Tracking_loop_filter theFilter(update_interval, + noise_bandwidth, + loop_order, + include_last_integrator); - EXPECT_EQ( theFilter.get_noise_bandwidth(), noise_bandwidth ); - EXPECT_EQ( theFilter.get_update_interval(), update_interval ); - EXPECT_EQ( theFilter.get_include_last_integrator(), include_last_integrator ); - EXPECT_EQ( theFilter.get_order(), loop_order ); + EXPECT_EQ(theFilter.get_noise_bandwidth(), noise_bandwidth); + EXPECT_EQ(theFilter.get_update_interval(), update_interval); + EXPECT_EQ(theFilter.get_include_last_integrator(), include_last_integrator); + EXPECT_EQ(theFilter.get_order(), loop_order); - std::vector< float > sample_data = { 0.0, 0.0, 1.0, 0.0, 0.0, 0.0 }; - std::vector< float > expected_out = { 0.0, 0.0, 0.007659, 0.015341, 0.015386, 0.015432}; + std::vector sample_data = {0.0, 0.0, 1.0, 0.0, 0.0, 0.0}; + std::vector expected_out = {0.0, 0.0, 0.007659, 0.015341, 0.015386, 0.015432}; - theFilter.initialize( 0.0 ); + theFilter.initialize(0.0); float result = 0.0; - for( unsigned int i = 0; i < sample_data.size(); ++i ) + for (unsigned int i = 0; i < sample_data.size(); ++i) { - result = theFilter.apply( sample_data[i] ); - EXPECT_NEAR( result, expected_out[i], 1e-4 ); + result = theFilter.apply(sample_data[i]); + EXPECT_NEAR(result, expected_out[i], 1e-4); } } - - diff --git a/src/tests/unit-tests/system-parameters/glonass_gnav_ephemeris_test.cc b/src/tests/unit-tests/system-parameters/glonass_gnav_ephemeris_test.cc index 10f0cc28d..673de252c 100644 --- a/src/tests/unit-tests/system-parameters/glonass_gnav_ephemeris_test.cc +++ b/src/tests/unit-tests/system-parameters/glonass_gnav_ephemeris_test.cc @@ -53,12 +53,12 @@ TEST(GlonassGnavEphemerisTest, ComputeGlonassTime) expected_gtime = gtime.time_of_day(); // Perform assertions of decoded fields - ASSERT_TRUE(expected_gdate.year() - d.year() < FLT_EPSILON ); - ASSERT_TRUE(expected_gdate.month() - d.month() < FLT_EPSILON ); - ASSERT_TRUE(expected_gdate.day() - d.day() < FLT_EPSILON ); - ASSERT_TRUE(expected_gtime.hours() - t.hours() < FLT_EPSILON ); - ASSERT_TRUE(expected_gtime.minutes() - t.minutes() < FLT_EPSILON ); - ASSERT_TRUE(expected_gtime.seconds() - t.seconds() < FLT_EPSILON ); + ASSERT_TRUE(expected_gdate.year() - d.year() < FLT_EPSILON); + ASSERT_TRUE(expected_gdate.month() - d.month() < FLT_EPSILON); + ASSERT_TRUE(expected_gdate.day() - d.day() < FLT_EPSILON); + ASSERT_TRUE(expected_gtime.hours() - t.hours() < FLT_EPSILON); + ASSERT_TRUE(expected_gtime.minutes() - t.minutes() < FLT_EPSILON); + ASSERT_TRUE(expected_gtime.seconds() - t.seconds() < FLT_EPSILON); } @@ -70,21 +70,21 @@ TEST(GlonassGnavEphemerisTest, ConvertGlonassT2GpsT1) { Glonass_Gnav_Ephemeris gnav_eph; gnav_eph.d_yr = 2004; - gnav_eph.d_N_T = 366+28; + gnav_eph.d_N_T = 366 + 28; - double glo2utc = 3600*3; + double glo2utc = 3600 * 3; double tod = 48600; double week = 0.0; double tow = 0.0; double true_leap_sec = 13; double true_week = 1307; - double true_tow = 480600+true_leap_sec; + double true_tow = 480600 + true_leap_sec; gnav_eph.glot_to_gpst(tod + glo2utc, 0.0, 0.0, &week, &tow); // Perform assertions of decoded fields - ASSERT_TRUE(week - true_week < FLT_EPSILON ); - ASSERT_TRUE(tow - true_tow < FLT_EPSILON ); + ASSERT_TRUE(week - true_week < FLT_EPSILON); + ASSERT_TRUE(tow - true_tow < FLT_EPSILON); } @@ -98,19 +98,19 @@ TEST(GlonassGnavEphemerisTest, ConvertGlonassT2GpsT2) gnav_eph.d_yr = 2016; gnav_eph.d_N_T = 268; - double glo2utc = 3600*3; + double glo2utc = 3600 * 3; double tod = 7560; double week = 0.0; double tow = 0.0; double true_leap_sec = 17; double true_week = 1915; - double true_tow = 518400+true_leap_sec+tod; + double true_tow = 518400 + true_leap_sec + tod; gnav_eph.glot_to_gpst(tod + glo2utc, 0.0, 0.0, &week, &tow); // Perform assertions of decoded fields - ASSERT_TRUE(week - true_week < FLT_EPSILON ); - ASSERT_TRUE(tow - true_tow < FLT_EPSILON ); + ASSERT_TRUE(week - true_week < FLT_EPSILON); + ASSERT_TRUE(tow - true_tow < FLT_EPSILON); } @@ -124,17 +124,17 @@ TEST(GlonassGnavEphemerisTest, ConvertGlonassT2GpsT3) gnav_eph.d_yr = 2016; gnav_eph.d_N_T = 62; - double glo2utc = 3600*3; + double glo2utc = 3600 * 3; double tod = 7560; double week = 0.0; double tow = 0.0; double true_leap_sec = 17; double true_week = 1886; - double true_tow = 259200+true_leap_sec+tod; + double true_tow = 259200 + true_leap_sec + tod; gnav_eph.glot_to_gpst(tod + glo2utc, 0.0, 0.0, &week, &tow); // Perform assertions of decoded fields - ASSERT_TRUE(week - true_week < FLT_EPSILON ); - ASSERT_TRUE(tow - true_tow < FLT_EPSILON ); + ASSERT_TRUE(week - true_week < FLT_EPSILON); + ASSERT_TRUE(tow - true_tow < FLT_EPSILON); } diff --git a/src/tests/unit-tests/system-parameters/glonass_gnav_nav_message_test.cc b/src/tests/unit-tests/system-parameters/glonass_gnav_nav_message_test.cc index e613af58a..34b159cb4 100644 --- a/src/tests/unit-tests/system-parameters/glonass_gnav_nav_message_test.cc +++ b/src/tests/unit-tests/system-parameters/glonass_gnav_nav_message_test.cc @@ -43,7 +43,7 @@ TEST(GlonassGnavNavigationMessageTest, CRCTestSuccess) { // Variables declarations in code bool test_result; - std::bitset string_bits (std::string ("0010100100001100000000000000000000000000110011110001100000000000000001100100011000000")); + std::bitset string_bits(std::string("0010100100001100000000000000000000000000110011110001100000000000000001100100011000000")); Glonass_Gnav_Navigation_Message gnav_nav_message; gnav_nav_message.reset(); @@ -65,7 +65,7 @@ TEST(GlonassGnavNavigationMessageTest, CRCTestFailure) // Variables declarations in code bool test_result; // Constructor of string to bitset will flip the order of the bits. Needed for CRC computation - std::bitset string_bits (std::string ("0111100100001100000000000000000000000000110011110001100000000000000001100100011000000")); + std::bitset string_bits(std::string("0111100100001100000000000000000000000000110011110001100000000000000001100100011000000")); Glonass_Gnav_Navigation_Message gnav_nav_message; gnav_nav_message.reset(); @@ -92,21 +92,21 @@ TEST(GlonassGnavNavigationMessageTest, String1Decoder) Glonass_Gnav_Ephemeris gnav_ephemeris; // Fill out ephemeris values for truth - gnav_ephemeris.d_P_1 = 15; - gnav_ephemeris.d_t_k = 7560; - gnav_ephemeris.d_VXn = -0.490900039672852; - gnav_ephemeris.d_AXn = 0; - gnav_ephemeris.d_Xn = -11025.6669921875; + gnav_ephemeris.d_P_1 = 15; + gnav_ephemeris.d_t_k = 7560; + gnav_ephemeris.d_VXn = -0.490900039672852; + gnav_ephemeris.d_AXn = 0; + gnav_ephemeris.d_Xn = -11025.6669921875; // Call target test method gnav_nav_message.string_decoder(str1); // Perform assertions of decoded fields - ASSERT_TRUE(gnav_ephemeris.d_P_1 - gnav_nav_message.gnav_ephemeris.d_P_1 < FLT_EPSILON ); - ASSERT_TRUE(gnav_ephemeris.d_t_k - gnav_nav_message.gnav_ephemeris.d_t_k < FLT_EPSILON ); - ASSERT_TRUE(gnav_ephemeris.d_VXn - gnav_nav_message.gnav_ephemeris.d_VXn < FLT_EPSILON ); - ASSERT_TRUE(gnav_ephemeris.d_AXn - gnav_nav_message.gnav_ephemeris.d_AXn < FLT_EPSILON ); - ASSERT_TRUE(gnav_ephemeris.d_Xn - gnav_nav_message.gnav_ephemeris.d_Xn < FLT_EPSILON ); + ASSERT_TRUE(gnav_ephemeris.d_P_1 - gnav_nav_message.gnav_ephemeris.d_P_1 < FLT_EPSILON); + ASSERT_TRUE(gnav_ephemeris.d_t_k - gnav_nav_message.gnav_ephemeris.d_t_k < FLT_EPSILON); + ASSERT_TRUE(gnav_ephemeris.d_VXn - gnav_nav_message.gnav_ephemeris.d_VXn < FLT_EPSILON); + ASSERT_TRUE(gnav_ephemeris.d_AXn - gnav_nav_message.gnav_ephemeris.d_AXn < FLT_EPSILON); + ASSERT_TRUE(gnav_ephemeris.d_Xn - gnav_nav_message.gnav_ephemeris.d_Xn < FLT_EPSILON); } @@ -130,7 +130,7 @@ TEST(GlonassGnavNavigationMessageTest, String2Decoder) gnav_ephemeris.d_t_b = 8100; gnav_ephemeris.d_VYn = -2.69022750854492; gnav_ephemeris.d_AYn = 0; - gnav_ephemeris.d_Yn = -11456.7348632812; + gnav_ephemeris.d_Yn = -11456.7348632812; // Call target test method gnav_nav_message.flag_ephemeris_str_1 = true; @@ -138,12 +138,12 @@ TEST(GlonassGnavNavigationMessageTest, String2Decoder) gnav_nav_message.string_decoder(str2); // Perform assertions of decoded fields - ASSERT_TRUE(gnav_ephemeris.d_B_n - gnav_nav_message.gnav_ephemeris.d_B_n < FLT_EPSILON ); - ASSERT_TRUE(gnav_ephemeris.d_P_2 - gnav_nav_message.gnav_ephemeris.d_P_2 < FLT_EPSILON ); - ASSERT_TRUE(gnav_ephemeris.d_t_b - gnav_nav_message.gnav_ephemeris.d_t_b < FLT_EPSILON ); - ASSERT_TRUE(gnav_ephemeris.d_VYn - gnav_nav_message.gnav_ephemeris.d_VYn < FLT_EPSILON ); - ASSERT_TRUE(gnav_ephemeris.d_AYn - gnav_nav_message.gnav_ephemeris.d_AYn < FLT_EPSILON ); - ASSERT_TRUE(gnav_ephemeris.d_Yn - gnav_nav_message.gnav_ephemeris.d_Yn < FLT_EPSILON ); + ASSERT_TRUE(gnav_ephemeris.d_B_n - gnav_nav_message.gnav_ephemeris.d_B_n < FLT_EPSILON); + ASSERT_TRUE(gnav_ephemeris.d_P_2 - gnav_nav_message.gnav_ephemeris.d_P_2 < FLT_EPSILON); + ASSERT_TRUE(gnav_ephemeris.d_t_b - gnav_nav_message.gnav_ephemeris.d_t_b < FLT_EPSILON); + ASSERT_TRUE(gnav_ephemeris.d_VYn - gnav_nav_message.gnav_ephemeris.d_VYn < FLT_EPSILON); + ASSERT_TRUE(gnav_ephemeris.d_AYn - gnav_nav_message.gnav_ephemeris.d_AYn < FLT_EPSILON); + ASSERT_TRUE(gnav_ephemeris.d_Yn - gnav_nav_message.gnav_ephemeris.d_Yn < FLT_EPSILON); } @@ -162,26 +162,26 @@ TEST(GlonassGnavNavigationMessageTest, String3Decoder) Glonass_Gnav_Ephemeris gnav_ephemeris; // Fill out ephemeris values for truth - gnav_ephemeris.d_P_3 = 1; - gnav_ephemeris.d_gamma_n = 1.81898940354586e-12; - gnav_ephemeris.d_P = 3; - gnav_ephemeris.d_l3rd_n = 0; - gnav_ephemeris.d_VZn = -1.82016849517822; - gnav_ephemeris.d_AZn = -2.79396772384644e-09; - gnav_ephemeris.d_Zn = 19929.2377929688; + gnav_ephemeris.d_P_3 = 1; + gnav_ephemeris.d_gamma_n = 1.81898940354586e-12; + gnav_ephemeris.d_P = 3; + gnav_ephemeris.d_l3rd_n = 0; + gnav_ephemeris.d_VZn = -1.82016849517822; + gnav_ephemeris.d_AZn = -2.79396772384644e-09; + gnav_ephemeris.d_Zn = 19929.2377929688; // Call target test method gnav_nav_message.flag_ephemeris_str_2 = true; gnav_nav_message.string_decoder(str3); // Perform assertions of decoded fields - ASSERT_TRUE(gnav_ephemeris.d_P_3 - gnav_nav_message.gnav_ephemeris.d_P_3 < FLT_EPSILON ); - ASSERT_TRUE(gnav_ephemeris.d_gamma_n - gnav_nav_message.gnav_ephemeris.d_gamma_n < FLT_EPSILON ); - ASSERT_TRUE(gnav_ephemeris.d_P - gnav_nav_message.gnav_ephemeris.d_P < FLT_EPSILON ); - ASSERT_TRUE(gnav_ephemeris.d_l3rd_n - gnav_nav_message.gnav_ephemeris.d_l3rd_n < FLT_EPSILON ); - ASSERT_TRUE(gnav_ephemeris.d_VZn - gnav_nav_message.gnav_ephemeris.d_VZn < FLT_EPSILON ); - ASSERT_TRUE(gnav_ephemeris.d_AZn - gnav_nav_message.gnav_ephemeris.d_AZn < FLT_EPSILON ); - ASSERT_TRUE(gnav_ephemeris.d_Zn - gnav_nav_message.gnav_ephemeris.d_Zn < FLT_EPSILON ); + ASSERT_TRUE(gnav_ephemeris.d_P_3 - gnav_nav_message.gnav_ephemeris.d_P_3 < FLT_EPSILON); + ASSERT_TRUE(gnav_ephemeris.d_gamma_n - gnav_nav_message.gnav_ephemeris.d_gamma_n < FLT_EPSILON); + ASSERT_TRUE(gnav_ephemeris.d_P - gnav_nav_message.gnav_ephemeris.d_P < FLT_EPSILON); + ASSERT_TRUE(gnav_ephemeris.d_l3rd_n - gnav_nav_message.gnav_ephemeris.d_l3rd_n < FLT_EPSILON); + ASSERT_TRUE(gnav_ephemeris.d_VZn - gnav_nav_message.gnav_ephemeris.d_VZn < FLT_EPSILON); + ASSERT_TRUE(gnav_ephemeris.d_AZn - gnav_nav_message.gnav_ephemeris.d_AZn < FLT_EPSILON); + ASSERT_TRUE(gnav_ephemeris.d_Zn - gnav_nav_message.gnav_ephemeris.d_Zn < FLT_EPSILON); } @@ -214,14 +214,14 @@ TEST(GlonassGnavNavigationMessageTest, String4Decoder) gnav_nav_message.string_decoder(str4); // Perform assertions of decoded fields - ASSERT_TRUE(gnav_ephemeris.d_tau_n - gnav_nav_message.gnav_ephemeris.d_tau_n < FLT_EPSILON ); - ASSERT_TRUE(gnav_ephemeris.d_Delta_tau_n - gnav_nav_message.gnav_ephemeris.d_Delta_tau_n < FLT_EPSILON ); - ASSERT_TRUE(gnav_ephemeris.d_E_n - gnav_nav_message.gnav_ephemeris.d_E_n < FLT_EPSILON ); - ASSERT_TRUE(gnav_ephemeris.d_P_4 - gnav_nav_message.gnav_ephemeris.d_P_4 < FLT_EPSILON ); - ASSERT_TRUE(gnav_ephemeris.d_F_T - gnav_nav_message.gnav_ephemeris.d_F_T < FLT_EPSILON ); - ASSERT_TRUE(gnav_ephemeris.d_N_T - gnav_nav_message.gnav_ephemeris.d_N_T < FLT_EPSILON ); - ASSERT_TRUE(gnav_ephemeris.d_n - gnav_nav_message.gnav_ephemeris.d_n < FLT_EPSILON ); - ASSERT_TRUE(gnav_ephemeris.d_M - gnav_nav_message.gnav_ephemeris.d_M < FLT_EPSILON ); + ASSERT_TRUE(gnav_ephemeris.d_tau_n - gnav_nav_message.gnav_ephemeris.d_tau_n < FLT_EPSILON); + ASSERT_TRUE(gnav_ephemeris.d_Delta_tau_n - gnav_nav_message.gnav_ephemeris.d_Delta_tau_n < FLT_EPSILON); + ASSERT_TRUE(gnav_ephemeris.d_E_n - gnav_nav_message.gnav_ephemeris.d_E_n < FLT_EPSILON); + ASSERT_TRUE(gnav_ephemeris.d_P_4 - gnav_nav_message.gnav_ephemeris.d_P_4 < FLT_EPSILON); + ASSERT_TRUE(gnav_ephemeris.d_F_T - gnav_nav_message.gnav_ephemeris.d_F_T < FLT_EPSILON); + ASSERT_TRUE(gnav_ephemeris.d_N_T - gnav_nav_message.gnav_ephemeris.d_N_T < FLT_EPSILON); + ASSERT_TRUE(gnav_ephemeris.d_n - gnav_nav_message.gnav_ephemeris.d_n < FLT_EPSILON); + ASSERT_TRUE(gnav_ephemeris.d_M - gnav_nav_message.gnav_ephemeris.d_M < FLT_EPSILON); } @@ -240,20 +240,20 @@ TEST(GlonassGnavNavigationMessageTest, String5Decoder) Glonass_Gnav_Utc_Model gnav_utc_model; // Fill out ephemeris values for truth - gnav_utc_model.d_N_A = 268; - gnav_utc_model.d_tau_c = 9.6391886472702e-08; - gnav_utc_model.d_N_4 = 6; - gnav_utc_model.d_tau_gps = 9.313225746154785e-08; + gnav_utc_model.d_N_A = 268; + gnav_utc_model.d_tau_c = 9.6391886472702e-08; + gnav_utc_model.d_N_4 = 6; + gnav_utc_model.d_tau_gps = 9.313225746154785e-08; // Call target test method gnav_nav_message.flag_ephemeris_str_4 = true; gnav_nav_message.string_decoder(str5); // Perform assertions of decoded fields - ASSERT_TRUE(gnav_utc_model.d_N_A - gnav_nav_message.gnav_utc_model.d_N_A < FLT_EPSILON ); - ASSERT_TRUE(gnav_utc_model.d_tau_c - gnav_nav_message.gnav_utc_model.d_tau_c < FLT_EPSILON ); - ASSERT_TRUE(gnav_utc_model.d_N_4 - gnav_nav_message.gnav_utc_model.d_N_4 < FLT_EPSILON ); - ASSERT_TRUE(gnav_utc_model.d_tau_gps - gnav_nav_message.gnav_utc_model.d_tau_gps < FLT_EPSILON ); + ASSERT_TRUE(gnav_utc_model.d_N_A - gnav_nav_message.gnav_utc_model.d_N_A < FLT_EPSILON); + ASSERT_TRUE(gnav_utc_model.d_tau_c - gnav_nav_message.gnav_utc_model.d_tau_c < FLT_EPSILON); + ASSERT_TRUE(gnav_utc_model.d_N_4 - gnav_nav_message.gnav_utc_model.d_N_4 < FLT_EPSILON); + ASSERT_TRUE(gnav_utc_model.d_tau_gps - gnav_nav_message.gnav_utc_model.d_tau_gps < FLT_EPSILON); } std::string str6("0011010100110100001100111100011100001101011000000110101111001000000101100011111011001"); diff --git a/src/utils/front-end-cal/front_end_cal.cc b/src/utils/front-end-cal/front_end_cal.cc index 506054363..eb025178d 100644 --- a/src/utils/front-end-cal/front_end_cal.cc +++ b/src/utils/front-end-cal/front_end_cal.cc @@ -53,11 +53,9 @@ extern concurrent_map global_gps_utc_model_map; extern concurrent_map global_gps_almanac_map; extern concurrent_map global_gps_acq_assist_map; -FrontEndCal::FrontEndCal() -{} +FrontEndCal::FrontEndCal() {} -FrontEndCal::~FrontEndCal() -{} +FrontEndCal::~FrontEndCal() {} bool FrontEndCal::read_assistance_from_XML() { @@ -67,10 +65,10 @@ bool FrontEndCal::read_assistance_from_XML() LOG(INFO) << "SUPL: Trying to read GPS ephemeris from XML file " << eph_xml_filename; if (supl_client_ephemeris_.load_ephemeris_xml(eph_xml_filename) == true) { - std::map::iterator gps_eph_iter; - for(gps_eph_iter = supl_client_ephemeris_.gps_ephemeris_map.begin(); - gps_eph_iter != supl_client_ephemeris_.gps_ephemeris_map.end(); - gps_eph_iter++) + std::map::iterator gps_eph_iter; + for (gps_eph_iter = supl_client_ephemeris_.gps_ephemeris_map.begin(); + gps_eph_iter != supl_client_ephemeris_.gps_ephemeris_map.end(); + gps_eph_iter++) { std::cout << "SUPL: Read XML Ephemeris for GPS SV " << gps_eph_iter->first << std::endl; LOG(INFO) << "SUPL: Read XML Ephemeris for GPS SV " << gps_eph_iter->first; @@ -87,15 +85,16 @@ bool FrontEndCal::read_assistance_from_XML() } } + int FrontEndCal::Get_SUPL_Assist() { //######### GNSS Assistance ################################# gnss_sdr_supl_client supl_client_acquisition_; gnss_sdr_supl_client supl_client_ephemeris_; - int supl_mcc; // Current network MCC (Mobile country code), 3 digits. - int supl_mns; //Current network MNC (Mobile Network code), 2 or 3 digits. - int supl_lac; // Current network LAC (Location area code),16 bits, 1-65520 are valid values. - int supl_ci; // Cell Identity (16 bits, 0-65535 are valid values). + int supl_mcc; // Current network MCC (Mobile country code), 3 digits. + int supl_mns; //Current network MNC (Mobile Network code), 2 or 3 digits. + int supl_lac; // Current network LAC (Location area code),16 bits, 1-65520 are valid values. + int supl_ci; // Cell Identity (16 bits, 0-65535 are valid values). // GNSS Assistance configuration int error = 0; @@ -116,21 +115,21 @@ int FrontEndCal::Get_SUPL_Assist() std::string default_lac = "0x59e2"; std::string default_ci = "0x31b0"; try - { + { supl_lac = boost::lexical_cast(configuration_->property("GNSS-SDR.SUPL_LAC", default_lac)); - } - catch(boost::bad_lexical_cast &) - { + } + catch (boost::bad_lexical_cast &) + { supl_lac = 0x59e2; - } + } try - { + { supl_ci = boost::lexical_cast(configuration_->property("GNSS-SDR.SUPL_CI", default_ci)); - } - catch(boost::bad_lexical_cast &) - { + } + catch (boost::bad_lexical_cast &) + { supl_ci = 0x31b0; - } + } bool SUPL_read_gps_assistance_xml = configuration_->property("GNSS-SDR.SUPL_read_gps_assistance_xml", false); if (SUPL_read_gps_assistance_xml == true) @@ -147,21 +146,21 @@ int FrontEndCal::Get_SUPL_Assist() error = supl_client_ephemeris_.get_assistance(supl_mcc, supl_mns, supl_lac, supl_ci); if (error == 0) { - std::map::iterator gps_eph_iter; - for(gps_eph_iter = supl_client_ephemeris_.gps_ephemeris_map.begin(); - gps_eph_iter != supl_client_ephemeris_.gps_ephemeris_map.end(); - gps_eph_iter++) + std::map::iterator gps_eph_iter; + for (gps_eph_iter = supl_client_ephemeris_.gps_ephemeris_map.begin(); + gps_eph_iter != supl_client_ephemeris_.gps_ephemeris_map.end(); + gps_eph_iter++) { - LOG(INFO) << "SUPL: Received Ephemeris for GPS SV " << gps_eph_iter->first; + LOG(INFO) << "SUPL: Received Ephemeris for GPS SV " << gps_eph_iter->first; std::cout << "SUPL: Received Ephemeris for GPS SV " << gps_eph_iter->first << std::endl; - LOG(INFO) << "New Ephemeris record inserted with Toe=" << gps_eph_iter->second.d_Toe << " and GPS Week=" << gps_eph_iter->second.i_GPS_week; + LOG(INFO) << "New Ephemeris record inserted with Toe=" << gps_eph_iter->second.d_Toe << " and GPS Week=" << gps_eph_iter->second.i_GPS_week; global_gps_ephemeris_map.write(gps_eph_iter->second.i_satellite_PRN, gps_eph_iter->second); } //Save ephemeris to XML file std::string eph_xml_filename = configuration_->property("GNSS-SDR.SUPL_gps_ephemeris_xml", eph_default_xml_filename); if (supl_client_ephemeris_.save_ephemeris_map_xml(eph_xml_filename, supl_client_ephemeris_.gps_ephemeris_map) == true) { - LOG(INFO) << "SUPL: XML Ephemeris file created."; + LOG(INFO) << "SUPL: XML Ephemeris file created."; } } else @@ -176,10 +175,10 @@ int FrontEndCal::Get_SUPL_Assist() error = supl_client_ephemeris_.get_assistance(supl_mcc, supl_mns, supl_lac, supl_ci); if (error == 0) { - std::map::iterator gps_alm_iter; - for(gps_alm_iter = supl_client_ephemeris_.gps_almanac_map.begin(); - gps_alm_iter != supl_client_ephemeris_.gps_almanac_map.end(); - gps_alm_iter++) + std::map::iterator gps_alm_iter; + for (gps_alm_iter = supl_client_ephemeris_.gps_almanac_map.begin(); + gps_alm_iter != supl_client_ephemeris_.gps_almanac_map.end(); + gps_alm_iter++) { LOG(INFO) << "SUPL: Received Almanac for GPS SV " << gps_alm_iter->first; std::cout << "SUPL: Received Almanac for GPS SV " << gps_alm_iter->first << std::endl; @@ -189,11 +188,11 @@ int FrontEndCal::Get_SUPL_Assist() { LOG(INFO) << "SUPL: Received GPS Iono"; std::cout << "SUPL: Received GPS Iono" << std::endl; - global_gps_iono_map.write(0,supl_client_ephemeris_.gps_iono); + global_gps_iono_map.write(0, supl_client_ephemeris_.gps_iono); } if (supl_client_ephemeris_.gps_utc.valid == true) { - LOG(INFO) << "SUPL: Received GPS UTC Model"; + LOG(INFO) << "SUPL: Received GPS UTC Model"; std::cout << "SUPL: Received GPS UTC Model" << std::endl; global_gps_utc_model_map.write(0, supl_client_ephemeris_.gps_utc); } @@ -212,10 +211,10 @@ int FrontEndCal::Get_SUPL_Assist() error = supl_client_acquisition_.get_assistance(supl_mcc, supl_mns, supl_lac, supl_ci); if (error == 0) { - std::map::iterator gps_acq_iter; - for(gps_acq_iter = supl_client_acquisition_.gps_acq_map.begin(); - gps_acq_iter != supl_client_acquisition_.gps_acq_map.end(); - gps_acq_iter++) + std::map::iterator gps_acq_iter; + for (gps_acq_iter = supl_client_acquisition_.gps_acq_map.begin(); + gps_acq_iter != supl_client_acquisition_.gps_acq_map.end(); + gps_acq_iter++) { LOG(INFO) << "SUPL: Received Acquisition assistance for GPS SV " << gps_acq_iter->first; std::cout << "SUPL: Received Acquisition assistance for GPS SV " << gps_acq_iter->first << std::endl; @@ -246,7 +245,7 @@ bool FrontEndCal::get_ephemeris() if (read_ephemeris_from_xml == true) { - std::cout << "Trying to read ephemeris from XML file..." << std::endl; + std::cout << "Trying to read ephemeris from XML file..." << std::endl; LOG(INFO) << "Trying to read ephemeris from XML file..."; if (read_assistance_from_XML() == false) { @@ -282,7 +281,7 @@ bool FrontEndCal::get_ephemeris() } -arma::vec FrontEndCal::lla2ecef(const arma::vec & lla) +arma::vec FrontEndCal::lla2ecef(const arma::vec &lla) { // WGS84 flattening double f = 1.0 / 298.257223563; @@ -295,7 +294,7 @@ arma::vec FrontEndCal::lla2ecef(const arma::vec & lla) double lambda = (lla(1) / 360.0) * GPS_TWO_PI; ellipsoid(0) = R; - ellipsoid(1) = sqrt(1.0 - (1.0 - f)*(1.0 - f)); + ellipsoid(1) = sqrt(1.0 - (1.0 - f) * (1.0 - f)); arma::vec ecef = "0.0 0.0 0.0 0.0"; ecef = geodetic2ecef(phi, lambda, lla(3), ellipsoid); @@ -304,18 +303,18 @@ arma::vec FrontEndCal::lla2ecef(const arma::vec & lla) } -arma::vec FrontEndCal::geodetic2ecef(double phi, double lambda, double h, const arma::vec & ellipsoid) +arma::vec FrontEndCal::geodetic2ecef(double phi, double lambda, double h, const arma::vec &ellipsoid) { double a = ellipsoid(0); - double e2 = ellipsoid(1)*ellipsoid(1); + double e2 = ellipsoid(1) * ellipsoid(1); double sinphi = sin(phi); double cosphi = cos(phi); - double N = a / sqrt(1.0 - e2 * sinphi*sinphi); + double N = a / sqrt(1.0 - e2 * sinphi * sinphi); arma::vec ecef = "0.0 0.0 0.0 0.0"; ecef(0) = (N + h) * cosphi * cos(lambda); ecef(1) = (N + h) * cosphi * sin(lambda); - ecef(2) = (N*(1.0 - e2) + h) * sinphi; + ecef(2) = (N * (1.0 - e2) + h) * sinphi; return ecef; } @@ -335,22 +334,22 @@ double FrontEndCal::estimate_doppler_from_eph(unsigned int PRN, double TOW, doub obs_ecef = lla2ecef(lla); // Satellite positions ECEF - std::map eph_map; + std::map eph_map; eph_map = global_gps_ephemeris_map.get_map_copy(); - std::map::iterator eph_it; + std::map::iterator eph_it; eph_it = eph_map.find(PRN); - if (eph_it!=eph_map.end()) + if (eph_it != eph_map.end()) { arma::vec SV_pos_ecef = "0.0 0.0 0.0 0.0"; double obs_time_start, obs_time_stop; - obs_time_start = TOW - num_secs/2; - obs_time_stop = TOW + num_secs/2; - int n_points = round((obs_time_stop - obs_time_start)/step_secs); + obs_time_start = TOW - num_secs / 2; + obs_time_stop = TOW + num_secs / 2; + int n_points = round((obs_time_stop - obs_time_start) / step_secs); arma::vec ranges = arma::zeros(n_points, 1); double obs_time = obs_time_start; - for (int i=0; isecond.satellitePosition(obs_time); SV_pos_ecef(0) = eph_it->second.d_satpos_X; @@ -364,7 +363,7 @@ double FrontEndCal::estimate_doppler_from_eph(unsigned int PRN, double TOW, doub // Numeric derivative: Positive slope means that the distance from obs to // satellite is increasing arma::vec obs_to_sat_velocity; - obs_to_sat_velocity = (ranges.subvec(1, (n_points - 1)) - ranges.subvec(0, (n_points - 2)))/step_secs; + obs_to_sat_velocity = (ranges.subvec(1, (n_points - 1)) - ranges.subvec(0, (n_points - 2))) / step_secs; // Doppler equations are formulated accounting for positive velocities if the // tx and rx are approaching to each other. So, the satellite velocity must // be redefined as: @@ -372,7 +371,7 @@ double FrontEndCal::estimate_doppler_from_eph(unsigned int PRN, double TOW, doub //Doppler estimation arma::vec Doppler_Hz; - Doppler_Hz = (obs_to_sat_velocity/GPS_C_m_s)*GPS_L1_FREQ_HZ; + Doppler_Hz = (obs_to_sat_velocity / GPS_C_m_s) * GPS_L1_FREQ_HZ; double mean_Doppler_Hz; mean_Doppler_Hz = arma::mean(Doppler_Hz); return mean_Doppler_Hz; @@ -394,22 +393,20 @@ void FrontEndCal::GPS_L1_front_end_model_E4000(double f_bb_true_Hz, double f_bb_ const double R = 2.0; // Obtained RF center frequency - double f_rf_pll = (f_osc_n * (N + X / Y)) /R; + double f_rf_pll = (f_osc_n * (N + X / Y)) / R; // RF frequency error caused by fractional PLL roundings double f_bb_err_pll = GPS_L1_FREQ_HZ - f_rf_pll; // Measured F_rf error double f_rf_err = (f_bb_meas_Hz - f_bb_true_Hz) - f_bb_err_pll; - double f_osc_err_hz = (f_rf_err*R)/(N+X/Y); + double f_osc_err_hz = (f_rf_err * R) / (N + X / Y); // OJO,segun los datos gnss, la IF positiva hace disminuir la fs!! f_osc_err_hz = -f_osc_err_hz; - *f_osc_err_ppm = f_osc_err_hz/(f_osc_n/1e6); + *f_osc_err_ppm = f_osc_err_hz / (f_osc_n / 1e6); - double frac = fs_nominal_hz/f_osc_n; - *estimated_fs_Hz = frac*(f_osc_n + f_osc_err_hz); + double frac = fs_nominal_hz / f_osc_n; + *estimated_fs_Hz = frac * (f_osc_n + f_osc_err_hz); *estimated_f_if_Hz = f_rf_err; } - - diff --git a/src/utils/front-end-cal/front_end_cal.h b/src/utils/front-end-cal/front_end_cal.h index 51581b6b4..b1b60fa17 100644 --- a/src/utils/front-end-cal/front_end_cal.h +++ b/src/utils/front-end-cal/front_end_cal.h @@ -49,7 +49,7 @@ private: * coordinates, P. LLA is in [degrees degrees meters]. P is in meters. * The default ellipsoid planet is WGS84. Original copyright (c) by Kai Borre. */ - arma::vec lla2ecef(const arma::vec & lla); + arma::vec lla2ecef(const arma::vec &lla); /*! * GEODETIC2ECEF Convert geodetic to geocentric (ECEF) coordinates * [X, Y, Z] = GEODETIC2ECEF(PHI, LAMBDA, H, ELLIPSOID) converts geodetic @@ -80,7 +80,7 @@ private: * Paul R. Wolf and Bon A. Dewitt, "Elements of Photogrammetry with * Applications in GIS," 3rd Ed., McGraw-Hill, 2000 (Appendix F-3). */ - arma::vec geodetic2ecef(double phi, double lambda, double h, const arma::vec & ellipsoid); + arma::vec geodetic2ecef(double phi, double lambda, double h, const arma::vec &ellipsoid); /*! * \brief Reads the ephemeris data from an external XML file * @@ -132,7 +132,7 @@ public: * Front-end TUNER Elonics E4000 + RTL2832 sampler For GPS L1 1575.42 MHz * */ - void GPS_L1_front_end_model_E4000(double f_bb_true_Hz,double f_bb_meas_Hz,double fs_nominal_hz, double *estimated_fs_Hz, double *estimated_f_if_Hz, double *f_osc_err_ppm ); + void GPS_L1_front_end_model_E4000(double f_bb_true_Hz, double f_bb_meas_Hz, double fs_nominal_hz, double *estimated_fs_Hz, double *estimated_f_if_Hz, double *f_osc_err_ppm); FrontEndCal(); ~FrontEndCal(); diff --git a/src/utils/front-end-cal/main.cc b/src/utils/front-end-cal/main.cc index a482e29ce..70408c67a 100644 --- a/src/utils/front-end-cal/main.cc +++ b/src/utils/front-end-cal/main.cc @@ -68,7 +68,7 @@ #include #include #include -#include // for ctime +#include // for ctime #include #include #include @@ -87,8 +87,8 @@ concurrent_map global_gps_acq_assist_map; bool stop; concurrent_queue channel_internal_queue; -GpsL1CaPcpsAcquisitionFineDoppler *acquisition; -Gnss_Synchro *gnss_synchro; +GpsL1CaPcpsAcquisitionFineDoppler* acquisition; +Gnss_Synchro* gnss_synchro; std::vector gnss_sync_vector; @@ -109,7 +109,7 @@ private: public: int rx_message; - ~FrontEndCal_msg_rx(); //!< Default destructor + ~FrontEndCal_msg_rx(); //!< Default destructor }; @@ -122,29 +122,29 @@ FrontEndCal_msg_rx_sptr FrontEndCal_msg_rx_make() void FrontEndCal_msg_rx::msg_handler_events(pmt::pmt_t msg) { try - { + { long int message = pmt::to_long(msg); rx_message = message; channel_internal_queue.push(rx_message); - } - catch(boost::bad_any_cast& e) - { + } + catch (boost::bad_any_cast& e) + { LOG(WARNING) << "msg_handler_telemetry Bad any cast!\n"; rx_message = 0; - } + } } -FrontEndCal_msg_rx::FrontEndCal_msg_rx() : - gr::block("FrontEndCal_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0)) +FrontEndCal_msg_rx::FrontEndCal_msg_rx() : gr::block("FrontEndCal_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0)) { this->message_port_register_in(pmt::mp("events")); this->set_msg_handler(pmt::mp("events"), boost::bind(&FrontEndCal_msg_rx::msg_handler_events, this, _1)); rx_message = 0; } -FrontEndCal_msg_rx::~FrontEndCal_msg_rx() -{} + +FrontEndCal_msg_rx::~FrontEndCal_msg_rx() {} + // ########################################################### @@ -156,20 +156,20 @@ void wait_message() channel_internal_queue.wait_and_pop(message); //std::cout<<"Acq mesage rx="<reset(); - break; - case 2: // negative acq - //acquisition->reset(); - break; - case 3: - stop = true; - break; - default: - break; - } + { + case 1: // Positive acq + gnss_sync_vector.push_back(*gnss_synchro); + //acquisition->reset(); + break; + case 2: // negative acq + //acquisition->reset(); + break; + case 3: + stop = true; + break; + default: + break; + } } } @@ -180,47 +180,46 @@ bool front_end_capture(std::shared_ptr configuration) GNSSBlockFactory block_factory; boost::shared_ptr queue; - queue = gr::msg_queue::make(0); + queue = gr::msg_queue::make(0); top_block = gr::make_top_block("Acquisition test"); std::shared_ptr source; try - { + { source = block_factory.GetSignalSource(configuration, queue); - } - catch(const boost::exception_ptr & e) - { + } + catch (const boost::exception_ptr& e) + { std::cout << "Exception caught in creating source " << e << std::endl; return 0; - } + } std::shared_ptr conditioner; try - { + { conditioner = block_factory.GetSignalConditioner(configuration); - } - catch(const boost::exception_ptr & e) - { + } + catch (const boost::exception_ptr& e) + { std::cout << "Exception caught in creating signal conditioner " << e << std::endl; return 0; - } + } gr::block_sptr sink; sink = gr::blocks::file_sink::make(sizeof(gr_complex), "tmp_capture.dat"); //--- Find number of samples per spreading code --- long fs_in_ = configuration->property("GNSS-SDR.internal_fs_sps", 2048000); - int samples_per_code = round(fs_in_ - / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS)); + int samples_per_code = round(fs_in_ / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS)); int nsamples = samples_per_code * 50; - int skip_samples = fs_in_ * 5; // skip 5 seconds + int skip_samples = fs_in_ * 5; // skip 5 seconds gr::block_sptr head = gr::blocks::head::make(sizeof(gr_complex), nsamples); gr::block_sptr skiphead = gr::blocks::skiphead::make(sizeof(gr_complex), skip_samples); try - { + { source->connect(top_block); conditioner->connect(top_block); top_block->connect(source->get_right_block(), 0, conditioner->get_left_block(), 0); @@ -228,12 +227,12 @@ bool front_end_capture(std::shared_ptr configuration) top_block->connect(skiphead, 0, head, 0); top_block->connect(head, 0, sink, 0); top_block->run(); - } - catch(const std::exception & e) - { + } + catch (const std::exception& e) + { std::cout << "Failure connecting the GNU Radio blocks " << e.what() << std::endl; return false; - } + } //delete conditioner; //delete source; @@ -241,7 +240,8 @@ bool front_end_capture(std::shared_ptr configuration) } -static time_t utc_time(int week, long tow) { +static time_t utc_time(int week, long tow) +{ time_t t; /* Jan 5/6 midnight 1980 - beginning of GPS time as Unix time */ @@ -260,13 +260,10 @@ static time_t utc_time(int week, long tow) { int main(int argc, char** argv) { const std::string intro_help( - std::string("\n RTL-SDR E4000 RF front-end center frequency and sampling rate calibration tool that uses GPS signals\n") - + - "Copyright (C) 2010-2017 (see AUTHORS file for a list of contributors)\n" - + - "This program comes with ABSOLUTELY NO WARRANTY;\n" - + - "See COPYING file to see a copy of the General Public License\n \n"); + std::string("\n RTL-SDR E4000 RF front-end center frequency and sampling rate calibration tool that uses GPS signals\n") + + "Copyright (C) 2010-2017 (see AUTHORS file for a list of contributors)\n" + + "This program comes with ABSOLUTELY NO WARRANTY;\n" + + "See COPYING file to see a copy of the General Public License\n \n"); google::SetUsageMessage(intro_help); google::SetVersionString(FRONT_END_CAL_VERSION); @@ -279,14 +276,14 @@ int main(int argc, char** argv) { std::cout << "Logging will be done at " - << "/tmp" - << std::endl - << "Use front-end-cal --log_dir=/path/to/log to change that." - << std::endl; + << "/tmp" + << std::endl + << "Use front-end-cal --log_dir=/path/to/log to change that." + << std::endl; } else { - const boost::filesystem::path p (FLAGS_log_dir); + const boost::filesystem::path p(FLAGS_log_dir); if (!boost::filesystem::exists(p)) { std::cout << "The path " @@ -317,12 +314,12 @@ int main(int argc, char** argv) } else { - std::cout << "Failure connecting to SUPL server" < Acquisition_10m) gr::top_block_sptr top_block; @@ -372,13 +369,14 @@ int main(int argc, char** argv) source = gr::blocks::file_source::make(sizeof(gr_complex), "tmp_capture.dat"); boost::shared_ptr msg_rx; try - { + { msg_rx = FrontEndCal_msg_rx_make(); - } - catch(const std::exception & e) - { - std::cout << "Failure connecting the message port system: " << e.what() << std::endl; exit(0); - } + } + catch (const std::exception& e) + { + std::cout << "Failure connecting the message port system: " << e.what() << std::endl; + exit(0); + } //gr_basic_block_sptr head = gr_make_head(sizeof(gr_complex), nsamples); //gr_head_sptr head_sptr = boost::dynamic_pointer_cast(head); @@ -386,23 +384,23 @@ int main(int argc, char** argv) //head_sptr->reset(); try - { + { acquisition->connect(top_block); top_block->connect(source, 0, acquisition->get_left_block(), 0); - top_block->msg_connect(acquisition->get_right_block(), pmt::mp("events"), msg_rx,pmt::mp("events")); - } - catch(const std::exception & e) - { + top_block->msg_connect(acquisition->get_right_block(), pmt::mp("events"), msg_rx, pmt::mp("events")); + } + catch (const std::exception& e) + { std::cout << "Failure connecting the GNU Radio blocks: " << e.what() << std::endl; - } + } // 5. Run the flowgraph // Get visible GPS satellites (positive acquisitions with Doppler measurements) // Compute Doppler estimations //todo: Fix the front-end cal to support new channel internal message system (no more external queues) - std::map doppler_measurements_map; - std::map cn0_measurements_map; + std::map doppler_measurements_map; + std::map cn0_measurements_map; boost::thread ch_thread; @@ -413,7 +411,7 @@ int main(int argc, char** argv) bool start_msg = true; - for (unsigned int PRN=1; PRN<33; PRN++) + for (unsigned int PRN = 1; PRN < 33; PRN++) { gnss_synchro->PRN = PRN; acquisition->set_gnss_synchro(gnss_synchro); @@ -422,13 +420,13 @@ int main(int argc, char** argv) acquisition->reset(); stop = false; try - { + { ch_thread = boost::thread(wait_message); - } - catch(const boost::thread_resource_error & e) - { + } + catch (const boost::thread_resource_error& e) + { LOG(INFO) << "Exception caught (thread resource error)"; - } + } top_block->run(); if (start_msg == true) { @@ -436,16 +434,16 @@ int main(int argc, char** argv) std::cout << "["; start_msg = false; } - if (gnss_sync_vector.size()>0) + if (gnss_sync_vector.size() > 0) { std::cout << " " << PRN << " "; double doppler_measurement_hz = 0; - for (std::vector::iterator it = gnss_sync_vector.begin() ; it != gnss_sync_vector.end(); ++it) + for (std::vector::iterator it = gnss_sync_vector.begin(); it != gnss_sync_vector.end(); ++it) { doppler_measurement_hz += (*it).Acq_doppler_hz; } - doppler_measurement_hz = doppler_measurement_hz/gnss_sync_vector.size(); - doppler_measurements_map.insert(std::pair(PRN, doppler_measurement_hz)); + doppler_measurement_hz = doppler_measurement_hz / gnss_sync_vector.size(); + doppler_measurements_map.insert(std::pair(PRN, doppler_measurement_hz)); } else { @@ -453,13 +451,13 @@ int main(int argc, char** argv) } channel_internal_queue.push(3); try - { + { ch_thread.join(); - } - catch(const boost::thread_resource_error & e) - { + } + catch (const boost::thread_resource_error& e) + { LOG(INFO) << "Exception caught while joining threads."; - } + } gnss_sync_vector.clear(); boost::dynamic_pointer_cast(source)->seek(0, 0); std::cout.flush(); @@ -478,7 +476,7 @@ int main(int argc, char** argv) double current_TOW = 0; if (global_gps_ephemeris_map.size() > 0) { - std::map Eph_map; + std::map Eph_map; Eph_map = global_gps_ephemeris_map.get_map_copy(); current_TOW = Eph_map.begin()->second.d_TOW; @@ -486,7 +484,7 @@ int main(int argc, char** argv) fprintf(stdout, "Reference Time:\n"); fprintf(stdout, " GPS Week: %d\n", Eph_map.begin()->second.i_GPS_week); - fprintf(stdout, " GPS TOW: %ld %lf\n", (long int)current_TOW, (long int)current_TOW*0.08); + fprintf(stdout, " GPS TOW: %ld %lf\n", (long int)current_TOW, (long int)current_TOW * 0.08); fprintf(stdout, " ~ UTC: %s", ctime(&t)); std::cout << "Current TOW obtained from SUPL assistance = " << current_TOW << std::endl; } @@ -521,43 +519,42 @@ int main(int argc, char** argv) return 0; } - std::map f_if_estimation_Hz_map; - std::map f_fs_estimation_Hz_map; - std::map f_ppm_estimation_Hz_map; + std::map f_if_estimation_Hz_map; + std::map f_fs_estimation_Hz_map; + std::map f_ppm_estimation_Hz_map; - std::cout << std::setiosflags(std::ios::fixed) << std::setprecision(2) << - "Doppler analysis results:" << std::endl; + std::cout << std::setiosflags(std::ios::fixed) << std::setprecision(2) << "Doppler analysis results:" << std::endl; std::cout << "SV ID Measured [Hz] Predicted [Hz]" << std::endl; - for (std::map::iterator it = doppler_measurements_map.begin() ; it != doppler_measurements_map.end(); ++it) + for (std::map::iterator it = doppler_measurements_map.begin(); it != doppler_measurements_map.end(); ++it) { try - { + { double doppler_estimated_hz; doppler_estimated_hz = front_end_cal.estimate_doppler_from_eph(it->first, current_TOW, lat_deg, lon_deg, altitude_m); std::cout << " " << it->first << " " << it->second << " " << doppler_estimated_hz << std::endl; // 7. Compute front-end IF and sampling frequency estimation // Compare with the measurements and compute clock drift using FE model double estimated_fs_Hz, estimated_f_if_Hz, f_osc_err_ppm; - front_end_cal.GPS_L1_front_end_model_E4000(doppler_estimated_hz, it->second,fs_in_, &estimated_fs_Hz, &estimated_f_if_Hz, &f_osc_err_ppm ); + front_end_cal.GPS_L1_front_end_model_E4000(doppler_estimated_hz, it->second, fs_in_, &estimated_fs_Hz, &estimated_f_if_Hz, &f_osc_err_ppm); - f_if_estimation_Hz_map.insert(std::pair(it->first,estimated_f_if_Hz)); - f_fs_estimation_Hz_map.insert(std::pair(it->first,estimated_fs_Hz)); - f_ppm_estimation_Hz_map.insert(std::pair(it->first,f_osc_err_ppm)); - } - catch(const std::logic_error & e) - { + f_if_estimation_Hz_map.insert(std::pair(it->first, estimated_f_if_Hz)); + f_fs_estimation_Hz_map.insert(std::pair(it->first, estimated_fs_Hz)); + f_ppm_estimation_Hz_map.insert(std::pair(it->first, f_osc_err_ppm)); + } + catch (const std::logic_error& e) + { std::cout << "Logic error caught: " << e.what() << std::endl; - } - catch(const boost::lock_error & e) - { + } + catch (const boost::lock_error& e) + { std::cout << "Exception caught while reading ephemeris" << std::endl; - } - catch(int ex) - { + } + catch (int ex) + { std::cout << " " << it->first << " " << it->second << " (Eph not found)" << std::endl; - } + } } // FINAL FE estimations @@ -566,7 +563,7 @@ int main(int argc, char** argv) double mean_osc_err_ppm = 0; int n_elements = f_if_estimation_Hz_map.size(); - for (std::map::iterator it = f_if_estimation_Hz_map.begin() ; it != f_if_estimation_Hz_map.end(); ++it) + for (std::map::iterator it = f_if_estimation_Hz_map.begin(); it != f_if_estimation_Hz_map.end(); ++it) { mean_f_if_Hz += (*it).second; mean_fs_Hz += f_fs_estimation_Hz_map.find((*it).first)->second; @@ -587,31 +584,28 @@ int main(int argc, char** argv) << "Corrected Doppler vs. Predicted" << std::endl; std::cout << "SV ID Corrected [Hz] Predicted [Hz]" << std::endl; - for (std::map::iterator it = doppler_measurements_map.begin() ; it != doppler_measurements_map.end(); ++it) + for (std::map::iterator it = doppler_measurements_map.begin(); it != doppler_measurements_map.end(); ++it) { try - { + { double doppler_estimated_hz; doppler_estimated_hz = front_end_cal.estimate_doppler_from_eph(it->first, current_TOW, lat_deg, lon_deg, altitude_m); - std::cout << " " << it->first << " " << it->second - mean_f_if_Hz << " " << doppler_estimated_hz << std::endl; - } - catch(const std::logic_error & e) - { + std::cout << " " << it->first << " " << it->second - mean_f_if_Hz << " " << doppler_estimated_hz << std::endl; + } + catch (const std::logic_error& e) + { std::cout << "Logic error caught: " << e.what() << std::endl; - } - catch(const boost::lock_error & e) - { + } + catch (const boost::lock_error& e) + { std::cout << "Exception caught while reading ephemeris" << std::endl; - } - catch(int ex) - { + } + catch (int ex) + { std::cout << " " << it->first << " " << it->second - mean_f_if_Hz << " (Eph not found)" << std::endl; - } + } } - // 8. Generate GNSS-SDR config file. - - delete acquisition; delete gnss_synchro; diff --git a/src/utils/gpstk/gnsspvt/src/kml_printer_gpstk.h b/src/utils/gpstk/gnsspvt/src/kml_printer_gpstk.h index f5d6dfeca..7d8e76cc4 100644 --- a/src/utils/gpstk/gnsspvt/src/kml_printer_gpstk.h +++ b/src/utils/gpstk/gnsspvt/src/kml_printer_gpstk.h @@ -32,7 +32,7 @@ #ifndef GNSS_SDR_KML_PRINTER_H_ -#define GNSS_SDR_KML_PRINTER_H_ +#define GNSS_SDR_KML_PRINTER_H_ #include #include @@ -48,6 +48,7 @@ class Kml_Printer_gpstk { private: std::ofstream kml_file; + public: bool set_headers(std::string filename); bool print_position(gpstk::Position position);